pnpm 7.27.1 → 7.28.0-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/dist/node_modules/.modules.yaml +2 -2
- package/dist/pnpm.cjs +117 -53
- package/package.json +1 -1
|
@@ -200,11 +200,11 @@ included:
|
|
|
200
200
|
injectedDeps: {}
|
|
201
201
|
layoutVersion: 5
|
|
202
202
|
nodeLinker: hoisted
|
|
203
|
-
packageManager: pnpm@7.27.
|
|
203
|
+
packageManager: pnpm@7.27.1
|
|
204
204
|
pendingBuilds:
|
|
205
205
|
- /node-gyp/9.3.1
|
|
206
206
|
- /encoding/0.1.13
|
|
207
|
-
prunedAt:
|
|
207
|
+
prunedAt: Mon, 20 Feb 2023 20:49:35 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: "pnpm" != null && true ? "pnpm" : "pnpm",
|
|
3247
|
-
version: "7.
|
|
3247
|
+
version: "7.28.0-0" != null && true ? "7.28.0-0" : "0.0.0"
|
|
3248
3248
|
};
|
|
3249
3249
|
var pkgJson;
|
|
3250
3250
|
if (require.main == null) {
|
|
@@ -45992,15 +45992,16 @@ var require_recursiveSummary = __commonJS({
|
|
|
45992
45992
|
exports2.throwOnCommandFail = void 0;
|
|
45993
45993
|
var error_1 = require_lib8();
|
|
45994
45994
|
var RecursiveFailError = class extends error_1.PnpmError {
|
|
45995
|
-
constructor(command, recursiveSummary) {
|
|
45996
|
-
super("RECURSIVE_FAIL", `"${command}" failed in ${
|
|
45997
|
-
this.
|
|
45998
|
-
this.passes = recursiveSummary.
|
|
45995
|
+
constructor(command, recursiveSummary, failures) {
|
|
45996
|
+
super("RECURSIVE_FAIL", `"${command}" failed in ${failures.length} packages`);
|
|
45997
|
+
this.failures = failures;
|
|
45998
|
+
this.passes = Object.values(recursiveSummary).filter(({ status }) => status === "passed").length;
|
|
45999
45999
|
}
|
|
46000
46000
|
};
|
|
46001
46001
|
function throwOnCommandFail(command, recursiveSummary) {
|
|
46002
|
-
|
|
46003
|
-
|
|
46002
|
+
const failures = Object.values(recursiveSummary).filter(({ status }) => status === "failure");
|
|
46003
|
+
if (failures.length > 0) {
|
|
46004
|
+
throw new RecursiveFailError(command, recursiveSummary, failures);
|
|
46004
46005
|
}
|
|
46005
46006
|
}
|
|
46006
46007
|
exports2.throwOnCommandFail = throwOnCommandFail;
|
|
@@ -113593,7 +113594,8 @@ var require_getPkgInfo2 = __commonJS({
|
|
|
113593
113594
|
license: manifest.license,
|
|
113594
113595
|
author: manifest.author,
|
|
113595
113596
|
homepage: manifest.homepage,
|
|
113596
|
-
repository: (manifest.repository && (typeof manifest.repository === "string" ? manifest.repository : manifest.repository.url)) ?? void 0
|
|
113597
|
+
repository: (manifest.repository && (typeof manifest.repository === "string" ? manifest.repository : manifest.repository.url)) ?? void 0,
|
|
113598
|
+
path: pkg.path
|
|
113597
113599
|
};
|
|
113598
113600
|
}
|
|
113599
113601
|
exports2.getPkgInfo = getPkgInfo;
|
|
@@ -113640,7 +113642,8 @@ var require_renderJson = __commonJS({
|
|
|
113640
113642
|
alias: node.alias,
|
|
113641
113643
|
from: node.name,
|
|
113642
113644
|
version: node.version,
|
|
113643
|
-
resolved: node.resolved
|
|
113645
|
+
resolved: node.resolved,
|
|
113646
|
+
path: node.path
|
|
113644
113647
|
};
|
|
113645
113648
|
if (Object.keys(subDependencies).length > 0) {
|
|
113646
113649
|
dep.dependencies = subDependencies;
|
|
@@ -113807,6 +113810,9 @@ ${depsLabel}
|
|
|
113807
113810
|
if (pkg.homepage) {
|
|
113808
113811
|
labelLines.push(pkg.homepage);
|
|
113809
113812
|
}
|
|
113813
|
+
if (pkg.path) {
|
|
113814
|
+
labelLines.push(pkg.path);
|
|
113815
|
+
}
|
|
113810
113816
|
return {
|
|
113811
113817
|
label: labelLines.join("\n"),
|
|
113812
113818
|
nodes
|
|
@@ -125993,7 +125999,7 @@ var require_implementation2 = __commonJS({
|
|
|
125993
125999
|
const warn = (message2) => {
|
|
125994
126000
|
logger_1.logger.info({ message: message2, prefix: opts.dir });
|
|
125995
126001
|
};
|
|
125996
|
-
const groups = chunks.map((chunk) => chunk.filter((depPath) => ctx.pkgsToRebuild.has(depPath)).map((depPath) => async () => {
|
|
126002
|
+
const groups = chunks.map((chunk) => chunk.filter((depPath) => ctx.pkgsToRebuild.has(depPath) && !ctx.skipped.has(depPath)).map((depPath) => async () => {
|
|
125997
126003
|
const pkgSnapshot = pkgSnapshots[depPath];
|
|
125998
126004
|
const pkgInfo = (0, lockfile_utils_1.nameVerFromPkgSnapshot)(depPath, pkgSnapshot);
|
|
125999
126005
|
const pkgRoots = opts.nodeLinker === "hoisted" ? (ctx.modulesFile?.hoistedLocations?.[depPath] ?? []).map((hoistedLocation) => path_1.default.join(opts.lockfileDir, hoistedLocation)) : [path_1.default.join(ctx.virtualStoreDir, dp.depPathToFilename(depPath), "node_modules", pkgInfo.name)];
|
|
@@ -126200,10 +126206,7 @@ var require_recursive = __commonJS({
|
|
|
126200
126206
|
storeDir: store.dir,
|
|
126201
126207
|
workspacePackages
|
|
126202
126208
|
});
|
|
126203
|
-
const result2 = {
|
|
126204
|
-
fails: [],
|
|
126205
|
-
passes: 0
|
|
126206
|
-
};
|
|
126209
|
+
const result2 = {};
|
|
126207
126210
|
const memReadLocalConfig = (0, mem_1.default)(config_1.readLocalConfig);
|
|
126208
126211
|
async function getImporters() {
|
|
126209
126212
|
const importers = [];
|
|
@@ -126237,6 +126240,7 @@ var require_recursive = __commonJS({
|
|
|
126237
126240
|
if (opts.ignoredPackages?.has(rootDir)) {
|
|
126238
126241
|
return;
|
|
126239
126242
|
}
|
|
126243
|
+
result2[rootDir] = { status: "running" };
|
|
126240
126244
|
const localConfig = await memReadLocalConfig(rootDir);
|
|
126241
126245
|
await rebuild([
|
|
126242
126246
|
{
|
|
@@ -126254,15 +126258,16 @@ var require_recursive = __commonJS({
|
|
|
126254
126258
|
...localConfig
|
|
126255
126259
|
}
|
|
126256
126260
|
});
|
|
126257
|
-
result2.
|
|
126261
|
+
result2[rootDir].status = "passed";
|
|
126258
126262
|
} catch (err) {
|
|
126259
126263
|
logger_1.logger.info(err);
|
|
126260
126264
|
if (!opts.bail) {
|
|
126261
|
-
result2
|
|
126265
|
+
result2[rootDir] = {
|
|
126266
|
+
status: "failure",
|
|
126262
126267
|
error: err,
|
|
126263
126268
|
message: err.message,
|
|
126264
126269
|
prefix: rootDir
|
|
126265
|
-
}
|
|
126270
|
+
};
|
|
126266
126271
|
return;
|
|
126267
126272
|
}
|
|
126268
126273
|
err["prefix"] = rootDir;
|
|
@@ -176607,7 +176612,16 @@ var require_lib129 = __commonJS({
|
|
|
176607
176612
|
storeDir: opts.storeDir,
|
|
176608
176613
|
virtualStoreDir
|
|
176609
176614
|
});
|
|
176610
|
-
|
|
176615
|
+
if (opts.useLockfile) {
|
|
176616
|
+
await (0, lockfile_file_1.writeLockfiles)({
|
|
176617
|
+
wantedLockfileDir: opts.lockfileDir,
|
|
176618
|
+
currentLockfileDir: virtualStoreDir,
|
|
176619
|
+
wantedLockfile,
|
|
176620
|
+
currentLockfile: filteredLockfile
|
|
176621
|
+
});
|
|
176622
|
+
} else {
|
|
176623
|
+
await (0, lockfile_file_1.writeCurrentLockfile)(virtualStoreDir, filteredLockfile);
|
|
176624
|
+
}
|
|
176611
176625
|
}
|
|
176612
176626
|
await Promise.all(depNodes.map(({ finishing }) => finishing));
|
|
176613
176627
|
core_loggers_1.summaryLogger.debug({ prefix: lockfileDir });
|
|
@@ -180501,7 +180515,9 @@ var require_resolveDependencies = __commonJS({
|
|
|
180501
180515
|
return missingPeers;
|
|
180502
180516
|
}
|
|
180503
180517
|
function pkgIsLeaf(pkg) {
|
|
180504
|
-
return (0, isEmpty_1.default)(pkg.dependencies ?? {}) && (0, isEmpty_1.default)(pkg.optionalDependencies ?? {}) && (0, isEmpty_1.default)(pkg.peerDependencies ?? {})
|
|
180518
|
+
return (0, isEmpty_1.default)(pkg.dependencies ?? {}) && (0, isEmpty_1.default)(pkg.optionalDependencies ?? {}) && (0, isEmpty_1.default)(pkg.peerDependencies ?? {}) && // Package manifests can declare peerDependenciesMeta without declaring
|
|
180519
|
+
// peerDependencies. peerDependenciesMeta implies the later.
|
|
180520
|
+
(0, isEmpty_1.default)(pkg.peerDependenciesMeta ?? {});
|
|
180505
180521
|
}
|
|
180506
180522
|
function getResolvedPackage(options) {
|
|
180507
180523
|
const peerDependencies = peerDependenciesWithoutOwn(options.pkg);
|
|
@@ -193281,6 +193297,7 @@ var require_install = __commonJS({
|
|
|
193281
193297
|
});
|
|
193282
193298
|
}
|
|
193283
193299
|
if (opts.lockfileOnly) {
|
|
193300
|
+
await (0, lockfile_file_1.writeWantedLockfile)(ctx.lockfileDir, ctx.wantedLockfile);
|
|
193284
193301
|
return projects.map((mutatedProject) => ctx.projects[mutatedProject.rootDir]);
|
|
193285
193302
|
}
|
|
193286
193303
|
if (!ctx.existsWantedLockfile) {
|
|
@@ -194558,10 +194575,7 @@ var require_recursive2 = __commonJS({
|
|
|
194558
194575
|
forceHoistPattern: typeof opts.rawLocalConfig?.["hoist-pattern"] !== "undefined" || typeof opts.rawLocalConfig?.["hoist"] !== "undefined",
|
|
194559
194576
|
forceShamefullyHoist: typeof opts.rawLocalConfig?.["shamefully-hoist"] !== "undefined"
|
|
194560
194577
|
});
|
|
194561
|
-
const result2 = {
|
|
194562
|
-
fails: [],
|
|
194563
|
-
passes: 0
|
|
194564
|
-
};
|
|
194578
|
+
const result2 = {};
|
|
194565
194579
|
const memReadLocalConfig = (0, mem_1.default)(config_1.readLocalConfig);
|
|
194566
194580
|
const updateToLatest = opts.update && opts.latest;
|
|
194567
194581
|
const includeDirect = opts.includeDirect ?? {
|
|
@@ -194708,6 +194722,7 @@ var require_recursive2 = __commonJS({
|
|
|
194708
194722
|
if (opts.ignoredPackages?.has(rootDir)) {
|
|
194709
194723
|
return;
|
|
194710
194724
|
}
|
|
194725
|
+
result2[rootDir] = { status: "running" };
|
|
194711
194726
|
const { manifest, writeProjectManifest } = manifestsByPath[rootDir];
|
|
194712
194727
|
let currentInput = [...params];
|
|
194713
194728
|
if (updateMatch != null) {
|
|
@@ -194774,15 +194789,16 @@ var require_recursive2 = __commonJS({
|
|
|
194774
194789
|
if (opts.save !== false) {
|
|
194775
194790
|
await writeProjectManifest(newManifest);
|
|
194776
194791
|
}
|
|
194777
|
-
result2.
|
|
194792
|
+
result2[rootDir].status = "passed";
|
|
194778
194793
|
} catch (err) {
|
|
194779
194794
|
logger_1.logger.info(err);
|
|
194780
194795
|
if (!opts.bail) {
|
|
194781
|
-
result2
|
|
194796
|
+
result2[rootDir] = {
|
|
194797
|
+
status: "failure",
|
|
194782
194798
|
error: err,
|
|
194783
194799
|
message: err.message,
|
|
194784
194800
|
prefix: rootDir
|
|
194785
|
-
}
|
|
194801
|
+
};
|
|
194786
194802
|
return;
|
|
194787
194803
|
}
|
|
194788
194804
|
err["prefix"] = rootDir;
|
|
@@ -194796,7 +194812,7 @@ var require_recursive2 = __commonJS({
|
|
|
194796
194812
|
}, []);
|
|
194797
194813
|
}
|
|
194798
194814
|
throwOnFail(result2);
|
|
194799
|
-
if (!result2.
|
|
194815
|
+
if (!Object.values(result2).filter(({ status }) => status === "passed").length && cmdFullName === "update" && opts.depth === 0) {
|
|
194800
194816
|
throw new error_1.PnpmError("NO_PACKAGE_IN_DEPENDENCIES", "None of the specified packages were found in the dependencies of any of the projects.");
|
|
194801
194817
|
}
|
|
194802
194818
|
return true;
|
|
@@ -219102,10 +219118,6 @@ var require_runRecursive = __commonJS({
|
|
|
219102
219118
|
selectedProjectsGraph: opts.selectedProjectsGraph
|
|
219103
219119
|
});
|
|
219104
219120
|
}
|
|
219105
|
-
const result2 = {
|
|
219106
|
-
fails: [],
|
|
219107
|
-
passes: 0
|
|
219108
|
-
};
|
|
219109
219121
|
const limitRun = (0, p_limit_12.default)(opts.workspaceConcurrency ?? 4);
|
|
219110
219122
|
const stdio = !opts.stream && (opts.workspaceConcurrency === 1 || packageChunks.length === 1 && packageChunks[0].length === 1) ? "inherit" : "pipe";
|
|
219111
219123
|
const existsPnp = existsInDir_1.existsInDir.bind(null, ".pnp.cjs");
|
|
@@ -219117,6 +219129,7 @@ var require_runRecursive = __commonJS({
|
|
|
219117
219129
|
throw new error_1.PnpmError("RECURSIVE_RUN_NO_SCRIPT", `Missing script "${scriptName}" in packages: ${missingScriptPackages.join(", ")}`);
|
|
219118
219130
|
}
|
|
219119
219131
|
}
|
|
219132
|
+
const result2 = (0, exec_1.createEmptyRecursiveSummary)(packageChunks);
|
|
219120
219133
|
for (const chunk of packageChunks) {
|
|
219121
219134
|
const selectedScripts = chunk.map((prefix) => {
|
|
219122
219135
|
const pkg = opts.selectedProjectsGraph[prefix];
|
|
@@ -219128,6 +219141,8 @@ var require_runRecursive = __commonJS({
|
|
|
219128
219141
|
if (!pkg.package.manifest.scripts?.[scriptName2] || process.env.npm_lifecycle_event === scriptName2 && process.env.PNPM_SCRIPT_SRC_DIR === prefix) {
|
|
219129
219142
|
return;
|
|
219130
219143
|
}
|
|
219144
|
+
result2[prefix].status = "running";
|
|
219145
|
+
const startTime = process.hrtime();
|
|
219131
219146
|
hasCommand++;
|
|
219132
219147
|
try {
|
|
219133
219148
|
const lifecycleOpts = {
|
|
@@ -219153,19 +219168,26 @@ var require_runRecursive = __commonJS({
|
|
|
219153
219168
|
}
|
|
219154
219169
|
const _runScript = run_1.runScript.bind(null, { manifest: pkg.package.manifest, lifecycleOpts, runScriptOptions: { enablePrePostScripts: opts.enablePrePostScripts ?? false }, passedThruArgs });
|
|
219155
219170
|
await _runScript(scriptName2);
|
|
219156
|
-
result2.
|
|
219171
|
+
result2[prefix].status = "passed";
|
|
219172
|
+
result2[prefix].duration = (0, exec_1.getExecutionDuration)(startTime);
|
|
219157
219173
|
} catch (err) {
|
|
219158
219174
|
logger_1.logger.info(err);
|
|
219175
|
+
result2[prefix] = {
|
|
219176
|
+
status: "failure",
|
|
219177
|
+
duration: (0, exec_1.getExecutionDuration)(startTime),
|
|
219178
|
+
error: err,
|
|
219179
|
+
message: err.message,
|
|
219180
|
+
prefix
|
|
219181
|
+
};
|
|
219159
219182
|
if (!opts.bail) {
|
|
219160
|
-
result2.fails.push({
|
|
219161
|
-
error: err,
|
|
219162
|
-
message: err.message,
|
|
219163
|
-
prefix
|
|
219164
|
-
});
|
|
219165
219183
|
return;
|
|
219166
219184
|
}
|
|
219167
219185
|
err["code"] = "ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL";
|
|
219168
219186
|
err["prefix"] = prefix;
|
|
219187
|
+
opts.reportSummary && await (0, exec_1.writeRecursiveSummary)({
|
|
219188
|
+
dir: opts.workspaceDir ?? opts.dir,
|
|
219189
|
+
summary: result2
|
|
219190
|
+
});
|
|
219169
219191
|
throw err;
|
|
219170
219192
|
}
|
|
219171
219193
|
})));
|
|
@@ -219181,6 +219203,10 @@ var require_runRecursive = __commonJS({
|
|
|
219181
219203
|
});
|
|
219182
219204
|
}
|
|
219183
219205
|
}
|
|
219206
|
+
opts.reportSummary && await (0, exec_1.writeRecursiveSummary)({
|
|
219207
|
+
dir: opts.workspaceDir ?? opts.dir,
|
|
219208
|
+
summary: result2
|
|
219209
|
+
});
|
|
219184
219210
|
(0, cli_utils_1.throwOnCommandFail)("pnpm recursive run", result2);
|
|
219185
219211
|
}
|
|
219186
219212
|
exports2.runRecursive = runRecursive;
|
|
@@ -219207,7 +219233,7 @@ var require_run = __commonJS({
|
|
|
219207
219233
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
219208
219234
|
};
|
|
219209
219235
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
219210
|
-
exports2.runScript = exports2.handler = exports2.help = exports2.commandNames = exports2.completion = exports2.cliOptionsTypes = exports2.rcOptionsTypes = exports2.shorthands = exports2.SEQUENTIAL_OPTION_HELP = exports2.RESUME_FROM_OPTION_HELP = exports2.PARALLEL_OPTION_HELP = exports2.IF_PRESENT_OPTION_HELP = exports2.IF_PRESENT_OPTION = void 0;
|
|
219236
|
+
exports2.runScript = exports2.handler = exports2.help = exports2.commandNames = exports2.completion = exports2.cliOptionsTypes = exports2.rcOptionsTypes = exports2.shorthands = exports2.REPORT_SUMMARY_OPTION_HELP = exports2.SEQUENTIAL_OPTION_HELP = exports2.RESUME_FROM_OPTION_HELP = exports2.PARALLEL_OPTION_HELP = exports2.IF_PRESENT_OPTION_HELP = exports2.IF_PRESENT_OPTION = void 0;
|
|
219211
219237
|
var path_1 = __importDefault3(require("path"));
|
|
219212
219238
|
var p_limit_12 = __importDefault3(require_p_limit());
|
|
219213
219239
|
var cli_utils_1 = require_lib27();
|
|
@@ -219240,6 +219266,10 @@ var require_run = __commonJS({
|
|
|
219240
219266
|
description: "Run the specified scripts one by one",
|
|
219241
219267
|
name: "--sequential"
|
|
219242
219268
|
};
|
|
219269
|
+
exports2.REPORT_SUMMARY_OPTION_HELP = {
|
|
219270
|
+
description: 'Save the execution results of every package to "pnpm-exec-summary.json". Useful to inspect the execution time and status of each package.',
|
|
219271
|
+
name: "--report-summary"
|
|
219272
|
+
};
|
|
219243
219273
|
exports2.shorthands = {
|
|
219244
219274
|
parallel: [
|
|
219245
219275
|
"--workspace-concurrency=Infinity",
|
|
@@ -219273,7 +219303,8 @@ var require_run = __commonJS({
|
|
|
219273
219303
|
...exports2.IF_PRESENT_OPTION,
|
|
219274
219304
|
recursive: Boolean,
|
|
219275
219305
|
reverse: Boolean,
|
|
219276
|
-
"resume-from": String
|
|
219306
|
+
"resume-from": String,
|
|
219307
|
+
"report-summary": Boolean
|
|
219277
219308
|
};
|
|
219278
219309
|
}
|
|
219279
219310
|
exports2.cliOptionsTypes = cliOptionsTypes;
|
|
@@ -219307,7 +219338,8 @@ var require_run = __commonJS({
|
|
|
219307
219338
|
exports2.PARALLEL_OPTION_HELP,
|
|
219308
219339
|
exports2.RESUME_FROM_OPTION_HELP,
|
|
219309
219340
|
...common_cli_options_help_1.UNIVERSAL_OPTIONS,
|
|
219310
|
-
exports2.SEQUENTIAL_OPTION_HELP
|
|
219341
|
+
exports2.SEQUENTIAL_OPTION_HELP,
|
|
219342
|
+
exports2.REPORT_SUMMARY_OPTION_HELP
|
|
219311
219343
|
]
|
|
219312
219344
|
},
|
|
219313
219345
|
common_cli_options_help_1.FILTERING
|
|
@@ -219496,7 +219528,8 @@ var require_exec = __commonJS({
|
|
|
219496
219528
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
219497
219529
|
};
|
|
219498
219530
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
219499
|
-
exports2.handler = exports2.getResumedPackageChunks = exports2.help = exports2.cliOptionsTypes = exports2.rcOptionsTypes = exports2.commandNames = exports2.shorthands = void 0;
|
|
219531
|
+
exports2.handler = exports2.getExecutionDuration = exports2.createEmptyRecursiveSummary = exports2.writeRecursiveSummary = exports2.getResumedPackageChunks = exports2.help = exports2.cliOptionsTypes = exports2.rcOptionsTypes = exports2.commandNames = exports2.shorthands = void 0;
|
|
219532
|
+
var path_1 = __importDefault3(require("path"));
|
|
219500
219533
|
var cli_utils_1 = require_lib27();
|
|
219501
219534
|
var config_1 = require_lib21();
|
|
219502
219535
|
var lifecycle_1 = require_lib58();
|
|
@@ -219511,6 +219544,7 @@ var require_exec = __commonJS({
|
|
|
219511
219544
|
var makeEnv_1 = require_makeEnv();
|
|
219512
219545
|
var run_1 = require_run();
|
|
219513
219546
|
var error_1 = require_lib8();
|
|
219547
|
+
var write_json_file_1 = __importDefault3(require_write_json_file());
|
|
219514
219548
|
exports2.shorthands = {
|
|
219515
219549
|
parallel: run_1.shorthands.parallel,
|
|
219516
219550
|
c: "--shell-mode"
|
|
@@ -219526,7 +219560,8 @@ var require_exec = __commonJS({
|
|
|
219526
219560
|
"workspace-concurrency"
|
|
219527
219561
|
], config_1.types),
|
|
219528
219562
|
"shell-mode": Boolean,
|
|
219529
|
-
"resume-from": String
|
|
219563
|
+
"resume-from": String,
|
|
219564
|
+
"report-summary": Boolean
|
|
219530
219565
|
};
|
|
219531
219566
|
}
|
|
219532
219567
|
exports2.rcOptionsTypes = rcOptionsTypes;
|
|
@@ -219554,7 +219589,8 @@ var require_exec = __commonJS({
|
|
|
219554
219589
|
name: "--shell-mode",
|
|
219555
219590
|
shortAlias: "-c"
|
|
219556
219591
|
},
|
|
219557
|
-
run_1.RESUME_FROM_OPTION_HELP
|
|
219592
|
+
run_1.RESUME_FROM_OPTION_HELP,
|
|
219593
|
+
run_1.REPORT_SUMMARY_OPTION_HELP
|
|
219558
219594
|
]
|
|
219559
219595
|
}
|
|
219560
219596
|
],
|
|
@@ -219572,15 +219608,29 @@ var require_exec = __commonJS({
|
|
|
219572
219608
|
return chunks.slice(chunkPosition);
|
|
219573
219609
|
}
|
|
219574
219610
|
exports2.getResumedPackageChunks = getResumedPackageChunks;
|
|
219611
|
+
async function writeRecursiveSummary(opts) {
|
|
219612
|
+
await (0, write_json_file_1.default)(path_1.default.join(opts.dir, "pnpm-exec-summary.json"), {
|
|
219613
|
+
executionStatus: opts.summary
|
|
219614
|
+
});
|
|
219615
|
+
}
|
|
219616
|
+
exports2.writeRecursiveSummary = writeRecursiveSummary;
|
|
219617
|
+
function createEmptyRecursiveSummary(chunks) {
|
|
219618
|
+
return chunks.flat().reduce((acc, prefix) => {
|
|
219619
|
+
acc[prefix] = { status: "queued" };
|
|
219620
|
+
return acc;
|
|
219621
|
+
}, {});
|
|
219622
|
+
}
|
|
219623
|
+
exports2.createEmptyRecursiveSummary = createEmptyRecursiveSummary;
|
|
219624
|
+
function getExecutionDuration(start) {
|
|
219625
|
+
const end = process.hrtime(start);
|
|
219626
|
+
return (end[0] * 1e9 + end[1]) / 1e6;
|
|
219627
|
+
}
|
|
219628
|
+
exports2.getExecutionDuration = getExecutionDuration;
|
|
219575
219629
|
async function handler(opts, params) {
|
|
219576
219630
|
if (params[0] === "--") {
|
|
219577
219631
|
params.shift();
|
|
219578
219632
|
}
|
|
219579
219633
|
const limitRun = (0, p_limit_12.default)(opts.workspaceConcurrency ?? 4);
|
|
219580
|
-
const result2 = {
|
|
219581
|
-
fails: [],
|
|
219582
|
-
passes: 0
|
|
219583
|
-
};
|
|
219584
219634
|
let chunks;
|
|
219585
219635
|
if (opts.recursive) {
|
|
219586
219636
|
chunks = opts.sort ? (0, sort_packages_1.sortPackages)(opts.selectedProjectsGraph) : [Object.keys(opts.selectedProjectsGraph).sort()];
|
|
@@ -219609,11 +219659,14 @@ var require_exec = __commonJS({
|
|
|
219609
219659
|
selectedProjectsGraph: opts.selectedProjectsGraph
|
|
219610
219660
|
});
|
|
219611
219661
|
}
|
|
219662
|
+
const result2 = createEmptyRecursiveSummary(chunks);
|
|
219612
219663
|
const existsPnp = existsInDir_1.existsInDir.bind(null, ".pnp.cjs");
|
|
219613
219664
|
const workspacePnpPath = opts.workspaceDir && await existsPnp(opts.workspaceDir);
|
|
219614
219665
|
let exitCode = 0;
|
|
219615
219666
|
for (const chunk of chunks) {
|
|
219616
219667
|
await Promise.all(chunk.map(async (prefix) => limitRun(async () => {
|
|
219668
|
+
result2[prefix].status = "running";
|
|
219669
|
+
const startTime = process.hrtime();
|
|
219617
219670
|
try {
|
|
219618
219671
|
const pnpPath = workspacePnpPath ?? await existsPnp(prefix);
|
|
219619
219672
|
const extraEnv = {
|
|
@@ -219637,29 +219690,40 @@ var require_exec = __commonJS({
|
|
|
219637
219690
|
stdio: "inherit",
|
|
219638
219691
|
shell: opts.shellMode ?? false
|
|
219639
219692
|
});
|
|
219640
|
-
result2.
|
|
219693
|
+
result2[prefix].status = "passed";
|
|
219694
|
+
result2[prefix].duration = getExecutionDuration(startTime);
|
|
219641
219695
|
} catch (err) {
|
|
219642
219696
|
if (!opts.recursive && typeof err.exitCode === "number") {
|
|
219643
219697
|
exitCode = err.exitCode;
|
|
219644
219698
|
return;
|
|
219645
219699
|
}
|
|
219646
219700
|
logger_1.logger.info(err);
|
|
219701
|
+
result2[prefix] = {
|
|
219702
|
+
status: "failure",
|
|
219703
|
+
duration: getExecutionDuration(startTime),
|
|
219704
|
+
error: err,
|
|
219705
|
+
message: err.message,
|
|
219706
|
+
prefix
|
|
219707
|
+
};
|
|
219647
219708
|
if (!opts.bail) {
|
|
219648
|
-
result2.fails.push({
|
|
219649
|
-
error: err,
|
|
219650
|
-
message: err.message,
|
|
219651
|
-
prefix
|
|
219652
|
-
});
|
|
219653
219709
|
return;
|
|
219654
219710
|
}
|
|
219655
219711
|
if (!err["code"]?.startsWith("ERR_PNPM_")) {
|
|
219656
219712
|
err["code"] = "ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL";
|
|
219657
219713
|
}
|
|
219658
219714
|
err["prefix"] = prefix;
|
|
219715
|
+
opts.reportSummary && await writeRecursiveSummary({
|
|
219716
|
+
dir: opts.lockfileDir ?? opts.dir,
|
|
219717
|
+
summary: result2
|
|
219718
|
+
});
|
|
219659
219719
|
throw err;
|
|
219660
219720
|
}
|
|
219661
219721
|
})));
|
|
219662
219722
|
}
|
|
219723
|
+
opts.reportSummary && await writeRecursiveSummary({
|
|
219724
|
+
dir: opts.lockfileDir ?? opts.dir,
|
|
219725
|
+
summary: result2
|
|
219726
|
+
});
|
|
219663
219727
|
(0, cli_utils_1.throwOnCommandFail)("pnpm recursive exec", result2);
|
|
219664
219728
|
return { exitCode };
|
|
219665
219729
|
}
|