feat: strengthen design skill and refresh all showcases
Some checks failed
ci / build (push) Has been cancelled
Some checks failed
ci / build (push) Has been cancelled
This commit is contained in:
parent
69e5cc1efd
commit
e09d4efb1c
257 changed files with 8196 additions and 2374 deletions
|
|
@ -16,6 +16,13 @@ const BASE = path.join(SHOTS, "baseline");
|
|||
const CURR = path.join(SHOTS, "current");
|
||||
const CHROME = "C:/Program Files/Google/Chrome/Application/chrome.exe";
|
||||
const UPDATE = process.argv.includes("--update-baseline");
|
||||
const scopedUpdates = new Set(
|
||||
process.argv
|
||||
.filter((arg) => arg.startsWith("--update-baseline="))
|
||||
.flatMap((arg) => arg.slice("--update-baseline=".length).split(","))
|
||||
.map((name) => name.trim())
|
||||
.filter(Boolean),
|
||||
);
|
||||
|
||||
const APPS = {
|
||||
"gaon-lms": ["dashboard", "students", "attendance", "grades", "files", "calendar", "counsel", "report", "notice"],
|
||||
|
|
@ -54,9 +61,10 @@ const rows = [];
|
|||
for (const name of shots) {
|
||||
const cur = PNG.sync.read(fs.readFileSync(path.join(CURR, name)));
|
||||
const baseFile = path.join(BASE, name);
|
||||
if (UPDATE || !fs.existsSync(baseFile)) {
|
||||
const updateThisBaseline = UPDATE || scopedUpdates.has(name);
|
||||
if (updateThisBaseline || !fs.existsSync(baseFile)) {
|
||||
fs.writeFileSync(baseFile, PNG.sync.write(cur));
|
||||
rows.push({ name, status: UPDATE ? "갱신" : "신규기준", diff: "—" });
|
||||
rows.push({ name, status: updateThisBaseline ? "갱신" : "신규기준", diff: "—" });
|
||||
continue;
|
||||
}
|
||||
const base = PNG.sync.read(fs.readFileSync(baseFile));
|
||||
|
|
@ -76,6 +84,12 @@ for (const name of shots) {
|
|||
rows.push({ name, status: bad ? "FAIL" : "PASS", diff: ratio.toFixed(3) + "%" });
|
||||
}
|
||||
|
||||
const unknownScopedUpdates = [...scopedUpdates].filter((name) => !shots.includes(name));
|
||||
if (unknownScopedUpdates.length) {
|
||||
console.error(`Unknown baseline name(s): ${unknownScopedUpdates.join(", ")}`);
|
||||
process.exit(2);
|
||||
}
|
||||
|
||||
for (const r of rows) console.log(`${r.status.padEnd(4)} ${r.name} ${r.diff}`);
|
||||
console.log(`\nVISUAL: ${fails ? `${fails} FAIL (기준 대비 회귀)` : UPDATE ? "기준 갱신 완료" : "ALL MATCH"}`);
|
||||
process.exit(fails ? 1 : 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue