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,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hub child cards (#10121) for /team. The shared cases live in
|
|
3
|
-
* `lib/__tests__/hub-children.fixtures.ts`; this file sits beside the route so
|
|
4
|
-
* a scaffold without /team 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 TeamPage from "../page";
|
|
24
|
-
import {
|
|
25
|
-
describeHub,
|
|
26
|
-
type HubPage,
|
|
27
|
-
} from "../../../../lib/__tests__/hub-children.fixtures";
|
|
28
|
-
|
|
29
|
-
describeHub(
|
|
30
|
-
["team", TeamPage as HubPage, "TeamList", "TeamMember", "composed"],
|
|
31
|
-
mockRenderPage,
|
|
32
|
-
);
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The team routes (#7744 D2, AC-1): `/team/<slug>` renders a profile whose
|
|
3
|
-
* JSON-LD is a `ProfilePage` with a `Person` main entity carrying the
|
|
4
|
-
* page-scoped `@id`, valid under the schema validator; an unknown slug 404s
|
|
5
|
-
* through `renderPage`; `/team` emits a valid `TeamList` block.
|
|
6
|
-
*
|
|
7
|
-
* MDX sources are inline stubs (no fs reads), so the suite runs unchanged
|
|
8
|
-
* inside a scaffold.
|
|
9
|
-
*/
|
|
10
|
-
import React from "react";
|
|
11
|
-
import { render } from "@testing-library/react";
|
|
12
|
-
import {
|
|
13
|
-
validateBlock,
|
|
14
|
-
validatePageGraph,
|
|
15
|
-
} from "@working-theory/schema-validator";
|
|
16
|
-
|
|
17
|
-
jest.mock("next/navigation", () => ({
|
|
18
|
-
__esModule: true,
|
|
19
|
-
notFound: jest.fn(() => {
|
|
20
|
-
throw new Error("NEXT_NOT_FOUND");
|
|
21
|
-
}),
|
|
22
|
-
}));
|
|
23
|
-
|
|
24
|
-
jest.mock("next-mdx-remote/rsc", () => ({
|
|
25
|
-
__esModule: true,
|
|
26
|
-
MDXRemote: ({ source }: { source: string }) =>
|
|
27
|
-
React.createElement("div", { "data-testid": "mdx-rendered" }, source),
|
|
28
|
-
}));
|
|
29
|
-
|
|
30
|
-
import TeamPage from "../page";
|
|
31
|
-
import TeamMemberPage from "../[slug]/page";
|
|
32
|
-
import * as pageRenderer from "@working-theory/page-renderer";
|
|
33
|
-
|
|
34
|
-
// #10704 — a fixture suite: its content is shaped for the mdx source, whatever the site serves from.
|
|
35
|
-
process.env.CONTENT_ADAPTER = "mdx";
|
|
36
|
-
|
|
37
|
-
type JsonLd = Record<string, unknown>;
|
|
38
|
-
|
|
39
|
-
function jsonLdScripts(container: HTMLElement): JsonLd[] {
|
|
40
|
-
return [
|
|
41
|
-
...container.querySelectorAll("script[type='application/ld+json']"),
|
|
42
|
-
].map((s) => JSON.parse(s.textContent ?? "") as JsonLd);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const FIRST_MEMBER = {
|
|
46
|
-
frontmatter: {
|
|
47
|
-
type: "TeamMember",
|
|
48
|
-
slug: "first-member",
|
|
49
|
-
title: "{First team member's name}",
|
|
50
|
-
description: "{One sentence on who they are and what they do here}",
|
|
51
|
-
schema: { jobTitle: "{Their title}" },
|
|
52
|
-
},
|
|
53
|
-
body: "{Two or three sentences on what they do here.}",
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
describe("team/[slug] — the profile page", () => {
|
|
57
|
-
it("emits one ProfilePage graph whose Person carries @id #person, valid under the schema validator", async () => {
|
|
58
|
-
const element = await TeamMemberPage({
|
|
59
|
-
params: Promise.resolve({ locale: "en", slug: "first-member" }),
|
|
60
|
-
getMdxSource: jest.fn().mockResolvedValue(FIRST_MEMBER),
|
|
61
|
-
});
|
|
62
|
-
const { container } = render(element);
|
|
63
|
-
const scripts = jsonLdScripts(container);
|
|
64
|
-
expect(scripts).toHaveLength(1);
|
|
65
|
-
const graph = scripts[0]!["@graph"] as JsonLd[];
|
|
66
|
-
expect(validatePageGraph(graph as never, "TeamMember")).toEqual(
|
|
67
|
-
expect.objectContaining({ valid: true }),
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
const profile = graph.find((b) => b["@type"] === "ProfilePage")!;
|
|
71
|
-
const person = profile["mainEntity"] as JsonLd;
|
|
72
|
-
expect(person["@type"]).toBe("Person");
|
|
73
|
-
expect(person["@id"]).toBe("#person");
|
|
74
|
-
// The seed's `jobTitle` is a `{placeholder}` slot, which never reaches the
|
|
75
|
-
// graph (#8797 D8.5).
|
|
76
|
-
expect(FIRST_MEMBER.frontmatter.schema.jobTitle).toBe("{Their title}");
|
|
77
|
-
expect(person).not.toHaveProperty("jobTitle");
|
|
78
|
-
|
|
79
|
-
const breadcrumb = graph.find((b) => b["@type"] === "BreadcrumbList")!;
|
|
80
|
-
const items = breadcrumb["itemListElement"] as Array<{ item: string }>;
|
|
81
|
-
expect(items[1]!.item).toMatch(/\/en\/team$/);
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
it("renders a sections-carrying profile (the _base seed's shape) through its content-block, with the same valid graph", async () => {
|
|
85
|
-
const element = await TeamMemberPage({
|
|
86
|
-
params: Promise.resolve({ locale: "en", slug: "first-member" }),
|
|
87
|
-
getMdxSource: jest.fn().mockResolvedValue({
|
|
88
|
-
...FIRST_MEMBER,
|
|
89
|
-
frontmatter: {
|
|
90
|
-
...FIRST_MEMBER.frontmatter,
|
|
91
|
-
sections: [
|
|
92
|
-
{
|
|
93
|
-
id: "profile",
|
|
94
|
-
type: "content-block",
|
|
95
|
-
data: {
|
|
96
|
-
headline: FIRST_MEMBER.frontmatter.title,
|
|
97
|
-
body: "{Two or three sentences on what they do here.}",
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
],
|
|
101
|
-
},
|
|
102
|
-
}),
|
|
103
|
-
});
|
|
104
|
-
const { container } = render(element);
|
|
105
|
-
expect(container.querySelector("[data-testid='mdx-body']")).toBeNull();
|
|
106
|
-
expect(container.textContent).toContain(
|
|
107
|
-
"{Two or three sentences on what they do here.}",
|
|
108
|
-
);
|
|
109
|
-
const graph = jsonLdScripts(container)[0]!["@graph"] as JsonLd[];
|
|
110
|
-
expect(validatePageGraph(graph as never, "TeamMember")).toEqual(
|
|
111
|
-
expect.objectContaining({ valid: true }),
|
|
112
|
-
);
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
it("404s an unknown slug through renderPage, with no translations namespace", async () => {
|
|
116
|
-
const renderPageSpy = jest.spyOn(pageRenderer, "renderPage");
|
|
117
|
-
await expect(
|
|
118
|
-
TeamMemberPage({
|
|
119
|
-
params: Promise.resolve({ locale: "en", slug: "unknown" }),
|
|
120
|
-
getMdxSource: jest.fn().mockResolvedValue(null),
|
|
121
|
-
}),
|
|
122
|
-
).rejects.toThrow("NEXT_NOT_FOUND");
|
|
123
|
-
expect(renderPageSpy).toHaveBeenCalledTimes(1);
|
|
124
|
-
expect(renderPageSpy.mock.calls[0]![0].translationsNamespace).toBeUndefined();
|
|
125
|
-
renderPageSpy.mockRestore();
|
|
126
|
-
});
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
describe("team — the index page", () => {
|
|
130
|
-
it("emits a block the schema validator accepts as TeamList", async () => {
|
|
131
|
-
const element = await TeamPage({
|
|
132
|
-
params: Promise.resolve({ locale: "en" }),
|
|
133
|
-
getMdxSource: jest.fn().mockResolvedValue({
|
|
134
|
-
frontmatter: {
|
|
135
|
-
type: "TeamList",
|
|
136
|
-
slug: "team",
|
|
137
|
-
title: "Team",
|
|
138
|
-
description: "The people behind the work.",
|
|
139
|
-
},
|
|
140
|
-
body: "The team.",
|
|
141
|
-
}),
|
|
142
|
-
});
|
|
143
|
-
const { container } = render(element);
|
|
144
|
-
const scripts = jsonLdScripts(container);
|
|
145
|
-
expect(scripts).toHaveLength(1);
|
|
146
|
-
expect(validateBlock(scripts[0] as never, "TeamList")).toEqual(
|
|
147
|
-
expect.objectContaining({ valid: true }),
|
|
148
|
-
);
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
it("renders the empty state from the team namespace when the page is missing", async () => {
|
|
152
|
-
const element = await TeamPage({
|
|
153
|
-
params: Promise.resolve({ locale: "en" }),
|
|
154
|
-
getMdxSource: jest.fn().mockResolvedValue(null),
|
|
155
|
-
});
|
|
156
|
-
const { getByTestId } = render(element);
|
|
157
|
-
expect(getByTestId("section-empty-state").textContent).toBe(
|
|
158
|
-
"Team listing coming soon.",
|
|
159
|
-
);
|
|
160
|
-
});
|
|
161
|
-
});
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// Team list page (#7744 D2). Reads TeamList 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 TeamMember 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: "TeamList",
|
|
26
|
-
slug: "team",
|
|
27
|
-
childType: "TeamMember",
|
|
28
|
-
linkLabel: "View profile",
|
|
29
|
-
sectionId: "team-member-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: "TeamList", slug: "team", 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: "TeamList",
|
|
47
|
-
slug: "team",
|
|
48
|
-
...(await hubPageInput(HUB, locale, loaders)),
|
|
49
|
-
});
|
|
50
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// TechArticle detail page. Reads the TechArticle MDX for the given slug, renders via
|
|
2
|
-
// @working-theory/page-renderer, and emits a JSON-LD <script>. Unknown slugs trigger 404.
|
|
3
|
-
import type { getMdxSource as defaultGetMdxSource } from "@working-theory/page-renderer";
|
|
4
|
-
import {
|
|
5
|
-
getMdxSource as loadMdxSource,
|
|
6
|
-
renderPage,
|
|
7
|
-
renderPageMetadata,
|
|
8
|
-
} from "@working-theory/page-renderer";
|
|
9
|
-
import type { Metadata } from "next";
|
|
10
|
-
import type { ReactElement } from "react";
|
|
11
|
-
|
|
12
|
-
interface Props {
|
|
13
|
-
params: Promise<{ locale: string; slug: string }>;
|
|
14
|
-
getMdxSource?: typeof defaultGetMdxSource;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export async function generateMetadata({
|
|
18
|
-
params,
|
|
19
|
-
}: Pick<Props, "params">): Promise<Metadata> {
|
|
20
|
-
const { locale, slug } = await params;
|
|
21
|
-
return renderPageMetadata({ type: "TechArticle", slug, locale });
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default async function Page({
|
|
25
|
-
params,
|
|
26
|
-
getMdxSource,
|
|
27
|
-
}: Props): Promise<ReactElement> {
|
|
28
|
-
const { locale, slug } = await params;
|
|
29
|
-
// A page that composes `sections[]` renders them (JSON-LD is built from
|
|
30
|
-
// the same sections); a prose page renders its MDX body — the rule
|
|
31
|
-
// /vs/[slug] applies (#10122).
|
|
32
|
-
const source = await (getMdxSource ?? loadMdxSource)(
|
|
33
|
-
"TechArticle",
|
|
34
|
-
slug,
|
|
35
|
-
locale,
|
|
36
|
-
);
|
|
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: "TechArticle",
|
|
44
|
-
slug,
|
|
45
|
-
locale,
|
|
46
|
-
...(composed
|
|
47
|
-
? {}
|
|
48
|
-
: {
|
|
49
|
-
bodyMode: "mdx-body" as const,
|
|
50
|
-
populatedDescriptionTestId: "tech-article-description",
|
|
51
|
-
}),
|
|
52
|
-
...(getMdxSource !== undefined && { getMdxSource }),
|
|
53
|
-
});
|
|
54
|
-
}
|
package/templates/apps/web/app/[locale]/tech-articles/__tests__/page-renderer-migration.test.tsx
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HTML snapshot regression tests for tech-articles/[slug] — @working-theory/page-renderer migration.
|
|
3
|
-
*
|
|
4
|
-
* Node version: captured against Node 22.x (same as CI).
|
|
5
|
-
* MDX seed content: DI-injected stub — no fs reads, deterministic.
|
|
6
|
-
*
|
|
7
|
-
* Two-commit strategy:
|
|
8
|
-
* Commit 1: this file added; snapshots captured against pre-migration routes.
|
|
9
|
-
* Commit 2: routes migrated; same snapshots verify diff=0.
|
|
10
|
-
*
|
|
11
|
-
* Routes covered:
|
|
12
|
-
* - tech-articles/[slug] (populated: populated state)
|
|
13
|
-
* - tech-articles/[slug] (notFound: unknown slug triggers notFound())
|
|
14
|
-
*
|
|
15
|
-
* Note: tech-articles/page.tsx is a slug-listing route (not MDX-body); only the
|
|
16
|
-
* import path changes. No snapshot tests needed for tech-articles/page.
|
|
17
|
-
*
|
|
18
|
-
* Failure = snapshot diff > 0 bytes. DO NOT regenerate snapshots to pass.
|
|
19
|
-
* A non-zero diff indicates a behavior regression in the migration. Escalate.
|
|
20
|
-
*/
|
|
21
|
-
import React from "react";
|
|
22
|
-
import { render } from "@testing-library/react";
|
|
23
|
-
|
|
24
|
-
jest.mock("next-mdx-remote/rsc", () => ({
|
|
25
|
-
__esModule: true,
|
|
26
|
-
MDXRemote: ({ source }: { source: string }): React.ReactElement =>
|
|
27
|
-
React.createElement("div", { "data-testid": "mdx-rendered" }, source),
|
|
28
|
-
}));
|
|
29
|
-
|
|
30
|
-
jest.mock("next/navigation", () => ({
|
|
31
|
-
__esModule: true,
|
|
32
|
-
notFound: jest.fn(() => {
|
|
33
|
-
throw new Error("NEXT_NOT_FOUND");
|
|
34
|
-
}),
|
|
35
|
-
}));
|
|
36
|
-
|
|
37
|
-
import TechArticleSlugPage from "../[slug]/page";
|
|
38
|
-
import { notFound } from "next/navigation";
|
|
39
|
-
|
|
40
|
-
const mockNotFound = notFound as jest.MockedFunction<typeof notFound>;
|
|
41
|
-
|
|
42
|
-
describe("tech-articles/[slug] — snapshot regression", () => {
|
|
43
|
-
beforeEach(() => {
|
|
44
|
-
mockNotFound.mockClear();
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it("populated state renders deterministic HTML", async () => {
|
|
48
|
-
const getMdxSource = jest.fn().mockResolvedValue({
|
|
49
|
-
frontmatter: {
|
|
50
|
-
type: "TechArticle" as const,
|
|
51
|
-
slug: "aeo-layer1-scoring",
|
|
52
|
-
title: "AEO Layer 1 Scoring",
|
|
53
|
-
description:
|
|
54
|
-
"Deep dive into AEO Layer 1 scoring and AILK audit internals.",
|
|
55
|
-
},
|
|
56
|
-
body: "## AEO Layer 1\n\nBody content.",
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
const element = await TechArticleSlugPage({
|
|
60
|
-
params: Promise.resolve({ locale: "en", slug: "aeo-layer1-scoring" }),
|
|
61
|
-
getMdxSource,
|
|
62
|
-
});
|
|
63
|
-
const { container } = render(element);
|
|
64
|
-
expect(container.innerHTML).toMatchInlineSnapshot(`
|
|
65
|
-
"<script type="application/ld+json" data-testid="json-ld">{"@context":"https://schema.org","@graph":[{"@context":"https://schema.org","@type":"WebPage","inLanguage":"en","name":"AEO Layer 1 Scoring","description":"Deep dive into AEO Layer 1 scoring and AILK audit internals.","mainEntity":{"@context":"https://schema.org","@type":"TechArticle","headline":"AEO Layer 1 Scoring","description":"Deep dive into AEO Layer 1 scoring and AILK audit internals."}},{"@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":"Tech Articles","item":"http://localhost:3000/en/tech-articles"},{"@type":"ListItem","position":3,"name":"AEO Layer 1 Scoring","item":"http://localhost:3000/en/tech-articles/aeo-layer1-scoring"}]}]}</script><main id="main"><div class="mx-auto w-full max-w-container-xl px-4 md:px-6 lg:px-8 py-section"><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 class="ailk-prose max-w-none text-(--color-text-muted) text-body-sm leading-relaxed [&>*:first-child]:mt-0 [&_h2]:mt-block-loose [&_h2]:scroll-mt-24 [&_h2]:text-heading-3 [&_h2]:font-display [&_h2]:text-(--color-fg) [&_h3]:mt-block-loose [&_h3]:scroll-mt-24 [&_h3]:text-heading-4 [&_h3]:font-display [&_h3]:text-(--color-fg) [&_h4]:mt-block-tight [&_h4]:scroll-mt-24 [&_h4]:text-heading-4 [&_h4]:font-display [&_h4]:text-(--color-fg) [&_h5]:mt-block-tight [&_h5]:scroll-mt-24 [&_h5]:text-heading-4 [&_h5]:font-display [&_h5]:text-(--color-fg) [&_h6]:mt-block-tight [&_h6]:scroll-mt-24 [&_h6]:text-heading-4 [&_h6]:font-display [&_h6]:text-(--color-fg) [&_p]:mt-paragraph [&_strong]:font-semibold [&_strong]:text-(--color-fg) [&_em]:italic [&_ul]:mt-paragraph [&_ul]:list-disc [&_ul]:ps-6 [&_ol]:mt-paragraph [&_ol]:list-decimal [&_ol]:ps-6 [&_li]:mt-1 [&_li]:ps-1 [&_li]:marker:text-(--color-text-muted) [&_li>ul]:mt-1 [&_li>ol]:mt-1 [&_blockquote]:mt-paragraph [&_blockquote]:border-s-4 [&_blockquote]:border-(--color-border-strong) [&_blockquote]:ps-4 [&_blockquote]:italic [&_blockquote]:text-(--color-text-muted) [&_hr]:my-block-loose [&_hr]:border-(--color-border) [&_a]:text-(--color-accent) [&_a]:underline [&_a]:underline-offset-4 [&_:not(pre)>code]:rounded [&_:not(pre)>code]:bg-(--color-surface-secondary) [&_:not(pre)>code]:px-1.5 [&_:not(pre)>code]:py-0.5 [&_:not(pre)>code]:text-code [&_:not(pre)>code]:font-mono [&_:not(pre)>code]:text-(--color-fg) [&_pre]:mt-paragraph [&_pre]:overflow-auto [&_pre]:rounded-md [&_pre]:border-hairline [&_pre]:border-(--color-border) [&_pre]:bg-(--color-bg) [&_pre]:p-4 [&_pre]:font-mono [&_pre]:text-body-sm [&_img]:mt-paragraph [&_img]:h-auto [&_img]:max-w-full [&_img]:rounded-lg [&_table]:mt-paragraph [&_table]:w-full [&_table]:border-collapse [&_table]:text-body-sm [&_th]:border-b [&_th]:border-(--color-border) [&_th]:bg-(--color-surface-secondary) [&_th]:px-3 [&_th]:py-2 [&_th]:text-start [&_th]:font-semibold [&_th]:text-(--color-fg) [&_td]:border-b [&_td]:border-(--color-border) [&_td]:px-3 [&_td]:py-2 [&_kbd]:rounded [&_kbd]:border-hairline [&_kbd]:border-(--color-border) [&_kbd]:bg-(--color-surface-secondary) [&_kbd]:px-1.5 [&_kbd]:py-0.5 [&_kbd]:text-caption [&_kbd]:font-mono" data-testid="mdx-content"><div data-testid="mdx-rendered">## AEO Layer 1
|
|
66
|
-
|
|
67
|
-
Body content.</div></div></article></div></div></div></main>"
|
|
68
|
-
`);
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it("unknown slug triggers notFound()", async () => {
|
|
72
|
-
const getMdxSource = jest.fn().mockResolvedValue(null);
|
|
73
|
-
|
|
74
|
-
await expect(
|
|
75
|
-
TechArticleSlugPage({
|
|
76
|
-
params: Promise.resolve({ locale: "en", slug: "unknown-slug" }),
|
|
77
|
-
getMdxSource,
|
|
78
|
-
}),
|
|
79
|
-
).rejects.toThrow("NEXT_NOT_FOUND");
|
|
80
|
-
expect(mockNotFound).toHaveBeenCalled();
|
|
81
|
-
});
|
|
82
|
-
});
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// Tech Articles list page. Enumerates TechArticle slugs via the content adapter
|
|
2
|
-
// and renders a directory listing. No dedicated list MDX type exists for TechArticle.
|
|
3
|
-
import { getMdxSlugs as defaultGetMdxSlugs } from "@working-theory/page-renderer";
|
|
4
|
-
import { LinkListItem, RowGroup } from "@working-theory/ui/blocks";
|
|
5
|
-
import { Container, Heading, Text } from "@working-theory/ui/primitives";
|
|
6
|
-
import { getTranslations } from "next-intl/server";
|
|
7
|
-
import type { ReactElement } from "react";
|
|
8
|
-
|
|
9
|
-
interface Props {
|
|
10
|
-
params: Promise<{ locale: string }>;
|
|
11
|
-
getMdxSlugs?: typeof defaultGetMdxSlugs;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export default async function Page({
|
|
15
|
-
params,
|
|
16
|
-
getMdxSlugs = defaultGetMdxSlugs,
|
|
17
|
-
}: Props): Promise<ReactElement> {
|
|
18
|
-
const { locale } = await params;
|
|
19
|
-
const t = await getTranslations("tech-articles");
|
|
20
|
-
const slugs = await getMdxSlugs("TechArticle", locale);
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<main>
|
|
24
|
-
<Container className="py-section">
|
|
25
|
-
<Heading level={1}>{t("heading")}</Heading>
|
|
26
|
-
<div data-testid="tech-articles-description">
|
|
27
|
-
<Text>{t("description")}</Text>
|
|
28
|
-
</div>
|
|
29
|
-
{slugs.length === 0 ? (
|
|
30
|
-
<div data-testid="section-empty-state">
|
|
31
|
-
<Text>{t("emptyState")}</Text>
|
|
32
|
-
</div>
|
|
33
|
-
) : (
|
|
34
|
-
<RowGroup data-testid="tech-articles-list">
|
|
35
|
-
{slugs.map((slug) => (
|
|
36
|
-
<LinkListItem
|
|
37
|
-
key={slug}
|
|
38
|
-
href={`/${locale}/tech-articles/${slug}`}
|
|
39
|
-
label={slug}
|
|
40
|
-
className="px-4"
|
|
41
|
-
data-testid={`tech-articles-list-item-${slug}`}
|
|
42
|
-
/>
|
|
43
|
-
))}
|
|
44
|
-
</RowGroup>
|
|
45
|
-
)}
|
|
46
|
-
</Container>
|
|
47
|
-
</main>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for /templates/[slug] (#10051 D7, AC-5) — the TemplatePage detail
|
|
3
|
-
* route. `renderPage`/`renderPageMetadata` are mocked at the
|
|
4
|
-
* `@working-theory/page-renderer` boundary (the /vs/[slug] shape) and each
|
|
5
|
-
* assertion inspects the sections the route hands `renderPage`; the unknown-
|
|
6
|
-
* slug case runs the real `renderPage` so its notFound() is observed. The
|
|
7
|
-
* JSON-LD is the real builder over the real `toContentPageInput`, the path
|
|
8
|
-
* `renderPage` takes.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
const mockRenderPage = jest.fn(
|
|
12
|
-
async (..._args: unknown[]): Promise<unknown> => "<rendered/>",
|
|
13
|
-
);
|
|
14
|
-
const mockRenderPageMetadata = jest.fn((..._args: unknown[]) => undefined);
|
|
15
|
-
const mockNotFound = jest.fn(() => {
|
|
16
|
-
throw new Error("NEXT_NOT_FOUND");
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
jest.mock("next/navigation", () => ({
|
|
20
|
-
__esModule: true,
|
|
21
|
-
notFound: () => mockNotFound(),
|
|
22
|
-
redirect: jest.fn(),
|
|
23
|
-
}));
|
|
24
|
-
|
|
25
|
-
jest.mock("@working-theory/page-renderer", () => ({
|
|
26
|
-
...jest.requireActual("@working-theory/page-renderer"),
|
|
27
|
-
renderPage: (...args: unknown[]) => mockRenderPage(...args),
|
|
28
|
-
renderPageMetadata: (...args: unknown[]) => mockRenderPageMetadata(...args),
|
|
29
|
-
}));
|
|
30
|
-
|
|
31
|
-
const MESSAGES: Record<string, string> = {
|
|
32
|
-
getIt: "Get it",
|
|
33
|
-
startFree: "Start free",
|
|
34
|
-
viewDemo: "View demo",
|
|
35
|
-
viewTemplate: "View template",
|
|
36
|
-
included: "What's included",
|
|
37
|
-
demoBadge: "Live demo",
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
jest.mock("next-intl/server", () => ({
|
|
41
|
-
__esModule: true,
|
|
42
|
-
getTranslations: () => Promise.resolve((key: string) => MESSAGES[key] ?? key),
|
|
43
|
-
}));
|
|
44
|
-
|
|
45
|
-
import { pageToJsonLd } from "@working-theory/page-renderer";
|
|
46
|
-
|
|
47
|
-
import TemplateDetailPage, { generateMetadata } from "../page";
|
|
48
|
-
|
|
49
|
-
const A = {
|
|
50
|
-
type: "TemplatePage",
|
|
51
|
-
slug: "a",
|
|
52
|
-
title: "Template A",
|
|
53
|
-
description: "Description A.",
|
|
54
|
-
summary: "Summary A.",
|
|
55
|
-
price: 0,
|
|
56
|
-
priceCurrency: "USD",
|
|
57
|
-
demoUrl: "https://a.salessmyth.com",
|
|
58
|
-
categories: ["accounting"],
|
|
59
|
-
thumbnail: "/img/a.png",
|
|
60
|
-
getItUrl: "/contact",
|
|
61
|
-
includes: [
|
|
62
|
-
{ title: "Base site", description: "Pages and structured data." },
|
|
63
|
-
{ title: "Marketing", description: "Landing pages." },
|
|
64
|
-
],
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const B = {
|
|
68
|
-
type: "TemplatePage",
|
|
69
|
-
slug: "b",
|
|
70
|
-
title: "Template B",
|
|
71
|
-
description: "Description B.",
|
|
72
|
-
getItUrl: "/contact",
|
|
73
|
-
includes: [{ title: "Base site", description: "Pages and structured data." }],
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
type Section = { type: string; id: string; data: Record<string, unknown> };
|
|
77
|
-
|
|
78
|
-
async function sectionsFor(
|
|
79
|
-
frontmatter: Record<string, unknown>,
|
|
80
|
-
declared: Section[] = [],
|
|
81
|
-
) {
|
|
82
|
-
await TemplateDetailPage({
|
|
83
|
-
params: Promise.resolve({ locale: "en", slug: String(frontmatter.slug) }),
|
|
84
|
-
getMdxSource: jest
|
|
85
|
-
.fn()
|
|
86
|
-
.mockResolvedValue({ frontmatter, body: "" }) as never,
|
|
87
|
-
getPageSections: jest.fn(async () => declared) as never,
|
|
88
|
-
});
|
|
89
|
-
const input = mockRenderPage.mock.calls[0]![0] as {
|
|
90
|
-
type: string;
|
|
91
|
-
translationsNamespace?: string;
|
|
92
|
-
getPageSections: (fm: unknown) => Promise<Section[]>;
|
|
93
|
-
};
|
|
94
|
-
return { input, sections: await input.getPageSections(frontmatter) };
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
beforeEach(() => jest.clearAllMocks());
|
|
98
|
-
|
|
99
|
-
describe("TemplatePage detail — metadata", () => {
|
|
100
|
-
it("resolves metadata for the given slug", async () => {
|
|
101
|
-
await generateMetadata({
|
|
102
|
-
params: Promise.resolve({ locale: "en", slug: "a" }),
|
|
103
|
-
});
|
|
104
|
-
expect(mockRenderPageMetadata).toHaveBeenCalledWith({
|
|
105
|
-
type: "TemplatePage",
|
|
106
|
-
slug: "a",
|
|
107
|
-
locale: "en",
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
describe("TemplatePage detail — the generated sections (#10051 AC-5)", () => {
|
|
113
|
-
it("renders TemplatePage with no translations namespace", async () => {
|
|
114
|
-
const { input } = await sectionsFor(A);
|
|
115
|
-
expect(input.type).toBe("TemplatePage");
|
|
116
|
-
expect(input.translationsNamespace).toBeUndefined();
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
it("leads with a hero carrying the title, summary, thumbnail, Start free and View demo", async () => {
|
|
120
|
-
const { sections } = await sectionsFor(A);
|
|
121
|
-
expect(sections[0]).toMatchObject({
|
|
122
|
-
type: "hero",
|
|
123
|
-
data: {
|
|
124
|
-
headline: "Template A",
|
|
125
|
-
subheadline: "Summary A.",
|
|
126
|
-
image: { src: "/img/a.png", alt: "Template A" },
|
|
127
|
-
primaryCta: { label: "Start free", href: "/contact" },
|
|
128
|
-
secondaryCta: { label: "View demo", href: "https://a.salessmyth.com" },
|
|
129
|
-
},
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
it("renders What's included with one item per includes row", async () => {
|
|
134
|
-
const { sections } = await sectionsFor(A);
|
|
135
|
-
const included = sections.find((s) => s.id === "template-included");
|
|
136
|
-
expect(included?.data.headline).toBe("What's included");
|
|
137
|
-
expect(included?.data.items).toHaveLength(2);
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
it("renders Get it and no View demo for a priceless page without a demo", async () => {
|
|
141
|
-
const { sections } = await sectionsFor(B);
|
|
142
|
-
expect(sections[0]!.data.primaryCta).toEqual({
|
|
143
|
-
label: "Get it",
|
|
144
|
-
href: "/contact",
|
|
145
|
-
});
|
|
146
|
-
expect(sections[0]!.data).not.toHaveProperty("secondaryCta");
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
it("keeps an author's own leading hero and still renders What's included", async () => {
|
|
150
|
-
const own = {
|
|
151
|
-
type: "hero",
|
|
152
|
-
id: "own-hero",
|
|
153
|
-
data: { headline: "My own hero" },
|
|
154
|
-
};
|
|
155
|
-
const { sections } = await sectionsFor(A, [own]);
|
|
156
|
-
expect(sections.filter((s) => s.type === "hero").map((s) => s.id)).toEqual([
|
|
157
|
-
"own-hero",
|
|
158
|
-
]);
|
|
159
|
-
// The author's hero leads (spec Clarification); What's included follows it.
|
|
160
|
-
expect(sections.map((s) => s.id)).toEqual([
|
|
161
|
-
"own-hero",
|
|
162
|
-
"template-included",
|
|
163
|
-
]);
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
it("emits a Product main entity carrying an offers node", async () => {
|
|
167
|
-
const emitted = await pageToJsonLd(A as never, "en");
|
|
168
|
-
const graph = (emitted as { "@graph"?: unknown[] })["@graph"];
|
|
169
|
-
const blocks = (graph ??
|
|
170
|
-
(Array.isArray(emitted) ? emitted : [emitted])) as Array<
|
|
171
|
-
Record<string, unknown>
|
|
172
|
-
>;
|
|
173
|
-
const page = blocks.find((b) => b["@type"] === "WebPage") as {
|
|
174
|
-
mainEntity: Record<string, unknown>;
|
|
175
|
-
};
|
|
176
|
-
expect(page.mainEntity["@type"]).toBe("Product");
|
|
177
|
-
expect(page.mainEntity.offers).toMatchObject({
|
|
178
|
-
"@type": "Offer",
|
|
179
|
-
price: "0",
|
|
180
|
-
});
|
|
181
|
-
expect(String((page.mainEntity.offers as { url: string }).url)).toMatch(
|
|
182
|
-
/\/contact$/,
|
|
183
|
-
);
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
describe("TemplatePage detail — unknown slug", () => {
|
|
188
|
-
it("calls notFound through renderPage's detail branch", async () => {
|
|
189
|
-
const actual = jest.requireActual("@working-theory/page-renderer") as {
|
|
190
|
-
renderPage: (...args: unknown[]) => Promise<unknown>;
|
|
191
|
-
};
|
|
192
|
-
mockRenderPage.mockImplementationOnce((...args) =>
|
|
193
|
-
actual.renderPage(...args),
|
|
194
|
-
);
|
|
195
|
-
await expect(
|
|
196
|
-
TemplateDetailPage({
|
|
197
|
-
params: Promise.resolve({ locale: "en", slug: "no-such-template" }),
|
|
198
|
-
getMdxSource: jest.fn().mockResolvedValue(null) as never,
|
|
199
|
-
}),
|
|
200
|
-
).rejects.toThrow("NEXT_NOT_FOUND");
|
|
201
|
-
expect(mockNotFound).toHaveBeenCalled();
|
|
202
|
-
});
|
|
203
|
-
});
|