Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/upgrade-deps-latest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
12 changes: 6 additions & 6 deletions docs/concepts/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ config({ schema: configSchema, eager: true })

### Middleware options

| Field | Type | Default | Description |
| -------- | --------- | ------------------- | -------------------------------------------------------------------- |
| `schema` | `ZodType` | -- | Zod schema to validate the loaded config. Infers `ctx.config` type. |
| `eager` | `boolean` | `false` | Load config during middleware pass instead of on first `load()` call |
| `layers` | `boolean` | `false` | Enable layered resolution when eager loading. For lazy mode, pass `{ layers: true }` to `load()` instead. |
| Field | Type | Default | Description |
| -------- | --------- | ------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `schema` | `ZodType` | -- | Zod schema to validate the loaded config. Infers `ctx.config` type. |
| `eager` | `boolean` | `false` | Load config during middleware pass instead of on first `load()` call |
| `layers` | `boolean` | `false` | Enable layered resolution when eager loading. For lazy mode, pass `{ layers: true }` to `load()` instead. |
| `dirs` | `object` | From `ctx.meta` | Override layer directories: `{ global?: string, local?: string }`. Only applies when layered resolution is used. |
| `name` | `string` | Derived from `name` | Override the config file name for file discovery |
| `name` | `string` | Derived from `name` | Override the config file name for file discovery |

## Using `ctx.config`

Expand Down
4 changes: 2 additions & 2 deletions examples/tui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"dependencies": {
"@inkjs/ui": "^2.0.0",
"@kidd-cli/core": "workspace:*",
"ink": "^6.8.0",
"react": "^19.2.4",
"ink": "^7.0.0",
"react": "^19.2.5",
"ts-pattern": "catalog:",
"zod": "catalog:"
},
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@
"@clack/prompts": "^1.2.0",
"@kidd-cli/cli": "workspace:*",
"@types/node": "catalog:",
"@typescript/native-preview": "7.0.0-dev.20260401.1",
"@typescript/native-preview": "7.0.0-dev.20260408.1",
"@vitest/coverage-v8": "catalog:",
"@zpress/kit": "^0.2.14",
"@zpress/kit": "^0.2.16",
"eslint-plugin-functional": "^9.0.4",
"eslint-plugin-jsdoc": "^62.9.0",
"eslint-plugin-security": "^4.0.0",
"laufen": "^1.3.1",
"oxfmt": "^0.43.0",
"oxlint": "^1.58.0",
"oxfmt": "^0.44.0",
"oxlint": "^1.59.0",
"rimraf": "^6.1.3",
"ts-pattern": "catalog:",
"turbo": "^2.9.3",
"turbo": "^2.9.5",
"vitest": "catalog:",
"yaml": "^2.8.3"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
"@kidd-cli/core": "workspace:*",
"@kidd-cli/utils": "workspace:*",
"fs-extra": "^11.3.4",
"ink": "^6.8.0",
"ink": "^7.0.0",
"liquidjs": "catalog:",
"picocolors": "^1.1.1",
"react": "^19.2.4",
"react": "^19.2.5",
"tsdown": "catalog:",
"yaml": "^2.8.3",
"zod": "catalog:"
Expand Down
16 changes: 8 additions & 8 deletions packages/cli/src/commands/doctor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ const doctorCommand: Command = command({
const [, rawPackageJson] = await readRawPackageJson(cwd)

const context = createCheckContext({
configError: configError,
configResult: configResult,
configError,
configResult,
cwd,
manifest: manifest,
rawPackageJson: rawPackageJson,
manifest,
rawPackageJson,
})

ctx.status.spinner.start('Running diagnostics...')
Expand Down Expand Up @@ -117,11 +117,11 @@ async function resolveResults(params: {
const [, rawPackageJson] = await readRawPackageJson(params.cwd)

const freshContext = createCheckContext({
configError: configError,
configResult: configResult,
configError,
configResult,
cwd: params.cwd,
manifest: manifest,
rawPackageJson: rawPackageJson,
manifest,
rawPackageJson,
})

return Promise.all(CHECKS.map((check) => check.run(freshContext)))
Expand Down
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"@kidd-cli/utils": "workspace:*",
"@pinojs/redact": "^0.4.0",
"c12": "4.0.0-beta.4",
"dotenv": "^17.4.0",
"dotenv": "^17.4.1",
"es-toolkit": "catalog:",
"figures": "^6.1.0",
"liquidjs": "catalog:",
Expand All @@ -96,8 +96,8 @@
"@types/node": "catalog:",
"@types/react": "^19.2.14",
"@types/yargs": "^17.0.35",
"ink": "^6.8.0",
"react": "^19.2.4",
"ink": "^7.0.0",
"react": "^19.2.5",
"tsdown": "catalog:",
"typescript": "catalog:",
"vitest": "catalog:"
Expand Down
14 changes: 9 additions & 5 deletions packages/core/src/middleware/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ export interface ConfigHandle<TConfig> {
* @returns The load result, or null on error (unless `exitOnError` is set).
*/
readonly load: {
(options: ConfigLoadCallOptions & { readonly exitOnError: true }): Promise<
ConfigLoadCallResult<TConfig>
>
(
options: ConfigLoadCallOptions & { readonly exitOnError: true }
): Promise<ConfigLoadCallResult<TConfig>>
(options?: ConfigLoadCallOptions): Promise<ConfigLoadCallResult<TConfig> | null>
}
}
Expand Down Expand Up @@ -127,9 +127,13 @@ export interface ConfigMiddlewareOptions<TSchema extends ZodTypeAny> {
* Override layer directories. Only applies when layered resolution is used.
*/
readonly dirs?: {
/** Override the global directory name. Default: `ctx.meta.dirs.global`. */
/**
* Override the global directory name. Default: `ctx.meta.dirs.global`.
*/
readonly global?: string
/** Override the local directory name. Default: `ctx.meta.dirs.local`. */
/**
* Override the local directory name. Default: `ctx.meta.dirs.local`.
*/
readonly local?: string
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/stories/viewer/stories-screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export function StoriesScreen({ include, out, check }: StoriesScreenProps): Reac
*/
function StoriesViewer({ include }: { readonly include?: string }): ReactElement {
const [state, setState] = useState<DiscoveryState>({ phase: 'loading' })
// eslint-disable-next-line react/hook-use-state -- read-only state, setter intentionally unused
const [registry] = useState(createStoryRegistry)
const { isReloading, onReloadStart, onReloadEnd } = useReloadState()

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/ui/prompts/autocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export function Autocomplete<TValue>({
return
}

if (key.backspace || key.delete) {
if (key.backspace) {
if (cursorOffset > 0) {
const nextSearch = removeCharAt({ str: search, index: cursorOffset - 1 })
setSearch(nextSearch)
Expand Down
7 changes: 3 additions & 4 deletions packages/core/src/ui/prompts/input-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ export interface ResolveStateOptions {
* Handles cursor movement (left/right, home/end), character deletion
* (backspace, Ctrl+D for forward-delete), and character insertion.
*
* Both `key.backspace` and `key.delete` are treated as backspace
* because macOS terminals send `\x7f` (DEL) for the Backspace key,
* which ink reports as `key.delete`. Forward-delete uses Ctrl+D.
* Backspace removes the character before the cursor.
* Forward-delete uses Ctrl+D.
*
* @param options - The state resolution options.
* @returns The next input state.
Expand Down Expand Up @@ -75,7 +74,7 @@ export function resolveNextState({ state, input, key }: ResolveStateOptions): In
return { ...state, value: nextValue, error: undefined }
}

if (key.backspace || key.delete) {
if (key.backspace) {
if (state.cursor === 0) {
return state
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/ui/prompts/path-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export function PathInput({
return
}

if (key.backspace || key.delete) {
if (key.backspace) {
if (cursorOffset > 0) {
const nextValue = removeCharAt({ str: value, index: cursorOffset - 1 })
setValue(nextValue)
Expand Down
Loading
Loading