Skip to content

Commit

Permalink
feat: update version when pinnedVersion is * (#5720)
Browse files Browse the repository at this point in the history
close #5681
  • Loading branch information
HomyeeKing committed Nov 30, 2022
1 parent 93558ce commit c245edf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/hot-dingos-act.md
@@ -0,0 +1,6 @@
---
"@pnpm/manifest-utils": patch
"pnpm": patch
---

Dependencies specified via `*` should be updated to semver ranges by `pnpm update` [#5681](https://github.com/pnpm/pnpm/issues/5681).
1 change: 0 additions & 1 deletion pkg-manifest/manifest-utils/src/getPref.ts
Expand Up @@ -19,7 +19,6 @@ export function getPref (
export function createVersionSpec (version: string | undefined, opts: { pinnedVersion?: PinnedVersion, rolling?: boolean }) {
switch (opts.pinnedVersion ?? 'major') {
case 'none':
return '*'
case 'major':
if (opts.rolling) return '^'
return !version ? '*' : `^${version}`
Expand Down
2 changes: 1 addition & 1 deletion pkg-manifest/manifest-utils/test/getPref.test.ts
Expand Up @@ -25,7 +25,7 @@ test('getPref()', () => {
getPref('foo', 'foo', '4.0.0', {
pinnedVersion: 'none',
})
).toEqual('*')
).toEqual('^4.0.0')

expect(
getPref('foo', 'foo', undefined, {
Expand Down

0 comments on commit c245edf

Please sign in to comment.