vercel 54.15.0 → 54.16.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-6XHROCMP.js → add-ODBKI7EV.js} +5 -5
- package/dist/chunks/{chunk-AWD3IGXU.js → chunk-3NR6OYDV.js} +1 -1
- package/dist/chunks/{chunk-OQD4G5FW.js → chunk-76QQSALN.js} +3 -3
- package/dist/chunks/{chunk-3RIVJWW5.js → chunk-7CTLNKAS.js} +48 -9
- package/dist/chunks/{chunk-OEYKL4IY.js → chunk-BGQPLZFA.js} +6 -6
- package/dist/chunks/{chunk-DCN3SOR6.js → chunk-BIHRICRM.js} +2 -2
- package/dist/chunks/{chunk-6SL223IW.js → chunk-FBYYZKN3.js} +4 -1
- package/dist/chunks/{chunk-TLVKY7WL.js → chunk-HL5ZRVF2.js} +6 -6
- package/dist/chunks/{chunk-WGH26RJV.js → chunk-HXAMK45D.js} +2 -2
- package/dist/chunks/{chunk-SFPJ3VR7.js → chunk-INFYZRHS.js} +286 -76
- package/dist/chunks/{chunk-PMUUPCDL.js → chunk-JFA4NUXP.js} +1 -1
- package/dist/chunks/{chunk-LABX5FSJ.js → chunk-KJMSI2CT.js} +1 -1
- package/dist/chunks/{chunk-EAEEBPMD.js → chunk-LJXYGWOY.js} +11 -3
- package/dist/chunks/{chunk-AG6TBL6C.js → chunk-MSWXRAHA.js} +1 -1
- package/dist/chunks/{chunk-HSXUEJ4T.js → chunk-NVITPK2U.js} +1 -1
- package/dist/chunks/{chunk-RHXSECUF.js → chunk-O6YJBWWC.js} +1 -1
- package/dist/chunks/{chunk-LOPPFUV3.js → chunk-Q4ZRBN2A.js} +1 -1
- package/dist/chunks/{chunk-HIYWSGI7.js → chunk-Q77ALSXR.js} +3 -0
- package/dist/chunks/{chunk-6TPH3ZBU.js → chunk-RCUMYP4L.js} +4 -4
- package/dist/chunks/{chunk-574PHXNT.js → chunk-U2NYO6GP.js} +1 -1
- package/dist/chunks/{chunk-6A62YUBE.js → chunk-UI2T3GI4.js} +2 -2
- package/dist/chunks/{chunk-UZD3DM6V.js → chunk-ULNWA6GY.js} +1 -1
- package/dist/chunks/{chunk-CENOYXK3.js → chunk-VLQBXXOQ.js} +2 -2
- package/dist/chunks/{compile-vercel-config-ATU3UBFK.js → compile-vercel-config-7THB6MTJ.js} +2 -2
- package/dist/chunks/{delete-WIN4UHQY.js → delete-USWDARFF.js} +3 -3
- package/dist/chunks/{disable-24KUO3TS.js → disable-K6B26MC2.js} +3 -3
- package/dist/chunks/{discard-B6ATZCPD.js → discard-2T7HZCGR.js} +3 -3
- package/dist/chunks/{edit-DIYIVLFQ.js → edit-2CC2WAO4.js} +5 -5
- package/dist/chunks/{enable-BF7NKTV7.js → enable-KEZA6F4T.js} +3 -3
- package/dist/chunks/{export-HHONDN7V.js → export-PE2T4HYP.js} +3 -3
- package/dist/chunks/{inspect-GSYKUMK5.js → inspect-TQSHD4MH.js} +4 -4
- package/dist/chunks/{list-OSJGB5AE.js → list-AU6URG3E.js} +4 -4
- package/dist/chunks/{list-PZ4DRWLO.js → list-IDTF5TWY.js} +3 -3
- package/dist/chunks/{ls-QBCHGSIC.js → ls-XOAWRTNQ.js} +5 -5
- package/dist/chunks/{publish-QYPZQ66O.js → publish-G42C77TP.js} +3 -3
- package/dist/chunks/{query-BDMX4CF6.js → query-YTBD7YLX.js} +3 -3
- package/dist/chunks/{reorder-YDTGTTJB.js → reorder-BDOOUURL.js} +3 -3
- package/dist/chunks/{restore-LXO2ZBAF.js → restore-ENUHC25O.js} +3 -3
- package/dist/chunks/{rm-3L7FVCDA.js → rm-ALWF3NBL.js} +5 -5
- package/dist/chunks/{routes-YEU33SON.js → routes-KUTLDFIF.js} +2 -2
- package/dist/chunks/{rule-inspect-T57QBYJR.js → rule-inspect-BV6MC7PG.js} +5 -5
- package/dist/chunks/{rules-E5DTNMFG.js → rules-IGG7M2AC.js} +6 -6
- package/dist/chunks/{schema-VYVJ4GYP.js → schema-ZYJOJIGL.js} +3 -3
- package/dist/chunks/{update-LT3LZVEZ.js → update-I3WE3IQJ.js} +5 -5
- package/dist/commands/build/index.js +18 -18
- package/dist/commands/deploy/index.js +12 -12
- package/dist/commands/dev/index.js +670 -100
- package/dist/commands/env/index.js +6 -6
- package/dist/commands/link/index.js +47 -13
- package/dist/commands/list/index.js +5 -5
- package/dist/commands-bulk.js +88 -45
- package/dist/index.js +46 -42
- package/dist/version.mjs +1 -1
- package/package.json +20 -19
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
TelemetryClient,
|
|
9
9
|
require_dist as require_dist2,
|
|
10
10
|
require_graceful_fs
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-Q77ALSXR.js";
|
|
12
12
|
import {
|
|
13
13
|
buildCommandWithYes,
|
|
14
14
|
getPreservedArgsForEnvPull,
|
|
@@ -8006,7 +8006,7 @@ var require_jsonfile = __commonJS({
|
|
|
8006
8006
|
}
|
|
8007
8007
|
return obj;
|
|
8008
8008
|
}
|
|
8009
|
-
var
|
|
8009
|
+
var readFile7 = universalify.fromPromise(_readFile);
|
|
8010
8010
|
function readFileSync(file, options = {}) {
|
|
8011
8011
|
if (typeof options === "string") {
|
|
8012
8012
|
options = { encoding: options };
|
|
@@ -8038,7 +8038,7 @@ var require_jsonfile = __commonJS({
|
|
|
8038
8038
|
return fs5.writeFileSync(file, str, options);
|
|
8039
8039
|
}
|
|
8040
8040
|
module.exports = {
|
|
8041
|
-
readFile:
|
|
8041
|
+
readFile: readFile7,
|
|
8042
8042
|
readFileSync,
|
|
8043
8043
|
writeFile: writeFile5,
|
|
8044
8044
|
writeFileSync
|
|
@@ -13734,10 +13734,10 @@ var require_read_config_file = __commonJS({
|
|
|
13734
13734
|
var import_smol_toml3 = __require("smol-toml");
|
|
13735
13735
|
var import_fs4 = __require("fs");
|
|
13736
13736
|
var import_error_utils5 = require_dist();
|
|
13737
|
-
var { readFile:
|
|
13737
|
+
var { readFile: readFile7 } = import_fs4.promises;
|
|
13738
13738
|
async function readFileOrNull(file) {
|
|
13739
13739
|
try {
|
|
13740
|
-
const data = await
|
|
13740
|
+
const data = await readFile7(file);
|
|
13741
13741
|
return data;
|
|
13742
13742
|
} catch (error) {
|
|
13743
13743
|
if (!(0, import_error_utils5.isErrnoException)(error)) {
|
|
@@ -13824,7 +13824,7 @@ var require_frameworks = __commonJS({
|
|
|
13824
13824
|
var import_fs4 = __require("fs");
|
|
13825
13825
|
var import_read_config_file = require_read_config_file();
|
|
13826
13826
|
__reExport(frameworks_exports, require_types(), module.exports);
|
|
13827
|
-
var { readdir, readFile:
|
|
13827
|
+
var { readdir, readFile: readFile7, unlink: unlink2 } = import_fs4.promises;
|
|
13828
13828
|
var frameworks = [
|
|
13829
13829
|
{
|
|
13830
13830
|
name: "Blitz.js (Legacy)",
|
|
@@ -13952,7 +13952,7 @@ var require_frameworks = __commonJS({
|
|
|
13952
13952
|
"public",
|
|
13953
13953
|
"__now_routes_g4t5bY.json"
|
|
13954
13954
|
);
|
|
13955
|
-
const content = await
|
|
13955
|
+
const content = await readFile7(nowRoutesPath, "utf8");
|
|
13956
13956
|
const nowRoutes = JSON.parse(content);
|
|
13957
13957
|
try {
|
|
13958
13958
|
await unlink2(nowRoutesPath);
|
|
@@ -22955,7 +22955,8 @@ var require_types3 = __commonJS({
|
|
|
22955
22955
|
python: "@vercel/python",
|
|
22956
22956
|
go: "@vercel/go",
|
|
22957
22957
|
rust: "@vercel/rust",
|
|
22958
|
-
ruby: "@vercel/ruby"
|
|
22958
|
+
ruby: "@vercel/ruby",
|
|
22959
|
+
container: "@vercel/container"
|
|
22959
22960
|
};
|
|
22960
22961
|
var RUNTIME_MANIFESTS = {
|
|
22961
22962
|
node: ["package.json"],
|
|
@@ -23522,6 +23523,12 @@ var require_resolve2 = __commonJS({
|
|
|
23522
23523
|
"python",
|
|
23523
23524
|
"go"
|
|
23524
23525
|
]);
|
|
23526
|
+
function isContainerRuntime(config) {
|
|
23527
|
+
return config.runtime === "container";
|
|
23528
|
+
}
|
|
23529
|
+
function normalizeContainerCommand(command) {
|
|
23530
|
+
return Array.isArray(command) ? command : [command];
|
|
23531
|
+
}
|
|
23525
23532
|
async function getServiceFs(fs5, serviceName, root) {
|
|
23526
23533
|
if (!root) {
|
|
23527
23534
|
return { fs: fs5 };
|
|
@@ -23607,6 +23614,10 @@ var require_resolve2 = __commonJS({
|
|
|
23607
23614
|
}
|
|
23608
23615
|
};
|
|
23609
23616
|
}
|
|
23617
|
+
function isDockerfileEntrypoint(entrypoint) {
|
|
23618
|
+
const base = import_path12.posix.basename(entrypoint).toLowerCase();
|
|
23619
|
+
return base === "dockerfile" || base === "containerfile" || base.endsWith(".dockerfile");
|
|
23620
|
+
}
|
|
23610
23621
|
function toWorkspaceRelativeEntrypoint(entrypoint, workspace) {
|
|
23611
23622
|
const normalizedEntrypoint = import_path12.posix.normalize(entrypoint);
|
|
23612
23623
|
if (workspace === ".") {
|
|
@@ -23985,6 +23996,13 @@ var require_resolve2 = __commonJS({
|
|
|
23985
23996
|
serviceName: name
|
|
23986
23997
|
};
|
|
23987
23998
|
}
|
|
23999
|
+
if (config.command !== void 0 && !isContainerRuntime(config)) {
|
|
24000
|
+
return {
|
|
24001
|
+
code: "INVALID_COMMAND",
|
|
24002
|
+
message: `Service "${name}" can only specify "command" when using runtime "container".`,
|
|
24003
|
+
serviceName: name
|
|
24004
|
+
};
|
|
24005
|
+
}
|
|
23988
24006
|
return null;
|
|
23989
24007
|
}
|
|
23990
24008
|
function validateServiceEntrypoint(name, config, resolvedEntrypoint) {
|
|
@@ -24025,8 +24043,11 @@ var require_resolve2 = __commonJS({
|
|
|
24025
24043
|
const configuredRoutePrefix = routingResult.routing?.routePrefix;
|
|
24026
24044
|
const configuredSubdomain = routingResult.routing?.subdomain;
|
|
24027
24045
|
const routePrefixWasConfigured = routingResult.routing?.routePrefixConfigured ?? false;
|
|
24046
|
+
const containerEntrypoint = isContainerRuntime(config) && typeof rawEntrypoint === "string" ? rawEntrypoint : void 0;
|
|
24047
|
+
const containerDockerfile = containerEntrypoint && isDockerfileEntrypoint(containerEntrypoint) ? import_path12.posix.normalize(containerEntrypoint) : void 0;
|
|
24048
|
+
const containerImage = containerEntrypoint && !containerDockerfile ? containerEntrypoint : void 0;
|
|
24028
24049
|
let resolvedEntrypointPath = resolvedEntrypoint;
|
|
24029
|
-
if (!resolvedEntrypointPath && typeof rawEntrypoint === "string") {
|
|
24050
|
+
if (!containerEntrypoint && !resolvedEntrypointPath && typeof rawEntrypoint === "string") {
|
|
24030
24051
|
const entrypointToResolve = moduleAttrParsed ? moduleAttrParsed.filePath : rawEntrypoint;
|
|
24031
24052
|
const resolved = await resolveEntrypointPath({
|
|
24032
24053
|
fs: serviceFs,
|
|
@@ -24035,7 +24056,7 @@ var require_resolve2 = __commonJS({
|
|
|
24035
24056
|
});
|
|
24036
24057
|
resolvedEntrypointPath = resolved.entrypoint;
|
|
24037
24058
|
}
|
|
24038
|
-
if (typeof rawEntrypoint === "string" && !resolvedEntrypointPath) {
|
|
24059
|
+
if (!containerEntrypoint && typeof rawEntrypoint === "string" && !resolvedEntrypointPath) {
|
|
24039
24060
|
throw new Error(
|
|
24040
24061
|
`Failed to resolve entrypoint "${rawEntrypoint}" for service "${name}".`
|
|
24041
24062
|
);
|
|
@@ -24099,7 +24120,7 @@ var require_resolve2 = __commonJS({
|
|
|
24099
24120
|
} else {
|
|
24100
24121
|
builderUse = (0, import_utils4.getBuilderForRuntime)(inferredRuntime);
|
|
24101
24122
|
}
|
|
24102
|
-
builderSrc = resolvedEntrypointFile;
|
|
24123
|
+
builderSrc = inferredRuntime === "container" && typeof containerEntrypoint === "string" ? containerEntrypoint : resolvedEntrypointFile;
|
|
24103
24124
|
}
|
|
24104
24125
|
const normalizedSubdomain = type === "web" && typeof configuredSubdomain === "string" ? configuredSubdomain.toLowerCase() : void 0;
|
|
24105
24126
|
const defaultRoutePrefix = type === "web" && normalizedSubdomain ? `/_/${name}` : void 0;
|
|
@@ -24133,6 +24154,12 @@ var require_resolve2 = __commonJS({
|
|
|
24133
24154
|
if (config.framework) {
|
|
24134
24155
|
builderConfig.framework = config.framework;
|
|
24135
24156
|
}
|
|
24157
|
+
if (containerImage) {
|
|
24158
|
+
builderConfig.handler = containerImage;
|
|
24159
|
+
}
|
|
24160
|
+
if (config.command !== void 0) {
|
|
24161
|
+
builderConfig.command = normalizeContainerCommand(config.command);
|
|
24162
|
+
}
|
|
24136
24163
|
if (moduleAttrParsed) {
|
|
24137
24164
|
builderConfig.handlerFunction = moduleAttrParsed.attrName;
|
|
24138
24165
|
}
|
|
@@ -24143,7 +24170,7 @@ var require_resolve2 = __commonJS({
|
|
|
24143
24170
|
trigger,
|
|
24144
24171
|
group,
|
|
24145
24172
|
workspace,
|
|
24146
|
-
entrypoint: resolvedEntrypointFile,
|
|
24173
|
+
entrypoint: containerImage ?? containerDockerfile ?? resolvedEntrypointFile,
|
|
24147
24174
|
routePrefix,
|
|
24148
24175
|
routePrefixSource: resolvedRoutePrefixSource,
|
|
24149
24176
|
subdomain: normalizedSubdomain,
|
|
@@ -24182,7 +24209,7 @@ var require_resolve2 = __commonJS({
|
|
|
24182
24209
|
}
|
|
24183
24210
|
const serviceFs = serviceFsResult.fs;
|
|
24184
24211
|
let resolvedEntrypoint;
|
|
24185
|
-
if (typeof serviceConfig.entrypoint === "string") {
|
|
24212
|
+
if (typeof serviceConfig.entrypoint === "string" && !isContainerRuntime(serviceConfig)) {
|
|
24186
24213
|
const moduleAttr = parsePyModuleAttrEntrypoint(serviceConfig.entrypoint);
|
|
24187
24214
|
const entrypointToResolve = moduleAttr?.filePath ?? serviceConfig.entrypoint;
|
|
24188
24215
|
const resolvedPath = await resolveEntrypointPath({
|
|
@@ -24379,6 +24406,67 @@ var require_resolve_v2 = __commonJS({
|
|
|
24379
24406
|
var import_utils4 = require_utils3();
|
|
24380
24407
|
var frameworksBySlug = new Map(import_frameworks2.frameworkList.map((f) => [f.slug, f]));
|
|
24381
24408
|
var SERVICE_NAME_REGEX = /^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$/;
|
|
24409
|
+
function isDockerfileEntrypoint(entrypoint) {
|
|
24410
|
+
const base = import_path12.posix.basename(entrypoint).toLowerCase();
|
|
24411
|
+
return base === "dockerfile" || base === "containerfile" || base.endsWith(".dockerfile");
|
|
24412
|
+
}
|
|
24413
|
+
function normalizeContainerCommand(command) {
|
|
24414
|
+
if (command === void 0) {
|
|
24415
|
+
return void 0;
|
|
24416
|
+
}
|
|
24417
|
+
return Array.isArray(command) ? command : [command];
|
|
24418
|
+
}
|
|
24419
|
+
function resolveContainerServiceV2(name, config, normalizedRoot) {
|
|
24420
|
+
const isRoot = normalizedRoot === ".";
|
|
24421
|
+
const entrypoint = config.entrypoint;
|
|
24422
|
+
const dockerfile = typeof entrypoint === "string" && isDockerfileEntrypoint(entrypoint) ? import_path12.posix.normalize(entrypoint) : void 0;
|
|
24423
|
+
const image = typeof entrypoint === "string" && !dockerfile ? entrypoint : void 0;
|
|
24424
|
+
if (!dockerfile && !image) {
|
|
24425
|
+
return {
|
|
24426
|
+
error: {
|
|
24427
|
+
code: "MISSING_SERVICE_CONFIG",
|
|
24428
|
+
message: `Container service "${name}" must specify an "entrypoint": a Dockerfile path to build, or a prebuilt OCI image reference.`,
|
|
24429
|
+
serviceName: name
|
|
24430
|
+
}
|
|
24431
|
+
};
|
|
24432
|
+
}
|
|
24433
|
+
const localSrc = dockerfile ?? image ?? "Dockerfile";
|
|
24434
|
+
const builderSrc = isRoot ? localSrc : import_path12.posix.join(normalizedRoot, localSrc);
|
|
24435
|
+
const builderConfig = { zeroConfig: true };
|
|
24436
|
+
if (!isRoot) {
|
|
24437
|
+
builderConfig.workspace = normalizedRoot;
|
|
24438
|
+
}
|
|
24439
|
+
if (image) {
|
|
24440
|
+
builderConfig.handler = image;
|
|
24441
|
+
}
|
|
24442
|
+
const command = normalizeContainerCommand(config.command);
|
|
24443
|
+
if (command) {
|
|
24444
|
+
builderConfig.command = command;
|
|
24445
|
+
}
|
|
24446
|
+
return {
|
|
24447
|
+
service: {
|
|
24448
|
+
schema: "experimentalServicesV2",
|
|
24449
|
+
name,
|
|
24450
|
+
root: normalizedRoot,
|
|
24451
|
+
runtime: "container",
|
|
24452
|
+
entrypoint: image ?? dockerfile,
|
|
24453
|
+
command,
|
|
24454
|
+
builder: {
|
|
24455
|
+
src: builderSrc,
|
|
24456
|
+
use: "@vercel/container",
|
|
24457
|
+
config: builderConfig
|
|
24458
|
+
},
|
|
24459
|
+
bindings: config.bindings,
|
|
24460
|
+
functions: config.functions,
|
|
24461
|
+
headers: config.headers,
|
|
24462
|
+
redirects: config.redirects,
|
|
24463
|
+
rewrites: config.rewrites,
|
|
24464
|
+
routes: config.routes,
|
|
24465
|
+
cleanUrls: config.cleanUrls,
|
|
24466
|
+
trailingSlash: config.trailingSlash
|
|
24467
|
+
}
|
|
24468
|
+
};
|
|
24469
|
+
}
|
|
24382
24470
|
function validateServiceConfigV22(name, config) {
|
|
24383
24471
|
if (!SERVICE_NAME_REGEX.test(name)) {
|
|
24384
24472
|
return {
|
|
@@ -24440,7 +24528,8 @@ var require_resolve_v2 = __commonJS({
|
|
|
24440
24528
|
};
|
|
24441
24529
|
}
|
|
24442
24530
|
}
|
|
24443
|
-
|
|
24531
|
+
const isContainer = config.runtime === "container";
|
|
24532
|
+
if (!config.framework && !config.entrypoint && !isContainer) {
|
|
24444
24533
|
return {
|
|
24445
24534
|
code: "MISSING_SERVICE_CONFIG",
|
|
24446
24535
|
message: `Service "${name}" must specify "framework" or "entrypoint".`,
|
|
@@ -24451,6 +24540,10 @@ var require_resolve_v2 = __commonJS({
|
|
|
24451
24540
|
}
|
|
24452
24541
|
async function resolveConfiguredServiceV22(name, config, fs5) {
|
|
24453
24542
|
const normalizedRoot = (0, import_utils4.stripTrailingSlash)(import_path12.posix.normalize(config.root));
|
|
24543
|
+
const isContainer = config.runtime === "container" || typeof config.entrypoint === "string" && isDockerfileEntrypoint(config.entrypoint);
|
|
24544
|
+
if (isContainer) {
|
|
24545
|
+
return resolveContainerServiceV2(name, config, normalizedRoot);
|
|
24546
|
+
}
|
|
24454
24547
|
const serviceFsResult = normalizedRoot === "." ? { fs: fs5 } : await (0, import_resolve.getServiceFs)(fs5, name, normalizedRoot);
|
|
24455
24548
|
if (serviceFsResult.error) {
|
|
24456
24549
|
return { error: serviceFsResult.error };
|
|
@@ -28577,8 +28670,23 @@ var require_detect_services = __commonJS({
|
|
|
28577
28670
|
warnings: []
|
|
28578
28671
|
});
|
|
28579
28672
|
}
|
|
28673
|
+
if (vercelConfig?.services != null && vercelConfig.experimentalServicesV2 != null) {
|
|
28674
|
+
return withResolvedResult({
|
|
28675
|
+
services: [],
|
|
28676
|
+
source: "configured",
|
|
28677
|
+
useImplicitEnvInjection: false,
|
|
28678
|
+
routes: emptyRoutes(),
|
|
28679
|
+
errors: [
|
|
28680
|
+
{
|
|
28681
|
+
code: "SERVICES_AND_EXPERIMENTAL_SERVICES_V2",
|
|
28682
|
+
message: "The `services` property cannot be used in conjunction with its deprecated alias `experimentalServicesV2`. Please use only `services`."
|
|
28683
|
+
}
|
|
28684
|
+
],
|
|
28685
|
+
warnings: []
|
|
28686
|
+
});
|
|
28687
|
+
}
|
|
28580
28688
|
const hasProvidedConfiguredServices = providedConfiguredServices && Object.keys(providedConfiguredServices).length > 0;
|
|
28581
|
-
const experimentalServicesV2 = hasProvidedConfiguredServices && providedConfiguredServicesType === "experimentalServicesV2" ? providedConfiguredServices : hasProvidedConfiguredServices ? void 0 : vercelConfig?.experimentalServicesV2;
|
|
28689
|
+
const experimentalServicesV2 = hasProvidedConfiguredServices && (providedConfiguredServicesType === "services" || providedConfiguredServicesType === "experimentalServicesV2") ? providedConfiguredServices : hasProvidedConfiguredServices ? void 0 : vercelConfig?.services ?? vercelConfig?.experimentalServicesV2;
|
|
28582
28690
|
if (experimentalServicesV2 && Object.keys(experimentalServicesV2).length > 0) {
|
|
28583
28691
|
const result2 = await (0, import_resolve_v2.resolveAllConfiguredServicesV2)(
|
|
28584
28692
|
experimentalServicesV2,
|
|
@@ -28757,11 +28865,12 @@ var require_detect_services = __commonJS({
|
|
|
28757
28865
|
}
|
|
28758
28866
|
} else if (service.runtime) {
|
|
28759
28867
|
const functionPath = (0, import_utils4.getInternalServiceFunctionPath)(service.name);
|
|
28868
|
+
const check2 = service.runtime === "container" ? void 0 : true;
|
|
28760
28869
|
if (routePrefix === "/") {
|
|
28761
28870
|
defaults.push({
|
|
28762
28871
|
src: (0, import_routing_utils2.scopeRouteSourceToOwnership)("^/(.*)$", ownershipGuard),
|
|
28763
28872
|
dest: functionPath,
|
|
28764
|
-
check:
|
|
28873
|
+
...check2 ? { check: check2 } : {}
|
|
28765
28874
|
});
|
|
28766
28875
|
} else {
|
|
28767
28876
|
rewrites.push({
|
|
@@ -28770,7 +28879,7 @@ var require_detect_services = __commonJS({
|
|
|
28770
28879
|
ownershipGuard
|
|
28771
28880
|
),
|
|
28772
28881
|
dest: functionPath,
|
|
28773
|
-
check:
|
|
28882
|
+
...check2 ? { check: check2 } : {}
|
|
28774
28883
|
});
|
|
28775
28884
|
}
|
|
28776
28885
|
}
|
|
@@ -29278,12 +29387,30 @@ var require_detect_builders = __commonJS({
|
|
|
29278
29387
|
async function detectBuilders2(files, pkg, options = {}) {
|
|
29279
29388
|
const {
|
|
29280
29389
|
experimentalServices: experimentalServicesV1,
|
|
29390
|
+
services,
|
|
29281
29391
|
experimentalServicesV2,
|
|
29282
29392
|
projectSettings = {}
|
|
29283
29393
|
} = options;
|
|
29394
|
+
if (services != null && experimentalServicesV2 != null) {
|
|
29395
|
+
return {
|
|
29396
|
+
builders: null,
|
|
29397
|
+
errors: [
|
|
29398
|
+
{
|
|
29399
|
+
code: "SERVICES_AND_EXPERIMENTAL_SERVICES_V2",
|
|
29400
|
+
message: "The `services` option cannot be used in conjunction with its deprecated alias `experimentalServicesV2`. Please use only `services`."
|
|
29401
|
+
}
|
|
29402
|
+
],
|
|
29403
|
+
warnings: [],
|
|
29404
|
+
defaultRoutes: null,
|
|
29405
|
+
redirectRoutes: null,
|
|
29406
|
+
rewriteRoutes: null,
|
|
29407
|
+
errorRoutes: null
|
|
29408
|
+
};
|
|
29409
|
+
}
|
|
29284
29410
|
const { framework } = projectSettings;
|
|
29285
|
-
const
|
|
29286
|
-
const
|
|
29411
|
+
const servicesConfig = services ?? experimentalServicesV2;
|
|
29412
|
+
const configuredServices = servicesConfig ?? experimentalServicesV1;
|
|
29413
|
+
const configuredServicesType = servicesConfig ? services ? "services" : "experimentalServicesV2" : "experimentalServices";
|
|
29287
29414
|
const hasServicesConfig = configuredServices != null && typeof configuredServices === "object";
|
|
29288
29415
|
if (hasServicesConfig || framework === "services") {
|
|
29289
29416
|
const result = await (0, import_get_services_builders.getServicesBuilders)({
|
|
@@ -36527,7 +36654,7 @@ var require_jsonfile3 = __commonJS({
|
|
|
36527
36654
|
} catch (_) {
|
|
36528
36655
|
_fs = __require("fs");
|
|
36529
36656
|
}
|
|
36530
|
-
function
|
|
36657
|
+
function readFile7(file, options, callback) {
|
|
36531
36658
|
if (callback == null) {
|
|
36532
36659
|
callback = options;
|
|
36533
36660
|
options = {};
|
|
@@ -36626,7 +36753,7 @@ var require_jsonfile3 = __commonJS({
|
|
|
36626
36753
|
return content;
|
|
36627
36754
|
}
|
|
36628
36755
|
var jsonfile = {
|
|
36629
|
-
readFile:
|
|
36756
|
+
readFile: readFile7,
|
|
36630
36757
|
readFileSync,
|
|
36631
36758
|
writeFile: writeFile5,
|
|
36632
36759
|
writeFileSync
|
|
@@ -37606,7 +37733,7 @@ var require_package = __commonJS({
|
|
|
37606
37733
|
"../client/package.json"(exports, module) {
|
|
37607
37734
|
module.exports = {
|
|
37608
37735
|
name: "@vercel/client",
|
|
37609
|
-
version: "17.
|
|
37736
|
+
version: "17.6.0",
|
|
37610
37737
|
main: "dist/index.js",
|
|
37611
37738
|
typings: "dist/index.d.ts",
|
|
37612
37739
|
homepage: "https://vercel.com",
|
|
@@ -52696,7 +52823,7 @@ var require_dist7 = __commonJS({
|
|
|
52696
52823
|
|
|
52697
52824
|
// src/util/compile-vercel-config.ts
|
|
52698
52825
|
var import_dotenv = __toESM(require_main(), 1);
|
|
52699
|
-
import { mkdir, readFile as
|
|
52826
|
+
import { mkdir, readFile as readFile6, writeFile as writeFile4, unlink, access } from "fs/promises";
|
|
52700
52827
|
import { join as join10, basename as basename3 } from "path";
|
|
52701
52828
|
import { fork } from "child_process";
|
|
52702
52829
|
import { parse as tomlParse2 } from "smol-toml";
|
|
@@ -55497,6 +55624,41 @@ function addDeltaSection(prefix, arr, changed = false) {
|
|
|
55497
55624
|
return arr.sort().map((item) => ` ${prefix} ${item}${changed ? " (Updated)" : ""}`).join("\n") + "\n";
|
|
55498
55625
|
}
|
|
55499
55626
|
|
|
55627
|
+
// src/util/env/constants.ts
|
|
55628
|
+
var VERCEL_OIDC_TOKEN = "VERCEL_OIDC_TOKEN";
|
|
55629
|
+
|
|
55630
|
+
// src/util/env/update-oidc-token-contents.ts
|
|
55631
|
+
var CONTENTS_HEADER = "# Created by Vercel CLI";
|
|
55632
|
+
function updateOidcTokenContents(existing, token) {
|
|
55633
|
+
const assignment = `${VERCEL_OIDC_TOKEN}="${escapeValue(token)}"`;
|
|
55634
|
+
const oidcAssignment = new RegExp(
|
|
55635
|
+
`^(\\uFEFF?)[\\t ]*(?:export[\\t ]+)?${VERCEL_OIDC_TOKEN}[\\t ]*=[^\\r\\n]*(\\r\\n|\\n|\\r|$)`,
|
|
55636
|
+
"gm"
|
|
55637
|
+
);
|
|
55638
|
+
let tokenWritten = false;
|
|
55639
|
+
const withoutDuplicates = existing.replace(
|
|
55640
|
+
oidcAssignment,
|
|
55641
|
+
(_match, byteOrderMark, lineEnding2) => {
|
|
55642
|
+
if (token !== void 0 && !tokenWritten) {
|
|
55643
|
+
tokenWritten = true;
|
|
55644
|
+
return `${byteOrderMark}${assignment}${lineEnding2}`;
|
|
55645
|
+
}
|
|
55646
|
+
return byteOrderMark;
|
|
55647
|
+
}
|
|
55648
|
+
);
|
|
55649
|
+
if (token === void 0 || tokenWritten) {
|
|
55650
|
+
return withoutDuplicates;
|
|
55651
|
+
}
|
|
55652
|
+
const lineEnding = withoutDuplicates.match(/\r\n|\n|\r/)?.[0] ?? "\n";
|
|
55653
|
+
const hasTrailingLineEnding = /(?:\r\n|\n|\r)$/.test(withoutDuplicates);
|
|
55654
|
+
const hasTrailingBlankLine = /(?:\r\n|\n|\r){2}$/.test(withoutDuplicates);
|
|
55655
|
+
const separator = withoutDuplicates.length === 0 || hasTrailingBlankLine ? "" : hasTrailingLineEnding ? lineEnding : `${lineEnding}${lineEnding}`;
|
|
55656
|
+
return `${withoutDuplicates}${separator}${CONTENTS_HEADER}${lineEnding}${assignment}${lineEnding}`;
|
|
55657
|
+
}
|
|
55658
|
+
function escapeValue(value) {
|
|
55659
|
+
return value ? value.replace(/\n/g, "\\n").replace(/\r/g, "\\r") : "";
|
|
55660
|
+
}
|
|
55661
|
+
|
|
55500
55662
|
// src/commands/env/pull.ts
|
|
55501
55663
|
var import_error_utils2 = __toESM(require_dist(), 1);
|
|
55502
55664
|
var import_json_parse_better_errors = __toESM(require_json_parse_better_errors(), 1);
|
|
@@ -55565,9 +55727,9 @@ var EnvPullTelemetryClient = class extends TelemetryClient {
|
|
|
55565
55727
|
};
|
|
55566
55728
|
|
|
55567
55729
|
// src/util/env/env-target.ts
|
|
55568
|
-
var
|
|
55730
|
+
var import_constants2 = __toESM(require_dist2(), 1);
|
|
55569
55731
|
var import_title = __toESM(require_lib(), 1);
|
|
55570
|
-
var envTargetChoices =
|
|
55732
|
+
var envTargetChoices = import_constants2.PROJECT_ENV_TARGET.map((t) => ({
|
|
55571
55733
|
name: (0, import_title.default)(t),
|
|
55572
55734
|
value: t
|
|
55573
55735
|
}));
|
|
@@ -56411,7 +56573,7 @@ var VARIABLES_TO_IGNORE = [
|
|
|
56411
56573
|
"VERCEL_SPEED_INSIGHTS_ID",
|
|
56412
56574
|
"VERCEL_WEB_ANALYTICS_ID"
|
|
56413
56575
|
];
|
|
56414
|
-
async function pull(client, argv, source = "vercel-cli:env:pull") {
|
|
56576
|
+
async function pull(client, argv, source = "vercel-cli:env:pull", options = {}) {
|
|
56415
56577
|
const telemetryClient = new EnvPullTelemetryClient({
|
|
56416
56578
|
opts: {
|
|
56417
56579
|
store: client.telemetryEventStore
|
|
@@ -56492,17 +56654,18 @@ async function pull(client, argv, source = "vercel-cli:env:pull") {
|
|
|
56492
56654
|
gitBranch,
|
|
56493
56655
|
client.cwd,
|
|
56494
56656
|
source,
|
|
56495
|
-
deploymentId
|
|
56657
|
+
deploymentId,
|
|
56658
|
+
options
|
|
56496
56659
|
);
|
|
56497
56660
|
return 0;
|
|
56498
56661
|
}
|
|
56499
|
-
async function envPullCommandLogic(client, filename, skipConfirmation, environment, link, gitBranch, cwd, source, deploymentId) {
|
|
56662
|
+
async function envPullCommandLogic(client, filename, skipConfirmation, environment, link, gitBranch, cwd, source, deploymentId, { oidcTokenOnly = false } = {}) {
|
|
56500
56663
|
const fullPath = resolve3(cwd, filename);
|
|
56501
56664
|
const head = tryReadHeadSync(fullPath, Buffer.byteLength(CONTENTS_PREFIX));
|
|
56502
56665
|
const exists = typeof head !== "undefined";
|
|
56503
|
-
if (head === CONTENTS_PREFIX) {
|
|
56666
|
+
if (head === CONTENTS_PREFIX && !oidcTokenOnly) {
|
|
56504
56667
|
output_manager_default.log(`Overwriting existing ${import_chalk12.default.bold(filename)} file`);
|
|
56505
|
-
} else if (exists && !skipConfirmation) {
|
|
56668
|
+
} else if (exists && !skipConfirmation && !oidcTokenOnly) {
|
|
56506
56669
|
if (client.nonInteractive) {
|
|
56507
56670
|
outputActionRequired(client, {
|
|
56508
56671
|
status: "action_required",
|
|
@@ -56529,7 +56692,9 @@ async function envPullCommandLogic(client, filename, skipConfirmation, environme
|
|
|
56529
56692
|
}
|
|
56530
56693
|
}
|
|
56531
56694
|
const projectSlugLink = formatProject(link.org.slug, link.project.name);
|
|
56532
|
-
const downloadMessage =
|
|
56695
|
+
const downloadMessage = oidcTokenOnly ? `Downloading a fresh \`${import_chalk12.default.cyan(
|
|
56696
|
+
VERCEL_OIDC_TOKEN
|
|
56697
|
+
)}\` for ${projectSlugLink}` : gitBranch ? `Downloading \`${import_chalk12.default.cyan(
|
|
56533
56698
|
environment
|
|
56534
56699
|
)}\` environment variables for ${projectSlugLink} and any overrides for branch ${import_chalk12.default.cyan(
|
|
56535
56700
|
gitBranch
|
|
@@ -56546,26 +56711,48 @@ async function envPullCommandLogic(client, filename, skipConfirmation, environme
|
|
|
56546
56711
|
const records = deploymentId ? pullResult.buildEnv : pullResult.env;
|
|
56547
56712
|
let deltaString = "";
|
|
56548
56713
|
let oldEnv;
|
|
56549
|
-
if (exists) {
|
|
56714
|
+
if (exists && !oidcTokenOnly) {
|
|
56550
56715
|
oldEnv = await createEnvObject(fullPath);
|
|
56551
56716
|
if (oldEnv) {
|
|
56552
56717
|
const newEnv = (0, import_json_parse_better_errors.default)(JSON.stringify(records).replace(/\\"/g, ""));
|
|
56553
56718
|
deltaString = buildDeltaString(oldEnv, newEnv);
|
|
56554
56719
|
}
|
|
56555
56720
|
}
|
|
56556
|
-
|
|
56557
|
-
|
|
56721
|
+
let contents;
|
|
56722
|
+
let fileChanged = true;
|
|
56723
|
+
if (oidcTokenOnly) {
|
|
56724
|
+
const existingContents = exists ? await (0, import_fs_extra5.readFile)(fullPath, "utf8") : "";
|
|
56725
|
+
contents = updateOidcTokenContents(
|
|
56726
|
+
existingContents,
|
|
56727
|
+
records[VERCEL_OIDC_TOKEN] || void 0
|
|
56728
|
+
);
|
|
56729
|
+
fileChanged = contents !== existingContents;
|
|
56730
|
+
} else {
|
|
56731
|
+
contents = CONTENTS_PREFIX + Object.keys(records).sort().filter((key) => !VARIABLES_TO_IGNORE.includes(key)).map((key) => `${key}="${escapeValue2(records[key])}"`).join("\n") + "\n";
|
|
56732
|
+
}
|
|
56733
|
+
if (fileChanged) {
|
|
56734
|
+
await (0, import_fs_extra5.outputFile)(fullPath, contents, "utf8");
|
|
56735
|
+
}
|
|
56558
56736
|
if (deltaString) {
|
|
56559
56737
|
output_manager_default.print("\n" + deltaString);
|
|
56560
56738
|
} else if (oldEnv && exists) {
|
|
56561
56739
|
output_manager_default.log("No changes found.");
|
|
56562
56740
|
}
|
|
56563
56741
|
let isGitIgnoreUpdated = false;
|
|
56564
|
-
|
|
56742
|
+
const fileExistsAfterPull = exists || contents.length > 0;
|
|
56743
|
+
if (filename === ".env.local" && fileExistsAfterPull) {
|
|
56565
56744
|
const rootPath = link.repoRoot ?? cwd;
|
|
56566
56745
|
isGitIgnoreUpdated = await addToGitIgnore(rootPath, ".env*");
|
|
56567
56746
|
}
|
|
56747
|
+
if (!fileChanged && !isGitIgnoreUpdated) {
|
|
56748
|
+
output_manager_default.stopSpinner();
|
|
56749
|
+
return;
|
|
56750
|
+
}
|
|
56568
56751
|
output_manager_default.print("\n");
|
|
56752
|
+
if (!fileChanged) {
|
|
56753
|
+
printAlignedLabel("Updated", `.gitignore for ${filename}`, { gutter: "\u2713" });
|
|
56754
|
+
return;
|
|
56755
|
+
}
|
|
56569
56756
|
printAlignedLabel(
|
|
56570
56757
|
exists ? "Updated" : "Created",
|
|
56571
56758
|
`${filename} file${isGitIgnoreUpdated ? " and added it to .gitignore" : ""}`,
|
|
@@ -56620,7 +56807,7 @@ function getAcrValuesFromWWWAuthenticate(header) {
|
|
|
56620
56807
|
);
|
|
56621
56808
|
return match?.[1]?.replace(/\\(.)/g, "$1") ?? match?.[2];
|
|
56622
56809
|
}
|
|
56623
|
-
function
|
|
56810
|
+
function escapeValue2(value) {
|
|
56624
56811
|
return value ? value.replace(new RegExp("\n", "g"), "\\n").replace(new RegExp("\r", "g"), "\\r") : "";
|
|
56625
56812
|
}
|
|
56626
56813
|
|
|
@@ -56632,7 +56819,7 @@ import { join as join8, dirname } from "path";
|
|
|
56632
56819
|
|
|
56633
56820
|
// src/util/projects/detect-services.ts
|
|
56634
56821
|
var import_fs_detectors2 = __toESM(require_dist6(), 1);
|
|
56635
|
-
import { readFile as
|
|
56822
|
+
import { readFile as readFile4, writeFile as writeFile2 } from "fs/promises";
|
|
56636
56823
|
import { basename as basename2, join as join7 } from "path";
|
|
56637
56824
|
import { parse as tomlParse, stringify as tomlStringify } from "smol-toml";
|
|
56638
56825
|
|
|
@@ -56950,6 +57137,16 @@ var getExperimentalServicesCommonProperties = () => ({
|
|
|
56950
57137
|
minLength: 1,
|
|
56951
57138
|
maxLength: 2048
|
|
56952
57139
|
},
|
|
57140
|
+
command: {
|
|
57141
|
+
oneOf: [
|
|
57142
|
+
{ type: "string", minLength: 1, maxLength: 2048 },
|
|
57143
|
+
{
|
|
57144
|
+
type: "array",
|
|
57145
|
+
minItems: 1,
|
|
57146
|
+
items: { type: "string", minLength: 1, maxLength: 2048 }
|
|
57147
|
+
}
|
|
57148
|
+
]
|
|
57149
|
+
},
|
|
56953
57150
|
memory: {
|
|
56954
57151
|
type: "integer",
|
|
56955
57152
|
minimum: 128,
|
|
@@ -57112,17 +57309,17 @@ var experimentalServiceGroupsSchema = {
|
|
|
57112
57309
|
}
|
|
57113
57310
|
}
|
|
57114
57311
|
};
|
|
57115
|
-
var
|
|
57312
|
+
var servicesPathSchema = {
|
|
57116
57313
|
type: "string",
|
|
57117
57314
|
minLength: 1,
|
|
57118
57315
|
maxLength: 512
|
|
57119
57316
|
};
|
|
57120
|
-
var
|
|
57317
|
+
var servicesCommandSchema = {
|
|
57121
57318
|
type: "string",
|
|
57122
57319
|
minLength: 1,
|
|
57123
57320
|
maxLength: 2048
|
|
57124
57321
|
};
|
|
57125
|
-
var
|
|
57322
|
+
var servicesBindingSchema = {
|
|
57126
57323
|
type: "object",
|
|
57127
57324
|
additionalProperties: false,
|
|
57128
57325
|
required: ["type", "service", "format", "env"],
|
|
@@ -57141,17 +57338,17 @@ var experimentalServicesV2BindingSchema = {
|
|
|
57141
57338
|
}
|
|
57142
57339
|
}
|
|
57143
57340
|
};
|
|
57144
|
-
var
|
|
57341
|
+
var servicesBindingsSchema = {
|
|
57145
57342
|
type: "array",
|
|
57146
57343
|
maxItems: 100,
|
|
57147
|
-
items:
|
|
57344
|
+
items: servicesBindingSchema
|
|
57148
57345
|
};
|
|
57149
|
-
var
|
|
57346
|
+
var getServicesServiceConfigSchema = () => ({
|
|
57150
57347
|
type: "object",
|
|
57151
57348
|
additionalProperties: false,
|
|
57152
57349
|
required: ["root"],
|
|
57153
57350
|
properties: {
|
|
57154
|
-
root:
|
|
57351
|
+
root: servicesPathSchema,
|
|
57155
57352
|
framework: {
|
|
57156
57353
|
type: "string",
|
|
57157
57354
|
minLength: 1,
|
|
@@ -57162,13 +57359,16 @@ var getExperimentalServicesV2ServiceConfigSchema = () => ({
|
|
|
57162
57359
|
minLength: 1,
|
|
57163
57360
|
maxLength: 256
|
|
57164
57361
|
},
|
|
57165
|
-
entrypoint:
|
|
57166
|
-
|
|
57167
|
-
|
|
57168
|
-
|
|
57169
|
-
|
|
57170
|
-
|
|
57171
|
-
|
|
57362
|
+
entrypoint: servicesPathSchema,
|
|
57363
|
+
command: {
|
|
57364
|
+
oneOf: [{ type: "string" }, { type: "array", items: { type: "string" } }]
|
|
57365
|
+
},
|
|
57366
|
+
installCommand: servicesCommandSchema,
|
|
57367
|
+
buildCommand: servicesCommandSchema,
|
|
57368
|
+
devCommand: servicesCommandSchema,
|
|
57369
|
+
ignoreCommand: servicesCommandSchema,
|
|
57370
|
+
outputDirectory: servicesPathSchema,
|
|
57371
|
+
bindings: servicesBindingsSchema,
|
|
57172
57372
|
functions: getFunctionsSchema(),
|
|
57173
57373
|
headers: import_routing_utils.headersSchema,
|
|
57174
57374
|
redirects: import_routing_utils.redirectsSchema,
|
|
@@ -57178,13 +57378,13 @@ var getExperimentalServicesV2ServiceConfigSchema = () => ({
|
|
|
57178
57378
|
trailingSlash: import_routing_utils.trailingSlashSchema
|
|
57179
57379
|
}
|
|
57180
57380
|
});
|
|
57181
|
-
var
|
|
57381
|
+
var getServicesSchema = () => ({
|
|
57182
57382
|
type: "object",
|
|
57183
57383
|
propertyNames: {
|
|
57184
57384
|
pattern: "^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",
|
|
57185
57385
|
maxLength: 64
|
|
57186
57386
|
},
|
|
57187
|
-
additionalProperties:
|
|
57387
|
+
additionalProperties: getServicesServiceConfigSchema()
|
|
57188
57388
|
});
|
|
57189
57389
|
function buildVercelConfigSchema() {
|
|
57190
57390
|
return {
|
|
@@ -57206,7 +57406,8 @@ function buildVercelConfigSchema() {
|
|
|
57206
57406
|
bunVersion: { type: "string" },
|
|
57207
57407
|
experimentalServices: getExperimentalServicesSchema(),
|
|
57208
57408
|
experimentalServiceGroups: experimentalServiceGroupsSchema,
|
|
57209
|
-
|
|
57409
|
+
services: getServicesSchema(),
|
|
57410
|
+
experimentalServicesV2: getServicesSchema()
|
|
57210
57411
|
}
|
|
57211
57412
|
};
|
|
57212
57413
|
}
|
|
@@ -57258,20 +57459,30 @@ function validateConfig(config) {
|
|
|
57258
57459
|
message: "The `experimentalServiceGroups` property requires `experimentalServices` to be defined. Service groups reference services by name."
|
|
57259
57460
|
});
|
|
57260
57461
|
}
|
|
57261
|
-
const
|
|
57262
|
-
|
|
57462
|
+
const hasServices = config.services != null;
|
|
57463
|
+
const hasExperimentalServicesV2 = config.experimentalServicesV2 != null;
|
|
57464
|
+
if (hasServices && hasExperimentalServicesV2) {
|
|
57465
|
+
return new NowBuildError({
|
|
57466
|
+
code: "SERVICES_AND_EXPERIMENTAL_SERVICES_V2",
|
|
57467
|
+
message: "The `services` property cannot be used in conjunction with its deprecated alias `experimentalServicesV2`. Please use only `services`."
|
|
57468
|
+
});
|
|
57469
|
+
}
|
|
57470
|
+
const servicesConfig = config.services ?? config.experimentalServicesV2;
|
|
57471
|
+
const servicesConfigKey = hasServices ? "services" : "experimentalServicesV2";
|
|
57472
|
+
const servicesErrorCodePrefix = hasServices ? "SERVICES" : "EXPERIMENTAL_SERVICES_V2";
|
|
57473
|
+
if (servicesConfig && hasExperimentalServices) {
|
|
57263
57474
|
return new NowBuildError({
|
|
57264
|
-
code:
|
|
57265
|
-
message:
|
|
57475
|
+
code: `${servicesErrorCodePrefix}_AND_EXPERIMENTAL_SERVICES`,
|
|
57476
|
+
message: `The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`experimentalServices\` property. Please use only one services configuration.`
|
|
57266
57477
|
});
|
|
57267
57478
|
}
|
|
57268
|
-
if (
|
|
57479
|
+
if (servicesConfig && config.builds) {
|
|
57269
57480
|
return new NowBuildError({
|
|
57270
|
-
code:
|
|
57271
|
-
message:
|
|
57481
|
+
code: `${servicesErrorCodePrefix}_AND_BUILDS`,
|
|
57482
|
+
message: `The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`builds\` property. Please remove one of them.`
|
|
57272
57483
|
});
|
|
57273
57484
|
}
|
|
57274
|
-
if (
|
|
57485
|
+
if (servicesConfig) {
|
|
57275
57486
|
const ambiguousTopLevel = [];
|
|
57276
57487
|
if (config.functions != null) {
|
|
57277
57488
|
ambiguousTopLevel.push("functions");
|
|
@@ -57298,21 +57509,19 @@ function validateConfig(config) {
|
|
|
57298
57509
|
const count = ambiguousTopLevel.length;
|
|
57299
57510
|
const fields = ambiguousTopLevel.map((field) => `\`${field}\``).join(", ");
|
|
57300
57511
|
return new NowBuildError({
|
|
57301
|
-
code:
|
|
57302
|
-
message: `The top-level ${count > 1 ? "properties" : "property"} ${fields} cannot be used with \`
|
|
57512
|
+
code: `${servicesErrorCodePrefix}_AND_TOP_LEVEL_BUILD_SETTINGS`,
|
|
57513
|
+
message: `The top-level ${count > 1 ? "properties" : "property"} ${fields} cannot be used with \`${servicesConfigKey}\` because the owning service is ambiguous. Move ${count > 1 ? "them" : "it"} under the relevant service in \`${servicesConfigKey}\`.`
|
|
57303
57514
|
});
|
|
57304
57515
|
}
|
|
57305
57516
|
}
|
|
57306
|
-
if (
|
|
57307
|
-
const serviceNames = new Set(Object.keys(
|
|
57308
|
-
for (const [serviceName, serviceConfig] of Object.entries(
|
|
57309
|
-
config.experimentalServicesV2
|
|
57310
|
-
)) {
|
|
57517
|
+
if (servicesConfig) {
|
|
57518
|
+
const serviceNames = new Set(Object.keys(servicesConfig));
|
|
57519
|
+
for (const [serviceName, serviceConfig] of Object.entries(servicesConfig)) {
|
|
57311
57520
|
for (const binding of serviceConfig.bindings ?? []) {
|
|
57312
57521
|
if (!serviceNames.has(binding.service)) {
|
|
57313
57522
|
return new NowBuildError({
|
|
57314
|
-
code:
|
|
57315
|
-
message: `Service "${serviceName}" declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`
|
|
57523
|
+
code: `${servicesErrorCodePrefix}_BINDING_UNKNOWN_SERVICE`,
|
|
57524
|
+
message: `Service "${serviceName}" declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`${servicesConfigKey}\` or fix the binding.`
|
|
57316
57525
|
});
|
|
57317
57526
|
}
|
|
57318
57527
|
}
|
|
@@ -57368,7 +57577,7 @@ async function hasExperimentalServicesConfig(cwd) {
|
|
|
57368
57577
|
);
|
|
57369
57578
|
if (!config || config instanceof Error)
|
|
57370
57579
|
return false;
|
|
57371
|
-
return config.experimentalServices != null && typeof config.experimentalServices === "object" || config.experimentalServicesV2 != null && typeof config.experimentalServicesV2 === "object";
|
|
57580
|
+
return config.experimentalServices != null && typeof config.experimentalServices === "object" || config.services != null && typeof config.services === "object" || config.experimentalServicesV2 != null && typeof config.experimentalServicesV2 === "object";
|
|
57372
57581
|
} catch {
|
|
57373
57582
|
return false;
|
|
57374
57583
|
}
|
|
@@ -57446,7 +57655,7 @@ async function prepareTomlServicesConfigWrite(configPath, config) {
|
|
|
57446
57655
|
const patchKeys = Object.keys(patch);
|
|
57447
57656
|
let existingContent;
|
|
57448
57657
|
try {
|
|
57449
|
-
existingContent = await
|
|
57658
|
+
existingContent = await readFile4(configPath, "utf8");
|
|
57450
57659
|
} catch {
|
|
57451
57660
|
existingContent = "";
|
|
57452
57661
|
}
|
|
@@ -57521,7 +57730,7 @@ async function resolveProjectCwd(cwd) {
|
|
|
57521
57730
|
}
|
|
57522
57731
|
|
|
57523
57732
|
// src/util/projects/link.ts
|
|
57524
|
-
var
|
|
57733
|
+
var readFile5 = promisify(fs4.readFile);
|
|
57525
57734
|
var writeFile3 = promisify(fs4.writeFile);
|
|
57526
57735
|
var VERCEL_DIR = ".vercel";
|
|
57527
57736
|
var VERCEL_DIR_FALLBACK = ".now";
|
|
@@ -57639,7 +57848,7 @@ async function getProjectLinkFromRepoLink(client, path, projectName, projectName
|
|
|
57639
57848
|
}
|
|
57640
57849
|
async function getLinkFromDir(dir) {
|
|
57641
57850
|
try {
|
|
57642
|
-
const json = await
|
|
57851
|
+
const json = await readFile5(join9(dir, VERCEL_DIR_PROJECT), "utf8");
|
|
57643
57852
|
const ajv2 = new import_ajv2.default();
|
|
57644
57853
|
const link = JSON.parse(json);
|
|
57645
57854
|
if (!ajv2.validate(linkSchema, link)) {
|
|
@@ -58046,7 +58255,7 @@ async function compileVercelConfig(workPath) {
|
|
|
58046
58255
|
}
|
|
58047
58256
|
if (hasVercelToml) {
|
|
58048
58257
|
try {
|
|
58049
|
-
const tomlContent = await
|
|
58258
|
+
const tomlContent = await readFile6(vercelTomlPath, "utf8");
|
|
58050
58259
|
const config = tomlParse2(tomlContent);
|
|
58051
58260
|
const normalizedConfig = normalizeConfig(config);
|
|
58052
58261
|
await mkdir(vercelDir, { recursive: true });
|
|
@@ -58271,6 +58480,7 @@ export {
|
|
|
58271
58480
|
pullEnvRecords,
|
|
58272
58481
|
parseEnv,
|
|
58273
58482
|
createEnvObject,
|
|
58483
|
+
VERCEL_OIDC_TOKEN,
|
|
58274
58484
|
require_json_parse_better_errors,
|
|
58275
58485
|
formatProject,
|
|
58276
58486
|
STANDARD_ENVIRONMENTS,
|