@christiango/unbarrel 0.10.4 → 0.11.0

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.
@@ -1,5 +1,8 @@
1
1
  /**
2
- * Fixes any issues in the referenced barrel file.
2
+ * Fixes any issues in the specified barrel file.
3
+ * This includes flattening `export *` statements into explicit named exports
4
+ * and resolving exports that reference other barrel files to point directly
5
+ * to their true source modules. The file is modified in place.
3
6
  * @param absoluteFilePath - the absolute path of the barrel file to fix
4
7
  */
5
8
  export declare function fixIssuesInBarrelFile(absoluteFilePath: string): void;
@@ -1 +1 @@
1
- {"version":3,"file":"fixIssuesInBarrelFile.d.ts","sourceRoot":"","sources":["../src/fixIssuesInBarrelFile.ts"],"names":[],"mappings":"AA8HA;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,QAyH7D"}
1
+ {"version":3,"file":"fixIssuesInBarrelFile.d.ts","sourceRoot":"","sources":["../src/fixIssuesInBarrelFile.ts"],"names":[],"mappings":"AAqFA;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,QAsG7D"}
@@ -46,204 +46,136 @@ const getExportDefinitionFromReExport_1 = require("./getExportDefinitionFromReEx
46
46
  const parseUtils_1 = require("./parseUtils");
47
47
  const getIssuesInBarrelFile_1 = require("./getIssuesInBarrelFile");
48
48
  const importUtils_1 = require("./importUtils");
49
- /**
50
- * Groups resolved exports by their import path
51
- */
52
- function groupExportsByPath(exports) {
53
- const grouped = new Map();
54
- for (const exp of exports) {
55
- const list = grouped.get(exp.importPath) || [];
56
- list.push(exp);
57
- grouped.set(exp.importPath, list);
58
- }
59
- return grouped;
60
- }
61
- /**
62
- * Deduplicates exports by exportedName.
63
- * Value exports take precedence over type-only exports.
64
- */
65
- function deduplicateExports(exports) {
66
- const byName = new Map();
67
- for (const exp of exports) {
68
- const existing = byName.get(exp.exportedName);
69
- if (!existing || (existing.typeOnly && !exp.typeOnly)) {
70
- byName.set(exp.exportedName, exp);
71
- }
72
- }
73
- return Array.from(byName.values());
74
- }
75
- /**
76
- * Creates an export specifier AST node from a resolved export
77
- */
78
- function createExportSpecifier(exp) {
79
- const specifier = t.exportSpecifier(t.identifier(exp.importedName), t.identifier(exp.exportedName));
80
- if (exp.typeOnly) {
81
- specifier.exportKind = 'type';
82
- }
83
- return specifier;
84
- }
85
- /**
86
- * Fixes barrel file references by resolving exports to their true source
87
- */
88
- function fixBarrelFileReferences(absoluteFilePath, nodesToFix, barrelRefNames) {
89
- for (const nodePath of nodesToFix) {
90
- const sourcePath = nodePath.node.source.value;
91
- const resolvedByPath = new Map();
92
- const unchangedSpecifiers = [];
93
- for (const specifier of nodePath.node.specifiers) {
94
- if (specifier.type !== 'ExportSpecifier' || specifier.exported.type !== 'Identifier') {
95
- continue;
96
- }
97
- const exportedName = specifier.exported.name;
98
- const importedName = specifier.local.name;
99
- const typeOnly = specifier.exportKind === 'type' || nodePath.node.exportKind === 'type';
100
- if (!barrelRefNames.has(exportedName)) {
101
- unchangedSpecifiers.push(specifier);
102
- continue;
103
- }
104
- // Resolve this export to its true source
105
- const resolved = (0, getExportDefinitionFromReExport_1.getExportDefinitionFromReExport)(absoluteFilePath, {
106
- type: importedName === 'default' ? 'defaultExport' : 'namedExport',
107
- importedName,
108
- exportedName,
109
- importPath: sourcePath,
110
- typeOnly,
111
- });
112
- const newSpecifier = t.exportSpecifier(t.identifier(resolved.importedName), t.identifier(resolved.exportedName));
113
- if (resolved.typeOnly || typeOnly) {
114
- newSpecifier.exportKind = 'type';
49
+ /** After all the processing has been done */
50
+ function cleanupExportsInAST(ast) {
51
+ // Map to the first export statement with a given path
52
+ const pathToExportMap = new Map();
53
+ (0, traverse_1.default)(ast, {
54
+ ExportNamedDeclaration(path) {
55
+ if (path.node.source) {
56
+ if (path.node.specifiers.length === 0) {
57
+ // If there are no specifiers left, remove the export statement
58
+ path.remove();
59
+ return;
60
+ }
61
+ const existingExportForPath = pathToExportMap.get(path.node.source.value);
62
+ if (existingExportForPath) {
63
+ // If we have seen the same path already, merge the specifiers and remove the current one
64
+ const specifiersSet = new Map();
65
+ for (const specifier of existingExportForPath.node.specifiers) {
66
+ if (specifier.type === 'ExportSpecifier' && specifier.exported.type === 'Identifier') {
67
+ specifiersSet.set(specifier.exported.name, specifier);
68
+ }
69
+ }
70
+ // If the existing export statement is an export type {} statement, let's switch it to export { type foo } style statements for better merging
71
+ if (existingExportForPath.node.exportKind === 'type') {
72
+ existingExportForPath.node.exportKind = 'value';
73
+ for (const specifier of existingExportForPath.node.specifiers) {
74
+ if (specifier.type === 'ExportSpecifier') {
75
+ specifier.exportKind = 'type';
76
+ }
77
+ }
78
+ }
79
+ for (const specifier of path.node.specifiers) {
80
+ if (specifier.type === 'ExportSpecifier' && specifier.exported.type === 'Identifier') {
81
+ const exportedName = specifier.exported.name;
82
+ const existingSpecifier = specifiersSet.get(exportedName);
83
+ if (!existingSpecifier) {
84
+ specifiersSet.set(exportedName, specifier);
85
+ existingExportForPath.node.specifiers.push(specifier);
86
+ }
87
+ else {
88
+ // If we've seen the specifier already, we need to make sure that if it was a type only export and this one is a value export we upgrade to a value export
89
+ if (existingSpecifier.exportKind === 'type' && specifier.exportKind !== 'type') {
90
+ existingSpecifier.exportKind = 'value';
91
+ }
92
+ }
93
+ }
94
+ }
95
+ path.remove();
96
+ }
97
+ else {
98
+ pathToExportMap.set(path.node.source.value, path);
99
+ }
115
100
  }
116
- const list = resolvedByPath.get(resolved.importPath) || [];
117
- list.push(newSpecifier);
118
- resolvedByPath.set(resolved.importPath, list);
119
- }
120
- // Build replacement statements
121
- const newStatements = [];
122
- if (unchangedSpecifiers.length > 0) {
123
- newStatements.push(t.exportNamedDeclaration(null, unchangedSpecifiers, t.stringLiteral(sourcePath)));
124
- }
125
- for (const [importPath, specifiers] of resolvedByPath) {
126
- newStatements.push(t.exportNamedDeclaration(null, specifiers, t.stringLiteral(importPath)));
127
- }
128
- if (newStatements.length > 0) {
129
- nodePath.replaceWithMultiple(newStatements);
130
- }
131
- else {
132
- nodePath.remove();
133
- }
134
- }
101
+ },
102
+ });
135
103
  }
136
104
  /**
137
- * Fixes any issues in the referenced barrel file.
105
+ * Fixes any issues in the specified barrel file.
106
+ * This includes flattening `export *` statements into explicit named exports
107
+ * and resolving exports that reference other barrel files to point directly
108
+ * to their true source modules. The file is modified in place.
138
109
  * @param absoluteFilePath - the absolute path of the barrel file to fix
139
110
  */
140
111
  function fixIssuesInBarrelFile(absoluteFilePath) {
141
112
  const ast = (0, parseUtils_1.parseTypescriptFile)(absoluteFilePath);
142
- // Collect all exports and detect issues in a single traverse pass
143
- const existingExportsByName = new Map();
144
- const existingStatementsByPath = new Map();
145
- const exportStarPaths = [];
146
- const allFlattenedExports = [];
147
- const barrelRefExportsToFix = [];
148
- const barrelFileRefs = new Set();
113
+ const exportStatements = [];
114
+ let astModified = false;
149
115
  (0, traverse_1.default)(ast, {
150
116
  ExportNamedDeclaration(path) {
151
117
  if (!path.node.source)
152
118
  return;
153
119
  const sourcePath = path.node.source.value;
154
- const namedExport = {
155
- path,
156
- sourcePath,
157
- };
158
- existingStatementsByPath.set(namedExport.sourcePath, namedExport);
159
- let hasBarrelRef = false;
160
- path.node.specifiers.forEach((specifier, i) => {
161
- if (specifier.type === 'ExportSpecifier' && specifier.exported.type === 'Identifier') {
162
- const exportedName = specifier.exported.name;
163
- const importedName = specifier.local.name;
164
- existingExportsByName.set(exportedName, {
165
- namedExport,
166
- specifierIndex: i,
167
- typeOnly: specifier.exportKind === 'type' || path.node.exportKind === 'type',
168
- });
169
- // Check if this specifier is a barrel file reference
170
- if ((0, importUtils_1.isInternalModule)(sourcePath) && (0, getIssuesInBarrelFile_1.isBarrelFileReference)(absoluteFilePath, sourcePath, importedName)) {
171
- barrelFileRefs.add(exportedName);
172
- hasBarrelRef = true;
173
- }
174
- }
175
- });
176
- if (hasBarrelRef) {
177
- barrelRefExportsToFix.push(path);
178
- }
120
+ exportStatements.push({ type: 'exportNamedDeclaration', sourcePath, nodePath: path });
179
121
  },
180
122
  ExportAllDeclaration(path) {
181
- const isExportTypeStar = path.node.exportKind === 'type';
182
- const flattened = (0, flattenExportStar_1.flattenExportStar)(absoluteFilePath, path.node.source.value, isExportTypeStar);
183
- exportStarPaths.push(path);
184
- allFlattenedExports.push(...flattened);
123
+ exportStatements.push({ type: 'exportStar', sourcePath: path.node.source.value, nodePath: path });
185
124
  },
186
125
  });
187
- // Handle barrel file references
188
- if (barrelRefExportsToFix.length > 0) {
189
- fixBarrelFileReferences(absoluteFilePath, barrelRefExportsToFix, barrelFileRefs);
190
- }
191
- if (exportStarPaths.length === 0) {
192
- if (barrelRefExportsToFix.length > 0) {
193
- const output = (0, generator_1.default)(ast, { retainLines: false, comments: true });
194
- fs.writeFileSync(absoluteFilePath, output.code, 'utf8');
195
- }
196
- return;
197
- }
198
- // Deduplicate and filter exports
199
- const deduplicated = deduplicateExports(allFlattenedExports);
200
- const toRemove = [];
201
- const filteredExports = deduplicated.filter((exp) => {
202
- const existing = existingExportsByName.get(exp.exportedName);
203
- if (!existing)
204
- return true;
205
- // Upgrade type-only to value export
206
- if (existing.typeOnly && !exp.typeOnly) {
207
- toRemove.push(existing);
208
- return true;
209
- }
210
- return false;
211
- });
212
- // Remove specifiers being upgraded from type to value
213
- for (const { namedExport, specifierIndex } of toRemove) {
214
- const specifiers = namedExport.path.node.specifiers;
215
- if (specifiers.length === 1) {
216
- namedExport.path.remove();
217
- existingStatementsByPath.delete(namedExport.sourcePath);
218
- }
219
- else {
220
- specifiers.splice(specifierIndex, 1);
221
- }
222
- }
223
- // Group filtered exports and create/update statements
224
- const grouped = groupExportsByPath(filteredExports);
225
- const newStatements = [];
226
- for (const [importPath, exps] of grouped) {
227
- const existing = existingStatementsByPath.get(importPath);
228
- if (existing) {
229
- existing.path.node.specifiers.push(...exps.map(createExportSpecifier));
126
+ // Now go through all export statements and perform the flattening of export star and resolving of re-exports
127
+ for (const exportStatement of exportStatements) {
128
+ if (exportStatement.type === 'exportStar') {
129
+ const flattened = (0, flattenExportStar_1.flattenExportStar)(absoluteFilePath, exportStatement.nodePath.node.source.value);
130
+ const exportNamedDeclarations = [];
131
+ const isTypeOnlyExportStar = exportStatement.nodePath.node.exportKind === 'type';
132
+ for (const resolvedModuleDefinition of flattened) {
133
+ const specifier = t.exportSpecifier(t.identifier(resolvedModuleDefinition.importedName), t.identifier(resolvedModuleDefinition.exportedName));
134
+ // For export type star statements, make all the generated specifiers type only
135
+ if (resolvedModuleDefinition.typeOnly || isTypeOnlyExportStar) {
136
+ specifier.exportKind = 'type';
137
+ }
138
+ exportNamedDeclarations.push(t.exportNamedDeclaration(null, [specifier], t.stringLiteral(resolvedModuleDefinition.importPath)));
139
+ }
140
+ exportStatement.nodePath.replaceWithMultiple(exportNamedDeclarations);
141
+ astModified = true;
230
142
  }
231
143
  else {
232
- newStatements.push(t.exportNamedDeclaration(null, exps.map(createExportSpecifier), t.stringLiteral(importPath)));
144
+ for (const specifier of exportStatement.nodePath.node.specifiers) {
145
+ if (specifier.type === 'ExportSpecifier' && specifier.exported.type === 'Identifier') {
146
+ const exportedName = specifier.exported.name;
147
+ const importedName = specifier.local.name;
148
+ // If this export points to another barrel file, let's replace it with a direct reference to the true source module
149
+ if ((0, importUtils_1.isInternalModule)(exportStatement.sourcePath) &&
150
+ (0, getIssuesInBarrelFile_1.isBarrelFileReference)(absoluteFilePath, exportStatement.sourcePath, importedName)) {
151
+ const typeOnly = specifier.exportKind === 'type' || exportStatement.nodePath.node.exportKind === 'type';
152
+ const resolvedExport = (0, getExportDefinitionFromReExport_1.getExportDefinitionFromReExport)(absoluteFilePath, {
153
+ type: importedName === 'default' ? 'defaultExport' : 'namedExport',
154
+ importedName,
155
+ exportedName,
156
+ importPath: exportStatement.sourcePath,
157
+ typeOnly,
158
+ });
159
+ // Add a new export statement to the true path
160
+ const newSpecifier = t.exportSpecifier(t.identifier(resolvedExport.importedName), t.identifier(resolvedExport.exportedName));
161
+ // Preserve the type-only flag
162
+ if (resolvedExport.typeOnly) {
163
+ newSpecifier.exportKind = 'type';
164
+ }
165
+ exportStatement.nodePath.insertAfter(t.exportNamedDeclaration(null, [newSpecifier], t.stringLiteral(resolvedExport.importPath)));
166
+ // Remove the specifier from the current export statement
167
+ exportStatement.nodePath.node.specifiers = exportStatement.nodePath.node.specifiers.filter((s) => s !== specifier);
168
+ astModified = true;
169
+ }
170
+ }
171
+ }
233
172
  }
234
173
  }
235
- // Replace export stars
236
- if (newStatements.length > 0) {
237
- exportStarPaths[0].replaceWithMultiple(newStatements);
238
- }
239
- else {
240
- exportStarPaths[0].remove();
241
- }
242
- for (let i = 1; i < exportStarPaths.length; i++) {
243
- exportStarPaths[i].remove();
174
+ // Write output if any changes were made
175
+ if (astModified) {
176
+ cleanupExportsInAST(ast);
177
+ const output = (0, generator_1.default)(ast, { retainLines: false, comments: true });
178
+ fs.writeFileSync(absoluteFilePath, output.code, 'utf8');
244
179
  }
245
- // Write output
246
- const output = (0, generator_1.default)(ast, { retainLines: false, comments: true });
247
- fs.writeFileSync(absoluteFilePath, output.code, 'utf8');
248
180
  }
249
181
  //# sourceMappingURL=fixIssuesInBarrelFile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fixIssuesInBarrelFile.js","sourceRoot":"","sources":["../src/fixIssuesInBarrelFile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkIA,sDAyHC;AA3PD,4CAA8B;AAE9B,+DAAuC;AACvC,iEAAwC;AACxC,gDAAkC;AAClC,2DAAwD;AACxD,uFAA8G;AAC9G,6CAAmD;AACnD,mEAAgE;AAChE,+CAAiD;AAEjD;;GAEG;AACH,SAAS,kBAAkB,CAAC,OAAmC;IAC7D,MAAM,OAAO,GAAG,IAAI,GAAG,EAAsC,CAAC;IAC9D,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;QAC1B,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG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ClC,CAAC,CAAC,sBAAsB,CAAC,IAAI,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAC3F,CAAC;wBAEF,yDAAyD;wBACzD,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,GAAG,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CACxF,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CACvB,CAAC;wBAEF,WAAW,GAAG,IAAI,CAAC;oBACrB,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,wCAAwC;IACxC,IAAI,WAAW,EAAE,CAAC;QAChB,mBAAmB,CAAC,GAAG,CAAC,CAAC;QACzB,MAAM,MAAM,GAAG,IAAA,mBAAQ,EAAC,GAAG,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QACrE,EAAE,CAAC,aAAa,CAAC,gBAAgB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC"}
@@ -3,7 +3,6 @@ import { ResolvedModuleDefinition } from './getExportDefinitionFromReExport';
3
3
  * Takes an export star and gets the list of fully resolved named exports that are currently reachable by the export *
4
4
  * @param absolutePathOfBarrelFile - The absolute path of the barrel file with the export * in it
5
5
  * @param importPath - The relative path of the module that is being referenced by the export *
6
- * @param isExportTypeStar - If true, all exports will be marked as type-only (for `export type *` statements)
7
6
  */
8
- export declare function flattenExportStar(absolutePathOfBarrelFile: string, importPath: string, isExportTypeStar?: boolean): ResolvedModuleDefinition[];
7
+ export declare function flattenExportStar(absolutePathOfBarrelFile: string, importPath: string): ResolvedModuleDefinition[];
9
8
  //# sourceMappingURL=flattenExportStar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"flattenExportStar.d.ts","sourceRoot":"","sources":["../src/flattenExportStar.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmC,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAG9G;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,wBAAwB,EAAE,MAAM,EAChC,UAAU,EAAE,MAAM,EAClB,gBAAgB,GAAE,OAAe,GAChC,wBAAwB,EAAE,CAoC5B"}
1
+ {"version":3,"file":"flattenExportStar.d.ts","sourceRoot":"","sources":["../src/flattenExportStar.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmC,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAG9G;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,wBAAwB,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,wBAAwB,EAAE,CAmClH"}
@@ -9,9 +9,8 @@ const getAllExportDefinitionsReachableFromModule_1 = require("./getAllExportDefi
9
9
  * Takes an export star and gets the list of fully resolved named exports that are currently reachable by the export *
10
10
  * @param absolutePathOfBarrelFile - The absolute path of the barrel file with the export * in it
11
11
  * @param importPath - The relative path of the module that is being referenced by the export *
12
- * @param isExportTypeStar - If true, all exports will be marked as type-only (for `export type *` statements)
13
12
  */
14
- function flattenExportStar(absolutePathOfBarrelFile, importPath, isExportTypeStar = false) {
13
+ function flattenExportStar(absolutePathOfBarrelFile, importPath) {
15
14
  const result = [];
16
15
  const importAbsolutePath = (0, importUtils_1.getAbsolutePathOfImport)(absolutePathOfBarrelFile, importPath);
17
16
  const moduleExports = (0, getExportsFromModule_1.getExportsFromModule)(importAbsolutePath);
@@ -22,18 +21,17 @@ function flattenExportStar(absolutePathOfBarrelFile, importPath, isExportTypeSta
22
21
  exportedName: importName,
23
22
  importedName: importName,
24
23
  importPath,
25
- // If the export star is type-only, all exports become type-only
26
- typeOnly: isExportTypeStar || definition.typeOnly,
24
+ typeOnly: definition.typeOnly,
27
25
  });
28
26
  }
29
27
  for (const reExport of moduleExports.reExports) {
30
28
  if (reExport.type === 'exportAll') {
31
29
  const reachableExports = (0, getAllExportDefinitionsReachableFromModule_1.getAllExportDefinitionsReachableFromModule)((0, importUtils_1.getAbsolutePathOfImport)(absolutePathOfBarrelFile, reExport.importPath), absolutePathOfBarrelFile);
32
- result.push(...reachableExports.map((exp) => ({ ...exp, typeOnly: isExportTypeStar || exp.typeOnly })));
30
+ result.push(...reachableExports.map((exp) => ({ ...exp, typeOnly: exp.typeOnly })));
33
31
  }
34
32
  else {
35
33
  const resolved = (0, getExportDefinitionFromReExport_1.getExportDefinitionFromReExport)((0, importUtils_1.getAbsolutePathOfImport)(absolutePathOfBarrelFile, reExport.importPath), reExport);
36
- result.push({ ...resolved, typeOnly: isExportTypeStar || resolved.typeOnly });
34
+ result.push({ ...resolved, typeOnly: resolved.typeOnly });
37
35
  }
38
36
  }
39
37
  return result;
@@ -1 +1 @@
1
- {"version":3,"file":"flattenExportStar.js","sourceRoot":"","sources":["../src/flattenExportStar.ts"],"names":[],"mappings":";;AAWA,8CAwCC;AAnDD,iEAA8D;AAC9D,+CAAwD;AACxD,uFAA8G;AAC9G,6GAA0G;AAE1G;;;;;GAKG;AACH,SAAgB,iBAAiB,CAC/B,wBAAgC,EAChC,UAAkB,EAClB,mBAA4B,KAAK;IAEjC,MAAM,MAAM,GAA+B,EAAE,CAAC;IAE9C,MAAM,kBAAkB,GAAG,IAAA,qCAAuB,EAAC,wBAAwB,EAAE,UAAU,CAAC,CAAC;IACzF,MAAM,aAAa,GAAG,IAAA,2CAAoB,EAAC,kBAAkB,CAAC,CAAC;IAE/D,KAAK,MAAM,UAAU,IAAI,aAAa,CAAC,WAAW,EAAE,CAAC;QACnD,MAAM,UAAU,GAAG,UAAU,CAAC,IAAI,KAAK,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC;QAErF,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,0BAA0B;YAChC,YAAY,EAAE,UAAU;YACxB,YAAY,EAAE,UAAU;YACxB,UAAU;YACV,gE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version": "0.10.4",
3
+ "version": "0.11.0",
4
4
  "description": "Utilities for optimizing barrel files",
5
5
  "main": "lib/index.js",
6
6
  "bin": "lib/cli.js",