New changes
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
|
||||
import {
|
||||
existsSync,
|
||||
mkdirSync,
|
||||
readFileSync,
|
||||
readdirSync,
|
||||
unlinkSync,
|
||||
writeFileSync,
|
||||
} from "node:fs";
|
||||
import { join, resolve } from "node:path";
|
||||
|
||||
const root = resolve(import.meta.dir, "..");
|
||||
@@ -424,9 +431,12 @@ for (const item of uiReference.components) {
|
||||
);
|
||||
}
|
||||
for (const file of readdirSync(componentPages)) {
|
||||
if (file.endsWith(".wrn") && !currentComponentFiles.has(file)) {
|
||||
throw new Error(`Stale generated component page: ${file}`);
|
||||
if (!file.endsWith(".wrn") || currentComponentFiles.has(file)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
unlinkSync(join(componentPages, file));
|
||||
console.log(`Removed stale generated component page: ${file}`);
|
||||
}
|
||||
|
||||
writeFileSync(
|
||||
|
||||
Reference in New Issue
Block a user