Skip to content

chore: drop node 18 and pnpm 9, support node 22 and pnpm 10 #17582

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

Closed
wants to merge 9 commits into from
Closed
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
6 changes: 3 additions & 3 deletions .github/workflows/build-rust-binding.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [18.x]
node-version: [22.x]
settings:
- host: macos-13
target: x86_64-apple-darwin
Expand Down Expand Up @@ -47,9 +47,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v3.0.0
uses: pnpm/action-setup@v4
with:
version: 9
version: 10
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
if: ${{ !matrix.settings.docker }}
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ jobs:
name: Build Rust WASM
uses: ./.github/workflows/build-rust-wasm.yml

nodejs-tesing:
nodejs-testing:
name: Testing on Node.js ${{ matrix.node-version }} (${{ matrix.host }})
needs:
- build-rust-binding
- build-rust-wasm
strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x]
node-version: [22.x, 20.x]
host: [macos-13, windows-latest, ubuntu-latest]
include:
- host: macos-13
Expand All @@ -48,9 +48,9 @@ jobs:
- host: ubuntu-latest
target: x86_64-unknown-linux-musl
exclude:
- node-version: 18.x
- node-version: 22.x
host: macos-13
- node-version: 18.x
- node-version: 22.x
host: windows-latest
- node-version: 20.x
host: macos-13
Expand All @@ -62,9 +62,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v3.0.0
uses: pnpm/action-setup@v4
with:
version: 9
version: 10
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -118,31 +118,27 @@ jobs:
uses: codecov/codecov-action@v4
if: ${{ matrix.host == 'ubuntu-latest' }}
with:
move_coverage_to_trash: true
flags: taro-cli
files: ./packages/taro-cli/coverage/clover.xml
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload runner coverage to Codecov
uses: codecov/codecov-action@v4
if: ${{ matrix.host == 'ubuntu-latest' }}
with:
move_coverage_to_trash: true
flags: taro-runner
files: ./packages/taro-webpack5-runner/coverage/clover.xml
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload [taro-runtime] coverage to Codecov
uses: codecov/codecov-action@v4
if: ${{ matrix.host == 'ubuntu-latest' }}
with:
move_coverage_to_trash: true
flags: taro-runtime
files: ./packages/taro-runtime/coverage/clover.xml
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload [taro-web] coverage to Codecov
uses: codecov/codecov-action@v4
if: ${{ matrix.host == 'ubuntu-latest' }}
with:
move_coverage_to_trash: true
flags: taro-web
files: ./packages/taro-components/coverage/clover.xml,./packages/taro-h5/coverage/clover.xml,./packages/taro-router/coverage/clover.xml
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v3.0.0
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node 18
version: 10
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org' # Don't touch!
- name: Git Identity
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/sync-components-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,17 @@ jobs:
${{ runner.os }}-

- name: install
uses: pnpm/action-setup@v3.0.0
uses: pnpm/action-setup@v4
with:
version: 9
version: 10
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
- args: [--filter @tarojs/components, -D, miniapp-types@latest]
# Note: 当前同步脚本使用 ts-node 与 node20 存在兼容问题,修复后解除版本限制
- name: Setup Node 18
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org' # Don't touch!

Expand All @@ -69,4 +68,3 @@ jobs:
labels: |
A-typings
A-components

4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

### 1. 环境准备

> 需要安装 [Node.js 16](https://nodejs.org/en/)(建议安装 `16.20.0` 及以上版本)及 [pnpm 7](https://pnpm.io/zh/installation)
> 需要安装 [Node.js 22](https://nodejs.org/en/)(建议安装 `v22.14.0` 及以上版本)及 [pnpm 10](https://pnpm.io/zh/installation)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

文档 Node.js 最低版本不一致
文档中建议使用 Node.js v22.14.0+,但 CI 测试矩阵和各包 package.json 中的 engines.node 均支持 >=20。请统一最低版本要求:要么将文档改为 >=20,要么在 CI 和引擎声明中仅保留 >=22


首先把 Taro 仓库 fork 一份到自己的 Github,然后从个人仓库把项目 clone 到本地,项目默认是 `main` 分支。

Expand Down Expand Up @@ -209,7 +209,7 @@ Cargo workspace 会把编译产物输出到根目录的 `target` 文件夹中。

如对 `@taorjs/helper` 进行集成测试时,会把 `target/wasm32-wasip1/release/swc_plugin_xxx.wasm` 文件的软链到 `packages/taro-helper/swc/swc_plugin_xxx.wasm`。

####
####

## Credits

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@tarojs/test-utils-vue3": "^0.1.1",
"@tarojs/webpack5-runner": "3.6.24",
"@types/jest": "^29.3.1",
"@types/node": "^18.15.11",
"@types/node": "^20",
"@types/webpack-env": "^1.13.6",
"@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^6.2.0",
Expand Down
4 changes: 2 additions & 2 deletions examples/mini-program-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mini-program-example",
"version": "1.0.0",
"private": true,
"description": "小程序demo",
"description": "小程序 demo",
"templateInfo": {
"name": "default",
"typescript": true,
Expand Down Expand Up @@ -81,6 +81,6 @@
"typescript": "^4.1.0",
"postcss": "^8.4.38",
"ts-node": "^10.9.1",
"@types/node": "^18.15.11"
"@types/node": "^20"
}
}
2 changes: 1 addition & 1 deletion examples/swiper-effect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@tarojs/cli": "4.0.7",
"@tarojs/taro-loader": "4.0.7",
"@tarojs/webpack5-runner": "4.0.7",
"@types/node": "^18",
"@types/node": "^20",
"@types/react": "^18.0.0",
"@types/webpack-env": "^1.13.6",
"babel-preset-taro": "4.0.7",
Expand Down
2 changes: 1 addition & 1 deletion examples/taro-list/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"tsconfig-paths-webpack-plugin": "^4.1.0",
"postcss": "^8.4.38",
"ts-node": "^10.9.1",
"@types/node": "^18.15.11",
"@types/node": "^20",
"@types/jest": "^29.3.1",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.5.0"
Expand Down
2 changes: 1 addition & 1 deletion npm/darwin-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"license": "MIT",
"engines": {
"node": ">= 18"
"node": ">=20"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion npm/darwin-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"license": "MIT",
"engines": {
"node": ">= 18"
"node": ">=20"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-x64-gnu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"license": "MIT",
"engines": {
"node": ">= 18"
"node": ">=20"
},
"libc": [
"glibc"
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-x64-musl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"license": "MIT",
"engines": {
"node": ">= 18"
"node": ">=20"
},
"libc": [
"musl"
Expand Down
2 changes: 1 addition & 1 deletion npm/win32-x64-msvc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"license": "MIT",
"engines": {
"node": ">= 18"
"node": ">=20"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"@types/inquirer": "^8.2.1",
"@types/jest": "^29.5.0",
"@types/less": "^3.0.2",
"@types/node": "^18",
"@types/node": "^20",
"@types/postcss-import": "^14.0.0",
"@types/postcss-url": "^10.0.0",
"@types/resolve": "^1.20.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"homepage": "https://github.com/NervJS/taro#readme",
"engines": {
"node": ">= 18"
"node": ">=20"
},
"dependencies": {
"camelize": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-plugin-transform-taroapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"updateSnapshot": "cross-env NODE_ENV=jest jest --updateSnapshot"
},
"engines": {
"node": ">= 18"
"node": ">=20"
},
"dependencies": {
"lodash": "^4.17.21"
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-preset-taro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"url": "https://github.com/NervJS/taro/issues"
},
"engines": {
"node": ">= 18"
"node": ">=20"
},
"dependencies": {
"@babel/plugin-proposal-decorators": "^7.24.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"cli"
],
"engines": {
"node": ">= 18"
"node": ">=20"
},
"dependencies": {
"@tarojs/cli": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/css-to-react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
]
},
"engines": {
"node": ">= 18"
"node": ">=20"
},
"dependencies": {
"camelize": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-taro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"jsx"
],
"engines": {
"node": ">= 18"
"node": ">=20"
},
"dependencies": {
"@babel/eslint-parser": "^7.24.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-helper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"keywords": [],
"engines": {
"node": ">= 18"
"node": ">=20"
},
"dependencies": {
"@jest/test-sequencer": "^29.7.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/postcss-html-transform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"url": "https://github.com/NervJS/taro/issues"
},
"engines": {
"node": ">= 18"
"node": ">=20"
},
"peerDependencies": {
"postcss": "^8"
Expand Down
2 changes: 1 addition & 1 deletion packages/postcss-plugin-constparse/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"main": "index.js",
"engines": {
"node": ">= 18"
"node": ">=20"
},
"peerDependencies": {
"postcss": "^8"
Expand Down
2 changes: 1 addition & 1 deletion packages/postcss-pxtransform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"testEnvironmentOptions": {}
},
"engines": {
"node": ">= 18"
"node": ">=20"
},
"peerDependencies": {
"postcss": "^8"
Expand Down
2 changes: 1 addition & 1 deletion packages/rollup-plugin-copy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"keywords": [],
"engines": {
"node": ">= 18"
"node": ">=20"
},
"dependencies": {
"@tarojs/helper": "workspace:*"
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"url": "https://github.com/NervJS/taro/issues"
},
"engines": {
"node": ">= 18"
"node": ">=20"
},
"devDependencies": {
"lodash": "^4.17.21"
Expand Down
2 changes: 1 addition & 1 deletion packages/stylelint-config-taro-rn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
},
"engines": {
"node": ">= 18"
"node": ">=20"
},
"dependencies": {
"stylelint-taro-rn": "workspace:*"
Expand Down
2 changes: 1 addition & 1 deletion packages/stylelint-taro-rn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"url": "git+https://github.com/NervJS/taro.git"
},
"engines": {
"node": ">= 18"
"node": ">=20"
},
"dependencies": {
"react-native-known-styling-properties": "^1.3.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/stylelint-taro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"stylelint-plugin"
],
"engines": {
"node": ">= 18"
"node": ">=20"
},
"dependencies": {
"lodash": "^4.17.21"
Expand Down
Loading