rook-cli 1.3.10 → 1.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/app.js +14 -13
- package/src/commands/AddCommand.js +6 -2
- package/src/ui/PromptUI.js +5 -0
- package/src/utils/logger.js +12 -4
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -41,22 +41,26 @@ export class App {
|
|
|
41
41
|
this.conflictResolver = new ConflictResolver(this.logger);
|
|
42
42
|
this.fileMapper = new FileMapper(this.logger, this.conflictResolver);
|
|
43
43
|
|
|
44
|
+
// -- Serviços --
|
|
45
|
+
this.scaffoldService = new ScaffoldService(this.logger);
|
|
46
|
+
this.frameworkInstaller = new FrameworkInstaller(this.logger);
|
|
47
|
+
|
|
44
48
|
// -- Comandos --
|
|
45
|
-
this.
|
|
49
|
+
this.installCommand = new InstallCommand(
|
|
46
50
|
this.logger,
|
|
47
51
|
this.promptUI,
|
|
48
|
-
this.
|
|
49
|
-
this.downloadService,
|
|
50
|
-
this.fileMapper
|
|
52
|
+
this.frameworkInstaller
|
|
51
53
|
);
|
|
52
54
|
|
|
53
|
-
this.
|
|
55
|
+
this.addCommand = new AddCommand(
|
|
54
56
|
this.logger,
|
|
55
|
-
this.
|
|
57
|
+
this.promptUI,
|
|
58
|
+
this.githubService,
|
|
59
|
+
this.downloadService,
|
|
60
|
+
this.fileMapper,
|
|
61
|
+
this.installCommand
|
|
56
62
|
);
|
|
57
63
|
|
|
58
|
-
this.scaffoldService = new ScaffoldService(this.logger);
|
|
59
|
-
|
|
60
64
|
this.generateCommand = new GenerateCommand(
|
|
61
65
|
this.logger,
|
|
62
66
|
this.promptUI,
|
|
@@ -64,12 +68,9 @@ export class App {
|
|
|
64
68
|
this.conflictResolver
|
|
65
69
|
);
|
|
66
70
|
|
|
67
|
-
this.
|
|
68
|
-
|
|
69
|
-
this.installCommand = new InstallCommand(
|
|
71
|
+
this.configCommand = new ConfigCommand(
|
|
70
72
|
this.logger,
|
|
71
|
-
this.
|
|
72
|
-
this.frameworkInstaller
|
|
73
|
+
this.tokenManager
|
|
73
74
|
);
|
|
74
75
|
}
|
|
75
76
|
|
|
@@ -24,13 +24,15 @@ export class AddCommand {
|
|
|
24
24
|
* @param {import('../services/GitHubService.js').GitHubService} githubService
|
|
25
25
|
* @param {import('../services/DownloadService.js').DownloadService} downloadService
|
|
26
26
|
* @param {import('../filesystem/FileMapper.js').FileMapper} fileMapper
|
|
27
|
+
* @param {import('./InstallCommand.js').InstallCommand} installCommand
|
|
27
28
|
*/
|
|
28
|
-
constructor(logger, promptUI, githubService, downloadService, fileMapper) {
|
|
29
|
+
constructor(logger, promptUI, githubService, downloadService, fileMapper, installCommand) {
|
|
29
30
|
this.logger = logger;
|
|
30
31
|
this.promptUI = promptUI;
|
|
31
32
|
this.githubService = githubService;
|
|
32
33
|
this.downloadService = downloadService;
|
|
33
34
|
this.fileMapper = fileMapper;
|
|
35
|
+
this.installCommand = installCommand;
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
/**
|
|
@@ -57,7 +59,9 @@ export class AddCommand {
|
|
|
57
59
|
const tipoInstalacao = opcoes.type || await this.promptUI.menuPrincipal();
|
|
58
60
|
|
|
59
61
|
// 2. Delega para o fluxo correto
|
|
60
|
-
if (tipoInstalacao === '
|
|
62
|
+
if (tipoInstalacao === 'framework') {
|
|
63
|
+
await this.installCommand.executar();
|
|
64
|
+
} else if (tipoInstalacao === 'kit') {
|
|
61
65
|
await this._instalarKit(opcoes.name);
|
|
62
66
|
} else {
|
|
63
67
|
await this._instalarComponentes(opcoes.name);
|
package/src/ui/PromptUI.js
CHANGED
|
@@ -74,6 +74,11 @@ export class PromptUI {
|
|
|
74
74
|
const escolha = await select({
|
|
75
75
|
message: 'O que você deseja instalar?',
|
|
76
76
|
choices: [
|
|
77
|
+
{
|
|
78
|
+
name: '⚡ Rook UI Framework — Instala o core framework no tema',
|
|
79
|
+
value: 'framework',
|
|
80
|
+
description: 'Tokens, variáveis, estilos base e snippets do framework',
|
|
81
|
+
},
|
|
77
82
|
{
|
|
78
83
|
name: '🎯 Kit Base — Estrutura completa para iniciar projetos',
|
|
79
84
|
value: 'kit',
|
package/src/utils/logger.js
CHANGED
|
@@ -47,11 +47,19 @@ export class Logger {
|
|
|
47
47
|
* Exibe o banner/header do CLI.
|
|
48
48
|
*/
|
|
49
49
|
banner() {
|
|
50
|
+
const dim = pc.dim;
|
|
51
|
+
const bold = pc.bold;
|
|
52
|
+
const white = pc.white;
|
|
53
|
+
|
|
54
|
+
console.log('');
|
|
55
|
+
console.log(bold(white(' ██████╗ ██████╗ ██████╗ ██╗ ██╗')));
|
|
56
|
+
console.log(bold(white(' ██╔══██╗██╔═══██╗██╔═══██╗██║ ██╔╝')));
|
|
57
|
+
console.log(bold(white(' ██████╔╝██║ ██║██║ ██║█████╔╝ ')));
|
|
58
|
+
console.log(bold(white(' ██╔══██╗██║ ██║██║ ██║██╔═██╗ ')));
|
|
59
|
+
console.log(bold(white(' ██║ ██║╚██████╔╝╚██████╔╝██║ ██╗')));
|
|
60
|
+
console.log(bold(white(' ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝')));
|
|
50
61
|
console.log('');
|
|
51
|
-
console.log(
|
|
52
|
-
console.log(pc.bold(pc.white(' ║ ♟️ ROOK CLI v1.3.10 ║')));
|
|
53
|
-
console.log(pc.bold(pc.white(' ║ Shopify Component Tool ║')));
|
|
54
|
-
console.log(pc.bold(pc.white(' ╚══════════════════════════════╝')));
|
|
62
|
+
console.log(dim(' v1.3.11 — Shopify Component Tool'));
|
|
55
63
|
console.log('');
|
|
56
64
|
}
|
|
57
65
|
|