diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d81bd8d..b13087f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,50 +22,20 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - node: [20, 22, 24] + node: [22, 24] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: persist-credentials: false - # pnpm 11 cannot run on node 20 (it requires node >= 22.13), so the - # node 20 jobs need the standalone build, which bundles its own - # runtime while project scripts still run on the matrix node. Both - # pnpm/action-setup standalone mode and `npm i -g @pnpm/exe` are - # broken for 11.13.0 — the @pnpm/* platform packages on npm were - # published without their binary (pnpm/action-setup#277) — so fetch - # the standalone binary straight from the GitHub release, versioned - # by package.json's packageManager field. - - name: Setup pnpm (standalone binary) - shell: bash - run: | - version="$(node -p "require('./package.json').packageManager.split('@').pop()")" - case "${RUNNER_OS}-${RUNNER_ARCH}" in - Linux-X64) asset="pnpm-linux-x64.tar.gz" ;; - Linux-ARM64) asset="pnpm-linux-arm64.tar.gz" ;; - macOS-ARM64) asset="pnpm-darwin-arm64.tar.gz" ;; - Windows-X64) asset="pnpm-win32-x64.zip" ;; - Windows-ARM64) asset="pnpm-win32-arm64.zip" ;; - *) echo "no pnpm standalone asset for ${RUNNER_OS}-${RUNNER_ARCH}" >&2; exit 1 ;; - esac - dest="${RUNNER_TEMP}/pnpm-standalone" - mkdir -p "$dest" - cd "$dest" - curl -fsSL --retry 3 -o "$asset" \ - "https://github.com/pnpm/pnpm/releases/download/v${version}/${asset}" - if [[ "$asset" == *.zip ]]; then - powershell.exe -NoProfile -Command "Expand-Archive -Path '${asset}' -DestinationPath '.' -Force" - else - tar -xzf "$asset" - chmod +x pnpm - fi - rm "$asset" - ./pnpm --version - echo "$dest" >> "$GITHUB_PATH" + # Must precede setup-node so its `cache: 'pnpm'` can find the binary. + # Version comes from package.json's packageManager field. + - name: Setup pnpm + uses: pnpm/action-setup@v6 - name: Setup Node.js ${{ matrix.node }} - uses: actions/setup-node@v4 + uses: actions/setup-node@v7 with: node-version: ${{ matrix.node }} cache: 'pnpm' diff --git a/README.md b/README.md index b18650f..e5f0582 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ the actual downloading is performed by Motrix. ## Requirements -- **Node.js ≥ 20** +- **Node.js ≥ 22** - A reachable, running **Motrix** instance (desktop app or server). ## Installation diff --git a/README.zh-CN.md b/README.zh-CN.md index c134df4..d288dc7 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -12,7 +12,7 @@ CLI 是**客户端,而非下载引擎**——它自己不下载任何东西。 ## 环境要求 -- **Node.js ≥ 20** +- **Node.js ≥ 22** - 一个可访问的、正在运行的 **Motrix** 实例(桌面端 app 或 server)。 ## 安装 diff --git a/package.json b/package.json index 14b9488..02271bc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@motrix/cli", - "version": "0.3.0", + "version": "0.4.0", "description": "Command-line client for the Motrix download manager — speaks MDXP (JSON-RPC 2.0) to a running Motrix, for humans and AI agents.", "license": "MIT", "author": "Motrix", @@ -28,7 +28,7 @@ "motrix": "dist/bin/motrix.js" }, "engines": { - "node": ">=20" + "node": ">=22" }, "files": [ "dist", diff --git a/tsup.config.ts b/tsup.config.ts index 359e077..348ccfd 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -8,7 +8,7 @@ export default defineConfig({ dts: false, splitting: false, clean: true, - target: 'node20', + target: 'node22', platform: 'node', // @motrix/mdxp is published on npm, but we inline it into the built CLI // (a devDependency, not a runtime one) so the artifact stays self-contained