@vercel/fs-detectors 5.5.4 → 5.5.6

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.
@@ -236,7 +236,7 @@ async function detectBuilders(files, pkg, options = {}) {
236
236
  builders.push(...apiBuilders);
237
237
  }
238
238
  if (frontendBuilder) {
239
- if (frontendBuilder?.use === "@vercel/express") {
239
+ if (frontendBuilder?.use === "@vercel/express" || frontendBuilder?.use === "@vercel/hono") {
240
240
  builders.push({
241
241
  src: "public/**/*",
242
242
  use: "@vercel/static",
@@ -503,6 +503,25 @@ function checkUnusedFunctions(frontendBuilder, usedFunctions, options) {
503
503
  }
504
504
  }
505
505
  }
506
+ if (frontendBuilder && ((0, import_is_official_runtime.isOfficialRuntime)("express", frontendBuilder.use) || (0, import_is_official_runtime.isOfficialRuntime)("hono", frontendBuilder.use))) {
507
+ const validFilenames = [
508
+ "app",
509
+ "index",
510
+ "server",
511
+ "src/app",
512
+ "src/index",
513
+ "src/server"
514
+ ];
515
+ const validExtensions = ["js", "cjs", "mjs", "ts", "cts", "mts"];
516
+ const validEntrypoints = validFilenames.flatMap(
517
+ (filename) => validExtensions.map((extension) => `${filename}.${extension}`)
518
+ );
519
+ for (const fnKey of unusedFunctions.values()) {
520
+ if (validEntrypoints.includes(fnKey)) {
521
+ unusedFunctions.delete(fnKey);
522
+ }
523
+ }
524
+ }
506
525
  if (unusedFunctions.size) {
507
526
  const [fnKey] = Array.from(unusedFunctions);
508
527
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/fs-detectors",
3
- "version": "5.5.4",
3
+ "version": "5.5.6",
4
4
  "description": "Vercel filesystem detectors",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -15,7 +15,7 @@
15
15
  "license": "Apache-2.0",
16
16
  "dependencies": {
17
17
  "@vercel/error-utils": "2.0.3",
18
- "@vercel/frameworks": "3.9.0",
18
+ "@vercel/frameworks": "3.9.2",
19
19
  "@vercel/routing-utils": "5.1.1",
20
20
  "glob": "8.0.3",
21
21
  "js-yaml": "4.1.0",