Skip to content

feat: upgrade to Node 24 and modernize build toolchain#1

Merged
dcoraboeuf merged 12 commits into
nemerosa:mainfrom
rathpc:feat/upgrade-node-24-and-build-toolchain
May 6, 2026
Merged

feat: upgrade to Node 24 and modernize build toolchain#1
dcoraboeuf merged 12 commits into
nemerosa:mainfrom
rathpc:feat/upgrade-node-24-and-build-toolchain

Conversation

@rathpc
Copy link
Copy Markdown
Contributor

@rathpc rathpc commented May 6, 2026

Summary

Upgrade cli-config to Node 24, esbuild bundling (replacing @vercel/ncc), ESLint 10, real unit tests, standardized semantic-release with floating major/minor tags, and updated CLAUDE.md. Pins to @nemerosa/ontrack-github-actions-module-install@^2.0.0 (the new major from its just-merged Wave 1 upgrade).

What changed

  • Runtime: engines.node set to >=24; action.yml runtime is node24; CI workflow installs Node 24.
  • Bundling: replaced @vercel/ncc with esbuild + esbuild-plugin-license (driven by build.js). dist/index.js produced by esbuild; dist/licenses.txt carries third-party attributions.
  • Source shape: index.js refactored to a dependency-injection pattern. A top-level IIFE loads pure-ESM @actions/core and @actions/exec via dynamic ESM import (namespace, not .default) and calls runAction({core, exec, client}). @nemerosa/ontrack-github-actions-module-install stays as a top-level require() since its CJS exports are preserved.
  • Tests: new index.test.js with 12 unit tests covering input handling (url/token + env-var fallbacks), CLI invocation (env injection, custom env-vars, YONTRACK_CI_*), and output/env-var exports. Tests run in <500ms without secrets or network. @nemerosa/...module-install is mocked via jest.mock.
  • Module dep: @nemerosa/ontrack-github-actions-module-install bumped from ^1.2.1 to ^2.0.0.
  • @actions/*: core 1.x → 3.x, exec 1.x → 3.x.
  • ESLint: eslint 8.x → 10.3.0 with new flat config. .eslintrc.json and .eslintignore removed.
  • Release process: new .releaserc matches the standardized template; floating-tag step force-updates vX and vX.Y after each release. Pre-release "commit dist" step removed — semantic-release's git plugin handles dist/ via assets.
  • Workflow: Node 20 → 24, actions/checkout@v4@v6. Self-test gated on vars.ONTRACK_URL != '' so fork PRs don't fail on missing secrets.

Why this is breaking

engines.node >= 24 and runs.using: node24 mean self-hosted runners on older Node will fail. GitHub-hosted runners support Node 24 natively.

Test plan

  • CI passes on this PR (lint, build, tests; self-test runs on internal PRs and main pushes)
  • After merge, semantic-release publishes the next version (likely v2.0.0 if BREAKING CHANGE triggers a major bump)
  • Floating tags vX and vX.Y exist after release

Squash-merge commit message

feat: upgrade to Node 24 and modernize build toolchain

- Replace @vercel/ncc with esbuild + esbuild-plugin-license
- Convert index.js to runAction({core,exec,client}) DI pattern
- Bump @actions/* to v3 majors with namespace dynamic-import
- Pin @nemerosa/ontrack-github-actions-module-install to ^2.0.0
- Migrate to ESLint 10 flat config
- Add 12 unit tests with mocked deps
- Standardize release rules (patch on every commit type)
- Add floating major/minor tag step in CI

BREAKING CHANGE: Now requires Node 24 runtime. Self-hosted runners
must have Node 24 available; GitHub-hosted runners support this
natively. Module-install dep bumped to ^2.0.0.

@rathpc
Copy link
Copy Markdown
Contributor Author

rathpc commented May 6, 2026

@dcoraboeuf here is the last in the batch for review

@dcoraboeuf dcoraboeuf merged commit e16e146 into nemerosa:main May 6, 2026
1 check passed
@dcoraboeuf
Copy link
Copy Markdown
Contributor

Available in v2.0.0

Thanks for your contributions @rathpc !

@rathpc rathpc deleted the feat/upgrade-node-24-and-build-toolchain branch May 6, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants