@stacksjs/buddy 0.59.11 → 0.61.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/README.md +0 -1
- package/dist/chunk-b0df37cbea681adc.js +2223 -0
- package/dist/{chunk-d2428b387d843985.js → chunk-eb51d49adb5b5f07.js} +478 -247
- package/dist/cli.js +13 -4
- package/dist/index.js +1 -1
- package/dist/stacks +0 -0
- package/package.json +1 -1
- package/src/cli.ts +17 -13
- package/src/commands/add.ts +5 -6
- package/src/commands/build.ts +55 -34
- package/src/commands/changelog.ts +13 -6
- package/src/commands/clean.ts +13 -5
- package/src/commands/cloud.ts +91 -30
- package/src/commands/commit.ts +2 -2
- package/src/commands/configure.ts +7 -7
- package/src/commands/create.ts +14 -10
- package/src/commands/deploy.ts +15 -10
- package/src/commands/dev.ts +53 -53
- package/src/commands/dns.ts +5 -5
- package/src/commands/domains.ts +132 -41
- package/src/commands/fresh.ts +16 -6
- package/src/commands/generate.ts +14 -16
- package/src/commands/http.ts +2 -2
- package/src/commands/install.ts +2 -2
- package/src/commands/key.ts +3 -3
- package/src/commands/lint.ts +4 -4
- package/src/commands/list.ts +3 -4
- package/src/commands/make.ts +101 -65
- package/src/commands/migrate.ts +52 -9
- package/src/commands/ports.ts +35 -37
- package/src/commands/prepublish.ts +3 -3
- package/src/commands/projects.ts +5 -11
- package/src/commands/release.ts +8 -6
- package/src/commands/seed.ts +12 -5
- package/src/commands/setup.ts +10 -11
- package/src/commands/test.ts +97 -30
- package/src/commands/tinker.ts +10 -6
- package/src/commands/types.ts +3 -3
- package/src/commands/upgrade.ts +49 -29
- package/src/commands/version.ts +11 -13
- package/src/custom-cli.ts +5 -7
- package/dist/cli.d.ts +0 -1
- package/dist/commands/build.d.ts +0 -2
- package/dist/commands/changelog.d.ts +0 -2
- package/dist/commands/clean.d.ts +0 -2
- package/dist/commands/cloud.d.ts +0 -2
- package/dist/commands/commit.d.ts +0 -2
- package/dist/commands/configure.d.ts +0 -2
- package/dist/commands/create.d.ts +0 -2
- package/dist/commands/deploy.d.ts +0 -2
- package/dist/commands/dev.d.ts +0 -3
- package/dist/commands/dns.d.ts +0 -2
- package/dist/commands/domains.d.ts +0 -2
- package/dist/commands/fresh.d.ts +0 -2
- package/dist/commands/generate.d.ts +0 -2
- package/dist/commands/http.d.ts +0 -2
- package/dist/commands/index.d.ts +0 -31
- package/dist/commands/install.d.ts +0 -2
- package/dist/commands/key.d.ts +0 -2
- package/dist/commands/lint.d.ts +0 -2
- package/dist/commands/list.d.ts +0 -2
- package/dist/commands/make.d.ts +0 -2
- package/dist/commands/migrate.d.ts +0 -2
- package/dist/commands/ports.d.ts +0 -2
- package/dist/commands/prepublish.d.ts +0 -2
- package/dist/commands/projects.d.ts +0 -2
- package/dist/commands/release.d.ts +0 -2
- package/dist/commands/seed.d.ts +0 -2
- package/dist/commands/setup.d.ts +0 -4
- package/dist/commands/test.d.ts +0 -2
- package/dist/commands/tinker.d.ts +0 -2
- package/dist/commands/types.d.ts +0 -2
- package/dist/commands/upgrade.d.ts +0 -2
- package/dist/commands/version.d.ts +0 -2
- package/dist/index.d.ts +0 -1
package/src/commands/dev.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import process from 'node:process'
|
|
2
|
-
import { Action } from '@stacksjs/enums'
|
|
3
2
|
import {
|
|
4
3
|
runAction,
|
|
5
4
|
runApiDevServer,
|
|
@@ -10,10 +9,11 @@ import {
|
|
|
10
9
|
runFrontendDevServer,
|
|
11
10
|
runSystemTrayDevServer,
|
|
12
11
|
} from '@stacksjs/actions'
|
|
13
|
-
import { ExitCode } from '@stacksjs/types'
|
|
14
|
-
import type { CLI, DevOptions } from '@stacksjs/types'
|
|
15
12
|
import { intro, log, outro, runCommand } from '@stacksjs/cli'
|
|
13
|
+
import { Action } from '@stacksjs/enums'
|
|
16
14
|
import { libsPath } from '@stacksjs/path'
|
|
15
|
+
import { ExitCode } from '@stacksjs/types'
|
|
16
|
+
import type { CLI, DevOptions } from '@stacksjs/types'
|
|
17
17
|
|
|
18
18
|
export function dev(buddy: CLI) {
|
|
19
19
|
const descriptions = {
|
|
@@ -44,8 +44,10 @@ export function dev(buddy: CLI) {
|
|
|
44
44
|
.option('-d, --docs', descriptions.docs)
|
|
45
45
|
.option('-t, --system-tray', descriptions.systemTray)
|
|
46
46
|
.option('-i, --interactive', descriptions.interactive, { default: false })
|
|
47
|
-
.option('-l, --with-localhost', descriptions.withLocalhost, {
|
|
48
|
-
|
|
47
|
+
.option('-l, --with-localhost', descriptions.withLocalhost, {
|
|
48
|
+
default: false,
|
|
49
|
+
})
|
|
50
|
+
.option('-p, --project [project]', descriptions.project, { default: false })
|
|
49
51
|
.option('--verbose', descriptions.verbose, { default: false })
|
|
50
52
|
.action(async (server: string | undefined, options: DevOptions) => {
|
|
51
53
|
log.debug('Running `buddy dev [server]` ...', options)
|
|
@@ -79,9 +81,9 @@ export function dev(buddy: CLI) {
|
|
|
79
81
|
case 'system-tray':
|
|
80
82
|
await runSystemTrayDevServer(options)
|
|
81
83
|
break
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
// case 'email':
|
|
85
|
+
// await runEmailDevServer(options)
|
|
86
|
+
// break
|
|
85
87
|
case 'docs':
|
|
86
88
|
await runDocsDevServer(options)
|
|
87
89
|
break
|
|
@@ -89,48 +91,38 @@ export function dev(buddy: CLI) {
|
|
|
89
91
|
}
|
|
90
92
|
|
|
91
93
|
if (wantsInteractive(options)) {
|
|
92
|
-
const answer = await log.prompt.require()
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
})
|
|
94
|
+
const answer = await log.prompt.require().select(descriptions.select, {
|
|
95
|
+
options: [
|
|
96
|
+
{ value: 'all', label: 'All' },
|
|
97
|
+
{ value: 'frontend', label: 'Frontend' },
|
|
98
|
+
{ value: 'api', label: 'Backend' },
|
|
99
|
+
{ value: 'dashboard', label: 'Dashboard' },
|
|
100
|
+
{ value: 'desktop', label: 'Desktop' },
|
|
101
|
+
{ value: 'email', label: 'Email' },
|
|
102
|
+
{ value: 'components', label: 'Components' },
|
|
103
|
+
{ value: 'docs', label: 'Documentation' },
|
|
104
|
+
],
|
|
105
|
+
})
|
|
105
106
|
|
|
106
107
|
if (answer === 'components') {
|
|
107
108
|
await runComponentsDevServer(options)
|
|
108
|
-
}
|
|
109
|
-
else if (answer === 'api') {
|
|
109
|
+
} else if (answer === 'api') {
|
|
110
110
|
await runApiDevServer(options)
|
|
111
|
-
}
|
|
112
|
-
else if (answer === 'dashboard') {
|
|
111
|
+
} else if (answer === 'dashboard') {
|
|
113
112
|
await runDashboardDevServer(options)
|
|
114
113
|
}
|
|
115
114
|
// else if (answer === 'email')
|
|
116
115
|
// await runEmailDevServer(options)
|
|
117
116
|
else if (answer === 'docs') {
|
|
118
117
|
await runDocsDevServer(options)
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
else {
|
|
118
|
+
} else {
|
|
122
119
|
log.error('Invalid option during interactive mode')
|
|
123
120
|
process.exit(ExitCode.InvalidArgument)
|
|
124
121
|
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
if (options.
|
|
129
|
-
await runComponentsDevServer(options)
|
|
130
|
-
if (options.docs)
|
|
131
|
-
await runDocsDevServer(options)
|
|
132
|
-
else if (options.api)
|
|
133
|
-
await runApiDevServer(options)
|
|
122
|
+
} else {
|
|
123
|
+
if (options.components) await runComponentsDevServer(options)
|
|
124
|
+
if (options.docs) await runDocsDevServer(options)
|
|
125
|
+
else if (options.api) await runApiDevServer(options)
|
|
134
126
|
// else if (options.email)
|
|
135
127
|
// await runEmailDevServer(options)
|
|
136
128
|
}
|
|
@@ -143,7 +135,7 @@ export function dev(buddy: CLI) {
|
|
|
143
135
|
|
|
144
136
|
buddy
|
|
145
137
|
.command('dev:components', descriptions.components)
|
|
146
|
-
.option('-p, --project', descriptions.project, { default: false })
|
|
138
|
+
.option('-p, --project [project]', descriptions.project, { default: false })
|
|
147
139
|
.option('--verbose', descriptions.verbose, { default: false })
|
|
148
140
|
.action(async (options: DevOptions) => {
|
|
149
141
|
log.debug('Running `buddy dev:components` ...', options)
|
|
@@ -154,15 +146,17 @@ export function dev(buddy: CLI) {
|
|
|
154
146
|
// silent: !options.verbose,
|
|
155
147
|
})
|
|
156
148
|
|
|
157
|
-
if (options.verbose)
|
|
158
|
-
log.info('buddy dev:components result', result)
|
|
149
|
+
if (options.verbose) log.info('buddy dev:components result', result)
|
|
159
150
|
|
|
160
151
|
if (result.isErr()) {
|
|
161
|
-
await outro(
|
|
152
|
+
await outro(
|
|
153
|
+
'While running the dev:components command, there was an issue',
|
|
154
|
+
{ startTime: perf, useSeconds: true },
|
|
155
|
+
result.error,
|
|
156
|
+
)
|
|
162
157
|
process.exit()
|
|
163
158
|
}
|
|
164
159
|
|
|
165
|
-
// eslint-disable-next-line no-console
|
|
166
160
|
console.log('')
|
|
167
161
|
await outro('Exited', { startTime: perf, useSeconds: true })
|
|
168
162
|
process.exit(ExitCode.Success)
|
|
@@ -170,7 +164,7 @@ export function dev(buddy: CLI) {
|
|
|
170
164
|
|
|
171
165
|
buddy
|
|
172
166
|
.command('dev:docs', descriptions.docs)
|
|
173
|
-
.option('-p, --project', descriptions.project, { default: false })
|
|
167
|
+
.option('-p, --project [project]', descriptions.project, { default: false })
|
|
174
168
|
.option('--verbose', descriptions.verbose, { default: false })
|
|
175
169
|
.action(async (options: DevOptions) => {
|
|
176
170
|
log.debug('Running `buddy dev:docs` ...', options)
|
|
@@ -179,11 +173,14 @@ export function dev(buddy: CLI) {
|
|
|
179
173
|
const result = await runAction(Action.DevDocs, options)
|
|
180
174
|
|
|
181
175
|
if (result.isErr()) {
|
|
182
|
-
await outro(
|
|
176
|
+
await outro(
|
|
177
|
+
'While running the dev:docs command, there was an issue',
|
|
178
|
+
{ startTime: perf, useSeconds: true },
|
|
179
|
+
result.error,
|
|
180
|
+
)
|
|
183
181
|
process.exit()
|
|
184
182
|
}
|
|
185
183
|
|
|
186
|
-
// eslint-disable-next-line no-console
|
|
187
184
|
console.log('')
|
|
188
185
|
await outro('Exited', { startTime: perf, useSeconds: true })
|
|
189
186
|
process.exit(ExitCode.Success)
|
|
@@ -191,7 +188,7 @@ export function dev(buddy: CLI) {
|
|
|
191
188
|
|
|
192
189
|
buddy
|
|
193
190
|
.command('dev:desktop', descriptions.desktop)
|
|
194
|
-
.option('-p, --project', descriptions.project, { default: false })
|
|
191
|
+
.option('-p, --project [project]', descriptions.project, { default: false })
|
|
195
192
|
.option('--verbose', descriptions.verbose, { default: false })
|
|
196
193
|
.action(async (options: DevOptions) => {
|
|
197
194
|
log.debug('Running `buddy dev:desktop` ...', options)
|
|
@@ -200,11 +197,14 @@ export function dev(buddy: CLI) {
|
|
|
200
197
|
const result = await runAction(Action.DevDesktop, options)
|
|
201
198
|
|
|
202
199
|
if (result.isErr()) {
|
|
203
|
-
await outro(
|
|
200
|
+
await outro(
|
|
201
|
+
'While running the dev:desktop command, there was an issue',
|
|
202
|
+
{ startTime: perf, useSeconds: true },
|
|
203
|
+
result.error,
|
|
204
|
+
)
|
|
204
205
|
process.exit()
|
|
205
206
|
}
|
|
206
207
|
|
|
207
|
-
// eslint-disable-next-line no-console
|
|
208
208
|
console.log('')
|
|
209
209
|
await outro('Exited', { startTime: perf, useSeconds: true })
|
|
210
210
|
process.exit(ExitCode.Success)
|
|
@@ -212,7 +212,7 @@ export function dev(buddy: CLI) {
|
|
|
212
212
|
|
|
213
213
|
buddy
|
|
214
214
|
.command('dev:api', descriptions.api)
|
|
215
|
-
.option('-p, --project', descriptions.project, { default: false })
|
|
215
|
+
.option('-p, --project [project]', descriptions.project, { default: false })
|
|
216
216
|
.option('--verbose', descriptions.verbose, { default: false })
|
|
217
217
|
.action(async (options: DevOptions) => {
|
|
218
218
|
log.debug('Running `buddy dev:api` ...', options)
|
|
@@ -222,7 +222,7 @@ export function dev(buddy: CLI) {
|
|
|
222
222
|
|
|
223
223
|
// buddy
|
|
224
224
|
// .command('dev:functions', descriptions.api)
|
|
225
|
-
// .option('-p, --project', descriptions.project, { default: false })//
|
|
225
|
+
// .option('-p, --project [project]', descriptions.project, { default: false })//
|
|
226
226
|
// .option('--verbose', descriptions.verbose, { default: false })
|
|
227
227
|
// .action(async (options: DevOptions) => {
|
|
228
228
|
// await runFunctionsDevServer(options)
|
|
@@ -232,7 +232,7 @@ export function dev(buddy: CLI) {
|
|
|
232
232
|
.command('dev:frontend', descriptions.frontend)
|
|
233
233
|
.alias('dev:pages')
|
|
234
234
|
.alias('dev:views')
|
|
235
|
-
.option('-p, --project', descriptions.project, { default: false })
|
|
235
|
+
.option('-p, --project [project]', descriptions.project, { default: false })
|
|
236
236
|
.option('--verbose', descriptions.verbose, { default: false })
|
|
237
237
|
.action(async (options: DevOptions) => {
|
|
238
238
|
log.debug('Running `buddy dev:frontend` ...', options)
|
|
@@ -242,7 +242,7 @@ export function dev(buddy: CLI) {
|
|
|
242
242
|
buddy
|
|
243
243
|
.command('dev:dashboard', descriptions.dashboard)
|
|
244
244
|
.alias('dev:admin')
|
|
245
|
-
.option('-p, --project', descriptions.project, { default: false })
|
|
245
|
+
.option('-p, --project [project]', descriptions.project, { default: false })
|
|
246
246
|
.option('--verbose', descriptions.verbose, { default: false })
|
|
247
247
|
.action(async (options: DevOptions) => {
|
|
248
248
|
log.debug('Running `buddy dev:dashboard` ...', options)
|
|
@@ -252,7 +252,7 @@ export function dev(buddy: CLI) {
|
|
|
252
252
|
buddy
|
|
253
253
|
.command('dev:system-tray', descriptions.systemTray)
|
|
254
254
|
.alias('dev:tray')
|
|
255
|
-
.option('-p, --project', descriptions.project, { default: false })
|
|
255
|
+
.option('-p, --project [project]', descriptions.project, { default: false })
|
|
256
256
|
.option('--verbose', descriptions.verbose, { default: false })
|
|
257
257
|
.action(async (options: DevOptions) => {
|
|
258
258
|
log.debug('Running `buddy dev:system-tray` ...', options)
|
package/src/commands/dns.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import process from 'node:process'
|
|
2
|
+
import { log, runCommand } from '@stacksjs/cli'
|
|
3
|
+
import { config } from '@stacksjs/config'
|
|
2
4
|
import { ExitCode } from '@stacksjs/types'
|
|
3
5
|
import type { CLI } from '@stacksjs/types'
|
|
4
|
-
import { config } from '@stacksjs/config'
|
|
5
|
-
import { log, runCommand } from '@stacksjs/cli'
|
|
6
6
|
|
|
7
7
|
// import { Action } from '@stacksjs/enums'
|
|
8
8
|
// import { runAction } from '@stacksjs/actions'
|
|
@@ -56,7 +56,7 @@ export function dns(buddy: CLI) {
|
|
|
56
56
|
.option('-1, --short', descriptions.short, { default: false })
|
|
57
57
|
.option('-J, --json', descriptions.json, { default: false })
|
|
58
58
|
.option('-p, --pretty', descriptions.pretty, { default: true })
|
|
59
|
-
.option('-p, --project', descriptions.project, { default: false })
|
|
59
|
+
.option('-p, --project [project]', descriptions.project, { default: false })
|
|
60
60
|
.option('--verbose', descriptions.verbose, { default: false })
|
|
61
61
|
.action(async (domain: string | undefined, options: DnsOptions) => {
|
|
62
62
|
log.debug('Running `buddy dns [domain]` ...', options)
|
|
@@ -65,8 +65,8 @@ export function dns(buddy: CLI) {
|
|
|
65
65
|
// if (options.json && options.pretty)
|
|
66
66
|
// prettyOutput = true
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
options.pretty = undefined
|
|
69
|
+
options.p = undefined
|
|
70
70
|
|
|
71
71
|
// Convert options object to command-line options string
|
|
72
72
|
const optionsString = Object.entries(options)
|
package/src/commands/domains.ts
CHANGED
|
@@ -3,9 +3,9 @@ import { runAction } from '@stacksjs/actions'
|
|
|
3
3
|
import { bgCyan, bold, intro, italic, log, outro, prompts } from '@stacksjs/cli'
|
|
4
4
|
import { config } from '@stacksjs/config'
|
|
5
5
|
import { addDomain } from '@stacksjs/dns'
|
|
6
|
+
import { Action } from '@stacksjs/enums'
|
|
6
7
|
import { ExitCode } from '@stacksjs/types'
|
|
7
8
|
import type { CLI, DomainsOptions } from '@stacksjs/types'
|
|
8
|
-
import { Action } from '@stacksjs/enums'
|
|
9
9
|
|
|
10
10
|
export function domains(buddy: CLI) {
|
|
11
11
|
const descriptions = {
|
|
@@ -21,47 +21,109 @@ export function domains(buddy: CLI) {
|
|
|
21
21
|
|
|
22
22
|
buddy
|
|
23
23
|
.command('domains:purchase <domain>', descriptions.purchase)
|
|
24
|
-
.option('--years <years>', 'Number of years to purchase the domain for', {
|
|
24
|
+
.option('--years <years>', 'Number of years to purchase the domain for', {
|
|
25
|
+
default: 1,
|
|
26
|
+
})
|
|
25
27
|
.option('--privacy', 'Enable privacy protection', { default: true })
|
|
26
28
|
.option('--auto-renew', 'Enable auto-renew', { default: true })
|
|
27
|
-
.option('--first-name <firstName>', 'Registrant first name', {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
.option('--
|
|
31
|
-
|
|
29
|
+
.option('--first-name <firstName>', 'Registrant first name', {
|
|
30
|
+
default: c?.firstName,
|
|
31
|
+
})
|
|
32
|
+
.option('--last-name <lastName>', 'Registrant last name', {
|
|
33
|
+
default: c?.lastName,
|
|
34
|
+
})
|
|
35
|
+
.option('--organization <organization>', 'Registrant organization name', {
|
|
36
|
+
default: c?.organizationName,
|
|
37
|
+
})
|
|
38
|
+
.option('--address-line1 <address>', 'Registrant address line 1', {
|
|
39
|
+
default: c?.addressLine1,
|
|
40
|
+
})
|
|
41
|
+
.option('--address-line2 <address>', 'Registrant address line 2', {
|
|
42
|
+
default: c?.addressLine2,
|
|
43
|
+
})
|
|
32
44
|
.option('--city <city>', 'Registrant city', { default: c?.city })
|
|
33
45
|
.option('--state <state>', 'Registrant state', { default: c?.state })
|
|
34
|
-
.option('--country <country>', 'Registrant country code', {
|
|
46
|
+
.option('--country <country>', 'Registrant country code', {
|
|
47
|
+
default: c?.countryCode,
|
|
48
|
+
})
|
|
35
49
|
.option('--zip <zip>', 'Registrant zip', { default: c?.zip })
|
|
36
50
|
.option('--phone <phone>', 'Registrant phone', { default: c?.phoneNumber })
|
|
37
51
|
.option('--email <email>', 'Registrant email', { default: c?.email })
|
|
38
|
-
.option('--admin-first-name <firstName>', 'Admin first name', {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
.option('--admin-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
.option('--admin-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
.option('--admin-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
.option('--
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
.option('--
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
.option('--
|
|
52
|
+
.option('--admin-first-name <firstName>', 'Admin first name', {
|
|
53
|
+
default: c?.admin?.firstName || c?.firstName,
|
|
54
|
+
})
|
|
55
|
+
.option('--admin-last-name <lastName>', 'Admin last name', {
|
|
56
|
+
default: c?.admin?.lastName || c?.lastName,
|
|
57
|
+
})
|
|
58
|
+
.option('--admin-organization <organization>', 'Admin organization', {
|
|
59
|
+
default: c?.admin?.organizationName || c?.organizationName,
|
|
60
|
+
})
|
|
61
|
+
.option('--admin-address-line1 <address>', 'Admin address line 1', {
|
|
62
|
+
default: c?.admin?.addressLine1 || c?.addressLine1,
|
|
63
|
+
})
|
|
64
|
+
.option('--admin-address-line2 <address>', 'Admin address line 2', {
|
|
65
|
+
default: c?.admin?.addressLine2 || c?.addressLine2,
|
|
66
|
+
})
|
|
67
|
+
.option('--admin-city <city>', 'Admin city', {
|
|
68
|
+
default: c?.admin?.city || c?.city,
|
|
69
|
+
})
|
|
70
|
+
.option('--admin-state <state>', 'Admin state', {
|
|
71
|
+
default: c?.admin?.state || c?.state,
|
|
72
|
+
})
|
|
73
|
+
.option('--admin-country <country>', 'Admin country code', {
|
|
74
|
+
default: c?.admin?.countryCode || c?.countryCode,
|
|
75
|
+
})
|
|
76
|
+
.option('--admin-zip <zip>', 'Admin zip', {
|
|
77
|
+
default: c?.admin?.zip || c?.zip,
|
|
78
|
+
})
|
|
79
|
+
.option('--admin-phone <phone>', 'Admin phone number', {
|
|
80
|
+
default: c?.admin?.phoneNumber || c?.phoneNumber,
|
|
81
|
+
})
|
|
82
|
+
.option('--admin-email <email>', 'Admin email', {
|
|
83
|
+
default: c?.admin?.email || c?.email,
|
|
84
|
+
})
|
|
85
|
+
.option('--tech-first-name <firstName>', 'Tech first name', {
|
|
86
|
+
default: c?.tech?.firstName || c?.firstName,
|
|
87
|
+
})
|
|
88
|
+
.option('--tech-last-name <lastName>', 'Tech last name', {
|
|
89
|
+
default: c?.tech?.lastName || c?.lastName,
|
|
90
|
+
})
|
|
91
|
+
.option('--tech-organization <organization>', 'Tech organization name', {
|
|
92
|
+
default: c?.tech?.organizationName || c?.organizationName,
|
|
93
|
+
})
|
|
94
|
+
.option('--tech-address-line1 <address>', 'Tech address line 1', {
|
|
95
|
+
default: c?.tech?.addressLine1 || c?.addressLine1,
|
|
96
|
+
})
|
|
97
|
+
.option('--tech-address-line2 <address>', 'Tech address line 2', {
|
|
98
|
+
default: c?.tech?.addressLine2 || c?.addressLine2,
|
|
99
|
+
})
|
|
100
|
+
.option('--tech-city <city>', 'Tech city', {
|
|
101
|
+
default: c?.tech?.city || c?.city,
|
|
102
|
+
})
|
|
103
|
+
.option('--tech-state <state>', 'Tech state', {
|
|
104
|
+
default: c?.tech?.state || c?.state,
|
|
105
|
+
})
|
|
106
|
+
.option('--tech-country <country>', 'Tech country', {
|
|
107
|
+
default: c?.tech?.countryCode || c?.countryCode,
|
|
108
|
+
})
|
|
57
109
|
.option('--tech-zip <zip>', 'Tech zip', { default: c?.tech?.zip || c?.zip })
|
|
58
|
-
.option('--tech-phone <phone>', 'Tech phone', {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
.option('--
|
|
62
|
-
|
|
110
|
+
.option('--tech-phone <phone>', 'Tech phone', {
|
|
111
|
+
default: c?.tech?.phoneNumber || c?.phoneNumber,
|
|
112
|
+
})
|
|
113
|
+
.option('--tech-email <email>', 'Tech email', {
|
|
114
|
+
default: c?.tech?.email || c?.email,
|
|
115
|
+
})
|
|
116
|
+
.option('--privacy-admin', 'Enable privacy protection for admin', {
|
|
117
|
+
default: c?.privacyAdmin || c?.privacy || true,
|
|
118
|
+
})
|
|
119
|
+
.option('--privacy-tech', 'Enable privacy protection for tech', {
|
|
120
|
+
default: c?.privacyTech || c?.privacy || true,
|
|
121
|
+
})
|
|
122
|
+
.option('--privacy-registrant', 'Enable privacy protection for registrant', {
|
|
123
|
+
default: c?.privacyRegistrant || c?.privacy || true,
|
|
124
|
+
})
|
|
63
125
|
.option('--contact-type <type>', 'Contact type', { default: 'person' })
|
|
64
|
-
.option('-p, --project', descriptions.project, { default: false })
|
|
126
|
+
.option('-p, --project [project]', descriptions.project, { default: false })
|
|
65
127
|
.option('--verbose', descriptions.verbose, { default: false })
|
|
66
128
|
.action(async (domain: string, options: DomainsOptions) => {
|
|
67
129
|
log.debug('Running `buddy domains:purchase <domain>` ...', options)
|
|
@@ -71,7 +133,11 @@ export function domains(buddy: CLI) {
|
|
|
71
133
|
const result = await runAction(Action.DomainsPurchase, options)
|
|
72
134
|
|
|
73
135
|
if (result.isErr()) {
|
|
74
|
-
await outro(
|
|
136
|
+
await outro(
|
|
137
|
+
'While running the domains:purchase command, there was an issue',
|
|
138
|
+
{ startTime, useSeconds: true },
|
|
139
|
+
result.error,
|
|
140
|
+
)
|
|
75
141
|
process.exit(ExitCode.FatalError)
|
|
76
142
|
}
|
|
77
143
|
|
|
@@ -82,8 +148,16 @@ export function domains(buddy: CLI) {
|
|
|
82
148
|
})
|
|
83
149
|
|
|
84
150
|
if (!confirm) {
|
|
85
|
-
await outro(`Alrighty! ${italic(domain)} was added to your account.`, {
|
|
86
|
-
|
|
151
|
+
await outro(`Alrighty! ${italic(domain)} was added to your account.`, {
|
|
152
|
+
startTime,
|
|
153
|
+
useSeconds: true,
|
|
154
|
+
type: 'success',
|
|
155
|
+
})
|
|
156
|
+
log.info(
|
|
157
|
+
`Please note, you may need to validate your email address. Check your ${italic(
|
|
158
|
+
options.registrantEmail as string,
|
|
159
|
+
)} inbox.`,
|
|
160
|
+
)
|
|
87
161
|
process.exit(ExitCode.Success)
|
|
88
162
|
}
|
|
89
163
|
|
|
@@ -95,7 +169,9 @@ export function domains(buddy: CLI) {
|
|
|
95
169
|
message += `\n\nAnd your APP_URL has been set to ${italic(domain)}.
|
|
96
170
|
\nPlease note, this change has not been deployed yet.
|
|
97
171
|
\nThe next time you run ${bgCyan(italic(bold(' buddy deploy ')))}, your app will deploy to ${italic(domain)}.
|
|
98
|
-
\n${italic(
|
|
172
|
+
\n${italic(
|
|
173
|
+
'You may need to deploy 2-3 times for the changes to take effect. Issue tracked here: https://github.com/stacksjs/stacks/issues/685',
|
|
174
|
+
)}`
|
|
99
175
|
|
|
100
176
|
await outro(message, { startTime, useSeconds: true, type: 'info' })
|
|
101
177
|
process.exit(ExitCode.Success)
|
|
@@ -114,7 +190,11 @@ export function domains(buddy: CLI) {
|
|
|
114
190
|
})
|
|
115
191
|
|
|
116
192
|
if (result.isErr()) {
|
|
117
|
-
await outro(
|
|
193
|
+
await outro(
|
|
194
|
+
'While running the `buddy deploy`, there was an issue',
|
|
195
|
+
{ startTime, useSeconds: true },
|
|
196
|
+
result.error,
|
|
197
|
+
)
|
|
118
198
|
process.exit(ExitCode.FatalError)
|
|
119
199
|
}
|
|
120
200
|
|
|
@@ -141,7 +221,11 @@ export function domains(buddy: CLI) {
|
|
|
141
221
|
})
|
|
142
222
|
|
|
143
223
|
if (!confirm) {
|
|
144
|
-
await outro('Cancelled the domains:remove command', {
|
|
224
|
+
await outro('Cancelled the domains:remove command', {
|
|
225
|
+
startTime,
|
|
226
|
+
useSeconds: true,
|
|
227
|
+
type: 'info',
|
|
228
|
+
})
|
|
145
229
|
process.exit(ExitCode.Success)
|
|
146
230
|
}
|
|
147
231
|
}
|
|
@@ -149,11 +233,18 @@ export function domains(buddy: CLI) {
|
|
|
149
233
|
const result = await runAction(Action.DomainsRemove, opts)
|
|
150
234
|
|
|
151
235
|
if (result.isErr()) {
|
|
152
|
-
await outro(
|
|
236
|
+
await outro(
|
|
237
|
+
'While running the domains:remove command, there was an issue',
|
|
238
|
+
{ startTime, useSeconds: true },
|
|
239
|
+
result.error,
|
|
240
|
+
)
|
|
153
241
|
process.exit(ExitCode.FatalError)
|
|
154
242
|
}
|
|
155
243
|
|
|
156
|
-
await outro('Removed your domain DNS records.', {
|
|
244
|
+
await outro('Removed your domain DNS records.', {
|
|
245
|
+
startTime,
|
|
246
|
+
useSeconds: true,
|
|
247
|
+
})
|
|
157
248
|
process.exit(ExitCode.Success)
|
|
158
249
|
})
|
|
159
250
|
|
package/src/commands/fresh.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import process from 'node:process'
|
|
2
|
-
import { ExitCode } from '@stacksjs/types'
|
|
3
|
-
import type { CLI, FreshOptions } from '@stacksjs/types'
|
|
4
2
|
import { runAction } from '@stacksjs/actions'
|
|
5
3
|
import { intro, log, outro } from '@stacksjs/cli'
|
|
6
4
|
import { Action } from '@stacksjs/enums'
|
|
5
|
+
import { ExitCode } from '@stacksjs/types'
|
|
6
|
+
import type { CLI, FreshOptions } from '@stacksjs/types'
|
|
7
7
|
|
|
8
8
|
export function fresh(buddy: CLI) {
|
|
9
9
|
const descriptions = {
|
|
@@ -14,20 +14,30 @@ export function fresh(buddy: CLI) {
|
|
|
14
14
|
|
|
15
15
|
buddy
|
|
16
16
|
.command('fresh', descriptions.fresh)
|
|
17
|
-
.option('-p, --project', descriptions.project, { default: false })
|
|
17
|
+
.option('-p, --project [project]', descriptions.project, { default: false })
|
|
18
18
|
.option('--verbose', descriptions.verbose, { default: false })
|
|
19
19
|
.action(async (options: FreshOptions) => {
|
|
20
20
|
log.debug('Running `buddy fresh` ...', options)
|
|
21
21
|
|
|
22
22
|
const perf = await intro('buddy fresh')
|
|
23
|
-
const result = await runAction(Action.Fresh, {
|
|
23
|
+
const result = await runAction(Action.Fresh, {
|
|
24
|
+
...options,
|
|
25
|
+
stdout: 'inherit',
|
|
26
|
+
})
|
|
24
27
|
|
|
25
28
|
if (result.isErr()) {
|
|
26
|
-
await outro(
|
|
29
|
+
await outro(
|
|
30
|
+
'While running `buddy fresh`, there was an issue',
|
|
31
|
+
{ startTime: perf, useSeconds: true },
|
|
32
|
+
result.error,
|
|
33
|
+
)
|
|
27
34
|
process.exit(ExitCode.FatalError)
|
|
28
35
|
}
|
|
29
36
|
|
|
30
|
-
await outro('Freshly reinstalled your dependencies', {
|
|
37
|
+
await outro('Freshly reinstalled your dependencies', {
|
|
38
|
+
startTime: perf,
|
|
39
|
+
useSeconds: true,
|
|
40
|
+
})
|
|
31
41
|
process.exit(ExitCode.Success)
|
|
32
42
|
})
|
|
33
43
|
|
package/src/commands/generate.ts
CHANGED
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
generateCoreSymlink,
|
|
5
5
|
generateIdeHelpers,
|
|
6
6
|
generateLibEntries,
|
|
7
|
-
generateMigrations,
|
|
8
7
|
generatePkgxConfig,
|
|
9
8
|
generateTypes,
|
|
10
9
|
generateVsCodeCustomData,
|
|
@@ -16,7 +15,8 @@ import { type CLI, ExitCode, type GeneratorOptions } from '@stacksjs/types'
|
|
|
16
15
|
|
|
17
16
|
export function generate(buddy: CLI) {
|
|
18
17
|
const descriptions = {
|
|
19
|
-
command:
|
|
18
|
+
command:
|
|
19
|
+
'Automagically build any of your libraries/packages for production use. Select any of the following packages',
|
|
20
20
|
types: 'Generate your TypeScript types',
|
|
21
21
|
entries: 'Generate your function & Component Library Entry Points',
|
|
22
22
|
webTypes: 'Generate web-types.json for IDEs',
|
|
@@ -39,7 +39,7 @@ export function generate(buddy: CLI) {
|
|
|
39
39
|
.option('-i, --ide-helpers', descriptions.ideHelpers)
|
|
40
40
|
.option('-c, --component-meta', descriptions.componentMeta)
|
|
41
41
|
.option('-p, --pkgx', descriptions.pkgx)
|
|
42
|
-
.option('-p, --project', descriptions.project, { default: false })
|
|
42
|
+
.option('-p, --project [project]', descriptions.project, { default: false })
|
|
43
43
|
.option('--core-symlink', descriptions.coreSymlink)
|
|
44
44
|
.option('--verbose', descriptions.verbose, { default: false })
|
|
45
45
|
.action(async (options: GeneratorOptions) => {
|
|
@@ -73,7 +73,7 @@ export function generate(buddy: CLI) {
|
|
|
73
73
|
|
|
74
74
|
buddy
|
|
75
75
|
.command('generate:types', descriptions.types)
|
|
76
|
-
.option('-p, --project', descriptions.project, { default: false })
|
|
76
|
+
.option('-p, --project [project]', descriptions.project, { default: false })
|
|
77
77
|
.option('--verbose', descriptions.verbose, { default: false })
|
|
78
78
|
.alias('types:generate')
|
|
79
79
|
.action(async (options: GeneratorOptions) => {
|
|
@@ -83,7 +83,7 @@ export function generate(buddy: CLI) {
|
|
|
83
83
|
|
|
84
84
|
buddy
|
|
85
85
|
.command('generate:entries', descriptions.entries)
|
|
86
|
-
.option('-p, --project', descriptions.project, { default: false })
|
|
86
|
+
.option('-p, --project [project]', descriptions.project, { default: false })
|
|
87
87
|
.option('--verbose', descriptions.verbose, { default: false })
|
|
88
88
|
.action(async (options: GeneratorOptions) => {
|
|
89
89
|
log.debug('Running `buddy generate:entries` ...', options)
|
|
@@ -92,7 +92,7 @@ export function generate(buddy: CLI) {
|
|
|
92
92
|
|
|
93
93
|
buddy
|
|
94
94
|
.command('generate:web-types', descriptions.webTypes)
|
|
95
|
-
.option('-p, --project', descriptions.project, { default: false })
|
|
95
|
+
.option('-p, --project [project]', descriptions.project, { default: false })
|
|
96
96
|
.option('--verbose', descriptions.verbose, { default: false })
|
|
97
97
|
.action(async (options: GeneratorOptions) => {
|
|
98
98
|
log.debug('Running `buddy generate:web-types` ...', options)
|
|
@@ -101,7 +101,7 @@ export function generate(buddy: CLI) {
|
|
|
101
101
|
|
|
102
102
|
buddy
|
|
103
103
|
.command('generate:vscode-custom-data', descriptions.customData)
|
|
104
|
-
.option('-p, --project', descriptions.project, { default: false })
|
|
104
|
+
.option('-p, --project [project]', descriptions.project, { default: false })
|
|
105
105
|
.option('--verbose', descriptions.verbose, { default: false })
|
|
106
106
|
.action(async (options: GeneratorOptions) => {
|
|
107
107
|
log.debug('Running `buddy generate:vscode-custom-data` ...', options)
|
|
@@ -110,7 +110,7 @@ export function generate(buddy: CLI) {
|
|
|
110
110
|
|
|
111
111
|
buddy
|
|
112
112
|
.command('generate:ide-helpers', descriptions.ideHelpers)
|
|
113
|
-
.option('-p, --project', descriptions.project, { default: false })
|
|
113
|
+
.option('-p, --project [project]', descriptions.project, { default: false })
|
|
114
114
|
.option('--verbose', descriptions.verbose, { default: false })
|
|
115
115
|
.action(async (options: GeneratorOptions) => {
|
|
116
116
|
log.debug('Running `buddy generate:ide-helpers` ...', options)
|
|
@@ -119,7 +119,7 @@ export function generate(buddy: CLI) {
|
|
|
119
119
|
|
|
120
120
|
buddy
|
|
121
121
|
.command('generate:component-meta', descriptions.componentMeta)
|
|
122
|
-
.option('-p, --project', descriptions.project, { default: false })
|
|
122
|
+
.option('-p, --project [project]', descriptions.project, { default: false })
|
|
123
123
|
.option('--verbose', descriptions.verbose, { default: false })
|
|
124
124
|
.action(async (options: GeneratorOptions) => {
|
|
125
125
|
log.debug('Running `buddy generate:component-meta` ...', options)
|
|
@@ -128,19 +128,17 @@ export function generate(buddy: CLI) {
|
|
|
128
128
|
|
|
129
129
|
buddy
|
|
130
130
|
.command('generate:pkgx-config', descriptions.pkgx)
|
|
131
|
-
.option('-p, --project', descriptions.project, { default: false })
|
|
131
|
+
.option('-p, --project [project]', descriptions.project, { default: false })
|
|
132
132
|
.option('--verbose', descriptions.verbose, { default: false })
|
|
133
133
|
.action((options: GeneratorOptions) => {
|
|
134
134
|
log.debug('Running `buddy generate:pkgx-config` ...', options)
|
|
135
135
|
generatePkgxConfig()
|
|
136
136
|
})
|
|
137
137
|
|
|
138
|
-
buddy
|
|
139
|
-
.
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
generateMigrations()
|
|
143
|
-
})
|
|
138
|
+
buddy.command('generate:migrations', 'Generate Migrations').action((options: GeneratorOptions) => {
|
|
139
|
+
log.debug('Running `buddy generate:migrations` ...', options)
|
|
140
|
+
// generateMigrations()
|
|
141
|
+
})
|
|
144
142
|
|
|
145
143
|
buddy
|
|
146
144
|
.command('generate:core-symlink', 'Generate core symlink. A shortcut for core developers.')
|