vercel 51.2.0 → 51.3.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-3MIOUOZC.js +180 -0
- package/dist/chunks/{chunk-K4IC7LFB.js → chunk-2JQVASXJ.js} +13 -8
- package/dist/chunks/{chunk-Q6BEDVOU.js → chunk-4PQA6H63.js} +1 -1
- package/dist/chunks/{chunk-IS2HEMF4.js → chunk-4RBF6ZDU.js} +4 -2
- package/dist/chunks/{chunk-V23RAVWV.js → chunk-4VP55L4V.js} +211 -504
- package/dist/chunks/{chunk-TBW2XDGN.js → chunk-4WRHMYCG.js} +6 -6
- package/dist/chunks/chunk-4ZWTYJSP.js +139 -0
- package/dist/chunks/{chunk-7IDNCLTM.js → chunk-APGVHLAW.js} +2 -2
- package/dist/chunks/{chunk-UZIEJEMY.js → chunk-BAUYQ7AR.js} +1 -1
- package/dist/chunks/{chunk-BUBUVE23.js → chunk-BJQTGP42.js} +4 -2
- package/dist/chunks/{chunk-WOFF2NEI.js → chunk-BU3JMDDH.js} +3 -3
- package/dist/chunks/chunk-CGTXAXZ4.js +484 -0
- package/dist/chunks/{chunk-BQUQ5F7R.js → chunk-CRZM5WM2.js} +4 -2
- package/dist/chunks/{chunk-RQTDTSAX.js → chunk-CZXW3DJH.js} +2 -2
- package/dist/chunks/chunk-DVQ4SIWF.js +183 -0
- package/dist/chunks/{chunk-TWZWQGBN.js → chunk-E3NE4SKN.js} +3 -0
- package/dist/chunks/{chunk-A4NVECX5.js → chunk-ECRBC4HL.js} +4 -581
- package/dist/chunks/{chunk-65IHMJX4.js → chunk-FNFZO3WQ.js} +7 -5
- package/dist/chunks/{chunk-L2BKVTHL.js → chunk-G6RXZLQ2.js} +2 -2
- package/dist/chunks/{chunk-4YZKA4FN.js → chunk-GE6G37P4.js} +1 -1
- package/dist/chunks/{chunk-NELCIT4M.js → chunk-GLDQ23LD.js} +1 -1
- package/dist/chunks/{chunk-D7SZ3DXR.js → chunk-GYBFQLYR.js} +6 -4
- package/dist/chunks/{chunk-ZL5SYUAG.js → chunk-JEON5XEH.js} +44 -13
- package/dist/chunks/{chunk-Y5YCSB6X.js → chunk-LDXYSGPZ.js} +2 -2
- package/dist/chunks/{chunk-U5J73OA3.js → chunk-N45K6NXC.js} +1 -1
- package/dist/chunks/{chunk-YKKQGGLZ.js → chunk-NCQBQGI6.js} +2 -2
- package/dist/chunks/chunk-NE34PEHL.js +167 -0
- package/dist/chunks/{chunk-A5XRYFVO.js → chunk-OFUQPP26.js} +10 -6
- package/dist/chunks/{chunk-NYO5XRBQ.js → chunk-R2BVH5SQ.js} +1 -1
- package/dist/chunks/chunk-RFMC2QXQ.js +602 -0
- package/dist/chunks/{chunk-XHMU7WUB.js → chunk-RHXEHBO3.js} +8 -6
- package/dist/chunks/{chunk-5CRSHCRD.js → chunk-RRYVGOVK.js} +1 -1
- package/dist/chunks/{chunk-3PEFANXY.js → chunk-T7CL42FK.js} +5 -5
- package/dist/chunks/{chunk-WXNT7WJO.js → chunk-TAOVG4PS.js} +49 -4
- package/dist/chunks/{chunk-6DIXPIXB.js → chunk-UB325PS7.js} +1 -1
- package/dist/chunks/{chunk-2IAZZEVQ.js → chunk-UWKTUK3W.js} +4 -2
- package/dist/chunks/{chunk-VE7MY76H.js → chunk-VGWGLBUC.js} +4 -2
- package/dist/chunks/{chunk-F2ROYUW2.js → chunk-VMTOBGCO.js} +425 -28
- package/dist/chunks/{chunk-XMVSCINT.js → chunk-ZS5VKEZL.js} +5 -3
- package/dist/chunks/{compile-vercel-config-6FEECIZK.js → compile-vercel-config-A2SLMCWK.js} +4 -2
- package/dist/chunks/{delete-J2N2QXMP.js → delete-SEQBCYWT.js} +8 -6
- package/dist/chunks/{disable-QGYXQKAM.js → disable-GRM5DJGU.js} +8 -6
- package/dist/chunks/{discard-ZDGJB5US.js → discard-IVQWWSPI.js} +8 -6
- package/dist/chunks/{edit-RJWDA5KJ.js → edit-YTMZBT4Y.js} +9 -7
- package/dist/chunks/{enable-L33HPTXB.js → enable-SSU3MG6J.js} +8 -6
- package/dist/chunks/{export-Z5C4BJ2U.js → export-INCDZTYW.js} +8 -6
- package/dist/chunks/inspect-QMY2ZE6J.js +353 -0
- package/dist/chunks/{list-HXN64DKX.js → list-FF4VGSZ2.js} +115 -85
- package/dist/chunks/{list-4P2TW77C.js → list-MMIBPSB3.js} +10 -7
- package/dist/chunks/ls-TYEDISJD.js +114 -0
- package/dist/chunks/{publish-TLVHQB2H.js → publish-OJQCVDL5.js} +8 -6
- package/dist/chunks/{query-SDKQTWN2.js → query-LACPOOBL.js} +15 -12
- package/dist/chunks/{reorder-UHMUFYIW.js → reorder-TBFWHFQZ.js} +8 -6
- package/dist/chunks/{restore-762GO6HU.js → restore-5LUZRUME.js} +8 -6
- package/dist/chunks/rm-LDXY2G45.js +164 -0
- package/dist/chunks/rule-inspect-THIN6POX.js +142 -0
- package/dist/chunks/rules-4ZH7VTGC.js +83 -0
- package/dist/chunks/{schema-WBOIQRP4.js → schema-OK4OOI2N.js} +9 -7
- package/dist/chunks/{types-A4EAQ6F6.js → types-QNN5CDCB.js} +6 -4
- package/dist/chunks/update-EXPUPEH6.js +196 -0
- package/dist/commands/build/index.js +28 -24
- package/dist/commands/deploy/index.js +172 -33
- package/dist/commands/dev/index.js +21 -17
- package/dist/commands/env/index.js +32 -27
- package/dist/commands/link/index.js +21 -17
- package/dist/commands/list/index.js +14 -11
- package/dist/commands-bulk.js +4566 -1816
- package/dist/index.js +38 -24
- package/dist/version.mjs +1 -1
- package/package.json +18 -18
|
@@ -9,34 +9,41 @@ import {
|
|
|
9
9
|
require_dist as require_dist2,
|
|
10
10
|
require_graceful_fs
|
|
11
11
|
} from "./chunk-U3WLEFHU.js";
|
|
12
|
+
import {
|
|
13
|
+
buildCommandWithYes,
|
|
14
|
+
getPreservedArgsForEnvPull,
|
|
15
|
+
outputActionRequired,
|
|
16
|
+
outputAgentError
|
|
17
|
+
} from "./chunk-CGTXAXZ4.js";
|
|
12
18
|
import {
|
|
13
19
|
require_ms,
|
|
14
20
|
stamp_default
|
|
15
21
|
} from "./chunk-CO5D46AG.js";
|
|
22
|
+
import {
|
|
23
|
+
forceOption,
|
|
24
|
+
formatOption,
|
|
25
|
+
getArgs,
|
|
26
|
+
getFlagsSpecification,
|
|
27
|
+
parseArguments,
|
|
28
|
+
printError,
|
|
29
|
+
require_string_width,
|
|
30
|
+
require_strip_ansi,
|
|
31
|
+
yesOption
|
|
32
|
+
} from "./chunk-RFMC2QXQ.js";
|
|
16
33
|
import {
|
|
17
34
|
APIError,
|
|
18
35
|
CantParseJSONFile,
|
|
19
36
|
ConflictingConfigFiles,
|
|
20
37
|
InvalidToken,
|
|
21
|
-
LinkRequiredError,
|
|
22
38
|
MissingUser,
|
|
23
39
|
ProjectNotFound,
|
|
24
40
|
code,
|
|
25
|
-
forceOption,
|
|
26
|
-
formatOption,
|
|
27
|
-
getArgs,
|
|
28
41
|
getCommandName,
|
|
29
42
|
getCommandNamePlain,
|
|
30
|
-
getFlagsSpecification,
|
|
31
43
|
isAPIError,
|
|
32
44
|
packageName,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
require_lib,
|
|
36
|
-
require_string_width,
|
|
37
|
-
require_strip_ansi,
|
|
38
|
-
yesOption
|
|
39
|
-
} from "./chunk-A4NVECX5.js";
|
|
45
|
+
require_lib
|
|
46
|
+
} from "./chunk-ECRBC4HL.js";
|
|
40
47
|
import {
|
|
41
48
|
emoji,
|
|
42
49
|
eraseLines,
|
|
@@ -13982,14 +13989,14 @@ var require_read_config_file = __commonJS({
|
|
|
13982
13989
|
var import_js_yaml = __toESM2(require_js_yaml2());
|
|
13983
13990
|
var import_smol_toml2 = __require("smol-toml");
|
|
13984
13991
|
var import_fs4 = __require("fs");
|
|
13985
|
-
var
|
|
13992
|
+
var import_error_utils5 = require_dist();
|
|
13986
13993
|
var { readFile: readFile5 } = import_fs4.promises;
|
|
13987
13994
|
async function readFileOrNull(file) {
|
|
13988
13995
|
try {
|
|
13989
13996
|
const data = await readFile5(file);
|
|
13990
13997
|
return data;
|
|
13991
13998
|
} catch (error) {
|
|
13992
|
-
if (!(0,
|
|
13999
|
+
if (!(0, import_error_utils5.isErrnoException)(error)) {
|
|
13993
14000
|
throw error;
|
|
13994
14001
|
}
|
|
13995
14002
|
if (error.code !== "ENOENT") {
|
|
@@ -17940,6 +17947,105 @@ var require_frameworks = __commonJS({
|
|
|
17940
17947
|
}
|
|
17941
17948
|
]
|
|
17942
17949
|
},
|
|
17950
|
+
{
|
|
17951
|
+
name: "Axum",
|
|
17952
|
+
slug: "axum",
|
|
17953
|
+
experimental: true,
|
|
17954
|
+
supersedes: ["rust"],
|
|
17955
|
+
logo: "https://api-frameworks.vercel.sh/framework-logos/axum.svg",
|
|
17956
|
+
tagline: "Ergonomic and modular web framework built with Tokio, Tower, and Hyper.",
|
|
17957
|
+
description: "An Axum application deployed as a serverless function.",
|
|
17958
|
+
website: "https://github.com/tokio-rs/axum",
|
|
17959
|
+
useRuntime: { src: "src/main.rs", use: "@vercel/rust" },
|
|
17960
|
+
ignoreRuntimes: ["@vercel/rust"],
|
|
17961
|
+
detectors: {
|
|
17962
|
+
every: [
|
|
17963
|
+
{
|
|
17964
|
+
path: "Cargo.toml",
|
|
17965
|
+
matchContent: "axum\\s*="
|
|
17966
|
+
},
|
|
17967
|
+
{
|
|
17968
|
+
path: "src/main.rs"
|
|
17969
|
+
}
|
|
17970
|
+
]
|
|
17971
|
+
},
|
|
17972
|
+
settings: {
|
|
17973
|
+
installCommand: {
|
|
17974
|
+
placeholder: "None"
|
|
17975
|
+
},
|
|
17976
|
+
buildCommand: {
|
|
17977
|
+
placeholder: "None",
|
|
17978
|
+
value: null
|
|
17979
|
+
},
|
|
17980
|
+
devCommand: {
|
|
17981
|
+
placeholder: "`cargo run`",
|
|
17982
|
+
value: null
|
|
17983
|
+
},
|
|
17984
|
+
outputDirectory: {
|
|
17985
|
+
value: "N/A"
|
|
17986
|
+
}
|
|
17987
|
+
},
|
|
17988
|
+
getOutputDirName: async () => "public",
|
|
17989
|
+
defaultRoutes: [
|
|
17990
|
+
{
|
|
17991
|
+
handle: "filesystem"
|
|
17992
|
+
},
|
|
17993
|
+
{
|
|
17994
|
+
src: "/(.*)",
|
|
17995
|
+
dest: "/src/main"
|
|
17996
|
+
}
|
|
17997
|
+
]
|
|
17998
|
+
},
|
|
17999
|
+
{
|
|
18000
|
+
name: "Actix Web",
|
|
18001
|
+
slug: "actix-web",
|
|
18002
|
+
experimental: true,
|
|
18003
|
+
runtimeFramework: true,
|
|
18004
|
+
supersedes: ["rust"],
|
|
18005
|
+
logo: "https://api-frameworks.vercel.sh/framework-logos/actix-web.svg",
|
|
18006
|
+
tagline: "A powerful, pragmatic, and extremely fast web framework for Rust.",
|
|
18007
|
+
description: "An Actix Web application deployed as a serverless function.",
|
|
18008
|
+
website: "https://actix.rs",
|
|
18009
|
+
useRuntime: { src: "src/main.rs", use: "@vercel/rust" },
|
|
18010
|
+
ignoreRuntimes: ["@vercel/rust"],
|
|
18011
|
+
detectors: {
|
|
18012
|
+
every: [
|
|
18013
|
+
{
|
|
18014
|
+
path: "Cargo.toml",
|
|
18015
|
+
matchContent: "actix-web\\s*="
|
|
18016
|
+
},
|
|
18017
|
+
{
|
|
18018
|
+
path: "src/main.rs"
|
|
18019
|
+
}
|
|
18020
|
+
]
|
|
18021
|
+
},
|
|
18022
|
+
settings: {
|
|
18023
|
+
installCommand: {
|
|
18024
|
+
placeholder: "None"
|
|
18025
|
+
},
|
|
18026
|
+
buildCommand: {
|
|
18027
|
+
placeholder: "None",
|
|
18028
|
+
value: null
|
|
18029
|
+
},
|
|
18030
|
+
devCommand: {
|
|
18031
|
+
placeholder: "`cargo run`",
|
|
18032
|
+
value: null
|
|
18033
|
+
},
|
|
18034
|
+
outputDirectory: {
|
|
18035
|
+
value: "N/A"
|
|
18036
|
+
}
|
|
18037
|
+
},
|
|
18038
|
+
getOutputDirName: async () => "public",
|
|
18039
|
+
defaultRoutes: [
|
|
18040
|
+
{
|
|
18041
|
+
handle: "filesystem"
|
|
18042
|
+
},
|
|
18043
|
+
{
|
|
18044
|
+
src: "/(.*)",
|
|
18045
|
+
dest: "/src/main"
|
|
18046
|
+
}
|
|
18047
|
+
]
|
|
18048
|
+
},
|
|
17943
18049
|
{
|
|
17944
18050
|
name: "Node",
|
|
17945
18051
|
slug: "node",
|
|
@@ -23245,6 +23351,33 @@ var require_resolve2 = __commonJS({
|
|
|
23245
23351
|
var SERVICE_NAME_REGEX = /^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$/;
|
|
23246
23352
|
var DNS_LABEL_RE = /^(?!-)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;
|
|
23247
23353
|
var ENV_PREFIX_RE = /^[A-Z][A-Z0-9_]*_$/;
|
|
23354
|
+
async function getServiceFs(fs5, serviceName, root) {
|
|
23355
|
+
if (!root) {
|
|
23356
|
+
return { fs: fs5 };
|
|
23357
|
+
}
|
|
23358
|
+
const normalizedRoot = import_path12.posix.normalize(root);
|
|
23359
|
+
if (!await fs5.hasPath(normalizedRoot)) {
|
|
23360
|
+
return {
|
|
23361
|
+
fs: fs5,
|
|
23362
|
+
error: {
|
|
23363
|
+
code: "ROOT_NOT_FOUND",
|
|
23364
|
+
message: `Service "${serviceName}" has root "${root}" but that directory does not exist.`,
|
|
23365
|
+
serviceName
|
|
23366
|
+
}
|
|
23367
|
+
};
|
|
23368
|
+
}
|
|
23369
|
+
if (await fs5.isFile(normalizedRoot)) {
|
|
23370
|
+
return {
|
|
23371
|
+
fs: fs5,
|
|
23372
|
+
error: {
|
|
23373
|
+
code: "ROOT_NOT_DIRECTORY",
|
|
23374
|
+
message: `Service "${serviceName}" has root "${root}" but that path is a file, not a directory.`,
|
|
23375
|
+
serviceName
|
|
23376
|
+
}
|
|
23377
|
+
};
|
|
23378
|
+
}
|
|
23379
|
+
return { fs: fs5.chdir(normalizedRoot) };
|
|
23380
|
+
}
|
|
23248
23381
|
function normalizeServiceEntrypoint(entrypoint) {
|
|
23249
23382
|
const normalized = import_path12.posix.normalize(entrypoint);
|
|
23250
23383
|
return normalized === "" ? "." : normalized;
|
|
@@ -23503,6 +23636,23 @@ var require_resolve2 = __commonJS({
|
|
|
23503
23636
|
serviceName: name
|
|
23504
23637
|
};
|
|
23505
23638
|
}
|
|
23639
|
+
if (config.root !== void 0) {
|
|
23640
|
+
const normalizedRoot = import_path12.posix.normalize(config.root);
|
|
23641
|
+
if (normalizedRoot.startsWith("/")) {
|
|
23642
|
+
return {
|
|
23643
|
+
code: "INVALID_ROOT",
|
|
23644
|
+
message: `Service "${name}" has invalid "root" "${config.root}". Must be a relative path.`,
|
|
23645
|
+
serviceName: name
|
|
23646
|
+
};
|
|
23647
|
+
}
|
|
23648
|
+
if (normalizedRoot === ".." || normalizedRoot.startsWith("../")) {
|
|
23649
|
+
return {
|
|
23650
|
+
code: "INVALID_ROOT",
|
|
23651
|
+
message: `Service "${name}" has invalid "root" "${config.root}". Must not escape the project root.`,
|
|
23652
|
+
serviceName: name
|
|
23653
|
+
};
|
|
23654
|
+
}
|
|
23655
|
+
}
|
|
23506
23656
|
if (config.envPrefix !== void 0) {
|
|
23507
23657
|
if (!ENV_PREFIX_RE.test(config.envPrefix)) {
|
|
23508
23658
|
return {
|
|
@@ -23576,14 +23726,15 @@ var require_resolve2 = __commonJS({
|
|
|
23576
23726
|
const {
|
|
23577
23727
|
name,
|
|
23578
23728
|
config,
|
|
23579
|
-
|
|
23729
|
+
serviceFs,
|
|
23730
|
+
root,
|
|
23580
23731
|
group,
|
|
23581
23732
|
resolvedEntrypoint,
|
|
23582
23733
|
routePrefixSource = "configured"
|
|
23583
23734
|
} = options;
|
|
23584
23735
|
const type = config.type || "web";
|
|
23585
23736
|
const rawEntrypoint = config.entrypoint;
|
|
23586
|
-
const moduleAttrParsed = typeof rawEntrypoint === "string"
|
|
23737
|
+
const moduleAttrParsed = typeof rawEntrypoint === "string" ? parsePyModuleAttrEntrypoint(rawEntrypoint) : null;
|
|
23587
23738
|
const routingResult = resolveServiceRoutingConfig(name, config);
|
|
23588
23739
|
if (routingResult.error) {
|
|
23589
23740
|
throw new Error(routingResult.error.message);
|
|
@@ -23595,7 +23746,7 @@ var require_resolve2 = __commonJS({
|
|
|
23595
23746
|
if (!resolvedEntrypointPath && typeof rawEntrypoint === "string") {
|
|
23596
23747
|
const entrypointToResolve = moduleAttrParsed ? moduleAttrParsed.filePath : rawEntrypoint;
|
|
23597
23748
|
const resolved = await resolveEntrypointPath({
|
|
23598
|
-
fs:
|
|
23749
|
+
fs: serviceFs,
|
|
23599
23750
|
serviceName: name,
|
|
23600
23751
|
entrypoint: entrypointToResolve
|
|
23601
23752
|
});
|
|
@@ -23618,7 +23769,7 @@ var require_resolve2 = __commonJS({
|
|
|
23618
23769
|
workspace = normalizedEntrypoint;
|
|
23619
23770
|
} else {
|
|
23620
23771
|
const inferredWorkspace = await inferWorkspaceFromNearestManifest({
|
|
23621
|
-
fs:
|
|
23772
|
+
fs: serviceFs,
|
|
23622
23773
|
entrypoint: resolvedEntrypointFile,
|
|
23623
23774
|
runtime: inferredRuntime
|
|
23624
23775
|
});
|
|
@@ -23632,6 +23783,12 @@ var require_resolve2 = __commonJS({
|
|
|
23632
23783
|
}
|
|
23633
23784
|
}
|
|
23634
23785
|
}
|
|
23786
|
+
if (root) {
|
|
23787
|
+
const normalizedRoot = import_path12.posix.normalize(root);
|
|
23788
|
+
if (normalizedRoot !== ".") {
|
|
23789
|
+
workspace = workspace === "." ? normalizedRoot : import_path12.posix.join(normalizedRoot, workspace);
|
|
23790
|
+
}
|
|
23791
|
+
}
|
|
23635
23792
|
const topics = type === "worker" ? (0, import_build_utils5.getWorkerTopics)(config) : config.topics;
|
|
23636
23793
|
const consumer = type === "worker" ? config.consumer || "default" : config.consumer;
|
|
23637
23794
|
let builderUse;
|
|
@@ -23731,13 +23888,19 @@ var require_resolve2 = __commonJS({
|
|
|
23731
23888
|
errors.push(validationError);
|
|
23732
23889
|
continue;
|
|
23733
23890
|
}
|
|
23891
|
+
const root = serviceConfig.root;
|
|
23892
|
+
const serviceFsResult = await getServiceFs(fs5, name, root);
|
|
23893
|
+
if (serviceFsResult.error) {
|
|
23894
|
+
errors.push(serviceFsResult.error);
|
|
23895
|
+
continue;
|
|
23896
|
+
}
|
|
23897
|
+
const serviceFs = serviceFsResult.fs;
|
|
23734
23898
|
let resolvedEntrypoint;
|
|
23735
|
-
const serviceType = serviceConfig.type || "web";
|
|
23736
23899
|
if (typeof serviceConfig.entrypoint === "string") {
|
|
23737
|
-
const moduleAttr =
|
|
23738
|
-
const entrypointToResolve = moduleAttr
|
|
23900
|
+
const moduleAttr = parsePyModuleAttrEntrypoint(serviceConfig.entrypoint);
|
|
23901
|
+
const entrypointToResolve = moduleAttr?.filePath ?? serviceConfig.entrypoint;
|
|
23739
23902
|
const resolvedPath = await resolveEntrypointPath({
|
|
23740
|
-
fs:
|
|
23903
|
+
fs: serviceFs,
|
|
23741
23904
|
serviceName: name,
|
|
23742
23905
|
entrypoint: entrypointToResolve
|
|
23743
23906
|
});
|
|
@@ -23766,7 +23929,7 @@ var require_resolve2 = __commonJS({
|
|
|
23766
23929
|
});
|
|
23767
23930
|
const workspace = resolvedEntrypoint.normalized;
|
|
23768
23931
|
const { framework, error } = await detectFrameworkFromWorkspace({
|
|
23769
|
-
fs:
|
|
23932
|
+
fs: serviceFs,
|
|
23770
23933
|
workspace,
|
|
23771
23934
|
runtime: inferredRuntime,
|
|
23772
23935
|
serviceName: name
|
|
@@ -23794,13 +23957,13 @@ var require_resolve2 = __commonJS({
|
|
|
23794
23957
|
});
|
|
23795
23958
|
if (inferredRuntime) {
|
|
23796
23959
|
const inferredWorkspace = await inferWorkspaceFromNearestManifest({
|
|
23797
|
-
fs:
|
|
23960
|
+
fs: serviceFs,
|
|
23798
23961
|
entrypoint: resolvedEntrypoint.normalized,
|
|
23799
23962
|
runtime: inferredRuntime
|
|
23800
23963
|
});
|
|
23801
23964
|
const workspace = inferredWorkspace ?? import_path12.posix.dirname(resolvedEntrypoint.normalized);
|
|
23802
23965
|
const detection = await detectFrameworkFromWorkspace({
|
|
23803
|
-
fs:
|
|
23966
|
+
fs: serviceFs,
|
|
23804
23967
|
workspace,
|
|
23805
23968
|
serviceName: name,
|
|
23806
23969
|
runtime: inferredRuntime
|
|
@@ -23817,7 +23980,8 @@ var require_resolve2 = __commonJS({
|
|
|
23817
23980
|
const service = await resolveConfiguredService({
|
|
23818
23981
|
name,
|
|
23819
23982
|
config: resolvedConfig,
|
|
23820
|
-
|
|
23983
|
+
serviceFs,
|
|
23984
|
+
root,
|
|
23821
23985
|
resolvedEntrypoint,
|
|
23822
23986
|
routePrefixSource
|
|
23823
23987
|
});
|
|
@@ -24822,7 +24986,7 @@ var require_local_file_system_detector = __commonJS({
|
|
|
24822
24986
|
var import_promises4 = __toESM2(__require("fs/promises"));
|
|
24823
24987
|
var import_path12 = __require("path");
|
|
24824
24988
|
var import_filesystem = require_filesystem();
|
|
24825
|
-
var
|
|
24989
|
+
var import_error_utils5 = require_dist();
|
|
24826
24990
|
var LocalFileSystemDetector4 = class _LocalFileSystemDetector extends import_filesystem.DetectorFilesystem {
|
|
24827
24991
|
constructor(rootPath) {
|
|
24828
24992
|
super();
|
|
@@ -24833,7 +24997,7 @@ var require_local_file_system_detector = __commonJS({
|
|
|
24833
24997
|
await import_promises4.default.stat(this.getFilePath(name));
|
|
24834
24998
|
return true;
|
|
24835
24999
|
} catch (err) {
|
|
24836
|
-
if ((0,
|
|
25000
|
+
if ((0, import_error_utils5.isErrnoException)(err) && err.code === "ENOENT") {
|
|
24837
25001
|
return false;
|
|
24838
25002
|
}
|
|
24839
25003
|
throw err;
|
|
@@ -25301,7 +25465,7 @@ var require_detect_builders = __commonJS({
|
|
|
25301
25465
|
}
|
|
25302
25466
|
}
|
|
25303
25467
|
const nodeExtensions = [".js", ".mjs", ".ts", ".tsx"];
|
|
25304
|
-
if (process.env.VERCEL_NODE_FILTER_ENTRYPOINTS === "1" && nodeExtensions.some((ext) => fileName.endsWith(ext)) && options.workPath) {
|
|
25468
|
+
if (fileName.startsWith("api/") && process.env.VERCEL_NODE_FILTER_ENTRYPOINTS === "1" && nodeExtensions.some((ext) => fileName.endsWith(ext)) && options.workPath) {
|
|
25305
25469
|
const fsPath = (0, import_path12.join)(options.workPath, fileName);
|
|
25306
25470
|
const isEntrypoint = await (0, import_build_utils5.isNodeEntrypoint)({ fsPath });
|
|
25307
25471
|
if (!isEntrypoint) {
|
|
@@ -38966,7 +39130,7 @@ var require_package = __commonJS({
|
|
|
38966
39130
|
"../client/package.json"(exports, module) {
|
|
38967
39131
|
module.exports = {
|
|
38968
39132
|
name: "@vercel/client",
|
|
38969
|
-
version: "17.3.
|
|
39133
|
+
version: "17.3.3",
|
|
38970
39134
|
main: "dist/index.js",
|
|
38971
39135
|
typings: "dist/index.d.ts",
|
|
38972
39136
|
homepage: "https://vercel.com",
|
|
@@ -48239,10 +48403,10 @@ var require_util4 = __commonJS({
|
|
|
48239
48403
|
return objectToString(d) === "[object Date]";
|
|
48240
48404
|
}
|
|
48241
48405
|
exports.isDate = isDate;
|
|
48242
|
-
function
|
|
48406
|
+
function isError2(e) {
|
|
48243
48407
|
return objectToString(e) === "[object Error]" || e instanceof Error;
|
|
48244
48408
|
}
|
|
48245
|
-
exports.isError =
|
|
48409
|
+
exports.isError = isError2;
|
|
48246
48410
|
function isFunction(arg) {
|
|
48247
48411
|
return typeof arg === "function";
|
|
48248
48412
|
}
|
|
@@ -52049,7 +52213,7 @@ var require_create_deployment = __commonJS({
|
|
|
52049
52213
|
var import_upload = require_upload();
|
|
52050
52214
|
var import_utils4 = require_utils10();
|
|
52051
52215
|
var import_errors3 = require_errors();
|
|
52052
|
-
var
|
|
52216
|
+
var import_error_utils5 = require_dist();
|
|
52053
52217
|
var import_archive = require_archive();
|
|
52054
52218
|
function buildCreateDeployment() {
|
|
52055
52219
|
return async function* createDeployment(clientOptions, deploymentOptions = {}) {
|
|
@@ -52130,7 +52294,7 @@ var require_create_deployment = __commonJS({
|
|
|
52130
52294
|
files = await (0, import_hashes.hashes)(fileList);
|
|
52131
52295
|
}
|
|
52132
52296
|
} catch (err) {
|
|
52133
|
-
if (clientOptions.prebuilt && (0,
|
|
52297
|
+
if (clientOptions.prebuilt && (0, import_error_utils5.isErrnoException)(err) && err.code === "ENOENT" && err.path) {
|
|
52134
52298
|
const errPath = (0, import_path12.relative)(workPath, err.path);
|
|
52135
52299
|
err.message = `File does not exist: "${(0, import_path12.relative)(workPath, errPath)}"`;
|
|
52136
52300
|
if (errPath.split(import_path12.sep).includes("node_modules")) {
|
|
@@ -52579,7 +52743,7 @@ var global_path_default = getGlobalPathConfig;
|
|
|
52579
52743
|
|
|
52580
52744
|
// src/util/projects/link.ts
|
|
52581
52745
|
import { NowBuildError as NowBuildError2, getPlatformEnv } from "@vercel/build-utils";
|
|
52582
|
-
var
|
|
52746
|
+
var import_error_utils4 = __toESM(require_dist(), 1);
|
|
52583
52747
|
|
|
52584
52748
|
// src/util/link/repo.ts
|
|
52585
52749
|
var import_chalk6 = __toESM(require_source(), 1);
|
|
@@ -53982,452 +54146,6 @@ async function getTeams(client, opts = {}) {
|
|
|
53982
54146
|
}
|
|
53983
54147
|
}
|
|
53984
54148
|
|
|
53985
|
-
// src/util/agent-output.ts
|
|
53986
|
-
var import_error_utils2 = __toESM(require_dist(), 1);
|
|
53987
|
-
function buildCommandWithYes(argv, pkgName = packageName) {
|
|
53988
|
-
const args = argv.slice(2);
|
|
53989
|
-
const hasYes = args.some((a) => a === "--yes" || a === "-y");
|
|
53990
|
-
const out = hasYes ? [...args] : [...args, "--yes"];
|
|
53991
|
-
return `${pkgName} ${out.join(" ")}`;
|
|
53992
|
-
}
|
|
53993
|
-
var GLOBAL_FLAG_NAMES = /* @__PURE__ */ new Set([
|
|
53994
|
-
"--cwd",
|
|
53995
|
-
"--config",
|
|
53996
|
-
"--yes",
|
|
53997
|
-
"-y",
|
|
53998
|
-
"--non-interactive",
|
|
53999
|
-
"--scope",
|
|
54000
|
-
"--team",
|
|
54001
|
-
"-S",
|
|
54002
|
-
"-T",
|
|
54003
|
-
"--token"
|
|
54004
|
-
]);
|
|
54005
|
-
var BOOLEAN_GLOBAL_FLAG_NAMES = /* @__PURE__ */ new Set(["--yes", "-y", "--non-interactive"]);
|
|
54006
|
-
function getGlobalFlagsFromArgv(argv) {
|
|
54007
|
-
const args = argv.slice(2);
|
|
54008
|
-
const out = [];
|
|
54009
|
-
for (let i = 0; i < args.length; i++) {
|
|
54010
|
-
const arg = args[i];
|
|
54011
|
-
const name = arg.startsWith("--") ? arg.split("=")[0] : arg;
|
|
54012
|
-
if (GLOBAL_FLAG_NAMES.has(name)) {
|
|
54013
|
-
out.push(arg);
|
|
54014
|
-
const takesSeparateValue = !BOOLEAN_GLOBAL_FLAG_NAMES.has(name) && !arg.includes("=") && i + 1 < args.length && !args[i + 1].startsWith("-");
|
|
54015
|
-
if (takesSeparateValue) {
|
|
54016
|
-
out.push(args[i + 1]);
|
|
54017
|
-
i++;
|
|
54018
|
-
}
|
|
54019
|
-
}
|
|
54020
|
-
}
|
|
54021
|
-
return out;
|
|
54022
|
-
}
|
|
54023
|
-
function omitGlobalFlagsFromArgs(args) {
|
|
54024
|
-
const out = [];
|
|
54025
|
-
for (let i = 0; i < args.length; i++) {
|
|
54026
|
-
const arg = args[i];
|
|
54027
|
-
const name = arg.startsWith("--") ? arg.split("=")[0] : arg;
|
|
54028
|
-
if (GLOBAL_FLAG_NAMES.has(name)) {
|
|
54029
|
-
const skipSeparateValue = !BOOLEAN_GLOBAL_FLAG_NAMES.has(name) && !arg.includes("=") && i + 1 < args.length && !args[i + 1].startsWith("-");
|
|
54030
|
-
if (skipSeparateValue) {
|
|
54031
|
-
i++;
|
|
54032
|
-
}
|
|
54033
|
-
continue;
|
|
54034
|
-
}
|
|
54035
|
-
out.push(arg);
|
|
54036
|
-
}
|
|
54037
|
-
return out;
|
|
54038
|
-
}
|
|
54039
|
-
function buildIntegrationCommandTailFromArgv(argv) {
|
|
54040
|
-
const args = argv.slice(2);
|
|
54041
|
-
const idx = args.indexOf("integration");
|
|
54042
|
-
if (idx === -1) {
|
|
54043
|
-
return "integration";
|
|
54044
|
-
}
|
|
54045
|
-
return omitGlobalFlagsFromArgs(args.slice(idx)).join(" ");
|
|
54046
|
-
}
|
|
54047
|
-
function buildCommandWithGlobalFlags(argv, commandTemplate, pkgName = packageName, options) {
|
|
54048
|
-
let preserved = getGlobalFlagsFromArgv(argv);
|
|
54049
|
-
if (options?.excludeFlags?.length) {
|
|
54050
|
-
const exclude = new Set(options.excludeFlags);
|
|
54051
|
-
const out = [];
|
|
54052
|
-
for (let i = 0; i < preserved.length; i++) {
|
|
54053
|
-
const arg = preserved[i];
|
|
54054
|
-
const name = arg.startsWith("--") ? arg.split("=")[0] : arg;
|
|
54055
|
-
if (exclude.has(name)) {
|
|
54056
|
-
if (!arg.includes("=") && i + 1 < preserved.length && !preserved[i + 1].startsWith("-")) {
|
|
54057
|
-
i++;
|
|
54058
|
-
}
|
|
54059
|
-
continue;
|
|
54060
|
-
}
|
|
54061
|
-
out.push(arg);
|
|
54062
|
-
}
|
|
54063
|
-
preserved = out;
|
|
54064
|
-
}
|
|
54065
|
-
const base = `${pkgName} ${commandTemplate}`;
|
|
54066
|
-
if (preserved.length === 0) {
|
|
54067
|
-
return base;
|
|
54068
|
-
}
|
|
54069
|
-
if (options?.prependGlobalFlags) {
|
|
54070
|
-
return `${pkgName} ${preserved.join(" ")} ${commandTemplate}`;
|
|
54071
|
-
}
|
|
54072
|
-
return `${base} ${preserved.join(" ")}`;
|
|
54073
|
-
}
|
|
54074
|
-
function getPreservedArgsForEnvAdd(argv) {
|
|
54075
|
-
const args = argv.slice(2);
|
|
54076
|
-
const addIdx = args.indexOf("add");
|
|
54077
|
-
if (addIdx === -1 || args[addIdx - 1] !== "env")
|
|
54078
|
-
return args;
|
|
54079
|
-
let i = addIdx + 1;
|
|
54080
|
-
let positionals = 0;
|
|
54081
|
-
while (i < args.length && positionals < 3 && !args[i].startsWith("-")) {
|
|
54082
|
-
positionals++;
|
|
54083
|
-
i++;
|
|
54084
|
-
}
|
|
54085
|
-
return args.slice(i);
|
|
54086
|
-
}
|
|
54087
|
-
function buildEnvAddCommandWithPreservedArgs(argv, commandTemplate, pkgName = packageName) {
|
|
54088
|
-
let preserved = getPreservedArgsForEnvAdd(argv);
|
|
54089
|
-
if (commandTemplate.includes("--yes")) {
|
|
54090
|
-
preserved = preserved.filter((a) => a !== "--yes" && a !== "-y");
|
|
54091
|
-
}
|
|
54092
|
-
if (commandTemplate.includes("--value")) {
|
|
54093
|
-
const out = [];
|
|
54094
|
-
for (let j = 0; j < preserved.length; j++) {
|
|
54095
|
-
if (preserved[j] === "--value" && j + 1 < preserved.length) {
|
|
54096
|
-
j++;
|
|
54097
|
-
continue;
|
|
54098
|
-
}
|
|
54099
|
-
if (preserved[j].startsWith("--value="))
|
|
54100
|
-
continue;
|
|
54101
|
-
out.push(preserved[j]);
|
|
54102
|
-
}
|
|
54103
|
-
preserved = out;
|
|
54104
|
-
}
|
|
54105
|
-
const base = `${pkgName} ${commandTemplate}`;
|
|
54106
|
-
if (preserved.length === 0)
|
|
54107
|
-
return base;
|
|
54108
|
-
return `${base} ${preserved.join(" ")}`;
|
|
54109
|
-
}
|
|
54110
|
-
function getPreservedArgsForEnvPull(argv) {
|
|
54111
|
-
const args = argv.slice(2);
|
|
54112
|
-
const pullIdx = args.indexOf("pull");
|
|
54113
|
-
if (pullIdx === -1 || args[pullIdx - 1] !== "env")
|
|
54114
|
-
return args;
|
|
54115
|
-
let i = pullIdx + 1;
|
|
54116
|
-
if (i < args.length && !args[i].startsWith("-"))
|
|
54117
|
-
i++;
|
|
54118
|
-
return args.slice(i);
|
|
54119
|
-
}
|
|
54120
|
-
function getPreservedArgsForEnvRm(argv) {
|
|
54121
|
-
const args = argv.slice(2);
|
|
54122
|
-
const rmIdx = args.indexOf("rm");
|
|
54123
|
-
if (rmIdx === -1 || args[rmIdx - 1] !== "env")
|
|
54124
|
-
return args;
|
|
54125
|
-
let i = rmIdx + 1;
|
|
54126
|
-
let positionals = 0;
|
|
54127
|
-
while (i < args.length && positionals < 3 && !args[i].startsWith("-")) {
|
|
54128
|
-
positionals++;
|
|
54129
|
-
i++;
|
|
54130
|
-
}
|
|
54131
|
-
return args.slice(i);
|
|
54132
|
-
}
|
|
54133
|
-
function buildEnvRmCommandWithPreservedArgs(argv, commandTemplate, pkgName = packageName) {
|
|
54134
|
-
let preserved = getPreservedArgsForEnvRm(argv);
|
|
54135
|
-
if (commandTemplate.includes("--yes")) {
|
|
54136
|
-
preserved = preserved.filter((a) => a !== "--yes" && a !== "-y");
|
|
54137
|
-
}
|
|
54138
|
-
const base = `${pkgName} ${commandTemplate}`;
|
|
54139
|
-
if (preserved.length === 0)
|
|
54140
|
-
return base;
|
|
54141
|
-
return `${base} ${preserved.join(" ")}`;
|
|
54142
|
-
}
|
|
54143
|
-
function getPreservedArgsForEnvUpdate(argv) {
|
|
54144
|
-
const args = argv.slice(2);
|
|
54145
|
-
const updateIdx = args.indexOf("update");
|
|
54146
|
-
if (updateIdx === -1 || args[updateIdx - 1] !== "env")
|
|
54147
|
-
return args;
|
|
54148
|
-
let i = updateIdx + 1;
|
|
54149
|
-
let positionals = 0;
|
|
54150
|
-
while (i < args.length && positionals < 3 && !args[i].startsWith("-")) {
|
|
54151
|
-
positionals++;
|
|
54152
|
-
i++;
|
|
54153
|
-
}
|
|
54154
|
-
return args.slice(i);
|
|
54155
|
-
}
|
|
54156
|
-
function buildEnvUpdateCommandWithPreservedArgs(argv, commandTemplate, pkgName = packageName) {
|
|
54157
|
-
let preserved = getPreservedArgsForEnvUpdate(argv);
|
|
54158
|
-
if (commandTemplate.includes("--yes")) {
|
|
54159
|
-
preserved = preserved.filter((a) => a !== "--yes" && a !== "-y");
|
|
54160
|
-
}
|
|
54161
|
-
if (commandTemplate.includes("--value")) {
|
|
54162
|
-
const out = [];
|
|
54163
|
-
for (let i = 0; i < preserved.length; i++) {
|
|
54164
|
-
if (preserved[i] === "--value" && i + 1 < preserved.length) {
|
|
54165
|
-
i++;
|
|
54166
|
-
continue;
|
|
54167
|
-
}
|
|
54168
|
-
if (preserved[i].startsWith("--value="))
|
|
54169
|
-
continue;
|
|
54170
|
-
out.push(preserved[i]);
|
|
54171
|
-
}
|
|
54172
|
-
preserved = out;
|
|
54173
|
-
}
|
|
54174
|
-
const base = `${pkgName} ${commandTemplate}`;
|
|
54175
|
-
if (preserved.length === 0)
|
|
54176
|
-
return base;
|
|
54177
|
-
return `${base} ${preserved.join(" ")}`;
|
|
54178
|
-
}
|
|
54179
|
-
function buildCommandWithScope(argv, scopeSlug, pkgName = packageName) {
|
|
54180
|
-
const args = argv.slice(2);
|
|
54181
|
-
const out = [];
|
|
54182
|
-
for (let i = 0; i < args.length; i++) {
|
|
54183
|
-
if (args[i] === "--scope" || args[i] === "--team" || args[i] === "-S" || args[i] === "-T") {
|
|
54184
|
-
i++;
|
|
54185
|
-
continue;
|
|
54186
|
-
}
|
|
54187
|
-
if (args[i].startsWith("--scope=") || args[i].startsWith("--team=")) {
|
|
54188
|
-
continue;
|
|
54189
|
-
}
|
|
54190
|
-
out.push(args[i]);
|
|
54191
|
-
}
|
|
54192
|
-
out.push("--scope", scopeSlug);
|
|
54193
|
-
return `${pkgName} ${out.join(" ")}`;
|
|
54194
|
-
}
|
|
54195
|
-
function enrichActionRequiredWithInvokingCommand(payload, argv) {
|
|
54196
|
-
if (!payload.choices?.length) {
|
|
54197
|
-
return payload;
|
|
54198
|
-
}
|
|
54199
|
-
const next = [];
|
|
54200
|
-
const linkArgv = [...argv.slice(0, 2), "link", ...argv.slice(3)];
|
|
54201
|
-
for (const choice of payload.choices) {
|
|
54202
|
-
const slug = choice.name;
|
|
54203
|
-
next.push({
|
|
54204
|
-
command: buildCommandWithScope(linkArgv, slug),
|
|
54205
|
-
when: "Link first (then run any command without --scope)"
|
|
54206
|
-
});
|
|
54207
|
-
next.push({
|
|
54208
|
-
command: buildCommandWithScope(argv, slug),
|
|
54209
|
-
when: "Run this command with scope (no link)"
|
|
54210
|
-
});
|
|
54211
|
-
}
|
|
54212
|
-
return { ...payload, next };
|
|
54213
|
-
}
|
|
54214
|
-
function outputActionRequired(client, payload, exitCode = 1) {
|
|
54215
|
-
if (!shouldEmitNonInteractiveCommandError(client)) {
|
|
54216
|
-
return;
|
|
54217
|
-
}
|
|
54218
|
-
const enriched = enrichActionRequiredWithInvokingCommand(
|
|
54219
|
-
payload,
|
|
54220
|
-
client.argv
|
|
54221
|
-
);
|
|
54222
|
-
if (!enriched.hint && enriched.next?.length) {
|
|
54223
|
-
enriched.hint = "Run one of the commands in next[] to complete without prompting.";
|
|
54224
|
-
}
|
|
54225
|
-
client.stdout.write(`${JSON.stringify(enriched, null, 2)}
|
|
54226
|
-
`);
|
|
54227
|
-
process.exit(exitCode);
|
|
54228
|
-
}
|
|
54229
|
-
function argvHasNonInteractive(argv) {
|
|
54230
|
-
if (!argv?.length) {
|
|
54231
|
-
return false;
|
|
54232
|
-
}
|
|
54233
|
-
for (let i = 0; i < argv.length; i++) {
|
|
54234
|
-
const a = argv[i];
|
|
54235
|
-
if (a === "--non-interactive") {
|
|
54236
|
-
return argv[i + 1] !== "false";
|
|
54237
|
-
}
|
|
54238
|
-
if (a.startsWith("--non-interactive=")) {
|
|
54239
|
-
return a.slice("--non-interactive=".length) !== "false";
|
|
54240
|
-
}
|
|
54241
|
-
}
|
|
54242
|
-
return false;
|
|
54243
|
-
}
|
|
54244
|
-
function shouldEmitNonInteractiveCommandError(client) {
|
|
54245
|
-
return client.nonInteractive || argvHasNonInteractive(client.argv ?? []);
|
|
54246
|
-
}
|
|
54247
|
-
function outputAgentError(client, payload, exitCode = 1) {
|
|
54248
|
-
if (!shouldEmitNonInteractiveCommandError(client)) {
|
|
54249
|
-
return;
|
|
54250
|
-
}
|
|
54251
|
-
client.stdout.write(`${JSON.stringify(payload, null, 2)}
|
|
54252
|
-
`);
|
|
54253
|
-
process.exit(exitCode);
|
|
54254
|
-
}
|
|
54255
|
-
function buildNextStepsForEdgeConfig(client) {
|
|
54256
|
-
return [
|
|
54257
|
-
{
|
|
54258
|
-
command: buildCommandWithGlobalFlags(client.argv, "edge-config list"),
|
|
54259
|
-
when: "List Edge Config stores in the current team scope"
|
|
54260
|
-
},
|
|
54261
|
-
{
|
|
54262
|
-
command: buildCommandWithGlobalFlags(client.argv, "teams switch"),
|
|
54263
|
-
when: "Switch to the team that owns the Edge Config"
|
|
54264
|
-
},
|
|
54265
|
-
{
|
|
54266
|
-
command: buildCommandWithGlobalFlags(client.argv, "whoami"),
|
|
54267
|
-
when: "Verify the current team or user scope"
|
|
54268
|
-
}
|
|
54269
|
-
];
|
|
54270
|
-
}
|
|
54271
|
-
var EDGE_CONFIG_NON_INTERACTIVE_HINT = "Edge Config commands use your current team scope. Pass --scope or run `vercel teams switch` if the store is missing.";
|
|
54272
|
-
function buildNextStepsForProjectSubcommands(client, variant) {
|
|
54273
|
-
const byName = variant === "access-groups" ? {
|
|
54274
|
-
template: "project access-groups <name>",
|
|
54275
|
-
when: "List access groups by project name (replace <name>)"
|
|
54276
|
-
} : variant === "access-summary" ? {
|
|
54277
|
-
template: "project access-summary <name>",
|
|
54278
|
-
when: "Show role counts by project name (replace <name>)"
|
|
54279
|
-
} : variant === "protection" ? {
|
|
54280
|
-
template: "project protection <name>",
|
|
54281
|
-
when: "Show deployment protection by project name (replace <name>)"
|
|
54282
|
-
} : variant === "speed-insights" ? {
|
|
54283
|
-
template: "project speed-insights <name>",
|
|
54284
|
-
when: "Enable Speed Insights by project name (replace <name>)"
|
|
54285
|
-
} : variant === "web-analytics" ? {
|
|
54286
|
-
template: "project web-analytics <name>",
|
|
54287
|
-
when: "Enable Web Analytics by project name (replace <name>)"
|
|
54288
|
-
} : variant === "checks" ? {
|
|
54289
|
-
template: "project checks add <name>",
|
|
54290
|
-
when: "Create a deployment check by project name (replace <name>)"
|
|
54291
|
-
} : {
|
|
54292
|
-
template: "project members <name>",
|
|
54293
|
-
when: "List members by project name (replace <name>)"
|
|
54294
|
-
};
|
|
54295
|
-
return [
|
|
54296
|
-
{
|
|
54297
|
-
command: buildCommandWithGlobalFlags(client.argv, "link"),
|
|
54298
|
-
when: "Re-link this directory to the correct Vercel project"
|
|
54299
|
-
},
|
|
54300
|
-
{
|
|
54301
|
-
command: buildCommandWithGlobalFlags(client.argv, byName.template),
|
|
54302
|
-
when: byName.when
|
|
54303
|
-
},
|
|
54304
|
-
{
|
|
54305
|
-
command: buildCommandWithGlobalFlags(client.argv, "project ls"),
|
|
54306
|
-
when: "List projects in the current team to pick a name"
|
|
54307
|
-
}
|
|
54308
|
-
];
|
|
54309
|
-
}
|
|
54310
|
-
var PROJECT_SUBCOMMAND_ERROR_HINT = "If you use --cwd, ensure that folder is linked to the right project, or pass an explicit project name. Use --scope when the project belongs to another team.";
|
|
54311
|
-
function resolveNonInteractiveDefaults(client, variant) {
|
|
54312
|
-
if (variant === "edge-config") {
|
|
54313
|
-
return {
|
|
54314
|
-
next: buildNextStepsForEdgeConfig(client),
|
|
54315
|
-
hint: EDGE_CONFIG_NON_INTERACTIVE_HINT
|
|
54316
|
-
};
|
|
54317
|
-
}
|
|
54318
|
-
return {
|
|
54319
|
-
next: buildNextStepsForProjectSubcommands(client, variant),
|
|
54320
|
-
hint: PROJECT_SUBCOMMAND_ERROR_HINT
|
|
54321
|
-
};
|
|
54322
|
-
}
|
|
54323
|
-
function writeAgentErrorPayloadAndExit(client, payload, exitCode, variant) {
|
|
54324
|
-
const defaults = resolveNonInteractiveDefaults(client, variant);
|
|
54325
|
-
const out = {
|
|
54326
|
-
...payload,
|
|
54327
|
-
next: payload.next ?? defaults.next,
|
|
54328
|
-
hint: payload.hint ?? defaults.hint
|
|
54329
|
-
};
|
|
54330
|
-
client.stdout.write(`${JSON.stringify(out, null, 2)}
|
|
54331
|
-
`);
|
|
54332
|
-
process.exit(exitCode);
|
|
54333
|
-
}
|
|
54334
|
-
function isProjectNotFoundLike(err) {
|
|
54335
|
-
if (err instanceof ProjectNotFound) {
|
|
54336
|
-
return true;
|
|
54337
|
-
}
|
|
54338
|
-
if ((0, import_error_utils2.isError)(err) && "code" in err && err.code === "PROJECT_NOT_FOUND") {
|
|
54339
|
-
return true;
|
|
54340
|
-
}
|
|
54341
|
-
return false;
|
|
54342
|
-
}
|
|
54343
|
-
function isLinkRequiredLike(err) {
|
|
54344
|
-
return err instanceof LinkRequiredError;
|
|
54345
|
-
}
|
|
54346
|
-
function normalizeApiErrorText(message) {
|
|
54347
|
-
return message.replace(/\s*\(\d{3}\)\s*$/, "").trim();
|
|
54348
|
-
}
|
|
54349
|
-
function exitWithNonInteractiveError(client, err, exitCode = 1, options = {
|
|
54350
|
-
variant: "members"
|
|
54351
|
-
}) {
|
|
54352
|
-
if (!shouldEmitNonInteractiveCommandError(client)) {
|
|
54353
|
-
return;
|
|
54354
|
-
}
|
|
54355
|
-
const { variant } = options;
|
|
54356
|
-
if (isLinkRequiredLike(err)) {
|
|
54357
|
-
if (variant === "edge-config") {
|
|
54358
|
-
writeAgentErrorPayloadAndExit(
|
|
54359
|
-
client,
|
|
54360
|
-
{
|
|
54361
|
-
status: "error",
|
|
54362
|
-
reason: "link_required",
|
|
54363
|
-
message: err instanceof Error ? err.message : String(err),
|
|
54364
|
-
next: buildNextStepsForEdgeConfig(client),
|
|
54365
|
-
hint: EDGE_CONFIG_NON_INTERACTIVE_HINT
|
|
54366
|
-
},
|
|
54367
|
-
exitCode,
|
|
54368
|
-
"edge-config"
|
|
54369
|
-
);
|
|
54370
|
-
return;
|
|
54371
|
-
}
|
|
54372
|
-
writeAgentErrorPayloadAndExit(
|
|
54373
|
-
client,
|
|
54374
|
-
{
|
|
54375
|
-
status: "error",
|
|
54376
|
-
reason: "link_required",
|
|
54377
|
-
message: err instanceof Error ? err.message : String(err)
|
|
54378
|
-
},
|
|
54379
|
-
exitCode,
|
|
54380
|
-
variant
|
|
54381
|
-
);
|
|
54382
|
-
return;
|
|
54383
|
-
}
|
|
54384
|
-
if (isProjectNotFoundLike(err)) {
|
|
54385
|
-
writeAgentErrorPayloadAndExit(
|
|
54386
|
-
client,
|
|
54387
|
-
{
|
|
54388
|
-
status: "error",
|
|
54389
|
-
reason: "project_not_found",
|
|
54390
|
-
message: err instanceof Error ? err.message : String(err)
|
|
54391
|
-
},
|
|
54392
|
-
exitCode,
|
|
54393
|
-
variant
|
|
54394
|
-
);
|
|
54395
|
-
return;
|
|
54396
|
-
}
|
|
54397
|
-
if (isAPIError(err)) {
|
|
54398
|
-
const rawMessage = err.serverMessage || err.message;
|
|
54399
|
-
const message = normalizeApiErrorText(rawMessage);
|
|
54400
|
-
const reason = err.status === 403 ? "forbidden" : err.status === 401 ? "not_authorized" : err.status === 404 ? variant === "edge-config" ? "not_found" : "project_not_found" : err.status === 429 ? "rate_limited" : "api_error";
|
|
54401
|
-
writeAgentErrorPayloadAndExit(
|
|
54402
|
-
client,
|
|
54403
|
-
{
|
|
54404
|
-
status: "error",
|
|
54405
|
-
reason,
|
|
54406
|
-
message
|
|
54407
|
-
},
|
|
54408
|
-
exitCode,
|
|
54409
|
-
variant
|
|
54410
|
-
);
|
|
54411
|
-
}
|
|
54412
|
-
writeAgentErrorPayloadAndExit(
|
|
54413
|
-
client,
|
|
54414
|
-
{
|
|
54415
|
-
status: "error",
|
|
54416
|
-
reason: "unexpected_error",
|
|
54417
|
-
message: err instanceof Error ? err.message : String(err)
|
|
54418
|
-
},
|
|
54419
|
-
exitCode,
|
|
54420
|
-
variant
|
|
54421
|
-
);
|
|
54422
|
-
}
|
|
54423
|
-
function openUrlInBrowserCommand(url) {
|
|
54424
|
-
if (process.platform === "win32")
|
|
54425
|
-
return `start ${url}`;
|
|
54426
|
-
if (process.platform === "darwin")
|
|
54427
|
-
return `open '${url}'`;
|
|
54428
|
-
return `xdg-open '${url}'`;
|
|
54429
|
-
}
|
|
54430
|
-
|
|
54431
54149
|
// src/util/input/select-org.ts
|
|
54432
54150
|
function getScopeOrTeamFromArgv(argv) {
|
|
54433
54151
|
const args = argv.slice(2);
|
|
@@ -55585,7 +55303,7 @@ function addDeltaSection(prefix, arr, changed = false) {
|
|
|
55585
55303
|
}
|
|
55586
55304
|
|
|
55587
55305
|
// src/commands/env/pull.ts
|
|
55588
|
-
var
|
|
55306
|
+
var import_error_utils2 = __toESM(require_dist(), 1);
|
|
55589
55307
|
var import_json_parse_better_errors = __toESM(require_json_parse_better_errors(), 1);
|
|
55590
55308
|
|
|
55591
55309
|
// src/util/projects/format-project.ts
|
|
@@ -56047,7 +55765,7 @@ function tryReadHeadSync(path2, length) {
|
|
|
56047
55765
|
try {
|
|
56048
55766
|
return readHeadSync(path2, length);
|
|
56049
55767
|
} catch (err) {
|
|
56050
|
-
if (!(0,
|
|
55768
|
+
if (!(0, import_error_utils2.isErrnoException)(err) || err.code !== "ENOENT") {
|
|
56051
55769
|
throw err;
|
|
56052
55770
|
}
|
|
56053
55771
|
}
|
|
@@ -56238,7 +55956,7 @@ import { basename as basename2, join as join6 } from "path";
|
|
|
56238
55956
|
// src/util/read-json-file.ts
|
|
56239
55957
|
var import_fs_extra6 = __toESM(require_lib2(), 1);
|
|
56240
55958
|
var import_json_parse_better_errors2 = __toESM(require_json_parse_better_errors(), 1);
|
|
56241
|
-
var
|
|
55959
|
+
var import_error_utils3 = __toESM(require_dist(), 1);
|
|
56242
55960
|
async function readJSONFile(file) {
|
|
56243
55961
|
const content = await readFileSafe(file);
|
|
56244
55962
|
if (content === null) {
|
|
@@ -56248,7 +55966,7 @@ async function readJSONFile(file) {
|
|
|
56248
55966
|
const json = (0, import_json_parse_better_errors2.default)(content);
|
|
56249
55967
|
return json;
|
|
56250
55968
|
} catch (error) {
|
|
56251
|
-
return new CantParseJSONFile(file, (0,
|
|
55969
|
+
return new CantParseJSONFile(file, (0, import_error_utils3.errorToString)(error));
|
|
56252
55970
|
}
|
|
56253
55971
|
}
|
|
56254
55972
|
async function readFileSafe(file) {
|
|
@@ -56439,6 +56157,11 @@ var serviceConfigSchema = {
|
|
|
56439
56157
|
type: {
|
|
56440
56158
|
enum: ["web", "cron", "worker"]
|
|
56441
56159
|
},
|
|
56160
|
+
root: {
|
|
56161
|
+
type: "string",
|
|
56162
|
+
minLength: 1,
|
|
56163
|
+
maxLength: 512
|
|
56164
|
+
},
|
|
56442
56165
|
entrypoint: {
|
|
56443
56166
|
type: "string",
|
|
56444
56167
|
minLength: 1,
|
|
@@ -56886,10 +56609,10 @@ async function getLinkFromDir(dir) {
|
|
|
56886
56609
|
}
|
|
56887
56610
|
return link;
|
|
56888
56611
|
} catch (err) {
|
|
56889
|
-
if ((0,
|
|
56612
|
+
if ((0, import_error_utils4.isErrnoException)(err) && err.code && ["ENOENT", "ENOTDIR"].includes(err.code)) {
|
|
56890
56613
|
return null;
|
|
56891
56614
|
}
|
|
56892
|
-
if ((0,
|
|
56615
|
+
if ((0, import_error_utils4.isError)(err) && err.name === "SyntaxError") {
|
|
56893
56616
|
throw new Error(
|
|
56894
56617
|
`Project Settings could not be retrieved. To link your project again, remove the ${dir} directory.`
|
|
56895
56618
|
);
|
|
@@ -57048,7 +56771,7 @@ async function linkFolderToProject(client, path2, projectLink, projectName, orgS
|
|
|
57048
56771
|
try {
|
|
57049
56772
|
await (0, import_fs_extra8.ensureDir)(join8(path2, VERCEL_DIR));
|
|
57050
56773
|
} catch (err) {
|
|
57051
|
-
if ((0,
|
|
56774
|
+
if ((0, import_error_utils4.isErrnoException)(err) && err.code === "ENOTDIR") {
|
|
57052
56775
|
return;
|
|
57053
56776
|
}
|
|
57054
56777
|
throw err;
|
|
@@ -57491,22 +57214,6 @@ export {
|
|
|
57491
57214
|
createGitMeta,
|
|
57492
57215
|
parseGitConfig,
|
|
57493
57216
|
pluckRemoteUrls,
|
|
57494
|
-
buildCommandWithYes,
|
|
57495
|
-
getGlobalFlagsFromArgv,
|
|
57496
|
-
buildIntegrationCommandTailFromArgv,
|
|
57497
|
-
buildCommandWithGlobalFlags,
|
|
57498
|
-
getPreservedArgsForEnvAdd,
|
|
57499
|
-
buildEnvAddCommandWithPreservedArgs,
|
|
57500
|
-
getPreservedArgsForEnvRm,
|
|
57501
|
-
buildEnvRmCommandWithPreservedArgs,
|
|
57502
|
-
getPreservedArgsForEnvUpdate,
|
|
57503
|
-
buildEnvUpdateCommandWithPreservedArgs,
|
|
57504
|
-
outputActionRequired,
|
|
57505
|
-
argvHasNonInteractive,
|
|
57506
|
-
shouldEmitNonInteractiveCommandError,
|
|
57507
|
-
outputAgentError,
|
|
57508
|
-
exitWithNonInteractiveError,
|
|
57509
|
-
openUrlInBrowserCommand,
|
|
57510
57217
|
selectOrg,
|
|
57511
57218
|
createProject,
|
|
57512
57219
|
require_frameworks,
|