create-ailk 0.37.1 → 0.39.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/README.md +129 -0
- package/component-catalog.json +44 -6
- package/component-catalog.md +6 -5
- package/dist/add-module.js +16 -1
- package/dist/add-route.d.ts +2 -2
- package/dist/add-route.js +19 -12
- package/dist/cli.js +52 -0
- package/dist/declined-routes.d.ts +13 -0
- package/dist/declined-routes.js +74 -0
- package/dist/derive-architecture.d.ts +0 -6
- package/dist/derive-architecture.js +12 -16
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -0
- package/dist/language-import.d.ts +93 -0
- package/dist/language-import.js +270 -43
- package/dist/lib/import-mdx.js +1 -1
- package/dist/lib/scaffold-render-sweep.d.ts +6 -3
- package/dist/lib/scaffold-render-sweep.js +8 -4
- package/dist/migrate-content.d.ts +6 -2
- package/dist/migrate-content.js +62 -5
- package/dist/module-architecture.js +139 -103
- package/dist/paid-sections.d.ts +13 -0
- package/dist/paid-sections.js +35 -5
- package/dist/programmatic.js +6 -16
- package/dist/remove-module.js +73 -2
- package/dist/routes.d.ts +130 -0
- package/dist/routes.js +954 -0
- package/dist/site-manifest.js +6 -4
- package/dist/site-roster.d.ts +11 -2
- package/dist/site-roster.js +63 -21
- package/dist/spoke-checkout.d.ts +28 -27
- package/dist/spoke-checkout.js +71 -102
- package/dist/surfaces.d.ts +26 -0
- package/dist/surfaces.js +105 -293
- package/dist/sync-routes.d.ts +14 -1
- package/dist/sync-routes.js +108 -10
- package/dist/template-record.js +3 -1
- package/dist/topology.d.ts +26 -1
- package/dist/topology.js +273 -7
- package/dist/update.d.ts +17 -2
- package/dist/update.js +480 -77
- package/package.json +3 -3
- package/templates/README.md +1 -1
- package/templates/apps/mcp/CLAUDE.md +5 -3
- package/templates/apps/web/CLAUDE.md +87 -23
- package/templates/apps/web/__tests__/__mocks__/next-intl-server.ts +5 -1
- package/templates/apps/web/__tests__/__mocks__/next-intl.ts +5 -1
- package/templates/apps/web/__tests__/auth/seam.test.ts +34 -0
- package/templates/apps/web/account.config.tsx +100 -0
- 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 +2 -2
- package/templates/apps/web/app/[locale]/(authed)/signed-out-gate.generated.tsx +1 -1
- package/templates/apps/web/app/[locale]/layout.tsx +46 -29
- package/templates/apps/web/app/apple-icon.tsx +72 -0
- package/templates/apps/web/app/llms.txt/__tests__/site-listing.test.ts +22 -12
- package/templates/apps/web/app/og/__tests__/__snapshots__/card.test.tsx.snap +3 -0
- package/templates/apps/web/app/og/__tests__/card.test.tsx +129 -0
- package/templates/apps/web/app/og/__tests__/route.test.ts +3 -4
- package/templates/apps/web/app/og/route.tsx +155 -72
- package/templates/apps/web/app/sitemap.xml/__tests__/site-listing.test.ts +12 -0
- package/templates/apps/web/auth.config.tsx +107 -0
- package/templates/apps/web/auth.ts +2 -1
- package/templates/apps/web/i18n/request.ts +51 -1
- package/templates/apps/web/jest.config.cjs +17 -1
- package/templates/apps/web/lib/__tests__/auth-phone.test.ts +11 -0
- package/templates/apps/web/lib/__tests__/fixtures/site-topology.ts +73 -0
- package/templates/apps/web/lib/__tests__/nav-label-keys.test.ts +14 -0
- package/templates/apps/web/lib/__tests__/profile-back-link.test.ts +148 -61
- package/templates/apps/web/lib/__tests__/served-pages.test.ts +77 -0
- package/templates/apps/web/lib/__tests__/server-api.test.ts +37 -5
- package/templates/apps/web/lib/__tests__/structured-data.test.tsx +26 -13
- package/templates/apps/web/lib/listings.tsx +2 -2
- package/templates/apps/web/lib/nav-label-keys.ts +16 -2
- package/templates/apps/web/lib/paid-section-contracts.ts +35 -6
- package/templates/apps/web/lib/paid-sections.generated.ts +8 -0
- package/templates/apps/web/lib/profile-back-link.ts +105 -32
- package/templates/apps/web/lib/served-pages.ts +95 -0
- package/templates/apps/web/lib/server-api.ts +1 -1
- package/templates/apps/web/lib/site-brand.tsx +3 -5
- package/templates/apps/web/lib/topology.generated.ts +5 -0
- package/templates/apps/web/messages/en.json +8 -836
- package/templates/apps/web/middleware.ts +15 -26
- package/templates/apps/web/next.config.mjs +35 -0
- package/templates/apps/web/package.json +2 -0
- package/templates/apps/web/types/messages.d.ts +6 -1
- package/templates/customizations.yaml +9 -0
- package/templates/package.json +3 -1
- package/templates/tools/lint-architecture.ts +164 -11
- package/versions.json +49 -47
- 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/__tests__/account-frame-sign-out.test.tsx +0 -175
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/agreements-prompt.test.tsx +0 -301
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/billing.test.tsx +0 -515
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/general.test.tsx +0 -883
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/hub-mode.test.tsx +0 -758
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/item.test.tsx +0 -264
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/layout-sign-out.test.tsx +0 -167
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/layout.test.tsx +0 -730
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/new-menu.test.tsx +0 -355
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/new-popups.test.tsx +0 -97
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/notifications.test.tsx +0 -375
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/onboarding.test.tsx +0 -323
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/page.test.tsx +0 -1208
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/popups.test.tsx +0 -418
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/privacy.test.tsx +0 -462
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/rich-translator.ts +0 -63
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/security.test.tsx +0 -406
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/settings.test.tsx +0 -93
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/support.test.tsx +0 -208
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/thread.test.tsx +0 -340
- package/templates/apps/web/app/[locale]/(authed)/account/account-data.ts +0 -182
- package/templates/apps/web/app/[locale]/(authed)/account/account-frame.tsx +0 -353
- package/templates/apps/web/app/[locale]/(authed)/account/actions.ts +0 -57
- package/templates/apps/web/app/[locale]/(authed)/account/agreements-actions.ts +0 -58
- package/templates/apps/web/app/[locale]/(authed)/account/agreements-gate.ts +0 -61
- package/templates/apps/web/app/[locale]/(authed)/account/agreements-prompt.tsx +0 -184
- package/templates/apps/web/app/[locale]/(authed)/account/appointments/[slug]/page.tsx +0 -161
- package/templates/apps/web/app/[locale]/(authed)/account/appointments/__tests__/page.test.tsx +0 -426
- package/templates/apps/web/app/[locale]/(authed)/account/appointments/appointments-data.ts +0 -76
- package/templates/apps/web/app/[locale]/(authed)/account/appointments/page.tsx +0 -139
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/page.tsx +0 -406
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/pay-form.tsx +0 -65
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/review-form.tsx +0 -172
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/versions/[version]/file/route.ts +0 -190
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/file-route.test.ts +0 -333
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/page.test.tsx +0 -936
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/pay.test.tsx +0 -193
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/review.test.tsx +0 -476
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/artifact-actions.ts +0 -184
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/artifact-data.ts +0 -197
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/page.tsx +0 -182
- package/templates/apps/web/app/[locale]/(authed)/account/billing/__tests__/offerings.test.ts +0 -99
- package/templates/apps/web/app/[locale]/(authed)/account/billing/offerings.ts +0 -123
- package/templates/apps/web/app/[locale]/(authed)/account/billing/page.tsx +0 -424
- package/templates/apps/web/app/[locale]/(authed)/account/billing-source.ts +0 -303
- package/templates/apps/web/app/[locale]/(authed)/account/components/request-quote.tsx +0 -274
- package/templates/apps/web/app/[locale]/(authed)/account/error-row.tsx +0 -35
- package/templates/apps/web/app/[locale]/(authed)/account/for-you-labels.ts +0 -36
- package/templates/apps/web/app/[locale]/(authed)/account/general/__tests__/phone-verification.test.tsx +0 -215
- package/templates/apps/web/app/[locale]/(authed)/account/general/__tests__/seam-imports.test.ts +0 -65
- package/templates/apps/web/app/[locale]/(authed)/account/general/account-name.ts +0 -36
- package/templates/apps/web/app/[locale]/(authed)/account/general/billing-anchor.tsx +0 -27
- package/templates/apps/web/app/[locale]/(authed)/account/general/contact-actions.ts +0 -149
- package/templates/apps/web/app/[locale]/(authed)/account/general/contact-details.tsx +0 -42
- package/templates/apps/web/app/[locale]/(authed)/account/general/deletion-request.tsx +0 -132
- package/templates/apps/web/app/[locale]/(authed)/account/general/page.tsx +0 -218
- package/templates/apps/web/app/[locale]/(authed)/account/general/phone-actions.ts +0 -122
- package/templates/apps/web/app/[locale]/(authed)/account/general/phone-verification.tsx +0 -215
- package/templates/apps/web/app/[locale]/(authed)/account/general/photo-actions.ts +0 -73
- package/templates/apps/web/app/[locale]/(authed)/account/general/profile-form.tsx +0 -107
- package/templates/apps/web/app/[locale]/(authed)/account/general/profile-source.ts +0 -87
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/[kind]/[id]/page.tsx +0 -119
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/message/[id]/file/__tests__/route.test.ts +0 -215
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/message/[id]/file/route.ts +0 -80
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/member-thread-composer.tsx +0 -43
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/page.tsx +0 -125
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/thread-data.ts +0 -88
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/thread-write.ts +0 -31
- package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/__tests__/invitation-id.test.ts +0 -35
- package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/__tests__/page.test.tsx +0 -266
- package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/actions.ts +0 -116
- package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/invitation-id.ts +0 -12
- package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/page.tsx +0 -154
- package/templates/apps/web/app/[locale]/(authed)/account/layout.tsx +0 -152
- package/templates/apps/web/app/[locale]/(authed)/account/new-actions.ts +0 -219
- package/templates/apps/web/app/[locale]/(authed)/account/new-menu.tsx +0 -365
- package/templates/apps/web/app/[locale]/(authed)/account/new-popups.tsx +0 -86
- package/templates/apps/web/app/[locale]/(authed)/account/notifications/page.tsx +0 -143
- package/templates/apps/web/app/[locale]/(authed)/account/onboarding/actions.ts +0 -120
- package/templates/apps/web/app/[locale]/(authed)/account/onboarding/onboarding-form.tsx +0 -322
- package/templates/apps/web/app/[locale]/(authed)/account/onboarding/page.tsx +0 -126
- package/templates/apps/web/app/[locale]/(authed)/account/page.tsx +0 -306
- package/templates/apps/web/app/[locale]/(authed)/account/privacy/__tests__/export-route.test.ts +0 -173
- package/templates/apps/web/app/[locale]/(authed)/account/privacy/actions.ts +0 -103
- package/templates/apps/web/app/[locale]/(authed)/account/privacy/export/route.ts +0 -102
- package/templates/apps/web/app/[locale]/(authed)/account/privacy/page.tsx +0 -240
- package/templates/apps/web/app/[locale]/(authed)/account/profile-actions.ts +0 -116
- package/templates/apps/web/app/[locale]/(authed)/account/retry-button.tsx +0 -27
- package/templates/apps/web/app/[locale]/(authed)/account/security/__tests__/hub-variant.test.tsx +0 -258
- package/templates/apps/web/app/[locale]/(authed)/account/security/page.tsx +0 -131
- package/templates/apps/web/app/[locale]/(authed)/account/security/security-panel.tsx +0 -130
- package/templates/apps/web/app/[locale]/(authed)/account/security/security-source.ts +0 -92
- package/templates/apps/web/app/[locale]/(authed)/account/settings/page.tsx +0 -24
- package/templates/apps/web/app/[locale]/(authed)/account/settings-frame.tsx +0 -121
- package/templates/apps/web/app/[locale]/(authed)/account/sign-in-method.ts +0 -37
- package/templates/apps/web/app/[locale]/(authed)/account/support/page.tsx +0 -60
- package/templates/apps/web/app/[locale]/(authed)/account/support/support-form.tsx +0 -98
- package/templates/apps/web/app/[locale]/(authed)/account/support-actions.ts +0 -100
- package/templates/apps/web/app/[locale]/checkout/__tests__/pages.test.tsx +0 -139
- package/templates/apps/web/app/[locale]/checkout/__tests__/thank-you-account.test.tsx +0 -146
- package/templates/apps/web/app/[locale]/checkout/thank-you/page.tsx +0 -114
- package/templates/apps/web/app/[locale]/checkout/unavailable/page.tsx +0 -51
- package/templates/apps/web/app/[locale]/flows/[slug]/FlowStepperClient.tsx +0 -614
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.count.test.tsx +0 -43
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.deliverable.test.tsx +0 -214
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.ending.test.tsx +0 -197
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.invite.test.tsx +0 -286
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.permalink.test.tsx +0 -520
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.test.tsx +0 -376
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.thanks-by-tier.test.tsx +0 -306
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/account-invite.actions.test.ts +0 -69
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/flow.actions.test.ts +0 -398
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/magnet-page.test.tsx +0 -704
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/save.actions.test.ts +0 -173
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/two-route-tool.test.tsx +0 -141
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/verify.test.tsx +0 -249
- package/templates/apps/web/app/[locale]/flows/[slug]/account-invite.actions.ts +0 -35
- package/templates/apps/web/app/[locale]/flows/[slug]/email-moment.ts +0 -92
- package/templates/apps/web/app/[locale]/flows/[slug]/flow.actions.ts +0 -177
- package/templates/apps/web/app/[locale]/flows/[slug]/magnet-page.tsx +0 -472
- package/templates/apps/web/app/[locale]/flows/[slug]/page.tsx +0 -48
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/LevelChart.tsx +0 -100
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsCard.tsx +0 -99
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsClient.tsx +0 -820
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsEmailStep.tsx +0 -203
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/ResultsClient.no-commerce.test.tsx +0 -194
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/ResultsClient.report.test.tsx +0 -284
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/by-result.test.tsx +0 -302
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/cards.test.tsx +0 -402
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/landing.test.tsx +0 -293
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/page.test.tsx +0 -485
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/score.test.tsx +0 -231
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/checkout-seam.ts +0 -74
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/meeting-seam.ts +0 -36
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/page.tsx +0 -420
- package/templates/apps/web/app/[locale]/flows/[slug]/save.actions.ts +0 -85
- package/templates/apps/web/app/[locale]/flows/[slug]/served-flow.ts +0 -91
- package/templates/apps/web/app/[locale]/flows/[slug]/start/page.tsx +0 -32
- package/templates/apps/web/app/[locale]/flows/[slug]/verify/page.tsx +0 -153
- package/templates/apps/web/app/[locale]/flows/[slug]/verify.actions.ts +0 -151
- package/templates/apps/web/app/[locale]/meet/confirmed/BookingHandOff.tsx +0 -128
- package/templates/apps/web/app/[locale]/meet/confirmed/__tests__/BookingHandOff.test.tsx +0 -126
- package/templates/apps/web/app/[locale]/purchase/__tests__/cancel.test.tsx +0 -162
- package/templates/apps/web/app/[locale]/purchase/__tests__/module-scope.test.ts +0 -68
- package/templates/apps/web/app/[locale]/purchase/__tests__/success.test.tsx +0 -411
- package/templates/apps/web/app/[locale]/purchase/cancel/page.tsx +0 -115
- package/templates/apps/web/app/[locale]/purchase/success/page.tsx +0 -348
- 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__/account-config.test.ts +0 -704
- package/templates/apps/web/lib/__tests__/auth-routes.test.ts +0 -140
- package/templates/apps/web/lib/account-config.ts +0 -678
- package/templates/apps/web/lib/auth-routes.ts +0 -125
- package/templates/apps/web/lib/checkout-config.ts +0 -16
- 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/next-path.ts +0 -35
- package/templates/apps/web/src/lib/__tests__/commerce-sections.test.ts +0 -57
- package/templates/apps/web/src/lib/commerce-sections.ts +0 -55
package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/by-result.test.tsx
DELETED
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
// oss: false
|
|
2
|
-
/**
|
|
3
|
-
* Tests for the by-result rows on the results permalink (#10827).
|
|
4
|
-
*
|
|
5
|
-
* `recommend()` returns the first matching row's `routeTo`; the page then
|
|
6
|
-
* sends a checkout row with a shown `_monthly` key straight to the Offerings
|
|
7
|
-
* buy route (a top-level navigation from the browser), and renders an offering row as one card named from the
|
|
8
|
-
* offering — priced, with its `/pricing?plan=` link, only while the offering
|
|
9
|
-
* is shown. A draft (an offering not in the shown set) renders its card with
|
|
10
|
-
* no price and no link, for either kind.
|
|
11
|
-
*
|
|
12
|
-
* #11013 spec E, D-G (AC-5) — the by-result card is the same Product card
|
|
13
|
-
* `ResultsCard` draws for an Email-links-to offering, and it wins over one.
|
|
14
|
-
*
|
|
15
|
-
* Mocks mirror `landing.test.tsx`; the clock moves 16 s between cases so the
|
|
16
|
-
* page's 15 s shown-set read never carries over.
|
|
17
|
-
*/
|
|
18
|
-
import { render, screen, within } from "@testing-library/react";
|
|
19
|
-
import type { FlowConfig, FlowResultRow } from "@working-theory/validation";
|
|
20
|
-
import {
|
|
21
|
-
encodePermalink,
|
|
22
|
-
PERMALINK_VERSION,
|
|
23
|
-
workspaceShownSetWireSchema,
|
|
24
|
-
} from "@working-theory/validation";
|
|
25
|
-
import type { ReactElement } from "react";
|
|
26
|
-
|
|
27
|
-
const mockGet = jest.fn();
|
|
28
|
-
const mockShown = jest.fn();
|
|
29
|
-
jest.mock("@working-theory/api-client", () => ({
|
|
30
|
-
__esModule: true,
|
|
31
|
-
flows: { get: (...args: unknown[]) => mockGet(...args) },
|
|
32
|
-
offerings: { shown: (...args: unknown[]) => mockShown(...args) },
|
|
33
|
-
}));
|
|
34
|
-
|
|
35
|
-
const mockRedirect = jest.fn((url: string) => {
|
|
36
|
-
throw new Error(`NEXT_REDIRECT:${url}`);
|
|
37
|
-
});
|
|
38
|
-
jest.mock("next/navigation", () => ({
|
|
39
|
-
__esModule: true,
|
|
40
|
-
redirect: (url: string) => mockRedirect(url),
|
|
41
|
-
}));
|
|
42
|
-
|
|
43
|
-
jest.mock("next-intl", () => ({
|
|
44
|
-
__esModule: true,
|
|
45
|
-
useTranslations: () => (key: string) => key,
|
|
46
|
-
useMessages: () => ({}),
|
|
47
|
-
}));
|
|
48
|
-
|
|
49
|
-
import Page from "../page";
|
|
50
|
-
|
|
51
|
-
const SLUG = "readiness";
|
|
52
|
-
const en = (s: string) => ({ en: s });
|
|
53
|
-
|
|
54
|
-
/** A scored diagnostic — never 0, monthly 2, weekly 4 points — with rows only. */
|
|
55
|
-
function config(
|
|
56
|
-
byResult: FlowResultRow[],
|
|
57
|
-
weights: Record<"never" | "monthly" | "weekly", number> = { never: 0, monthly: 2, weekly: 4 },
|
|
58
|
-
): FlowConfig {
|
|
59
|
-
return {
|
|
60
|
-
slug: SLUG,
|
|
61
|
-
defaultLocale: "en",
|
|
62
|
-
mode: "recommending",
|
|
63
|
-
steps: [
|
|
64
|
-
{
|
|
65
|
-
key: "q0",
|
|
66
|
-
type: "segmentation",
|
|
67
|
-
copy: { title: en("How often do you ship?") },
|
|
68
|
-
questions: [
|
|
69
|
-
{
|
|
70
|
-
name: "cadence",
|
|
71
|
-
options: [
|
|
72
|
-
{ value: "never", label: en("Never") },
|
|
73
|
-
{ value: "monthly", label: en("Monthly") },
|
|
74
|
-
{ value: "weekly", label: en("Weekly") },
|
|
75
|
-
],
|
|
76
|
-
},
|
|
77
|
-
],
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
scoring: {
|
|
81
|
-
version: 1,
|
|
82
|
-
points: [
|
|
83
|
-
{
|
|
84
|
-
name: "p_cadence",
|
|
85
|
-
question: "cadence",
|
|
86
|
-
kind: "optionWeights",
|
|
87
|
-
weights,
|
|
88
|
-
},
|
|
89
|
-
],
|
|
90
|
-
scores: { total: { sum: ["p_cadence"] } },
|
|
91
|
-
tiers: [{ key: "all", when: { score: "total", gte: 0 } }],
|
|
92
|
-
default: "all",
|
|
93
|
-
},
|
|
94
|
-
recommendation: { key: "result", copy: { title: en("Your result") }, byResult },
|
|
95
|
-
} as FlowConfig;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const SHOWN_SET = workspaceShownSetWireSchema.parse({
|
|
99
|
-
productIds: ["prod_growth"],
|
|
100
|
-
recommended: { plan: null, addon: null },
|
|
101
|
-
offerings: [
|
|
102
|
-
{
|
|
103
|
-
productId: "prod_growth",
|
|
104
|
-
plan: "growth-ops-growth",
|
|
105
|
-
name: "Growth Ops - Growth",
|
|
106
|
-
description: null,
|
|
107
|
-
marketingFeatures: [],
|
|
108
|
-
unitLabel: null,
|
|
109
|
-
note: null,
|
|
110
|
-
termsNote: null,
|
|
111
|
-
ailkGroup: "plan",
|
|
112
|
-
ailkOrder: null,
|
|
113
|
-
recommended: false,
|
|
114
|
-
prices: [
|
|
115
|
-
{
|
|
116
|
-
priceId: "price_growth_monthly",
|
|
117
|
-
lookupKey: "growth-ops-growth_monthly",
|
|
118
|
-
plan: "growth-ops-growth",
|
|
119
|
-
period: "monthly",
|
|
120
|
-
interval: "month",
|
|
121
|
-
amount: 120000,
|
|
122
|
-
currency: "usd",
|
|
123
|
-
},
|
|
124
|
-
],
|
|
125
|
-
},
|
|
126
|
-
],
|
|
127
|
-
state: "current",
|
|
128
|
-
snapshotAt: "2026-11-04T12:00:00.000Z",
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
function page(answers: Record<string, string>): Promise<ReactElement> {
|
|
132
|
-
return Page({
|
|
133
|
-
params: Promise.resolve({
|
|
134
|
-
locale: "en",
|
|
135
|
-
slug: SLUG,
|
|
136
|
-
payload: encodePermalink({ version: PERMALINK_VERSION, flowSlug: SLUG, answers }),
|
|
137
|
-
}),
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
async function redirectOf(answers: Record<string, string>): Promise<string | null> {
|
|
142
|
-
const err = await page(answers).then(
|
|
143
|
-
() => null,
|
|
144
|
-
(e: unknown) => e,
|
|
145
|
-
);
|
|
146
|
-
const message = err instanceof Error ? err.message : "";
|
|
147
|
-
return message.startsWith("NEXT_REDIRECT:") ? message.slice("NEXT_REDIRECT:".length) : null;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
const checkoutRow = (offeringKey: string): FlowResultRow => ({
|
|
151
|
-
when: { kind: "tier", op: "is", level: 5 },
|
|
152
|
-
routeTo: { kind: "checkout", offeringKey },
|
|
153
|
-
});
|
|
154
|
-
const offeringRow = (offeringKey: string): FlowResultRow => ({
|
|
155
|
-
when: { kind: "answer", op: "atLeast", question: "cadence", value: "monthly" },
|
|
156
|
-
routeTo: { kind: "offering", offeringKey },
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
/** The navigations jsdom was asked for and reports as not implemented. */
|
|
160
|
-
let consoleError: jest.SpyInstance<void, unknown[]>;
|
|
161
|
-
function navigations(): unknown[] {
|
|
162
|
-
return consoleError.mock.calls.filter((args) =>
|
|
163
|
-
args.some((arg: unknown) => String(arg instanceof Error ? arg.message : arg).includes("navigation")),
|
|
164
|
-
);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
beforeAll(() => {
|
|
168
|
-
jest.useFakeTimers({ now: new Date("2026-11-04T12:00:00.000Z") });
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
afterAll(() => {
|
|
172
|
-
jest.useRealTimers();
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
beforeEach(() => {
|
|
176
|
-
jest.setSystemTime(Date.now() + 16_000);
|
|
177
|
-
mockGet.mockReset();
|
|
178
|
-
mockShown.mockReset();
|
|
179
|
-
mockRedirect.mockClear();
|
|
180
|
-
consoleError = jest.spyOn(console, "error").mockImplementation(() => undefined);
|
|
181
|
-
window.sessionStorage.clear();
|
|
182
|
-
mockShown.mockResolvedValue({ ok: true, status: 200, body: { status: "shown", shownSet: SHOWN_SET } });
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
afterEach(() => {
|
|
186
|
-
consoleError.mockRestore();
|
|
187
|
-
// Every landing is a root-relative path of grammar characters only.
|
|
188
|
-
for (const [url] of mockRedirect.mock.calls) {
|
|
189
|
-
expect(url).toMatch(/^\/[a-z0-9/?=_-]+$/);
|
|
190
|
-
expect(url).not.toContain("//");
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
describe("#10827 — a checkout row sends the respondent to checkout", () => {
|
|
195
|
-
it("a shown _monthly key → a top-level navigation to the Offerings buy route for that key", async () => {
|
|
196
|
-
// The walk arrives by a client-side navigation, which the buy route
|
|
197
|
-
// refuses — so the browser, not a server redirect, goes to checkout.
|
|
198
|
-
mockGet.mockResolvedValue({ ok: true, status: 200, body: config([checkoutRow("growth-ops-growth_monthly")]) });
|
|
199
|
-
// This tab just walked the flow: `FlowStepperClient`'s session entry.
|
|
200
|
-
window.sessionStorage.setItem(`ailk:flow-session:${SLUG}`, "sess_1");
|
|
201
|
-
render(await page({ cadence: "weekly" }));
|
|
202
|
-
expect(mockRedirect).not.toHaveBeenCalled();
|
|
203
|
-
// jsdom performs no navigation; it reports each one it was asked for.
|
|
204
|
-
expect(navigations()).toHaveLength(1);
|
|
205
|
-
expect(screen.getByTestId("flow-results-card-action")).toHaveTextContent("getStarted");
|
|
206
|
-
// The card stays as the fallback, priced from the offering.
|
|
207
|
-
expect(screen.getByTestId("flow-results-card-price")).toBeInTheDocument();
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
it.each<[string, Record<string, string> | undefined, boolean]>([
|
|
211
|
-
["a cold load of a shared permalink (no walk in this tab)", undefined, false],
|
|
212
|
-
["a ?checkout=cancelled return", { checkout: "cancelled" }, true],
|
|
213
|
-
])("%s shows the priced card and waits for the click", async (_label, search, walked) => {
|
|
214
|
-
mockGet.mockResolvedValue({ ok: true, status: 200, body: config([checkoutRow("growth-ops-growth_monthly")]) });
|
|
215
|
-
if (walked) window.sessionStorage.setItem(`ailk:flow-session:${SLUG}`, "sess_1");
|
|
216
|
-
render(
|
|
217
|
-
await Page({
|
|
218
|
-
params: Promise.resolve({
|
|
219
|
-
locale: "en",
|
|
220
|
-
slug: SLUG,
|
|
221
|
-
payload: encodePermalink({ version: PERMALINK_VERSION, flowSlug: SLUG, answers: { cadence: "weekly" } }),
|
|
222
|
-
}),
|
|
223
|
-
...(search !== undefined ? { searchParams: Promise.resolve(search) } : {}),
|
|
224
|
-
}),
|
|
225
|
-
);
|
|
226
|
-
expect(navigations()).toEqual([]);
|
|
227
|
-
expect(screen.getByTestId("flow-results-card-action")).toHaveTextContent("getStarted");
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
it("a {plan} key → the /pricing?plan= landing", async () => {
|
|
231
|
-
mockGet.mockResolvedValue({ ok: true, status: 200, body: config([checkoutRow("growth-ops-growth")]) });
|
|
232
|
-
await expect(redirectOf({ cadence: "weekly" })).resolves.toBe("/en/pricing?plan=growth-ops-growth");
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
it("a Level 4 row matches a 75% walk and not a 100% one (#11034)", async () => {
|
|
236
|
-
// monthly = 3 / 4 = 75% → Level 4; weekly = 100% → Level 5.
|
|
237
|
-
const level4: FlowResultRow = {
|
|
238
|
-
when: { kind: "tier", op: "is", level: 4 },
|
|
239
|
-
routeTo: { kind: "checkout", offeringKey: "growth-ops-growth" },
|
|
240
|
-
};
|
|
241
|
-
mockGet.mockResolvedValue({ ok: true, status: 200, body: config([level4], { never: 0, monthly: 3, weekly: 4 }) });
|
|
242
|
-
await expect(redirectOf({ cadence: "monthly" })).resolves.toBe("/en/pricing?plan=growth-ops-growth");
|
|
243
|
-
await expect(redirectOf({ cadence: "weekly" })).resolves.toBeNull();
|
|
244
|
-
});
|
|
245
|
-
|
|
246
|
-
it("a key not shown (a draft) renders its card with no price and no checkout", async () => {
|
|
247
|
-
mockGet.mockResolvedValue({ ok: true, status: 200, body: config([checkoutRow("ai-readiness-workshop_monthly")]) });
|
|
248
|
-
render(await page({ cadence: "weekly" }));
|
|
249
|
-
expect(mockRedirect).not.toHaveBeenCalled();
|
|
250
|
-
const card = screen.getByTestId("flow-results-card");
|
|
251
|
-
expect(card).toHaveTextContent("Ai readiness workshop");
|
|
252
|
-
expect(screen.queryByTestId("flow-results-card-price")).toBeNull();
|
|
253
|
-
expect(screen.queryByTestId("flow-results-card-action")).toBeNull();
|
|
254
|
-
expect(navigations()).toEqual([]);
|
|
255
|
-
});
|
|
256
|
-
});
|
|
257
|
-
|
|
258
|
-
describe("#10827 — an offering row renders a card named from the offering", () => {
|
|
259
|
-
it("a shown offering: its product name, its price and its /pricing link", async () => {
|
|
260
|
-
mockGet.mockResolvedValue({ ok: true, status: 200, body: config([offeringRow("growth-ops-growth")]) });
|
|
261
|
-
render(await page({ cadence: "monthly" }));
|
|
262
|
-
expect(mockRedirect).not.toHaveBeenCalled();
|
|
263
|
-
const card = screen.getByTestId("flow-results-card");
|
|
264
|
-
expect(within(card).getByRole("heading", { name: "Growth Ops - Growth" })).toBeInTheDocument();
|
|
265
|
-
expect(within(card).getByTestId("flow-results-card-price")).toBeInTheDocument();
|
|
266
|
-
expect(within(card).getByTestId("flow-results-card-action").getAttribute("href")).toBe(
|
|
267
|
-
"/en/pricing?plan=growth-ops-growth",
|
|
268
|
-
);
|
|
269
|
-
expect(navigations()).toEqual([]);
|
|
270
|
-
});
|
|
271
|
-
|
|
272
|
-
// #11013 decision 15 — a by-result row beats Email links to.
|
|
273
|
-
it("a by-result offering row and a conversionLink together render only the by-result card", async () => {
|
|
274
|
-
mockGet.mockResolvedValue({
|
|
275
|
-
ok: true,
|
|
276
|
-
status: 200,
|
|
277
|
-
body: { ...config([offeringRow("growth-ops-growth")]), conversionLink: { kind: "offering", id: "growth-ops-growth" } },
|
|
278
|
-
});
|
|
279
|
-
render(await page({ cadence: "monthly" }));
|
|
280
|
-
const cards = screen.getAllByTestId("flow-results-card");
|
|
281
|
-
expect(cards).toHaveLength(1);
|
|
282
|
-
expect(within(cards[0]!).getByRole("heading", { name: "Growth Ops - Growth" })).toBeInTheDocument();
|
|
283
|
-
// One read serves the row's card; the link never asks for a second.
|
|
284
|
-
expect(mockShown).toHaveBeenCalledTimes(1);
|
|
285
|
-
});
|
|
286
|
-
|
|
287
|
-
it("a draft offering (not shown): the card with no price and no link", async () => {
|
|
288
|
-
mockGet.mockResolvedValue({ ok: true, status: 200, body: config([offeringRow("ai-readiness-workshop")]) });
|
|
289
|
-
render(await page({ cadence: "weekly" }));
|
|
290
|
-
expect(screen.getByTestId("flow-results-card")).toHaveTextContent("Ai readiness workshop");
|
|
291
|
-
expect(screen.queryByTestId("flow-results-card-price")).toBeNull();
|
|
292
|
-
expect(screen.queryByTestId("flow-results-card-action")).toBeNull();
|
|
293
|
-
});
|
|
294
|
-
|
|
295
|
-
it("no row matches: the results page with no card and no redirect", async () => {
|
|
296
|
-
mockGet.mockResolvedValue({ ok: true, status: 200, body: config([offeringRow("growth-ops-growth")]) });
|
|
297
|
-
render(await page({ cadence: "never" }));
|
|
298
|
-
expect(screen.getByTestId("flow-results")).toBeInTheDocument();
|
|
299
|
-
expect(screen.queryByTestId("flow-results-card")).toBeNull();
|
|
300
|
-
expect(mockRedirect).not.toHaveBeenCalled();
|
|
301
|
-
});
|
|
302
|
-
});
|