@vercel/fs-detectors 7.5.0 → 7.6.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
CHANGED
|
@@ -46,8 +46,8 @@ var import_minimatch = __toESM(require("minimatch"));
|
|
|
46
46
|
var import_semver = require("semver");
|
|
47
47
|
var import_path = require("path");
|
|
48
48
|
var import_frameworks = require("@vercel/frameworks");
|
|
49
|
-
var import_framework = require("
|
|
50
|
-
var import_constants = require("
|
|
49
|
+
var import_framework = require("@vercel-internals/runtimes/framework");
|
|
50
|
+
var import_constants = require("@vercel-internals/runtimes/constants");
|
|
51
51
|
var import_is_official_runtime = require("./is-official-runtime");
|
|
52
52
|
var import_build_utils = require("@vercel/build-utils");
|
|
53
53
|
var import_python = require("./python");
|
|
@@ -2,10 +2,6 @@ import type { ServiceRuntime } from '@vercel/build-utils';
|
|
|
2
2
|
export declare const RUNTIME_BUILDERS: Record<ServiceRuntime, string>;
|
|
3
3
|
export declare const RUNTIME_MANIFESTS: Partial<Record<ServiceRuntime, string[]>>;
|
|
4
4
|
export declare const ENTRYPOINT_EXTENSIONS: Record<string, ServiceRuntime>;
|
|
5
|
-
/**
|
|
6
|
-
* The inverse of RUNTIME_BUILDERS. Maps each builder to its runtime.
|
|
7
|
-
*/
|
|
8
|
-
export declare const BUILDER_RUNTIMES: Record<string, ServiceRuntime>;
|
|
9
5
|
/**
|
|
10
6
|
* Builders that produce static output (SPAs, static sites) with no runtime.
|
|
11
7
|
*/
|
|
@@ -18,7 +18,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var constants_exports = {};
|
|
20
20
|
__export(constants_exports, {
|
|
21
|
-
BUILDER_RUNTIMES: () => BUILDER_RUNTIMES,
|
|
22
21
|
CONTAINER_ENTRYPOINT_CANDIDATES: () => CONTAINER_ENTRYPOINT_CANDIDATES,
|
|
23
22
|
ENTRYPOINT_EXTENSIONS: () => ENTRYPOINT_EXTENSIONS,
|
|
24
23
|
ROUTE_OWNING_BUILDERS: () => ROUTE_OWNING_BUILDERS,
|
|
@@ -61,12 +60,6 @@ const ENTRYPOINT_EXTENSIONS = {
|
|
|
61
60
|
".rb": "ruby",
|
|
62
61
|
".ru": "ruby"
|
|
63
62
|
};
|
|
64
|
-
const BUILDER_RUNTIMES = Object.fromEntries(
|
|
65
|
-
Object.entries(RUNTIME_BUILDERS).map(([runtime, builder]) => [
|
|
66
|
-
builder,
|
|
67
|
-
runtime
|
|
68
|
-
])
|
|
69
|
-
);
|
|
70
63
|
const STATIC_BUILDERS = /* @__PURE__ */ new Set([
|
|
71
64
|
"@vercel/static-build",
|
|
72
65
|
"@vercel/static"
|
|
@@ -83,7 +76,6 @@ const CONTAINER_ENTRYPOINT_CANDIDATES = [
|
|
|
83
76
|
];
|
|
84
77
|
// Annotate the CommonJS export names for ESM import in node:
|
|
85
78
|
0 && (module.exports = {
|
|
86
|
-
BUILDER_RUNTIMES,
|
|
87
79
|
CONTAINER_ENTRYPOINT_CANDIDATES,
|
|
88
80
|
ENTRYPOINT_EXTENSIONS,
|
|
89
81
|
ROUTE_OWNING_BUILDERS,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ServiceRuntime } from '@vercel/build-utils';
|
|
2
2
|
import type { Framework } from '@vercel/frameworks';
|
|
3
|
-
export declare const frameworksBySlug: Map<string, Framework>;
|
|
4
3
|
/**
|
|
5
4
|
* Framework list filtered to entries eligible for auto-detection.
|
|
6
5
|
* Includes non-experimental frameworks and runtime frameworks (Python, Node, etc.)
|
|
@@ -16,12 +15,6 @@ export declare const DETECTION_FRAMEWORKS: Framework[];
|
|
|
16
15
|
* - `express` → `node`
|
|
17
16
|
*/
|
|
18
17
|
export declare function inferRuntimeFromFramework(framework: string | null | undefined): ServiceRuntime | undefined;
|
|
19
|
-
/**
|
|
20
|
-
* Infer the runtime used by a framework's builder.
|
|
21
|
-
*
|
|
22
|
-
* A builder may not necessarily produce a function with a runtime, e.g. @vercel/static-build.
|
|
23
|
-
*/
|
|
24
|
-
export declare function inferBuilderRuntimeFromFramework(framework: string | null | undefined): ServiceRuntime | undefined;
|
|
25
18
|
/**
|
|
26
19
|
* Returns true if the framework is a client-only frontend (no server runtime).
|
|
27
20
|
*/
|
|
@@ -20,8 +20,6 @@ var framework_exports = {};
|
|
|
20
20
|
__export(framework_exports, {
|
|
21
21
|
DETECTION_FRAMEWORKS: () => DETECTION_FRAMEWORKS,
|
|
22
22
|
filterFrameworksByRuntime: () => filterFrameworksByRuntime,
|
|
23
|
-
frameworksBySlug: () => frameworksBySlug,
|
|
24
|
-
inferBuilderRuntimeFromFramework: () => inferBuilderRuntimeFromFramework,
|
|
25
23
|
inferRuntimeFromFramework: () => inferRuntimeFromFramework,
|
|
26
24
|
isBFFFramework: () => isBFFFramework,
|
|
27
25
|
isFrontendFramework: () => isFrontendFramework
|
|
@@ -30,9 +28,6 @@ module.exports = __toCommonJS(framework_exports);
|
|
|
30
28
|
var import_build_utils = require("@vercel/build-utils");
|
|
31
29
|
var import_frameworks = require("@vercel/frameworks");
|
|
32
30
|
var import_constants = require("./constants");
|
|
33
|
-
const frameworksBySlug = new Map(
|
|
34
|
-
import_frameworks.frameworkList.flatMap((f) => typeof f.slug === "string" ? [[f.slug, f]] : [])
|
|
35
|
-
);
|
|
36
31
|
const DETECTION_FRAMEWORKS = import_frameworks.frameworkList.filter(
|
|
37
32
|
(framework) => !framework.experimental || framework.runtimeFramework
|
|
38
33
|
);
|
|
@@ -47,25 +42,6 @@ function inferRuntimeFromFramework(framework) {
|
|
|
47
42
|
return "node";
|
|
48
43
|
return void 0;
|
|
49
44
|
}
|
|
50
|
-
const STATIC_BUILDER_RUNTIMES = {
|
|
51
|
-
hugo: "go",
|
|
52
|
-
jekyll: "ruby",
|
|
53
|
-
middleman: "ruby",
|
|
54
|
-
zola: "rust"
|
|
55
|
-
};
|
|
56
|
-
function inferBuilderRuntimeFromFramework(framework) {
|
|
57
|
-
if (!framework || framework === "container" || framework === "services")
|
|
58
|
-
return void 0;
|
|
59
|
-
const f = frameworksBySlug.get(framework);
|
|
60
|
-
const declaredBuilder = f?.useRuntime?.use;
|
|
61
|
-
if (declaredBuilder)
|
|
62
|
-
return import_constants.BUILDER_RUNTIMES[declaredBuilder];
|
|
63
|
-
const detectorItems = [
|
|
64
|
-
...f?.detectors?.every ?? [],
|
|
65
|
-
...f?.detectors?.some ?? []
|
|
66
|
-
];
|
|
67
|
-
return STATIC_BUILDER_RUNTIMES[framework] ?? (detectorItems.some((d) => d.matchPackage !== void 0) ? "node" : void 0);
|
|
68
|
-
}
|
|
69
45
|
function isFrontendFramework(framework) {
|
|
70
46
|
return !!framework && !inferRuntimeFromFramework(framework);
|
|
71
47
|
}
|
|
@@ -88,8 +64,6 @@ function filterFrameworksByRuntime(frameworks, runtime) {
|
|
|
88
64
|
0 && (module.exports = {
|
|
89
65
|
DETECTION_FRAMEWORKS,
|
|
90
66
|
filterFrameworksByRuntime,
|
|
91
|
-
frameworksBySlug,
|
|
92
|
-
inferBuilderRuntimeFromFramework,
|
|
93
67
|
inferRuntimeFromFramework,
|
|
94
68
|
isBFFFramework,
|
|
95
69
|
isFrontendFramework
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/fs-detectors",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.6.0",
|
|
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/error-utils": "2.2.1",
|
|
24
23
|
"@vercel/frameworks": "3.34.0",
|
|
25
24
|
"@vercel/python-analysis": "0.14.0",
|
|
25
|
+
"@vercel/build-utils": "14.10.1",
|
|
26
26
|
"@vercel/routing-utils": "6.6.0",
|
|
27
|
-
"@vercel/
|
|
27
|
+
"@vercel/error-utils": "2.2.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/glob": "7.2.0",
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"@types/minimatch": "3.0.5",
|
|
33
33
|
"@types/node": "20.11.0",
|
|
34
34
|
"@types/semver": "7.3.10",
|
|
35
|
-
"vitest": "4.1.10"
|
|
35
|
+
"vitest": "4.1.10",
|
|
36
|
+
"@vercel-internals/runtimes": "1.1.0"
|
|
36
37
|
},
|
|
37
38
|
"scripts": {
|
|
38
39
|
"build": "node ../../utils/build.mjs",
|