From b3bcad2a55490bb0043bcb32301ed722e81a284d Mon Sep 17 00:00:00 2001 From: Dr_rOot Date: Sun, 2 Aug 2026 14:28:07 +0800 Subject: [PATCH 1/2] ci: drop EOL node 20 and restore the standard pnpm setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Node 20 reached end-of-life on 2026-04-30, so the matrix keeps only the still-supported LTS lines: 22 (maintenance, EOL 2027-04-30) and 24 (active, EOL 2028-04-30). Dropping it also removes the reason the standalone-pnpm workaround existed. pnpm 11 requires node >= 22.13, which every remaining matrix entry satisfies, so the hand-rolled GitHub-release download is replaced by pnpm/action-setup@v6 — which reads the version from packageManager and still runs before setup-node so `cache: 'pnpm'` resolves. Bump checkout and setup-node to v7. --- .github/workflows/ci.yml | 44 +++++++--------------------------------- 1 file changed, 7 insertions(+), 37 deletions(-) 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' From 45f78e92b9602edfa757d34733e4b52197f7d1c9 Mon Sep 17 00:00:00 2001 From: Dr_rOot Date: Sun, 2 Aug 2026 14:28:12 +0800 Subject: [PATCH 2/2] chore!: require node >= 22, bump to 0.4.0 Align the declared support surface with what CI actually verifies: engines, the tsup compile target, and the requirements section of both READMEs all said node 20, which is EOL as of 2026-04-30. @types/node deliberately stays on ^24 to match the development and runtime environment; the node 22 CI job is what guards the floor. BREAKING CHANGE: node 20 is no longer supported. Install now requires node >= 22. --- README.md | 2 +- README.zh-CN.md | 2 +- package.json | 4 ++-- tsup.config.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) 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