@kubb/studio 5.2.3 → 5.2.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/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.3";
567
+ var version = "5.2.4";
568
568
  //#endregion
569
569
  //#region src/hooks.ts
570
570
  /**
@@ -670,6 +670,20 @@ function toPluginName(packageName) {
670
670
  return packageName.split("/").pop() ?? packageName;
671
671
  }
672
672
  /**
673
+ * Adds the `@kubb/` scope a plugin's package carries but its `name` does not, the inverse of
674
+ * {@link toPluginName}. A name outside the `plugin-` convention is left alone, so a third-party
675
+ * plugin is not reported as one of Kubb's.
676
+ *
677
+ * @example
678
+ * ```ts
679
+ * toPackageName('plugin-ts') // '@kubb/plugin-ts'
680
+ * toPackageName('@acme/my-plugin') // '@acme/my-plugin'
681
+ * ```
682
+ */
683
+ function toPackageName(name) {
684
+ return name.startsWith("plugin-") ? `@kubb/${name}` : name;
685
+ }
686
+ /**
673
687
  * Derives the conventional named export for a `@kubb/*` plugin package from its package name.
674
688
  *
675
689
  * @example
@@ -1504,7 +1518,7 @@ const CONNECT_TIMEOUT_MS = 5e3;
1504
1518
  const eventSeqCounters = /* @__PURE__ */ new WeakMap();
1505
1519
  const require = createRequire(import.meta.url);
1506
1520
  async function resolvePeerDependencies(names) {
1507
- const uniqueNames = [...new Set(names)];
1521
+ const uniqueNames = [...new Set(names.map(toPackageName))];
1508
1522
  const peerDependencies = {};
1509
1523
  const missingDependencies = [];
1510
1524
  const versions = await Promise.all(uniqueNames.map(async (name) => {
@@ -1950,7 +1964,7 @@ var StudioSession = class {
1950
1964
  path: configPath,
1951
1965
  file: await this.#readConfigFileView(),
1952
1966
  plugins: config.plugins.map((plugin) => ({
1953
- name: `@kubb/${plugin.name}`,
1967
+ name: toPackageName(plugin.name),
1954
1968
  options: plugin.options ?? {}
1955
1969
  }))
1956
1970
  },