@bitmagic/cli 0.1.83-dev.6 → 0.1.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -7
- package/dist/bug-report/dev-view.d.ts +10 -0
- package/dist/bug-report/dev-view.js +35 -0
- package/dist/bug-report/dev-view.js.map +1 -0
- package/dist/bug-report/send.d.ts +54 -0
- package/dist/bug-report/send.js +143 -0
- package/dist/bug-report/send.js.map +1 -0
- package/dist/cli.d.ts +29 -0
- package/dist/cli.js +4 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/build.d.ts +4 -0
- package/dist/commands/build.js +20 -3
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/pages.d.ts +25 -0
- package/dist/commands/pages.js +87 -0
- package/dist/commands/pages.js.map +1 -0
- package/dist/commands/report-bug.d.ts +42 -0
- package/dist/commands/report-bug.js +98 -0
- package/dist/commands/report-bug.js.map +1 -0
- package/dist/commands/upgrade.d.ts +9 -2
- package/dist/commands/upgrade.js +27 -6
- package/dist/commands/upgrade.js.map +1 -1
- package/dist/editor/bug-report-panel.d.ts +23 -0
- package/dist/editor/bug-report-panel.js +191 -0
- package/dist/editor/bug-report-panel.js.map +1 -0
- package/dist/editor/hud-replay-page.d.ts +9 -0
- package/dist/editor/hud-replay-page.js +11 -1
- package/dist/editor/hud-replay-page.js.map +1 -1
- package/dist/editor/server.js +54 -1
- package/dist/editor/server.js.map +1 -1
- package/dist/editor/shell-page.js +11 -0
- package/dist/editor/shell-page.js.map +1 -1
- package/dist/project/context.d.ts +7 -0
- package/dist/project/context.js.map +1 -1
- package/dist/publish/bundle.d.ts +43 -0
- package/dist/publish/bundle.js +133 -29
- package/dist/publish/bundle.js.map +1 -1
- package/dist/publish/source-zip.d.ts +6 -0
- package/dist/publish/source-zip.js +1 -1
- package/dist/publish/source-zip.js.map +1 -1
- package/dist/scaffold/engine-capabilities.d.ts +4 -0
- package/dist/scaffold/engine-capabilities.js.map +1 -1
- package/dist/scaffold/game-migration.d.ts +25 -63
- package/dist/scaffold/game-migration.js +30 -439
- package/dist/scaffold/game-migration.js.map +1 -1
- package/dist/scaffold/github-pages.d.ts +83 -0
- package/dist/scaffold/github-pages.js +200 -0
- package/dist/scaffold/github-pages.js.map +1 -0
- package/dist/scaffold/import-codemod.d.ts +4 -3
- package/dist/scaffold/import-codemod.js +16 -34
- package/dist/scaffold/import-codemod.js.map +1 -1
- package/dist/scaffold/project-files.d.ts +11 -0
- package/dist/scaffold/project-files.js +21 -8
- package/dist/scaffold/project-files.js.map +1 -1
- package/dist/scaffold/skill-files.js +34 -3
- package/dist/scaffold/skill-files.js.map +1 -1
- package/dist/vendor/hud-theme/engine/hud/fonts.js +6 -4
- package/package.json +6 -6
- package/dist/scaffold/legacy-game-baselines.d.ts +0 -14
- package/dist/scaffold/legacy-game-baselines.js +0 -218
- package/dist/scaffold/legacy-game-baselines.js.map +0 -1
|
@@ -1,447 +1,23 @@
|
|
|
1
1
|
import * as fs from 'fs';
|
|
2
2
|
import * as path from 'path';
|
|
3
|
-
import {
|
|
4
|
-
import { applyTextEdits } from '@bitmagic/asset-core/engine-specifiers';
|
|
5
|
-
import { LEGACY_GAME_BODIES, LEGACY_GAME_MEMBERS } from './legacy-game-baselines.js';
|
|
6
|
-
/**
|
|
7
|
-
* `bitmagic upgrade --migrate-game`: turn a Game.ts written on the old baseline — a whole
|
|
8
|
-
* `class VoxelGame implements GameModule` that built its own Spawner, VehicleManager,
|
|
9
|
-
* VehicleSpawner and PlayerLoader and handed them to the engine with `setX()` — into the small
|
|
10
|
-
* `class VoxelGame extends VoxelGameBase` every game is now, keeping only what the creator changed.
|
|
11
|
-
*
|
|
12
|
-
* It only rewrites what it can prove:
|
|
13
|
-
*
|
|
14
|
-
* - a member identical (token for token, comments and layout ignored) to the same member in any
|
|
15
|
-
* released baseline is the default, and is dropped;
|
|
16
|
-
* - `constructor`, `load`, `update` and `dispose` may additionally carry the creator's own
|
|
17
|
-
* statements, but only inserted at a point a VoxelGameBase hook runs at — after the world
|
|
18
|
-
* (`onWorldLoaded`), after the camera (`onCameraReady`), after the player controller
|
|
19
|
-
* (`onPlayerReady`), at the end of a frame (`updateCamera`), beside the vehicles' disposal
|
|
20
|
-
* (`disposeGameplay`), or at the very start or end of the method — and each default statement
|
|
21
|
-
* must still be there, in order;
|
|
22
|
-
* - a modified `setupCamera` or `setupVoxelLighting` stays as an override (both are hooks now);
|
|
23
|
-
* - anything the creator added (fields, methods, top-level code) is kept as it is, with
|
|
24
|
-
* `this.spawner` / `this.vehicleSpawner` read through `getSpawner()` / `getVehicleSpawner()`.
|
|
25
|
-
*
|
|
26
|
-
* Anything else — a default statement removed or edited, a statement added where no hook runs,
|
|
27
|
-
* a changed member VoxelGameBase also declares — leaves the file unchanged and says why. The
|
|
28
|
-
* result is then type-checked with the project's own compiler and put back if it does not
|
|
29
|
-
* compile, so a migration that runs is one that compiles.
|
|
30
|
-
*/
|
|
3
|
+
import { isLegacyGameText, planGameMigrationFromOrigins, } from '@bitmagic/asset-core/game-migration';
|
|
31
4
|
export const GAME_FILE = 'src/work/Game.ts';
|
|
32
5
|
export const BASE_FILE = 'src/work/VoxelGameBase.ts';
|
|
6
|
+
/** The step-by-step rewrite for the project's agent, when `--migrate-game` cannot prove one (vendored from game/agent-docs). */
|
|
7
|
+
export const GAME_MIGRATION_GUIDE = 'engine/agent-docs/migrating-game-to-voxelgamebase.md';
|
|
33
8
|
/** The new baseline, as the engine just vendored it. */
|
|
34
9
|
export const VENDORED_BASELINE_DIR = 'engine/baseline';
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const text = n.kind === ts.SyntaxKind.EndOfFileToken ? '' : n.getText(sf);
|
|
47
|
-
if (text.length > 0)
|
|
48
|
-
tokens.push(text);
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
for (const child of children)
|
|
52
|
-
walk(child);
|
|
53
|
-
};
|
|
54
|
-
walk(node);
|
|
55
|
-
return tokens.join(' ');
|
|
56
|
-
}
|
|
57
|
-
/** A statement or member compared by its tokens alone, so comments and layout never matter. */
|
|
58
|
-
export function fingerprint(ts, node, sf) {
|
|
59
|
-
return createHash('sha1').update(tokenText(ts, node, sf)).digest('hex').slice(0, 16);
|
|
60
|
-
}
|
|
61
|
-
function memberName(ts, member, sf) {
|
|
62
|
-
if (ts.isConstructorDeclaration(member))
|
|
63
|
-
return 'constructor';
|
|
64
|
-
if (!member.name)
|
|
65
|
-
return null;
|
|
66
|
-
const name = member.name.getText(sf);
|
|
67
|
-
if (ts.isGetAccessorDeclaration(member))
|
|
68
|
-
return `get ${name}`;
|
|
69
|
-
if (ts.isSetAccessorDeclaration(member))
|
|
70
|
-
return `set ${name}`;
|
|
71
|
-
return name;
|
|
72
|
-
}
|
|
73
|
-
function findGameClass(ts, sf) {
|
|
74
|
-
for (const statement of sf.statements) {
|
|
75
|
-
if (ts.isClassDeclaration(statement) && statement.name?.text === 'VoxelGame')
|
|
76
|
-
return statement;
|
|
77
|
-
}
|
|
78
|
-
return null;
|
|
79
|
-
}
|
|
80
|
-
/** The statements a segmented body is compared on: a `load` wrapped in try/catch is its try block. */
|
|
81
|
-
function bodyStatements(ts, method) {
|
|
82
|
-
const body = (ts.isConstructorDeclaration(method) || ts.isMethodDeclaration(method)) ? method.body : undefined;
|
|
83
|
-
if (!body)
|
|
84
|
-
return null;
|
|
85
|
-
const only = body.statements.length === 1 ? body.statements[0] : undefined;
|
|
86
|
-
if (only && ts.isTryStatement(only) && only.catchClause && !only.finallyBlock) {
|
|
87
|
-
return { statements: only.tryBlock.statements, catchClause: only.catchClause };
|
|
88
|
-
}
|
|
89
|
-
return { statements: body.statements, catchClause: null };
|
|
90
|
-
}
|
|
91
|
-
/** The named gaps of a default body: where a hook (or the method's own start/end) runs. */
|
|
92
|
-
function anchorsFor(method, texts) {
|
|
93
|
-
const at = (pred) => texts.findIndex(pred);
|
|
94
|
-
const anchors = { start: 0, end: texts.length };
|
|
95
|
-
if (method === 'constructor')
|
|
96
|
-
delete anchors.start;
|
|
97
|
-
if (method === 'load') {
|
|
98
|
-
delete anchors.start;
|
|
99
|
-
const player = at((t) => t.startsWith('this . playerLoader . prefetchPlayerAnimations') || t.startsWith('this . player = await this . playerLoader . loadPlayer'));
|
|
100
|
-
if (player >= 0)
|
|
101
|
-
anchors.onWorldLoaded = player;
|
|
102
|
-
const camera = at((t) => t === 'this . setupCamera ( ) ;');
|
|
103
|
-
if (camera >= 0)
|
|
104
|
-
anchors.onCameraReady = camera + 1;
|
|
105
|
-
const controller = at((t) => t === 'await this . setupPlayerController ( ) ;');
|
|
106
|
-
if (controller >= 0)
|
|
107
|
-
anchors.onPlayerReady = controller + 1;
|
|
108
|
-
}
|
|
109
|
-
if (method === 'dispose') {
|
|
110
|
-
const vehicles = at((t) => t === 'this . vehicleManager . dispose ( ) ;');
|
|
111
|
-
if (vehicles >= 0)
|
|
112
|
-
anchors.disposeGameplay = vehicles + 1;
|
|
113
|
-
}
|
|
114
|
-
return anchors;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* The fingerprints of a pre-VoxelGameBase Game.ts — every member, plus the statement list and
|
|
118
|
-
* hook gaps of each segmented method. Null when the file has no such class. Run over every
|
|
119
|
-
* released baseline by `scripts/gen-legacy-game-baselines.mjs` to produce the known defaults.
|
|
120
|
-
*/
|
|
121
|
-
export function describeLegacyGame(ts, text) {
|
|
122
|
-
const sf = ts.createSourceFile('Game.ts', text, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
|
123
|
-
const cls = findGameClass(ts, sf);
|
|
124
|
-
if (!cls || extendsClause(ts, cls))
|
|
125
|
-
return null;
|
|
126
|
-
const shape = { members: {}, bodies: {} };
|
|
127
|
-
for (const member of cls.members) {
|
|
128
|
-
const name = memberName(ts, member, sf);
|
|
129
|
-
if (name === null)
|
|
130
|
-
continue;
|
|
131
|
-
shape.members[name] = fingerprint(ts, member, sf);
|
|
132
|
-
if (isSegmentedMethod(name)) {
|
|
133
|
-
const body = bodyStatements(ts, member);
|
|
134
|
-
if (!body)
|
|
135
|
-
continue;
|
|
136
|
-
const texts = body.statements.map((s) => tokenText(ts, s, sf));
|
|
137
|
-
shape.bodies[name] = {
|
|
138
|
-
statements: body.statements.map((s) => fingerprint(ts, s, sf)),
|
|
139
|
-
...(body.catchClause ? { catchClause: fingerprint(ts, body.catchClause, sf) } : {}),
|
|
140
|
-
anchors: anchorsFor(name, texts),
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
return shape;
|
|
145
|
-
}
|
|
146
|
-
function extendsClause(ts, cls) {
|
|
147
|
-
for (const clause of cls.heritageClauses ?? []) {
|
|
148
|
-
if (clause.token === ts.SyntaxKind.ExtendsKeyword)
|
|
149
|
-
return clause.types[0] ?? null;
|
|
150
|
-
}
|
|
151
|
-
return null;
|
|
152
|
-
}
|
|
153
|
-
function matchBody(ts, sf, method, statements, catchClause, version) {
|
|
154
|
-
const catchFp = catchClause ? fingerprint(ts, catchClause, sf) : undefined;
|
|
155
|
-
if (catchFp !== version.catchClause) {
|
|
156
|
-
return { ok: false, matched: 0, reason: `${method}() handles its errors differently from the baseline` };
|
|
157
|
-
}
|
|
158
|
-
const gaps = new Map();
|
|
159
|
-
let j = 0;
|
|
160
|
-
for (const statement of statements) {
|
|
161
|
-
if (j < version.statements.length && fingerprint(ts, statement, sf) === version.statements[j]) {
|
|
162
|
-
j++;
|
|
163
|
-
continue;
|
|
164
|
-
}
|
|
165
|
-
const list = gaps.get(j) ?? [];
|
|
166
|
-
list.push(statement);
|
|
167
|
-
gaps.set(j, list);
|
|
168
|
-
}
|
|
169
|
-
if (j < version.statements.length) {
|
|
170
|
-
return { ok: false, matched: j, reason: `${method}() no longer runs every statement the baseline's does (one was edited or removed)` };
|
|
171
|
-
}
|
|
172
|
-
const anchorAt = new Map(Object.entries(version.anchors).map(([name, gap]) => [gap, name]));
|
|
173
|
-
const byAnchor = new Map();
|
|
174
|
-
for (const [gap, added] of gaps) {
|
|
175
|
-
const anchor = anchorAt.get(gap);
|
|
176
|
-
if (anchor === undefined) {
|
|
177
|
-
const first = added[0];
|
|
178
|
-
const preview = first ? tokenText(ts, first, sf).slice(0, 60) : '';
|
|
179
|
-
return { ok: false, matched: j, reason: `${method}() has code added where no VoxelGameBase hook runs (\`${preview}\`)` };
|
|
180
|
-
}
|
|
181
|
-
byAnchor.set(anchor, added);
|
|
182
|
-
}
|
|
183
|
-
return { ok: true, insertions: { byAnchor } };
|
|
184
|
-
}
|
|
185
|
-
// ── Output ─────────────────────────────────────────────────────────────────────────────
|
|
186
|
-
const MEMBER_INDENT = ' ';
|
|
187
|
-
const BODY_INDENT = ' ';
|
|
188
|
-
/** A text block with its blank edges trimmed and its common indentation replaced by `indent`. */
|
|
189
|
-
function reindentText(text, indent) {
|
|
190
|
-
const lines = text.replace(/^\s*\n/, '').replace(/\s+$/, '').split('\n');
|
|
191
|
-
const widths = lines.filter((l) => l.trim().length > 0).map((l) => /^[ \t]*/.exec(l)?.[0].length ?? 0);
|
|
192
|
-
const strip = widths.length > 0 ? Math.min(...widths) : 0;
|
|
193
|
-
return lines.map((l) => (l.trim().length === 0 ? '' : indent + l.slice(strip))).join('\n');
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* A node's text with its leading comments, re-indented, with `this.spawner` /
|
|
197
|
-
* `this.vehicleSpawner` read through the getters VoxelGameBase keeps (the fields are gone: the
|
|
198
|
-
* engine owns both now) and a `private` modifier made `protected` when asked. Null when the node
|
|
199
|
-
* assigns one of those fields, which no rewrite can keep working.
|
|
200
|
-
*/
|
|
201
|
-
function nodeText(ts, sf, node, indent, makeProtected = false) {
|
|
202
|
-
const offset = node.getFullStart();
|
|
203
|
-
const edits = [];
|
|
204
|
-
let assigned = false;
|
|
205
|
-
const visit = (n) => {
|
|
206
|
-
if (ts.isPropertyAccessExpression(n) && n.expression.kind === ts.SyntaxKind.ThisKeyword
|
|
207
|
-
&& (n.name.text === 'spawner' || n.name.text === 'vehicleSpawner')) {
|
|
208
|
-
const parent = n.parent;
|
|
209
|
-
if (ts.isBinaryExpression(parent) && parent.left === n && parent.operatorToken.kind === ts.SyntaxKind.EqualsToken)
|
|
210
|
-
assigned = true;
|
|
211
|
-
const getter = n.name.text === 'spawner' ? 'getSpawner' : 'getVehicleSpawner';
|
|
212
|
-
edits.push({ start: n.getStart(sf) - offset, end: n.end - offset, text: `this.${getter}()` });
|
|
213
|
-
}
|
|
214
|
-
ts.forEachChild(n, visit);
|
|
215
|
-
};
|
|
216
|
-
visit(node);
|
|
217
|
-
if (assigned)
|
|
218
|
-
return null;
|
|
219
|
-
if (makeProtected && ts.canHaveModifiers(node)) {
|
|
220
|
-
const modifier = ts.getModifiers(node)?.find((m) => m.kind === ts.SyntaxKind.PrivateKeyword);
|
|
221
|
-
if (modifier)
|
|
222
|
-
edits.push({ start: modifier.getStart(sf) - offset, end: modifier.end - offset, text: 'protected' });
|
|
223
|
-
}
|
|
224
|
-
return reindentText(applyTextEdits(sf.text.slice(offset, node.end), edits), indent);
|
|
225
|
-
}
|
|
226
|
-
function statementsText(ts, sf, statements, indent) {
|
|
227
|
-
const parts = [];
|
|
228
|
-
for (const statement of statements) {
|
|
229
|
-
const text = nodeText(ts, sf, statement, indent);
|
|
230
|
-
if (text === null)
|
|
231
|
-
return null;
|
|
232
|
-
parts.push(text);
|
|
233
|
-
}
|
|
234
|
-
return parts.join('\n');
|
|
235
|
-
}
|
|
236
|
-
/** The hook override a set of insertions becomes: its name and its signature, and whether the creator's code runs before `super`. */
|
|
237
|
-
function hookFor(method, anchor, param) {
|
|
238
|
-
switch (`${method}:${anchor}`) {
|
|
239
|
-
case 'load:onWorldLoaded':
|
|
240
|
-
return { name: 'onWorldLoaded', signature: 'protected onWorldLoaded(): void', superCall: 'super.onWorldLoaded();', before: false };
|
|
241
|
-
case 'load:onCameraReady':
|
|
242
|
-
return { name: 'onCameraReady', signature: 'protected onCameraReady(): void', superCall: 'super.onCameraReady();', before: false };
|
|
243
|
-
case 'load:onPlayerReady':
|
|
244
|
-
return { name: 'onPlayerReady', signature: 'protected onPlayerReady(): void', superCall: 'super.onPlayerReady();', before: false };
|
|
245
|
-
case 'load:end':
|
|
246
|
-
return { name: 'load', signature: `async load(${param}: string): Promise<void>`, superCall: `await super.load(${param});`, before: false };
|
|
247
|
-
case 'update:start':
|
|
248
|
-
return { name: 'update', signature: `update(${param}: number): void`, superCall: `super.update(${param});`, before: true };
|
|
249
|
-
case 'update:end':
|
|
250
|
-
return { name: 'updateCamera', signature: `protected updateCamera(${param}: number): void`, superCall: `super.updateCamera(${param});`, before: false };
|
|
251
|
-
case 'dispose:start':
|
|
252
|
-
return { name: 'dispose', signature: 'dispose(): void', superCall: 'super.dispose();', before: true };
|
|
253
|
-
case 'dispose:disposeGameplay':
|
|
254
|
-
return { name: 'disposeGameplay', signature: 'protected disposeGameplay(): void', superCall: 'super.disposeGameplay();', before: false };
|
|
255
|
-
case 'dispose:end':
|
|
256
|
-
return { name: 'dispose', signature: 'dispose(): void', superCall: 'super.dispose();', before: false };
|
|
257
|
-
default:
|
|
258
|
-
throw new Error(`no hook for ${method}:${anchor}`);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
/** The names a class declares, read from the vendored VoxelGameBase. */
|
|
262
|
-
function baseMemberNames(ts, baseText) {
|
|
263
|
-
const sf = ts.createSourceFile('VoxelGameBase.ts', baseText, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
|
264
|
-
const names = new Set();
|
|
265
|
-
for (const statement of sf.statements) {
|
|
266
|
-
if (!ts.isClassDeclaration(statement) || statement.name?.text !== 'VoxelGameBase')
|
|
267
|
-
continue;
|
|
268
|
-
for (const member of statement.members) {
|
|
269
|
-
const name = memberName(ts, member, sf);
|
|
270
|
-
if (name !== null)
|
|
271
|
-
names.add(name.replace(/^(get|set) /, ''));
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
return names;
|
|
275
|
-
}
|
|
276
|
-
/** Every identifier in a text, for pruning imports the new file no longer uses. */
|
|
277
|
-
function identifiersIn(ts, text) {
|
|
278
|
-
const sf = ts.createSourceFile('x.ts', text, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
|
279
|
-
const out = new Set();
|
|
280
|
-
const visit = (n) => {
|
|
281
|
-
if (ts.isIdentifier(n))
|
|
282
|
-
out.add(n.text);
|
|
283
|
-
ts.forEachChild(n, visit);
|
|
284
|
-
};
|
|
285
|
-
visit(sf);
|
|
286
|
-
return out;
|
|
287
|
-
}
|
|
288
|
-
/** An import declaration with only the bindings `used` names, or null when none are left. */
|
|
289
|
-
function prunedImport(ts, sf, decl, used) {
|
|
290
|
-
const clause = decl.importClause;
|
|
291
|
-
if (!clause)
|
|
292
|
-
return decl.getText(sf); // a side-effect import is always kept
|
|
293
|
-
const keepDefault = clause.name !== undefined && used.has(clause.name.text);
|
|
294
|
-
const bindings = clause.namedBindings;
|
|
295
|
-
let named = null;
|
|
296
|
-
if (bindings && ts.isNamespaceImport(bindings)) {
|
|
297
|
-
named = used.has(bindings.name.text) ? bindings.getText(sf) : null;
|
|
298
|
-
}
|
|
299
|
-
else if (bindings && ts.isNamedImports(bindings)) {
|
|
300
|
-
const kept = bindings.elements.filter((e) => used.has(e.name.text)).map((e) => e.getText(sf));
|
|
301
|
-
named = kept.length > 0 ? `{ ${kept.join(', ')} }` : null;
|
|
302
|
-
}
|
|
303
|
-
if (!keepDefault && named === null)
|
|
304
|
-
return null;
|
|
305
|
-
if (keepDefault && named === null && bindings === undefined)
|
|
306
|
-
return decl.getText(sf);
|
|
307
|
-
const parts = [keepDefault && clause.name ? clause.name.text : null, named].filter((p) => p !== null);
|
|
308
|
-
const typeOnly = clause.isTypeOnly ? 'type ' : '';
|
|
309
|
-
return `import ${typeOnly}${parts.join(', ')} from ${decl.moduleSpecifier.getText(sf)};`;
|
|
310
|
-
}
|
|
311
|
-
const ASSIGNS_ENGINE_FIELD = 'assigns this.spawner or this.vehicleSpawner, which the engine owns now';
|
|
312
|
-
/**
|
|
313
|
-
* Plan the rewrite of one Game.ts against the new baseline: pure, reads nothing but its inputs.
|
|
314
|
-
*
|
|
315
|
-
* `newBaselineGame` is the vendored `engine/baseline/Game.ts` (the file a game with nothing of
|
|
316
|
-
* its own becomes, verbatim), `newBaseText` the vendored `VoxelGameBase.ts`.
|
|
317
|
-
*/
|
|
318
|
-
export function planGameMigration(ts, oldText, newBaselineGame, newBaseText) {
|
|
319
|
-
const skip = (reason) => ({ outcome: { status: 'skipped', reason } });
|
|
320
|
-
const sf = ts.createSourceFile('Game.ts', oldText, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
|
321
|
-
const cls = findGameClass(ts, sf);
|
|
322
|
-
if (!cls)
|
|
323
|
-
return skip('Game.ts has no `VoxelGame` class');
|
|
324
|
-
const heritage = extendsClause(ts, cls);
|
|
325
|
-
if (heritage) {
|
|
326
|
-
return heritage.expression.getText(sf) === 'VoxelGameBase'
|
|
327
|
-
? { outcome: { status: 'already-migrated' } }
|
|
328
|
-
: skip(`VoxelGame extends ${heritage.expression.getText(sf)}, not the old baseline's class`);
|
|
329
|
-
}
|
|
330
|
-
const baseNames = baseMemberNames(ts, newBaseText);
|
|
331
|
-
if (baseNames.size === 0)
|
|
332
|
-
return skip('the vendored engine/baseline/VoxelGameBase.ts declares no VoxelGameBase class');
|
|
333
|
-
const fields = [];
|
|
334
|
-
const methods = [];
|
|
335
|
-
const kept = [];
|
|
336
|
-
const overrides = new Map();
|
|
337
|
-
let constructorTail = null;
|
|
338
|
-
for (const member of cls.members) {
|
|
339
|
-
const name = memberName(ts, member, sf);
|
|
340
|
-
if (name === null)
|
|
341
|
-
return skip('Game.ts has a class member this migration cannot name');
|
|
342
|
-
if (LEGACY_GAME_MEMBERS[name]?.includes(fingerprint(ts, member, sf)))
|
|
343
|
-
continue; // the default: VoxelGameBase has it
|
|
344
|
-
if (isSegmentedMethod(name)) {
|
|
345
|
-
const method = name;
|
|
346
|
-
const body = bodyStatements(ts, member);
|
|
347
|
-
if (!body)
|
|
348
|
-
return skip(`${method}() has no body to compare`);
|
|
349
|
-
let best = null;
|
|
350
|
-
for (const version of LEGACY_GAME_BODIES[method]) {
|
|
351
|
-
const match = matchBody(ts, sf, method, body.statements, body.catchClause, version);
|
|
352
|
-
if (match.ok) {
|
|
353
|
-
best = match;
|
|
354
|
-
break;
|
|
355
|
-
}
|
|
356
|
-
if (!best || (!best.ok && match.matched > best.matched))
|
|
357
|
-
best = match;
|
|
358
|
-
}
|
|
359
|
-
if (!best)
|
|
360
|
-
return skip(`${method}() matches no released baseline`);
|
|
361
|
-
if (!best.ok)
|
|
362
|
-
return skip(best.reason);
|
|
363
|
-
const declared = ts.isMethodDeclaration(member) ? member.parameters[0]?.name.getText(sf) : undefined;
|
|
364
|
-
const param = declared ?? (method === 'load' ? 'gameId' : 'deltaTime');
|
|
365
|
-
for (const [anchor, added] of best.insertions.byAnchor) {
|
|
366
|
-
const text = statementsText(ts, sf, added, BODY_INDENT);
|
|
367
|
-
if (text === null)
|
|
368
|
-
return skip(`${method}() ${ASSIGNS_ENGINE_FIELD}`);
|
|
369
|
-
if (method === 'constructor') {
|
|
370
|
-
constructorTail = text;
|
|
371
|
-
continue;
|
|
372
|
-
}
|
|
373
|
-
const hook = hookFor(method, anchor, param);
|
|
374
|
-
if (anchor !== 'end' && method === 'load' && added.some((s) => /\bawait\b/.test(s.getText(sf)))) {
|
|
375
|
-
return skip(`load() awaits inside code that would move into the synchronous ${hook.name}() hook`);
|
|
376
|
-
}
|
|
377
|
-
if (overrides.has(hook.name))
|
|
378
|
-
return skip(`two parts of the old Game.ts would both become ${hook.name}()`);
|
|
379
|
-
const superLine = `${BODY_INDENT}${hook.superCall}`;
|
|
380
|
-
const inner = hook.before ? `${text}\n${superLine}` : `${superLine}\n${text}`;
|
|
381
|
-
overrides.set(hook.name, `${MEMBER_INDENT}${hook.signature} {\n${inner}\n${MEMBER_INDENT}}`);
|
|
382
|
-
}
|
|
383
|
-
continue;
|
|
384
|
-
}
|
|
385
|
-
const isHook = HOOK_METHODS.has(name) && ts.isMethodDeclaration(member);
|
|
386
|
-
if (!isHook && baseNames.has(name)) {
|
|
387
|
-
return skip(`${name} is changed from the baseline and VoxelGameBase declares it too — move the change into a hook by hand`);
|
|
388
|
-
}
|
|
389
|
-
if (name === 'spawner' || name === 'vehicleSpawner') {
|
|
390
|
-
return skip(`the ${name} field is changed from the baseline; the engine owns it now`);
|
|
391
|
-
}
|
|
392
|
-
// A changed setupCamera/setupVoxelLighting is the same call in VoxelGameBase, now protected.
|
|
393
|
-
const text = nodeText(ts, sf, member, MEMBER_INDENT, isHook);
|
|
394
|
-
if (text === null)
|
|
395
|
-
return skip(`${name} ${ASSIGNS_ENGINE_FIELD}`);
|
|
396
|
-
if (ts.isPropertyDeclaration(member)) {
|
|
397
|
-
fields.push(text);
|
|
398
|
-
kept.push(`field ${name}`);
|
|
399
|
-
}
|
|
400
|
-
else {
|
|
401
|
-
methods.push(text);
|
|
402
|
-
kept.push(isHook ? `${name}() (kept as an override)` : `${name}()`);
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
// Everything outside the class (helpers, constants) stays, and so do the imports it and the kept members use.
|
|
406
|
-
const outside = [];
|
|
407
|
-
const imports = [];
|
|
408
|
-
for (const statement of sf.statements) {
|
|
409
|
-
if (statement === cls)
|
|
410
|
-
continue;
|
|
411
|
-
if (ts.isImportDeclaration(statement)) {
|
|
412
|
-
imports.push(statement);
|
|
413
|
-
continue;
|
|
414
|
-
}
|
|
415
|
-
const text = nodeText(ts, sf, statement, '');
|
|
416
|
-
if (text === null)
|
|
417
|
-
return skip(`code outside the class ${ASSIGNS_ENGINE_FIELD}`);
|
|
418
|
-
outside.push(text);
|
|
419
|
-
}
|
|
420
|
-
const hooks = [...overrides.keys()];
|
|
421
|
-
if (fields.length === 0 && methods.length === 0 && overrides.size === 0 && constructorTail === null && outside.length === 0) {
|
|
422
|
-
return { outcome: { status: 'migrated', kept: [], hooks: [], wroteBase: false }, gameText: newBaselineGame };
|
|
423
|
-
}
|
|
424
|
-
const ctorTail = constructorTail === null ? '' : `\n${constructorTail}`;
|
|
425
|
-
const constructorText = `${MEMBER_INDENT}constructor(engine: EngineLike, worldProfileData: WorldProfileData, gameData?: GameData) {\n`
|
|
426
|
-
+ `${BODY_INDENT}super(engine, worldProfileData, gameData);${ctorTail}\n${MEMBER_INDENT}}`;
|
|
427
|
-
const classBody = [fields.join('\n'), constructorText, ...overrides.values(), ...methods].filter((p) => p.length > 0).join('\n\n');
|
|
428
|
-
// The new baseline's file comment and class comment, so a migrated file reads like a new one.
|
|
429
|
-
const newSf = ts.createSourceFile('Game.ts', newBaselineGame, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
|
430
|
-
const newClass = findGameClass(ts, newSf);
|
|
431
|
-
const firstStatement = newSf.statements[0];
|
|
432
|
-
const header = firstStatement ? newBaselineGame.slice(0, firstStatement.getStart(newSf)) : '';
|
|
433
|
-
const classDoc = newClass ? newBaselineGame.slice(newClass.pos, newClass.getStart(newSf)).trim() : '';
|
|
434
|
-
const classText = `${classDoc ? `${classDoc}\n` : ''}export class VoxelGame extends VoxelGameBase {\n${classBody}\n}`;
|
|
435
|
-
const body = [...outside, classText].join('\n\n');
|
|
436
|
-
const used = identifiersIn(ts, body);
|
|
437
|
-
const importLines = imports.map((d) => prunedImport(ts, sf, d, used)).filter((l) => l !== null);
|
|
438
|
-
const joined = importLines.join('\n');
|
|
439
|
-
if (!['WorldProfileData', 'EngineLike', 'GameData'].every((n) => new RegExp(`\\b${n}\\b`).test(joined))) {
|
|
440
|
-
importLines.unshift("import type { WorldProfileData, EngineLike, GameData } from 'types/game.js';");
|
|
441
|
-
}
|
|
442
|
-
importLines.push("import { VoxelGameBase } from './VoxelGameBase.js';");
|
|
443
|
-
const gameText = `${header}${[...new Set(importLines)].join('\n')}\n\n${body}\n`;
|
|
444
|
-
return { outcome: { status: 'migrated', kept, hooks, wroteBase: false }, gameText };
|
|
10
|
+
/** The project's template first (bitmagic.json names it), then the baseline. */
|
|
11
|
+
function originsFor(options, baselineGame) {
|
|
12
|
+
const { templatesDir, template } = options;
|
|
13
|
+
const origins = [];
|
|
14
|
+
if (templatesDir && template) {
|
|
15
|
+
const templateGame = path.join(templatesDir, template, 'source', 'Game.ts');
|
|
16
|
+
if (fs.existsSync(templateGame))
|
|
17
|
+
origins.push({ name: template, newGame: fs.readFileSync(templateGame, 'utf-8') });
|
|
18
|
+
}
|
|
19
|
+
origins.push({ name: 'baseline', newGame: baselineGame });
|
|
20
|
+
return origins;
|
|
445
21
|
}
|
|
446
22
|
/**
|
|
447
23
|
* Migrate `src/work/Game.ts` onto VoxelGameBase in place: plan it, write the new Game.ts and the
|
|
@@ -462,7 +38,7 @@ export function migrateGameFile(options) {
|
|
|
462
38
|
}
|
|
463
39
|
const oldText = fs.readFileSync(gamePath, 'utf-8');
|
|
464
40
|
const baseText = fs.readFileSync(vendoredBase, 'utf-8');
|
|
465
|
-
const plan =
|
|
41
|
+
const plan = planGameMigrationFromOrigins(ts, oldText, baseText, originsFor(options, fs.readFileSync(vendoredGame, 'utf-8')));
|
|
466
42
|
if (plan.outcome.status !== 'migrated' || plan.gameText === undefined)
|
|
467
43
|
return plan.outcome;
|
|
468
44
|
const existingBase = fs.existsSync(basePath) ? fs.readFileSync(basePath, 'utf-8') : null;
|
|
@@ -485,6 +61,21 @@ export function migrateGameFile(options) {
|
|
|
485
61
|
}
|
|
486
62
|
return { ...plan.outcome, wroteBase: existingBase === null };
|
|
487
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Whether src/work/Game.ts is still the old baseline's whole class, which logs the GameEngine
|
|
66
|
+
* `set*` deprecation warnings on every load. A cheap text check for the hint `upgrade` prints
|
|
67
|
+
* when `--migrate-game` was not passed; the migration itself parses the file.
|
|
68
|
+
*/
|
|
69
|
+
export function isLegacyGameFile(root) {
|
|
70
|
+
const gamePath = path.join(root, GAME_FILE);
|
|
71
|
+
if (!fs.existsSync(gamePath))
|
|
72
|
+
return false;
|
|
73
|
+
return isLegacyGameText(fs.readFileSync(gamePath, 'utf-8'));
|
|
74
|
+
}
|
|
75
|
+
/** The guide's project-relative path, or null on an engine that predates it. */
|
|
76
|
+
export function gameMigrationGuide(root) {
|
|
77
|
+
return fs.existsSync(path.join(root, GAME_MIGRATION_GUIDE)) ? GAME_MIGRATION_GUIDE : null;
|
|
78
|
+
}
|
|
488
79
|
function firstLines(text, count = 8) {
|
|
489
80
|
return text.split('\n').filter((l) => l.trim().length > 0).slice(0, count).map((l) => ` ${l}`).join('\n');
|
|
490
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"game-migration.js","sourceRoot":"","sources":["../../src/scaffold/game-migration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAiB,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAmB,MAAM,4BAA4B,CAAC;AAEtG;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG,kBAAkB,CAAC;AAC5C,MAAM,CAAC,MAAM,SAAS,GAAG,2BAA2B,CAAC;AACrD,wDAAwD;AACxD,MAAM,CAAC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAIvD,MAAM,CAAC,MAAM,iBAAiB,GAA+B,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;AAC1G,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAA2B,EAAE,CAAE,iBAAuC,CAAC,QAAQ,CAAC,IAAI,CA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,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,YAAY,KAAK,IAAI,EAAE,CAAC;AAC/D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAC5C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,KAAK,CAAC;IAC3C,OAAO,gBAAgB,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5F,CAAC;AAED,SAAS,UAAU,CAAC,IAAY,EAAE,KAAK,GAAG,CAAC;IACzC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7G,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { PackageManager } from '../project/package-manager.js';
|
|
2
|
+
import { type EngineCapabilities } from './engine-capabilities.js';
|
|
3
|
+
/**
|
|
4
|
+
* The GitHub Pages target for a standalone project (engine OSS audit W5.6 §2.6, decision H-h):
|
|
5
|
+
* `bitmagic pages init` writes the workflow below, and the workflow runs `bitmagic build --pages`
|
|
6
|
+
* on every push to the default branch and deploys `.bitmagic/pages/` with GitHub's own Pages
|
|
7
|
+
* actions.
|
|
8
|
+
*
|
|
9
|
+
* What `build --pages` makes is a STATIC page: it boots through `bitmagic/boot-static.js`, which
|
|
10
|
+
* registers no platform services, so a `*.github.io` page never calls api-server, game-server or
|
|
11
|
+
* GTM. Only the engine's own files still come from Bitmagic: the Bitmagic CDN, until the open
|
|
12
|
+
* engine's asset site exists (`pagesHosting` in `bitmagic.json` switches that).
|
|
13
|
+
*/
|
|
14
|
+
/** Where `bitmagic pages init` writes the workflow, relative to the project root. */
|
|
15
|
+
export declare const PAGES_WORKFLOW_PATH = ".github/workflows/bitmagic-pages.yml";
|
|
16
|
+
/** The directory `bitmagic build --pages` writes and the workflow uploads, relative to the root. */
|
|
17
|
+
export declare const PAGES_OUTPUT_DIR = ".bitmagic/pages";
|
|
18
|
+
/** The engine capability a vendored engine advertises once it carries `bitmagic/boot-static.ts`. */
|
|
19
|
+
export declare const STATIC_PAGE_CAPABILITY = "staticPage";
|
|
20
|
+
/** The `bm:platform` id the static page declares and `bitmagic/register-static.ts` registers. */
|
|
21
|
+
export declare const BITMAGIC_STATIC_PLATFORM_ID = "bitmagic-static";
|
|
22
|
+
/**
|
|
23
|
+
* Refuses an engine without the static page, before anything is written or built. The page boots
|
|
24
|
+
* `bitmagic/boot-static.js`; on an engine that has none, the build would compile clean and then
|
|
25
|
+
* fail in Vite on an unresolved entry, naming a file the creator never wrote.
|
|
26
|
+
*/
|
|
27
|
+
export declare function requireStaticPageEngine(capabilities: EngineCapabilities): void;
|
|
28
|
+
/** The values `pagesHosting` in `bitmagic.json` takes, besides a root URL. */
|
|
29
|
+
export declare const PAGES_HOSTING_PRESETS: readonly ["bitmagic-cdn", "github-pages"];
|
|
30
|
+
export type PagesHostingPreset = (typeof PAGES_HOSTING_PRESETS)[number];
|
|
31
|
+
/** The default: the engine's files from the Bitmagic CDN, which is where they all are today. */
|
|
32
|
+
export declare const DEFAULT_PAGES_HOSTING: PagesHostingPreset;
|
|
33
|
+
/**
|
|
34
|
+
* The `<meta name="bm:asset-host">` content the static page carries for `bitmagic.json`'s
|
|
35
|
+
* `pagesHosting`, or null for none.
|
|
36
|
+
*
|
|
37
|
+
* - absent, or `"bitmagic-cdn"`: no meta. The static platform registers the Bitmagic CDN preset,
|
|
38
|
+
* and a page with no meta takes the platform's hosting (`resolveHosting` in the engine's
|
|
39
|
+
* `runtime/hosting.ts`).
|
|
40
|
+
* - `"github-pages"`: the meta `github-pages`, the open engine's own asset site. That site does
|
|
41
|
+
* not exist yet, so a page built this way loads no engine assets until it does.
|
|
42
|
+
* - a root URL (`https://…`, `http://…`, or a page-relative `./…`, `../…` or `/…` path): the meta
|
|
43
|
+
* names that root, which the engine reads as a self-hosted copy of the engine's files.
|
|
44
|
+
*
|
|
45
|
+
* Anything else is refused: the engine would read an unknown name as an unregistered provider and
|
|
46
|
+
* silently fall back to the platform's hosting, which is the opposite of what the creator asked.
|
|
47
|
+
*/
|
|
48
|
+
export declare function pagesAssetHostMeta(pagesHosting: unknown): string | null;
|
|
49
|
+
export interface GithubPagesWorkflowOptions {
|
|
50
|
+
/**
|
|
51
|
+
* The CLI version the workflow runs, pinned: the version that scaffolded it. An unpinned `npx`
|
|
52
|
+
* would build with whatever was published last, against an engine this project may not have.
|
|
53
|
+
*/
|
|
54
|
+
cliVersion: string;
|
|
55
|
+
/** The project's package manager, from its lockfile (`detectPackageManager`). */
|
|
56
|
+
packageManager: PackageManager;
|
|
57
|
+
/**
|
|
58
|
+
* The branch whose pushes deploy: the repository's default branch (`detectDefaultBranch`).
|
|
59
|
+
* Named literally, because `$default-branch` only works in GitHub's workflow templates; in a
|
|
60
|
+
* repository's own workflow file it is a branch called `$default-branch`, and nothing deploys.
|
|
61
|
+
*/
|
|
62
|
+
branch: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* `.github/workflows/bitmagic-pages.yml`.
|
|
66
|
+
*
|
|
67
|
+
* Action majors follow this repository's own workflows (`actions/checkout@v6`,
|
|
68
|
+
* `actions/setup-node@v6`, `pnpm/action-setup@v5`); the two Pages actions, which the repository
|
|
69
|
+
* does not otherwise use, are pinned to their current majors. Checkout fetches LFS objects,
|
|
70
|
+
* because a project may keep large models there and the bundle inlines nothing it cannot read.
|
|
71
|
+
*/
|
|
72
|
+
export declare function renderGithubPagesWorkflow(options: GithubPagesWorkflowOptions): string;
|
|
73
|
+
/**
|
|
74
|
+
* What `bitmagic pages init` prints after writing the workflow: the one step only the creator can
|
|
75
|
+
* take, the limits GitHub sets, and the terms note. Lines, so `--json` can carry them as an array.
|
|
76
|
+
*/
|
|
77
|
+
export declare function pagesSetupNotes(): string[];
|
|
78
|
+
/**
|
|
79
|
+
* The repository's default branch, for the workflow's push trigger: the remote's `HEAD` when the
|
|
80
|
+
* clone knows it, else the branch checked out now, else `main` (GitHub's default for a new
|
|
81
|
+
* repository). `bitmagic pages init --branch` overrides it.
|
|
82
|
+
*/
|
|
83
|
+
export declare function detectDefaultBranch(root: string): string;
|