@kubb/core 5.14.5 → 5.15.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.
- package/dist/{Hookable-BLHdV93L.js → Hookable-BYr6s0lB.js} +82 -70
- package/dist/Hookable-BYr6s0lB.js.map +1 -0
- package/dist/{createAdapter-BD4waEKc.d.ts → createAdapter-CCe-Oddm.d.ts} +35 -49
- package/dist/html/ui.iife.js +3 -3
- package/dist/index.cjs +124 -120
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +70 -85
- package/dist/index.d.ts +38 -39
- package/dist/index.js +45 -56
- package/dist/index.js.map +1 -1
- package/dist/mocks.d.ts +1 -3
- package/dist/mocks.js +8 -4
- package/dist/mocks.js.map +1 -1
- package/package.json +2 -2
- package/dist/Hookable-BLHdV93L.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,36 @@
|
|
|
1
1
|
import { Enforce, FileNode, HttpMethod, ImportNode, InlineLanguage, InputMeta, InputNode, Macro, Node, OperationNode, SchemaNode, UserFileNode } from "@kubb/ast";
|
|
2
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
3
|
import net from "node:net";
|
|
4
|
-
|
|
4
|
+
type Options$1 = {
|
|
5
|
+
/**
|
|
6
|
+
* Text prepended before casing is applied.
|
|
7
|
+
*/
|
|
8
|
+
prefix?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Text appended before casing is applied.
|
|
11
|
+
*/
|
|
12
|
+
suffix?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Converts `text` to camelCase.
|
|
16
|
+
*
|
|
17
|
+
* @example Word boundaries
|
|
18
|
+
* `camelCase('hello-world') // 'helloWorld'`
|
|
19
|
+
*
|
|
20
|
+
* @example With a prefix
|
|
21
|
+
* `camelCase('tag', { prefix: 'create' }) // 'createTag'`
|
|
22
|
+
*/
|
|
23
|
+
export declare function camelCase(text: string, { prefix, suffix }?: Options$1): string;
|
|
24
|
+
/**
|
|
25
|
+
* Converts `text` to PascalCase.
|
|
26
|
+
*
|
|
27
|
+
* @example Word boundaries
|
|
28
|
+
* `pascalCase('hello-world') // 'HelloWorld'`
|
|
29
|
+
*
|
|
30
|
+
* @example With a suffix
|
|
31
|
+
* `pascalCase('tag', { suffix: 'schema' }) // 'TagSchema'`
|
|
32
|
+
*/
|
|
33
|
+
export declare function pascalCase(text: string, { prefix, suffix }?: Options$1): string;
|
|
5
34
|
/** A value that may already be resolved or still pending.
|
|
6
35
|
*
|
|
7
36
|
* @example
|
|
@@ -12,8 +41,6 @@ import net from "node:net";
|
|
|
12
41
|
* ```
|
|
13
42
|
*/
|
|
14
43
|
type PossiblePromise<T> = Promise<T> | T;
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region ../../internals/utils/src/types.d.ts
|
|
17
44
|
/** A union of known literals that still accepts any other value of `Base`, without collapsing
|
|
18
45
|
* the literals away. Editors keep autocompleting the known members while arbitrary strings stay
|
|
19
46
|
* assignable.
|
|
@@ -26,8 +53,6 @@ type PossiblePromise<T> = Promise<T> | T;
|
|
|
26
53
|
* ```
|
|
27
54
|
*/
|
|
28
55
|
type LiteralUnion<T extends Base, Base = string> = T | (Base & {});
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region src/defineParser.d.ts
|
|
31
56
|
/**
|
|
32
57
|
* Converts a resolved {@link FileNode} into the final source string that gets
|
|
33
58
|
* written to disk. Kubb ships with TypeScript and TSX parsers. Add your own
|
|
@@ -88,8 +113,6 @@ type ParserFactory<TOptions extends object = object, TMeta extends object = obje
|
|
|
88
113
|
* @deprecated Use `defineExtension` with `kind: 'parser'` instead.
|
|
89
114
|
*/
|
|
90
115
|
export declare function defineParser<TOptions extends object = object, TMeta extends object = object, TNode = unknown>(definition: ParserDefinition<TOptions, TMeta, TNode>): ParserFactory<TOptions, TMeta, TNode>;
|
|
91
|
-
//#endregion
|
|
92
|
-
//#region src/diagnosticCatalog.d.ts
|
|
93
116
|
/**
|
|
94
117
|
* Every diagnostic code with its docs entry: a short title, what triggers it, and how to resolve
|
|
95
118
|
* it. The source of truth for {@link diagnosticCode}, and the kubb.dev `/reference/diagnostics`
|
|
@@ -322,8 +345,6 @@ declare const diagnosticCode: { readonly [K in keyof typeof diagnosticCatalog]:
|
|
|
322
345
|
* Union of the stable {@link diagnosticCode} values.
|
|
323
346
|
*/
|
|
324
347
|
type DiagnosticCode = (typeof diagnosticCode)[keyof typeof diagnosticCode];
|
|
325
|
-
//#endregion
|
|
326
|
-
//#region src/formatDiagnostic.d.ts
|
|
327
348
|
/**
|
|
328
349
|
* How {@link format} renders a diagnostic.
|
|
329
350
|
*/
|
|
@@ -406,8 +427,6 @@ declare function serialize(diagnostic: Diagnostic): SerializedDiagnostic;
|
|
|
406
427
|
* `verbose` adds the full stack.
|
|
407
428
|
*/
|
|
408
429
|
declare function format(diagnostic: Diagnostic, { audience, verbose, width, position }?: DiagnosticFormatOptions): Array<string>;
|
|
409
|
-
//#endregion
|
|
410
|
-
//#region src/createReporter.d.ts
|
|
411
430
|
/**
|
|
412
431
|
* Numeric log-level thresholds used internally to compare verbosity.
|
|
413
432
|
*
|
|
@@ -551,8 +570,6 @@ type UserReporter<T = void> = {
|
|
|
551
570
|
* ```
|
|
552
571
|
*/
|
|
553
572
|
export declare function createReporter<T = void>(reporter: UserReporter<T>): Reporter;
|
|
554
|
-
//#endregion
|
|
555
|
-
//#region src/createStorage.d.ts
|
|
556
573
|
/**
|
|
557
574
|
* Backend that persists generated files. Kubb ships with `fsStorage` (writes
|
|
558
575
|
* to disk) and `memoryStorage` (keeps everything in RAM). Implement this
|
|
@@ -633,8 +650,6 @@ type Storage = {
|
|
|
633
650
|
* ```
|
|
634
651
|
*/
|
|
635
652
|
export declare const createStorage: <TOptions = Record<string, never>>(build: (options: TOptions) => Storage) => (options?: TOptions) => Storage;
|
|
636
|
-
//#endregion
|
|
637
|
-
//#region src/createRenderer.d.ts
|
|
638
653
|
/**
|
|
639
654
|
* Minimal interface any Kubb renderer must satisfy.
|
|
640
655
|
*
|
|
@@ -695,8 +710,6 @@ type RendererFactory<TElement = unknown> = () => Renderer<TElement>;
|
|
|
695
710
|
* ```
|
|
696
711
|
*/
|
|
697
712
|
export declare function createRenderer<TElement = unknown>(factory: RendererFactory<TElement>): RendererFactory<TElement>;
|
|
698
|
-
//#endregion
|
|
699
|
-
//#region src/outputManifest.d.ts
|
|
700
713
|
/**
|
|
701
714
|
* Remembers what the output passes did to each generated file, so the next run can tell "the
|
|
702
715
|
* formatter already turned this exact source into what is stored" apart from a real change.
|
|
@@ -741,8 +754,6 @@ export declare function createOutputManifest({ storage, cache }: {
|
|
|
741
754
|
storage: Storage;
|
|
742
755
|
cache: Storage;
|
|
743
756
|
}): Promise<OutputManifest>;
|
|
744
|
-
//#endregion
|
|
745
|
-
//#region src/Hookable.d.ts
|
|
746
757
|
/**
|
|
747
758
|
* A function that can be registered as a hook listener, synchronous or async. Any return value is
|
|
748
759
|
* allowed and ignored, so handlers that return a result for their own callers still register.
|
|
@@ -826,8 +837,6 @@ export declare class Hookable<THooks extends { [K in keyof THooks]: Array<unknow
|
|
|
826
837
|
*/
|
|
827
838
|
removeAllHooks(): void;
|
|
828
839
|
}
|
|
829
|
-
//#endregion
|
|
830
|
-
//#region src/FileManager.d.ts
|
|
831
840
|
type ParseOptions = {
|
|
832
841
|
parsers?: Map<FileNode['extname'], Parser>;
|
|
833
842
|
};
|
|
@@ -839,6 +848,11 @@ type WriteOptions = ParseOptions & {
|
|
|
839
848
|
* unchanged. Omitted when no formatter, linter, or `postGenerate` step is configured.
|
|
840
849
|
*/
|
|
841
850
|
manifest?: OutputManifest;
|
|
851
|
+
/**
|
|
852
|
+
* Directory the storage emptied right before this write. Files under it cannot exist yet, so they
|
|
853
|
+
* are written without reading the previous value back.
|
|
854
|
+
*/
|
|
855
|
+
cleaned?: string;
|
|
842
856
|
/**
|
|
843
857
|
* Receives `kubb:files:processing:start`, `:update` (in input order, as files finish) and `:end` for the write. `config` fills the update rows.
|
|
844
858
|
*/
|
|
@@ -900,10 +914,11 @@ declare class FileManager {
|
|
|
900
914
|
* writes nothing and leaves every mtime where it was. `kubb:files:processing:end` lists the
|
|
901
915
|
* skipped paths as `unchanged`.
|
|
902
916
|
*/
|
|
903
|
-
write(files: Array<FileNode>, { storage, parsers, manifest, signal, hooks, config }: WriteOptions): Promise<void>;
|
|
917
|
+
write(files: Array<FileNode>, { storage, parsers, manifest, signal, hooks, config, cleaned }: WriteOptions): Promise<void>;
|
|
904
918
|
}
|
|
905
|
-
|
|
906
|
-
|
|
919
|
+
type MemoKey = LiteralUnion<`${keyof Kubb.MemoRegistry & string}:${string}`>;
|
|
920
|
+
type MemoValue<TKey extends string> = TKey extends `${infer TPrefix}:${string}` ? TPrefix extends keyof Kubb.MemoRegistry ? Kubb.MemoRegistry[TPrefix] : unknown : unknown;
|
|
921
|
+
type Memo = <TKey extends MemoKey, TValue extends MemoValue<TKey>>(key: TKey, compute: () => TValue) => TValue;
|
|
907
922
|
type Options = {
|
|
908
923
|
hooks: Hookable<KubbHooks>;
|
|
909
924
|
signal?: AbortSignal;
|
|
@@ -975,6 +990,7 @@ export declare class KubbDriver {
|
|
|
975
990
|
[Symbol.dispose](): void;
|
|
976
991
|
/** Reads `plugin.resolver`, falling back to a fresh default for a name that is not a registered plugin. */
|
|
977
992
|
getResolver<TName extends PluginName>(pluginName: TName): ResolvePluginOptions<TName>['resolver'];
|
|
993
|
+
memo<TKey extends MemoKey, TValue extends MemoValue<TKey>>(key: TKey, compute: () => TValue): TValue;
|
|
978
994
|
getContext<TOptions extends PluginType>(plugin: NormalizedPlugin<TOptions>): Omit<GeneratorContext<TOptions>, 'options' | 'cache'>;
|
|
979
995
|
getPlugin<TName extends PluginName>(pluginName: TName): Plugin<ResolvePluginOptions<TName>> | undefined;
|
|
980
996
|
/**
|
|
@@ -982,8 +998,6 @@ export declare class KubbDriver {
|
|
|
982
998
|
*/
|
|
983
999
|
requirePlugin<TName extends PluginName>(pluginName: TName, context?: RequirePluginContext): Plugin<ResolvePluginOptions<TName>>;
|
|
984
1000
|
}
|
|
985
|
-
//#endregion
|
|
986
|
-
//#region src/output/runHook.d.ts
|
|
987
1001
|
/**
|
|
988
1002
|
* Outcome of one hook subprocess, also carried by the `kubb:hook:end` hook it emits.
|
|
989
1003
|
*/
|
|
@@ -1015,8 +1029,6 @@ type RunHookOptions = {
|
|
|
1015
1029
|
* only, and the caller emits `kubb:success` or a diagnostic, so nothing is reported twice.
|
|
1016
1030
|
*/
|
|
1017
1031
|
export declare function runHook({ hooks, command, args, name, cwd, signal }: RunHookOptions): Promise<HookResult>;
|
|
1018
|
-
//#endregion
|
|
1019
|
-
//#region src/types.d.ts
|
|
1020
1032
|
/**
|
|
1021
1033
|
* Source to generate from. Kubb detects what it was given:
|
|
1022
1034
|
*
|
|
@@ -1349,6 +1361,14 @@ declare global {
|
|
|
1349
1361
|
* ```
|
|
1350
1362
|
*/
|
|
1351
1363
|
interface PluginOptionsRegistry {}
|
|
1364
|
+
/**
|
|
1365
|
+
* Registry of memo key prefixes to the value stored under them, so `memo(`prefix:rest`, compute)`
|
|
1366
|
+
* returns that type. Augment it the way `PluginRegistry` is augmented.
|
|
1367
|
+
*/
|
|
1368
|
+
interface MemoRegistry {
|
|
1369
|
+
name: string;
|
|
1370
|
+
resolveName: string;
|
|
1371
|
+
}
|
|
1352
1372
|
/**
|
|
1353
1373
|
* Registry of hook names to their listener argument tuples.
|
|
1354
1374
|
* Augment this interface to add hook events without touching core types.
|
|
@@ -1701,8 +1721,6 @@ export type BuildOutput = {
|
|
|
1701
1721
|
*/
|
|
1702
1722
|
storage: Storage;
|
|
1703
1723
|
};
|
|
1704
|
-
//#endregion
|
|
1705
|
-
//#region src/Diagnostics.d.ts
|
|
1706
1724
|
/**
|
|
1707
1725
|
* How serious a diagnostic is. `error` fails the build, `warning` and `info`
|
|
1708
1726
|
* are reported but do not.
|
|
@@ -2026,8 +2044,6 @@ export declare class Diagnostics {
|
|
|
2026
2044
|
*/
|
|
2027
2045
|
static format: typeof format;
|
|
2028
2046
|
}
|
|
2029
|
-
//#endregion
|
|
2030
|
-
//#region src/nodeCache.d.ts
|
|
2031
2047
|
/**
|
|
2032
2048
|
* Per-node memo shared by every plugin that generates from the same schema or operation node in
|
|
2033
2049
|
* one generate pass. The driver creates one `NodeCache` per node during the walk and hands the
|
|
@@ -2058,8 +2074,6 @@ type NodeCache = {
|
|
|
2058
2074
|
*/
|
|
2059
2075
|
ensureItem<TValue>(key: string, factory: () => TValue): TValue;
|
|
2060
2076
|
};
|
|
2061
|
-
//#endregion
|
|
2062
|
-
//#region src/defineGenerator.d.ts
|
|
2063
2077
|
/**
|
|
2064
2078
|
* Context passed to a generator's `schema`, `operation`, and `operations` methods.
|
|
2065
2079
|
*
|
|
@@ -2170,6 +2184,11 @@ type GeneratorContext<TOptions extends PluginType = PluginType> = {
|
|
|
2170
2184
|
* there is no single node, the cache is a fresh scratch scope for that call.
|
|
2171
2185
|
*/
|
|
2172
2186
|
cache: NodeCache;
|
|
2187
|
+
/**
|
|
2188
|
+
* Cache for the whole build, shared by every plugin, where `cache` is one node and `resolver.memo` is one
|
|
2189
|
+
* plugin. Prefix a key with the plugin name unless every plugin wants the same value.
|
|
2190
|
+
*/
|
|
2191
|
+
memo: Memo;
|
|
2173
2192
|
};
|
|
2174
2193
|
/**
|
|
2175
2194
|
* Declares a named generator unit that walks the AST and emits files.
|
|
@@ -2287,8 +2306,6 @@ type Generator<TOptions extends PluginType = PluginType, TElement = unknown> = {
|
|
|
2287
2306
|
* ```
|
|
2288
2307
|
*/
|
|
2289
2308
|
export declare function defineGenerator<TOptions extends PluginType = PluginType, TElement = unknown>(generator: Generator<TOptions, TElement>): Generator<TOptions, TElement>;
|
|
2290
|
-
//#endregion
|
|
2291
|
-
//#region src/resolveOptions.d.ts
|
|
2292
2309
|
/**
|
|
2293
2310
|
* Filters and overrides applied to an operation or schema's options.
|
|
2294
2311
|
*
|
|
@@ -2300,8 +2317,6 @@ type ResolveOptionsContext<TOptions> = {
|
|
|
2300
2317
|
include?: Array<Filter>;
|
|
2301
2318
|
override?: Array<Override<TOptions>>;
|
|
2302
2319
|
};
|
|
2303
|
-
//#endregion
|
|
2304
|
-
//#region src/Resolver.d.ts
|
|
2305
2320
|
/**
|
|
2306
2321
|
* The built-in resolution machinery exposed on every resolver as `resolver.default`.
|
|
2307
2322
|
* Plugins delegate to it via `this.default.*` and set their own conventions through
|
|
@@ -2440,13 +2455,13 @@ type ResolverFile = {
|
|
|
2440
2455
|
* `extname`. Defaults to `toFilePath(name)` with `extname` appended. Reaches sibling resolver
|
|
2441
2456
|
* helpers through `this`.
|
|
2442
2457
|
*/
|
|
2443
|
-
baseName?(params: Pick<ResolverFileParams, 'name' | 'extname'>): FileNode['baseName'];
|
|
2458
|
+
baseName?(this: Resolver, params: Pick<ResolverFileParams, 'name' | 'extname'>): FileNode['baseName'];
|
|
2444
2459
|
/**
|
|
2445
2460
|
* Returns the file's complete path, resolved against the project `root`. Bypasses `output.path`
|
|
2446
2461
|
* and `group`, so the resolver owns the layout. The returned path may not escape `root`. Reaches
|
|
2447
2462
|
* sibling resolver helpers through `this`.
|
|
2448
2463
|
*/
|
|
2449
|
-
path?(params: ResolverFilePathParams): string;
|
|
2464
|
+
path?(this: Resolver, params: ResolverFilePathParams): string;
|
|
2450
2465
|
};
|
|
2451
2466
|
/**
|
|
2452
2467
|
* The argument to a resolver's `file.path`: the resolved `baseName` (what `file.baseName` produced,
|
|
@@ -2589,6 +2604,10 @@ export declare class Resolver {
|
|
|
2589
2604
|
/** Exposes the raw build options so `Resolver.merge` can read them across `@kubb/core` copies. */
|
|
2590
2605
|
get [resolverOptions](): ResolverBuildOptions;
|
|
2591
2606
|
name(name: string): string;
|
|
2607
|
+
/**
|
|
2608
|
+
* Returns what `compute` produced the first time this build asked for `key`. A resolver lives for one build.
|
|
2609
|
+
*/
|
|
2610
|
+
memo<TKey extends MemoKey, TValue extends MemoValue<TKey>>(key: TKey, compute: () => TValue): TValue;
|
|
2592
2611
|
/**
|
|
2593
2612
|
* Reserves emitted identifiers before allocating other declarations. The driver reserves component
|
|
2594
2613
|
* names. Reserve extra identifiers, such as enum type aliases, before calling `resolveName`.
|
|
@@ -2647,8 +2666,6 @@ export declare class Resolver {
|
|
|
2647
2666
|
*/
|
|
2648
2667
|
static merge<T extends Resolver>(base: T, ...overrides: Array<ResolverPatch<T> | Resolver>): T;
|
|
2649
2668
|
}
|
|
2650
|
-
//#endregion
|
|
2651
|
-
//#region src/definePlugin.d.ts
|
|
2652
2669
|
/** Reads key `K` from a registry interface, or `{}` when no package has augmented it. @internal */
|
|
2653
2670
|
type ExtractRegistryKey<T, K extends PropertyKey> = K extends keyof T ? T[K] : {};
|
|
2654
2671
|
/**
|
|
@@ -2962,6 +2979,10 @@ type KubbPluginSetupContext<TFactory extends PluginType = PluginType> = {
|
|
|
2962
2979
|
injectFile(userFileNode: UserFileNode): void;
|
|
2963
2980
|
/** Returns a plugin this one needs, or fails the run with `KUBB_PLUGIN_NOT_FOUND` when the config lacks it. */
|
|
2964
2981
|
requirePlugin<TName extends PluginName>(name: TName): Plugin<ResolvePluginOptions<TName>>;
|
|
2982
|
+
/**
|
|
2983
|
+
* Returns a value computed once per build and shared by every plugin, like `ctx.memo` in a generator.
|
|
2984
|
+
*/
|
|
2985
|
+
memo: Memo;
|
|
2965
2986
|
/**
|
|
2966
2987
|
* The resolved build configuration at setup time.
|
|
2967
2988
|
*/
|
|
@@ -3054,8 +3075,6 @@ type KubbPluginEndContext = FilesContext & {
|
|
|
3054
3075
|
* @deprecated Use `defineExtension` with `kind: 'plugin'` instead.
|
|
3055
3076
|
*/
|
|
3056
3077
|
export declare function definePlugin<TFactory extends PluginType = PluginType>(definition: PluginDefinition<TFactory>): PluginFactory<TFactory>;
|
|
3057
|
-
//#endregion
|
|
3058
|
-
//#region src/defineExtension.d.ts
|
|
3059
3078
|
/**
|
|
3060
3079
|
* What an extension extends: a plugin generates code, an adapter reads the input, a parser prints files.
|
|
3061
3080
|
*/
|
|
@@ -3171,8 +3190,6 @@ export declare function defineExtension<T extends AdapterFactoryOptions = Adapte
|
|
|
3171
3190
|
export declare function defineExtension<TFactory extends PluginType = PluginType>(definition: {
|
|
3172
3191
|
kind: 'plugin';
|
|
3173
3192
|
} & PluginDefinition<TFactory>): PluginFactory<TFactory>;
|
|
3174
|
-
//#endregion
|
|
3175
|
-
//#region src/createAdapter.d.ts
|
|
3176
3193
|
/**
|
|
3177
3194
|
* Source data handed to an adapter's `parse` function. Mirrors the config
|
|
3178
3195
|
* input shape with paths resolved to absolute.
|
|
@@ -3305,8 +3322,6 @@ type AdapterFactory<T extends AdapterFactoryOptions = AdapterFactoryOptions> = E
|
|
|
3305
3322
|
* @deprecated Use `defineExtension` with `kind: 'adapter'` instead.
|
|
3306
3323
|
*/
|
|
3307
3324
|
export declare function createAdapter<T extends AdapterFactoryOptions = AdapterFactoryOptions>(definition: AdapterDefinition<T>): AdapterFactory<T>;
|
|
3308
|
-
//#endregion
|
|
3309
|
-
//#region src/composables.d.ts
|
|
3310
3325
|
/**
|
|
3311
3326
|
* Holds the setup context of the plugin whose `setup` or `kubb:plugin:setup` is running. `KubbDriver` sets it for each plugin.
|
|
3312
3327
|
*
|
|
@@ -3346,6 +3361,10 @@ export declare function setMacros(macros: ReadonlyArray<Macro>): void;
|
|
|
3346
3361
|
* Adds a raw file to the build output, like `ctx.injectFile`.
|
|
3347
3362
|
*/
|
|
3348
3363
|
export declare function injectFile(file: UserFileNode): void;
|
|
3364
|
+
/**
|
|
3365
|
+
* Returns a value computed once per build and shared by every plugin, like `ctx.memo`.
|
|
3366
|
+
*/
|
|
3367
|
+
export declare const memo: Memo;
|
|
3349
3368
|
/**
|
|
3350
3369
|
* Returns the options the user passed to the plugin being set up, like `ctx.options`.
|
|
3351
3370
|
*/
|
|
@@ -3362,8 +3381,6 @@ export declare function useConfig(): Config;
|
|
|
3362
3381
|
* Returns another plugin from the config, typed through `Kubb.PluginRegistry`, like `ctx.requirePlugin`.
|
|
3363
3382
|
*/
|
|
3364
3383
|
export declare function requirePlugin<TName extends PluginName>(name: TName): NormalizedPlugin<ResolvePluginOptions<TName>>;
|
|
3365
|
-
//#endregion
|
|
3366
|
-
//#region src/output/runOutputPasses.d.ts
|
|
3367
3384
|
type RunOutputPassesOptions = {
|
|
3368
3385
|
config: Config;
|
|
3369
3386
|
/**
|
|
@@ -3386,8 +3403,6 @@ type RunOutputPassesOptions = {
|
|
|
3386
3403
|
* ```
|
|
3387
3404
|
*/
|
|
3388
3405
|
export declare function runOutputPasses({ config, outputPath, hooks, signal }: RunOutputPassesOptions): Promise<Array<Diagnostic>>;
|
|
3389
|
-
//#endregion
|
|
3390
|
-
//#region src/createKubb.d.ts
|
|
3391
3406
|
type CreateKubbOptions = {
|
|
3392
3407
|
/**
|
|
3393
3408
|
* Receives Kubb lifecycle hooks for the run.
|
|
@@ -3503,8 +3518,6 @@ declare class Kubb$1 {
|
|
|
3503
3518
|
* ```
|
|
3504
3519
|
*/
|
|
3505
3520
|
export declare function createKubb(userConfig: UserConfig, options?: CreateKubbOptions): Kubb$1;
|
|
3506
|
-
//#endregion
|
|
3507
|
-
//#region src/reporters/summary.d.ts
|
|
3508
3521
|
/**
|
|
3509
3522
|
* Writes the summary through the host's output, or plain console lines by default.
|
|
3510
3523
|
*/
|
|
@@ -3512,8 +3525,6 @@ type SummaryRenderer = (lines: ReadonlyArray<string>, meta: {
|
|
|
3512
3525
|
title: string;
|
|
3513
3526
|
status: 'success' | 'failed';
|
|
3514
3527
|
}) => void;
|
|
3515
|
-
//#endregion
|
|
3516
|
-
//#region src/reporters/cliReporter.d.ts
|
|
3517
3528
|
/**
|
|
3518
3529
|
* Builds a `cli` reporter that renders the {@link Report} for each config as it finishes.
|
|
3519
3530
|
* Suppressed at `silent`. The `verbose` level adds the per-plugin timings.
|
|
@@ -3534,8 +3545,6 @@ export declare function createCliReporter({ render }?: {
|
|
|
3534
3545
|
* logger view.
|
|
3535
3546
|
*/
|
|
3536
3547
|
export declare const cliReporter: Reporter;
|
|
3537
|
-
//#endregion
|
|
3538
|
-
//#region src/reporters/fileReporter.d.ts
|
|
3539
3548
|
/**
|
|
3540
3549
|
* The `file` reporter. Writes a config's {@link Report} to `.kubb/kubb-<name>-<timestamp>.log` as a
|
|
3541
3550
|
* plain-text document: a `# <name> — <timestamp>` header, a `## Summary` with the same lines the
|
|
@@ -3547,8 +3556,6 @@ export declare const cliReporter: Reporter;
|
|
|
3547
3556
|
* the run is attached to a TTY.
|
|
3548
3557
|
*/
|
|
3549
3558
|
export declare const fileReporter: Reporter;
|
|
3550
|
-
//#endregion
|
|
3551
|
-
//#region src/reporters/jsonReporter.d.ts
|
|
3552
3559
|
/**
|
|
3553
3560
|
* The `json` reporter. `report` returns one config's {@link Report}, which {@link createReporter}
|
|
3554
3561
|
* buffers, and `drain` writes them as a single pretty-printed JSON array on `kubb:lifecycle:end`.
|
|
@@ -3557,14 +3564,10 @@ export declare const fileReporter: Reporter;
|
|
|
3557
3564
|
* stdout stays valid JSON.
|
|
3558
3565
|
*/
|
|
3559
3566
|
export declare const jsonReporter: Reporter;
|
|
3560
|
-
//#endregion
|
|
3561
|
-
//#region src/reporters/htmlReporter.d.ts
|
|
3562
3567
|
/**
|
|
3563
3568
|
* Writes a static HTML report directory selected with `--reporter html`.
|
|
3564
3569
|
*/
|
|
3565
3570
|
export declare const htmlReporter: Reporter;
|
|
3566
|
-
//#endregion
|
|
3567
|
-
//#region src/createResolver.d.ts
|
|
3568
3571
|
/**
|
|
3569
3572
|
* The plugin-specific resolver fields handed to `createResolver`. `name` and `file` fall
|
|
3570
3573
|
* back to the built-ins when omitted. Every method reaches sibling helpers through `this`,
|
|
@@ -3587,7 +3590,7 @@ type ResolverOptions<T extends PluginType> = Omit<T['resolver'], keyof Resolver>
|
|
|
3587
3590
|
* export const resolverTs = createResolver<PluginTs>({
|
|
3588
3591
|
* pluginName: 'plugin-ts',
|
|
3589
3592
|
* name(name) {
|
|
3590
|
-
* return ensureValidVarName(pascalCase(name))
|
|
3593
|
+
* return this.memo(`name:${name}`, () => ensureValidVarName(pascalCase(name)))
|
|
3591
3594
|
* },
|
|
3592
3595
|
* })
|
|
3593
3596
|
* ```
|
|
@@ -3620,8 +3623,6 @@ type ResolverOptions<T extends PluginType> = Omit<T['resolver'], keyof Resolver>
|
|
|
3620
3623
|
* ```
|
|
3621
3624
|
*/
|
|
3622
3625
|
export declare function createResolver<T extends PluginType>(options: ResolverOptions<T>): T['resolver'];
|
|
3623
|
-
//#endregion
|
|
3624
|
-
//#region src/gitInput.d.ts
|
|
3625
3626
|
/**
|
|
3626
3627
|
* Fetches one commit of a git repository into a temporary directory with a shallow `git fetch`,
|
|
3627
3628
|
* so any host and the user's own git credentials work, and relative `$ref` files resolve.
|
|
@@ -3638,16 +3639,12 @@ export declare function checkoutGitInput(input: string, signal?: AbortSignal, {
|
|
|
3638
3639
|
path: string;
|
|
3639
3640
|
dispose: () => Promise<void>;
|
|
3640
3641
|
}>;
|
|
3641
|
-
//#endregion
|
|
3642
|
-
//#region src/publicAddress.d.ts
|
|
3643
3642
|
/**
|
|
3644
3643
|
* Whether `address` is a routable public IP. Loopback, private, link-local, cloud metadata, and
|
|
3645
3644
|
* multicast ranges are not, and an IPv4-mapped IPv6 address counts as the IPv4 address it wraps.
|
|
3646
3645
|
* Pass `blocked` to replace the ranges.
|
|
3647
3646
|
*/
|
|
3648
3647
|
export declare function isPublicAddress(address: string, blocked?: net.BlockList): boolean;
|
|
3649
|
-
//#endregion
|
|
3650
|
-
//#region src/input.d.ts
|
|
3651
3648
|
/**
|
|
3652
3649
|
* What an `input` value points at, once Kubb has looked at it.
|
|
3653
3650
|
*
|
|
@@ -3667,8 +3664,6 @@ type InputKind = 'file' | 'url' | 'git' | 'inline' | 'object';
|
|
|
3667
3664
|
* one, or a `file` path.
|
|
3668
3665
|
*/
|
|
3669
3666
|
export declare function getInputKind(input: NonNullable<Input>): InputKind;
|
|
3670
|
-
//#endregion
|
|
3671
|
-
//#region src/storages/cacheStorage.d.ts
|
|
3672
3667
|
type CacheStorageOptions = {
|
|
3673
3668
|
/**
|
|
3674
3669
|
* Project root the cache directory is derived from.
|
|
@@ -3699,8 +3694,6 @@ export declare function resolveCacheDir(root: string): string;
|
|
|
3699
3694
|
* ```
|
|
3700
3695
|
*/
|
|
3701
3696
|
export declare const cacheStorage: (options?: CacheStorageOptions | undefined) => import("@kubb/kit").Storage;
|
|
3702
|
-
//#endregion
|
|
3703
|
-
//#region src/storages/fsStorage.d.ts
|
|
3704
3697
|
/**
|
|
3705
3698
|
* Built-in filesystem storage driver.
|
|
3706
3699
|
*
|
|
@@ -3714,6 +3707,7 @@ export declare const cacheStorage: (options?: CacheStorageOptions | undefined) =
|
|
|
3714
3707
|
* a formatter left behind
|
|
3715
3708
|
* - missing parent directories are created automatically
|
|
3716
3709
|
* - `FileManager.write` bounds in-flight writes, so this driver does not pace itself
|
|
3710
|
+
* - `empty` moves the directory aside and deletes it in the background
|
|
3717
3711
|
*
|
|
3718
3712
|
* @example
|
|
3719
3713
|
* ```ts
|
|
@@ -3728,8 +3722,6 @@ export declare const cacheStorage: (options?: CacheStorageOptions | undefined) =
|
|
|
3728
3722
|
* ```
|
|
3729
3723
|
*/
|
|
3730
3724
|
export declare const fsStorage: (options?: Record<string, never> | undefined) => import("@kubb/kit").Storage;
|
|
3731
|
-
//#endregion
|
|
3732
|
-
//#region src/storages/kubbStorage.d.ts
|
|
3733
3725
|
type KubbStorageOptions = {
|
|
3734
3726
|
/**
|
|
3735
3727
|
* Folder inside the Kubb home, or an absolute path such as `<cwd>/.kubb`.
|
|
@@ -3760,8 +3752,6 @@ export declare function kubbStorage({ base }?: KubbStorageOptions): {
|
|
|
3760
3752
|
setItem(key: string, value: unknown): Promise<void>;
|
|
3761
3753
|
removeItem(key: string): Promise<void>;
|
|
3762
3754
|
};
|
|
3763
|
-
//#endregion
|
|
3764
|
-
//#region src/storages/memoryStorage.d.ts
|
|
3765
3755
|
/**
|
|
3766
3756
|
* In-memory storage driver. Useful for testing and dry-run scenarios where
|
|
3767
3757
|
* generated output should be captured without touching the filesystem.
|
|
@@ -3782,8 +3772,6 @@ export declare function kubbStorage({ base }?: KubbStorageOptions): {
|
|
|
3782
3772
|
* ```
|
|
3783
3773
|
*/
|
|
3784
3774
|
export declare const memoryStorage: (options?: Record<string, never> | undefined) => import("@kubb/kit").Storage;
|
|
3785
|
-
//#endregion
|
|
3786
|
-
//#region src/manifest.d.ts
|
|
3787
3775
|
/** A value that survives `JSON.stringify` and `JSON.parse` unchanged. */
|
|
3788
3776
|
type JSONValue = string | number | boolean | null | Array<JSONValue> | {
|
|
3789
3777
|
[key: string]: JSONValue;
|
|
@@ -3933,8 +3921,6 @@ export declare function isExtensionManifest(value: unknown): value is ExtensionM
|
|
|
3933
3921
|
* an npm or GitHub artifact pinned to a valid version, and a valid manifest of the entry's kind.
|
|
3934
3922
|
*/
|
|
3935
3923
|
export declare function isRegistryEntry(value: unknown): value is RegistryEntry;
|
|
3936
|
-
//#endregion
|
|
3937
|
-
//#region src/installedPackages.d.ts
|
|
3938
3924
|
type InstalledPackage = {
|
|
3939
3925
|
package: string;
|
|
3940
3926
|
version?: string;
|
|
@@ -3951,6 +3937,5 @@ export declare function readInstalledPackages({ root, packages, resolveFrom }: {
|
|
|
3951
3937
|
packages?: Iterable<string>;
|
|
3952
3938
|
resolveFrom?: Array<string>;
|
|
3953
3939
|
}): Promise<Array<InstalledPackage>>;
|
|
3954
|
-
|
|
3955
|
-
export type { Adapter, AdapterDefinition, AdapterFactory, AdapterFactoryOptions, AdapterSource, BannerMeta, CreateKubbOptions, Diagnostic, DiagnosticDoc, DiagnosticFormatOptions, DiagnosticKind, DiagnosticLocation, DiagnosticSeverity, Exclude$1 as Exclude, ExtensionDependencies, ExtensionDependency, ExtensionDependencyRecord, ExtensionFactory, ExtensionKind, ExtensionManifest, ExtensionManifestOption, ExtensionMeta, Filter, GenerateOptions, GenerateResult, GenerationResult, Generator, GeneratorContext, Group, HookResult, Include, InputKind, InstalledPackage, JSONValue, Kubb$1 as Kubb, KubbPluginEndContext, KubbPluginSetupContext, KubbPluginStartContext, NodeCache, NormalizedPlugin, Output, OutputManifest, OutputMode, OutputOptions, Override, Parser, ParserDefinition, ParserFactory, PerformanceDiagnostic, Plugin, PluginDefinition, PluginFactory, PluginName, PluginType, ProblemCode, ProblemDiagnostic, RegistryArtifact, RegistryDetail, RegistryEntry, RegistryGuide, RegistryIndex, Renderer, RendererFactory, Reporter, ReporterContext, ReporterName, ReporterPluginFiles, ResolveBannerContext, ResolveBannerFile, ResolveFileOptions, ResolveImportsOptions, ResolveNameOptions, ResolveOptionsContext, ResolvePathOptions, ResolvePluginOptions, ResolverDefault, ResolverFile, ResolverFileParams, ResolverFilePathParams, ResolverPatch, ResolverPathParams, RunHookOptions, RunOutputPassesOptions, SerializedDiagnostic, Storage, SummaryRenderer, UpdateDiagnostic, UserReporter };
|
|
3940
|
+
export type { Adapter, AdapterDefinition, AdapterFactory, AdapterFactoryOptions, AdapterSource, BannerMeta, CreateKubbOptions, Diagnostic, DiagnosticDoc, DiagnosticFormatOptions, DiagnosticKind, DiagnosticLocation, DiagnosticSeverity, Exclude$1 as Exclude, ExtensionDependencies, ExtensionDependency, ExtensionDependencyRecord, ExtensionFactory, ExtensionKind, ExtensionManifest, ExtensionManifestOption, ExtensionMeta, Filter, GenerateOptions, GenerateResult, GenerationResult, Generator, GeneratorContext, Group, HookResult, Include, InputKind, InstalledPackage, JSONValue, Kubb$1 as Kubb, KubbPluginEndContext, KubbPluginSetupContext, KubbPluginStartContext, Memo, NodeCache, NormalizedPlugin, Output, OutputManifest, OutputMode, OutputOptions, Override, Parser, ParserDefinition, ParserFactory, PerformanceDiagnostic, Plugin, PluginDefinition, PluginFactory, PluginName, PluginType, ProblemCode, ProblemDiagnostic, RegistryArtifact, RegistryDetail, RegistryEntry, RegistryGuide, RegistryIndex, Renderer, RendererFactory, Reporter, ReporterContext, ReporterName, ReporterPluginFiles, ResolveBannerContext, ResolveBannerFile, ResolveFileOptions, ResolveImportsOptions, ResolveNameOptions, ResolveOptionsContext, ResolvePathOptions, ResolvePluginOptions, ResolverDefault, ResolverFile, ResolverFileParams, ResolverFilePathParams, ResolverPatch, ResolverPathParams, RunHookOptions, RunOutputPassesOptions, SerializedDiagnostic, Storage, SummaryRenderer, UpdateDiagnostic, UserReporter };
|
|
3956
3941
|
//# sourceMappingURL=index.d.cts.map
|