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.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
fix(editor): an export's output is not the project's content
yhhf871db3a550a
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 26a9e3120..3c6d5f21a 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -35,6 +35,13 @@ published separately; it ships inside the editor.### Fixed+- **An export's output is no longer mistaken for the project's content.** `dist/` and+ `build/` were excluded; `dist-web/`, `dist-android/`, `dist-wechat/` and the rest were+ not — so the registry adopted a finished build's assets as if they had been authored,+ and they show up in the Content Browser. Harmless while nothing forced them into a+ build; with data assets always included, the next build would have shipped the previous+ one's manifest inside itself. Any `dist-*` folder is build output now.+- **Checking for updates showed nothing, and could show nothing forever.** The toast wasposted only once the network had answered, so Help ▸ Check for Updates was a click withno visible effect for as long as the request took — and the requests had no timeout atdiff --git a/desktop/electron/contentPolicy.ts b/desktop/electron/contentPolicy.tsindex 694b75db7..b4bfc674b 100644--- a/desktop/electron/contentPolicy.ts+++ b/desktop/electron/contentPolicy.ts@@ -15,8 +15,19 @@ export const META_EXT = '.meta';* (`.esengine`, `.git`, …) are excluded by the dot rule. */const NON_CONTENT_DIRS = new Set(['node_modules', 'dist', 'dist-electron', 'build']);+/**+ * Where an export lands: `dist-web`, `dist-android`, `dist-wechat`, one per+ * platform and more of them over time.+ *+ * A build's OUTPUT is not the project's content — but it is full of files that+ * look exactly like content, because it is made of them. Left in, the registry+ * adopts a finished build's assets as if the user had authored them, and the+ * next build ships the previous one's manifest inside itself.+ */+const isBuildOutputDir = (name: string): boolean => name.startsWith('dist-');+export const isContentDir = (name: string): boolean =>- !name.startsWith('.') && !NON_CONTENT_DIRS.has(name);+ !name.startsWith('.') && !NON_CONTENT_DIRS.has(name) && !isBuildOutputDir(name);export const isContentFile = (name: string): boolean =>!name.startsWith('.') && !name.endsWith(META_EXT);@@ -27,7 +38,7 @@ export function isNonContentPath(rel: string): boolean {return rel.replace(/\\/g, '/').split('/')- .some((seg) => seg.startsWith('.') || NON_CONTENT_DIRS.has(seg));+ .some((seg) => seg.startsWith('.') || NON_CONTENT_DIRS.has(seg) || isBuildOutputDir(seg));}/**diff --git a/desktop/tests/content-policy.test.ts b/desktop/tests/content-policy.test.tsindex e1e22eb10..639c87c2e 100644--- a/desktop/tests/content-policy.test.ts+++ b/desktop/tests/content-policy.test.ts@@ -25,6 +25,18 @@ describe('content classification', () => {expect(isContentFile('.DS_Store')).toBe(false);});+ it("excludes an export's output, whichever platform wrote it", () => {+ // A build's output is made OF content, so every file in it looks like one.+ // Adopted, the registry treats a finished build as authored assets and the+ // next build ships the previous one's manifest inside itself.+ for (const dir of ['dist-web', 'dist-android', 'dist-wechat', 'dist-playable', 'dist-native']) {+ expect(isContentDir(dir)).toBe(false);+ expect(isNonContentPath(`${dir}/assets/hero.png`)).toBe(true);+ }+ // Not a prefix match on "dist": a folder of distortion sprites is content.+ expect(isContentDir('distortion')).toBe(true);+ });+it('treats any dot or build segment in a path as leaving content space', () => {expect(isNonContentPath('assets/hero.png')).toBe(false);expect(isNonContentPath('.esengine/cache/assets.json')).toBe(true);