@vercel/static-build 4.0.0 → 5.0.3

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 +27 -10
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -11135,7 +11135,6 @@ var require_frameworks = __commonJS({
11135
11135
  {
11136
11136
  name: "Rust",
11137
11137
  slug: "rust",
11138
- experimental: true,
11139
11138
  runtimeFramework: true,
11140
11139
  logo: "https://api-frameworks.vercel.sh/framework-logos/rust.svg",
11141
11140
  tagline: "A language empowering everyone to build reliable and efficient software.",
@@ -11144,6 +11143,8 @@ var require_frameworks = __commonJS({
11144
11143
  useRuntime: { src: "src/main.rs", use: "@vercel/rust" },
11145
11144
  ignoreRuntimes: ["@vercel/rust"],
11146
11145
  detectors: {
11146
+ // Do not detect on `[[bin]]` declarations: `api/**/*.rs` projects
11147
+ // declare one per handler and must stay framework-less.
11147
11148
  every: [
11148
11149
  {
11149
11150
  path: "Cargo.toml"
@@ -32339,7 +32340,10 @@ var require_detect_builders = __commonJS({
32339
32340
  const absolutePathCache = /* @__PURE__ */ new Map();
32340
32341
  const { buildCommand, outputDirectory } = projectSettings;
32341
32342
  const frameworkConfig = slugToFramework.get(framework || "");
32342
- const ignoreRuntimes = new Set(frameworkConfig?.ignoreRuntimes);
32343
+ const rustStaticOutput = isRustStaticOutput(framework, projectSettings);
32344
+ const ignoreRuntimes = new Set(
32345
+ rustStaticOutput ? void 0 : frameworkConfig?.ignoreRuntimes
32346
+ );
32343
32347
  const withTag = options.tag ? `@${options.tag}` : "";
32344
32348
  const apiMatches = getApiMatches().filter(
32345
32349
  (b) => (
@@ -32414,7 +32418,8 @@ var require_detect_builders = __commonJS({
32414
32418
  addToUsedFunctions(proxyBuilder);
32415
32419
  apiBuilders.unshift(proxyBuilder);
32416
32420
  }
32417
- if (!makeFrontendStatic && (hasBuildScript(pkg) || buildCommand || framework)) {
32421
+ const rustStaticPrebuilt = rustStaticOutput && !pkg && !buildCommand;
32422
+ if (!makeFrontendStatic && !rustStaticPrebuilt && (hasBuildScript(pkg) || buildCommand || framework)) {
32418
32423
  frontendBuilder = detectFrontBuilder(
32419
32424
  pkg,
32420
32425
  files,
@@ -32711,6 +32716,10 @@ var require_detect_builders = __commonJS({
32711
32716
  const { scripts = {} } = pkg || {};
32712
32717
  return Boolean(scripts && scripts["build"]);
32713
32718
  }
32719
+ function isRustStaticOutput(framework, projectSettings) {
32720
+ return framework === "rust" && typeof projectSettings.outputDirectory === "string" && projectSettings.outputDirectory !== "" && // The framework preset's display default; not a real directory.
32721
+ projectSettings.outputDirectory !== "N/A";
32722
+ }
32714
32723
  function detectFrontBuilder(pkg, files, usedFunctions, fallbackEntrypoint, options) {
32715
32724
  const { tag, projectSettings = {} } = options;
32716
32725
  const withTag = tag ? `@${tag}` : "";
@@ -32756,7 +32765,7 @@ var require_detect_builders = __commonJS({
32756
32765
  });
32757
32766
  }
32758
32767
  const f = slugToFramework.get(framework || "");
32759
- if (f && f.useRuntime) {
32768
+ if (f && f.useRuntime && !isRustStaticOutput(framework, projectSettings)) {
32760
32769
  const { src, use } = f.useRuntime;
32761
32770
  const shouldUseUnifiedBackend = (0, import_build_utils5.isExperimentalBackendsEnabled)() && import_build_utils5.BACKEND_BUILDERS.includes(use);
32762
32771
  const finalUse = shouldUseUnifiedBackend ? import_build_utils5.UNIFIED_BACKEND_BUILDER : use;
@@ -41365,7 +41374,8 @@ async function getBuildOutputDirectory(workingDir) {
41365
41374
  return void 0;
41366
41375
  }
41367
41376
  async function readBuildOutputDirectory2({
41368
- workPath
41377
+ workPath,
41378
+ span
41369
41379
  }) {
41370
41380
  const functions = {};
41371
41381
  const routes = [];
@@ -41381,7 +41391,12 @@ async function readBuildOutputDirectory2({
41381
41391
  regions: (() => {
41382
41392
  try {
41383
41393
  const project = new import_ts_morph.Project();
41384
- const config = (0, import_static_config.getConfig)(project, middleware.file.fsPath);
41394
+ const config = (0, import_static_config.getConfig)(
41395
+ project,
41396
+ middleware.file.fsPath,
41397
+ void 0,
41398
+ span
41399
+ );
41385
41400
  return config?.regions;
41386
41401
  } catch (_err) {
41387
41402
  return void 0;
@@ -41452,11 +41467,12 @@ async function readStaticFiles2({
41452
41467
  });
41453
41468
  return staticFiles;
41454
41469
  }
41455
- async function createBuildOutput(workPath) {
41470
+ async function createBuildOutput(workPath, span) {
41456
41471
  let output = {};
41457
41472
  const routes = [];
41458
41473
  const extraOutputs = await readBuildOutputDirectory2({
41459
- workPath
41474
+ workPath,
41475
+ span
41460
41476
  });
41461
41477
  if (extraOutputs.routes) {
41462
41478
  routes.push(...extraOutputs.routes);
@@ -42170,7 +42186,8 @@ var build = async ({
42170
42186
  repoRootPath,
42171
42187
  config,
42172
42188
  meta = {},
42173
- service
42189
+ service,
42190
+ span
42174
42191
  }) => {
42175
42192
  await (0, import_build_utils4.download)(files, workPath, meta);
42176
42193
  const routePrefix = config.routePrefix;
@@ -42549,7 +42566,7 @@ Details: https://err.sh/vercel/vercel/now-static-build-failed-to-detect-a-server
42549
42566
  }
42550
42567
  const buildOutputPathV2 = await getBuildOutputDirectory(outputDirPrefix);
42551
42568
  if (buildOutputPathV2) {
42552
- return await createBuildOutput(workPath);
42569
+ return await createBuildOutput(workPath, span);
42553
42570
  }
42554
42571
  const extraOutputs = await readBuildOutputDirectory({
42555
42572
  workPath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/static-build",
3
- "version": "4.0.0",
3
+ "version": "5.0.3",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/build-step",
@@ -14,12 +14,12 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "ts-morph": "12.0.0",
17
- "@vercel/gatsby-plugin-vercel-builder": "2.2.44",
18
17
  "@vercel/gatsby-plugin-vercel-analytics": "1.0.12",
19
- "@vercel/static-config": "3.4.1"
18
+ "@vercel/gatsby-plugin-vercel-builder": "2.2.47",
19
+ "@vercel/static-config": "3.4.3"
20
20
  },
21
21
  "peerDependencies": {
22
- "@vercel/build-utils": "14.4.0"
22
+ "@vercel/build-utils": "14.5.1"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/aws-lambda": "8.10.64",
@@ -40,10 +40,10 @@
40
40
  "semver": "7.5.2",
41
41
  "tree-kill": "1.2.2",
42
42
  "vitest": "4.1.10",
43
- "@vercel/build-utils": "14.4.0",
43
+ "@vercel/build-utils": "14.5.1",
44
44
  "@vercel/error-utils": "2.2.1",
45
- "@vercel/frameworks": "3.32.0",
46
- "@vercel/fs-detectors": "7.0.1",
45
+ "@vercel/frameworks": "3.33.0",
46
+ "@vercel/fs-detectors": "7.1.2",
47
47
  "@vercel/routing-utils": "6.5.0"
48
48
  },
49
49
  "scripts": {