Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(pnpm): migrate to pnpm v7 🎉 #1513

Merged
merged 5 commits into from
May 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ module.exports = {
"login",
"config",
"flat-rtc",
"pnpm",
],
],
"scope-case": [2, "always", ["lower-case", "kebab-case"]],
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/check-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,14 @@ jobs:
./packages/**/node_modules

- name: Install PNPM
uses: pnpm/action-setup@v2.0.1
uses: pnpm/action-setup@v2
with:
version: latest
run_install: false
version: 7

- name: Install changed package dependencies and build packages
run: |-
# failure automatically retries 3 times
pnpm install || pnpm install || pnpm install
pnpm i || pnpm i || pnpm i
env:
components: ${{ steps.filter.outputs.components }}
types: ${{ steps.filter.outputs.types }}
Expand All @@ -83,15 +82,15 @@ jobs:
flatWeb: ${{ steps.filter.outputs.flat-web }}

- name: Build renderer
run: pnpm --filter renderer-app build
run: pnpm -F renderer-app build
if: steps.filter.outputs.renderer == 'true'

- name: Build main
run: pnpm --filter flat build
run: pnpm -F flat build
if: steps.filter.outputs.main == 'true'

- name: Build flat-web
run: pnpm --filter flat-web build
run: pnpm -F flat-web build
env:
noLegacy: true
if: steps.filter.outputs.flat-web == 'true'
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/deploy-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,25 @@ jobs:
./packages/**/node_modules

- name: Install PNPM
uses: pnpm/action-setup@v2.0.1
uses: pnpm/action-setup@v2
with:
version: latest
run_install: false
version: 7

- name: Install dependencies
run: |-
# failure automatically retries 3 times
pnpm install || pnpm install || pnpm install
pnpm i || pnpm i || pnpm i
env:
components: true
if: steps.pnpm-cache.outputs.cache-hit != 'true'

- name: Build Types
# it must be added here, otherwise when the cache matches, there will be flat-types not found
run: pnpm --filter flat-types build
run: pnpm -F flat-types build
if: steps.pnpm-cache.outputs.cache-hit == 'true'

- name: Build Storybook
run: pnpm --filter flat-components build
run: pnpm -F flat-components build

- name: Deploy Storybook
uses: peaceiris/actions-gh-pages@v3
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/deploy-web-dev-cn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,19 @@ jobs:
uses: actions/checkout@v2

- name: Install PNPM
uses: pnpm/action-setup@v2.0.1
uses: pnpm/action-setup@v2
with:
version: latest
run_install: true
version: 7

- name: Install dependencies
run: |
node ./scripts/ci/remove-workspace-packages.js web
node ./scripts/ci/remove-package-scripts-hooks.js
# failure automatically retries 3 times
pnpm install || pnpm install || pnpm install
pnpm i || pnpm i || pnpm i

- name: Build flat web development
run: pnpm --filter flat-web build:cn -- -- -m development
run: pnpm -F flat-web build:cn -m development

- name: Log in to Docker Hub
uses: docker/login-action@v1
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/deploy-web-dev-us.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,19 @@ jobs:
uses: actions/checkout@v2

- name: Install PNPM
uses: pnpm/action-setup@v2.0.1
uses: pnpm/action-setup@v2
with:
version: latest
run_install: true
version: 7

- name: Install dependencies
run: |
node ./scripts/ci/remove-workspace-packages.js web
node ./scripts/ci/remove-package-scripts-hooks.js
# failure automatically retries 3 times
pnpm install || pnpm install || pnpm install
pnpm i || pnpm i || pnpm i

- name: Build flat web development
run: pnpm --filter flat-web build:us -- -- -m development
run: pnpm -F flat-web build:us -m development

- name: Log in to Docker Hub
uses: docker/login-action@v1
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/deploy-web-prod-cn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,19 @@ jobs:
uses: actions/checkout@v2

- name: Install PNPM
uses: pnpm/action-setup@v2.0.1
uses: pnpm/action-setup@v2
with:
version: latest
run_install: true
version: 7

- name: Install dependencies
run: |
node ./scripts/ci/remove-workspace-packages.js web
node ./scripts/ci/remove-package-scripts-hooks.js
# failure automatically retries 3 times
pnpm install || pnpm install || pnpm install
pnpm i || pnpm i || pnpm i

- name: Build flat web production
run: pnpm --filter flat-web build:cn -m production
run: pnpm -F flat-web build:cn -m production

- name: Log in to Docker Hub
uses: docker/login-action@v1
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/deploy-web-prod-us.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,19 @@ jobs:
uses: actions/checkout@v2

- name: Install PNPM
uses: pnpm/action-setup@v2.0.1
uses: pnpm/action-setup@v2
with:
version: latest
run_install: true
version: 7

- name: Install dependencies
run: |
node ./scripts/ci/remove-workspace-packages.js web
node ./scripts/ci/remove-package-scripts-hooks.js
# failure automatically retries 3 times
pnpm install || pnpm install || pnpm install
pnpm i || pnpm i || pnpm i

- name: Build flat web production
run: pnpm --filter flat-web build:us -m production
run: pnpm -F flat-web build:us -m production

- name: Log in to Docker Hub
uses: docker/login-action@v1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ You can build and run the Flat client without a server. This repository includes
Clone or fork this project, at project root run:

```bash
pnpm install
pnpm i
```

### Build and run Flat Electron client
Expand Down
9 changes: 9 additions & 0 deletions cspell.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ module.exports = {
"unpublish", // agora-rtc-sdk-ng
"multipass", // svgo
"allowlist", // webpack-node-externals
"Wyri", // WyriHaximus/github-action-helm3@v2
"Haximus", // WyriHaximus/github-action-helm3@v2
"dorny", // dorny/paths-filter@v2
"peaceiris", // peaceiris/actions-gh-pages@v3

// less
"isstring",
Expand Down Expand Up @@ -129,6 +133,8 @@ module.exports = {
"lintstagedrc",
"pnpm",
"emittery",
"APPVERSION",
"eslintignore",

// CNCF
"nindent",
Expand All @@ -139,6 +145,9 @@ module.exports = {
"Kube",
"agoraflat",
"applinks",
"dockerignore",
"DOCKERHUB",
"kubeconfig",

// readme
"customizational",
Expand Down
6 changes: 3 additions & 3 deletions docs/readme/README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
Clone 或者 fork 这个项目,在根目录执行:

```bash
pnpm install
pnpm i
```

### 构建并运行 Flat Electron 客户端
Expand All @@ -77,10 +77,10 @@ pnpm start
- 项目根目录执行 `pnpm ship` 将根据当前系统打包。
- 或者项目根目录执行 `pnpm ship:mac` 或 `pnpm ship:win` 可针对指定的系统打包。

> 如果你因为网络问题导致无法下载 `electron`,可在项目目录新建: `.npmrc` 文件,并写入 `ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/"` 内容。重新执行 `pnpm install` 即可。
> 如果你因为网络问题导致无法下载 `electron`,可在项目目录新建: `.npmrc` 文件,并写入 `ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/"` 内容。重新执行 `pnpm i` 即可。

```shell
pnpm install
pnpm i
```

### 构建并运行 Flat Web 客户端
Expand Down
23 changes: 14 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"postinstall": "husky install",
"lint": "lint-staged --cwd .",
"check-spelling": "cspell --no-progress \"**/*.{md,ts,tsx,js,css,less,json,yml,yaml,html,sh}\"",
"storybook": "pnpm --filter flat-components start",
"storybook": "pnpm -F flat-components start",
"start": "node scripts/launch/index.js",
"start:cn": "cross-env FLAT_REGION=CN node scripts/launch/index.js",
"start:us": "cross-env FLAT_REGION=US node scripts/launch/index.js",
"start:web": "pnpm --filter flat-web start",
"ship": "pnpm --filter renderer-app build && pnpm --filter flat ship",
"ship:mac": "pnpm --filter renderer-app build && pnpm --filter flat ship:mac",
"ship:win": "pnpm --filter renderer-app build && pnpm --filter flat ship:win",
"ship:all": "pnpm --filter renderer-app build && pnpm --filter flat ship:win && pnpm --filter flat pack:mac",
"start:web": "pnpm -F flat-web start",
"ship": "pnpm -F renderer-app build && pnpm -F flat ship",
"ship:mac": "pnpm -F renderer-app build && pnpm -F flat ship:mac",
"ship:win": "pnpm -F renderer-app build && pnpm -F flat ship:win",
"ship:all": "pnpm -F renderer-app build && pnpm -F flat ship:win && pnpm -F flat pack:mac",
"ship:cn:all": "cross-env FLAT_REGION=CN pnpm ship:all",
"ship:us:all": "cross-env FLAT_REGION=US pnpm ship:all"
},
Expand Down Expand Up @@ -62,7 +62,7 @@
"yaml": "^1.10.2"
},
"pnpm": {
"//": "don't worry, we will download it in the main-app/postinstall script.",
"//": "don't worry, we will download it in the @netless/flat-rtc-agora-electron -> postinstall script.",
"neverBuiltDependencies": [
"agora-electron-sdk"
],
Expand All @@ -78,7 +78,12 @@
"rollup",
"prop-types",
"react-refresh",
"react-scripts"
"react-scripts",
"webpack",
"vite",
"less",
"typescript",
"eslint"
],
"allowedVersions": {
"@storybook/theming": "~6.3.7",
Expand All @@ -93,5 +98,5 @@
"@types/eslint": "^8"
}
},
"packageManager": "pnpm@6.32.11"
"packageManager": "pnpm@7.0.0"
}
Loading