feat: enforces that only pinned dependencies should be pinned @W-21064297@#1606
Merged
iowillhoit merged 4 commits intomainfrom Apr 1, 2026
Merged
feat: enforces that only pinned dependencies should be pinned @W-21064297@#1606iowillhoit merged 4 commits intomainfrom
iowillhoit merged 4 commits intomainfrom
Conversation
jfeingold35
commented
Mar 13, 2026
iowillhoit
reviewed
Mar 26, 2026
test/package.test.ts
Outdated
| '@salesforce/plugin-config': '1.2.3', | ||
| 'left-pad': '1.1.1', | ||
| }, | ||
| pinnedDependencies: ['left-pad'], |
Contributor
There was a problem hiding this comment.
For sf consistency sake, let's use @salesforce/plugin-config as the pinned dep and left-pad as the one that will get the ^
iowillhoit
reviewed
Mar 26, 2026
src/package.ts
Outdated
| // find dependency in package.json (could be an npm alias) | ||
| const depInfo = this.getDependencyInfo(name, { ...dependencies, ...resolutions, ...jitPlugins }); | ||
|
|
||
| const isPinned: boolean = (this.packageJson.pinnedDependencies ?? []).includes(depInfo.packageName); |
Contributor
There was a problem hiding this comment.
Sorry, I forgot that jitPlugins were not in the pinnedDep list. All of the jitPlugins also need to be pinned, no matter what.
Example in the sf package.json https://github.com/salesforcecli/cli/blob/2017716e9c61c80db1c2b289d59ae12963673b18/package.json#L78
iowillhoit
approved these changes
Apr 1, 2026
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 does this PR do?
Previously, when the
--onlyflag was used forsf cli release build, dependencies would always be upgraded to a pinned version.Now, if the dependency is unpinned, it is upgraded to an unpinned version (e.g.,
^1.1.1instead of1.1.1). If it's inpinnedDependencies, then it will remain pinned.What issues does this PR fix or reference?
@W-21064297@