create-ailk 0.37.1 → 0.38.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 (230) hide show
  1. package/README.md +129 -0
  2. package/component-catalog.json +44 -6
  3. package/component-catalog.md +6 -5
  4. package/dist/add-module.js +16 -1
  5. package/dist/add-route.d.ts +2 -2
  6. package/dist/add-route.js +18 -11
  7. package/dist/cli.js +52 -0
  8. package/dist/declined-routes.d.ts +13 -0
  9. package/dist/declined-routes.js +74 -0
  10. package/dist/derive-architecture.d.ts +0 -6
  11. package/dist/derive-architecture.js +9 -15
  12. package/dist/index.d.ts +1 -0
  13. package/dist/index.js +3 -0
  14. package/dist/language-import.d.ts +93 -0
  15. package/dist/language-import.js +270 -43
  16. package/dist/lib/import-mdx.js +1 -1
  17. package/dist/lib/scaffold-render-sweep.d.ts +6 -3
  18. package/dist/lib/scaffold-render-sweep.js +8 -4
  19. package/dist/migrate-content.d.ts +6 -2
  20. package/dist/migrate-content.js +62 -5
  21. package/dist/module-architecture.js +139 -103
  22. package/dist/paid-sections.d.ts +13 -0
  23. package/dist/paid-sections.js +35 -5
  24. package/dist/programmatic.js +6 -16
  25. package/dist/remove-module.js +67 -0
  26. package/dist/routes.d.ts +103 -0
  27. package/dist/routes.js +708 -0
  28. package/dist/site-manifest.js +1 -1
  29. package/dist/site-roster.d.ts +2 -1
  30. package/dist/site-roster.js +30 -8
  31. package/dist/spoke-checkout.d.ts +28 -27
  32. package/dist/spoke-checkout.js +71 -102
  33. package/dist/surfaces.d.ts +18 -0
  34. package/dist/surfaces.js +47 -282
  35. package/dist/sync-routes.d.ts +14 -1
  36. package/dist/sync-routes.js +86 -5
  37. package/dist/topology.d.ts +15 -1
  38. package/dist/topology.js +20 -4
  39. package/dist/update.d.ts +17 -2
  40. package/dist/update.js +480 -77
  41. package/package.json +3 -3
  42. package/templates/README.md +1 -1
  43. package/templates/apps/mcp/CLAUDE.md +5 -3
  44. package/templates/apps/web/CLAUDE.md +62 -20
  45. package/templates/apps/web/account.config.tsx +101 -0
  46. package/templates/apps/web/app/[locale]/(authed)/account/appointments/[slug]/page.tsx +3 -161
  47. package/templates/apps/web/app/[locale]/(authed)/account/appointments/page.tsx +3 -139
  48. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/page.tsx +3 -406
  49. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/versions/[version]/file/route.ts +2 -190
  50. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/page.tsx +3 -182
  51. package/templates/apps/web/app/[locale]/(authed)/account/billing/page.tsx +8 -420
  52. package/templates/apps/web/app/[locale]/(authed)/account/connect/page.tsx +1 -1
  53. package/templates/apps/web/app/[locale]/(authed)/account/general/page.tsx +8 -214
  54. package/templates/apps/web/app/[locale]/(authed)/account/inbox/[kind]/[id]/page.tsx +8 -115
  55. package/templates/apps/web/app/[locale]/(authed)/account/inbox/message/[id]/file/route.ts +2 -80
  56. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/page.tsx +8 -121
  57. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/page.tsx +3 -154
  58. package/templates/apps/web/app/[locale]/(authed)/account/layout.tsx +7 -149
  59. package/templates/apps/web/app/[locale]/(authed)/account/notifications/page.tsx +3 -143
  60. package/templates/apps/web/app/[locale]/(authed)/account/onboarding/page.tsx +3 -126
  61. package/templates/apps/web/app/[locale]/(authed)/account/page.tsx +8 -302
  62. package/templates/apps/web/app/[locale]/(authed)/account/privacy/export/route.ts +2 -102
  63. package/templates/apps/web/app/[locale]/(authed)/account/privacy/page.tsx +3 -240
  64. package/templates/apps/web/app/[locale]/(authed)/account/security/page.tsx +3 -131
  65. package/templates/apps/web/app/[locale]/(authed)/account/settings/page.tsx +2 -24
  66. package/templates/apps/web/app/[locale]/(authed)/account/support/page.tsx +3 -60
  67. package/templates/apps/web/app/[locale]/layout.tsx +45 -28
  68. package/templates/apps/web/app/apple-icon.tsx +72 -0
  69. package/templates/apps/web/app/llms.txt/__tests__/site-listing.test.ts +22 -12
  70. package/templates/apps/web/app/og/__tests__/__snapshots__/card.test.tsx.snap +3 -0
  71. package/templates/apps/web/app/og/__tests__/card.test.tsx +129 -0
  72. package/templates/apps/web/app/og/__tests__/route.test.ts +3 -4
  73. package/templates/apps/web/app/og/route.tsx +155 -72
  74. package/templates/apps/web/app/sitemap.xml/__tests__/site-listing.test.ts +12 -0
  75. package/templates/apps/web/i18n/request.ts +44 -1
  76. package/templates/apps/web/jest.config.cjs +13 -1
  77. package/templates/apps/web/lib/__tests__/auth-phone.test.ts +11 -0
  78. package/templates/apps/web/lib/__tests__/fixtures/site-topology.ts +70 -0
  79. package/templates/apps/web/lib/__tests__/nav-label-keys.test.ts +14 -0
  80. package/templates/apps/web/lib/__tests__/profile-back-link.test.ts +148 -61
  81. package/templates/apps/web/lib/__tests__/served-pages.test.ts +77 -0
  82. package/templates/apps/web/lib/__tests__/server-api.test.ts +37 -5
  83. package/templates/apps/web/lib/__tests__/structured-data.test.tsx +26 -13
  84. package/templates/apps/web/lib/listings.tsx +2 -2
  85. package/templates/apps/web/lib/nav-label-keys.ts +16 -2
  86. package/templates/apps/web/lib/paid-section-contracts.ts +35 -6
  87. package/templates/apps/web/lib/paid-sections.generated.ts +8 -0
  88. package/templates/apps/web/lib/profile-back-link.ts +105 -32
  89. package/templates/apps/web/lib/served-pages.ts +95 -0
  90. package/templates/apps/web/lib/site-brand.tsx +3 -5
  91. package/templates/apps/web/messages/en.json +8 -684
  92. package/templates/apps/web/middleware.ts +3 -1
  93. package/templates/apps/web/next.config.mjs +27 -0
  94. package/templates/apps/web/package.json +1 -0
  95. package/templates/customizations.yaml +9 -0
  96. package/templates/package.json +3 -1
  97. package/templates/tools/lint-architecture.ts +164 -11
  98. package/versions.json +48 -47
  99. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/account-frame-sign-out.test.tsx +0 -175
  100. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/agreements-prompt.test.tsx +0 -301
  101. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/billing.test.tsx +0 -515
  102. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/general.test.tsx +0 -883
  103. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/hub-mode.test.tsx +0 -758
  104. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/item.test.tsx +0 -264
  105. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/layout-sign-out.test.tsx +0 -167
  106. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/layout.test.tsx +0 -730
  107. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/new-menu.test.tsx +0 -355
  108. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/new-popups.test.tsx +0 -97
  109. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/notifications.test.tsx +0 -375
  110. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/onboarding.test.tsx +0 -323
  111. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/page.test.tsx +0 -1208
  112. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/popups.test.tsx +0 -418
  113. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/privacy.test.tsx +0 -462
  114. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/rich-translator.ts +0 -63
  115. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/security.test.tsx +0 -406
  116. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/settings.test.tsx +0 -93
  117. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/support.test.tsx +0 -208
  118. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/thread.test.tsx +0 -340
  119. package/templates/apps/web/app/[locale]/(authed)/account/account-data.ts +0 -182
  120. package/templates/apps/web/app/[locale]/(authed)/account/account-frame.tsx +0 -353
  121. package/templates/apps/web/app/[locale]/(authed)/account/actions.ts +0 -57
  122. package/templates/apps/web/app/[locale]/(authed)/account/agreements-actions.ts +0 -58
  123. package/templates/apps/web/app/[locale]/(authed)/account/agreements-gate.ts +0 -61
  124. package/templates/apps/web/app/[locale]/(authed)/account/agreements-prompt.tsx +0 -184
  125. package/templates/apps/web/app/[locale]/(authed)/account/appointments/__tests__/page.test.tsx +0 -426
  126. package/templates/apps/web/app/[locale]/(authed)/account/appointments/appointments-data.ts +0 -76
  127. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/pay-form.tsx +0 -65
  128. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/review-form.tsx +0 -172
  129. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/file-route.test.ts +0 -333
  130. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/page.test.tsx +0 -936
  131. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/pay.test.tsx +0 -193
  132. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/review.test.tsx +0 -476
  133. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/artifact-actions.ts +0 -184
  134. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/artifact-data.ts +0 -197
  135. package/templates/apps/web/app/[locale]/(authed)/account/billing/__tests__/offerings.test.ts +0 -99
  136. package/templates/apps/web/app/[locale]/(authed)/account/billing/offerings.ts +0 -123
  137. package/templates/apps/web/app/[locale]/(authed)/account/billing-source.ts +0 -303
  138. package/templates/apps/web/app/[locale]/(authed)/account/components/request-quote.tsx +0 -274
  139. package/templates/apps/web/app/[locale]/(authed)/account/error-row.tsx +0 -35
  140. package/templates/apps/web/app/[locale]/(authed)/account/for-you-labels.ts +0 -36
  141. package/templates/apps/web/app/[locale]/(authed)/account/general/__tests__/phone-verification.test.tsx +0 -215
  142. package/templates/apps/web/app/[locale]/(authed)/account/general/__tests__/seam-imports.test.ts +0 -65
  143. package/templates/apps/web/app/[locale]/(authed)/account/general/account-name.ts +0 -36
  144. package/templates/apps/web/app/[locale]/(authed)/account/general/billing-anchor.tsx +0 -27
  145. package/templates/apps/web/app/[locale]/(authed)/account/general/contact-actions.ts +0 -149
  146. package/templates/apps/web/app/[locale]/(authed)/account/general/contact-details.tsx +0 -42
  147. package/templates/apps/web/app/[locale]/(authed)/account/general/deletion-request.tsx +0 -132
  148. package/templates/apps/web/app/[locale]/(authed)/account/general/phone-actions.ts +0 -122
  149. package/templates/apps/web/app/[locale]/(authed)/account/general/phone-verification.tsx +0 -215
  150. package/templates/apps/web/app/[locale]/(authed)/account/general/photo-actions.ts +0 -73
  151. package/templates/apps/web/app/[locale]/(authed)/account/general/profile-form.tsx +0 -107
  152. package/templates/apps/web/app/[locale]/(authed)/account/general/profile-source.ts +0 -87
  153. package/templates/apps/web/app/[locale]/(authed)/account/inbox/message/[id]/file/__tests__/route.test.ts +0 -215
  154. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/member-thread-composer.tsx +0 -43
  155. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/thread-data.ts +0 -88
  156. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/thread-write.ts +0 -31
  157. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/__tests__/invitation-id.test.ts +0 -35
  158. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/__tests__/page.test.tsx +0 -266
  159. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/actions.ts +0 -116
  160. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/invitation-id.ts +0 -12
  161. package/templates/apps/web/app/[locale]/(authed)/account/new-actions.ts +0 -219
  162. package/templates/apps/web/app/[locale]/(authed)/account/new-menu.tsx +0 -365
  163. package/templates/apps/web/app/[locale]/(authed)/account/new-popups.tsx +0 -86
  164. package/templates/apps/web/app/[locale]/(authed)/account/onboarding/actions.ts +0 -120
  165. package/templates/apps/web/app/[locale]/(authed)/account/onboarding/onboarding-form.tsx +0 -322
  166. package/templates/apps/web/app/[locale]/(authed)/account/privacy/__tests__/export-route.test.ts +0 -173
  167. package/templates/apps/web/app/[locale]/(authed)/account/privacy/actions.ts +0 -103
  168. package/templates/apps/web/app/[locale]/(authed)/account/profile-actions.ts +0 -116
  169. package/templates/apps/web/app/[locale]/(authed)/account/retry-button.tsx +0 -27
  170. package/templates/apps/web/app/[locale]/(authed)/account/security/__tests__/hub-variant.test.tsx +0 -258
  171. package/templates/apps/web/app/[locale]/(authed)/account/security/security-panel.tsx +0 -130
  172. package/templates/apps/web/app/[locale]/(authed)/account/security/security-source.ts +0 -92
  173. package/templates/apps/web/app/[locale]/(authed)/account/settings-frame.tsx +0 -121
  174. package/templates/apps/web/app/[locale]/(authed)/account/sign-in-method.ts +0 -37
  175. package/templates/apps/web/app/[locale]/(authed)/account/support/support-form.tsx +0 -98
  176. package/templates/apps/web/app/[locale]/(authed)/account/support-actions.ts +0 -100
  177. package/templates/apps/web/app/[locale]/checkout/__tests__/pages.test.tsx +0 -139
  178. package/templates/apps/web/app/[locale]/checkout/__tests__/thank-you-account.test.tsx +0 -146
  179. package/templates/apps/web/app/[locale]/checkout/thank-you/page.tsx +0 -114
  180. package/templates/apps/web/app/[locale]/checkout/unavailable/page.tsx +0 -51
  181. package/templates/apps/web/app/[locale]/flows/[slug]/FlowStepperClient.tsx +0 -614
  182. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.count.test.tsx +0 -43
  183. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.deliverable.test.tsx +0 -214
  184. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.ending.test.tsx +0 -197
  185. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.invite.test.tsx +0 -286
  186. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.permalink.test.tsx +0 -520
  187. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.test.tsx +0 -376
  188. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.thanks-by-tier.test.tsx +0 -306
  189. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/account-invite.actions.test.ts +0 -69
  190. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/flow.actions.test.ts +0 -398
  191. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/magnet-page.test.tsx +0 -704
  192. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/save.actions.test.ts +0 -173
  193. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/two-route-tool.test.tsx +0 -141
  194. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/verify.test.tsx +0 -249
  195. package/templates/apps/web/app/[locale]/flows/[slug]/account-invite.actions.ts +0 -35
  196. package/templates/apps/web/app/[locale]/flows/[slug]/email-moment.ts +0 -92
  197. package/templates/apps/web/app/[locale]/flows/[slug]/flow.actions.ts +0 -177
  198. package/templates/apps/web/app/[locale]/flows/[slug]/magnet-page.tsx +0 -472
  199. package/templates/apps/web/app/[locale]/flows/[slug]/page.tsx +0 -48
  200. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/LevelChart.tsx +0 -100
  201. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsCard.tsx +0 -99
  202. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsClient.tsx +0 -820
  203. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsEmailStep.tsx +0 -203
  204. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/ResultsClient.no-commerce.test.tsx +0 -194
  205. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/ResultsClient.report.test.tsx +0 -284
  206. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/by-result.test.tsx +0 -302
  207. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/cards.test.tsx +0 -402
  208. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/landing.test.tsx +0 -293
  209. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/page.test.tsx +0 -485
  210. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/score.test.tsx +0 -231
  211. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/checkout-seam.ts +0 -74
  212. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/meeting-seam.ts +0 -36
  213. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/page.tsx +0 -420
  214. package/templates/apps/web/app/[locale]/flows/[slug]/save.actions.ts +0 -85
  215. package/templates/apps/web/app/[locale]/flows/[slug]/served-flow.ts +0 -91
  216. package/templates/apps/web/app/[locale]/flows/[slug]/start/page.tsx +0 -32
  217. package/templates/apps/web/app/[locale]/flows/[slug]/verify/page.tsx +0 -153
  218. package/templates/apps/web/app/[locale]/flows/[slug]/verify.actions.ts +0 -151
  219. package/templates/apps/web/app/[locale]/meet/confirmed/BookingHandOff.tsx +0 -128
  220. package/templates/apps/web/app/[locale]/meet/confirmed/__tests__/BookingHandOff.test.tsx +0 -126
  221. package/templates/apps/web/app/[locale]/purchase/__tests__/cancel.test.tsx +0 -162
  222. package/templates/apps/web/app/[locale]/purchase/__tests__/module-scope.test.ts +0 -68
  223. package/templates/apps/web/app/[locale]/purchase/__tests__/success.test.tsx +0 -411
  224. package/templates/apps/web/app/[locale]/purchase/cancel/page.tsx +0 -115
  225. package/templates/apps/web/app/[locale]/purchase/success/page.tsx +0 -348
  226. package/templates/apps/web/lib/__tests__/account-config.test.ts +0 -704
  227. package/templates/apps/web/lib/account-config.ts +0 -678
  228. package/templates/apps/web/lib/checkout-config.ts +0 -16
  229. package/templates/apps/web/src/lib/__tests__/commerce-sections.test.ts +0 -57
  230. package/templates/apps/web/src/lib/commerce-sections.ts +0 -55
@@ -89,7 +89,7 @@ export function planSiteManifest(opts) {
89
89
  // #10774 D4.2 — the template's own code-route rows a spoke does not serve
90
90
  // (`/sign-in`, `/sign-up`) leave with the files the spoke filter dropped.
91
91
  const planned = plan.next ?? roster.text;
92
- const appended = withoutUnservedRouteRows(parseRosterFile(planned, roster.path), opts.targetDir).next ?? planned;
92
+ const appended = withoutUnservedRouteRows(parseRosterFile(planned, roster.path), opts.targetDir, opts.topology).next ?? planned;
93
93
  const declared = new Set(JSON.parse(appended).rows.map((row) => row["route"]));
94
94
  const extra = [
95
95
  ...sampleRows(opts, declared),
@@ -6,6 +6,7 @@ import type { ModuleName } from "./parse-args.js";
6
6
  import type { ResolvedSiteChrome } from "./site-chrome.js";
7
7
  import { type MarkerMap } from "./substitute.js";
8
8
  import { type TemplateManifest } from "./template-manifest.js";
9
+ import { type Topology } from "./topology.js";
9
10
  /** The site-root file that is the roster of record (#6658 D7). */
10
11
  export declare const SITE_ROSTER_PATH = ".ailk-site-manifest.json";
11
12
  /**
@@ -195,7 +196,7 @@ export declare function servedRoutes(targetDir: string): string[];
195
196
  * byte verbatim — and the dropped routes in file order; `next` is undefined
196
197
  * when none is dropped.
197
198
  */
198
- export declare function withoutUnservedRouteRows(file: RosterFile, targetDir: string): {
199
+ export declare function withoutUnservedRouteRows(file: RosterFile, targetDir: string, topology?: Topology): {
199
200
  next: string | undefined;
200
201
  dropped: string[];
201
202
  };
@@ -36,8 +36,9 @@ import { diffTwoStrings } from "./lib/extract-module-bundle.js";
36
36
  import { publicTreeRemoved } from "./lib/site-modules.js";
37
37
  import { MODULE_SLICES, normalizeModules, } from "./module-architecture.js";
38
38
  import { substituteMarkers } from "./substitute.js";
39
- import { isUnservedSurfaceContent, resolveSurfaces } from "./surfaces.js";
39
+ import { isUnservedSurfaceContent, pagePackageOfRoute, resolveSurfaces } from "./surfaces.js";
40
40
  import { BASE_LAYER_DIR, SHAPE_STARTERS, TEMPLATE_MANIFESTS, resolveTemplate, rosterDeclares, shippedManifestPath, templateTreeDir, } from "./template-manifest.js";
41
+ import { readSiteTopology, SPOKE_REMOVAL_SEEDS } from "./topology.js";
41
42
  /** The site-root file that is the roster of record (#6658 D7). */
42
43
  export const SITE_ROSTER_PATH = ".ailk-site-manifest.json";
43
44
  /**
@@ -667,25 +668,46 @@ export function servedRoutes(targetDir) {
667
668
  * dynamic is never judged either: the root renderers are not in
668
669
  * `servedRoutes`.
669
670
  */
670
- function unservedRouteRow(targetDir) {
671
+ function unservedRouteRow(targetDir, topology) {
671
672
  if (!existsSync(join(targetDir, ROUTE_ROOT)))
672
673
  return undefined;
674
+ const spoke = (topology ?? readSiteTopology(targetDir)) === "spoke";
673
675
  const served = new Set(servedRoutes(targetDir));
676
+ const carried = webDependencies(targetDir);
674
677
  return (row) => {
675
678
  const route = row["route"];
676
- return (row["kind"] === "route" &&
677
- typeof route === "string" &&
678
- !route.split("/").filter(Boolean)[0]?.startsWith("[") &&
679
- !served.has(route));
679
+ if (row["kind"] !== "route" || typeof route !== "string")
680
+ return false;
681
+ if (route.split("/").filter(Boolean)[0]?.startsWith("[") || served.has(route))
682
+ return false;
683
+ // #11251 — a route a carried page package ships is served once
684
+ // `create-ailk routes --write` writes its file after the install, unless
685
+ // the spoke removal registry drops it (the generator's `not carried`).
686
+ const pkg = pagePackageOfRoute(route.slice(1));
687
+ if (pkg === undefined || !carried.has(pkg))
688
+ return true;
689
+ const sitePath = `apps/web/app/[locale]${route}`;
690
+ return spoke && SPOKE_REMOVAL_SEEDS.some((seed) => sitePath === seed || sitePath.startsWith(`${seed}/`));
680
691
  };
681
692
  }
693
+ /** The dependency and devDependency names of the site's `apps/web/package.json`; empty when it has none. */
694
+ function webDependencies(targetDir) {
695
+ try {
696
+ const pkg = JSON.parse(readFileSync(join(targetDir, "apps", "web", "package.json"), "utf8"));
697
+ // The route generator's own reading (`readRouteManifests`): both lists.
698
+ return new Set([...Object.keys(pkg.dependencies ?? {}), ...Object.keys(pkg.devDependencies ?? {})]);
699
+ }
700
+ catch {
701
+ return new Set();
702
+ }
703
+ }
682
704
  /**
683
705
  * `file`'s next text with its unserved code-route rows removed — every other
684
706
  * byte verbatim — and the dropped routes in file order; `next` is undefined
685
707
  * when none is dropped.
686
708
  */
687
- export function withoutUnservedRouteRows(file, targetDir) {
688
- const unserved = unservedRouteRow(targetDir);
709
+ export function withoutUnservedRouteRows(file, targetDir, topology) {
710
+ const unserved = unservedRouteRow(targetDir, topology);
689
711
  const dropped = file.rows.filter((row) => unserved?.(row.value) === true);
690
712
  if (dropped.length === 0)
691
713
  return { next: undefined, dropped: [] };
@@ -4,17 +4,15 @@ import { type WorkspaceVersionMap } from "./substitute.js";
4
4
  import { type SignInMode } from "./topology.js";
5
5
  /** The checkout package a spoke's billing action and thank-you page import. */
6
6
  export declare const SPOKE_CHECKOUT_PACKAGE = "@working-theory/spoke-checkout";
7
- /** The site's checkout stamp — written once, the site's from then on (#8748 D2). */
7
+ /** The site's checkout stamp — stamped once, the site's from then on (#8748 D2). */
8
8
  export declare const SPOKE_CHECKOUT_CONFIG_PATH = "apps/web/lib/checkout-config.ts";
9
- /** The two return pages a commerce spoke still carries (#8748 D5). */
10
- export declare const SPOKE_CHECKOUT_PAGE_FILES: readonly string[];
11
9
  /**
12
- * The spoke checkout's template paths, scaffold-relative (#8748 D3). A
13
- * directory entry covers every file under it, so the tests that sit beside
14
- * the pages travel with them. `copyTemplate` skips all of them for every
15
- * scaffold; `writeSpokeCheckoutSlice` copies them into a commerce spoke.
10
+ * The stamp the bundled `lib/checkout-config.ts` carries until a spoke's is
11
+ * stamped (#11253 D6). This monorepo's copy is that file, and
12
+ * `spoke-checkout.test.ts` pins it to this value, so an edited bundled stamp
13
+ * fails CI rather than stamping every new spoke alike (SEC-11253-2).
16
14
  */
17
- export declare const SPOKE_CHECKOUT_TEMPLATE_PATHS: readonly string[];
15
+ export declare const SPOKE_CHECKOUT_PLACEHOLDER_SITE = "example-site";
18
16
  /** The variables a commerce spoke depends on (D9): the package reads both. */
19
17
  export declare const SPOKE_CHECKOUT_ENV_CATALOG: Readonly<Record<string, EnvCatalogEntry>>;
20
18
  /** The names a commerce spoke declares although only the package reads them (D9). */
@@ -45,7 +43,7 @@ export declare const BILLING_ACTION: string;
45
43
  /**
46
44
  * The rendered part of the slice for `site` (#8748 D3): with `signIn: "hub"`
47
45
  * the billing action (#8217 D8), else nothing. It does not depend on `site`.
48
- * The rest of the slice is template source, copied by
46
+ * The rest of the slice is the config's stamp, written in place by
49
47
  * `writeSpokeCheckoutSlice`. Throws `TopologyError` for an invalid stamp
50
48
  * (SEC-7838-10).
51
49
  */
@@ -53,35 +51,38 @@ export declare function renderSpokeCheckoutFiles(site: string, opts?: {
53
51
  signIn?: SignInMode | undefined;
54
52
  }): [string, string][];
55
53
  /**
56
- * Write the slice into `targetDir` (#7838 D3, #8748 D3). The standard's
57
- * template files (`SPOKE_CHECKOUT_TEMPLATE_PATHS`) are copied from
58
- * `templatesDir`, each rendered with `copyTemplate`'s own renderer and
59
- * markers, so a recorded hash equals what `create-ailk update` renders; the
60
- * config's one `const SITE` line is stamped with `site`. `onWrite` is called
61
- * once per template file written, as `copyTemplate` calls it. Then come the
62
- * rendered files (`renderSpokeCheckoutFiles`). A file that already exists is
63
- * left byte-for-byte and reported `skipped` — the config is the site's once
64
- * written. With `signIn: "hub"` (#8217 D8) the slice carries the billing
65
- * action, and the web seam — generated, so always rewritten — becomes the
66
- * billing render: reported `patched` when it changed, not at all when equal.
54
+ * Write the slice into `targetDir` (#7838 D3, #8748 D3, #11253 D6). The
55
+ * site's `lib/checkout-config.ts` — delivered by the commerce bundle, which
56
+ * lands first — is stamped in place: its one `const SITE` line is set to
57
+ * `site` while it still reads the placeholder
58
+ * (`SPOKE_CHECKOUT_PLACEHOLDER_SITE`), reported `patched`; any other value is
59
+ * the site's and is left byte-for-byte, unreported, but only when it is a
60
+ * stamp this writer would itself write (`assertSite`, SEC-11253-1). Then come
61
+ * the rendered files (`renderSpokeCheckoutFiles`); one that already exists is
62
+ * left byte-for-byte and reported `skipped`. With `signIn: "hub"` (#8217 D8)
63
+ * the slice carries the billing action, and the web seam — generated, so
64
+ * always rewritten — becomes the billing render: reported `patched` when it
65
+ * changed, not at all when equal.
67
66
  * Adds the package to `apps/web/package.json` when absent, and raises a plain
68
67
  * pin older than the one it writes (#7839): the rendered billing action
69
68
  * calls the package's current `createSpokeCheckout` shape, which an older
70
69
  * pin does not take (#9142). Any other range — newer, `workspace:`, a tag —
71
70
  * is the site's and is kept.
72
71
  * Every refusal (an invalid stamp, a version map without the package, a
73
- * missing or malformed `apps/web/package.json`, a template missing any
74
- * `SPOKE_CHECKOUT_TEMPLATE_PATHS` entry, a template config without exactly
75
- * one `const SITE` line, a destination to write that resolves outside
76
- * `targetDir`) throws before the first write.
72
+ * missing or malformed `apps/web/package.json`, no config, a config without
73
+ * exactly one `const SITE` line, a kept value `assertSite` refuses, a
74
+ * destination to write that resolves outside `targetDir`) throws before the
75
+ * first write.
76
+ *
77
+ * `projectName` and `templatesDir` are no longer read (nothing is copied from
78
+ * the template since #11253); they stay accepted for `add-module.ts`'s call.
77
79
  */
78
80
  export declare function writeSpokeCheckoutSlice(targetDir: string, opts: {
79
81
  site: string;
80
- projectName: string;
82
+ projectName?: string;
81
83
  versions: WorkspaceVersionMap;
82
- templatesDir: string;
84
+ templatesDir?: string;
83
85
  signIn?: SignInMode | undefined;
84
- onWrite?: (relPath: string, bytes: Uint8Array) => void;
85
86
  }): InstallReportRow[];
86
87
  /**
87
88
  * Drop the checkout package from a scaffold that does not get the slice — a
@@ -1,11 +1,14 @@
1
1
  /**
2
2
  * The spoke checkout slice (#7838, #8748) — what a spoke carrying `commerce`
3
- * gets in `apps/web`, copied from the template tree: the site's own
4
- * `lib/checkout-config.ts` (its stamp) and the thank-you and unavailable
5
- * return pages with their tests (`SPOKE_CHECKOUT_TEMPLATE_PATHS`). A spoke
3
+ * gets in `apps/web` beyond the commerce bundle: its `lib/checkout-config.ts`
4
+ * stamped in place. The thank-you and unavailable return pages ship in
5
+ * `@working-theory/ui-commerce` (#11253) and mount through the route files
6
+ * `create-ailk routes` generates; the config is a commerce `ownedFiles`
7
+ * entry, so the bundle delivers it to every commerce site with the
8
+ * template's placeholder stamp, and this writer stamps it on a spoke. A spoke
6
9
  * that signs in through its hub also gets the billing action, the one file
7
- * allowed to import the package besides the thank-you page, and the web seam
8
- * render that reaches it (#8217 D6–D8); that action is rendered here.
10
+ * in its `apps/web` allowed to import the package, and the web seam render
11
+ * that reaches it (#8217 D6–D8); that action is rendered here.
9
12
  *
10
13
  * A spoke sells through its hub's Offerings buy route
11
14
  * (`apps/web/app/api/offerings/checkout/[lookupKey]/route.ts`), never its own
@@ -15,24 +18,22 @@
15
18
  * (`RETIRED_SPOKE_CHECKOUT_PATHS`, sync-routes.ts).
16
19
  *
17
20
  * Every guarantee lives in `@working-theory/spoke-checkout` and arrives by a
18
- * package bump; the copied files are `apps/web` source, tested in the
19
- * monorepo and kept current by `create-ailk update`, and apart from the
20
- * config's one stamp line they are byte-identical across spokes at one
21
- * create-ailk version (roadmap D3, AC-SPOKE-02). A hub never gets them.
21
+ * package bump; the pages arrive with `@working-theory/ui-commerce`'s, and
22
+ * the config differs across spokes in its one stamp line alone (roadmap D3,
23
+ * AC-SPOKE-02). A hub carries the config with its placeholder unread: both
24
+ * checkout pages answer `notFound()` there first.
22
25
  *
23
26
  * Spec: docs/specs/7838-spoke-web-checkout-slice-spec.md (D3–D7, D9);
24
27
  * docs/specs/8748-a-standard-spoke-checkout-route-spec.md (D2, D3).
25
28
  *
26
- * Pure module: no `import.meta.url`, so jest imports it directly — the caller
27
- * passes `templatesDir`. Every package specifier in a rendered file is
29
+ * Pure module: no `import.meta.url`, so jest imports it directly. Every package specifier in a rendered file is
28
30
  * interpolated from a constant, so the monorepo's own architecture lint never
29
31
  * reads a rendered line as an import create-ailk makes (the
30
32
  * `CONTENT_ADAPTERS_PACKAGE` idiom in topology.ts).
31
33
  */
32
34
  import { createHash } from "node:crypto";
33
- import { existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, realpathSync, writeFileSync, } from "node:fs";
35
+ import { existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, writeFileSync, } from "node:fs";
34
36
  import { dirname, join, resolve, sep } from "node:path";
35
- import { buildScaffoldMarkers, renderTemplateFile, templateDestination } from "./copy.js";
36
37
  import { SPOKE_BILLING_ACTION_PATH } from "./derive-architecture.js";
37
38
  import { ENV_CATALOG } from "./lib/env-catalog.js";
38
39
  import { diffTwoStrings, } from "./lib/extract-module-bundle.js";
@@ -41,23 +42,15 @@ import { TopologyError, WEB_SEAM_PATH, renderWebSeam, } from "./topology.js";
41
42
  /** The checkout package a spoke's billing action and thank-you page import. */
42
43
  export const SPOKE_CHECKOUT_PACKAGE = "@working-theory/spoke-checkout";
43
44
  const API_CLIENT_PACKAGE = "@working-theory/api-client";
44
- /** The site's checkout stamp — written once, the site's from then on (#8748 D2). */
45
+ /** The site's checkout stamp — stamped once, the site's from then on (#8748 D2). */
45
46
  export const SPOKE_CHECKOUT_CONFIG_PATH = "apps/web/lib/checkout-config.ts";
46
- /** The two return pages a commerce spoke still carries (#8748 D5). */
47
- export const SPOKE_CHECKOUT_PAGE_FILES = Object.freeze([
48
- "apps/web/app/[locale]/checkout/thank-you/page.tsx",
49
- "apps/web/app/[locale]/checkout/unavailable/page.tsx",
50
- ]);
51
47
  /**
52
- * The spoke checkout's template paths, scaffold-relative (#8748 D3). A
53
- * directory entry covers every file under it, so the tests that sit beside
54
- * the pages travel with them. `copyTemplate` skips all of them for every
55
- * scaffold; `writeSpokeCheckoutSlice` copies them into a commerce spoke.
48
+ * The stamp the bundled `lib/checkout-config.ts` carries until a spoke's is
49
+ * stamped (#11253 D6). This monorepo's copy is that file, and
50
+ * `spoke-checkout.test.ts` pins it to this value, so an edited bundled stamp
51
+ * fails CI rather than stamping every new spoke alike (SEC-11253-2).
56
52
  */
57
- export const SPOKE_CHECKOUT_TEMPLATE_PATHS = Object.freeze([
58
- "apps/web/app/[locale]/checkout",
59
- SPOKE_CHECKOUT_CONFIG_PATH,
60
- ]);
53
+ export const SPOKE_CHECKOUT_PLACEHOLDER_SITE = "example-site";
61
54
  /** The variables a commerce spoke depends on (D9): the package reads both. */
62
55
  export const SPOKE_CHECKOUT_ENV_CATALOG = Object.freeze({
63
56
  STRIPE_SECRET_KEY: {
@@ -151,7 +144,7 @@ export const BILLING_ACTION = [
151
144
  /**
152
145
  * The rendered part of the slice for `site` (#8748 D3): with `signIn: "hub"`
153
146
  * the billing action (#8217 D8), else nothing. It does not depend on `site`.
154
- * The rest of the slice is template source, copied by
147
+ * The rest of the slice is the config's stamp, written in place by
155
148
  * `writeSpokeCheckoutSlice`. Throws `TopologyError` for an invalid stamp
156
149
  * (SEC-7838-10).
157
150
  */
@@ -159,35 +152,8 @@ export function renderSpokeCheckoutFiles(site, opts = {}) {
159
152
  assertSite(site);
160
153
  return opts.signIn === "hub" ? [[SPOKE_BILLING_ACTION_PATH, BILLING_ACTION]] : [];
161
154
  }
162
- /** The one line of the template's config the writer stamps (#8748 D2). */
163
- const SITE_LINE = /^const SITE = "[a-z0-9-]+";$/gm;
164
- /**
165
- * Every template file under `SPOKE_CHECKOUT_TEMPLATE_PATHS`, sorted, as its
166
- * destination path and its source. A symlink is skipped, never followed, as
167
- * `copyTemplate` skips one; a `.gitkeep` has no destination.
168
- */
169
- function templateCheckoutFiles(templatesDir) {
170
- const out = [];
171
- const visit = (rel) => {
172
- const abs = join(templatesDir, ...rel.split("/"));
173
- if (!existsSync(abs))
174
- return;
175
- const stat = lstatSync(abs);
176
- if (stat.isSymbolicLink())
177
- return;
178
- if (stat.isDirectory()) {
179
- for (const name of readdirSync(abs))
180
- visit(`${rel}/${name}`);
181
- return;
182
- }
183
- const dest = templateDestination(rel);
184
- if (dest !== undefined)
185
- out.push([dest, abs]);
186
- };
187
- for (const entry of SPOKE_CHECKOUT_TEMPLATE_PATHS)
188
- visit(entry);
189
- return out.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0));
190
- }
155
+ /** The one line of the config the writer stamps (#8748 D2); its value is group 1. */
156
+ const SITE_LINE = /^const SITE = "([^"\n]*)";$/gm;
191
157
  /** Whether anything — a dangling symlink included — sits at `abs`. */
192
158
  function lstatExists(abs) {
193
159
  try {
@@ -243,27 +209,31 @@ function isOlderPin(current, wanted) {
243
209
  return false;
244
210
  }
245
211
  /**
246
- * Write the slice into `targetDir` (#7838 D3, #8748 D3). The standard's
247
- * template files (`SPOKE_CHECKOUT_TEMPLATE_PATHS`) are copied from
248
- * `templatesDir`, each rendered with `copyTemplate`'s own renderer and
249
- * markers, so a recorded hash equals what `create-ailk update` renders; the
250
- * config's one `const SITE` line is stamped with `site`. `onWrite` is called
251
- * once per template file written, as `copyTemplate` calls it. Then come the
252
- * rendered files (`renderSpokeCheckoutFiles`). A file that already exists is
253
- * left byte-for-byte and reported `skipped` — the config is the site's once
254
- * written. With `signIn: "hub"` (#8217 D8) the slice carries the billing
255
- * action, and the web seam — generated, so always rewritten — becomes the
256
- * billing render: reported `patched` when it changed, not at all when equal.
212
+ * Write the slice into `targetDir` (#7838 D3, #8748 D3, #11253 D6). The
213
+ * site's `lib/checkout-config.ts` — delivered by the commerce bundle, which
214
+ * lands first — is stamped in place: its one `const SITE` line is set to
215
+ * `site` while it still reads the placeholder
216
+ * (`SPOKE_CHECKOUT_PLACEHOLDER_SITE`), reported `patched`; any other value is
217
+ * the site's and is left byte-for-byte, unreported, but only when it is a
218
+ * stamp this writer would itself write (`assertSite`, SEC-11253-1). Then come
219
+ * the rendered files (`renderSpokeCheckoutFiles`); one that already exists is
220
+ * left byte-for-byte and reported `skipped`. With `signIn: "hub"` (#8217 D8)
221
+ * the slice carries the billing action, and the web seam — generated, so
222
+ * always rewritten — becomes the billing render: reported `patched` when it
223
+ * changed, not at all when equal.
257
224
  * Adds the package to `apps/web/package.json` when absent, and raises a plain
258
225
  * pin older than the one it writes (#7839): the rendered billing action
259
226
  * calls the package's current `createSpokeCheckout` shape, which an older
260
227
  * pin does not take (#9142). Any other range — newer, `workspace:`, a tag —
261
228
  * is the site's and is kept.
262
229
  * Every refusal (an invalid stamp, a version map without the package, a
263
- * missing or malformed `apps/web/package.json`, a template missing any
264
- * `SPOKE_CHECKOUT_TEMPLATE_PATHS` entry, a template config without exactly
265
- * one `const SITE` line, a destination to write that resolves outside
266
- * `targetDir`) throws before the first write.
230
+ * missing or malformed `apps/web/package.json`, no config, a config without
231
+ * exactly one `const SITE` line, a kept value `assertSite` refuses, a
232
+ * destination to write that resolves outside `targetDir`) throws before the
233
+ * first write.
234
+ *
235
+ * `projectName` and `templatesDir` are no longer read (nothing is copied from
236
+ * the template since #11253); they stay accepted for `add-module.ts`'s call.
267
237
  */
268
238
  export function writeSpokeCheckoutSlice(targetDir, opts) {
269
239
  const rendered = renderSpokeCheckoutFiles(opts.site, { signIn: opts.signIn });
@@ -272,28 +242,30 @@ export function writeSpokeCheckoutSlice(targetDir, opts) {
272
242
  const pkgPath = join(targetDir, WEB_PACKAGE_JSON);
273
243
  const before = readFileSync(pkgPath, "utf8");
274
244
  const pkg = JSON.parse(before);
275
- const markers = buildScaffoldMarkers(opts.projectName);
276
- const copied = [];
277
- for (const [path, source] of templateCheckoutFiles(opts.templatesDir)) {
278
- let bytes = Buffer.from(renderTemplateFile(readFileSync(source), path, opts.versions, markers));
279
- if (path === SPOKE_CHECKOUT_CONFIG_PATH) {
280
- const text = bytes.toString("utf8");
281
- const lines = text.match(SITE_LINE) ?? [];
282
- if (lines.length !== 1) {
283
- throw new TopologyError(`spoke checkout: the template's ${SPOKE_CHECKOUT_CONFIG_PATH} must hold exactly one const SITE line, found ${lines.length}`);
284
- }
285
- bytes = Buffer.from(text.replace(SITE_LINE, `const SITE = "${opts.site}";`), "utf8");
286
- }
287
- copied.push([path, bytes]);
245
+ const targetReal = realpathSync(targetDir);
246
+ const configPath = join(targetDir, SPOKE_CHECKOUT_CONFIG_PATH);
247
+ if (!existsSync(configPath)) {
248
+ throw new TopologyError(`spoke checkout: the site has no ${SPOKE_CHECKOUT_CONFIG_PATH} (the commerce bundle delivers it)`);
288
249
  }
289
- const missing = SPOKE_CHECKOUT_TEMPLATE_PATHS.filter((entry) => !copied.some(([path]) => path === entry || path.startsWith(`${entry}/`)));
290
- if (missing.length > 0) {
291
- throw new TopologyError(`spoke checkout: the template has no ${missing.join(", ")}`);
250
+ // The config is rewritten in place, so it must be the site's own file: a
251
+ // symlink, or a path that resolves outside the site, is refused.
252
+ if (lstatSync(configPath).isSymbolicLink() || !resolvesInside(targetReal, configPath)) {
253
+ throw new TopologyError(`spoke checkout: refusing to write outside the site: ${SPOKE_CHECKOUT_CONFIG_PATH}`);
292
254
  }
293
- // A file already there is skipped below, never written, so only a path
294
- // that will be written must resolve inside the site.
295
- const targetReal = realpathSync(targetDir);
296
- for (const [path] of [...copied, ...rendered]) {
255
+ const config = readFileSync(configPath, "utf8");
256
+ const siteLines = [...config.matchAll(SITE_LINE)];
257
+ if (siteLines.length !== 1) {
258
+ throw new TopologyError(`spoke checkout: ${SPOKE_CHECKOUT_CONFIG_PATH} must hold exactly one const SITE line, found ${siteLines.length}`);
259
+ }
260
+ const kept = siteLines[0][1];
261
+ if (kept !== SPOKE_CHECKOUT_PLACEHOLDER_SITE)
262
+ assertSite(kept);
263
+ const stamped = kept === SPOKE_CHECKOUT_PLACEHOLDER_SITE
264
+ ? config.replace(SITE_LINE, `const SITE = "${opts.site}";`)
265
+ : undefined;
266
+ // A rendered file already there is skipped below, never written, so only a
267
+ // path that will be written must resolve inside the site.
268
+ for (const [path] of rendered) {
297
269
  const abs = resolve(targetDir, path);
298
270
  if (lstatExists(abs))
299
271
  continue;
@@ -302,16 +274,13 @@ export function writeSpokeCheckoutSlice(targetDir, opts) {
302
274
  }
303
275
  }
304
276
  const rows = [];
305
- for (const [path, bytes] of copied) {
306
- const abs = join(targetDir, path);
307
- if (lstatExists(abs)) {
308
- rows.push({ path, action: "skipped", wanted: bytes.toString("utf8") });
309
- continue;
310
- }
311
- mkdirSync(dirname(abs), { recursive: true });
312
- writeFileSync(abs, bytes);
313
- opts.onWrite?.(path, bytes);
314
- rows.push({ path, action: "written" });
277
+ if (stamped !== undefined) {
278
+ writeFileSync(configPath, stamped);
279
+ rows.push({
280
+ path: SPOKE_CHECKOUT_CONFIG_PATH,
281
+ action: "patched",
282
+ change: diffTwoStrings(SPOKE_CHECKOUT_CONFIG_PATH, config, stamped, true),
283
+ });
315
284
  }
316
285
  for (const [path, text] of rendered) {
317
286
  const abs = join(targetDir, path);
@@ -29,6 +29,24 @@ export declare const HUB_KEPT_ROUTE_DIRS: readonly string[];
29
29
  * site whose manifest lists no `marketing` (`lib/site-modules.ts`, spec 10040 D10).
30
30
  */
31
31
  export declare function isRemovedPublicRoutePath(destRel: string): boolean;
32
+ /**
33
+ * The route trees a page package ships (ADR 0040): the package's pages
34
+ * mount through the route files `create-ailk routes` generates from its
35
+ * manifest, so `sync-routes` has nothing to sync under the prefix — the
36
+ * generator writes, checks and records those files, never the route copier.
37
+ * A `siteOwned` route under the prefix stays the site's own page (one the
38
+ * package leaves to a later slice) and `sync-routes` keeps it in scope. One
39
+ * entry per page package, mirroring its `routes.json` (`prefix`, and each
40
+ * `siteOwned` routing file's directory); `sync-routes.test.ts` pins
41
+ * `@working-theory/account`'s to the package's manifest.
42
+ */
43
+ export declare const PAGE_PACKAGE_ROUTES: readonly {
44
+ package: string;
45
+ prefix: string;
46
+ siteOwned: readonly string[];
47
+ }[];
48
+ /** The page package that ships `route` (a ROUTE_ROOT-relative dir), or `undefined` when no page package does. */
49
+ export declare function pagePackageOfRoute(route: string): string | undefined;
32
50
  /** Template-relative route directories that are always copied. */
33
51
  export declare const CORE_ROUTE_DIRS: readonly string[];
34
52
  /**