@visulima/packem-rollup 1.0.0-alpha.67 → 1.0.0-alpha.68

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/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## @visulima/packem-rollup [1.0.0-alpha.68](https://github.com/visulima/packem/compare/@visulima/packem-rollup@1.0.0-alpha.67...@visulima/packem-rollup@1.0.0-alpha.68) (2026-06-02)
2
+
3
+ ### Features
4
+
5
+ * add duplicated package detector ([#203](https://github.com/visulima/packem/issues/203)) ([2b29466](https://github.com/visulima/packem/commit/2b29466bc7980477fe0e2a500feba2487dd7758a))
6
+
7
+
8
+ ### Dependencies
9
+
10
+ * **@visulima/packem-share:** upgraded to 1.0.0-alpha.48
11
+ * **@visulima/rollup-plugin-dts:** upgraded to 1.0.0-alpha.29
12
+
1
13
  ## @visulima/packem-rollup [1.0.0-alpha.67](https://github.com/visulima/packem/compare/@visulima/packem-rollup@1.0.0-alpha.66...@visulima/packem-rollup@1.0.0-alpha.67) (2026-06-01)
2
14
 
3
15
  ### Miscellaneous Chores
package/dist/index.d.ts CHANGED
@@ -102,6 +102,40 @@ interface DebarrelPluginOptions {
102
102
  include?: FilterPattern;
103
103
  possibleBarrelFiles?: (RegExp | string)[];
104
104
  }
105
+ /**
106
+ * Collected duplicated-package information, keyed by package name, then version,
107
+ * then the resolved package directory, with the set of importers as the leaf value.
108
+ *
109
+ * ```plaintext
110
+ * Map {
111
+ * "axios" => Map {
112
+ * "1.4.0" => Map { "[dir]" => Set { "packages/pkg2/index.js" } },
113
+ * "0.27.2" => Map { "[dir]" => Set { "packages/pkg1/index.js" } }
114
+ * }
115
+ * }
116
+ * ```
117
+ */
118
+ type PackagesInfo = Map<string, Map<string, Map<string, Set<string>>>>;
119
+ interface DetectDuplicatedPluginOptions {
120
+ /** Build a custom message from the collected duplicates instead of the default report. */
121
+ customErrorMessage?: (packageToVersionsMap: PackagesInfo) => string;
122
+ /**
123
+ * Whether to report duplicated deps that are pulled in transitively by another dep under node_modules.
124
+ * When `false`, only duplicates imported directly by your own source are reported.
125
+ * @default true
126
+ */
127
+ deep?: boolean;
128
+ /**
129
+ * Duplicated dependencies to ignore. Pass `*` as a version to ignore all versions, e.g. `{ axios: ["0.17.4", "1.4.0"] }`.
130
+ * @default {} (ignore nothing)
131
+ */
132
+ ignore?: Record<string, string[]>;
133
+ /**
134
+ * Make the build fail when duplicated deps exist.
135
+ * @default false
136
+ */
137
+ throwErrorWhenDuplicated?: boolean;
138
+ }
105
139
  interface EsmShimCjsSyntaxOptions {
106
140
  exclude?: FilterPattern;
107
141
  include?: FilterPattern;
@@ -631,6 +665,12 @@ interface PackemRollupOptions {
631
665
  copy?: CopyPluginOptions | false;
632
666
  dataUri?: DataUriPluginOptions | false;
633
667
  debarrel?: DebarrelPluginOptions | false;
668
+ /**
669
+ * Detect dependencies that get bundled more than once (multiple versions, or
670
+ * the same version from multiple directories) and report them. Enabled by
671
+ * default; set to `false` to disable, or pass options to configure.
672
+ */
673
+ detectDuplicated?: DetectDuplicatedPluginOptions | false;
634
674
  dts?: Options$2;
635
675
  dynamicVars?: RollupDynamicImportVariablesOptions | false;
636
676
  esbuild?: Options$3 | false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/packem-rollup",
3
- "version": "1.0.0-alpha.67",
3
+ "version": "1.0.0-alpha.68",
4
4
  "description": "Rollup plugins for packem",
5
5
  "keywords": [
6
6
  "visulima",
@@ -93,9 +93,9 @@
93
93
  "@visulima/find-cache-dir": "3.0.0-alpha.9",
94
94
  "@visulima/fs": "5.0.0-alpha.24",
95
95
  "@visulima/package": "5.0.0-alpha.23",
96
- "@visulima/packem-share": "1.0.0-alpha.47",
96
+ "@visulima/packem-share": "1.0.0-alpha.48",
97
97
  "@visulima/path": "3.0.0-alpha.10",
98
- "@visulima/rollup-plugin-dts": "1.0.0-alpha.28",
98
+ "@visulima/rollup-plugin-dts": "1.0.0-alpha.29",
99
99
  "clean-css": "^5.3.3",
100
100
  "html-minifier-next": "6.2.7",
101
101
  "magic-string": "0.30.21",