@vercel/fs-detectors 6.6.0 → 6.7.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.
@@ -1,5 +1,5 @@
1
1
  import type { DetectorFilesystem } from '../detectors/filesystem';
2
- import type { ExperimentalServices, ServiceDetectionError, ServiceDetectionWarning } from './types';
2
+ import type { DetectEntrypointFn, ExperimentalServices, ServiceDetectionError, ServiceDetectionWarning } from './types';
3
3
  export interface RenderDetectResult {
4
4
  services: ExperimentalServices | null;
5
5
  errors: ServiceDetectionError[];
@@ -10,4 +10,5 @@ export interface RenderDetectResult {
10
10
  */
11
11
  export declare function detectRenderServices(options: {
12
12
  fs: DetectorFilesystem;
13
+ detectEntrypoint?: DetectEntrypointFn;
13
14
  }): Promise<RenderDetectResult>;
@@ -41,7 +41,7 @@ const SERVICE_TYPE_MAP = {
41
41
  static: "web"
42
42
  };
43
43
  async function detectRenderServices(options) {
44
- const { fs } = options;
44
+ const { fs, detectEntrypoint } = options;
45
45
  const raw = await readRenderYaml(fs);
46
46
  if (raw.warning) {
47
47
  return { services: null, errors: [], warnings: [raw.warning] };
@@ -165,7 +165,16 @@ async function detectRenderServices(options) {
165
165
  serviceConfig.type = vercelType;
166
166
  serviceConfig.framework = framework.slug ?? void 0;
167
167
  if (rootDir !== ".") {
168
- serviceConfig.entrypoint = rootDir;
168
+ serviceConfig.root = rootDir;
169
+ if (detectEntrypoint && !(0, import_utils.isFrontendFramework)(serviceConfig.framework)) {
170
+ const detected = await detectEntrypoint({
171
+ workPath: rootDir,
172
+ framework: serviceConfig.framework
173
+ });
174
+ if (detected) {
175
+ serviceConfig.entrypoint = detected.entrypoint;
176
+ }
177
+ }
169
178
  }
170
179
  const buildCommand = (0, import_utils.combineBuildCommand)(
171
180
  rs.buildCommand,
@@ -601,7 +601,7 @@ async function resolveConfiguredService(options) {
601
601
  workspace = workspace === "." ? normalizedRoot : import_path.posix.join(normalizedRoot, workspace);
602
602
  }
603
603
  }
604
- const topics = type === "worker" ? (0, import_build_utils.getServiceQueueTopics)({ type, topics: config.topics }) : trigger === "queue" ? config.topics : void 0;
604
+ const topics = type === "worker" ? (0, import_build_utils.getServiceQueueTopics)({ type, topics: config.topics }) : trigger === "queue" ? config.topics : trigger === "workflow" ? ["__wkf_*"] : void 0;
605
605
  let builderUse;
606
606
  let builderSrc;
607
607
  const frameworkDefinition = config.framework ? frameworksBySlug.get(config.framework) : void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/fs-detectors",
3
- "version": "6.6.0",
3
+ "version": "6.7.0",
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.26.0",
23
+ "@vercel/build-utils": "13.26.1",
24
24
  "@vercel/error-utils": "2.1.0",
25
- "@vercel/frameworks": "3.26.1",
26
- "@vercel/routing-utils": "6.2.0"
25
+ "@vercel/routing-utils": "6.2.0",
26
+ "@vercel/frameworks": "3.26.1"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/glob": "7.2.0",