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.
Files changed (304) hide show
  1. package/dist/add-route.js +16 -1
  2. package/dist/body-heading.d.ts +2 -1
  3. package/dist/body-heading.js +31 -3
  4. package/dist/derive-architecture.js +3 -1
  5. package/dist/module-architecture.js +0 -3
  6. package/dist/remove-module.js +27 -14
  7. package/dist/routes.d.ts +36 -2
  8. package/dist/routes.js +269 -23
  9. package/dist/site-manifest.js +6 -4
  10. package/dist/site-roster.d.ts +11 -3
  11. package/dist/site-roster.js +48 -22
  12. package/dist/surfaces.d.ts +13 -3
  13. package/dist/surfaces.js +128 -194
  14. package/dist/sync-routes.js +22 -5
  15. package/dist/template-record.js +3 -1
  16. package/dist/topology.d.ts +11 -0
  17. package/dist/topology.js +253 -3
  18. package/package.json +3 -3
  19. package/templates/apps/web/CLAUDE.md +32 -4
  20. package/templates/apps/web/__tests__/__mocks__/next-intl-server.ts +6 -1
  21. package/templates/apps/web/__tests__/__mocks__/next-intl.ts +6 -1
  22. package/templates/apps/web/__tests__/auth/seam.test.ts +34 -0
  23. package/templates/apps/web/account.config.tsx +2 -3
  24. package/templates/apps/web/app/[locale]/(authed)/account/connect/__tests__/page.test.tsx +1 -1
  25. package/templates/apps/web/app/[locale]/(authed)/account/connect/page.tsx +1 -1
  26. package/templates/apps/web/app/[locale]/(authed)/signed-out-gate.generated.tsx +1 -1
  27. package/templates/apps/web/app/[locale]/layout.tsx +2 -2
  28. package/templates/apps/web/auth.config.tsx +107 -0
  29. package/templates/apps/web/auth.ts +2 -1
  30. package/templates/apps/web/i18n/request.ts +13 -2
  31. package/templates/apps/web/jest.config.cjs +10 -0
  32. package/templates/apps/web/lib/__tests__/deck-page.test.ts +9 -0
  33. package/templates/apps/web/lib/__tests__/fixtures/site-topology.ts +3 -0
  34. package/templates/apps/web/lib/__tests__/in-page-magnet-self-request.test.ts +1 -1
  35. package/templates/apps/web/lib/__tests__/in-page-magnet.test.ts +2 -2
  36. package/templates/apps/web/lib/__tests__/pricing-page.test.ts +1 -1
  37. package/templates/apps/web/lib/__tests__/server-api.test.ts +1 -1
  38. package/templates/apps/web/lib/__tests__/structured-data.test.tsx +17 -4
  39. package/templates/apps/web/lib/in-page-magnet.ts +2 -2
  40. package/templates/apps/web/lib/pricing-page.ts +3 -3
  41. package/templates/apps/web/lib/server-api.ts +1 -1
  42. package/templates/apps/web/{app/[locale]/contact → lib}/site-contact-email.ts +1 -1
  43. package/templates/apps/web/{app/[locale]/contact → lib}/site-contact-lines.ts +1 -1
  44. package/templates/apps/web/lib/site-header.ts +1 -1
  45. package/templates/apps/web/lib/topology.generated.ts +5 -0
  46. package/templates/apps/web/messages/en.json +0 -271
  47. package/templates/apps/web/middleware.ts +12 -25
  48. package/templates/apps/web/next.config.mjs +15 -0
  49. package/templates/apps/web/package.json +2 -0
  50. package/templates/apps/web/site-pages.config.tsx +85 -0
  51. package/templates/apps/web/types/messages.d.ts +6 -1
  52. package/templates/tools/body-heading.ts +30 -3
  53. package/versions.json +50 -48
  54. package/templates/apps/web/app/[locale]/(auth)/__tests__/auth-pages.test.tsx +0 -322
  55. package/templates/apps/web/app/[locale]/(auth)/__tests__/password-reset.test.tsx +0 -554
  56. package/templates/apps/web/app/[locale]/(auth)/consent/__tests__/consent-actions.test.ts +0 -56
  57. package/templates/apps/web/app/[locale]/(auth)/consent/__tests__/page.test.tsx +0 -164
  58. package/templates/apps/web/app/[locale]/(auth)/consent/consent-form.tsx +0 -132
  59. package/templates/apps/web/app/[locale]/(auth)/consent/consent.actions.ts +0 -51
  60. package/templates/apps/web/app/[locale]/(auth)/consent/page.tsx +0 -144
  61. package/templates/apps/web/app/[locale]/(auth)/forgot-password/forgot-password-card.tsx +0 -101
  62. package/templates/apps/web/app/[locale]/(auth)/forgot-password/page.tsx +0 -111
  63. package/templates/apps/web/app/[locale]/(auth)/layout.tsx +0 -81
  64. package/templates/apps/web/app/[locale]/(auth)/legal-footnote.tsx +0 -35
  65. package/templates/apps/web/app/[locale]/(auth)/reset-password/__tests__/return.test.tsx +0 -179
  66. package/templates/apps/web/app/[locale]/(auth)/reset-password/page.tsx +0 -157
  67. package/templates/apps/web/app/[locale]/(auth)/reset-password/reset-password-card.tsx +0 -126
  68. package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/next-path.test.ts +0 -54
  69. package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/page.test.tsx +0 -628
  70. package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/remembered-method.test.ts +0 -43
  71. package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/sign-in-card.test.tsx +0 -266
  72. package/templates/apps/web/app/[locale]/(auth)/sign-in/next-path.ts +0 -20
  73. package/templates/apps/web/app/[locale]/(auth)/sign-in/page.tsx +0 -234
  74. package/templates/apps/web/app/[locale]/(auth)/sign-in/remembered-method.ts +0 -37
  75. package/templates/apps/web/app/[locale]/(auth)/sign-in/sign-in-card.tsx +0 -323
  76. package/templates/apps/web/app/[locale]/(auth)/sign-in/sign-in-text.ts +0 -93
  77. package/templates/apps/web/app/[locale]/(auth)/sign-up/__tests__/page.test.tsx +0 -301
  78. package/templates/apps/web/app/[locale]/(auth)/sign-up/__tests__/sign-up-card.test.tsx +0 -309
  79. package/templates/apps/web/app/[locale]/(auth)/sign-up/page.tsx +0 -201
  80. package/templates/apps/web/app/[locale]/(auth)/sign-up/sign-up-card.tsx +0 -366
  81. package/templates/apps/web/app/[locale]/(auth)/use-auth-card-flow.ts +0 -116
  82. package/templates/apps/web/app/[locale]/(auth)/verify-email/__tests__/actions.test.ts +0 -94
  83. package/templates/apps/web/app/[locale]/(auth)/verify-email/actions.ts +0 -77
  84. package/templates/apps/web/app/[locale]/(auth)/verify-email/page.tsx +0 -154
  85. package/templates/apps/web/app/[locale]/(authed)/account/appointments/[slug]/page.tsx +0 -3
  86. package/templates/apps/web/app/[locale]/(authed)/account/appointments/page.tsx +0 -3
  87. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/page.tsx +0 -3
  88. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/versions/[version]/file/route.ts +0 -2
  89. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/page.tsx +0 -3
  90. package/templates/apps/web/app/[locale]/(authed)/account/billing/page.tsx +0 -12
  91. package/templates/apps/web/app/[locale]/(authed)/account/general/page.tsx +0 -12
  92. package/templates/apps/web/app/[locale]/(authed)/account/inbox/[kind]/[id]/page.tsx +0 -12
  93. package/templates/apps/web/app/[locale]/(authed)/account/inbox/message/[id]/file/route.ts +0 -2
  94. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/page.tsx +0 -12
  95. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/page.tsx +0 -3
  96. package/templates/apps/web/app/[locale]/(authed)/account/layout.tsx +0 -10
  97. package/templates/apps/web/app/[locale]/(authed)/account/notifications/page.tsx +0 -3
  98. package/templates/apps/web/app/[locale]/(authed)/account/onboarding/page.tsx +0 -3
  99. package/templates/apps/web/app/[locale]/(authed)/account/page.tsx +0 -12
  100. package/templates/apps/web/app/[locale]/(authed)/account/privacy/export/route.ts +0 -2
  101. package/templates/apps/web/app/[locale]/(authed)/account/privacy/page.tsx +0 -3
  102. package/templates/apps/web/app/[locale]/(authed)/account/security/page.tsx +0 -3
  103. package/templates/apps/web/app/[locale]/(authed)/account/settings/page.tsx +0 -2
  104. package/templates/apps/web/app/[locale]/(authed)/account/support/page.tsx +0 -3
  105. package/templates/apps/web/app/[locale]/(authed)/leads/__tests__/page.test.tsx +0 -205
  106. package/templates/apps/web/app/[locale]/(authed)/leads/components/LeadsTable.tsx +0 -137
  107. package/templates/apps/web/app/[locale]/(authed)/leads/page.tsx +0 -122
  108. package/templates/apps/web/app/[locale]/(authed)/waitlist/components/ForbiddenState.tsx +0 -24
  109. package/templates/apps/web/app/[locale]/(authed)/waitlist/format.ts +0 -111
  110. package/templates/apps/web/app/[locale]/[slug]/[detail]/__tests__/page.test.tsx +0 -402
  111. package/templates/apps/web/app/[locale]/[slug]/[detail]/page.tsx +0 -143
  112. package/templates/apps/web/app/[locale]/[slug]/__tests__/page.test.tsx +0 -148
  113. package/templates/apps/web/app/[locale]/[slug]/page.tsx +0 -109
  114. package/templates/apps/web/app/[locale]/about/[slug]/page.tsx +0 -46
  115. package/templates/apps/web/app/[locale]/about/__tests__/about-routes.test.tsx +0 -353
  116. package/templates/apps/web/app/[locale]/about/page.tsx +0 -122
  117. package/templates/apps/web/app/[locale]/alternatives/__tests__/page.test.tsx +0 -161
  118. package/templates/apps/web/app/[locale]/alternatives/page.tsx +0 -112
  119. package/templates/apps/web/app/[locale]/careers/[slug]/[action]/page.tsx +0 -244
  120. package/templates/apps/web/app/[locale]/careers/[slug]/apply.actions.ts +0 -325
  121. package/templates/apps/web/app/[locale]/careers/[slug]/job-application-form.ts +0 -120
  122. package/templates/apps/web/app/[locale]/careers/[slug]/page.tsx +0 -73
  123. package/templates/apps/web/app/[locale]/careers/__tests__/apply.actions.test.ts +0 -497
  124. package/templates/apps/web/app/[locale]/careers/__tests__/careers-hub.test.tsx +0 -172
  125. package/templates/apps/web/app/[locale]/careers/__tests__/careers-set.test.tsx +0 -153
  126. package/templates/apps/web/app/[locale]/careers/__tests__/job-application-form.test.ts +0 -141
  127. package/templates/apps/web/app/[locale]/careers/__tests__/job-apply-page.test.tsx +0 -546
  128. package/templates/apps/web/app/[locale]/careers/__tests__/page-renderer-migration.test.tsx +0 -189
  129. package/templates/apps/web/app/[locale]/careers/page.tsx +0 -165
  130. package/templates/apps/web/app/[locale]/case-studies/[slug]/page.tsx +0 -49
  131. package/templates/apps/web/app/[locale]/case-studies/__tests__/hub-children.test.tsx +0 -65
  132. package/templates/apps/web/app/[locale]/case-studies/__tests__/page-renderer-migration.test.tsx +0 -125
  133. package/templates/apps/web/app/[locale]/case-studies/page.tsx +0 -49
  134. package/templates/apps/web/app/[locale]/clients/__tests__/page-renderer-migration.test.tsx +0 -85
  135. package/templates/apps/web/app/[locale]/clients/page.tsx +0 -47
  136. package/templates/apps/web/app/[locale]/contact/ConversationalIntakeWrapper.tsx +0 -249
  137. package/templates/apps/web/app/[locale]/contact/__tests__/ConversationalIntakeWrapper.test.tsx +0 -400
  138. package/templates/apps/web/app/[locale]/contact/__tests__/contact-form-magnet.test.ts +0 -138
  139. package/templates/apps/web/app/[locale]/contact/__tests__/contact-form-text.test.ts +0 -49
  140. package/templates/apps/web/app/[locale]/contact/__tests__/contact-magnet-page.test.tsx +0 -494
  141. package/templates/apps/web/app/[locale]/contact/__tests__/contact.actions.test.ts +0 -1122
  142. package/templates/apps/web/app/[locale]/contact/__tests__/intake-analytics.test.ts +0 -51
  143. package/templates/apps/web/app/[locale]/contact/__tests__/page-renderer-migration.test.tsx +0 -319
  144. package/templates/apps/web/app/[locale]/contact/contact-form-magnet.ts +0 -77
  145. package/templates/apps/web/app/[locale]/contact/contact-form-text.ts +0 -52
  146. package/templates/apps/web/app/[locale]/contact/contact.actions.ts +0 -403
  147. package/templates/apps/web/app/[locale]/contact/intake-analytics.ts +0 -49
  148. package/templates/apps/web/app/[locale]/contact/intake-script.ts +0 -92
  149. package/templates/apps/web/app/[locale]/contact/page.tsx +0 -267
  150. package/templates/apps/web/app/[locale]/courses/[slug]/page.tsx +0 -50
  151. package/templates/apps/web/app/[locale]/courses/__tests__/hub-children.test.tsx +0 -32
  152. package/templates/apps/web/app/[locale]/courses/__tests__/page-renderer-migration.test.tsx +0 -123
  153. package/templates/apps/web/app/[locale]/courses/page.tsx +0 -49
  154. package/templates/apps/web/app/[locale]/events/[slug]/page.tsx +0 -57
  155. package/templates/apps/web/app/[locale]/events/__tests__/hub-children.test.tsx +0 -32
  156. package/templates/apps/web/app/[locale]/events/__tests__/page-renderer-migration.test.tsx +0 -164
  157. package/templates/apps/web/app/[locale]/events/__tests__/program-event.test.tsx +0 -120
  158. package/templates/apps/web/app/[locale]/events/page.tsx +0 -60
  159. package/templates/apps/web/app/[locale]/faq/page.tsx +0 -54
  160. package/templates/apps/web/app/[locale]/features/[slug]/page.tsx +0 -54
  161. package/templates/apps/web/app/[locale]/features/__tests__/hub-children.test.tsx +0 -32
  162. package/templates/apps/web/app/[locale]/features/page.tsx +0 -50
  163. package/templates/apps/web/app/[locale]/for/[slug]/page.tsx +0 -54
  164. package/templates/apps/web/app/[locale]/for/__tests__/hub-children.test.tsx +0 -32
  165. package/templates/apps/web/app/[locale]/for/__tests__/page-renderer-migration.test.tsx +0 -90
  166. package/templates/apps/web/app/[locale]/for/page.tsx +0 -51
  167. package/templates/apps/web/app/[locale]/glossary/page.tsx +0 -53
  168. package/templates/apps/web/app/[locale]/how-to/[slug]/page.tsx +0 -50
  169. package/templates/apps/web/app/[locale]/how-to/__tests__/page-renderer-migration.test.tsx +0 -78
  170. package/templates/apps/web/app/[locale]/how-to/page.tsx +0 -50
  171. package/templates/apps/web/app/[locale]/integrations/[slug]/page.tsx +0 -54
  172. package/templates/apps/web/app/[locale]/integrations/__tests__/hub-children.test.tsx +0 -38
  173. package/templates/apps/web/app/[locale]/integrations/__tests__/page-renderer-migration.test.tsx +0 -141
  174. package/templates/apps/web/app/[locale]/integrations/page.tsx +0 -49
  175. package/templates/apps/web/app/[locale]/launch-service/page.tsx +0 -44
  176. package/templates/apps/web/app/[locale]/newsletter/__tests__/page.test.tsx +0 -236
  177. package/templates/apps/web/app/[locale]/newsletter/page.tsx +0 -179
  178. package/templates/apps/web/app/[locale]/page.tsx +0 -147
  179. package/templates/apps/web/app/[locale]/partners/[slug]/page.tsx +0 -45
  180. package/templates/apps/web/app/[locale]/partners/__tests__/hub-children.test.tsx +0 -32
  181. package/templates/apps/web/app/[locale]/partners/__tests__/page-renderer-migration.test.tsx +0 -125
  182. package/templates/apps/web/app/[locale]/partners/page.tsx +0 -49
  183. package/templates/apps/web/app/[locale]/portfolio/[slug]/page.tsx +0 -46
  184. package/templates/apps/web/app/[locale]/portfolio/__tests__/hub-children.test.tsx +0 -38
  185. package/templates/apps/web/app/[locale]/portfolio/page.tsx +0 -50
  186. package/templates/apps/web/app/[locale]/pricing/[slug]/__tests__/page.test.tsx +0 -324
  187. package/templates/apps/web/app/[locale]/pricing/[slug]/page.tsx +0 -87
  188. package/templates/apps/web/app/[locale]/pricing/__tests__/__snapshots__/unconnected.test.tsx.snap +0 -7
  189. package/templates/apps/web/app/[locale]/pricing/__tests__/offerings.test.tsx +0 -605
  190. package/templates/apps/web/app/[locale]/pricing/__tests__/page.test.tsx +0 -219
  191. package/templates/apps/web/app/[locale]/pricing/__tests__/pricing-pages.test.tsx +0 -215
  192. package/templates/apps/web/app/[locale]/pricing/__tests__/unconnected.test.tsx +0 -282
  193. package/templates/apps/web/app/[locale]/pricing/page.tsx +0 -120
  194. package/templates/apps/web/app/[locale]/privacy/page.tsx +0 -40
  195. package/templates/apps/web/app/[locale]/products/[slug]/page.tsx +0 -50
  196. package/templates/apps/web/app/[locale]/products/__tests__/hub-children.test.tsx +0 -32
  197. package/templates/apps/web/app/[locale]/products/__tests__/page-renderer-migration.test.tsx +0 -141
  198. package/templates/apps/web/app/[locale]/products/page.tsx +0 -49
  199. package/templates/apps/web/app/[locale]/projects/[slug]/page.tsx +0 -37
  200. package/templates/apps/web/app/[locale]/projects/__tests__/hub-children.test.tsx +0 -32
  201. package/templates/apps/web/app/[locale]/projects/__tests__/page-renderer-migration.test.tsx +0 -157
  202. package/templates/apps/web/app/[locale]/projects/page.tsx +0 -49
  203. package/templates/apps/web/app/[locale]/purchase-policy/page.tsx +0 -49
  204. package/templates/apps/web/app/[locale]/resources/[slug]/page.tsx +0 -54
  205. package/templates/apps/web/app/[locale]/resources/__tests__/hub-children.test.tsx +0 -38
  206. package/templates/apps/web/app/[locale]/resources/__tests__/page-renderer-migration.test.tsx +0 -151
  207. package/templates/apps/web/app/[locale]/resources/page.tsx +0 -49
  208. package/templates/apps/web/app/[locale]/services/[slug]/[child]/page.tsx +0 -68
  209. package/templates/apps/web/app/[locale]/services/[slug]/page.tsx +0 -88
  210. package/templates/apps/web/app/[locale]/services/__tests__/hub-children.test.tsx +0 -158
  211. package/templates/apps/web/app/[locale]/services/__tests__/page-renderer-migration.test.tsx +0 -187
  212. package/templates/apps/web/app/[locale]/services/__tests__/service-detail-sections.test.tsx +0 -224
  213. package/templates/apps/web/app/[locale]/services/__tests__/service-families.test.tsx +0 -368
  214. package/templates/apps/web/app/[locale]/services/page.tsx +0 -71
  215. package/templates/apps/web/app/[locale]/software/[slug]/page.tsx +0 -49
  216. package/templates/apps/web/app/[locale]/software/__tests__/page-renderer-migration.test.tsx +0 -81
  217. package/templates/apps/web/app/[locale]/software/page.tsx +0 -49
  218. package/templates/apps/web/app/[locale]/team/[slug]/page.tsx +0 -45
  219. package/templates/apps/web/app/[locale]/team/__tests__/hub-children.test.tsx +0 -32
  220. package/templates/apps/web/app/[locale]/team/__tests__/team-routes.test.tsx +0 -161
  221. package/templates/apps/web/app/[locale]/team/page.tsx +0 -50
  222. package/templates/apps/web/app/[locale]/tech-articles/[slug]/page.tsx +0 -54
  223. package/templates/apps/web/app/[locale]/tech-articles/__tests__/page-renderer-migration.test.tsx +0 -82
  224. package/templates/apps/web/app/[locale]/tech-articles/page.tsx +0 -49
  225. package/templates/apps/web/app/[locale]/templates/[slug]/__tests__/page.test.tsx +0 -203
  226. package/templates/apps/web/app/[locale]/templates/[slug]/page.tsx +0 -81
  227. package/templates/apps/web/app/[locale]/templates/__tests__/page.test.tsx +0 -237
  228. package/templates/apps/web/app/[locale]/templates/page.tsx +0 -114
  229. package/templates/apps/web/app/[locale]/terms/page.tsx +0 -40
  230. package/templates/apps/web/app/[locale]/testimonials/__tests__/page-renderer-migration.test.tsx +0 -85
  231. package/templates/apps/web/app/[locale]/testimonials/page.tsx +0 -51
  232. package/templates/apps/web/app/[locale]/thanks/[slug]/__tests__/page.test.tsx +0 -136
  233. package/templates/apps/web/app/[locale]/thanks/[slug]/page.tsx +0 -39
  234. package/templates/apps/web/app/[locale]/unsubscribe/__tests__/unsubscribe-rsc-boundary.test.tsx +0 -226
  235. package/templates/apps/web/app/[locale]/unsubscribe/__tests__/unsubscribe.test.tsx +0 -217
  236. package/templates/apps/web/app/[locale]/unsubscribe/page.tsx +0 -106
  237. package/templates/apps/web/app/[locale]/unsubscribe/unsubscribe-button.tsx +0 -94
  238. package/templates/apps/web/app/[locale]/unsubscribe/unsubscribe.actions.ts +0 -55
  239. package/templates/apps/web/app/[locale]/vs/[slug]/__tests__/page.test.tsx +0 -100
  240. package/templates/apps/web/app/[locale]/vs/[slug]/page.tsx +0 -60
  241. package/templates/apps/web/app/[locale]/whitepapers/[slug]/page.tsx +0 -54
  242. package/templates/apps/web/app/[locale]/whitepapers/__tests__/page-renderer-migration.test.tsx +0 -82
  243. package/templates/apps/web/app/[locale]/whitepapers/page.tsx +0 -49
  244. package/templates/apps/web/app/[locale]/working-agreement/__tests__/page.test.tsx +0 -63
  245. package/templates/apps/web/app/[locale]/working-agreement/page.tsx +0 -41
  246. package/templates/apps/web/app/api/auth/[...all]/route.ts +0 -16
  247. package/templates/apps/web/app/api/auth/hub/__tests__/continuation.test.ts +0 -143
  248. package/templates/apps/web/app/api/auth/hub/__tests__/entry-routes.test.ts +0 -749
  249. package/templates/apps/web/app/api/auth/hub/authorize/__tests__/route.test.ts +0 -964
  250. package/templates/apps/web/app/api/auth/hub/authorize/route.ts +0 -390
  251. package/templates/apps/web/app/api/auth/hub/continuation.ts +0 -127
  252. package/templates/apps/web/app/api/auth/hub/continue/[ref]/__tests__/route.test.ts +0 -188
  253. package/templates/apps/web/app/api/auth/hub/continue/[ref]/route.ts +0 -53
  254. package/templates/apps/web/app/api/auth/hub/email/route.ts +0 -111
  255. package/templates/apps/web/app/api/auth/hub/entry-shared.ts +0 -163
  256. package/templates/apps/web/app/api/auth/hub/password/__tests__/return.test.ts +0 -86
  257. package/templates/apps/web/app/api/auth/hub/password/__tests__/route.test.ts +0 -368
  258. package/templates/apps/web/app/api/auth/hub/password/return.ts +0 -86
  259. package/templates/apps/web/app/api/auth/hub/password/route.ts +0 -171
  260. package/templates/apps/web/app/api/auth/hub/purchase/route.ts +0 -230
  261. package/templates/apps/web/app/api/auth/hub/purchase-link/route.ts +0 -174
  262. package/templates/apps/web/app/api/auth/hub/sign-up/route.ts +0 -60
  263. package/templates/apps/web/app/api/auth/hub/sign-up-evidence.ts +0 -97
  264. package/templates/apps/web/app/api/auth/mcp/__tests__/continuation.test.ts +0 -92
  265. package/templates/apps/web/app/api/auth/mcp/continuation.ts +0 -89
  266. package/templates/apps/web/app/api/auth/mcp/continue/[ref]/__tests__/route.test.ts +0 -59
  267. package/templates/apps/web/app/api/auth/mcp/continue/[ref]/route.ts +0 -41
  268. package/templates/apps/web/app/api/hub-session/__tests__/routes.test.ts +0 -1166
  269. package/templates/apps/web/app/api/hub-session/callback/route.ts +0 -134
  270. package/templates/apps/web/app/api/hub-session/email/route.ts +0 -125
  271. package/templates/apps/web/app/api/hub-session/one-tap/nonce/route.ts +0 -49
  272. package/templates/apps/web/app/api/hub-session/one-tap/route.ts +0 -106
  273. package/templates/apps/web/app/api/hub-session/open/route.ts +0 -111
  274. package/templates/apps/web/app/api/hub-session/password/return/route.ts +0 -69
  275. package/templates/apps/web/app/api/hub-session/password/route.ts +0 -106
  276. package/templates/apps/web/app/api/hub-session/sign-in/route.ts +0 -91
  277. package/templates/apps/web/app/api/hub-session/sign-out/route.ts +0 -54
  278. package/templates/apps/web/components/sign-out-trigger.tsx +0 -62
  279. package/templates/apps/web/lib/__tests__/auth-routes.test.ts +0 -140
  280. package/templates/apps/web/lib/__tests__/hub-children.fixtures.ts +0 -279
  281. package/templates/apps/web/lib/__tests__/route-family.test.ts +0 -57
  282. package/templates/apps/web/lib/__tests__/service-listing.test.ts +0 -111
  283. package/templates/apps/web/lib/__tests__/template-listing.test.ts +0 -158
  284. package/templates/apps/web/lib/auth-routes.ts +0 -125
  285. package/templates/apps/web/lib/hub-children.tsx +0 -351
  286. package/templates/apps/web/lib/hub-session/__tests__/hub-session.test.ts +0 -433
  287. package/templates/apps/web/lib/hub-session/__tests__/spoke-sign-in.test.tsx +0 -332
  288. package/templates/apps/web/lib/hub-session/config.ts +0 -110
  289. package/templates/apps/web/lib/hub-session/entry.ts +0 -238
  290. package/templates/apps/web/lib/hub-session/index.ts +0 -21
  291. package/templates/apps/web/lib/hub-session/one-tap.tsx +0 -148
  292. package/templates/apps/web/lib/hub-session/reseal.ts +0 -90
  293. package/templates/apps/web/lib/hub-session/seal.ts +0 -86
  294. package/templates/apps/web/lib/hub-session/session.ts +0 -298
  295. package/templates/apps/web/lib/hub-session/spoke-sign-in.tsx +0 -277
  296. package/templates/apps/web/lib/meet-placeholder.ts +0 -5
  297. package/templates/apps/web/lib/next-path.ts +0 -35
  298. package/templates/apps/web/lib/posting-title.ts +0 -39
  299. package/templates/apps/web/lib/route-family.ts +0 -69
  300. package/templates/apps/web/lib/service-listing.ts +0 -89
  301. package/templates/apps/web/lib/template-listing.ts +0 -169
  302. package/templates/apps/web/src/lib/__tests__/lead-write.test.ts +0 -187
  303. package/templates/apps/web/src/lib/lead-write.ts +0 -90
  304. /package/templates/apps/web/{app/[locale]/contact → lib}/__tests__/site-contact-lines.test.ts +0 -0
@@ -1,323 +0,0 @@
1
- "use client"; // Better Auth's client calls (signIn.social / signIn.email / $fetch) + error state
2
-
3
- /**
4
- * SignInCard — the /sign-in page's client island (#4984).
5
- *
6
- * Composes the shipped `AuthCard` block (`intent="sign-in"`, `footer="none"`)
7
- * and wires its provider buttons / password form to the Better Auth client
8
- * via the shared `useAuthCardFlow` hook (#6018 AC-3) — the same hook
9
- * `SignUpCard` next door uses, through its one module-scope
10
- * `createAuthClient()`. The page (RSC) decides providers +
11
- * method from auth-env and hands them in; this component never reads env
12
- * itself.
13
- *
14
- * The site's mark arrives as `logo` (#8790 D3) and renders centred in the
15
- * card; the shell draws no brand row.
16
- *
17
- * `footer="none"` drops AuthCard's "Not a member? Create an account"
18
- * cross-link; the page's `prospect` line ("Don't have an account? Sign up",
19
- * #9662) is the one route to `/sign-up`.
20
- *
21
- * Password path: `apps/web/auth.ts` does not enable `emailAndPassword` today,
22
- * so `signIn.email` is wired but inert (Better Auth answers with an error)
23
- * until an operator enables it server-side — the page only selects
24
- * `method="password"` when auth-env reports the "email" provider.
25
- *
26
- * Zero providers (method sso, providers []): the card renders in its inert
27
- * state — heading + `notConfiguredSubhead`, no buttons, no form. Never a
28
- * fabricated session.
29
- *
30
- * Error surface: AuthCard's `errors` prop is per-field. A failed provider
31
- * launch lands on `errors.email` — the social row sits inside the password
32
- * form beside the email field, so it renders there. The SSO body has no
33
- * fields at all, so for `method="sso"` the same message is rendered as an
34
- * `Alert` above the card instead.
35
- *
36
- * `forgot` (#6018 AC-1): the page passes `forgot="none"` when
37
- * `isResetAvailable()` is false, so the "Forgot password?" link never renders
38
- * a dead end — AuthCard's own default (`"link"`) assumes reset is wired.
39
- *
40
- * Email sign-in link (#7435 § D8): with `emailLink` true the card adds
41
- * AuthCard's `emailLink="form"` and POSTs the typed address to Better Auth's
42
- * `/sign-in/magic-link` through the shared client's `$fetch` — not the
43
- * `magicLinkClient()` plugin, so no ESM-only module enters the client graph
44
- * every `(auth)` and `(authed)` suite would then have to mock. The answer is
45
- * the same for an address with and without an account, so a success swaps to
46
- * a sent state that never names the address.
47
- *
48
- * Hinted email (#8757 D9): the page hands in `defaultEmail` (already checked
49
- * by `accountEmailHintSchema`); it reaches AuthCard as the starting value of
50
- * every email input. Absent → AuthCard's render is unchanged.
51
- *
52
- * Remembered method (#11095 D7): a provider launch writes its id to the
53
- * `ailk-sign-in-method` cookie (`remembered-method.ts`) before the launch; a
54
- * password submit or a sign-in-link request clears it. With `remembered` set
55
- * the card leads with that one provider ("Continue with Google", the SSO
56
- * stack's 44px button) and "Use another way" restores the full card. Absent,
57
- * the render is today's.
58
- */
59
-
60
- import {
61
- AuthBackLink,
62
- AuthCard,
63
- type AuthCardLabels,
64
- type AuthSubmitData,
65
- } from "@working-theory/ui/blocks";
66
- import { Alert, AlertDescription, Button } from "@working-theory/ui/primitives";
67
- import { useRef, useState, type ReactElement, type ReactNode } from "react";
68
-
69
- import { authClient, useAuthCardFlow } from "../use-auth-card-flow";
70
-
71
- import { rememberMethod } from "./remembered-method";
72
-
73
- /** The OAuth providers this page can launch — a subset of AuthCard's. */
74
- export type SignInProvider = "google" | "github";
75
-
76
- /** Translated copy for the email sign-in link flow (#7435 § D10). */
77
- export interface SignInEmailLinkLabels {
78
- sentHeading: string;
79
- sentSubhead: string;
80
- sentBody: string;
81
- backToSignIn: string;
82
- /** Any failed request other than a rate limit. */
83
- failed: string;
84
- /** A 429 from Better Auth's per-IP limit. */
85
- rateLimited: string;
86
- }
87
-
88
- export interface SignInCardProps {
89
- /** Active OAuth providers, exactly as auth-env reports them. */
90
- providers: SignInProvider[];
91
- /** "password" when the email provider is active; otherwise "sso". */
92
- method: "sso" | "password";
93
- /** Sanitised post-sign-in path (see `next-path.ts`). */
94
- next: string;
95
- /** Href for the card's "Forgot password?" link (#5963). */
96
- forgotHref?: string;
97
- /** "link" (AuthCard's default) unless password reset is unavailable (#6018). */
98
- forgot?: "link" | "none";
99
- /** Translated AuthCard labels (resolved server-side by the page). */
100
- labels: AuthCardLabels;
101
- /** Subhead shown when no provider is configured. */
102
- notConfiguredSubhead: string;
103
- /** Translated error copy. */
104
- errorLabels: { signInFailed: string; providerFailed: string };
105
- /** Offer "Email me a sign-in link" — `getActiveProviderIds()` has "magic-link". */
106
- emailLink: boolean;
107
- /** Where a failed link lands (`/sign-in?next=…`); Better Auth appends `?error`. */
108
- errorCallbackURL: string;
109
- /** The sent state's "Back to sign in" link. */
110
- signInHref: string;
111
- /** Fixed copy for a failed link (`?error=` mapped by the page), shown above the card. */
112
- linkNotice?: string;
113
- emailLinkLabels: SignInEmailLinkLabels;
114
- /** #8757 D9 — the validated `?email=` hint, the email inputs' starting value. */
115
- defaultEmail?: string;
116
- /** The site's mark, centred in the card at 48px (#8790 D3). */
117
- logo?: ReactNode;
118
- /** "← Back to <spoke>" when the visitor came from a registered spoke (#8790 D2). */
119
- backLink?: { href: string; label: string };
120
- /** The prospect line a site turns on (#8790 D3). */
121
- prospect?: { prompt: string; linkLabel: string; href: string };
122
- /** The acknowledgement sentence(s) at the card's foot (#8790 D6). */
123
- footnote?: ReactNode;
124
- /** #11095 D7 — the provider the person last launched, already parsed by the page. */
125
- remembered?: SignInProvider;
126
- /** The lead button's prefix in place of `labels.ssoPrefix` ("Continue with"). */
127
- continueWith?: string;
128
- /** The control under the lead card that shows every method ("Use another way"). */
129
- useAnotherWay?: string;
130
- }
131
-
132
- export function SignInCard({
133
- providers,
134
- method,
135
- next,
136
- forgotHref,
137
- forgot,
138
- labels,
139
- notConfiguredSubhead,
140
- errorLabels,
141
- emailLink,
142
- errorCallbackURL,
143
- signInHref,
144
- linkNotice,
145
- emailLinkLabels,
146
- defaultEmail,
147
- logo,
148
- backLink,
149
- prospect,
150
- footnote,
151
- remembered,
152
- continueWith,
153
- useAnotherWay,
154
- }: SignInCardProps): ReactElement {
155
- const { errors, providerError, launchProvider, submitPassword } =
156
- useAuthCardFlow(next, {
157
- providerFailed: errorLabels.providerFailed,
158
- passwordFailed: errorLabels.signInFailed,
159
- });
160
- const [emailLinkSent, setEmailLinkSent] = useState(false);
161
- const [emailLinkError, setEmailLinkError] = useState<string | null>(null);
162
- // One request at a time: a double-click would spend two of the per-IP and
163
- // per-address sends and mint two live tokens (code review).
164
- const emailLinkPending = useRef(false);
165
- const [expanded, setExpanded] = useState(false);
166
- const lead = remembered !== undefined && !expanded;
167
-
168
- const notConfigured =
169
- method === "sso" && providers.length === 0 && !emailLink;
170
- // One field, one action (#8790 D4): the sign-in link first when it is on,
171
- // the password as the in-place alternative when the email provider is on.
172
- const methods: ("magic-link" | "password")[] = [
173
- ...(emailLink ? (["magic-link"] as const) : []),
174
- ...(method === "password" ? (["password"] as const) : []),
175
- ];
176
-
177
- const launch = (provider: SignInProvider): void => {
178
- rememberMethod(provider);
179
- void launchProvider(provider);
180
- };
181
- const providerButtons = providers.map((provider) => ({
182
- provider,
183
- onClick: () => launch(provider),
184
- }));
185
-
186
- const handleSubmit = (data: AuthSubmitData): void => {
187
- rememberMethod(null);
188
- void submitPassword(
189
- authClient.signIn.email({
190
- email: data.email,
191
- password: data.password ?? "",
192
- callbackURL: next,
193
- }),
194
- );
195
- };
196
-
197
- const requestEmailLink = async (email: string): Promise<void> => {
198
- if (emailLinkPending.current) return;
199
- emailLinkPending.current = true;
200
- rememberMethod(null);
201
- setEmailLinkError(null);
202
- try {
203
- const { error } = await authClient.$fetch("/sign-in/magic-link", {
204
- method: "POST",
205
- body: { email, callbackURL: next, errorCallbackURL },
206
- });
207
- if (!error) {
208
- setEmailLinkSent(true);
209
- return;
210
- }
211
- setEmailLinkError(
212
- error.status === 429
213
- ? emailLinkLabels.rateLimited
214
- : emailLinkLabels.failed,
215
- );
216
- } catch {
217
- setEmailLinkError(emailLinkLabels.failed);
218
- } finally {
219
- emailLinkPending.current = false;
220
- }
221
- };
222
-
223
- if (emailLinkSent) {
224
- // Every string passed in, so no AuthCard English default — whose "Follow
225
- // the link we just sent" would contradict the neutral copy — renders. No
226
- // `sentTo`: the state must not confirm the address has an account.
227
- return (
228
- <div className="flex flex-col gap-4" data-testid="sign-in-page">
229
- <AuthCard
230
- intent="sent"
231
- footer="cross-link"
232
- signInHref={signInHref}
233
- labels={{
234
- sentHeading: emailLinkLabels.sentHeading,
235
- sentSubhead: emailLinkLabels.sentSubhead,
236
- sentBody: emailLinkLabels.sentBody,
237
- backToSignIn: emailLinkLabels.backToSignIn,
238
- }}
239
- />
240
- </div>
241
- );
242
- }
243
-
244
- return (
245
- /*
246
- * No page framing of its own (#5963): AuthShell owns the brand row, the
247
- * 400px column and the vertical rhythm. The `min-h-screen items-center
248
- * justify-center` wrapper this used to carry is exactly the "card centered
249
- * in empty space, first input at 470px" defect the auth route group fixes.
250
- */
251
- <div className="flex flex-col gap-4" data-testid="sign-in-page">
252
- {backLink ? <AuthBackLink href={backLink.href} label={backLink.label} /> : null}
253
- {(method === "sso" || lead) && providerError ? (
254
- <Alert variant="error" data-testid="sign-in-provider-error">
255
- <AlertDescription>{providerError}</AlertDescription>
256
- </Alert>
257
- ) : null}
258
- {linkNotice ? (
259
- <Alert variant="error" data-testid="sign-in-link-notice">
260
- <AlertDescription>{linkNotice}</AlertDescription>
261
- </Alert>
262
- ) : null}
263
- {lead ? (
264
- <>
265
- <AuthCard
266
- intent="sign-in"
267
- method="sso"
268
- footer="none"
269
- {...(logo !== undefined ? { logo } : {})}
270
- subhead=""
271
- {...(prospect !== undefined ? { prospect } : {})}
272
- {...(footnote !== undefined ? { footnote } : {})}
273
- providers={[
274
- { provider: remembered, onClick: () => launch(remembered) },
275
- ]}
276
- labels={{
277
- ...labels,
278
- ...(continueWith !== undefined
279
- ? { ssoPrefix: continueWith }
280
- : {}),
281
- }}
282
- />
283
- <Button
284
- variant="ghost"
285
- size="big"
286
- type="button"
287
- onClick={() => setExpanded(true)}
288
- data-testid="sign-in-use-another-way"
289
- >
290
- {useAnotherWay}
291
- </Button>
292
- </>
293
- ) : (
294
- <AuthCard
295
- intent="sign-in"
296
- method={method}
297
- footer="none"
298
- {...(logo !== undefined ? { logo } : {})}
299
- {...(forgotHref !== undefined ? { forgotHref } : {})}
300
- {...(forgot !== undefined ? { forgot } : {})}
301
- // The heading stands alone (#8790 D3): no subhead unless the card
302
- // is inert and must say why.
303
- subhead={notConfigured ? notConfiguredSubhead : ""}
304
- {...(prospect !== undefined ? { prospect } : {})}
305
- {...(footnote !== undefined ? { footnote } : {})}
306
- providers={providerButtons}
307
- onSubmit={handleSubmit}
308
- errors={
309
- emailLinkError ? { ...errors, emailLink: emailLinkError } : errors
310
- }
311
- labels={labels}
312
- {...(defaultEmail !== undefined ? { defaultEmail } : {})}
313
- {...(methods.length > 0 ? { methodSwitch: { methods } } : {})}
314
- {...(emailLink
315
- ? {
316
- onEmailLink: (email: string) => void requestEmailLink(email),
317
- }
318
- : {})}
319
- />
320
- )}
321
- </div>
322
- );
323
- }
@@ -1,93 +0,0 @@
1
- /**
2
- * The `SignInCard`'s translated copy, resolved on the server (#7435 § D9).
3
- *
4
- * One helper, so every `SignInCard` renders the SAME labels from the same
5
- * `signIn` keys — a second copy of this object would drift.
6
- *
7
- * The heading names the site — "Sign in to <site>" (#9662) — from
8
- * `SITE_NAME`, the deployment's own display name (env, else `_site.mdx`),
9
- * never from the request.
10
- *
11
- * Plain data only: the page hands this object to a client component, and a
12
- * function cannot cross that boundary (`/sign-in` resolves its "Back to
13
- * <spoke>" line itself).
14
- */
15
-
16
- import type { AuthCardLabels } from "@working-theory/ui/blocks";
17
- import { getTranslations } from "next-intl/server";
18
-
19
- import { SITE_NAME } from "../../../../lib/site-brand";
20
-
21
- import type { SignInEmailLinkLabels } from "./sign-in-card";
22
-
23
- export interface SignInCardText {
24
- labels: AuthCardLabels;
25
- /** The acknowledgement sentence's parts (#8790 D6; Terms + Privacy, #9662). */
26
- acknowledgement: {
27
- lead: string;
28
- terms: string;
29
- and: string;
30
- privacy: string;
31
- /** The sentence's closing mark — a message, so a locale can use its own. */
32
- end: string;
33
- };
34
- /** The prospect line toggling to /sign-up (#8790 D3; on by default, #9662). */
35
- prospect: { prompt: string; linkLabel: string };
36
- notConfiguredSubhead: string;
37
- errorLabels: { signInFailed: string; providerFailed: string };
38
- emailLinkLabels: SignInEmailLinkLabels;
39
- /** The notice for a link that failed verification (`?error=INVALID_TOKEN`). */
40
- emailLinkExpired: string;
41
- /** #11095 D7 — the remembered provider's button prefix ("Continue with"). */
42
- continueWith: string;
43
- /** #11095 D7 — the control that shows every method ("Use another way"). */
44
- useAnotherWay: string;
45
- }
46
-
47
- export async function resolveSignInCardText(
48
- locale: string,
49
- ): Promise<SignInCardText> {
50
- const t = await getTranslations({ locale, namespace: "signIn" });
51
- return {
52
- labels: {
53
- signInHeading: t("heading", { site: SITE_NAME }),
54
- ssoPrefix: t("ssoPrefix"),
55
- google: t("google"),
56
- github: t("github"),
57
- email: t("email"),
58
- password: t("password"),
59
- forgot: t("forgot"),
60
- signInSubmit: t("submit"),
61
- orContinue: t("orContinue"),
62
- emailLinkSubmit: t("emailLinkSubmit"),
63
- emailLinkDivider: t("emailLinkDivider"),
64
- useEmailLink: t("useEmailLink"),
65
- emailPlaceholder: t("emailPlaceholder"),
66
- },
67
- acknowledgement: {
68
- lead: t("acknowledgement"),
69
- terms: t("termsLink"),
70
- and: t("acknowledgementAnd"),
71
- privacy: t("privacyLink"),
72
- end: t("acknowledgementEnd"),
73
- },
74
- prospect: { prompt: t("prospectPrompt"), linkLabel: t("prospectLink") },
75
-
76
- notConfiguredSubhead: t("notConfiguredSubhead"),
77
- errorLabels: {
78
- signInFailed: t("signInFailed"),
79
- providerFailed: t("providerFailed"),
80
- },
81
- emailLinkLabels: {
82
- sentHeading: t("emailLinkSentHeading"),
83
- sentSubhead: t("emailLinkSentSubhead"),
84
- sentBody: t("emailLinkSentBody"),
85
- backToSignIn: t("emailLinkBack"),
86
- failed: t("emailLinkFailed"),
87
- rateLimited: t("emailLinkRateLimited"),
88
- },
89
- emailLinkExpired: t("emailLinkExpired"),
90
- continueWith: t("continueWith"),
91
- useAnotherWay: t("useAnotherWay"),
92
- };
93
- }