vercel 54.14.5 → 54.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/chunks/{add-5Z2AAQMM.js → add-BHCMFK52.js} +5 -5
  2. package/dist/chunks/{chunk-R5MIXAJF.js → chunk-4GQBO7KU.js} +2 -2
  3. package/dist/chunks/{chunk-6ABEFMPX.js → chunk-4OEXX4CB.js} +1 -1
  4. package/dist/chunks/{chunk-25XEQWUS.js → chunk-4TL5EF3A.js} +1 -1
  5. package/dist/chunks/{chunk-IXTKPQYW.js → chunk-5X6ILMYI.js} +4 -4
  6. package/dist/chunks/{chunk-6R3YPU76.js → chunk-AQWK7XXE.js} +382 -7
  7. package/dist/chunks/{chunk-KSSRTKN4.js → chunk-B5DP7FOH.js} +4 -4
  8. package/dist/chunks/{chunk-ZR4XADWC.js → chunk-CBMMVXLH.js} +2 -2
  9. package/dist/chunks/{chunk-EBIX223X.js → chunk-CQ24PL4F.js} +1 -1
  10. package/dist/chunks/{chunk-ETVOM3IR.js → chunk-D7U6YBVT.js} +1 -1
  11. package/dist/chunks/{chunk-2GOVUIMY.js → chunk-JNVCGTF2.js} +2 -2
  12. package/dist/chunks/{chunk-YIAUEFUY.js → chunk-MABHXDYV.js} +210 -12
  13. package/dist/chunks/{chunk-45S2Y3TD.js → chunk-OEFNWW5M.js} +1 -1
  14. package/dist/chunks/{chunk-JLLN34XF.js → chunk-OOGTHUXU.js} +4 -4
  15. package/dist/chunks/{chunk-LJ5WXXG6.js → chunk-QH7WYDEP.js} +11 -0
  16. package/dist/chunks/{chunk-2N7NBUQX.js → chunk-RWRYDAUG.js} +206 -31
  17. package/dist/chunks/{chunk-PXJA4KXE.js → chunk-TAUAS27Y.js} +3 -3
  18. package/dist/chunks/{chunk-MOVGWTDQ.js → chunk-TDFUNPL7.js} +6 -5
  19. package/dist/chunks/{chunk-PSG6ZBGQ.js → chunk-UEPXHHDN.js} +1 -1
  20. package/dist/chunks/{chunk-6H2YVMJJ.js → chunk-UJZ4RUU6.js} +1 -1
  21. package/dist/chunks/{chunk-X23JL3ZL.js → chunk-UYC2Q5YZ.js} +9 -4
  22. package/dist/chunks/{compile-vercel-config-UMUHH55E.js → compile-vercel-config-LUMMHFTD.js} +1 -1
  23. package/dist/chunks/{delete-NO2U3UGV.js → delete-X6VOLLCP.js} +3 -3
  24. package/dist/chunks/{disable-AGDDHVKZ.js → disable-LFH5IOCZ.js} +3 -3
  25. package/dist/chunks/{discard-Q5HML52L.js → discard-EVD33PAE.js} +3 -3
  26. package/dist/chunks/{edit-HSHJAKHM.js → edit-FL3SRS2I.js} +7 -7
  27. package/dist/chunks/{enable-YMJAXOGA.js → enable-HTU7LQK5.js} +3 -3
  28. package/dist/chunks/{export-RCACOTPE.js → export-R222C6IH.js} +3 -3
  29. package/dist/chunks/{inspect-OJHOQHD2.js → inspect-YYTAQP3A.js} +4 -4
  30. package/dist/chunks/{list-LLUDMAWA.js → list-AOJMWKA7.js} +4 -4
  31. package/dist/chunks/{list-R7V2P6TM.js → list-SWJFJSEE.js} +2 -2
  32. package/dist/chunks/{ls-KAI6V7SU.js → ls-H7KDHFK6.js} +5 -5
  33. package/dist/chunks/{publish-KCYVRDAT.js → publish-O5VKBFJ6.js} +3 -3
  34. package/dist/chunks/{query-MBJLAQRX.js → query-7UDJEOOR.js} +2 -2
  35. package/dist/chunks/{reorder-C5BJWFJM.js → reorder-ZPI6Q7DQ.js} +3 -3
  36. package/dist/chunks/{restore-F63NO7XP.js → restore-7FNMEG4A.js} +3 -3
  37. package/dist/chunks/{rm-HT7YO3JX.js → rm-U37YHRNF.js} +5 -5
  38. package/dist/chunks/{rule-inspect-IHEUI5JT.js → rule-inspect-CVI3TQHN.js} +5 -5
  39. package/dist/chunks/{rules-ZUBTVSNC.js → rules-ZTL4JCZO.js} +7 -7
  40. package/dist/chunks/{schema-VAQSZY2H.js → schema-LZ6VDRGM.js} +2 -2
  41. package/dist/chunks/{update-BS5FBLIP.js → update-O6FSP627.js} +5 -5
  42. package/dist/commands/build/index.js +115 -83
  43. package/dist/commands/deploy/index.js +11 -11
  44. package/dist/commands/dev/index.js +56 -14
  45. package/dist/commands/env/index.js +4 -4
  46. package/dist/commands/link/index.js +8 -8
  47. package/dist/commands/list/index.js +3 -3
  48. package/dist/commands-bulk.js +4868 -1596
  49. package/dist/index.js +8 -8
  50. package/dist/version.mjs +1 -1
  51. package/package.json +20 -20
@@ -20940,6 +20940,7 @@ var require_superstatic = __commonJS({
20940
20940
  var superstatic_exports = {};
20941
20941
  __export2(superstatic_exports, {
20942
20942
  collectHasSegments: () => collectHasSegments,
20943
+ compilePathToRegexpTemplate: () => compilePathToRegexpTemplate2,
20943
20944
  convertCleanUrls: () => convertCleanUrls,
20944
20945
  convertHeaders: () => convertHeaders,
20945
20946
  convertRedirects: () => convertRedirects,
@@ -21083,6 +21084,22 @@ var require_superstatic = __commonJS({
21083
21084
  }
21084
21085
  route = { src, destination };
21085
21086
  }
21087
+ if (r.transforms) {
21088
+ route.transforms = r.transforms.map((transform) => {
21089
+ if (transform.type !== "request.path") {
21090
+ return { ...transform };
21091
+ }
21092
+ return {
21093
+ ...transform,
21094
+ args: compilePathToRegexpTemplateFromSegments(
21095
+ transform.args,
21096
+ segments,
21097
+ hasSegments,
21098
+ transform.env
21099
+ )
21100
+ };
21101
+ });
21102
+ }
21086
21103
  if (typeof r.env !== "undefined") {
21087
21104
  route.env = r.env;
21088
21105
  }
@@ -21223,6 +21240,81 @@ var require_superstatic = __commonJS({
21223
21240
  }
21224
21241
  var escapeSegment = (str, segmentName) => str.replace(new RegExp(`:${segmentName}`, "g"), `__ESC_COLON_${segmentName}`);
21225
21242
  var unescapeSegments = (str) => str.replace(/__ESC_COLON_/gi, ":");
21243
+ var pathTemplateSegmentNameRegex = /^([a-zA-Z_][a-zA-Z0-9_]*)/;
21244
+ function isEscaped(value, index) {
21245
+ let backslashCount = 0;
21246
+ for (let i = index - 1; i >= 0 && value[i] === "\\"; i--) {
21247
+ backslashCount++;
21248
+ }
21249
+ return backslashCount % 2 === 1;
21250
+ }
21251
+ function collectPathTemplateSegments(template) {
21252
+ const segments = [];
21253
+ for (let i = 0; i < template.length; i++) {
21254
+ if (template[i] !== ":" || isEscaped(template, i)) {
21255
+ continue;
21256
+ }
21257
+ const match = template.slice(i + 1).match(pathTemplateSegmentNameRegex);
21258
+ if (match) {
21259
+ segments.push(match[1]);
21260
+ i += match[1].length;
21261
+ }
21262
+ }
21263
+ return segments;
21264
+ }
21265
+ function collectNamedDollarReferences(template) {
21266
+ const references = [];
21267
+ for (let i = 0; i < template.length; i++) {
21268
+ if (template[i] !== "$" || isEscaped(template, i)) {
21269
+ continue;
21270
+ }
21271
+ const remainder = template.slice(i + 1);
21272
+ const bracedMatch = remainder.match(/^\{([a-zA-Z_][a-zA-Z0-9_]*)\}/);
21273
+ const unbracedMatch = remainder.match(pathTemplateSegmentNameRegex);
21274
+ const name = bracedMatch?.[1] || unbracedMatch?.[1];
21275
+ if (name) {
21276
+ references.push(name);
21277
+ }
21278
+ }
21279
+ return references;
21280
+ }
21281
+ function compilePathToRegexpTemplateFromSegments(template, segments, hasItemSegments, env = []) {
21282
+ const indexes = {};
21283
+ segments.forEach((name, index) => {
21284
+ indexes[name] = toSegmentDest(index);
21285
+ });
21286
+ hasItemSegments.forEach((name) => {
21287
+ indexes[name] = `$${name}`;
21288
+ });
21289
+ for (const name of collectPathTemplateSegments(template)) {
21290
+ if (!(name in indexes)) {
21291
+ throw new Error(
21292
+ `Path template references parameter ":${name}" that is not present in the source or has conditions.`
21293
+ );
21294
+ }
21295
+ }
21296
+ const routeParameters = /* @__PURE__ */ new Set([
21297
+ ...segments.filter((name) => name !== UN_NAMED_SEGMENT),
21298
+ ...hasItemSegments
21299
+ ]);
21300
+ for (const name of collectNamedDollarReferences(template)) {
21301
+ if (routeParameters.has(name) && !env.includes(name)) {
21302
+ throw new Error(
21303
+ `Path template references route parameter "${name}" as \`$${name}\`. Use \`:${name}\` path-to-regexp syntax in high-level rewrites, or list "${name}" in the transform env allowlist if it is an environment variable.`
21304
+ );
21305
+ }
21306
+ }
21307
+ return safelyCompile(template, indexes, true);
21308
+ }
21309
+ function compilePathToRegexpTemplate2(source, template, has, env) {
21310
+ const { segments } = sourceToRegex2(source);
21311
+ return compilePathToRegexpTemplateFromSegments(
21312
+ template,
21313
+ segments,
21314
+ collectHasSegments(has),
21315
+ env
21316
+ );
21317
+ }
21226
21318
  function replaceSegments(segments, hasItemSegments, destination, isRedirect, internalParamNames) {
21227
21319
  const namedSegments = segments.filter((name) => name !== UN_NAMED_SEGMENT);
21228
21320
  const canNeedReplacing = destination.includes(":") && namedSegments.length > 0 || hasItemSegments.length > 0 || !isRedirect;
@@ -21624,7 +21716,8 @@ var require_schemas = __commonJS({
21624
21716
  redirectsSchema: () => redirectsSchema2,
21625
21717
  rewritesSchema: () => rewritesSchema2,
21626
21718
  routesSchema: () => routesSchema2,
21627
- trailingSlashSchema: () => trailingSlashSchema2
21719
+ trailingSlashSchema: () => trailingSlashSchema2,
21720
+ transformsSchema: () => transformsSchema
21628
21721
  });
21629
21722
  module.exports = __toCommonJS2(schemas_exports);
21630
21723
  var mitigateSchema = {
@@ -21789,18 +21882,23 @@ var require_schemas = __commonJS({
21789
21882
  }
21790
21883
  };
21791
21884
  var transformsSchema = {
21792
- description: "A list of transform rules to adjust the query parameters of a request or HTTP headers of request or response",
21885
+ description: "A list of transform rules to adjust a request path, request query parameters, or request/response headers",
21793
21886
  type: "array",
21794
21887
  minItems: 1,
21795
21888
  items: {
21796
21889
  type: "object",
21797
21890
  additionalProperties: false,
21798
- required: ["type", "op", "target"],
21891
+ required: ["type", "op"],
21799
21892
  properties: {
21800
21893
  type: {
21801
21894
  description: "The scope of the transform to apply",
21802
21895
  type: "string",
21803
- enum: ["request.headers", "request.query", "response.headers"]
21896
+ enum: [
21897
+ "request.headers",
21898
+ "request.query",
21899
+ "response.headers",
21900
+ "request.path"
21901
+ ]
21804
21902
  },
21805
21903
  op: {
21806
21904
  description: "The operation to perform on the target",
@@ -21986,10 +22084,90 @@ var require_schemas = __commonJS({
21986
22084
  }
21987
22085
  }
21988
22086
  }
22087
+ },
22088
+ {
22089
+ if: {
22090
+ required: ["type"],
22091
+ properties: {
22092
+ type: {
22093
+ enum: ["request.headers", "request.query", "response.headers"]
22094
+ }
22095
+ }
22096
+ },
22097
+ // biome-ignore lint/suspicious/noThenProperty: JSON Schema if/then keyword
22098
+ then: {
22099
+ required: ["target"]
22100
+ }
22101
+ },
22102
+ {
22103
+ if: {
22104
+ required: ["type"],
22105
+ properties: {
22106
+ type: {
22107
+ enum: ["request.path"]
22108
+ }
22109
+ }
22110
+ },
22111
+ // biome-ignore lint/suspicious/noThenProperty: JSON Schema if/then keyword
22112
+ then: {
22113
+ required: ["args"],
22114
+ not: {
22115
+ required: ["target"]
22116
+ },
22117
+ properties: {
22118
+ op: {
22119
+ enum: ["set"]
22120
+ },
22121
+ args: {
22122
+ description: "The runtime-visible request path. Must be an origin-form path without query or fragment.",
22123
+ type: "string",
22124
+ maxLength: 2048,
22125
+ pattern: "^/(?!/)(?!.*[?#\\s\\x00-\\x1F\\x7F]).*$"
22126
+ }
22127
+ }
22128
+ }
21989
22129
  }
21990
22130
  ]
21991
22131
  }
21992
22132
  };
22133
+ var rewriteTransformsSchema = {
22134
+ description: "A list of request path transforms using path-to-regexp parameters.",
22135
+ type: "array",
22136
+ minItems: 1,
22137
+ items: {
22138
+ type: "object",
22139
+ additionalProperties: false,
22140
+ required: ["type", "op", "args"],
22141
+ properties: {
22142
+ type: {
22143
+ description: "The request path to expose to the target runtime",
22144
+ type: "string",
22145
+ enum: ["request.path"]
22146
+ },
22147
+ op: {
22148
+ description: "Replace the runtime-visible request path",
22149
+ type: "string",
22150
+ enum: ["set"]
22151
+ },
22152
+ args: {
22153
+ description: "An origin-form request path. Route parameters use path-to-regexp syntax such as `/:path*`.",
22154
+ type: "string",
22155
+ maxLength: 2048,
22156
+ pattern: "^/(?!/)(?!.*[?#\\s\\x00-\\x1F\\x7F]).*$"
22157
+ },
22158
+ env: {
22159
+ description: "An array of environment variable names that should be replaced at runtime in the args value",
22160
+ type: "array",
22161
+ minItems: 1,
22162
+ maxItems: 64,
22163
+ items: {
22164
+ type: "string",
22165
+ maxLength: 256
22166
+ }
22167
+ }
22168
+ }
22169
+ }
22170
+ };
21993
22171
  var routesSchema2 = {
21994
22172
  type: "array",
21995
22173
  description: "A list of routes objects used to rewrite paths to point towards other internal or external paths",
@@ -22169,6 +22347,7 @@ var require_schemas = __commonJS({
22169
22347
  description: "An absolute pathname to an existing resource, an external URL, or a service-targeted destination object.",
22170
22348
  anyOf: [{ type: "string", maxLength: 4096 }, serviceDestinationSchema]
22171
22349
  },
22350
+ transforms: rewriteTransformsSchema,
22172
22351
  has: hasSchema,
22173
22352
  missing: hasSchema,
22174
22353
  statusCode: {
@@ -22337,6 +22516,7 @@ var require_dist5 = __commonJS({
22337
22516
  var src_exports = {};
22338
22517
  __export2(src_exports, {
22339
22518
  appendRoutesToPhase: () => import_append.appendRoutesToPhase,
22519
+ compilePathToRegexpTemplate: () => import_superstatic2.compilePathToRegexpTemplate,
22340
22520
  getCleanUrls: () => import_superstatic2.getCleanUrls,
22341
22521
  getOwnershipGuard: () => import_service_route_ownership.getOwnershipGuard,
22342
22522
  getTransformedRoutes: () => getTransformedRoutes,
@@ -22510,7 +22690,8 @@ var require_dist5 = __commonJS({
22510
22690
  function checkPatternSyntax(type, index, {
22511
22691
  source,
22512
22692
  destination,
22513
- has
22693
+ has,
22694
+ transforms
22514
22695
  }) {
22515
22696
  let sourceSegments = /* @__PURE__ */ new Set();
22516
22697
  const destinationSegments = /* @__PURE__ */ new Set();
@@ -22550,6 +22731,19 @@ var require_dist5 = __commonJS({
22550
22731
  }
22551
22732
  }
22552
22733
  }
22734
+ for (const transform of transforms || []) {
22735
+ if (transform.type !== "request.path") {
22736
+ continue;
22737
+ }
22738
+ try {
22739
+ (0, import_superstatic.compilePathToRegexpTemplate)(source, transform.args, has, transform.env);
22740
+ } catch (error) {
22741
+ return {
22742
+ message: `${type} at index ${index} has an invalid \`request.path\` transform: ${error instanceof Error ? error.message : String(error)}`,
22743
+ link: "https://vercel.link/invalid-route-destination-segment"
22744
+ };
22745
+ }
22746
+ }
22553
22747
  return null;
22554
22748
  }
22555
22749
  function checkRedirect(r, index) {
@@ -22841,7 +23035,8 @@ var require_utils3 = __commonJS({
22841
23035
  isFrontendFramework: () => isFrontendFramework,
22842
23036
  isRouteOwningBuilder: () => isRouteOwningBuilder2,
22843
23037
  isStaticBuild: () => isStaticBuild2,
22844
- readVercelConfig: () => readVercelConfig
23038
+ readVercelConfig: () => readVercelConfig,
23039
+ stripTrailingSlash: () => stripTrailingSlash
22845
23040
  });
22846
23041
  module.exports = __toCommonJS2(utils_exports);
22847
23042
  var import_framework_helpers = __require("@vercel/build-utils/dist/framework-helpers");
@@ -22851,6 +23046,10 @@ var require_utils3 = __commonJS({
22851
23046
  var DETECTION_FRAMEWORKS = import_frameworks2.frameworkList.filter(
22852
23047
  (framework) => !framework.experimental || framework.runtimeFramework
22853
23048
  );
23049
+ function stripTrailingSlash(p) {
23050
+ const stripped = p.replace(/\/+$/, "");
23051
+ return stripped === "" ? "." : stripped;
23052
+ }
22854
23053
  async function hasFile(fs5, filePath) {
22855
23054
  try {
22856
23055
  return await fs5.isFile(filePath);
@@ -23327,7 +23526,7 @@ var require_resolve2 = __commonJS({
23327
23526
  if (!root) {
23328
23527
  return { fs: fs5 };
23329
23528
  }
23330
- const normalizedRoot = import_path12.posix.normalize(root);
23529
+ const normalizedRoot = (0, import_utils4.stripTrailingSlash)(import_path12.posix.normalize(root));
23331
23530
  if (!await fs5.hasPath(normalizedRoot)) {
23332
23531
  return {
23333
23532
  fs: fs5,
@@ -24251,9 +24450,8 @@ var require_resolve_v2 = __commonJS({
24251
24450
  return null;
24252
24451
  }
24253
24452
  async function resolveConfiguredServiceV22(name, config, fs5) {
24254
- const root = config.root;
24255
- const normalizedRoot = import_path12.posix.normalize(root);
24256
- const serviceFsResult = normalizedRoot === "." ? { fs: fs5 } : await (0, import_resolve.getServiceFs)(fs5, name, root);
24453
+ const normalizedRoot = (0, import_utils4.stripTrailingSlash)(import_path12.posix.normalize(config.root));
24454
+ const serviceFsResult = normalizedRoot === "." ? { fs: fs5 } : await (0, import_resolve.getServiceFs)(fs5, name, normalizedRoot);
24257
24455
  if (serviceFsResult.error) {
24258
24456
  return { error: serviceFsResult.error };
24259
24457
  }
@@ -24343,7 +24541,7 @@ var require_resolve_v2 = __commonJS({
24343
24541
  service: {
24344
24542
  schema: "experimentalServicesV2",
24345
24543
  name,
24346
- root,
24544
+ root: normalizedRoot,
24347
24545
  framework,
24348
24546
  runtime,
24349
24547
  entrypoint: entrypointFile,
@@ -37408,7 +37606,7 @@ var require_package = __commonJS({
37408
37606
  "../client/package.json"(exports, module) {
37409
37607
  module.exports = {
37410
37608
  name: "@vercel/client",
37411
- version: "17.5.16",
37609
+ version: "17.5.18",
37412
37610
  main: "dist/index.js",
37413
37611
  typings: "dist/index.d.ts",
37414
37612
  homepage: "https://vercel.com",
@@ -6,7 +6,7 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  require_lib
9
- } from "./chunk-YIAUEFUY.js";
9
+ } from "./chunk-MABHXDYV.js";
10
10
  import {
11
11
  isNativeBinaryInstall
12
12
  } from "./chunk-HIYWSGI7.js";
@@ -7,17 +7,17 @@ const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  getUpdateCommandInfo,
9
9
  isGlobal
10
- } from "./chunk-45S2Y3TD.js";
10
+ } from "./chunk-OEFNWW5M.js";
11
11
  import {
12
12
  getGlobalPathConfig,
13
13
  progress,
14
14
  writeToConfigFile
15
- } from "./chunk-ZR4XADWC.js";
15
+ } from "./chunk-CBMMVXLH.js";
16
16
  import {
17
17
  apiCommand,
18
18
  listSubcommand2 as listSubcommand,
19
19
  loginCommand
20
- } from "./chunk-6R3YPU76.js";
20
+ } from "./chunk-AQWK7XXE.js";
21
21
  import {
22
22
  require_semver
23
23
  } from "./chunk-IB5L4LKZ.js";
@@ -26,7 +26,7 @@ import {
26
26
  } from "./chunk-AWD3IGXU.js";
27
27
  import {
28
28
  login
29
- } from "./chunk-YIAUEFUY.js";
29
+ } from "./chunk-MABHXDYV.js";
30
30
  import {
31
31
  TelemetryClient,
32
32
  isNativeBinaryInstall
@@ -22,7 +22,10 @@ var AGENT_REASON = {
22
22
  NOT_FOUND: "not_found",
23
23
  PROJECT_NOT_FOUND: "project_not_found",
24
24
  MISSING_SCOPE: "missing_scope",
25
+ SCOPE_NOT_ACCESSIBLE: "scope_not_accessible",
25
26
  API_ERROR: "api_error",
27
+ // Flags
28
+ SEGMENT_IN_USE: "segment_in_use",
26
29
  // Env
27
30
  MISSING_REQUIREMENTS: "missing_requirements",
28
31
  MISSING_NAME: "missing_name",
@@ -46,6 +49,14 @@ var AGENT_REASON = {
46
49
  INVALID_DNS_TYPE: "invalid_dns_type",
47
50
  DNS_ADD_FAILED: "dns_add_failed",
48
51
  INVALID_DOMAIN: "invalid_domain",
52
+ CONFIGURED_CORRECTLY: "configured_correctly",
53
+ VERIFICATION_NEEDED: "verification_needed",
54
+ INVALID_CONFIGURATION: "invalid_configuration",
55
+ DNS_CHANGE_REQUIRED: "dns_change_required",
56
+ DNS_CHANGE_RECOMMENDED: "dns_change_recommended",
57
+ DNSSEC_NEEDS_TO_BE_DISABLED: "dnssec_needs_to_be_disabled",
58
+ PROJECT_ATTACHMENT_RECOMMENDED: "project_attachment_recommended",
59
+ PROJECT_DOMAIN_MISSING: "project_domain_missing",
49
60
  /** User must accept marketplace integration terms in the browser before install can continue. */
50
61
  INTEGRATION_TERMS_ACCEPTANCE_REQUIRED: "integration_terms_acceptance_required",
51
62
  /** Integration uninstall blocked because team-scoped resources still exist. */