Skip to content

Commit 8f35aca

Browse files
authored
[optimize] upgrade to Snabbdom v3 & Parcel v2 (#5)
1 parent 14618e1 commit 8f35aca

File tree

14 files changed

+12160
-77
lines changed

14 files changed

+12160
-77
lines changed

.eslintrc.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
"prettier"
2020
],
2121
"rules": {
22+
"no-var": "off",
2223
"no-unused-vars": "warn",
2324
"no-undef": "warn",
2425
"@typescript-eslint/ban-types": "warn",
26+
"@typescript-eslint/no-namespace": "warn",
2527
"@typescript-eslint/explicit-module-boundary-types": "off"
2628
}
2729
}

.github/workflows/main.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: CI & CD
22
on:
33
push:
4-
branches:
5-
- v2
4+
tags:
5+
- v*
66
jobs:
77
Build-and-Deploy:
88
runs-on: ubuntu-latest
@@ -12,14 +12,25 @@ jobs:
1212
- name: Use Node.js
1313
uses: actions/setup-node@v2
1414
with:
15-
node-version: '14'
16-
- name: Install & build
15+
node-version: 14
16+
registry-url: https://registry.npmjs.org
17+
cache: yarn
18+
- name: Install, Build & Publish
1719
run: |
18-
npm install
19-
npm run build
20-
- name: Deploy
20+
yarn
21+
yarn publish
22+
env:
23+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
24+
- name: Update document
2125
uses: peaceiris/actions-gh-pages@v3
2226
with:
2327
publish_dir: ./docs
2428
personal_token: ${{ secrets.GITHUB_TOKEN }}
2529
force_orphan: true
30+
- name: Publish Adapter
31+
run: |
32+
cd MobX/
33+
yarn
34+
yarn publish
35+
env:
36+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
node_modules/
22
package-lock.json
33
dist/
4-
.cache/
4+
.parcel-cache/
55
docs/
66
.vscode/

.npmignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
.eslintrc.json
2+
jest.config.ts
23
test/
3-
.cache/
4+
.parcel-cache/
45
Contributing.md
56
docs/
7+
.husky/
68
.github/
79
.vscode/
810
MobX/

MobX/package.json

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mobx-web-cell",
3-
"version": "0.3.5",
3+
"version": "0.4.0-rc.0",
44
"license": "LGPL-3.0",
55
"author": "[email protected]",
66
"description": "MobX adaptor for WebCell v2",
@@ -15,27 +15,34 @@
1515
"homepage": "https://github.com/EasyWebApp/WebCell/tree/v2/MobX",
1616
"source": "source/index.ts",
1717
"types": "dist/index.d.ts",
18-
"main": "dist/index.umd.js",
19-
"module": "dist/index.js",
18+
"main": "dist/index.js",
19+
"module": "dist/index.esm.js",
2020
"scripts": {
21-
"build": "microbundle --external web-cell,mobx --globals web-cell=WebCell --name mobxWebCell",
21+
"build": "rm -rf dist/ && parcel build source/index.ts",
2222
"test": "jest --forceExit",
23-
"prepublishOnly": "npm test && rm -rf .rts2_cache_* dist/ && npm run build"
23+
"prepublishOnly": "npm test && npm run build"
2424
},
2525
"dependencies": {
2626
"mobx": ">4.0.0 <6.0.0",
27-
"web-cell": "^2.3.0"
27+
"web-cell": "^2.4.0-rc.1"
2828
},
2929
"devDependencies": {
30-
"@types/jest": "^26.0.24",
31-
"@webcomponents/webcomponentsjs": "^2.5.0",
32-
"jest": "^27.0.6",
33-
"microbundle": "^0.13.3",
34-
"ts-jest": "^27.0.4",
35-
"typescript": "^4.3.5"
30+
"@parcel/packager-ts": "^2.2.1",
31+
"@types/jest": "^27.4.0",
32+
"@webcomponents/webcomponentsjs": "^2.6.0",
33+
"jest": "^27.4.7",
34+
"parcel": "^2.2.1",
35+
"ts-jest": "^27.1.3",
36+
"typescript": "~4.3.5"
3637
},
3738
"jest": {
3839
"testEnvironment": "jsdom",
3940
"preset": "ts-jest"
41+
},
42+
"browserslist": "> 0.5%, last 2 versions, not dead",
43+
"targets": {
44+
"main": {
45+
"optimize": true
46+
}
4047
}
4148
}

MobX/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"esModuleInterop": true,
44
"experimentalDecorators": true,
55
"jsx": "react",
6-
"jsxFactory": "createCell"
6+
"jsxFactory": "createCell",
7+
"lib": ["ES2021", "DOM"]
78
},
89
"include": ["./source/*"]
910
}

0 commit comments

Comments
 (0)