@vercel/build-utils 9.3.1 → 10.0.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/CHANGELOG.md +18 -0
- package/dist/fs/run-user-scripts.js +28 -29
- package/dist/index.js +28 -29
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
# @vercel/build-utils
|
2
2
|
|
3
|
+
## 10.0.1
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [build-utils] Move `runNpmInstallSema` closer to where it's used ([#13061](https://github.com/vercel/vercel/pull/13061))
|
8
|
+
|
9
|
+
- [build-utils] extract getInstallCommandForPackageManager to module scope ([#13058](https://github.com/vercel/vercel/pull/13058))
|
10
|
+
|
11
|
+
- [build-utils] remove redundant sema release ([#13059](https://github.com/vercel/vercel/pull/13059))
|
12
|
+
|
13
|
+
- Revert support pnpm 10 ([#13064](https://github.com/vercel/vercel/pull/13064))
|
14
|
+
|
15
|
+
## 10.0.0
|
16
|
+
|
17
|
+
### Major Changes
|
18
|
+
|
19
|
+
- Detect v9 pnpm lockfiles as pnpm 10 generated ([#12852](https://github.com/vercel/vercel/pull/12852))
|
20
|
+
|
3
21
|
## 9.3.1
|
4
22
|
|
5
23
|
### Patch Changes
|
@@ -67,7 +67,6 @@ var import_node_version = require("./node-version");
|
|
67
67
|
var import_read_config_file = require("./read-config-file");
|
68
68
|
var import_clone_env = require("../clone-env");
|
69
69
|
var import_json5 = __toESM(require("json5"));
|
70
|
-
const runNpmInstallSema = new import_async_sema.default(1);
|
71
70
|
const NO_OVERRIDE = {
|
72
71
|
detectedLockfile: void 0,
|
73
72
|
detectedPackageManager: void 0,
|
@@ -423,38 +422,38 @@ async function walkParentDirsMulti({
|
|
423
422
|
function isSet(v) {
|
424
423
|
return v?.constructor?.name === "Set";
|
425
424
|
}
|
425
|
+
function getInstallCommandForPackageManager(packageManager, args) {
|
426
|
+
switch (packageManager) {
|
427
|
+
case "npm":
|
428
|
+
return {
|
429
|
+
prettyCommand: "npm install",
|
430
|
+
commandArguments: args.filter((a) => a !== "--prefer-offline").concat(["install", "--no-audit", "--unsafe-perm"])
|
431
|
+
};
|
432
|
+
case "pnpm":
|
433
|
+
return {
|
434
|
+
prettyCommand: "pnpm install",
|
435
|
+
// PNPM's install command is similar to NPM's but without the audit nonsense
|
436
|
+
// @see options https://pnpm.io/cli/install
|
437
|
+
commandArguments: args.filter((a) => a !== "--prefer-offline").concat(["install", "--unsafe-perm"])
|
438
|
+
};
|
439
|
+
case "bun":
|
440
|
+
return {
|
441
|
+
prettyCommand: "bun install",
|
442
|
+
// @see options https://bun.sh/docs/cli/install
|
443
|
+
commandArguments: ["install", ...args]
|
444
|
+
};
|
445
|
+
case "yarn":
|
446
|
+
return {
|
447
|
+
prettyCommand: "yarn install",
|
448
|
+
commandArguments: ["install", ...args]
|
449
|
+
};
|
450
|
+
}
|
451
|
+
}
|
426
452
|
async function runInstallCommand({
|
427
453
|
packageManager,
|
428
454
|
args,
|
429
455
|
opts
|
430
456
|
}) {
|
431
|
-
const getInstallCommandForPackageManager = (packageManager2, args2) => {
|
432
|
-
switch (packageManager2) {
|
433
|
-
case "npm":
|
434
|
-
return {
|
435
|
-
prettyCommand: "npm install",
|
436
|
-
commandArguments: args2.filter((a) => a !== "--prefer-offline").concat(["install", "--no-audit", "--unsafe-perm"])
|
437
|
-
};
|
438
|
-
case "pnpm":
|
439
|
-
return {
|
440
|
-
prettyCommand: "pnpm install",
|
441
|
-
// PNPM's install command is similar to NPM's but without the audit nonsense
|
442
|
-
// @see options https://pnpm.io/cli/install
|
443
|
-
commandArguments: args2.filter((a) => a !== "--prefer-offline").concat(["install", "--unsafe-perm"])
|
444
|
-
};
|
445
|
-
case "bun":
|
446
|
-
return {
|
447
|
-
prettyCommand: "bun install",
|
448
|
-
// @see options https://bun.sh/docs/cli/install
|
449
|
-
commandArguments: ["install", ...args2]
|
450
|
-
};
|
451
|
-
case "yarn":
|
452
|
-
return {
|
453
|
-
prettyCommand: "yarn install",
|
454
|
-
commandArguments: ["install", ...args2]
|
455
|
-
};
|
456
|
-
}
|
457
|
-
};
|
458
457
|
const { commandArguments, prettyCommand } = getInstallCommandForPackageManager(packageManager, args);
|
459
458
|
opts.prettyCommand = prettyCommand;
|
460
459
|
if (process.env.NPM_ONLY_PRODUCTION) {
|
@@ -462,6 +461,7 @@ async function runInstallCommand({
|
|
462
461
|
}
|
463
462
|
await spawnAsync(packageManager, commandArguments, opts);
|
464
463
|
}
|
464
|
+
const runNpmInstallSema = new import_async_sema.default(1);
|
465
465
|
async function runNpmInstall(destPath, args = [], spawnOpts, meta, nodeVersion) {
|
466
466
|
if (meta?.isDev) {
|
467
467
|
(0, import_debug.default)("Skipping dependency installation because dev mode is enabled");
|
@@ -482,7 +482,6 @@ async function runNpmInstall(destPath, args = [], spawnOpts, meta, nodeVersion)
|
|
482
482
|
(0, import_debug.default)(
|
483
483
|
`Skipping dependency installation because no package.json was found for ${destPath}`
|
484
484
|
);
|
485
|
-
runNpmInstallSema.release();
|
486
485
|
return false;
|
487
486
|
}
|
488
487
|
if (meta && packageJsonPath && args.length === 0) {
|
package/dist/index.js
CHANGED
@@ -23080,7 +23080,6 @@ function cloneEnv(...envs) {
|
|
23080
23080
|
|
23081
23081
|
// src/fs/run-user-scripts.ts
|
23082
23082
|
var import_json5 = __toESM(require_lib5());
|
23083
|
-
var runNpmInstallSema = new import_async_sema4.default(1);
|
23084
23083
|
var NO_OVERRIDE = {
|
23085
23084
|
detectedLockfile: void 0,
|
23086
23085
|
detectedPackageManager: void 0,
|
@@ -23436,38 +23435,38 @@ async function walkParentDirsMulti({
|
|
23436
23435
|
function isSet(v) {
|
23437
23436
|
return v?.constructor?.name === "Set";
|
23438
23437
|
}
|
23438
|
+
function getInstallCommandForPackageManager(packageManager, args) {
|
23439
|
+
switch (packageManager) {
|
23440
|
+
case "npm":
|
23441
|
+
return {
|
23442
|
+
prettyCommand: "npm install",
|
23443
|
+
commandArguments: args.filter((a) => a !== "--prefer-offline").concat(["install", "--no-audit", "--unsafe-perm"])
|
23444
|
+
};
|
23445
|
+
case "pnpm":
|
23446
|
+
return {
|
23447
|
+
prettyCommand: "pnpm install",
|
23448
|
+
// PNPM's install command is similar to NPM's but without the audit nonsense
|
23449
|
+
// @see options https://pnpm.io/cli/install
|
23450
|
+
commandArguments: args.filter((a) => a !== "--prefer-offline").concat(["install", "--unsafe-perm"])
|
23451
|
+
};
|
23452
|
+
case "bun":
|
23453
|
+
return {
|
23454
|
+
prettyCommand: "bun install",
|
23455
|
+
// @see options https://bun.sh/docs/cli/install
|
23456
|
+
commandArguments: ["install", ...args]
|
23457
|
+
};
|
23458
|
+
case "yarn":
|
23459
|
+
return {
|
23460
|
+
prettyCommand: "yarn install",
|
23461
|
+
commandArguments: ["install", ...args]
|
23462
|
+
};
|
23463
|
+
}
|
23464
|
+
}
|
23439
23465
|
async function runInstallCommand({
|
23440
23466
|
packageManager,
|
23441
23467
|
args,
|
23442
23468
|
opts
|
23443
23469
|
}) {
|
23444
|
-
const getInstallCommandForPackageManager = (packageManager2, args2) => {
|
23445
|
-
switch (packageManager2) {
|
23446
|
-
case "npm":
|
23447
|
-
return {
|
23448
|
-
prettyCommand: "npm install",
|
23449
|
-
commandArguments: args2.filter((a) => a !== "--prefer-offline").concat(["install", "--no-audit", "--unsafe-perm"])
|
23450
|
-
};
|
23451
|
-
case "pnpm":
|
23452
|
-
return {
|
23453
|
-
prettyCommand: "pnpm install",
|
23454
|
-
// PNPM's install command is similar to NPM's but without the audit nonsense
|
23455
|
-
// @see options https://pnpm.io/cli/install
|
23456
|
-
commandArguments: args2.filter((a) => a !== "--prefer-offline").concat(["install", "--unsafe-perm"])
|
23457
|
-
};
|
23458
|
-
case "bun":
|
23459
|
-
return {
|
23460
|
-
prettyCommand: "bun install",
|
23461
|
-
// @see options https://bun.sh/docs/cli/install
|
23462
|
-
commandArguments: ["install", ...args2]
|
23463
|
-
};
|
23464
|
-
case "yarn":
|
23465
|
-
return {
|
23466
|
-
prettyCommand: "yarn install",
|
23467
|
-
commandArguments: ["install", ...args2]
|
23468
|
-
};
|
23469
|
-
}
|
23470
|
-
};
|
23471
23470
|
const { commandArguments, prettyCommand } = getInstallCommandForPackageManager(packageManager, args);
|
23472
23471
|
opts.prettyCommand = prettyCommand;
|
23473
23472
|
if (process.env.NPM_ONLY_PRODUCTION) {
|
@@ -23475,6 +23474,7 @@ async function runInstallCommand({
|
|
23475
23474
|
}
|
23476
23475
|
await spawnAsync(packageManager, commandArguments, opts);
|
23477
23476
|
}
|
23477
|
+
var runNpmInstallSema = new import_async_sema4.default(1);
|
23478
23478
|
async function runNpmInstall(destPath, args = [], spawnOpts, meta, nodeVersion) {
|
23479
23479
|
if (meta?.isDev) {
|
23480
23480
|
debug("Skipping dependency installation because dev mode is enabled");
|
@@ -23495,7 +23495,6 @@ async function runNpmInstall(destPath, args = [], spawnOpts, meta, nodeVersion)
|
|
23495
23495
|
debug(
|
23496
23496
|
`Skipping dependency installation because no package.json was found for ${destPath}`
|
23497
23497
|
);
|
23498
|
-
runNpmInstallSema.release();
|
23499
23498
|
return false;
|
23500
23499
|
}
|
23501
23500
|
if (meta && packageJsonPath && args.length === 0) {
|