@stacksjs/cli 0.63.1 → 0.64.0

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/src/console.ts CHANGED
@@ -1,111 +1,4 @@
1
- import { log, logger } from '@stacksjs/logging'
1
+ import { log } from '@stacksjs/logging'
2
2
  import prompts from 'prompts'
3
3
 
4
- export class Prompt {
5
- private required: boolean
6
-
7
- constructor() {
8
- this.required = false
9
- }
10
-
11
- require() {
12
- this.required = true
13
- return this
14
- }
15
-
16
- isRequired() {
17
- return this.required
18
- }
19
-
20
- async select(message: any, options: any) {
21
- if (this.isRequired())
22
- return logger.prompt(message, {
23
- ...options,
24
- type: 'select',
25
- required: true,
26
- })
27
-
28
- return logger.prompt(message, { ...options, type: 'select' })
29
- }
30
-
31
- async checkbox(message: any, options: any) {
32
- if (this.isRequired())
33
- return logger.prompt(message, {
34
- ...options,
35
- type: 'multiselect',
36
- required: true,
37
- })
38
-
39
- return logger.prompt(message, { ...options, type: 'multiselect' })
40
- }
41
-
42
- async confirm(message: any, options?: any) {
43
- if (this.isRequired())
44
- return logger.prompt(message, {
45
- ...options,
46
- type: 'confirm',
47
- required: true,
48
- })
49
-
50
- return logger.prompt(message, { ...options, type: 'confirm' })
51
- }
52
-
53
- async input(message: any, options: any) {
54
- if (this.isRequired())
55
- return logger.prompt(message, {
56
- ...options,
57
- type: 'text',
58
- required: true,
59
- })
60
-
61
- return logger.prompt(message, { ...options, type: 'text' })
62
- }
63
-
64
- async password(message: any, options: any) {
65
- if (this.isRequired())
66
- return logger.prompt(message, {
67
- ...options,
68
- type: 'password',
69
- required: true,
70
- })
71
-
72
- return logger.prompt(message, { ...options, type: 'password' })
73
- }
74
-
75
- async number(message: any, options: any) {
76
- if (this.isRequired())
77
- return logger.prompt(message, {
78
- ...options,
79
- type: 'numeral',
80
- required: true,
81
- })
82
-
83
- return logger.prompt(message, { ...options, type: 'numeral' })
84
- }
85
-
86
- async multiselect(message: any, options: any) {
87
- if (this.isRequired())
88
- return logger.prompt(message, {
89
- ...options,
90
- type: 'multiselect',
91
- required: true,
92
- })
93
-
94
- return logger.prompt(message, { ...options, type: 'multiselect' })
95
- }
96
-
97
- async autocomplete(message: any, options: any) {
98
- if (this.isRequired())
99
- return logger.prompt(message, {
100
- ...options,
101
- type: 'autocomplete',
102
- required: true,
103
- })
104
-
105
- return logger.prompt(message, { ...options, type: 'autocomplete' })
106
- }
107
- }
108
-
109
- export { prompts, logger, log }
110
-
111
- export const prompt = () => new Prompt()
4
+ export { prompts, log }
package/src/helpers.ts CHANGED
@@ -16,7 +16,7 @@ export async function intro(command: string, options?: IntroOptions): Promise<nu
16
16
  console.log()
17
17
  }
18
18
 
19
- log.info(`Running ${bgCyan(italic(bold(` ${command} `)))}`)
19
+ log.info(`Running ${bgCyan(italic(bold(` ${command} `)))}`, { styled: false })
20
20
 
21
21
  if (options?.showPerformance === false || options?.quiet) return resolve(0)
22
22