@vercel/static-build 2.9.39 → 2.10.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 (2) hide show
  1. package/dist/index.js +79 -13
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -19799,14 +19799,23 @@ var require_superstatic = __commonJS({
19799
19799
  normalizeHasKeys(r.has);
19800
19800
  normalizeHasKeys(r.missing);
19801
19801
  try {
19802
- const dest = replaceSegments(
19802
+ const interpolate = (value) => replaceSegments(
19803
19803
  segments,
19804
19804
  hasSegments,
19805
- r.destination,
19805
+ value,
19806
19806
  false,
19807
19807
  internalParamNames
19808
19808
  );
19809
- const route = { src, dest, check: true };
19809
+ let route;
19810
+ if (typeof r.destination === "string") {
19811
+ route = { src, dest: interpolate(r.destination), check: true };
19812
+ } else {
19813
+ const destination = { ...r.destination };
19814
+ if (typeof destination.path === "string") {
19815
+ destination.path = interpolate(destination.path);
19816
+ }
19817
+ route = { src, destination };
19818
+ }
19810
19819
  if (typeof r.env !== "undefined") {
19811
19820
  route.env = r.env;
19812
19821
  }
@@ -20364,6 +20373,32 @@ var require_schemas = __commonJS({
20364
20373
  }
20365
20374
  }
20366
20375
  };
20376
+ var serviceNameSchema = {
20377
+ description: "A service name identifier.",
20378
+ type: "string",
20379
+ minLength: 1,
20380
+ maxLength: 64,
20381
+ pattern: "^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$"
20382
+ };
20383
+ var serviceDestinationSchema = {
20384
+ description: "A service-targeted destination that delegates routing into a named service from `services`.",
20385
+ type: "object",
20386
+ additionalProperties: false,
20387
+ required: ["type", "service"],
20388
+ properties: {
20389
+ type: {
20390
+ description: "Discriminator. Must be `service`.",
20391
+ type: "string",
20392
+ enum: ["service"]
20393
+ },
20394
+ service: serviceNameSchema,
20395
+ path: {
20396
+ description: "Routing-only path used to select a route inside the target service. It does not mutate the URL observed by user code.",
20397
+ type: "string",
20398
+ maxLength: 4096
20399
+ }
20400
+ }
20401
+ };
20367
20402
  var matchableValueSchema = {
20368
20403
  description: "A value to match against. Can be a string (regex) or a condition operation object",
20369
20404
  anyOf: [
@@ -20712,8 +20747,10 @@ var require_schemas = __commonJS({
20712
20747
  maxLength: 4096
20713
20748
  },
20714
20749
  destination: {
20715
- type: "string",
20716
- maxLength: 4096
20750
+ anyOf: [
20751
+ { type: "string", maxLength: 4096 },
20752
+ serviceDestinationSchema
20753
+ ]
20717
20754
  },
20718
20755
  headers: {
20719
20756
  type: "object",
@@ -20862,9 +20899,8 @@ var require_schemas = __commonJS({
20862
20899
  maxLength: 4096
20863
20900
  },
20864
20901
  destination: {
20865
- description: "An absolute pathname to an existing resource or an external URL.",
20866
- type: "string",
20867
- maxLength: 4096
20902
+ description: "An absolute pathname to an existing resource, an external URL, or a service-targeted destination object.",
20903
+ anyOf: [{ type: "string", maxLength: 4096 }, serviceDestinationSchema]
20868
20904
  },
20869
20905
  has: hasSchema,
20870
20906
  missing: hasSchema,
@@ -21085,8 +21121,10 @@ var require_dist7 = __commonJS({
21085
21121
  `Route at index ${index} cannot define both \`dest\` and \`destination\`. Please use only one.`
21086
21122
  );
21087
21123
  }
21088
- route.dest = route.destination;
21089
- delete route.destination;
21124
+ if (typeof route.destination === "string") {
21125
+ route.dest = route.destination;
21126
+ delete route.destination;
21127
+ }
21090
21128
  }
21091
21129
  if (route.statusCode !== void 0) {
21092
21130
  if (route.status !== void 0) {
@@ -21146,6 +21184,11 @@ var require_dist7 = __commonJS({
21146
21184
  if (regError) {
21147
21185
  errors.push(regError);
21148
21186
  }
21187
+ if (route.destination && typeof route.destination === "object" && route.continue) {
21188
+ errors.push(
21189
+ `Route at index ${i} cannot define \`continue: true\` with a service \`destination\`. The service handoff is terminal.`
21190
+ );
21191
+ }
21149
21192
  const handleValue = handling[handling.length - 1];
21150
21193
  if (handleValue === "hit") {
21151
21194
  if (route.dest) {
@@ -21212,9 +21255,10 @@ var require_dist7 = __commonJS({
21212
21255
  link: "https://vercel.link/invalid-route-source-pattern"
21213
21256
  };
21214
21257
  }
21215
- if (destination) {
21258
+ const destinationString = typeof destination === "string" ? destination : typeof destination?.path === "string" ? destination.path : void 0;
21259
+ if (destinationString !== void 0) {
21216
21260
  try {
21217
- const { hostname, pathname, query } = (0, import_url.parse)(destination, true);
21261
+ const { hostname, pathname, query } = (0, import_url.parse)(destinationString, true);
21218
21262
  (0, import_superstatic.sourceToRegex)(hostname || "").segments.forEach(
21219
21263
  (name) => destinationSegments.add(name)
21220
21264
  );
@@ -34072,6 +34116,7 @@ var require_dist8 = __commonJS({
34072
34116
  var src_exports = {};
34073
34117
  __export(src_exports, {
34074
34118
  build: () => build,
34119
+ diagnostics: () => diagnostics,
34075
34120
  prepareCache: () => prepareCache,
34076
34121
  version: () => version
34077
34122
  });
@@ -35155,7 +35200,8 @@ var build = async ({
35155
35200
  workPath,
35156
35201
  repoRootPath,
35157
35202
  config,
35158
- meta = {}
35203
+ meta = {},
35204
+ service
35159
35205
  }) => {
35160
35206
  await (0, import_build_utils4.download)(files, workPath, meta);
35161
35207
  const routePrefix = config.routePrefix;
@@ -35268,6 +35314,7 @@ var build = async ({
35268
35314
  );
35269
35315
  const {
35270
35316
  cliType,
35317
+ lockfilePath,
35271
35318
  lockfileVersion,
35272
35319
  packageJsonPackageManager,
35273
35320
  turboSupportsCorepackHome
@@ -35362,6 +35409,23 @@ var build = async ({
35362
35409
  }
35363
35410
  }
35364
35411
  }
35412
+ if (framework?.slug) {
35413
+ try {
35414
+ await (0, import_build_utils4.generateProjectManifest)({
35415
+ workPath: entrypointDir,
35416
+ nodeVersion,
35417
+ cliType,
35418
+ lockfilePath,
35419
+ lockfileVersion,
35420
+ framework: framework.slug,
35421
+ serviceType: service ? (0, import_build_utils4.getReportedServiceType)(service) : void 0
35422
+ });
35423
+ } catch (err) {
35424
+ (0, import_build_utils4.debug)(
35425
+ `Failed to write static-build manifest: ${err instanceof Error ? err.message : String(err)}`
35426
+ );
35427
+ }
35428
+ }
35365
35429
  if (framework?.slug === "gatsby") {
35366
35430
  await createPluginSymlinks(entrypointDir);
35367
35431
  }
@@ -35618,9 +35682,11 @@ var prepareCache = async ({
35618
35682
  }
35619
35683
  return cacheFiles;
35620
35684
  };
35685
+ var diagnostics = (0, import_build_utils4.createDiagnostics)("node");
35621
35686
  // Annotate the CommonJS export names for ESM import in node:
35622
35687
  0 && (module.exports = {
35623
35688
  build,
35689
+ diagnostics,
35624
35690
  prepareCache,
35625
35691
  version
35626
35692
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/static-build",
3
- "version": "2.9.39",
3
+ "version": "2.10.1",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/build-step",
@@ -14,9 +14,9 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "ts-morph": "12.0.0",
17
- "@vercel/static-config": "3.4.0",
18
17
  "@vercel/gatsby-plugin-vercel-analytics": "1.0.11",
19
- "@vercel/gatsby-plugin-vercel-builder": "2.2.16"
18
+ "@vercel/static-config": "3.4.0",
19
+ "@vercel/gatsby-plugin-vercel-builder": "2.2.17"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/aws-lambda": "8.10.64",
@@ -37,11 +37,11 @@
37
37
  "semver": "7.5.2",
38
38
  "tree-kill": "1.2.2",
39
39
  "vitest": "2.0.3",
40
+ "@vercel/build-utils": "13.29.0",
40
41
  "@vercel/error-utils": "2.2.0",
41
- "@vercel/build-utils": "13.28.0",
42
42
  "@vercel/frameworks": "3.28.0",
43
- "@vercel/fs-detectors": "6.8.1",
44
- "@vercel/routing-utils": "6.2.0"
43
+ "@vercel/fs-detectors": "6.8.2",
44
+ "@vercel/routing-utils": "6.3.0"
45
45
  },
46
46
  "scripts": {
47
47
  "build": "node ../../utils/build-builder.mjs",