@kubb/core 4.36.0 → 5.0.0-alpha.1
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/hooks.d.ts +1 -1
- package/dist/index.cjs +2 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{types-D-MpaA4Z.d.ts → types-D30QAz2y.d.ts} +71 -2
- package/package.json +3 -3
- package/src/index.ts +1 -1
package/dist/hooks.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __name } from "./chunk--u3MIqq1.js";
|
|
2
|
-
import { N as PluginManager, _ as PluginFactoryOptions, h as Plugin } from "./types-
|
|
2
|
+
import { N as PluginManager, _ as PluginFactoryOptions, h as Plugin } from "./types-D30QAz2y.js";
|
|
3
3
|
import { KubbFile } from "@kubb/fabric-core/types";
|
|
4
4
|
|
|
5
5
|
//#region src/hooks/useMode.d.ts
|
package/dist/index.cjs
CHANGED
|
@@ -1469,7 +1469,7 @@ const fsStorage = defineStorage(() => ({
|
|
|
1469
1469
|
}));
|
|
1470
1470
|
//#endregion
|
|
1471
1471
|
//#region package.json
|
|
1472
|
-
var version = "
|
|
1472
|
+
var version = "5.0.0-alpha.1";
|
|
1473
1473
|
//#endregion
|
|
1474
1474
|
//#region src/utils/diagnostics.ts
|
|
1475
1475
|
/**
|
|
@@ -2319,6 +2319,7 @@ exports.FunctionParams = FunctionParams;
|
|
|
2319
2319
|
exports.PackageManager = PackageManager;
|
|
2320
2320
|
exports.PluginManager = PluginManager;
|
|
2321
2321
|
exports.PromiseManager = PromiseManager;
|
|
2322
|
+
exports.URLPath = URLPath;
|
|
2322
2323
|
exports.build = build;
|
|
2323
2324
|
exports.default = build;
|
|
2324
2325
|
exports.defineAdapter = defineAdapter;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __name } from "./chunk--u3MIqq1.js";
|
|
2
|
-
import { A as UserPlugin, B as AsyncEventEmitter, C as Printer, D as UnknownUserPlugin, E as ResolvePathParams, F as DefineStorage, I as defineStorage, L as formatters, M as KubbEvents, N as PluginManager, O as UserConfig, P as getMode, R as linters, S as PluginWithLifeCycle, T as ResolveNameParams, _ as PluginFactoryOptions, a as Config, b as PluginLifecycleHooks, c as Group, d as Logger, f as LoggerContext, g as PluginContext, h as Plugin, i as BarrelType, j as UserPluginWithLifeCycle, k as UserLogger, l as InputData, m as Output, n as AdapterFactoryOptions, o as DevtoolsOptions, p as LoggerOptions, r as AdapterSource, s as GetPluginFactoryOptions, t as Adapter, u as InputPath, v as PluginKey, w as PrinterFactoryOptions, x as PluginParameter, y as PluginLifecycle, z as logLevel } from "./types-
|
|
2
|
+
import { A as UserPlugin, B as AsyncEventEmitter, C as Printer, D as UnknownUserPlugin, E as ResolvePathParams, F as DefineStorage, I as defineStorage, L as formatters, M as KubbEvents, N as PluginManager, O as UserConfig, P as getMode, R as linters, S as PluginWithLifeCycle, T as ResolveNameParams, V as URLPath, _ as PluginFactoryOptions, a as Config, b as PluginLifecycleHooks, c as Group, d as Logger, f as LoggerContext, g as PluginContext, h as Plugin, i as BarrelType, j as UserPluginWithLifeCycle, k as UserLogger, l as InputData, m as Output, n as AdapterFactoryOptions, o as DevtoolsOptions, p as LoggerOptions, r as AdapterSource, s as GetPluginFactoryOptions, t as Adapter, u as InputPath, v as PluginKey, w as PrinterFactoryOptions, x as PluginParameter, y as PluginLifecycle, z as logLevel } from "./types-D30QAz2y.js";
|
|
3
3
|
import { definePrinter } from "@kubb/ast";
|
|
4
4
|
import { Fabric } from "@kubb/react-fabric";
|
|
5
5
|
import { KubbFile } from "@kubb/fabric-core/types";
|
|
@@ -311,5 +311,5 @@ declare function getConfigs(config: ConfigInput | UserConfig, args: CLIOptions):
|
|
|
311
311
|
type Linter = keyof typeof linters;
|
|
312
312
|
declare function detectLinter(): Promise<Linter | undefined>;
|
|
313
313
|
//#endregion
|
|
314
|
-
export { Adapter, AdapterFactoryOptions, AdapterSource, AsyncEventEmitter, BarrelType, type CLIOptions, Config, type ConfigInput, DefineStorage, DevtoolsOptions, type FileMetaBase, FunctionParams, type FunctionParamsAST, GetPluginFactoryOptions, Group, InputData, InputPath, KubbEvents, Logger, LoggerContext, LoggerOptions, Output, PackageManager, Plugin, PluginContext, PluginFactoryOptions, PluginKey, PluginLifecycle, PluginLifecycleHooks, PluginManager, PluginParameter, PluginWithLifeCycle, Printer, PrinterFactoryOptions, PromiseManager, ResolveNameParams, ResolvePathParams, UnknownUserPlugin, UserConfig, UserLogger, UserPlugin, UserPluginWithLifeCycle, build, build as default, defineAdapter, defineConfig, defineLogger, definePlugin, definePrinter, defineStorage, detectFormatter, detectLinter, formatters, fsStorage, getBarrelFiles, getConfigs, getMode, isInputPath, linters, logLevel, memoryStorage, safeBuild, setup };
|
|
314
|
+
export { Adapter, AdapterFactoryOptions, AdapterSource, AsyncEventEmitter, BarrelType, type CLIOptions, Config, type ConfigInput, DefineStorage, DevtoolsOptions, type FileMetaBase, FunctionParams, type FunctionParamsAST, GetPluginFactoryOptions, Group, InputData, InputPath, KubbEvents, Logger, LoggerContext, LoggerOptions, Output, PackageManager, Plugin, PluginContext, PluginFactoryOptions, PluginKey, PluginLifecycle, PluginLifecycleHooks, PluginManager, PluginParameter, PluginWithLifeCycle, Printer, PrinterFactoryOptions, PromiseManager, ResolveNameParams, ResolvePathParams, URLPath, UnknownUserPlugin, UserConfig, UserLogger, UserPlugin, UserPluginWithLifeCycle, build, build as default, defineAdapter, defineConfig, defineLogger, definePlugin, definePrinter, defineStorage, detectFormatter, detectLinter, formatters, fsStorage, getBarrelFiles, getConfigs, getMode, isInputPath, linters, logLevel, memoryStorage, safeBuild, setup };
|
|
315
315
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1461,7 +1461,7 @@ const fsStorage = defineStorage(() => ({
|
|
|
1461
1461
|
}));
|
|
1462
1462
|
//#endregion
|
|
1463
1463
|
//#region package.json
|
|
1464
|
-
var version$1 = "
|
|
1464
|
+
var version$1 = "5.0.0-alpha.1";
|
|
1465
1465
|
//#endregion
|
|
1466
1466
|
//#region src/utils/diagnostics.ts
|
|
1467
1467
|
/**
|
|
@@ -2306,6 +2306,6 @@ async function detectLinter() {
|
|
|
2306
2306
|
]) if (await isLinterAvailable(linter)) return linter;
|
|
2307
2307
|
}
|
|
2308
2308
|
//#endregion
|
|
2309
|
-
export { AsyncEventEmitter, FunctionParams, PackageManager, PluginManager, PromiseManager, build, build as default, defineAdapter, defineConfig, defineLogger, definePlugin, definePrinter, defineStorage, detectFormatter, detectLinter, formatters, fsStorage, getBarrelFiles, getConfigs, getMode, isInputPath, linters, logLevel, memoryStorage, safeBuild, setup };
|
|
2309
|
+
export { AsyncEventEmitter, FunctionParams, PackageManager, PluginManager, PromiseManager, URLPath, build, build as default, defineAdapter, defineConfig, defineLogger, definePlugin, definePrinter, defineStorage, detectFormatter, detectLinter, formatters, fsStorage, getBarrelFiles, getConfigs, getMode, isInputPath, linters, logLevel, memoryStorage, safeBuild, setup };
|
|
2310
2310
|
|
|
2311
2311
|
//# sourceMappingURL=index.js.map
|
|
@@ -23,6 +23,75 @@ declare var AsyncEventEmitter: {
|
|
|
23
23
|
removeAll(): void;
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* Parses and transforms an OpenAPI/Swagger path string into various URL formats.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* const p = new URLPath('/pet/{petId}')
|
|
31
|
+
* p.URL // '/pet/:petId'
|
|
32
|
+
* p.template // '`/pet/${petId}`'
|
|
33
|
+
*/
|
|
34
|
+
declare var URLPath: {
|
|
35
|
+
new (path: any, options?: {}): {
|
|
36
|
+
/** The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`. */path: any;
|
|
37
|
+
"__#private@#options": {}; /** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`. */
|
|
38
|
+
get URL(): any; /** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`). */
|
|
39
|
+
get isURL(): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Converts the OpenAPI path to a TypeScript template literal string.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* new URLPath('/pet/{petId}').template // '`/pet/${petId}`'
|
|
45
|
+
* new URLPath('/account/monetary-accountID').template // '`/account/${monetaryAccountId}`'
|
|
46
|
+
*/
|
|
47
|
+
get template(): string; /** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set. */
|
|
48
|
+
get object(): string | {
|
|
49
|
+
url: any;
|
|
50
|
+
params: {} | undefined;
|
|
51
|
+
}; /** Returns a map of path parameter names, or `undefined` when the path has no parameters. */
|
|
52
|
+
get params(): {} | undefined;
|
|
53
|
+
"__#private@#transformParam"(raw: any): any; /** Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name. */
|
|
54
|
+
"__#private@#eachParam"(fn: any): void;
|
|
55
|
+
toObject({
|
|
56
|
+
type,
|
|
57
|
+
replacer,
|
|
58
|
+
stringify
|
|
59
|
+
}?: {
|
|
60
|
+
type?: string | undefined;
|
|
61
|
+
}): string | {
|
|
62
|
+
url: any;
|
|
63
|
+
params: {} | undefined;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Converts the OpenAPI path to a TypeScript template literal string.
|
|
67
|
+
* An optional `replacer` can transform each extracted parameter name before interpolation.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* new URLPath('/pet/{petId}').toTemplateString() // '`/pet/${petId}`'
|
|
71
|
+
*/
|
|
72
|
+
toTemplateString({
|
|
73
|
+
prefix,
|
|
74
|
+
replacer
|
|
75
|
+
}?: {
|
|
76
|
+
prefix?: string | undefined;
|
|
77
|
+
}): string;
|
|
78
|
+
/**
|
|
79
|
+
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
80
|
+
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
81
|
+
* Returns `undefined` when no path parameters are found.
|
|
82
|
+
*/
|
|
83
|
+
getParams(replacer: any): {} | undefined; /** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`. */
|
|
84
|
+
toURLPath(): any;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Serializes a primitive value to a JSON string literal, stripping any surrounding quote characters first.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* stringify('hello') // '"hello"'
|
|
92
|
+
* stringify('"hello"') // '"hello"'
|
|
93
|
+
*/
|
|
94
|
+
declare function stringify(value: any): string;
|
|
26
95
|
//#endregion
|
|
27
96
|
//#region src/constants.d.ts
|
|
28
97
|
declare const DEFAULT_STUDIO_URL: "https://studio.kubb.dev";
|
|
@@ -918,5 +987,5 @@ type Logger<TOptions extends LoggerOptions = LoggerOptions> = {
|
|
|
918
987
|
};
|
|
919
988
|
type UserLogger<TOptions extends LoggerOptions = LoggerOptions> = Omit<Logger<TOptions>, 'logLevel'>;
|
|
920
989
|
//#endregion
|
|
921
|
-
export { UserPlugin as A, AsyncEventEmitter as B, Printer as C, UnknownUserPlugin as D, ResolvePathParams as E, DefineStorage as F, defineStorage as I, formatters as L, KubbEvents as M, PluginManager as N, UserConfig as O, getMode as P, linters as R, PluginWithLifeCycle as S, ResolveNameParams as T, PluginFactoryOptions as _, Config as a, PluginLifecycleHooks as b, Group as c, Logger as d, LoggerContext as f, PluginContext as g, Plugin as h, BarrelType as i, UserPluginWithLifeCycle as j, UserLogger as k, InputData as l, Output as m, AdapterFactoryOptions as n, DevtoolsOptions as o, LoggerOptions as p, AdapterSource as r, GetPluginFactoryOptions as s, Adapter as t, InputPath as u, PluginKey as v, PrinterFactoryOptions as w, PluginParameter as x, PluginLifecycle as y, logLevel as z };
|
|
922
|
-
//# sourceMappingURL=types-
|
|
990
|
+
export { UserPlugin as A, AsyncEventEmitter as B, Printer as C, UnknownUserPlugin as D, ResolvePathParams as E, DefineStorage as F, defineStorage as I, formatters as L, KubbEvents as M, PluginManager as N, UserConfig as O, getMode as P, linters as R, PluginWithLifeCycle as S, ResolveNameParams as T, URLPath as V, PluginFactoryOptions as _, Config as a, PluginLifecycleHooks as b, Group as c, Logger as d, LoggerContext as f, PluginContext as g, Plugin as h, BarrelType as i, UserPluginWithLifeCycle as j, UserLogger as k, InputData as l, Output as m, AdapterFactoryOptions as n, DevtoolsOptions as o, LoggerOptions as p, AdapterSource as r, GetPluginFactoryOptions as s, Adapter as t, InputPath as u, PluginKey as v, PrinterFactoryOptions as w, PluginParameter as x, PluginLifecycle as y, logLevel as z };
|
|
991
|
+
//# sourceMappingURL=types-D30QAz2y.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-alpha.1",
|
|
4
4
|
"description": "Core functionality for Kubb's plugin-based code generation system, providing the foundation for transforming OpenAPI specifications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"remeda": "^2.33.6",
|
|
72
72
|
"semver": "^7.7.4",
|
|
73
73
|
"tinyexec": "^1.0.4",
|
|
74
|
-
"@kubb/ast": "
|
|
74
|
+
"@kubb/ast": "5.0.0-alpha.1"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@types/semver": "^7.7.1",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@kubb/react-fabric": "0.13.3"
|
|
84
84
|
},
|
|
85
85
|
"engines": {
|
|
86
|
-
"node": ">=
|
|
86
|
+
"node": ">=22"
|
|
87
87
|
},
|
|
88
88
|
"publishConfig": {
|
|
89
89
|
"access": "public",
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AsyncEventEmitter } from '@internals/utils'
|
|
1
|
+
export { AsyncEventEmitter, URLPath } from '@internals/utils'
|
|
2
2
|
export { definePrinter } from '@kubb/ast'
|
|
3
3
|
export { build, build as default, safeBuild, setup } from './build.ts'
|
|
4
4
|
export { type CLIOptions, type ConfigInput, defineConfig, isInputPath } from './config.ts'
|