vercel 54.11.1 → 54.12.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/chunks/{add-T6Q4Z7IF.js → add-4F6CBPSE.js} +4 -4
- package/dist/chunks/{chunk-KXQCHXEP.js → chunk-2WND2XFN.js} +1 -1
- package/dist/chunks/{chunk-4EDYATFL.js → chunk-42PRZ45G.js} +4 -4
- package/dist/chunks/{chunk-B5AHOULN.js → chunk-7IAMAKFC.js} +1 -1
- package/dist/chunks/{chunk-VEG7O6KK.js → chunk-ADBU633H.js} +1 -1
- package/dist/chunks/{chunk-4LAXPJJL.js → chunk-APC5GMBX.js} +1 -1
- package/dist/chunks/{chunk-G3O5GGTH.js → chunk-B744TFL4.js} +1 -1
- package/dist/chunks/{chunk-EJVUTQYL.js → chunk-DITVV3KE.js} +1 -1
- package/dist/chunks/{chunk-FCJ5RCKQ.js → chunk-FJP2X2TE.js} +2 -2
- package/dist/chunks/{chunk-2BE6S2X5.js → chunk-HVYPWTJQ.js} +2 -2
- package/dist/chunks/{chunk-MSTGWZ4V.js → chunk-HYFP6VVA.js} +2 -2
- package/dist/chunks/{chunk-4AYB4D6T.js → chunk-IDTFK3CR.js} +4 -4
- package/dist/chunks/{chunk-PEDCQGFS.js → chunk-IOV7PLXQ.js} +4 -4
- package/dist/chunks/{chunk-74I4AWLF.js → chunk-JRPLGVXQ.js} +1 -1
- package/dist/chunks/{chunk-WWFDZWZX.js → chunk-LGWH2KFI.js} +20 -7
- package/dist/chunks/chunk-NLEBTR3S.js +181 -0
- package/dist/chunks/{chunk-CJ2XGDXE.js → chunk-NZDGG7W3.js} +1 -1
- package/dist/chunks/{chunk-A3HBHHB7.js → chunk-OBWYK3NL.js} +1 -1
- package/dist/chunks/{chunk-3QANLV66.js → chunk-WNYUBBFH.js} +2 -2
- package/dist/chunks/{chunk-JRCKHA5T.js → chunk-ZYNF76YT.js} +10 -7
- package/dist/chunks/{compile-vercel-config-PINMHJZV.js → compile-vercel-config-CGU7GBYQ.js} +1 -1
- package/dist/chunks/{delete-JSAUWGZL.js → delete-XKC6CE3R.js} +2 -2
- package/dist/chunks/{disable-H6456MIN.js → disable-F2RLDMXX.js} +2 -2
- package/dist/chunks/{discard-MWHLHDII.js → discard-N4MILEID.js} +2 -2
- package/dist/chunks/{edit-PQBKAMEB.js → edit-PMIBPG7J.js} +3 -3
- package/dist/chunks/{enable-I2LTHACN.js → enable-AON5KGOT.js} +2 -2
- package/dist/chunks/{export-PDBNDENX.js → export-OQKO5JVC.js} +2 -2
- package/dist/chunks/{inspect-YNZEEINA.js → inspect-7TLOVORH.js} +3 -3
- package/dist/chunks/{list-OT34GXTX.js → list-RJHF6SWM.js} +2 -2
- package/dist/chunks/{list-CXA72TY6.js → list-SCOE3N4I.js} +3 -3
- package/dist/chunks/{ls-JLRWHA5W.js → ls-CFTCULV5.js} +4 -4
- package/dist/chunks/{publish-AR3FRIHJ.js → publish-6VOT42HN.js} +2 -2
- package/dist/chunks/{query-M4VFM77U.js → query-OHEBAPTS.js} +2 -2
- package/dist/chunks/{reorder-V5Q23O4J.js → reorder-GMIEF42H.js} +2 -2
- package/dist/chunks/{restore-FMGF5AU4.js → restore-JY2JCHOY.js} +2 -2
- package/dist/chunks/{rm-C54EEBUU.js → rm-FQB3M5YP.js} +4 -4
- package/dist/chunks/{rule-inspect-NKCIQNWD.js → rule-inspect-2JWJRPGL.js} +4 -4
- package/dist/chunks/{rules-LHTAZK7R.js → rules-MULKOWZ5.js} +6 -6
- package/dist/chunks/{schema-KGZ7YT4T.js → schema-4YC2WD3R.js} +2 -2
- package/dist/chunks/{update-67NV2T55.js → update-T4SXDA7F.js} +4 -4
- package/dist/commands/build/index.js +9 -9
- package/dist/commands/deploy/index.js +10 -10
- package/dist/commands/dev/index.js +369 -208
- package/dist/commands/env/index.js +4 -4
- package/dist/commands/link/index.js +7 -7
- package/dist/commands/list/index.js +3 -3
- package/dist/commands-bulk.js +31 -31
- package/dist/index.js +8 -8
- package/dist/version.mjs +1 -1
- package/package.json +20 -20
- package/dist/chunks/chunk-XRP2HYDU.js +0 -112
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
handleRulesApiError,
|
|
10
10
|
parseRulesFlagsAndScope,
|
|
11
11
|
rulesCollectionPath
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-7IAMAKFC.js";
|
|
13
|
+
import "./chunk-HYFP6VVA.js";
|
|
14
14
|
import "./chunk-5SYDEK2N.js";
|
|
15
15
|
import {
|
|
16
16
|
validateJsonOutput
|
|
@@ -21,8 +21,8 @@ import {
|
|
|
21
21
|
import {
|
|
22
22
|
AGENT_REASON
|
|
23
23
|
} from "./chunk-LJ5WXXG6.js";
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-ADBU633H.js";
|
|
25
|
+
import "./chunk-IDTFK3CR.js";
|
|
26
26
|
import "./chunk-J5273CSE.js";
|
|
27
27
|
import {
|
|
28
28
|
buildCommandWithGlobalFlags,
|
|
@@ -6,13 +6,13 @@ const __filename = __fileURLToPath(import.meta.url);
|
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
7
|
import {
|
|
8
8
|
writeProjectSettings
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JRPLGVXQ.js";
|
|
10
10
|
import {
|
|
11
11
|
ensureLink
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FJP2X2TE.js";
|
|
13
13
|
import {
|
|
14
14
|
pullCommand
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-2WND2XFN.js";
|
|
16
16
|
import {
|
|
17
17
|
help
|
|
18
18
|
} from "./chunk-VNUNCNPE.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
envPullCommandLogic,
|
|
24
24
|
humanizePath,
|
|
25
25
|
parseTarget
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-IDTFK3CR.js";
|
|
27
27
|
import {
|
|
28
28
|
TelemetryClient
|
|
29
29
|
} from "./chunk-J5273CSE.js";
|
|
@@ -7,12 +7,12 @@ const __dirname = __dirname_(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
printProjectNotFoundError,
|
|
9
9
|
setupAndLink
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-LGWH2KFI.js";
|
|
11
11
|
import {
|
|
12
12
|
getLinkedProject,
|
|
13
13
|
param,
|
|
14
14
|
resolveProjectCwd
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-IDTFK3CR.js";
|
|
16
16
|
import {
|
|
17
17
|
buildCommandWithYes,
|
|
18
18
|
outputActionRequired
|
|
@@ -25,10 +25,10 @@ import {
|
|
|
25
25
|
import {
|
|
26
26
|
buildCommand,
|
|
27
27
|
pullCommand
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-2WND2XFN.js";
|
|
29
29
|
import {
|
|
30
30
|
envCommand
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-IDTFK3CR.js";
|
|
32
32
|
import {
|
|
33
33
|
confirmOption,
|
|
34
34
|
forceOption,
|
|
@@ -12,11 +12,11 @@ import {
|
|
|
12
12
|
} from "./chunk-LJ5WXXG6.js";
|
|
13
13
|
import {
|
|
14
14
|
getScope
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ADBU633H.js";
|
|
16
16
|
import {
|
|
17
17
|
getLinkedProject,
|
|
18
18
|
getProjectByNameOrId
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-IDTFK3CR.js";
|
|
20
20
|
import {
|
|
21
21
|
buildCommandWithGlobalFlags,
|
|
22
22
|
outputAgentError
|
|
@@ -37330,7 +37330,7 @@ var require_package = __commonJS({
|
|
|
37330
37330
|
"../client/package.json"(exports, module) {
|
|
37331
37331
|
module.exports = {
|
|
37332
37332
|
name: "@vercel/client",
|
|
37333
|
-
version: "17.5.
|
|
37333
|
+
version: "17.5.14",
|
|
37334
37334
|
main: "dist/index.js",
|
|
37335
37335
|
typings: "dist/index.d.ts",
|
|
37336
37336
|
homepage: "https://vercel.com",
|
|
@@ -44981,9 +44981,9 @@ var require_out4 = __commonJS({
|
|
|
44981
44981
|
}
|
|
44982
44982
|
});
|
|
44983
44983
|
|
|
44984
|
-
// ../../node_modules/.pnpm/@vercel+microfrontends@1.2.2_next@16.2.6_@opentelemetry+api@1.9.
|
|
44984
|
+
// ../../node_modules/.pnpm/@vercel+microfrontends@1.2.2_next@16.2.6_@opentelemetry+api@1.9.1_react-dom@18.3.1_reac_dafed8485844cbf4d92e1fbe0bf15d03/node_modules/@vercel/microfrontends/dist/microfrontends/utils.cjs
|
|
44985
44985
|
var require_utils8 = __commonJS({
|
|
44986
|
-
"../../node_modules/.pnpm/@vercel+microfrontends@1.2.2_next@16.2.6_@opentelemetry+api@1.9.
|
|
44986
|
+
"../../node_modules/.pnpm/@vercel+microfrontends@1.2.2_next@16.2.6_@opentelemetry+api@1.9.1_react-dom@18.3.1_reac_dafed8485844cbf4d92e1fbe0bf15d03/node_modules/@vercel/microfrontends/dist/microfrontends/utils.cjs"(exports, module) {
|
|
44987
44987
|
"use strict";
|
|
44988
44988
|
var __create = Object.create;
|
|
44989
44989
|
var __defProp = Object.defineProperty;
|
|
@@ -57625,7 +57625,7 @@ async function hasExperimentalServicesConfig(cwd) {
|
|
|
57625
57625
|
);
|
|
57626
57626
|
if (!config || config instanceof Error)
|
|
57627
57627
|
return false;
|
|
57628
|
-
return config.experimentalServices != null && typeof config.experimentalServices === "object";
|
|
57628
|
+
return config.experimentalServices != null && typeof config.experimentalServices === "object" || config.experimentalServicesV2 != null && typeof config.experimentalServicesV2 === "object";
|
|
57629
57629
|
} catch {
|
|
57630
57630
|
return false;
|
|
57631
57631
|
}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
printIndications,
|
|
10
10
|
require_dist as require_dist2,
|
|
11
11
|
sleep
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WNYUBBFH.js";
|
|
13
13
|
import {
|
|
14
14
|
suggestNextCommands
|
|
15
15
|
} from "./chunk-LKBI43XK.js";
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
} from "./chunk-TCF6MGBY.js";
|
|
20
20
|
import {
|
|
21
21
|
CommandTimeout
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-HVYPWTJQ.js";
|
|
23
23
|
import {
|
|
24
24
|
getScope
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-ADBU633H.js";
|
|
26
26
|
import {
|
|
27
27
|
getProjectByNameOrId,
|
|
28
28
|
param,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
require_pluralize,
|
|
32
32
|
showPluginTipIfNeeded,
|
|
33
33
|
ua_default
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-IDTFK3CR.js";
|
|
35
35
|
import {
|
|
36
36
|
require_ms,
|
|
37
37
|
stamp_default
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
} from "./chunk-LJ5WXXG6.js";
|
|
11
11
|
import {
|
|
12
12
|
getLocalPathConfig
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-APC5GMBX.js";
|
|
14
14
|
import {
|
|
15
15
|
getScope
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ADBU633H.js";
|
|
17
17
|
import {
|
|
18
18
|
VERCEL_DIR_PROJECT,
|
|
19
19
|
VERCEL_DIR_README,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
selectAndParseRemoteUrl,
|
|
48
48
|
selectOrg,
|
|
49
49
|
writeServicesConfig
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-IDTFK3CR.js";
|
|
51
51
|
import {
|
|
52
52
|
buildCommandWithGlobalFlags,
|
|
53
53
|
outputAgentError,
|
|
@@ -212,6 +212,7 @@ List accessible teams with \`vercel teams ls\`.`
|
|
|
212
212
|
var import_frameworks = __toESM(require_frameworks(), 1);
|
|
213
213
|
import {
|
|
214
214
|
getServiceQueueTopics,
|
|
215
|
+
isExperimentalServiceV2,
|
|
215
216
|
isQueueTriggeredService,
|
|
216
217
|
isScheduleTriggeredService,
|
|
217
218
|
isWorkflowTriggeredService
|
|
@@ -277,6 +278,9 @@ function getServiceDescriptionInfo(service) {
|
|
|
277
278
|
}
|
|
278
279
|
return { label: typeLabel, colorFn: typeColorFn };
|
|
279
280
|
}
|
|
281
|
+
return getFrameworkRuntimeBuilderInfo(service);
|
|
282
|
+
}
|
|
283
|
+
function getFrameworkRuntimeBuilderInfo(service) {
|
|
280
284
|
const frameworkName = getFrameworkName(service.framework);
|
|
281
285
|
if (frameworkName && service.framework) {
|
|
282
286
|
const colorFn = frameworkColors[service.framework] || chalk2.cyan;
|
|
@@ -306,6 +310,12 @@ function getServiceTarget(service) {
|
|
|
306
310
|
function displayDetectedServices(services) {
|
|
307
311
|
output_manager_default.print(`Detected services:
|
|
308
312
|
`);
|
|
313
|
+
const rows = services.some(isExperimentalServiceV2) ? buildServiceRowsV2(services.filter(isExperimentalServiceV2)) : buildServiceRowsV1(services);
|
|
314
|
+
const tableOutput = table(rows, { align: ["l", "l", "l", "l"], hsep: 2 });
|
|
315
|
+
output_manager_default.print(`${tableOutput}
|
|
316
|
+
`);
|
|
317
|
+
}
|
|
318
|
+
function buildServiceRowsV1(services) {
|
|
309
319
|
const outputOrder = {
|
|
310
320
|
web: 0,
|
|
311
321
|
cron: 1,
|
|
@@ -315,7 +325,7 @@ function displayDetectedServices(services) {
|
|
|
315
325
|
const sorted = [...services].sort(
|
|
316
326
|
(a, b) => (outputOrder[a.type] ?? 3) - (outputOrder[b.type] ?? 3)
|
|
317
327
|
);
|
|
318
|
-
|
|
328
|
+
return sorted.map((service) => {
|
|
319
329
|
const descInfo = getServiceDescriptionInfo(service);
|
|
320
330
|
const target = getServiceTarget(service);
|
|
321
331
|
return [
|
|
@@ -325,9 +335,12 @@ function displayDetectedServices(services) {
|
|
|
325
335
|
target
|
|
326
336
|
];
|
|
327
337
|
});
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
338
|
+
}
|
|
339
|
+
function buildServiceRowsV2(services) {
|
|
340
|
+
return services.map((service) => {
|
|
341
|
+
const descInfo = getFrameworkRuntimeBuilderInfo(service);
|
|
342
|
+
return [`\u2022 ${service.name}`, descInfo.colorFn(`[${descInfo.label}]`)];
|
|
343
|
+
});
|
|
331
344
|
}
|
|
332
345
|
function displayServicesConfigNote(configFileName = "vercel.json") {
|
|
333
346
|
output_manager_default.print(
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import {
|
|
8
|
+
require_lib
|
|
9
|
+
} from "./chunk-IDTFK3CR.js";
|
|
10
|
+
import {
|
|
11
|
+
packageName
|
|
12
|
+
} from "./chunk-LN6B7ZI3.js";
|
|
13
|
+
import {
|
|
14
|
+
__toESM
|
|
15
|
+
} from "./chunk-TZ2YI2VH.js";
|
|
16
|
+
|
|
17
|
+
// src/util/native-install.ts
|
|
18
|
+
function isNativeBinaryInstall() {
|
|
19
|
+
return process.env.VERCEL_VC_NATIVE === "1";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// src/util/get-update-command.ts
|
|
23
|
+
var import_fs_extra = __toESM(require_lib(), 1);
|
|
24
|
+
import { sep, dirname, join, resolve } from "path";
|
|
25
|
+
import { execFile } from "child_process";
|
|
26
|
+
import { promisify } from "util";
|
|
27
|
+
import { scanParentDirs } from "@vercel/build-utils";
|
|
28
|
+
var nativePackageName = "@vercel/vc-native";
|
|
29
|
+
var execFileAsync = promisify(execFile);
|
|
30
|
+
var globalRootQueries = {
|
|
31
|
+
npm: { args: ["root", "-g"], packageDir: (root, pkg) => join(root, pkg) },
|
|
32
|
+
pnpm: { args: ["root", "-g"], packageDir: (root, pkg) => join(root, pkg) },
|
|
33
|
+
yarn: {
|
|
34
|
+
args: ["global", "dir"],
|
|
35
|
+
packageDir: (root, pkg) => join(root, "node_modules", pkg)
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
async function getPackageManagerGlobalRoot(cliType) {
|
|
39
|
+
try {
|
|
40
|
+
const { stdout } = await execFileAsync(
|
|
41
|
+
cliType,
|
|
42
|
+
globalRootQueries[cliType].args,
|
|
43
|
+
{
|
|
44
|
+
encoding: "utf8",
|
|
45
|
+
windowsHide: true
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
const root = stdout.trim();
|
|
49
|
+
return root || null;
|
|
50
|
+
} catch (_) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async function detectGlobalCliType(installPath, pkg) {
|
|
55
|
+
for (const cliType of Object.keys(globalRootQueries)) {
|
|
56
|
+
const root = await getPackageManagerGlobalRoot(cliType);
|
|
57
|
+
if (!root) {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
let resolvedPackageDir;
|
|
61
|
+
try {
|
|
62
|
+
resolvedPackageDir = await (0, import_fs_extra.realpath)(
|
|
63
|
+
globalRootQueries[cliType].packageDir(root, pkg)
|
|
64
|
+
);
|
|
65
|
+
} catch (_) {
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
if (installPath === resolvedPackageDir || installPath.startsWith(resolvedPackageDir + sep)) {
|
|
69
|
+
return cliType;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
async function getConfigPrefix() {
|
|
75
|
+
const paths = [
|
|
76
|
+
process.env.npm_config_userconfig || process.env.NPM_CONFIG_USERCONFIG,
|
|
77
|
+
join(process.env.HOME || "/", ".npmrc"),
|
|
78
|
+
process.env.npm_config_globalconfig || process.env.NPM_CONFIG_GLOBALCONFIG
|
|
79
|
+
].filter(Boolean);
|
|
80
|
+
for (const configPath of paths) {
|
|
81
|
+
if (!configPath) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
const content = await (0, import_fs_extra.readFile)(configPath).then((buffer) => buffer.toString()).catch(() => null);
|
|
85
|
+
if (content) {
|
|
86
|
+
const [prefix] = content.split("\n").map((line) => line && line.trim()).filter((line) => line && line.startsWith("prefix")).map((line) => line.slice(line.indexOf("=") + 1).trim());
|
|
87
|
+
if (prefix) {
|
|
88
|
+
return prefix;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
function isGlobalByPath(installPath) {
|
|
95
|
+
if (dirname(process.argv[0]) === dirname(process.argv[1])) {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
if (installPath.includes(["", "yarn", "global", "node_modules", ""].join(sep))) {
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
if (installPath.includes(["", "pnpm", "global", ""].join(sep))) {
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
if (installPath.includes(["", "fnm", "node-versions", ""].join(sep))) {
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
async function isGlobalByPrefix(installPath) {
|
|
110
|
+
const isWindows = process.platform === "win32";
|
|
111
|
+
const defaultPath = isWindows ? process.env.APPDATA : "/usr/local/lib";
|
|
112
|
+
const prefixPath = process.env.PREFIX || process.env.npm_config_prefix || process.env.NPM_CONFIG_PREFIX || await getConfigPrefix() || defaultPath;
|
|
113
|
+
if (!prefixPath) {
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
try {
|
|
117
|
+
return installPath.startsWith(await (0, import_fs_extra.realpath)(prefixPath));
|
|
118
|
+
} catch (_) {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async function resolveInstall() {
|
|
123
|
+
const pkg = isNativeBinaryInstall() ? nativePackageName : packageName;
|
|
124
|
+
const installPath = await (0, import_fs_extra.realpath)(resolve(__dirname));
|
|
125
|
+
const globalCliType = await detectGlobalCliType(installPath, pkg);
|
|
126
|
+
if (globalCliType) {
|
|
127
|
+
return { cliType: globalCliType, global: true };
|
|
128
|
+
}
|
|
129
|
+
const entrypoint = await (0, import_fs_extra.realpath)(process.argv[1]);
|
|
130
|
+
const { cliType, lockfilePath } = await scanParentDirs(
|
|
131
|
+
dirname(dirname(entrypoint))
|
|
132
|
+
);
|
|
133
|
+
return {
|
|
134
|
+
// Global installs for npm do not have a lockfile
|
|
135
|
+
cliType: lockfilePath ? cliType : "npm",
|
|
136
|
+
global: isGlobalByPath(installPath) || await isGlobalByPrefix(installPath)
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
async function isGlobal() {
|
|
140
|
+
try {
|
|
141
|
+
return (await resolveInstall()).global;
|
|
142
|
+
} catch (_) {
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
async function getUpdateCommandInfo() {
|
|
147
|
+
const nativeInstall = isNativeBinaryInstall();
|
|
148
|
+
const pkgAndVersion = `${nativeInstall ? nativePackageName : packageName}@latest`;
|
|
149
|
+
if (nativeInstall) {
|
|
150
|
+
const segments = process.execPath.split(sep);
|
|
151
|
+
let cliType2 = "npm";
|
|
152
|
+
if (segments.includes("pnpm") || segments.includes(".pnpm")) {
|
|
153
|
+
cliType2 = "pnpm";
|
|
154
|
+
} else if (segments.includes("yarn") || segments.includes(".yarn")) {
|
|
155
|
+
cliType2 = "yarn";
|
|
156
|
+
}
|
|
157
|
+
const install2 = cliType2 === "yarn" ? "global add" : "i -g";
|
|
158
|
+
const force = cliType2 === "npm" ? " --force" : "";
|
|
159
|
+
return {
|
|
160
|
+
command: `${cliType2} ${install2} ${pkgAndVersion}${force}`,
|
|
161
|
+
global: true
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
const { cliType, global } = await resolveInstall();
|
|
165
|
+
const yarn = cliType === "yarn";
|
|
166
|
+
let install = yarn ? "add" : "i";
|
|
167
|
+
if (global) {
|
|
168
|
+
install = yarn ? "global add" : "i -g";
|
|
169
|
+
}
|
|
170
|
+
return { command: `${cliType} ${install} ${pkgAndVersion}`, global };
|
|
171
|
+
}
|
|
172
|
+
async function getUpdateCommand() {
|
|
173
|
+
return (await getUpdateCommandInfo()).command;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export {
|
|
177
|
+
isNativeBinaryInstall,
|
|
178
|
+
isGlobal,
|
|
179
|
+
getUpdateCommandInfo,
|
|
180
|
+
getUpdateCommand
|
|
181
|
+
};
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-V5P25P7F.js";
|
|
10
10
|
import {
|
|
11
11
|
getLocalPathConfig
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-APC5GMBX.js";
|
|
13
13
|
import {
|
|
14
14
|
DEFAULT_VERCEL_CONFIG_FILENAME,
|
|
15
15
|
VERCEL_CONFIG_EXTENSIONS,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
useKeypress,
|
|
37
37
|
usePrefix,
|
|
38
38
|
useState
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-IDTFK3CR.js";
|
|
40
40
|
import {
|
|
41
41
|
require_load_json_file
|
|
42
42
|
} from "./chunk-J5273CSE.js";
|
|
@@ -5,25 +5,25 @@ const require = __createRequire(import.meta.url);
|
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
7
|
import {
|
|
8
|
-
|
|
8
|
+
getUpdateCommandInfo,
|
|
9
9
|
isGlobal,
|
|
10
10
|
isNativeBinaryInstall
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-NLEBTR3S.js";
|
|
12
12
|
import {
|
|
13
13
|
getGlobalPathConfig,
|
|
14
14
|
writeToConfigFile
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-WNYUBBFH.js";
|
|
16
16
|
import {
|
|
17
17
|
apiCommand,
|
|
18
18
|
listSubcommand2 as listSubcommand,
|
|
19
19
|
loginCommand
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-HVYPWTJQ.js";
|
|
21
21
|
import {
|
|
22
22
|
help
|
|
23
23
|
} from "./chunk-VNUNCNPE.js";
|
|
24
24
|
import {
|
|
25
25
|
login
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-IDTFK3CR.js";
|
|
27
27
|
import {
|
|
28
28
|
TelemetryClient
|
|
29
29
|
} from "./chunk-J5273CSE.js";
|
|
@@ -2565,15 +2565,18 @@ async function runTagOperation(client, options) {
|
|
|
2565
2565
|
|
|
2566
2566
|
// src/util/upgrade.ts
|
|
2567
2567
|
import { spawn } from "child_process";
|
|
2568
|
+
import { tmpdir } from "os";
|
|
2568
2569
|
async function executeUpgrade() {
|
|
2569
|
-
const updateCommand = await
|
|
2570
|
+
const { command: updateCommand, global } = await getUpdateCommandInfo();
|
|
2570
2571
|
const [command, ...args] = updateCommand.split(" ");
|
|
2572
|
+
const cwd = global ? tmpdir() : process.cwd();
|
|
2571
2573
|
output_manager_default.log(`Upgrading Vercel CLI...`);
|
|
2572
|
-
output_manager_default.debug(`Executing: ${updateCommand}`);
|
|
2574
|
+
output_manager_default.debug(`Executing: ${updateCommand} (cwd: ${cwd})`);
|
|
2573
2575
|
return new Promise((resolve3) => {
|
|
2574
2576
|
const stdout = [];
|
|
2575
2577
|
const stderr = [];
|
|
2576
2578
|
const upgradeProcess = spawn(command, args, {
|
|
2579
|
+
cwd,
|
|
2577
2580
|
stdio: ["inherit", "pipe", "pipe"],
|
|
2578
2581
|
shell: false
|
|
2579
2582
|
});
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
parseSubcommandArgs,
|
|
16
16
|
resolveRoutes,
|
|
17
17
|
withGlobalFlags
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-NZDGG7W3.js";
|
|
19
19
|
import {
|
|
20
20
|
deleteSubcommand
|
|
21
21
|
} from "./chunk-WFRHKZFI.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
AGENT_REASON,
|
|
24
24
|
AGENT_STATUS
|
|
25
25
|
} from "./chunk-LJ5WXXG6.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-IDTFK3CR.js";
|
|
27
27
|
import "./chunk-J5273CSE.js";
|
|
28
28
|
import {
|
|
29
29
|
outputAgentError
|
|
@@ -17,12 +17,12 @@ import {
|
|
|
17
17
|
parseSubcommandArgs,
|
|
18
18
|
resolveRoute,
|
|
19
19
|
withGlobalFlags
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-NZDGG7W3.js";
|
|
21
21
|
import {
|
|
22
22
|
disableSubcommand
|
|
23
23
|
} from "./chunk-WFRHKZFI.js";
|
|
24
24
|
import "./chunk-LJ5WXXG6.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-IDTFK3CR.js";
|
|
26
26
|
import "./chunk-J5273CSE.js";
|
|
27
27
|
import {
|
|
28
28
|
outputAgentError
|
|
@@ -17,12 +17,12 @@ import {
|
|
|
17
17
|
parseSubcommandArgs,
|
|
18
18
|
printDiffSummary,
|
|
19
19
|
withGlobalFlags
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-NZDGG7W3.js";
|
|
21
21
|
import {
|
|
22
22
|
discardSubcommand
|
|
23
23
|
} from "./chunk-WFRHKZFI.js";
|
|
24
24
|
import "./chunk-LJ5WXXG6.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-IDTFK3CR.js";
|
|
26
26
|
import "./chunk-J5273CSE.js";
|
|
27
27
|
import {
|
|
28
28
|
outputAgentError
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
printRouteConfig,
|
|
20
20
|
routingRuleToCurrentRoute,
|
|
21
21
|
runInteractiveEditLoop
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-B744TFL4.js";
|
|
23
23
|
import {
|
|
24
24
|
getRouteVersions
|
|
25
25
|
} from "./chunk-AHU7WNL2.js";
|
|
@@ -31,12 +31,12 @@ import {
|
|
|
31
31
|
resolveRoute,
|
|
32
32
|
shellQuoteRouteIdentifierForSuggestion,
|
|
33
33
|
withGlobalFlags
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-NZDGG7W3.js";
|
|
35
35
|
import {
|
|
36
36
|
editSubcommand
|
|
37
37
|
} from "./chunk-WFRHKZFI.js";
|
|
38
38
|
import "./chunk-LJ5WXXG6.js";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-IDTFK3CR.js";
|
|
40
40
|
import "./chunk-J5273CSE.js";
|
|
41
41
|
import {
|
|
42
42
|
outputAgentError
|