@kidd-cli/core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +214 -0
  3. package/dist/config-BvGapuFJ.js +282 -0
  4. package/dist/config-BvGapuFJ.js.map +1 -0
  5. package/dist/create-store-BQUX0tAn.js +197 -0
  6. package/dist/create-store-BQUX0tAn.js.map +1 -0
  7. package/dist/index.d.ts +73 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +1034 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/lib/config.d.ts +64 -0
  12. package/dist/lib/config.d.ts.map +1 -0
  13. package/dist/lib/config.js +4 -0
  14. package/dist/lib/logger.d.ts +2 -0
  15. package/dist/lib/logger.js +55 -0
  16. package/dist/lib/logger.js.map +1 -0
  17. package/dist/lib/output.d.ts +62 -0
  18. package/dist/lib/output.d.ts.map +1 -0
  19. package/dist/lib/output.js +276 -0
  20. package/dist/lib/output.js.map +1 -0
  21. package/dist/lib/project.d.ts +59 -0
  22. package/dist/lib/project.d.ts.map +1 -0
  23. package/dist/lib/project.js +3 -0
  24. package/dist/lib/prompts.d.ts +24 -0
  25. package/dist/lib/prompts.d.ts.map +1 -0
  26. package/dist/lib/prompts.js +3 -0
  27. package/dist/lib/store.d.ts +56 -0
  28. package/dist/lib/store.d.ts.map +1 -0
  29. package/dist/lib/store.js +4 -0
  30. package/dist/logger-BkQQej8h.d.ts +76 -0
  31. package/dist/logger-BkQQej8h.d.ts.map +1 -0
  32. package/dist/middleware/auth.d.ts +22 -0
  33. package/dist/middleware/auth.d.ts.map +1 -0
  34. package/dist/middleware/auth.js +759 -0
  35. package/dist/middleware/auth.js.map +1 -0
  36. package/dist/middleware/http.d.ts +87 -0
  37. package/dist/middleware/http.d.ts.map +1 -0
  38. package/dist/middleware/http.js +255 -0
  39. package/dist/middleware/http.js.map +1 -0
  40. package/dist/middleware-D3psyhYo.js +54 -0
  41. package/dist/middleware-D3psyhYo.js.map +1 -0
  42. package/dist/project-NPtYX2ZX.js +181 -0
  43. package/dist/project-NPtYX2ZX.js.map +1 -0
  44. package/dist/prompts-lLfUSgd6.js +63 -0
  45. package/dist/prompts-lLfUSgd6.js.map +1 -0
  46. package/dist/types-CqKJhsYk.d.ts +135 -0
  47. package/dist/types-CqKJhsYk.d.ts.map +1 -0
  48. package/dist/types-Cz9h927W.d.ts +23 -0
  49. package/dist/types-Cz9h927W.d.ts.map +1 -0
  50. package/dist/types-DFtYg5uZ.d.ts +26 -0
  51. package/dist/types-DFtYg5uZ.d.ts.map +1 -0
  52. package/dist/types-kjpRau0U.d.ts +382 -0
  53. package/dist/types-kjpRau0U.d.ts.map +1 -0
  54. package/package.json +94 -0
@@ -0,0 +1,382 @@
1
+ import { t as CliLogger } from "./logger-BkQQej8h.js";
2
+ import { n as Spinner } from "./types-DFtYg5uZ.js";
3
+ import { Tagged } from "@kidd-cli/utils/tag";
4
+ import { z } from "zod";
5
+
6
+ //#region src/context/types.d.ts
7
+ /**
8
+ * Typed in-memory key-value store shape carried on `ctx.store`.
9
+ *
10
+ * Consumers extend this interface via declaration merging to register
11
+ * typed keys without threading generics through every handler:
12
+ *
13
+ * ```ts
14
+ * declare module '@kidd-cli/core' {
15
+ * interface StoreMap { myKey: MyType }
16
+ * }
17
+ * ```
18
+ */
19
+ interface StoreMap {
20
+ [key: string]: unknown;
21
+ }
22
+ /**
23
+ * Typed key-value store available on every {@link Context}.
24
+ *
25
+ * Provides `get`, `set`, `has`, `delete`, and `clear` over an in-memory
26
+ * `Map`. The generic `TMap` constrains keys and values so consumers
27
+ * receive compile-time safety for registered store keys.
28
+ *
29
+ * @typeParam TMap - Key-value shape (defaults to {@link StoreMap}).
30
+ */
31
+ interface Store<TMap extends AnyRecord = StoreMap> {
32
+ get<TKey extends StringKeyOf<TMap>>(key: TKey): TMap[TKey] | undefined;
33
+ set<TKey extends StringKeyOf<TMap>>(key: TKey, value: TMap[TKey]): void;
34
+ has(key: string): boolean;
35
+ delete(key: string): boolean;
36
+ clear(): void;
37
+ }
38
+ /**
39
+ * Options for a yes/no confirmation prompt.
40
+ */
41
+ interface ConfirmOptions {
42
+ readonly message: string;
43
+ readonly initialValue?: boolean;
44
+ }
45
+ /**
46
+ * Options for a free-text input prompt.
47
+ */
48
+ interface TextOptions {
49
+ readonly message: string;
50
+ readonly placeholder?: string;
51
+ readonly defaultValue?: string;
52
+ readonly validate?: (value: string | undefined) => string | Error | undefined;
53
+ }
54
+ /**
55
+ * A single option in a select or multi-select prompt.
56
+ *
57
+ * @typeParam TValue - The value type returned when this option is selected.
58
+ */
59
+ interface SelectOption<TValue> {
60
+ readonly value: TValue;
61
+ readonly label: string;
62
+ readonly hint?: string;
63
+ }
64
+ /**
65
+ * Options for a single-select prompt.
66
+ *
67
+ * @typeParam TValue - The value type of each selectable option.
68
+ */
69
+ interface SelectOptions<TValue> {
70
+ readonly message: string;
71
+ readonly options: SelectOption<TValue>[];
72
+ readonly initialValue?: TValue;
73
+ }
74
+ /**
75
+ * Options for a multi-select prompt.
76
+ *
77
+ * @typeParam TValue - The value type of each selectable option.
78
+ */
79
+ interface MultiSelectOptions<TValue> {
80
+ readonly message: string;
81
+ readonly options: SelectOption<TValue>[];
82
+ readonly initialValues?: TValue[];
83
+ readonly required?: boolean;
84
+ }
85
+ /**
86
+ * Interactive prompt methods available on the context.
87
+ *
88
+ * Each method suspends execution until the user provides input.
89
+ * Cancellation (Ctrl-C) throws a ContextError with code `PROMPT_CANCELLED`.
90
+ */
91
+ interface Prompts {
92
+ confirm(opts: ConfirmOptions): Promise<boolean>;
93
+ text(opts: TextOptions): Promise<string>;
94
+ select<TValue>(opts: SelectOptions<TValue>): Promise<TValue>;
95
+ multiselect<TValue>(opts: MultiSelectOptions<TValue>): Promise<TValue[]>;
96
+ password(opts: TextOptions): Promise<string>;
97
+ }
98
+ /**
99
+ * Formatting options for structured output methods.
100
+ */
101
+ interface OutputOptions {
102
+ /**
103
+ * When true, output JSON instead of human-readable text.
104
+ */
105
+ readonly json?: boolean;
106
+ }
107
+ /**
108
+ * Structured output methods available on the context.
109
+ *
110
+ * Commands use these to write data to stdout. The `json` flag on
111
+ * {@link OutputOptions} switches between human-readable formatting
112
+ * and machine-parsable JSON.
113
+ */
114
+ interface Output {
115
+ /**
116
+ * Write a value to stdout. Objects are serialized as JSON when `json` is set.
117
+ */
118
+ write(data: unknown, options?: OutputOptions): void;
119
+ /**
120
+ * Write a table (array of objects) to stdout.
121
+ */
122
+ table(rows: Record<string, unknown>[], options?: OutputOptions): void;
123
+ /**
124
+ * Write a markdown-formatted string to stdout.
125
+ */
126
+ markdown(content: string): void;
127
+ /**
128
+ * Write raw string to stdout (no formatting).
129
+ */
130
+ raw(content: string): void;
131
+ }
132
+ /**
133
+ * CLI metadata available on the context. Deeply immutable at the type level.
134
+ */
135
+ interface Meta {
136
+ /**
137
+ * CLI name as defined in `cli({ name })`.
138
+ */
139
+ readonly name: string;
140
+ /**
141
+ * CLI version as defined in `cli({ version })`.
142
+ */
143
+ readonly version: string;
144
+ /**
145
+ * The resolved command path (e.g. `['deploy', 'preview']`).
146
+ */
147
+ readonly command: string[];
148
+ }
149
+ /**
150
+ * The context object threaded through every handler, middleware, and hook.
151
+ *
152
+ * All data properties (args, config, meta) are deeply readonly — attempting
153
+ * to mutate any nested property produces a compile-time error. Use `ctx.store`
154
+ * for mutable state that flows between middleware and handlers.
155
+ *
156
+ * Register types (`KiddArgs`, `KiddConfig`, etc.) are merged with generics so
157
+ * consumers can use module augmentation for project-wide defaults without
158
+ * threading generics everywhere.
159
+ *
160
+ * @typeParam TArgs - Parsed args type (inferred from the command's zod/yargs args definition).
161
+ * @typeParam TConfig - Config type (inferred from the zod schema passed to `cli({ config: { schema } })`).
162
+ */
163
+ interface Context<TArgs extends AnyRecord = AnyRecord, TConfig extends AnyRecord = AnyRecord> {
164
+ /**
165
+ * Parsed and validated args for this command. Deeply immutable.
166
+ */
167
+ readonly args: DeepReadonly<Merge<KiddArgs, TArgs>>;
168
+ /**
169
+ * Runtime config validated against the zod schema. Deeply immutable.
170
+ */
171
+ readonly config: DeepReadonly<Merge<KiddConfig, TConfig>>;
172
+ /**
173
+ * Structured logger backed by @clack/prompts for styled terminal output.
174
+ */
175
+ readonly logger: CliLogger;
176
+ /**
177
+ * Interactive prompts (confirm, text, select, multiselect, password).
178
+ */
179
+ readonly prompts: Prompts;
180
+ /**
181
+ * Spinner for long-running operations.
182
+ */
183
+ readonly spinner: Spinner;
184
+ /**
185
+ * Structured output (write, table, markdown, raw).
186
+ */
187
+ readonly output: Output;
188
+ /**
189
+ * In-memory key-value store (mutable — use this for middleware-to-handler data flow).
190
+ */
191
+ readonly store: Store<Merge<KiddStore, StoreMap>>;
192
+ /**
193
+ * Throw a user-facing error with a clean message (no stack in production).
194
+ */
195
+ readonly fail: (message: string, options?: {
196
+ code?: string;
197
+ exitCode?: number;
198
+ }) => never;
199
+ /**
200
+ * CLI metadata (name, version, resolved command path). Deeply immutable.
201
+ */
202
+ readonly meta: DeepReadonly<Meta>;
203
+ }
204
+ //#endregion
205
+ //#region src/types.d.ts
206
+ /**
207
+ * Global args merged into every ctx.args.
208
+ */
209
+ interface KiddArgs {}
210
+ /**
211
+ * Global config merged into every ctx.config.
212
+ */
213
+ interface KiddConfig {}
214
+ /**
215
+ * Global store keys merged into every ctx.store.
216
+ */
217
+ interface KiddStore {}
218
+ /**
219
+ * Merge two types, with TBase overriding TOverride.
220
+ */
221
+ type Merge<TBase, TOverride> = Omit<TBase, keyof TOverride> & TOverride;
222
+ /**
223
+ * String keys of a record.
224
+ */
225
+ type StringKeyOf<TRecord> = Extract<keyof TRecord, string>;
226
+ /**
227
+ * A record with string keys and unknown values. Used as the default constraint
228
+ * for args, config, and general-purpose record types throughout the framework.
229
+ */
230
+ type AnyRecord = Record<string, unknown>;
231
+ /**
232
+ * Recursively makes all properties readonly.
233
+ * Primitives and functions pass through unchanged.
234
+ * Arrays become readonly tuples, objects get readonly properties at every depth.
235
+ */
236
+ type DeepReadonly<TType> = TType extends ((...args: unknown[]) => unknown) ? TType : TType extends readonly (infer TItem)[] ? readonly DeepReadonly<TItem>[] : TType extends object ? { readonly [Key in keyof TType]: DeepReadonly<TType[Key]> } : TType;
237
+ /**
238
+ * The next() function passed to middleware. Call it to continue to the next middleware or handler.
239
+ */
240
+ type NextFunction = () => Promise<void>;
241
+ /**
242
+ * A middleware function receives ctx and next.
243
+ */
244
+ type MiddlewareFn<TConfig extends AnyRecord = AnyRecord> = (ctx: Context<AnyRecord, TConfig>, next: NextFunction) => Promise<void> | void;
245
+ /**
246
+ * A middleware object wrapping a MiddlewareFn. Returned by the middleware() factory.
247
+ */
248
+ type Middleware<TConfig extends AnyRecord = AnyRecord> = Tagged<{
249
+ readonly handler: MiddlewareFn<TConfig>;
250
+ }, "Middleware">;
251
+ /**
252
+ * Yargs-native arg format -- accepted as an alternative to zod.
253
+ * Converted to a zod schema internally before parsing.
254
+ */
255
+ interface YargsArgDef {
256
+ type: "string" | "number" | "boolean" | "array";
257
+ description?: string;
258
+ required?: boolean;
259
+ default?: unknown;
260
+ alias?: string | string[];
261
+ choices?: readonly string[];
262
+ }
263
+ /**
264
+ * Arg definitions accepted by `command()`.
265
+ *
266
+ * Either a zod object schema (recommended) or a record of yargs-native arg
267
+ * definitions. Both produce the same typed `ctx.args` -- yargs format is
268
+ * converted to zod internally before parsing.
269
+ */
270
+ type ArgsDef = z.ZodObject<z.ZodRawShape> | Record<string, YargsArgDef>;
271
+ /**
272
+ * Map a single yargs arg def to its TypeScript type.
273
+ */
274
+ type YargsArgValue<TDef extends YargsArgDef> = TDef["required"] extends true ? YargsArgBaseType<TDef["type"]> : TDef["default"] extends undefined ? YargsArgBaseType<TDef["type"]> | undefined : YargsArgBaseType<TDef["type"]>;
275
+ type YargsArgBaseType<TType extends string> = TType extends "string" ? string : TType extends "number" ? number : TType extends "boolean" ? boolean : TType extends "array" ? string[] : unknown;
276
+ /**
277
+ * Resolve the parsed args type from either format.
278
+ */
279
+ type InferArgs<TDef extends ArgsDef> = TDef extends z.ZodObject<z.ZodRawShape> ? z.infer<TDef> : TDef extends Record<string, YargsArgDef> ? { [Key in keyof TDef]: YargsArgValue<TDef[Key]> } : AnyRecord;
280
+ /**
281
+ * Handler function for a command. Receives the fully typed context.
282
+ */
283
+ type HandlerFn<TArgs extends AnyRecord = AnyRecord, TConfig extends AnyRecord = AnyRecord> = (ctx: Context<TArgs, TConfig>) => Promise<void> | void;
284
+ /**
285
+ * Options passed to `command()`.
286
+ */
287
+ interface CommandDef<TArgsDef extends ArgsDef = ArgsDef, TConfig extends AnyRecord = AnyRecord> {
288
+ /**
289
+ * Human-readable description shown in help text.
290
+ */
291
+ description?: string;
292
+ /**
293
+ * Arg definitions -- zod object schema (recommended) or yargs-native format.
294
+ */
295
+ args?: TArgsDef;
296
+ /**
297
+ * Command-level middleware. Runs inside the root middleware chain, wrapping the handler.
298
+ */
299
+ middleware?: Middleware[];
300
+ /**
301
+ * Nested subcommands — a static map or a promise from `autoload()`.
302
+ */
303
+ commands?: CommandMap | Promise<CommandMap>;
304
+ /**
305
+ * The command handler.
306
+ */
307
+ handler?: HandlerFn<TArgsDef extends z.ZodObject<z.ZodRawShape> ? z.infer<TArgsDef> : InferArgs<TArgsDef & ArgsDef>, TConfig>;
308
+ }
309
+ /**
310
+ * A resolved command object. Returned by command().
311
+ */
312
+ type Command<TArgsDef extends ArgsDef = ArgsDef, TConfig extends AnyRecord = AnyRecord> = Tagged<{
313
+ readonly description?: string;
314
+ readonly args?: TArgsDef;
315
+ readonly middleware?: Middleware[];
316
+ readonly commands?: CommandMap | Promise<CommandMap>;
317
+ readonly handler?: HandlerFn<TArgsDef extends z.ZodObject<z.ZodRawShape> ? z.infer<TArgsDef> : InferArgs<TArgsDef & ArgsDef>, TConfig>;
318
+ }, "Command">;
319
+ /**
320
+ * A map of command name to resolved {@link Command}. Used for subcommands and the manifest.
321
+ */
322
+ interface CommandMap {
323
+ [name: string]: Command;
324
+ }
325
+ /**
326
+ * Options accepted by `autoload()`.
327
+ */
328
+ interface AutoloadOptions {
329
+ /**
330
+ * Directory to scan for command files. Defaults to the directory of the calling file.
331
+ */
332
+ dir?: string;
333
+ }
334
+ /**
335
+ * Config loading options nested inside {@link CliOptions}.
336
+ */
337
+ interface CliConfigOptions<TSchema extends z.ZodType = z.ZodType> {
338
+ /**
339
+ * Zod schema to validate the loaded config. Infers `ctx.config` type.
340
+ */
341
+ schema?: TSchema;
342
+ /**
343
+ * Override the config file name. Default: derived from `name` in CliOptions.
344
+ */
345
+ name?: string;
346
+ }
347
+ /**
348
+ * Options passed to `cli()`.
349
+ */
350
+ interface CliOptions<TSchema extends z.ZodType = z.ZodType> {
351
+ /**
352
+ * CLI name. Used for help text and config file discovery.
353
+ */
354
+ name: string;
355
+ /**
356
+ * CLI version. Enables `--version` flag.
357
+ */
358
+ version: string;
359
+ /**
360
+ * Human-readable description shown in help text.
361
+ */
362
+ description?: string;
363
+ /**
364
+ * Runtime config options (schema, config file name override).
365
+ */
366
+ config?: CliConfigOptions<TSchema>;
367
+ /**
368
+ * Middleware stack. Executed in order before each command handler.
369
+ */
370
+ middleware?: Middleware[];
371
+ /**
372
+ * Override the commands source. When omitted, `cli()` loads `kidd.config.ts`
373
+ * and autoloads from its `commands` field (falling back to `'./commands'`).
374
+ *
375
+ * Accepts a directory path string, a static {@link CommandMap}, or a
376
+ * `Promise<CommandMap>` for advanced use and testing.
377
+ */
378
+ commands?: string | CommandMap | Promise<CommandMap>;
379
+ }
380
+ //#endregion
381
+ export { CommandDef as a, MiddlewareFn as c, Command as i, Context as l, AutoloadOptions as n, CommandMap as o, CliOptions as r, Middleware as s, ArgsDef as t };
382
+ //# sourceMappingURL=types-kjpRau0U.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-kjpRau0U.d.ts","names":[],"sources":["../src/context/types.ts","../src/types.ts"],"mappings":";;;;;;;;;;AAuBA;;;;;AAaA;;;UAbiB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GAAU,SAAA,CACR,QAAA,SAAiB,CAAA,CAAE,SAAA,CAAU,CAAA,CAAE,WAAA,IAAe,CAAA,CAAE,KAAA,CAAM,QAAA,IAAY,SAAA,CAAU,QAAA,GAAW,OAAA,GACvF,OAAA;AAAA;;;;KAOQ,OAAA,kBACO,OAAA,GAAU,OAAA,kBACX,SAAA,GAAY,SAAA,IAC1B,MAAA;EAAA,SAES,WAAA;EAAA,SACA,IAAA,GAAO,QAAA;EAAA,SACP,UAAA,GAAa,UAAA;EAAA,SACb,QAAA,GAAW,UAAA,GAAa,OAAA,CAAQ,UAAA;EAAA,SAChC,OAAA,GAAU,SAAA,CACjB,QAAA,SAAiB,CAAA,CAAE,SAAA,CAAU,CAAA,CAAE,WAAA,IAC3B,CAAA,CAAE,KAAA,CAAM,QAAA,IACR,SAAA,CAAU,QAAA,GAAW,OAAA,GACzB,OAAA;AAAA;;;;UASW,UAAA;EAAA,CACC,IAAA,WAAA,OAAA;AAAA;;;;UAMD,eAAA;;;;EAIf,GAAA;AAAA;;;;UAUe,gBAAA,iBAAiC,CAAA,CAAE,OAAA,GAAU,CAAA,CAAE,OAAA;;;;EAI9D,MAAA,GAAS,OAAA;;;;EAIT,IAAA;AAAA;;;;UAMe,UAAA,iBAA2B,CAAA,CAAE,OAAA,GAAU,CAAA,CAAE,OAAA;ED3I3B;AAS/B;;ECsIE,IAAA;EDtIe;;AAcjB;EC4HE,OAAA;;;;EAIA,WAAA;;;;EAIA,MAAA,GAAS,gBAAA,CAAiB,OAAA;;;;EAI1B,UAAA,GAAa,UAAA;;;;;;;;EAQb,QAAA,YAAoB,UAAA,GAAa,OAAA,CAAQ,UAAA;AAAA"}
package/package.json ADDED
@@ -0,0 +1,94 @@
1
+ {
2
+ "name": "@kidd-cli/core",
3
+ "version": "0.1.0",
4
+ "description": "An opinionated CLI framework for Node.js",
5
+ "keywords": [
6
+ "cli",
7
+ "command",
8
+ "framework",
9
+ "typescript",
10
+ "yargs",
11
+ "zod"
12
+ ],
13
+ "license": "MIT",
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "type": "module",
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/index.d.ts",
21
+ "default": "./dist/index.js"
22
+ },
23
+ "./prompts": {
24
+ "types": "./dist/lib/prompts.d.ts",
25
+ "default": "./dist/lib/prompts.js"
26
+ },
27
+ "./logger": {
28
+ "types": "./dist/lib/logger.d.ts",
29
+ "default": "./dist/lib/logger.js"
30
+ },
31
+ "./output": {
32
+ "types": "./dist/lib/output.d.ts",
33
+ "default": "./dist/lib/output.js"
34
+ },
35
+ "./config": {
36
+ "types": "./dist/lib/config.d.ts",
37
+ "default": "./dist/lib/config.js"
38
+ },
39
+ "./store": {
40
+ "types": "./dist/lib/store.d.ts",
41
+ "default": "./dist/lib/store.js"
42
+ },
43
+ "./project": {
44
+ "types": "./dist/lib/project.d.ts",
45
+ "default": "./dist/lib/project.js"
46
+ },
47
+ "./auth": {
48
+ "types": "./dist/middleware/auth.d.ts",
49
+ "default": "./dist/middleware/auth.js"
50
+ },
51
+ "./http": {
52
+ "types": "./dist/middleware/http.d.ts",
53
+ "default": "./dist/middleware/http.js"
54
+ }
55
+ },
56
+ "dependencies": {
57
+ "@clack/prompts": "^1.0.1",
58
+ "@pinojs/redact": "^0.4.0",
59
+ "dotenv": "^17.3.1",
60
+ "es-toolkit": "^1.45.0",
61
+ "jsonc-parser": "^3.3.1",
62
+ "liquidjs": "^10.24.0",
63
+ "picocolors": "^1.1.1",
64
+ "ts-pattern": "^5.9.0",
65
+ "yaml": "^2.8.2",
66
+ "yargs": "^18.0.0",
67
+ "zod": "^4.3.6",
68
+ "@kidd-cli/config": "0.1.0",
69
+ "@kidd-cli/utils": "0.1.0"
70
+ },
71
+ "devDependencies": {
72
+ "@types/node": "^25.3.3",
73
+ "@types/yargs": "^17.0.35",
74
+ "tsdown": "0.21.0-beta.2",
75
+ "typescript": "^5.9.3",
76
+ "vitest": "^4.0.18"
77
+ },
78
+ "peerDependencies": {
79
+ "pino": ">=9.0.0"
80
+ },
81
+ "peerDependenciesMeta": {
82
+ "pino": {
83
+ "optional": true
84
+ }
85
+ },
86
+ "scripts": {
87
+ "build": "tsdown",
88
+ "typecheck": "tsgo --noEmit",
89
+ "lint": "oxlint --ignore-pattern node_modules",
90
+ "lint:fix": "oxlint --fix --ignore-pattern node_modules",
91
+ "test": "vitest run",
92
+ "test:watch": "vitest"
93
+ }
94
+ }