@vercel/static-build 2.11.4 → 2.11.5

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 +120 -24
  2. 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/other.svg",
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",
@@ -24202,7 +24252,14 @@ var require_resolve_v2 = __commonJS({
24202
24252
  var import_resolve = require_resolve();
24203
24253
  var import_utils = require_utils4();
24204
24254
  var frameworksBySlug = new Map(import_frameworks2.frameworkList.map((f) => [f.slug, f]));
24205
- var SERVICE_NAME_REGEX = /^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$/;
24255
+ var MAX_SERVICE_NAME_LENGTH = 64;
24256
+ var SERVICE_NAME_REGEX = /^[a-z]([a-z_-]*[a-z])?$/;
24257
+ function isValidServiceName(name) {
24258
+ return name.length <= MAX_SERVICE_NAME_LENGTH && SERVICE_NAME_REGEX.test(name);
24259
+ }
24260
+ function getInvalidServiceNameMessage(name) {
24261
+ 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.`;
24262
+ }
24206
24263
  var CONTAINER_ENTRYPOINT_CANDIDATES = [
24207
24264
  "Dockerfile.vercel",
24208
24265
  "Containerfile.vercel",
@@ -24294,10 +24351,10 @@ var require_resolve_v2 = __commonJS({
24294
24351
  };
24295
24352
  }
24296
24353
  function validateServiceConfigV22(name, config) {
24297
- if (!SERVICE_NAME_REGEX.test(name)) {
24354
+ if (!isValidServiceName(name)) {
24298
24355
  return {
24299
24356
  code: "INVALID_SERVICE_NAME",
24300
- message: `Service name "${name}" is invalid. Names must start with a letter, end with an alphanumeric character, and contain only alphanumeric characters, hyphens, and underscores.`,
24357
+ message: getInvalidServiceNameMessage(name),
24301
24358
  serviceName: name
24302
24359
  };
24303
24360
  }
@@ -24354,14 +24411,6 @@ var require_resolve_v2 = __commonJS({
24354
24411
  };
24355
24412
  }
24356
24413
  }
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
24414
  return null;
24366
24415
  }
24367
24416
  async function resolveConfiguredServiceV22(name, config, fs5) {
@@ -24393,14 +24442,15 @@ var require_resolve_v2 = __commonJS({
24393
24442
  entrypointIsDirectory = Boolean(resolved.entrypoint?.isDirectory);
24394
24443
  }
24395
24444
  const entrypointFile = entrypointIsDirectory || !normalizedEntrypoint ? void 0 : normalizedEntrypoint;
24396
- const inferredRuntime = (0, import_utils.inferServiceRuntime)({
24445
+ let inferredRuntime = (0, import_utils.inferServiceRuntime)({
24397
24446
  runtime: config.runtime,
24398
24447
  framework: config.framework,
24399
24448
  entrypoint: entrypointFile
24400
24449
  });
24401
24450
  let framework = config.framework;
24402
- if (!framework && normalizedEntrypoint) {
24403
- const workspace = entrypointIsDirectory ? normalizedEntrypoint : import_path7.posix.dirname(normalizedEntrypoint) || ".";
24451
+ let detectedFramework = false;
24452
+ if (!framework) {
24453
+ const workspace = entrypointIsDirectory && normalizedEntrypoint ? normalizedEntrypoint : ".";
24404
24454
  const detection = await (0, import_resolve.detectFrameworkFromWorkspace)({
24405
24455
  fs: serviceFs,
24406
24456
  workspace,
@@ -24411,6 +24461,12 @@ var require_resolve_v2 = __commonJS({
24411
24461
  return { error: detection.error };
24412
24462
  }
24413
24463
  framework = detection.framework;
24464
+ detectedFramework = Boolean(framework);
24465
+ inferredRuntime = (0, import_utils.inferServiceRuntime)({
24466
+ runtime: config.runtime,
24467
+ framework,
24468
+ entrypoint: entrypointFile
24469
+ });
24414
24470
  }
24415
24471
  if (entrypointIsDirectory && !framework) {
24416
24472
  return {
@@ -24421,6 +24477,16 @@ var require_resolve_v2 = __commonJS({
24421
24477
  }
24422
24478
  };
24423
24479
  }
24480
+ const frameworkRuntime = (0, import_utils.inferRuntimeFromFramework)(framework);
24481
+ if (detectedFramework && frameworkRuntime && !entrypointFile) {
24482
+ return {
24483
+ error: {
24484
+ code: "MISSING_SERVICE_CONFIG",
24485
+ message: `Service "${name}" detected framework "${framework}" in "${normalizedRoot}" and must specify an "entrypoint" for runtime "${frameworkRuntime}".`,
24486
+ serviceName: name
24487
+ }
24488
+ };
24489
+ }
24424
24490
  const frameworkDefinition = framework ? frameworksBySlug.get(framework) : void 0;
24425
24491
  let builderUse;
24426
24492
  let builderSrc;
@@ -24429,16 +24495,26 @@ var require_resolve_v2 = __commonJS({
24429
24495
  builderSrc = entrypointFile || frameworkDefinition?.useRuntime?.src || "package.json";
24430
24496
  } else {
24431
24497
  if (!inferredRuntime) {
24432
- return {
24433
- error: {
24434
- code: "MISSING_SERVICE_CONFIG",
24435
- message: `Service "${name}" must specify "framework" or a runtime-resolvable "entrypoint".`,
24436
- serviceName: name
24437
- }
24438
- };
24498
+ if (config.buildCommand) {
24499
+ builderUse = "@vercel/static-build";
24500
+ builderSrc = "package.json";
24501
+ } else {
24502
+ builderUse = "@vercel/static";
24503
+ builderSrc = config.outputDirectory ? import_path7.posix.join(config.outputDirectory, "**") : "**";
24504
+ }
24505
+ } else {
24506
+ if (!entrypointFile) {
24507
+ return {
24508
+ error: {
24509
+ code: "MISSING_SERVICE_CONFIG",
24510
+ message: `Service "${name}" must specify an "entrypoint" for runtime "${inferredRuntime}".`,
24511
+ serviceName: name
24512
+ }
24513
+ };
24514
+ }
24515
+ builderUse = inferredRuntime === "node" ? "@vercel/backends" : (0, import_utils.getBuilderForRuntime)(inferredRuntime);
24516
+ builderSrc = entrypointFile;
24439
24517
  }
24440
- builderUse = inferredRuntime === "node" ? "@vercel/backends" : (0, import_utils.getBuilderForRuntime)(inferredRuntime);
24441
- builderSrc = entrypointFile;
24442
24518
  }
24443
24519
  const isRoot = normalizedRoot === ".";
24444
24520
  const projectRelativeSrc = isRoot ? builderSrc : import_path7.posix.join(normalizedRoot, builderSrc);
@@ -24449,6 +24525,9 @@ var require_resolve_v2 = __commonJS({
24449
24525
  if (framework) {
24450
24526
  builderConfig.framework = framework;
24451
24527
  }
24528
+ if (config.outputDirectory) {
24529
+ builderConfig.outputDirectory = config.outputDirectory;
24530
+ }
24452
24531
  if (!isRoot) {
24453
24532
  builderConfig.workspace = normalizedRoot;
24454
24533
  }
@@ -24511,6 +24590,14 @@ var require_resolve_v2 = __commonJS({
24511
24590
  const serviceNames = new Set(Object.keys(services));
24512
24591
  for (const service of resolved) {
24513
24592
  for (const binding of service.bindings ?? []) {
24593
+ if (!isValidServiceName(binding.service)) {
24594
+ errors.push({
24595
+ code: "INVALID_SERVICE_BINDING_NAME",
24596
+ message: `Service "${service.name}" declares an invalid binding service name "${binding.service}". ${getInvalidServiceNameMessage(binding.service)}`,
24597
+ serviceName: service.name
24598
+ });
24599
+ continue;
24600
+ }
24514
24601
  if (!serviceNames.has(binding.service)) {
24515
24602
  errors.push({
24516
24603
  code: "UNKNOWN_SERVICE_BINDING",
@@ -35759,6 +35846,15 @@ var build = async ({
35759
35846
  }) => {
35760
35847
  await (0, import_build_utils4.download)(files, workPath, meta);
35761
35848
  const routePrefix = config.routePrefix;
35849
+ if (routePrefix) {
35850
+ const mountpointCandidate = routePrefix.replace(/^\//, "") || ".";
35851
+ if (mountpointCandidate.split(/[/\\]/).some((segment) => segment === "..")) {
35852
+ throw new import_build_utils4.NowBuildError({
35853
+ code: "STATIC_BUILD_UNSAFE_ROUTE_PREFIX",
35854
+ message: `Invalid routePrefix "${routePrefix}": path traversal segments are not allowed.`
35855
+ });
35856
+ }
35857
+ }
35762
35858
  const mountpoint = routePrefix ? routePrefix.replace(/^\//, "") || "." : import_path6.default.dirname(entrypoint);
35763
35859
  const entrypointDir = import_path6.default.join(workPath, import_path6.default.dirname(entrypoint));
35764
35860
  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.4",
3
+ "version": "2.11.5",
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
- "@vercel/gatsby-plugin-vercel-builder": "2.2.24",
19
- "@vercel/gatsby-plugin-vercel-analytics": "1.0.11"
17
+ "@vercel/gatsby-plugin-vercel-analytics": "1.0.11",
18
+ "@vercel/gatsby-plugin-vercel-builder": "2.2.25",
19
+ "@vercel/static-config": "3.4.0"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/aws-lambda": "8.10.64",
@@ -37,10 +37,10 @@
37
37
  "semver": "7.5.2",
38
38
  "tree-kill": "1.2.2",
39
39
  "vitest": "2.0.3",
40
+ "@vercel/build-utils": "13.32.3",
41
+ "@vercel/frameworks": "3.30.6",
40
42
  "@vercel/error-utils": "2.2.0",
41
- "@vercel/frameworks": "3.30.1",
42
- "@vercel/build-utils": "13.32.2",
43
- "@vercel/fs-detectors": "6.11.1",
43
+ "@vercel/fs-detectors": "6.12.1",
44
44
  "@vercel/routing-utils": "6.4.0"
45
45
  },
46
46
  "scripts": {