@bongos/core 1.25.31 → 1.25.33
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/.bongos-core.json +36 -41
- package/docs/copy-inventory.md +28 -28
- package/docs/copy-registry.json +30 -30
- package/docs/module-api-changelog.md +4 -0
- package/docs/page-readings.json +202 -175
- package/modules/autonomy/runner-health.js +19 -0
- package/modules/hall-ui/public/gate.js +9 -5
- package/modules/hall-ui/public/index.html +4 -4
- package/modules/hall-ui/public/runner-button.js +7 -0
- package/modules/hall-ui/public/shell-game.css +2 -3
- package/modules/hall-ui/public/shell-game.js +6 -5
- package/modules/hall-ui/public/welcome-boot.css +18 -31
- package/modules/hall-ui/public/welcome-boot.js +81 -97
- package/modules/hall-ui/records/start-screen.md +6 -6
- package/modules/hall-ui/records/welcome-tower.md +29 -20
- package/package-lock.json +2 -2
- package/package.json +1 -1
- package/release-notes.json +12 -0
- package/scripts/bongos/autobongos-host.js +22 -11
- package/scripts/bongos/autobongos-run.js +37 -5
- package/src/module-api.js +1 -1
- package/tests/autobongos_cannot_fetch.mjs +123 -0
- package/tests/hall_sky_time.mjs +3 -2
- package/tests/hall_start_screen.mjs +3 -2
- package/tests/welcome_boot.mjs +35 -27
- package/tests/welcome_boot_browser.mjs +25 -19
- package/modules/hall-ui/public/welcome-day.webp +0 -0
- package/modules/hall-ui/public/welcome-night.webp +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// tests/welcome_boot_browser.mjs — the welcome in a real browser (tasks 1004785, 1004818).
|
|
2
2
|
//
|
|
3
3
|
// WHY. "Once a day", "Skip", "the craft picker does not also open", "Patron only with a seat", the day
|
|
4
|
-
// and night
|
|
4
|
+
// and night veils over the city in the clouds and the slow way out are behaviour across the real shell.js, craft-mode.js and
|
|
5
5
|
// welcome-boot.js together — the shell is what decides which of the two greets a builder — so this
|
|
6
|
-
// serves the REAL Home markup
|
|
6
|
+
// serves the REAL Home markup and the REAL hall scripts (the city's painters too) from a routed origin
|
|
7
7
|
// (localStorage needs one) in the ui-design kit's launcher. Every wait is on DOM state, never on a
|
|
8
8
|
// flag that flips before the DOM settles (the task 1004780 CI flake). Skips when the machine has no
|
|
9
9
|
// system Edge or Chrome, as ui_design_kit_fit does.
|
|
@@ -33,7 +33,9 @@ const INDEX = fs.readFileSync(path.join(HALL, 'index.html'), 'utf8')
|
|
|
33
33
|
.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g, '')
|
|
34
34
|
.replace(/\{\{[^}]*\}\}/g, '');
|
|
35
35
|
const STUB = '<script>window.__BRANDING__ = { identity: { worldName: "Harbor" } }; window.BongosClient = { createClient: () => ({ request: async () => ({ ok: false, status: 404, data: null }) }) };</script>';
|
|
36
|
-
|
|
36
|
+
// The city's three painters draw the scene (task 1005308: the city in the clouds, not a painting).
|
|
37
|
+
const PAINTERS = ['sky-time.js', 'city-draw.js', 'home-city-draw.js'];
|
|
38
|
+
const SCRIPTS = ['dom-utils.js', ...PAINTERS, 'shell-trail.js', 'craft-mode.js', 'welcome-boot.js', 'shell.js'] // dom-utils first, as on the real page (task 1004876)
|
|
37
39
|
.map((f) => `<script src="/builders/${f}"></script>`).join('');
|
|
38
40
|
const PAGE = INDEX.replace('</body>', STUB + SCRIPTS + '</body>');
|
|
39
41
|
|
|
@@ -46,7 +48,7 @@ async function hall({ art = true, reducedMotion = 'no-preference', time = null }
|
|
|
46
48
|
if (p === '/api/bongos/auth/web/start') return route.fulfill({ contentType: 'text/html', body: '<!doctype html><title>github</title><p id="auth">sign in</p>' });
|
|
47
49
|
if (p === '/studio' || p === '/city') return route.fulfill({ contentType: 'text/html', body: '<!doctype html><title>room</title><p id="room">' + p + '</p>' });
|
|
48
50
|
const ext = path.extname(p);
|
|
49
|
-
if (
|
|
51
|
+
if (!art && PAINTERS.includes(path.basename(p))) return route.fulfill({ status: 404, body: '' });
|
|
50
52
|
const f = path.join(HALL, p.replace(/^\/builders\//, ''));
|
|
51
53
|
if (p.startsWith('/builders/') && TYPES[ext] && fs.existsSync(f)) return route.fulfill({ contentType: TYPES[ext], body: fs.readFileSync(f) });
|
|
52
54
|
return route.fulfill({ status: 404, body: '' });
|
|
@@ -91,8 +93,8 @@ test('first visit of the day: the welcome, not the craft picker; Skip brings the
|
|
|
91
93
|
'the welcome shows, the picker is marked asked and does not stack on it');
|
|
92
94
|
assert.equal(await page.evaluate(() => document.querySelector('.wb__banner').tagName), 'DIV',
|
|
93
95
|
'over a signed-in hall the shell keeps the one <header>; the banner is a plain block (task 1005080)');
|
|
94
|
-
// The
|
|
95
|
-
await page.
|
|
96
|
+
// The city in the clouds is drawn behind it (task 1005308).
|
|
97
|
+
await page.waitForSelector('#welcome-boot .cloud-scene .cloud-scene__svg path');
|
|
96
98
|
assert.equal(await page.isVisible('[data-wb-skip]'), true);
|
|
97
99
|
await page.click('[data-wb-skip]');
|
|
98
100
|
await done(page);
|
|
@@ -227,17 +229,18 @@ test('roles: a seat holder sees Patron; Artisan stays on Home in Artisan', { ski
|
|
|
227
229
|
await ctx.close();
|
|
228
230
|
});
|
|
229
231
|
|
|
230
|
-
test('no
|
|
232
|
+
test('no city painters: the greeting and the choice still come up, over the sky colour', { skip }, async () => {
|
|
231
233
|
const ctx = await hall({ art: false });
|
|
232
234
|
const { page } = await open(ctx);
|
|
233
235
|
await signIn(page);
|
|
234
236
|
await done(page);
|
|
235
237
|
const s = await page.evaluate(() => ({
|
|
236
238
|
bare: document.getElementById('welcome-boot').classList.contains('wb--bare'),
|
|
237
|
-
|
|
239
|
+
city: !!document.querySelector('#welcome-boot .cloud-scene__svg'),
|
|
240
|
+
sky: !!document.querySelector('#welcome-boot .cloud-scene'),
|
|
238
241
|
choices: document.querySelectorAll('.wb__choice').length,
|
|
239
242
|
}));
|
|
240
|
-
assert.deepEqual(s, { bare: true,
|
|
243
|
+
assert.deepEqual(s, { bare: true, city: false, sky: true, choices: 2 });
|
|
241
244
|
await ctx.close();
|
|
242
245
|
});
|
|
243
246
|
|
|
@@ -256,15 +259,16 @@ const look = (page) => page.evaluate(() => {
|
|
|
256
259
|
return {
|
|
257
260
|
day: r.classList.contains('wb--day'), night: r.classList.contains('wb--night'),
|
|
258
261
|
veil: getComputedStyle(r.querySelector('.wb__veil')).backgroundColor,
|
|
259
|
-
|
|
260
|
-
|
|
262
|
+
city: !!r.querySelector('.cloud-scene__svg'),
|
|
263
|
+
hour: document.documentElement.getAttribute('data-sky-hour'),
|
|
264
|
+
img: r.querySelectorAll('img:not(.wb__logo)').length,
|
|
261
265
|
};
|
|
262
266
|
});
|
|
263
267
|
|
|
264
|
-
test('by day the
|
|
268
|
+
test('by day the city opens from a white veil, by night from black, in the sky of that hour (task 1005308)', { skip }, async () => {
|
|
265
269
|
for (const [time, want] of [
|
|
266
|
-
[new Date(2026, 9, 23, 10, 0), { day: true, night: false, veil: 'rgb(255, 255, 255)',
|
|
267
|
-
[new Date(2026, 9, 23, 22, 0), { day: false, night: true, veil: 'rgb(0, 0, 0)',
|
|
270
|
+
[new Date(2026, 9, 23, 10, 0), { day: true, night: false, veil: 'rgb(255, 255, 255)', city: true, hour: '10', img: 0 }],
|
|
271
|
+
[new Date(2026, 9, 23, 22, 0), { day: false, night: true, veil: 'rgb(0, 0, 0)', city: true, hour: '22', img: 0 }],
|
|
268
272
|
]) {
|
|
269
273
|
const ctx = await hall({ time });
|
|
270
274
|
const { page } = await open(ctx);
|
|
@@ -305,19 +309,21 @@ test('the banner is the animated logo, the motion is laid on, and the drawn towe
|
|
|
305
309
|
const ctx = await hall();
|
|
306
310
|
const { page } = await open(ctx);
|
|
307
311
|
await signIn(page);
|
|
308
|
-
await page.waitForSelector('#welcome-boot.wb--lit .
|
|
312
|
+
await page.waitForSelector('#welcome-boot.wb--lit .cloud-scene__svg');
|
|
309
313
|
const s = await page.evaluate(() => ({
|
|
310
314
|
banner: document.querySelector('.wb__banner').textContent,
|
|
311
315
|
name: document.querySelector('.wb__banner .wb__name').textContent,
|
|
312
316
|
mark: !!document.querySelector('.wb__banner svg.wb__mark .wb__moonlet'),
|
|
313
317
|
ringAnim: getComputedStyle(document.querySelector('.wb__ring')).animationName,
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
318
|
+
// anywhere on the page, under any container: the painting's lights must not come back
|
|
319
|
+
pulses: document.querySelectorAll('.wb-pulse, .wb-pulses').length,
|
|
320
|
+
cars: document.querySelectorAll('.wb-car').length,
|
|
321
|
+
// every earlier scene: the drawn tower and city, the painting and its light layer
|
|
322
|
+
old: document.querySelectorAll('.wb-floor, .wb-bldg, .wb-person, #wb-beam, #wb-city, #wb-fx, .wb-motion, .wb-moon, .wb-star, .wb__img').length,
|
|
317
323
|
}));
|
|
318
324
|
assert.doesNotMatch(s.banner, /Working on the core of/, 'task 1004953: the banner text is gone');
|
|
319
325
|
assert.deepEqual({ name: s.name, mark: s.mark, ringAnim: s.ringAnim, pulses: s.pulses, cars: s.cars, old: s.old },
|
|
320
|
-
{ name: 'Harbor', mark: true, ringAnim: 'wb-ring', pulses:
|
|
326
|
+
{ name: 'Harbor', mark: true, ringAnim: 'wb-ring', pulses: 0, cars: 0, old: 0 }, 'the painting\'s lights went with it (task 1005308)');
|
|
321
327
|
await ctx.close();
|
|
322
328
|
});
|
|
323
329
|
|
|
Binary file
|
|
Binary file
|