@bitmagic/cli 0.1.27 → 0.1.29
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 +8 -3
- package/dist/commands/init.js +15 -4
- package/dist/commands/init.js.map +1 -1
- package/dist/editor/shell-page.js +44 -36
- package/dist/editor/shell-page.js.map +1 -1
- package/dist/project/jobs.js +27 -0
- package/dist/project/jobs.js.map +1 -1
- package/dist/scaffold/project-files.d.ts +10 -1
- package/dist/scaffold/project-files.js +81 -21
- package/dist/scaffold/project-files.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,13 +18,18 @@ bitmagic --version
|
|
|
18
18
|
bitmagic login # device-code auth in your browser
|
|
19
19
|
bitmagic init my-game # scaffold a new project into ./my-game
|
|
20
20
|
cd my-game
|
|
21
|
+
bitmagic dev & # FIRST, and in the background — it never exits
|
|
22
|
+
# then open http://localhost:3011/ and leave it open
|
|
21
23
|
bitmagic cover # generate cover art from GAME-DESIGN.md
|
|
22
24
|
bitmagic check # typecheck against the vendored engine
|
|
23
|
-
bitmagic
|
|
24
|
-
bitmagic
|
|
25
|
-
bitmagic publish # verify-gate, build, and ship — private by default
|
|
25
|
+
bitmagic verify # boot the game in a real browser and report what broke
|
|
26
|
+
bitmagic publish # verify-gate, build, and ship — private by default
|
|
26
27
|
```
|
|
27
28
|
|
|
29
|
+
**Start `bitmagic dev` first, not last.** It is a long-running server, so an agent working through
|
|
30
|
+
a list tends to leave it until the end — and then nobody saw the game get built. Started first, the
|
|
31
|
+
browser reloads itself on every change and the assets panel shows each generation as it runs.
|
|
32
|
+
|
|
28
33
|
## Commands
|
|
29
34
|
|
|
30
35
|
| Command | What it does |
|
package/dist/commands/init.js
CHANGED
|
@@ -52,10 +52,19 @@ function installDependencies(dir) {
|
|
|
52
52
|
return true;
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
55
|
+
* The order here is the whole content of this function, and every entry is placed by when it stops
|
|
56
|
+
* being useful rather than by when it is convenient to run.
|
|
57
|
+
*
|
|
58
|
+
* `bitmagic dev` is first, and annotated as long-running, because agents were reliably starting it
|
|
59
|
+
* LAST — after the game was already built. Read as a list of commands to work through, a
|
|
60
|
+
* never-exiting server is the one you defer, and deferring it means the person waiting saw none of
|
|
61
|
+
* the build: no reloads, no assets panel, no way to steer. Naming it as a background task is what
|
|
62
|
+
* makes it startable at step one.
|
|
63
|
+
*
|
|
64
|
+
* `bitmagic cover` is listed before `bitmagic check` for the same reason: the cover is generated
|
|
65
|
+
* from GAME-DESIGN.md, so it exists while the agent's first implementation pass runs rather than
|
|
66
|
+
* arriving after it. Generating one afterwards works identically — it is simply no longer something
|
|
67
|
+
* to look at during the wait.
|
|
59
68
|
*/
|
|
60
69
|
function printNextSteps(output, dir, gameId, installSucceeded, hasIdea) {
|
|
61
70
|
output.info('');
|
|
@@ -66,6 +75,8 @@ function printNextSteps(output, dir, gameId, installSucceeded, hasIdea) {
|
|
|
66
75
|
if (!installSucceeded) {
|
|
67
76
|
output.info(' npm install');
|
|
68
77
|
}
|
|
78
|
+
output.info(' bitmagic dev # IN THE BACKGROUND — it never exits. Open http://localhost:3011/');
|
|
79
|
+
output.info(' # Start it FIRST: it is how the human watches the game get built.');
|
|
69
80
|
if (!hasIdea) {
|
|
70
81
|
output.info(' # write GAME-DESIGN.md — the cover art is generated from it');
|
|
71
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,YAAY,EAAe,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;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AE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACxD,CAAC,CAAC;YAEH,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC;YACxD,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;YAC7F,MAAM,CAAC,MAAM,CAAC;gBACZ,EAAE,EAAE,IAAI;gBACR,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,IAAI,EAAE,SAAS;gBACf,QAAQ,EAAE,QAAQ,CAAC,EAAE;gBACrB,KAAK,EAAE,QAAQ,CAAC,KAAK;gBACrB,aAAa,EAAE,QAAQ,CAAC,OAAO;gBAC/B,uFAAuF;gBACvF,qBAAqB,EAAE,gBAAgB;gBACvC,2FAA2F;gBAC3F,eAAe,EAAE,IAAI,CAAC,IAAI,KAAK,SAAS;aACzC,CAAC,CAAC;QACL,CAAC;gBAAS,CAAC;YACT,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -101,7 +101,7 @@ export function renderEditorShell(options) {
|
|
|
101
101
|
padding: 4px 10px; font: inherit; cursor: pointer; }
|
|
102
102
|
button:hover { background: #30303a; }
|
|
103
103
|
button:disabled { opacity: .5; cursor: default; background: #26262e; }
|
|
104
|
-
|
|
104
|
+
/* .tab:hover is declared after .tab.active and would otherwise win on an active tab. */
|
|
105
105
|
#tabs .tab.active:hover { background: #3352c4; }
|
|
106
106
|
.banner { display: none; align-items: center; gap: 12px; flex: none; padding: 8px 12px;
|
|
107
107
|
background: #3a2c12; border-bottom: 1px solid #574018; color: #f0d9a8; }
|
|
@@ -233,6 +233,7 @@ export function renderEditorShell(options) {
|
|
|
233
233
|
var terrainBanner = document.getElementById('terrain-banner');
|
|
234
234
|
var buildBanner = document.getElementById('build-banner');
|
|
235
235
|
var autoToggle = document.getElementById('auto-toggle');
|
|
236
|
+
var tabButtons = document.querySelectorAll('.tab');
|
|
236
237
|
|
|
237
238
|
var loaded = false;
|
|
238
239
|
var saving = false;
|
|
@@ -294,23 +295,35 @@ export function renderEditorShell(options) {
|
|
|
294
295
|
});
|
|
295
296
|
}
|
|
296
297
|
|
|
298
|
+
/**
|
|
299
|
+
* Ask the engine something and wait for its answer, or null on timeout.
|
|
300
|
+
*
|
|
301
|
+
* The waiter is armed before the post for the same reason boot() arms both of its own before
|
|
302
|
+
* navigating: nothing here may assume the reply cannot land early.
|
|
303
|
+
*/
|
|
304
|
+
function request(type, replyType, timeoutMs, data) {
|
|
305
|
+
var reply = await_(replyType, timeoutMs);
|
|
306
|
+
post(type, data);
|
|
307
|
+
return reply;
|
|
308
|
+
}
|
|
309
|
+
|
|
297
310
|
window.addEventListener('message', function (event) {
|
|
298
311
|
var message = event.data;
|
|
299
312
|
if (!message || typeof message.type !== 'string') return;
|
|
300
313
|
|
|
301
|
-
|
|
302
|
-
if (
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}
|
|
314
|
+
waiters = waiters.filter(function (waiter) {
|
|
315
|
+
if (waiter.type !== message.type) return true;
|
|
316
|
+
clearTimeout(waiter.timer);
|
|
317
|
+
waiter.resolve(message);
|
|
318
|
+
return false;
|
|
319
|
+
});
|
|
308
320
|
|
|
309
321
|
switch (message.type) {
|
|
310
322
|
case 'GAME_STATE_CHANGED':
|
|
311
323
|
gameState = message.state || '';
|
|
312
324
|
if (activeTab === 'game' && loaded) {
|
|
313
|
-
|
|
325
|
+
var playing = gameState === 'playing';
|
|
326
|
+
setStatus(playing ? 'saved' : '', playing ? 'Playing' : 'Ready');
|
|
314
327
|
}
|
|
315
328
|
break;
|
|
316
329
|
|
|
@@ -389,7 +402,7 @@ export function renderEditorShell(options) {
|
|
|
389
402
|
try {
|
|
390
403
|
var project = await (await fetch('/api/game-data')).json();
|
|
391
404
|
var asset = ((project.gameData && project.gameData.assets) || [])
|
|
392
|
-
.
|
|
405
|
+
.find(function (a) { return a && a.id === assetId; });
|
|
393
406
|
if (asset && typeof asset.description === 'string') existing = asset.description;
|
|
394
407
|
} catch (error) {
|
|
395
408
|
// No description to prefill is a worse dialog, not a broken one.
|
|
@@ -415,9 +428,9 @@ export function renderEditorShell(options) {
|
|
|
415
428
|
return;
|
|
416
429
|
}
|
|
417
430
|
lastKnownMtime = result.worldMtimeMs || lastKnownMtime;
|
|
418
|
-
hqNote.classList.add('show');
|
|
419
431
|
|
|
420
|
-
// The description is saved either way; only what happens next differs.
|
|
432
|
+
// The description is saved either way; only what happens next differs. Every branch below
|
|
433
|
+
// ends in showHqNote, which is what reveals the note.
|
|
421
434
|
if (result.canGenerate === false) {
|
|
422
435
|
showHqNote('Description saved. ' + (result.reason || 'This asset cannot be regenerated.'), '');
|
|
423
436
|
setStatus('saved', 'Description saved');
|
|
@@ -536,8 +549,7 @@ export function renderEditorShell(options) {
|
|
|
536
549
|
|
|
537
550
|
if (activeTab === 'editor' && tab === 'game' && loaded && !fromEngine) {
|
|
538
551
|
await flush();
|
|
539
|
-
|
|
540
|
-
var terrain = await await_('TERRAIN_HAS_CHANGES', 2000);
|
|
552
|
+
var terrain = await request('CHECK_TERRAIN_CHANGES', 'TERRAIN_HAS_CHANGES', 2000);
|
|
541
553
|
if (terrain && terrain.hasChanges === true) {
|
|
542
554
|
terrainBanner.classList.add('show');
|
|
543
555
|
return;
|
|
@@ -546,10 +558,9 @@ export function renderEditorShell(options) {
|
|
|
546
558
|
|
|
547
559
|
activeTab = tab;
|
|
548
560
|
writePref(TAB_KEY, tab);
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
}
|
|
561
|
+
tabButtons.forEach(function (button) {
|
|
562
|
+
button.classList.toggle('active', button.getAttribute('data-tab') === tab);
|
|
563
|
+
});
|
|
553
564
|
if (!loaded) return;
|
|
554
565
|
applyTab(tab);
|
|
555
566
|
// One loop for both tabs; the work inside it is what differs (see runLoop()).
|
|
@@ -614,13 +625,11 @@ export function renderEditorShell(options) {
|
|
|
614
625
|
async function flush() {
|
|
615
626
|
if (!loaded || saving) return;
|
|
616
627
|
|
|
617
|
-
|
|
618
|
-
var changes = await await_('SCENE_HAS_CHANGES', 2000);
|
|
628
|
+
var changes = await request('CHECK_SCENE_CHANGES', 'SCENE_HAS_CHANGES', 2000);
|
|
619
629
|
if (!changes) return;
|
|
620
630
|
if (!changes.hasChanges && !markersDirty) return;
|
|
621
631
|
|
|
622
|
-
|
|
623
|
-
var status = await await_('SCENE_EDITING_STATUS', 5000);
|
|
632
|
+
var status = await request('GET_SCENE_EDITING_STATUS', 'SCENE_EDITING_STATUS', 5000);
|
|
624
633
|
if (!status) return;
|
|
625
634
|
|
|
626
635
|
saving = true;
|
|
@@ -663,8 +672,7 @@ export function renderEditorShell(options) {
|
|
|
663
672
|
*/
|
|
664
673
|
async function checkTerrainEdits() {
|
|
665
674
|
if (!loaded) return;
|
|
666
|
-
|
|
667
|
-
var terrain = await await_('TERRAIN_HAS_CHANGES', 2000);
|
|
675
|
+
var terrain = await request('CHECK_TERRAIN_CHANGES', 'TERRAIN_HAS_CHANGES', 2000);
|
|
668
676
|
if (!terrain) return;
|
|
669
677
|
terrainBanner.classList.toggle('show', terrain.hasChanges === true);
|
|
670
678
|
}
|
|
@@ -1074,8 +1082,7 @@ export function renderEditorShell(options) {
|
|
|
1074
1082
|
var shotButton = document.getElementById('shot');
|
|
1075
1083
|
|
|
1076
1084
|
async function captureGamePng() {
|
|
1077
|
-
|
|
1078
|
-
var response = await await_('SCREENSHOT_RESPONSE', 15000);
|
|
1085
|
+
var response = await request('CAPTURE_SCREENSHOT', 'SCREENSHOT_RESPONSE', 15000, { mode: 'immediate' });
|
|
1079
1086
|
if (!response) throw new Error('the game did not answer');
|
|
1080
1087
|
// The engine reports its own failures as a null screenshot rather than staying silent.
|
|
1081
1088
|
if (!response.screenshot) throw new Error('the engine could not capture a frame');
|
|
@@ -1187,11 +1194,14 @@ export function renderEditorShell(options) {
|
|
|
1187
1194
|
* loop here — a dropped stream degrades to the mtime poll above until the browser reopens it.
|
|
1188
1195
|
*/
|
|
1189
1196
|
function listenForEvents() {
|
|
1197
|
+
// An unparseable payload is a missing label, not a lost event: the event's NAME is what says
|
|
1198
|
+
// what happened, and every field read below has a fallback.
|
|
1199
|
+
function payloadOf(event) {
|
|
1200
|
+
try { return JSON.parse(event.data); } catch (error) { return {}; }
|
|
1201
|
+
}
|
|
1190
1202
|
var events = new EventSource('/api/events/stream');
|
|
1191
1203
|
events.addEventListener('reload', function (event) {
|
|
1192
|
-
|
|
1193
|
-
try { payload = JSON.parse(event.data); } catch (error) { /* reason is a label */ }
|
|
1194
|
-
onChangeSignal(payload.reason || 'change');
|
|
1204
|
+
onChangeSignal(payloadOf(event).reason || 'change');
|
|
1195
1205
|
});
|
|
1196
1206
|
// A bare "the list moved" ping: a generation started, made progress, failed, or world.json was
|
|
1197
1207
|
// rewritten. The panel re-reads rather than the server sending a diff, which keeps the whole
|
|
@@ -1200,8 +1210,7 @@ export function renderEditorShell(options) {
|
|
|
1200
1210
|
void refreshAssets();
|
|
1201
1211
|
});
|
|
1202
1212
|
events.addEventListener('build', function (event) {
|
|
1203
|
-
var payload =
|
|
1204
|
-
try { payload = JSON.parse(event.data); } catch (error) { /* see above */ }
|
|
1213
|
+
var payload = payloadOf(event);
|
|
1205
1214
|
if (payload.status === 'failed') {
|
|
1206
1215
|
document.getElementById('build-message').textContent = payload.message || 'The build failed.';
|
|
1207
1216
|
buildBanner.classList.add('show');
|
|
@@ -1220,12 +1229,11 @@ export function renderEditorShell(options) {
|
|
|
1220
1229
|
post('REVERT_TERRAIN_CHANGES');
|
|
1221
1230
|
terrainBanner.classList.remove('show');
|
|
1222
1231
|
});
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
void selectTab(event.currentTarget.getAttribute('data-tab'), {});
|
|
1232
|
+
tabButtons.forEach(function (button) {
|
|
1233
|
+
button.addEventListener('click', function () {
|
|
1234
|
+
void selectTab(button.getAttribute('data-tab'));
|
|
1227
1235
|
});
|
|
1228
|
-
}
|
|
1236
|
+
});
|
|
1229
1237
|
autoToggle.addEventListener('change', function () {
|
|
1230
1238
|
autoReload = autoToggle.checked;
|
|
1231
1239
|
writePref(AUTO_KEY, autoReload ? '1' : '0');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell-page.js","sourceRoot":"","sources":["../../src/editor/shell-page.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,oGAAoG;AACpG,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B;;;;;;GAMG;AACH,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAEnC,kGAAkG;AAClG,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,KAAK;SACT,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC3B,CAAC;AASD,MAAM,UAAU,iBAAiB,CAAC,OAA2B;IAC3D,MAAM,OAAO,GAAG,oBAAoB,OAAO,CAAC,QAAQ,2BAA2B,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IACpH,OAAO;;;;wBAIe,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA2F3B,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;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41
|
*/
|
|
42
42
|
import * as fs from 'fs';
|
|
43
43
|
import * as path from 'path';
|
|
44
|
+
import { readDevHandle } from './dev-handle.js';
|
|
44
45
|
export const JOBS_DIR = path.join('.bitmagic', 'jobs');
|
|
45
46
|
/** Failed records are kept so the creator can see why nothing appeared — but not forever. */
|
|
46
47
|
const FAILED_RECORD_TTL_MS = 24 * 60 * 60 * 1000;
|
|
@@ -204,6 +205,31 @@ export function pruneJobs(root, now = Date.now()) {
|
|
|
204
205
|
}
|
|
205
206
|
return removed;
|
|
206
207
|
}
|
|
208
|
+
/**
|
|
209
|
+
* Said at most once per process, and only when a generation starts with nothing watching.
|
|
210
|
+
*
|
|
211
|
+
* The docs tell an agent to start `bitmagic dev` first; agents skim docs. This fires at the one
|
|
212
|
+
* moment the advice is unarguable — a paid, minutes-long generation is about to run and produce no
|
|
213
|
+
* visible sign anywhere — and it is the cheapest place to catch the mistake, because the fix
|
|
214
|
+
* (start it now) still salvages the rest of the session.
|
|
215
|
+
*
|
|
216
|
+
* A stale handle from a `dev` that was SIGKILLed means this stays quiet when it could have spoken.
|
|
217
|
+
* That is the right direction to fail: a missed nudge costs a little visibility, while telling
|
|
218
|
+
* someone to start a server they are already running teaches them to ignore the line.
|
|
219
|
+
*/
|
|
220
|
+
let nudgedAboutDev = false;
|
|
221
|
+
function nudgeIfNothingIsWatching(root, log) {
|
|
222
|
+
if (nudgedAboutDev)
|
|
223
|
+
return;
|
|
224
|
+
nudgedAboutDev = true;
|
|
225
|
+
// A running dev server writes this handle; the HQ generation the sidecar itself runs therefore
|
|
226
|
+
// never reaches the message below, which is correct — that one is being watched by definition.
|
|
227
|
+
if (readDevHandle(root) !== null)
|
|
228
|
+
return;
|
|
229
|
+
log('Note: no `bitmagic dev` is running, so nobody can see this happen. Start one in the '
|
|
230
|
+
+ 'background — it shows each generation\'s progress while it runs and reloads the game when '
|
|
231
|
+
+ 'it lands.');
|
|
232
|
+
}
|
|
207
233
|
export function startJob(options) {
|
|
208
234
|
const now = new Date().toISOString();
|
|
209
235
|
const record = {
|
|
@@ -249,6 +275,7 @@ export async function withJobRecord(options, body) {
|
|
|
249
275
|
catch {
|
|
250
276
|
// See above: no record is a worse dev view, not a failed generation.
|
|
251
277
|
}
|
|
278
|
+
nudgeIfNothingIsWatching(options.root, options.log);
|
|
252
279
|
const log = (message) => {
|
|
253
280
|
options.log(message);
|
|
254
281
|
try {
|
package/dist/project/jobs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jobs.js","sourceRoot":"","sources":["../../src/project/jobs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"jobs.js","sourceRoot":"","sources":["../../src/project/jobs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAwBhD,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;AAEvD,6FAA6F;AAC7F,MAAM,oBAAoB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEjD,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,OAAO,CAAC,IAAY,EAAE,KAAa;IAC1C,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,CAAC;AAC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AK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC9F,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,KAAa;IACnD,IAAI,CAAC;QACH,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACnD,CAAC;IAAC,MAAM,CAAC;QACP,6FAA6F;IAC/F,CAAC;AACH,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,OAAO,CAAC,IAAY,EAAE,KAAa,EAAE,KAAa;IAChE,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,WAAW,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;QAC7E,IAAI,QAAQ,KAAK,IAAI;YAAE,OAAO;QAC9B,WAAW,CAAC,IAAI,EAAE,EAAE,GAAG,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IACnG,CAAC;IAAC,MAAM,CAAC;QACP,8EAA8E;IAChF,CAAC;AACH,CAAC"}
|
|
@@ -6,7 +6,16 @@
|
|
|
6
6
|
* PLATFORM_GENERATED_FILES in project.ts), so this is the only source of truth upgrade has for
|
|
7
7
|
* telling a creator what to add by hand.
|
|
8
8
|
*/
|
|
9
|
-
export declare const DEPENDENCIES:
|
|
9
|
+
export declare const DEPENDENCIES: {
|
|
10
|
+
'@dimforge/rapier2d-compat': string;
|
|
11
|
+
'@dimforge/rapier3d-compat': string;
|
|
12
|
+
'@msgpack/msgpack': string;
|
|
13
|
+
fflate: string;
|
|
14
|
+
i18next: string;
|
|
15
|
+
'i18next-browser-languagedetector': string;
|
|
16
|
+
jszip: string;
|
|
17
|
+
three: string;
|
|
18
|
+
};
|
|
10
19
|
export declare const DEV_DEPENDENCIES: Record<string, string>;
|
|
11
20
|
export declare function renderPackageJson(name: string): string;
|
|
12
21
|
export declare function renderTsconfig(): string;
|
|
@@ -16,6 +16,9 @@ export const DEPENDENCIES = {
|
|
|
16
16
|
'i18next-browser-languagedetector': '^8.0.4',
|
|
17
17
|
jszip: '^3.10.1',
|
|
18
18
|
three: '^0.185.1',
|
|
19
|
+
// `satisfies` rather than a `Record<string, string>` annotation: it keeps the same contract
|
|
20
|
+
// while leaving the key names visible to the type system, so `esmUrl('fflate')` below cannot
|
|
21
|
+
// name a package this map does not install.
|
|
19
22
|
};
|
|
20
23
|
export const DEV_DEPENDENCIES = {
|
|
21
24
|
'@types/node': '^24.10.0',
|
|
@@ -29,13 +32,26 @@ export const DEV_DEPENDENCIES = {
|
|
|
29
32
|
vite: '^7.3.1',
|
|
30
33
|
'vite-plugin-singlefile': '^2.3.3',
|
|
31
34
|
};
|
|
35
|
+
/** The exact release a `^x.y.z` range in `DEPENDENCIES` installs. */
|
|
36
|
+
function pinnedVersion(name) {
|
|
37
|
+
return DEPENDENCIES[name].replace(/^\^/, '');
|
|
38
|
+
}
|
|
32
39
|
/**
|
|
33
|
-
* The
|
|
40
|
+
* The CDN URL the browser loads a package from, pinned to the version `DEPENDENCIES` installs
|
|
41
|
+
* for tsc. Derived rather than written a second time: the two must agree, and a bump that
|
|
42
|
+
* updates the npm range but not the URL leaves a project type-checking against one copy of a
|
|
43
|
+
* library while the game runs against another.
|
|
44
|
+
*/
|
|
45
|
+
function esmUrl(name) {
|
|
46
|
+
return `https://esm.sh/${name}@${pinnedVersion(name)}`;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The three.js release every `three*` import map entry below resolves to. Named once because
|
|
34
50
|
* the entries repeat it eight times, including four times inside the `three` shim, and a bump
|
|
35
51
|
* that updates some copies but not others splits the engine across two module instances — the
|
|
36
52
|
* exact failure the comments below describe.
|
|
37
53
|
*/
|
|
38
|
-
const THREE_VERSION = '
|
|
54
|
+
const THREE_VERSION = pinnedVersion('three');
|
|
39
55
|
/**
|
|
40
56
|
* `three` resolves to a shim, not straight to the webgpu build. r185's three.webgpu.js exports
|
|
41
57
|
* neither `UniformsUtils` (which every classic postprocessing pass imports from `three`) nor
|
|
@@ -70,12 +86,12 @@ const CDN_IMPORTS = {
|
|
|
70
86
|
'three/addons/': `https://esm.sh/*three@${THREE_VERSION}/addons/`,
|
|
71
87
|
'three/examples/jsm/': `https://esm.sh/*three@${THREE_VERSION}/examples/jsm/`,
|
|
72
88
|
'three/': `https://esm.sh/three@${THREE_VERSION}/`,
|
|
73
|
-
'@dimforge/rapier3d-compat': '
|
|
74
|
-
'@dimforge/rapier2d-compat': '
|
|
75
|
-
i18next: '
|
|
76
|
-
'i18next-browser-languagedetector': '
|
|
77
|
-
'@msgpack/msgpack': '
|
|
78
|
-
fflate: '
|
|
89
|
+
'@dimforge/rapier3d-compat': esmUrl('@dimforge/rapier3d-compat'),
|
|
90
|
+
'@dimforge/rapier2d-compat': esmUrl('@dimforge/rapier2d-compat'),
|
|
91
|
+
i18next: esmUrl('i18next'),
|
|
92
|
+
'i18next-browser-languagedetector': esmUrl('i18next-browser-languagedetector'),
|
|
93
|
+
'@msgpack/msgpack': esmUrl('@msgpack/msgpack'),
|
|
94
|
+
fflate: esmUrl('fflate'),
|
|
79
95
|
};
|
|
80
96
|
/** Every JSON file the scaffold writes is 2-space indented and newline-terminated. */
|
|
81
97
|
function renderJson(value) {
|
|
@@ -153,6 +169,20 @@ export function renderTsconfig() {
|
|
|
153
169
|
],
|
|
154
170
|
});
|
|
155
171
|
}
|
|
172
|
+
/**
|
|
173
|
+
* The Bitmagic mark, inlined. Same 16x16 PNG as game/Images/favicon.png — keep in step with
|
|
174
|
+
* game/index.html. A data URI rather than a file reference because a built game is a single
|
|
175
|
+
* self-contained index.html that gets served from a bucket with no /favicon.png of its own.
|
|
176
|
+
* Regenerate with: base64 -i game/Images/favicon.png
|
|
177
|
+
*/
|
|
178
|
+
const FAVICON_DATA_URI = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB1UlEQVQ4jX2TsW/aQBTGfxB7q' +
|
|
179
|
+
'JBiprYSd8ZEqmjE0IykC0ipVKlT/wOjRGLuyFKJLnSqS5amo+eygLIUJjME1iJFERuWRfZgZnQdwK5jhX7TvXfv+757p/' +
|
|
180
|
+
'cySimSME3xCWgAb3iMGdANgqWbTGYiAdMUJ0AfKPJ/zICPQbD0Y4Ed2QOMdLUQkjBcEYZhMr0CToJg6WdNU+R3zkaa6Dj' +
|
|
181
|
+
'f6XS+cnt7R7v9BfFM8Pm4za7WBdB2/RbT5MlkCoDneQCcn1/w/u4DF78bUVnNNEXjwDAOfwIvkwKVSoWbmwnz+ZxqtcpgM' +
|
|
182
|
+
'EDXdY5qR1xd/0i2kzkwjMOrf71uL05P32LbNvl8nvF4TKvVolQq8eLVc4rFIsPhMBJ4rUWOZ2fvGI1GNJtNNE2PX1Mul+l' +
|
|
183
|
+
'0OuRyOSzLQte1x78sZUFJWVCXl10VwbZttVgs4jh5VkqpiCNlQWUjoc1mE4u6rovv+/T7fQAsy2IPVhrbwUhPHfV6/UnG/' +
|
|
184
|
+
'f0yGXpZoAvQ6/VYr9f7nGI4jpMMuyilkLLwR8qCqlSOVa/3S4VhqNIIw1A5zrdk/55Sav8oCyGRUsRW0+k06TwD6kGwfEg' +
|
|
185
|
+
'vk/vUf6QwZrtMD5DYxgimKRpsx7uWIg6Afnqd/wLHH+fn7VRm6gAAAABJRU5ErkJggg==';
|
|
156
186
|
export function renderIndexHtml() {
|
|
157
187
|
const aliasImports = importMapEntries();
|
|
158
188
|
const imports = { ...CDN_IMPORTS, ...aliasImports };
|
|
@@ -170,10 +200,10 @@ export function renderIndexHtml() {
|
|
|
170
200
|
<meta charset="UTF-8">
|
|
171
201
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
172
202
|
<title>Bitmagic Game</title>
|
|
203
|
+
<link rel="icon" type="image/png" href="${FAVICON_DATA_URI}">
|
|
173
204
|
<style>
|
|
174
205
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
175
|
-
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; }
|
|
176
|
-
html, body { touch-action: none; }
|
|
206
|
+
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; touch-action: none; }
|
|
177
207
|
canvas { display: block; }
|
|
178
208
|
#game-container {
|
|
179
209
|
position: fixed;
|
|
@@ -211,7 +241,6 @@ function renderAliasEntries() {
|
|
|
211
241
|
.join(',\n');
|
|
212
242
|
}
|
|
213
243
|
export function renderViteConfig() {
|
|
214
|
-
const entries = renderAliasEntries();
|
|
215
244
|
return `import { defineConfig } from 'vite';
|
|
216
245
|
|
|
217
246
|
// Aliases mirror tsconfig paths but point at the COMPILED output: tsc emits to dist/ and the
|
|
@@ -223,7 +252,7 @@ export default defineConfig({
|
|
|
223
252
|
assetsInclude: ['**/*.wasm'],
|
|
224
253
|
resolve: {
|
|
225
254
|
alias: {
|
|
226
|
-
${
|
|
255
|
+
${renderAliasEntries()}
|
|
227
256
|
}
|
|
228
257
|
},
|
|
229
258
|
server: {
|
|
@@ -244,7 +273,6 @@ ${entries}
|
|
|
244
273
|
* versions with the engine it was written for.
|
|
245
274
|
*/
|
|
246
275
|
export function renderVitePublishConfig() {
|
|
247
|
-
const entries = renderAliasEntries();
|
|
248
276
|
return `import { defineConfig } from 'vite';
|
|
249
277
|
import { viteSingleFile } from 'vite-plugin-singlefile';
|
|
250
278
|
|
|
@@ -273,7 +301,7 @@ export default defineConfig({
|
|
|
273
301
|
define: { __BUNDLED__: true },
|
|
274
302
|
resolve: {
|
|
275
303
|
alias: {
|
|
276
|
-
${
|
|
304
|
+
${renderAliasEntries()}
|
|
277
305
|
}
|
|
278
306
|
},
|
|
279
307
|
build: {
|
|
@@ -298,6 +326,34 @@ export function renderBitmagicJson(metadata) {
|
|
|
298
326
|
export function renderAgentsMd() {
|
|
299
327
|
return `# Working on this Bitmagic game
|
|
300
328
|
|
|
329
|
+
## Start \`bitmagic dev\` before you build anything
|
|
330
|
+
|
|
331
|
+
**This is the first command you run in a session, not the last.**
|
|
332
|
+
|
|
333
|
+
\`\`\`
|
|
334
|
+
bitmagic dev # long-running — start it IN THE BACKGROUND and leave it up
|
|
335
|
+
\`\`\`
|
|
336
|
+
|
|
337
|
+
\`bitmagic dev\` never exits: it builds, then serves the game and the editor at
|
|
338
|
+
\`http://localhost:3011/\` until it is interrupted. **Run it as a background task.** Run it in the
|
|
339
|
+
foreground and you will block until the session is killed, which is the mistake worth naming
|
|
340
|
+
because the way to avoid it is to defer the command — and deferring it is the failure this section
|
|
341
|
+
exists to prevent.
|
|
342
|
+
|
|
343
|
+
The point is not the server. The point is that the person who asked for this game is sitting in
|
|
344
|
+
front of that page, and everything below assumes they can see what you are doing:
|
|
345
|
+
|
|
346
|
+
- The game reloads by itself every time you change it, so they watch it take shape.
|
|
347
|
+
- The assets panel lists every generation while it runs, with your prompt and progress. A forge
|
|
348
|
+
takes twenty minutes; started with no dev view up, those twenty minutes look identical to a
|
|
349
|
+
crash.
|
|
350
|
+
- They can move objects in the Editor tab and screenshot a problem straight to you.
|
|
351
|
+
|
|
352
|
+
Started at the end, all of that is a server nobody needed. A game that appeared in one silent hour
|
|
353
|
+
is worth less than a rough one they watched arrive, because they could not steer the first.
|
|
354
|
+
|
|
355
|
+
If you are unsure whether one is already running, \`bitmagic reload\` says so and costs nothing.
|
|
356
|
+
|
|
301
357
|
## Layout
|
|
302
358
|
|
|
303
359
|
- \`src/work/\` — **your game.** Everything you write lives here. \`Game.ts\` is the entry
|
|
@@ -452,11 +508,12 @@ the two yaw conventions differ. Guessing produces code that compiles and moves t
|
|
|
452
508
|
|
|
453
509
|
\`\`\`
|
|
454
510
|
bitmagic check # typecheck against the vendored engine
|
|
455
|
-
bitmagic dev # build, then serve the game + editor with auto-reload (leave this running)
|
|
456
511
|
bitmagic reload # tell the open browser you have finished a round of edits
|
|
457
512
|
bitmagic verify # boot the game in a real browser and report what broke
|
|
458
513
|
\`\`\`
|
|
459
514
|
|
|
515
|
+
(\`bitmagic dev\` belongs at the START of the session — see the top of this file.)
|
|
516
|
+
|
|
460
517
|
The engine is large; \`check\` is the fast way to find out whether an edit holds together.
|
|
461
518
|
|
|
462
519
|
**Run \`bitmagic reload\` when you finish a round of edits.** \`bitmagic dev\` watches the project
|
|
@@ -653,8 +710,9 @@ Five things worth knowing:
|
|
|
653
710
|
message says when resuming is worth it, and when the failure is deterministic and you should
|
|
654
711
|
change the prompt instead.
|
|
655
712
|
|
|
656
|
-
Afterwards
|
|
657
|
-
|
|
713
|
+
Afterwards actually walk the level in the dev view — one that loads is not necessarily one you can
|
|
714
|
+
move through. (You should already have \`bitmagic dev\` running; a forge takes twenty minutes, and
|
|
715
|
+
its progress shows there.)
|
|
658
716
|
`;
|
|
659
717
|
}
|
|
660
718
|
/**
|
|
@@ -791,12 +849,14 @@ file is excluded from the publish fingerprint, so rewriting it never invalidates
|
|
|
791
849
|
|
|
792
850
|
## Step 4 — build slice 1, in this order
|
|
793
851
|
|
|
794
|
-
1. \`
|
|
795
|
-
|
|
852
|
+
1. \`bitmagic dev\`, **in the background, before anything else.** It never exits, so it has to be a
|
|
853
|
+
background task — and everything below is worth more when they can watch it happen. Last in this
|
|
854
|
+
list it is just a server; first, it is the whole reason the rest is visible.
|
|
855
|
+
2. \`GAME-DESIGN.md\` written or confirmed.
|
|
856
|
+
3. \`bitmagic cover\` — **now**, not later. It is the one paid generation slice 1 is allowed, it
|
|
796
857
|
takes minutes, and it is what the human looks at while you work. It writes \`world.json\`, so it
|
|
797
858
|
must come before any \`bitmagic verify\`.
|
|
798
|
-
|
|
799
|
-
4. \`bitmagic dev\`, left running, so they can watch.
|
|
859
|
+
4. \`mechanics-plan.md\`.
|
|
800
860
|
5. Write the code. Look up APIs with the \`finding-engine-apis\` skill; do not read engine source to
|
|
801
861
|
find out what exists.
|
|
802
862
|
6. \`bitmagic check\` until green.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-files.js","sourceRoot":"","sources":["../../src/scaffold/project-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEjF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"project-files.js","sourceRoot":"","sources":["../../src/scaffold/project-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEjF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,2BAA2B,EAAE,SAAS;IACtC,2BAA2B,EAAE,SAAS;IACtC,kBAAkB,EAAE,QAAQ;IAC5B,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,kCAAkC,EAAE,QAAQ;IAC5C,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,UAAU;IACjB,4FAA4F;IAC5F,6FAA6F;IAC7F,4CAA4C;CACZ,CAAC;AAEnC,MAAM,CAAC,MAAM,gBAAgB,GAA2B;IACtD,aAAa,EAAE,UAAU;IACzB,cAAc,EAAE,UAAU;IAC1B,8FAA8F;IAC9F,cAAc,EAAE,QAAQ;IACxB,4FAA4F;IAC5F,mFAAmF;IACnF,eAAe,EAAE,SAAS;IAC1B,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,QAAQ;IACd,wBAAwB,EAAE,QAAQ;CACnC,CAAC;AAEF,qEAAqE;AACrE,SAAS,aAAa,CAAC,IAA+B;IACpD,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAC/C,CAAC;AAED;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