Skip to content

Commit c3dc954

Browse files
committed
chore: wip
1 parent bacbe22 commit c3dc954

File tree

7 files changed

+53
-41
lines changed

7 files changed

+53
-41
lines changed

storage/framework/core/cli/dts.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export interface DtsOptions {
5353
* it is relative to the current working directory.
5454
* @default 'dist'
5555
*/
56-
outdir?: ts.CompilerOptions['outDir']
56+
outdir?: ts.CompilerOptions['outDir'] // sadly, the bundler uses `outdir` instead of `outDir` and to avoid confusion, we'll use `outdir` here
5757

5858
/**
5959
* The files to include. If not provided, it will include all files in the
@@ -95,6 +95,8 @@ export async function generate(entryPoints: string | string[], options?: DtsOpti
9595
noEmit: false,
9696
outDir: options?.outdir ?? './dist',
9797
rootDir: p.resolve(cwd, root),
98+
incremental: undefined,
99+
composite: undefined,
98100
}
99101

100102
console.log('Compiler Options:', JSON.stringify(compilerOptions, null, 2))

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,15 +639,16 @@ export const spinner = (): Spinner => {
639639
}
640640

641641
const start = (msg = ''): void => {
642-
let loop: ReturnType<typeof setInterval>
643642
isSpinnerActive = true
644643
unblock = block()
645644
_message = msg.replace(/\.+$/, '')
646645
process.stdout.write(`${color.gray(S_BAR)}\n`)
647646
let frameIndex = 0
648647
let dotsTimer = 0
648+
649649
registerHooks()
650-
loop = setInterval(() => {
650+
651+
setInterval(() => {
651652
const frame = color.magenta(frames[frameIndex])
652653
const loadingDots = '.'.repeat(Math.floor(dotsTimer)).slice(0, 3)
653654
process.stdout.write(cursor.move(-999, 0))

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import type { CliOptions } from '@stacksjs/types'
1+
import type { Result } from '@stacksjs/error-handling'
2+
import type { CliOptions, Readable, Subprocess, Writable } from '@stacksjs/types'
23
import { runCommand } from './run'
34

45
type CommandOptionTuple = [string, string, { default: boolean }]
@@ -37,11 +38,17 @@ export class Command {
3738
}
3839

3940
export const command = {
40-
run: async (command: string, options?: CliOptions): Promise<void> => {
41+
run: async (
42+
command: string,
43+
options?: CliOptions,
44+
): Promise<Result<Subprocess<Writable, Readable, Readable>, Error>> => {
4145
return await runCommand(command, options)
4246
},
4347

44-
runSync: async (command: string, options?: CliOptions): Promise<void> => {
48+
runSync: async (
49+
command: string,
50+
options?: CliOptions,
51+
): Promise<Result<Subprocess<Writable, Readable, Readable>, Error>> => {
4552
return await runCommand(command, options)
4653
},
4754
}

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { Result } from '@stacksjs/error-handling'
2-
import type { CliOptions, CommandError, Subprocess } from '@stacksjs/types'
1+
import type { Ok, Result } from '@stacksjs/error-handling'
2+
import type { CliOptions, CommandError, Readable, Subprocess, Writable } from '@stacksjs/types'
33
import { ExitCode } from '@stacksjs/types'
44
import { log } from './console'
55
import { exec, execSync } from './exec'
@@ -90,7 +90,10 @@ export async function runCommandSync(command: string, options?: CliOptions): Pro
9090
* @param options The options to pass to the command.
9191
* @returns The result of the command.
9292
*/
93-
export async function runCommands(commands: string[], options?: CliOptions): Promise<Subprocess[]> {
93+
export async function runCommands(
94+
commands: string[],
95+
options?: CliOptions,
96+
): Promise<Ok<Subprocess<Writable, Readable, Readable>, Error>[]> {
9497
const results = []
9598

9699
for (const command of commands) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { collect } from '@stacksjs/collections'
1+
import { type Collection, collect } from '@stacksjs/collections'
22

33
export * as kolorist from 'kolorist'
44

@@ -63,7 +63,7 @@ export {
6363
stripColors,
6464
} from 'kolorist'
6565

66-
export const quotes: string[] = collect([
66+
export const quotes: Collection<string> = collect([
6767
// could be queried from any API or database
6868
'The best way to get started is to quit talking and begin doing.',
6969
'The pessimist sees difficulty in every opportunity. The optimist sees opportunity in every difficulty.',

storage/framework/core/config/src/config.ts

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,31 @@ export const config: StacksOptions = {
88
...overrides,
99
}
1010

11-
export const {
12-
ai,
13-
analytics,
14-
app,
15-
cache,
16-
cloud,
17-
cli,
18-
database,
19-
dns,
20-
docs,
21-
email,
22-
errors,
23-
git,
24-
hashing,
25-
library,
26-
logging,
27-
notification,
28-
payment,
29-
ports,
30-
queue,
31-
security,
32-
searchEngine,
33-
services,
34-
storage,
35-
team,
36-
ui,
37-
}: StacksOptions = config
11+
export const ai: StacksOptions['ai'] = config.ai
12+
export const analytics: StacksOptions['analytics'] = config.analytics
13+
export const app: StacksOptions['app'] = config.app
14+
export const cache: StacksOptions['cache'] = config.cache
15+
export const cloud: StacksOptions['cloud'] = config.cloud
16+
export const cli: StacksOptions['cli'] = config.cli
17+
export const database: StacksOptions['database'] = config.database
18+
export const dns: StacksOptions['dns'] = config.dns
19+
export const docs: StacksOptions['docs'] = config.docs
20+
export const email: StacksOptions['email'] = config.email
21+
export const errors: StacksOptions['errors'] = config.errors
22+
export const git: StacksOptions['git'] = config.git
23+
export const hashing: StacksOptions['hashing'] = config.hashing
24+
export const library: StacksOptions['library'] = config.library
25+
export const logging: StacksOptions['logging'] = config.logging
26+
export const notification: StacksOptions['notification'] = config.notification
27+
export const payment: StacksOptions['payment'] = config.payment
28+
export const ports: StacksOptions['ports'] = config.ports
29+
export const queue: StacksOptions['queue'] = config.queue
30+
export const security: StacksOptions['security'] = config.security
31+
export const searchEngine: StacksOptions['searchEngine'] = config.searchEngine
32+
export const services: StacksOptions['services'] = config.services
33+
export const storage: StacksOptions['storage'] = config.storage
34+
export const team: StacksOptions['team'] = config.team
35+
export const ui: StacksOptions['ui'] = config.ui
3836

3937
export { defaults, overrides }
4038

storage/framework/core/config/src/overrides.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ import team from '~/config/team'
2525
import ui from '~/config/ui'
2626
// import docs from '~/docs/config'
2727

28-
// this "user config" will override the default config options
29-
export default {
28+
const config: StacksConfig = {
3029
ai,
3130
analytics,
3231
app,
@@ -52,4 +51,6 @@ export default {
5251
storage,
5352
team,
5453
ui,
55-
} satisfies StacksConfig
54+
}
55+
56+
export default config

0 commit comments

Comments
 (0)