CHANGE @W-22462048@ Update CLI dependencies to released core packages - #2070
Open
nikhil-mittal-165 wants to merge 2 commits into
Open
CHANGE @W-22462048@ Update CLI dependencies to released core packages#2070nikhil-mittal-165 wants to merge 2 commits into
nikhil-mittal-165 wants to merge 2 commits into
Conversation
- Bump 9 @salesforce/code-analyzer-* deps to the newly released versions (core 0.50.0, engine-api 0.40.0, pmd 0.44.0, eslint 0.45.0, flow 0.39.0, regex 0.38.0, retirejs 0.37.0, sfge 0.23.0, apexguru 0.40.0) - Bump eligible non-core minor/patch deps (oclif, sf-plugins-core, cli-plugins-testkit, vitest, typescript-eslint, etc.) - Add scoped override pinning @jsforce/jsforce-node's undici to ^7.29.0. jsforce-node 3.10.17+ requires undici ^8.5.0, which needs Node >=22.19.0 (webidl markAsUncloneable) and hard-crashes on the supported Node 20 floor. This restores Node 20 compatibility; removable once the Node 20 floor is dropped.
aruntyagiTutu
approved these changes
Jul 27, 2026
aruntyagiTutu
left a comment
Contributor
There was a problem hiding this comment.
Excellent, evidence-driven PR:
- Core package bumps are exact-pinned to the just-released versions (0.50.0, 0.40.0, etc.) — correct for a CLI that depends on released (non-SNAPSHOT) core packages.
- Non-core bumps are minor/patch only, and the compatibility holds (
@salesforce/core,@types/nodeat ^20,eslint,vite,typescript) are explicit and justified — matches the Compatibility & Versioning guidance on not bumping without understanding downstream impact. - The Node 20
undicioverride is the standout part of this PR: the root-cause analysis (caret float injsforce→ undici 8 → Node 22+ API) is precise, and all 7 alternatives were actually tested rather than asserted, with the two npm-viable options (top-level pins) shown to be ineffective due to nested resolution. Landing on a scopedoverridesunder@jsforce/jsforce-nodeis the right minimal-blast-radius fix, and it's explicitly flagged as removable once Node 20 support is dropped — good forward-looking hygiene per the versioning guidelines. - Testing is thorough and reproducible: before/after behavior on Node 20.20.2, full test suite (393/393), and a real smoke run.
One minor nit (non-blocking): the second commit message "update critical dependency" doesn't follow the `NEW/FIX/CHANGE @W-XXXXX@" convention and doesn't say what was bumped (websocket-driver, per the diff) — worth a more descriptive message next time, but doesn't affect this PR's mergeability.
Approving.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Updates the CLI to depend on the freshly released
@salesforce/code-analyzer-*core packages (monthly release), refreshes eligible non-core minor/patch dependencies, and adds a scoped override to keep the CLI working on its supported Node 20 floor.Core package bumps (exact-pinned)
Non-core (minor/patch only)
@oclif/core^4.11.6→^4.11.14 ·@salesforce/sf-plugins-core^12.2.24→^12.2.26 ·@eslint/eslintrc^3.3.5→^3.3.6 ·@oclif/plugin-help^6.2.50→^6.2.53 ·@salesforce/cli-plugins-testkit^5.3.61→^5.3.62 ·@vitest/coverage-istanbul&vitest^4.1.9→^4.1.10 ·oclif^4.23.16→^4.23.28 ·typescript-eslint^8.61.1→^8.65.0Intentionally not changed (compatibility):
@salesforce/core(8.23.4),@types/node(^20),eslint/@eslint/js(^9),vite(^7),typescript(^5.9.3).Node 20 fix — scoped undici override
Root cause (transitive caret float, not a manifest change)
@jsforce/[email protected](published Jun 25) is the first jsforce version to depend onundici(^8.5.0). Earlier versions (3.10.13/3.10.16) had no undici. undici 8.x requires Node ≥22.19.0 (webidl.util.markAsUncloneablefromnode:worker_threads) and hard-crashes on Node 20 — the CLI's supported floor (engines.node: ">=20.0.0") — withTypeError: webidl.util.markAsUncloneable is not a functionon any command that loads jsforce.@salesforce/core(pinned at 8.23.4) depends onjsforce ^3.10.8— a caret — so npm resolves the newest published jsforce (3.10.19 today). The prior release's lockfile was frozen at jsforce 3.10.13 (locked before jsforce added undici), so it never pulled undici; regenerating the lockfile for this dependency update floats jsforce forward and pulls in undici 8.@salesforce/[email protected]+@salesforce/sf-plugins-core@^12.2.24, no apexguru) yieldsjsforce-node 3.10.19+undici 8.9.0. So the crash reproduces with the old dependency set alone — the newer engines did not introduce it.lts/*+24.x(never Node 20). Verified locally on Node v20.20.2: without the override the built CLI crashes oncode-analyzer run; with it, a real scan and the full suite pass.Alternatives considered (all tested, all rejected)
undicias a top-level dependency ("undici": "^7.29.0"independencies)undici ^8.5.0; npm keeps a nestedundici@8undernode_modules/@jsforce/jsforce-node/that jsforce's ownrequire('undici')resolves. Same crash. A top-level pin only dedupes a transitive dep when our version satisfies the transitive range, and 7.x can never satisfy^8.5.0.@jsforce/jsforce-nodeas a top-level dependency to 3.10.16 (last version with no undici)sf-plugins-coreandapexguru-engineeach declarejsforce ^3.10.17, so npm gives them nested[email protected]→[email protected]reappears. A direct dependency cannot constrain another package's subtree.apexguru-engine's@salesforce/coreto 8.23.4 and republishcore → jsforce(a caret), not inapexguru → core. Even[email protected]resolvesjsforce ^3.10.13→ 3.10.19 → undici 8. And there are parallel paths ([email protected] → core ^8.31.4, plus the CLI's own[email protected] → jsforce ^3.10.8) that reach undici 8 independently. Pinning apexguru fixes none of them. (For the record, apexguru only usesConnection/Org/Org.create, which do exist in 8.23.4 — but the change still wouldn't fix the crash, and would push apexguru below its declared^8.31.2range.)resolutionsfieldpatch-packageon jsforce's manifestoverrides— it adds a postinstall hook that rewrites a dependency'spackage.json.>=22(drop the override, accept undici 8)@salesforce/[email protected], and even this repo's CI all effectively target Node ≥22). But dropping Node 20 is a product/policy decision — Node 20 is our stated customer minimum — so it is out of scope for this dependency PR and should be a separate, deliberate change.Conclusion: within npm and while keeping the Node 20 floor, a scoped
overridesis the only mechanism that constrains the transitiveundiciacross every subtree at once. It is scoped under@jsforce/jsforce-nodeso the intent is explicit and narrow, and it is removable the moment the CLI drops its Node 20 floor (alternative #6).Testing (Node v20.20.2)
npm run build✅npm run lint✅npm run test✅ — 22/22 files, 393/393 tests (before the fix: 18/22 files failed at import time)code-analyzer run --rule-selector regex✅ exit 0lts/*)Note: CLI version intentionally left at 5.14.0 — the release Action bumps it.