pnpm 8.0.0 → 8.1.1

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
package/README.md CHANGED
@@ -84,6 +84,8 @@ To quote the [Rush](https://rushjs.io/) team:
84
84
  </picture>
85
85
  </a>
86
86
  </td>
87
+ </tr>
88
+ <tr>
87
89
  <td align="center" valign="middle">
88
90
  <a href="https://depot.dev/?utm_source=pnpm&utm_medium=readme" target="_blank">
89
91
  <picture>
@@ -93,6 +95,15 @@ To quote the [Rush](https://rushjs.io/) team:
93
95
  </picture>
94
96
  </a>
95
97
  </td>
98
+ <td align="center" valign="middle">
99
+ <a href="https://moonrepo.dev/?utm_source=pnpm&utm_medium=readme" target="_blank">
100
+ <picture>
101
+ <source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/moonrepo.svg" />
102
+ <source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/moonrepo_light.svg" />
103
+ <img src="https://pnpm.io/img/users/moonrepo.svg" width="200" />
104
+ </picture>
105
+ </a>
106
+ </td>
96
107
  </tr>
97
108
  </tbody>
98
109
  </table>
package/bin/pnpm.cjs CHANGED
@@ -6,7 +6,7 @@ const COMPATIBILITY_PAGE = `Visit https://r.pnpm.io/comp to see the list of past
6
6
  // 1. it is already bundled to dist/pnpm.cjs, so we would load it twice
7
7
  // 2. we want this file to support potentially older Node.js versions than what semver supports
8
8
  if (major < 16 || major == 16 && minor < 14) {
9
- console.log(`ERROR: This version of pnpm requires at least Node.js v16.4
9
+ console.log(`ERROR: This version of pnpm requires at least Node.js v16.14
10
10
  The current version of Node.js is ${process.version}
11
11
  ${COMPATIBILITY_PAGE}`)
12
12
  process.exit(1)
@@ -204,7 +204,7 @@ packageManager: pnpm@8.0.0-beta.0
204
204
  pendingBuilds:
205
205
  - /node-gyp/9.3.1
206
206
  - /encoding/0.1.13
207
- prunedAt: Mon, 27 Mar 2023 21:15:54 GMT
207
+ prunedAt: Tue, 04 Apr 2023 00:14:12 GMT
208
208
  publicHoistPattern:
209
209
  - '*eslint*'
210
210
  - '*prettier*'
package/dist/pnpm.cjs CHANGED
@@ -3249,7 +3249,7 @@ var require_lib4 = __commonJS({
3249
3249
  var load_json_file_1 = __importDefault3(require_load_json_file());
3250
3250
  var defaultManifest = {
3251
3251
  name: true ? "pnpm" : "pnpm",
3252
- version: true ? "8.0.0" : "0.0.0"
3252
+ version: true ? "8.1.1" : "0.0.0"
3253
3253
  };
3254
3254
  var pkgJson;
3255
3255
  if (require.main == null) {
@@ -26192,6 +26192,7 @@ var require_lib21 = __commonJS({
26192
26192
  "config-dir": String,
26193
26193
  "deploy-all-files": Boolean,
26194
26194
  "dedupe-peer-dependents": Boolean,
26195
+ "dedupe-direct-deps": Boolean,
26195
26196
  dev: [null, true],
26196
26197
  dir: String,
26197
26198
  "enable-modules-dir": Boolean,
@@ -26215,6 +26216,7 @@ var require_lib21 = __commonJS({
26215
26216
  "ignore-dep-scripts": Boolean,
26216
26217
  "ignore-pnpmfile": Boolean,
26217
26218
  "ignore-workspace": Boolean,
26219
+ "ignore-workspace-cycles": Boolean,
26218
26220
  "ignore-workspace-root-check": Boolean,
26219
26221
  "include-workspace-root": Boolean,
26220
26222
  "legacy-dir-filtering": Boolean,
@@ -26314,6 +26316,7 @@ var require_lib21 = __commonJS({
26314
26316
  color: "auto",
26315
26317
  "deploy-all-files": false,
26316
26318
  "dedupe-peer-dependents": true,
26319
+ "dedupe-direct-deps": false,
26317
26320
  "enable-modules-dir": true,
26318
26321
  "extend-node-path": true,
26319
26322
  "fetch-retries": 2,
@@ -26333,6 +26336,7 @@ var require_lib21 = __commonJS({
26333
26336
  "git-branch-lockfile": false,
26334
26337
  hoist: true,
26335
26338
  "hoist-pattern": ["*"],
26339
+ "ignore-workspace-cycles": false,
26336
26340
  "ignore-workspace-root-check": false,
26337
26341
  "link-workspace-packages": true,
26338
26342
  "lockfile-include-tarball-url": false,
@@ -41362,8 +41366,8 @@ You can run ${highlight("pnpm install --force")} to refetch the modified package
41362
41366
  };
41363
41367
  }
41364
41368
  function formatRecursiveCommandSummary(msg) {
41365
- 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) => {
41366
- return fail.prefix + ":" + constants_1.EOL + formatErrorSummary(fail.message);
41369
+ 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 }) => {
41370
+ return prefix + ":" + constants_1.EOL + formatErrorSummary(message2);
41367
41371
  }).join(constants_1.EOL + constants_1.EOL);
41368
41372
  return {
41369
41373
  title: "",
@@ -54132,12 +54136,8 @@ var require_lib32 = __commonJS({
54132
54136
  function createPkgGraph(pkgs, opts) {
54133
54137
  const pkgMap = createPkgMap(pkgs);
54134
54138
  const pkgMapValues = Object.values(pkgMap);
54135
- const pkgMapByManifestName = {};
54136
- for (const pkg of pkgMapValues) {
54137
- if (pkg.manifest.name) {
54138
- (pkgMapByManifestName[pkg.manifest.name] ??= []).push(pkg);
54139
- }
54140
- }
54139
+ let pkgMapByManifestName;
54140
+ let pkgMapByDir;
54141
54141
  const unmatched = [];
54142
54142
  const graph = (0, map_1.default)((pkg) => ({
54143
54143
  dependencies: createNode(pkg),
@@ -54165,14 +54165,22 @@ var require_lib32 = __commonJS({
54165
54165
  return "";
54166
54166
  }
54167
54167
  if (spec.type === "directory") {
54168
+ pkgMapByDir ??= getPkgMapByDir(pkgMapValues);
54169
+ const resolvedPath = path_1.default.resolve(pkg.dir, spec.fetchSpec);
54170
+ const found = pkgMapByDir[resolvedPath];
54171
+ if (found) {
54172
+ return found.dir;
54173
+ }
54168
54174
  const matchedPkg2 = pkgMapValues.find((pkg2) => path_1.default.relative(pkg2.dir, spec.fetchSpec) === "");
54169
54175
  if (matchedPkg2 == null) {
54170
54176
  return "";
54171
54177
  }
54178
+ pkgMapByDir[resolvedPath] = matchedPkg2;
54172
54179
  return matchedPkg2.dir;
54173
54180
  }
54174
54181
  if (spec.type !== "version" && spec.type !== "range")
54175
54182
  return "";
54183
+ pkgMapByManifestName ??= getPkgMapByManifestName(pkgMapValues);
54176
54184
  const pkgs2 = pkgMapByManifestName[depName];
54177
54185
  if (!pkgs2 || pkgs2.length === 0)
54178
54186
  return "";
@@ -54208,6 +54216,22 @@ var require_lib32 = __commonJS({
54208
54216
  }
54209
54217
  return pkgMap;
54210
54218
  }
54219
+ function getPkgMapByManifestName(pkgMapValues) {
54220
+ const pkgMapByManifestName = {};
54221
+ for (const pkg of pkgMapValues) {
54222
+ if (pkg.manifest.name) {
54223
+ (pkgMapByManifestName[pkg.manifest.name] ??= []).push(pkg);
54224
+ }
54225
+ }
54226
+ return pkgMapByManifestName;
54227
+ }
54228
+ function getPkgMapByDir(pkgMapValues) {
54229
+ const pkgMapByDir = {};
54230
+ for (const pkg of pkgMapValues) {
54231
+ pkgMapByDir[path_1.default.resolve(pkg.dir)] = pkg;
54232
+ }
54233
+ return pkgMapByDir;
54234
+ }
54211
54235
  }
54212
54236
  });
54213
54237
 
@@ -83428,9 +83452,9 @@ var require_localTarballFetcher = __commonJS({
83428
83452
  }
83429
83453
  });
83430
83454
 
83431
- // ../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.0_typanion@3.12.1/node_modules/@pnpm/npm-lifecycle/lib/spawn.js
83455
+ // ../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.1_typanion@3.12.1/node_modules/@pnpm/npm-lifecycle/lib/spawn.js
83432
83456
  var require_spawn = __commonJS({
83433
- "../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.0_typanion@3.12.1/node_modules/@pnpm/npm-lifecycle/lib/spawn.js"(exports2, module2) {
83457
+ "../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.1_typanion@3.12.1/node_modules/@pnpm/npm-lifecycle/lib/spawn.js"(exports2, module2) {
83434
83458
  "use strict";
83435
83459
  module2.exports = spawn;
83436
83460
  var _spawn = require("child_process").spawn;
@@ -97736,9 +97760,9 @@ var require_source2 = __commonJS({
97736
97760
  }
97737
97761
  });
97738
97762
 
97739
- // ../node_modules/.pnpm/@yarnpkg+shell@3.2.0-rc.8_typanion@3.12.1/node_modules/@yarnpkg/shell/lib/errors.js
97763
+ // ../node_modules/.pnpm/@yarnpkg+shell@3.2.5_typanion@3.12.1/node_modules/@yarnpkg/shell/lib/errors.js
97740
97764
  var require_errors3 = __commonJS({
97741
- "../node_modules/.pnpm/@yarnpkg+shell@3.2.0-rc.8_typanion@3.12.1/node_modules/@yarnpkg/shell/lib/errors.js"(exports2) {
97765
+ "../node_modules/.pnpm/@yarnpkg+shell@3.2.5_typanion@3.12.1/node_modules/@yarnpkg/shell/lib/errors.js"(exports2) {
97742
97766
  "use strict";
97743
97767
  Object.defineProperty(exports2, "__esModule", { value: true });
97744
97768
  exports2.ShellError = void 0;
@@ -97752,17 +97776,17 @@ var require_errors3 = __commonJS({
97752
97776
  }
97753
97777
  });
97754
97778
 
97755
- // ../node_modules/.pnpm/@yarnpkg+shell@3.2.0-rc.8_typanion@3.12.1/node_modules/@yarnpkg/shell/lib/globUtils.js
97779
+ // ../node_modules/.pnpm/@yarnpkg+shell@3.2.5_typanion@3.12.1/node_modules/@yarnpkg/shell/lib/globUtils.js
97756
97780
  var require_globUtils = __commonJS({
97757
- "../node_modules/.pnpm/@yarnpkg+shell@3.2.0-rc.8_typanion@3.12.1/node_modules/@yarnpkg/shell/lib/globUtils.js"(exports2) {
97781
+ "../node_modules/.pnpm/@yarnpkg+shell@3.2.5_typanion@3.12.1/node_modules/@yarnpkg/shell/lib/globUtils.js"(exports2) {
97758
97782
  "use strict";
97759
97783
  Object.defineProperty(exports2, "__esModule", { value: true });
97760
97784
  exports2.isBraceExpansion = exports2.match = exports2.isGlobPattern = exports2.fastGlobOptions = exports2.micromatchOptions = void 0;
97761
97785
  var tslib_12 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
97762
97786
  var fslib_12 = require_lib49();
97763
- var fast_glob_1 = (0, tslib_12.__importDefault)(require_out4());
97764
- var fs_1 = (0, tslib_12.__importDefault)(require("fs"));
97765
- var micromatch_12 = (0, tslib_12.__importDefault)(require_micromatch());
97787
+ var fast_glob_1 = tslib_12.__importDefault(require_out4());
97788
+ var fs_1 = tslib_12.__importDefault(require("fs"));
97789
+ var micromatch_12 = tslib_12.__importDefault(require_micromatch());
97766
97790
  exports2.micromatchOptions = {
97767
97791
  // This is required because we don't want ")/*" to be a valid shell glob pattern.
97768
97792
  strictBrackets: true
@@ -97797,14 +97821,14 @@ var require_globUtils = __commonJS({
97797
97821
  }
97798
97822
  });
97799
97823
 
97800
- // ../node_modules/.pnpm/@yarnpkg+shell@3.2.0-rc.8_typanion@3.12.1/node_modules/@yarnpkg/shell/lib/pipe.js
97824
+ // ../node_modules/.pnpm/@yarnpkg+shell@3.2.5_typanion@3.12.1/node_modules/@yarnpkg/shell/lib/pipe.js
97801
97825
  var require_pipe2 = __commonJS({
97802
- "../node_modules/.pnpm/@yarnpkg+shell@3.2.0-rc.8_typanion@3.12.1/node_modules/@yarnpkg/shell/lib/pipe.js"(exports2) {
97826
+ "../node_modules/.pnpm/@yarnpkg+shell@3.2.5_typanion@3.12.1/node_modules/@yarnpkg/shell/lib/pipe.js"(exports2) {
97803
97827
  "use strict";
97804
97828
  Object.defineProperty(exports2, "__esModule", { value: true });
97805
97829
  exports2.createOutputStreamsWithPrefix = exports2.start = exports2.Handle = exports2.ProtectedStream = exports2.makeBuiltin = exports2.makeProcess = exports2.Pipe = void 0;
97806
97830
  var tslib_12 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
97807
- var cross_spawn_1 = (0, tslib_12.__importDefault)(require_cross_spawn());
97831
+ var cross_spawn_1 = tslib_12.__importDefault(require_cross_spawn());
97808
97832
  var stream_12 = require("stream");
97809
97833
  var string_decoder_1 = require("string_decoder");
97810
97834
  var Pipe;
@@ -97875,7 +97899,7 @@ var require_pipe2 = __commonJS({
97875
97899
  break;
97876
97900
  }
97877
97901
  });
97878
- child.on(`exit`, (code) => {
97902
+ child.on(`close`, (code) => {
97879
97903
  activeChildren.delete(child);
97880
97904
  if (activeChildren.size === 0) {
97881
97905
  process.off(`SIGINT`, sigintHandler);
@@ -97940,6 +97964,13 @@ var require_pipe2 = __commonJS({
97940
97964
  }
97941
97965
  };
97942
97966
  var Handle = class {
97967
+ static start(implementation, { stdin, stdout, stderr }) {
97968
+ const chain = new Handle(null, implementation);
97969
+ chain.stdin = stdin;
97970
+ chain.stdout = stdout;
97971
+ chain.stderr = stderr;
97972
+ return chain;
97973
+ }
97943
97974
  constructor(ancestor, implementation) {
97944
97975
  this.stdin = null;
97945
97976
  this.stdout = null;
@@ -97948,13 +97979,6 @@ var require_pipe2 = __commonJS({
97948
97979
  this.ancestor = ancestor;
97949
97980
  this.implementation = implementation;
97950
97981
  }
97951
- static start(implementation, { stdin, stdout, stderr }) {
97952
- const chain = new Handle(null, implementation);
97953
- chain.stdin = stdin;
97954
- chain.stdout = stdout;
97955
- chain.stderr = stderr;
97956
- return chain;
97957
- }
97958
97982
  pipeTo(implementation, source = Pipe.STDOUT) {
97959
97983
  const next = new Handle(this, implementation);
97960
97984
  const pipe = new PipeStream();
@@ -98033,8 +98057,8 @@ var require_pipe2 = __commonJS({
98033
98057
  lineIndex = chunkStr.indexOf(`
98034
98058
  `);
98035
98059
  if (lineIndex !== -1) {
98036
- const line = buffer + chunkStr.substr(0, lineIndex);
98037
- chunkStr = chunkStr.substr(lineIndex + 1);
98060
+ const line = buffer + chunkStr.substring(0, lineIndex);
98061
+ chunkStr = chunkStr.substring(lineIndex + 1);
98038
98062
  buffer = ``;
98039
98063
  if (prefix !== null) {
98040
98064
  reportFn(`${prefix} ${line}`);
@@ -98069,16 +98093,16 @@ var require_pipe2 = __commonJS({
98069
98093
  }
98070
98094
  });
98071
98095
 
98072
- // ../node_modules/.pnpm/@yarnpkg+shell@3.2.0-rc.8_typanion@3.12.1/node_modules/@yarnpkg/shell/lib/index.js
98096
+ // ../node_modules/.pnpm/@yarnpkg+shell@3.2.5_typanion@3.12.1/node_modules/@yarnpkg/shell/lib/index.js
98073
98097
  var require_lib51 = __commonJS({
98074
- "../node_modules/.pnpm/@yarnpkg+shell@3.2.0-rc.8_typanion@3.12.1/node_modules/@yarnpkg/shell/lib/index.js"(exports2) {
98098
+ "../node_modules/.pnpm/@yarnpkg+shell@3.2.5_typanion@3.12.1/node_modules/@yarnpkg/shell/lib/index.js"(exports2) {
98075
98099
  "use strict";
98076
98100
  Object.defineProperty(exports2, "__esModule", { value: true });
98077
98101
  exports2.execute = exports2.ShellError = exports2.globUtils = void 0;
98078
98102
  var tslib_12 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
98079
98103
  var fslib_12 = require_lib49();
98080
98104
  var parsers_1 = require_lib50();
98081
- var chalk_1 = (0, tslib_12.__importDefault)(require_source2());
98105
+ var chalk_1 = tslib_12.__importDefault(require_source2());
98082
98106
  var os_1 = require("os");
98083
98107
  var stream_12 = require("stream");
98084
98108
  var util_1 = require("util");
@@ -98086,7 +98110,7 @@ var require_lib51 = __commonJS({
98086
98110
  Object.defineProperty(exports2, "ShellError", { enumerable: true, get: function() {
98087
98111
  return errors_1.ShellError;
98088
98112
  } });
98089
- var globUtils = (0, tslib_12.__importStar)(require_globUtils());
98113
+ var globUtils = tslib_12.__importStar(require_globUtils());
98090
98114
  exports2.globUtils = globUtils;
98091
98115
  var pipe_1 = require_pipe2();
98092
98116
  var pipe_2 = require_pipe2();
@@ -98423,29 +98447,32 @@ var require_lib51 = __commonJS({
98423
98447
  {
98424
98448
  const argIndex = parseInt(segment.name, 10);
98425
98449
  let raw;
98426
- if (Number.isFinite(argIndex)) {
98450
+ const isArgument = Number.isFinite(argIndex);
98451
+ if (isArgument) {
98427
98452
  if (argIndex >= 0 && argIndex < opts.args.length) {
98428
98453
  raw = opts.args[argIndex];
98429
- } else if (segment.defaultValue) {
98430
- raw = (await interpolateArguments(segment.defaultValue, opts, state)).join(` `);
98431
- } else if (segment.alternativeValue) {
98432
- raw = (await interpolateArguments(segment.alternativeValue, opts, state)).join(` `);
98433
- } else {
98434
- throw new errors_1.ShellError(`Unbound argument #${argIndex}`);
98435
98454
  }
98436
98455
  } else {
98437
98456
  if (Object.prototype.hasOwnProperty.call(state.variables, segment.name)) {
98438
98457
  raw = state.variables[segment.name];
98439
98458
  } else if (Object.prototype.hasOwnProperty.call(state.environment, segment.name)) {
98440
98459
  raw = state.environment[segment.name];
98441
- } else if (segment.defaultValue) {
98442
- raw = (await interpolateArguments(segment.defaultValue, opts, state)).join(` `);
98443
- } else {
98444
- throw new errors_1.ShellError(`Unbound variable "${segment.name}"`);
98445
98460
  }
98446
98461
  }
98447
- if (typeof raw !== `undefined` && segment.alternativeValue)
98462
+ if (typeof raw !== `undefined` && segment.alternativeValue) {
98448
98463
  raw = (await interpolateArguments(segment.alternativeValue, opts, state)).join(` `);
98464
+ } else if (typeof raw === `undefined`) {
98465
+ if (segment.defaultValue) {
98466
+ raw = (await interpolateArguments(segment.defaultValue, opts, state)).join(` `);
98467
+ } else if (segment.alternativeValue) {
98468
+ raw = ``;
98469
+ }
98470
+ }
98471
+ if (typeof raw === `undefined`) {
98472
+ if (isArgument)
98473
+ throw new errors_1.ShellError(`Unbound argument #${argIndex}`);
98474
+ throw new errors_1.ShellError(`Unbound variable "${segment.name}"`);
98475
+ }
98449
98476
  if (segment.quoted) {
98450
98477
  push(raw);
98451
98478
  } else {
@@ -99327,9 +99354,9 @@ var require_resolve_from = __commonJS({
99327
99354
  }
99328
99355
  });
99329
99356
 
99330
- // ../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.0_typanion@3.12.1/node_modules/@pnpm/npm-lifecycle/lib/extendPath.js
99357
+ // ../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.1_typanion@3.12.1/node_modules/@pnpm/npm-lifecycle/lib/extendPath.js
99331
99358
  var require_extendPath = __commonJS({
99332
- "../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.0_typanion@3.12.1/node_modules/@pnpm/npm-lifecycle/lib/extendPath.js"(exports2, module2) {
99359
+ "../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.1_typanion@3.12.1/node_modules/@pnpm/npm-lifecycle/lib/extendPath.js"(exports2, module2) {
99333
99360
  var path2 = require("path");
99334
99361
  var which = require_which2();
99335
99362
  module2.exports = (wd, originalPath, nodeGyp, opts) => {
@@ -99380,9 +99407,9 @@ var require_extendPath = __commonJS({
99380
99407
  }
99381
99408
  });
99382
99409
 
99383
- // ../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.0_typanion@3.12.1/node_modules/@pnpm/npm-lifecycle/index.js
99410
+ // ../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.1_typanion@3.12.1/node_modules/@pnpm/npm-lifecycle/index.js
99384
99411
  var require_npm_lifecycle = __commonJS({
99385
- "../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.0_typanion@3.12.1/node_modules/@pnpm/npm-lifecycle/index.js"(exports2, module2) {
99412
+ "../node_modules/.pnpm/@pnpm+npm-lifecycle@2.0.1_typanion@3.12.1/node_modules/@pnpm/npm-lifecycle/index.js"(exports2, module2) {
99386
99413
  "use strict";
99387
99414
  exports2 = module2.exports = lifecycle;
99388
99415
  exports2.makeEnv = makeEnv;
@@ -112031,6 +112058,26 @@ var require_pickPackageFromMeta = __commonJS({
112031
112058
  }
112032
112059
  }
112033
112060
  exports2.pickPackageFromMeta = pickPackageFromMeta;
112061
+ var semverRangeCache = /* @__PURE__ */ new Map();
112062
+ function semverSatisfiesLoose(version2, range) {
112063
+ let semverRange = semverRangeCache.get(range);
112064
+ if (semverRange === void 0) {
112065
+ try {
112066
+ semverRange = new semver_12.default.Range(range, true);
112067
+ } catch {
112068
+ semverRange = null;
112069
+ }
112070
+ semverRangeCache.set(range, semverRange);
112071
+ }
112072
+ if (semverRange) {
112073
+ try {
112074
+ return semverRange.test(new semver_12.default.SemVer(version2, true));
112075
+ } catch {
112076
+ return false;
112077
+ }
112078
+ }
112079
+ return false;
112080
+ }
112034
112081
  function pickLowestVersionByVersionRange(meta, versionRange, preferredVerSels) {
112035
112082
  if (preferredVerSels != null && Object.keys(preferredVerSels).length > 0) {
112036
112083
  const prioritizedPreferredVersions = prioritizePreferredVersions(meta, versionRange, preferredVerSels);
@@ -112052,7 +112099,7 @@ var require_pickPackageFromMeta = __commonJS({
112052
112099
  if (preferredVerSels != null && Object.keys(preferredVerSels).length > 0) {
112053
112100
  const prioritizedPreferredVersions = prioritizePreferredVersions(meta, versionRange, preferredVerSels);
112054
112101
  for (const preferredVersions of prioritizedPreferredVersions) {
112055
- if (preferredVersions.includes(latest) && semver_12.default.satisfies(latest, versionRange, true)) {
112102
+ if (preferredVersions.includes(latest) && semverSatisfiesLoose(latest, versionRange)) {
112056
112103
  return latest;
112057
112104
  }
112058
112105
  const preferredVersion = semver_12.default.maxSatisfying(preferredVersions, versionRange, true);
@@ -112068,7 +112115,7 @@ var require_pickPackageFromMeta = __commonJS({
112068
112115
  latest = void 0;
112069
112116
  }
112070
112117
  }
112071
- if (latest && (versionRange === "*" || semver_12.default.satisfies(latest, versionRange, true))) {
112118
+ if (latest && (versionRange === "*" || semverSatisfiesLoose(latest, versionRange))) {
112072
112119
  return latest;
112073
112120
  }
112074
112121
  const maxVersion = semver_12.default.maxSatisfying(versions, versionRange, true);
@@ -112096,7 +112143,7 @@ var require_pickPackageFromMeta = __commonJS({
112096
112143
  case "range": {
112097
112144
  const versions = Object.keys(meta.versions);
112098
112145
  for (const version2 of versions) {
112099
- if (semver_12.default.satisfies(version2, preferredSelector, true)) {
112146
+ if (semverSatisfiesLoose(version2, preferredSelector)) {
112100
112147
  versionsPrioritizer.add(version2, weight);
112101
112148
  }
112102
112149
  }
@@ -112159,6 +112206,19 @@ var require_pickPackage = __commonJS({
112159
112206
  var toRaw_1 = require_toRaw();
112160
112207
  var pickPackageFromMeta_1 = require_pickPackageFromMeta();
112161
112208
  var metafileOperationLimits = {};
112209
+ async function runLimited(pkgMirror, fn2) {
112210
+ let entry;
112211
+ try {
112212
+ entry = metafileOperationLimits[pkgMirror] ??= { count: 0, limit: (0, p_limit_12.default)(1) };
112213
+ entry.count++;
112214
+ return await fn2(entry.limit);
112215
+ } finally {
112216
+ entry.count--;
112217
+ if (entry.count === 0) {
112218
+ metafileOperationLimits[pkgMirror] = void 0;
112219
+ }
112220
+ }
112221
+ }
112162
112222
  function pickPackageFromMetaUsingTime(spec, preferredVersionSelectors, meta, publishedBy) {
112163
112223
  const pickedPackage = (0, pickPackageFromMeta_1.pickPackageFromMeta)(pickPackageFromMeta_1.pickVersionByVersionRange, spec, preferredVersionSelectors, meta, publishedBy);
112164
112224
  if (pickedPackage)
@@ -112178,80 +112238,81 @@ var require_pickPackage = __commonJS({
112178
112238
  }
112179
112239
  const registryName = (0, encode_registry_1.default)(opts.registry);
112180
112240
  const pkgMirror = path_1.default.join(ctx.cacheDir, ctx.metaDir, registryName, `${encodePkgName(spec.name)}.json`);
112181
- const limit = metafileOperationLimits[pkgMirror] = metafileOperationLimits[pkgMirror] || (0, p_limit_12.default)(1);
112182
- let metaCachedInStore;
112183
- if (ctx.offline === true || ctx.preferOffline === true || opts.pickLowestVersion) {
112184
- metaCachedInStore = await limit(async () => loadMeta(pkgMirror));
112185
- if (ctx.offline) {
112186
- if (metaCachedInStore != null)
112187
- return {
112188
- meta: metaCachedInStore,
112189
- pickedPackage: _pickPackageFromMeta(spec, opts.preferredVersionSelectors, metaCachedInStore, opts.publishedBy)
112190
- };
112191
- throw new error_1.PnpmError("NO_OFFLINE_META", `Failed to resolve ${(0, toRaw_1.toRaw)(spec)} in package mirror ${pkgMirror}`);
112192
- }
112193
- if (metaCachedInStore != null) {
112194
- const pickedPackage = _pickPackageFromMeta(spec, opts.preferredVersionSelectors, metaCachedInStore, opts.publishedBy);
112195
- if (pickedPackage) {
112196
- return {
112197
- meta: metaCachedInStore,
112198
- pickedPackage
112199
- };
112241
+ return runLimited(pkgMirror, async (limit) => {
112242
+ let metaCachedInStore;
112243
+ if (ctx.offline === true || ctx.preferOffline === true || opts.pickLowestVersion) {
112244
+ metaCachedInStore = await limit(async () => loadMeta(pkgMirror));
112245
+ if (ctx.offline) {
112246
+ if (metaCachedInStore != null)
112247
+ return {
112248
+ meta: metaCachedInStore,
112249
+ pickedPackage: _pickPackageFromMeta(spec, opts.preferredVersionSelectors, metaCachedInStore, opts.publishedBy)
112250
+ };
112251
+ throw new error_1.PnpmError("NO_OFFLINE_META", `Failed to resolve ${(0, toRaw_1.toRaw)(spec)} in package mirror ${pkgMirror}`);
112252
+ }
112253
+ if (metaCachedInStore != null) {
112254
+ const pickedPackage = _pickPackageFromMeta(spec, opts.preferredVersionSelectors, metaCachedInStore, opts.publishedBy);
112255
+ if (pickedPackage) {
112256
+ return {
112257
+ meta: metaCachedInStore,
112258
+ pickedPackage
112259
+ };
112260
+ }
112200
112261
  }
112201
112262
  }
112202
- }
112203
- if (spec.type === "version") {
112204
- metaCachedInStore = metaCachedInStore ?? await limit(async () => loadMeta(pkgMirror));
112205
- if (metaCachedInStore?.versions?.[spec.fetchSpec] != null) {
112206
- return {
112207
- meta: metaCachedInStore,
112208
- pickedPackage: metaCachedInStore.versions[spec.fetchSpec]
112209
- };
112210
- }
112211
- }
112212
- if (opts.publishedBy) {
112213
- metaCachedInStore = metaCachedInStore ?? await limit(async () => loadMeta(pkgMirror));
112214
- if (metaCachedInStore?.cachedAt && new Date(metaCachedInStore.cachedAt) >= opts.publishedBy) {
112215
- const pickedPackage = _pickPackageFromMeta(spec, opts.preferredVersionSelectors, metaCachedInStore, opts.publishedBy);
112216
- if (pickedPackage) {
112263
+ if (spec.type === "version") {
112264
+ metaCachedInStore = metaCachedInStore ?? await limit(async () => loadMeta(pkgMirror));
112265
+ if (metaCachedInStore?.versions?.[spec.fetchSpec] != null) {
112217
112266
  return {
112218
112267
  meta: metaCachedInStore,
112219
- pickedPackage
112268
+ pickedPackage: metaCachedInStore.versions[spec.fetchSpec]
112220
112269
  };
112221
112270
  }
112222
112271
  }
112223
- }
112224
- try {
112225
- let meta = await ctx.fetch(spec.name, opts.registry, opts.authHeaderValue);
112226
- if (ctx.filterMetadata) {
112227
- meta = clearMeta(meta);
112228
- }
112229
- meta.cachedAt = Date.now();
112230
- ctx.metaCache.set(spec.name, meta);
112231
- if (!opts.dryRun) {
112232
- limit(async () => {
112233
- try {
112234
- await saveMeta(pkgMirror, meta);
112235
- } catch (err) {
112272
+ if (opts.publishedBy) {
112273
+ metaCachedInStore = metaCachedInStore ?? await limit(async () => loadMeta(pkgMirror));
112274
+ if (metaCachedInStore?.cachedAt && new Date(metaCachedInStore.cachedAt) >= opts.publishedBy) {
112275
+ const pickedPackage = _pickPackageFromMeta(spec, opts.preferredVersionSelectors, metaCachedInStore, opts.publishedBy);
112276
+ if (pickedPackage) {
112277
+ return {
112278
+ meta: metaCachedInStore,
112279
+ pickedPackage
112280
+ };
112236
112281
  }
112237
- });
112282
+ }
112238
112283
  }
112239
- return {
112240
- meta,
112241
- pickedPackage: _pickPackageFromMeta(spec, opts.preferredVersionSelectors, meta, opts.publishedBy)
112242
- };
112243
- } catch (err) {
112244
- err.spec = spec;
112245
- const meta = await loadMeta(pkgMirror);
112246
- if (meta == null)
112247
- throw err;
112248
- logger_1.logger.error(err, err);
112249
- logger_1.logger.debug({ message: `Using cached meta from ${pkgMirror}` });
112250
- return {
112251
- meta,
112252
- pickedPackage: _pickPackageFromMeta(spec, opts.preferredVersionSelectors, meta, opts.publishedBy)
112253
- };
112254
- }
112284
+ try {
112285
+ let meta = await ctx.fetch(spec.name, opts.registry, opts.authHeaderValue);
112286
+ if (ctx.filterMetadata) {
112287
+ meta = clearMeta(meta);
112288
+ }
112289
+ meta.cachedAt = Date.now();
112290
+ ctx.metaCache.set(spec.name, meta);
112291
+ if (!opts.dryRun) {
112292
+ runLimited(pkgMirror, (limit2) => limit2(async () => {
112293
+ try {
112294
+ await saveMeta(pkgMirror, meta);
112295
+ } catch (err) {
112296
+ }
112297
+ }));
112298
+ }
112299
+ return {
112300
+ meta,
112301
+ pickedPackage: _pickPackageFromMeta(spec, opts.preferredVersionSelectors, meta, opts.publishedBy)
112302
+ };
112303
+ } catch (err) {
112304
+ err.spec = spec;
112305
+ const meta = await loadMeta(pkgMirror);
112306
+ if (meta == null)
112307
+ throw err;
112308
+ logger_1.logger.error(err, err);
112309
+ logger_1.logger.debug({ message: `Using cached meta from ${pkgMirror}` });
112310
+ return {
112311
+ meta,
112312
+ pickedPackage: _pickPackageFromMeta(spec, opts.preferredVersionSelectors, meta, opts.publishedBy)
112313
+ };
112314
+ }
112315
+ });
112255
112316
  }
112256
112317
  exports2.pickPackage = pickPackage;
112257
112318
  function clearMeta(pkg) {
@@ -113409,7 +113470,7 @@ var require_lib78 = __commonJS({
113409
113470
  return mod && mod.__esModule ? mod : { "default": mod };
113410
113471
  };
113411
113472
  Object.defineProperty(exports2, "__esModule", { value: true });
113412
- exports2.createPeersFolderSuffix = exports2.depPathToFilename = exports2.parse = exports2.refToRelative = exports2.relative = exports2.getRegistryByPackageName = exports2.refToAbsolute = exports2.tryGetPackageId = exports2.resolve = exports2.isAbsolute = void 0;
113473
+ exports2.createPeersFolderSuffix = exports2.depPathToFilename = exports2.parse = exports2.refToRelative = exports2.relative = exports2.getRegistryByPackageName = exports2.refToAbsolute = exports2.tryGetPackageId = exports2.indexOfPeersSuffix = exports2.resolve = exports2.isAbsolute = void 0;
113413
113474
  var crypto_base32_hash_1 = require_lib77();
113414
113475
  var encode_registry_1 = __importDefault3(require_encode_registry());
113415
113476
  var semver_12 = __importDefault3(require_semver2());
@@ -113433,13 +113494,31 @@ var require_lib78 = __commonJS({
113433
113494
  return resolutionLocation;
113434
113495
  }
113435
113496
  exports2.resolve = resolve;
113497
+ function indexOfPeersSuffix(depPath) {
113498
+ if (!depPath.endsWith(")"))
113499
+ return -1;
113500
+ let open = true;
113501
+ for (let i = depPath.length - 2; i >= 0; i--) {
113502
+ if (depPath[i] === "(") {
113503
+ open = false;
113504
+ } else if (depPath[i] === ")") {
113505
+ if (open)
113506
+ return -1;
113507
+ open = true;
113508
+ } else if (!open) {
113509
+ return i + 1;
113510
+ }
113511
+ }
113512
+ return -1;
113513
+ }
113514
+ exports2.indexOfPeersSuffix = indexOfPeersSuffix;
113436
113515
  function tryGetPackageId(registries, relDepPath) {
113437
113516
  if (relDepPath[0] !== "/") {
113438
113517
  return null;
113439
113518
  }
113440
- const sepIndex = relDepPath.indexOf("(");
113519
+ const sepIndex = indexOfPeersSuffix(relDepPath);
113441
113520
  if (sepIndex !== -1) {
113442
- return resolve(registries, relDepPath.slice(0, sepIndex));
113521
+ return resolve(registries, relDepPath.substring(0, sepIndex));
113443
113522
  }
113444
113523
  const underscoreIndex = relDepPath.indexOf("_", relDepPath.lastIndexOf("/"));
113445
113524
  if (underscoreIndex !== -1) {
@@ -114380,7 +114459,7 @@ var require_inlineSpecifiersLockfileConverters = __commonJS({
114380
114459
  return result2;
114381
114460
  };
114382
114461
  Object.defineProperty(exports2, "__esModule", { value: true });
114383
- exports2.convertNewDepPathToOldDepPath = exports2.revertFromInlineSpecifiersFormat = exports2.revertFromInlineSpecifiersFormatIfNecessary = exports2.convertToInlineSpecifiersFormat = exports2.isExperimentalInlineSpecifiersFormat = void 0;
114462
+ exports2.convertLockfileV6DepPathToV5DepPath = exports2.revertFromInlineSpecifiersFormat = exports2.revertFromInlineSpecifiersFormatIfNecessary = exports2.convertToInlineSpecifiersFormat = exports2.isExperimentalInlineSpecifiersFormat = void 0;
114384
114463
  var dp = __importStar4(require_lib78());
114385
114464
  var InlineSpecifiersLockfile_1 = require_InlineSpecifiersLockfile();
114386
114465
  function isExperimentalInlineSpecifiersFormat(lockfile) {
@@ -114489,7 +114568,7 @@ var require_inlineSpecifiersLockfileConverters = __commonJS({
114489
114568
  if (newSnapshot.optionalDependencies != null) {
114490
114569
  newSnapshot.optionalDependencies = mapValues(newSnapshot.optionalDependencies, convertNewRefToOldRef);
114491
114570
  }
114492
- return [convertNewDepPathToOldDepPath(depPath), newSnapshot];
114571
+ return [convertLockfileV6DepPathToV5DepPath(depPath), newSnapshot];
114493
114572
  }));
114494
114573
  }
114495
114574
  const newLockfile = {
@@ -114499,26 +114578,26 @@ var require_inlineSpecifiersLockfileConverters = __commonJS({
114499
114578
  importers: revertedImporters
114500
114579
  };
114501
114580
  if (originalVersion === 6 && newLockfile.time) {
114502
- newLockfile.time = Object.fromEntries(Object.entries(newLockfile.time).map(([depPath, time]) => [convertNewDepPathToOldDepPath(depPath), time]));
114581
+ newLockfile.time = Object.fromEntries(Object.entries(newLockfile.time).map(([depPath, time]) => [convertLockfileV6DepPathToV5DepPath(depPath), time]));
114503
114582
  }
114504
114583
  return newLockfile;
114505
114584
  }
114506
114585
  exports2.revertFromInlineSpecifiersFormat = revertFromInlineSpecifiersFormat;
114507
- function convertNewDepPathToOldDepPath(oldDepPath) {
114508
- if (!oldDepPath.includes("@", 2))
114509
- return oldDepPath;
114510
- const index = oldDepPath.indexOf("@", oldDepPath.indexOf("/@") + 2);
114511
- if (oldDepPath.includes("(") && index > oldDepPath.indexOf("("))
114512
- return oldDepPath;
114513
- return `${oldDepPath.substring(0, index)}/${oldDepPath.substring(index + 1)}`;
114514
- }
114515
- exports2.convertNewDepPathToOldDepPath = convertNewDepPathToOldDepPath;
114586
+ function convertLockfileV6DepPathToV5DepPath(newDepPath) {
114587
+ if (!newDepPath.includes("@", 2) || newDepPath.startsWith("file:"))
114588
+ return newDepPath;
114589
+ const index = newDepPath.indexOf("@", newDepPath.indexOf("/@") + 2);
114590
+ if (newDepPath.includes("(") && index > dp.indexOfPeersSuffix(newDepPath))
114591
+ return newDepPath;
114592
+ return `${newDepPath.substring(0, index)}/${newDepPath.substring(index + 1)}`;
114593
+ }
114594
+ exports2.convertLockfileV6DepPathToV5DepPath = convertLockfileV6DepPathToV5DepPath;
114516
114595
  function convertNewRefToOldRef(oldRef) {
114517
114596
  if (oldRef.startsWith("link:") || oldRef.startsWith("file:")) {
114518
114597
  return oldRef;
114519
114598
  }
114520
114599
  if (oldRef.includes("@")) {
114521
- return convertNewDepPathToOldDepPath(oldRef);
114600
+ return convertLockfileV6DepPathToV5DepPath(oldRef);
114522
114601
  }
114523
114602
  return oldRef;
114524
114603
  }
@@ -192082,7 +192161,8 @@ var require_extendInstallOptions = __commonJS({
192082
192161
  dedupeDirectDeps: true,
192083
192162
  dedupePeerDependents: true,
192084
192163
  resolvePeersFromWorkspaceRoot: true,
192085
- extendNodePath: true
192164
+ extendNodePath: true,
192165
+ ignoreWorkspaceCycles: false
192086
192166
  };
192087
192167
  };
192088
192168
  async function extendOptions(opts) {
@@ -192669,7 +192749,8 @@ var require_install = __commonJS({
192669
192749
  existsCurrentLockfile: ctx.existsCurrentLockfile,
192670
192750
  existsWantedLockfile: ctx.existsWantedLockfile,
192671
192751
  lockfileDir: ctx.lockfileDir,
192672
- storeDir: ctx.storeDir
192752
+ storeDir: ctx.storeDir,
192753
+ registries: ctx.registries
192673
192754
  });
192674
192755
  }
192675
192756
  const pruneVirtualStore = ctx.modulesFile?.prunedAt && opts.modulesCacheMaxAge > 0 ? cacheExpired(ctx.modulesFile.prunedAt, opts.modulesCacheMaxAge) : true;
@@ -192740,8 +192821,12 @@ var require_install = __commonJS({
192740
192821
  workspacePackages: opts.workspacePackages
192741
192822
  }))) {
192742
192823
  if (needsFullResolution) {
192743
- throw new error_1.PnpmError("FROZEN_LOCKFILE_WITH_OUTDATED_LOCKFILE", "Cannot perform a frozen installation because the lockfile needs updates", {
192744
- hint: 'Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"'
192824
+ throw new error_1.PnpmError("FROZEN_LOCKFILE_WITH_OUTDATED_LOCKFILE", "Cannot perform a frozen installation because the version of the lockfile is incompatible with this version of pnpm", {
192825
+ hint: `Try either:
192826
+ 1. Aligning the version of pnpm that generated the lockfile with the version that installs from it, or
192827
+ 2. Migrating the lockfile so that it is compatible with the newer version of pnpm, or
192828
+ 3. Using "pnpm install --no-frozen-lockfile".
192829
+ Note that in CI environments, this setting is enabled by default.`
192745
192830
  });
192746
192831
  }
192747
192832
  if (opts.lockfileOnly) {
@@ -194437,7 +194522,7 @@ var require_installDeps = __commonJS({
194437
194522
  const selectedProjectsGraph = opts.selectedProjectsGraph ?? selectProjectByDir(allProjects, opts.dir);
194438
194523
  if (selectedProjectsGraph != null) {
194439
194524
  const sequencedGraph = (0, sort_packages_1.sequenceGraph)(selectedProjectsGraph);
194440
- if (!sequencedGraph.safe) {
194525
+ if (!opts.ignoreWorkspaceCycles && !sequencedGraph.safe) {
194441
194526
  const cyclicDependenciesInfo = sequencedGraph.cycles.length > 0 ? `: ${sequencedGraph.cycles.map((deps) => deps.join(", ")).join("; ")}` : "";
194442
194527
  logger_1.logger.warn({
194443
194528
  message: `There are cyclic workspace dependencies${cyclicDependenciesInfo}`,
@@ -204645,7 +204730,7 @@ var require_import = __commonJS({
204645
204730
  const selectedProjectsGraph = opts.selectedProjectsGraph ?? selectProjectByDir(allProjects, opts.dir);
204646
204731
  if (selectedProjectsGraph != null) {
204647
204732
  const sequencedGraph = (0, sort_packages_1.sequenceGraph)(selectedProjectsGraph);
204648
- if (!sequencedGraph.safe) {
204733
+ if (!opts.ignoreWorkspaceCycles && !sequencedGraph.safe) {
204649
204734
  const cyclicDependenciesInfo = sequencedGraph.cycles.length > 0 ? `: ${sequencedGraph.cycles.map((deps) => deps.join(", ")).join("; ")}` : "";
204650
204735
  logger_1.logger.warn({
204651
204736
  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": "8.0.0",
4
+ "version": "8.1.1",
5
5
  "bin": {
6
6
  "pnpm": "bin/pnpm.cjs",
7
7
  "pnpx": "bin/pnpx.cjs"