@vercel/fs-detectors 7.9.10 → 7.10.0
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/detect-builders.js +58 -20
- package/package.json +4 -4
package/dist/detect-builders.js
CHANGED
|
@@ -96,12 +96,26 @@ var require_constants = __commonJS({
|
|
|
96
96
|
".rb": "ruby",
|
|
97
97
|
".ru": "ruby"
|
|
98
98
|
};
|
|
99
|
-
var BUILDER_RUNTIMES =
|
|
100
|
-
Object.
|
|
101
|
-
builder
|
|
102
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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);
|
|
@@ -661,6 +673,25 @@ async function detectBuilders(files, pkg, options = {}) {
|
|
|
661
673
|
});
|
|
662
674
|
}
|
|
663
675
|
}
|
|
676
|
+
const ignoredInstallCommandPatterns = /* @__PURE__ */ new Set();
|
|
677
|
+
for (const builder of apiBuilders) {
|
|
678
|
+
if (isOfficialRuntime("node", builder.use)) {
|
|
679
|
+
continue;
|
|
680
|
+
}
|
|
681
|
+
for (const [pattern, func] of Object.entries(
|
|
682
|
+
builder.config?.functions ?? {}
|
|
683
|
+
)) {
|
|
684
|
+
if (func.installCommand !== void 0) {
|
|
685
|
+
ignoredInstallCommandPatterns.add(pattern);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
for (const pattern of ignoredInstallCommandPatterns) {
|
|
690
|
+
warnings.push({
|
|
691
|
+
code: "unsupported_function_install_command",
|
|
692
|
+
message: `The \`installCommand\` property in \`functions["${pattern}"]\` is only supported for Node.js functions and will be ignored for other runtimes.`
|
|
693
|
+
});
|
|
694
|
+
}
|
|
664
695
|
const routesResult = getRouteResult(
|
|
665
696
|
apiRoutes,
|
|
666
697
|
dynamicRoutes,
|
|
@@ -862,21 +893,20 @@ function validateProxy(options, files, framework) {
|
|
|
862
893
|
message: `The proxy entrypoint \`${proxy.entrypoint}\` does not exist.`
|
|
863
894
|
};
|
|
864
895
|
}
|
|
865
|
-
if (framework === "nextjs" || framework === "astro") {
|
|
866
|
-
return {
|
|
867
|
-
code: "proxy_framework_conflict",
|
|
868
|
-
message: `The \`proxy\` property cannot be used with ${framework === "nextjs" ? "Next.js" : "Astro"} because the framework builds its own routing middleware.`
|
|
869
|
-
};
|
|
870
|
-
}
|
|
871
896
|
const appRuntime = (0, import_framework.inferBuilderRuntimeFromFramework)(framework);
|
|
872
|
-
const
|
|
873
|
-
const proxyRuntime = import_constants.ENTRYPOINT_EXTENSIONS[(0, import_path.extname)(proxyFile)];
|
|
897
|
+
const proxyRuntime = import_constants.ENTRYPOINT_EXTENSIONS[(0, import_path.extname)(file)];
|
|
874
898
|
if (appRuntime !== void 0 && proxyRuntime !== void 0 && appRuntime !== proxyRuntime) {
|
|
875
899
|
return {
|
|
876
900
|
code: "proxy_runtime_mismatch",
|
|
877
901
|
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.`
|
|
878
902
|
};
|
|
879
903
|
}
|
|
904
|
+
if (framework === "nextjs" || framework === "astro") {
|
|
905
|
+
return {
|
|
906
|
+
code: "proxy_framework_conflict",
|
|
907
|
+
message: `The \`proxy\` property cannot be used with ${framework === "nextjs" ? "Next.js" : "Astro"} because the framework builds its own routing middleware.`
|
|
908
|
+
};
|
|
909
|
+
}
|
|
880
910
|
return null;
|
|
881
911
|
}
|
|
882
912
|
function hasBuildScript(pkg) {
|
|
@@ -1035,6 +1065,14 @@ function validateFunctions({ functions = {} }) {
|
|
|
1035
1065
|
};
|
|
1036
1066
|
}
|
|
1037
1067
|
}
|
|
1068
|
+
if (func.installCommand !== void 0) {
|
|
1069
|
+
if (typeof func.installCommand !== "string") {
|
|
1070
|
+
return {
|
|
1071
|
+
code: "invalid_function_property",
|
|
1072
|
+
message: `The property \`installCommand\` must be a string.`
|
|
1073
|
+
};
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1038
1076
|
}
|
|
1039
1077
|
return null;
|
|
1040
1078
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/fs-detectors",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.10.0",
|
|
4
4
|
"description": "Vercel filesystem detectors",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"minimatch": "3.1.2",
|
|
21
21
|
"semver": "6.3.1",
|
|
22
22
|
"smol-toml": "1.5.2",
|
|
23
|
-
"@vercel/build-utils": "14.
|
|
23
|
+
"@vercel/build-utils": "14.23.0",
|
|
24
24
|
"@vercel/error-utils": "2.2.1",
|
|
25
25
|
"@vercel/frameworks": "3.35.0",
|
|
26
|
-
"@vercel/python-analysis": "0.15.
|
|
26
|
+
"@vercel/python-analysis": "0.15.2",
|
|
27
27
|
"@vercel/routing-utils": "6.6.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
@@ -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.
|
|
36
|
+
"@vercel-internals/runtimes": "1.2.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "node build.mjs",
|