Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

feat(gates): a file whose colours are not the palette's says so

esengine78c0c34e6a5e
diff --git a/desktop b/desktop
index 0ea740242..a43564df0 160000
--- a/desktop
+++ b/desktop
@@ -1 +1 @@
-Subproject commit 0ea74024205d764d7063d8d08ca25fa2f12a03f4
+Subproject commit a43564df0d89ea0b8e4da5f17d408b704fd8c8eb
diff --git a/tools/baselines/theme-drift.json b/tools/baselines/theme-drift.json
index b29d73a8d..4ef86e704 100644
--- a/tools/baselines/theme-drift.json
+++ b/tools/baselines/theme-drift.json
@@ -55,7 +55,6 @@
"colourLiteralsInCode": {
"components/AudioWavePreview.tsx": 2,
"components/ColorControl.tsx": 3,
- "components/LoadingScreen.tsx": 6,
"components/PerfOverlay.tsx": 1,
"components/SettingsRow.tsx": 3,
"diagnostics/redact.ts": 2,
@@ -65,9 +64,7 @@
"panels/ContentBrowser.tsx": 3,
"panels/Details.tsx": 1,
"panels/inspector/controls.tsx": 1,
- "panels/MaterialGraphEditor.tsx": 4,
"panels/ProfilerPanel.tsx": 1,
- "panels/ScriptGraphEditor.tsx": 6,
"panels/SpinePreviewPane.tsx": 4,
"panels/Viewport.tsx": 2,
"settings/editorSettings.ts": 10,
diff --git a/tools/check-theme.mjs b/tools/check-theme.mjs
index 44ad6fcca..2cc724cd6 100644
--- a/tools/check-theme.mjs
+++ b/tools/check-theme.mjs
@@ -311,6 +311,17 @@ const handRolledByFile = () => {
return out;
};
+/**
+ * Files whose colours are NOT the palette's to hold, each with the reason —
+ * without this the ratchet's target of zero is unreachable, and a target nobody
+ * can reach is not one anybody aims at.
+ */
+const NOT_THE_PALETTE = {
+ 'components/LoadingScreen.tsx':
+ 'the Estella mark itself (see favicon.svg). Its blue and --star came from the same place,'
+ + ' but a logo that moves when the accent moves is not a logo',
+};
+
/**
* Colour written into CODE rather than read from a token. The ratchet above
* guards `theme/`, which is where tokens are DEFINED; this guards everywhere
@@ -327,10 +338,12 @@ const colourLiteralInCodeByFile = () => {
continue;
}
if (!/\.tsx?$/.test(e.name) || e.name.includes('.generated.')) continue;
+ const rel = path.relative(path.join(ROOT, 'desktop', 'src'), full).replaceAll(path.sep, '/');
+ if (rel in NOT_THE_PALETTE) continue;
const text = readFileSync(full, 'utf8');
const n = (text.match(/#[0-9a-fA-F]{3,8}\b/g)?.length ?? 0)
+ (text.match(/\brgba?\(/g)?.length ?? 0);
- if (n > 0) out[path.relative(path.join(ROOT, 'desktop', 'src'), full).replaceAll(path.sep, '/')] = n;
+ if (n > 0) out[rel] = n;
}
};
walk(path.join(ROOT, 'desktop', 'src'));
@@ -417,7 +430,8 @@ console.log(
+ `${identityUses} identity-token use(s), every one on the thing it names. `
+ `Ratchets hold: ${total} off-grid spacing(s), `
+ `${Object.values(colours).reduce((a, b) => a + b, 0)} colour literal(s) in theme `
- + `and ${Object.values(colourCode).reduce((a, b) => a + b, 0)} in code, `
+ + `and ${Object.values(colourCode).reduce((a, b) => a + b, 0)} in code `
+ + `(${Object.keys(NOT_THE_PALETTE).length} file(s) declared not the palette's), `
+ `${Object.values(fontSizes).reduce((a, b) => a + b, 0)} raw font-size(s), `
+ `${icons.sizes.length} icon size(s) / ${icons.strokes.length} stroke width(s), `
+ `${Object.values(handRolled).reduce((a, b) => a + b, 0)} hand-rolled control(s).`,