feat: update version when pinnedVersion is * (#5720)

close #5681
This commit is contained in:
Homyee King authored and GitHub committed 2022-12-01 00:00:49 +02:00
1 parent 93558ce68f
commit c245edf1b6
3 files changed
+7 -2

No files matched your search

+6
View File
@@ -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).
@@ -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}`
@@ -25,7 +25,7 @@ test('getPref()', () => {
getPref('foo', 'foo', '4.0.0', {
pinnedVersion: 'none',
})
).toEqual('*')
).toEqual('^4.0.0')
expect(
getPref('foo', 'foo', undefined, {