@vercel/static-build 2.11.4 → 2.11.6
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 +123 -24
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -9036,6 +9036,52 @@ var require_frameworks = __commonJS({
|
|
|
9036
9036
|
},
|
|
9037
9037
|
getOutputDirName: async () => "dist"
|
|
9038
9038
|
},
|
|
9039
|
+
{
|
|
9040
|
+
name: "TanStack Start",
|
|
9041
|
+
slug: "tanstack-start-lovable",
|
|
9042
|
+
logo: "https://api-frameworks.vercel.sh/framework-logos/tanstack-start.svg",
|
|
9043
|
+
darkModeLogo: "https://api-frameworks.vercel.sh/framework-logos/tanstack-start-dark.svg",
|
|
9044
|
+
platform: {
|
|
9045
|
+
name: "lovable",
|
|
9046
|
+
logo: "https://api-frameworks.vercel.sh/framework-logos/lovable.svg"
|
|
9047
|
+
},
|
|
9048
|
+
tagline: "Full-stack Framework powered by TanStack Router imported from Lovable",
|
|
9049
|
+
description: "Full-document SSR, Streaming, Server Functions, bundling and more, imported from Lovable",
|
|
9050
|
+
website: "https://lovable.dev/",
|
|
9051
|
+
supersedes: ["tanstack-start", "ionic-react", "vite"],
|
|
9052
|
+
detectors: {
|
|
9053
|
+
every: [
|
|
9054
|
+
{
|
|
9055
|
+
matchPackage: "@lovable.dev/vite-tanstack-config"
|
|
9056
|
+
}
|
|
9057
|
+
],
|
|
9058
|
+
some: [
|
|
9059
|
+
{
|
|
9060
|
+
matchPackage: "@tanstack/react-start"
|
|
9061
|
+
},
|
|
9062
|
+
{
|
|
9063
|
+
matchPackage: "@tanstack/solid-start"
|
|
9064
|
+
}
|
|
9065
|
+
]
|
|
9066
|
+
},
|
|
9067
|
+
settings: {
|
|
9068
|
+
installCommand: {
|
|
9069
|
+
placeholder: "`yarn install`, `pnpm install`, `npm install`, or `bun install`"
|
|
9070
|
+
},
|
|
9071
|
+
buildCommand: {
|
|
9072
|
+
placeholder: "`npm run build` or `vite build`",
|
|
9073
|
+
value: "vite build"
|
|
9074
|
+
},
|
|
9075
|
+
devCommand: {
|
|
9076
|
+
placeholder: "vite",
|
|
9077
|
+
value: "vite --port $PORT"
|
|
9078
|
+
},
|
|
9079
|
+
outputDirectory: {
|
|
9080
|
+
value: "dist"
|
|
9081
|
+
}
|
|
9082
|
+
},
|
|
9083
|
+
getOutputDirName: async () => "dist"
|
|
9084
|
+
},
|
|
9039
9085
|
{
|
|
9040
9086
|
name: "VitePress",
|
|
9041
9087
|
slug: "vitepress",
|
|
@@ -9538,6 +9584,10 @@ var require_frameworks = __commonJS({
|
|
|
9538
9584
|
website: "https://storybook.js.org",
|
|
9539
9585
|
ignoreRuntimes: ["@vercel/next", "@vercel/node"],
|
|
9540
9586
|
disableRootMiddleware: true,
|
|
9587
|
+
// Storybook is a devDependency of many apps that deploy something else
|
|
9588
|
+
// entirely, so detecting it is not evidence the user intends to deploy
|
|
9589
|
+
// Storybook itself.
|
|
9590
|
+
detectionConfidence: "weak",
|
|
9541
9591
|
detectors: {
|
|
9542
9592
|
every: [
|
|
9543
9593
|
{
|
|
@@ -11449,7 +11499,7 @@ var require_frameworks = __commonJS({
|
|
|
11449
11499
|
name: "Services",
|
|
11450
11500
|
slug: "services",
|
|
11451
11501
|
experimental: true,
|
|
11452
|
-
logo: "https://api-frameworks.vercel.sh/framework-logos/
|
|
11502
|
+
logo: "https://api-frameworks.vercel.sh/framework-logos/services.svg",
|
|
11453
11503
|
tagline: "Multiple services deployed as serverless functions within your project.",
|
|
11454
11504
|
description: "Multiple services deployed as serverless functions within your project.",
|
|
11455
11505
|
website: "https://vercel.com",
|
|
@@ -22917,6 +22967,9 @@ var require_utils4 = __commonJS({
|
|
|
22917
22967
|
}
|
|
22918
22968
|
}
|
|
22919
22969
|
if (config.entrypoint) {
|
|
22970
|
+
if (config.entrypoint === "pyproject.toml" || config.entrypoint.endsWith("/pyproject.toml")) {
|
|
22971
|
+
return "python";
|
|
22972
|
+
}
|
|
22920
22973
|
for (const [ext, runtime] of Object.entries(import_types.ENTRYPOINT_EXTENSIONS)) {
|
|
22921
22974
|
if (config.entrypoint.endsWith(ext)) {
|
|
22922
22975
|
return runtime;
|
|
@@ -24202,7 +24255,14 @@ var require_resolve_v2 = __commonJS({
|
|
|
24202
24255
|
var import_resolve = require_resolve();
|
|
24203
24256
|
var import_utils = require_utils4();
|
|
24204
24257
|
var frameworksBySlug = new Map(import_frameworks2.frameworkList.map((f) => [f.slug, f]));
|
|
24205
|
-
var
|
|
24258
|
+
var MAX_SERVICE_NAME_LENGTH = 64;
|
|
24259
|
+
var SERVICE_NAME_REGEX = /^[a-z]([a-z_-]*[a-z])?$/;
|
|
24260
|
+
function isValidServiceName(name) {
|
|
24261
|
+
return name.length <= MAX_SERVICE_NAME_LENGTH && SERVICE_NAME_REGEX.test(name);
|
|
24262
|
+
}
|
|
24263
|
+
function getInvalidServiceNameMessage(name) {
|
|
24264
|
+
return `Service name "${name}" is invalid. Names must be 1-${MAX_SERVICE_NAME_LENGTH} characters, start and end with a lowercase letter, and contain only lowercase letters, hyphens, and underscores.`;
|
|
24265
|
+
}
|
|
24206
24266
|
var CONTAINER_ENTRYPOINT_CANDIDATES = [
|
|
24207
24267
|
"Dockerfile.vercel",
|
|
24208
24268
|
"Containerfile.vercel",
|
|
@@ -24294,10 +24354,10 @@ var require_resolve_v2 = __commonJS({
|
|
|
24294
24354
|
};
|
|
24295
24355
|
}
|
|
24296
24356
|
function validateServiceConfigV22(name, config) {
|
|
24297
|
-
if (!
|
|
24357
|
+
if (!isValidServiceName(name)) {
|
|
24298
24358
|
return {
|
|
24299
24359
|
code: "INVALID_SERVICE_NAME",
|
|
24300
|
-
message:
|
|
24360
|
+
message: getInvalidServiceNameMessage(name),
|
|
24301
24361
|
serviceName: name
|
|
24302
24362
|
};
|
|
24303
24363
|
}
|
|
@@ -24354,14 +24414,6 @@ var require_resolve_v2 = __commonJS({
|
|
|
24354
24414
|
};
|
|
24355
24415
|
}
|
|
24356
24416
|
}
|
|
24357
|
-
const isContainer = config.runtime === "container";
|
|
24358
|
-
if (!config.framework && !config.entrypoint && !isContainer) {
|
|
24359
|
-
return {
|
|
24360
|
-
code: "MISSING_SERVICE_CONFIG",
|
|
24361
|
-
message: `Service "${name}" must specify "framework" or "entrypoint".`,
|
|
24362
|
-
serviceName: name
|
|
24363
|
-
};
|
|
24364
|
-
}
|
|
24365
24417
|
return null;
|
|
24366
24418
|
}
|
|
24367
24419
|
async function resolveConfiguredServiceV22(name, config, fs5) {
|
|
@@ -24393,14 +24445,15 @@ var require_resolve_v2 = __commonJS({
|
|
|
24393
24445
|
entrypointIsDirectory = Boolean(resolved.entrypoint?.isDirectory);
|
|
24394
24446
|
}
|
|
24395
24447
|
const entrypointFile = entrypointIsDirectory || !normalizedEntrypoint ? void 0 : normalizedEntrypoint;
|
|
24396
|
-
|
|
24448
|
+
let inferredRuntime = (0, import_utils.inferServiceRuntime)({
|
|
24397
24449
|
runtime: config.runtime,
|
|
24398
24450
|
framework: config.framework,
|
|
24399
24451
|
entrypoint: entrypointFile
|
|
24400
24452
|
});
|
|
24401
24453
|
let framework = config.framework;
|
|
24402
|
-
|
|
24403
|
-
|
|
24454
|
+
let detectedFramework = false;
|
|
24455
|
+
if (!framework) {
|
|
24456
|
+
const workspace = entrypointIsDirectory && normalizedEntrypoint ? normalizedEntrypoint : ".";
|
|
24404
24457
|
const detection = await (0, import_resolve.detectFrameworkFromWorkspace)({
|
|
24405
24458
|
fs: serviceFs,
|
|
24406
24459
|
workspace,
|
|
@@ -24411,6 +24464,12 @@ var require_resolve_v2 = __commonJS({
|
|
|
24411
24464
|
return { error: detection.error };
|
|
24412
24465
|
}
|
|
24413
24466
|
framework = detection.framework;
|
|
24467
|
+
detectedFramework = Boolean(framework);
|
|
24468
|
+
inferredRuntime = (0, import_utils.inferServiceRuntime)({
|
|
24469
|
+
runtime: config.runtime,
|
|
24470
|
+
framework,
|
|
24471
|
+
entrypoint: entrypointFile
|
|
24472
|
+
});
|
|
24414
24473
|
}
|
|
24415
24474
|
if (entrypointIsDirectory && !framework) {
|
|
24416
24475
|
return {
|
|
@@ -24421,6 +24480,16 @@ var require_resolve_v2 = __commonJS({
|
|
|
24421
24480
|
}
|
|
24422
24481
|
};
|
|
24423
24482
|
}
|
|
24483
|
+
const frameworkRuntime = (0, import_utils.inferRuntimeFromFramework)(framework);
|
|
24484
|
+
if (detectedFramework && frameworkRuntime && !entrypointFile) {
|
|
24485
|
+
return {
|
|
24486
|
+
error: {
|
|
24487
|
+
code: "MISSING_SERVICE_CONFIG",
|
|
24488
|
+
message: `Service "${name}" detected framework "${framework}" in "${normalizedRoot}" and must specify an "entrypoint" for runtime "${frameworkRuntime}".`,
|
|
24489
|
+
serviceName: name
|
|
24490
|
+
}
|
|
24491
|
+
};
|
|
24492
|
+
}
|
|
24424
24493
|
const frameworkDefinition = framework ? frameworksBySlug.get(framework) : void 0;
|
|
24425
24494
|
let builderUse;
|
|
24426
24495
|
let builderSrc;
|
|
@@ -24429,16 +24498,26 @@ var require_resolve_v2 = __commonJS({
|
|
|
24429
24498
|
builderSrc = entrypointFile || frameworkDefinition?.useRuntime?.src || "package.json";
|
|
24430
24499
|
} else {
|
|
24431
24500
|
if (!inferredRuntime) {
|
|
24432
|
-
|
|
24433
|
-
|
|
24434
|
-
|
|
24435
|
-
|
|
24436
|
-
|
|
24437
|
-
|
|
24438
|
-
}
|
|
24501
|
+
if (config.buildCommand) {
|
|
24502
|
+
builderUse = "@vercel/static-build";
|
|
24503
|
+
builderSrc = "package.json";
|
|
24504
|
+
} else {
|
|
24505
|
+
builderUse = "@vercel/static";
|
|
24506
|
+
builderSrc = config.outputDirectory ? import_path7.posix.join(config.outputDirectory, "**") : "**";
|
|
24507
|
+
}
|
|
24508
|
+
} else {
|
|
24509
|
+
if (!entrypointFile) {
|
|
24510
|
+
return {
|
|
24511
|
+
error: {
|
|
24512
|
+
code: "MISSING_SERVICE_CONFIG",
|
|
24513
|
+
message: `Service "${name}" must specify an "entrypoint" for runtime "${inferredRuntime}".`,
|
|
24514
|
+
serviceName: name
|
|
24515
|
+
}
|
|
24516
|
+
};
|
|
24517
|
+
}
|
|
24518
|
+
builderUse = inferredRuntime === "node" ? "@vercel/backends" : (0, import_utils.getBuilderForRuntime)(inferredRuntime);
|
|
24519
|
+
builderSrc = entrypointFile;
|
|
24439
24520
|
}
|
|
24440
|
-
builderUse = inferredRuntime === "node" ? "@vercel/backends" : (0, import_utils.getBuilderForRuntime)(inferredRuntime);
|
|
24441
|
-
builderSrc = entrypointFile;
|
|
24442
24521
|
}
|
|
24443
24522
|
const isRoot = normalizedRoot === ".";
|
|
24444
24523
|
const projectRelativeSrc = isRoot ? builderSrc : import_path7.posix.join(normalizedRoot, builderSrc);
|
|
@@ -24449,6 +24528,9 @@ var require_resolve_v2 = __commonJS({
|
|
|
24449
24528
|
if (framework) {
|
|
24450
24529
|
builderConfig.framework = framework;
|
|
24451
24530
|
}
|
|
24531
|
+
if (config.outputDirectory) {
|
|
24532
|
+
builderConfig.outputDirectory = config.outputDirectory;
|
|
24533
|
+
}
|
|
24452
24534
|
if (!isRoot) {
|
|
24453
24535
|
builderConfig.workspace = normalizedRoot;
|
|
24454
24536
|
}
|
|
@@ -24511,6 +24593,14 @@ var require_resolve_v2 = __commonJS({
|
|
|
24511
24593
|
const serviceNames = new Set(Object.keys(services));
|
|
24512
24594
|
for (const service of resolved) {
|
|
24513
24595
|
for (const binding of service.bindings ?? []) {
|
|
24596
|
+
if (!isValidServiceName(binding.service)) {
|
|
24597
|
+
errors.push({
|
|
24598
|
+
code: "INVALID_SERVICE_BINDING_NAME",
|
|
24599
|
+
message: `Service "${service.name}" declares an invalid binding service name "${binding.service}". ${getInvalidServiceNameMessage(binding.service)}`,
|
|
24600
|
+
serviceName: service.name
|
|
24601
|
+
});
|
|
24602
|
+
continue;
|
|
24603
|
+
}
|
|
24514
24604
|
if (!serviceNames.has(binding.service)) {
|
|
24515
24605
|
errors.push({
|
|
24516
24606
|
code: "UNKNOWN_SERVICE_BINDING",
|
|
@@ -35759,6 +35849,15 @@ var build = async ({
|
|
|
35759
35849
|
}) => {
|
|
35760
35850
|
await (0, import_build_utils4.download)(files, workPath, meta);
|
|
35761
35851
|
const routePrefix = config.routePrefix;
|
|
35852
|
+
if (routePrefix) {
|
|
35853
|
+
const mountpointCandidate = routePrefix.replace(/^\//, "") || ".";
|
|
35854
|
+
if (mountpointCandidate.split(/[/\\]/).some((segment) => segment === "..")) {
|
|
35855
|
+
throw new import_build_utils4.NowBuildError({
|
|
35856
|
+
code: "STATIC_BUILD_UNSAFE_ROUTE_PREFIX",
|
|
35857
|
+
message: `Invalid routePrefix "${routePrefix}": path traversal segments are not allowed.`
|
|
35858
|
+
});
|
|
35859
|
+
}
|
|
35860
|
+
}
|
|
35762
35861
|
const mountpoint = routePrefix ? routePrefix.replace(/^\//, "") || "." : import_path6.default.dirname(entrypoint);
|
|
35763
35862
|
const entrypointDir = import_path6.default.join(workPath, import_path6.default.dirname(entrypoint));
|
|
35764
35863
|
let distPath = import_path6.default.join(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/static-build",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.6",
|
|
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/
|
|
18
|
-
"@vercel/gatsby-plugin-vercel-builder": "2.2.
|
|
19
|
-
"@vercel/
|
|
17
|
+
"@vercel/gatsby-plugin-vercel-analytics": "1.0.11",
|
|
18
|
+
"@vercel/gatsby-plugin-vercel-builder": "2.2.26",
|
|
19
|
+
"@vercel/static-config": "3.4.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/aws-lambda": "8.10.64",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"tree-kill": "1.2.2",
|
|
39
39
|
"vitest": "2.0.3",
|
|
40
40
|
"@vercel/error-utils": "2.2.0",
|
|
41
|
-
"@vercel/
|
|
42
|
-
"@vercel/
|
|
43
|
-
"@vercel/fs-detectors": "6.
|
|
41
|
+
"@vercel/build-utils": "13.33.0",
|
|
42
|
+
"@vercel/frameworks": "3.30.6",
|
|
43
|
+
"@vercel/fs-detectors": "6.13.0",
|
|
44
44
|
"@vercel/routing-utils": "6.4.0"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|