pnpm 10.34.3 → 10.34.4
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 +92 -92
- package/dist/node_modules/.pnpm/lock.yaml +2 -2
- package/dist/node_modules/.pnpm-workspace-state-v1.json +3 -3
- package/dist/pnpm.cjs +362 -205
- package/dist/worker.js +1303 -10
- package/package.json +1 -1
package/dist/pnpm.cjs
CHANGED
|
@@ -2973,7 +2973,7 @@ var require_lib4 = __commonJS({
|
|
|
2973
2973
|
var load_json_file_1 = __importDefault2(require_load_json_file());
|
|
2974
2974
|
var defaultManifest = {
|
|
2975
2975
|
name: true ? "pnpm" : "pnpm",
|
|
2976
|
-
version: true ? "10.34.
|
|
2976
|
+
version: true ? "10.34.4" : "0.0.0"
|
|
2977
2977
|
};
|
|
2978
2978
|
var pkgJson;
|
|
2979
2979
|
if (require.main == null) {
|
|
@@ -16935,8 +16935,9 @@ var require_dropUntrustedEnvExpansions = __commonJS({
|
|
|
16935
16935
|
return /\$\{[^}]+\}/.test(value);
|
|
16936
16936
|
}
|
|
16937
16937
|
var DOCS_URL = "https://pnpm.io/npmrc";
|
|
16938
|
+
var SHELL_SAFE_KEY = /^[\w@.:/-]+$/;
|
|
16938
16939
|
function configSetExample(key) {
|
|
16939
|
-
return
|
|
16940
|
+
return SHELL_SAFE_KEY.test(key) ? ` (for example, run: pnpm config set "${key}" <value>)` : "";
|
|
16940
16941
|
}
|
|
16941
16942
|
function warnIgnoredRequestDestinationEnv(filePath, key, warnings) {
|
|
16942
16943
|
warnings.push(`Ignored project-level request destination "${key}" in "${filePath}": environment variables are not expanded in registry or proxy URLs that come from a project .npmrc, because that file is committed to the repository and a malicious value could redirect requests or leak secrets. Move this setting to a trusted source that pnpm still expands \u2014 put it in your user-level ~/.npmrc, or set it with pnpm config set${configSetExample(key)}. If the value is not secret, you can also write it literally in the project .npmrc. See ${DOCS_URL}`);
|
|
@@ -117195,6 +117196,209 @@ var require_lib96 = __commonJS({
|
|
|
117195
117196
|
}
|
|
117196
117197
|
});
|
|
117197
117198
|
|
|
117199
|
+
// ../node_modules/.pnpm/builtins@5.1.0/node_modules/builtins/index.js
|
|
117200
|
+
var require_builtins2 = __commonJS({
|
|
117201
|
+
"../node_modules/.pnpm/builtins@5.1.0/node_modules/builtins/index.js"(exports2, module2) {
|
|
117202
|
+
"use strict";
|
|
117203
|
+
var satisfies = require_satisfies();
|
|
117204
|
+
var permanentModules = [
|
|
117205
|
+
"assert",
|
|
117206
|
+
"buffer",
|
|
117207
|
+
"child_process",
|
|
117208
|
+
"cluster",
|
|
117209
|
+
"console",
|
|
117210
|
+
"constants",
|
|
117211
|
+
"crypto",
|
|
117212
|
+
"dgram",
|
|
117213
|
+
"dns",
|
|
117214
|
+
"domain",
|
|
117215
|
+
"events",
|
|
117216
|
+
"fs",
|
|
117217
|
+
"http",
|
|
117218
|
+
"https",
|
|
117219
|
+
"module",
|
|
117220
|
+
"net",
|
|
117221
|
+
"os",
|
|
117222
|
+
"path",
|
|
117223
|
+
"punycode",
|
|
117224
|
+
"querystring",
|
|
117225
|
+
"readline",
|
|
117226
|
+
"repl",
|
|
117227
|
+
"stream",
|
|
117228
|
+
"string_decoder",
|
|
117229
|
+
"sys",
|
|
117230
|
+
"timers",
|
|
117231
|
+
"tls",
|
|
117232
|
+
"tty",
|
|
117233
|
+
"url",
|
|
117234
|
+
"util",
|
|
117235
|
+
"vm",
|
|
117236
|
+
"zlib"
|
|
117237
|
+
];
|
|
117238
|
+
var versionLockedModules = {
|
|
117239
|
+
freelist: "<6.0.0",
|
|
117240
|
+
v8: ">=1.0.0",
|
|
117241
|
+
process: ">=1.1.0",
|
|
117242
|
+
inspector: ">=8.0.0",
|
|
117243
|
+
async_hooks: ">=8.1.0",
|
|
117244
|
+
http2: ">=8.4.0",
|
|
117245
|
+
perf_hooks: ">=8.5.0",
|
|
117246
|
+
trace_events: ">=10.0.0",
|
|
117247
|
+
worker_threads: ">=12.0.0",
|
|
117248
|
+
"node:test": ">=18.0.0"
|
|
117249
|
+
};
|
|
117250
|
+
var experimentalModules = {
|
|
117251
|
+
worker_threads: ">=10.5.0",
|
|
117252
|
+
wasi: ">=12.16.0",
|
|
117253
|
+
diagnostics_channel: "^14.17.0 || >=15.1.0"
|
|
117254
|
+
};
|
|
117255
|
+
module2.exports = ({ version: version2 = process.version, experimental = false } = {}) => {
|
|
117256
|
+
const builtins = [...permanentModules];
|
|
117257
|
+
for (const [name, semverRange] of Object.entries(versionLockedModules)) {
|
|
117258
|
+
if (version2 === "*" || satisfies(version2, semverRange)) {
|
|
117259
|
+
builtins.push(name);
|
|
117260
|
+
}
|
|
117261
|
+
}
|
|
117262
|
+
if (experimental) {
|
|
117263
|
+
for (const [name, semverRange] of Object.entries(experimentalModules)) {
|
|
117264
|
+
if (!builtins.includes(name) && (version2 === "*" || satisfies(version2, semverRange))) {
|
|
117265
|
+
builtins.push(name);
|
|
117266
|
+
}
|
|
117267
|
+
}
|
|
117268
|
+
}
|
|
117269
|
+
return builtins;
|
|
117270
|
+
};
|
|
117271
|
+
}
|
|
117272
|
+
});
|
|
117273
|
+
|
|
117274
|
+
// ../node_modules/.pnpm/validate-npm-package-name@5.0.0/node_modules/validate-npm-package-name/lib/index.js
|
|
117275
|
+
var require_lib97 = __commonJS({
|
|
117276
|
+
"../node_modules/.pnpm/validate-npm-package-name@5.0.0/node_modules/validate-npm-package-name/lib/index.js"(exports2, module2) {
|
|
117277
|
+
"use strict";
|
|
117278
|
+
var scopedPackagePattern = new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$");
|
|
117279
|
+
var builtins = require_builtins2();
|
|
117280
|
+
var blacklist = [
|
|
117281
|
+
"node_modules",
|
|
117282
|
+
"favicon.ico"
|
|
117283
|
+
];
|
|
117284
|
+
function validate2(name) {
|
|
117285
|
+
var warnings = [];
|
|
117286
|
+
var errors = [];
|
|
117287
|
+
if (name === null) {
|
|
117288
|
+
errors.push("name cannot be null");
|
|
117289
|
+
return done(warnings, errors);
|
|
117290
|
+
}
|
|
117291
|
+
if (name === void 0) {
|
|
117292
|
+
errors.push("name cannot be undefined");
|
|
117293
|
+
return done(warnings, errors);
|
|
117294
|
+
}
|
|
117295
|
+
if (typeof name !== "string") {
|
|
117296
|
+
errors.push("name must be a string");
|
|
117297
|
+
return done(warnings, errors);
|
|
117298
|
+
}
|
|
117299
|
+
if (!name.length) {
|
|
117300
|
+
errors.push("name length must be greater than zero");
|
|
117301
|
+
}
|
|
117302
|
+
if (name.match(/^\./)) {
|
|
117303
|
+
errors.push("name cannot start with a period");
|
|
117304
|
+
}
|
|
117305
|
+
if (name.match(/^_/)) {
|
|
117306
|
+
errors.push("name cannot start with an underscore");
|
|
117307
|
+
}
|
|
117308
|
+
if (name.trim() !== name) {
|
|
117309
|
+
errors.push("name cannot contain leading or trailing spaces");
|
|
117310
|
+
}
|
|
117311
|
+
blacklist.forEach(function(blacklistedName) {
|
|
117312
|
+
if (name.toLowerCase() === blacklistedName) {
|
|
117313
|
+
errors.push(blacklistedName + " is a blacklisted name");
|
|
117314
|
+
}
|
|
117315
|
+
});
|
|
117316
|
+
builtins({ version: "*" }).forEach(function(builtin) {
|
|
117317
|
+
if (name.toLowerCase() === builtin) {
|
|
117318
|
+
warnings.push(builtin + " is a core module name");
|
|
117319
|
+
}
|
|
117320
|
+
});
|
|
117321
|
+
if (name.length > 214) {
|
|
117322
|
+
warnings.push("name can no longer contain more than 214 characters");
|
|
117323
|
+
}
|
|
117324
|
+
if (name.toLowerCase() !== name) {
|
|
117325
|
+
warnings.push("name can no longer contain capital letters");
|
|
117326
|
+
}
|
|
117327
|
+
if (/[~'!()*]/.test(name.split("/").slice(-1)[0])) {
|
|
117328
|
+
warnings.push(`name can no longer contain special characters ("~'!()*")`);
|
|
117329
|
+
}
|
|
117330
|
+
if (encodeURIComponent(name) !== name) {
|
|
117331
|
+
var nameMatch = name.match(scopedPackagePattern);
|
|
117332
|
+
if (nameMatch) {
|
|
117333
|
+
var user = nameMatch[1];
|
|
117334
|
+
var pkg = nameMatch[2];
|
|
117335
|
+
if (encodeURIComponent(user) === user && encodeURIComponent(pkg) === pkg) {
|
|
117336
|
+
return done(warnings, errors);
|
|
117337
|
+
}
|
|
117338
|
+
}
|
|
117339
|
+
errors.push("name can only contain URL-friendly characters");
|
|
117340
|
+
}
|
|
117341
|
+
return done(warnings, errors);
|
|
117342
|
+
}
|
|
117343
|
+
var done = function(warnings, errors) {
|
|
117344
|
+
var result2 = {
|
|
117345
|
+
validForNewPackages: errors.length === 0 && warnings.length === 0,
|
|
117346
|
+
validForOldPackages: errors.length === 0,
|
|
117347
|
+
warnings,
|
|
117348
|
+
errors
|
|
117349
|
+
};
|
|
117350
|
+
if (!result2.warnings.length) {
|
|
117351
|
+
delete result2.warnings;
|
|
117352
|
+
}
|
|
117353
|
+
if (!result2.errors.length) {
|
|
117354
|
+
delete result2.errors;
|
|
117355
|
+
}
|
|
117356
|
+
return result2;
|
|
117357
|
+
};
|
|
117358
|
+
module2.exports = validate2;
|
|
117359
|
+
}
|
|
117360
|
+
});
|
|
117361
|
+
|
|
117362
|
+
// ../config/deps-installer/lib/assertValidConfigDepName.js
|
|
117363
|
+
var require_assertValidConfigDepName = __commonJS({
|
|
117364
|
+
"../config/deps-installer/lib/assertValidConfigDepName.js"(exports2) {
|
|
117365
|
+
"use strict";
|
|
117366
|
+
var __importDefault2 = exports2 && exports2.__importDefault || function(mod) {
|
|
117367
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
117368
|
+
};
|
|
117369
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
117370
|
+
exports2.assertValidConfigDepName = assertValidConfigDepName;
|
|
117371
|
+
var error_1 = require_lib6();
|
|
117372
|
+
var validate_npm_package_name_1 = __importDefault2(require_lib97());
|
|
117373
|
+
function assertValidConfigDepName(name) {
|
|
117374
|
+
if (!(0, validate_npm_package_name_1.default)(name).validForOldPackages) {
|
|
117375
|
+
throw new error_1.PnpmError("INVALID_DEPENDENCY_NAME", `The configDependencies in pnpm-workspace.yaml contains a dependency with an invalid name: ${JSON.stringify(name)}`, {
|
|
117376
|
+
hint: "A dependency name must be a valid npm package name \u2014 a single `name` or `@scope/name` consisting of URL-friendly characters, with no leading `.` or `_`, and not equal to reserved names such as `node_modules`."
|
|
117377
|
+
});
|
|
117378
|
+
}
|
|
117379
|
+
}
|
|
117380
|
+
}
|
|
117381
|
+
});
|
|
117382
|
+
|
|
117383
|
+
// ../config/deps-installer/lib/assertValidConfigDepVersion.js
|
|
117384
|
+
var require_assertValidConfigDepVersion = __commonJS({
|
|
117385
|
+
"../config/deps-installer/lib/assertValidConfigDepVersion.js"(exports2) {
|
|
117386
|
+
"use strict";
|
|
117387
|
+
var __importDefault2 = exports2 && exports2.__importDefault || function(mod) {
|
|
117388
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
117389
|
+
};
|
|
117390
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
117391
|
+
exports2.assertValidConfigDepVersion = assertValidConfigDepVersion;
|
|
117392
|
+
var error_1 = require_lib6();
|
|
117393
|
+
var semver_12 = __importDefault2(require_semver2());
|
|
117394
|
+
function assertValidConfigDepVersion(name, version2) {
|
|
117395
|
+
if (semver_12.default.valid(version2) == null) {
|
|
117396
|
+
throw new error_1.PnpmError("INVALID_CONFIG_DEP_VERSION", `The config dependency "${name}" has an invalid version "${version2}"`, { hint: "A config dependency version must be an exact semver version." });
|
|
117397
|
+
}
|
|
117398
|
+
}
|
|
117399
|
+
}
|
|
117400
|
+
});
|
|
117401
|
+
|
|
117198
117402
|
// ../config/deps-installer/lib/normalizeConfigDeps.js
|
|
117199
117403
|
var require_normalizeConfigDeps = __commonJS({
|
|
117200
117404
|
"../config/deps-installer/lib/normalizeConfigDeps.js"(exports2) {
|
|
@@ -117207,12 +117411,16 @@ var require_normalizeConfigDeps = __commonJS({
|
|
|
117207
117411
|
var get_npm_tarball_url_1 = __importDefault2(require_lib96());
|
|
117208
117412
|
var error_1 = require_lib6();
|
|
117209
117413
|
var pick_registry_for_package_1 = require_lib44();
|
|
117414
|
+
var assertValidConfigDepName_js_1 = require_assertValidConfigDepName();
|
|
117415
|
+
var assertValidConfigDepVersion_js_1 = require_assertValidConfigDepVersion();
|
|
117210
117416
|
function normalizeConfigDeps(configDependencies, opts) {
|
|
117211
117417
|
const deps = {};
|
|
117212
117418
|
for (const [pkgName, pkgSpec] of Object.entries(configDependencies)) {
|
|
117419
|
+
(0, assertValidConfigDepName_js_1.assertValidConfigDepName)(pkgName);
|
|
117213
117420
|
const registry = (0, pick_registry_for_package_1.pickRegistryForPackage)(opts.registries, pkgName);
|
|
117214
117421
|
if (typeof pkgSpec === "object") {
|
|
117215
117422
|
const { version: version2, integrity } = parseIntegrity(pkgName, pkgSpec.integrity);
|
|
117423
|
+
(0, assertValidConfigDepVersion_js_1.assertValidConfigDepVersion)(pkgName, version2);
|
|
117216
117424
|
deps[pkgName] = {
|
|
117217
117425
|
version: version2,
|
|
117218
117426
|
resolution: {
|
|
@@ -117224,6 +117432,7 @@ var require_normalizeConfigDeps = __commonJS({
|
|
|
117224
117432
|
}
|
|
117225
117433
|
if (typeof pkgSpec === "string") {
|
|
117226
117434
|
const { version: version2, integrity } = parseIntegrity(pkgName, pkgSpec);
|
|
117435
|
+
(0, assertValidConfigDepVersion_js_1.assertValidConfigDepVersion)(pkgName, version2);
|
|
117227
117436
|
deps[pkgName] = {
|
|
117228
117437
|
version: version2,
|
|
117229
117438
|
resolution: {
|
|
@@ -124781,7 +124990,7 @@ var require_patchDocument = __commonJS({
|
|
|
124781
124990
|
});
|
|
124782
124991
|
|
|
124783
124992
|
// ../yaml/document-sync/lib/index.js
|
|
124784
|
-
var
|
|
124993
|
+
var require_lib98 = __commonJS({
|
|
124785
124994
|
"../yaml/document-sync/lib/index.js"(exports2) {
|
|
124786
124995
|
"use strict";
|
|
124787
124996
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -124871,7 +125080,7 @@ var require_sort_keys = __commonJS({
|
|
|
124871
125080
|
});
|
|
124872
125081
|
|
|
124873
125082
|
// ../object/key-sorting/lib/index.js
|
|
124874
|
-
var
|
|
125083
|
+
var require_lib99 = __commonJS({
|
|
124875
125084
|
"../object/key-sorting/lib/index.js"(exports2) {
|
|
124876
125085
|
"use strict";
|
|
124877
125086
|
var __importDefault2 = exports2 && exports2.__importDefault || function(mod) {
|
|
@@ -124917,7 +125126,7 @@ var require_lib98 = __commonJS({
|
|
|
124917
125126
|
});
|
|
124918
125127
|
|
|
124919
125128
|
// ../workspace/manifest-writer/lib/index.js
|
|
124920
|
-
var
|
|
125129
|
+
var require_lib100 = __commonJS({
|
|
124921
125130
|
"../workspace/manifest-writer/lib/index.js"(exports2) {
|
|
124922
125131
|
"use strict";
|
|
124923
125132
|
var __importDefault2 = exports2 && exports2.__importDefault || function(mod) {
|
|
@@ -124930,11 +125139,11 @@ var require_lib99 = __commonJS({
|
|
|
124930
125139
|
var util_1 = __importDefault2(require("util"));
|
|
124931
125140
|
var workspace_read_manifest_1 = require_lib22();
|
|
124932
125141
|
var constants_1 = require_lib5();
|
|
124933
|
-
var yaml_document_sync_1 =
|
|
125142
|
+
var yaml_document_sync_1 = require_lib98();
|
|
124934
125143
|
var equals_1 = __importDefault2(require_equals2());
|
|
124935
125144
|
var yaml_1 = __importDefault2(require_dist20());
|
|
124936
125145
|
var write_file_atomic_1 = __importDefault2(require_lib14());
|
|
124937
|
-
var object_key_sorting_1 =
|
|
125146
|
+
var object_key_sorting_1 = require_lib99();
|
|
124938
125147
|
async function writeManifestFile(dir, manifest) {
|
|
124939
125148
|
const manifestStr = manifest.toString({
|
|
124940
125149
|
lineWidth: 0,
|
|
@@ -125113,7 +125322,7 @@ var require_lib99 = __commonJS({
|
|
|
125113
125322
|
});
|
|
125114
125323
|
|
|
125115
125324
|
// ../config/config-writer/lib/index.js
|
|
125116
|
-
var
|
|
125325
|
+
var require_lib101 = __commonJS({
|
|
125117
125326
|
"../config/config-writer/lib/index.js"(exports2) {
|
|
125118
125327
|
"use strict";
|
|
125119
125328
|
var __importDefault2 = exports2 && exports2.__importDefault || function(mod) {
|
|
@@ -125122,7 +125331,7 @@ var require_lib100 = __commonJS({
|
|
|
125122
125331
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
125123
125332
|
exports2.writeSettings = writeSettings;
|
|
125124
125333
|
var read_project_manifest_1 = require_lib17();
|
|
125125
|
-
var workspace_manifest_writer_1 =
|
|
125334
|
+
var workspace_manifest_writer_1 = require_lib100();
|
|
125126
125335
|
var equals_1 = __importDefault2(require_equals2());
|
|
125127
125336
|
async function writeSettings(opts) {
|
|
125128
125337
|
if (opts.rootProjectManifest?.pnpm != null) {
|
|
@@ -125168,169 +125377,6 @@ var require_lib100 = __commonJS({
|
|
|
125168
125377
|
}
|
|
125169
125378
|
});
|
|
125170
125379
|
|
|
125171
|
-
// ../node_modules/.pnpm/builtins@5.1.0/node_modules/builtins/index.js
|
|
125172
|
-
var require_builtins2 = __commonJS({
|
|
125173
|
-
"../node_modules/.pnpm/builtins@5.1.0/node_modules/builtins/index.js"(exports2, module2) {
|
|
125174
|
-
"use strict";
|
|
125175
|
-
var satisfies = require_satisfies();
|
|
125176
|
-
var permanentModules = [
|
|
125177
|
-
"assert",
|
|
125178
|
-
"buffer",
|
|
125179
|
-
"child_process",
|
|
125180
|
-
"cluster",
|
|
125181
|
-
"console",
|
|
125182
|
-
"constants",
|
|
125183
|
-
"crypto",
|
|
125184
|
-
"dgram",
|
|
125185
|
-
"dns",
|
|
125186
|
-
"domain",
|
|
125187
|
-
"events",
|
|
125188
|
-
"fs",
|
|
125189
|
-
"http",
|
|
125190
|
-
"https",
|
|
125191
|
-
"module",
|
|
125192
|
-
"net",
|
|
125193
|
-
"os",
|
|
125194
|
-
"path",
|
|
125195
|
-
"punycode",
|
|
125196
|
-
"querystring",
|
|
125197
|
-
"readline",
|
|
125198
|
-
"repl",
|
|
125199
|
-
"stream",
|
|
125200
|
-
"string_decoder",
|
|
125201
|
-
"sys",
|
|
125202
|
-
"timers",
|
|
125203
|
-
"tls",
|
|
125204
|
-
"tty",
|
|
125205
|
-
"url",
|
|
125206
|
-
"util",
|
|
125207
|
-
"vm",
|
|
125208
|
-
"zlib"
|
|
125209
|
-
];
|
|
125210
|
-
var versionLockedModules = {
|
|
125211
|
-
freelist: "<6.0.0",
|
|
125212
|
-
v8: ">=1.0.0",
|
|
125213
|
-
process: ">=1.1.0",
|
|
125214
|
-
inspector: ">=8.0.0",
|
|
125215
|
-
async_hooks: ">=8.1.0",
|
|
125216
|
-
http2: ">=8.4.0",
|
|
125217
|
-
perf_hooks: ">=8.5.0",
|
|
125218
|
-
trace_events: ">=10.0.0",
|
|
125219
|
-
worker_threads: ">=12.0.0",
|
|
125220
|
-
"node:test": ">=18.0.0"
|
|
125221
|
-
};
|
|
125222
|
-
var experimentalModules = {
|
|
125223
|
-
worker_threads: ">=10.5.0",
|
|
125224
|
-
wasi: ">=12.16.0",
|
|
125225
|
-
diagnostics_channel: "^14.17.0 || >=15.1.0"
|
|
125226
|
-
};
|
|
125227
|
-
module2.exports = ({ version: version2 = process.version, experimental = false } = {}) => {
|
|
125228
|
-
const builtins = [...permanentModules];
|
|
125229
|
-
for (const [name, semverRange] of Object.entries(versionLockedModules)) {
|
|
125230
|
-
if (version2 === "*" || satisfies(version2, semverRange)) {
|
|
125231
|
-
builtins.push(name);
|
|
125232
|
-
}
|
|
125233
|
-
}
|
|
125234
|
-
if (experimental) {
|
|
125235
|
-
for (const [name, semverRange] of Object.entries(experimentalModules)) {
|
|
125236
|
-
if (!builtins.includes(name) && (version2 === "*" || satisfies(version2, semverRange))) {
|
|
125237
|
-
builtins.push(name);
|
|
125238
|
-
}
|
|
125239
|
-
}
|
|
125240
|
-
}
|
|
125241
|
-
return builtins;
|
|
125242
|
-
};
|
|
125243
|
-
}
|
|
125244
|
-
});
|
|
125245
|
-
|
|
125246
|
-
// ../node_modules/.pnpm/validate-npm-package-name@5.0.0/node_modules/validate-npm-package-name/lib/index.js
|
|
125247
|
-
var require_lib101 = __commonJS({
|
|
125248
|
-
"../node_modules/.pnpm/validate-npm-package-name@5.0.0/node_modules/validate-npm-package-name/lib/index.js"(exports2, module2) {
|
|
125249
|
-
"use strict";
|
|
125250
|
-
var scopedPackagePattern = new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$");
|
|
125251
|
-
var builtins = require_builtins2();
|
|
125252
|
-
var blacklist = [
|
|
125253
|
-
"node_modules",
|
|
125254
|
-
"favicon.ico"
|
|
125255
|
-
];
|
|
125256
|
-
function validate2(name) {
|
|
125257
|
-
var warnings = [];
|
|
125258
|
-
var errors = [];
|
|
125259
|
-
if (name === null) {
|
|
125260
|
-
errors.push("name cannot be null");
|
|
125261
|
-
return done(warnings, errors);
|
|
125262
|
-
}
|
|
125263
|
-
if (name === void 0) {
|
|
125264
|
-
errors.push("name cannot be undefined");
|
|
125265
|
-
return done(warnings, errors);
|
|
125266
|
-
}
|
|
125267
|
-
if (typeof name !== "string") {
|
|
125268
|
-
errors.push("name must be a string");
|
|
125269
|
-
return done(warnings, errors);
|
|
125270
|
-
}
|
|
125271
|
-
if (!name.length) {
|
|
125272
|
-
errors.push("name length must be greater than zero");
|
|
125273
|
-
}
|
|
125274
|
-
if (name.match(/^\./)) {
|
|
125275
|
-
errors.push("name cannot start with a period");
|
|
125276
|
-
}
|
|
125277
|
-
if (name.match(/^_/)) {
|
|
125278
|
-
errors.push("name cannot start with an underscore");
|
|
125279
|
-
}
|
|
125280
|
-
if (name.trim() !== name) {
|
|
125281
|
-
errors.push("name cannot contain leading or trailing spaces");
|
|
125282
|
-
}
|
|
125283
|
-
blacklist.forEach(function(blacklistedName) {
|
|
125284
|
-
if (name.toLowerCase() === blacklistedName) {
|
|
125285
|
-
errors.push(blacklistedName + " is a blacklisted name");
|
|
125286
|
-
}
|
|
125287
|
-
});
|
|
125288
|
-
builtins({ version: "*" }).forEach(function(builtin) {
|
|
125289
|
-
if (name.toLowerCase() === builtin) {
|
|
125290
|
-
warnings.push(builtin + " is a core module name");
|
|
125291
|
-
}
|
|
125292
|
-
});
|
|
125293
|
-
if (name.length > 214) {
|
|
125294
|
-
warnings.push("name can no longer contain more than 214 characters");
|
|
125295
|
-
}
|
|
125296
|
-
if (name.toLowerCase() !== name) {
|
|
125297
|
-
warnings.push("name can no longer contain capital letters");
|
|
125298
|
-
}
|
|
125299
|
-
if (/[~'!()*]/.test(name.split("/").slice(-1)[0])) {
|
|
125300
|
-
warnings.push(`name can no longer contain special characters ("~'!()*")`);
|
|
125301
|
-
}
|
|
125302
|
-
if (encodeURIComponent(name) !== name) {
|
|
125303
|
-
var nameMatch = name.match(scopedPackagePattern);
|
|
125304
|
-
if (nameMatch) {
|
|
125305
|
-
var user = nameMatch[1];
|
|
125306
|
-
var pkg = nameMatch[2];
|
|
125307
|
-
if (encodeURIComponent(user) === user && encodeURIComponent(pkg) === pkg) {
|
|
125308
|
-
return done(warnings, errors);
|
|
125309
|
-
}
|
|
125310
|
-
}
|
|
125311
|
-
errors.push("name can only contain URL-friendly characters");
|
|
125312
|
-
}
|
|
125313
|
-
return done(warnings, errors);
|
|
125314
|
-
}
|
|
125315
|
-
var done = function(warnings, errors) {
|
|
125316
|
-
var result2 = {
|
|
125317
|
-
validForNewPackages: errors.length === 0 && warnings.length === 0,
|
|
125318
|
-
validForOldPackages: errors.length === 0,
|
|
125319
|
-
warnings,
|
|
125320
|
-
errors
|
|
125321
|
-
};
|
|
125322
|
-
if (!result2.warnings.length) {
|
|
125323
|
-
delete result2.warnings;
|
|
125324
|
-
}
|
|
125325
|
-
if (!result2.errors.length) {
|
|
125326
|
-
delete result2.errors;
|
|
125327
|
-
}
|
|
125328
|
-
return result2;
|
|
125329
|
-
};
|
|
125330
|
-
module2.exports = validate2;
|
|
125331
|
-
}
|
|
125332
|
-
});
|
|
125333
|
-
|
|
125334
125380
|
// ../packages/parse-wanted-dependency/lib/index.js
|
|
125335
125381
|
var require_lib102 = __commonJS({
|
|
125336
125382
|
"../packages/parse-wanted-dependency/lib/index.js"(exports2) {
|
|
@@ -125340,7 +125386,7 @@ var require_lib102 = __commonJS({
|
|
|
125340
125386
|
};
|
|
125341
125387
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
125342
125388
|
exports2.parseWantedDependency = parseWantedDependency;
|
|
125343
|
-
var validate_npm_package_name_1 = __importDefault2(
|
|
125389
|
+
var validate_npm_package_name_1 = __importDefault2(require_lib97());
|
|
125344
125390
|
function parseWantedDependency(rawWantedDependency) {
|
|
125345
125391
|
const versionDelimiter = rawWantedDependency.indexOf("@", 1);
|
|
125346
125392
|
if (versionDelimiter !== -1) {
|
|
@@ -125378,7 +125424,7 @@ var require_resolveConfigDeps = __commonJS({
|
|
|
125378
125424
|
exports2.resolveConfigDeps = resolveConfigDeps;
|
|
125379
125425
|
var get_npm_tarball_url_1 = __importDefault2(require_lib96());
|
|
125380
125426
|
var error_1 = require_lib6();
|
|
125381
|
-
var config_config_writer_1 =
|
|
125427
|
+
var config_config_writer_1 = require_lib101();
|
|
125382
125428
|
var fetch_1 = require_lib31();
|
|
125383
125429
|
var npm_resolver_1 = require_lib51();
|
|
125384
125430
|
var network_auth_header_1 = require_lib77();
|
|
@@ -139143,7 +139189,7 @@ var require_sortLockfileKeys = __commonJS({
|
|
|
139143
139189
|
"use strict";
|
|
139144
139190
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
139145
139191
|
exports2.sortLockfileKeys = sortLockfileKeys;
|
|
139146
|
-
var object_key_sorting_1 =
|
|
139192
|
+
var object_key_sorting_1 = require_lib99();
|
|
139147
139193
|
var ORDERED_KEYS = {
|
|
139148
139194
|
resolution: 1,
|
|
139149
139195
|
id: 2,
|
|
@@ -142024,7 +142070,7 @@ var require_approveBuilds = __commonJS({
|
|
|
142024
142070
|
var enquirer_1 = require_enquirer();
|
|
142025
142071
|
var chalk_1 = __importDefault2(require_source());
|
|
142026
142072
|
var plugin_commands_rebuild_1 = require_lib133();
|
|
142027
|
-
var config_config_writer_1 =
|
|
142073
|
+
var config_config_writer_1 = require_lib101();
|
|
142028
142074
|
var getAutomaticallyIgnoredBuilds_js_1 = require_getAutomaticallyIgnoredBuilds();
|
|
142029
142075
|
exports2.commandNames = ["approve-builds"];
|
|
142030
142076
|
function help() {
|
|
@@ -148235,7 +148281,7 @@ var require_fix = __commonJS({
|
|
|
148235
148281
|
};
|
|
148236
148282
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
148237
148283
|
exports2.fix = fix;
|
|
148238
|
-
var config_config_writer_1 =
|
|
148284
|
+
var config_config_writer_1 = require_lib101();
|
|
148239
148285
|
var difference_1 = __importDefault2(require_difference());
|
|
148240
148286
|
async function fix(auditReport, opts) {
|
|
148241
148287
|
const vulnOverrides = createOverrides(Object.values(auditReport.advisories), opts.auditConfig?.ignoreCves);
|
|
@@ -148270,7 +148316,7 @@ var require_ignore2 = __commonJS({
|
|
|
148270
148316
|
};
|
|
148271
148317
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
148272
148318
|
exports2.ignore = ignore;
|
|
148273
|
-
var config_config_writer_1 =
|
|
148319
|
+
var config_config_writer_1 = require_lib101();
|
|
148274
148320
|
var difference_1 = __importDefault2(require_difference());
|
|
148275
148321
|
async function ignore(opts) {
|
|
148276
148322
|
const currentCves = opts?.auditConfig?.ignoreCves ?? [];
|
|
@@ -150914,7 +150960,7 @@ var require_configSet = __commonJS({
|
|
|
150914
150960
|
var error_1 = require_lib6();
|
|
150915
150961
|
var object_property_path_1 = require_lib141();
|
|
150916
150962
|
var run_npm_1 = require_lib142();
|
|
150917
|
-
var workspace_manifest_writer_1 =
|
|
150963
|
+
var workspace_manifest_writer_1 = require_lib100();
|
|
150918
150964
|
var camelcase_1 = __importDefault2(require_camelcase());
|
|
150919
150965
|
var lodash_kebabcase_1 = __importDefault2(require_lodash());
|
|
150920
150966
|
var read_ini_file_1 = require_read_ini_file();
|
|
@@ -151049,7 +151095,7 @@ var require_configList = __commonJS({
|
|
|
151049
151095
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
151050
151096
|
exports2.configList = configList;
|
|
151051
151097
|
var ini_1 = require_ini3();
|
|
151052
|
-
var object_key_sorting_1 =
|
|
151098
|
+
var object_key_sorting_1 = require_lib99();
|
|
151053
151099
|
async function configList(opts) {
|
|
151054
151100
|
const sortedConfig = (0, object_key_sorting_1.sortDirectKeys)(opts.rawConfig);
|
|
151055
151101
|
if (opts.json) {
|
|
@@ -163724,17 +163770,25 @@ var require_safeJoinModulesDir = __commonJS({
|
|
|
163724
163770
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
163725
163771
|
exports2.safeJoinModulesDir = safeJoinModulesDir;
|
|
163726
163772
|
var path_1 = __importDefault2(require("path"));
|
|
163773
|
+
var validate_npm_package_name_1 = __importDefault2(require_lib97());
|
|
163727
163774
|
function safeJoinModulesDir(modulesDir, alias) {
|
|
163775
|
+
if (!(0, validate_npm_package_name_1.default)(alias).validForOldPackages) {
|
|
163776
|
+
throw invalidDependencyNameError(modulesDir, alias);
|
|
163777
|
+
}
|
|
163728
163778
|
const link = path_1.default.join(modulesDir, alias);
|
|
163729
163779
|
const resolvedDir = path_1.default.resolve(modulesDir);
|
|
163730
163780
|
const resolvedLink = path_1.default.resolve(link);
|
|
163731
163781
|
if (resolvedLink === resolvedDir || !resolvedLink.startsWith(resolvedDir + path_1.default.sep)) {
|
|
163732
|
-
|
|
163733
|
-
error.code = "ERR_PNPM_INVALID_DEPENDENCY_NAME";
|
|
163734
|
-
throw error;
|
|
163782
|
+
throw invalidDependencyNameError(modulesDir, alias, resolvedLink);
|
|
163735
163783
|
}
|
|
163736
163784
|
return link;
|
|
163737
163785
|
}
|
|
163786
|
+
function invalidDependencyNameError(modulesDir, alias, resolvedLink) {
|
|
163787
|
+
const detail = resolvedLink ? ` (it resolves to ${resolvedLink})` : "";
|
|
163788
|
+
const error = new Error(`Refusing to place a dependency under ${modulesDir} with the invalid alias ${JSON.stringify(alias)}${detail}`);
|
|
163789
|
+
error.code = "ERR_PNPM_INVALID_DEPENDENCY_NAME";
|
|
163790
|
+
return error;
|
|
163791
|
+
}
|
|
163738
163792
|
}
|
|
163739
163793
|
});
|
|
163740
163794
|
|
|
@@ -163795,12 +163849,16 @@ var require_lib161 = __commonJS({
|
|
|
163795
163849
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
163796
163850
|
};
|
|
163797
163851
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
163798
|
-
exports2.symlinkDirectRootDependency = void 0;
|
|
163852
|
+
exports2.symlinkDirectRootDependency = exports2.safeJoinModulesDir = void 0;
|
|
163799
163853
|
exports2.symlinkDependency = symlinkDependency;
|
|
163800
163854
|
exports2.symlinkDependencySync = symlinkDependencySync;
|
|
163801
163855
|
var core_loggers_1 = require_lib8();
|
|
163802
163856
|
var symlink_dir_1 = __importDefault2(require_dist18());
|
|
163803
163857
|
var safeJoinModulesDir_js_1 = require_safeJoinModulesDir();
|
|
163858
|
+
var safeJoinModulesDir_js_2 = require_safeJoinModulesDir();
|
|
163859
|
+
Object.defineProperty(exports2, "safeJoinModulesDir", { enumerable: true, get: function() {
|
|
163860
|
+
return safeJoinModulesDir_js_2.safeJoinModulesDir;
|
|
163861
|
+
} });
|
|
163804
163862
|
var symlinkDirectRootDependency_js_1 = require_symlinkDirectRootDependency();
|
|
163805
163863
|
Object.defineProperty(exports2, "symlinkDirectRootDependency", { enumerable: true, get: function() {
|
|
163806
163864
|
return symlinkDirectRootDependency_js_1.symlinkDirectRootDependency;
|
|
@@ -165347,6 +165405,7 @@ var require_lockfileToHoistedDepGraph = __commonJS({
|
|
|
165347
165405
|
var package_is_installable_1 = require_lib86();
|
|
165348
165406
|
var patching_config_1 = require_lib162();
|
|
165349
165407
|
var read_package_json_1 = require_lib62();
|
|
165408
|
+
var symlink_dependency_1 = require_lib161();
|
|
165350
165409
|
var real_hoist_1 = require_lib164();
|
|
165351
165410
|
var dp = __importStar3(require_lib87());
|
|
165352
165411
|
async function lockfileToHoistedDepGraph(lockfile, currentLockfile, opts) {
|
|
@@ -165472,7 +165531,7 @@ var require_lockfileToHoistedDepGraph = __commonJS({
|
|
|
165472
165531
|
});
|
|
165473
165532
|
return;
|
|
165474
165533
|
}
|
|
165475
|
-
const dir =
|
|
165534
|
+
const dir = (0, symlink_dependency_1.safeJoinModulesDir)(modules, dep.name);
|
|
165476
165535
|
const depLocation = path_1.default.relative(opts.lockfileDir, dir);
|
|
165477
165536
|
const resolution = (0, lockfile_utils_1.pkgSnapshotToResolution)(depPath, pkgSnapshot, opts.registries);
|
|
165478
165537
|
let fetchResponse;
|
|
@@ -166455,7 +166514,7 @@ var require_validateDependencyAlias = __commonJS({
|
|
|
166455
166514
|
exports2.isValidDependencyAlias = isValidDependencyAlias;
|
|
166456
166515
|
exports2.assertValidDependencyAliases = assertValidDependencyAliases;
|
|
166457
166516
|
var error_1 = require_lib6();
|
|
166458
|
-
var validate_npm_package_name_1 = __importDefault2(
|
|
166517
|
+
var validate_npm_package_name_1 = __importDefault2(require_lib97());
|
|
166459
166518
|
function isValidDependencyAlias(alias) {
|
|
166460
166519
|
return typeof alias === "string" && (0, validate_npm_package_name_1.default)(alias).validForOldPackages;
|
|
166461
166520
|
}
|
|
@@ -175377,7 +175436,7 @@ var require_recursive2 = __commonJS({
|
|
|
175377
175436
|
var pnpmfile_1 = require_lib104();
|
|
175378
175437
|
var sort_packages_1 = require_lib132();
|
|
175379
175438
|
var store_connection_manager_1 = require_lib95();
|
|
175380
|
-
var workspace_manifest_writer_1 =
|
|
175439
|
+
var workspace_manifest_writer_1 = require_lib100();
|
|
175381
175440
|
var core_1 = require_lib172();
|
|
175382
175441
|
var is_subdir_1 = __importDefault2(require_is_subdir());
|
|
175383
175442
|
var mem_1 = __importDefault2(require_dist15());
|
|
@@ -175780,7 +175839,7 @@ var require_installDeps = __commonJS({
|
|
|
175780
175839
|
var core_1 = require_lib172();
|
|
175781
175840
|
var logger_1 = require_lib();
|
|
175782
175841
|
var sort_packages_1 = require_lib132();
|
|
175783
|
-
var workspace_manifest_writer_1 =
|
|
175842
|
+
var workspace_manifest_writer_1 = require_lib100();
|
|
175784
175843
|
var workspace_pkgs_graph_1 = require_lib109();
|
|
175785
175844
|
var workspace_state_1 = require_lib152();
|
|
175786
175845
|
var is_subdir_1 = __importDefault2(require_is_subdir());
|
|
@@ -176079,7 +176138,7 @@ var require_add2 = __commonJS({
|
|
|
176079
176138
|
var render_help_1 = __importDefault2(require_lib111());
|
|
176080
176139
|
var getFetchFullMetadata_js_1 = require_getFetchFullMetadata();
|
|
176081
176140
|
var installDeps_js_1 = require_installDeps();
|
|
176082
|
-
var config_config_writer_1 =
|
|
176141
|
+
var config_config_writer_1 = require_lib101();
|
|
176083
176142
|
exports2.shorthands = {
|
|
176084
176143
|
"save-catalog": "--save-catalog-name=default"
|
|
176085
176144
|
};
|
|
@@ -176989,7 +177048,7 @@ var require_link4 = __commonJS({
|
|
|
176989
177048
|
var path_1 = __importDefault2(require("path"));
|
|
176990
177049
|
var cli_utils_1 = require_lib105();
|
|
176991
177050
|
var common_cli_options_help_1 = require_lib118();
|
|
176992
|
-
var config_config_writer_1 =
|
|
177051
|
+
var config_config_writer_1 = require_lib101();
|
|
176993
177052
|
var config_1 = require_lib24();
|
|
176994
177053
|
var types_1 = require_lib10();
|
|
176995
177054
|
var error_1 = require_lib6();
|
|
@@ -177239,7 +177298,7 @@ var require_remove4 = __commonJS({
|
|
|
177239
177298
|
var error_1 = require_lib6();
|
|
177240
177299
|
var get_context_1 = require_lib127();
|
|
177241
177300
|
var workspace_find_packages_1 = require_lib107();
|
|
177242
|
-
var workspace_manifest_writer_1 =
|
|
177301
|
+
var workspace_manifest_writer_1 = require_lib100();
|
|
177243
177302
|
var manifest_utils_1 = require_lib11();
|
|
177244
177303
|
var store_connection_manager_1 = require_lib95();
|
|
177245
177304
|
var core_1 = require_lib172();
|
|
@@ -200367,7 +200426,7 @@ var require_pack2 = __commonJS({
|
|
|
200367
200426
|
var tar_stream_1 = __importDefault2(require_tar_stream());
|
|
200368
200427
|
var publish_js_1 = require_publish2();
|
|
200369
200428
|
var chalk_1 = __importDefault2(require_source());
|
|
200370
|
-
var validate_npm_package_name_1 = __importDefault2(
|
|
200429
|
+
var validate_npm_package_name_1 = __importDefault2(require_lib97());
|
|
200371
200430
|
var p_limit_12 = __importDefault2(require_p_limit());
|
|
200372
200431
|
var common_cli_options_help_1 = require_lib118();
|
|
200373
200432
|
var sort_packages_1 = require_lib132();
|
|
@@ -201264,7 +201323,7 @@ var require_updatePatchedDependencies = __commonJS({
|
|
|
201264
201323
|
exports2.updatePatchedDependencies = updatePatchedDependencies;
|
|
201265
201324
|
var path_1 = __importDefault2(require("path"));
|
|
201266
201325
|
var normalize_path_1 = __importDefault2(require_normalize_path());
|
|
201267
|
-
var config_config_writer_1 =
|
|
201326
|
+
var config_config_writer_1 = require_lib101();
|
|
201268
201327
|
async function updatePatchedDependencies(patchedDependencies, opts) {
|
|
201269
201328
|
const workspaceDir = opts.workspaceDir ?? opts.rootProjectManifestDir;
|
|
201270
201329
|
for (const [patchName, patchPath] of Object.entries(patchedDependencies)) {
|
|
@@ -201496,6 +201555,23 @@ ${stderr}`);
|
|
|
201496
201555
|
}
|
|
201497
201556
|
});
|
|
201498
201557
|
|
|
201558
|
+
// ../patching/plugin-commands-patching/lib/isSubdirectory.js
|
|
201559
|
+
var require_isSubdirectory = __commonJS({
|
|
201560
|
+
"../patching/plugin-commands-patching/lib/isSubdirectory.js"(exports2) {
|
|
201561
|
+
"use strict";
|
|
201562
|
+
var __importDefault2 = exports2 && exports2.__importDefault || function(mod) {
|
|
201563
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
201564
|
+
};
|
|
201565
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
201566
|
+
exports2.isSubdirectory = isSubdirectory;
|
|
201567
|
+
var path_1 = __importDefault2(require("path"));
|
|
201568
|
+
function isSubdirectory(parentDir, childPath, pathUtils = path_1.default) {
|
|
201569
|
+
const relativePath = pathUtils.relative(parentDir, childPath);
|
|
201570
|
+
return relativePath === "" || relativePath !== ".." && !relativePath.startsWith(`..${pathUtils.sep}`) && !pathUtils.isAbsolute(relativePath);
|
|
201571
|
+
}
|
|
201572
|
+
}
|
|
201573
|
+
});
|
|
201574
|
+
|
|
201499
201575
|
// ../patching/plugin-commands-patching/lib/patchRemove.js
|
|
201500
201576
|
var require_patchRemove = __commonJS({
|
|
201501
201577
|
"../patching/plugin-commands-patching/lib/patchRemove.js"(exports2) {
|
|
@@ -201509,8 +201585,8 @@ var require_patchRemove = __commonJS({
|
|
|
201509
201585
|
exports2.cliOptionsTypes = cliOptionsTypes;
|
|
201510
201586
|
exports2.help = help;
|
|
201511
201587
|
exports2.handler = handler;
|
|
201512
|
-
var path_1 = __importDefault2(require("path"));
|
|
201513
201588
|
var promises_1 = __importDefault2(require("fs/promises"));
|
|
201589
|
+
var path_1 = __importDefault2(require("path"));
|
|
201514
201590
|
var cli_utils_1 = require_lib105();
|
|
201515
201591
|
var plugin_commands_installation_1 = require_lib177();
|
|
201516
201592
|
var config_1 = require_lib24();
|
|
@@ -201518,6 +201594,7 @@ var require_patchRemove = __commonJS({
|
|
|
201518
201594
|
var render_help_1 = __importDefault2(require_lib111());
|
|
201519
201595
|
var enquirer_1 = require_enquirer();
|
|
201520
201596
|
var pick_1 = __importDefault2(require_pick());
|
|
201597
|
+
var isSubdirectory_js_1 = require_isSubdirectory();
|
|
201521
201598
|
var updatePatchedDependencies_js_1 = require_updatePatchedDependencies();
|
|
201522
201599
|
function rcOptionsTypes() {
|
|
201523
201600
|
return (0, pick_1.default)([], config_1.types);
|
|
@@ -201535,7 +201612,7 @@ var require_patchRemove = __commonJS({
|
|
|
201535
201612
|
}
|
|
201536
201613
|
async function handler(opts, params) {
|
|
201537
201614
|
let patchesToRemove = params;
|
|
201538
|
-
const patchedDependencies = opts.patchedDependencies
|
|
201615
|
+
const patchedDependencies = { ...opts.patchedDependencies };
|
|
201539
201616
|
if (!params.length) {
|
|
201540
201617
|
const allPatches = Object.keys(patchedDependencies);
|
|
201541
201618
|
if (allPatches.length) {
|
|
@@ -201558,15 +201635,19 @@ var require_patchRemove = __commonJS({
|
|
|
201558
201635
|
throw new error_1.PnpmError("PATCH_NOT_FOUND", `Patch "${patch}" not found in patched dependencies`);
|
|
201559
201636
|
}
|
|
201560
201637
|
}
|
|
201561
|
-
const
|
|
201562
|
-
await Promise.all(patchesToRemove.map(async (patch) => {
|
|
201563
|
-
|
|
201564
|
-
|
|
201565
|
-
|
|
201566
|
-
await promises_1.default.rm(patchFile, { force: true });
|
|
201567
|
-
delete patchedDependencies[patch];
|
|
201638
|
+
const patchRemovalContext = await getPatchRemovalContext(opts);
|
|
201639
|
+
const patchesToRemoveTargets = await Promise.all(patchesToRemove.map(async (patch) => {
|
|
201640
|
+
const patchFile = patchedDependencies[patch];
|
|
201641
|
+
if (patchFile == null) {
|
|
201642
|
+
throw new error_1.PnpmError("PATCH_NOT_FOUND", `Patch "${patch}" not found in patched dependencies`);
|
|
201568
201643
|
}
|
|
201644
|
+
return getPatchRemovalTarget(patch, patchFile, patchRemovalContext);
|
|
201569
201645
|
}));
|
|
201646
|
+
await Promise.all(patchesToRemoveTargets.map(unlinkPatchIfExists));
|
|
201647
|
+
for (const { patch } of patchesToRemoveTargets) {
|
|
201648
|
+
delete patchedDependencies[patch];
|
|
201649
|
+
}
|
|
201650
|
+
const patchesDirs = new Set(patchesToRemoveTargets.map(({ parentDir }) => parentDir));
|
|
201570
201651
|
await Promise.all(Array.from(patchesDirs).map(async (dir) => {
|
|
201571
201652
|
try {
|
|
201572
201653
|
const files = await promises_1.default.readdir(dir);
|
|
@@ -201580,7 +201661,83 @@ var require_patchRemove = __commonJS({
|
|
|
201580
201661
|
...opts,
|
|
201581
201662
|
workspaceDir: opts.workspaceDir ?? opts.rootProjectManifestDir
|
|
201582
201663
|
});
|
|
201583
|
-
return plugin_commands_installation_1.install.handler(
|
|
201664
|
+
return plugin_commands_installation_1.install.handler({
|
|
201665
|
+
...opts,
|
|
201666
|
+
patchedDependencies
|
|
201667
|
+
});
|
|
201668
|
+
}
|
|
201669
|
+
async function getPatchRemovalContext(opts) {
|
|
201670
|
+
const lockfileDir = path_1.default.resolve(opts.lockfileDir ?? opts.dir ?? process.cwd());
|
|
201671
|
+
const realLockfileDir = await promises_1.default.realpath(lockfileDir);
|
|
201672
|
+
const patchesDirSetting = opts.patchesDir ?? "patches";
|
|
201673
|
+
const patchesDir = path_1.default.join(lockfileDir, path_1.default.normalize(patchesDirSetting));
|
|
201674
|
+
if (!(0, isSubdirectory_js_1.isSubdirectory)(lockfileDir, patchesDir)) {
|
|
201675
|
+
throw new error_1.PnpmError("PATCHES_DIR_OUTSIDE_PROJECT", `The configured patches directory is outside the project: ${patchesDirSetting}`);
|
|
201676
|
+
}
|
|
201677
|
+
const realPatchesDir = await realpathIfExists(patchesDir);
|
|
201678
|
+
if (realPatchesDir != null && !(0, isSubdirectory_js_1.isSubdirectory)(realLockfileDir, realPatchesDir)) {
|
|
201679
|
+
throw new error_1.PnpmError("PATCHES_DIR_OUTSIDE_PROJECT", `The configured patches directory is outside the project: ${patchesDirSetting}`);
|
|
201680
|
+
}
|
|
201681
|
+
return {
|
|
201682
|
+
lockfileDir,
|
|
201683
|
+
patchesDir,
|
|
201684
|
+
realPatchesDir
|
|
201685
|
+
};
|
|
201686
|
+
}
|
|
201687
|
+
async function getPatchRemovalTarget(patch, patchFile, ctx) {
|
|
201688
|
+
const targetPath = path_1.default.resolve(ctx.lockfileDir, patchFile);
|
|
201689
|
+
if (targetPath === ctx.patchesDir || !(0, isSubdirectory_js_1.isSubdirectory)(ctx.patchesDir, targetPath)) {
|
|
201690
|
+
throw new error_1.PnpmError("PATCH_FILE_OUTSIDE_PATCHES_DIR", `Patch file "${patchFile}" is outside the configured patches directory`);
|
|
201691
|
+
}
|
|
201692
|
+
const parentDir = path_1.default.dirname(targetPath);
|
|
201693
|
+
const targetStats = await lstatIfExists(targetPath);
|
|
201694
|
+
const realParentDir = await realpathIfExists(parentDir);
|
|
201695
|
+
const realPatchesDir = ctx.realPatchesDir ?? await realpathIfExists(ctx.patchesDir);
|
|
201696
|
+
if (realParentDir != null && realPatchesDir != null && !(0, isSubdirectory_js_1.isSubdirectory)(realPatchesDir, realParentDir)) {
|
|
201697
|
+
throw new error_1.PnpmError("PATCH_FILE_OUTSIDE_PATCHES_DIR", `Patch file "${patchFile}" is outside the configured patches directory`);
|
|
201698
|
+
}
|
|
201699
|
+
if (targetStats?.isDirectory()) {
|
|
201700
|
+
throw new error_1.PnpmError("PATCH_FILE_IS_DIRECTORY", `Patch file "${patchFile}" is a directory`);
|
|
201701
|
+
}
|
|
201702
|
+
return {
|
|
201703
|
+
patch,
|
|
201704
|
+
patchFile,
|
|
201705
|
+
parentDir,
|
|
201706
|
+
targetPath,
|
|
201707
|
+
targetExists: targetStats != null
|
|
201708
|
+
};
|
|
201709
|
+
}
|
|
201710
|
+
async function unlinkPatchIfExists({ targetExists, targetPath }) {
|
|
201711
|
+
if (!targetExists)
|
|
201712
|
+
return;
|
|
201713
|
+
try {
|
|
201714
|
+
await promises_1.default.unlink(targetPath);
|
|
201715
|
+
} catch (err) {
|
|
201716
|
+
if (isErrorWithCode(err, "ENOENT"))
|
|
201717
|
+
return;
|
|
201718
|
+
throw err;
|
|
201719
|
+
}
|
|
201720
|
+
}
|
|
201721
|
+
async function lstatIfExists(targetPath) {
|
|
201722
|
+
try {
|
|
201723
|
+
return await promises_1.default.lstat(targetPath);
|
|
201724
|
+
} catch (err) {
|
|
201725
|
+
if (isErrorWithCode(err, "ENOENT"))
|
|
201726
|
+
return void 0;
|
|
201727
|
+
throw err;
|
|
201728
|
+
}
|
|
201729
|
+
}
|
|
201730
|
+
async function realpathIfExists(targetPath) {
|
|
201731
|
+
try {
|
|
201732
|
+
return await promises_1.default.realpath(targetPath);
|
|
201733
|
+
} catch (err) {
|
|
201734
|
+
if (isErrorWithCode(err, "ENOENT"))
|
|
201735
|
+
return void 0;
|
|
201736
|
+
throw err;
|
|
201737
|
+
}
|
|
201738
|
+
}
|
|
201739
|
+
function isErrorWithCode(err, code) {
|
|
201740
|
+
return typeof err === "object" && err !== null && "code" in err && err.code === code;
|
|
201584
201741
|
}
|
|
201585
201742
|
}
|
|
201586
201743
|
});
|
|
@@ -210971,7 +211128,7 @@ var require_catIndex = __commonJS({
|
|
|
210971
211128
|
exports2.handler = handler;
|
|
210972
211129
|
var client_1 = require_lib79();
|
|
210973
211130
|
var error_1 = require_lib6();
|
|
210974
|
-
var object_key_sorting_1 =
|
|
211131
|
+
var object_key_sorting_1 = require_lib99();
|
|
210975
211132
|
var store_path_1 = require_lib33();
|
|
210976
211133
|
var store_cafs_1 = require_lib80();
|
|
210977
211134
|
var parse_wanted_dependency_1 = require_lib102();
|
|
@@ -211294,7 +211451,7 @@ var require_init2 = __commonJS({
|
|
|
211294
211451
|
var cli_meta_1 = require_lib4();
|
|
211295
211452
|
var config_1 = require_lib24();
|
|
211296
211453
|
var error_1 = require_lib6();
|
|
211297
|
-
var object_key_sorting_1 =
|
|
211454
|
+
var object_key_sorting_1 = require_lib99();
|
|
211298
211455
|
var write_project_manifest_1 = require_lib15();
|
|
211299
211456
|
var pick_1 = __importDefault2(require_pick());
|
|
211300
211457
|
var render_help_1 = __importDefault2(require_lib111());
|