Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/commands/dev.ts
Original file line number Diff line number Diff line change
@@ -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 ?? [];
Expand All @@ -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);
Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/constants/help.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
4 changes: 3 additions & 1 deletion src/help/dev.help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const usage = `Usage: ${green('juno')} ${cyan('dev')} ${magenta('<subcommand>')}

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}

Expand Down