Skip to content

Commit 76882a8

Browse files
committed
📦 refactor: cli home styles
1 parent 03f8ca1 commit 76882a8

File tree

3 files changed

+26
-19
lines changed

3 files changed

+26
-19
lines changed

src/cli.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
1-
import { build } from 'gluegun'
1+
import { build } from 'gluegun';
22

3-
/**
4-
* Create the cli and kick it off
5-
*/
63
async function run(argv) {
7-
// create a CLI runtime
84
const cli = build()
95
.brand('ngx-devs-cli')
106
.src(__dirname)
117
.plugins('./node_modules', { matching: 'ngx-devs-cli-*', hidden: true })
12-
.help() // provides default for help, h, --help, -h
138
.version() // provides default for version, v, --version, -v
149
.create()
1510
// enable the following method if you'd like to skip loading one of these core extensions
1611
// this can improve performance if they're not necessary for your project:
1712
// .exclude(['meta', 'strings', 'print', 'filesystem', 'semver', 'system', 'prompt', 'http', 'template', 'patching', 'package-manager'])
1813
// and run it
1914
const toolbox = await cli.run(argv)
20-
21-
// send it back (for testing, mostly)
2215
return toolbox
2316
}
2417

src/commands/ngx-devs-cli.ts

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
import { GluegunCommand } from 'gluegun';
22

3-
const command: GluegunCommand = {
3+
import { ASCII_ART } from '../utils/cli-ascii.const';
4+
5+
const COMMAND: GluegunCommand = {
46
name: 'ngx-devs-cli',
7+
alias: ['ngxd'],
8+
description: 'Inicializa a CLI do NgxDevs',
59
run: async (toolbox) => {
610
const { print } = toolbox
7-
8-
const ASCII_ART = `
9-
███╗░░██╗░██████╗░██╗░░██╗░░░░░░██████╗░███████╗██╗░░░██╗░██████╗  ░█████╗░██╗░░░░░██╗
10-
████╗░██║██╔════╝░╚██╗██╔╝░░░░░░██╔══██╗██╔════╝██║░░░██║██╔════╝  ██╔══██╗██║░░░░░██║
11-
██╔██╗██║██║░░██╗░░╚███╔╝░█████╗██║░░██║█████╗░░╚██╗░██╔╝╚█████╗░  ██║░░╚═╝██║░░░░░██║
12-
██║╚████║██║░░╚██╗░██╔██╗░╚════╝██║░░██║██╔══╝░░░╚████╔╝░░╚═══██╗  ██║░░██╗██║░░░░░██║
13-
██║░╚███║╚██████╔╝██╔╝╚██╗░░░░░░██████╔╝███████╗░░╚██╔╝░░██████╔╝  ╚█████╔╝███████╗██║
14-
╚═╝░░╚══╝░╚═════╝░╚═╝░░╚═╝░░░░░░╚═════╝░╚══════╝░░░╚═╝░░░╚═════╝░  ░╚════╝░╚══════╝╚═╝`
11+
const version = require('../../package.json').version
1512

1613
print.info(ASCII_ART)
17-
print.info('Commands:')
14+
print.info(` version: ${version}`)
15+
print.divider()
16+
17+
print.highlight('Como Utilizar:')
18+
print.newline()
19+
20+
print.info(' ngxd <command>')
21+
print.info(' ngxd <command> [options]')
22+
print.divider()
23+
24+
print.highlight('Comandos:')
1825
print.printCommands(toolbox)
1926
},
2027
}
2128

22-
module.exports = command
29+
module.exports = COMMAND

src/utils/cli-ascii.const.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export const ASCII_ART = `
2+
███╗░░██╗░██████╗░██╗░░██╗░░░░░░██████╗░███████╗██╗░░░██╗░██████╗  ░█████╗░██╗░░░░░██╗
3+
████╗░██║██╔════╝░╚██╗██╔╝░░░░░░██╔══██╗██╔════╝██║░░░██║██╔════╝  ██╔══██╗██║░░░░░██║
4+
██╔██╗██║██║░░██╗░░╚███╔╝░█████╗██║░░██║█████╗░░╚██╗░██╔╝╚█████╗░  ██║░░╚═╝██║░░░░░██║
5+
██║╚████║██║░░╚██╗░██╔██╗░╚════╝██║░░██║██╔══╝░░░╚████╔╝░░╚═══██╗  ██║░░██╗██║░░░░░██║
6+
██║░╚███║╚██████╔╝██╔╝╚██╗░░░░░░██████╔╝███████╗░░╚██╔╝░░██████╔╝  ╚█████╔╝███████╗██║
7+
╚═╝░░╚══╝░╚═════╝░╚═╝░░╚═╝░░░░░░╚═════╝░╚══════╝░░░╚═╝░░░╚═════╝░  ░╚════╝░╚══════╝╚═╝`

0 commit comments

Comments
 (0)