@vercel/fs-detectors 7.0.1 → 7.1.2

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.
@@ -162,7 +162,10 @@ async function detectBuilders(files, pkg, options = {}) {
162
162
  const absolutePathCache = /* @__PURE__ */ new Map();
163
163
  const { buildCommand, outputDirectory } = projectSettings;
164
164
  const frameworkConfig = slugToFramework.get(framework || "");
165
- const ignoreRuntimes = new Set(frameworkConfig?.ignoreRuntimes);
165
+ const rustStaticOutput = isRustStaticOutput(framework, projectSettings);
166
+ const ignoreRuntimes = new Set(
167
+ rustStaticOutput ? void 0 : frameworkConfig?.ignoreRuntimes
168
+ );
166
169
  const withTag = options.tag ? `@${options.tag}` : "";
167
170
  const apiMatches = getApiMatches().filter(
168
171
  (b) => (
@@ -237,7 +240,8 @@ async function detectBuilders(files, pkg, options = {}) {
237
240
  addToUsedFunctions(proxyBuilder);
238
241
  apiBuilders.unshift(proxyBuilder);
239
242
  }
240
- if (!makeFrontendStatic && (hasBuildScript(pkg) || buildCommand || framework)) {
243
+ const rustStaticPrebuilt = rustStaticOutput && !pkg && !buildCommand;
244
+ if (!makeFrontendStatic && !rustStaticPrebuilt && (hasBuildScript(pkg) || buildCommand || framework)) {
241
245
  frontendBuilder = detectFrontBuilder(
242
246
  pkg,
243
247
  files,
@@ -534,6 +538,10 @@ function hasBuildScript(pkg) {
534
538
  const { scripts = {} } = pkg || {};
535
539
  return Boolean(scripts && scripts["build"]);
536
540
  }
541
+ function isRustStaticOutput(framework, projectSettings) {
542
+ return framework === "rust" && typeof projectSettings.outputDirectory === "string" && projectSettings.outputDirectory !== "" && // The framework preset's display default; not a real directory.
543
+ projectSettings.outputDirectory !== "N/A";
544
+ }
537
545
  function detectFrontBuilder(pkg, files, usedFunctions, fallbackEntrypoint, options) {
538
546
  const { tag, projectSettings = {} } = options;
539
547
  const withTag = tag ? `@${tag}` : "";
@@ -579,7 +587,7 @@ function detectFrontBuilder(pkg, files, usedFunctions, fallbackEntrypoint, optio
579
587
  });
580
588
  }
581
589
  const f = slugToFramework.get(framework || "");
582
- if (f && f.useRuntime) {
590
+ if (f && f.useRuntime && !isRustStaticOutput(framework, projectSettings)) {
583
591
  const { src, use } = f.useRuntime;
584
592
  const shouldUseUnifiedBackend = (0, import_build_utils.isExperimentalBackendsEnabled)() && import_build_utils.BACKEND_BUILDERS.includes(use);
585
593
  const finalUse = shouldUseUnifiedBackend ? import_build_utils.UNIFIED_BACKEND_BUILDER : use;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/fs-detectors",
3
- "version": "7.0.1",
3
+ "version": "7.1.2",
4
4
  "description": "Vercel filesystem detectors",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -19,9 +19,9 @@
19
19
  "json5": "2.2.2",
20
20
  "minimatch": "3.1.2",
21
21
  "semver": "6.3.1",
22
- "@vercel/build-utils": "14.4.0",
22
+ "@vercel/build-utils": "14.5.1",
23
23
  "@vercel/error-utils": "2.2.1",
24
- "@vercel/frameworks": "3.32.0",
24
+ "@vercel/frameworks": "3.33.0",
25
25
  "@vercel/python-analysis": "0.14.0",
26
26
  "@vercel/routing-utils": "6.5.0"
27
27
  },