Skip to content

chore: update Node runtime and dependencies#1147

Merged
peaceiris merged 5 commits into
mainfrom
codex/node24-dependency-updates
May 11, 2026
Merged

chore: update Node runtime and dependencies#1147
peaceiris merged 5 commits into
mainfrom
codex/node24-dependency-updates

Conversation

@peaceiris
Copy link
Copy Markdown
Owner

@peaceiris peaceiris commented May 11, 2026

概要

  • Upgrade the action runtime and local development baseline from Node.js 20 to Node.js 24.
  • Update direct npm dependencies to their latest versions and migrate tooling for ESLint 10, Jest 30, TypeScript 6, and ESM-only @actions/* packages.
  • Replace the ncc build with esbuild and adjust the test workflow to use actions/setup-node@v4 for Node setup.
  • Make asset copying cross-platform by replacing shelljs glob-based copy with Node fs.cp entry copying.
  • Replace the retired ubuntu-20.04 test runner with ubuntu-24.04 and cancel stale Test workflow runs for the same ref.

参考

  • Related issue: closes proposal: bump node to version 24 #1141
  • @actions/* latest packages are ESM-only; @vercel/ncc@0.38.4 could not bundle their import-only exports, so the build now uses esbuild.
  • peaceiris/workflows/setup-node@v0.20.1 enables corepack and failed on windows-latest when C:\npm\prefix\yarn already existed, so the test workflow now uses actions/setup-node@v4 with npm cache.
  • Windows tests failed when shelljs did not expand absolute publish directory globs such as ${publishDir}/* and ${publishDir}/.*, so copyAssets now enumerates entries and copies them with Node fs.cp.
  • GitHub-hosted Linux runners currently list ubuntu-latest, ubuntu-24.04, and ubuntu-22.04; ubuntu-20.04 was replaced to avoid a queued/unavailable matrix job.
  • The Test workflow now cancels stale runs for the same ref so obsolete queued matrix jobs do not block the latest commit.
  • Generated lib/index.js is not committed in this PR, matching the repository guideline for normal changes.

Test plan

  • npm run lint
  • npm test
  • npm run build
  • npm run tsc
  • npm run format
  • npm outdated --json --depth=0 --include=dev --min-release-age=0
  • npm audit --min-release-age=0

Summary by CodeRabbit

  • Chores

    • Updated minimum Node.js requirement to v24 and npm to v11.
    • Modernized CI/CD workflow with updated OS matrix and Node setup.
    • Replaced build tooling from @vercel/ncc to esbuild.
    • Upgraded ESLint to flat config format and modernized TypeScript configuration to ES2022.
    • Updated all development dependencies to latest versions.
  • Tests

    • Enhanced test setup with improved environment configuration.
  • Bug Fixes

    • Improved error reporting with detailed error cause chains.

Review Change Stack

Co-Authored-By: Codex <noreply@openai.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a8fd1490-1d9f-4543-b99c-f764b5e71832

📥 Commits

Reviewing files that changed from the base of the PR and between a1f94b5 and e5ab8f6.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (14)
  • .eslintrc.json
  • .github/workflows/test.yml
  • .nvmrc
  • __tests__/jest.setup.mjs
  • __tests__/utils.test.ts
  • action.yml
  • eslint.config.mjs
  • jest.config.js
  • package.json
  • src/git-utils.ts
  • src/main.ts
  • src/set-tokens.ts
  • src/utils.ts
  • tsconfig.json

📝 Walkthrough

Walkthrough

This PR modernizes the GitHub Pages action to Node.js 24, migrating from legacy tooling (@vercel/ncc, .eslintrc.json) to modern alternatives (esbuild, flat ESLint config), adding ESM support to Jest, and refactoring code to improve error tracing and reduce mutable state patterns.

Changes

Node 24 Upgrade & Tooling Modernization

Layer / File(s) Summary
Node Runtime & Engine Requirements
.nvmrc, package.json, action.yml
Node.js version constraint bumped from 20.11.1 to 24 across environment config, package engines (Node >=24, npm >=11), and action runtime definition.
TypeScript Compiler Configuration
tsconfig.json
Language target upgraded from ES2019 to ES2022; added resolveJsonModule and explicit type packages (jest, node).
Build Tool Migration
package.json
Build scripts migrated from @vercel/ncc to esbuild targeting node24 as CJS with minification; test script now runs Jest via Node's experimental VM modules flag; tsc script updated to --noEmit; dependencies refreshed across @actions/* packages, eslint, jest, ts-jest, typescript.
ESLint Configuration Migration
.eslintrc.json, eslint.config.mjs
Removed legacy .eslintrc.json configuration (26 lines); added new eslint.config.mjs flat config with ignores, JavaScript/TypeScript/Jest recommended rules, Prettier integration, and ES2022 language options.
Jest ESM Configuration
jest.config.js
Added extensionsToTreatAsEsm: ['.ts'] and updated ts-jest transform to explicit array config with tsconfig.module: 'ES2022', tsconfig.target: 'ES2022', and useESM: true.
Test Environment Setup
__tests__/jest.setup.mjs
New setup file creates deterministic temporary home directory for tests and assigns globalThis.jest and globalThis.__dirname globals.
Test Async Refactoring
__tests__/utils.test.ts
Removed non-awaited async IIFEs; replaced conditional if/else assignments with ternary const expressions; simplified getWorkDir() helper to directly compute, create, and return path.
GitHub Actions Workflow Updates
.github/workflows/test.yml
Added concurrency cancellation (cancel-in-progress: true), updated OS matrix from ubuntu-20.04 to ubuntu-24.04, replaced peaceiris/workflows/setup-node with actions/setup-node@v4 with npm cache, renamed build step from "Run ncc" to "Run build".
Error Handling Refactoring
src/main.ts, src/git-utils.ts, src/set-tokens.ts
All error rethrows now attach original caught value as {cause: error} metadata, preserving error chains for better debugging.
Process & Child Execution Refactoring
src/set-tokens.ts
Replaced CommonJS child_process require wrappers with ES imports (execFileSync, spawnSync); Windows SSH-agent setup now uses spawnSync for PowerShell and shell operations.
Asset & Utility Refactoring
src/git-utils.ts, src/utils.ts
Asset deletion refactored to bulk rm('-rf', files) operation; asset copying switched from shelljs glob patterns to fs.promises.cp via new copyDirContents() helper; getHomeDir() simplified to single const ternary expression instead of conditional block.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • proposal: bump node to version 24 #1141: Main changes explicitly bump Node runtime to v24 across workflow, action.yml, .nvmrc, and package.json — directly addresses the proposal to upgrade to Node 24.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/node24-dependency-updates

Comment @coderabbitai help to get the list of available commands and usage tips.

@actions-gh-pages actions-gh-pages Bot added the dependencies Pull requests that update a dependency file label May 11, 2026
Co-Authored-By: Codex <noreply@openai.com>
peaceiris and others added 3 commits May 12, 2026 01:26
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
@peaceiris peaceiris marked this pull request as ready for review May 11, 2026 16:45
@peaceiris peaceiris merged commit 954f6bf into main May 11, 2026
10 of 11 checks passed
@peaceiris peaceiris deleted the codex/node24-dependency-updates branch May 11, 2026 16:48
@coderabbitai coderabbitai Bot mentioned this pull request May 12, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cicd dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

proposal: bump node to version 24

1 participant