@kubb/core 5.0.0-alpha.3 → 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-D0dY_hpJ.d.ts +1986 -0
- package/dist/{chunk-ByKO4r7w.cjs → chunk-MlS0t1Af.cjs} +15 -0
- package/dist/chunk-O_arW02_.js +17 -0
- package/dist/hooks.cjs +13 -28
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.ts +11 -37
- package/dist/hooks.js +14 -28
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +1469 -831
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +572 -191
- package/dist/index.js +1443 -826
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/Kubb.ts +38 -56
- package/src/KubbFile.ts +143 -0
- package/src/{PluginManager.ts → PluginDriver.ts} +159 -170
- package/src/build.ts +213 -65
- package/src/constants.ts +39 -6
- package/src/createAdapter.ts +25 -0
- package/src/createPlugin.ts +30 -0
- package/src/createStorage.ts +58 -0
- package/src/{config.ts → defineConfig.ts} +11 -16
- package/src/defineGenerator.ts +126 -0
- package/src/defineLogger.ts +13 -3
- package/src/defineParser.ts +57 -0
- package/src/definePresets.ts +16 -0
- package/src/defineResolver.ts +454 -0
- package/src/hooks/index.ts +1 -6
- package/src/hooks/useDriver.ts +11 -0
- package/src/hooks/useMode.ts +4 -4
- package/src/hooks/usePlugin.ts +3 -3
- package/src/index.ts +22 -10
- package/src/renderNode.tsx +25 -0
- package/src/storages/fsStorage.ts +2 -2
- package/src/storages/memoryStorage.ts +2 -2
- package/src/types.ts +639 -52
- package/src/utils/FunctionParams.ts +2 -2
- package/src/utils/TreeNode.ts +40 -2
- package/src/utils/diagnostics.ts +4 -1
- package/src/utils/executeStrategies.ts +29 -10
- package/src/utils/formatters.ts +10 -21
- package/src/utils/getBarrelFiles.ts +80 -10
- package/src/utils/getConfigs.ts +9 -23
- package/src/utils/getPreset.ts +78 -0
- package/src/utils/isInputPath.ts +8 -0
- package/src/utils/linters.ts +23 -3
- package/src/utils/packageJSON.ts +76 -0
- package/dist/chunk--u3MIqq1.js +0 -8
- package/dist/types-CiPWLv-5.d.ts +0 -1001
- package/src/BarrelManager.ts +0 -74
- package/src/PackageManager.ts +0 -180
- package/src/PromiseManager.ts +0 -40
- package/src/defineAdapter.ts +0 -22
- package/src/definePlugin.ts +0 -12
- package/src/defineStorage.ts +0 -56
- package/src/errors.ts +0 -1
- package/src/hooks/useKubb.ts +0 -22
- package/src/hooks/usePluginManager.ts +0 -11
- package/src/utils/getPlugins.ts +0 -23
|
@@ -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
|
@@ -1,50 +1,35 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("./chunk-
|
|
2
|
+
require("./chunk-MlS0t1Af.cjs");
|
|
3
3
|
let _kubb_react_fabric = require("@kubb/react-fabric");
|
|
4
|
-
//#region src/hooks/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
getPluginByName: meta.pluginManager.getPluginByName.bind(meta.pluginManager),
|
|
12
|
-
getFile: meta.pluginManager.getFile.bind(meta.pluginManager),
|
|
13
|
-
resolveName: meta.pluginManager.resolveName.bind(meta.pluginManager),
|
|
14
|
-
resolvePath: meta.pluginManager.resolvePath.bind(meta.pluginManager)
|
|
15
|
-
};
|
|
4
|
+
//#region src/hooks/useDriver.ts
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated use `driver` from the generator component props instead
|
|
7
|
+
*/
|
|
8
|
+
function useDriver() {
|
|
9
|
+
const { meta } = (0, _kubb_react_fabric.useFabric)();
|
|
10
|
+
return meta.driver;
|
|
16
11
|
}
|
|
17
12
|
//#endregion
|
|
18
13
|
//#region src/hooks/useMode.ts
|
|
19
14
|
/**
|
|
20
|
-
* @deprecated use `
|
|
15
|
+
* @deprecated use `mode` from the generator component props instead
|
|
21
16
|
*/
|
|
22
17
|
function useMode() {
|
|
23
|
-
const { meta } = (0, _kubb_react_fabric.
|
|
18
|
+
const { meta } = (0, _kubb_react_fabric.useFabric)();
|
|
24
19
|
return meta.mode;
|
|
25
20
|
}
|
|
26
21
|
//#endregion
|
|
27
22
|
//#region src/hooks/usePlugin.ts
|
|
28
23
|
/**
|
|
29
|
-
* @deprecated use
|
|
24
|
+
* @deprecated use `plugin` from the generator component props instead
|
|
30
25
|
*/
|
|
31
26
|
function usePlugin() {
|
|
32
|
-
const { meta } = (0, _kubb_react_fabric.
|
|
27
|
+
const { meta } = (0, _kubb_react_fabric.useFabric)();
|
|
33
28
|
return meta.plugin;
|
|
34
29
|
}
|
|
35
30
|
//#endregion
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* @deprecated use `useKubb` instead
|
|
39
|
-
*/
|
|
40
|
-
function usePluginManager() {
|
|
41
|
-
const { meta } = (0, _kubb_react_fabric.useApp)();
|
|
42
|
-
return meta.pluginManager;
|
|
43
|
-
}
|
|
44
|
-
//#endregion
|
|
45
|
-
exports.useKubb = useKubb;
|
|
31
|
+
exports.useDriver = useDriver;
|
|
46
32
|
exports.useMode = useMode;
|
|
47
33
|
exports.usePlugin = usePlugin;
|
|
48
|
-
exports.usePluginManager = usePluginManager;
|
|
49
34
|
|
|
50
35
|
//# sourceMappingURL=hooks.cjs.map
|
package/dist/hooks.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.cjs","names":[],"sources":["../src/hooks/
|
|
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,49 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { KubbFile } 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
|
-
//#region src/hooks/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
getPluginByName: (pluginName: string) => Plugin | undefined;
|
|
11
|
-
getFile: <TOptions_1 = object>({
|
|
12
|
-
name,
|
|
13
|
-
mode,
|
|
14
|
-
extname,
|
|
15
|
-
pluginName,
|
|
16
|
-
options
|
|
17
|
-
}: {
|
|
18
|
-
name: string;
|
|
19
|
-
mode?: KubbFile.Mode;
|
|
20
|
-
extname: KubbFile.Extname;
|
|
21
|
-
pluginName: string;
|
|
22
|
-
options?: TOptions_1 | undefined;
|
|
23
|
-
}) => KubbFile.File<{
|
|
24
|
-
pluginName: string;
|
|
25
|
-
}>;
|
|
26
|
-
resolveName: (params: ResolveNameParams) => string;
|
|
27
|
-
resolvePath: <TOptions_1 = object>(params: ResolvePathParams<TOptions_1>) => KubbFile.Path;
|
|
28
|
-
};
|
|
4
|
+
//#region src/hooks/useDriver.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated use `driver` from the generator component props instead
|
|
7
|
+
*/
|
|
8
|
+
declare function useDriver(): PluginDriver;
|
|
29
9
|
//#endregion
|
|
30
10
|
//#region src/hooks/useMode.d.ts
|
|
31
11
|
/**
|
|
32
|
-
* @deprecated use `
|
|
12
|
+
* @deprecated use `mode` from the generator component props instead
|
|
33
13
|
*/
|
|
34
|
-
declare function useMode():
|
|
14
|
+
declare function useMode(): Mode;
|
|
35
15
|
//#endregion
|
|
36
16
|
//#region src/hooks/usePlugin.d.ts
|
|
37
17
|
/**
|
|
38
|
-
* @deprecated use
|
|
18
|
+
* @deprecated use `plugin` from the generator component props instead
|
|
39
19
|
*/
|
|
40
20
|
declare function usePlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions>(): Plugin<TOptions>;
|
|
41
21
|
//#endregion
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* @deprecated use `useKubb` instead
|
|
45
|
-
*/
|
|
46
|
-
declare function usePluginManager(): PluginManager;
|
|
47
|
-
//#endregion
|
|
48
|
-
export { useKubb, useMode, usePlugin, usePluginManager };
|
|
22
|
+
export { useDriver, useMode, usePlugin };
|
|
49
23
|
//# sourceMappingURL=hooks.d.ts.map
|
package/dist/hooks.js
CHANGED
|
@@ -1,46 +1,32 @@
|
|
|
1
|
-
import "./chunk
|
|
2
|
-
import {
|
|
3
|
-
//#region src/hooks/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
getPluginByName: meta.pluginManager.getPluginByName.bind(meta.pluginManager),
|
|
11
|
-
getFile: meta.pluginManager.getFile.bind(meta.pluginManager),
|
|
12
|
-
resolveName: meta.pluginManager.resolveName.bind(meta.pluginManager),
|
|
13
|
-
resolvePath: meta.pluginManager.resolvePath.bind(meta.pluginManager)
|
|
14
|
-
};
|
|
1
|
+
import "./chunk-O_arW02_.js";
|
|
2
|
+
import { useFabric } from "@kubb/react-fabric";
|
|
3
|
+
//#region src/hooks/useDriver.ts
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated use `driver` from the generator component props instead
|
|
6
|
+
*/
|
|
7
|
+
function useDriver() {
|
|
8
|
+
const { meta } = useFabric();
|
|
9
|
+
return meta.driver;
|
|
15
10
|
}
|
|
16
11
|
//#endregion
|
|
17
12
|
//#region src/hooks/useMode.ts
|
|
18
13
|
/**
|
|
19
|
-
* @deprecated use `
|
|
14
|
+
* @deprecated use `mode` from the generator component props instead
|
|
20
15
|
*/
|
|
21
16
|
function useMode() {
|
|
22
|
-
const { meta } =
|
|
17
|
+
const { meta } = useFabric();
|
|
23
18
|
return meta.mode;
|
|
24
19
|
}
|
|
25
20
|
//#endregion
|
|
26
21
|
//#region src/hooks/usePlugin.ts
|
|
27
22
|
/**
|
|
28
|
-
* @deprecated use
|
|
23
|
+
* @deprecated use `plugin` from the generator component props instead
|
|
29
24
|
*/
|
|
30
25
|
function usePlugin() {
|
|
31
|
-
const { meta } =
|
|
26
|
+
const { meta } = useFabric();
|
|
32
27
|
return meta.plugin;
|
|
33
28
|
}
|
|
34
29
|
//#endregion
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* @deprecated use `useKubb` instead
|
|
38
|
-
*/
|
|
39
|
-
function usePluginManager() {
|
|
40
|
-
const { meta } = useApp();
|
|
41
|
-
return meta.pluginManager;
|
|
42
|
-
}
|
|
43
|
-
//#endregion
|
|
44
|
-
export { useKubb, useMode, usePlugin, usePluginManager };
|
|
30
|
+
export { useDriver, useMode, usePlugin };
|
|
45
31
|
|
|
46
32
|
//# sourceMappingURL=hooks.js.map
|
package/dist/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","names":[
|
|
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"}
|