@vercel/fs-detectors 6.14.3 → 6.15.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.
@@ -1,4 +1,5 @@
1
1
  import type { Route } from '@vercel/routing-utils';
2
+ import { type Framework } from '@vercel/frameworks';
2
3
  import type { PackageJson, Builder, BuilderFunctions, ExperimentalServices, ExperimentalServicesV2, Services, ProjectSettings, Service } from '@vercel/build-utils';
3
4
  /**
4
5
  * Pattern for finding all supported middleware files.
@@ -9,6 +10,10 @@ export declare const REGEX_VERCEL_PLATFORM_FILES: string;
9
10
  * Pattern for non-Vercel platform files.
10
11
  */
11
12
  export declare const REGEX_NON_VERCEL_PLATFORM_FILES: string;
13
+ /**
14
+ * Maps each builder name to the frameworks it handles.
15
+ */
16
+ export declare const builderToFrameworks: ReadonlyMap<string, readonly Framework[]>;
12
17
  export interface ErrorResponse {
13
18
  code: string;
14
19
  message: string;
@@ -31,6 +31,7 @@ __export(detect_builders_exports, {
31
31
  REGEX_MIDDLEWARE_FILES: () => REGEX_MIDDLEWARE_FILES,
32
32
  REGEX_NON_VERCEL_PLATFORM_FILES: () => REGEX_NON_VERCEL_PLATFORM_FILES,
33
33
  REGEX_VERCEL_PLATFORM_FILES: () => REGEX_VERCEL_PLATFORM_FILES,
34
+ builderToFrameworks: () => builderToFrameworks,
34
35
  detectApiDirectory: () => detectApiDirectory,
35
36
  detectApiExtensions: () => detectApiExtensions,
36
37
  detectBuilders: () => detectBuilders,
@@ -75,6 +76,21 @@ const REGEX_NON_VERCEL_PLATFORM_FILES = getStaticFilesPattern();
75
76
  const slugToFramework = new Map(
76
77
  import_frameworks.frameworkList.map((f) => [f.slug, f])
77
78
  );
79
+ const builderToFrameworks = (() => {
80
+ const map = /* @__PURE__ */ new Map();
81
+ for (const f of import_frameworks.frameworkList) {
82
+ if (!f.useRuntime?.use)
83
+ continue;
84
+ const builder = f.useRuntime.use;
85
+ const entry = map.get(builder);
86
+ if (entry) {
87
+ entry.push(f);
88
+ } else {
89
+ map.set(builder, [f]);
90
+ }
91
+ }
92
+ return map;
93
+ })();
78
94
  function sortFiles(fileA, fileB) {
79
95
  return fileA.localeCompare(fileB);
80
96
  }
@@ -1007,6 +1023,7 @@ function sortFilesBySegmentCount(fileA, fileB) {
1007
1023
  REGEX_MIDDLEWARE_FILES,
1008
1024
  REGEX_NON_VERCEL_PLATFORM_FILES,
1009
1025
  REGEX_VERCEL_PLATFORM_FILES,
1026
+ builderToFrameworks,
1010
1027
  detectApiDirectory,
1011
1028
  detectApiExtensions,
1012
1029
  detectBuilders,
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { detectBuilders, detectOutputDirectory, detectApiDirectory, detectApiExtensions, getProxyBuilder, validateProxyConfig, type Options as DetectBuildersOptions, type ProxyConfig, } from './detect-builders';
1
+ export { builderToFrameworks, detectBuilders, detectOutputDirectory, detectApiDirectory, detectApiExtensions, getProxyBuilder, validateProxyConfig, type Options as DetectBuildersOptions, type ProxyConfig, } from './detect-builders';
2
2
  export { detectServices, generateServicesRoutes, } from './services/detect-services';
3
3
  export { resolveAllConfiguredServicesV2, resolveConfiguredServiceV2, validateServiceConfigV2, } from './services/resolve-v2';
4
4
  export { isExperimentalService, isExperimentalServiceV2, } from '@vercel/build-utils';
package/dist/index.js CHANGED
@@ -28,6 +28,7 @@ __export(src_exports, {
28
28
  Workspace: () => import_get_workspaces.Workspace,
29
29
  WorkspaceType: () => import_get_workspaces.WorkspaceType,
30
30
  autoDetectServices: () => import_auto_detect.autoDetectServices,
31
+ builderToFrameworks: () => import_detect_builders.builderToFrameworks,
31
32
  detectApiDirectory: () => import_detect_builders.detectApiDirectory,
32
33
  detectApiExtensions: () => import_detect_builders.detectApiExtensions,
33
34
  detectBuilders: () => import_detect_builders.detectBuilders,
@@ -97,6 +98,7 @@ var import_detect_instrumentation = require("./detect-instrumentation");
97
98
  Workspace,
98
99
  WorkspaceType,
99
100
  autoDetectServices,
101
+ builderToFrameworks,
100
102
  detectApiDirectory,
101
103
  detectApiExtensions,
102
104
  detectBuilders,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/fs-detectors",
3
- "version": "6.14.3",
3
+ "version": "6.15.2",
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": "13.36.3",
24
- "@vercel/routing-utils": "6.4.0",
25
- "@vercel/error-utils": "2.2.0",
26
- "@vercel/frameworks": "3.30.7"
23
+ "@vercel/build-utils": "14.0.2",
24
+ "@vercel/error-utils": "2.2.1",
25
+ "@vercel/frameworks": "3.30.9",
26
+ "@vercel/routing-utils": "6.4.1"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/glob": "7.2.0",
@@ -40,7 +40,7 @@
40
40
  "test-e2e": "pnpm test test/integration.test.ts",
41
41
  "type-check": "tsc --noEmit",
42
42
  "vitest-run": "vitest -c ../../vitest.config.mts",
43
- "vitest-unit": "glob --absolute 'test/unit.*test.*'",
43
+ "vitest-unit": "pnpm test test/unit.",
44
44
  "vitest-e2e": "glob --absolute 'test/integration.test.ts'"
45
45
  }
46
46
  }