@vercel/fs-detectors 5.8.10 → 5.8.13

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.
@@ -528,23 +528,7 @@ function checkUnusedFunctions(frontendBuilder, usedFunctions, options) {
528
528
  }
529
529
  }
530
530
  if (frontendBuilder && ((0, import_is_official_runtime.isOfficialRuntime)("express", frontendBuilder.use) || (0, import_is_official_runtime.isOfficialRuntime)("hono", frontendBuilder.use) || (0, import_is_official_runtime.isOfficialRuntime)("backends", frontendBuilder.use))) {
531
- const validFilenames = [
532
- "app",
533
- "index",
534
- "server",
535
- "src/app",
536
- "src/index",
537
- "src/server"
538
- ];
539
- const validExtensions = ["js", "cjs", "mjs", "ts", "cts", "mts"];
540
- const validEntrypoints = validFilenames.flatMap(
541
- (filename) => validExtensions.map((extension) => `${filename}.${extension}`)
542
- );
543
- for (const fnKey of unusedFunctions.values()) {
544
- if (validEntrypoints.includes(fnKey)) {
545
- unusedFunctions.delete(fnKey);
546
- }
547
- }
531
+ return null;
548
532
  }
549
533
  if (unusedFunctions.size) {
550
534
  const [fnKey] = Array.from(unusedFunctions);
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ export { autoDetectServices } from './services/auto-detect';
4
4
  export type { AutoDetectOptions, AutoDetectResult, } from './services/auto-detect';
5
5
  export { isStaticBuild, isRouteOwningBuilder, INTERNAL_SERVICE_PREFIX, getInternalServiceFunctionPath, } from './services/utils';
6
6
  export { getServicesBuilders } from './services/get-services-builders';
7
- export type { DetectServicesOptions, DetectServicesResult, ResolvedService, Service, ServicesRoutes, ServiceDetectionError, } from './services/types';
7
+ export type { DetectServicesOptions, DetectServicesResult, DetectServicesSource, ResolvedService, Service, ServicesRoutes, ServiceDetectionError, } from './services/types';
8
8
  export { detectFileSystemAPI } from './detect-file-system-api';
9
9
  export { detectFramework, detectFrameworks, detectFrameworkRecord, detectFrameworkVersion, } from './detect-framework';
10
10
  export { getProjectPaths } from './get-project-paths';
@@ -33,6 +33,7 @@ async function detectServices(options) {
33
33
  if (configError) {
34
34
  return {
35
35
  services: [],
36
+ source: "configured",
36
37
  routes: { rewrites: [], defaults: [], crons: [], workers: [] },
37
38
  errors: [configError],
38
39
  warnings: []
@@ -45,6 +46,7 @@ async function detectServices(options) {
45
46
  if (autoResult.errors.length > 0) {
46
47
  return {
47
48
  services: [],
49
+ source: "auto-detected",
48
50
  routes: { rewrites: [], defaults: [], crons: [], workers: [] },
49
51
  errors: autoResult.errors,
50
52
  warnings: []
@@ -59,6 +61,7 @@ async function detectServices(options) {
59
61
  const routes2 = generateServicesRoutes(result2.services);
60
62
  return {
61
63
  services: result2.services,
64
+ source: "auto-detected",
62
65
  routes: routes2,
63
66
  errors: result2.errors,
64
67
  warnings: []
@@ -66,6 +69,7 @@ async function detectServices(options) {
66
69
  }
67
70
  return {
68
71
  services: [],
72
+ source: "auto-detected",
69
73
  routes: { rewrites: [], defaults: [], crons: [], workers: [] },
70
74
  errors: [
71
75
  {
@@ -84,6 +88,7 @@ async function detectServices(options) {
84
88
  const routes = generateServicesRoutes(result.services);
85
89
  return {
86
90
  services: result.services,
91
+ source: "configured",
87
92
  routes,
88
93
  errors: result.errors,
89
94
  warnings: []
@@ -34,11 +34,18 @@ export interface ServicesRoutes {
34
34
  }
35
35
  export interface DetectServicesResult {
36
36
  services: Service[];
37
+ /**
38
+ * Source of service definitions:
39
+ * - `configured`: loaded from explicit project configuration (currently `vercel.json#experimentalServices`)
40
+ * - `auto-detected`: inferred from project structure
41
+ */
42
+ source: DetectServicesSource;
37
43
  /** Routing rules derived from services */
38
44
  routes: ServicesRoutes;
39
45
  errors: ServiceDetectionError[];
40
46
  warnings: ServiceDetectionWarning[];
41
47
  }
48
+ export type DetectServicesSource = 'configured' | 'auto-detected';
42
49
  export interface ServiceDetectionWarning {
43
50
  code: string;
44
51
  message: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/fs-detectors",
3
- "version": "5.8.10",
3
+ "version": "5.8.13",
4
4
  "description": "Vercel filesystem detectors",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -20,8 +20,8 @@
20
20
  "minimatch": "3.1.2",
21
21
  "semver": "6.3.1",
22
22
  "@vercel/error-utils": "2.0.3",
23
- "@vercel/frameworks": "3.19.0",
24
- "@vercel/routing-utils": "5.3.3"
23
+ "@vercel/frameworks": "3.19.1",
24
+ "@vercel/routing-utils": "6.0.1"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/glob": "7.2.0",
@@ -32,7 +32,7 @@
32
32
  "@types/semver": "7.3.10",
33
33
  "jest-junit": "16.0.0",
34
34
  "typescript": "4.9.5",
35
- "@vercel/build-utils": "13.5.0"
35
+ "@vercel/build-utils": "13.6.1"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "node ../../utils/build.mjs",