@kubb/studio 5.2.1 → 5.2.3

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.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "./rolldown-runtime-CRm0XQPb.js";
2
- import { a as AgentPermissions, c as ClientInfo } from "./index-Y-wkaxbL.js";
2
+ import { a as AgentPermissions, c as ClientInfo } from "./index-V3fjg2mj.js";
3
3
  import { Storage } from "unstorage";
4
4
  import { Config, Hookable, KubbHooks } from "@kubb/core";
5
5
  //#region src/api.d.ts
package/dist/index.js CHANGED
@@ -564,7 +564,7 @@ async function disconnect({ sessionId, token, studioUrl, slug }) {
564
564
  }
565
565
  //#endregion
566
566
  //#region package.json
567
- var version = "5.2.1";
567
+ var version = "5.2.3";
568
568
  //#endregion
569
569
  //#region src/hooks.ts
570
570
  /**
@@ -1502,6 +1502,29 @@ const CONNECT_TIMEOUT_MS = 5e3;
1502
1502
  * automatically once the socket is collected.
1503
1503
  */
1504
1504
  const eventSeqCounters = /* @__PURE__ */ new WeakMap();
1505
+ const require = createRequire(import.meta.url);
1506
+ async function resolvePeerDependencies(names) {
1507
+ const uniqueNames = [...new Set(names)];
1508
+ const peerDependencies = {};
1509
+ const missingDependencies = [];
1510
+ const versions = await Promise.all(uniqueNames.map(async (name) => {
1511
+ try {
1512
+ const path = require.resolve(`${name}/package.json`);
1513
+ return JSON.parse(await readFile(path, "utf8")).version;
1514
+ } catch {
1515
+ return;
1516
+ }
1517
+ }));
1518
+ for (const [index, name] of uniqueNames.entries()) {
1519
+ const version = versions[index];
1520
+ if (version) peerDependencies[name] = version;
1521
+ else missingDependencies.push(name);
1522
+ }
1523
+ return {
1524
+ peerDependencies,
1525
+ missingDependencies
1526
+ };
1527
+ }
1505
1528
  function nextEventSeq(ws) {
1506
1529
  const seq = eventSeqCounters.get(ws) ?? 0;
1507
1530
  eventSeqCounters.set(ws, seq + 1);
@@ -1653,6 +1676,7 @@ function setupEventsStream(ws, hooks) {
1653
1676
  });
1654
1677
  });
1655
1678
  on("kubb:generation:end", async ({ config, storage, diagnostics = [], status, hrStart, filesCreated }) => {
1679
+ const { peerDependencies, missingDependencies } = await resolvePeerDependencies(config.plugins.map(({ name }) => name));
1656
1680
  const paths = await storage.readKeys();
1657
1681
  const files = {};
1658
1682
  await inParallel({
@@ -1667,7 +1691,9 @@ function setupEventsStream(ws, hooks) {
1667
1691
  type: "kubb:generation:end",
1668
1692
  data: [{
1669
1693
  config,
1670
- storage: files
1694
+ storage: files,
1695
+ peerDependencies,
1696
+ missingDependencies
1671
1697
  }]
1672
1698
  });
1673
1699
  if (!hrStart) return;