Skip to content

Commit c21ef72

Browse files
committed
chore: wip
1 parent 188962c commit c21ef72

File tree

16 files changed

+149
-82
lines changed

16 files changed

+149
-82
lines changed

bun.lockb

2.02 KB
Binary file not shown.

config/cli.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ export default {
1111
name: 'My Custom CLI',
1212
command: 'custom-cli', // enables `custom-cli <command> <options>`
1313
description: 'This is an example command to illustrate how to create your own commands. Check out `../app/commands` for more.',
14+
deploy: true, // deploys CLI setup endpoint (./bootstrap)
1415
} satisfies BinaryConfig

config/cloud.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ export default {
4747
timeout: 30,
4848
},
4949

50-
ai: true, // deploys AI endpoints
51-
cli: true, // deploys CLI setup endpoint (./bootstrap)
52-
docs: true, // deploys documentation
5350
fileSystem: true, // enables file system
5451

5552
// compute: {},

pkgx.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@ dependencies:
1313
stedolan.github.io/jq: ^1.7
1414
httpie.io: ^3.2.2
1515
rust-lang.org: ^1.74.1 # optional, for certain dev purposes only
16-
gnu.org/coreutils: ^9.4 # nproc does not ship everywhere but is included in coreutils

storage/framework/core/buddy/src/commands/dev.ts

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
} from '@stacksjs/actions'
1313
import { ExitCode } from '@stacksjs/types'
1414
import type { CLI, DevOptions } from '@stacksjs/types'
15-
import { intro, log, outro, prompt, runCommand } from '@stacksjs/cli'
15+
import { intro, log, outro, runCommand } from '@stacksjs/cli'
1616
import { libsPath } from '@stacksjs/path'
1717

1818
export function dev(buddy: CLI) {
@@ -91,39 +91,40 @@ export function dev(buddy: CLI) {
9191
}
9292

9393
if (wantsInteractive(options)) {
94-
const answer = await prompt.require()
95-
.select(descriptions.select, {
96-
options: [
97-
{ value: 'all', label: 'All' },
98-
{ value: 'frontend', label: 'Frontend' },
99-
{ value: 'api', label: 'Backend' },
100-
{ value: 'dashboard', label: 'Dashboard' },
101-
{ value: 'desktop', label: 'Desktop' },
102-
{ value: 'email', label: 'Email' },
103-
{ value: 'components', label: 'Components' },
104-
{ value: 'docs', label: 'Documentation' },
105-
],
106-
})
107-
108-
if (answer === 'components') {
109-
await runComponentsDevServer(options)
110-
}
111-
else if (answer === 'api') {
112-
await runApiDevServer(options)
113-
}
114-
else if (answer === 'dashboard') {
115-
await runDashboardDevServer(options)
116-
}
117-
// else if (answer === 'email')
118-
// await runEmailDevServer(options)
119-
else if (answer === 'docs') {
120-
await runDocsDevServer(options)
121-
}
122-
123-
else {
124-
log.error('Invalid option during interactive mode')
125-
process.exit(ExitCode.InvalidArgument)
126-
}
94+
// TODO: uncomment this when prompt is available
95+
// const answer = await prompt.require()
96+
// .select(descriptions.select, {
97+
// options: [
98+
// { value: 'all', label: 'All' },
99+
// { value: 'frontend', label: 'Frontend' },
100+
// { value: 'api', label: 'Backend' },
101+
// { value: 'dashboard', label: 'Dashboard' },
102+
// { value: 'desktop', label: 'Desktop' },
103+
// { value: 'email', label: 'Email' },
104+
// { value: 'components', label: 'Components' },
105+
// { value: 'docs', label: 'Documentation' },
106+
// ],
107+
// })
108+
//
109+
// if (answer === 'components') {
110+
// await runComponentsDevServer(options)
111+
// }
112+
// else if (answer === 'api') {
113+
// await runApiDevServer(options)
114+
// }
115+
// else if (answer === 'dashboard') {
116+
// await runDashboardDevServer(options)
117+
// }
118+
// // else if (answer === 'email')
119+
// // await runEmailDevServer(options)
120+
// else if (answer === 'docs') {
121+
// await runDocsDevServer(options)
122+
// }
123+
//
124+
// else {
125+
// log.error('Invalid option during interactive mode')
126+
// process.exit(ExitCode.InvalidArgument)
127+
// }
127128
}
128129

129130
else {

storage/framework/core/cli/src/exec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import process from 'node:process'
22
import { type Result, err, handleError, ok } from '@stacksjs/error-handling'
33
import type { CliOptions, StacksError, Subprocess } from '@stacksjs/types'
44
import { ExitCode } from '@stacksjs/types'
5-
import { italic, log, underline } from './'
5+
import { italic } from './utils'
6+
import { log } from './'
67

78
/**
89
* Execute a command.
@@ -32,7 +33,7 @@ export async function exec(command: string | string[], options?: CliOptions): Pr
3233
if (!cmd)
3334
return err(handleError(`Failed to parse command: ${cmd}`, options))
3435

35-
log.debug('Running exec:', italic(underline(command)))
36+
log.debug('Running exec:', Array.isArray(command) ? command.join(' ') : command)
3637
log.debug('cmd:', cmd)
3738
log.debug('Options:', options)
3839

storage/framework/core/cli/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ export * from './parse'
77
export * from './exec'
88
export * from './run'
99
export * from './spinner'
10-
export * from './utilities'
10+
export * from './utils'

storage/framework/core/cli/src/run.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { CliOptions, CommandError, Subprocess } from '@stacksjs/types'
22
import type { Result } from '@stacksjs/error-handling'
33
import { exec, execSync } from './exec'
4-
import { italic, underline } from './utilities'
4+
import { italic } from './utils'
55
import { log } from './console'
66

77
/**
@@ -30,7 +30,7 @@ import { log } from './console'
3030
* ```
3131
*/
3232
export async function runCommand(command: string, options?: CliOptions): Promise<Result<Subprocess, CommandError>> {
33-
log.debug('runCommand:', underline(italic(command)))
33+
log.debug('runCommand:', command)
3434
log.debug('runCommand Options:', options)
3535

3636
return await exec(command, options)

storage/framework/core/cli/src/utilities.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

storage/framework/core/cli/src/utils.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
export * as kolorist from 'kolorist'
2+
13
export {
24
stripAnsi,
35
centerAlign,
@@ -9,3 +11,52 @@ export {
911
getColor,
1012
colorize,
1113
} from 'consola/utils'
14+
15+
export {
16+
ansi256Bg,
17+
bgBlack,
18+
bgBlue,
19+
bgCyan,
20+
bgGray,
21+
bgGreen,
22+
bgLightBlue,
23+
bgLightCyan,
24+
bgLightGray,
25+
bgLightGreen,
26+
bgLightMagenta,
27+
bgLightRed,
28+
bgLightYellow,
29+
bgMagenta,
30+
bgRed,
31+
bgWhite,
32+
bgYellow,
33+
black,
34+
blue,
35+
bold,
36+
cyan,
37+
dim,
38+
gray,
39+
green,
40+
hidden,
41+
inverse,
42+
italic,
43+
lightBlue,
44+
lightCyan,
45+
lightGray,
46+
lightGreen,
47+
lightMagenta,
48+
lightRed,
49+
lightYellow,
50+
link,
51+
magenta,
52+
red,
53+
reset,
54+
strikethrough,
55+
underline,
56+
white,
57+
yellow,
58+
ansi256,
59+
trueColor,
60+
trueColorBg,
61+
stripColors,
62+
} from 'kolorist'

0 commit comments

Comments
 (0)