pure-index
Advanced tools
Comparing version 1.0.0-next.2 to 1.0.0-next.3
@@ -5,9 +5,6 @@ import { extname } from 'node:path'; | ||
const getFiles = async ({ config }) => { | ||
const exclude = config.exclude | ||
.map((item) => item.replace(/(^\/|\/$)/g, '').replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')) | ||
.join('|'); | ||
const excludeRegExp = new RegExp(exclude); | ||
const exclude = new Set(config.exclude); | ||
const extensions = new Set(config.extensions); | ||
const files = new fdir() | ||
.exclude((dirName) => excludeRegExp.test(dirName)) | ||
.exclude((dirName) => exclude.has(dirName)) | ||
.filter((path) => extensions.has(extname(path))) | ||
@@ -14,0 +11,0 @@ .withBasePath() |
@@ -24,2 +24,14 @@ import { existsSync } from 'node:fs'; | ||
}; | ||
const printExportAllError = (pkg) => { | ||
_printError({ | ||
text: ` | ||
ExportAllDeclaration was found inside the ${pkg.name} package index file. | ||
Unfortunately, Pure Index does not parse "export *" to find out what is exported from there. | ||
But it can help with replacing: | ||
https://space307.github.io/pure-index/explanation/limitations | ||
`, | ||
}); | ||
}; | ||
const getExports = async ({ pkg, config }) => { | ||
@@ -72,2 +84,6 @@ if (!existsSync(pkg.path)) { | ||
} | ||
if (node.type === 'ExportAllDeclaration') { | ||
printExportAllError(pkg); | ||
process.exit(1); | ||
} | ||
} | ||
@@ -74,0 +90,0 @@ return result; |
{ | ||
"name": "pure-index", | ||
"type": "module", | ||
"version": "1.0.0-next.2", | ||
"version": "1.0.0-next.3", | ||
"description": "Pure Index is a tool for packages. It helps to clean your packages of unused exports with ease.", | ||
@@ -30,3 +30,3 @@ "main": "./dist/api/index.js", | ||
"devDependencies": { | ||
"@types/node": "20.10.6", | ||
"@types/node": "20.10.8", | ||
"@vitest/coverage-v8": "1.1.3", | ||
@@ -33,0 +33,0 @@ "effector": "23.1.0", |
27203
666