Skip to content

Commit af6cefb

Browse files
committed
chore: wip
1 parent b048cfa commit af6cefb

File tree

8 files changed

+25
-24
lines changed

8 files changed

+25
-24
lines changed

.stacks/core/actions/src/dev/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { log } from '@stacksjs/logging'
22
import { frameworkPath } from '@stacksjs/path'
33
import { runCommand } from '@stacksjs/cli'
4-
import { type DevOptions } from '@stacksjs/types'
5-
import { NpmScript } from '@stacksjs/types'
4+
import type { DevOptions } from '@stacksjs/types'
5+
import { Action, NpmScript } from '@stacksjs/types'
66

77
export async function runComponentsDevServer(options: DevOptions) {
88
log.info('Starting your components dev server...')
9-
await runCommand(NpmScript.DevComponents, { ...options, cwd: frameworkPath() })
9+
await runAction(Action.DevComponents, options)
1010
}
1111

1212
export async function runDesktopDevServer(options: DevOptions) {
@@ -16,7 +16,7 @@ export async function runDesktopDevServer(options: DevOptions) {
1616

1717
export async function runPagesDevServer(options: DevOptions) {
1818
log.info('Starting your page engine...')
19-
await runCommand(NpmScript.DevPages, options)
19+
await runCommand(NpmScript.DevViews, options)
2020
}
2121

2222
export async function runFunctionsDevServer(options: DevOptions) {

.stacks/core/buddy/src/commands/domains.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ import { Action, ExitCode } from '@stacksjs/types'
66

77
export function domains(buddy: CLI) {
88
const descriptions = {
9-
add: 'Add a domain to your project',
10-
domain: 'The domain to add',
11-
remove: 'Removes a domain from your project',
9+
add: 'Add a domain to your cloud',
10+
remove: 'Remove a domain from your cloud',
1211
verbose: 'Enable verbose output',
1312
}
1413

1514
buddy
16-
.command('domains:add', descriptions.add)
17-
.option('<domain>', descriptions.domain)
15+
.command('domains:add <domain>', descriptions.add)
1816
.option('--verbose', descriptions.verbose, { default: false })
1917
.action(async (options: DomainsOptions) => {
2018
const perf = await intro('buddy domains:add')
@@ -30,12 +28,12 @@ export function domains(buddy: CLI) {
3028
})
3129

3230
buddy
33-
.command('domains:remove', descriptions.remove)
34-
.option('<domain>', descriptions.domain)
31+
.command('domains:remove <domain>', descriptions.remove)
3532
.option('--verbose', descriptions.verbose, { default: false })
36-
.action(async (options: DomainsOptions) => {
33+
// TODO: .option('--yes', 'Skip the confirmation prompt', { default: false })
34+
.action(async (domain: string, options: DomainsOptions) => {
3735
const perf = await intro('buddy domains:remove')
38-
const result = await runAction(Action.DomainsRemove, options)
36+
const result = await runAction(Action.DomainsRemove, { ...options, domain })
3937

4038
if (result.isErr()) {
4139
await outro('While running the domains:remove command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)

.stacks/core/cloud/src/drivers/aws/runtime/scripts/build-layer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export class BuildCommand extends Command {
6363

6464
this.debug('Response:', response.status, response.statusText)
6565
if (!response.ok) {
66+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
6667
const reason = await response.text()
6768
this.error(reason, { exit: 1 })
6869
}

.stacks/core/events/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export default function mitt<Events extends Record<EventType, unknown>>(
140140
* events.emit('user:registered', { name: 'Chris'})
141141
* useEvents.emit('user:registered', { name: 'Chris'})
142142
* ````
143-
143+
*
144144
* @example To capture an event, you may use any of the following approaches:
145145
* ```ts
146146
* useListen('user:registered', (user) => console.log(user))

.stacks/core/logging/src/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@ import process from 'node:process'
33
import { handleError } from '@stacksjs/error-handling'
44
import { bold, green, prompts } from '@stacksjs/cli'
55
import { ray as debug } from 'node-ray'
6+
import { ExitCode } from '@stacksjs/types'
67
import type { StacksError } from '@stacksjs/types'
78

89
export function dump(...args: any[]) {
910
return debug(...args)
1011
}
1112

12-
export function dd(...args: any[]) {
13-
return dump(...args).showApp()
14-
}
15-
1613
export const logger = console
1714
export const log = {
1815
info: (...args: any[]) => logger.info(...args),
@@ -27,3 +24,8 @@ export const log = {
2724
dump,
2825
dd,
2926
}
27+
28+
export function dd(...args: any[]) {
29+
args.forEach(arg => log.info(arg))
30+
process.exit(ExitCode.Success)
31+
}

.stacks/core/types/src/cli.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export type ActionOption = 'types' | 'domains' | 'count'
151151
*/
152152
export type ActionOptions = {
153153
[key in ActionOption]?: boolean | number;
154-
} & CliOptions
154+
} & CliOptions & DomainsOptions
155155

156156
export type BuildOption = 'components' | 'vueComponents' | 'webComponents' | 'elements' | 'functions' | 'docs' | 'pages' | 'stacks' | 'all'
157157
export type BuildOptions = {
@@ -215,7 +215,7 @@ export type TestOptions = CliOptions & {
215215
showReport?: boolean
216216
}
217217
export type DomainsOptions = CliOptions & {
218-
domain?: boolean
218+
domain?: string
219219
}
220220

221221
export interface CleanOptions extends CliOptions { }
@@ -245,7 +245,7 @@ export enum NpmScript {
245245
Clean = 'rimraf bun.lockb node_modules/ .stacks/**/dist',
246246
Dev = 'dev',
247247
DevDesktop = 'dev:desktop',
248-
DevPages = 'dev:pages',
248+
DevViews = 'dev:views',
249249
DevFunctions = 'dev:functions',
250250
Fresh = 'fresh',
251251
Lint = 'eslint .',

.stacks/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@
356356
"dev:components": "vite serve ../../components/vue -c ../build/src/vue-components.ts",
357357
"dev:desktop": "vite serve ../../components/vue -c ../build/src/desktop.ts",
358358
"dev:docs": "buddy dev:docs",
359-
"dev:pages": "nitro dev",
359+
"dev:views": "nitro dev",
360360
"dev:functions": "bun buddy dev:functions",
361361
"development": "bun --bun run dev",
362362
"build:components": "bun buddy build:components",
@@ -392,7 +392,7 @@
392392
"lint:stacks": "bun buddy lint:stacks",
393393
"lint:fix": "bun buddy lint:fix",
394394
"serve": "bun buddy serve",
395-
"serve:pages": "bun --bun run dev:pages",
395+
"serve:pages": "bun --bun run dev:views",
396396
"serve:functions": "bun --bun run dev:functions",
397397
"make": "bun buddy make",
398398
"make:component": "bun buddy make:component",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"dev:components": "pnpm buddy dev:components",
3333
"dev:desktop": "pnpm buddy dev:desktop",
3434
"dev:docs": "pnpm buddy dev:docs",
35-
"dev:pages": "pnpm buddy dev:pages",
35+
"dev:views": "pnpm buddy dev:views",
3636
"dev:functions": "pnpm buddy dev:functions // todo: opens the auto-generated web server of functions",
3737
"development": "pnpm buddy dev",
3838
"build": "pnpm buddy build",

0 commit comments

Comments
 (0)