@kubb/core 5.0.0-alpha.12 → 5.0.0-alpha.14
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/{PluginDriver-BkFepPdm.d.ts → PluginDriver-By5lhDKP.d.ts} +2 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/index.cjs +14 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +13 -4
- package/dist/index.js +14 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/defineResolver.ts +4 -4
- package/src/index.ts +1 -0
- package/src/types.ts +1 -0
- package/src/utils/executeStrategies.ts +7 -7
- package/src/utils/mergeResolvers.ts +8 -0
|
@@ -693,6 +693,7 @@ type ResolveOptionsContext<TOptions> = {
|
|
|
693
693
|
* Concrete plugin resolver types extend this with their own helper methods.
|
|
694
694
|
*/
|
|
695
695
|
type Resolver = {
|
|
696
|
+
name: string;
|
|
696
697
|
default(name: ResolveNameParams['name'], type?: ResolveNameParams['type']): string;
|
|
697
698
|
resolveOptions<TOptions>(node: Node, context: ResolveOptionsContext<TOptions>): TOptions | null;
|
|
698
699
|
};
|
|
@@ -1051,4 +1052,4 @@ declare class PluginDriver {
|
|
|
1051
1052
|
}
|
|
1052
1053
|
//#endregion
|
|
1053
1054
|
export { UserConfig as A, Storage as B, PluginWithLifeCycle as C, ResolveOptionsContext as D, ResolveNameParams as E, CoreGeneratorV2 as F, AsyncEventEmitter as G, formatters as H, Generator as I, ReactGeneratorV2 as L, UserPlugin as M, UserPluginWithLifeCycle as N, ResolvePathParams as O, UserResolver as P, defineGenerator as R, PluginParameter as S, PrinterFactoryOptions as T, linters as U, createStorage as V, logLevel as W, Plugin as _, AdapterFactoryOptions as a, PluginLifecycle as b, Config as c, InputData as d, InputPath as f, Output as g, LoggerOptions as h, Adapter as i, UserLogger as j, Resolver as k, DevtoolsOptions as l, LoggerContext as m, PluginDriver as n, AdapterSource as o, Logger as p, getMode as r, BarrelType as s, GetFileOptions as t, Group as u, PluginContext as v, Printer as w, PluginLifecycleHooks as x, PluginFactoryOptions as y, KubbEvents as z };
|
|
1054
|
-
//# sourceMappingURL=PluginDriver-
|
|
1055
|
+
//# sourceMappingURL=PluginDriver-By5lhDKP.d.ts.map
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __name } from "./chunk--u3MIqq1.js";
|
|
2
|
-
import { E as ResolveNameParams, O as ResolvePathParams, _ as Plugin, c as Config, n as PluginDriver, t as GetFileOptions, y as PluginFactoryOptions } from "./PluginDriver-
|
|
2
|
+
import { E as ResolveNameParams, O as ResolvePathParams, _ as Plugin, c as Config, n as PluginDriver, t as GetFileOptions, y as PluginFactoryOptions } from "./PluginDriver-By5lhDKP.js";
|
|
3
3
|
import { RootNode } from "@kubb/ast/types";
|
|
4
4
|
import { KubbFile } from "@kubb/fabric-core/types";
|
|
5
5
|
|
package/dist/index.cjs
CHANGED
|
@@ -1447,7 +1447,7 @@ const fsStorage = createStorage(() => ({
|
|
|
1447
1447
|
}));
|
|
1448
1448
|
//#endregion
|
|
1449
1449
|
//#region package.json
|
|
1450
|
-
var version = "5.0.0-alpha.
|
|
1450
|
+
var version = "5.0.0-alpha.14";
|
|
1451
1451
|
//#endregion
|
|
1452
1452
|
//#region src/utils/diagnostics.ts
|
|
1453
1453
|
/**
|
|
@@ -1918,6 +1918,7 @@ function defaultResolveOptions(node, { options, exclude = [], include, override
|
|
|
1918
1918
|
*
|
|
1919
1919
|
* @example
|
|
1920
1920
|
* export const resolver = defineResolver<PluginTs>(() => ({
|
|
1921
|
+
* name: 'default',
|
|
1921
1922
|
* resolveName(name) {
|
|
1922
1923
|
* return this.default(name, 'function')
|
|
1923
1924
|
* },
|
|
@@ -2392,6 +2393,17 @@ async function detectLinter() {
|
|
|
2392
2393
|
for (const linter of linterNames) if (await isLinterAvailable(linter)) return linter;
|
|
2393
2394
|
}
|
|
2394
2395
|
//#endregion
|
|
2396
|
+
//#region src/utils/mergeResolvers.ts
|
|
2397
|
+
/**
|
|
2398
|
+
* Merges an array of resolvers into a single resolver. Later entries override earlier ones (last wins).
|
|
2399
|
+
*/
|
|
2400
|
+
function mergeResolvers(...resolvers) {
|
|
2401
|
+
return resolvers.reduce((acc, curr) => ({
|
|
2402
|
+
...acc,
|
|
2403
|
+
...curr
|
|
2404
|
+
}), resolvers[0]);
|
|
2405
|
+
}
|
|
2406
|
+
//#endregion
|
|
2395
2407
|
//#region src/utils/packageJSON.ts
|
|
2396
2408
|
function getPackageJSONSync(cwd) {
|
|
2397
2409
|
const pkgPath = empathic_package.up({ cwd });
|
|
@@ -2449,6 +2461,7 @@ exports.isInputPath = isInputPath;
|
|
|
2449
2461
|
exports.linters = linters;
|
|
2450
2462
|
exports.logLevel = logLevel;
|
|
2451
2463
|
exports.memoryStorage = memoryStorage;
|
|
2464
|
+
exports.mergeResolvers = mergeResolvers;
|
|
2452
2465
|
exports.renderOperation = renderOperation;
|
|
2453
2466
|
exports.renderOperations = renderOperations;
|
|
2454
2467
|
exports.renderSchema = renderSchema;
|