@kubb/core 5.0.0-beta.97 → 5.0.0-beta.98

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.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-DOXZGtQx.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-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.97";
192
+ var version = "5.0.0-beta.98";
193
193
  //#endregion
194
194
  //#region src/constants.ts
195
195
  /**
@@ -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: onWriteStart,
1530
- update: onWriteUpdate,
1531
- end: onWriteEnd
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 {