From 4665709122cffcc5d757cc3e696f1b371c73ad5f Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Fri, 24 Nov 2023 16:55:48 +0100 Subject: [PATCH] cli: check for dev/index.ts Signed-off-by: Vincenzo Scamporlino --- packages/cli/src/commands/start/startBackend.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/commands/start/startBackend.ts b/packages/cli/src/commands/start/startBackend.ts index f5dfecdd21..25758a0939 100644 --- a/packages/cli/src/commands/start/startBackend.ts +++ b/packages/cli/src/commands/start/startBackend.ts @@ -49,12 +49,14 @@ export async function startBackend(options: StartBackendOptions) { export async function startBackendPlugin(options: StartBackendOptions) { if (!process.env.LEGACY_BACKEND_START) { - const hasDevEntry = await fs.pathExists(paths.resolveTarget('dev')); + const hasDevIndexEntry = await fs.pathExists( + paths.resolveTarget('dev', 'index.ts'), + ); const hasSrcIndexEntry = await fs.pathExists( paths.resolveTarget('src', 'run.ts'), ); - if (!hasDevEntry && !hasSrcIndexEntry) { + if (!hasDevIndexEntry && !hasSrcIndexEntry) { console.warn( hasSrcIndexEntry ? `The 'dev' directory is missing. The plugin might not be updated for the new backend system. To run, use "LEGACY_BACKEND_START=1 yarn start".`