@kubb/core 5.0.0-beta.97 → 5.0.0-beta.99
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/index.cjs +20 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +20 -23
- package/dist/index.js.map +1 -1
- package/dist/mocks.cjs +1 -1
- package/dist/mocks.d.ts +1 -1
- package/dist/mocks.js +1 -1
- package/dist/{types-CK6CfipY.d.ts → types-DM7-MGjZ.d.ts} +11 -11
- package/dist/{usingCtx-DOXZGtQx.js → usingCtx-BNggxUEL.js} +2 -2
- package/dist/{usingCtx-DOXZGtQx.js.map → usingCtx-BNggxUEL.js.map} +1 -1
- package/dist/{usingCtx-BLzqdXPG.cjs → usingCtx-CZyLSqds.cjs} +2 -2
- package/dist/{usingCtx-BLzqdXPG.cjs.map → usingCtx-CZyLSqds.cjs.map} +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __name } from "./rolldown-runtime-C0LytTxp.js";
|
|
2
|
-
import { $ as definePlugin, A as Generator, At as DiagnosticSeverity, B as Include, Bt as AdapterSource, C as KubbWarnContext, Ct as UserReporter, D as CreateKubbOptions, Dt as DiagnosticDoc, E as UserConfig, Et as Diagnostic, F as Parser, Ft as SerializedDiagnostic, G as Output, H as KubbPluginSetupContext, I as defineParser, It as UpdateDiagnostic, J as Override, K as OutputMode, L as Exclude, Lt as Hookable, M as defineGenerator, Mt as PerformanceDiagnostic, N as KubbDriver, Nt as ProblemCode, O as Kubb, Ot as DiagnosticKind, P as FileManagerHooks, Pt as ProblemDiagnostic, Q as ResolvePluginOptions, R as Filter, Rt as Adapter, S as KubbSuccessContext, St as ReporterName, T as PostGenerateCommand, Tt as logLevel, U as KubbPluginStartContext, V as KubbPluginEndContext, Vt as createAdapter, W as NormalizedPlugin, X as PluginFactoryOptions, Y as Plugin, Z as PluginName, _ as KubbHookStartContext, _t as Storage, a as KubbBuildEndContext, at as ResolveOptionsContext, b as KubbLifecycleStartContext, bt as Reporter, c as KubbErrorContext, ct as ResolverDefault, d as KubbFilesProcessingStartContext, dt as ResolverFilePathParams, et as BannerMeta, f as KubbFilesProcessingUpdateContext, ft as ResolverPatch, g as KubbHookLineContext, gt as createRenderer, h as KubbHookEndContext, ht as RendererFactory, i as Input, it as ResolveImportsOptions, j as GeneratorContext, jt as Diagnostics, k as createKubb, kt as DiagnosticLocation, l as KubbFileProcessingUpdate, lt as ResolverFile, m as KubbGenerationStartContext, mt as Renderer, n as CLIOptions, nt as ResolveBannerFile, o as KubbBuildStartContext, ot as ResolvePathOptions, p as KubbGenerationEndContext, pt as ResolverPathParams, q as OutputOptions, r as Config, rt as ResolveFileOptions, s as KubbDiagnosticContext, st as Resolver, t as BuildOutput, tt as ResolveBannerContext, u as KubbFilesProcessingEndContext, ut as ResolverFileParams, v as KubbHooks, vt as createStorage, w as PossibleConfig, wt as createReporter, x as KubbPluginsEndContext, xt as ReporterContext, y as KubbInfoContext, yt as GenerationResult, z as Group, zt as AdapterFactoryOptions } from "./types-
|
|
2
|
+
import { $ as definePlugin, A as Generator, At as DiagnosticSeverity, B as Include, Bt as AdapterSource, C as KubbWarnContext, Ct as UserReporter, D as CreateKubbOptions, Dt as DiagnosticDoc, E as UserConfig, Et as Diagnostic, F as Parser, Ft as SerializedDiagnostic, G as Output, H as KubbPluginSetupContext, I as defineParser, It as UpdateDiagnostic, J as Override, K as OutputMode, L as Exclude, Lt as Hookable, M as defineGenerator, Mt as PerformanceDiagnostic, N as KubbDriver, Nt as ProblemCode, O as Kubb, Ot as DiagnosticKind, P as FileManagerHooks, Pt as ProblemDiagnostic, Q as ResolvePluginOptions, R as Filter, Rt as Adapter, S as KubbSuccessContext, St as ReporterName, T as PostGenerateCommand, Tt as logLevel, U as KubbPluginStartContext, V as KubbPluginEndContext, Vt as createAdapter, W as NormalizedPlugin, X as PluginFactoryOptions, Y as Plugin, Z as PluginName, _ as KubbHookStartContext, _t as Storage, a as KubbBuildEndContext, at as ResolveOptionsContext, b as KubbLifecycleStartContext, bt as Reporter, c as KubbErrorContext, ct as ResolverDefault, d as KubbFilesProcessingStartContext, dt as ResolverFilePathParams, et as BannerMeta, f as KubbFilesProcessingUpdateContext, ft as ResolverPatch, g as KubbHookLineContext, gt as createRenderer, h as KubbHookEndContext, ht as RendererFactory, i as Input, it as ResolveImportsOptions, j as GeneratorContext, jt as Diagnostics, k as createKubb, kt as DiagnosticLocation, l as KubbFileProcessingUpdate, lt as ResolverFile, m as KubbGenerationStartContext, mt as Renderer, n as CLIOptions, nt as ResolveBannerFile, o as KubbBuildStartContext, ot as ResolvePathOptions, p as KubbGenerationEndContext, pt as ResolverPathParams, q as OutputOptions, r as Config, rt as ResolveFileOptions, s as KubbDiagnosticContext, st as Resolver, t as BuildOutput, tt as ResolveBannerContext, u as KubbFilesProcessingEndContext, ut as ResolverFileParams, v as KubbHooks, vt as createStorage, w as PossibleConfig, wt as createReporter, x as KubbPluginsEndContext, xt as ReporterContext, y as KubbInfoContext, yt as GenerationResult, z as Group, zt as AdapterFactoryOptions } from "./types-DM7-MGjZ.js";
|
|
3
3
|
//#region src/applyConfigDefaults.d.ts
|
|
4
4
|
type ApplyConfigDefaultsOptions<TOutput> = {
|
|
5
5
|
defaultAdapter: Adapter;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./rolldown-runtime-C0LytTxp.js";
|
|
2
|
-
import { a as isPathInside, c as write, d as toError, f as camelCase, i as clean, l as BuildError, n as FileManager, o as toFilePath, r as Hookable, s as toPosixPath, t as _usingCtx, u as getErrorMessage } from "./usingCtx-
|
|
2
|
+
import { a as isPathInside, c as write, d as toError, f as camelCase, i as clean, l as BuildError, n as FileManager, o as toFilePath, r as Hookable, s as toPosixPath, t as _usingCtx, u as getErrorMessage } from "./usingCtx-BNggxUEL.js";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
import { stripVTControlCharacters, styleText } from "node:util";
|
|
5
5
|
import { hash } from "node:crypto";
|
|
@@ -189,7 +189,7 @@ function memoize(store, factory) {
|
|
|
189
189
|
}
|
|
190
190
|
//#endregion
|
|
191
191
|
//#region package.json
|
|
192
|
-
var version = "5.0.0-beta.
|
|
192
|
+
var version = "5.0.0-beta.99";
|
|
193
193
|
//#endregion
|
|
194
194
|
//#region src/constants.ts
|
|
195
195
|
/**
|
|
@@ -711,7 +711,7 @@ var Diagnostics = class Diagnostics {
|
|
|
711
711
|
* since a single-file output has nothing to group.
|
|
712
712
|
*/
|
|
713
713
|
function normalizeOutput({ output, group, pluginName }) {
|
|
714
|
-
const mode = output.mode ?? "
|
|
714
|
+
const mode = output.mode ?? "file";
|
|
715
715
|
if (mode === "file" && group) throw new Diagnostics.Error({
|
|
716
716
|
code: diagnosticCode.invalidPluginOptions,
|
|
717
717
|
severity: "error",
|
|
@@ -1027,12 +1027,12 @@ var Resolver = class Resolver {
|
|
|
1027
1027
|
return segment ? camelCase(segment) : "";
|
|
1028
1028
|
}
|
|
1029
1029
|
/**
|
|
1030
|
-
* `mode: 'file'` resolves directly to `output.path`. `mode: 'directory'`
|
|
1030
|
+
* `mode: 'file'` (default) resolves directly to `output.path`. `mode: 'directory'` resolves
|
|
1031
1031
|
* to `output.path/{baseName}`, or into a subdirectory when `group` and a `tag`/`path` value
|
|
1032
1032
|
* are provided.
|
|
1033
1033
|
*/
|
|
1034
1034
|
#resolvePath({ baseName, tag, path: groupPath, root, output, group }) {
|
|
1035
|
-
if (output.mode
|
|
1035
|
+
if (output.mode !== "directory") return path.resolve(root, output.path);
|
|
1036
1036
|
const outputDir = path.resolve(root, output.path);
|
|
1037
1037
|
const result = group && (groupPath || tag) ? path.resolve(outputDir, Resolver.#resolveGroupDir(group, group.type === "path" ? groupPath : tag), baseName) : path.resolve(outputDir, baseName);
|
|
1038
1038
|
const outputDirWithSep = outputDir.endsWith(path.sep) ? outputDir : `${outputDir}${path.sep}`;
|
|
@@ -1508,27 +1508,24 @@ var KubbDriver = class {
|
|
|
1508
1508
|
async run() {
|
|
1509
1509
|
const { hooks, config, fileManager } = this;
|
|
1510
1510
|
const diagnostics = [];
|
|
1511
|
+
const updateBuffer = [];
|
|
1511
1512
|
const parsersMap = /* @__PURE__ */ new Map();
|
|
1512
1513
|
for (const parser of config.parsers) if (parser.extNames) for (const ext of parser.extNames) parsersMap.set(ext, parser);
|
|
1513
|
-
const onWriteStart = async (files) => {
|
|
1514
|
-
await hooks.callHook("kubb:files:processing:start", { files });
|
|
1515
|
-
};
|
|
1516
|
-
const updateBuffer = [];
|
|
1517
|
-
const onWriteUpdate = (item) => {
|
|
1518
|
-
updateBuffer.push(item);
|
|
1519
|
-
};
|
|
1520
|
-
const onWriteEnd = async (files) => {
|
|
1521
|
-
await hooks.callHook("kubb:files:processing:update", { files: updateBuffer.map((item) => ({
|
|
1522
|
-
...item,
|
|
1523
|
-
config
|
|
1524
|
-
})) });
|
|
1525
|
-
updateBuffer.length = 0;
|
|
1526
|
-
await hooks.callHook("kubb:files:processing:end", { files });
|
|
1527
|
-
};
|
|
1528
1514
|
const unhookWrites = fileManager.hooks.addHooks({
|
|
1529
|
-
start:
|
|
1530
|
-
|
|
1531
|
-
|
|
1515
|
+
start: async (files) => {
|
|
1516
|
+
await hooks.callHook("kubb:files:processing:start", { files });
|
|
1517
|
+
},
|
|
1518
|
+
update: (item) => {
|
|
1519
|
+
updateBuffer.push(item);
|
|
1520
|
+
},
|
|
1521
|
+
end: async (files) => {
|
|
1522
|
+
await hooks.callHook("kubb:files:processing:update", { files: updateBuffer.map((item) => ({
|
|
1523
|
+
...item,
|
|
1524
|
+
config
|
|
1525
|
+
})) });
|
|
1526
|
+
updateBuffer.length = 0;
|
|
1527
|
+
await hooks.callHook("kubb:files:processing:end", { files });
|
|
1528
|
+
}
|
|
1532
1529
|
});
|
|
1533
1530
|
return Diagnostics.scope((diagnostic) => diagnostics.push(diagnostic), async () => {
|
|
1534
1531
|
try {
|