Skip to content

Commit 546e429

Browse files
committed
feat: add TS type defs
1 parent bd7ffad commit 546e429

30 files changed

+7472
-8495
lines changed

.babelrc.cjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* eslint-env node, es2018 */
2+
module.exports = function (api) {
3+
const base = require('@jcoreio/toolchain-esnext/.babelrc.cjs')(api)
4+
return {
5+
...base,
6+
}
7+
}

.babelrc.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

.circleci/config.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
version: 2
1+
# created by @jcoreio/toolchain-circle
2+
3+
version: 2.1
24
jobs:
35
build:
46
docker:
5-
- image: circleci/node:8
7+
- image: cimg/node:20.3.0
68

79
steps:
810
- checkout
9-
- restore_cache:
10-
name: Restore Yarn Package Cache
11-
keys:
12-
- v1-yarn-packages-{{ checksum "yarn.lock" }}
13-
1411
- run:
1512
name: Setup NPM Token
1613
command: |
17-
yarn config set registry "https://registry.npmjs.org/"
18-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
19-
echo "registry=https://registry.npmjs.org/" >> .npmrc
20-
14+
npm config set \
15+
"//registry.npmjs.org/:_authToken=$NPM_TOKEN" \
16+
"registry=https://registry.npmjs.org/"
2117
- run:
22-
name: Install Dependencies
23-
command: yarn install --frozen-lockfile
24-
- save_cache:
25-
name: Save Yarn Package Cache
26-
key: v1-yarn-packages-{{ checksum "yarn.lock" }}
27-
paths:
28-
- ~/.cache/yarn
29-
18+
name: Corepack enable
19+
command: sudo corepack enable
3020
- run:
31-
name: build
32-
command: yarn run prepublishOnly
21+
name: Install Dependencies
22+
command: pnpm install --frozen-lockfile
3323
- run:
34-
name: upload test coverage
35-
command: yarn codecov || true
24+
name: Prepublish
25+
command: |
26+
[[ $(netstat -tnlp | grep -F 'circleci-agent') ]] || pnpm run tc prepublish
3627
- run:
37-
name: release
38-
command: yarn run semantic-release || true
28+
name: Release
29+
command: |
30+
[[ $(netstat -tnlp | grep -F 'circleci-agent') ]] || pnpm run tc release
31+
32+
workflows:
33+
build:
34+
jobs:
35+
- build:
36+
context:
37+
- npm-release
38+
- github-release

.eslintrc

Lines changed: 0 additions & 13 deletions
This file was deleted.

.eslintrc.cjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* eslint-env node, es2018 */
2+
module.exports = {
3+
extends: [require.resolve('@jcoreio/toolchain/eslint.config.cjs')],
4+
env: {
5+
es6: true,
6+
},
7+
}

.flowconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
<PROJECT_ROOT>/node_modules/fbjs/.*
66
<PROJECT_ROOT>/node_modules/.*/fbjs/.*
77
<PROJECT_ROOT>/node_modules/.*/config-chain/.*
8+
<PROJECT_ROOT>/dist/.*
9+
.*/malformed_package_json/.*
810

911
[include]
1012
./src

.gitignore

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
coverage
1+
/dist
22
.nyc_output
33
node_modules
4-
lib
5-
es
6-
.eslintcache
7-
/*.js
8-
/*.js.flow
9-
!/.babelrc.js
4+
/coverage

.mocharc.cjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* eslint-env node, es2018 */
2+
const base = require('@jcoreio/toolchain-mocha/.mocharc.cjs')
3+
module.exports = {
4+
...base,
5+
}

.npmignore

Lines changed: 0 additions & 12 deletions
This file was deleted.

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ const reducer = combineReducers({
5454
```js
5555
const reducer = createReducer({
5656
[SET_USER]: (state, action) =>
57-
state.withMutations(state => {
58-
state.update('user', oldUser => setUser(oldUser, action))
59-
state.update('userChangeCount', count =>
57+
state.withMutations((state) => {
58+
state.update('user', (oldUser) => setUser(oldUser, action))
59+
state.update('userChangeCount', (count) =>
6060
incUserChangeCount(count, action)
6161
)
6262
}),
6363
[UPDATE_USER]: (state, action) =>
64-
state.update('user', user => updateUser(user, action)),
64+
state.update('user', (user) => updateUser(user, action)),
6565
})
6666
```
6767

@@ -77,12 +77,12 @@ import { combineReducers } from 'mindfront-redux-utils-immutable'
7777

7878
const reducer = combineReducers({
7979
a: createReducer(0, {
80-
a: state => state + 1,
81-
ab: state => state + 1,
80+
a: (state) => state + 1,
81+
ab: (state) => state + 1,
8282
}),
8383
b: createReducer(0, {
84-
ab: state => state + 1,
85-
b: state => state + 1,
84+
ab: (state) => state + 1,
85+
b: (state) => state + 1,
8686
}),
8787
})
8888

@@ -106,12 +106,12 @@ const MyRecord = Record({ a: 0, b: 0 })
106106
const reducer = combineReducers(
107107
{
108108
a: createReducer(0, {
109-
a: state => state + 1,
110-
ab: state => state + 1,
109+
a: (state) => state + 1,
110+
ab: (state) => state + 1,
111111
}),
112112
b: createReducer(0, {
113-
ab: state => state + 1,
114-
b: state => state + 1,
113+
ab: (state) => state + 1,
114+
b: (state) => state + 1,
115115
}),
116116
},
117117
MyRecord

githooks.cjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* eslint-env node, es2018 */
2+
const base = require('@jcoreio/toolchain/githooks.cjs')
3+
module.exports = {
4+
...base,
5+
}

lint-staged.config.cjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* eslint-env node, es2018 */
2+
const base = require('@jcoreio/toolchain/lint-staged.config.cjs')
3+
module.exports = {
4+
...base,
5+
}

nyc.config.cjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* eslint-env node, es2018 */
2+
const base = require('@jcoreio/toolchain-mocha/nyc.config.cjs')
3+
module.exports = {
4+
...base,
5+
}

0 commit comments

Comments
 (0)