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/dist/remove-module.js
CHANGED
|
@@ -42,8 +42,9 @@ import { deriveArchitecture } from "./derive-architecture.js";
|
|
|
42
42
|
import { MODULE_SLICES, normalizeModules } from "./module-architecture.js";
|
|
43
43
|
import { MODULE_FLAGS_PATH, PAID_MCP_TOOLS_PATH, PAID_SECTIONS_PATH, writePaidSections, } from "./paid-sections.js";
|
|
44
44
|
import { ParseError, parseModules } from "./parse-args.js";
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
45
|
+
import { isGenerated, isRecordedRoute } from "./routes.js";
|
|
46
|
+
import { SITE_ROSTER_PATH, readSiteRoster, webDependencies } from "./site-roster.js";
|
|
47
|
+
import { HUB_KEPT_ROUTE_DIRS, MODULE_SURFACES, PAGE_PACKAGE_ROUTES, ROUTE_ROOT, resolveSurfaces, } from "./surfaces.js";
|
|
47
48
|
import { BASE_LAYER_DIR, templateTreeDir } from "./template-manifest.js";
|
|
48
49
|
import { TEMPLATE_RECORD_PATH, isRecordable, parseTemplateRecord, serializeTemplateRecord, sha256Hex, } from "./template-record.js";
|
|
49
50
|
import { readSiteTopology } from "./topology.js";
|
|
@@ -187,6 +188,53 @@ export function removalSet(targetDir, moduleName) {
|
|
|
187
188
|
.filter((p) => existsSync(join(targetDir, ...p.split("/"))))
|
|
188
189
|
.sort();
|
|
189
190
|
}
|
|
191
|
+
// ── Edited-file classification (D5) ─────────────────────────────────────────
|
|
192
|
+
/** The `request` a removed generated route's `customizations.yaml` entry names. */
|
|
193
|
+
const REMOVED_ROUTE_REQUEST = "working-theory-labs/ai-launch-kit-internal#11251";
|
|
194
|
+
/**
|
|
195
|
+
* Append one `customizations.yaml` entry per removed generated route file
|
|
196
|
+
* (#11251 D12): `id: removed-<route>`, its one path, the decision that the
|
|
197
|
+
* site removed it with `moduleName`. A path the file already names is left
|
|
198
|
+
* as it is; an empty `customizations: []` becomes `customizations:` first.
|
|
199
|
+
*/
|
|
200
|
+
function recordRemovedRoutes(targetDir, removed, moduleName) {
|
|
201
|
+
const fresh = removed.filter((p) => !isRecordedRoute(targetDir, p));
|
|
202
|
+
if (fresh.length === 0)
|
|
203
|
+
return;
|
|
204
|
+
const path = join(targetDir, "customizations.yaml");
|
|
205
|
+
const lines = (existsSync(path) ? readFileSync(path, "utf8") : "").replace(/\n*$/, "").split("\n");
|
|
206
|
+
let start = lines.findIndex((line) => /^customizations:/.test(line));
|
|
207
|
+
if (start === -1) {
|
|
208
|
+
if (lines.length === 1 && lines[0] === "")
|
|
209
|
+
lines.length = 0;
|
|
210
|
+
lines.push("customizations:");
|
|
211
|
+
start = lines.length - 1;
|
|
212
|
+
}
|
|
213
|
+
else if (/^customizations:\s*\[\s*\]\s*$/.test(lines[start])) {
|
|
214
|
+
lines[start] = "customizations:";
|
|
215
|
+
}
|
|
216
|
+
// The entries go at the end of the `customizations:` list — before the next
|
|
217
|
+
// top-level key (`declined_routes:`, `undecided_ok_until:`), never after it.
|
|
218
|
+
let end = lines.findIndex((line, i) => i > start && /^\S/.test(line) && !line.startsWith("#"));
|
|
219
|
+
if (end === -1)
|
|
220
|
+
end = lines.length;
|
|
221
|
+
while (end > start + 1 && lines[end - 1].trim() === "")
|
|
222
|
+
end--;
|
|
223
|
+
const today = new Date().toISOString().slice(0, 10);
|
|
224
|
+
const entries = fresh.flatMap((p) => {
|
|
225
|
+
const route = p.slice(`${ROUTE_ROOT}/`.length).replace(/\.[a-z]+$/, "");
|
|
226
|
+
const id = `removed-${route.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "")}`;
|
|
227
|
+
return [
|
|
228
|
+
` - id: ${JSON.stringify(id)}`,
|
|
229
|
+
" paths:",
|
|
230
|
+
` - ${JSON.stringify(p)}`,
|
|
231
|
+
` request: ${JSON.stringify(REMOVED_ROUTE_REQUEST)}`,
|
|
232
|
+
` decision: ${JSON.stringify(`build-in: site — create-ailk remove-module ${moduleName}, ${today}, the site removed the ${moduleName} module`)}`,
|
|
233
|
+
];
|
|
234
|
+
});
|
|
235
|
+
lines.splice(end, 0, ...entries);
|
|
236
|
+
writeFileSync(path, `${lines.join("\n")}\n`);
|
|
237
|
+
}
|
|
190
238
|
/** The template's copy of `path`, rendered as `copyTemplate` wrote it, or undefined when the template lacks it. */
|
|
191
239
|
function templateCopy(layers, path) {
|
|
192
240
|
const abs = join(layers.templatesDir, ...path.split("/"));
|
|
@@ -225,6 +273,11 @@ function seedMatches(layers, path, disk) {
|
|
|
225
273
|
*/
|
|
226
274
|
function isEdited(layers, targetDir, path) {
|
|
227
275
|
const disk = readFileSync(join(targetDir, ...path.split("/")));
|
|
276
|
+
// #11251 D12 — a route file `create-ailk routes --write` generated is the
|
|
277
|
+
// page package's code, never the site's edit (`routes --check` holds it to
|
|
278
|
+
// the manifest).
|
|
279
|
+
if (isGenerated(disk.toString("utf8")))
|
|
280
|
+
return false;
|
|
228
281
|
// A carried module's own sample seeds are placeholders by contract (the
|
|
229
282
|
// starter-template contract R2); no shipped layer holds their bytes to
|
|
230
283
|
// compare, and they are never the site's own page.
|
|
@@ -376,8 +429,13 @@ export function removeModuleFromScaffold(opts) {
|
|
|
376
429
|
].join("\n"));
|
|
377
430
|
}
|
|
378
431
|
// ── Delete, then prune the directories the deletions emptied ────────────
|
|
432
|
+
const generatedRoutes = paths.filter((p) => isGenerated(readFileSync(join(targetDir, ...p.split("/")), "utf8")));
|
|
379
433
|
for (const p of paths)
|
|
380
434
|
rmSync(join(targetDir, ...p.split("/")));
|
|
435
|
+
// #11251 D12 (ADR 0040 rule 2) — a deleted generated route is recorded as
|
|
436
|
+
// the site's removal, so the next `routes --write` skips it and
|
|
437
|
+
// `routes --check` reports it removed, never missing.
|
|
438
|
+
recordRemovedRoutes(targetDir, generatedRoutes, moduleName);
|
|
381
439
|
if (moduleName === "marketing") {
|
|
382
440
|
pruneEmpty(join(targetDir, ...ROUTE_ROOT.split("/")), false);
|
|
383
441
|
pruneEmpty(join(targetDir, "content"), false);
|
|
@@ -444,6 +502,19 @@ export function removeModuleFromScaffold(opts) {
|
|
|
444
502
|
keptSegments.add(dir);
|
|
445
503
|
}
|
|
446
504
|
}
|
|
505
|
+
// #11259 D6 — a carried page package's pages under a kept group are kept
|
|
506
|
+
// too: the snapshot holds none of its generated route files, so a site
|
|
507
|
+
// whose routes are not yet written has no `(auth)/sign-in` on disk.
|
|
508
|
+
const carried = webDependencies(targetDir);
|
|
509
|
+
for (const row of PAGE_PACKAGE_ROUTES) {
|
|
510
|
+
if (!carried.has(row.package))
|
|
511
|
+
continue;
|
|
512
|
+
for (const page of row.pages) {
|
|
513
|
+
const [group, segment] = page.split("/");
|
|
514
|
+
if (segment !== undefined && HUB_KEPT_ROUTE_DIRS.includes(group ?? ""))
|
|
515
|
+
keptSegments.add(segment);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
447
518
|
const dropRoutes = moduleName === "marketing"
|
|
448
519
|
? (route) => !keptSegments.has(route.split("/")[1] ?? "")
|
|
449
520
|
: (route) => (MODULE_SLICES[moduleName].pageContributions ?? []).some((c) => c.route === route);
|
package/dist/routes.d.ts
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/** The app a page package's routes mount in, relative to the site root. */
|
|
2
|
+
export declare const ROUTES_APP_DIR = "apps/web";
|
|
3
|
+
/**
|
|
4
|
+
* The site's own handler trees under `app/api/`, which no page package may
|
|
5
|
+
* declare as an app prefix (#11257 D10, SEC-11257-3): the Offerings buy route,
|
|
6
|
+
* the revalidate hook, the webhook routes and the legacy checkout.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SITE_HANDLER_PREFIXES: readonly string[];
|
|
9
|
+
/** The routing file names the generator writes (`ROUTING_FILES`), for the snapshot build (#11259 D6). */
|
|
10
|
+
export declare const ROUTING_FILE_NAMES: ReadonlySet<string>;
|
|
11
|
+
export type RouteKind = "page" | "layout" | "route";
|
|
12
|
+
export interface RouteEntry {
|
|
13
|
+
/** The routing file under `app/[locale]/`, POSIX, e.g. `(authed)/account/general/page.tsx`. */
|
|
14
|
+
path: string;
|
|
15
|
+
kind: RouteKind;
|
|
16
|
+
/** The package subpath the file re-exports from, e.g. `general/page` → `@working-theory/account/general/page`. */
|
|
17
|
+
module: string;
|
|
18
|
+
/** The exports to re-export: `default`, `metadata`, `generateMetadata`, or HTTP methods on a handler. */
|
|
19
|
+
exports: string[];
|
|
20
|
+
/** Route-segment-config lines, copied literally. */
|
|
21
|
+
segmentConfig: string[];
|
|
22
|
+
/** Whether the default export takes the site's config as a `config` prop. */
|
|
23
|
+
config: boolean;
|
|
24
|
+
/** Whether `generateMetadata` takes it too (#11253) — only with `config` and a `generateMetadata` export. */
|
|
25
|
+
metadataConfig: boolean;
|
|
26
|
+
/** Where `path` is relative to: `app/[locale]/` (the default) or `app/` (#11257 D10). */
|
|
27
|
+
mount: RouteMount;
|
|
28
|
+
/** An ADR 0020 inline waiver the generated handler carries after its header (#11257 D10). */
|
|
29
|
+
waiver: string | undefined;
|
|
30
|
+
}
|
|
31
|
+
export type RouteMount = "locale" | "app";
|
|
32
|
+
export interface RouteManifest {
|
|
33
|
+
package: string;
|
|
34
|
+
version: string;
|
|
35
|
+
/** The package's route prefixes under `app/[locale]/` — the stray check's scope; a manifest's single string is wrapped. */
|
|
36
|
+
prefix: string[];
|
|
37
|
+
/** Whether the package ships the locale-root `page.tsx` — the manifest's `"root": true` (#11259 D5). */
|
|
38
|
+
localeRoot: boolean;
|
|
39
|
+
/** Whether the site's surfaces and public tree gate the package's entries (#11259 D5). */
|
|
40
|
+
siteGated: boolean;
|
|
41
|
+
/** The package's prefixes under `app/` for its `app`-mounted entries — their stray check's scope (#11257 D10). */
|
|
42
|
+
appPrefixes: string[];
|
|
43
|
+
/** Whether the package reads the site through `<package>/site`, which the site must alias (#11257 D4). */
|
|
44
|
+
siteSeam: boolean;
|
|
45
|
+
/** The site's config file at the app root, without extension (`account.config`). */
|
|
46
|
+
config: string | undefined;
|
|
47
|
+
/** Routing files under the prefix that stay the site's own pages, never generated. */
|
|
48
|
+
siteOwned: string[];
|
|
49
|
+
/** The package's message catalog, when it ships one. */
|
|
50
|
+
messages: ManifestMessages | undefined;
|
|
51
|
+
/** `false` when each generated file carries the `// oss: false` marker; unset otherwise. */
|
|
52
|
+
oss: false | undefined;
|
|
53
|
+
routes: RouteEntry[];
|
|
54
|
+
/** The installed package's directory, which `messages.catalog` is relative to (set by `readRouteManifests`). */
|
|
55
|
+
root?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface ManifestMessages {
|
|
58
|
+
/** The installed package's catalog directory, one `<locale>.json` per locale. */
|
|
59
|
+
catalog: string;
|
|
60
|
+
/** Dotted key prefixes under the package's namespaces that are the site's own strings. */
|
|
61
|
+
siteOwned: string[];
|
|
62
|
+
}
|
|
63
|
+
export declare class RoutesRefusedError extends Error {
|
|
64
|
+
readonly exitCode = 2;
|
|
65
|
+
constructor(message: string);
|
|
66
|
+
}
|
|
67
|
+
/** Parse and validate one manifest; every refusal names the package and the entry. */
|
|
68
|
+
export declare function parseRouteManifest(pkg: string, version: string, raw: unknown): RouteManifest;
|
|
69
|
+
/**
|
|
70
|
+
* The route manifests of the installed page packages, in package-name
|
|
71
|
+
* order: every `@working-theory/*` dependency of `<site>/apps/web` whose
|
|
72
|
+
* installed `package.json` declares one. A dependency not installed yet
|
|
73
|
+
* (before `pnpm install`) declares nothing and is not an error.
|
|
74
|
+
*/
|
|
75
|
+
export declare function readRouteManifests(siteDir: string): RouteManifest[];
|
|
76
|
+
/** The header line of every generated route file begins with this; `remove-module` reads it as module code. */
|
|
77
|
+
export declare const GENERATED_ROUTE_HEADER = "// Generated by create-ailk routes from ";
|
|
78
|
+
/** Line 1 of a generated file whose manifest sets `"oss": false` — the public strip's file marker. */
|
|
79
|
+
export declare const OSS_FALSE_MARKER = "// oss: false";
|
|
80
|
+
/** The generated file's text for one entry. Every statement is one line; the config wrapper is in prettier's shape. */
|
|
81
|
+
export declare function renderRouteFile(manifest: RouteManifest, entry: RouteEntry): string;
|
|
82
|
+
/** Whether `text` is a file this generator wrote: its first line (after an `oss: false` marker) is the header. */
|
|
83
|
+
export declare function isGenerated(text: string): boolean;
|
|
84
|
+
/** Whether `<siteDir>/customizations.yaml` records `sitePath` — any entry, any path form or glob (the generator's own reading). */
|
|
85
|
+
export declare function isRecordedRoute(siteDir: string, sitePath: string): boolean;
|
|
86
|
+
export interface RecordedRoute {
|
|
87
|
+
path: string;
|
|
88
|
+
state: "replaced" | "removed";
|
|
89
|
+
id: string;
|
|
90
|
+
}
|
|
91
|
+
export interface RoutesDrift {
|
|
92
|
+
missing: string[];
|
|
93
|
+
stale: string[];
|
|
94
|
+
stray: string[];
|
|
95
|
+
recorded: RecordedRoute[];
|
|
96
|
+
/** The manifest entries the site's topology does not carry (a spoke without the account area). */
|
|
97
|
+
notCarried: string[];
|
|
98
|
+
/** Routing files under a prefix that the package's manifest leaves to the site (`siteOwned`). */
|
|
99
|
+
siteKept: string[];
|
|
100
|
+
/** Site message keys under a package's namespace that its catalog no longer has: `<file>: <key>`. */
|
|
101
|
+
orphanedOverrides: string[];
|
|
102
|
+
/** A site file missing the alias line a `siteSeam` package needs: `<file>: <alias>` (#11257 D4). */
|
|
103
|
+
seamAliasMissing: string[];
|
|
104
|
+
/** The manifest entries in force — recorded ones included, not-carried ones not. */
|
|
105
|
+
generated: number;
|
|
106
|
+
}
|
|
107
|
+
/** The count check mode fails on: missing, stale and stray route files, orphaned overrides and missing seam aliases. */
|
|
108
|
+
export declare function routesFailing(drift: RoutesDrift): number;
|
|
109
|
+
/** How the site's route files and message overrides differ from the installed page packages. `routesFailing` zero means in sync. */
|
|
110
|
+
export declare function checkRoutes(siteDir: string): RoutesDrift;
|
|
111
|
+
export interface WriteRoutesResult {
|
|
112
|
+
written: string[];
|
|
113
|
+
current: string[];
|
|
114
|
+
recorded: RecordedRoute[];
|
|
115
|
+
/** Routing files at an entry's path that the generator did not write — a site's own handler — left as they are (#11257 D10). */
|
|
116
|
+
kept: string[];
|
|
117
|
+
}
|
|
118
|
+
/** Write every generated file that is missing or stale; a recorded route is left exactly as it is. */
|
|
119
|
+
export declare function writeRoutes(siteDir: string): WriteRoutesResult;
|
|
120
|
+
export interface RoutesArgs {
|
|
121
|
+
target: string | undefined;
|
|
122
|
+
write: boolean;
|
|
123
|
+
check: boolean;
|
|
124
|
+
help: boolean;
|
|
125
|
+
}
|
|
126
|
+
export declare const ROUTES_HELP = "create-ailk routes \u2014 generate the route files for the pages a site's packages ship.\n\nUsage:\n create-ailk routes --write [<target-dir>]\n create-ailk routes --check [<target-dir>]\n\nArguments:\n <target-dir> The site root (holds apps/web). Defaults to the\n current dir.\n\nOptions:\n --write Write one generated file per route the installed\n page packages declare, under apps/web/app/[locale]/.\n A file already current is left alone.\n --check Write nothing; exit 1 naming each generated file\n that is missing, stale (differs from what --write\n would write) or stray (a page.tsx, layout.tsx or\n route.ts under a package's route prefix that is\n neither generated, recorded, nor one the package\n leaves to the site). It also names each orphaned\n override: a key in apps/web/messages/<locale>.json\n under a namespace a package's catalog ships that\n the catalog no longer has.\n --help, -h Print this message.\n\nA page package is an installed @working-theory/* dependency of apps/web whose\npackage.json declares \"ailk\": { \"routes\": \"<manifest>\" }. A generated file\nre-exports the package's page and copies its route-segment config; when the\npage takes the site's config it imports the manifest's config file from the\napp root (apps/web/account.config.tsx, say) and passes it in. Replace or remove a shipped route by recording it in\ncustomizations.yaml (an entry whose paths match the route file): a recorded\nroute is reported as replaced or removed, never failed, and --write never\ntouches it. A manifest may list several prefixes, and one manifest with\n\"root\": true may ship the locale-root page.tsx. A manifest with\n\"siteGated\": true ships only the routes the site selected: its public pages\nare not carried when .ailk-site-manifest.json lists no marketing module, and\nneither is any page under a surface the architecture.yaml \"# Surfaces:\" header\nleaves out. Run --write after `pnpm install` (the manifests are read from the\ninstalled packages); the scaffold's preflight runs --check as `pnpm routes:check`.\n";
|
|
127
|
+
/** Parse the argv AFTER the `routes` word. Strict `node:util` parseArgs, like `parseSyncRoutesArgs`. */
|
|
128
|
+
export declare function parseRoutesArgs(argv: string[]): RoutesArgs;
|
|
129
|
+
/** The printed report: one line per file, grouped by state; the recorded routes last, under their decision. */
|
|
130
|
+
export declare function formatRoutesReport(result: RoutesDrift | WriteRoutesResult, mode: "check" | "write"): string;
|