diff --git a/.changeset/hot-dingos-act.md b/.changeset/hot-dingos-act.md new file mode 100644 index 00000000000..8de7dab0497 --- /dev/null +++ b/.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). diff --git a/pkg-manifest/manifest-utils/src/getPref.ts b/pkg-manifest/manifest-utils/src/getPref.ts index cf750f1e8e9..018d188c29f 100644 --- a/pkg-manifest/manifest-utils/src/getPref.ts +++ b/pkg-manifest/manifest-utils/src/getPref.ts @@ -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}` diff --git a/pkg-manifest/manifest-utils/test/getPref.test.ts b/pkg-manifest/manifest-utils/test/getPref.test.ts index 15ceee403b7..67ce52ba327 100644 --- a/pkg-manifest/manifest-utils/test/getPref.test.ts +++ b/pkg-manifest/manifest-utils/test/getPref.test.ts @@ -25,7 +25,7 @@ test('getPref()', () => { getPref('foo', 'foo', '4.0.0', { pinnedVersion: 'none', }) - ).toEqual('*') + ).toEqual('^4.0.0') expect( getPref('foo', 'foo', undefined, {