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,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HTML snapshot regression tests for for/page.tsx → @working-theory/page-renderer migration
|
|
3
|
-
* (route renamed from use-cases/ by #6878 D2).
|
|
4
|
-
*
|
|
5
|
-
* Two-commit strategy:
|
|
6
|
-
* Commit 1: this file added; snapshots captured against pre-migration route (RED-passing).
|
|
7
|
-
* Commit 2: route migrated; same snapshots verify diff=0 (GREEN).
|
|
8
|
-
*
|
|
9
|
-
* Two states tested:
|
|
10
|
-
* - empty: getMdxSource returns null → empty-state branch
|
|
11
|
-
* - populated: getMdxSource returns a minimal MdxPageSource → full render
|
|
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
|
-
// ── @working-theory/ui mock ─────────────────────────────────────────────────────────────
|
|
19
|
-
jest.mock("@working-theory/ui", () => ({
|
|
20
|
-
// #7745: renderPage's mdx-body branch frames its head and body in the
|
|
21
|
-
// section Container and renders the body through MDXContent + the shared map.
|
|
22
|
-
Container: ({
|
|
23
|
-
children,
|
|
24
|
-
}: {
|
|
25
|
-
children?: React.ReactNode;
|
|
26
|
-
}): React.ReactElement => React.createElement("div", null, children),
|
|
27
|
-
MDXContent: ({
|
|
28
|
-
children,
|
|
29
|
-
}: {
|
|
30
|
-
children?: React.ReactNode;
|
|
31
|
-
}): React.ReactElement => React.createElement(React.Fragment, null, children),
|
|
32
|
-
getMDXComponents: (overrides?: Record<string, unknown>) => ({ ...overrides }),
|
|
33
|
-
// #4446/#4447: renderPage's own fallback/empty-state title now composes
|
|
34
|
-
// Heading (mobile type-budget classes, #4417) instead of a bare <h1>.
|
|
35
|
-
Heading: ({
|
|
36
|
-
children,
|
|
37
|
-
level,
|
|
38
|
-
}: {
|
|
39
|
-
children: React.ReactNode;
|
|
40
|
-
level: number;
|
|
41
|
-
}): React.ReactElement => React.createElement(`h${level}`, null, children),
|
|
42
|
-
SectionRenderer: ({ sections }: { sections: unknown[] }) =>
|
|
43
|
-
React.createElement("div", {
|
|
44
|
-
"data-testid": "section-renderer",
|
|
45
|
-
"data-section-count": String(sections.length),
|
|
46
|
-
}),
|
|
47
|
-
}));
|
|
48
|
-
|
|
49
|
-
import ForPage from "../page";
|
|
50
|
-
|
|
51
|
-
const getMdxSourceEmpty = jest.fn().mockResolvedValue(null);
|
|
52
|
-
|
|
53
|
-
describe("ForPage — snapshot regression", () => {
|
|
54
|
-
it("empty state renders deterministic HTML", async () => {
|
|
55
|
-
const element = await ForPage({
|
|
56
|
-
params: Promise.resolve({ locale: "en" }),
|
|
57
|
-
// No child pages: this snapshot pins the hub's own render (#10121).
|
|
58
|
-
getMdxSlugs: async () => [],
|
|
59
|
-
getMdxSource: getMdxSourceEmpty,
|
|
60
|
-
});
|
|
61
|
-
const { container } = render(element);
|
|
62
|
-
expect(container.innerHTML).toMatchInlineSnapshot(
|
|
63
|
-
`"<main id="main"><h1>Customers</h1><p data-testid="section-empty-state">Customer pages coming soon.</p></main>"`,
|
|
64
|
-
);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it("populated state renders deterministic HTML", async () => {
|
|
68
|
-
const source = {
|
|
69
|
-
frontmatter: {
|
|
70
|
-
type: "UseCasesList" as const,
|
|
71
|
-
slug: "for",
|
|
72
|
-
title: "Use Cases",
|
|
73
|
-
description: "How teams use our platform.",
|
|
74
|
-
},
|
|
75
|
-
body: "",
|
|
76
|
-
};
|
|
77
|
-
const getMdxSourcePopulated = jest.fn().mockResolvedValue(source);
|
|
78
|
-
|
|
79
|
-
const element = await ForPage({
|
|
80
|
-
params: Promise.resolve({ locale: "en" }),
|
|
81
|
-
// No child pages: this snapshot pins the hub's own render (#10121).
|
|
82
|
-
getMdxSlugs: async () => [],
|
|
83
|
-
getMdxSource: getMdxSourcePopulated,
|
|
84
|
-
});
|
|
85
|
-
const { container } = render(element);
|
|
86
|
-
expect(container.innerHTML).toMatchInlineSnapshot(
|
|
87
|
-
`"<script type="application/ld+json" data-testid="json-ld">{"@context":"https://schema.org","@type":"CollectionPage","inLanguage":"en","name":"Use Cases","description":"How teams use our platform.","mainEntity":{"@type":"ItemList","itemListElement":[{"@type":"Article"}]}}</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-remote" data-source=""></div></article></div></div></div></main>"`,
|
|
88
|
-
);
|
|
89
|
-
});
|
|
90
|
-
});
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
// Customers (/for) hub page (#6878 D2 — renamed from /use-cases). Reads
|
|
2
|
-
// UseCasesList MDX via the content adapter and emits a JSON-LD CollectionPage
|
|
3
|
-
// via the dispatcher. Sections when the frontmatter carries `sections[]` (the
|
|
4
|
-
// Free template's hub, operator ruling 2026-09-23), the MDX body otherwise.
|
|
5
|
-
// It lists every UseCase page through one generated card section (#10121,
|
|
6
|
-
// apps/web/lib/hub-children.tsx — the /alternatives and /templates shape).
|
|
7
|
-
import type {
|
|
8
|
-
getMdxSlugs as defaultGetMdxSlugs,
|
|
9
|
-
getMdxSource as defaultGetMdxSource,
|
|
10
|
-
getPageSections as defaultGetPageSections,
|
|
11
|
-
} from "@working-theory/page-renderer";
|
|
12
|
-
import { renderPage, renderPageMetadata } from "@working-theory/page-renderer";
|
|
13
|
-
import type { Metadata } from "next";
|
|
14
|
-
import type { ReactElement } from "react";
|
|
15
|
-
|
|
16
|
-
import { type HubConfig, hubPageInput } from "../../../lib/hub-children";
|
|
17
|
-
|
|
18
|
-
interface Props {
|
|
19
|
-
params: Promise<{ locale: string }>;
|
|
20
|
-
getMdxSource?: typeof defaultGetMdxSource;
|
|
21
|
-
getPageSections?: typeof defaultGetPageSections;
|
|
22
|
-
getMdxSlugs?: typeof defaultGetMdxSlugs;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const HUB: HubConfig = {
|
|
26
|
-
listType: "UseCasesList",
|
|
27
|
-
slug: "for",
|
|
28
|
-
childType: "UseCase",
|
|
29
|
-
linkLabel: "Read the use case",
|
|
30
|
-
sectionId: "use-case-cards",
|
|
31
|
-
body: "composed",
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export async function generateMetadata({
|
|
35
|
-
params,
|
|
36
|
-
}: Pick<Props, "params">): Promise<Metadata> {
|
|
37
|
-
const { locale } = await params;
|
|
38
|
-
return renderPageMetadata({ type: "UseCasesList", slug: "for", locale });
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export default async function Page({
|
|
42
|
-
params,
|
|
43
|
-
...loaders
|
|
44
|
-
}: Props): Promise<ReactElement> {
|
|
45
|
-
const { locale } = await params;
|
|
46
|
-
return renderPage({
|
|
47
|
-
type: "UseCasesList",
|
|
48
|
-
slug: "for",
|
|
49
|
-
...(await hubPageInput(HUB, locale, loaders)),
|
|
50
|
-
});
|
|
51
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
// Glossary page (#6658 D5) — a GlossaryList at /glossary. Reads the
|
|
2
|
-
// `GlossaryList` MDX with slug `glossary` and emits a JSON-LD CollectionPage
|
|
3
|
-
// whose mainEntity is a DefinedTermSet built from its `glossary-index`
|
|
4
|
-
// sections. A module-less surface a template enables by naming it in its
|
|
5
|
-
// roster; with no content the route 404s. Mirrors for/page.tsx: a
|
|
6
|
-
// sections-composed page renders its sections, a prose-only page 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
|
-
import { honourNavOnly } from "../../../lib/hub-children";
|
|
17
|
-
|
|
18
|
-
interface Props {
|
|
19
|
-
params: Promise<{ locale: string }>;
|
|
20
|
-
getMdxSource?: typeof defaultGetMdxSource;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export async function generateMetadata({
|
|
24
|
-
params,
|
|
25
|
-
}: Pick<Props, "params">): Promise<Metadata> {
|
|
26
|
-
const { locale } = await params;
|
|
27
|
-
return renderPageMetadata({
|
|
28
|
-
type: "GlossaryList",
|
|
29
|
-
slug: "glossary",
|
|
30
|
-
locale,
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export default async function Page({
|
|
35
|
-
params,
|
|
36
|
-
getMdxSource,
|
|
37
|
-
}: Props): Promise<ReactElement> {
|
|
38
|
-
const { locale } = await params;
|
|
39
|
-
const source = await (getMdxSource ?? loadMdxSource)("GlossaryList", "glossary", locale);
|
|
40
|
-
honourNavOnly(source?.frontmatter, locale, []);
|
|
41
|
-
const composed =
|
|
42
|
-
source !== null &&
|
|
43
|
-
Array.isArray((source.frontmatter as { sections?: unknown[] }).sections) &&
|
|
44
|
-
((source.frontmatter as { sections?: unknown[] }).sections?.length ?? 0) >
|
|
45
|
-
0;
|
|
46
|
-
return renderPage({
|
|
47
|
-
type: "GlossaryList",
|
|
48
|
-
slug: "glossary",
|
|
49
|
-
locale,
|
|
50
|
-
...(composed ? {} : { bodyMode: "mdx-body" as const }),
|
|
51
|
-
...(getMdxSource !== undefined && { getMdxSource }),
|
|
52
|
-
});
|
|
53
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// HowTo detail page. Reads the HowTo 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: "HowTo", 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)("HowTo", slug, locale);
|
|
33
|
-
const composed =
|
|
34
|
-
source !== null &&
|
|
35
|
-
Array.isArray((source.frontmatter as { sections?: unknown[] }).sections) &&
|
|
36
|
-
((source.frontmatter as { sections?: unknown[] }).sections?.length ?? 0) >
|
|
37
|
-
0;
|
|
38
|
-
return renderPage({
|
|
39
|
-
type: "HowTo",
|
|
40
|
-
slug,
|
|
41
|
-
locale,
|
|
42
|
-
...(composed
|
|
43
|
-
? {}
|
|
44
|
-
: {
|
|
45
|
-
bodyMode: "mdx-body" as const,
|
|
46
|
-
populatedDescriptionTestId: "how-to-description",
|
|
47
|
-
}),
|
|
48
|
-
...(getMdxSource !== undefined && { getMdxSource }),
|
|
49
|
-
});
|
|
50
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HTML snapshot regression tests for how-to routes — @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
|
-
* - how-to/[slug] (populated: populated state)
|
|
13
|
-
* - how-to/[slug] (notFound: unknown slug triggers notFound())
|
|
14
|
-
*
|
|
15
|
-
* Failure = snapshot diff > 0 bytes. DO NOT regenerate snapshots to pass.
|
|
16
|
-
* A non-zero diff indicates a behavior regression in the migration. Escalate.
|
|
17
|
-
*/
|
|
18
|
-
import React from "react";
|
|
19
|
-
import { render } from "@testing-library/react";
|
|
20
|
-
|
|
21
|
-
jest.mock("next-mdx-remote/rsc", () => ({
|
|
22
|
-
__esModule: true,
|
|
23
|
-
MDXRemote: ({ source }: { source: string }): React.ReactElement =>
|
|
24
|
-
React.createElement("div", { "data-testid": "mdx-rendered" }, source),
|
|
25
|
-
}));
|
|
26
|
-
|
|
27
|
-
jest.mock("next/navigation", () => ({
|
|
28
|
-
__esModule: true,
|
|
29
|
-
notFound: jest.fn(() => {
|
|
30
|
-
throw new Error("NEXT_NOT_FOUND");
|
|
31
|
-
}),
|
|
32
|
-
}));
|
|
33
|
-
|
|
34
|
-
import HowToSlugPage from "../[slug]/page";
|
|
35
|
-
import { notFound } from "next/navigation";
|
|
36
|
-
|
|
37
|
-
const mockNotFound = notFound as jest.MockedFunction<typeof notFound>;
|
|
38
|
-
|
|
39
|
-
describe("how-to/[slug] — snapshot regression", () => {
|
|
40
|
-
beforeEach(() => {
|
|
41
|
-
mockNotFound.mockClear();
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it("populated state renders deterministic HTML", async () => {
|
|
45
|
-
const getMdxSource = jest.fn().mockResolvedValue({
|
|
46
|
-
frontmatter: {
|
|
47
|
-
type: "HowTo" as const,
|
|
48
|
-
slug: "deploy-ailk-vercel",
|
|
49
|
-
title: "Deploy AILK to Vercel",
|
|
50
|
-
description: "Step-by-step guide to deploying AI Launch Kit on Vercel.",
|
|
51
|
-
},
|
|
52
|
-
body: "## Steps\n\nBody content.",
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
const element = await HowToSlugPage({
|
|
56
|
-
params: Promise.resolve({ locale: "en", slug: "deploy-ailk-vercel" }),
|
|
57
|
-
getMdxSource,
|
|
58
|
-
});
|
|
59
|
-
const { container } = render(element);
|
|
60
|
-
expect(container.innerHTML).toMatchInlineSnapshot(`
|
|
61
|
-
"<script type="application/ld+json" data-testid="json-ld">{"@context":"https://schema.org","@graph":[{"@context":"https://schema.org","@type":"WebPage","inLanguage":"en","name":"Deploy AILK to Vercel","description":"Step-by-step guide to deploying AI Launch Kit on Vercel.","mainEntity":{"@context":"https://schema.org","@type":"HowTo","name":"Deploy AILK to Vercel","description":"Step-by-step guide to deploying AI Launch Kit on Vercel."}},{"@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":"How-To Guides","item":"http://localhost:3000/en/how-to"},{"@type":"ListItem","position":3,"name":"Deploy AILK to Vercel","item":"http://localhost:3000/en/how-to/deploy-ailk-vercel"}]}]}</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">## Steps
|
|
62
|
-
|
|
63
|
-
Body content.</div></div></article></div></div></div></main>"
|
|
64
|
-
`);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it("unknown slug triggers notFound()", async () => {
|
|
68
|
-
const getMdxSource = jest.fn().mockResolvedValue(null);
|
|
69
|
-
|
|
70
|
-
await expect(
|
|
71
|
-
HowToSlugPage({
|
|
72
|
-
params: Promise.resolve({ locale: "en", slug: "unknown-slug" }),
|
|
73
|
-
getMdxSource,
|
|
74
|
-
}),
|
|
75
|
-
).rejects.toThrow("NEXT_NOT_FOUND");
|
|
76
|
-
expect(mockNotFound).toHaveBeenCalled();
|
|
77
|
-
});
|
|
78
|
-
});
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// How-To list page. Enumerates HowTo slugs via the content adapter and renders
|
|
2
|
-
// a directory listing. No dedicated list MDX type exists for HowTo; the list
|
|
3
|
-
// page is generated from the detail type's slug enumeration.
|
|
4
|
-
import { getMdxSlugs as defaultGetMdxSlugs } from "@working-theory/page-renderer";
|
|
5
|
-
import { LinkListItem, RowGroup } from "@working-theory/ui/blocks";
|
|
6
|
-
import { Container, Heading, Text } from "@working-theory/ui/primitives";
|
|
7
|
-
import { getTranslations } from "next-intl/server";
|
|
8
|
-
import type { ReactElement } from "react";
|
|
9
|
-
|
|
10
|
-
interface Props {
|
|
11
|
-
params: Promise<{ locale: string }>;
|
|
12
|
-
getMdxSlugs?: typeof defaultGetMdxSlugs;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default async function Page({
|
|
16
|
-
params,
|
|
17
|
-
getMdxSlugs = defaultGetMdxSlugs,
|
|
18
|
-
}: Props): Promise<ReactElement> {
|
|
19
|
-
const { locale } = await params;
|
|
20
|
-
const t = await getTranslations("how-to");
|
|
21
|
-
const slugs = await getMdxSlugs("HowTo", locale);
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<main>
|
|
25
|
-
<Container className="py-section">
|
|
26
|
-
<Heading level={1}>{t("heading")}</Heading>
|
|
27
|
-
<div data-testid="how-to-description">
|
|
28
|
-
<Text>{t("description")}</Text>
|
|
29
|
-
</div>
|
|
30
|
-
{slugs.length === 0 ? (
|
|
31
|
-
<div data-testid="section-empty-state">
|
|
32
|
-
<Text>{t("emptyState")}</Text>
|
|
33
|
-
</div>
|
|
34
|
-
) : (
|
|
35
|
-
<RowGroup data-testid="how-to-list">
|
|
36
|
-
{slugs.map((slug) => (
|
|
37
|
-
<LinkListItem
|
|
38
|
-
key={slug}
|
|
39
|
-
href={`/${locale}/how-to/${slug}`}
|
|
40
|
-
label={slug}
|
|
41
|
-
className="px-4"
|
|
42
|
-
data-testid={`how-to-list-item-${slug}`}
|
|
43
|
-
/>
|
|
44
|
-
))}
|
|
45
|
-
</RowGroup>
|
|
46
|
-
)}
|
|
47
|
-
</Container>
|
|
48
|
-
</main>
|
|
49
|
-
);
|
|
50
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// Integration detail page. Reads the Integration MDX for the given slug, renders
|
|
2
|
-
// via @working-theory/page-renderer, and emits a JSON-LD <script>. Unknown slugs 404 through renderPage.
|
|
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: "Integration", 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
|
-
"Integration",
|
|
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: "Integration",
|
|
44
|
-
slug,
|
|
45
|
-
locale,
|
|
46
|
-
...(composed
|
|
47
|
-
? {}
|
|
48
|
-
: {
|
|
49
|
-
bodyMode: "mdx-body" as const,
|
|
50
|
-
populatedDescriptionTestId: "integration-description",
|
|
51
|
-
}),
|
|
52
|
-
...(getMdxSource !== undefined && { getMdxSource }),
|
|
53
|
-
});
|
|
54
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hub child cards (#10121) for /integrations. The shared cases live in
|
|
3
|
-
* `lib/__tests__/hub-children.fixtures.ts`; this file sits beside the route so
|
|
4
|
-
* a scaffold without /integrations 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 IntegrationsPage from "../page";
|
|
24
|
-
import {
|
|
25
|
-
describeHub,
|
|
26
|
-
type HubPage,
|
|
27
|
-
} from "../../../../lib/__tests__/hub-children.fixtures";
|
|
28
|
-
|
|
29
|
-
describeHub(
|
|
30
|
-
[
|
|
31
|
-
"integrations",
|
|
32
|
-
IntegrationsPage as HubPage,
|
|
33
|
-
"IntegrationsList",
|
|
34
|
-
"Integration",
|
|
35
|
-
"mdx-body",
|
|
36
|
-
],
|
|
37
|
-
mockRenderPage,
|
|
38
|
-
);
|
package/templates/apps/web/app/[locale]/integrations/__tests__/page-renderer-migration.test.tsx
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HTML snapshot regression tests for the integrations catalog routes
|
|
3
|
-
* apps/web → @working-theory/page-renderer migration (Spec 1.5.1).
|
|
4
|
-
*
|
|
5
|
-
* Node version: captured against Node 22.x (same as CI).
|
|
6
|
-
* MDX seed content: DI-injected stub — no fs reads, deterministic across environments.
|
|
7
|
-
*
|
|
8
|
-
* Two-commit strategy (per spec §6):
|
|
9
|
-
* Commit 1: this file added; snapshots captured against pre-migration routes.
|
|
10
|
-
* Commit 2: routes migrated; same snapshots verify diff=0 (GREEN).
|
|
11
|
-
*
|
|
12
|
-
* Routes under test:
|
|
13
|
-
* - integrations/page.tsx (index — empty-state + populated)
|
|
14
|
-
* - integrations/[slug]/page.tsx (detail — populated + null→notFound)
|
|
15
|
-
*
|
|
16
|
-
* Failure = snapshot diff > 0 bytes. DO NOT regenerate snapshots to pass.
|
|
17
|
-
* A non-zero diff indicates a behavior regression in the migration. Escalate.
|
|
18
|
-
*/
|
|
19
|
-
import React from "react";
|
|
20
|
-
import { render } from "@testing-library/react";
|
|
21
|
-
|
|
22
|
-
jest.mock("next/navigation", () => ({
|
|
23
|
-
__esModule: true,
|
|
24
|
-
notFound: jest.fn(() => {
|
|
25
|
-
throw new Error("NEXT_NOT_FOUND");
|
|
26
|
-
}),
|
|
27
|
-
}));
|
|
28
|
-
|
|
29
|
-
import { notFound } from "next/navigation";
|
|
30
|
-
import IntegrationsPage from "../page";
|
|
31
|
-
import IntegrationSlugPage from "../[slug]/page";
|
|
32
|
-
import * as pageRenderer from "@working-theory/page-renderer";
|
|
33
|
-
|
|
34
|
-
const mockNotFound = notFound as jest.MockedFunction<typeof notFound>;
|
|
35
|
-
|
|
36
|
-
// ── Shared stub helpers ────────────────────────────────────────────────────────
|
|
37
|
-
|
|
38
|
-
function makeIntegrationsListSource() {
|
|
39
|
-
return {
|
|
40
|
-
frontmatter: {
|
|
41
|
-
type: "IntegrationsList" as const,
|
|
42
|
-
slug: "integrations",
|
|
43
|
-
title: "Integrations",
|
|
44
|
-
description: "First-party integrations for AI Launch Kit.",
|
|
45
|
-
},
|
|
46
|
-
body: "# Integrations\n\nBody.",
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function makeIntegrationSource(slug: string) {
|
|
51
|
-
return {
|
|
52
|
-
frontmatter: {
|
|
53
|
-
type: "Integration" as const,
|
|
54
|
-
slug,
|
|
55
|
-
title: "OpenAI API",
|
|
56
|
-
description: "Connect AILK to OpenAI.",
|
|
57
|
-
},
|
|
58
|
-
body: "# OpenAI API\n\nBody.",
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// ── integrations/page.tsx — index ─────────────────────────────────────────────
|
|
63
|
-
|
|
64
|
-
describe("IntegrationsPage — snapshot regression", () => {
|
|
65
|
-
beforeEach(() => {
|
|
66
|
-
mockNotFound.mockClear();
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
it("empty state renders deterministic HTML", async () => {
|
|
70
|
-
const getMdxSourceEmpty = jest.fn().mockResolvedValue(null);
|
|
71
|
-
const element = await IntegrationsPage({
|
|
72
|
-
params: Promise.resolve({ locale: "en" }),
|
|
73
|
-
// No child pages: this snapshot pins the hub's own render (#10121).
|
|
74
|
-
getMdxSlugs: async () => [],
|
|
75
|
-
getMdxSource: getMdxSourceEmpty,
|
|
76
|
-
});
|
|
77
|
-
const { container } = render(element);
|
|
78
|
-
expect(container.innerHTML).toMatchInlineSnapshot(
|
|
79
|
-
`"<main id="main"><h1 class="text-heading-1 lg:text-display-sm font-display text-fg hero-type-display">Integrations</h1><p data-testid="section-empty-state">Integrations listing coming soon.</p></main>"`,
|
|
80
|
-
);
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it("populated state renders deterministic HTML", async () => {
|
|
84
|
-
const source = makeIntegrationsListSource();
|
|
85
|
-
const getMdxSourcePopulated = jest.fn().mockResolvedValue(source);
|
|
86
|
-
const element = await IntegrationsPage({
|
|
87
|
-
params: Promise.resolve({ locale: "en" }),
|
|
88
|
-
// No child pages: this snapshot pins the hub's own render (#10121).
|
|
89
|
-
getMdxSlugs: async () => [],
|
|
90
|
-
getMdxSource: getMdxSourcePopulated,
|
|
91
|
-
});
|
|
92
|
-
const { container } = render(element);
|
|
93
|
-
expect(container.innerHTML).toMatchInlineSnapshot(`
|
|
94
|
-
"<script type="application/ld+json" data-testid="json-ld">{"@context":"https://schema.org","@type":"CollectionPage","inLanguage":"en","name":"Integrations","description":"First-party integrations for AI Launch Kit.","mainEntity":{"@type":"ItemList","itemListElement":[{"@type":"SoftwareApplication"}]}}</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-remote" data-source="# Integrations
|
|
95
|
-
|
|
96
|
-
Body."></div></div></article></div></div></div></main>"
|
|
97
|
-
`);
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
// ── integrations/[slug]/page.tsx — detail ─────────────────────────────────────
|
|
102
|
-
|
|
103
|
-
describe("IntegrationSlugPage — snapshot regression", () => {
|
|
104
|
-
beforeEach(() => {
|
|
105
|
-
mockNotFound.mockClear();
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
it("populated state renders deterministic HTML", async () => {
|
|
109
|
-
const slug = "openai-api";
|
|
110
|
-
const source = makeIntegrationSource(slug);
|
|
111
|
-
const getMdxSourcePopulated = jest.fn().mockResolvedValue(source);
|
|
112
|
-
const element = await IntegrationSlugPage({
|
|
113
|
-
params: Promise.resolve({ locale: "en", slug }),
|
|
114
|
-
getMdxSource: getMdxSourcePopulated,
|
|
115
|
-
});
|
|
116
|
-
const { container } = render(element);
|
|
117
|
-
expect(container.innerHTML).toMatchInlineSnapshot(`
|
|
118
|
-
"<script type="application/ld+json" data-testid="json-ld">{"@context":"https://schema.org","@graph":[{"@context":"https://schema.org","@type":"WebPage","inLanguage":"en","name":"OpenAI API","description":"Connect AILK to OpenAI.","mainEntity":{"@context":"https://schema.org","@type":"SoftwareApplication","name":"OpenAI API","description":"Connect AILK to OpenAI."}},{"@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":"Integrations","item":"http://localhost:3000/en/integrations"},{"@type":"ListItem","position":3,"name":"OpenAI API","item":"http://localhost:3000/en/integrations/openai-api"}]}]}</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-remote" data-source="# OpenAI API
|
|
119
|
-
|
|
120
|
-
Body."></div></div></article></div></div></div></main>"
|
|
121
|
-
`);
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
it("null source calls notFound()", async () => {
|
|
125
|
-
const renderPageSpy = jest.spyOn(pageRenderer, "renderPage");
|
|
126
|
-
const getMdxSourceNull = jest.fn().mockResolvedValue(null);
|
|
127
|
-
await expect(
|
|
128
|
-
IntegrationSlugPage({
|
|
129
|
-
params: Promise.resolve({ locale: "en", slug: "unknown-slug" }),
|
|
130
|
-
getMdxSource: getMdxSourceNull,
|
|
131
|
-
}),
|
|
132
|
-
).rejects.toThrow("NEXT_NOT_FOUND");
|
|
133
|
-
// The 404 is renderPage's detail branch, not a route pre-check (#7537).
|
|
134
|
-
expect(renderPageSpy).toHaveBeenCalledTimes(1);
|
|
135
|
-
expect(
|
|
136
|
-
renderPageSpy.mock.calls[0]![0].translationsNamespace,
|
|
137
|
-
).toBeUndefined();
|
|
138
|
-
renderPageSpy.mockRestore();
|
|
139
|
-
expect(mockNotFound).toHaveBeenCalled();
|
|
140
|
-
});
|
|
141
|
-
});
|