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,325 +0,0 @@
1
- "use server";
2
-
3
- /**
4
- * captureLeadAction — the job page's apply form (#8746 D4, D5). Paired, like
5
- * /contact's action of the same name, with the `ailkCaptureLead` MCP tool: an
6
- * application is a lead written to `POST /v1/leads/submit`, so an agent
7
- * applies through the same capture route. A distinct `*Action` name would
8
- * claim a capability with no MCP twin (`apps/mcp/__tests__/parity.test.ts`).
9
- *
10
- * The page binds the posting's slug as the first argument
11
- * (`captureLeadAction.bind(null, slug)`); it travels as the lead's hidden
12
- * `job` value and must be a slug. Bound arguments round-trip through the
13
- * browser, so it is attribution, never authorization.
14
- *
15
- * The lead (#8746 AC-5): source `flow:job-application` — always, so it is an
16
- * Inbox submission of the Job application magnet (a post from the built-in
17
- * form too: the magnet is seeded into every workspace and never deleted) —
18
- * the applicant's email, and a payload of `name` (first + last),
19
- * `first_name`, `last_name`, the optional `phone` and `linkedin_url`, any
20
- * extra field the owner added to the magnet (bounded as /contact bounds
21
- * them), and `job`. `name`, `job` and the read fields are spread after the
22
- * extras, so no form field overrides them. The write goes through the site's
23
- * lead writer (`src/lib/lead-write.ts`), which adds `payload.site` and
24
- * `payload.page` ("careers") and sends no `siteId`. An accepted post tells
25
- * the API so (`consent: true`, #9130): the hub requires it of a
26
- * `flow:job-application` lead and records `payload.consent` itself.
27
- *
28
- * #10054 D6 — a posting that names its own magnet binds `{ job, flow }`
29
- * instead: the flow, slug-checked, is written as `payload.applicationFlow`
30
- * beside `job`, and no form field overrides it. The source stays
31
- * `flow:job-application`, so the hub still records consent.
32
- *
33
- * Checks, before any write: the honeypot (a filled one answers success and
34
- * sends nothing); first name, last name and email required; a LinkedIn URL,
35
- * when given, an http(s) URL — a bare domain gains `https://`, the flow
36
- * engine's `url` idiom; the terms box ticked, as the form block requires; and
37
- * the per-visitor limit /contact runs, in /contact's own bucket so a visitor's
38
- * lead posts stay at 30 per 10 minutes however they are split (with no
39
- * readable client address, /contact's shared, wider bucket — never skipped,
40
- * #9967). Outcomes map as /contact's do: the API's
41
- * `lead_capture_not_configured` or an unreachable API is `unavailable`, any
42
- * other refusal the generic error.
43
- */
44
-
45
- import { visitorForwardHeaders } from "@working-theory/api-client";
46
- import {
47
- LEAD_CAPTURE_HONEYPOT,
48
- type LeadCaptureFormState,
49
- } from "@working-theory/ui";
50
- import {
51
- accountEmailHintSchema,
52
- flowLeadSource,
53
- flowSlugSchema,
54
- JOB_APPLICATION_FLOW_SLUG,
55
- leadSubmitNextSchema,
56
- } from "@working-theory/validation";
57
- import { cookies, headers } from "next/headers";
58
- import { getLocale, getTranslations } from "next-intl/server";
59
- import { z } from "zod";
60
-
61
- import { accountInviteHref } from "../../../../lib/account-invite";
62
- import { runBotCheck } from "../../../../lib/bot-check";
63
- import {
64
- consentVisitorHeader,
65
- readConsentVisitor,
66
- } from "../../../../lib/consent-visitor";
67
- import { writeLead } from "../../../../src/lib/lead-write";
68
- import { takeVisitorLimit } from "../../../../src/lib/rate-limit";
69
-
70
- const GENERIC_ERROR = "Something went wrong, please try again.";
71
- const RATE_LIMITED =
72
- "Too many applications from here. Please try again in a few minutes.";
73
- const CONSENT_REQUIRED = "Please accept the terms to send your application.";
74
-
75
- const RATE_LIMIT_MAX_CALLS = 30;
76
- const RATE_LIMIT_WINDOW_MS = 10 * 60 * 1000;
77
- /** Outside a request scope there is no address: the shared bucket. */
78
- const NO_HEADERS = { get: () => null };
79
-
80
- const SOURCE = flowLeadSource(JOB_APPLICATION_FLOW_SLUG);
81
- const JOB_SLUG_RE = /^[a-z0-9][a-z0-9-]{0,127}$/;
82
- const HAS_SCHEME_RE = /^[a-z][a-z0-9+.-]*:\/\//i;
83
-
84
- /** Field names the action reads itself, or writes — never copied from the form. */
85
- const RESERVED_FIELDS = new Set([
86
- "first_name",
87
- "last_name",
88
- "email",
89
- "phone",
90
- "linkedin_url",
91
- "consent",
92
- "name",
93
- "job",
94
- "applicationFlow",
95
- "source",
96
- LEAD_CAPTURE_HONEYPOT,
97
- ]);
98
- const MAX_EXTRA_FIELDS = 20;
99
- const MAX_EXTRA_FIELD_LENGTH = 2000;
100
-
101
- const optionalText = (max: number) =>
102
- z.preprocess(
103
- (v) => (typeof v === "string" && v.trim() !== "" ? v.trim() : undefined),
104
- z.string().max(max).optional(),
105
- );
106
-
107
- /** A LinkedIn URL: blank is absent; a bare domain gains `https://`; only http(s). */
108
- const linkedinUrl = z.preprocess(
109
- (v) => {
110
- if (typeof v !== "string" || v.trim() === "") return undefined;
111
- const value = v.trim();
112
- return HAS_SCHEME_RE.test(value) ? value : `https://${value}`;
113
- },
114
- z
115
- .string()
116
- .max(2000)
117
- .refine((value) => {
118
- try {
119
- const url = new URL(value);
120
- return (
121
- (url.protocol === "https:" || url.protocol === "http:") &&
122
- url.hostname.includes(".") &&
123
- // No credentials: `https://linkedin.com@evil.example/` would show
124
- // the operator a LinkedIn-looking link to another host.
125
- url.username === "" &&
126
- url.password === ""
127
- );
128
- } catch {
129
- return false;
130
- }
131
- }, "Enter a valid URL.")
132
- .optional(),
133
- );
134
-
135
- const applicationSchema = z.object({
136
- first_name: z.string().trim().min(1, "Enter your first name.").max(100),
137
- last_name: z.string().trim().min(1, "Enter your last name.").max(100),
138
- email: z.string().trim().email("Enter a valid email address.").max(254),
139
- phone: optionalText(32),
140
- linkedin_url: linkedinUrl,
141
- });
142
-
143
- /** The extra fields, or `null` over the bounds. Files and `$ACTION_…` keys are skipped. */
144
- function extraFields(formData: FormData): Record<string, string> | null {
145
- const extra: Record<string, string> = {};
146
- let count = 0;
147
- for (const [key, value] of formData.entries()) {
148
- if (RESERVED_FIELDS.has(key) || key.startsWith("$ACTION")) continue;
149
- if (typeof value !== "string") continue;
150
- if (value.length > MAX_EXTRA_FIELD_LENGTH) return null;
151
- if (!Object.hasOwn(extra, key)) count += 1;
152
- if (count > MAX_EXTRA_FIELDS) return null;
153
- extra[key] = value;
154
- }
155
- return extra;
156
- }
157
-
158
- function isNotConfigured(res: { status: number; body: unknown }): boolean {
159
- return (
160
- res.status === 503 &&
161
- typeof res.body === "object" &&
162
- res.body !== null &&
163
- (res.body as { error?: unknown }).error === "lead_capture_not_configured"
164
- );
165
- }
166
-
167
- function isApiUnreachable(res: { status: number }): boolean {
168
- return res.status === 0 || res.status === 502 || res.status === 504;
169
- }
170
-
171
- const field = (formData: FormData, name: string): unknown =>
172
- formData.get(name) ?? undefined;
173
-
174
- /**
175
- * #8771 D7 — the thank-you's "Track this in your account" link, when the API
176
- * answered `next: { completion: "invite" }` and this site can build one; else
177
- * exactly `{ kind: "success" }`. The application is already written, so a
178
- * refusal or a throw anywhere here is still a success — an error would invite
179
- * a duplicate application.
180
- */
181
- async function successState(
182
- next: unknown,
183
- email: string,
184
- ): Promise<LeadCaptureFormState> {
185
- try {
186
- const parsed = leadSubmitNextSchema.safeParse(next);
187
- if (!parsed.success || parsed.data.completion !== "invite") {
188
- return { kind: "success" };
189
- }
190
- const hint = accountEmailHintSchema.safeParse(email);
191
- if (!hint.success) return { kind: "success" };
192
- const locale = await getLocale();
193
- const href = accountInviteHref(locale, hint.data);
194
- if (href === null) return { kind: "success" };
195
- const t = await getTranslations({ locale, namespace: "contact" });
196
- return { kind: "success", next: { href, label: t("trackInAccount") } };
197
- } catch {
198
- return { kind: "success" };
199
- }
200
- }
201
-
202
- /**
203
- * The bound posting: today's string `job`, or `{ job, flow }` (D6). `null`
204
- * for anything else — a bound argument comes back from the browser, so its
205
- * type is checked, not only its text.
206
- */
207
- function readPosting(posting: unknown): { job: string; applicationFlow?: string } | null {
208
- if (typeof posting === "string") return JOB_SLUG_RE.test(posting) ? { job: posting } : null;
209
- if (typeof posting !== "object" || posting === null) return null;
210
- const { job, flow } = posting as { job?: unknown; flow?: unknown };
211
- if (typeof job !== "string" || !JOB_SLUG_RE.test(job)) return null;
212
- if (!flowSlugSchema.safeParse(flow).success) return null;
213
- return { job, applicationFlow: flow as string };
214
- }
215
-
216
- export async function captureLeadAction(
217
- posting: string | { job: string; flow: string },
218
- _prevState: LeadCaptureFormState,
219
- formData: FormData,
220
- ): Promise<LeadCaptureFormState> {
221
- const honeypot = formData.get(LEAD_CAPTURE_HONEYPOT);
222
- if (typeof honeypot === "string" && honeypot !== "")
223
- return { kind: "success" };
224
-
225
- const attribution = readPosting(posting);
226
- if (attribution === null) {
227
- return { kind: "error", message: GENERIC_ERROR };
228
- }
229
- const { job, applicationFlow } = attribution;
230
-
231
- const fieldErrors: Record<string, string> = {};
232
- if (formData.get("consent") !== "true")
233
- fieldErrors.consent = CONSENT_REQUIRED;
234
-
235
- const parsed = applicationSchema.safeParse({
236
- first_name: field(formData, "first_name") ?? "",
237
- last_name: field(formData, "last_name") ?? "",
238
- email: field(formData, "email") ?? "",
239
- phone: field(formData, "phone"),
240
- linkedin_url: field(formData, "linkedin_url"),
241
- });
242
- if (!parsed.success) {
243
- for (const issue of parsed.error.issues) {
244
- const name = String(issue.path[0] ?? "form");
245
- fieldErrors[name] ??= issue.message;
246
- }
247
- }
248
- if (!parsed.success || Object.keys(fieldErrors).length > 0) {
249
- return { kind: "error", fieldErrors };
250
- }
251
-
252
- const extra = extraFields(formData);
253
- if (extra === null) return { kind: "error", message: GENERIC_ERROR };
254
-
255
- const { first_name, last_name, email, phone, linkedin_url } = parsed.data;
256
- const payload = {
257
- ...extra,
258
- name: `${first_name} ${last_name}`,
259
- first_name,
260
- last_name,
261
- ...(phone !== undefined && { phone }),
262
- ...(linkedin_url !== undefined && { linkedin_url }),
263
- job,
264
- ...(applicationFlow !== undefined && { applicationFlow }),
265
- };
266
-
267
- let requestHeaders: Awaited<ReturnType<typeof headers>> | undefined;
268
- try {
269
- requestHeaders = await headers();
270
- } catch {
271
- // No request scope — no forwarding, and the visitor is "unknown".
272
- }
273
-
274
- if (
275
- !takeVisitorLimit(
276
- "contact",
277
- requestHeaders ?? NO_HEADERS,
278
- RATE_LIMIT_MAX_CALLS,
279
- RATE_LIMIT_WINDOW_MS,
280
- ).allowed
281
- ) {
282
- return { kind: "error", message: RATE_LIMITED };
283
- }
284
-
285
- let init: { headers: Record<string, string> } | undefined;
286
- if (requestHeaders) {
287
- const forwarded = visitorForwardHeaders(
288
- requestHeaders,
289
- process.env.AILK_VISITOR_FORWARD_KEY,
290
- );
291
- if (forwarded) init = { headers: forwarded };
292
- }
293
- try {
294
- const visitorId = readConsentVisitor(await cookies());
295
- if (visitorId)
296
- init = {
297
- headers: {
298
- ...(init?.headers ?? {}),
299
- ...consentVisitorHeader(visitorId),
300
- },
301
- };
302
- } catch {
303
- // No request scope — submit with no visitor-link header.
304
- }
305
-
306
- // #9255 D4 — the spoke edge's bot check, immediately before the write.
307
- const botCheck = await runBotCheck({
308
- source: "bot-check",
309
- target: "captureLeadAction",
310
- scope: "write",
311
- });
312
- if (botCheck === "bot") return { kind: "error", message: GENERIC_ERROR };
313
- if (botCheck === "unavailable") return { kind: "unavailable" };
314
-
315
- const res = await writeLead(
316
- { source: SOURCE, email, page: "careers", consent: true, payload },
317
- init,
318
- );
319
- if (!res.ok) {
320
- if (isNotConfigured(res) || isApiUnreachable(res))
321
- return { kind: "unavailable" };
322
- return { kind: "error", message: GENERIC_ERROR };
323
- }
324
- return successState(res.body.next, email);
325
- }
@@ -1,120 +0,0 @@
1
- /**
2
- * jobApplicationFormFromConfig — the Job application magnet's field step, as
3
- * the shared `LeadCaptureForm` block renders it on a job page (#8746 D5).
4
- *
5
- * Reads the config's first step, which must be a `field` step holding fields
6
- * named `first_name`, `last_name` and `email` (what the apply action needs);
7
- * anything else answers `null` and the page renders the built-in form, the
8
- * seeded config itself (`jobApplicationFormFallback`).
9
- *
10
- * Each `text`, `email`, `tel`, `url`, `textarea` or `select` field is mapped
11
- * in order. First and last name sit side by side, then email and phone; every
12
- * other field runs full width. `consent` and `address` fields are not
13
- * rendered: the block draws its own terms box, labelled with the step's first
14
- * `consent` field's label when it has one (as /contact does). The step's
15
- * `copy.title` heads the section and its `copy.cta` is the submit label — or,
16
- * when step 1 has none, the last field step's (#8840 D3: the two-step seed
17
- * carries "Submit application" on step 2 only).
18
- *
19
- * Copy resolves with the one LocalizedString rule every flow surface shares
20
- * (`resolveLocalizedString`). Pure: no fetch, no React.
21
- */
22
- import type { ContactFormField } from "@working-theory/ui";
23
- import {
24
- jobApplicationFlowConfig,
25
- resolveLocalizedString,
26
- type FlowConfig,
27
- } from "@working-theory/validation";
28
-
29
- export interface JobApplicationFormView {
30
- /** The step's `copy.title`. */
31
- title: string;
32
- fields: ContactFormField[];
33
- /** The step's first consent field's label — `[Label](key)` tokens intact. */
34
- consentStatement?: string;
35
- /** The step's `copy.cta`, else the last field step's (#8840 D3). */
36
- submitLabel?: string;
37
- }
38
-
39
- type FieldStep = Extract<FlowConfig["steps"][number], { type: "field" }>;
40
- type FieldDef = FieldStep["fields"][number];
41
-
42
- const RENDERED_TYPES = [
43
- "text",
44
- "email",
45
- "tel",
46
- "url",
47
- "textarea",
48
- "select",
49
- ] as const;
50
- type RenderedType = (typeof RENDERED_TYPES)[number];
51
-
52
- const REQUIRED_NAMES = ["first_name", "last_name", "email"] as const;
53
- const PAIRED_NAMES: ReadonlySet<string> = new Set([
54
- "first_name",
55
- "last_name",
56
- "email",
57
- "phone",
58
- ]);
59
-
60
- function isRendered(type: FieldDef["inputType"]): type is RenderedType {
61
- return (RENDERED_TYPES as readonly string[]).includes(type);
62
- }
63
-
64
- export function jobApplicationFormFromConfig(
65
- config: FlowConfig,
66
- locale: string,
67
- ): JobApplicationFormView | null {
68
- const step = config.steps[0];
69
- if (step?.type !== "field") return null;
70
- const names = new Set(step.fields.map((f) => f.name));
71
- if (!REQUIRED_NAMES.every((name) => names.has(name))) return null;
72
-
73
- const resolve = (value: Record<string, string>): string =>
74
- resolveLocalizedString(value, locale, config.defaultLocale);
75
-
76
- const fields: ContactFormField[] = [];
77
- for (const field of step.fields) {
78
- if (!isRendered(field.inputType)) continue;
79
- fields.push({
80
- name: field.name,
81
- type: field.inputType,
82
- label: resolve(field.copy.label),
83
- required: field.required ?? false,
84
- ...(field.copy.placeholder !== undefined && {
85
- placeholder: resolve(field.copy.placeholder),
86
- }),
87
- ...(field.copy.help !== undefined && {
88
- helpText: resolve(field.copy.help),
89
- }),
90
- ...(field.options !== undefined && {
91
- options: field.options.map((o) => ({
92
- value: o.value,
93
- label: resolve(o.label),
94
- })),
95
- }),
96
- colSpan: PAIRED_NAMES.has(field.name) ? 1 : 2,
97
- });
98
- }
99
-
100
- const consent = step.fields.find((f) => f.inputType === "consent");
101
- const cta =
102
- step.copy.cta ??
103
- config.steps.filter((s): s is FieldStep => s.type === "field").at(-1)?.copy.cta;
104
- return {
105
- title: resolve(step.copy.title),
106
- fields,
107
- ...(consent !== undefined && {
108
- consentStatement: resolve(consent.copy.label),
109
- }),
110
- ...(cta !== undefined && { submitLabel: resolve(cta) }),
111
- };
112
- }
113
-
114
- /** The built-in form: the seeded magnet's own config. */
115
- export function jobApplicationFormFallback(
116
- locale: string,
117
- ): JobApplicationFormView {
118
- // The seeded config always maps — its test pins first_name, last_name, email.
119
- return jobApplicationFormFromConfig(jobApplicationFlowConfig, locale)!;
120
- }
@@ -1,73 +0,0 @@
1
- // JobPosting detail page. Reads the JobPosting MDX for the given slug, renders via
2
- // @working-theory/page-renderer, and emits a JSON-LD <script>. Unknown slugs 404 through renderPage.
3
- // Careers list at /careers links here; each job posting lives at /careers/<slug>.
4
- //
5
- // Under the posting, inside <main>, an Apply button (#8849 D8) opens
6
- // /careers/<slug>/apply — the multi-step walk where the `signal-collectors`
7
- // module is present (#8840 D11), else the Free apply page,
8
- // careers/[slug]/[action] (#8849 D7), which draws the one-step application
9
- // form this page used to draw under `#apply`. The posting's JSON-LD
10
- // ApplyAction targets the same URL (#8849 D3). The page makes no hub read.
11
- import type { getMdxSource as defaultGetMdxSource } from "@working-theory/page-renderer";
12
- import {
13
- getMdxSource as loadMdxSource,
14
- renderPage,
15
- renderPageMetadata,
16
- } from "@working-theory/page-renderer";
17
- import { Button, Container, Link, localeHref } from "@working-theory/ui";
18
- import type { Metadata } from "next";
19
- import { getTranslations } from "next-intl/server";
20
- import type { ReactElement } from "react";
21
-
22
- interface Props {
23
- params: Promise<{ locale: string; slug: string }>;
24
- getMdxSource?: typeof defaultGetMdxSource;
25
- }
26
-
27
- export async function generateMetadata({
28
- params,
29
- }: Pick<Props, "params">): Promise<Metadata> {
30
- const { locale, slug } = await params;
31
- return renderPageMetadata({ type: "JobPosting", slug, locale });
32
- }
33
-
34
- export default async function Page({
35
- params,
36
- getMdxSource,
37
- }: Props): Promise<ReactElement> {
38
- const { locale, slug } = await params;
39
- // A page that composes `sections[]` renders them (JSON-LD is built from
40
- // the same sections); a prose page renders its MDX body — the rule
41
- // /vs/[slug] applies (#10122).
42
- const source = await (getMdxSource ?? loadMdxSource)(
43
- "JobPosting",
44
- slug,
45
- locale,
46
- );
47
- const composed =
48
- source !== null &&
49
- Array.isArray((source.frontmatter as { sections?: unknown[] }).sections) &&
50
- ((source.frontmatter as { sections?: unknown[] }).sections?.length ?? 0) >
51
- 0;
52
- const t = await getTranslations({ locale, namespace: "careers" });
53
- return renderPage({
54
- type: "JobPosting",
55
- slug,
56
- locale,
57
- ...(composed ? {} : { bodyMode: "mdx-body" as const }),
58
- trailing: (
59
- <Container className="pb-section">
60
- <Button asChild size="big">
61
- <Link
62
- href={localeHref(locale, `/careers/${slug}/apply`)}
63
- variant="bare"
64
- data-testid="job-apply-cta"
65
- >
66
- {t("apply")}
67
- </Link>
68
- </Button>
69
- </Container>
70
- ),
71
- ...(getMdxSource !== undefined && { getMdxSource }),
72
- });
73
- }