@kubb/core 5.0.0-beta.51 → 5.0.0-beta.53
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/{diagnostics-BCcJbIpZ.d.ts → diagnostics-D_LOtOCv.d.ts} +45 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +21 -21
- package/dist/index.js.map +1 -1
- package/dist/mocks.d.ts +1 -1
- package/package.json +4 -4
- package/src/defineResolver.ts +2 -15
- package/src/reporters/report.ts +1 -1
|
@@ -871,6 +871,50 @@ type ResolverBuilder<T extends PluginFactoryOptions> = () => Omit<T['resolver'],
|
|
|
871
871
|
name: string;
|
|
872
872
|
pluginName: T['name'];
|
|
873
873
|
} & ThisType<T['resolver']>;
|
|
874
|
+
/**
|
|
875
|
+
* Default path resolver used by `defineResolver`.
|
|
876
|
+
*
|
|
877
|
+
* - `mode: 'file'` — resolves directly to `output.path` (the full file path, extension included).
|
|
878
|
+
* - `mode: 'directory'` (default) — resolves to `output.path/{baseName}`, or into a
|
|
879
|
+
* subdirectory when `group` and a `tag`/`path` value are provided.
|
|
880
|
+
*
|
|
881
|
+
* A custom `group.name` function overrides the default subdirectory naming.
|
|
882
|
+
* For `tag` groups the default is the camelCased tag.
|
|
883
|
+
* For `path` groups the default is the first path segment after `/`.
|
|
884
|
+
*
|
|
885
|
+
* @example Flat output
|
|
886
|
+
* ```ts
|
|
887
|
+
* defaultResolvePath({ baseName: 'petTypes.ts' }, { root: '/src', output: { path: 'types' } })
|
|
888
|
+
* // → '/src/types/petTypes.ts'
|
|
889
|
+
* ```
|
|
890
|
+
*
|
|
891
|
+
* @example Tag-based grouping
|
|
892
|
+
* ```ts
|
|
893
|
+
* defaultResolvePath(
|
|
894
|
+
* { baseName: 'petTypes.ts', tag: 'pets' },
|
|
895
|
+
* { root: '/src', output: { path: 'types' }, group: { type: 'tag' } },
|
|
896
|
+
* )
|
|
897
|
+
* // → '/src/types/pets/petTypes.ts'
|
|
898
|
+
* ```
|
|
899
|
+
*
|
|
900
|
+
* @example Path-based grouping
|
|
901
|
+
* ```ts
|
|
902
|
+
* defaultResolvePath(
|
|
903
|
+
* { baseName: 'petTypes.ts', path: '/pets/list' },
|
|
904
|
+
* { root: '/src', output: { path: 'types' }, group: { type: 'path' } },
|
|
905
|
+
* )
|
|
906
|
+
* // → '/src/types/pets/petTypes.ts'
|
|
907
|
+
* ```
|
|
908
|
+
*
|
|
909
|
+
* @example Single file (`mode: 'file'`)
|
|
910
|
+
* ```ts
|
|
911
|
+
* defaultResolvePath(
|
|
912
|
+
* { baseName: 'petTypes.ts' },
|
|
913
|
+
* { root: '/src', output: { path: 'types.ts', mode: 'file' } },
|
|
914
|
+
* )
|
|
915
|
+
* // → '/src/types.ts'
|
|
916
|
+
* ```
|
|
917
|
+
*/
|
|
874
918
|
/**
|
|
875
919
|
* Defines a plugin resolver. The resolver is the object that decides what
|
|
876
920
|
* every generated symbol and file path is called. Built-in defaults handle
|
|
@@ -3022,4 +3066,4 @@ declare class Diagnostics {
|
|
|
3022
3066
|
}
|
|
3023
3067
|
//#endregion
|
|
3024
3068
|
export { Include as $, KubbHookStartContext as A, createReporter as At, ParsedFile as B, KubbFilesProcessingEndContext as C, Storage as Ct, KubbGenerationStartContext as D, ReporterContext as Dt, KubbGenerationEndContext as E, Reporter as Et, KubbSuccessContext as F, Adapter as Ft, Parser as G, createKubb as H, KubbWarnContext as I, AdapterFactoryOptions as It, GeneratorContext as J, defineParser as K, PossibleConfig as L, AdapterSource as Lt, KubbInfoContext as M, Cache as Mt, KubbLifecycleStartContext as N, CachedSnapshot as Nt, KubbHookEndContext as O, ReporterName as Ot, KubbPluginsEndContext as P, createCache as Pt, Group as Q, UserConfig as R, createAdapter as Rt, KubbFileProcessingUpdate as S, createRenderer as St, KubbFilesProcessingUpdateContext as T, GenerationResult as Tt, FsCacheOptions as U, Kubb$1 as V, fsCache as W, KubbDriver as X, defineGenerator as Y, Exclude$1 as Z, InputPath as _, ResolverFileParams as _t, DiagnosticLocation as a, OutputMode as at, KubbDiagnosticContext as b, Renderer as bt, PerformanceDiagnostic as c, Plugin as ct, SerializedDiagnostic as d, BannerMeta as dt, KubbPluginEndContext as et, UpdateDiagnostic as f, ResolveBannerContext as ft, InputData as g, ResolverContext as gt, Config as h, Resolver as ht, DiagnosticKind as i, Output as it, KubbHooks as j, logLevel as jt, KubbHookLineContext as k, UserReporter as kt, ProblemCode as l, PluginFactoryOptions as lt, CLIOptions as m, ResolveOptionsContext as mt, DiagnosticByCode as n, KubbPluginStartContext as nt, DiagnosticSeverity as o, OutputOptions as ot, BuildOutput as p, ResolveBannerFile as pt, Generator$1 as q, DiagnosticDoc as r, NormalizedPlugin as rt, Diagnostics as s, Override as st, Diagnostic as t, KubbPluginSetupContext as tt, ProblemDiagnostic as u, definePlugin as ut, KubbBuildEndContext as v, ResolverPathParams as vt, KubbFilesProcessingStartContext as w, createStorage as wt, KubbErrorContext as x, RendererFactory as xt, KubbBuildStartContext as y, defineResolver as yt, FileProcessorHooks as z, AsyncEventEmitter as zt };
|
|
3025
|
-
//# sourceMappingURL=diagnostics-
|
|
3069
|
+
//# sourceMappingURL=diagnostics-D_LOtOCv.d.ts.map
|