vercel 51.2.1 → 51.4.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-RNQLGEYS.js +180 -0
- package/dist/chunks/{chunk-XAVGWINL.js → chunk-3GDNTBCE.js} +44 -13
- package/dist/chunks/{chunk-SSOWPEZT.js → chunk-4DR2FV6O.js} +2 -2
- 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-7S7GE4BN.js → chunk-537JTK2U.js} +216 -523
- package/dist/chunks/{chunk-K5XJCQQO.js → chunk-5NTBJ33M.js} +1 -1
- package/dist/chunks/{chunk-5YQCJTZI.js → chunk-5VKKTHMP.js} +6 -6
- package/dist/chunks/{chunk-W6FW7CCT.js → chunk-6C33Y3DC.js} +13 -8
- package/dist/chunks/{chunk-5WHDQH2U.js → chunk-7MF47FW3.js} +1 -1
- package/dist/chunks/chunk-7ZDERWUW.js +167 -0
- package/dist/chunks/{chunk-RK4TKB3D.js → chunk-AUSDBXUD.js} +7 -5
- package/dist/chunks/{chunk-BUBUVE23.js → chunk-BJQTGP42.js} +4 -2
- package/dist/chunks/{chunk-57RLFBKC.js → chunk-BRQBLRFB.js} +1 -1
- package/dist/chunks/chunk-CGTXAXZ4.js +484 -0
- package/dist/chunks/{chunk-BQUQ5F7R.js → chunk-CRZM5WM2.js} +4 -2
- package/dist/chunks/{chunk-VTQNSCUG.js → chunk-D2D4FJ6S.js} +8 -6
- package/dist/chunks/{chunk-G6MVEB4W.js → chunk-DKFFXOHJ.js} +3 -3
- package/dist/chunks/chunk-DVQ4SIWF.js +183 -0
- package/dist/chunks/{chunk-A4NVECX5.js → chunk-ECRBC4HL.js} +4 -581
- 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-QQTF2FEY.js → chunk-HNU5CXW4.js} +9 -5
- package/dist/chunks/chunk-HQXVCOH6.js +139 -0
- package/dist/chunks/{chunk-3FMFPD7F.js → chunk-L2JUC7NX.js} +2 -2
- 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-5DLMAFQU.js → chunk-NKJC5SI4.js} +6 -4
- package/dist/chunks/{chunk-FSOFFJDV.js → chunk-O7SQKNIT.js} +1 -1
- package/dist/chunks/{chunk-XRR5HDB3.js → chunk-P56KWLXY.js} +2 -2
- package/dist/chunks/{chunk-EHZKWVK2.js → chunk-PBGN54ZH.js} +5 -5
- package/dist/chunks/chunk-RFMC2QXQ.js +602 -0
- package/dist/chunks/{chunk-W5K4YCTI.js → chunk-RJD5NYGF.js} +5 -3
- package/dist/chunks/{chunk-WXNT7WJO.js → chunk-TAOVG4PS.js} +49 -4
- package/dist/chunks/{chunk-4EGCWWSR.js → chunk-UJ4JXXED.js} +143 -16
- 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/{compile-vercel-config-2GV46IDP.js → compile-vercel-config-ZVY7LBE3.js} +4 -2
- package/dist/chunks/{delete-PXMYSQGR.js → delete-SKTJMJNP.js} +7 -5
- package/dist/chunks/{disable-2ZQ4OG4A.js → disable-AG7I6DPV.js} +7 -5
- package/dist/chunks/{discard-FQZTZ5HK.js → discard-LUK6LBLT.js} +7 -5
- package/dist/chunks/{edit-F3J7Q5SZ.js → edit-3BR5HP3U.js} +8 -6
- package/dist/chunks/{enable-ZW4W33H5.js → enable-4JNLOKSM.js} +7 -5
- package/dist/chunks/{export-ZZV6ESIW.js → export-YLZ6QSHG.js} +7 -5
- package/dist/chunks/inspect-HUJLUQAV.js +353 -0
- package/dist/chunks/{list-SSIMVNNN.js → list-EPU4SB3E.js} +10 -7
- package/dist/chunks/{list-VFPV4TUW.js → list-RMA56KYZ.js} +115 -85
- package/dist/chunks/ls-7HHDYE6F.js +114 -0
- package/dist/chunks/{publish-3K76MNS3.js → publish-6YE4OUDI.js} +7 -5
- package/dist/chunks/{query-CY7JJSSX.js → query-VNBKOI65.js} +15 -12
- package/dist/chunks/{reorder-6L7MENN5.js → reorder-VFM23ESC.js} +7 -5
- package/dist/chunks/{restore-XUYXOJQ2.js → restore-VX34SXVF.js} +7 -5
- package/dist/chunks/rm-5KXF2PY3.js +164 -0
- package/dist/chunks/rule-inspect-JG7AE5TI.js +142 -0
- package/dist/chunks/rules-XRJBT22L.js +83 -0
- package/dist/chunks/{schema-G5FSLZVA.js → schema-FUOKCZTW.js} +9 -7
- package/dist/chunks/{types-A4EAQ6F6.js → types-QNN5CDCB.js} +6 -4
- package/dist/chunks/update-4FMWTIJK.js +196 -0
- package/dist/commands/build/index.js +36 -43
- package/dist/commands/deploy/index.js +171 -32
- package/dist/commands/dev/index.js +36 -31
- 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 +1640 -884
- package/dist/index.js +28 -24
- package/dist/version.mjs +1 -1
- package/package.json +17 -17
|
@@ -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",
|
|
@@ -22788,12 +22894,12 @@ var require_utils3 = __commonJS({
|
|
|
22788
22894
|
var utils_exports = {};
|
|
22789
22895
|
__export2(utils_exports, {
|
|
22790
22896
|
INTERNAL_QUEUES_PREFIX: () => INTERNAL_QUEUES_PREFIX,
|
|
22791
|
-
INTERNAL_SERVICE_PREFIX: () =>
|
|
22897
|
+
INTERNAL_SERVICE_PREFIX: () => import_build_utils5.INTERNAL_SERVICE_PREFIX,
|
|
22792
22898
|
filterFrameworksByRuntime: () => filterFrameworksByRuntime,
|
|
22793
22899
|
getBuilderForRuntime: () => getBuilderForRuntime,
|
|
22794
|
-
getInternalServiceCronPath: () =>
|
|
22795
|
-
getInternalServiceCronPathPrefix: () =>
|
|
22796
|
-
getInternalServiceFunctionPath: () =>
|
|
22900
|
+
getInternalServiceCronPath: () => import_build_utils5.getInternalServiceCronPath,
|
|
22901
|
+
getInternalServiceCronPathPrefix: () => import_build_utils5.getInternalServiceCronPathPrefix,
|
|
22902
|
+
getInternalServiceFunctionPath: () => import_build_utils5.getInternalServiceFunctionPath,
|
|
22797
22903
|
getInternalServiceWorkerPath: () => getInternalServiceWorkerPath2,
|
|
22798
22904
|
getInternalServiceWorkerPathPrefix: () => getInternalServiceWorkerPathPrefix2,
|
|
22799
22905
|
hasFile: () => hasFile,
|
|
@@ -22806,6 +22912,7 @@ var require_utils3 = __commonJS({
|
|
|
22806
22912
|
});
|
|
22807
22913
|
module.exports = __toCommonJS2(utils_exports);
|
|
22808
22914
|
var import_framework_helpers = __require("@vercel/build-utils/dist/framework-helpers");
|
|
22915
|
+
var import_build_utils5 = __require("@vercel/build-utils");
|
|
22809
22916
|
var import_types = require_types3();
|
|
22810
22917
|
async function hasFile(fs5, filePath) {
|
|
22811
22918
|
try {
|
|
@@ -22814,29 +22921,18 @@ var require_utils3 = __commonJS({
|
|
|
22814
22921
|
return false;
|
|
22815
22922
|
}
|
|
22816
22923
|
}
|
|
22817
|
-
var INTERNAL_SERVICE_PREFIX2 = "/_svc";
|
|
22818
22924
|
var INTERNAL_QUEUES_PREFIX = "/_svc/_queues";
|
|
22819
|
-
function getInternalServiceFunctionPath2(serviceName) {
|
|
22820
|
-
return `${INTERNAL_SERVICE_PREFIX2}/${serviceName}/index`;
|
|
22821
|
-
}
|
|
22822
22925
|
function normalizeInternalServiceEntrypoint(entrypoint) {
|
|
22823
22926
|
const normalized = entrypoint.replace(/\\/g, "/").replace(/^\/+/, "").replace(/\.[^/.]+$/, "");
|
|
22824
22927
|
return normalized || "index";
|
|
22825
22928
|
}
|
|
22826
22929
|
function getInternalServiceWorkerPathPrefix2(serviceName) {
|
|
22827
|
-
return `${
|
|
22828
|
-
}
|
|
22829
|
-
function getInternalServiceCronPathPrefix2(serviceName) {
|
|
22830
|
-
return `${INTERNAL_SERVICE_PREFIX2}/${serviceName}/crons`;
|
|
22930
|
+
return `${import_build_utils5.INTERNAL_SERVICE_PREFIX}/${serviceName}/workers`;
|
|
22831
22931
|
}
|
|
22832
22932
|
function getInternalServiceWorkerPath2(serviceName, entrypoint, handler = "worker") {
|
|
22833
22933
|
const normalizedEntrypoint = normalizeInternalServiceEntrypoint(entrypoint);
|
|
22834
22934
|
return `${getInternalServiceWorkerPathPrefix2(serviceName)}/${normalizedEntrypoint}/${handler}`;
|
|
22835
22935
|
}
|
|
22836
|
-
function getInternalServiceCronPath2(serviceName, entrypoint, handler = "cron") {
|
|
22837
|
-
const normalizedEntrypoint = normalizeInternalServiceEntrypoint(entrypoint);
|
|
22838
|
-
return `${getInternalServiceCronPathPrefix2(serviceName)}/${normalizedEntrypoint}/${handler}`;
|
|
22839
|
-
}
|
|
22840
22936
|
function getBuilderForRuntime(runtime) {
|
|
22841
22937
|
const builder = import_types.RUNTIME_BUILDERS[runtime];
|
|
22842
22938
|
if (!builder) {
|
|
@@ -23245,6 +23341,33 @@ var require_resolve2 = __commonJS({
|
|
|
23245
23341
|
var SERVICE_NAME_REGEX = /^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$/;
|
|
23246
23342
|
var DNS_LABEL_RE = /^(?!-)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;
|
|
23247
23343
|
var ENV_PREFIX_RE = /^[A-Z][A-Z0-9_]*_$/;
|
|
23344
|
+
async function getServiceFs(fs5, serviceName, root) {
|
|
23345
|
+
if (!root) {
|
|
23346
|
+
return { fs: fs5 };
|
|
23347
|
+
}
|
|
23348
|
+
const normalizedRoot = import_path12.posix.normalize(root);
|
|
23349
|
+
if (!await fs5.hasPath(normalizedRoot)) {
|
|
23350
|
+
return {
|
|
23351
|
+
fs: fs5,
|
|
23352
|
+
error: {
|
|
23353
|
+
code: "ROOT_NOT_FOUND",
|
|
23354
|
+
message: `Service "${serviceName}" has root "${root}" but that directory does not exist.`,
|
|
23355
|
+
serviceName
|
|
23356
|
+
}
|
|
23357
|
+
};
|
|
23358
|
+
}
|
|
23359
|
+
if (await fs5.isFile(normalizedRoot)) {
|
|
23360
|
+
return {
|
|
23361
|
+
fs: fs5,
|
|
23362
|
+
error: {
|
|
23363
|
+
code: "ROOT_NOT_DIRECTORY",
|
|
23364
|
+
message: `Service "${serviceName}" has root "${root}" but that path is a file, not a directory.`,
|
|
23365
|
+
serviceName
|
|
23366
|
+
}
|
|
23367
|
+
};
|
|
23368
|
+
}
|
|
23369
|
+
return { fs: fs5.chdir(normalizedRoot) };
|
|
23370
|
+
}
|
|
23248
23371
|
function normalizeServiceEntrypoint(entrypoint) {
|
|
23249
23372
|
const normalized = import_path12.posix.normalize(entrypoint);
|
|
23250
23373
|
return normalized === "" ? "." : normalized;
|
|
@@ -23503,6 +23626,23 @@ var require_resolve2 = __commonJS({
|
|
|
23503
23626
|
serviceName: name
|
|
23504
23627
|
};
|
|
23505
23628
|
}
|
|
23629
|
+
if (config.root !== void 0) {
|
|
23630
|
+
const normalizedRoot = import_path12.posix.normalize(config.root);
|
|
23631
|
+
if (normalizedRoot.startsWith("/")) {
|
|
23632
|
+
return {
|
|
23633
|
+
code: "INVALID_ROOT",
|
|
23634
|
+
message: `Service "${name}" has invalid "root" "${config.root}". Must be a relative path.`,
|
|
23635
|
+
serviceName: name
|
|
23636
|
+
};
|
|
23637
|
+
}
|
|
23638
|
+
if (normalizedRoot === ".." || normalizedRoot.startsWith("../")) {
|
|
23639
|
+
return {
|
|
23640
|
+
code: "INVALID_ROOT",
|
|
23641
|
+
message: `Service "${name}" has invalid "root" "${config.root}". Must not escape the project root.`,
|
|
23642
|
+
serviceName: name
|
|
23643
|
+
};
|
|
23644
|
+
}
|
|
23645
|
+
}
|
|
23506
23646
|
if (config.envPrefix !== void 0) {
|
|
23507
23647
|
if (!ENV_PREFIX_RE.test(config.envPrefix)) {
|
|
23508
23648
|
return {
|
|
@@ -23576,7 +23716,8 @@ var require_resolve2 = __commonJS({
|
|
|
23576
23716
|
const {
|
|
23577
23717
|
name,
|
|
23578
23718
|
config,
|
|
23579
|
-
|
|
23719
|
+
serviceFs,
|
|
23720
|
+
root,
|
|
23580
23721
|
group,
|
|
23581
23722
|
resolvedEntrypoint,
|
|
23582
23723
|
routePrefixSource = "configured"
|
|
@@ -23595,7 +23736,7 @@ var require_resolve2 = __commonJS({
|
|
|
23595
23736
|
if (!resolvedEntrypointPath && typeof rawEntrypoint === "string") {
|
|
23596
23737
|
const entrypointToResolve = moduleAttrParsed ? moduleAttrParsed.filePath : rawEntrypoint;
|
|
23597
23738
|
const resolved = await resolveEntrypointPath({
|
|
23598
|
-
fs:
|
|
23739
|
+
fs: serviceFs,
|
|
23599
23740
|
serviceName: name,
|
|
23600
23741
|
entrypoint: entrypointToResolve
|
|
23601
23742
|
});
|
|
@@ -23618,7 +23759,7 @@ var require_resolve2 = __commonJS({
|
|
|
23618
23759
|
workspace = normalizedEntrypoint;
|
|
23619
23760
|
} else {
|
|
23620
23761
|
const inferredWorkspace = await inferWorkspaceFromNearestManifest({
|
|
23621
|
-
fs:
|
|
23762
|
+
fs: serviceFs,
|
|
23622
23763
|
entrypoint: resolvedEntrypointFile,
|
|
23623
23764
|
runtime: inferredRuntime
|
|
23624
23765
|
});
|
|
@@ -23632,6 +23773,12 @@ var require_resolve2 = __commonJS({
|
|
|
23632
23773
|
}
|
|
23633
23774
|
}
|
|
23634
23775
|
}
|
|
23776
|
+
if (root) {
|
|
23777
|
+
const normalizedRoot = import_path12.posix.normalize(root);
|
|
23778
|
+
if (normalizedRoot !== ".") {
|
|
23779
|
+
workspace = workspace === "." ? normalizedRoot : import_path12.posix.join(normalizedRoot, workspace);
|
|
23780
|
+
}
|
|
23781
|
+
}
|
|
23635
23782
|
const topics = type === "worker" ? (0, import_build_utils5.getWorkerTopics)(config) : config.topics;
|
|
23636
23783
|
const consumer = type === "worker" ? config.consumer || "default" : config.consumer;
|
|
23637
23784
|
let builderUse;
|
|
@@ -23731,12 +23878,19 @@ var require_resolve2 = __commonJS({
|
|
|
23731
23878
|
errors.push(validationError);
|
|
23732
23879
|
continue;
|
|
23733
23880
|
}
|
|
23881
|
+
const root = serviceConfig.root;
|
|
23882
|
+
const serviceFsResult = await getServiceFs(fs5, name, root);
|
|
23883
|
+
if (serviceFsResult.error) {
|
|
23884
|
+
errors.push(serviceFsResult.error);
|
|
23885
|
+
continue;
|
|
23886
|
+
}
|
|
23887
|
+
const serviceFs = serviceFsResult.fs;
|
|
23734
23888
|
let resolvedEntrypoint;
|
|
23735
23889
|
if (typeof serviceConfig.entrypoint === "string") {
|
|
23736
23890
|
const moduleAttr = parsePyModuleAttrEntrypoint(serviceConfig.entrypoint);
|
|
23737
23891
|
const entrypointToResolve = moduleAttr?.filePath ?? serviceConfig.entrypoint;
|
|
23738
23892
|
const resolvedPath = await resolveEntrypointPath({
|
|
23739
|
-
fs:
|
|
23893
|
+
fs: serviceFs,
|
|
23740
23894
|
serviceName: name,
|
|
23741
23895
|
entrypoint: entrypointToResolve
|
|
23742
23896
|
});
|
|
@@ -23765,7 +23919,7 @@ var require_resolve2 = __commonJS({
|
|
|
23765
23919
|
});
|
|
23766
23920
|
const workspace = resolvedEntrypoint.normalized;
|
|
23767
23921
|
const { framework, error } = await detectFrameworkFromWorkspace({
|
|
23768
|
-
fs:
|
|
23922
|
+
fs: serviceFs,
|
|
23769
23923
|
workspace,
|
|
23770
23924
|
runtime: inferredRuntime,
|
|
23771
23925
|
serviceName: name
|
|
@@ -23793,13 +23947,13 @@ var require_resolve2 = __commonJS({
|
|
|
23793
23947
|
});
|
|
23794
23948
|
if (inferredRuntime) {
|
|
23795
23949
|
const inferredWorkspace = await inferWorkspaceFromNearestManifest({
|
|
23796
|
-
fs:
|
|
23950
|
+
fs: serviceFs,
|
|
23797
23951
|
entrypoint: resolvedEntrypoint.normalized,
|
|
23798
23952
|
runtime: inferredRuntime
|
|
23799
23953
|
});
|
|
23800
23954
|
const workspace = inferredWorkspace ?? import_path12.posix.dirname(resolvedEntrypoint.normalized);
|
|
23801
23955
|
const detection = await detectFrameworkFromWorkspace({
|
|
23802
|
-
fs:
|
|
23956
|
+
fs: serviceFs,
|
|
23803
23957
|
workspace,
|
|
23804
23958
|
serviceName: name,
|
|
23805
23959
|
runtime: inferredRuntime
|
|
@@ -23816,7 +23970,8 @@ var require_resolve2 = __commonJS({
|
|
|
23816
23970
|
const service = await resolveConfiguredService({
|
|
23817
23971
|
name,
|
|
23818
23972
|
config: resolvedConfig,
|
|
23819
|
-
|
|
23973
|
+
serviceFs,
|
|
23974
|
+
root,
|
|
23820
23975
|
resolvedEntrypoint,
|
|
23821
23976
|
routePrefixSource
|
|
23822
23977
|
});
|
|
@@ -24632,15 +24787,10 @@ var require_detect_services = __commonJS({
|
|
|
24632
24787
|
}
|
|
24633
24788
|
const cronServices = services.filter((s) => s.type === "cron");
|
|
24634
24789
|
for (const service of cronServices) {
|
|
24635
|
-
const
|
|
24636
|
-
const cronPath = (0, import_utils4.getInternalServiceCronPath)(
|
|
24637
|
-
service.name,
|
|
24638
|
-
cronEntrypoint,
|
|
24639
|
-
service.handlerFunction || "cron"
|
|
24640
|
-
);
|
|
24790
|
+
const cronPrefix = (0, import_utils4.getInternalServiceCronPathPrefix)(service.name);
|
|
24641
24791
|
const functionPath = (0, import_utils4.getInternalServiceFunctionPath)(service.name);
|
|
24642
24792
|
crons.push({
|
|
24643
|
-
src: `^${escapeRegex(
|
|
24793
|
+
src: `^${escapeRegex(cronPrefix)}/.*$`,
|
|
24644
24794
|
dest: functionPath,
|
|
24645
24795
|
check: true
|
|
24646
24796
|
});
|
|
@@ -24821,7 +24971,7 @@ var require_local_file_system_detector = __commonJS({
|
|
|
24821
24971
|
var import_promises4 = __toESM2(__require("fs/promises"));
|
|
24822
24972
|
var import_path12 = __require("path");
|
|
24823
24973
|
var import_filesystem = require_filesystem();
|
|
24824
|
-
var
|
|
24974
|
+
var import_error_utils5 = require_dist();
|
|
24825
24975
|
var LocalFileSystemDetector4 = class _LocalFileSystemDetector extends import_filesystem.DetectorFilesystem {
|
|
24826
24976
|
constructor(rootPath) {
|
|
24827
24977
|
super();
|
|
@@ -24832,7 +24982,7 @@ var require_local_file_system_detector = __commonJS({
|
|
|
24832
24982
|
await import_promises4.default.stat(this.getFilePath(name));
|
|
24833
24983
|
return true;
|
|
24834
24984
|
} catch (err) {
|
|
24835
|
-
if ((0,
|
|
24985
|
+
if ((0, import_error_utils5.isErrnoException)(err) && err.code === "ENOENT") {
|
|
24836
24986
|
return false;
|
|
24837
24987
|
}
|
|
24838
24988
|
throw err;
|
|
@@ -25300,7 +25450,7 @@ var require_detect_builders = __commonJS({
|
|
|
25300
25450
|
}
|
|
25301
25451
|
}
|
|
25302
25452
|
const nodeExtensions = [".js", ".mjs", ".ts", ".tsx"];
|
|
25303
|
-
if (process.env.VERCEL_NODE_FILTER_ENTRYPOINTS === "1" && nodeExtensions.some((ext) => fileName.endsWith(ext)) && options.workPath) {
|
|
25453
|
+
if (fileName.startsWith("api/") && process.env.VERCEL_NODE_FILTER_ENTRYPOINTS === "1" && nodeExtensions.some((ext) => fileName.endsWith(ext)) && options.workPath) {
|
|
25304
25454
|
const fsPath = (0, import_path12.join)(options.workPath, fileName);
|
|
25305
25455
|
const isEntrypoint = await (0, import_build_utils5.isNodeEntrypoint)({ fsPath });
|
|
25306
25456
|
if (!isEntrypoint) {
|
|
@@ -38965,7 +39115,7 @@ var require_package = __commonJS({
|
|
|
38965
39115
|
"../client/package.json"(exports, module) {
|
|
38966
39116
|
module.exports = {
|
|
38967
39117
|
name: "@vercel/client",
|
|
38968
|
-
version: "17.3.
|
|
39118
|
+
version: "17.3.4",
|
|
38969
39119
|
main: "dist/index.js",
|
|
38970
39120
|
typings: "dist/index.d.ts",
|
|
38971
39121
|
homepage: "https://vercel.com",
|
|
@@ -48238,10 +48388,10 @@ var require_util4 = __commonJS({
|
|
|
48238
48388
|
return objectToString(d) === "[object Date]";
|
|
48239
48389
|
}
|
|
48240
48390
|
exports.isDate = isDate;
|
|
48241
|
-
function
|
|
48391
|
+
function isError2(e) {
|
|
48242
48392
|
return objectToString(e) === "[object Error]" || e instanceof Error;
|
|
48243
48393
|
}
|
|
48244
|
-
exports.isError =
|
|
48394
|
+
exports.isError = isError2;
|
|
48245
48395
|
function isFunction(arg) {
|
|
48246
48396
|
return typeof arg === "function";
|
|
48247
48397
|
}
|
|
@@ -52048,7 +52198,7 @@ var require_create_deployment = __commonJS({
|
|
|
52048
52198
|
var import_upload = require_upload();
|
|
52049
52199
|
var import_utils4 = require_utils10();
|
|
52050
52200
|
var import_errors3 = require_errors();
|
|
52051
|
-
var
|
|
52201
|
+
var import_error_utils5 = require_dist();
|
|
52052
52202
|
var import_archive = require_archive();
|
|
52053
52203
|
function buildCreateDeployment() {
|
|
52054
52204
|
return async function* createDeployment(clientOptions, deploymentOptions = {}) {
|
|
@@ -52129,7 +52279,7 @@ var require_create_deployment = __commonJS({
|
|
|
52129
52279
|
files = await (0, import_hashes.hashes)(fileList);
|
|
52130
52280
|
}
|
|
52131
52281
|
} catch (err) {
|
|
52132
|
-
if (clientOptions.prebuilt && (0,
|
|
52282
|
+
if (clientOptions.prebuilt && (0, import_error_utils5.isErrnoException)(err) && err.code === "ENOENT" && err.path) {
|
|
52133
52283
|
const errPath = (0, import_path12.relative)(workPath, err.path);
|
|
52134
52284
|
err.message = `File does not exist: "${(0, import_path12.relative)(workPath, errPath)}"`;
|
|
52135
52285
|
if (errPath.split(import_path12.sep).includes("node_modules")) {
|
|
@@ -52578,7 +52728,7 @@ var global_path_default = getGlobalPathConfig;
|
|
|
52578
52728
|
|
|
52579
52729
|
// src/util/projects/link.ts
|
|
52580
52730
|
import { NowBuildError as NowBuildError2, getPlatformEnv } from "@vercel/build-utils";
|
|
52581
|
-
var
|
|
52731
|
+
var import_error_utils4 = __toESM(require_dist(), 1);
|
|
52582
52732
|
|
|
52583
52733
|
// src/util/link/repo.ts
|
|
52584
52734
|
var import_chalk6 = __toESM(require_source(), 1);
|
|
@@ -53981,452 +54131,6 @@ async function getTeams(client, opts = {}) {
|
|
|
53981
54131
|
}
|
|
53982
54132
|
}
|
|
53983
54133
|
|
|
53984
|
-
// src/util/agent-output.ts
|
|
53985
|
-
var import_error_utils2 = __toESM(require_dist(), 1);
|
|
53986
|
-
function buildCommandWithYes(argv, pkgName = packageName) {
|
|
53987
|
-
const args = argv.slice(2);
|
|
53988
|
-
const hasYes = args.some((a) => a === "--yes" || a === "-y");
|
|
53989
|
-
const out = hasYes ? [...args] : [...args, "--yes"];
|
|
53990
|
-
return `${pkgName} ${out.join(" ")}`;
|
|
53991
|
-
}
|
|
53992
|
-
var GLOBAL_FLAG_NAMES = /* @__PURE__ */ new Set([
|
|
53993
|
-
"--cwd",
|
|
53994
|
-
"--config",
|
|
53995
|
-
"--yes",
|
|
53996
|
-
"-y",
|
|
53997
|
-
"--non-interactive",
|
|
53998
|
-
"--scope",
|
|
53999
|
-
"--team",
|
|
54000
|
-
"-S",
|
|
54001
|
-
"-T",
|
|
54002
|
-
"--token"
|
|
54003
|
-
]);
|
|
54004
|
-
var BOOLEAN_GLOBAL_FLAG_NAMES = /* @__PURE__ */ new Set(["--yes", "-y", "--non-interactive"]);
|
|
54005
|
-
function getGlobalFlagsFromArgv(argv) {
|
|
54006
|
-
const args = argv.slice(2);
|
|
54007
|
-
const out = [];
|
|
54008
|
-
for (let i = 0; i < args.length; i++) {
|
|
54009
|
-
const arg = args[i];
|
|
54010
|
-
const name = arg.startsWith("--") ? arg.split("=")[0] : arg;
|
|
54011
|
-
if (GLOBAL_FLAG_NAMES.has(name)) {
|
|
54012
|
-
out.push(arg);
|
|
54013
|
-
const takesSeparateValue = !BOOLEAN_GLOBAL_FLAG_NAMES.has(name) && !arg.includes("=") && i + 1 < args.length && !args[i + 1].startsWith("-");
|
|
54014
|
-
if (takesSeparateValue) {
|
|
54015
|
-
out.push(args[i + 1]);
|
|
54016
|
-
i++;
|
|
54017
|
-
}
|
|
54018
|
-
}
|
|
54019
|
-
}
|
|
54020
|
-
return out;
|
|
54021
|
-
}
|
|
54022
|
-
function omitGlobalFlagsFromArgs(args) {
|
|
54023
|
-
const out = [];
|
|
54024
|
-
for (let i = 0; i < args.length; i++) {
|
|
54025
|
-
const arg = args[i];
|
|
54026
|
-
const name = arg.startsWith("--") ? arg.split("=")[0] : arg;
|
|
54027
|
-
if (GLOBAL_FLAG_NAMES.has(name)) {
|
|
54028
|
-
const skipSeparateValue = !BOOLEAN_GLOBAL_FLAG_NAMES.has(name) && !arg.includes("=") && i + 1 < args.length && !args[i + 1].startsWith("-");
|
|
54029
|
-
if (skipSeparateValue) {
|
|
54030
|
-
i++;
|
|
54031
|
-
}
|
|
54032
|
-
continue;
|
|
54033
|
-
}
|
|
54034
|
-
out.push(arg);
|
|
54035
|
-
}
|
|
54036
|
-
return out;
|
|
54037
|
-
}
|
|
54038
|
-
function buildIntegrationCommandTailFromArgv(argv) {
|
|
54039
|
-
const args = argv.slice(2);
|
|
54040
|
-
const idx = args.indexOf("integration");
|
|
54041
|
-
if (idx === -1) {
|
|
54042
|
-
return "integration";
|
|
54043
|
-
}
|
|
54044
|
-
return omitGlobalFlagsFromArgs(args.slice(idx)).join(" ");
|
|
54045
|
-
}
|
|
54046
|
-
function buildCommandWithGlobalFlags(argv, commandTemplate, pkgName = packageName, options) {
|
|
54047
|
-
let preserved = getGlobalFlagsFromArgv(argv);
|
|
54048
|
-
if (options?.excludeFlags?.length) {
|
|
54049
|
-
const exclude = new Set(options.excludeFlags);
|
|
54050
|
-
const out = [];
|
|
54051
|
-
for (let i = 0; i < preserved.length; i++) {
|
|
54052
|
-
const arg = preserved[i];
|
|
54053
|
-
const name = arg.startsWith("--") ? arg.split("=")[0] : arg;
|
|
54054
|
-
if (exclude.has(name)) {
|
|
54055
|
-
if (!arg.includes("=") && i + 1 < preserved.length && !preserved[i + 1].startsWith("-")) {
|
|
54056
|
-
i++;
|
|
54057
|
-
}
|
|
54058
|
-
continue;
|
|
54059
|
-
}
|
|
54060
|
-
out.push(arg);
|
|
54061
|
-
}
|
|
54062
|
-
preserved = out;
|
|
54063
|
-
}
|
|
54064
|
-
const base = `${pkgName} ${commandTemplate}`;
|
|
54065
|
-
if (preserved.length === 0) {
|
|
54066
|
-
return base;
|
|
54067
|
-
}
|
|
54068
|
-
if (options?.prependGlobalFlags) {
|
|
54069
|
-
return `${pkgName} ${preserved.join(" ")} ${commandTemplate}`;
|
|
54070
|
-
}
|
|
54071
|
-
return `${base} ${preserved.join(" ")}`;
|
|
54072
|
-
}
|
|
54073
|
-
function getPreservedArgsForEnvAdd(argv) {
|
|
54074
|
-
const args = argv.slice(2);
|
|
54075
|
-
const addIdx = args.indexOf("add");
|
|
54076
|
-
if (addIdx === -1 || args[addIdx - 1] !== "env")
|
|
54077
|
-
return args;
|
|
54078
|
-
let i = addIdx + 1;
|
|
54079
|
-
let positionals = 0;
|
|
54080
|
-
while (i < args.length && positionals < 3 && !args[i].startsWith("-")) {
|
|
54081
|
-
positionals++;
|
|
54082
|
-
i++;
|
|
54083
|
-
}
|
|
54084
|
-
return args.slice(i);
|
|
54085
|
-
}
|
|
54086
|
-
function buildEnvAddCommandWithPreservedArgs(argv, commandTemplate, pkgName = packageName) {
|
|
54087
|
-
let preserved = getPreservedArgsForEnvAdd(argv);
|
|
54088
|
-
if (commandTemplate.includes("--yes")) {
|
|
54089
|
-
preserved = preserved.filter((a) => a !== "--yes" && a !== "-y");
|
|
54090
|
-
}
|
|
54091
|
-
if (commandTemplate.includes("--value")) {
|
|
54092
|
-
const out = [];
|
|
54093
|
-
for (let j = 0; j < preserved.length; j++) {
|
|
54094
|
-
if (preserved[j] === "--value" && j + 1 < preserved.length) {
|
|
54095
|
-
j++;
|
|
54096
|
-
continue;
|
|
54097
|
-
}
|
|
54098
|
-
if (preserved[j].startsWith("--value="))
|
|
54099
|
-
continue;
|
|
54100
|
-
out.push(preserved[j]);
|
|
54101
|
-
}
|
|
54102
|
-
preserved = out;
|
|
54103
|
-
}
|
|
54104
|
-
const base = `${pkgName} ${commandTemplate}`;
|
|
54105
|
-
if (preserved.length === 0)
|
|
54106
|
-
return base;
|
|
54107
|
-
return `${base} ${preserved.join(" ")}`;
|
|
54108
|
-
}
|
|
54109
|
-
function getPreservedArgsForEnvPull(argv) {
|
|
54110
|
-
const args = argv.slice(2);
|
|
54111
|
-
const pullIdx = args.indexOf("pull");
|
|
54112
|
-
if (pullIdx === -1 || args[pullIdx - 1] !== "env")
|
|
54113
|
-
return args;
|
|
54114
|
-
let i = pullIdx + 1;
|
|
54115
|
-
if (i < args.length && !args[i].startsWith("-"))
|
|
54116
|
-
i++;
|
|
54117
|
-
return args.slice(i);
|
|
54118
|
-
}
|
|
54119
|
-
function getPreservedArgsForEnvRm(argv) {
|
|
54120
|
-
const args = argv.slice(2);
|
|
54121
|
-
const rmIdx = args.indexOf("rm");
|
|
54122
|
-
if (rmIdx === -1 || args[rmIdx - 1] !== "env")
|
|
54123
|
-
return args;
|
|
54124
|
-
let i = rmIdx + 1;
|
|
54125
|
-
let positionals = 0;
|
|
54126
|
-
while (i < args.length && positionals < 3 && !args[i].startsWith("-")) {
|
|
54127
|
-
positionals++;
|
|
54128
|
-
i++;
|
|
54129
|
-
}
|
|
54130
|
-
return args.slice(i);
|
|
54131
|
-
}
|
|
54132
|
-
function buildEnvRmCommandWithPreservedArgs(argv, commandTemplate, pkgName = packageName) {
|
|
54133
|
-
let preserved = getPreservedArgsForEnvRm(argv);
|
|
54134
|
-
if (commandTemplate.includes("--yes")) {
|
|
54135
|
-
preserved = preserved.filter((a) => a !== "--yes" && a !== "-y");
|
|
54136
|
-
}
|
|
54137
|
-
const base = `${pkgName} ${commandTemplate}`;
|
|
54138
|
-
if (preserved.length === 0)
|
|
54139
|
-
return base;
|
|
54140
|
-
return `${base} ${preserved.join(" ")}`;
|
|
54141
|
-
}
|
|
54142
|
-
function getPreservedArgsForEnvUpdate(argv) {
|
|
54143
|
-
const args = argv.slice(2);
|
|
54144
|
-
const updateIdx = args.indexOf("update");
|
|
54145
|
-
if (updateIdx === -1 || args[updateIdx - 1] !== "env")
|
|
54146
|
-
return args;
|
|
54147
|
-
let i = updateIdx + 1;
|
|
54148
|
-
let positionals = 0;
|
|
54149
|
-
while (i < args.length && positionals < 3 && !args[i].startsWith("-")) {
|
|
54150
|
-
positionals++;
|
|
54151
|
-
i++;
|
|
54152
|
-
}
|
|
54153
|
-
return args.slice(i);
|
|
54154
|
-
}
|
|
54155
|
-
function buildEnvUpdateCommandWithPreservedArgs(argv, commandTemplate, pkgName = packageName) {
|
|
54156
|
-
let preserved = getPreservedArgsForEnvUpdate(argv);
|
|
54157
|
-
if (commandTemplate.includes("--yes")) {
|
|
54158
|
-
preserved = preserved.filter((a) => a !== "--yes" && a !== "-y");
|
|
54159
|
-
}
|
|
54160
|
-
if (commandTemplate.includes("--value")) {
|
|
54161
|
-
const out = [];
|
|
54162
|
-
for (let i = 0; i < preserved.length; i++) {
|
|
54163
|
-
if (preserved[i] === "--value" && i + 1 < preserved.length) {
|
|
54164
|
-
i++;
|
|
54165
|
-
continue;
|
|
54166
|
-
}
|
|
54167
|
-
if (preserved[i].startsWith("--value="))
|
|
54168
|
-
continue;
|
|
54169
|
-
out.push(preserved[i]);
|
|
54170
|
-
}
|
|
54171
|
-
preserved = out;
|
|
54172
|
-
}
|
|
54173
|
-
const base = `${pkgName} ${commandTemplate}`;
|
|
54174
|
-
if (preserved.length === 0)
|
|
54175
|
-
return base;
|
|
54176
|
-
return `${base} ${preserved.join(" ")}`;
|
|
54177
|
-
}
|
|
54178
|
-
function buildCommandWithScope(argv, scopeSlug, pkgName = packageName) {
|
|
54179
|
-
const args = argv.slice(2);
|
|
54180
|
-
const out = [];
|
|
54181
|
-
for (let i = 0; i < args.length; i++) {
|
|
54182
|
-
if (args[i] === "--scope" || args[i] === "--team" || args[i] === "-S" || args[i] === "-T") {
|
|
54183
|
-
i++;
|
|
54184
|
-
continue;
|
|
54185
|
-
}
|
|
54186
|
-
if (args[i].startsWith("--scope=") || args[i].startsWith("--team=")) {
|
|
54187
|
-
continue;
|
|
54188
|
-
}
|
|
54189
|
-
out.push(args[i]);
|
|
54190
|
-
}
|
|
54191
|
-
out.push("--scope", scopeSlug);
|
|
54192
|
-
return `${pkgName} ${out.join(" ")}`;
|
|
54193
|
-
}
|
|
54194
|
-
function enrichActionRequiredWithInvokingCommand(payload, argv) {
|
|
54195
|
-
if (!payload.choices?.length) {
|
|
54196
|
-
return payload;
|
|
54197
|
-
}
|
|
54198
|
-
const next = [];
|
|
54199
|
-
const linkArgv = [...argv.slice(0, 2), "link", ...argv.slice(3)];
|
|
54200
|
-
for (const choice of payload.choices) {
|
|
54201
|
-
const slug = choice.name;
|
|
54202
|
-
next.push({
|
|
54203
|
-
command: buildCommandWithScope(linkArgv, slug),
|
|
54204
|
-
when: "Link first (then run any command without --scope)"
|
|
54205
|
-
});
|
|
54206
|
-
next.push({
|
|
54207
|
-
command: buildCommandWithScope(argv, slug),
|
|
54208
|
-
when: "Run this command with scope (no link)"
|
|
54209
|
-
});
|
|
54210
|
-
}
|
|
54211
|
-
return { ...payload, next };
|
|
54212
|
-
}
|
|
54213
|
-
function outputActionRequired(client, payload, exitCode = 1) {
|
|
54214
|
-
if (!shouldEmitNonInteractiveCommandError(client)) {
|
|
54215
|
-
return;
|
|
54216
|
-
}
|
|
54217
|
-
const enriched = enrichActionRequiredWithInvokingCommand(
|
|
54218
|
-
payload,
|
|
54219
|
-
client.argv
|
|
54220
|
-
);
|
|
54221
|
-
if (!enriched.hint && enriched.next?.length) {
|
|
54222
|
-
enriched.hint = "Run one of the commands in next[] to complete without prompting.";
|
|
54223
|
-
}
|
|
54224
|
-
client.stdout.write(`${JSON.stringify(enriched, null, 2)}
|
|
54225
|
-
`);
|
|
54226
|
-
process.exit(exitCode);
|
|
54227
|
-
}
|
|
54228
|
-
function argvHasNonInteractive(argv) {
|
|
54229
|
-
if (!argv?.length) {
|
|
54230
|
-
return false;
|
|
54231
|
-
}
|
|
54232
|
-
for (let i = 0; i < argv.length; i++) {
|
|
54233
|
-
const a = argv[i];
|
|
54234
|
-
if (a === "--non-interactive") {
|
|
54235
|
-
return argv[i + 1] !== "false";
|
|
54236
|
-
}
|
|
54237
|
-
if (a.startsWith("--non-interactive=")) {
|
|
54238
|
-
return a.slice("--non-interactive=".length) !== "false";
|
|
54239
|
-
}
|
|
54240
|
-
}
|
|
54241
|
-
return false;
|
|
54242
|
-
}
|
|
54243
|
-
function shouldEmitNonInteractiveCommandError(client) {
|
|
54244
|
-
return client.nonInteractive || argvHasNonInteractive(client.argv ?? []);
|
|
54245
|
-
}
|
|
54246
|
-
function outputAgentError(client, payload, exitCode = 1) {
|
|
54247
|
-
if (!shouldEmitNonInteractiveCommandError(client)) {
|
|
54248
|
-
return;
|
|
54249
|
-
}
|
|
54250
|
-
client.stdout.write(`${JSON.stringify(payload, null, 2)}
|
|
54251
|
-
`);
|
|
54252
|
-
process.exit(exitCode);
|
|
54253
|
-
}
|
|
54254
|
-
function buildNextStepsForEdgeConfig(client) {
|
|
54255
|
-
return [
|
|
54256
|
-
{
|
|
54257
|
-
command: buildCommandWithGlobalFlags(client.argv, "edge-config list"),
|
|
54258
|
-
when: "List Edge Config stores in the current team scope"
|
|
54259
|
-
},
|
|
54260
|
-
{
|
|
54261
|
-
command: buildCommandWithGlobalFlags(client.argv, "teams switch"),
|
|
54262
|
-
when: "Switch to the team that owns the Edge Config"
|
|
54263
|
-
},
|
|
54264
|
-
{
|
|
54265
|
-
command: buildCommandWithGlobalFlags(client.argv, "whoami"),
|
|
54266
|
-
when: "Verify the current team or user scope"
|
|
54267
|
-
}
|
|
54268
|
-
];
|
|
54269
|
-
}
|
|
54270
|
-
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.";
|
|
54271
|
-
function buildNextStepsForProjectSubcommands(client, variant) {
|
|
54272
|
-
const byName = variant === "access-groups" ? {
|
|
54273
|
-
template: "project access-groups <name>",
|
|
54274
|
-
when: "List access groups by project name (replace <name>)"
|
|
54275
|
-
} : variant === "access-summary" ? {
|
|
54276
|
-
template: "project access-summary <name>",
|
|
54277
|
-
when: "Show role counts by project name (replace <name>)"
|
|
54278
|
-
} : variant === "protection" ? {
|
|
54279
|
-
template: "project protection <name>",
|
|
54280
|
-
when: "Show deployment protection by project name (replace <name>)"
|
|
54281
|
-
} : variant === "speed-insights" ? {
|
|
54282
|
-
template: "project speed-insights <name>",
|
|
54283
|
-
when: "Enable Speed Insights by project name (replace <name>)"
|
|
54284
|
-
} : variant === "web-analytics" ? {
|
|
54285
|
-
template: "project web-analytics <name>",
|
|
54286
|
-
when: "Enable Web Analytics by project name (replace <name>)"
|
|
54287
|
-
} : variant === "checks" ? {
|
|
54288
|
-
template: "project checks add <name>",
|
|
54289
|
-
when: "Create a deployment check by project name (replace <name>)"
|
|
54290
|
-
} : {
|
|
54291
|
-
template: "project members <name>",
|
|
54292
|
-
when: "List members by project name (replace <name>)"
|
|
54293
|
-
};
|
|
54294
|
-
return [
|
|
54295
|
-
{
|
|
54296
|
-
command: buildCommandWithGlobalFlags(client.argv, "link"),
|
|
54297
|
-
when: "Re-link this directory to the correct Vercel project"
|
|
54298
|
-
},
|
|
54299
|
-
{
|
|
54300
|
-
command: buildCommandWithGlobalFlags(client.argv, byName.template),
|
|
54301
|
-
when: byName.when
|
|
54302
|
-
},
|
|
54303
|
-
{
|
|
54304
|
-
command: buildCommandWithGlobalFlags(client.argv, "project ls"),
|
|
54305
|
-
when: "List projects in the current team to pick a name"
|
|
54306
|
-
}
|
|
54307
|
-
];
|
|
54308
|
-
}
|
|
54309
|
-
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.";
|
|
54310
|
-
function resolveNonInteractiveDefaults(client, variant) {
|
|
54311
|
-
if (variant === "edge-config") {
|
|
54312
|
-
return {
|
|
54313
|
-
next: buildNextStepsForEdgeConfig(client),
|
|
54314
|
-
hint: EDGE_CONFIG_NON_INTERACTIVE_HINT
|
|
54315
|
-
};
|
|
54316
|
-
}
|
|
54317
|
-
return {
|
|
54318
|
-
next: buildNextStepsForProjectSubcommands(client, variant),
|
|
54319
|
-
hint: PROJECT_SUBCOMMAND_ERROR_HINT
|
|
54320
|
-
};
|
|
54321
|
-
}
|
|
54322
|
-
function writeAgentErrorPayloadAndExit(client, payload, exitCode, variant) {
|
|
54323
|
-
const defaults = resolveNonInteractiveDefaults(client, variant);
|
|
54324
|
-
const out = {
|
|
54325
|
-
...payload,
|
|
54326
|
-
next: payload.next ?? defaults.next,
|
|
54327
|
-
hint: payload.hint ?? defaults.hint
|
|
54328
|
-
};
|
|
54329
|
-
client.stdout.write(`${JSON.stringify(out, null, 2)}
|
|
54330
|
-
`);
|
|
54331
|
-
process.exit(exitCode);
|
|
54332
|
-
}
|
|
54333
|
-
function isProjectNotFoundLike(err) {
|
|
54334
|
-
if (err instanceof ProjectNotFound) {
|
|
54335
|
-
return true;
|
|
54336
|
-
}
|
|
54337
|
-
if ((0, import_error_utils2.isError)(err) && "code" in err && err.code === "PROJECT_NOT_FOUND") {
|
|
54338
|
-
return true;
|
|
54339
|
-
}
|
|
54340
|
-
return false;
|
|
54341
|
-
}
|
|
54342
|
-
function isLinkRequiredLike(err) {
|
|
54343
|
-
return err instanceof LinkRequiredError;
|
|
54344
|
-
}
|
|
54345
|
-
function normalizeApiErrorText(message) {
|
|
54346
|
-
return message.replace(/\s*\(\d{3}\)\s*$/, "").trim();
|
|
54347
|
-
}
|
|
54348
|
-
function exitWithNonInteractiveError(client, err, exitCode = 1, options = {
|
|
54349
|
-
variant: "members"
|
|
54350
|
-
}) {
|
|
54351
|
-
if (!shouldEmitNonInteractiveCommandError(client)) {
|
|
54352
|
-
return;
|
|
54353
|
-
}
|
|
54354
|
-
const { variant } = options;
|
|
54355
|
-
if (isLinkRequiredLike(err)) {
|
|
54356
|
-
if (variant === "edge-config") {
|
|
54357
|
-
writeAgentErrorPayloadAndExit(
|
|
54358
|
-
client,
|
|
54359
|
-
{
|
|
54360
|
-
status: "error",
|
|
54361
|
-
reason: "link_required",
|
|
54362
|
-
message: err instanceof Error ? err.message : String(err),
|
|
54363
|
-
next: buildNextStepsForEdgeConfig(client),
|
|
54364
|
-
hint: EDGE_CONFIG_NON_INTERACTIVE_HINT
|
|
54365
|
-
},
|
|
54366
|
-
exitCode,
|
|
54367
|
-
"edge-config"
|
|
54368
|
-
);
|
|
54369
|
-
return;
|
|
54370
|
-
}
|
|
54371
|
-
writeAgentErrorPayloadAndExit(
|
|
54372
|
-
client,
|
|
54373
|
-
{
|
|
54374
|
-
status: "error",
|
|
54375
|
-
reason: "link_required",
|
|
54376
|
-
message: err instanceof Error ? err.message : String(err)
|
|
54377
|
-
},
|
|
54378
|
-
exitCode,
|
|
54379
|
-
variant
|
|
54380
|
-
);
|
|
54381
|
-
return;
|
|
54382
|
-
}
|
|
54383
|
-
if (isProjectNotFoundLike(err)) {
|
|
54384
|
-
writeAgentErrorPayloadAndExit(
|
|
54385
|
-
client,
|
|
54386
|
-
{
|
|
54387
|
-
status: "error",
|
|
54388
|
-
reason: "project_not_found",
|
|
54389
|
-
message: err instanceof Error ? err.message : String(err)
|
|
54390
|
-
},
|
|
54391
|
-
exitCode,
|
|
54392
|
-
variant
|
|
54393
|
-
);
|
|
54394
|
-
return;
|
|
54395
|
-
}
|
|
54396
|
-
if (isAPIError(err)) {
|
|
54397
|
-
const rawMessage = err.serverMessage || err.message;
|
|
54398
|
-
const message = normalizeApiErrorText(rawMessage);
|
|
54399
|
-
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";
|
|
54400
|
-
writeAgentErrorPayloadAndExit(
|
|
54401
|
-
client,
|
|
54402
|
-
{
|
|
54403
|
-
status: "error",
|
|
54404
|
-
reason,
|
|
54405
|
-
message
|
|
54406
|
-
},
|
|
54407
|
-
exitCode,
|
|
54408
|
-
variant
|
|
54409
|
-
);
|
|
54410
|
-
}
|
|
54411
|
-
writeAgentErrorPayloadAndExit(
|
|
54412
|
-
client,
|
|
54413
|
-
{
|
|
54414
|
-
status: "error",
|
|
54415
|
-
reason: "unexpected_error",
|
|
54416
|
-
message: err instanceof Error ? err.message : String(err)
|
|
54417
|
-
},
|
|
54418
|
-
exitCode,
|
|
54419
|
-
variant
|
|
54420
|
-
);
|
|
54421
|
-
}
|
|
54422
|
-
function openUrlInBrowserCommand(url) {
|
|
54423
|
-
if (process.platform === "win32")
|
|
54424
|
-
return `start ${url}`;
|
|
54425
|
-
if (process.platform === "darwin")
|
|
54426
|
-
return `open '${url}'`;
|
|
54427
|
-
return `xdg-open '${url}'`;
|
|
54428
|
-
}
|
|
54429
|
-
|
|
54430
54134
|
// src/util/input/select-org.ts
|
|
54431
54135
|
function getScopeOrTeamFromArgv(argv) {
|
|
54432
54136
|
const args = argv.slice(2);
|
|
@@ -55584,7 +55288,7 @@ function addDeltaSection(prefix, arr, changed = false) {
|
|
|
55584
55288
|
}
|
|
55585
55289
|
|
|
55586
55290
|
// src/commands/env/pull.ts
|
|
55587
|
-
var
|
|
55291
|
+
var import_error_utils2 = __toESM(require_dist(), 1);
|
|
55588
55292
|
var import_json_parse_better_errors = __toESM(require_json_parse_better_errors(), 1);
|
|
55589
55293
|
|
|
55590
55294
|
// src/util/projects/format-project.ts
|
|
@@ -56046,7 +55750,7 @@ function tryReadHeadSync(path2, length) {
|
|
|
56046
55750
|
try {
|
|
56047
55751
|
return readHeadSync(path2, length);
|
|
56048
55752
|
} catch (err) {
|
|
56049
|
-
if (!(0,
|
|
55753
|
+
if (!(0, import_error_utils2.isErrnoException)(err) || err.code !== "ENOENT") {
|
|
56050
55754
|
throw err;
|
|
56051
55755
|
}
|
|
56052
55756
|
}
|
|
@@ -56237,7 +55941,7 @@ import { basename as basename2, join as join6 } from "path";
|
|
|
56237
55941
|
// src/util/read-json-file.ts
|
|
56238
55942
|
var import_fs_extra6 = __toESM(require_lib2(), 1);
|
|
56239
55943
|
var import_json_parse_better_errors2 = __toESM(require_json_parse_better_errors(), 1);
|
|
56240
|
-
var
|
|
55944
|
+
var import_error_utils3 = __toESM(require_dist(), 1);
|
|
56241
55945
|
async function readJSONFile(file) {
|
|
56242
55946
|
const content = await readFileSafe(file);
|
|
56243
55947
|
if (content === null) {
|
|
@@ -56247,7 +55951,7 @@ async function readJSONFile(file) {
|
|
|
56247
55951
|
const json = (0, import_json_parse_better_errors2.default)(content);
|
|
56248
55952
|
return json;
|
|
56249
55953
|
} catch (error) {
|
|
56250
|
-
return new CantParseJSONFile(file, (0,
|
|
55954
|
+
return new CantParseJSONFile(file, (0, import_error_utils3.errorToString)(error));
|
|
56251
55955
|
}
|
|
56252
55956
|
}
|
|
56253
55957
|
async function readFileSafe(file) {
|
|
@@ -56438,6 +56142,11 @@ var serviceConfigSchema = {
|
|
|
56438
56142
|
type: {
|
|
56439
56143
|
enum: ["web", "cron", "worker"]
|
|
56440
56144
|
},
|
|
56145
|
+
root: {
|
|
56146
|
+
type: "string",
|
|
56147
|
+
minLength: 1,
|
|
56148
|
+
maxLength: 512
|
|
56149
|
+
},
|
|
56441
56150
|
entrypoint: {
|
|
56442
56151
|
type: "string",
|
|
56443
56152
|
minLength: 1,
|
|
@@ -56885,10 +56594,10 @@ async function getLinkFromDir(dir) {
|
|
|
56885
56594
|
}
|
|
56886
56595
|
return link;
|
|
56887
56596
|
} catch (err) {
|
|
56888
|
-
if ((0,
|
|
56597
|
+
if ((0, import_error_utils4.isErrnoException)(err) && err.code && ["ENOENT", "ENOTDIR"].includes(err.code)) {
|
|
56889
56598
|
return null;
|
|
56890
56599
|
}
|
|
56891
|
-
if ((0,
|
|
56600
|
+
if ((0, import_error_utils4.isError)(err) && err.name === "SyntaxError") {
|
|
56892
56601
|
throw new Error(
|
|
56893
56602
|
`Project Settings could not be retrieved. To link your project again, remove the ${dir} directory.`
|
|
56894
56603
|
);
|
|
@@ -57047,7 +56756,7 @@ async function linkFolderToProject(client, path2, projectLink, projectName, orgS
|
|
|
57047
56756
|
try {
|
|
57048
56757
|
await (0, import_fs_extra8.ensureDir)(join8(path2, VERCEL_DIR));
|
|
57049
56758
|
} catch (err) {
|
|
57050
|
-
if ((0,
|
|
56759
|
+
if ((0, import_error_utils4.isErrnoException)(err) && err.code === "ENOTDIR") {
|
|
57051
56760
|
return;
|
|
57052
56761
|
}
|
|
57053
56762
|
throw err;
|
|
@@ -57490,22 +57199,6 @@ export {
|
|
|
57490
57199
|
createGitMeta,
|
|
57491
57200
|
parseGitConfig,
|
|
57492
57201
|
pluckRemoteUrls,
|
|
57493
|
-
buildCommandWithYes,
|
|
57494
|
-
getGlobalFlagsFromArgv,
|
|
57495
|
-
buildIntegrationCommandTailFromArgv,
|
|
57496
|
-
buildCommandWithGlobalFlags,
|
|
57497
|
-
getPreservedArgsForEnvAdd,
|
|
57498
|
-
buildEnvAddCommandWithPreservedArgs,
|
|
57499
|
-
getPreservedArgsForEnvRm,
|
|
57500
|
-
buildEnvRmCommandWithPreservedArgs,
|
|
57501
|
-
getPreservedArgsForEnvUpdate,
|
|
57502
|
-
buildEnvUpdateCommandWithPreservedArgs,
|
|
57503
|
-
outputActionRequired,
|
|
57504
|
-
argvHasNonInteractive,
|
|
57505
|
-
shouldEmitNonInteractiveCommandError,
|
|
57506
|
-
outputAgentError,
|
|
57507
|
-
exitWithNonInteractiveError,
|
|
57508
|
-
openUrlInBrowserCommand,
|
|
57509
57202
|
selectOrg,
|
|
57510
57203
|
createProject,
|
|
57511
57204
|
require_frameworks,
|