@bongos/core 1.23.13 → 1.23.15

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.
Files changed (56) hide show
  1. package/.bongos-core.json +90 -55
  2. package/clients/bongos-client/README.md +1 -1
  3. package/clients/bongos-client/bongos-client.global.js +2 -0
  4. package/clients/bongos-client/index.cjs +2 -0
  5. package/clients/bongos-client/index.d.ts +2 -0
  6. package/clients/bongos-client/index.mjs +2 -0
  7. package/docs/api/openapi.json +22 -1
  8. package/docs/api-reference.md +3 -2
  9. package/docs/copy-inventory.md +1000 -946
  10. package/docs/copy-registry.json +2009 -1465
  11. package/docs/module-api-changelog.md +4 -2
  12. package/docs/page-inventory.json +10 -4
  13. package/docs/page-readings.json +593 -573
  14. package/modules/copy-desk/page-status.js +2 -2
  15. package/modules/copy-desk/tests/copy_page_status.mjs +1 -1
  16. package/modules/hall-ui/public/approval-queue-lib.js +1 -1
  17. package/modules/hall-ui/public/approval-queue.css +26 -12
  18. package/modules/hall-ui/public/approval-queue.js +40 -16
  19. package/modules/hall-ui/public/studio-lib.js +5 -3
  20. package/modules/hall-ui/public/studio.html +8 -8
  21. package/modules/hall-ui/public/studio.js +25 -5
  22. package/modules/hall-ui/public/studio.states.json +54 -4
  23. package/modules/hall-ui/public/welcome-boot.js +62 -12
  24. package/modules/platform-identity/builder-of-the-week.js +180 -0
  25. package/modules/platform-identity/migrations/platform_identity_032_weekly_features.sql +53 -0
  26. package/modules/platform-identity/routes/community-leaderboard.js +25 -1
  27. package/modules/public-landing/public/account.html +2 -1
  28. package/modules/public-landing/public/community-week-none.states.json +16 -0
  29. package/modules/public-landing/public/community.html +142 -13
  30. package/modules/public-landing/public/community.states.json +6 -4
  31. package/modules/public-landing/public/connections.html +2 -1
  32. package/modules/public-landing/public/contact.html +2 -1
  33. package/modules/public-landing/public/guild.html +2 -1
  34. package/modules/public-landing/public/index.html +2 -1
  35. package/modules/public-landing/public/invitations.html +2 -1
  36. package/modules/public-landing/public/privacy.html +2 -1
  37. package/modules/public-landing/public/projects.html +2 -1
  38. package/modules/public-landing/public/terms.html +2 -1
  39. package/modules/ui-design/kit/fixtures/community-week-none.json +6 -0
  40. package/modules/ui-design/kit/fixtures/community-week.json +11 -0
  41. package/modules/ui-design/kit/serve.js +8 -0
  42. package/package-lock.json +2 -2
  43. package/package.json +1 -1
  44. package/release-notes.json +15 -1
  45. package/scripts/bongos/run-unit-tests.js +4 -0
  46. package/src/module-api.js +1 -1
  47. package/src/platform-server.js +5 -5
  48. package/tests/builder_of_the_week.mjs +266 -0
  49. package/tests/builder_of_the_week_db.mjs +166 -0
  50. package/tests/hall_approval_queue.mjs +33 -9
  51. package/tests/hall_studio_home.mjs +74 -7
  52. package/tests/hub_account_page.mjs +2 -2
  53. package/tests/hub_community_page.mjs +136 -25
  54. package/tests/landing_legal_pages.mjs +2 -2
  55. package/tests/privacy_matrix.mjs +53 -8
  56. package/tests/welcome_boot_browser.mjs +45 -3
@@ -43,6 +43,7 @@ async function hall({ art = true, reducedMotion = 'no-preference', time = null }
43
43
  await ctx.route(ORIGIN + '/**', (route) => {
44
44
  const p = new URL(route.request().url()).pathname;
45
45
  if (p === '/' || p === '/index.html') return route.fulfill({ contentType: 'text/html', body: PAGE });
46
+ 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>' });
46
47
  if (p === '/thinking' || p === '/city') return route.fulfill({ contentType: 'text/html', body: '<!doctype html><title>room</title><p id="room">' + p + '</p>' });
47
48
  const ext = path.extname(p);
48
49
  if (ext === '.webp' && !art) return route.fulfill({ status: 404, body: '' });
@@ -123,12 +124,53 @@ test('once a day: the next load the same day gets no welcome (and the picker is
123
124
  await ctx.close();
124
125
  });
125
126
 
126
- test('a visitor who is not signed in is never greeted, and nothing is remembered', { skip }, async () => {
127
+ test('a visitor who is not signed in gets the Welcome on Home with a sign-in button, and no day is remembered', { skip }, async () => {
127
128
  const ctx = await hall();
128
129
  const { page } = await open(ctx);
129
130
  await page.evaluate(() => window.OTBShell.applyAccess({ authed: false }));
130
- const s = await page.evaluate(() => ({ welcome: !!document.getElementById('welcome-boot'), keys: Object.keys(localStorage).filter((k) => k.startsWith('hall-welcome-day')) }));
131
- assert.deepEqual(s, { welcome: false, keys: [] });
131
+ await page.waitForSelector('#welcome-boot');
132
+ const s = await page.evaluate(() => ({
133
+ hi: document.getElementById('wb-hi').textContent,
134
+ signin: !!document.querySelector('[data-wb-signin]'),
135
+ roles: !!document.querySelector('[data-wb-roles]'),
136
+ keys: Object.keys(localStorage).filter((k) => k.startsWith('hall-welcome-day') || k === 'hall-welcome-signin'),
137
+ picker: !!document.getElementById('craft-picker'),
138
+ }));
139
+ assert.match(s.hi, /^Welcome to /);
140
+ assert.deepEqual([s.signin, s.roles, s.keys, s.picker], [true, false, [], false]);
141
+ await ctx.close();
142
+ });
143
+
144
+ test('every fresh sign-in is welcomed again the same day, whichever sign-in link was clicked', { skip }, async () => {
145
+ for (const link of ['[data-wb-signin]', '#shell-signin']) {
146
+ const ctx = await hall();
147
+ const first = await open(ctx);
148
+ await signIn(first.page);
149
+ await first.page.waitForSelector('#welcome-boot');
150
+ await first.page.close(); // the day is now seen
151
+ const out = await open(ctx);
152
+ await out.page.evaluate(() => window.OTBShell.applyAccess({ authed: false }));
153
+ await out.page.waitForSelector('#welcome-boot');
154
+ // The welcome's own button, or the shell's top-bar link, leaves the flag and heads for GitHub.
155
+ await out.page.evaluate((sel) => document.querySelector(sel).click(), link);
156
+ await out.page.waitForSelector('#auth');
157
+ const { page } = await open(ctx);
158
+ await signIn(page);
159
+ await page.waitForSelector('#welcome-boot');
160
+ assert.equal(await page.evaluate(() => localStorage.getItem('hall-welcome-signin')), null, link + ': the flag is spent');
161
+ await ctx.close();
162
+ }
163
+ });
164
+
165
+ test('a link that only mentions the sign-in path on another site sets no flag', { skip }, async () => {
166
+ const ctx = await hall();
167
+ const { page } = await open(ctx);
168
+ await page.evaluate(() => {
169
+ const a = document.createElement('a');
170
+ a.id = 'far'; a.href = 'https://elsewhere.test/auth/web/start'; a.addEventListener('click', (e) => e.preventDefault());
171
+ document.body.appendChild(a); a.click();
172
+ });
173
+ assert.equal(await page.evaluate(() => localStorage.getItem('hall-welcome-signin')), null);
132
174
  await ctx.close();
133
175
  });
134
176