@kubb/core 2.7.2 → 2.8.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.
@@ -12,7 +12,8 @@ import {
12
12
  } from "./chunk-WRGVBPK2.js";
13
13
  import {
14
14
  getRelativePath,
15
- read
15
+ read,
16
+ readSync
16
17
  } from "./chunk-XDO5ZSKZ.js";
17
18
  import {
18
19
  write
@@ -1446,7 +1447,7 @@ var PluginManager = class {
1446
1447
  const paths = this.hookForPluginSync({
1447
1448
  pluginKey: params.pluginKey,
1448
1449
  hookName: "resolvePath",
1449
- parameters: [params.baseName, params.directory, params.options]
1450
+ parameters: [params.baseName, params.mode, params.options]
1450
1451
  });
1451
1452
  if (paths && paths?.length > 1 && this.logger.logLevel === LogLevel.debug) {
1452
1453
  this.logger.emit("debug", [
@@ -1462,7 +1463,7 @@ Falling back on the first item.
1462
1463
  }
1463
1464
  return this.hookFirstSync({
1464
1465
  hookName: "resolvePath",
1465
- parameters: [params.baseName, params.directory, params.options]
1466
+ parameters: [params.baseName, params.mode, params.options]
1466
1467
  }).result;
1467
1468
  };
1468
1469
  this.resolveName = (params) => {
@@ -1511,6 +1512,26 @@ Falling back on the first item.
1511
1512
  });
1512
1513
  return this;
1513
1514
  }
1515
+ getFile({ name, mode, extName, pluginKey, options }) {
1516
+ let source = "";
1517
+ const baseName = `${name}${extName}`;
1518
+ const path3 = this.resolvePath({ baseName, mode, pluginKey, options });
1519
+ if (!path3) {
1520
+ throw new Error(`Filepath should be defined for resolvedName "${name}" and pluginKey [${JSON.stringify(pluginKey)}]`);
1521
+ }
1522
+ try {
1523
+ source = readSync(path3);
1524
+ } catch (_e) {
1525
+ }
1526
+ return {
1527
+ path: path3,
1528
+ baseName,
1529
+ meta: {
1530
+ pluginKey
1531
+ },
1532
+ source
1533
+ };
1534
+ }
1514
1535
  /**
1515
1536
  * Instead of calling `pluginManager.events.on` you can use `pluginManager.on`. This one also has better types.
1516
1537
  */
@@ -1863,4 +1884,4 @@ export {
1863
1884
  isPromise,
1864
1885
  PluginManager
1865
1886
  };
1866
- //# sourceMappingURL=chunk-BHNAGXM3.js.map
1887
+ //# sourceMappingURL=chunk-6KNLOEZF.js.map