Skip to content

Commit

Permalink
chore: use lerna manage packages
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeLin committed Apr 30, 2021
1 parent 84df0e6 commit ceab1c0
Show file tree
Hide file tree
Showing 864 changed files with 35,069 additions and 13,741 deletions.
13 changes: 6 additions & 7 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
assets/
coverage/
dist/
es/
lib/
types/
node_modules/
packages/*/assets/
packages/*/coverage/
packages/*/dist/
packages/*/es/
packages/*/lib/
packages/*/types/
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
run: yarn

- name: build
run: npm run deploy:build
run: yarn deploy:build

- name: deploy
uses: peaceiris/actions-gh-pages@v2
Expand All @@ -25,6 +25,6 @@ jobs:
# PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./assets
PUBLISH_DIR: ./packages/site/assets
with:
emptyCommits: false
220 changes: 54 additions & 166 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ jobs:
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
run: yarn

compile:
setup-react-16:
runs-on: ubuntu-latest
env:
REACT: 16
steps:
- name: checkout
uses: actions/checkout@master
Expand All @@ -50,26 +52,11 @@ jobs:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}

- name: cache lib
uses: actions/cache@v2
with:
path: lib
key: lib-${{ github.sha }}

- name: cache es
uses: actions/cache@v2
with:
path: es
key: es-${{ github.sha }}

- name: compile
run: npm run build:lib && npm run build:es && npm run build:rn

# - name: check
# run: node ./tests/dekko/lib.test.js
- name: install react 16
run: lerna exec --scope zarm -- yarn install-react-16
needs: setup

lint:
compile:
runs-on: ubuntu-latest
steps:
- name: checkout
Expand All @@ -87,41 +74,23 @@ jobs:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}

- name: lint
run: npm run lint
needs: setup

react-17-dom:
name: [email protected] / dom
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master
with:
# codecov.io requires a fetch depth > 1.
fetch-depth: 2

- name: restore cache from yarn.lock
- name: cache lib
uses: actions/cache@v2
with:
path: package-temp-dir
key: lock-${{ github.sha }}
path: packages/zarm/lib
key: lib-${{ github.sha }}

- name: restore cache from node_modules
- name: cache es
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}
path: packages/zarm/es
key: es-${{ github.sha }}

- name: test
run: npm run test:h5 -- -c

- name: coverage
run: bash <(curl -s https://codecov.io/bash)
- name: compile
run: lerna exec --scope zarm -- yarn build:es && yarn build:lib
needs: setup

react-17-lib:
name: [email protected] / lib
compile-react-16:
runs-on: ubuntu-latest
steps:
- name: checkout
Expand All @@ -142,48 +111,20 @@ jobs:
- name: cache lib
uses: actions/cache@v2
with:
path: lib
path: packages/zarm/lib
key: lib-${{ github.sha }}

- name: test
run: npm run test:h5
env:
LIB_DIR: lib
needs: compile

react-17-es:
name: [email protected] / es
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master

- name: restore cache from yarn.lock
uses: actions/cache@v2
with:
path: package-temp-dir
key: lock-${{ github.sha }}

- name: restore cache from node_modules
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}

- name: cache es
uses: actions/cache@v2
with:
path: es
path: packages/zarm/es
key: es-${{ github.sha }}

- name: test
run: npm run test:h5
env:
LIB_DIR: es
needs: compile
- name: compile
run: lerna exec --scope zarm -- yarn build:es && yarn build:lib
needs: setup-react-16

react-17-dist:
name: [email protected] / dist
lint:
runs-on: ubuntu-latest
steps:
- name: checkout
Expand All @@ -201,33 +142,19 @@ jobs:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}

- name: dist
run: npm run build:umd
env:
NODE_OPTIONS: --max_old_space_size=4096

- name: check
run: node ./tests/dekko/dist.test.js

- name: bundlesize
run: npm run bundlesize
env:
BUNDLESIZE_GITHUB_TOKEN: ${{ secrets.BUNDLESIZE_GITHUB_TOKEN }}

- name: test
run: npm run test:h5
env:
LIB_DIR: dist
- name: lint
run: lerna exec --scope zarm -- yarn lint
needs: setup

react-16-dom:
name: react@16.x / dom
react-17:
name: react@17.x
runs-on: ubuntu-latest
env:
REACT: 16
steps:
- name: checkout
uses: actions/checkout@master
with:
# codecov.io requires a fetch depth > 1.
fetch-depth: 2

- name: restore cache from yarn.lock
uses: actions/cache@v2
Expand All @@ -241,18 +168,16 @@ jobs:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}

- name: install react 16
run: npm run install-react-16

- name: test
run: npm run test:h5
run: lerna exec --scope zarm -- yarn coverage

- name: coverage
run: bash <(curl -s https://codecov.io/bash)
needs: setup

react-16-lib:
name: react@16.x / lib
react-17-dist:
name: react@17.x / dist
runs-on: ubuntu-latest
env:
REACT: 16
steps:
- name: checkout
uses: actions/checkout@master
Expand All @@ -269,23 +194,22 @@ jobs:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}

- name: restore cache from lib
uses: actions/cache@v2
with:
path: lib
key: lib-${{ github.sha }}
- name: dist
run: lerna exec --scope zarm -- yarn build:umd
env:
NODE_OPTIONS: --max_old_space_size=4096

- name: install react 16
run: npm run install-react-16
- name: check
run: lerna exec --scope zarm -- node ./tests/dekko/dist.test.js

- name: test
run: npm run test:h5
- name: bundlesize
run: lerna exec --scope zarm -- yarn bundlesize
env:
LIB_DIR: lib
needs: compile
BUNDLESIZE_GITHUB_TOKEN: ${{ secrets.BUNDLESIZE_GITHUB_TOKEN }}
needs: setup

react-16-es:
name: [email protected] / es
react-16:
name: [email protected]
runs-on: ubuntu-latest
env:
REACT: 16
Expand All @@ -305,20 +229,12 @@ jobs:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}

- name: restore cache from es
uses: actions/cache@v2
with:
path: es
key: es-${{ github.sha }}

- name: install react 16
run: npm run install-react-16
run: lerna exec --scope zarm -- yarn install-react-16

- name: test
run: npm run test:h5
env:
LIB_DIR: es
needs: compile
run: lerna exec --scope zarm -- yarn test
needs: setup-react-16

react-16-dist:
name: [email protected] / dist
Expand All @@ -342,46 +258,18 @@ jobs:
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}

- name: install react 16
run: npm run install-react-16
run: lerna exec --scope zarm -- yarn install-react-16

- name: dist
run: npm run build:umd
run: lerna exec --scope zarm -- yarn build:umd
env:
NODE_OPTIONS: --max_old_space_size=4096

- name: check
run: node ./tests/dekko/dist.test.js
run: lerna exec --scope zarm -- node ./tests/dekko/dist.test.js

- name: bundlesize
run: npm run bundlesize
run: lerna exec --scope zarm -- yarn bundlesize
env:
BUNDLESIZE_GITHUB_TOKEN: ${{ secrets.BUNDLESIZE_GITHUB_TOKEN }}

- name: test
run: npm run test:h5
env:
LIB_DIR: dist
needs: setup

react-native:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master

- name: restore cache from yarn.lock
uses: actions/cache@v2
with:
path: package-temp-dir
key: lock-${{ github.sha }}

- name: restore cache from node_modules
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/yarn.lock') }}

- name: test
run: npm run test:rn
needs: setup

needs: setup-react-16
15 changes: 8 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ _book
*.iml
package-lock.json
/node_modules/
/packages/*/node_modules/

# bundle files
/assets/
/dist/
/es/
/lib/
/native/
/types/
/packages/*/assets/
/packages/*/dist/
/packages/*/es/
/packages/*/lib/
/packages/*/native/
/packages/*/types/

# test coverage
/coverage/
/packages/*/coverage/
6 changes: 6 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"packages": ["packages/*"],
"version": "0.0.0",
"npmClient": "yarn",
"useWorkspaces": true
}
9 changes: 0 additions & 9 deletions netlify.toml

This file was deleted.

Loading

0 comments on commit ceab1c0

Please sign in to comment.