From cdbb1490decfcdfa047102fd47e2076d2cd2f389 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Wed, 26 Mar 2025 14:47:09 +0100 Subject: [PATCH] feat: integrate juno dev start --watch --- src/index.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 36d95d2a..86ba2063 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,7 +16,11 @@ const WELCOME = `${JUNO_LOGO} ${grey(`v${version}`)} Welcome 👋 `; -const outro = ({input: {destination, localDevelopment}}: {input: GeneratorInput}) => { +const outro = ({ + input: {destination, localDevelopment, serverlessFunctions} +}: { + input: GeneratorInput; +}) => { const emptyDestination = isNullish(destination) || destination === ''; const pm = whichPMRuns(); @@ -24,7 +28,11 @@ const outro = ({input: {destination, localDevelopment}}: {input: GeneratorInput} const enterYourProjectDirectory = `Enter your project directory by running ${cyan(`cd ${destination}`)}`; const startDevServer = `Run ${cyan(`${pm} run dev`)} to start your frontend dev server (CTRL+C to stop)`; const runJunoInit = `Connect your satellite to the project by executing ${cyan('juno init')}`; - const runJunoDevStart = `In another terminal, run ${cyan('juno dev start')} to quickstart the local development emulator`; + + const liveReload = + nonNullish(serverlessFunctions) && ['ts', 'js'].includes(serverlessFunctions) ? ' --watch' : ''; + const startCmd = `juno dev start${liveReload}`; + const runJunoDevStart = `In another terminal, run ${cyan(startCmd)} to quickstart the local development emulator`; const runs = (index: number): string => localDevelopment