Skip to content

feat: enforces that only pinned dependencies should be pinned @W-21064297@#1606

Merged
iowillhoit merged 4 commits intomainfrom
d/W-21064297
Apr 1, 2026
Merged

feat: enforces that only pinned dependencies should be pinned @W-21064297@#1606
iowillhoit merged 4 commits intomainfrom
d/W-21064297

Conversation

@jfeingold35
Copy link
Copy Markdown
Contributor

What does this PR do?

Previously, when the --only flag was used for sf 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.1 instead of 1.1.1). If it's in pinnedDependencies, then it will remain pinned.

What issues does this PR fix or reference?

@W-21064297@

'@salesforce/plugin-config': '1.2.3',
'left-pad': '1.1.1',
},
pinnedDependencies: ['left-pad'],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sf consistency sake, let's use @salesforce/plugin-config as the pinned dep and left-pad as the one that will get the ^

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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 iowillhoit merged commit f17651f into main Apr 1, 2026
13 checks passed
@iowillhoit iowillhoit deleted the d/W-21064297 branch April 1, 2026 14:20
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