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(build): the Build dialog and the agent package with an export profile

esengine6ff8bbf6e8a8
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f48400d95..8c649861f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,7 +16,7 @@ published separately; it ships inside the editor.
### Added
-- **Export profiles.** A project can name several exports of one target in `packaging.profiles` — a test and a production WeChat build, each with its own AppID, CDN root and development or shipping configuration, writing only what differs from the project's settings. `estella export --profile <name>` builds one, and the size history records which profile a build used.
+- **Export profiles.** A project can name several exports of one target in `packaging.profiles` — a test and a production WeChat build, each with its own AppID, CDN root and development or shipping configuration, writing only what differs from the project's settings. The Build dialog picks one per target and shows what it sets, locked; `estella export --profile <name>` and the agent's `export_game` build the same one, and the size history records which profile a build used.
### Fixed
diff --git a/desktop b/desktop
index a4dcbabcb..0fb1d68b0 160000
--- a/desktop
+++ b/desktop
@@ -1 +1 @@
-Subproject commit a4dcbabcb0cb360428514729b82ddfdc2c45c1ea
+Subproject commit 0fb1d68b0c25f38d2ad186cd4b63b412634fc9c1
diff --git a/pipeline/src/export/sizeHistory.ts b/pipeline/src/export/sizeHistory.ts
index f0d4d9a28..73bd3d59b 100644
--- a/pipeline/src/export/sizeHistory.ts
+++ b/pipeline/src/export/sizeHistory.ts
@@ -69,6 +69,7 @@ export const PACKAGING_SIZE_ROLE: Readonly<Record<string, keyof SizeSettings | '
splash: 'content',
platforms: 'content',
profiles: 'profile',
+ profile: 'profile',
};
/** The settings this build ran with, out of everything the export was given. */
diff --git a/pipeline/src/project/format.ts b/pipeline/src/project/format.ts
index 5f5ff45c0..e94bafed7 100644
--- a/pipeline/src/project/format.ts
+++ b/pipeline/src/project/format.ts
@@ -403,6 +403,9 @@ export interface ProjectPackaging {
/** Named exports of one target each (a test and a production WeChat build),
* picked in the Build dialog or with `estella export --profile <name>`. */
profiles?: Record<string, ExportProfile>;
+ /** The profile the Build dialog last packaged with; empty when it used the
+ * project's own settings. */
+ profile?: string;
}
/** The packaging settings a profile may set; the rest are the project's. */
@@ -927,6 +930,7 @@ export function parseManifest(raw: unknown): ProjectManifest {
if (orientation) pkg.orientation = orientation;
const profiles = parseExportProfiles(p.profiles);
if (profiles) pkg.profiles = profiles;
+ if (typeof p.profile === 'string' && p.profile !== '') pkg.profile = p.profile;
if (Object.keys(pkg).length > 0) manifest.packaging = pkg;
}
return manifest;
diff --git a/pipeline/tests/project-export-options.test.ts b/pipeline/tests/project-export-options.test.ts
index 51c1de86b..543947c4e 100644
--- a/pipeline/tests/project-export-options.test.ts
+++ b/pipeline/tests/project-export-options.test.ts
@@ -52,6 +52,13 @@ describe('the export a project describes', () => {
});
});
+ it('cooks assets the way the project asked when the caller says nothing', async () => {
+ const skip = parseManifest({ formatVersion: '1', name: 'p', packaging: { assetCompression: 'skip' } });
+ expect(await projectExportOptions(root, skip, 'web'))
+ .toMatchObject({ compressTextures: false, compressAudio: false, atlasTextures: false });
+ expect((await projectExportOptions(root, manifest, 'web')).compressTextures).toBe(true);
+ });
+
it('carries the engine modules the project chose, per target', async () => {
const o = await projectExportOptions(root, manifest, 'wechat');
expect(o.features?.modules).toEqual({ 'esengine/tilemap': 'exclude' });
diff --git a/tools/check-project-health.mjs b/tools/check-project-health.mjs
index 9f1c6cd55..40303e681 100644
--- a/tools/check-project-health.mjs
+++ b/tools/check-project-health.mjs
@@ -129,13 +129,21 @@ else {
if (!/reason: 'preflight-blocked'/.test(door[0])) {
say(STORE, 'a refused build is not distinguishable from a failed one — it owes reason: preflight-blocked');
}
- // What a project's assets cook as is the PROJECT's, so the shared door has to
- // derive it. Left to each caller, an agent's build shipped a raw PNG and no
- // basis transcoder where the dialog's shipped a KTX2 and one — same project.
- if (!/cookOptionsOf\(/.test(door[0])) {
- say(STORE, 'exportGame does not derive the cook options from the project — a caller that'
- + ' says nothing gets `undefined`, which is not what the project asked for');
- }
+}
+
+// 5b'. Every door's export starts from the one reading of the project: left to
+// each caller, an agent's build shipped a raw PNG where the dialog's shipped
+// a KTX2 — same project.
+const MAIN = 'desktop/electron/main.ts';
+const OPTIONS = 'pipeline/src/export/projectExportOptions.ts';
+const handler = has(MAIN) ? /'project:exportGame',[\s\S]*?\n\);/.exec(read(MAIN)) : null;
+if (!handler) say(MAIN, 'no project:exportGame handler to check');
+else if (!/\.\.\.base,/.test(handler[0]) || !/projectExportOptions\(/.test(handler[0])) {
+ say(MAIN, 'the export handler does not start from projectExportOptions — a caller that says'
+ + ' nothing gets `undefined`, which is not what the project asked for');
+}
+if (!has(OPTIONS) || !/\.\.\.cookOptionsOf\(manifest\)/.test(read(OPTIONS))) {
+ say(OPTIONS, 'projectExportOptions does not derive the cook options from the project');
}
// 5c. No door reaches around the store to the bridge: a tool naming the exporter
diff --git a/tools/releaseNotes.mjs b/tools/releaseNotes.mjs
index 456dc2424..b8827ffbc 100644
--- a/tools/releaseNotes.mjs
+++ b/tools/releaseNotes.mjs
@@ -1151,5 +1151,9 @@ export const NOTED = {
'fix(export): the editor and the command line export a project from one reading of it':
{ note: 'An export from the Build dialog and one from `estella export` now read the project the same way. The dialog\'s builds keep the engine modules a project includes or excludes, which they ignored; the command line\'s carry the project\'s app id (a native package was always `com.estella.game`, so two games replaced each other on a phone), its script entry and scenes folder, its desktop channel and Steam app, and a playable\'s ad network.' },
'feat(export): a project names its exports as profiles, and the command line builds one':
- { note: '**Export profiles.** A project can name several exports of one target in `packaging.profiles` — a test and a production WeChat build, each with its own AppID, CDN root and development or shipping configuration, writing only what differs from the project\'s settings. `estella export --profile <name>` builds one, and the size history records which profile a build used.' },
+ { note: '**Export profiles.** A project can name several exports of one target in `packaging.profiles` — a test and a production WeChat build, each with its own AppID, CDN root and development or shipping configuration, writing only what differs from the project\'s settings. The Build dialog picks one per target and shows what it sets, locked; `estella export --profile <name>` and the agent\'s `export_game` build the same one, and the size history records which profile a build used.' },
+ 'feat(build): the Build dialog packages with a project\'s export profile':
+ { note: '**Export profiles.** A project can name several exports of one target in `packaging.profiles` — a test and a production WeChat build, each with its own AppID, CDN root and development or shipping configuration, writing only what differs from the project\'s settings. The Build dialog picks one per target and shows what it sets, locked; `estella export --profile <name>` and the agent\'s `export_game` build the same one, and the size history records which profile a build used.' },
+ 'feat(build): the Build dialog and the agent package with an export profile':
+ { note: '**Export profiles.** A project can name several exports of one target in `packaging.profiles` — a test and a production WeChat build, each with its own AppID, CDN root and development or shipping configuration, writing only what differs from the project\'s settings. The Build dialog picks one per target and shows what it sets, locked; `estella export --profile <name>` and the agent\'s `export_game` build the same one, and the size history records which profile a build used.' },
};