diff --git a/src/configs/juno.config.ts b/src/configs/juno.config.ts index 97efc2f2..73f3b47f 100644 --- a/src/configs/juno.config.ts +++ b/src/configs/juno.config.ts @@ -12,6 +12,7 @@ import { } from '@junobuild/config-loader'; import {writeFile} from 'node:fs/promises'; import {JUNO_CONFIG_FILENAME} from '../constants/constants'; +import {EMULATOR_SATELLITE_IMAGE_DEFAULT_ID} from '../constants/emulator.constants'; import { TEMPLATE_INIT_PATH, TEMPLATE_JUNO_PREDEPLOY_CONFIG_FILENAME, @@ -68,14 +69,19 @@ export const writeJunoConfigPlaceholder = async ({ sourceFolder: TEMPLATE_INIT_PATH }); - const content = template + let content = template .replace('', source ?? DEPLOY_DEFAULT_SOURCE) - .replace('', pm === 'npm' ? 'npm run' : (pm ?? '')) - .replace('', emulatorConfig?.runner?.type ?? '') - .replace( - '', - nonNullish(emulatorConfig) ? ('satellite' in emulatorConfig ? 'satellite' : 'skylab') : '' - ); + .replace('', pm === 'npm' ? 'npm run' : (pm ?? '')); + + if (nonNullish(emulatorConfig)) { + content = content + .replace('', emulatorConfig.runner?.type ?? '') + .replace('', 'satellite' in emulatorConfig ? 'satellite' : 'skylab'); + + if ('satellite' in emulatorConfig) { + content = content.replace('', EMULATOR_SATELLITE_IMAGE_DEFAULT_ID); + } + } await writeFile(configPath ?? `${JUNO_CONFIG_FILENAME}.${configType}`, content, 'utf-8'); break; diff --git a/src/constants/emulator.constants.ts b/src/constants/emulator.constants.ts index 58149860..c0524d74 100644 --- a/src/constants/emulator.constants.ts +++ b/src/constants/emulator.constants.ts @@ -4,6 +4,8 @@ export const EMULATOR_PORT_SERVER = 5987; export const EMULATOR_PORT_ADMIN = 5999; export const EMULATOR_PORT_CONSOLE = 5866; +export const EMULATOR_SATELLITE_IMAGE_DEFAULT_ID = 'jx5yt-yyaaa-aaaal-abzbq-cai'; + export const EMULATOR_SKYLAB: Required = { ports: { server: EMULATOR_PORT_SERVER,