@cordy/electro-cli 1.1.0 → 1.1.2

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.
Files changed (2) hide show
  1. package/dist/index.mjs +23 -1
  2. package/package.json +4 -4
package/dist/index.mjs CHANGED
@@ -490,7 +490,7 @@ const cac = (name = "") => new CAC(name);
490
490
 
491
491
  //#endregion
492
492
  //#region package.json
493
- var version$1 = "1.1.0";
493
+ var version$1 = "1.1.2";
494
494
 
495
495
  //#endregion
496
496
  //#region src/dev/logger.ts
@@ -934,10 +934,32 @@ function createRendererConfig(opts) {
934
934
  if (opts.userViteConfigs?.length) {
935
935
  let merged = config;
936
936
  for (const userConfig of opts.userViteConfigs) merged = mergeConfig(merged, userConfig);
937
+ merged.plugins = deduplicatePlugins(merged.plugins);
937
938
  return merged;
938
939
  }
939
940
  return config;
940
941
  }
942
+ /**
943
+ * Deduplicate plugins by name — keeps the first occurrence of each named plugin.
944
+ * This allows multiple views to declare the same plugins (e.g. react()) without
945
+ * causing duplicate injection errors when configs are merged.
946
+ */
947
+ function deduplicatePlugins(plugins) {
948
+ if (!plugins) return [];
949
+ const seen = /* @__PURE__ */ new Set();
950
+ const result = [];
951
+ for (const plugin of plugins.flat(Infinity)) {
952
+ const name = plugin?.name;
953
+ if (!name) {
954
+ result.push(plugin);
955
+ continue;
956
+ }
957
+ if (seen.has(name)) continue;
958
+ seen.add(name);
959
+ result.push(plugin);
960
+ }
961
+ return result;
962
+ }
941
963
 
942
964
  //#endregion
943
965
  //#region ../../node_modules/.bun/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cordy/electro-cli",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "CLI for @cordy/electro — dev server, build, and code generation commands",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -47,15 +47,15 @@
47
47
  "prepublishOnly": "bun run build"
48
48
  },
49
49
  "peerDependencies": {
50
- "@cordy/electro": "1.1.0",
50
+ "@cordy/electro": "1.1.2",
51
51
  "electron": ">=40.4.1",
52
52
  "vite": ">=8.0.0"
53
53
  },
54
54
  "dependencies": {
55
- "@cordy/electro-generator": "1.1.0"
55
+ "@cordy/electro-generator": "1.1.2"
56
56
  },
57
57
  "devDependencies": {
58
- "@cordy/electro": "1.1.0",
58
+ "@cordy/electro": "1.1.2",
59
59
  "@types/node": "^25.2.3",
60
60
  "cac": "^6.7.14",
61
61
  "electron": "^40.4.1",