pnpm 7.30.5 → 7.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,7 +1,7 @@
1
1
  The MIT License (MIT)
2
2
 
3
3
  Copyright (c) 2015-2016 Rico Sta. Cruz and other contributors
4
- Copyright (c) 2016-2021 Zoltan Kochan and other contributors
4
+ Copyright (c) 2016-2023 Zoltan Kochan and other contributors
5
5
 
6
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  of this software and associated documentation files (the "Software"), to deal
@@ -204,7 +204,7 @@ packageManager: pnpm@7.24.2
204
204
  pendingBuilds:
205
205
  - /node-gyp/9.3.1
206
206
  - /encoding/0.1.13
207
- prunedAt: Mon, 27 Mar 2023 13:41:59 GMT
207
+ prunedAt: Tue, 04 Apr 2023 00:30:21 GMT
208
208
  publicHoistPattern:
209
209
  - '*eslint*'
210
210
  - '*prettier*'
package/dist/pnpm.cjs CHANGED
@@ -3244,7 +3244,7 @@ var require_lib4 = __commonJS({
3244
3244
  var load_json_file_1 = __importDefault3(require_load_json_file());
3245
3245
  var defaultManifest = {
3246
3246
  name: true ? "pnpm" : "pnpm",
3247
- version: true ? "7.30.5" : "0.0.0"
3247
+ version: true ? "7.31.0" : "0.0.0"
3248
3248
  };
3249
3249
  var pkgJson;
3250
3250
  if (require.main == null) {
@@ -26209,6 +26209,7 @@ var require_lib21 = __commonJS({
26209
26209
  "ignore-dep-scripts": Boolean,
26210
26210
  "ignore-pnpmfile": Boolean,
26211
26211
  "ignore-workspace": Boolean,
26212
+ "ignore-workspace-cycles": Boolean,
26212
26213
  "ignore-workspace-root-check": Boolean,
26213
26214
  "include-workspace-root": Boolean,
26214
26215
  "legacy-dir-filtering": Boolean,
@@ -26328,6 +26329,7 @@ var require_lib21 = __commonJS({
26328
26329
  "git-branch-lockfile": false,
26329
26330
  hoist: true,
26330
26331
  "hoist-pattern": ["*"],
26332
+ "ignore-workspace-cycles": false,
26331
26333
  "ignore-workspace-root-check": false,
26332
26334
  "link-workspace-packages": true,
26333
26335
  "lockfile-include-tarball-url": false,
@@ -41357,8 +41359,8 @@ You can run ${highlight("pnpm install --force")} to refetch the modified package
41357
41359
  };
41358
41360
  }
41359
41361
  function formatRecursiveCommandSummary(msg) {
41360
- const output = constants_1.EOL + `Summary: ${chalk_1.default.red(`${msg.fails.length} fails`)}, ${msg.passes} passes` + constants_1.EOL + constants_1.EOL + msg.fails.map((fail) => {
41361
- return fail.prefix + ":" + constants_1.EOL + formatErrorSummary(fail.message);
41362
+ const output = constants_1.EOL + `Summary: ${chalk_1.default.red(`${msg.failures.length} fails`)}, ${msg.passes} passes` + constants_1.EOL + constants_1.EOL + msg.failures.map(({ message: message2, prefix }) => {
41363
+ return prefix + ":" + constants_1.EOL + formatErrorSummary(message2);
41362
41364
  }).join(constants_1.EOL + constants_1.EOL);
41363
41365
  return {
41364
41366
  title: "",
@@ -54127,6 +54129,8 @@ var require_lib32 = __commonJS({
54127
54129
  function createPkgGraph(pkgs, opts) {
54128
54130
  const pkgMap = createPkgMap(pkgs);
54129
54131
  const pkgMapValues = Object.values(pkgMap);
54132
+ let pkgMapByManifestName;
54133
+ let pkgMapByDir;
54130
54134
  const unmatched = [];
54131
54135
  const graph = (0, map_1.default)((pkg) => ({
54132
54136
  dependencies: createNode(pkg),
@@ -54154,16 +54158,24 @@ var require_lib32 = __commonJS({
54154
54158
  return "";
54155
54159
  }
54156
54160
  if (spec.type === "directory") {
54161
+ pkgMapByDir ?? (pkgMapByDir = getPkgMapByDir(pkgMapValues));
54162
+ const resolvedPath = path_1.default.resolve(pkg.dir, spec.fetchSpec);
54163
+ const found = pkgMapByDir[resolvedPath];
54164
+ if (found) {
54165
+ return found.dir;
54166
+ }
54157
54167
  const matchedPkg2 = pkgMapValues.find((pkg2) => path_1.default.relative(pkg2.dir, spec.fetchSpec) === "");
54158
54168
  if (matchedPkg2 == null) {
54159
54169
  return "";
54160
54170
  }
54171
+ pkgMapByDir[resolvedPath] = matchedPkg2;
54161
54172
  return matchedPkg2.dir;
54162
54173
  }
54163
54174
  if (spec.type !== "version" && spec.type !== "range")
54164
54175
  return "";
54165
- const pkgs2 = pkgMapValues.filter((pkg2) => pkg2.manifest.name === depName);
54166
- if (pkgs2.length === 0)
54176
+ pkgMapByManifestName ?? (pkgMapByManifestName = getPkgMapByManifestName(pkgMapValues));
54177
+ const pkgs2 = pkgMapByManifestName[depName];
54178
+ if (!pkgs2 || pkgs2.length === 0)
54167
54179
  return "";
54168
54180
  const versions = pkgs2.filter(({ manifest }) => manifest.version).map((pkg2) => pkg2.manifest.version);
54169
54181
  const strictWorkspaceMatching = opts?.linkWorkspacePackages === false && !isWorkspaceSpec;
@@ -54197,6 +54209,23 @@ var require_lib32 = __commonJS({
54197
54209
  }
54198
54210
  return pkgMap;
54199
54211
  }
54212
+ function getPkgMapByManifestName(pkgMapValues) {
54213
+ var _a;
54214
+ const pkgMapByManifestName = {};
54215
+ for (const pkg of pkgMapValues) {
54216
+ if (pkg.manifest.name) {
54217
+ (pkgMapByManifestName[_a = pkg.manifest.name] ?? (pkgMapByManifestName[_a] = [])).push(pkg);
54218
+ }
54219
+ }
54220
+ return pkgMapByManifestName;
54221
+ }
54222
+ function getPkgMapByDir(pkgMapValues) {
54223
+ const pkgMapByDir = {};
54224
+ for (const pkg of pkgMapValues) {
54225
+ pkgMapByDir[path_1.default.resolve(pkg.dir)] = pkg;
54226
+ }
54227
+ return pkgMapByDir;
54228
+ }
54200
54229
  }
54201
54230
  });
54202
54231
 
@@ -83417,9 +83446,9 @@ var require_localTarballFetcher = __commonJS({
83417
83446
  }
83418
83447
  });
83419
83448
 
83420
- // ../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.0(typanion@3.12.1)/node_modules/@pnpm/npm-lifecycle/lib/spawn.js
83449
+ // ../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.1(typanion@3.12.1)/node_modules/@pnpm/npm-lifecycle/lib/spawn.js
83421
83450
  var require_spawn = __commonJS({
83422
- "../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.0(typanion@3.12.1)/node_modules/@pnpm/npm-lifecycle/lib/spawn.js"(exports2, module2) {
83451
+ "../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.1(typanion@3.12.1)/node_modules/@pnpm/npm-lifecycle/lib/spawn.js"(exports2, module2) {
83423
83452
  "use strict";
83424
83453
  module2.exports = spawn;
83425
83454
  var _spawn = require("child_process").spawn;
@@ -97725,9 +97754,9 @@ var require_source2 = __commonJS({
97725
97754
  }
97726
97755
  });
97727
97756
 
97728
- // ../node_modules/.pnpm/@yarnpkg+shell@3.2.0-rc.8(typanion@3.12.1)/node_modules/@yarnpkg/shell/lib/errors.js
97757
+ // ../node_modules/.pnpm/@yarnpkg+shell@3.2.5(typanion@3.12.1)/node_modules/@yarnpkg/shell/lib/errors.js
97729
97758
  var require_errors3 = __commonJS({
97730
- "../node_modules/.pnpm/@yarnpkg+shell@3.2.0-rc.8(typanion@3.12.1)/node_modules/@yarnpkg/shell/lib/errors.js"(exports2) {
97759
+ "../node_modules/.pnpm/@yarnpkg+shell@3.2.5(typanion@3.12.1)/node_modules/@yarnpkg/shell/lib/errors.js"(exports2) {
97731
97760
  "use strict";
97732
97761
  Object.defineProperty(exports2, "__esModule", { value: true });
97733
97762
  exports2.ShellError = void 0;
@@ -97741,17 +97770,17 @@ var require_errors3 = __commonJS({
97741
97770
  }
97742
97771
  });
97743
97772
 
97744
- // ../node_modules/.pnpm/@yarnpkg+shell@3.2.0-rc.8(typanion@3.12.1)/node_modules/@yarnpkg/shell/lib/globUtils.js
97773
+ // ../node_modules/.pnpm/@yarnpkg+shell@3.2.5(typanion@3.12.1)/node_modules/@yarnpkg/shell/lib/globUtils.js
97745
97774
  var require_globUtils = __commonJS({
97746
- "../node_modules/.pnpm/@yarnpkg+shell@3.2.0-rc.8(typanion@3.12.1)/node_modules/@yarnpkg/shell/lib/globUtils.js"(exports2) {
97775
+ "../node_modules/.pnpm/@yarnpkg+shell@3.2.5(typanion@3.12.1)/node_modules/@yarnpkg/shell/lib/globUtils.js"(exports2) {
97747
97776
  "use strict";
97748
97777
  Object.defineProperty(exports2, "__esModule", { value: true });
97749
97778
  exports2.isBraceExpansion = exports2.match = exports2.isGlobPattern = exports2.fastGlobOptions = exports2.micromatchOptions = void 0;
97750
97779
  var tslib_12 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
97751
97780
  var fslib_12 = require_lib49();
97752
- var fast_glob_1 = (0, tslib_12.__importDefault)(require_out4());
97753
- var fs_1 = (0, tslib_12.__importDefault)(require("fs"));
97754
- var micromatch_12 = (0, tslib_12.__importDefault)(require_micromatch());
97781
+ var fast_glob_1 = tslib_12.__importDefault(require_out4());
97782
+ var fs_1 = tslib_12.__importDefault(require("fs"));
97783
+ var micromatch_12 = tslib_12.__importDefault(require_micromatch());
97755
97784
  exports2.micromatchOptions = {
97756
97785
  // This is required because we don't want ")/*" to be a valid shell glob pattern.
97757
97786
  strictBrackets: true
@@ -97786,14 +97815,14 @@ var require_globUtils = __commonJS({
97786
97815
  }
97787
97816
  });
97788
97817
 
97789
- // ../node_modules/.pnpm/@yarnpkg+shell@3.2.0-rc.8(typanion@3.12.1)/node_modules/@yarnpkg/shell/lib/pipe.js
97818
+ // ../node_modules/.pnpm/@yarnpkg+shell@3.2.5(typanion@3.12.1)/node_modules/@yarnpkg/shell/lib/pipe.js
97790
97819
  var require_pipe2 = __commonJS({
97791
- "../node_modules/.pnpm/@yarnpkg+shell@3.2.0-rc.8(typanion@3.12.1)/node_modules/@yarnpkg/shell/lib/pipe.js"(exports2) {
97820
+ "../node_modules/.pnpm/@yarnpkg+shell@3.2.5(typanion@3.12.1)/node_modules/@yarnpkg/shell/lib/pipe.js"(exports2) {
97792
97821
  "use strict";
97793
97822
  Object.defineProperty(exports2, "__esModule", { value: true });
97794
97823
  exports2.createOutputStreamsWithPrefix = exports2.start = exports2.Handle = exports2.ProtectedStream = exports2.makeBuiltin = exports2.makeProcess = exports2.Pipe = void 0;
97795
97824
  var tslib_12 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
97796
- var cross_spawn_1 = (0, tslib_12.__importDefault)(require_cross_spawn());
97825
+ var cross_spawn_1 = tslib_12.__importDefault(require_cross_spawn());
97797
97826
  var stream_12 = require("stream");
97798
97827
  var string_decoder_1 = require("string_decoder");
97799
97828
  var Pipe;
@@ -97864,7 +97893,7 @@ var require_pipe2 = __commonJS({
97864
97893
  break;
97865
97894
  }
97866
97895
  });
97867
- child.on(`exit`, (code) => {
97896
+ child.on(`close`, (code) => {
97868
97897
  activeChildren.delete(child);
97869
97898
  if (activeChildren.size === 0) {
97870
97899
  process.off(`SIGINT`, sigintHandler);
@@ -97929,6 +97958,13 @@ var require_pipe2 = __commonJS({
97929
97958
  }
97930
97959
  };
97931
97960
  var Handle = class {
97961
+ static start(implementation, { stdin, stdout, stderr }) {
97962
+ const chain = new Handle(null, implementation);
97963
+ chain.stdin = stdin;
97964
+ chain.stdout = stdout;
97965
+ chain.stderr = stderr;
97966
+ return chain;
97967
+ }
97932
97968
  constructor(ancestor, implementation) {
97933
97969
  this.stdin = null;
97934
97970
  this.stdout = null;
@@ -97937,13 +97973,6 @@ var require_pipe2 = __commonJS({
97937
97973
  this.ancestor = ancestor;
97938
97974
  this.implementation = implementation;
97939
97975
  }
97940
- static start(implementation, { stdin, stdout, stderr }) {
97941
- const chain = new Handle(null, implementation);
97942
- chain.stdin = stdin;
97943
- chain.stdout = stdout;
97944
- chain.stderr = stderr;
97945
- return chain;
97946
- }
97947
97976
  pipeTo(implementation, source = Pipe.STDOUT) {
97948
97977
  const next = new Handle(this, implementation);
97949
97978
  const pipe = new PipeStream();
@@ -98022,8 +98051,8 @@ var require_pipe2 = __commonJS({
98022
98051
  lineIndex = chunkStr.indexOf(`
98023
98052
  `);
98024
98053
  if (lineIndex !== -1) {
98025
- const line = buffer + chunkStr.substr(0, lineIndex);
98026
- chunkStr = chunkStr.substr(lineIndex + 1);
98054
+ const line = buffer + chunkStr.substring(0, lineIndex);
98055
+ chunkStr = chunkStr.substring(lineIndex + 1);
98027
98056
  buffer = ``;
98028
98057
  if (prefix !== null) {
98029
98058
  reportFn(`${prefix} ${line}`);
@@ -98058,16 +98087,16 @@ var require_pipe2 = __commonJS({
98058
98087
  }
98059
98088
  });
98060
98089
 
98061
- // ../node_modules/.pnpm/@yarnpkg+shell@3.2.0-rc.8(typanion@3.12.1)/node_modules/@yarnpkg/shell/lib/index.js
98090
+ // ../node_modules/.pnpm/@yarnpkg+shell@3.2.5(typanion@3.12.1)/node_modules/@yarnpkg/shell/lib/index.js
98062
98091
  var require_lib51 = __commonJS({
98063
- "../node_modules/.pnpm/@yarnpkg+shell@3.2.0-rc.8(typanion@3.12.1)/node_modules/@yarnpkg/shell/lib/index.js"(exports2) {
98092
+ "../node_modules/.pnpm/@yarnpkg+shell@3.2.5(typanion@3.12.1)/node_modules/@yarnpkg/shell/lib/index.js"(exports2) {
98064
98093
  "use strict";
98065
98094
  Object.defineProperty(exports2, "__esModule", { value: true });
98066
98095
  exports2.execute = exports2.ShellError = exports2.globUtils = void 0;
98067
98096
  var tslib_12 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
98068
98097
  var fslib_12 = require_lib49();
98069
98098
  var parsers_1 = require_lib50();
98070
- var chalk_1 = (0, tslib_12.__importDefault)(require_source2());
98099
+ var chalk_1 = tslib_12.__importDefault(require_source2());
98071
98100
  var os_1 = require("os");
98072
98101
  var stream_12 = require("stream");
98073
98102
  var util_1 = require("util");
@@ -98075,7 +98104,7 @@ var require_lib51 = __commonJS({
98075
98104
  Object.defineProperty(exports2, "ShellError", { enumerable: true, get: function() {
98076
98105
  return errors_1.ShellError;
98077
98106
  } });
98078
- var globUtils = (0, tslib_12.__importStar)(require_globUtils());
98107
+ var globUtils = tslib_12.__importStar(require_globUtils());
98079
98108
  exports2.globUtils = globUtils;
98080
98109
  var pipe_1 = require_pipe2();
98081
98110
  var pipe_2 = require_pipe2();
@@ -98412,29 +98441,32 @@ var require_lib51 = __commonJS({
98412
98441
  {
98413
98442
  const argIndex = parseInt(segment.name, 10);
98414
98443
  let raw;
98415
- if (Number.isFinite(argIndex)) {
98444
+ const isArgument = Number.isFinite(argIndex);
98445
+ if (isArgument) {
98416
98446
  if (argIndex >= 0 && argIndex < opts.args.length) {
98417
98447
  raw = opts.args[argIndex];
98418
- } else if (segment.defaultValue) {
98419
- raw = (await interpolateArguments(segment.defaultValue, opts, state)).join(` `);
98420
- } else if (segment.alternativeValue) {
98421
- raw = (await interpolateArguments(segment.alternativeValue, opts, state)).join(` `);
98422
- } else {
98423
- throw new errors_1.ShellError(`Unbound argument #${argIndex}`);
98424
98448
  }
98425
98449
  } else {
98426
98450
  if (Object.prototype.hasOwnProperty.call(state.variables, segment.name)) {
98427
98451
  raw = state.variables[segment.name];
98428
98452
  } else if (Object.prototype.hasOwnProperty.call(state.environment, segment.name)) {
98429
98453
  raw = state.environment[segment.name];
98430
- } else if (segment.defaultValue) {
98431
- raw = (await interpolateArguments(segment.defaultValue, opts, state)).join(` `);
98432
- } else {
98433
- throw new errors_1.ShellError(`Unbound variable "${segment.name}"`);
98434
98454
  }
98435
98455
  }
98436
- if (typeof raw !== `undefined` && segment.alternativeValue)
98456
+ if (typeof raw !== `undefined` && segment.alternativeValue) {
98437
98457
  raw = (await interpolateArguments(segment.alternativeValue, opts, state)).join(` `);
98458
+ } else if (typeof raw === `undefined`) {
98459
+ if (segment.defaultValue) {
98460
+ raw = (await interpolateArguments(segment.defaultValue, opts, state)).join(` `);
98461
+ } else if (segment.alternativeValue) {
98462
+ raw = ``;
98463
+ }
98464
+ }
98465
+ if (typeof raw === `undefined`) {
98466
+ if (isArgument)
98467
+ throw new errors_1.ShellError(`Unbound argument #${argIndex}`);
98468
+ throw new errors_1.ShellError(`Unbound variable "${segment.name}"`);
98469
+ }
98438
98470
  if (segment.quoted) {
98439
98471
  push(raw);
98440
98472
  } else {
@@ -99316,9 +99348,9 @@ var require_resolve_from = __commonJS({
99316
99348
  }
99317
99349
  });
99318
99350
 
99319
- // ../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.0(typanion@3.12.1)/node_modules/@pnpm/npm-lifecycle/lib/extendPath.js
99351
+ // ../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.1(typanion@3.12.1)/node_modules/@pnpm/npm-lifecycle/lib/extendPath.js
99320
99352
  var require_extendPath = __commonJS({
99321
- "../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.0(typanion@3.12.1)/node_modules/@pnpm/npm-lifecycle/lib/extendPath.js"(exports2, module2) {
99353
+ "../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.1(typanion@3.12.1)/node_modules/@pnpm/npm-lifecycle/lib/extendPath.js"(exports2, module2) {
99322
99354
  var path2 = require("path");
99323
99355
  var which = require_which2();
99324
99356
  module2.exports = (wd, originalPath, nodeGyp, opts) => {
@@ -99369,9 +99401,9 @@ var require_extendPath = __commonJS({
99369
99401
  }
99370
99402
  });
99371
99403
 
99372
- // ../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.0(typanion@3.12.1)/node_modules/@pnpm/npm-lifecycle/index.js
99404
+ // ../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.1(typanion@3.12.1)/node_modules/@pnpm/npm-lifecycle/index.js
99373
99405
  var require_npm_lifecycle = __commonJS({
99374
- "../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.0(typanion@3.12.1)/node_modules/@pnpm/npm-lifecycle/index.js"(exports2, module2) {
99406
+ "../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.1(typanion@3.12.1)/node_modules/@pnpm/npm-lifecycle/index.js"(exports2, module2) {
99375
99407
  "use strict";
99376
99408
  exports2 = module2.exports = lifecycle;
99377
99409
  exports2.makeEnv = makeEnv;
@@ -110821,6 +110853,26 @@ var require_pickPackageFromMeta = __commonJS({
110821
110853
  }
110822
110854
  }
110823
110855
  exports2.pickPackageFromMeta = pickPackageFromMeta;
110856
+ var semverRangeCache = /* @__PURE__ */ new Map();
110857
+ function semverSatisfiesLoose(version2, range) {
110858
+ let semverRange = semverRangeCache.get(range);
110859
+ if (semverRange === void 0) {
110860
+ try {
110861
+ semverRange = new semver_12.default.Range(range, true);
110862
+ } catch {
110863
+ semverRange = null;
110864
+ }
110865
+ semverRangeCache.set(range, semverRange);
110866
+ }
110867
+ if (semverRange) {
110868
+ try {
110869
+ return semverRange.test(new semver_12.default.SemVer(version2, true));
110870
+ } catch {
110871
+ return false;
110872
+ }
110873
+ }
110874
+ return false;
110875
+ }
110824
110876
  function pickLowestVersionByVersionRange(meta, versionRange, preferredVerSels) {
110825
110877
  if (preferredVerSels != null && Object.keys(preferredVerSels).length > 0) {
110826
110878
  const prioritizedPreferredVersions = prioritizePreferredVersions(meta, versionRange, preferredVerSels);
@@ -110842,7 +110894,7 @@ var require_pickPackageFromMeta = __commonJS({
110842
110894
  if (preferredVerSels != null && Object.keys(preferredVerSels).length > 0) {
110843
110895
  const prioritizedPreferredVersions = prioritizePreferredVersions(meta, versionRange, preferredVerSels);
110844
110896
  for (const preferredVersions of prioritizedPreferredVersions) {
110845
- if (preferredVersions.includes(latest) && semver_12.default.satisfies(latest, versionRange, true)) {
110897
+ if (preferredVersions.includes(latest) && semverSatisfiesLoose(latest, versionRange)) {
110846
110898
  return latest;
110847
110899
  }
110848
110900
  const preferredVersion = semver_12.default.maxSatisfying(preferredVersions, versionRange, true);
@@ -110858,7 +110910,7 @@ var require_pickPackageFromMeta = __commonJS({
110858
110910
  latest = void 0;
110859
110911
  }
110860
110912
  }
110861
- if (latest && (versionRange === "*" || semver_12.default.satisfies(latest, versionRange, true))) {
110913
+ if (latest && (versionRange === "*" || semverSatisfiesLoose(latest, versionRange))) {
110862
110914
  return latest;
110863
110915
  }
110864
110916
  const maxVersion = semver_12.default.maxSatisfying(versions, versionRange, true);
@@ -110886,7 +110938,7 @@ var require_pickPackageFromMeta = __commonJS({
110886
110938
  case "range": {
110887
110939
  const versions = Object.keys(meta.versions);
110888
110940
  for (const version2 of versions) {
110889
- if (semver_12.default.satisfies(version2, preferredSelector, true)) {
110941
+ if (semverSatisfiesLoose(version2, preferredSelector)) {
110890
110942
  versionsPrioritizer.add(version2, weight);
110891
110943
  }
110892
110944
  }
@@ -110949,6 +111001,19 @@ var require_pickPackage = __commonJS({
110949
111001
  var toRaw_1 = require_toRaw();
110950
111002
  var pickPackageFromMeta_1 = require_pickPackageFromMeta();
110951
111003
  var metafileOperationLimits = {};
111004
+ async function runLimited(pkgMirror, fn2) {
111005
+ let entry;
111006
+ try {
111007
+ entry = metafileOperationLimits[pkgMirror] ?? (metafileOperationLimits[pkgMirror] = { count: 0, limit: (0, p_limit_12.default)(1) });
111008
+ entry.count++;
111009
+ return await fn2(entry.limit);
111010
+ } finally {
111011
+ entry.count--;
111012
+ if (entry.count === 0) {
111013
+ metafileOperationLimits[pkgMirror] = void 0;
111014
+ }
111015
+ }
111016
+ }
110952
111017
  function pickPackageFromMetaUsingTime(spec, preferredVersionSelectors, meta, publishedBy) {
110953
111018
  const pickedPackage = (0, pickPackageFromMeta_1.pickPackageFromMeta)(pickPackageFromMeta_1.pickVersionByVersionRange, spec, preferredVersionSelectors, meta, publishedBy);
110954
111019
  if (pickedPackage)
@@ -110968,80 +111033,81 @@ var require_pickPackage = __commonJS({
110968
111033
  }
110969
111034
  const registryName = (0, encode_registry_1.default)(opts.registry);
110970
111035
  const pkgMirror = path_1.default.join(ctx.cacheDir, ctx.metaDir, registryName, `${encodePkgName(spec.name)}.json`);
110971
- const limit = metafileOperationLimits[pkgMirror] = metafileOperationLimits[pkgMirror] || (0, p_limit_12.default)(1);
110972
- let metaCachedInStore;
110973
- if (ctx.offline === true || ctx.preferOffline === true || opts.pickLowestVersion) {
110974
- metaCachedInStore = await limit(async () => loadMeta(pkgMirror));
110975
- if (ctx.offline) {
110976
- if (metaCachedInStore != null)
110977
- return {
110978
- meta: metaCachedInStore,
110979
- pickedPackage: _pickPackageFromMeta(spec, opts.preferredVersionSelectors, metaCachedInStore, opts.publishedBy)
110980
- };
110981
- throw new error_1.PnpmError("NO_OFFLINE_META", `Failed to resolve ${(0, toRaw_1.toRaw)(spec)} in package mirror ${pkgMirror}`);
110982
- }
110983
- if (metaCachedInStore != null) {
110984
- const pickedPackage = _pickPackageFromMeta(spec, opts.preferredVersionSelectors, metaCachedInStore, opts.publishedBy);
110985
- if (pickedPackage) {
110986
- return {
110987
- meta: metaCachedInStore,
110988
- pickedPackage
110989
- };
111036
+ return runLimited(pkgMirror, async (limit) => {
111037
+ let metaCachedInStore;
111038
+ if (ctx.offline === true || ctx.preferOffline === true || opts.pickLowestVersion) {
111039
+ metaCachedInStore = await limit(async () => loadMeta(pkgMirror));
111040
+ if (ctx.offline) {
111041
+ if (metaCachedInStore != null)
111042
+ return {
111043
+ meta: metaCachedInStore,
111044
+ pickedPackage: _pickPackageFromMeta(spec, opts.preferredVersionSelectors, metaCachedInStore, opts.publishedBy)
111045
+ };
111046
+ throw new error_1.PnpmError("NO_OFFLINE_META", `Failed to resolve ${(0, toRaw_1.toRaw)(spec)} in package mirror ${pkgMirror}`);
111047
+ }
111048
+ if (metaCachedInStore != null) {
111049
+ const pickedPackage = _pickPackageFromMeta(spec, opts.preferredVersionSelectors, metaCachedInStore, opts.publishedBy);
111050
+ if (pickedPackage) {
111051
+ return {
111052
+ meta: metaCachedInStore,
111053
+ pickedPackage
111054
+ };
111055
+ }
110990
111056
  }
110991
111057
  }
110992
- }
110993
- if (spec.type === "version") {
110994
- metaCachedInStore = metaCachedInStore ?? await limit(async () => loadMeta(pkgMirror));
110995
- if (metaCachedInStore?.versions?.[spec.fetchSpec] != null) {
110996
- return {
110997
- meta: metaCachedInStore,
110998
- pickedPackage: metaCachedInStore.versions[spec.fetchSpec]
110999
- };
111000
- }
111001
- }
111002
- if (opts.publishedBy) {
111003
- metaCachedInStore = metaCachedInStore ?? await limit(async () => loadMeta(pkgMirror));
111004
- if (metaCachedInStore?.cachedAt && new Date(metaCachedInStore.cachedAt) >= opts.publishedBy) {
111005
- const pickedPackage = _pickPackageFromMeta(spec, opts.preferredVersionSelectors, metaCachedInStore, opts.publishedBy);
111006
- if (pickedPackage) {
111058
+ if (spec.type === "version") {
111059
+ metaCachedInStore = metaCachedInStore ?? await limit(async () => loadMeta(pkgMirror));
111060
+ if (metaCachedInStore?.versions?.[spec.fetchSpec] != null) {
111007
111061
  return {
111008
111062
  meta: metaCachedInStore,
111009
- pickedPackage
111063
+ pickedPackage: metaCachedInStore.versions[spec.fetchSpec]
111010
111064
  };
111011
111065
  }
111012
111066
  }
111013
- }
111014
- try {
111015
- let meta = await ctx.fetch(spec.name, opts.registry, opts.authHeaderValue);
111016
- if (ctx.filterMetadata) {
111017
- meta = clearMeta(meta);
111018
- }
111019
- meta.cachedAt = Date.now();
111020
- ctx.metaCache.set(spec.name, meta);
111021
- if (!opts.dryRun) {
111022
- limit(async () => {
111023
- try {
111024
- await saveMeta(pkgMirror, meta);
111025
- } catch (err) {
111067
+ if (opts.publishedBy) {
111068
+ metaCachedInStore = metaCachedInStore ?? await limit(async () => loadMeta(pkgMirror));
111069
+ if (metaCachedInStore?.cachedAt && new Date(metaCachedInStore.cachedAt) >= opts.publishedBy) {
111070
+ const pickedPackage = _pickPackageFromMeta(spec, opts.preferredVersionSelectors, metaCachedInStore, opts.publishedBy);
111071
+ if (pickedPackage) {
111072
+ return {
111073
+ meta: metaCachedInStore,
111074
+ pickedPackage
111075
+ };
111026
111076
  }
111027
- });
111077
+ }
111028
111078
  }
111029
- return {
111030
- meta,
111031
- pickedPackage: _pickPackageFromMeta(spec, opts.preferredVersionSelectors, meta, opts.publishedBy)
111032
- };
111033
- } catch (err) {
111034
- err.spec = spec;
111035
- const meta = await loadMeta(pkgMirror);
111036
- if (meta == null)
111037
- throw err;
111038
- logger_1.logger.error(err, err);
111039
- logger_1.logger.debug({ message: `Using cached meta from ${pkgMirror}` });
111040
- return {
111041
- meta,
111042
- pickedPackage: _pickPackageFromMeta(spec, opts.preferredVersionSelectors, meta, opts.publishedBy)
111043
- };
111044
- }
111079
+ try {
111080
+ let meta = await ctx.fetch(spec.name, opts.registry, opts.authHeaderValue);
111081
+ if (ctx.filterMetadata) {
111082
+ meta = clearMeta(meta);
111083
+ }
111084
+ meta.cachedAt = Date.now();
111085
+ ctx.metaCache.set(spec.name, meta);
111086
+ if (!opts.dryRun) {
111087
+ runLimited(pkgMirror, (limit2) => limit2(async () => {
111088
+ try {
111089
+ await saveMeta(pkgMirror, meta);
111090
+ } catch (err) {
111091
+ }
111092
+ }));
111093
+ }
111094
+ return {
111095
+ meta,
111096
+ pickedPackage: _pickPackageFromMeta(spec, opts.preferredVersionSelectors, meta, opts.publishedBy)
111097
+ };
111098
+ } catch (err) {
111099
+ err.spec = spec;
111100
+ const meta = await loadMeta(pkgMirror);
111101
+ if (meta == null)
111102
+ throw err;
111103
+ logger_1.logger.error(err, err);
111104
+ logger_1.logger.debug({ message: `Using cached meta from ${pkgMirror}` });
111105
+ return {
111106
+ meta,
111107
+ pickedPackage: _pickPackageFromMeta(spec, opts.preferredVersionSelectors, meta, opts.publishedBy)
111108
+ };
111109
+ }
111110
+ });
111045
111111
  }
111046
111112
  exports2.pickPackage = pickPackage;
111047
111113
  function clearMeta(pkg) {
@@ -112199,7 +112265,7 @@ var require_lib78 = __commonJS({
112199
112265
  return mod && mod.__esModule ? mod : { "default": mod };
112200
112266
  };
112201
112267
  Object.defineProperty(exports2, "__esModule", { value: true });
112202
- exports2.createPeersFolderSuffix = exports2.createPeersFolderSuffixNewFormat = exports2.depPathToFilename = exports2.parse = exports2.refToRelative = exports2.relative = exports2.getRegistryByPackageName = exports2.refToAbsolute = exports2.tryGetPackageId = exports2.resolve = exports2.isAbsolute = void 0;
112268
+ exports2.createPeersFolderSuffix = exports2.createPeersFolderSuffixNewFormat = exports2.depPathToFilename = exports2.parse = exports2.refToRelative = exports2.relative = exports2.getRegistryByPackageName = exports2.refToAbsolute = exports2.tryGetPackageId = exports2.indexOfPeersSuffix = exports2.resolve = exports2.isAbsolute = void 0;
112203
112269
  var crypto_base32_hash_1 = require_lib77();
112204
112270
  var encode_registry_1 = __importDefault3(require_encode_registry());
112205
112271
  var semver_12 = __importDefault3(require_semver2());
@@ -112223,13 +112289,31 @@ var require_lib78 = __commonJS({
112223
112289
  return resolutionLocation;
112224
112290
  }
112225
112291
  exports2.resolve = resolve;
112292
+ function indexOfPeersSuffix(depPath) {
112293
+ if (!depPath.endsWith(")"))
112294
+ return -1;
112295
+ let open = true;
112296
+ for (let i = depPath.length - 2; i >= 0; i--) {
112297
+ if (depPath[i] === "(") {
112298
+ open = false;
112299
+ } else if (depPath[i] === ")") {
112300
+ if (open)
112301
+ return -1;
112302
+ open = true;
112303
+ } else if (!open) {
112304
+ return i + 1;
112305
+ }
112306
+ }
112307
+ return -1;
112308
+ }
112309
+ exports2.indexOfPeersSuffix = indexOfPeersSuffix;
112226
112310
  function tryGetPackageId(registries, relDepPath) {
112227
112311
  if (relDepPath[0] !== "/") {
112228
112312
  return null;
112229
112313
  }
112230
- const sepIndex = relDepPath.indexOf("(");
112314
+ const sepIndex = indexOfPeersSuffix(relDepPath);
112231
112315
  if (sepIndex !== -1) {
112232
- return resolve(registries, relDepPath.slice(0, sepIndex));
112316
+ return resolve(registries, relDepPath.substring(0, sepIndex));
112233
112317
  }
112234
112318
  const underscoreIndex = relDepPath.indexOf("_", relDepPath.lastIndexOf("/"));
112235
112319
  if (underscoreIndex !== -1) {
@@ -113178,7 +113262,7 @@ var require_inlineSpecifiersLockfileConverters = __commonJS({
113178
113262
  return result2;
113179
113263
  };
113180
113264
  Object.defineProperty(exports2, "__esModule", { value: true });
113181
- exports2.convertNewDepPathToOldDepPath = exports2.revertFromInlineSpecifiersFormat = exports2.revertFromInlineSpecifiersFormatIfNecessary = exports2.convertToInlineSpecifiersFormat = exports2.isExperimentalInlineSpecifiersFormat = void 0;
113265
+ exports2.convertLockfileV6DepPathToV5DepPath = exports2.revertFromInlineSpecifiersFormat = exports2.revertFromInlineSpecifiersFormatIfNecessary = exports2.convertToInlineSpecifiersFormat = exports2.isExperimentalInlineSpecifiersFormat = void 0;
113182
113266
  var dp = __importStar4(require_lib78());
113183
113267
  var InlineSpecifiersLockfile_1 = require_InlineSpecifiersLockfile();
113184
113268
  function isExperimentalInlineSpecifiersFormat(lockfile) {
@@ -113287,7 +113371,7 @@ var require_inlineSpecifiersLockfileConverters = __commonJS({
113287
113371
  if (newSnapshot.optionalDependencies != null) {
113288
113372
  newSnapshot.optionalDependencies = mapValues(newSnapshot.optionalDependencies, convertNewRefToOldRef);
113289
113373
  }
113290
- return [convertNewDepPathToOldDepPath(depPath), newSnapshot];
113374
+ return [convertLockfileV6DepPathToV5DepPath(depPath), newSnapshot];
113291
113375
  }));
113292
113376
  }
113293
113377
  const newLockfile = {
@@ -113297,26 +113381,26 @@ var require_inlineSpecifiersLockfileConverters = __commonJS({
113297
113381
  importers: revertedImporters
113298
113382
  };
113299
113383
  if (originalVersion === 6 && newLockfile.time) {
113300
- newLockfile.time = Object.fromEntries(Object.entries(newLockfile.time).map(([depPath, time]) => [convertNewDepPathToOldDepPath(depPath), time]));
113384
+ newLockfile.time = Object.fromEntries(Object.entries(newLockfile.time).map(([depPath, time]) => [convertLockfileV6DepPathToV5DepPath(depPath), time]));
113301
113385
  }
113302
113386
  return newLockfile;
113303
113387
  }
113304
113388
  exports2.revertFromInlineSpecifiersFormat = revertFromInlineSpecifiersFormat;
113305
- function convertNewDepPathToOldDepPath(oldDepPath) {
113306
- if (!oldDepPath.includes("@", 2))
113307
- return oldDepPath;
113308
- const index = oldDepPath.indexOf("@", oldDepPath.indexOf("/@") + 2);
113309
- if (oldDepPath.includes("(") && index > oldDepPath.indexOf("("))
113310
- return oldDepPath;
113311
- return `${oldDepPath.substring(0, index)}/${oldDepPath.substring(index + 1)}`;
113312
- }
113313
- exports2.convertNewDepPathToOldDepPath = convertNewDepPathToOldDepPath;
113389
+ function convertLockfileV6DepPathToV5DepPath(newDepPath) {
113390
+ if (!newDepPath.includes("@", 2) || newDepPath.startsWith("file:"))
113391
+ return newDepPath;
113392
+ const index = newDepPath.indexOf("@", newDepPath.indexOf("/@") + 2);
113393
+ if (newDepPath.includes("(") && index > dp.indexOfPeersSuffix(newDepPath))
113394
+ return newDepPath;
113395
+ return `${newDepPath.substring(0, index)}/${newDepPath.substring(index + 1)}`;
113396
+ }
113397
+ exports2.convertLockfileV6DepPathToV5DepPath = convertLockfileV6DepPathToV5DepPath;
113314
113398
  function convertNewRefToOldRef(oldRef) {
113315
113399
  if (oldRef.startsWith("link:") || oldRef.startsWith("file:")) {
113316
113400
  return oldRef;
113317
113401
  }
113318
113402
  if (oldRef.includes("@")) {
113319
- return convertNewDepPathToOldDepPath(oldRef);
113403
+ return convertLockfileV6DepPathToV5DepPath(oldRef);
113320
113404
  }
113321
113405
  return oldRef;
113322
113406
  }
@@ -191632,7 +191716,8 @@ var require_extendInstallOptions = __commonJS({
191632
191716
  dedupeDirectDeps: false,
191633
191717
  dedupePeerDependents: false,
191634
191718
  resolvePeersFromWorkspaceRoot: false,
191635
- extendNodePath: true
191719
+ extendNodePath: true,
191720
+ ignoreWorkspaceCycles: false
191636
191721
  };
191637
191722
  };
191638
191723
  async function extendOptions(opts) {
@@ -192219,7 +192304,8 @@ var require_install = __commonJS({
192219
192304
  existsCurrentLockfile: ctx.existsCurrentLockfile,
192220
192305
  existsWantedLockfile: ctx.existsWantedLockfile,
192221
192306
  lockfileDir: ctx.lockfileDir,
192222
- storeDir: ctx.storeDir
192307
+ storeDir: ctx.storeDir,
192308
+ registries: ctx.registries
192223
192309
  });
192224
192310
  }
192225
192311
  const pruneVirtualStore = ctx.modulesFile?.prunedAt && opts.modulesCacheMaxAge > 0 ? cacheExpired(ctx.modulesFile.prunedAt, opts.modulesCacheMaxAge) : true;
@@ -193996,7 +194082,7 @@ var require_installDeps = __commonJS({
193996
194082
  const selectedProjectsGraph = opts.selectedProjectsGraph ?? selectProjectByDir(allProjects, opts.dir);
193997
194083
  if (selectedProjectsGraph != null) {
193998
194084
  const sequencedGraph = (0, sort_packages_1.sequenceGraph)(selectedProjectsGraph);
193999
- if (!sequencedGraph.safe) {
194085
+ if (!opts.ignoreWorkspaceCycles && !sequencedGraph.safe) {
194000
194086
  const cyclicDependenciesInfo = sequencedGraph.cycles.length > 0 ? `: ${sequencedGraph.cycles.map((deps) => deps.join(", ")).join("; ")}` : "";
194001
194087
  logger_1.logger.warn({
194002
194088
  message: `There are cyclic workspace dependencies${cyclicDependenciesInfo}`,
@@ -204169,7 +204255,7 @@ var require_import = __commonJS({
204169
204255
  const selectedProjectsGraph = opts.selectedProjectsGraph ?? selectProjectByDir(allProjects, opts.dir);
204170
204256
  if (selectedProjectsGraph != null) {
204171
204257
  const sequencedGraph = (0, sort_packages_1.sequenceGraph)(selectedProjectsGraph);
204172
- if (!sequencedGraph.safe) {
204258
+ if (!opts.ignoreWorkspaceCycles && !sequencedGraph.safe) {
204173
204259
  const cyclicDependenciesInfo = sequencedGraph.cycles.length > 0 ? `: ${sequencedGraph.cycles.map((deps) => deps.join(", ")).join("; ")}` : "";
204174
204260
  logger_1.logger.warn({
204175
204261
  message: `There are cyclic workspace dependencies${cyclicDependenciesInfo}`,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pnpm",
3
3
  "description": "Fast, disk space efficient package manager",
4
- "version": "7.30.5",
4
+ "version": "7.31.0",
5
5
  "bin": {
6
6
  "pnpm": "bin/pnpm.cjs",
7
7
  "pnpx": "bin/pnpx.cjs"