From 8cdb721ca3cbab57b42598846f45fc1b92a3e897 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Tue, 3 Jun 2025 11:34:12 +0200 Subject: [PATCH] feat: redo dev commands as alias --- src/commands/dev.ts | 16 ++++++++++++++++ src/constants/help.constants.ts | 2 +- src/help/dev.help.ts | 4 +++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/commands/dev.ts b/src/commands/dev.ts index 5b9553f9..60e83d16 100644 --- a/src/commands/dev.ts +++ b/src/commands/dev.ts @@ -1,8 +1,12 @@ import {red} from 'kleur'; import {logHelpDev} from '../help/dev.help'; import {logHelpDevStart} from '../help/dev.start.help'; +import {logHelpFunctionsBuild} from '../help/functions.build.help'; +import {logHelpFunctionsEject} from '../help/functions.eject.help'; import {stop} from '../services/dev/start/docker.services'; import {start} from '../services/dev/start/start.services'; +import {build} from '../services/functions/build/build.services'; +import {eject} from '../services/functions/eject/eject.services'; export const dev = async (args?: string[]) => { const [subCommand] = args ?? []; @@ -14,6 +18,12 @@ export const dev = async (args?: string[]) => { case 'stop': await stop(); break; + case 'eject': + await eject(args); + break; + case 'build': + await build(args); + break; default: console.log(red('Unknown subcommand.')); logHelpDev(args); @@ -27,6 +37,12 @@ export const helpDev = (args?: string[]) => { case 'start': logHelpDevStart(args); break; + case 'build': + logHelpFunctionsBuild(args); + break; + case 'eject': + logHelpFunctionsEject(args); + break; default: logHelpDev(args); } diff --git a/src/constants/help.constants.ts b/src/constants/help.constants.ts index 1215b5fb..5a7de9cb 100644 --- a/src/constants/help.constants.ts +++ b/src/constants/help.constants.ts @@ -6,7 +6,7 @@ export const CLEAR_DESCRIPTION = export const CONFIG_DESCRIPTION = 'Apply configuration to satellite.'; export const DEPLOY_DESCRIPTION = 'Deploy your app to your satellite.'; export const DEV_DESCRIPTION = - 'Handle local development tasks like starting or stopping a local Internet Computer instance.'; + 'Handle developer tasks like starting/stopping a local network or building functions.'; export const FUNCTIONS_DESCRIPTION = "Build and upgrade your satellite's serverless functions."; export const INIT_DESCRIPTION = 'Set up your project.'; export const LOGIN_DESCRIPTION = diff --git a/src/help/dev.help.ts b/src/help/dev.help.ts index 5b01a766..85770ef0 100644 --- a/src/help/dev.help.ts +++ b/src/help/dev.help.ts @@ -7,7 +7,9 @@ const usage = `Usage: ${green('juno')} ${cyan('dev')} ${magenta('')} Subcommands: ${magenta('start')} ${DEV_START_DESCRIPTION} - ${magenta('stop')} Stop the local network.`; + ${magenta('stop')} Stop the local network. + ${magenta('build')} Alias for ${green('juno')} ${cyan('functions')} ${magenta('build')}. + ${magenta('eject')} Alias for ${green('juno')} ${cyan('functions')} ${magenta('eject')}.`; const doc = `${DEV_DESCRIPTION}