create-ailk 0.38.0 → 0.40.0
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/dist/add-route.js +16 -1
- package/dist/body-heading.d.ts +2 -1
- package/dist/body-heading.js +31 -3
- package/dist/derive-architecture.js +3 -1
- package/dist/module-architecture.js +0 -3
- package/dist/remove-module.js +27 -14
- package/dist/routes.d.ts +36 -2
- package/dist/routes.js +269 -23
- package/dist/site-manifest.js +6 -4
- package/dist/site-roster.d.ts +11 -3
- package/dist/site-roster.js +48 -22
- package/dist/surfaces.d.ts +13 -3
- package/dist/surfaces.js +128 -194
- package/dist/sync-routes.js +22 -5
- package/dist/template-record.js +3 -1
- package/dist/topology.d.ts +11 -0
- package/dist/topology.js +253 -3
- package/package.json +3 -3
- package/templates/apps/web/CLAUDE.md +32 -4
- package/templates/apps/web/__tests__/__mocks__/next-intl-server.ts +6 -1
- package/templates/apps/web/__tests__/__mocks__/next-intl.ts +6 -1
- package/templates/apps/web/__tests__/auth/seam.test.ts +34 -0
- package/templates/apps/web/account.config.tsx +2 -3
- package/templates/apps/web/app/[locale]/(authed)/account/connect/__tests__/page.test.tsx +1 -1
- package/templates/apps/web/app/[locale]/(authed)/account/connect/page.tsx +1 -1
- package/templates/apps/web/app/[locale]/(authed)/signed-out-gate.generated.tsx +1 -1
- package/templates/apps/web/app/[locale]/layout.tsx +2 -2
- package/templates/apps/web/auth.config.tsx +107 -0
- package/templates/apps/web/auth.ts +2 -1
- package/templates/apps/web/i18n/request.ts +13 -2
- package/templates/apps/web/jest.config.cjs +10 -0
- package/templates/apps/web/lib/__tests__/deck-page.test.ts +9 -0
- package/templates/apps/web/lib/__tests__/fixtures/site-topology.ts +3 -0
- package/templates/apps/web/lib/__tests__/in-page-magnet-self-request.test.ts +1 -1
- package/templates/apps/web/lib/__tests__/in-page-magnet.test.ts +2 -2
- package/templates/apps/web/lib/__tests__/pricing-page.test.ts +1 -1
- package/templates/apps/web/lib/__tests__/server-api.test.ts +1 -1
- package/templates/apps/web/lib/__tests__/structured-data.test.tsx +17 -4
- package/templates/apps/web/lib/in-page-magnet.ts +2 -2
- package/templates/apps/web/lib/pricing-page.ts +3 -3
- package/templates/apps/web/lib/server-api.ts +1 -1
- package/templates/apps/web/{app/[locale]/contact → lib}/site-contact-email.ts +1 -1
- package/templates/apps/web/{app/[locale]/contact → lib}/site-contact-lines.ts +1 -1
- package/templates/apps/web/lib/site-header.ts +1 -1
- package/templates/apps/web/lib/topology.generated.ts +5 -0
- package/templates/apps/web/messages/en.json +0 -271
- package/templates/apps/web/middleware.ts +12 -25
- package/templates/apps/web/next.config.mjs +15 -0
- package/templates/apps/web/package.json +2 -0
- package/templates/apps/web/site-pages.config.tsx +85 -0
- package/templates/apps/web/types/messages.d.ts +6 -1
- package/templates/tools/body-heading.ts +30 -3
- package/versions.json +50 -48
- package/templates/apps/web/app/[locale]/(auth)/__tests__/auth-pages.test.tsx +0 -322
- package/templates/apps/web/app/[locale]/(auth)/__tests__/password-reset.test.tsx +0 -554
- package/templates/apps/web/app/[locale]/(auth)/consent/__tests__/consent-actions.test.ts +0 -56
- package/templates/apps/web/app/[locale]/(auth)/consent/__tests__/page.test.tsx +0 -164
- package/templates/apps/web/app/[locale]/(auth)/consent/consent-form.tsx +0 -132
- package/templates/apps/web/app/[locale]/(auth)/consent/consent.actions.ts +0 -51
- package/templates/apps/web/app/[locale]/(auth)/consent/page.tsx +0 -144
- package/templates/apps/web/app/[locale]/(auth)/forgot-password/forgot-password-card.tsx +0 -101
- package/templates/apps/web/app/[locale]/(auth)/forgot-password/page.tsx +0 -111
- package/templates/apps/web/app/[locale]/(auth)/layout.tsx +0 -81
- package/templates/apps/web/app/[locale]/(auth)/legal-footnote.tsx +0 -35
- package/templates/apps/web/app/[locale]/(auth)/reset-password/__tests__/return.test.tsx +0 -179
- package/templates/apps/web/app/[locale]/(auth)/reset-password/page.tsx +0 -157
- package/templates/apps/web/app/[locale]/(auth)/reset-password/reset-password-card.tsx +0 -126
- package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/next-path.test.ts +0 -54
- package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/page.test.tsx +0 -628
- package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/remembered-method.test.ts +0 -43
- package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/sign-in-card.test.tsx +0 -266
- package/templates/apps/web/app/[locale]/(auth)/sign-in/next-path.ts +0 -20
- package/templates/apps/web/app/[locale]/(auth)/sign-in/page.tsx +0 -234
- package/templates/apps/web/app/[locale]/(auth)/sign-in/remembered-method.ts +0 -37
- package/templates/apps/web/app/[locale]/(auth)/sign-in/sign-in-card.tsx +0 -323
- package/templates/apps/web/app/[locale]/(auth)/sign-in/sign-in-text.ts +0 -93
- package/templates/apps/web/app/[locale]/(auth)/sign-up/__tests__/page.test.tsx +0 -301
- package/templates/apps/web/app/[locale]/(auth)/sign-up/__tests__/sign-up-card.test.tsx +0 -309
- package/templates/apps/web/app/[locale]/(auth)/sign-up/page.tsx +0 -201
- package/templates/apps/web/app/[locale]/(auth)/sign-up/sign-up-card.tsx +0 -366
- package/templates/apps/web/app/[locale]/(auth)/use-auth-card-flow.ts +0 -116
- package/templates/apps/web/app/[locale]/(auth)/verify-email/__tests__/actions.test.ts +0 -94
- package/templates/apps/web/app/[locale]/(auth)/verify-email/actions.ts +0 -77
- package/templates/apps/web/app/[locale]/(auth)/verify-email/page.tsx +0 -154
- package/templates/apps/web/app/[locale]/(authed)/account/appointments/[slug]/page.tsx +0 -3
- package/templates/apps/web/app/[locale]/(authed)/account/appointments/page.tsx +0 -3
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/page.tsx +0 -3
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/versions/[version]/file/route.ts +0 -2
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/page.tsx +0 -3
- package/templates/apps/web/app/[locale]/(authed)/account/billing/page.tsx +0 -12
- package/templates/apps/web/app/[locale]/(authed)/account/general/page.tsx +0 -12
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/[kind]/[id]/page.tsx +0 -12
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/message/[id]/file/route.ts +0 -2
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/page.tsx +0 -12
- package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/page.tsx +0 -3
- package/templates/apps/web/app/[locale]/(authed)/account/layout.tsx +0 -10
- package/templates/apps/web/app/[locale]/(authed)/account/notifications/page.tsx +0 -3
- package/templates/apps/web/app/[locale]/(authed)/account/onboarding/page.tsx +0 -3
- package/templates/apps/web/app/[locale]/(authed)/account/page.tsx +0 -12
- package/templates/apps/web/app/[locale]/(authed)/account/privacy/export/route.ts +0 -2
- package/templates/apps/web/app/[locale]/(authed)/account/privacy/page.tsx +0 -3
- package/templates/apps/web/app/[locale]/(authed)/account/security/page.tsx +0 -3
- package/templates/apps/web/app/[locale]/(authed)/account/settings/page.tsx +0 -2
- package/templates/apps/web/app/[locale]/(authed)/account/support/page.tsx +0 -3
- package/templates/apps/web/app/[locale]/(authed)/leads/__tests__/page.test.tsx +0 -205
- package/templates/apps/web/app/[locale]/(authed)/leads/components/LeadsTable.tsx +0 -137
- package/templates/apps/web/app/[locale]/(authed)/leads/page.tsx +0 -122
- package/templates/apps/web/app/[locale]/(authed)/waitlist/components/ForbiddenState.tsx +0 -24
- package/templates/apps/web/app/[locale]/(authed)/waitlist/format.ts +0 -111
- package/templates/apps/web/app/[locale]/[slug]/[detail]/__tests__/page.test.tsx +0 -402
- package/templates/apps/web/app/[locale]/[slug]/[detail]/page.tsx +0 -143
- package/templates/apps/web/app/[locale]/[slug]/__tests__/page.test.tsx +0 -148
- package/templates/apps/web/app/[locale]/[slug]/page.tsx +0 -109
- package/templates/apps/web/app/[locale]/about/[slug]/page.tsx +0 -46
- package/templates/apps/web/app/[locale]/about/__tests__/about-routes.test.tsx +0 -353
- package/templates/apps/web/app/[locale]/about/page.tsx +0 -122
- package/templates/apps/web/app/[locale]/alternatives/__tests__/page.test.tsx +0 -161
- package/templates/apps/web/app/[locale]/alternatives/page.tsx +0 -112
- package/templates/apps/web/app/[locale]/careers/[slug]/[action]/page.tsx +0 -244
- package/templates/apps/web/app/[locale]/careers/[slug]/apply.actions.ts +0 -325
- package/templates/apps/web/app/[locale]/careers/[slug]/job-application-form.ts +0 -120
- package/templates/apps/web/app/[locale]/careers/[slug]/page.tsx +0 -73
- package/templates/apps/web/app/[locale]/careers/__tests__/apply.actions.test.ts +0 -497
- package/templates/apps/web/app/[locale]/careers/__tests__/careers-hub.test.tsx +0 -172
- package/templates/apps/web/app/[locale]/careers/__tests__/careers-set.test.tsx +0 -153
- package/templates/apps/web/app/[locale]/careers/__tests__/job-application-form.test.ts +0 -141
- package/templates/apps/web/app/[locale]/careers/__tests__/job-apply-page.test.tsx +0 -546
- package/templates/apps/web/app/[locale]/careers/__tests__/page-renderer-migration.test.tsx +0 -189
- package/templates/apps/web/app/[locale]/careers/page.tsx +0 -165
- package/templates/apps/web/app/[locale]/case-studies/[slug]/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/case-studies/__tests__/hub-children.test.tsx +0 -65
- package/templates/apps/web/app/[locale]/case-studies/__tests__/page-renderer-migration.test.tsx +0 -125
- package/templates/apps/web/app/[locale]/case-studies/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/clients/__tests__/page-renderer-migration.test.tsx +0 -85
- package/templates/apps/web/app/[locale]/clients/page.tsx +0 -47
- package/templates/apps/web/app/[locale]/contact/ConversationalIntakeWrapper.tsx +0 -249
- package/templates/apps/web/app/[locale]/contact/__tests__/ConversationalIntakeWrapper.test.tsx +0 -400
- package/templates/apps/web/app/[locale]/contact/__tests__/contact-form-magnet.test.ts +0 -138
- package/templates/apps/web/app/[locale]/contact/__tests__/contact-form-text.test.ts +0 -49
- package/templates/apps/web/app/[locale]/contact/__tests__/contact-magnet-page.test.tsx +0 -494
- package/templates/apps/web/app/[locale]/contact/__tests__/contact.actions.test.ts +0 -1122
- package/templates/apps/web/app/[locale]/contact/__tests__/intake-analytics.test.ts +0 -51
- package/templates/apps/web/app/[locale]/contact/__tests__/page-renderer-migration.test.tsx +0 -319
- package/templates/apps/web/app/[locale]/contact/contact-form-magnet.ts +0 -77
- package/templates/apps/web/app/[locale]/contact/contact-form-text.ts +0 -52
- package/templates/apps/web/app/[locale]/contact/contact.actions.ts +0 -403
- package/templates/apps/web/app/[locale]/contact/intake-analytics.ts +0 -49
- package/templates/apps/web/app/[locale]/contact/intake-script.ts +0 -92
- package/templates/apps/web/app/[locale]/contact/page.tsx +0 -267
- package/templates/apps/web/app/[locale]/courses/[slug]/page.tsx +0 -50
- package/templates/apps/web/app/[locale]/courses/__tests__/hub-children.test.tsx +0 -32
- package/templates/apps/web/app/[locale]/courses/__tests__/page-renderer-migration.test.tsx +0 -123
- package/templates/apps/web/app/[locale]/courses/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/events/[slug]/page.tsx +0 -57
- package/templates/apps/web/app/[locale]/events/__tests__/hub-children.test.tsx +0 -32
- package/templates/apps/web/app/[locale]/events/__tests__/page-renderer-migration.test.tsx +0 -164
- package/templates/apps/web/app/[locale]/events/__tests__/program-event.test.tsx +0 -120
- package/templates/apps/web/app/[locale]/events/page.tsx +0 -60
- package/templates/apps/web/app/[locale]/faq/page.tsx +0 -54
- package/templates/apps/web/app/[locale]/features/[slug]/page.tsx +0 -54
- package/templates/apps/web/app/[locale]/features/__tests__/hub-children.test.tsx +0 -32
- package/templates/apps/web/app/[locale]/features/page.tsx +0 -50
- package/templates/apps/web/app/[locale]/for/[slug]/page.tsx +0 -54
- package/templates/apps/web/app/[locale]/for/__tests__/hub-children.test.tsx +0 -32
- package/templates/apps/web/app/[locale]/for/__tests__/page-renderer-migration.test.tsx +0 -90
- package/templates/apps/web/app/[locale]/for/page.tsx +0 -51
- package/templates/apps/web/app/[locale]/glossary/page.tsx +0 -53
- package/templates/apps/web/app/[locale]/how-to/[slug]/page.tsx +0 -50
- package/templates/apps/web/app/[locale]/how-to/__tests__/page-renderer-migration.test.tsx +0 -78
- package/templates/apps/web/app/[locale]/how-to/page.tsx +0 -50
- package/templates/apps/web/app/[locale]/integrations/[slug]/page.tsx +0 -54
- package/templates/apps/web/app/[locale]/integrations/__tests__/hub-children.test.tsx +0 -38
- package/templates/apps/web/app/[locale]/integrations/__tests__/page-renderer-migration.test.tsx +0 -141
- package/templates/apps/web/app/[locale]/integrations/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/launch-service/page.tsx +0 -44
- package/templates/apps/web/app/[locale]/newsletter/__tests__/page.test.tsx +0 -236
- package/templates/apps/web/app/[locale]/newsletter/page.tsx +0 -179
- package/templates/apps/web/app/[locale]/page.tsx +0 -147
- package/templates/apps/web/app/[locale]/partners/[slug]/page.tsx +0 -45
- package/templates/apps/web/app/[locale]/partners/__tests__/hub-children.test.tsx +0 -32
- package/templates/apps/web/app/[locale]/partners/__tests__/page-renderer-migration.test.tsx +0 -125
- package/templates/apps/web/app/[locale]/partners/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/portfolio/[slug]/page.tsx +0 -46
- package/templates/apps/web/app/[locale]/portfolio/__tests__/hub-children.test.tsx +0 -38
- package/templates/apps/web/app/[locale]/portfolio/page.tsx +0 -50
- package/templates/apps/web/app/[locale]/pricing/[slug]/__tests__/page.test.tsx +0 -324
- package/templates/apps/web/app/[locale]/pricing/[slug]/page.tsx +0 -87
- package/templates/apps/web/app/[locale]/pricing/__tests__/__snapshots__/unconnected.test.tsx.snap +0 -7
- package/templates/apps/web/app/[locale]/pricing/__tests__/offerings.test.tsx +0 -605
- package/templates/apps/web/app/[locale]/pricing/__tests__/page.test.tsx +0 -219
- package/templates/apps/web/app/[locale]/pricing/__tests__/pricing-pages.test.tsx +0 -215
- package/templates/apps/web/app/[locale]/pricing/__tests__/unconnected.test.tsx +0 -282
- package/templates/apps/web/app/[locale]/pricing/page.tsx +0 -120
- package/templates/apps/web/app/[locale]/privacy/page.tsx +0 -40
- package/templates/apps/web/app/[locale]/products/[slug]/page.tsx +0 -50
- package/templates/apps/web/app/[locale]/products/__tests__/hub-children.test.tsx +0 -32
- package/templates/apps/web/app/[locale]/products/__tests__/page-renderer-migration.test.tsx +0 -141
- package/templates/apps/web/app/[locale]/products/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/projects/[slug]/page.tsx +0 -37
- package/templates/apps/web/app/[locale]/projects/__tests__/hub-children.test.tsx +0 -32
- package/templates/apps/web/app/[locale]/projects/__tests__/page-renderer-migration.test.tsx +0 -157
- package/templates/apps/web/app/[locale]/projects/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/purchase-policy/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/resources/[slug]/page.tsx +0 -54
- package/templates/apps/web/app/[locale]/resources/__tests__/hub-children.test.tsx +0 -38
- package/templates/apps/web/app/[locale]/resources/__tests__/page-renderer-migration.test.tsx +0 -151
- package/templates/apps/web/app/[locale]/resources/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/services/[slug]/[child]/page.tsx +0 -68
- package/templates/apps/web/app/[locale]/services/[slug]/page.tsx +0 -88
- package/templates/apps/web/app/[locale]/services/__tests__/hub-children.test.tsx +0 -158
- package/templates/apps/web/app/[locale]/services/__tests__/page-renderer-migration.test.tsx +0 -187
- package/templates/apps/web/app/[locale]/services/__tests__/service-detail-sections.test.tsx +0 -224
- package/templates/apps/web/app/[locale]/services/__tests__/service-families.test.tsx +0 -368
- package/templates/apps/web/app/[locale]/services/page.tsx +0 -71
- package/templates/apps/web/app/[locale]/software/[slug]/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/software/__tests__/page-renderer-migration.test.tsx +0 -81
- package/templates/apps/web/app/[locale]/software/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/team/[slug]/page.tsx +0 -45
- package/templates/apps/web/app/[locale]/team/__tests__/hub-children.test.tsx +0 -32
- package/templates/apps/web/app/[locale]/team/__tests__/team-routes.test.tsx +0 -161
- package/templates/apps/web/app/[locale]/team/page.tsx +0 -50
- package/templates/apps/web/app/[locale]/tech-articles/[slug]/page.tsx +0 -54
- package/templates/apps/web/app/[locale]/tech-articles/__tests__/page-renderer-migration.test.tsx +0 -82
- package/templates/apps/web/app/[locale]/tech-articles/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/templates/[slug]/__tests__/page.test.tsx +0 -203
- package/templates/apps/web/app/[locale]/templates/[slug]/page.tsx +0 -81
- package/templates/apps/web/app/[locale]/templates/__tests__/page.test.tsx +0 -237
- package/templates/apps/web/app/[locale]/templates/page.tsx +0 -114
- package/templates/apps/web/app/[locale]/terms/page.tsx +0 -40
- package/templates/apps/web/app/[locale]/testimonials/__tests__/page-renderer-migration.test.tsx +0 -85
- package/templates/apps/web/app/[locale]/testimonials/page.tsx +0 -51
- package/templates/apps/web/app/[locale]/thanks/[slug]/__tests__/page.test.tsx +0 -136
- package/templates/apps/web/app/[locale]/thanks/[slug]/page.tsx +0 -39
- package/templates/apps/web/app/[locale]/unsubscribe/__tests__/unsubscribe-rsc-boundary.test.tsx +0 -226
- package/templates/apps/web/app/[locale]/unsubscribe/__tests__/unsubscribe.test.tsx +0 -217
- package/templates/apps/web/app/[locale]/unsubscribe/page.tsx +0 -106
- package/templates/apps/web/app/[locale]/unsubscribe/unsubscribe-button.tsx +0 -94
- package/templates/apps/web/app/[locale]/unsubscribe/unsubscribe.actions.ts +0 -55
- package/templates/apps/web/app/[locale]/vs/[slug]/__tests__/page.test.tsx +0 -100
- package/templates/apps/web/app/[locale]/vs/[slug]/page.tsx +0 -60
- package/templates/apps/web/app/[locale]/whitepapers/[slug]/page.tsx +0 -54
- package/templates/apps/web/app/[locale]/whitepapers/__tests__/page-renderer-migration.test.tsx +0 -82
- package/templates/apps/web/app/[locale]/whitepapers/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/working-agreement/__tests__/page.test.tsx +0 -63
- package/templates/apps/web/app/[locale]/working-agreement/page.tsx +0 -41
- package/templates/apps/web/app/api/auth/[...all]/route.ts +0 -16
- package/templates/apps/web/app/api/auth/hub/__tests__/continuation.test.ts +0 -143
- package/templates/apps/web/app/api/auth/hub/__tests__/entry-routes.test.ts +0 -749
- package/templates/apps/web/app/api/auth/hub/authorize/__tests__/route.test.ts +0 -964
- package/templates/apps/web/app/api/auth/hub/authorize/route.ts +0 -390
- package/templates/apps/web/app/api/auth/hub/continuation.ts +0 -127
- package/templates/apps/web/app/api/auth/hub/continue/[ref]/__tests__/route.test.ts +0 -188
- package/templates/apps/web/app/api/auth/hub/continue/[ref]/route.ts +0 -53
- package/templates/apps/web/app/api/auth/hub/email/route.ts +0 -111
- package/templates/apps/web/app/api/auth/hub/entry-shared.ts +0 -163
- package/templates/apps/web/app/api/auth/hub/password/__tests__/return.test.ts +0 -86
- package/templates/apps/web/app/api/auth/hub/password/__tests__/route.test.ts +0 -368
- package/templates/apps/web/app/api/auth/hub/password/return.ts +0 -86
- package/templates/apps/web/app/api/auth/hub/password/route.ts +0 -171
- package/templates/apps/web/app/api/auth/hub/purchase/route.ts +0 -230
- package/templates/apps/web/app/api/auth/hub/purchase-link/route.ts +0 -174
- package/templates/apps/web/app/api/auth/hub/sign-up/route.ts +0 -60
- package/templates/apps/web/app/api/auth/hub/sign-up-evidence.ts +0 -97
- package/templates/apps/web/app/api/auth/mcp/__tests__/continuation.test.ts +0 -92
- package/templates/apps/web/app/api/auth/mcp/continuation.ts +0 -89
- package/templates/apps/web/app/api/auth/mcp/continue/[ref]/__tests__/route.test.ts +0 -59
- package/templates/apps/web/app/api/auth/mcp/continue/[ref]/route.ts +0 -41
- package/templates/apps/web/app/api/hub-session/__tests__/routes.test.ts +0 -1166
- package/templates/apps/web/app/api/hub-session/callback/route.ts +0 -134
- package/templates/apps/web/app/api/hub-session/email/route.ts +0 -125
- package/templates/apps/web/app/api/hub-session/one-tap/nonce/route.ts +0 -49
- package/templates/apps/web/app/api/hub-session/one-tap/route.ts +0 -106
- package/templates/apps/web/app/api/hub-session/open/route.ts +0 -111
- package/templates/apps/web/app/api/hub-session/password/return/route.ts +0 -69
- package/templates/apps/web/app/api/hub-session/password/route.ts +0 -106
- package/templates/apps/web/app/api/hub-session/sign-in/route.ts +0 -91
- package/templates/apps/web/app/api/hub-session/sign-out/route.ts +0 -54
- package/templates/apps/web/components/sign-out-trigger.tsx +0 -62
- package/templates/apps/web/lib/__tests__/auth-routes.test.ts +0 -140
- package/templates/apps/web/lib/__tests__/hub-children.fixtures.ts +0 -279
- package/templates/apps/web/lib/__tests__/route-family.test.ts +0 -57
- package/templates/apps/web/lib/__tests__/service-listing.test.ts +0 -111
- package/templates/apps/web/lib/__tests__/template-listing.test.ts +0 -158
- package/templates/apps/web/lib/auth-routes.ts +0 -125
- package/templates/apps/web/lib/hub-children.tsx +0 -351
- package/templates/apps/web/lib/hub-session/__tests__/hub-session.test.ts +0 -433
- package/templates/apps/web/lib/hub-session/__tests__/spoke-sign-in.test.tsx +0 -332
- package/templates/apps/web/lib/hub-session/config.ts +0 -110
- package/templates/apps/web/lib/hub-session/entry.ts +0 -238
- package/templates/apps/web/lib/hub-session/index.ts +0 -21
- package/templates/apps/web/lib/hub-session/one-tap.tsx +0 -148
- package/templates/apps/web/lib/hub-session/reseal.ts +0 -90
- package/templates/apps/web/lib/hub-session/seal.ts +0 -86
- package/templates/apps/web/lib/hub-session/session.ts +0 -298
- package/templates/apps/web/lib/hub-session/spoke-sign-in.tsx +0 -277
- package/templates/apps/web/lib/meet-placeholder.ts +0 -5
- package/templates/apps/web/lib/next-path.ts +0 -35
- package/templates/apps/web/lib/posting-title.ts +0 -39
- package/templates/apps/web/lib/route-family.ts +0 -69
- package/templates/apps/web/lib/service-listing.ts +0 -89
- package/templates/apps/web/lib/template-listing.ts +0 -169
- package/templates/apps/web/src/lib/__tests__/lead-write.test.ts +0 -187
- package/templates/apps/web/src/lib/lead-write.ts +0 -90
- /package/templates/apps/web/{app/[locale]/contact → lib}/__tests__/site-contact-lines.test.ts +0 -0
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HTML snapshot regression tests for the events routes →
|
|
3
|
-
* @working-theory/page-renderer renderPage({ bodyMode: "mdx-body" }) migration.
|
|
4
|
-
*
|
|
5
|
-
* Two-commit strategy:
|
|
6
|
-
* Commit 1: snapshots captured against pre-migration routes (baseline).
|
|
7
|
-
* Commit 2: routes migrated; same snapshots verify diff=0.
|
|
8
|
-
*
|
|
9
|
-
* Routes covered:
|
|
10
|
-
* - events/page.tsx (empty + populated — 2 snapshots)
|
|
11
|
-
* - events/[slug]/page.tsx (populated + notFound — 2 snapshots)
|
|
12
|
-
*
|
|
13
|
-
* Failure = snapshot diff > 0 bytes. DO NOT regenerate snapshots to pass.
|
|
14
|
-
*/
|
|
15
|
-
import React from "react";
|
|
16
|
-
import { render } from "@testing-library/react";
|
|
17
|
-
|
|
18
|
-
// ── next-mdx-remote/rsc mock ──────────────────────────────────────────────────
|
|
19
|
-
jest.mock("next-mdx-remote/rsc", () => ({
|
|
20
|
-
MDXRemote: ({ source }: { source: string }): React.ReactElement =>
|
|
21
|
-
React.createElement("div", { "data-testid": "mdx-rendered" }, source),
|
|
22
|
-
}));
|
|
23
|
-
|
|
24
|
-
// ── next/navigation mock ──────────────────────────────────────────────────────
|
|
25
|
-
jest.mock("next/navigation", () => ({
|
|
26
|
-
__esModule: true,
|
|
27
|
-
notFound: jest.fn(() => {
|
|
28
|
-
throw new Error("NEXT_NOT_FOUND");
|
|
29
|
-
}),
|
|
30
|
-
}));
|
|
31
|
-
|
|
32
|
-
// ── @working-theory/ui mock ─────────────────────────────────────────────────────────────
|
|
33
|
-
jest.mock("@working-theory/ui", () => ({
|
|
34
|
-
// #7745: renderPage's mdx-body branch frames its head and body in the
|
|
35
|
-
// section Container and renders the body through MDXContent + the shared map.
|
|
36
|
-
Container: ({
|
|
37
|
-
children,
|
|
38
|
-
}: {
|
|
39
|
-
children?: React.ReactNode;
|
|
40
|
-
}): React.ReactElement => React.createElement("div", null, children),
|
|
41
|
-
MDXContent: ({
|
|
42
|
-
children,
|
|
43
|
-
}: {
|
|
44
|
-
children?: React.ReactNode;
|
|
45
|
-
}): React.ReactElement => React.createElement(React.Fragment, null, children),
|
|
46
|
-
getMDXComponents: (overrides?: Record<string, unknown>) => ({ ...overrides }),
|
|
47
|
-
// #4446/#4447: renderPage's own fallback/empty-state title now composes
|
|
48
|
-
// Heading (mobile type-budget classes, #4417) instead of a bare <h1>.
|
|
49
|
-
Heading: ({
|
|
50
|
-
children,
|
|
51
|
-
level,
|
|
52
|
-
}: {
|
|
53
|
-
children: React.ReactNode;
|
|
54
|
-
level: number;
|
|
55
|
-
}): React.ReactElement => React.createElement(`h${level}`, null, children),
|
|
56
|
-
SectionRenderer: ({ sections }: { sections: unknown[] }) =>
|
|
57
|
-
React.createElement("div", {
|
|
58
|
-
"data-testid": "section-renderer",
|
|
59
|
-
"data-section-count": String(sections.length),
|
|
60
|
-
}),
|
|
61
|
-
}));
|
|
62
|
-
|
|
63
|
-
import EventsPage from "../page";
|
|
64
|
-
import EventSlugPage from "../[slug]/page";
|
|
65
|
-
import * as pageRenderer from "@working-theory/page-renderer";
|
|
66
|
-
import { notFound } from "next/navigation";
|
|
67
|
-
|
|
68
|
-
const mockNotFound = notFound as jest.MockedFunction<typeof notFound>;
|
|
69
|
-
|
|
70
|
-
const getMdxSourceEmpty = jest.fn().mockResolvedValue(null);
|
|
71
|
-
|
|
72
|
-
// ── EventsPage ─────────────────────────────────────────────────────────────────
|
|
73
|
-
|
|
74
|
-
describe("EventsPage — snapshot regression", () => {
|
|
75
|
-
it("empty state renders deterministic HTML", async () => {
|
|
76
|
-
const element = await EventsPage({
|
|
77
|
-
params: Promise.resolve({ locale: "en" }),
|
|
78
|
-
// No child pages: this snapshot pins the hub's own render (#10121).
|
|
79
|
-
getMdxSlugs: async () => [],
|
|
80
|
-
getMdxSource: getMdxSourceEmpty,
|
|
81
|
-
});
|
|
82
|
-
const { container } = render(element);
|
|
83
|
-
expect(container.innerHTML).toMatchInlineSnapshot(
|
|
84
|
-
`"<main id="main"><h1>Events</h1><p data-testid="section-empty-state">Events listing coming soon.</p></main>"`,
|
|
85
|
-
);
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
it("populated state renders deterministic HTML", async () => {
|
|
89
|
-
const getMdxSourcePopulated = jest.fn().mockResolvedValue({
|
|
90
|
-
frontmatter: {
|
|
91
|
-
type: "EventsList",
|
|
92
|
-
slug: "events",
|
|
93
|
-
title: "Events",
|
|
94
|
-
description: "Upcoming and past events.",
|
|
95
|
-
},
|
|
96
|
-
body: "# Events\n\nBody.",
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
const element = await EventsPage({
|
|
100
|
-
params: Promise.resolve({ locale: "en" }),
|
|
101
|
-
// No child pages: this snapshot pins the hub's own render (#10121).
|
|
102
|
-
getMdxSlugs: async () => [],
|
|
103
|
-
getMdxSource: getMdxSourcePopulated,
|
|
104
|
-
});
|
|
105
|
-
const { container } = render(element);
|
|
106
|
-
expect(container.innerHTML).toMatchInlineSnapshot(`
|
|
107
|
-
"<script type="application/ld+json" data-testid="json-ld">{"@context":"https://schema.org","@type":"CollectionPage","inLanguage":"en","name":"Events","description":"Upcoming and past events.","mainEntity":{"@type":"ItemList","itemListElement":[{"@type":"Event"}]}}</script><main id="main"><div><div data-testid="markdown-view-toggle" class="ailk-markdown-view-toggle"><div class="flex justify-end mb-3"><div role="radiogroup" aria-label="Page view" data-testid="markdown-view-toggle" class="inline-flex items-center gap-0.5 rounded-lg p-1 bg-(--color-surface-secondary)"><button class="inline-flex items-center justify-center gap-2 font-medium motion-safe:transition motion-safe:duration-(--button-hover-duration) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--color-accent) focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50 [&>svg]:shrink-0 text-(--color-fg) not-disabled:hover:bg-(--button-hover-quiet-bg) not-disabled:hover:text-(--button-hover-quiet-fg) not-disabled:hover:opacity-(--button-hover-opacity) not-disabled:hover:transform-(--button-hover-transform) not-disabled:hover:shadow-(--button-hover-shadow) not-disabled:active:bg-gray-200 not-disabled:active:text-(--color-fg) rounded-control px-control-x h-(--control-height-thin) text-caption leading-none rounded-md px-3 text-body-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--color-accent) focus-visible:ring-offset-1 min-w-(--control-height-thin) min-h-(--control-height-big) bg-(--color-bg) text-(--color-fg) shadow-sm" type="button" role="radio" aria-checked="true" aria-label="Rendered" tabindex="0" data-testid="markdown-view-toggle-rendered">Rendered</button><button class="inline-flex items-center justify-center gap-2 font-medium motion-safe:transition motion-safe:duration-(--button-hover-duration) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--color-accent) focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50 [&>svg]:shrink-0 text-(--color-fg) not-disabled:hover:bg-(--button-hover-quiet-bg) not-disabled:hover:text-(--button-hover-quiet-fg) not-disabled:hover:opacity-(--button-hover-opacity) not-disabled:hover:transform-(--button-hover-transform) not-disabled:hover:shadow-(--button-hover-shadow) not-disabled:active:bg-gray-200 not-disabled:active:text-(--color-fg) rounded-control px-control-x h-(--control-height-thin) text-caption leading-none rounded-md px-3 text-body-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--color-accent) focus-visible:ring-offset-1 min-w-(--control-height-thin) min-h-(--control-height-big) text-(--color-text-muted) hover:text-(--color-fg)" type="button" role="radio" aria-checked="false" aria-label="Markdown" tabindex="-1" data-testid="markdown-view-toggle-markdown">Markdown</button></div></div><div role="status" aria-live="polite" aria-atomic="true" class="sr-only" data-testid="markdown-view-toggle-status">Showing Rendered view</div><div data-testid="markdown-view-rendered"><article data-testid="mdx-body"><div data-testid="mdx-rendered"># Events
|
|
108
|
-
|
|
109
|
-
Body.</div></article></div></div></div></main>"
|
|
110
|
-
`);
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
// ── EventSlugPage ──────────────────────────────────────────────────────────────
|
|
115
|
-
|
|
116
|
-
describe("EventSlugPage — snapshot regression", () => {
|
|
117
|
-
beforeEach(() => {
|
|
118
|
-
mockNotFound.mockClear();
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
it("populated state renders deterministic HTML", async () => {
|
|
122
|
-
const getMdxSourcePopulated = jest.fn().mockResolvedValue({
|
|
123
|
-
frontmatter: {
|
|
124
|
-
type: "Event",
|
|
125
|
-
slug: "annual-summit",
|
|
126
|
-
title: "Annual Summit",
|
|
127
|
-
description: "Our annual developer summit.",
|
|
128
|
-
},
|
|
129
|
-
body: "# Annual Summit\n\nBody.",
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
const element = await EventSlugPage({
|
|
133
|
-
params: Promise.resolve({ locale: "en", slug: "annual-summit" }),
|
|
134
|
-
getMdxSource: getMdxSourcePopulated,
|
|
135
|
-
});
|
|
136
|
-
const { container } = render(element);
|
|
137
|
-
// After migration: renderPage defaults populatedDescriptionTestId to
|
|
138
|
-
// "${slug}-description" where slug is the runtime params.slug value.
|
|
139
|
-
// This replaces the pre-migration hardcoded "event-description" testid
|
|
140
|
-
// with the slug-derived "annual-summit-description". Intentional per spec.
|
|
141
|
-
expect(container.innerHTML).toMatchInlineSnapshot(`
|
|
142
|
-
"<script type="application/ld+json" data-testid="json-ld">{"@context":"https://schema.org","@graph":[{"@context":"https://schema.org","@type":"WebPage","inLanguage":"en","name":"Annual Summit","description":"Our annual developer summit.","mainEntity":{"@context":"https://schema.org","@type":"Event","name":"Annual Summit","description":"Our annual developer summit."}},{"@context":"https://schema.org","@type":"BreadcrumbList","inLanguage":"en","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http://localhost:3000/en/"},{"@type":"ListItem","position":2,"name":"Events","item":"http://localhost:3000/en/events"},{"@type":"ListItem","position":3,"name":"Annual Summit","item":"http://localhost:3000/en/events/annual-summit"}]}]}</script><main id="main"><div><div data-testid="markdown-view-toggle" class="ailk-markdown-view-toggle"><div class="flex justify-end mb-3"><div role="radiogroup" aria-label="Page view" data-testid="markdown-view-toggle" class="inline-flex items-center gap-0.5 rounded-lg p-1 bg-(--color-surface-secondary)"><button class="inline-flex items-center justify-center gap-2 font-medium motion-safe:transition motion-safe:duration-(--button-hover-duration) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--color-accent) focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50 [&>svg]:shrink-0 text-(--color-fg) not-disabled:hover:bg-(--button-hover-quiet-bg) not-disabled:hover:text-(--button-hover-quiet-fg) not-disabled:hover:opacity-(--button-hover-opacity) not-disabled:hover:transform-(--button-hover-transform) not-disabled:hover:shadow-(--button-hover-shadow) not-disabled:active:bg-gray-200 not-disabled:active:text-(--color-fg) rounded-control px-control-x h-(--control-height-thin) text-caption leading-none rounded-md px-3 text-body-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--color-accent) focus-visible:ring-offset-1 min-w-(--control-height-thin) min-h-(--control-height-big) bg-(--color-bg) text-(--color-fg) shadow-sm" type="button" role="radio" aria-checked="true" aria-label="Rendered" tabindex="0" data-testid="markdown-view-toggle-rendered">Rendered</button><button class="inline-flex items-center justify-center gap-2 font-medium motion-safe:transition motion-safe:duration-(--button-hover-duration) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--color-accent) focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50 [&>svg]:shrink-0 text-(--color-fg) not-disabled:hover:bg-(--button-hover-quiet-bg) not-disabled:hover:text-(--button-hover-quiet-fg) not-disabled:hover:opacity-(--button-hover-opacity) not-disabled:hover:transform-(--button-hover-transform) not-disabled:hover:shadow-(--button-hover-shadow) not-disabled:active:bg-gray-200 not-disabled:active:text-(--color-fg) rounded-control px-control-x h-(--control-height-thin) text-caption leading-none rounded-md px-3 text-body-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--color-accent) focus-visible:ring-offset-1 min-w-(--control-height-thin) min-h-(--control-height-big) text-(--color-text-muted) hover:text-(--color-fg)" type="button" role="radio" aria-checked="false" aria-label="Markdown" tabindex="-1" data-testid="markdown-view-toggle-markdown">Markdown</button></div></div><div role="status" aria-live="polite" aria-atomic="true" class="sr-only" data-testid="markdown-view-toggle-status">Showing Rendered view</div><div data-testid="markdown-view-rendered"><article data-testid="mdx-body"><div data-testid="mdx-rendered"># Annual Summit
|
|
143
|
-
|
|
144
|
-
Body.</div></article></div></div></div></main>"
|
|
145
|
-
`);
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
it("null source calls notFound()", async () => {
|
|
149
|
-
const renderPageSpy = jest.spyOn(pageRenderer, "renderPage");
|
|
150
|
-
await expect(
|
|
151
|
-
EventSlugPage({
|
|
152
|
-
params: Promise.resolve({ locale: "en", slug: "unknown-event" }),
|
|
153
|
-
getMdxSource: getMdxSourceEmpty,
|
|
154
|
-
}),
|
|
155
|
-
).rejects.toThrow("NEXT_NOT_FOUND");
|
|
156
|
-
// The 404 is renderPage's detail branch, not a route pre-check (#7537).
|
|
157
|
-
expect(renderPageSpy).toHaveBeenCalledTimes(1);
|
|
158
|
-
expect(
|
|
159
|
-
renderPageSpy.mock.calls[0]![0].translationsNamespace,
|
|
160
|
-
).toBeUndefined();
|
|
161
|
-
renderPageSpy.mockRestore();
|
|
162
|
-
expect(mockNotFound).toHaveBeenCalled();
|
|
163
|
-
});
|
|
164
|
-
});
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* #10552 AC-6 — an Event under a program has one URL, `/<program>/<event>`:
|
|
3
|
-
* `/events/<event>` answers a 308 there, and the /events hub's card links it
|
|
4
|
-
* directly. An Event with no `parent` keeps `/events/<event>` on both.
|
|
5
|
-
*
|
|
6
|
-
* Its own suite: `hub-children.test.tsx` mocks `@working-theory/page-renderer`
|
|
7
|
-
* whole, so the hub's real cards are not rendered there.
|
|
8
|
-
*/
|
|
9
|
-
import React from "react";
|
|
10
|
-
import { render } from "@testing-library/react";
|
|
11
|
-
|
|
12
|
-
jest.mock("next/navigation", () => ({
|
|
13
|
-
__esModule: true,
|
|
14
|
-
notFound: jest.fn(() => {
|
|
15
|
-
throw new Error("NEXT_NOT_FOUND");
|
|
16
|
-
}),
|
|
17
|
-
permanentRedirect: jest.fn((url: string) => {
|
|
18
|
-
throw new Error(`NEXT_REDIRECT ${url}`);
|
|
19
|
-
}),
|
|
20
|
-
}));
|
|
21
|
-
|
|
22
|
-
import { permanentRedirect } from "next/navigation";
|
|
23
|
-
|
|
24
|
-
import EventsPage from "../page";
|
|
25
|
-
import EventSlugPage from "../[slug]/page";
|
|
26
|
-
|
|
27
|
-
const mockRedirect = permanentRedirect as jest.MockedFunction<typeof permanentRedirect>;
|
|
28
|
-
|
|
29
|
-
const event = (slug: string, parent?: string) => ({
|
|
30
|
-
frontmatter: {
|
|
31
|
-
type: "Event" as const,
|
|
32
|
-
slug,
|
|
33
|
-
title: `Title for ${slug}`,
|
|
34
|
-
description: `Description for ${slug}.`,
|
|
35
|
-
...(parent !== undefined && { parent }),
|
|
36
|
-
},
|
|
37
|
-
body: `# Title for ${slug}\n\nBody.`,
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
const eventsList = {
|
|
41
|
-
frontmatter: { type: "EventsList" as const, slug: "events", title: "Events", description: "Events." },
|
|
42
|
-
body: "# Events\n\nBody.",
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const events: Record<string, ReturnType<typeof event>> = {
|
|
46
|
-
"golf-tournament": event("golf-tournament", "younglife"),
|
|
47
|
-
"annual-summit": event("annual-summit"),
|
|
48
|
-
"typo-gala": event("typo-gala", "no-such-program"),
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const younglife = {
|
|
52
|
-
frontmatter: { type: "LandingPage" as const, slug: "younglife", title: "Young Life", description: "YL." },
|
|
53
|
-
body: "",
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const getMdxSource = jest.fn(async (type: string, slug: string) =>
|
|
57
|
-
type === "Event"
|
|
58
|
-
? (events[slug] ?? null)
|
|
59
|
-
: type === "EventsList"
|
|
60
|
-
? eventsList
|
|
61
|
-
: type === "LandingPage" && slug === "younglife"
|
|
62
|
-
? younglife
|
|
63
|
-
: null,
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
describe("/events/<event> for an Event under a program (#10552 D3)", () => {
|
|
67
|
-
const savedDefault = process.env.NEXT_PUBLIC_DEFAULT_LOCALE;
|
|
68
|
-
beforeEach(() => {
|
|
69
|
-
mockRedirect.mockClear();
|
|
70
|
-
delete process.env.NEXT_PUBLIC_DEFAULT_LOCALE;
|
|
71
|
-
});
|
|
72
|
-
afterAll(() => {
|
|
73
|
-
if (savedDefault === undefined) delete process.env.NEXT_PUBLIC_DEFAULT_LOCALE;
|
|
74
|
-
else process.env.NEXT_PUBLIC_DEFAULT_LOCALE = savedDefault;
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
it.each([
|
|
78
|
-
["en", "/younglife/golf-tournament"],
|
|
79
|
-
["es", "/es/younglife/golf-tournament"],
|
|
80
|
-
])("answers a 308 to the program URL at %s", async (locale, target) => {
|
|
81
|
-
await expect(
|
|
82
|
-
EventSlugPage({ params: Promise.resolve({ locale, slug: "golf-tournament" }), getMdxSource }),
|
|
83
|
-
).rejects.toThrow(`NEXT_REDIRECT ${target}`);
|
|
84
|
-
expect(mockRedirect).toHaveBeenCalledWith(target);
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
it("does not redirect when the parent names no program page", async () => {
|
|
88
|
-
render(
|
|
89
|
-
await EventSlugPage({ params: Promise.resolve({ locale: "en", slug: "typo-gala" }), getMdxSource }),
|
|
90
|
-
);
|
|
91
|
-
expect(mockRedirect).not.toHaveBeenCalled();
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it("renders an Event with no parent, with no redirect", async () => {
|
|
95
|
-
const { container } = render(
|
|
96
|
-
await EventSlugPage({
|
|
97
|
-
params: Promise.resolve({ locale: "en", slug: "annual-summit" }),
|
|
98
|
-
getMdxSource,
|
|
99
|
-
}),
|
|
100
|
-
);
|
|
101
|
-
expect(mockRedirect).not.toHaveBeenCalled();
|
|
102
|
-
expect(container.querySelector("script[type='application/ld+json']")).not.toBeNull();
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
describe("the /events hub's card for an Event under a program (#10552 D5)", () => {
|
|
107
|
-
it("links the program URL, and /events/<slug> for an Event with no parent", async () => {
|
|
108
|
-
const { container } = render(
|
|
109
|
-
await EventsPage({
|
|
110
|
-
params: Promise.resolve({ locale: "en" }),
|
|
111
|
-
getMdxSlugs: async () => ["golf-tournament", "annual-summit"],
|
|
112
|
-
getMdxSource,
|
|
113
|
-
}),
|
|
114
|
-
);
|
|
115
|
-
const hrefs = Array.from(container.querySelectorAll("a")).map((a) => a.getAttribute("href"));
|
|
116
|
-
expect(hrefs).toContain("/younglife/golf-tournament");
|
|
117
|
-
expect(hrefs).not.toContain("/events/golf-tournament");
|
|
118
|
-
expect(hrefs).toContain("/events/annual-summit");
|
|
119
|
-
});
|
|
120
|
-
});
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
// Events list page. Reads EventsList MDX via the content adapter and emits
|
|
2
|
-
// a JSON-LD CollectionPage via the dispatcher.
|
|
3
|
-
// It lists every Event page through one generated card section (#10121,
|
|
4
|
-
// apps/web/lib/hub-children.tsx — the /alternatives and /templates shape).
|
|
5
|
-
import type {
|
|
6
|
-
getMdxSlugs as defaultGetMdxSlugs,
|
|
7
|
-
getMdxSource as defaultGetMdxSource,
|
|
8
|
-
getPageSections as defaultGetPageSections,
|
|
9
|
-
} from "@working-theory/page-renderer";
|
|
10
|
-
import { renderPage, renderPageMetadata } from "@working-theory/page-renderer";
|
|
11
|
-
import type { Metadata } from "next";
|
|
12
|
-
import type { ReactElement } from "react";
|
|
13
|
-
|
|
14
|
-
import { type HubConfig, hubPageInput } from "../../../lib/hub-children";
|
|
15
|
-
import { pagePathFor } from "../../../src/lib/routes";
|
|
16
|
-
|
|
17
|
-
interface Props {
|
|
18
|
-
params: Promise<{ locale: string }>;
|
|
19
|
-
getMdxSource?: typeof defaultGetMdxSource;
|
|
20
|
-
getPageSections?: typeof defaultGetPageSections;
|
|
21
|
-
getMdxSlugs?: typeof defaultGetMdxSlugs;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const HUB: HubConfig = {
|
|
25
|
-
listType: "EventsList",
|
|
26
|
-
slug: "events",
|
|
27
|
-
childType: "Event",
|
|
28
|
-
linkLabel: "View the event",
|
|
29
|
-
sectionId: "event-cards",
|
|
30
|
-
body: "mdx-body",
|
|
31
|
-
// #10552 D5 — an Event under a program links its program URL; the rest is
|
|
32
|
-
// the default card, byte for byte.
|
|
33
|
-
card: ({ slug, frontmatter }) => {
|
|
34
|
-
const fm = frontmatter as { title?: string; description?: string; parent?: string };
|
|
35
|
-
return {
|
|
36
|
-
title: fm.title ?? slug,
|
|
37
|
-
description: fm.description ?? "",
|
|
38
|
-
link: { label: HUB.linkLabel, href: pagePathFor({ type: "Event", slug, parent: fm.parent }) },
|
|
39
|
-
};
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export async function generateMetadata({
|
|
44
|
-
params,
|
|
45
|
-
}: Pick<Props, "params">): Promise<Metadata> {
|
|
46
|
-
const { locale } = await params;
|
|
47
|
-
return renderPageMetadata({ type: "EventsList", slug: "events", locale });
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export default async function Page({
|
|
51
|
-
params,
|
|
52
|
-
...loaders
|
|
53
|
-
}: Props): Promise<ReactElement> {
|
|
54
|
-
const { locale } = await params;
|
|
55
|
-
return renderPage({
|
|
56
|
-
type: "EventsList",
|
|
57
|
-
slug: "events",
|
|
58
|
-
...(await hubPageInput(HUB, locale, loaders)),
|
|
59
|
-
});
|
|
60
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// FAQ page. Reads the FAQPage MDX frontmatter, renders sections via
|
|
2
|
-
// SectionRenderer, and emits a JSON-LD <script> with mainEntity from
|
|
3
|
-
// the schema: override field (populated from MDX frontmatter).
|
|
4
|
-
import type {
|
|
5
|
-
getMdxSource as defaultGetMdxSource,
|
|
6
|
-
getPageSections as defaultGetPageSections} from "@working-theory/page-renderer";
|
|
7
|
-
import {
|
|
8
|
-
getMdxSource as loadMdxSource,
|
|
9
|
-
renderPage,
|
|
10
|
-
renderPageMetadata
|
|
11
|
-
} from "@working-theory/page-renderer";
|
|
12
|
-
import type { Metadata } from "next";
|
|
13
|
-
import type { ReactElement } from "react";
|
|
14
|
-
|
|
15
|
-
import { honourNavOnly } from "../../../lib/hub-children";
|
|
16
|
-
|
|
17
|
-
interface Props {
|
|
18
|
-
params: Promise<{ locale: string }>;
|
|
19
|
-
getMdxSource?: typeof defaultGetMdxSource;
|
|
20
|
-
getPageSections?: typeof defaultGetPageSections;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export async function generateMetadata({
|
|
24
|
-
params,
|
|
25
|
-
}: Pick<Props, "params">): Promise<Metadata> {
|
|
26
|
-
const { locale } = await params;
|
|
27
|
-
return renderPageMetadata({ type: "FAQPage", slug: "faq", locale });
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default async function Page({
|
|
31
|
-
params,
|
|
32
|
-
getMdxSource,
|
|
33
|
-
getPageSections,
|
|
34
|
-
}: Props): Promise<ReactElement> {
|
|
35
|
-
const { locale } = await params;
|
|
36
|
-
const source = await (getMdxSource ?? loadMdxSource)(
|
|
37
|
-
"FAQPage",
|
|
38
|
-
"faq",
|
|
39
|
-
locale,
|
|
40
|
-
);
|
|
41
|
-
honourNavOnly(source?.frontmatter, locale, []);
|
|
42
|
-
return renderPage({
|
|
43
|
-
type: "FAQPage",
|
|
44
|
-
slug: "faq",
|
|
45
|
-
locale,
|
|
46
|
-
translationsNamespace: "faq",
|
|
47
|
-
emptyStateScaffoldJsonLd: {
|
|
48
|
-
"@context": "https://schema.org",
|
|
49
|
-
"@type": "FAQPage",
|
|
50
|
-
},
|
|
51
|
-
...(getMdxSource !== undefined && { getMdxSource }),
|
|
52
|
-
...(getPageSections !== undefined && { getPageSections }),
|
|
53
|
-
});
|
|
54
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// Feature detail page (#6721) — one feature at /features/<slug>, listed by
|
|
2
|
-
// the /features page. Reads the Feature MDX for the given slug, renders via
|
|
3
|
-
// @working-theory/page-renderer, and emits a JSON-LD WebPage whose mainEntity
|
|
4
|
-
// is the product's SoftwareApplication, named for the feature. Unknown slugs
|
|
5
|
-
// 404. Composed `sections[]` render as sections; a prose page renders its
|
|
6
|
-
// MDX body.
|
|
7
|
-
import type { getMdxSource as defaultGetMdxSource } from "@working-theory/page-renderer";
|
|
8
|
-
import {
|
|
9
|
-
getMdxSource as loadMdxSource,
|
|
10
|
-
renderPage,
|
|
11
|
-
renderPageMetadata,
|
|
12
|
-
} from "@working-theory/page-renderer";
|
|
13
|
-
import type { Metadata } from "next";
|
|
14
|
-
import type { ReactElement } from "react";
|
|
15
|
-
|
|
16
|
-
interface Props {
|
|
17
|
-
params: Promise<{ locale: string; slug: string }>;
|
|
18
|
-
getMdxSource?: typeof defaultGetMdxSource;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export async function generateMetadata({
|
|
22
|
-
params,
|
|
23
|
-
}: Pick<Props, "params">): Promise<Metadata> {
|
|
24
|
-
const { locale, slug } = await params;
|
|
25
|
-
return renderPageMetadata({ type: "Feature", slug, locale });
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export default async function Page({
|
|
29
|
-
params,
|
|
30
|
-
getMdxSource,
|
|
31
|
-
}: Props): Promise<ReactElement> {
|
|
32
|
-
const { locale, slug } = await params;
|
|
33
|
-
// A page that composes `sections[]` (the starter seeds, #6721) renders
|
|
34
|
-
// them; a prose page renders its MDX body — the same rule the /features hub
|
|
35
|
-
// applies. JSON-LD is built from the frontmatter either way.
|
|
36
|
-
const source = await (getMdxSource ?? loadMdxSource)("Feature", slug, locale);
|
|
37
|
-
const composed =
|
|
38
|
-
source !== null &&
|
|
39
|
-
Array.isArray((source.frontmatter as { sections?: unknown[] }).sections) &&
|
|
40
|
-
((source.frontmatter as { sections?: unknown[] }).sections?.length ?? 0) >
|
|
41
|
-
0;
|
|
42
|
-
return renderPage({
|
|
43
|
-
type: "Feature",
|
|
44
|
-
slug,
|
|
45
|
-
locale,
|
|
46
|
-
...(composed
|
|
47
|
-
? {}
|
|
48
|
-
: {
|
|
49
|
-
bodyMode: "mdx-body" as const,
|
|
50
|
-
populatedDescriptionTestId: "feature-description",
|
|
51
|
-
}),
|
|
52
|
-
...(getMdxSource !== undefined && { getMdxSource }),
|
|
53
|
-
});
|
|
54
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hub child cards (#10121) for /features. The shared cases live in
|
|
3
|
-
* `lib/__tests__/hub-children.fixtures.ts`; this file sits beside the route so
|
|
4
|
-
* a scaffold without /features drops it with the route (#10157).
|
|
5
|
-
*/
|
|
6
|
-
const mockRenderPage = jest.fn(async (..._args: unknown[]) => "<rendered/>");
|
|
7
|
-
|
|
8
|
-
jest.mock("@working-theory/page-renderer", () => ({
|
|
9
|
-
__esModule: true,
|
|
10
|
-
renderPage: (...args: unknown[]) => mockRenderPage(...args),
|
|
11
|
-
renderPageMetadata: jest.fn(),
|
|
12
|
-
// Never reached — every call in this suite passes its loaders via DI.
|
|
13
|
-
getMdxSlugs: jest.fn(),
|
|
14
|
-
getMdxSource: jest.fn(),
|
|
15
|
-
getPageSections: jest.fn(),
|
|
16
|
-
}));
|
|
17
|
-
|
|
18
|
-
jest.mock("@working-theory/ui/sections", () => ({
|
|
19
|
-
__esModule: true,
|
|
20
|
-
SectionRenderer: () => null,
|
|
21
|
-
}));
|
|
22
|
-
|
|
23
|
-
import FeaturesPage from "../page";
|
|
24
|
-
import {
|
|
25
|
-
describeHub,
|
|
26
|
-
type HubPage,
|
|
27
|
-
} from "../../../../lib/__tests__/hub-children.fixtures";
|
|
28
|
-
|
|
29
|
-
describeHub(
|
|
30
|
-
["features", FeaturesPage as HubPage, "FeaturesList", "Feature", "composed"],
|
|
31
|
-
mockRenderPage,
|
|
32
|
-
);
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// Features list page. Reads FeaturesList MDX via the content adapter and emits
|
|
2
|
-
// a JSON-LD CollectionPage via the dispatcher. The /for composed pattern:
|
|
3
|
-
// sections when the frontmatter carries `sections[]`, MDX prose otherwise.
|
|
4
|
-
// It lists every Feature page through one generated card section (#10121,
|
|
5
|
-
// apps/web/lib/hub-children.tsx — the /alternatives and /templates shape).
|
|
6
|
-
import type {
|
|
7
|
-
getMdxSlugs as defaultGetMdxSlugs,
|
|
8
|
-
getMdxSource as defaultGetMdxSource,
|
|
9
|
-
getPageSections as defaultGetPageSections,
|
|
10
|
-
} from "@working-theory/page-renderer";
|
|
11
|
-
import { renderPage, renderPageMetadata } from "@working-theory/page-renderer";
|
|
12
|
-
import type { Metadata } from "next";
|
|
13
|
-
import type { ReactElement } from "react";
|
|
14
|
-
|
|
15
|
-
import { type HubConfig, hubPageInput } from "../../../lib/hub-children";
|
|
16
|
-
|
|
17
|
-
interface Props {
|
|
18
|
-
params: Promise<{ locale: string }>;
|
|
19
|
-
getMdxSource?: typeof defaultGetMdxSource;
|
|
20
|
-
getPageSections?: typeof defaultGetPageSections;
|
|
21
|
-
getMdxSlugs?: typeof defaultGetMdxSlugs;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const HUB: HubConfig = {
|
|
25
|
-
listType: "FeaturesList",
|
|
26
|
-
slug: "features",
|
|
27
|
-
childType: "Feature",
|
|
28
|
-
linkLabel: "Learn more",
|
|
29
|
-
sectionId: "feature-cards",
|
|
30
|
-
body: "composed",
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export async function generateMetadata({
|
|
34
|
-
params,
|
|
35
|
-
}: Pick<Props, "params">): Promise<Metadata> {
|
|
36
|
-
const { locale } = await params;
|
|
37
|
-
return renderPageMetadata({ type: "FeaturesList", slug: "features", locale });
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export default async function Page({
|
|
41
|
-
params,
|
|
42
|
-
...loaders
|
|
43
|
-
}: Props): Promise<ReactElement> {
|
|
44
|
-
const { locale } = await params;
|
|
45
|
-
return renderPage({
|
|
46
|
-
type: "FeaturesList",
|
|
47
|
-
slug: "features",
|
|
48
|
-
...(await hubPageInput(HUB, locale, loaders)),
|
|
49
|
-
});
|
|
50
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// UseCase detail page (#6658 D4; route renamed to /for by #6878 D2) — one
|
|
2
|
-
// customer page at /for/<slug>, listed by the /for hub. Reads the UseCase MDX
|
|
3
|
-
// for the given slug, renders via
|
|
4
|
-
// @working-theory/page-renderer, and emits a JSON-LD WebPage whose mainEntity
|
|
5
|
-
// is an Article. Unknown slugs 404. Composed `sections[]` render as sections
|
|
6
|
-
// (#6721); a prose page renders its MDX body.
|
|
7
|
-
import type { getMdxSource as defaultGetMdxSource } from "@working-theory/page-renderer";
|
|
8
|
-
import {
|
|
9
|
-
getMdxSource as loadMdxSource,
|
|
10
|
-
renderPage,
|
|
11
|
-
renderPageMetadata,
|
|
12
|
-
} from "@working-theory/page-renderer";
|
|
13
|
-
import type { Metadata } from "next";
|
|
14
|
-
import type { ReactElement } from "react";
|
|
15
|
-
|
|
16
|
-
interface Props {
|
|
17
|
-
params: Promise<{ locale: string; slug: string }>;
|
|
18
|
-
getMdxSource?: typeof defaultGetMdxSource;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export async function generateMetadata({
|
|
22
|
-
params,
|
|
23
|
-
}: Pick<Props, "params">): Promise<Metadata> {
|
|
24
|
-
const { locale, slug } = await params;
|
|
25
|
-
return renderPageMetadata({ type: "UseCase", slug, locale });
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export default async function Page({
|
|
29
|
-
params,
|
|
30
|
-
getMdxSource,
|
|
31
|
-
}: Props): Promise<ReactElement> {
|
|
32
|
-
const { locale, slug } = await params;
|
|
33
|
-
// A page that composes `sections[]` (the starter seeds, #6721) renders
|
|
34
|
-
// them; a prose page renders its MDX body — the same rule the /for hub
|
|
35
|
-
// applies. JSON-LD is built from the frontmatter either way.
|
|
36
|
-
const source = await (getMdxSource ?? loadMdxSource)("UseCase", slug, locale);
|
|
37
|
-
const composed =
|
|
38
|
-
source !== null &&
|
|
39
|
-
Array.isArray((source.frontmatter as { sections?: unknown[] }).sections) &&
|
|
40
|
-
((source.frontmatter as { sections?: unknown[] }).sections?.length ?? 0) >
|
|
41
|
-
0;
|
|
42
|
-
return renderPage({
|
|
43
|
-
type: "UseCase",
|
|
44
|
-
slug,
|
|
45
|
-
locale,
|
|
46
|
-
...(composed
|
|
47
|
-
? {}
|
|
48
|
-
: {
|
|
49
|
-
bodyMode: "mdx-body" as const,
|
|
50
|
-
populatedDescriptionTestId: "use-case-description",
|
|
51
|
-
}),
|
|
52
|
-
...(getMdxSource !== undefined && { getMdxSource }),
|
|
53
|
-
});
|
|
54
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hub child cards (#10121) for /for. The shared cases live in
|
|
3
|
-
* `lib/__tests__/hub-children.fixtures.ts`; this file sits beside the route so
|
|
4
|
-
* a scaffold without /for drops it with the route (#10157).
|
|
5
|
-
*/
|
|
6
|
-
const mockRenderPage = jest.fn(async (..._args: unknown[]) => "<rendered/>");
|
|
7
|
-
|
|
8
|
-
jest.mock("@working-theory/page-renderer", () => ({
|
|
9
|
-
__esModule: true,
|
|
10
|
-
renderPage: (...args: unknown[]) => mockRenderPage(...args),
|
|
11
|
-
renderPageMetadata: jest.fn(),
|
|
12
|
-
// Never reached — every call in this suite passes its loaders via DI.
|
|
13
|
-
getMdxSlugs: jest.fn(),
|
|
14
|
-
getMdxSource: jest.fn(),
|
|
15
|
-
getPageSections: jest.fn(),
|
|
16
|
-
}));
|
|
17
|
-
|
|
18
|
-
jest.mock("@working-theory/ui/sections", () => ({
|
|
19
|
-
__esModule: true,
|
|
20
|
-
SectionRenderer: () => null,
|
|
21
|
-
}));
|
|
22
|
-
|
|
23
|
-
import ForPage from "../page";
|
|
24
|
-
import {
|
|
25
|
-
describeHub,
|
|
26
|
-
type HubPage,
|
|
27
|
-
} from "../../../../lib/__tests__/hub-children.fixtures";
|
|
28
|
-
|
|
29
|
-
describeHub(
|
|
30
|
-
["for", ForPage as HubPage, "UseCasesList", "UseCase", "composed"],
|
|
31
|
-
mockRenderPage,
|
|
32
|
-
);
|