@pnpm/exe 11.0.0-beta.4-1 → 11.0.0-beta.6

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/dist/pnpm.mjs CHANGED
@@ -1000,7 +1000,7 @@ var init_lib2 = __esm({
1000
1000
  "use strict";
1001
1001
  defaultManifest = {
1002
1002
  name: true ? "pnpm" : "pnpm",
1003
- version: true ? "11.0.0-beta.4-1" : "0.0.0"
1003
+ version: true ? "11.0.0-beta.6" : "0.0.0"
1004
1004
  };
1005
1005
  pkgJson = defaultManifest;
1006
1006
  packageManager = {
@@ -130132,11 +130132,10 @@ function createAutoImporter() {
130132
130132
  function initialAuto(to, opts2) {
130133
130133
  if (process.platform !== "win32") {
130134
130134
  try {
130135
- const _clonePkg = createClonePkg();
130136
- if (!_clonePkg(to, opts2))
130135
+ if (!tryClonePkg(to, opts2))
130137
130136
  return void 0;
130138
130137
  packageImportMethodLogger.debug({ method: "clone" });
130139
- auto = _clonePkg;
130138
+ auto = createClonePkg();
130140
130139
  return "clone";
130141
130140
  } catch {
130142
130141
  }
@@ -130167,11 +130166,10 @@ function createCloneOrCopyImporter() {
130167
130166
  return (to, opts2) => auto(to, opts2);
130168
130167
  function initialAuto(to, opts2) {
130169
130168
  try {
130170
- const _clonePkg = createClonePkg();
130171
- if (!_clonePkg(to, opts2))
130169
+ if (!tryClonePkg(to, opts2))
130172
130170
  return void 0;
130173
130171
  packageImportMethodLogger.debug({ method: "clone" });
130174
- auto = _clonePkg;
130172
+ auto = createClonePkg();
130175
130173
  return "clone";
130176
130174
  } catch {
130177
130175
  }
@@ -130180,6 +130178,14 @@ function createCloneOrCopyImporter() {
130180
130178
  return auto(to, opts2);
130181
130179
  }
130182
130180
  }
130181
+ function tryClonePkg(to, opts2) {
130182
+ if (opts2.resolvedFrom !== "store" || opts2.force || !pkgExistsAtTargetDir(to, opts2.filesMap)) {
130183
+ const clone3 = createCloneFunction();
130184
+ importIndexedDir({ importFile: clone3, importFileAtomic: clone3 }, to, opts2.filesMap, opts2);
130185
+ return "clone";
130186
+ }
130187
+ return void 0;
130188
+ }
130183
130189
  function createClonePkg() {
130184
130190
  const clone3 = createCloneFunction();
130185
130191
  const withFallback = (fallback) => (src2, dest) => {
@@ -130218,9 +130224,11 @@ function pickFileFromFilesMap(filesMap) {
130218
130224
  return filesMap.keys().next().value;
130219
130225
  }
130220
130226
  function createCloneFunction() {
130227
+ if (_cloneFunction)
130228
+ return _cloneFunction;
130221
130229
  if (process.platform === "darwin" || process.platform === "win32") {
130222
130230
  const { reflinkFileSync } = __require("@reflink/reflink");
130223
- return (fr, to) => {
130231
+ _cloneFunction = (fr, to) => {
130224
130232
  try {
130225
130233
  reflinkFileSync(fr, to);
130226
130234
  } catch (err) {
@@ -130228,15 +130236,17 @@ function createCloneFunction() {
130228
130236
  throw err;
130229
130237
  }
130230
130238
  };
130239
+ } else {
130240
+ _cloneFunction = (src2, dest) => {
130241
+ try {
130242
+ lib_default.copyFileSync(src2, dest, constants4.COPYFILE_FICLONE_FORCE);
130243
+ } catch (err) {
130244
+ if (!(util24.types.isNativeError(err) && "code" in err && err.code === "EEXIST"))
130245
+ throw err;
130246
+ }
130247
+ };
130231
130248
  }
130232
- return (src2, dest) => {
130233
- try {
130234
- lib_default.copyFileSync(src2, dest, constants4.COPYFILE_FICLONE_FORCE);
130235
- } catch (err) {
130236
- if (!(util24.types.isNativeError(err) && "code" in err && err.code === "EEXIST"))
130237
- throw err;
130238
- }
130239
- };
130249
+ return _cloneFunction;
130240
130250
  }
130241
130251
  function hardlinkPkg(importFile, to, opts2) {
130242
130252
  if (opts2.force || shouldRelinkPkg(to, opts2)) {
@@ -130313,6 +130323,7 @@ function atomicCopyFileSync(src2, dest) {
130313
130323
  }
130314
130324
  renameOverwriteSync(tmp, dest);
130315
130325
  }
130326
+ var _cloneFunction;
130316
130327
  var init_lib81 = __esm({
130317
130328
  "../fs/indexed-pkg-importer/lib/index.js"() {
130318
130329
  "use strict";
@@ -208122,7 +208133,7 @@ async function handler34(opts2, [command, ...args]) {
208122
208133
  });
208123
208134
  return resolved.id;
208124
208135
  }));
208125
- const { cacheLink, cacheExists, cachedDir } = findCache({
208136
+ let { cacheLink, cacheExists, cachedDir } = findCache({
208126
208137
  packages: resolvedPkgs,
208127
208138
  dlxCacheMaxAge: opts2.dlxCacheMaxAge,
208128
208139
  cacheDir: opts2.cacheDir,
@@ -208131,29 +208142,37 @@ async function handler34(opts2, [command, ...args]) {
208131
208142
  supportedArchitectures: opts2.supportedArchitectures
208132
208143
  });
208133
208144
  if (!cacheExists) {
208134
- fs90.mkdirSync(cachedDir, { recursive: true });
208135
- await add_exports.handler({
208136
- ...opts2,
208137
- enableGlobalVirtualStore: opts2.enableGlobalVirtualStore ?? true,
208138
- bin: path165.join(cachedDir, "node_modules/.bin"),
208139
- dir: cachedDir,
208140
- lockfileDir: cachedDir,
208141
- allowBuilds: Object.fromEntries([...resolvedPkgAliases, ...opts2.allowBuild ?? []].map((pkg) => [pkg, true])),
208142
- rootProjectManifestDir: cachedDir,
208143
- saveProd: true,
208144
- // dlx will be looking for the package in the "dependencies" field!
208145
- saveDev: false,
208146
- saveOptional: false,
208147
- savePeer: false,
208148
- symlink: true,
208149
- workspaceDir: void 0
208150
- }, resolvedPkgs);
208151
208145
  try {
208152
- await symlinkDir(cachedDir, cacheLink, { overwrite: true });
208153
- } catch (error) {
208154
- if (!util42.types.isNativeError(error) || !("code" in error) || error.code !== "EBUSY" && error.code !== "EEXIST" && error.code !== "EPERM") {
208155
- throw error;
208146
+ fs90.mkdirSync(cachedDir, { recursive: true });
208147
+ await add_exports.handler({
208148
+ ...opts2,
208149
+ enableGlobalVirtualStore: opts2.enableGlobalVirtualStore ?? true,
208150
+ bin: path165.join(cachedDir, "node_modules/.bin"),
208151
+ dir: cachedDir,
208152
+ lockfileDir: cachedDir,
208153
+ allowBuilds: Object.fromEntries([...resolvedPkgAliases, ...opts2.allowBuild ?? []].map((pkg) => [pkg, true])),
208154
+ rootProjectManifestDir: cachedDir,
208155
+ saveProd: true,
208156
+ // dlx will be looking for the package in the "dependencies" field!
208157
+ saveDev: false,
208158
+ saveOptional: false,
208159
+ savePeer: false,
208160
+ symlink: true,
208161
+ workspaceDir: void 0
208162
+ }, resolvedPkgs);
208163
+ try {
208164
+ await symlinkDir(cachedDir, cacheLink, { overwrite: true });
208165
+ } catch (error) {
208166
+ if (!util42.types.isNativeError(error) || !("code" in error) || error.code !== "EBUSY" && error.code !== "EEXIST" && error.code !== "EPERM") {
208167
+ throw error;
208168
+ }
208169
+ }
208170
+ } catch (err) {
208171
+ const completedDir = getValidCacheDir(cacheLink, opts2.dlxCacheMaxAge);
208172
+ if (completedDir == null) {
208173
+ throw err;
208156
208174
  }
208175
+ cachedDir = completedDir;
208157
208176
  }
208158
208177
  }
208159
208178
  const binsDir = path165.join(cachedDir, "node_modules/.bin");
@@ -248696,7 +248715,11 @@ var init_shorthands = __esm({
248696
248715
 
248697
248716
  // lib/parseCliArgs.js
248698
248717
  async function parseCliArgs2(inputArgv) {
248699
- return parseCliArgs({
248718
+ const builtInCommandForced = inputArgv[0] === "pm";
248719
+ if (builtInCommandForced) {
248720
+ inputArgv.splice(0, 1);
248721
+ }
248722
+ const result2 = await parseCliArgs({
248700
248723
  fallbackCommand: "run",
248701
248724
  escapeArgs: ["create", "exec", "test"],
248702
248725
  getCommandLongName: getCommandFullName,
@@ -248706,6 +248729,7 @@ async function parseCliArgs2(inputArgv) {
248706
248729
  universalOptionsTypes: GLOBAL_OPTIONS,
248707
248730
  universalShorthands: shorthands18
248708
248731
  }, inputArgv);
248732
+ return { ...result2, builtInCommandForced };
248709
248733
  }
248710
248734
  var RENAMED_OPTIONS;
248711
248735
  var init_parseCliArgs = __esm({
@@ -267054,28 +267078,16 @@ async function main4(inputArgv) {
267054
267078
  process.exitCode = 1;
267055
267079
  return;
267056
267080
  }
267057
- let { argv: argv2, params: cliParams, options: cliOptions, cmd, fallbackCommandUsed, unknownOptions, workspaceDir } = parsedCliArgs;
267081
+ let { argv: argv2, params: cliParams, options: cliOptions, cmd, fallbackCommandUsed, builtInCommandForced, unknownOptions, workspaceDir } = parsedCliArgs;
267058
267082
  if (cmd !== null && !pnpmCmds[cmd]) {
267059
267083
  printError(`Unknown command '${cmd}'`, "For help, run: pnpm help");
267060
267084
  process.exitCode = 1;
267061
267085
  return;
267062
267086
  }
267063
267087
  if (unknownOptions.size > 0 && !fallbackCommandUsed && !(cmd && NOT_IMPLEMENTED_COMMAND_SET.has(cmd))) {
267064
- const unknownOptionsArray = Array.from(unknownOptions.keys());
267065
- if (unknownOptionsArray.every((option) => DEPRECATED_OPTIONS.has(option))) {
267066
- let deprecationMsg = `${source_default.bgYellow.black("\u2009WARN\u2009")}`;
267067
- if (unknownOptionsArray.length === 1) {
267068
- const deprecatedOption = unknownOptionsArray[0];
267069
- deprecationMsg += ` ${source_default.yellow(`Deprecated option: '${deprecatedOption}'`)}`;
267070
- } else {
267071
- deprecationMsg += ` ${source_default.yellow(`Deprecated options: ${unknownOptionsArray.map((unknownOption) => `'${unknownOption}'`).join(", ")}`)}`;
267072
- }
267073
- console.log(deprecationMsg);
267074
- } else {
267075
- printError(formatUnknownOptionsError(unknownOptions), `For help, run: pnpm help${cmd ? ` ${cmd}` : ""}`);
267076
- process.exitCode = 1;
267077
- return;
267078
- }
267088
+ printError(formatUnknownOptionsError(unknownOptions), `For help, run: pnpm help${cmd ? ` ${cmd}` : ""}`);
267089
+ process.exitCode = 1;
267090
+ return;
267079
267091
  }
267080
267092
  let config;
267081
267093
  try {
@@ -267154,7 +267166,7 @@ async function main4(inputArgv) {
267154
267166
  global[REPORTER_INITIALIZED] = reporterType;
267155
267167
  }
267156
267168
  const typedCommandName = argv2.remain[0];
267157
- if (cmd != null && overridableByScriptCommands.has(typedCommandName) && !cliOptions.global) {
267169
+ if (cmd != null && !builtInCommandForced && overridableByScriptCommands.has(typedCommandName) && !cliOptions.global) {
267158
267170
  const currentDirManifest = config.dir === config.rootProjectManifestDir ? config.rootProjectManifest : await safeReadProjectManifestOnly(config.dir);
267159
267171
  if (currentDirManifest?.scripts?.[typedCommandName]) {
267160
267172
  cmd = "run";
@@ -267324,7 +267336,7 @@ function checkPackageManager(pm2) {
267324
267336
  }
267325
267337
  }
267326
267338
  }
267327
- var import_loud_rejection, import_semver47, REPORTER_INITIALIZED, DEPRECATED_OPTIONS;
267339
+ var import_loud_rejection, import_semver47, REPORTER_INITIALIZED;
267328
267340
  var init_main2 = __esm({
267329
267341
  "lib/main.js"() {
267330
267342
  "use strict";
@@ -267357,11 +267369,6 @@ var init_main2 = __esm({
267357
267369
  }
267358
267370
  throw err;
267359
267371
  });
267360
- DEPRECATED_OPTIONS = /* @__PURE__ */ new Set([
267361
- "independent-leaves",
267362
- "lock",
267363
- "resolution-strategy"
267364
- ]);
267365
267372
  }
267366
267373
  });
267367
267374
 
package/dist/worker.js CHANGED
@@ -7096,11 +7096,10 @@ function createAutoImporter() {
7096
7096
  function initialAuto(to, opts2) {
7097
7097
  if (process.platform !== "win32") {
7098
7098
  try {
7099
- const _clonePkg = createClonePkg();
7100
- if (!_clonePkg(to, opts2))
7099
+ if (!tryClonePkg(to, opts2))
7101
7100
  return void 0;
7102
7101
  packageImportMethodLogger.debug({ method: "clone" });
7103
- auto = _clonePkg;
7102
+ auto = createClonePkg();
7104
7103
  return "clone";
7105
7104
  } catch {
7106
7105
  }
@@ -7131,11 +7130,10 @@ function createCloneOrCopyImporter() {
7131
7130
  return (to, opts2) => auto(to, opts2);
7132
7131
  function initialAuto(to, opts2) {
7133
7132
  try {
7134
- const _clonePkg = createClonePkg();
7135
- if (!_clonePkg(to, opts2))
7133
+ if (!tryClonePkg(to, opts2))
7136
7134
  return void 0;
7137
7135
  packageImportMethodLogger.debug({ method: "clone" });
7138
- auto = _clonePkg;
7136
+ auto = createClonePkg();
7139
7137
  return "clone";
7140
7138
  } catch {
7141
7139
  }
@@ -7144,6 +7142,14 @@ function createCloneOrCopyImporter() {
7144
7142
  return auto(to, opts2);
7145
7143
  }
7146
7144
  }
7145
+ function tryClonePkg(to, opts2) {
7146
+ if (opts2.resolvedFrom !== "store" || opts2.force || !pkgExistsAtTargetDir(to, opts2.filesMap)) {
7147
+ const clone = createCloneFunction();
7148
+ importIndexedDir({ importFile: clone, importFileAtomic: clone }, to, opts2.filesMap, opts2);
7149
+ return "clone";
7150
+ }
7151
+ return void 0;
7152
+ }
7147
7153
  function createClonePkg() {
7148
7154
  const clone = createCloneFunction();
7149
7155
  const withFallback = (fallback) => (src2, dest) => {
@@ -7181,10 +7187,13 @@ function pickFileFromFilesMap(filesMap) {
7181
7187
  }
7182
7188
  return filesMap.keys().next().value;
7183
7189
  }
7190
+ var _cloneFunction;
7184
7191
  function createCloneFunction() {
7192
+ if (_cloneFunction)
7193
+ return _cloneFunction;
7185
7194
  if (process.platform === "darwin" || process.platform === "win32") {
7186
7195
  const { reflinkFileSync } = __require("@reflink/reflink");
7187
- return (fr, to) => {
7196
+ _cloneFunction = (fr, to) => {
7188
7197
  try {
7189
7198
  reflinkFileSync(fr, to);
7190
7199
  } catch (err) {
@@ -7192,15 +7201,17 @@ function createCloneFunction() {
7192
7201
  throw err;
7193
7202
  }
7194
7203
  };
7204
+ } else {
7205
+ _cloneFunction = (src2, dest) => {
7206
+ try {
7207
+ lib_default.copyFileSync(src2, dest, constants.COPYFILE_FICLONE_FORCE);
7208
+ } catch (err) {
7209
+ if (!(util7.types.isNativeError(err) && "code" in err && err.code === "EEXIST"))
7210
+ throw err;
7211
+ }
7212
+ };
7195
7213
  }
7196
- return (src2, dest) => {
7197
- try {
7198
- lib_default.copyFileSync(src2, dest, constants.COPYFILE_FICLONE_FORCE);
7199
- } catch (err) {
7200
- if (!(util7.types.isNativeError(err) && "code" in err && err.code === "EEXIST"))
7201
- throw err;
7202
- }
7203
- };
7214
+ return _cloneFunction;
7204
7215
  }
7205
7216
  function hardlinkPkg(importFile, to, opts2) {
7206
7217
  if (opts2.force || shouldRelinkPkg(to, opts2)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/exe",
3
- "version": "11.0.0-beta.4-1",
3
+ "version": "11.0.0-beta.6",
4
4
  "description": "Fast, disk space efficient package manager",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -30,18 +30,18 @@
30
30
  "@reflink/reflink": "0.1.19"
31
31
  },
32
32
  "optionalDependencies": {
33
- "@pnpm/macos-arm64": "11.0.0-beta.4-1",
34
- "@pnpm/linux-arm64": "11.0.0-beta.4-1",
35
- "@pnpm/linux-x64": "11.0.0-beta.4-1",
36
- "@pnpm/macos-x64": "11.0.0-beta.4-1",
37
- "@pnpm/win-x64": "11.0.0-beta.4-1",
38
- "@pnpm/win-arm64": "11.0.0-beta.4-1"
33
+ "@pnpm/linux-arm64": "11.0.0-beta.6",
34
+ "@pnpm/macos-arm64": "11.0.0-beta.6",
35
+ "@pnpm/linux-x64": "11.0.0-beta.6",
36
+ "@pnpm/win-arm64": "11.0.0-beta.6",
37
+ "@pnpm/win-x64": "11.0.0-beta.6",
38
+ "@pnpm/macos-x64": "11.0.0-beta.6"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@jest/globals": "30.3.0",
42
42
  "execa": "npm:safe-execa@0.3.0",
43
43
  "tar": "^7.5.10",
44
- "@pnpm/exe": "11.0.0-beta.4-1",
44
+ "@pnpm/exe": "11.0.0-beta.6",
45
45
  "@pnpm/jest-config": "1000.0.5"
46
46
  },
47
47
  "jest": {