@kubb/core 5.9.2 → 5.9.4
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/{KubbDriver-D2Jn4i3J.cjs → Hookable-BEzKPyQH.cjs} +144 -308
- package/dist/Hookable-BEzKPyQH.cjs.map +1 -0
- package/dist/{KubbDriver-DiYRWgxN.js → Hookable-C4PGA4hT.js} +147 -293
- package/dist/Hookable-C4PGA4hT.js.map +1 -0
- package/dist/{createAdapter-DfbfcqcJ.d.ts → createAdapter-D55JE9lX.d.ts} +16 -76
- package/dist/index.cjs +91 -140
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -28
- package/dist/index.js +33 -81
- package/dist/index.js.map +1 -1
- package/dist/mocks.cjs +9 -9
- package/dist/mocks.cjs.map +1 -1
- package/dist/mocks.d.ts +1 -1
- package/dist/mocks.js +1 -1
- package/package.json +2 -2
- package/dist/KubbDriver-D2Jn4i3J.cjs.map +0 -1
- package/dist/KubbDriver-DiYRWgxN.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
2
|
+
const require_Hookable = require("./Hookable-BEzKPyQH.cjs");
|
|
3
3
|
let verkit = require("verkit");
|
|
4
4
|
let node_util = require("node:util");
|
|
5
5
|
let node_process = require("node:process");
|
|
6
|
-
node_process =
|
|
6
|
+
node_process = require_Hookable.__toESM(node_process, 1);
|
|
7
7
|
let tinyexec = require("tinyexec");
|
|
8
8
|
let node_fs_promises = require("node:fs/promises");
|
|
9
9
|
let node_path = require("node:path");
|
|
10
|
-
node_path =
|
|
10
|
+
node_path = require_Hookable.__toESM(node_path, 1);
|
|
11
11
|
let node_crypto = require("node:crypto");
|
|
12
12
|
let node_fs = require("node:fs");
|
|
13
13
|
let node_os = require("node:os");
|
|
14
14
|
let node_readline = require("node:readline");
|
|
15
15
|
let unstorage = require("unstorage");
|
|
16
16
|
let unstorage_drivers_fs = require("unstorage/drivers/fs");
|
|
17
|
-
unstorage_drivers_fs =
|
|
17
|
+
unstorage_drivers_fs = require_Hookable.__toESM(unstorage_drivers_fs, 1);
|
|
18
18
|
let node_url = require("node:url");
|
|
19
19
|
let node_module = require("node:module");
|
|
20
20
|
//#region ../../internals/utils/src/isCIEnvironment.ts
|
|
@@ -156,35 +156,21 @@ function tokenize(command) {
|
|
|
156
156
|
}
|
|
157
157
|
//#endregion
|
|
158
158
|
//#region src/createAdapter.ts
|
|
159
|
-
function createAdapter(input) {
|
|
160
|
-
if (typeof input === "function") return require_KubbDriver.createExtensionFactory({
|
|
161
|
-
kind: "adapter",
|
|
162
|
-
build: (options) => input(options)
|
|
163
|
-
});
|
|
164
|
-
return require_KubbDriver.defineExtension({
|
|
165
|
-
kind: "adapter",
|
|
166
|
-
...input
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
//#endregion
|
|
170
|
-
//#region src/applyConfigDefaults.ts
|
|
171
159
|
/**
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
160
|
+
* Defines a custom adapter that translates a spec format into Kubb's universal
|
|
161
|
+
* AST, for example GraphQL, gRPC, or AsyncAPI. The built-in `@kubb/adapter-oas`
|
|
162
|
+
* handles OpenAPI/Swagger documents.
|
|
163
|
+
*
|
|
164
|
+
* Adapters must return an `InputNode` from `parse`. That node is what every
|
|
165
|
+
* plugin in the build consumes.
|
|
166
|
+
*
|
|
167
|
+
* @deprecated Use `defineExtension` with `kind: 'adapter'` instead.
|
|
177
168
|
*/
|
|
178
|
-
function
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
output: {
|
|
184
|
-
...defaultOutput,
|
|
185
|
-
...config.output
|
|
186
|
-
}
|
|
187
|
-
};
|
|
169
|
+
function createAdapter(definition) {
|
|
170
|
+
return require_Hookable.defineExtension({
|
|
171
|
+
kind: "adapter",
|
|
172
|
+
...definition
|
|
173
|
+
});
|
|
188
174
|
}
|
|
189
175
|
//#endregion
|
|
190
176
|
//#region src/outputManifest.ts
|
|
@@ -229,7 +215,7 @@ async function createOutputManifest({ storage, cache }) {
|
|
|
229
215
|
async commit() {
|
|
230
216
|
try {
|
|
231
217
|
const next = { ...entries };
|
|
232
|
-
await
|
|
218
|
+
await require_Hookable.inParallel({
|
|
233
219
|
items: [...tracked],
|
|
234
220
|
limit: 50,
|
|
235
221
|
run: async ([key, source]) => {
|
|
@@ -266,9 +252,6 @@ async function createOutputManifest({ storage, cache }) {
|
|
|
266
252
|
*
|
|
267
253
|
* return {
|
|
268
254
|
* name: 'memory',
|
|
269
|
-
* async existsItem(key) {
|
|
270
|
-
* return store.has(key)
|
|
271
|
-
* },
|
|
272
255
|
* async readItem(key) {
|
|
273
256
|
* return store.get(key) ?? null
|
|
274
257
|
* },
|
|
@@ -289,9 +272,7 @@ async function createOutputManifest({ storage, cache }) {
|
|
|
289
272
|
* })
|
|
290
273
|
* ```
|
|
291
274
|
*/
|
|
292
|
-
|
|
293
|
-
return (options) => build(options ?? {});
|
|
294
|
-
}
|
|
275
|
+
const createStorage = (build) => (options) => build(options ?? {});
|
|
295
276
|
//#endregion
|
|
296
277
|
//#region src/storages/fsStorage.ts
|
|
297
278
|
/**
|
|
@@ -306,7 +287,6 @@ function createStorage(build) {
|
|
|
306
287
|
* - the write is skipped when the file already holds that content, ignoring any trailing newline
|
|
307
288
|
* a formatter left behind
|
|
308
289
|
* - missing parent directories are created automatically
|
|
309
|
-
* - Bun's native file API is used when running under Bun
|
|
310
290
|
* - `FileManager.write` bounds in-flight writes, so this driver does not pace itself
|
|
311
291
|
*
|
|
312
292
|
* @example
|
|
@@ -323,9 +303,6 @@ function createStorage(build) {
|
|
|
323
303
|
*/
|
|
324
304
|
const fsStorage = createStorage(() => ({
|
|
325
305
|
name: "fs",
|
|
326
|
-
async existsItem(key) {
|
|
327
|
-
return require_KubbDriver.exists((0, node_path.resolve)(key));
|
|
328
|
-
},
|
|
329
306
|
async readItem(key) {
|
|
330
307
|
try {
|
|
331
308
|
return await (0, node_fs_promises.readFile)((0, node_path.resolve)(key), "utf8");
|
|
@@ -334,7 +311,7 @@ const fsStorage = createStorage(() => ({
|
|
|
334
311
|
}
|
|
335
312
|
},
|
|
336
313
|
async writeItem(key, value, options) {
|
|
337
|
-
await
|
|
314
|
+
await require_Hookable.write((0, node_path.resolve)(key), value, {
|
|
338
315
|
sanity: false,
|
|
339
316
|
stored: options?.stored
|
|
340
317
|
});
|
|
@@ -349,13 +326,16 @@ const fsStorage = createStorage(() => ({
|
|
|
349
326
|
for await (const entry of (0, node_fs_promises.glob)("**/*", {
|
|
350
327
|
cwd: resolvedBase,
|
|
351
328
|
withFileTypes: true
|
|
352
|
-
})) if (entry.isFile()) keys.push(
|
|
329
|
+
})) if (entry.isFile()) keys.push(require_Hookable.toPosixPath((0, node_path.relative)(resolvedBase, (0, node_path.join)(entry.parentPath, entry.name))));
|
|
353
330
|
} catch (_error) {}
|
|
354
331
|
return keys;
|
|
355
332
|
},
|
|
356
333
|
async empty(base) {
|
|
357
334
|
if (!base) return;
|
|
358
|
-
await
|
|
335
|
+
await (0, node_fs_promises.rm)((0, node_path.resolve)(base), {
|
|
336
|
+
recursive: true,
|
|
337
|
+
force: true
|
|
338
|
+
});
|
|
359
339
|
}
|
|
360
340
|
}));
|
|
361
341
|
//#endregion
|
|
@@ -387,29 +367,15 @@ function resolveCacheDir(root) {
|
|
|
387
367
|
*/
|
|
388
368
|
const cacheStorage = createStorage(({ root = process.cwd() }) => {
|
|
389
369
|
const dir = resolveCacheDir(root);
|
|
390
|
-
const
|
|
370
|
+
const fs = fsStorage();
|
|
391
371
|
const toPath = (key) => (0, node_path.join)(dir, key);
|
|
392
372
|
return {
|
|
393
373
|
name: "cache",
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
},
|
|
400
|
-
async writeItem(key, value) {
|
|
401
|
-
return storage.writeItem(toPath(key), value);
|
|
402
|
-
},
|
|
403
|
-
async removeItem(key) {
|
|
404
|
-
return storage.removeItem(toPath(key));
|
|
405
|
-
},
|
|
406
|
-
async readKeys(base) {
|
|
407
|
-
return storage.readKeys(base ? toPath(base) : dir);
|
|
408
|
-
},
|
|
409
|
-
async empty(base) {
|
|
410
|
-
if (!base) return;
|
|
411
|
-
return storage.empty(toPath(base));
|
|
412
|
-
}
|
|
374
|
+
readItem: (key) => fs.readItem(toPath(key)),
|
|
375
|
+
writeItem: (key, value) => fs.writeItem(toPath(key), value),
|
|
376
|
+
removeItem: (key) => fs.removeItem(toPath(key)),
|
|
377
|
+
readKeys: (base) => fs.readKeys(base ? toPath(base) : dir),
|
|
378
|
+
empty: async (base) => base ? fs.empty(toPath(base)) : void 0
|
|
413
379
|
};
|
|
414
380
|
});
|
|
415
381
|
//#endregion
|
|
@@ -431,7 +397,7 @@ async function settle(proc, hooks, id, commandWithArgs) {
|
|
|
431
397
|
id,
|
|
432
398
|
line
|
|
433
399
|
})).catch((error) => {
|
|
434
|
-
lineError ??=
|
|
400
|
+
lineError ??= require_Hookable.toError(error);
|
|
435
401
|
});
|
|
436
402
|
});
|
|
437
403
|
}
|
|
@@ -504,14 +470,14 @@ const TOOL_PASSES = [{
|
|
|
504
470
|
verb: "Formatting",
|
|
505
471
|
tools: formatters,
|
|
506
472
|
preference: FORMATTER_PREFERENCE,
|
|
507
|
-
code:
|
|
473
|
+
code: require_Hookable.Diagnostics.code.formatFailed
|
|
508
474
|
}, {
|
|
509
475
|
kind: "lint",
|
|
510
476
|
label: "linter",
|
|
511
477
|
verb: "Linting",
|
|
512
478
|
tools: linters,
|
|
513
479
|
preference: LINTER_PREFERENCE,
|
|
514
|
-
code:
|
|
480
|
+
code: require_Hookable.Diagnostics.code.lintFailed
|
|
515
481
|
}];
|
|
516
482
|
/**
|
|
517
483
|
* Resolves `auto` to an installed tool and runs it. Returns the failure instead of throwing.
|
|
@@ -562,7 +528,7 @@ async function runOutputPasses({ config, outputPath, hooks, signal }) {
|
|
|
562
528
|
cause: error
|
|
563
529
|
};
|
|
564
530
|
diagnostics.push(diagnostic);
|
|
565
|
-
await
|
|
531
|
+
await require_Hookable.Diagnostics.emit(hooks, diagnostic);
|
|
566
532
|
};
|
|
567
533
|
for (const pass of TOOL_PASSES) {
|
|
568
534
|
const setting = config.output[pass.kind];
|
|
@@ -599,7 +565,7 @@ async function runOutputPasses({ config, outputPath, hooks, signal }) {
|
|
|
599
565
|
signal
|
|
600
566
|
});
|
|
601
567
|
if (result.success) await hooks.callHook("kubb:success", { message: `${(0, node_util.styleText)("dim", name ?? command)} successfully executed` });
|
|
602
|
-
if (!result.success) await report(
|
|
568
|
+
if (!result.success) await report(require_Hookable.Diagnostics.code.postGenerateFailed, "Post-generate command", result.error);
|
|
603
569
|
signal?.throwIfAborted();
|
|
604
570
|
}
|
|
605
571
|
await hooks.callHook("kubb:hooks:end");
|
|
@@ -607,8 +573,6 @@ async function runOutputPasses({ config, outputPath, hooks, signal }) {
|
|
|
607
573
|
}
|
|
608
574
|
//#endregion
|
|
609
575
|
//#region src/createKubb.ts
|
|
610
|
-
/** Upper bound of listeners one plugin adds to a hook, sizing the emitter ceiling for large plugin sets. */
|
|
611
|
-
const HOOK_LISTENERS_PER_PLUGIN = 4;
|
|
612
576
|
function resolveConfig(userConfig) {
|
|
613
577
|
return {
|
|
614
578
|
...userConfig,
|
|
@@ -664,7 +628,7 @@ var Kubb = class {
|
|
|
664
628
|
#signal;
|
|
665
629
|
constructor(userConfig, options = {}) {
|
|
666
630
|
this.config = resolveConfig(userConfig);
|
|
667
|
-
this.hooks = options.hooks ?? new
|
|
631
|
+
this.hooks = options.hooks ?? new require_Hookable.Hookable();
|
|
668
632
|
this.#signal = options.signal;
|
|
669
633
|
}
|
|
670
634
|
get storage() {
|
|
@@ -685,16 +649,15 @@ var Kubb = class {
|
|
|
685
649
|
storage: config.storage,
|
|
686
650
|
cache: cacheStorage({ root: config.root })
|
|
687
651
|
}) : void 0;
|
|
688
|
-
this.hooks.setMaxListeners(Math.max(10, config.plugins.length * HOOK_LISTENERS_PER_PLUGIN));
|
|
689
652
|
const cleanPath = config.output.clean ? (0, node_path.resolve)(config.root, config.output.path) : void 0;
|
|
690
|
-
if (cleanPath &&
|
|
691
|
-
code:
|
|
653
|
+
if (cleanPath && require_Hookable.isPathInside(config.root, cleanPath)) throw new require_Hookable.Diagnostics.Error({
|
|
654
|
+
code: require_Hookable.Diagnostics.code.cleanRoot,
|
|
692
655
|
severity: "error",
|
|
693
656
|
message: `output.clean cannot delete "${cleanPath}" because it is the project root or a parent of it.`,
|
|
694
657
|
help: "Point `output.path` at a subdirectory such as `./src/gen` so clean only removes generated code.",
|
|
695
658
|
location: { kind: "config" }
|
|
696
659
|
});
|
|
697
|
-
const driver = new
|
|
660
|
+
const driver = new require_Hookable.KubbDriver(config, {
|
|
698
661
|
hooks: this.hooks,
|
|
699
662
|
manifest,
|
|
700
663
|
signal,
|
|
@@ -710,8 +673,8 @@ var Kubb = class {
|
|
|
710
673
|
*/
|
|
711
674
|
async build() {
|
|
712
675
|
const out = await this.safeBuild();
|
|
713
|
-
if (
|
|
714
|
-
const errors = out.diagnostics.filter(
|
|
676
|
+
if (require_Hookable.Diagnostics.hasError(out.diagnostics)) {
|
|
677
|
+
const errors = out.diagnostics.filter(require_Hookable.Diagnostics.isProblem).filter((diagnostic) => diagnostic.severity === "error").map((diagnostic) => diagnostic.cause ?? new require_Hookable.Diagnostics.Error(diagnostic));
|
|
715
678
|
throw new AggregateError(errors, `Build failed with ${errors.length} ${errors.length === 1 ? "error" : "errors"}`);
|
|
716
679
|
}
|
|
717
680
|
return out;
|
|
@@ -723,7 +686,7 @@ var Kubb = class {
|
|
|
723
686
|
*/
|
|
724
687
|
async safeBuild() {
|
|
725
688
|
try {
|
|
726
|
-
var _usingCtx$1 =
|
|
689
|
+
var _usingCtx$1 = require_Hookable._usingCtx();
|
|
727
690
|
this.#signal?.throwIfAborted();
|
|
728
691
|
if (!this.#driver) await this.setup();
|
|
729
692
|
const self = _usingCtx$1.u(this);
|
|
@@ -766,14 +729,14 @@ var Kubb = class {
|
|
|
766
729
|
const { files, diagnostics, storage } = await this.safeBuild();
|
|
767
730
|
signal?.throwIfAborted();
|
|
768
731
|
for (const diagnostic of diagnostics) {
|
|
769
|
-
if (!
|
|
770
|
-
if (diagnostic.code ===
|
|
732
|
+
if (!require_Hookable.Diagnostics.isProblem(diagnostic)) continue;
|
|
733
|
+
if (diagnostic.code === require_Hookable.Diagnostics.code.unknown) {
|
|
771
734
|
await hooks.callHook("kubb:error", { error: diagnostic.cause ?? new Error(diagnostic.message) });
|
|
772
735
|
continue;
|
|
773
736
|
}
|
|
774
|
-
await
|
|
737
|
+
await require_Hookable.Diagnostics.emit(hooks, diagnostic);
|
|
775
738
|
}
|
|
776
|
-
if (
|
|
739
|
+
if (require_Hookable.Diagnostics.hasError(diagnostics)) {
|
|
777
740
|
await hooks.callHook("kubb:generation:end", {
|
|
778
741
|
config,
|
|
779
742
|
storage,
|
|
@@ -796,7 +759,7 @@ var Kubb = class {
|
|
|
796
759
|
signal
|
|
797
760
|
}) : [];
|
|
798
761
|
const finalDiagnostics = [...diagnostics, ...outputDiagnostics];
|
|
799
|
-
const failed =
|
|
762
|
+
const failed = require_Hookable.Diagnostics.hasError(outputDiagnostics);
|
|
800
763
|
if (!failed) await this.#manifest?.commit();
|
|
801
764
|
await hooks.callHook("kubb:generation:end", {
|
|
802
765
|
config,
|
|
@@ -889,9 +852,6 @@ function createReporter(reporter) {
|
|
|
889
852
|
async drain(context) {
|
|
890
853
|
await reporter.drain?.(context, [...reports]);
|
|
891
854
|
reports.length = 0;
|
|
892
|
-
},
|
|
893
|
-
[Symbol.dispose]() {
|
|
894
|
-
reports.length = 0;
|
|
895
855
|
}
|
|
896
856
|
};
|
|
897
857
|
}
|
|
@@ -904,11 +864,11 @@ function createReporter(reporter) {
|
|
|
904
864
|
*/
|
|
905
865
|
function buildReport(result) {
|
|
906
866
|
const { config, diagnostics, filesCreated, status, hrStart } = result;
|
|
907
|
-
const failed =
|
|
867
|
+
const failed = require_Hookable.Diagnostics.failedPlugins(diagnostics);
|
|
908
868
|
const total = config.plugins?.length ?? 0;
|
|
909
|
-
const counts =
|
|
910
|
-
const problems = diagnostics.filter(
|
|
911
|
-
const timings = diagnostics.filter(
|
|
869
|
+
const counts = require_Hookable.Diagnostics.count(diagnostics);
|
|
870
|
+
const problems = diagnostics.filter(require_Hookable.Diagnostics.isProblem);
|
|
871
|
+
const timings = diagnostics.filter(require_Hookable.Diagnostics.isPerformance).sort((a, b) => b.duration - a.duration).map((diagnostic) => ({
|
|
912
872
|
plugin: diagnostic.plugin,
|
|
913
873
|
durationMs: diagnostic.duration
|
|
914
874
|
}));
|
|
@@ -922,10 +882,10 @@ function buildReport(result) {
|
|
|
922
882
|
},
|
|
923
883
|
counts,
|
|
924
884
|
filesCreated,
|
|
925
|
-
durationMs:
|
|
885
|
+
durationMs: require_Hookable.getElapsedMs(hrStart),
|
|
926
886
|
output: (0, node_path.resolve)(config.root, config.output.path),
|
|
927
887
|
timings,
|
|
928
|
-
diagnostics: problems.map((diagnostic) =>
|
|
888
|
+
diagnostics: problems.map((diagnostic) => require_Hookable.Diagnostics.serialize(diagnostic))
|
|
929
889
|
};
|
|
930
890
|
}
|
|
931
891
|
//#endregion
|
|
@@ -945,7 +905,7 @@ function formatSummary(report, { showTimings }) {
|
|
|
945
905
|
rows.push(["Issues", issues]);
|
|
946
906
|
}
|
|
947
907
|
rows.push(["Files", `${(0, node_util.styleText)("green", String(filesCreated))} generated`]);
|
|
948
|
-
rows.push(["Duration", (0, node_util.styleText)("green",
|
|
908
|
+
rows.push(["Duration", (0, node_util.styleText)("green", require_Hookable.formatMs(durationMs))]);
|
|
949
909
|
rows.push(["Output", output]);
|
|
950
910
|
const labelWidth = Math.max(...rows.map(([label]) => label.length), timings.length > 0 ? 7 : 0);
|
|
951
911
|
const lines = rows.map(([label, value]) => `${(0, node_util.styleText)("dim", label.padStart(labelWidth))} ${value}`);
|
|
@@ -954,7 +914,7 @@ function formatSummary(report, { showTimings }) {
|
|
|
954
914
|
const indent = " ".repeat(labelWidth + 2);
|
|
955
915
|
lines.push((0, node_util.styleText)("dim", "Timings".padStart(labelWidth)));
|
|
956
916
|
for (const timing of timings) {
|
|
957
|
-
const timeStr =
|
|
917
|
+
const timeStr = require_Hookable.formatMs(timing.durationMs);
|
|
958
918
|
const barLength = Math.min(Math.ceil(timing.durationMs / 100), 10);
|
|
959
919
|
const bar = (0, node_util.styleText)("dim", "█".repeat(barLength));
|
|
960
920
|
lines.push(`${indent}${(0, node_util.styleText)("dim", "•")} ${timing.plugin.padEnd(nameWidth)} ${bar} ${timeStr}`);
|
|
@@ -1049,12 +1009,12 @@ function kubbStorage({ base } = {}) {
|
|
|
1049
1009
|
* can drop the heading.
|
|
1050
1010
|
*/
|
|
1051
1011
|
function buildProblemSection(diagnostics) {
|
|
1052
|
-
const problems = diagnostics.filter(
|
|
1012
|
+
const problems = diagnostics.filter(require_Hookable.Diagnostics.isProblem);
|
|
1053
1013
|
if (problems.length === 0) return [];
|
|
1054
1014
|
return [
|
|
1055
1015
|
"## Problems",
|
|
1056
1016
|
"",
|
|
1057
|
-
problems.map((diagnostic) =>
|
|
1017
|
+
problems.map((diagnostic) => require_Hookable.Diagnostics.formatLines(diagnostic).join("\n")).join("\n\n")
|
|
1058
1018
|
];
|
|
1059
1019
|
}
|
|
1060
1020
|
/**
|
|
@@ -1132,7 +1092,7 @@ const htmlReporter = createReporter({
|
|
|
1132
1092
|
const dir = resolveKubbDir((0, node_path.resolve)(process.cwd(), ".kubb"));
|
|
1133
1093
|
const storage = kubbStorage({ base: dir });
|
|
1134
1094
|
const assets = new URL("./html/", require("url").pathToFileURL(__filename).href);
|
|
1135
|
-
const [html, ui] = await Promise.all([
|
|
1095
|
+
const [html, ui] = await Promise.all([require_Hookable.read((0, node_url.fileURLToPath)(new URL("index.html", assets))), require_Hookable.read((0, node_url.fileURLToPath)(new URL("ui.iife.js", assets)))]);
|
|
1136
1096
|
await Promise.all([
|
|
1137
1097
|
storage.setItem(`${baseName}/index.html`, html),
|
|
1138
1098
|
storage.setItem(`${baseName}/ui.iife.js`, ui),
|
|
@@ -1212,21 +1172,16 @@ function defineGenerator(generator) {
|
|
|
1212
1172
|
}
|
|
1213
1173
|
//#endregion
|
|
1214
1174
|
//#region src/defineParser.ts
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
};
|
|
1224
|
-
}
|
|
1225
|
-
});
|
|
1226
|
-
return require_KubbDriver.defineExtension({
|
|
1175
|
+
/**
|
|
1176
|
+
* Defines a parser from one object and returns a factory that takes the user's options.
|
|
1177
|
+
* Register the result in the `parsers` array on `defineConfig`.
|
|
1178
|
+
*
|
|
1179
|
+
* @deprecated Use `defineExtension` with `kind: 'parser'` instead.
|
|
1180
|
+
*/
|
|
1181
|
+
function defineParser(definition) {
|
|
1182
|
+
return require_Hookable.defineExtension({
|
|
1227
1183
|
kind: "parser",
|
|
1228
|
-
|
|
1229
|
-
build: "build" in input ? input.build : input.setup
|
|
1184
|
+
...definition
|
|
1230
1185
|
});
|
|
1231
1186
|
}
|
|
1232
1187
|
//#endregion
|
|
@@ -1254,9 +1209,6 @@ const memoryStorage = createStorage(() => {
|
|
|
1254
1209
|
const store = /* @__PURE__ */ new Map();
|
|
1255
1210
|
return {
|
|
1256
1211
|
name: "memory",
|
|
1257
|
-
async existsItem(key) {
|
|
1258
|
-
return store.has(key);
|
|
1259
|
-
},
|
|
1260
1212
|
async readItem(key) {
|
|
1261
1213
|
return store.get(key) ?? null;
|
|
1262
1214
|
},
|
|
@@ -1405,55 +1357,54 @@ async function readInstalledPackages({ root, packages = [], resolveFrom = [] })
|
|
|
1405
1357
|
}));
|
|
1406
1358
|
}
|
|
1407
1359
|
//#endregion
|
|
1408
|
-
exports.Diagnostics =
|
|
1409
|
-
exports.Hookable =
|
|
1410
|
-
exports.KubbDriver =
|
|
1411
|
-
exports.Resolver =
|
|
1412
|
-
exports.addGenerator =
|
|
1413
|
-
exports.addMacro =
|
|
1414
|
-
exports.
|
|
1415
|
-
exports.assertPluginOption = require_KubbDriver.assertPluginOption;
|
|
1360
|
+
exports.Diagnostics = require_Hookable.Diagnostics;
|
|
1361
|
+
exports.Hookable = require_Hookable.Hookable;
|
|
1362
|
+
exports.KubbDriver = require_Hookable.KubbDriver;
|
|
1363
|
+
exports.Resolver = require_Hookable.Resolver;
|
|
1364
|
+
exports.addGenerator = require_Hookable.addGenerator;
|
|
1365
|
+
exports.addMacro = require_Hookable.addMacro;
|
|
1366
|
+
exports.assertPluginOption = require_Hookable.assertPluginOption;
|
|
1416
1367
|
exports.cacheStorage = cacheStorage;
|
|
1417
|
-
exports.checkCompatibility =
|
|
1368
|
+
exports.checkCompatibility = require_Hookable.checkCompatibility;
|
|
1418
1369
|
exports.cliReporter = cliReporter;
|
|
1419
1370
|
exports.createAdapter = createAdapter;
|
|
1420
1371
|
exports.createCliReporter = createCliReporter;
|
|
1421
1372
|
exports.createKubb = createKubb;
|
|
1422
1373
|
exports.createRenderer = createRenderer;
|
|
1423
1374
|
exports.createReporter = createReporter;
|
|
1424
|
-
exports.createResolver =
|
|
1375
|
+
exports.createResolver = require_Hookable.createResolver;
|
|
1425
1376
|
exports.createStorage = createStorage;
|
|
1426
|
-
exports.defineExtension =
|
|
1377
|
+
exports.defineExtension = require_Hookable.defineExtension;
|
|
1427
1378
|
exports.defineGenerator = defineGenerator;
|
|
1428
1379
|
exports.defineParser = defineParser;
|
|
1429
|
-
exports.definePlugin =
|
|
1380
|
+
exports.definePlugin = require_Hookable.definePlugin;
|
|
1430
1381
|
exports.fileReporter = fileReporter;
|
|
1431
1382
|
exports.fsStorage = fsStorage;
|
|
1432
|
-
exports.getInputKind =
|
|
1383
|
+
exports.getInputKind = require_Hookable.getInputKind;
|
|
1433
1384
|
exports.htmlReporter = htmlReporter;
|
|
1434
|
-
exports.injectFile =
|
|
1385
|
+
exports.injectFile = require_Hookable.injectFile;
|
|
1435
1386
|
exports.isExtensionManifest = isExtensionManifest;
|
|
1436
1387
|
exports.isPackageName = isPackageName;
|
|
1437
1388
|
exports.isRegistryEntry = isRegistryEntry;
|
|
1438
1389
|
exports.jsonReporter = jsonReporter;
|
|
1439
|
-
exports.kubbContext =
|
|
1390
|
+
exports.kubbContext = require_Hookable.kubbContext;
|
|
1440
1391
|
exports.kubbStorage = kubbStorage;
|
|
1441
1392
|
exports.logLevel = logLevel;
|
|
1442
1393
|
exports.manifestProblems = manifestProblems;
|
|
1443
1394
|
exports.memoryStorage = memoryStorage;
|
|
1444
1395
|
exports.readInstalledPackages = readInstalledPackages;
|
|
1445
|
-
exports.requirePlugin =
|
|
1396
|
+
exports.requirePlugin = require_Hookable.requirePlugin;
|
|
1446
1397
|
exports.resolveCacheDir = resolveCacheDir;
|
|
1447
1398
|
exports.resolveKubbDir = resolveKubbDir;
|
|
1448
|
-
exports.resolveMeta =
|
|
1399
|
+
exports.resolveMeta = require_Hookable.resolveMeta;
|
|
1449
1400
|
exports.runHook = runHook;
|
|
1450
1401
|
exports.runOutputPasses = runOutputPasses;
|
|
1451
|
-
exports.setMacros =
|
|
1452
|
-
exports.setOptions =
|
|
1453
|
-
exports.setResolver =
|
|
1454
|
-
exports.tryUseKubb =
|
|
1455
|
-
exports.useConfig =
|
|
1456
|
-
exports.useKubb =
|
|
1457
|
-
exports.useOptions =
|
|
1402
|
+
exports.setMacros = require_Hookable.setMacros;
|
|
1403
|
+
exports.setOptions = require_Hookable.setOptions;
|
|
1404
|
+
exports.setResolver = require_Hookable.setResolver;
|
|
1405
|
+
exports.tryUseKubb = require_Hookable.tryUseKubb;
|
|
1406
|
+
exports.useConfig = require_Hookable.useConfig;
|
|
1407
|
+
exports.useKubb = require_Hookable.useKubb;
|
|
1408
|
+
exports.useOptions = require_Hookable.useOptions;
|
|
1458
1409
|
|
|
1459
1410
|
//# sourceMappingURL=index.cjs.map
|