fix(plugins): ignore archived extension dirs during discovery

Co-authored-by: chenzhuoms <chenzhuoms@users.noreply.github.com>
This commit is contained in:
Peter Steinberger
2026-02-22 19:18:50 +01:00
parent 8839162b97
commit 9da5f9819b
4 changed files with 56 additions and 1 deletions

View File

@@ -206,6 +206,23 @@ function isExtensionFile(filePath: string): boolean {
return !filePath.endsWith(".d.ts");
}
function shouldIgnoreScannedDirectory(dirName: string): boolean {
const normalized = dirName.trim().toLowerCase();
if (!normalized) {
return true;
}
if (normalized.endsWith(".bak")) {
return true;
}
if (normalized.includes(".backup-")) {
return true;
}
if (normalized.includes(".disabled")) {
return true;
}
return false;
}
function readPackageManifest(dir: string): PackageManifest | null {
const manifestPath = path.join(dir, "package.json");
if (!fs.existsSync(manifestPath)) {
@@ -362,6 +379,9 @@ function discoverInDirectory(params: {
if (!entry.isDirectory()) {
continue;
}
if (shouldIgnoreScannedDirectory(entry.name)) {
continue;
}
const manifest = readPackageManifest(fullPath);
const extensions = manifest ? resolvePackageExtensions(manifest) : [];