@kubb/core 5.0.0-alpha.30 → 5.0.0-alpha.31
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-D110FoJ-.d.ts → PluginDriver-D0dY_hpJ.d.ts} +400 -46
- package/dist/{chunk-ByKO4r7w.cjs → chunk-MlS0t1Af.cjs} +15 -0
- package/dist/chunk-O_arW02_.js +17 -0
- package/dist/hooks.cjs +1 -1
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.ts +3 -4
- package/dist/hooks.js +1 -1
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +98 -47
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +19 -140
- package/dist/index.js +92 -48
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/Kubb.ts +5 -5
- package/src/KubbFile.ts +143 -0
- package/src/PluginDriver.ts +11 -10
- package/src/build.ts +70 -45
- package/src/constants.ts +2 -2
- package/src/{config.ts → defineConfig.ts} +2 -8
- package/src/defineGenerator.ts +5 -5
- package/src/defineParser.ts +57 -0
- package/src/defineResolver.ts +10 -13
- package/src/hooks/useMode.ts +3 -3
- package/src/index.ts +4 -3
- package/src/renderNode.tsx +4 -4
- package/src/types.ts +85 -35
- package/src/utils/TreeNode.ts +7 -7
- package/src/utils/getBarrelFiles.ts +6 -9
- package/src/utils/getConfigs.ts +1 -1
- package/src/utils/isInputPath.ts +8 -0
- package/dist/chunk--u3MIqq1.js +0 -8
|
@@ -9,6 +9,15 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
9
9
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
10
|
var __getProtoOf = Object.getPrototypeOf;
|
|
11
11
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
+
var __exportAll = (all, no_symbols) => {
|
|
13
|
+
let target = {};
|
|
14
|
+
for (var name in all) __defProp(target, name, {
|
|
15
|
+
get: all[name],
|
|
16
|
+
enumerable: true
|
|
17
|
+
});
|
|
18
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
19
|
+
return target;
|
|
20
|
+
};
|
|
12
21
|
var __copyProps = (to, from, except, desc) => {
|
|
13
22
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
14
23
|
key = keys[i];
|
|
@@ -24,6 +33,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
33
|
enumerable: true
|
|
25
34
|
}) : target, mod));
|
|
26
35
|
//#endregion
|
|
36
|
+
Object.defineProperty(exports, "__exportAll", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function() {
|
|
39
|
+
return __exportAll;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
27
42
|
Object.defineProperty(exports, "__name", {
|
|
28
43
|
enumerable: true,
|
|
29
44
|
get: function() {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __name = (target, value) => __defProp(target, "name", {
|
|
4
|
+
value,
|
|
5
|
+
configurable: true
|
|
6
|
+
});
|
|
7
|
+
var __exportAll = (all, no_symbols) => {
|
|
8
|
+
let target = {};
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
13
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
14
|
+
return target;
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { __name as n, __exportAll as t };
|
package/dist/hooks.cjs
CHANGED
package/dist/hooks.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.cjs","names":[],"sources":["../src/hooks/useDriver.ts","../src/hooks/useMode.ts","../src/hooks/usePlugin.ts"],"sourcesContent":["import { useFabric } from '@kubb/react-fabric'\nimport type { PluginDriver } from '../PluginDriver.ts'\n\n/**\n * @deprecated use `driver` from the generator component props instead\n */\nexport function useDriver(): PluginDriver {\n const { meta } = useFabric<{ driver: PluginDriver }>()\n\n return meta.driver\n}\n","import
|
|
1
|
+
{"version":3,"file":"hooks.cjs","names":[],"sources":["../src/hooks/useDriver.ts","../src/hooks/useMode.ts","../src/hooks/usePlugin.ts"],"sourcesContent":["import { useFabric } from '@kubb/react-fabric'\nimport type { PluginDriver } from '../PluginDriver.ts'\n\n/**\n * @deprecated use `driver` from the generator component props instead\n */\nexport function useDriver(): PluginDriver {\n const { meta } = useFabric<{ driver: PluginDriver }>()\n\n return meta.driver\n}\n","import { useFabric } from '@kubb/react-fabric'\nimport type * as KubbFile from '../KubbFile.ts'\n\n/**\n * @deprecated use `mode` from the generator component props instead\n */\nexport function useMode(): KubbFile.Mode {\n const { meta } = useFabric<{ mode: KubbFile.Mode }>()\n\n return meta.mode\n}\n","import { useFabric } from '@kubb/react-fabric'\nimport type { Plugin, PluginFactoryOptions } from '../types.ts'\n\n/**\n * @deprecated use `plugin` from the generator component props instead\n */\nexport function usePlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions>(): Plugin<TOptions> {\n const { meta } = useFabric<{ plugin: Plugin<TOptions> }>()\n\n return meta.plugin\n}\n"],"mappings":";;;;;;;AAMA,SAAgB,YAA0B;CACxC,MAAM,EAAE,UAAA,GAAA,mBAAA,YAA8C;AAEtD,QAAO,KAAK;;;;;;;ACHd,SAAgB,UAAyB;CACvC,MAAM,EAAE,UAAA,GAAA,mBAAA,YAA6C;AAErD,QAAO,KAAK;;;;;;;ACHd,SAAgB,YAA4F;CAC1G,MAAM,EAAE,UAAA,GAAA,mBAAA,YAAkD;AAE1D,QAAO,KAAK"}
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as Plugin, T as PluginFactoryOptions, t as PluginDriver } from "./PluginDriver-
|
|
3
|
-
import { FabricFile } from "@kubb/fabric-core/types";
|
|
1
|
+
import { n as __name } from "./chunk-O_arW02_.js";
|
|
2
|
+
import { C as Plugin, T as PluginFactoryOptions, t as PluginDriver, vt as Mode } from "./PluginDriver-D0dY_hpJ.js";
|
|
4
3
|
|
|
5
4
|
//#region src/hooks/useDriver.d.ts
|
|
6
5
|
/**
|
|
@@ -12,7 +11,7 @@ declare function useDriver(): PluginDriver;
|
|
|
12
11
|
/**
|
|
13
12
|
* @deprecated use `mode` from the generator component props instead
|
|
14
13
|
*/
|
|
15
|
-
declare function useMode():
|
|
14
|
+
declare function useMode(): Mode;
|
|
16
15
|
//#endregion
|
|
17
16
|
//#region src/hooks/usePlugin.d.ts
|
|
18
17
|
/**
|
package/dist/hooks.js
CHANGED
package/dist/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","names":[],"sources":["../src/hooks/useDriver.ts","../src/hooks/useMode.ts","../src/hooks/usePlugin.ts"],"sourcesContent":["import { useFabric } from '@kubb/react-fabric'\nimport type { PluginDriver } from '../PluginDriver.ts'\n\n/**\n * @deprecated use `driver` from the generator component props instead\n */\nexport function useDriver(): PluginDriver {\n const { meta } = useFabric<{ driver: PluginDriver }>()\n\n return meta.driver\n}\n","import
|
|
1
|
+
{"version":3,"file":"hooks.js","names":[],"sources":["../src/hooks/useDriver.ts","../src/hooks/useMode.ts","../src/hooks/usePlugin.ts"],"sourcesContent":["import { useFabric } from '@kubb/react-fabric'\nimport type { PluginDriver } from '../PluginDriver.ts'\n\n/**\n * @deprecated use `driver` from the generator component props instead\n */\nexport function useDriver(): PluginDriver {\n const { meta } = useFabric<{ driver: PluginDriver }>()\n\n return meta.driver\n}\n","import { useFabric } from '@kubb/react-fabric'\nimport type * as KubbFile from '../KubbFile.ts'\n\n/**\n * @deprecated use `mode` from the generator component props instead\n */\nexport function useMode(): KubbFile.Mode {\n const { meta } = useFabric<{ mode: KubbFile.Mode }>()\n\n return meta.mode\n}\n","import { useFabric } from '@kubb/react-fabric'\nimport type { Plugin, PluginFactoryOptions } from '../types.ts'\n\n/**\n * @deprecated use `plugin` from the generator component props instead\n */\nexport function usePlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions>(): Plugin<TOptions> {\n const { meta } = useFabric<{ plugin: Plugin<TOptions> }>()\n\n return meta.plugin\n}\n"],"mappings":";;;;;;AAMA,SAAgB,YAA0B;CACxC,MAAM,EAAE,SAAS,WAAqC;AAEtD,QAAO,KAAK;;;;;;;ACHd,SAAgB,UAAyB;CACvC,MAAM,EAAE,SAAS,WAAoC;AAErD,QAAO,KAAK;;;;;;;ACHd,SAAgB,YAA4F;CAC1G,MAAM,EAAE,SAAS,WAAyC;AAE1D,QAAO,KAAK"}
|
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_chunk = require("./chunk-
|
|
5
|
+
const require_chunk = require("./chunk-MlS0t1Af.cjs");
|
|
6
6
|
let node_events = require("node:events");
|
|
7
7
|
let node_fs = require("node:fs");
|
|
8
8
|
let node_fs_promises = require("node:fs/promises");
|
|
@@ -10,7 +10,6 @@ let node_path = require("node:path");
|
|
|
10
10
|
node_path = require_chunk.__toESM(node_path);
|
|
11
11
|
let _kubb_ast = require("@kubb/ast");
|
|
12
12
|
let _kubb_react_fabric = require("@kubb/react-fabric");
|
|
13
|
-
let _kubb_react_fabric_parsers = require("@kubb/react-fabric/parsers");
|
|
14
13
|
let _kubb_react_fabric_plugins = require("@kubb/react-fabric/plugins");
|
|
15
14
|
let node_perf_hooks = require("node:perf_hooks");
|
|
16
15
|
let fflate = require("fflate");
|
|
@@ -621,17 +620,6 @@ var URLPath = class {
|
|
|
621
620
|
}
|
|
622
621
|
};
|
|
623
622
|
//#endregion
|
|
624
|
-
//#region src/config.ts
|
|
625
|
-
function defineConfig(config) {
|
|
626
|
-
return config;
|
|
627
|
-
}
|
|
628
|
-
/**
|
|
629
|
-
* Type guard to check if a given config has an `input.path`.
|
|
630
|
-
*/
|
|
631
|
-
function isInputPath(config) {
|
|
632
|
-
return typeof config?.input === "object" && config.input !== null && "path" in config.input;
|
|
633
|
-
}
|
|
634
|
-
//#endregion
|
|
635
623
|
//#region src/constants.ts
|
|
636
624
|
/**
|
|
637
625
|
* Base URL for the Kubb Studio web app.
|
|
@@ -723,6 +711,34 @@ const formatters = {
|
|
|
723
711
|
}
|
|
724
712
|
};
|
|
725
713
|
//#endregion
|
|
714
|
+
//#region src/defineParser.ts
|
|
715
|
+
/**
|
|
716
|
+
* Defines a parser with type safety.
|
|
717
|
+
*
|
|
718
|
+
* Use this function to create parsers that transform generated files to strings
|
|
719
|
+
* based on their extension.
|
|
720
|
+
*
|
|
721
|
+
* @example
|
|
722
|
+
* ```ts
|
|
723
|
+
* import { defineParser } from '@kubb/core'
|
|
724
|
+
*
|
|
725
|
+
* export const jsonParser = defineParser({
|
|
726
|
+
* name: 'json',
|
|
727
|
+
* extNames: ['.json'],
|
|
728
|
+
* parse(file) {
|
|
729
|
+
* return file.sources.map((s) => s.value).join('\n')
|
|
730
|
+
* },
|
|
731
|
+
* })
|
|
732
|
+
* ```
|
|
733
|
+
*/
|
|
734
|
+
function defineParser(parser) {
|
|
735
|
+
return {
|
|
736
|
+
install() {},
|
|
737
|
+
type: "parser",
|
|
738
|
+
...parser
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
//#endregion
|
|
726
742
|
//#region src/devtools.ts
|
|
727
743
|
/**
|
|
728
744
|
* Encodes a `RootNode` as a compressed, URL-safe string.
|
|
@@ -1357,7 +1373,7 @@ var PluginDriver = class {
|
|
|
1357
1373
|
* Handles the return value of a plugin AST hook or generator method.
|
|
1358
1374
|
*
|
|
1359
1375
|
* - React element → rendered via an isolated react-fabric context, files merged into `fabric`
|
|
1360
|
-
* - `Array<
|
|
1376
|
+
* - `Array<KubbFile.File>` → upserted directly into `fabric`
|
|
1361
1377
|
* - `void` / `null` / `undefined` → no-op (plugin handled it via `this.upsertFile`)
|
|
1362
1378
|
*/
|
|
1363
1379
|
async function applyHookResult(result, fabric) {
|
|
@@ -1469,7 +1485,7 @@ const fsStorage = createStorage(() => ({
|
|
|
1469
1485
|
}));
|
|
1470
1486
|
//#endregion
|
|
1471
1487
|
//#region package.json
|
|
1472
|
-
var version = "5.0.0-alpha.
|
|
1488
|
+
var version = "5.0.0-alpha.31";
|
|
1473
1489
|
//#endregion
|
|
1474
1490
|
//#region src/utils/diagnostics.ts
|
|
1475
1491
|
/**
|
|
@@ -1491,7 +1507,7 @@ function getDiagnosticInfo() {
|
|
|
1491
1507
|
//#region src/utils/TreeNode.ts
|
|
1492
1508
|
/**
|
|
1493
1509
|
* Tree structure used to build per-directory barrel (`index.ts`) files from a
|
|
1494
|
-
* flat list of generated {@link
|
|
1510
|
+
* flat list of generated {@link KubbFile.File} entries.
|
|
1495
1511
|
*
|
|
1496
1512
|
* Each node represents either a directory or a file within the output tree.
|
|
1497
1513
|
* Use {@link TreeNode.build} to construct a root node from a file list, then
|
|
@@ -1723,6 +1739,14 @@ async function getBarrelFiles(files, { type, meta = {}, root, output }) {
|
|
|
1723
1739
|
});
|
|
1724
1740
|
}
|
|
1725
1741
|
//#endregion
|
|
1742
|
+
//#region src/utils/isInputPath.ts
|
|
1743
|
+
/**
|
|
1744
|
+
* Type guard to check if a given config has an `input.path`.
|
|
1745
|
+
*/
|
|
1746
|
+
function isInputPath(config) {
|
|
1747
|
+
return typeof config?.input === "object" && config.input !== null && "path" in config.input;
|
|
1748
|
+
}
|
|
1749
|
+
//#endregion
|
|
1726
1750
|
//#region src/build.ts
|
|
1727
1751
|
/**
|
|
1728
1752
|
* Initializes all Kubb infrastructure for a build without executing any plugins.
|
|
@@ -1731,6 +1755,7 @@ async function getBarrelFiles(files, { type, meta = {}, root, output }) {
|
|
|
1731
1755
|
* - Applies config defaults (`root`, `output.*`, `devtools`).
|
|
1732
1756
|
* - Creates the Fabric instance and wires storage, format, and lint hooks.
|
|
1733
1757
|
* - Runs the adapter (if configured) to produce the universal `RootNode`.
|
|
1758
|
+
* When no adapter is supplied and `@kubb/adapter-oas` is installed as an
|
|
1734
1759
|
*
|
|
1735
1760
|
* Pass the returned {@link SetupResult} directly to {@link safeBuild} or {@link build}
|
|
1736
1761
|
* via the `overrides` argument to reuse the same infrastructure across multiple runs.
|
|
@@ -1770,9 +1795,12 @@ async function setup(options) {
|
|
|
1770
1795
|
throw new Error(`Cannot read file/URL defined in \`input.path\` or set with \`kubb generate PATH\` in the CLI of your Kubb config ${userConfig.input.path}`, { cause: error });
|
|
1771
1796
|
}
|
|
1772
1797
|
}
|
|
1773
|
-
|
|
1798
|
+
if (!userConfig.adapter) throw new Error("Adapter should be defined");
|
|
1799
|
+
const config = {
|
|
1774
1800
|
root: userConfig.root || process.cwd(),
|
|
1775
1801
|
...userConfig,
|
|
1802
|
+
parsers: userConfig.parsers ?? [],
|
|
1803
|
+
adapter: userConfig.adapter,
|
|
1776
1804
|
output: {
|
|
1777
1805
|
write: true,
|
|
1778
1806
|
barrelType: "named",
|
|
@@ -1786,17 +1814,24 @@ async function setup(options) {
|
|
|
1786
1814
|
} : void 0,
|
|
1787
1815
|
plugins: userConfig.plugins
|
|
1788
1816
|
};
|
|
1789
|
-
const storage =
|
|
1790
|
-
if (
|
|
1817
|
+
const storage = config.output.write === false ? null : config.output.storage ?? fsStorage();
|
|
1818
|
+
if (config.output.clean) {
|
|
1791
1819
|
await events.emit("debug", {
|
|
1792
1820
|
date: /* @__PURE__ */ new Date(),
|
|
1793
|
-
logs: ["Cleaning output directories", ` • Output: ${
|
|
1821
|
+
logs: ["Cleaning output directories", ` • Output: ${config.output.path}`]
|
|
1794
1822
|
});
|
|
1795
|
-
await storage?.clear((0, node_path.resolve)(
|
|
1823
|
+
await storage?.clear((0, node_path.resolve)(config.root, config.output.path));
|
|
1796
1824
|
}
|
|
1797
1825
|
const fabric = (0, _kubb_react_fabric.createFabric)();
|
|
1798
1826
|
fabric.use(_kubb_react_fabric_plugins.fsPlugin);
|
|
1799
|
-
fabric.use(
|
|
1827
|
+
for (const parser of config.parsers) fabric.use(parser);
|
|
1828
|
+
fabric.use(defineParser({
|
|
1829
|
+
name: "fallback",
|
|
1830
|
+
extNames: void 0,
|
|
1831
|
+
parse(file) {
|
|
1832
|
+
return file.sources.map((item) => item.value).filter((value) => value != null).join("\n\n");
|
|
1833
|
+
}
|
|
1834
|
+
}));
|
|
1800
1835
|
fabric.context.on("files:processing:start", (files) => {
|
|
1801
1836
|
events.emit("files:processing:start", files);
|
|
1802
1837
|
events.emit("debug", {
|
|
@@ -1808,11 +1843,11 @@ async function setup(options) {
|
|
|
1808
1843
|
const { file, source } = params;
|
|
1809
1844
|
await events.emit("file:processing:update", {
|
|
1810
1845
|
...params,
|
|
1811
|
-
config
|
|
1846
|
+
config,
|
|
1812
1847
|
source
|
|
1813
1848
|
});
|
|
1814
1849
|
if (source) {
|
|
1815
|
-
const key = (0, node_path.relative)((0, node_path.resolve)(
|
|
1850
|
+
const key = (0, node_path.relative)((0, node_path.resolve)(config.root), file.path);
|
|
1816
1851
|
await storage?.setItem(key, source);
|
|
1817
1852
|
sources.set(file.path, source);
|
|
1818
1853
|
}
|
|
@@ -1829,35 +1864,36 @@ async function setup(options) {
|
|
|
1829
1864
|
logs: [
|
|
1830
1865
|
"✓ Fabric initialized",
|
|
1831
1866
|
` • Storage: ${storage ? storage.name : "disabled (dry-run)"}`,
|
|
1832
|
-
` • Barrel type: ${
|
|
1867
|
+
` • Barrel type: ${config.output.barrelType || "none"}`
|
|
1833
1868
|
]
|
|
1834
1869
|
});
|
|
1835
|
-
const
|
|
1870
|
+
const driver = new PluginDriver(config, {
|
|
1836
1871
|
fabric,
|
|
1837
1872
|
events,
|
|
1838
1873
|
concurrency: 15
|
|
1839
1874
|
});
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
}
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
}
|
|
1875
|
+
const adapter = config.adapter;
|
|
1876
|
+
if (!adapter) throw new Error("No adapter configured. Please provide an adapter in your kubb.config.ts.");
|
|
1877
|
+
const source = inputToAdapterSource(config);
|
|
1878
|
+
await events.emit("debug", {
|
|
1879
|
+
date: /* @__PURE__ */ new Date(),
|
|
1880
|
+
logs: [`Running adapter: ${adapter.name}`]
|
|
1881
|
+
});
|
|
1882
|
+
driver.adapter = adapter;
|
|
1883
|
+
driver.rootNode = await adapter.parse(source);
|
|
1884
|
+
await events.emit("debug", {
|
|
1885
|
+
date: /* @__PURE__ */ new Date(),
|
|
1886
|
+
logs: [
|
|
1887
|
+
`✓ Adapter '${adapter.name}' resolved RootNode`,
|
|
1888
|
+
` • Schemas: ${driver.rootNode.schemas.length}`,
|
|
1889
|
+
` • Operations: ${driver.rootNode.operations.length}`
|
|
1890
|
+
]
|
|
1891
|
+
});
|
|
1857
1892
|
return {
|
|
1893
|
+
config,
|
|
1858
1894
|
events,
|
|
1859
1895
|
fabric,
|
|
1860
|
-
driver
|
|
1896
|
+
driver,
|
|
1861
1897
|
sources
|
|
1862
1898
|
};
|
|
1863
1899
|
}
|
|
@@ -1891,7 +1927,7 @@ async function build(options, overrides) {
|
|
|
1891
1927
|
* - Each hook accepts a single handler **or an array** — all entries are called in sequence.
|
|
1892
1928
|
* - Nodes that are excluded by `exclude`/`include` plugin options are skipped automatically.
|
|
1893
1929
|
* - Return values are handled via `applyHookResult`: React elements are rendered,
|
|
1894
|
-
* `
|
|
1930
|
+
* `KubbFile.File[]` are written via upsert, and `void` is a no-op (manual handling).
|
|
1895
1931
|
* - Barrel files are generated automatically when `output.barrelType` is set.
|
|
1896
1932
|
*/
|
|
1897
1933
|
async function runPluginAstHooks(plugin, context) {
|
|
@@ -2154,6 +2190,11 @@ function createPlugin(build) {
|
|
|
2154
2190
|
return (options) => build(options ?? {});
|
|
2155
2191
|
}
|
|
2156
2192
|
//#endregion
|
|
2193
|
+
//#region src/defineConfig.ts
|
|
2194
|
+
function defineConfig(config) {
|
|
2195
|
+
return config;
|
|
2196
|
+
}
|
|
2197
|
+
//#endregion
|
|
2157
2198
|
//#region src/defineGenerator.ts
|
|
2158
2199
|
/**
|
|
2159
2200
|
* Defines a generator. Returns the object as-is with correct `this` typings.
|
|
@@ -2379,7 +2420,7 @@ function defaultResolvePath({ baseName, pathMode, tag, path: groupPath }, { root
|
|
|
2379
2420
|
/**
|
|
2380
2421
|
* Default file resolver used by `defineResolver`.
|
|
2381
2422
|
*
|
|
2382
|
-
* Resolves a `
|
|
2423
|
+
* Resolves a `KubbFile.File` by combining name resolution (`resolver.default`) with
|
|
2383
2424
|
* path resolution (`resolver.resolvePath`). The resolved file always has empty
|
|
2384
2425
|
* `sources`, `imports`, and `exports` arrays — consumers populate those separately.
|
|
2385
2426
|
*
|
|
@@ -2529,7 +2570,7 @@ function defaultResolveFooter(node, { output }) {
|
|
|
2529
2570
|
* - `default` — name casing strategy (camelCase / PascalCase)
|
|
2530
2571
|
* - `resolveOptions` — include/exclude/override filtering
|
|
2531
2572
|
* - `resolvePath` — output path computation
|
|
2532
|
-
* - `resolveFile` — full `
|
|
2573
|
+
* - `resolveFile` — full `KubbFile.File` construction
|
|
2533
2574
|
*
|
|
2534
2575
|
* Methods in the builder have access to `this` (the full resolver object), so they
|
|
2535
2576
|
* can call other resolver methods without circular imports.
|
|
@@ -2579,6 +2620,9 @@ function defineResolver(build) {
|
|
|
2579
2620
|
};
|
|
2580
2621
|
}
|
|
2581
2622
|
//#endregion
|
|
2623
|
+
//#region src/KubbFile.ts
|
|
2624
|
+
var KubbFile_exports = /* @__PURE__ */ require_chunk.__exportAll({});
|
|
2625
|
+
//#endregion
|
|
2582
2626
|
//#region src/storages/memoryStorage.ts
|
|
2583
2627
|
/**
|
|
2584
2628
|
* In-memory storage driver. Useful for testing and dry-run scenarios where
|
|
@@ -2883,6 +2927,12 @@ function satisfiesDependency(dependency, version, cwd) {
|
|
|
2883
2927
|
//#endregion
|
|
2884
2928
|
exports.AsyncEventEmitter = AsyncEventEmitter;
|
|
2885
2929
|
exports.FunctionParams = FunctionParams;
|
|
2930
|
+
Object.defineProperty(exports, "KubbFile", {
|
|
2931
|
+
enumerable: true,
|
|
2932
|
+
get: function() {
|
|
2933
|
+
return KubbFile_exports;
|
|
2934
|
+
}
|
|
2935
|
+
});
|
|
2886
2936
|
exports.PluginDriver = PluginDriver;
|
|
2887
2937
|
exports.URLPath = URLPath;
|
|
2888
2938
|
exports.build = build;
|
|
@@ -2905,6 +2955,7 @@ exports.defaultResolvePath = defaultResolvePath;
|
|
|
2905
2955
|
exports.defineConfig = defineConfig;
|
|
2906
2956
|
exports.defineGenerator = defineGenerator;
|
|
2907
2957
|
exports.defineLogger = defineLogger;
|
|
2958
|
+
exports.defineParser = defineParser;
|
|
2908
2959
|
exports.definePresets = definePresets;
|
|
2909
2960
|
Object.defineProperty(exports, "definePrinter", {
|
|
2910
2961
|
enumerable: true,
|