fix: ignore generated compatibility markers
This commit is contained in:
@@ -9,6 +9,7 @@ const beginPattern = /REF-COMPAT:BEGIN ([a-z0-9]+(?:-[a-z0-9]+)*)/g;
|
|||||||
const endPattern = /REF-COMPAT:END ([a-z0-9]+(?:-[a-z0-9]+)*)/g;
|
const endPattern = /REF-COMPAT:END ([a-z0-9]+(?:-[a-z0-9]+)*)/g;
|
||||||
const inventoryPattern = /<!-- REF-COMPAT-ID: ([a-z0-9]+(?:-[a-z0-9]+)*) -->/g;
|
const inventoryPattern = /<!-- REF-COMPAT-ID: ([a-z0-9]+(?:-[a-z0-9]+)*) -->/g;
|
||||||
const sourceExtensions = new Set(['.ts', '.tsx', '.vue', '.js', '.mjs', '.cjs']);
|
const sourceExtensions = new Set(['.ts', '.tsx', '.vue', '.js', '.mjs', '.cjs']);
|
||||||
|
const ignoredDirectories = new Set(['node_modules', 'dist', 'coverage', '.turbo']);
|
||||||
|
|
||||||
const collectFiles = async (directory) => {
|
const collectFiles = async (directory) => {
|
||||||
const entries = await readdir(directory, { withFileTypes: true });
|
const entries = await readdir(directory, { withFileTypes: true });
|
||||||
@@ -16,6 +17,9 @@ const collectFiles = async (directory) => {
|
|||||||
for (const entry of entries) {
|
for (const entry of entries) {
|
||||||
const absolute = path.join(directory, entry.name);
|
const absolute = path.join(directory, entry.name);
|
||||||
if (entry.isDirectory()) {
|
if (entry.isDirectory()) {
|
||||||
|
if (ignoredDirectories.has(entry.name)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
files.push(...(await collectFiles(absolute)));
|
files.push(...(await collectFiles(absolute)));
|
||||||
} else if (sourceExtensions.has(path.extname(entry.name))) {
|
} else if (sourceExtensions.has(path.extname(entry.name))) {
|
||||||
files.push(absolute);
|
files.push(absolute);
|
||||||
|
|||||||
Reference in New Issue
Block a user