@vercel/fs-detectors 7.6.1 → 7.6.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.
- package/dist/detect-builders.js +246 -25
- package/package.json +4 -4
package/dist/detect-builders.js
CHANGED
|
@@ -5,6 +5,9 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
8
11
|
var __export = (target, all) => {
|
|
9
12
|
for (var name in all)
|
|
10
13
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -26,6 +29,189 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
29
|
mod
|
|
27
30
|
));
|
|
28
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
|
+
|
|
33
|
+
// ../../internals/runtimes/dist/constants.js
|
|
34
|
+
var require_constants = __commonJS({
|
|
35
|
+
"../../internals/runtimes/dist/constants.js"(exports, module2) {
|
|
36
|
+
"use strict";
|
|
37
|
+
var __defProp2 = Object.defineProperty;
|
|
38
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
39
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
40
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
41
|
+
var __export2 = (target, all) => {
|
|
42
|
+
for (var name in all)
|
|
43
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
44
|
+
};
|
|
45
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
46
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
47
|
+
for (let key of __getOwnPropNames2(from))
|
|
48
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
49
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
50
|
+
}
|
|
51
|
+
return to;
|
|
52
|
+
};
|
|
53
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
54
|
+
var constants_exports = {};
|
|
55
|
+
__export2(constants_exports, {
|
|
56
|
+
BUILDER_RUNTIMES: () => BUILDER_RUNTIMES,
|
|
57
|
+
CONTAINER_ENTRYPOINT_CANDIDATES: () => CONTAINER_ENTRYPOINT_CANDIDATES,
|
|
58
|
+
ENTRYPOINT_EXTENSIONS: () => ENTRYPOINT_EXTENSIONS2,
|
|
59
|
+
ROUTE_OWNING_BUILDERS: () => ROUTE_OWNING_BUILDERS,
|
|
60
|
+
RUNTIME_BUILDERS: () => RUNTIME_BUILDERS,
|
|
61
|
+
RUNTIME_MANIFESTS: () => RUNTIME_MANIFESTS,
|
|
62
|
+
STATIC_BUILDERS: () => STATIC_BUILDERS
|
|
63
|
+
});
|
|
64
|
+
module2.exports = __toCommonJS2(constants_exports);
|
|
65
|
+
var RUNTIME_BUILDERS = {
|
|
66
|
+
node: "@vercel/backends",
|
|
67
|
+
python: "@vercel/python",
|
|
68
|
+
go: "@vercel/go",
|
|
69
|
+
rust: "@vercel/rust",
|
|
70
|
+
ruby: "@vercel/ruby",
|
|
71
|
+
container: "@vercel/container"
|
|
72
|
+
};
|
|
73
|
+
var RUNTIME_MANIFESTS = {
|
|
74
|
+
node: ["package.json"],
|
|
75
|
+
python: [
|
|
76
|
+
"pyproject.toml",
|
|
77
|
+
"requirements.txt",
|
|
78
|
+
"Pipfile",
|
|
79
|
+
"pylock.yml",
|
|
80
|
+
"uv.lock",
|
|
81
|
+
"setup.py"
|
|
82
|
+
],
|
|
83
|
+
go: ["go.mod"],
|
|
84
|
+
ruby: ["Gemfile"],
|
|
85
|
+
rust: ["Cargo.toml"]
|
|
86
|
+
};
|
|
87
|
+
var ENTRYPOINT_EXTENSIONS2 = {
|
|
88
|
+
".ts": "node",
|
|
89
|
+
".mts": "node",
|
|
90
|
+
".js": "node",
|
|
91
|
+
".mjs": "node",
|
|
92
|
+
".cjs": "node",
|
|
93
|
+
".py": "python",
|
|
94
|
+
".go": "go",
|
|
95
|
+
".rs": "rust",
|
|
96
|
+
".rb": "ruby",
|
|
97
|
+
".ru": "ruby"
|
|
98
|
+
};
|
|
99
|
+
var BUILDER_RUNTIMES = Object.fromEntries(
|
|
100
|
+
Object.entries(RUNTIME_BUILDERS).map(([runtime, builder]) => [
|
|
101
|
+
builder,
|
|
102
|
+
runtime
|
|
103
|
+
])
|
|
104
|
+
);
|
|
105
|
+
var STATIC_BUILDERS = /* @__PURE__ */ new Set([
|
|
106
|
+
"@vercel/static-build",
|
|
107
|
+
"@vercel/static"
|
|
108
|
+
]);
|
|
109
|
+
var ROUTE_OWNING_BUILDERS = /* @__PURE__ */ new Set([
|
|
110
|
+
"@vercel/next",
|
|
111
|
+
"@vercel/backends"
|
|
112
|
+
]);
|
|
113
|
+
var CONTAINER_ENTRYPOINT_CANDIDATES = [
|
|
114
|
+
"Dockerfile.vercel",
|
|
115
|
+
"Containerfile.vercel",
|
|
116
|
+
"Dockerfile",
|
|
117
|
+
"Containerfile"
|
|
118
|
+
];
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
// ../../internals/runtimes/dist/framework.js
|
|
123
|
+
var require_framework = __commonJS({
|
|
124
|
+
"../../internals/runtimes/dist/framework.js"(exports, module2) {
|
|
125
|
+
"use strict";
|
|
126
|
+
var __defProp2 = Object.defineProperty;
|
|
127
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
128
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
129
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
130
|
+
var __export2 = (target, all) => {
|
|
131
|
+
for (var name in all)
|
|
132
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
133
|
+
};
|
|
134
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
135
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
136
|
+
for (let key of __getOwnPropNames2(from))
|
|
137
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
138
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
139
|
+
}
|
|
140
|
+
return to;
|
|
141
|
+
};
|
|
142
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
143
|
+
var framework_exports = {};
|
|
144
|
+
__export2(framework_exports, {
|
|
145
|
+
DETECTION_FRAMEWORKS: () => DETECTION_FRAMEWORKS,
|
|
146
|
+
filterFrameworksByRuntime: () => filterFrameworksByRuntime,
|
|
147
|
+
frameworksBySlug: () => frameworksBySlug,
|
|
148
|
+
inferBuilderRuntimeFromFramework: () => inferBuilderRuntimeFromFramework2,
|
|
149
|
+
inferRuntimeFromFramework: () => inferRuntimeFromFramework,
|
|
150
|
+
isBFFFramework: () => isBFFFramework,
|
|
151
|
+
isFrontendFramework: () => isFrontendFramework
|
|
152
|
+
});
|
|
153
|
+
module2.exports = __toCommonJS2(framework_exports);
|
|
154
|
+
var import_build_utils3 = require("@vercel/build-utils");
|
|
155
|
+
var import_frameworks2 = require("@vercel/frameworks");
|
|
156
|
+
var import_constants2 = require_constants();
|
|
157
|
+
var frameworksBySlug = new Map(
|
|
158
|
+
import_frameworks2.frameworkList.flatMap((f) => typeof f.slug === "string" ? [[f.slug, f]] : [])
|
|
159
|
+
);
|
|
160
|
+
var DETECTION_FRAMEWORKS = import_frameworks2.frameworkList.filter(
|
|
161
|
+
(framework) => !framework.experimental || framework.runtimeFramework
|
|
162
|
+
);
|
|
163
|
+
function inferRuntimeFromFramework(framework) {
|
|
164
|
+
if (!framework)
|
|
165
|
+
return void 0;
|
|
166
|
+
if (framework in import_constants2.RUNTIME_BUILDERS)
|
|
167
|
+
return framework;
|
|
168
|
+
if ((0, import_build_utils3.isPythonFramework)(framework))
|
|
169
|
+
return "python";
|
|
170
|
+
if ((0, import_build_utils3.isBackendFramework)(framework))
|
|
171
|
+
return "node";
|
|
172
|
+
return void 0;
|
|
173
|
+
}
|
|
174
|
+
var STATIC_BUILDER_RUNTIMES = {
|
|
175
|
+
hugo: "go",
|
|
176
|
+
jekyll: "ruby",
|
|
177
|
+
middleman: "ruby",
|
|
178
|
+
zola: "rust"
|
|
179
|
+
};
|
|
180
|
+
function inferBuilderRuntimeFromFramework2(framework) {
|
|
181
|
+
if (!framework || framework === "container" || framework === "services")
|
|
182
|
+
return void 0;
|
|
183
|
+
const f = frameworksBySlug.get(framework);
|
|
184
|
+
const declaredBuilder = f?.useRuntime?.use;
|
|
185
|
+
if (declaredBuilder)
|
|
186
|
+
return import_constants2.BUILDER_RUNTIMES[declaredBuilder];
|
|
187
|
+
const detectorItems = [
|
|
188
|
+
...f?.detectors?.every ?? [],
|
|
189
|
+
...f?.detectors?.some ?? []
|
|
190
|
+
];
|
|
191
|
+
return STATIC_BUILDER_RUNTIMES[framework] ?? (detectorItems.some((d) => d.matchPackage !== void 0) ? "node" : void 0);
|
|
192
|
+
}
|
|
193
|
+
function isFrontendFramework(framework) {
|
|
194
|
+
return !!framework && !inferRuntimeFromFramework(framework);
|
|
195
|
+
}
|
|
196
|
+
var BFF_FRAMEWORKS = /* @__PURE__ */ new Set([
|
|
197
|
+
"nextjs",
|
|
198
|
+
"nuxtjs",
|
|
199
|
+
"sveltekit",
|
|
200
|
+
"remix",
|
|
201
|
+
"solidstart"
|
|
202
|
+
]);
|
|
203
|
+
function isBFFFramework(framework) {
|
|
204
|
+
return !!framework && BFF_FRAMEWORKS.has(framework);
|
|
205
|
+
}
|
|
206
|
+
function filterFrameworksByRuntime(frameworks, runtime) {
|
|
207
|
+
if (!runtime)
|
|
208
|
+
return [...frameworks];
|
|
209
|
+
return frameworks.filter((f) => inferRuntimeFromFramework(f.slug) === runtime);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
// src/detect-builders.ts
|
|
29
215
|
var detect_builders_exports = {};
|
|
30
216
|
__export(detect_builders_exports, {
|
|
31
217
|
REGEX_MIDDLEWARE_FILES: () => REGEX_MIDDLEWARE_FILES,
|
|
@@ -46,14 +232,49 @@ var import_minimatch = __toESM(require("minimatch"));
|
|
|
46
232
|
var import_semver = require("semver");
|
|
47
233
|
var import_path = require("path");
|
|
48
234
|
var import_frameworks = require("@vercel/frameworks");
|
|
49
|
-
var import_framework =
|
|
50
|
-
var import_constants =
|
|
51
|
-
|
|
235
|
+
var import_framework = __toESM(require_framework());
|
|
236
|
+
var import_constants = __toESM(require_constants());
|
|
237
|
+
|
|
238
|
+
// src/is-official-runtime.ts
|
|
239
|
+
var isOfficialRuntime = (desired, name) => {
|
|
240
|
+
if (typeof name !== "string") {
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
243
|
+
return name === `@vercel/${desired}` || name === `@now/${desired}` || name.startsWith(`@vercel/${desired}@`) || name.startsWith(`@now/${desired}@`);
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
// src/detect-builders.ts
|
|
247
|
+
var import_build_utils2 = require("@vercel/build-utils");
|
|
248
|
+
|
|
249
|
+
// src/python.ts
|
|
250
|
+
var import_fs = __toESM(require("fs"));
|
|
52
251
|
var import_build_utils = require("@vercel/build-utils");
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const
|
|
252
|
+
var import_python_analysis = require("@vercel/python-analysis");
|
|
253
|
+
async function isPythonEntrypoint(fsPath) {
|
|
254
|
+
try {
|
|
255
|
+
const content = await import_fs.default.promises.readFile(fsPath, "utf-8");
|
|
256
|
+
return await (0, import_python_analysis.findAppOrHandler)(content) !== null;
|
|
257
|
+
} catch (err) {
|
|
258
|
+
(0, import_build_utils.debug)(`Failed to check Python entrypoint: ${err}`);
|
|
259
|
+
return false;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// src/buildpack-runtimes.ts
|
|
264
|
+
var BUILDPACK_PROJECT_MARKERS = /* @__PURE__ */ new Map([["ruby", ["Gemfile"]]]);
|
|
265
|
+
function isBuildpackRuntimeEnabled(runtime) {
|
|
266
|
+
return process.env[`VERCEL_EXPERIMENTAL_BUILDPACK_${runtime.toUpperCase()}`] === "1";
|
|
267
|
+
}
|
|
268
|
+
function toBuildpackRuntime(runtime) {
|
|
269
|
+
if (!runtime || !BUILDPACK_PROJECT_MARKERS.has(runtime) || !isBuildpackRuntimeEnabled(runtime)) {
|
|
270
|
+
return void 0;
|
|
271
|
+
}
|
|
272
|
+
return runtime;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// src/detect-builders.ts
|
|
276
|
+
var REGEX_MIDDLEWARE_FILES = "middleware.[jt]s";
|
|
277
|
+
var VERCEL_PLATFORM_FILES = [
|
|
57
278
|
"api/**",
|
|
58
279
|
"node_modules/**",
|
|
59
280
|
REGEX_MIDDLEWARE_FILES,
|
|
@@ -66,7 +287,7 @@ const VERCEL_PLATFORM_FILES = [
|
|
|
66
287
|
".gitignore",
|
|
67
288
|
"README.md"
|
|
68
289
|
];
|
|
69
|
-
|
|
290
|
+
var REGEX_VERCEL_PLATFORM_FILES = VERCEL_PLATFORM_FILES.join(",");
|
|
70
291
|
function escapeMinimatchPath(path) {
|
|
71
292
|
return path.replace(/([\\,*?[\]{}()!+@])/g, "\\$1");
|
|
72
293
|
}
|
|
@@ -76,8 +297,8 @@ function getStaticFilesPattern(additionalExclusions = []) {
|
|
|
76
297
|
...additionalExclusions.map(escapeMinimatchPath)
|
|
77
298
|
].join(",")}}`;
|
|
78
299
|
}
|
|
79
|
-
|
|
80
|
-
|
|
300
|
+
var REGEX_NON_VERCEL_PLATFORM_FILES = getStaticFilesPattern();
|
|
301
|
+
var builderToFrameworks = (() => {
|
|
81
302
|
const map = /* @__PURE__ */ new Map();
|
|
82
303
|
for (const f of import_frameworks.frameworkList) {
|
|
83
304
|
if (!f.useRuntime?.use)
|
|
@@ -110,7 +331,7 @@ function detectApiDirectory(builders) {
|
|
|
110
331
|
}
|
|
111
332
|
function getPublicBuilder(builders) {
|
|
112
333
|
for (const builder of builders) {
|
|
113
|
-
if (typeof builder.src === "string" &&
|
|
334
|
+
if (typeof builder.src === "string" && isOfficialRuntime("static", builder.use) && /^.*\/\*\*\/\*$/.test(builder.src) && builder.config?.zeroConfig === true) {
|
|
114
335
|
return builder;
|
|
115
336
|
}
|
|
116
337
|
}
|
|
@@ -283,7 +504,7 @@ async function detectBuilders(files, pkg, options = {}) {
|
|
|
283
504
|
};
|
|
284
505
|
}
|
|
285
506
|
}
|
|
286
|
-
if (options.proxy && frontendBuilder &&
|
|
507
|
+
if (options.proxy && frontendBuilder && isOfficialRuntime("next", frontendBuilder.use)) {
|
|
287
508
|
return {
|
|
288
509
|
builders: null,
|
|
289
510
|
errors: [
|
|
@@ -326,7 +547,7 @@ async function detectBuilders(files, pkg, options = {}) {
|
|
|
326
547
|
builders.push(...apiBuilders);
|
|
327
548
|
}
|
|
328
549
|
if (frontendBuilder) {
|
|
329
|
-
if (
|
|
550
|
+
if (isOfficialRuntime("express", frontendBuilder?.use) || isOfficialRuntime("hono", frontendBuilder?.use) || isOfficialRuntime("python", frontendBuilder?.use) || isOfficialRuntime("go", frontendBuilder?.use) || isOfficialRuntime("backends", frontendBuilder?.use)) {
|
|
330
551
|
builders.push({
|
|
331
552
|
src: "public/**/*",
|
|
332
553
|
use: "@vercel/static",
|
|
@@ -337,7 +558,7 @@ async function detectBuilders(files, pkg, options = {}) {
|
|
|
337
558
|
});
|
|
338
559
|
}
|
|
339
560
|
builders.push(frontendBuilder);
|
|
340
|
-
if (hasNextApiFiles && apiBuilders.some((b) =>
|
|
561
|
+
if (hasNextApiFiles && apiBuilders.some((b) => isOfficialRuntime("node", b.use))) {
|
|
341
562
|
warnings.push({
|
|
342
563
|
code: "conflicting_files",
|
|
343
564
|
message: "When using Next.js, it is recommended to place JavaScript Functions inside of the `pages/api` (provided by Next.js) directory instead of `api` (provided by Vercel). Other languages (Python, Go, etc) should still go in the `api` directory.",
|
|
@@ -386,7 +607,7 @@ async function maybeGetApiBuilder(fileName, apiMatches, options) {
|
|
|
386
607
|
}
|
|
387
608
|
if (fileName.endsWith(".py") && options.workPath) {
|
|
388
609
|
const fsPath = (0, import_path.join)(options.workPath, fileName);
|
|
389
|
-
const isEntrypoint = await
|
|
610
|
+
const isEntrypoint = await isPythonEntrypoint(fsPath);
|
|
390
611
|
if (!isEntrypoint) {
|
|
391
612
|
return null;
|
|
392
613
|
}
|
|
@@ -394,7 +615,7 @@ async function maybeGetApiBuilder(fileName, apiMatches, options) {
|
|
|
394
615
|
const nodeExtensions = [".js", ".mjs", ".ts", ".tsx"];
|
|
395
616
|
if (fileName.startsWith("api/") && process.env.VERCEL_NODE_FILTER_ENTRYPOINTS === "1" && nodeExtensions.some((ext) => fileName.endsWith(ext)) && options.workPath) {
|
|
396
617
|
const fsPath = (0, import_path.join)(options.workPath, fileName);
|
|
397
|
-
const isEntrypoint = await (0,
|
|
618
|
+
const isEntrypoint = await (0, import_build_utils2.isNodeEntrypoint)({ fsPath });
|
|
398
619
|
if (!isEntrypoint) {
|
|
399
620
|
return null;
|
|
400
621
|
}
|
|
@@ -596,8 +817,8 @@ function detectFrontBuilder(pkg, files, usedFunctions, fallbackEntrypoint, optio
|
|
|
596
817
|
}
|
|
597
818
|
const f = import_framework.frameworksBySlug.get(framework || "");
|
|
598
819
|
if (f && f.useRuntime && !isRustStaticOutput(framework, projectSettings)) {
|
|
599
|
-
const buildpackRuntime =
|
|
600
|
-
if (buildpackRuntime && (
|
|
820
|
+
const buildpackRuntime = toBuildpackRuntime(framework);
|
|
821
|
+
if (buildpackRuntime && (BUILDPACK_PROJECT_MARKERS.get(buildpackRuntime) ?? []).some(
|
|
601
822
|
(marker) => files.includes(marker)
|
|
602
823
|
)) {
|
|
603
824
|
config.buildpack = buildpackRuntime;
|
|
@@ -608,8 +829,8 @@ function detectFrontBuilder(pkg, files, usedFunctions, fallbackEntrypoint, optio
|
|
|
608
829
|
};
|
|
609
830
|
}
|
|
610
831
|
const { src, use } = f.useRuntime;
|
|
611
|
-
const shouldUseUnifiedBackend = (0,
|
|
612
|
-
const finalUse = shouldUseUnifiedBackend ?
|
|
832
|
+
const shouldUseUnifiedBackend = (0, import_build_utils2.isExperimentalBackendsEnabled)() && import_build_utils2.BACKEND_BUILDERS.includes(use);
|
|
833
|
+
const finalUse = shouldUseUnifiedBackend ? import_build_utils2.UNIFIED_BACKEND_BUILDER : use;
|
|
613
834
|
return { src, use: `${finalUse}${withTag}`, config };
|
|
614
835
|
}
|
|
615
836
|
const entrypoints = /* @__PURE__ */ new Set([
|
|
@@ -654,7 +875,7 @@ function validateFunctions({ functions = {} }) {
|
|
|
654
875
|
message: "Function must contain at least one property."
|
|
655
876
|
};
|
|
656
877
|
}
|
|
657
|
-
const maxDurationLimit = (0,
|
|
878
|
+
const maxDurationLimit = (0, import_build_utils2.getMaxDurationLimit)();
|
|
658
879
|
if (func.maxDuration !== void 0 && func.maxDuration !== "max" && (func.maxDuration < 1 || maxDurationLimit !== void 0 && func.maxDuration > maxDurationLimit || !Number.isInteger(func.maxDuration))) {
|
|
659
880
|
return {
|
|
660
881
|
code: "invalid_function_duration",
|
|
@@ -708,7 +929,7 @@ function checkUnusedFunctions(frontendBuilder, usedFunctions, options) {
|
|
|
708
929
|
if (!unusedFunctions.size) {
|
|
709
930
|
return null;
|
|
710
931
|
}
|
|
711
|
-
if (frontendBuilder &&
|
|
932
|
+
if (frontendBuilder && isOfficialRuntime("next", frontendBuilder.use)) {
|
|
712
933
|
for (const fnKey of unusedFunctions.values()) {
|
|
713
934
|
if (fnKey.startsWith("pages/") || fnKey.startsWith("src/pages") || fnKey.startsWith("app/") || fnKey.startsWith("src/app/") || fnKey.startsWith("middleware") || fnKey.startsWith("src/middleware")) {
|
|
714
935
|
unusedFunctions.delete(fnKey);
|
|
@@ -722,7 +943,7 @@ function checkUnusedFunctions(frontendBuilder, usedFunctions, options) {
|
|
|
722
943
|
}
|
|
723
944
|
}
|
|
724
945
|
}
|
|
725
|
-
if (frontendBuilder && (
|
|
946
|
+
if (frontendBuilder && (isOfficialRuntime("express", frontendBuilder.use) || isOfficialRuntime("hono", frontendBuilder.use) || isOfficialRuntime("python", frontendBuilder.use) || isOfficialRuntime("backends", frontendBuilder.use))) {
|
|
726
947
|
return null;
|
|
727
948
|
}
|
|
728
949
|
if (unusedFunctions.size) {
|
|
@@ -912,7 +1133,7 @@ function getRouteResult(apiRoutes, dynamicRoutes, outputDirectory, apiBuilders,
|
|
|
912
1133
|
const errorRoutes = [];
|
|
913
1134
|
const framework = frontendBuilder?.config?.framework || "";
|
|
914
1135
|
const isGatsby = framework === "gatsby";
|
|
915
|
-
const isNextjs = framework === "nextjs" ||
|
|
1136
|
+
const isNextjs = framework === "nextjs" || isOfficialRuntime("next", frontendBuilder?.use);
|
|
916
1137
|
const ignoreRuntimes = import_framework.frameworksBySlug.get(framework)?.ignoreRuntimes;
|
|
917
1138
|
if (apiRoutes && apiRoutes.length > 0) {
|
|
918
1139
|
if (options.featHandleMiss) {
|
|
@@ -961,7 +1182,7 @@ function getRouteResult(apiRoutes, dynamicRoutes, outputDirectory, apiBuilders,
|
|
|
961
1182
|
}
|
|
962
1183
|
}
|
|
963
1184
|
}
|
|
964
|
-
if (outputDirectory && frontendBuilder && !options.featHandleMiss &&
|
|
1185
|
+
if (outputDirectory && frontendBuilder && !options.featHandleMiss && isOfficialRuntime("static", frontendBuilder.use)) {
|
|
965
1186
|
defaultRoutes.push({
|
|
966
1187
|
src: "/(.*)",
|
|
967
1188
|
dest: `/${outputDirectory}/$1`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/fs-detectors",
|
|
3
|
-
"version": "7.6.
|
|
3
|
+
"version": "7.6.2",
|
|
4
4
|
"description": "Vercel filesystem detectors",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"semver": "6.3.1",
|
|
22
22
|
"smol-toml": "1.5.2",
|
|
23
23
|
"@vercel/build-utils": "14.10.2",
|
|
24
|
+
"@vercel/error-utils": "2.2.1",
|
|
24
25
|
"@vercel/frameworks": "3.34.0",
|
|
25
26
|
"@vercel/python-analysis": "0.14.0",
|
|
26
|
-
"@vercel/routing-utils": "6.6.0"
|
|
27
|
-
"@vercel/error-utils": "2.2.1"
|
|
27
|
+
"@vercel/routing-utils": "6.6.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/glob": "7.2.0",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@vercel-internals/runtimes": "1.1.1"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
|
-
"build": "node
|
|
39
|
+
"build": "node build.mjs",
|
|
40
40
|
"test": "vitest run --config ../../vitest.config.mts",
|
|
41
41
|
"test-unit": "vitest run --config ../../vitest.config.mts test/unit.",
|
|
42
42
|
"type-check": "tsc --noEmit"
|