@vercel/fs-detectors 7.9.12 → 7.10.1

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.
@@ -96,12 +96,26 @@ var require_constants = __commonJS({
96
96
  ".rb": "ruby",
97
97
  ".ru": "ruby"
98
98
  };
99
- var BUILDER_RUNTIMES = Object.fromEntries(
100
- Object.entries(RUNTIME_BUILDERS).map(([runtime, builder]) => [
101
- builder,
102
- runtime
103
- ])
104
- );
99
+ var BUILDER_RUNTIMES = {
100
+ ...Object.fromEntries(
101
+ Object.entries(RUNTIME_BUILDERS).map(([runtime, builder]) => [
102
+ builder,
103
+ runtime
104
+ ])
105
+ ),
106
+ "@vercel/node": "node",
107
+ "@vercel/next": "node",
108
+ "@vercel/remix-builder": "node",
109
+ "@vercel/redwood": "node",
110
+ "@vercel/hydrogen": "node",
111
+ "@vercel/express": "node",
112
+ "@vercel/hono": "node",
113
+ "@vercel/h3": "node",
114
+ "@vercel/koa": "node",
115
+ "@vercel/nestjs": "node",
116
+ "@vercel/fastify": "node",
117
+ "@vercel/elysia": "node"
118
+ };
105
119
  var STATIC_BUILDERS = /* @__PURE__ */ new Set([
106
120
  "@vercel/static-build",
107
121
  "@vercel/static"
@@ -264,14 +278,12 @@ var require_framework = __commonJS({
264
278
  if (!framework || framework === "container" || framework === "services")
265
279
  return void 0;
266
280
  const f = frameworksBySlug.get(framework);
267
- const declaredBuilder = f?.useRuntime?.use;
281
+ if (!f)
282
+ return void 0;
283
+ const declaredBuilder = f.useRuntime?.use;
268
284
  if (declaredBuilder)
269
285
  return import_constants2.BUILDER_RUNTIMES[declaredBuilder];
270
- const detectorItems = [
271
- ...f?.detectors?.every ?? [],
272
- ...f?.detectors?.some ?? []
273
- ];
274
- return STATIC_BUILDER_RUNTIMES[framework] ?? (detectorItems.some((d) => d.matchPackage !== void 0) ? "node" : void 0);
286
+ return STATIC_BUILDER_RUNTIMES[framework] ?? "node";
275
287
  }
276
288
  function isFrontendFramework(framework) {
277
289
  return !!framework && !inferRuntimeFromFramework(framework);
@@ -333,11 +345,13 @@ var import_build_utils2 = require("@vercel/build-utils");
333
345
  // src/python.ts
334
346
  var import_fs = __toESM(require("fs"));
335
347
  var import_build_utils = require("@vercel/build-utils");
336
- var import_python_analysis = require("@vercel/python-analysis");
337
348
  async function isPythonEntrypoint(fsPath) {
349
+ const {
350
+ findAppOrHandler
351
+ } = require("@vercel/python-analysis");
338
352
  try {
339
353
  const content = await import_fs.default.promises.readFile(fsPath, "utf-8");
340
- return await (0, import_python_analysis.findAppOrHandler)(content) !== null;
354
+ return await findAppOrHandler(content) !== null;
341
355
  } catch (err) {
342
356
  (0, import_build_utils.debug)(`Failed to check Python entrypoint: ${err}`);
343
357
  return false;
@@ -881,21 +895,20 @@ function validateProxy(options, files, framework) {
881
895
  message: `The proxy entrypoint \`${proxy.entrypoint}\` does not exist.`
882
896
  };
883
897
  }
884
- if (framework === "nextjs" || framework === "astro") {
885
- return {
886
- code: "proxy_framework_conflict",
887
- message: `The \`proxy\` property cannot be used with ${framework === "nextjs" ? "Next.js" : "Astro"} because the framework builds its own routing middleware.`
888
- };
889
- }
890
898
  const appRuntime = (0, import_framework.inferBuilderRuntimeFromFramework)(framework);
891
- const { file: proxyFile } = parseProxyEntrypoint(proxy.entrypoint);
892
- const proxyRuntime = import_constants.ENTRYPOINT_EXTENSIONS[(0, import_path.extname)(proxyFile)];
899
+ const proxyRuntime = import_constants.ENTRYPOINT_EXTENSIONS[(0, import_path.extname)(file)];
893
900
  if (appRuntime !== void 0 && proxyRuntime !== void 0 && appRuntime !== proxyRuntime) {
894
901
  return {
895
902
  code: "proxy_runtime_mismatch",
896
903
  message: `The proxy entrypoint \`${proxy.entrypoint}\` uses the ${proxyRuntime} runtime, but the app uses the ${appRuntime} runtime. The proxy and app must use the same runtime.`
897
904
  };
898
905
  }
906
+ if (framework === "nextjs" || framework === "astro") {
907
+ return {
908
+ code: "proxy_framework_conflict",
909
+ message: `The \`proxy\` property cannot be used with ${framework === "nextjs" ? "Next.js" : "Astro"} because the framework builds its own routing middleware.`
910
+ };
911
+ }
899
912
  return null;
900
913
  }
901
914
  function hasBuildScript(pkg) {
package/dist/python.js CHANGED
@@ -33,11 +33,13 @@ __export(python_exports, {
33
33
  module.exports = __toCommonJS(python_exports);
34
34
  var import_fs = __toESM(require("fs"));
35
35
  var import_build_utils = require("@vercel/build-utils");
36
- var import_python_analysis = require("@vercel/python-analysis");
37
36
  async function isPythonEntrypoint(fsPath) {
37
+ const {
38
+ findAppOrHandler
39
+ } = require("@vercel/python-analysis");
38
40
  try {
39
41
  const content = await import_fs.default.promises.readFile(fsPath, "utf-8");
40
- return await (0, import_python_analysis.findAppOrHandler)(content) !== null;
42
+ return await findAppOrHandler(content) !== null;
41
43
  } catch (err) {
42
44
  (0, import_build_utils.debug)(`Failed to check Python entrypoint: ${err}`);
43
45
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/fs-detectors",
3
- "version": "7.9.12",
3
+ "version": "7.10.1",
4
4
  "description": "Vercel filesystem detectors",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -20,11 +20,11 @@
20
20
  "minimatch": "3.1.2",
21
21
  "semver": "6.3.1",
22
22
  "smol-toml": "1.5.2",
23
- "@vercel/frameworks": "3.35.0",
24
- "@vercel/python-analysis": "0.15.1",
25
- "@vercel/routing-utils": "6.6.0",
26
23
  "@vercel/error-utils": "2.2.1",
27
- "@vercel/build-utils": "14.22.0"
24
+ "@vercel/frameworks": "3.35.0",
25
+ "@vercel/python-analysis": "0.15.2",
26
+ "@vercel/build-utils": "15.0.0",
27
+ "@vercel/routing-utils": "6.6.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/glob": "7.2.0",
@@ -33,7 +33,7 @@
33
33
  "@types/node": "20.11.0",
34
34
  "@types/semver": "7.3.10",
35
35
  "vitest": "4.1.10",
36
- "@vercel-internals/runtimes": "1.1.19"
36
+ "@vercel-internals/runtimes": "1.2.1"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "node build.mjs",