chore(deps): bump commander from 14.0.3 to 15.0.0#174
Conversation
🦋 Changeset detectedLatest commit: a80b3c5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Bumps [commander](https://github.com/tj/commander.js) from 14.0.3 to 15.0.0. - [Release notes](https://github.com/tj/commander.js/releases) - [Changelog](https://github.com/tj/commander.js/blob/master/CHANGELOG.md) - [Commits](tj/commander.js@v14.0.3...v15.0.0) --- updated-dependencies: - dependency-name: commander dependency-version: 15.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
662385d to
6852eb3
Compare
commander 15 dropped CJS; Jest on Node 22 cannot require() it natively. Bundle commander to CJS for tests via esbuild moduleNameMapper, and inline it in the Vite CJS build so dist/cli.js stays require()-able.
Replace the static import of commander with a lazy loader (mirroring chalk-loader) so the published CJS bundle and Jest on Node 22 no longer require() commander 15, which is ESM-only and throws on Node < 24.9. The loader uses an indirect dynamic import so neither @swc/jest nor rollup rewrites it back to require(). This reverts the earlier esbuild shim / de-externalization workaround.
Use a plain dynamic import() under Jest on Node >= 24.9 so commander loads within each test file's environment instead of a shared native-import realm that throws "import after teardown" once the first file finishes. Keep the native import() escape for the CJS bundle and for Jest on Node 22, and isolate test suites to separate workers on those versions so the escape cannot poison later files in the same process.
Expose async commander helpers so callers do not need to remember a separate preload step. Await command factories in the CLI setup flow.
Remove the Jest worker override and keep the shared ESM import helper aligned with the existing ora loader pattern.
Use a type guard to drop redundant assertions and a nullish assignment for the cached commander promise.
|
Oops, I thought I had the unit tests passing, I'll fix it again and reopen |
Run Jest with enough workers on Node 22 so ESM-only dependencies loaded through native import do not cross Jest environment teardown boundaries.
Use an explicit Node 22 test step with enough Jest workers to avoid reusing a worker across ESM import environments. Keep Node 24 and 26 on the normal test command.
|
giu1io
left a comment
There was a problem hiding this comment.
@innerdvations code looks god to me. Do you think I should do some manual QA on this? given that it's more then just a dependency bump.
|
Yes, since it's commander, you can basically just test that the cli commands all still work ok and that should be good |
Manual testing ✅Tested locally on Node v24.11.1 and Node 22.12 to cover both import paths. Build & bundle integrity (Node 24)
CLI runtime (Node 24)
Test suite (Node 24)
Node 22 path (ESM escape hatch)
Everything passed. 👍 |



Bumps commander from 14.0.3 to 15.0.0.
Release notes
Sourced from commander's releases.
... (truncated)
Changelog
Sourced from commander's changelog.
Commits
ba6d13dFix release dates in changelog (#2523)a752ed9Pin GitHub actions with hash (#2521)74d5dfeDrop EOL node 20 from test matrix, and add node 26 (#2520)6df9b68Update details for 15.0.0 release (#2519)01ce5d0Remove jest esm examples (#2517)d785d8bUpdate dependencies (#2518)9098b48Update dependencies (#2506)373f660Use node:util stripVTControlCharacters instead of own code (#2486)987f289Use simple match in test (to avoid warning about expensive regex) (#2485)0ea3bb3Update dependecies and lint (#2489)