Skip to content

Commit 4cfb15e

Browse files
committed
chore: wip
1 parent e6c75d9 commit 4cfb15e

File tree

5 files changed

+27
-14
lines changed

5 files changed

+27
-14
lines changed

.stacks/core/actions/src/upgrade.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { intro, log, outro, prompt, runCommand, spawn } from '@stacksjs/cli'
1+
import { intro, log, outro, runCommand, spawn } from '@stacksjs/cli'
22
import * as storage from '@stacksjs/storage'
33
import { determineDebugLevel } from '@stacksjs/utils'
44
import { projectPath } from '@stacksjs/path'
@@ -20,7 +20,7 @@ export async function checkForUncommittedChanges(path = './.stacks', options: Up
2020
// the user knows what they are doing. There is also a change that simply the deps within .stacks
2121
// folder have been updated and that could produce a diff.
2222
if (!options?.force) {
23-
const confirmed = await prompt('We detected there are uncommitted in the ./stacks folder. Do you want to overwrite those?', {
23+
const confirmed = await log.prompt('We detected there are uncommitted in the ./stacks folder. Do you want to overwrite those?', {
2424
type: 'confirm',
2525
})
2626

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { AddOptions, BuildOptions, CLI } from '@stacksjs/types'
22
import { ExitCode } from '@stacksjs/types'
3-
import { prompt } from '@stacksjs/cli'
3+
import { log } from '@stacksjs/cli'
44
import { invoke } from '@stacksjs/actions/add'
55

66
async function add(buddy: CLI) {
@@ -21,7 +21,7 @@ async function add(buddy: CLI) {
2121
.option('--verbose', descriptions.verbose, { default: false })
2222
.action(async (options: BuildOptions) => {
2323
if (hasNoOptions(options)) {
24-
const answers = await prompt(descriptions.select, {
24+
const answers = await log.prompt(descriptions.select, {
2525
type: 'multiselect',
2626
options: [
2727
{ label: 'Calendar', value: 'calendar' },

.stacks/core/validation/src/types/env.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export const frontendEnvSchema = validator.object({
123123
FRONTEND_APP_URL: validator.string().optional(),
124124
})
125125

126-
export type BackendEnv = Infer<typeof backendEnvSchema>
126+
export type BackendEnv = Infer<typeof envSchema>
127127
export type BackendEnvKeys = keyof BackendEnv
128128

129129
export type FrontendEnv = Infer<typeof frontendEnvSchema>

.stacks/core/validation/src/validate.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,6 @@ Validator.macro('money', () => {
55
return new MoneyValidator()
66
})
77

8-
/**
9-
* Informing TypeScript about the newly added method
10-
*/
11-
declare module '@stacksjs/validation' {
12-
interface Validator {
13-
money(): MoneyValidator
14-
}
15-
}
16-
178
const validate = validator.validate
189
const string = validator.string
1910
const number = validator.number

.stacks/stacks.d.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { MoneyValidator, Validator } from '@stacksjs/validation'
2+
3+
/**
4+
* Inform TypeScript about the custom/user-added macros
5+
*/
6+
declare module '@stacksjs/validation' {
7+
interface Validator {
8+
money(): MoneyValidator
9+
}
10+
}
11+
12+
declare module '@stacksjs/arrays' {
13+
interface Validator {
14+
// add custom methods to arrays
15+
}
16+
}
17+
18+
declare module '@stacksjs/strings' {
19+
interface Validator {
20+
// add custom methods to strings
21+
}
22+
}

0 commit comments

Comments
 (0)