@vercel/static-build 2.10.2 → 2.11.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/index.js +420 -42
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -9346,12 +9346,12 @@ var require_frameworks = __commonJS({
|
|
|
9346
9346
|
experimental: true
|
|
9347
9347
|
},
|
|
9348
9348
|
{
|
|
9349
|
-
name: "
|
|
9349
|
+
name: "eve",
|
|
9350
9350
|
slug: "eve",
|
|
9351
9351
|
logo: "https://api-frameworks.vercel.sh/framework-logos/eve.svg",
|
|
9352
9352
|
darkModeLogo: "https://api-frameworks.vercel.sh/framework-logos/eve-dark.svg",
|
|
9353
9353
|
tagline: "A filesystem-first framework for durable backend agents on Vercel.",
|
|
9354
|
-
description: "An
|
|
9354
|
+
description: "An eve app: agents authored as a directory of files, compiled and served on Vercel.",
|
|
9355
9355
|
detectors: {
|
|
9356
9356
|
every: [
|
|
9357
9357
|
{
|
|
@@ -9376,8 +9376,7 @@ var require_frameworks = __commonJS({
|
|
|
9376
9376
|
value: ".output"
|
|
9377
9377
|
}
|
|
9378
9378
|
},
|
|
9379
|
-
getOutputDirName: async () => ".output"
|
|
9380
|
-
experimental: true
|
|
9379
|
+
getOutputDirName: async () => ".output"
|
|
9381
9380
|
},
|
|
9382
9381
|
{
|
|
9383
9382
|
name: "Sanity",
|
|
@@ -11185,6 +11184,91 @@ var require_frameworks = __commonJS({
|
|
|
11185
11184
|
}
|
|
11186
11185
|
]
|
|
11187
11186
|
},
|
|
11187
|
+
{
|
|
11188
|
+
name: "Bun",
|
|
11189
|
+
slug: "bun",
|
|
11190
|
+
runtimeFramework: true,
|
|
11191
|
+
experimental: true,
|
|
11192
|
+
supersedes: ["node"],
|
|
11193
|
+
logo: "https://api-frameworks.vercel.sh/framework-logos/bun.svg",
|
|
11194
|
+
tagline: "Bun is a fast all-in-one JavaScript runtime, bundler, and package manager.",
|
|
11195
|
+
description: "A Bun application deployed as a serverless function.",
|
|
11196
|
+
website: "https://bun.com",
|
|
11197
|
+
useRuntime: { src: "package.json", use: "@vercel/backends" },
|
|
11198
|
+
ignoreRuntimes: ["@vercel/node"],
|
|
11199
|
+
detectors: {
|
|
11200
|
+
every: [
|
|
11201
|
+
{
|
|
11202
|
+
path: "bun.lock"
|
|
11203
|
+
}
|
|
11204
|
+
],
|
|
11205
|
+
some: [
|
|
11206
|
+
{
|
|
11207
|
+
path: "server.cjs"
|
|
11208
|
+
},
|
|
11209
|
+
{
|
|
11210
|
+
path: "server.js"
|
|
11211
|
+
},
|
|
11212
|
+
{
|
|
11213
|
+
path: "server.mjs"
|
|
11214
|
+
},
|
|
11215
|
+
{
|
|
11216
|
+
path: "server.mts"
|
|
11217
|
+
},
|
|
11218
|
+
{
|
|
11219
|
+
path: "server.ts"
|
|
11220
|
+
},
|
|
11221
|
+
{
|
|
11222
|
+
path: "server.cts"
|
|
11223
|
+
},
|
|
11224
|
+
{
|
|
11225
|
+
path: "src/server.cjs"
|
|
11226
|
+
},
|
|
11227
|
+
{
|
|
11228
|
+
path: "src/server.js"
|
|
11229
|
+
},
|
|
11230
|
+
{
|
|
11231
|
+
path: "src/server.mjs"
|
|
11232
|
+
},
|
|
11233
|
+
{
|
|
11234
|
+
path: "src/server.mts"
|
|
11235
|
+
},
|
|
11236
|
+
{
|
|
11237
|
+
path: "src/server.ts"
|
|
11238
|
+
},
|
|
11239
|
+
{
|
|
11240
|
+
path: "src/server.cts"
|
|
11241
|
+
}
|
|
11242
|
+
]
|
|
11243
|
+
},
|
|
11244
|
+
settings: {
|
|
11245
|
+
installCommand: {
|
|
11246
|
+
value: "bun install",
|
|
11247
|
+
placeholder: "bun install"
|
|
11248
|
+
},
|
|
11249
|
+
buildCommand: {
|
|
11250
|
+
placeholder: "None",
|
|
11251
|
+
value: null
|
|
11252
|
+
},
|
|
11253
|
+
devCommand: {
|
|
11254
|
+
placeholder: "`bun dev`, `bun run dev`, or `bun --hot server.ts`",
|
|
11255
|
+
value: null
|
|
11256
|
+
},
|
|
11257
|
+
outputDirectory: {
|
|
11258
|
+
value: "N/A"
|
|
11259
|
+
}
|
|
11260
|
+
},
|
|
11261
|
+
getOutputDirName: async () => "public",
|
|
11262
|
+
defaultRoutes: [
|
|
11263
|
+
{
|
|
11264
|
+
handle: "filesystem"
|
|
11265
|
+
},
|
|
11266
|
+
{
|
|
11267
|
+
src: "/(.*)",
|
|
11268
|
+
dest: "/"
|
|
11269
|
+
}
|
|
11270
|
+
]
|
|
11271
|
+
},
|
|
11188
11272
|
{
|
|
11189
11273
|
name: "Node",
|
|
11190
11274
|
slug: "node",
|
|
@@ -11196,11 +11280,6 @@ var require_frameworks = __commonJS({
|
|
|
11196
11280
|
useRuntime: { src: "package.json", use: "@vercel/backends" },
|
|
11197
11281
|
ignoreRuntimes: ["@vercel/node"],
|
|
11198
11282
|
detectors: {
|
|
11199
|
-
every: [
|
|
11200
|
-
{
|
|
11201
|
-
path: "package.json"
|
|
11202
|
-
}
|
|
11203
|
-
],
|
|
11204
11283
|
some: [
|
|
11205
11284
|
{
|
|
11206
11285
|
path: "server.cjs"
|
|
@@ -19673,6 +19752,7 @@ var require_superstatic = __commonJS({
|
|
|
19673
19752
|
var superstatic_exports = {};
|
|
19674
19753
|
__export2(superstatic_exports, {
|
|
19675
19754
|
collectHasSegments: () => collectHasSegments,
|
|
19755
|
+
compilePathToRegexpTemplate: () => compilePathToRegexpTemplate2,
|
|
19676
19756
|
convertCleanUrls: () => convertCleanUrls,
|
|
19677
19757
|
convertHeaders: () => convertHeaders,
|
|
19678
19758
|
convertRedirects: () => convertRedirects,
|
|
@@ -19816,6 +19896,22 @@ var require_superstatic = __commonJS({
|
|
|
19816
19896
|
}
|
|
19817
19897
|
route = { src, destination };
|
|
19818
19898
|
}
|
|
19899
|
+
if (r.transforms) {
|
|
19900
|
+
route.transforms = r.transforms.map((transform) => {
|
|
19901
|
+
if (transform.type !== "request.path") {
|
|
19902
|
+
return { ...transform };
|
|
19903
|
+
}
|
|
19904
|
+
return {
|
|
19905
|
+
...transform,
|
|
19906
|
+
args: compilePathToRegexpTemplateFromSegments(
|
|
19907
|
+
transform.args,
|
|
19908
|
+
segments,
|
|
19909
|
+
hasSegments,
|
|
19910
|
+
transform.env
|
|
19911
|
+
)
|
|
19912
|
+
};
|
|
19913
|
+
});
|
|
19914
|
+
}
|
|
19819
19915
|
if (typeof r.env !== "undefined") {
|
|
19820
19916
|
route.env = r.env;
|
|
19821
19917
|
}
|
|
@@ -19956,6 +20052,81 @@ var require_superstatic = __commonJS({
|
|
|
19956
20052
|
}
|
|
19957
20053
|
var escapeSegment = (str, segmentName) => str.replace(new RegExp(`:${segmentName}`, "g"), `__ESC_COLON_${segmentName}`);
|
|
19958
20054
|
var unescapeSegments = (str) => str.replace(/__ESC_COLON_/gi, ":");
|
|
20055
|
+
var pathTemplateSegmentNameRegex = /^([a-zA-Z_][a-zA-Z0-9_]*)/;
|
|
20056
|
+
function isEscaped2(value, index) {
|
|
20057
|
+
let backslashCount = 0;
|
|
20058
|
+
for (let i = index - 1; i >= 0 && value[i] === "\\"; i--) {
|
|
20059
|
+
backslashCount++;
|
|
20060
|
+
}
|
|
20061
|
+
return backslashCount % 2 === 1;
|
|
20062
|
+
}
|
|
20063
|
+
function collectPathTemplateSegments(template) {
|
|
20064
|
+
const segments = [];
|
|
20065
|
+
for (let i = 0; i < template.length; i++) {
|
|
20066
|
+
if (template[i] !== ":" || isEscaped2(template, i)) {
|
|
20067
|
+
continue;
|
|
20068
|
+
}
|
|
20069
|
+
const match = template.slice(i + 1).match(pathTemplateSegmentNameRegex);
|
|
20070
|
+
if (match) {
|
|
20071
|
+
segments.push(match[1]);
|
|
20072
|
+
i += match[1].length;
|
|
20073
|
+
}
|
|
20074
|
+
}
|
|
20075
|
+
return segments;
|
|
20076
|
+
}
|
|
20077
|
+
function collectNamedDollarReferences(template) {
|
|
20078
|
+
const references = [];
|
|
20079
|
+
for (let i = 0; i < template.length; i++) {
|
|
20080
|
+
if (template[i] !== "$" || isEscaped2(template, i)) {
|
|
20081
|
+
continue;
|
|
20082
|
+
}
|
|
20083
|
+
const remainder = template.slice(i + 1);
|
|
20084
|
+
const bracedMatch = remainder.match(/^\{([a-zA-Z_][a-zA-Z0-9_]*)\}/);
|
|
20085
|
+
const unbracedMatch = remainder.match(pathTemplateSegmentNameRegex);
|
|
20086
|
+
const name = bracedMatch?.[1] || unbracedMatch?.[1];
|
|
20087
|
+
if (name) {
|
|
20088
|
+
references.push(name);
|
|
20089
|
+
}
|
|
20090
|
+
}
|
|
20091
|
+
return references;
|
|
20092
|
+
}
|
|
20093
|
+
function compilePathToRegexpTemplateFromSegments(template, segments, hasItemSegments, env = []) {
|
|
20094
|
+
const indexes = {};
|
|
20095
|
+
segments.forEach((name, index) => {
|
|
20096
|
+
indexes[name] = toSegmentDest(index);
|
|
20097
|
+
});
|
|
20098
|
+
hasItemSegments.forEach((name) => {
|
|
20099
|
+
indexes[name] = `$${name}`;
|
|
20100
|
+
});
|
|
20101
|
+
for (const name of collectPathTemplateSegments(template)) {
|
|
20102
|
+
if (!(name in indexes)) {
|
|
20103
|
+
throw new Error(
|
|
20104
|
+
`Path template references parameter ":${name}" that is not present in the source or has conditions.`
|
|
20105
|
+
);
|
|
20106
|
+
}
|
|
20107
|
+
}
|
|
20108
|
+
const routeParameters = /* @__PURE__ */ new Set([
|
|
20109
|
+
...segments.filter((name) => name !== UN_NAMED_SEGMENT),
|
|
20110
|
+
...hasItemSegments
|
|
20111
|
+
]);
|
|
20112
|
+
for (const name of collectNamedDollarReferences(template)) {
|
|
20113
|
+
if (routeParameters.has(name) && !env.includes(name)) {
|
|
20114
|
+
throw new Error(
|
|
20115
|
+
`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.`
|
|
20116
|
+
);
|
|
20117
|
+
}
|
|
20118
|
+
}
|
|
20119
|
+
return safelyCompile(template, indexes, true);
|
|
20120
|
+
}
|
|
20121
|
+
function compilePathToRegexpTemplate2(source, template, has, env) {
|
|
20122
|
+
const { segments } = sourceToRegex2(source);
|
|
20123
|
+
return compilePathToRegexpTemplateFromSegments(
|
|
20124
|
+
template,
|
|
20125
|
+
segments,
|
|
20126
|
+
collectHasSegments(has),
|
|
20127
|
+
env
|
|
20128
|
+
);
|
|
20129
|
+
}
|
|
19959
20130
|
function replaceSegments(segments, hasItemSegments, destination, isRedirect, internalParamNames) {
|
|
19960
20131
|
const namedSegments = segments.filter((name) => name !== UN_NAMED_SEGMENT);
|
|
19961
20132
|
const canNeedReplacing = destination.includes(":") && namedSegments.length > 0 || hasItemSegments.length > 0 || !isRedirect;
|
|
@@ -20357,7 +20528,8 @@ var require_schemas = __commonJS({
|
|
|
20357
20528
|
redirectsSchema: () => redirectsSchema,
|
|
20358
20529
|
rewritesSchema: () => rewritesSchema,
|
|
20359
20530
|
routesSchema: () => routesSchema,
|
|
20360
|
-
trailingSlashSchema: () => trailingSlashSchema
|
|
20531
|
+
trailingSlashSchema: () => trailingSlashSchema,
|
|
20532
|
+
transformsSchema: () => transformsSchema
|
|
20361
20533
|
});
|
|
20362
20534
|
module2.exports = __toCommonJS2(schemas_exports);
|
|
20363
20535
|
var mitigateSchema = {
|
|
@@ -20522,18 +20694,23 @@ var require_schemas = __commonJS({
|
|
|
20522
20694
|
}
|
|
20523
20695
|
};
|
|
20524
20696
|
var transformsSchema = {
|
|
20525
|
-
description: "A list of transform rules to adjust
|
|
20697
|
+
description: "A list of transform rules to adjust a request path, request query parameters, or request/response headers",
|
|
20526
20698
|
type: "array",
|
|
20527
20699
|
minItems: 1,
|
|
20528
20700
|
items: {
|
|
20529
20701
|
type: "object",
|
|
20530
20702
|
additionalProperties: false,
|
|
20531
|
-
required: ["type", "op"
|
|
20703
|
+
required: ["type", "op"],
|
|
20532
20704
|
properties: {
|
|
20533
20705
|
type: {
|
|
20534
20706
|
description: "The scope of the transform to apply",
|
|
20535
20707
|
type: "string",
|
|
20536
|
-
enum: [
|
|
20708
|
+
enum: [
|
|
20709
|
+
"request.headers",
|
|
20710
|
+
"request.query",
|
|
20711
|
+
"response.headers",
|
|
20712
|
+
"request.path"
|
|
20713
|
+
]
|
|
20537
20714
|
},
|
|
20538
20715
|
op: {
|
|
20539
20716
|
description: "The operation to perform on the target",
|
|
@@ -20719,10 +20896,90 @@ var require_schemas = __commonJS({
|
|
|
20719
20896
|
}
|
|
20720
20897
|
}
|
|
20721
20898
|
}
|
|
20899
|
+
},
|
|
20900
|
+
{
|
|
20901
|
+
if: {
|
|
20902
|
+
required: ["type"],
|
|
20903
|
+
properties: {
|
|
20904
|
+
type: {
|
|
20905
|
+
enum: ["request.headers", "request.query", "response.headers"]
|
|
20906
|
+
}
|
|
20907
|
+
}
|
|
20908
|
+
},
|
|
20909
|
+
// biome-ignore lint/suspicious/noThenProperty: JSON Schema if/then keyword
|
|
20910
|
+
then: {
|
|
20911
|
+
required: ["target"]
|
|
20912
|
+
}
|
|
20913
|
+
},
|
|
20914
|
+
{
|
|
20915
|
+
if: {
|
|
20916
|
+
required: ["type"],
|
|
20917
|
+
properties: {
|
|
20918
|
+
type: {
|
|
20919
|
+
enum: ["request.path"]
|
|
20920
|
+
}
|
|
20921
|
+
}
|
|
20922
|
+
},
|
|
20923
|
+
// biome-ignore lint/suspicious/noThenProperty: JSON Schema if/then keyword
|
|
20924
|
+
then: {
|
|
20925
|
+
required: ["args"],
|
|
20926
|
+
not: {
|
|
20927
|
+
required: ["target"]
|
|
20928
|
+
},
|
|
20929
|
+
properties: {
|
|
20930
|
+
op: {
|
|
20931
|
+
enum: ["set"]
|
|
20932
|
+
},
|
|
20933
|
+
args: {
|
|
20934
|
+
description: "The runtime-visible request path. Must be an origin-form path without query or fragment.",
|
|
20935
|
+
type: "string",
|
|
20936
|
+
maxLength: 2048,
|
|
20937
|
+
pattern: "^/(?!/)(?!.*[?#\\s\\x00-\\x1F\\x7F]).*$"
|
|
20938
|
+
}
|
|
20939
|
+
}
|
|
20940
|
+
}
|
|
20722
20941
|
}
|
|
20723
20942
|
]
|
|
20724
20943
|
}
|
|
20725
20944
|
};
|
|
20945
|
+
var rewriteTransformsSchema = {
|
|
20946
|
+
description: "A list of request path transforms using path-to-regexp parameters.",
|
|
20947
|
+
type: "array",
|
|
20948
|
+
minItems: 1,
|
|
20949
|
+
items: {
|
|
20950
|
+
type: "object",
|
|
20951
|
+
additionalProperties: false,
|
|
20952
|
+
required: ["type", "op", "args"],
|
|
20953
|
+
properties: {
|
|
20954
|
+
type: {
|
|
20955
|
+
description: "The request path to expose to the target runtime",
|
|
20956
|
+
type: "string",
|
|
20957
|
+
enum: ["request.path"]
|
|
20958
|
+
},
|
|
20959
|
+
op: {
|
|
20960
|
+
description: "Replace the runtime-visible request path",
|
|
20961
|
+
type: "string",
|
|
20962
|
+
enum: ["set"]
|
|
20963
|
+
},
|
|
20964
|
+
args: {
|
|
20965
|
+
description: "An origin-form request path. Route parameters use path-to-regexp syntax such as `/:path*`.",
|
|
20966
|
+
type: "string",
|
|
20967
|
+
maxLength: 2048,
|
|
20968
|
+
pattern: "^/(?!/)(?!.*[?#\\s\\x00-\\x1F\\x7F]).*$"
|
|
20969
|
+
},
|
|
20970
|
+
env: {
|
|
20971
|
+
description: "An array of environment variable names that should be replaced at runtime in the args value",
|
|
20972
|
+
type: "array",
|
|
20973
|
+
minItems: 1,
|
|
20974
|
+
maxItems: 64,
|
|
20975
|
+
items: {
|
|
20976
|
+
type: "string",
|
|
20977
|
+
maxLength: 256
|
|
20978
|
+
}
|
|
20979
|
+
}
|
|
20980
|
+
}
|
|
20981
|
+
}
|
|
20982
|
+
};
|
|
20726
20983
|
var routesSchema = {
|
|
20727
20984
|
type: "array",
|
|
20728
20985
|
description: "A list of routes objects used to rewrite paths to point towards other internal or external paths",
|
|
@@ -20902,6 +21159,7 @@ var require_schemas = __commonJS({
|
|
|
20902
21159
|
description: "An absolute pathname to an existing resource, an external URL, or a service-targeted destination object.",
|
|
20903
21160
|
anyOf: [{ type: "string", maxLength: 4096 }, serviceDestinationSchema]
|
|
20904
21161
|
},
|
|
21162
|
+
transforms: rewriteTransformsSchema,
|
|
20905
21163
|
has: hasSchema,
|
|
20906
21164
|
missing: hasSchema,
|
|
20907
21165
|
statusCode: {
|
|
@@ -21070,6 +21328,7 @@ var require_dist7 = __commonJS({
|
|
|
21070
21328
|
var src_exports2 = {};
|
|
21071
21329
|
__export2(src_exports2, {
|
|
21072
21330
|
appendRoutesToPhase: () => import_append.appendRoutesToPhase,
|
|
21331
|
+
compilePathToRegexpTemplate: () => import_superstatic2.compilePathToRegexpTemplate,
|
|
21073
21332
|
getCleanUrls: () => import_superstatic2.getCleanUrls,
|
|
21074
21333
|
getOwnershipGuard: () => import_service_route_ownership.getOwnershipGuard,
|
|
21075
21334
|
getTransformedRoutes: () => getTransformedRoutes,
|
|
@@ -21243,7 +21502,8 @@ var require_dist7 = __commonJS({
|
|
|
21243
21502
|
function checkPatternSyntax(type, index, {
|
|
21244
21503
|
source,
|
|
21245
21504
|
destination,
|
|
21246
|
-
has
|
|
21505
|
+
has,
|
|
21506
|
+
transforms
|
|
21247
21507
|
}) {
|
|
21248
21508
|
let sourceSegments = /* @__PURE__ */ new Set();
|
|
21249
21509
|
const destinationSegments = /* @__PURE__ */ new Set();
|
|
@@ -21283,6 +21543,19 @@ var require_dist7 = __commonJS({
|
|
|
21283
21543
|
}
|
|
21284
21544
|
}
|
|
21285
21545
|
}
|
|
21546
|
+
for (const transform of transforms || []) {
|
|
21547
|
+
if (transform.type !== "request.path") {
|
|
21548
|
+
continue;
|
|
21549
|
+
}
|
|
21550
|
+
try {
|
|
21551
|
+
(0, import_superstatic.compilePathToRegexpTemplate)(source, transform.args, has, transform.env);
|
|
21552
|
+
} catch (error) {
|
|
21553
|
+
return {
|
|
21554
|
+
message: `${type} at index ${index} has an invalid \`request.path\` transform: ${error instanceof Error ? error.message : String(error)}`,
|
|
21555
|
+
link: "https://vercel.link/invalid-route-destination-segment"
|
|
21556
|
+
};
|
|
21557
|
+
}
|
|
21558
|
+
}
|
|
21286
21559
|
return null;
|
|
21287
21560
|
}
|
|
21288
21561
|
function checkRedirect(r, index) {
|
|
@@ -22493,7 +22766,8 @@ var require_utils4 = __commonJS({
|
|
|
22493
22766
|
isFrontendFramework: () => isFrontendFramework,
|
|
22494
22767
|
isRouteOwningBuilder: () => isRouteOwningBuilder2,
|
|
22495
22768
|
isStaticBuild: () => isStaticBuild2,
|
|
22496
|
-
readVercelConfig: () => readVercelConfig
|
|
22769
|
+
readVercelConfig: () => readVercelConfig,
|
|
22770
|
+
stripTrailingSlash: () => stripTrailingSlash
|
|
22497
22771
|
});
|
|
22498
22772
|
module2.exports = __toCommonJS2(utils_exports);
|
|
22499
22773
|
var import_framework_helpers = require("@vercel/build-utils/dist/framework-helpers");
|
|
@@ -22503,6 +22777,10 @@ var require_utils4 = __commonJS({
|
|
|
22503
22777
|
var DETECTION_FRAMEWORKS = import_frameworks2.frameworkList.filter(
|
|
22504
22778
|
(framework) => !framework.experimental || framework.runtimeFramework
|
|
22505
22779
|
);
|
|
22780
|
+
function stripTrailingSlash(p) {
|
|
22781
|
+
const stripped = p.replace(/\/+$/, "");
|
|
22782
|
+
return stripped === "" ? "." : stripped;
|
|
22783
|
+
}
|
|
22506
22784
|
async function hasFile(fs5, filePath) {
|
|
22507
22785
|
try {
|
|
22508
22786
|
return await fs5.isFile(filePath);
|
|
@@ -22979,7 +23257,7 @@ var require_resolve = __commonJS({
|
|
|
22979
23257
|
if (!root) {
|
|
22980
23258
|
return { fs: fs5 };
|
|
22981
23259
|
}
|
|
22982
|
-
const normalizedRoot = import_path7.posix.normalize(root);
|
|
23260
|
+
const normalizedRoot = (0, import_utils.stripTrailingSlash)(import_path7.posix.normalize(root));
|
|
22983
23261
|
if (!await fs5.hasPath(normalizedRoot)) {
|
|
22984
23262
|
return {
|
|
22985
23263
|
fs: fs5,
|
|
@@ -23097,8 +23375,8 @@ var require_resolve = __commonJS({
|
|
|
23097
23375
|
let reachedRoot = false;
|
|
23098
23376
|
while (!reachedRoot) {
|
|
23099
23377
|
for (const manifest of manifests) {
|
|
23100
|
-
const
|
|
23101
|
-
if (await (0, import_utils.hasFile)(fs5,
|
|
23378
|
+
const manifestPath2 = dir === "." ? manifest : import_path7.posix.join(dir, manifest);
|
|
23379
|
+
if (await (0, import_utils.hasFile)(fs5, manifestPath2)) {
|
|
23102
23380
|
return dir;
|
|
23103
23381
|
}
|
|
23104
23382
|
}
|
|
@@ -23903,9 +24181,8 @@ var require_resolve_v2 = __commonJS({
|
|
|
23903
24181
|
return null;
|
|
23904
24182
|
}
|
|
23905
24183
|
async function resolveConfiguredServiceV22(name, config, fs5) {
|
|
23906
|
-
const
|
|
23907
|
-
const
|
|
23908
|
-
const serviceFsResult = normalizedRoot === "." ? { fs: fs5 } : await (0, import_resolve.getServiceFs)(fs5, name, root);
|
|
24184
|
+
const normalizedRoot = (0, import_utils.stripTrailingSlash)(import_path7.posix.normalize(config.root));
|
|
24185
|
+
const serviceFsResult = normalizedRoot === "." ? { fs: fs5 } : await (0, import_resolve.getServiceFs)(fs5, name, normalizedRoot);
|
|
23909
24186
|
if (serviceFsResult.error) {
|
|
23910
24187
|
return { error: serviceFsResult.error };
|
|
23911
24188
|
}
|
|
@@ -23995,7 +24272,7 @@ var require_resolve_v2 = __commonJS({
|
|
|
23995
24272
|
service: {
|
|
23996
24273
|
schema: "experimentalServicesV2",
|
|
23997
24274
|
name,
|
|
23998
|
-
root,
|
|
24275
|
+
root: normalizedRoot,
|
|
23999
24276
|
framework,
|
|
24000
24277
|
runtime,
|
|
24001
24278
|
entrypoint: entrypointFile,
|
|
@@ -34438,13 +34715,13 @@ async function readBuildOutputDirectory2({
|
|
|
34438
34715
|
return outputs;
|
|
34439
34716
|
}
|
|
34440
34717
|
async function getMiddleware(workPath) {
|
|
34441
|
-
const
|
|
34718
|
+
const manifestPath2 = import_path3.default.join(
|
|
34442
34719
|
workPath,
|
|
34443
34720
|
BUILD_OUTPUT_DIR,
|
|
34444
34721
|
"functions-manifest.json"
|
|
34445
34722
|
);
|
|
34446
34723
|
try {
|
|
34447
|
-
const manifest = await (0, import_fs_extra.readJson)(
|
|
34724
|
+
const manifest = await (0, import_fs_extra.readJson)(manifestPath2);
|
|
34448
34725
|
if (manifest.pages["_middleware.js"].runtime !== "web") {
|
|
34449
34726
|
return;
|
|
34450
34727
|
}
|
|
@@ -35409,23 +35686,6 @@ var build = async ({
|
|
|
35409
35686
|
}
|
|
35410
35687
|
}
|
|
35411
35688
|
}
|
|
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
|
-
}
|
|
35429
35689
|
if (framework?.slug === "gatsby") {
|
|
35430
35690
|
await createPluginSymlinks(entrypointDir);
|
|
35431
35691
|
}
|
|
@@ -35479,6 +35739,15 @@ var build = async ({
|
|
|
35479
35739
|
`Set PYTHONPATH="${pythonPath}" because a requirements.txt was found`
|
|
35480
35740
|
);
|
|
35481
35741
|
}
|
|
35742
|
+
await generateStaticBuildManifest({
|
|
35743
|
+
framework,
|
|
35744
|
+
service,
|
|
35745
|
+
entrypointDir,
|
|
35746
|
+
nodeVersion,
|
|
35747
|
+
cliType,
|
|
35748
|
+
lockfilePath,
|
|
35749
|
+
lockfileVersion
|
|
35750
|
+
});
|
|
35482
35751
|
const cliEnv = {
|
|
35483
35752
|
...process.env,
|
|
35484
35753
|
PATH: pathList.join(import_path6.default.delimiter),
|
|
@@ -35682,7 +35951,116 @@ var prepareCache = async ({
|
|
|
35682
35951
|
}
|
|
35683
35952
|
return cacheFiles;
|
|
35684
35953
|
};
|
|
35685
|
-
var
|
|
35954
|
+
var STATIC_BUILD_MANIFEST_RUNTIMES = ["node", "go", "rust", "ruby"];
|
|
35955
|
+
async function generateStaticBuildManifest({
|
|
35956
|
+
framework,
|
|
35957
|
+
service,
|
|
35958
|
+
entrypointDir,
|
|
35959
|
+
nodeVersion,
|
|
35960
|
+
cliType,
|
|
35961
|
+
lockfilePath,
|
|
35962
|
+
lockfileVersion
|
|
35963
|
+
}) {
|
|
35964
|
+
if (framework?.slug === "hugo") {
|
|
35965
|
+
try {
|
|
35966
|
+
const hugoVersionOut = (0, import_child_process.spawnSync)("hugo", ["version"], {
|
|
35967
|
+
encoding: "utf8"
|
|
35968
|
+
});
|
|
35969
|
+
const hugoResolved = hugoVersionOut.status === 0 && typeof hugoVersionOut.stdout === "string" ? hugoVersionOut.stdout.match(/v(\d+(?:\.\d+)*)/)?.[1] ?? process.env.HUGO_VERSION ?? "0.58.2" : process.env.HUGO_VERSION || "0.58.2";
|
|
35970
|
+
await (0, import_build_utils4.writeProjectManifest)(
|
|
35971
|
+
{
|
|
35972
|
+
version: import_build_utils4.MANIFEST_VERSION,
|
|
35973
|
+
runtime: "go",
|
|
35974
|
+
framework: framework.slug,
|
|
35975
|
+
serviceType: service ? (0, import_build_utils4.getReportedServiceType)(service) : void 0,
|
|
35976
|
+
dependencies: [
|
|
35977
|
+
{
|
|
35978
|
+
name: "hugo",
|
|
35979
|
+
type: "direct",
|
|
35980
|
+
scopes: ["prod"],
|
|
35981
|
+
resolved: hugoResolved
|
|
35982
|
+
}
|
|
35983
|
+
]
|
|
35984
|
+
},
|
|
35985
|
+
entrypointDir,
|
|
35986
|
+
"go"
|
|
35987
|
+
);
|
|
35988
|
+
} catch (err) {
|
|
35989
|
+
(0, import_build_utils4.debug)(
|
|
35990
|
+
`Failed to write hugo manifest: ${err instanceof Error ? err.message : String(err)}`
|
|
35991
|
+
);
|
|
35992
|
+
}
|
|
35993
|
+
} else if (framework?.slug === "zola") {
|
|
35994
|
+
try {
|
|
35995
|
+
const zolaVersionOut = (0, import_child_process.spawnSync)("zola", ["--version"], {
|
|
35996
|
+
encoding: "utf8"
|
|
35997
|
+
});
|
|
35998
|
+
const zolaResolved = zolaVersionOut.status === 0 && typeof zolaVersionOut.stdout === "string" ? zolaVersionOut.stdout.trim().split(" ")[1] ?? process.env.ZOLA_VERSION ?? "" : process.env.ZOLA_VERSION ?? "";
|
|
35999
|
+
await (0, import_build_utils4.writeProjectManifest)(
|
|
36000
|
+
{
|
|
36001
|
+
version: import_build_utils4.MANIFEST_VERSION,
|
|
36002
|
+
runtime: "rust",
|
|
36003
|
+
framework: framework.slug,
|
|
36004
|
+
serviceType: service ? (0, import_build_utils4.getReportedServiceType)(service) : void 0,
|
|
36005
|
+
dependencies: [
|
|
36006
|
+
{
|
|
36007
|
+
name: "zola",
|
|
36008
|
+
type: "direct",
|
|
36009
|
+
scopes: ["prod"],
|
|
36010
|
+
resolved: zolaResolved
|
|
36011
|
+
}
|
|
36012
|
+
]
|
|
36013
|
+
},
|
|
36014
|
+
entrypointDir,
|
|
36015
|
+
"rust"
|
|
36016
|
+
);
|
|
36017
|
+
} catch (err) {
|
|
36018
|
+
(0, import_build_utils4.debug)(
|
|
36019
|
+
`Failed to write zola manifest: ${err instanceof Error ? err.message : String(err)}`
|
|
36020
|
+
);
|
|
36021
|
+
}
|
|
36022
|
+
} else if (framework?.slug === "jekyll" || framework?.slug === "middleman") {
|
|
36023
|
+
await (0, import_build_utils4.generateRubyProjectManifest)({
|
|
36024
|
+
workPath: entrypointDir,
|
|
36025
|
+
gemfileLockPath: import_path6.default.join(entrypointDir, "Gemfile.lock"),
|
|
36026
|
+
framework: framework.slug,
|
|
36027
|
+
serviceType: service ? (0, import_build_utils4.getReportedServiceType)(service) : void 0
|
|
36028
|
+
});
|
|
36029
|
+
} else if (framework?.slug) {
|
|
36030
|
+
try {
|
|
36031
|
+
await (0, import_build_utils4.generateProjectManifest)({
|
|
36032
|
+
workPath: entrypointDir,
|
|
36033
|
+
nodeVersion,
|
|
36034
|
+
cliType,
|
|
36035
|
+
lockfilePath,
|
|
36036
|
+
lockfileVersion,
|
|
36037
|
+
framework: framework.slug,
|
|
36038
|
+
serviceType: service ? (0, import_build_utils4.getReportedServiceType)(service) : void 0
|
|
36039
|
+
});
|
|
36040
|
+
} catch (err) {
|
|
36041
|
+
(0, import_build_utils4.debug)(
|
|
36042
|
+
`Failed to write static-build manifest: ${err instanceof Error ? err.message : String(err)}`
|
|
36043
|
+
);
|
|
36044
|
+
}
|
|
36045
|
+
}
|
|
36046
|
+
}
|
|
36047
|
+
var diagnostics = async ({ workPath }) => {
|
|
36048
|
+
const files = {};
|
|
36049
|
+
await Promise.all(
|
|
36050
|
+
STATIC_BUILD_MANIFEST_RUNTIMES.map(async (runtime) => {
|
|
36051
|
+
const relPath = (0, import_build_utils4.manifestPath)(runtime);
|
|
36052
|
+
try {
|
|
36053
|
+
const data = await import_fs4.promises.readFile(
|
|
36054
|
+
import_path6.default.join(workPath, relPath),
|
|
36055
|
+
"utf-8"
|
|
36056
|
+
);
|
|
36057
|
+
files[relPath] = new import_build_utils4.FileBlob({ data });
|
|
36058
|
+
} catch {
|
|
36059
|
+
}
|
|
36060
|
+
})
|
|
36061
|
+
);
|
|
36062
|
+
return files;
|
|
36063
|
+
};
|
|
35686
36064
|
// Annotate the CommonJS export names for ESM import in node:
|
|
35687
36065
|
0 && (module.exports = {
|
|
35688
36066
|
build,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/static-build",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
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/gatsby-plugin-vercel-
|
|
18
|
-
"@vercel/
|
|
19
|
-
"@vercel/
|
|
17
|
+
"@vercel/gatsby-plugin-vercel-analytics": "1.0.11",
|
|
18
|
+
"@vercel/gatsby-plugin-vercel-builder": "2.2.20",
|
|
19
|
+
"@vercel/static-config": "3.4.0"
|
|
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/
|
|
41
|
-
"@vercel/frameworks": "3.28.0",
|
|
40
|
+
"@vercel/frameworks": "3.29.1",
|
|
42
41
|
"@vercel/error-utils": "2.2.0",
|
|
43
|
-
"@vercel/
|
|
44
|
-
"@vercel/
|
|
42
|
+
"@vercel/build-utils": "13.31.0",
|
|
43
|
+
"@vercel/fs-detectors": "6.9.2",
|
|
44
|
+
"@vercel/routing-utils": "6.3.1"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"build": "node ../../utils/build-builder.mjs",
|