Skip to content

Commit

Permalink
feat: switch to pnpm (originjs#98)
Browse files Browse the repository at this point in the history
* chore: update license to SPDX identifier
* feat: switch to pnpm
  • Loading branch information
flyfishzy authored Nov 19, 2021
1 parent 5f37835 commit 3ec352a
Show file tree
Hide file tree
Showing 42 changed files with 8,429 additions and 22,955 deletions.
67 changes: 47 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,67 @@ jobs:
node_version: [12, 14, 16]
include:
- os: macos-latest
node_version: 14
node_version: 16
- os: windows-latest
node_version: 16
fail-fast: false

name: 'Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }}'
name: "Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }}"
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 6

- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- name: Set node version to ${{ matrix.node_version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node_version }}
cache: "pnpm"

- name: Get yarn cache directory
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Install deps
run: pnpm install

- name: Set dependencies cache
uses: actions/cache@v2
- name: Build vite-plugin-federation
run: pnpm run build

- name: Test build
run: pnpm run test

lint:
runs-on: ubuntu-latest
name: "Lint: node-16, ubuntu-latest"
steps:
- uses: actions/checkout@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('yarn.lock') }}
${{ runner.os }}-${{ matrix.node_version }}-
fetch-depth: 0

- name: Versions
run: yarn versions
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 6

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Set node version to 16
uses: actions/setup-node@v2
with:
node-version: 16
cache: "pnpm"

- name: Build
run: yarn build
- name: Install deps
run: pnpm install

- name: Test
run: yarn test
- name: Prepare
run: pnpm run build
- name: Lint
run: pnpm run lint
18 changes: 0 additions & 18 deletions appveyor.yml

This file was deleted.

12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
"node": ">=12.0.0"
},
"author": "@originjs",
"license": "MulanPSL2",
"license": "MulanPSL-2.0",
"scripts": {
"preinstall": "npx only-allow pnpm",
"format": "prettier -w .",
"lint": "eslint packages/*/{src,types}/**",
"lint:fix": "eslint --fix",
Expand All @@ -19,21 +20,24 @@
"test:e2e": "jest --runInBand --config ./jest.e2e.config.js"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^20.0.0",
"@types/jest": "^27.0.1",
"@types/node": "^15.12.2",
"@typescript-eslint/eslint-plugin": "^4.29.0",
"@typescript-eslint/parser": "^4.29.0",
"chalk": "^4.1.2",
"eslint": "^7.32.0",
"eslint-plugin-node": "^11.1.0",
"execa": "^5.1.1",
"fs-extra": "^10.0.0",
"jest": "^27.0.6",
"jest": "^27.3.1",
"jest-environment-node": "^27.3.1",
"kill-port": "^1.6.1",
"lint-staged": "^11.1.1",
"npm-run-all": "^4.1.5",
"playwright-chromium": "^1.14.0",
"prettier": "^2.3.2",
"rimraf": "^3.0.2",
"ts-jest": "^27.0.3",
"ts-jest": "^27.0.7",
"tslib": "^2.3.0",
"typescript": "^4.3.5",
"yorkie": "^2.0.0"
Expand Down
9 changes: 0 additions & 9 deletions packages/examples/basic-host-remote/lerna.json

This file was deleted.

15 changes: 5 additions & 10 deletions packages/examples/basic-host-remote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,15 @@
"name": "basic-host-remote",
"private": true,
"version": "1.0.0",
"workspaces": [
"rollup-host",
"rollup-remote"
],
"scripts": {
"build": "lerna run build --loglevel=error",
"serve": "lerna run serve --parallel --loglevel=silent",
"build": "pnpm run build -r --filter ./",
"serve": "pnpm run serve --parallel --filter ./",
"stop": "kill-port --port 5000,5001"
},
"license": "MulanPSL2",
"license": "MulanPSL-2.0",
"devDependencies": {
"@originjs/vite-plugin-federation": "link:../../lib",
"@originjs/vite-plugin-federation": "workspace:*",
"http-server": "^13.0.1",
"kill-port": "^1.6.1",
"lerna": "^4.0.0"
"kill-port": "^1.6.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"serve": "http-server . -p 5000 --cors='*'"
},
"devDependencies": {
"rollup": "^2.56.0"
"rollup": "^2.60.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"serve": "http-server ./dist -p 5001 --cors='*'"
},
"devDependencies": {
"rollup": "^2.56.0"
"rollup": "^2.60.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import federation from "@originjs/vite-plugin-federation";
import federation from '@originjs/vite-plugin-federation';

export default {
input: "src/index.js",
Expand Down
1 change: 0 additions & 1 deletion packages/examples/react-in-vue/home/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"react-dom": "^17.0.0"
},
"devDependencies": {
"kill-port": "^1.6.1",
"@vitejs/plugin-react-refresh": "^1.3.6",
"vite": "^2.5.0"
}
Expand Down
1 change: 0 additions & 1 deletion packages/examples/react-in-vue/layout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"react-dom": "^16.13.0"
},
"devDependencies": {
"kill-port": "^1.6.1",
"@vitejs/plugin-vue": "^1.3.0",
"vite": "^2.5.0"
}
Expand Down
9 changes: 0 additions & 9 deletions packages/examples/react-in-vue/lerna.json

This file was deleted.

9 changes: 4 additions & 5 deletions packages/examples/react-in-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@
"layout"
],
"scripts": {
"build": "lerna run build --loglevel=error",
"serve": "lerna run serve --parallel --loglevel=silent",
"build": "pnpm run build -r --filter ./",
"serve": "pnpm run serve --parallel --filter ./",
"stop": "kill-port --port 5000,5001"
},
"devDependencies": {
"@originjs/vite-plugin-federation": "link:../../lib",
"kill-port": "^1.6.1",
"lerna": "^4.0.0"
"@originjs/vite-plugin-federation": "workspace:*",
"kill-port": "^1.6.1"
}
}
2 changes: 1 addition & 1 deletion packages/examples/simple-react-esm/host-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@babel/preset-react": "^7.14.5",
"@rollup/plugin-commonjs": "^20.0.0",
"@rollup/plugin-node-resolve": "8.4.0",
"rollup": "^2.56.0",
"rollup": "^2.60.0",
"@rollup/plugin-replace": "^3.0.0",
"@rollup/plugin-babel": "^5.3.0"
}
Expand Down
9 changes: 0 additions & 9 deletions packages/examples/simple-react-esm/lerna.json

This file was deleted.

8 changes: 4 additions & 4 deletions packages/examples/simple-react-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
],
"license": "MIT",
"scripts": {
"build": "lerna run build --loglevel=error",
"serve": "lerna run serve --parallel --loglevel=silent",
"build": "pnpm run build -r --filter ./",
"serve": "pnpm run serve --parallel --filter ./",
"stop": "kill-port --port 5000,5001"
},
"devDependencies": {
"@originjs/vite-plugin-federation": "link:../../lib",
"@originjs/vite-plugin-federation": "workspace:*",
"http-server": "^13.0.1",
"kill-port": "^1.6.1",
"lerna": "^4.0.0"
"semver": "^7.3.5"
}
}

2 changes: 1 addition & 1 deletion packages/examples/simple-react-esm/remote-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@babel/preset-react": "^7.14.5",
"@rollup/plugin-commonjs": "^20.0.0",
"@rollup/plugin-node-resolve": "8.4.0",
"rollup": "^2.56.0",
"rollup": "^2.60.0",
"@rollup/plugin-replace": "^3.0.0",
"@rollup/plugin-babel": "^5.3.0"
}
Expand Down
Loading

0 comments on commit 3ec352a

Please sign in to comment.