create-ailk 0.7.0 → 0.9.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 (310) hide show
  1. package/README.md +112 -10
  2. package/component-catalog.json +798 -49
  3. package/component-catalog.md +9 -6
  4. package/dist/add-module.d.ts +20 -0
  5. package/dist/add-module.js +43 -7
  6. package/dist/add-route.d.ts +56 -0
  7. package/dist/add-route.js +286 -0
  8. package/dist/apply-design-md.d.ts +7 -0
  9. package/dist/apply-design-md.js +50 -0
  10. package/dist/apply-design.d.ts +64 -0
  11. package/dist/apply-design.js +273 -0
  12. package/dist/claude-md.d.ts +111 -0
  13. package/dist/claude-md.js +334 -0
  14. package/dist/cli.js +114 -28
  15. package/dist/derive-architecture.js +41 -36
  16. package/dist/design-compile.d.ts +71 -0
  17. package/dist/design-compile.js +98 -0
  18. package/dist/design-package.d.ts +83 -0
  19. package/dist/design-package.js +468 -0
  20. package/dist/design-presets.d.ts +86 -0
  21. package/dist/design-presets.js +642 -0
  22. package/dist/design-scaffold.d.ts +76 -0
  23. package/dist/design-scaffold.js +220 -0
  24. package/dist/index.d.ts +2 -1
  25. package/dist/index.js +4 -1
  26. package/dist/legacy-nav-renderers.d.ts +45 -0
  27. package/dist/legacy-nav-renderers.js +545 -0
  28. package/dist/lib/auth-secret-file.d.ts +19 -0
  29. package/dist/lib/auth-secret-file.js +112 -0
  30. package/dist/lib/design-checks.d.ts +78 -0
  31. package/dist/lib/design-checks.js +174 -0
  32. package/dist/lib/extract-module-bundle.js +5 -1
  33. package/dist/lib/license-key-files.d.ts +9 -0
  34. package/dist/lib/license-key-files.js +2 -2
  35. package/dist/lib/module-license-gate.d.ts +89 -0
  36. package/dist/lib/module-license-gate.js +171 -12
  37. package/dist/lib/module-tier.d.ts +45 -16
  38. package/dist/lib/module-tier.js +76 -0
  39. package/dist/lib/pro-callout.js +10 -2
  40. package/dist/lib/render-verdict.d.ts +52 -0
  41. package/dist/lib/render-verdict.js +77 -0
  42. package/dist/lib/scaffold-render-sweep.d.ts +105 -0
  43. package/dist/lib/scaffold-render-sweep.js +236 -0
  44. package/dist/module-architecture.d.ts +19 -16
  45. package/dist/module-architecture.js +64 -21
  46. package/dist/parse-args.d.ts +88 -10
  47. package/dist/parse-args.js +272 -21
  48. package/dist/programmatic.d.ts +66 -12
  49. package/dist/programmatic.js +361 -34
  50. package/dist/site-chrome.d.ts +19 -9
  51. package/dist/site-chrome.js +23 -13
  52. package/dist/site-manifest.d.ts +25 -0
  53. package/dist/site-manifest.js +254 -0
  54. package/dist/site-roster.d.ts +41 -0
  55. package/dist/site-roster.js +149 -11
  56. package/dist/starter-grid.d.ts +232 -0
  57. package/dist/starter-grid.js +545 -0
  58. package/dist/surfaces.d.ts +41 -9
  59. package/dist/surfaces.js +268 -92
  60. package/dist/template-manifest.d.ts +65 -29
  61. package/dist/template-manifest.js +161 -382
  62. package/dist/template-names.d.ts +14 -12
  63. package/dist/template-names.js +13 -17
  64. package/package.json +5 -4
  65. package/site-templates/_base/content/en/Feature/feature-1.mdx +69 -0
  66. package/site-templates/_base/content/en/Feature/feature-2.mdx +69 -0
  67. package/site-templates/_base/content/en/Feature/feature-3.mdx +69 -0
  68. package/site-templates/_base/content/en/FeaturesList/features.mdx +91 -0
  69. package/site-templates/_base/content/en/GlossaryList/glossary.mdx +0 -1
  70. package/site-templates/_base/content/en/NewsletterSignup/newsletter.mdx +0 -1
  71. package/site-templates/_base/content/en/PortfolioItem/sample-four.mdx +105 -0
  72. package/site-templates/_base/content/en/PortfolioItem/sample-one.mdx +34 -0
  73. package/site-templates/_base/content/en/PortfolioItem/sample-three.mdx +94 -0
  74. package/site-templates/_base/content/en/PortfolioItem/sample-two.mdx +45 -0
  75. package/site-templates/_base/content/en/PortfolioList/portfolio.mdx +169 -0
  76. package/site-templates/_base/content/en/PrivacyPage/privacy.mdx +15 -0
  77. package/site-templates/_base/content/en/UseCase/persona-1.mdx +70 -0
  78. package/site-templates/_base/content/en/UseCase/persona-2.mdx +70 -0
  79. package/site-templates/_base/content/en/UseCase/persona-3.mdx +70 -0
  80. package/site-templates/{minimalism-site/TEMPLATE-MANIFEST.json → aliases/minimalism-site.TEMPLATE-MANIFEST.json} +72 -40
  81. package/site-templates/designs/minimalism/DESIGN.md +98 -6
  82. package/site-templates/designs/minimalism/sample/README.md +48 -0
  83. package/site-templates/designs/standard/DESIGN.md +103 -6
  84. package/site-templates/marketing-site/DESIGN.md +103 -6
  85. package/site-templates/marketing-site/TEMPLATE-MANIFEST.json +144 -47
  86. package/site-templates/marketing-site/TEMPLATE-MANIFEST.md +82 -41
  87. package/site-templates/marketing-site-free/DESIGN.md +103 -6
  88. package/site-templates/marketing-site-free/TEMPLATE-MANIFEST.json +150 -48
  89. package/site-templates/marketing-site-free/TEMPLATE-MANIFEST.md +114 -67
  90. package/site-templates/marketing-site-free/ailk-template.json +1 -1
  91. package/site-templates/marketing-site-free/content/en/NewsletterSignup/newsletter.mdx +59 -0
  92. package/site-templates/marketing-site-free/content/en/Pricing/pricing.mdx +199 -0
  93. package/site-templates/saas-product/DESIGN.md +103 -6
  94. package/site-templates/saas-product/TEMPLATE-MANIFEST.md +9 -1
  95. package/site-templates/{simple-service → shapes/local-business-service}/TEMPLATE-MANIFEST.json +210 -81
  96. package/site-templates/shapes/local-business-service/TEMPLATE-MANIFEST.md +356 -0
  97. package/site-templates/shapes/local-business-service/ailk-template.json +10 -0
  98. package/site-templates/{simple-service → shapes/local-business-service}/content/en/AboutPage/about.mdx +4 -4
  99. package/site-templates/shapes/local-business-service/content/en/HomePage/home.mdx +70 -0
  100. package/site-templates/shapes/local-business-service/content/en/NewsletterSignup/newsletter.mdx +59 -0
  101. package/site-templates/shapes/local-business-service/content/en/PortfolioList/portfolio.mdx +171 -0
  102. package/site-templates/{minimalism-site → shapes/local-business-service}/content/en/PurchasePolicyPage/purchase-policy.mdx +7 -8
  103. package/site-templates/shapes/local-business-service/content/en/Service/first-job.mdx +39 -0
  104. package/site-templates/shapes/local-business-service/content/en/Service/second-job.mdx +39 -0
  105. package/site-templates/shapes/local-business-service/content/en/Service/third-job.mdx +39 -0
  106. package/site-templates/shapes/local-business-service/content/en/ServicesList/services.mdx +61 -0
  107. package/site-templates/shapes/local-business-service/provenance.json +4 -0
  108. package/site-templates/shapes/organization-service/TEMPLATE-MANIFEST.json +471 -0
  109. package/site-templates/shapes/organization-service/TEMPLATE-MANIFEST.md +354 -0
  110. package/site-templates/shapes/organization-service/ailk-template.json +10 -0
  111. package/site-templates/shapes/organization-service/content/en/AboutPage/about.mdx +38 -0
  112. package/site-templates/shapes/organization-service/content/en/HomePage/home.mdx +85 -0
  113. package/site-templates/shapes/organization-service/content/en/NewsletterSignup/newsletter.mdx +59 -0
  114. package/site-templates/shapes/organization-service/content/en/PortfolioList/portfolio.mdx +171 -0
  115. package/site-templates/shapes/organization-service/content/en/PurchasePolicyPage/purchase-policy.mdx +123 -0
  116. package/site-templates/{minimalism-site → shapes/organization-service}/content/en/ServicesList/services.mdx +3 -4
  117. package/site-templates/shapes/organization-service/provenance.json +4 -0
  118. package/site-templates/shapes/person-service/TEMPLATE-MANIFEST.json +478 -0
  119. package/site-templates/shapes/person-service/TEMPLATE-MANIFEST.md +353 -0
  120. package/site-templates/shapes/person-service/ailk-template.json +10 -0
  121. package/site-templates/shapes/person-service/content/_site.mdx +85 -0
  122. package/site-templates/shapes/person-service/content/en/AboutPage/about.mdx +39 -0
  123. package/site-templates/shapes/person-service/content/en/HomePage/home.mdx +97 -0
  124. package/site-templates/shapes/person-service/content/en/NewsletterSignup/newsletter.mdx +59 -0
  125. package/site-templates/shapes/person-service/content/en/PortfolioList/portfolio.mdx +171 -0
  126. package/site-templates/{simple-service → shapes/person-service}/content/en/PurchasePolicyPage/purchase-policy.mdx +10 -11
  127. package/site-templates/shapes/person-service/content/en/Service/first-engagement.mdx +38 -0
  128. package/site-templates/shapes/person-service/content/en/Service/second-engagement.mdx +38 -0
  129. package/site-templates/shapes/person-service/content/en/Service/third-engagement.mdx +38 -0
  130. package/site-templates/{simple-service → shapes/person-service}/content/en/ServicesList/services.mdx +16 -16
  131. package/site-templates/shapes/person-service/provenance.json +4 -0
  132. package/templates/.claude/rules/architecture.md +7 -0
  133. package/templates/.claude/skills/README.md +5 -3
  134. package/templates/.claude/skills/add-auth/references/env-vars.md +22 -15
  135. package/templates/.claude/skills/add-auth/references/oauth-app-setup.md +3 -2
  136. package/templates/.claude/skills/add-page/SKILL.md +241 -238
  137. package/templates/.claude/skills/add-page/references/page-types.md +85 -72
  138. package/templates/.claude/skills/add-page/scripts/site-pages.mjs +87 -0
  139. package/templates/.claude/skills/add-page/templates/comparison-page.mdx.tmpl +99 -0
  140. package/templates/.claude/skills/add-page/templates/content.mdx.tmpl +8 -18
  141. package/templates/.claude/skills/add-page/templates/flow-landing-page.mdx.tmpl +43 -0
  142. package/templates/.claude/skills/add-page/templates/report-page.mdx.tmpl +52 -0
  143. package/templates/.claude/skills/add-page/templates/reports-list.mdx.tmpl +38 -0
  144. package/templates/.claude/skills/check-site/SKILL.md +23 -0
  145. package/templates/.claude/skills/fill-page/SKILL.md +26 -7
  146. package/templates/.claude/skills/fill-page/profiles/plumbing.yaml +1 -1
  147. package/templates/.claude/skills/setup-database/SKILL.md +156 -0
  148. package/templates/.claude/skills/setup-database/scripts/verify-inbox.ts +154 -0
  149. package/templates/.claude/skills/setup-deploy/SKILL.md +64 -32
  150. package/templates/.claude/skills/setup-deploy/references/env-vars-template.md +44 -36
  151. package/templates/.claude/skills/setup-deploy/references/runbook-template.md +58 -102
  152. package/templates/.claude/skills/update-page/SKILL.md +117 -0
  153. package/templates/.claude/skills/update-page/scripts/update-page.ts +640 -0
  154. package/templates/.claude/skills/update-page/templates/redirects.mjs.tmpl +31 -0
  155. package/templates/.claude/skills/upgrade-plan/SKILL.md +12 -8
  156. package/templates/.github/workflows/ci.yml +4 -0
  157. package/templates/.prettierignore +1 -0
  158. package/templates/CLAUDE.md +146 -103
  159. package/templates/DESIGN.md +103 -6
  160. package/templates/README.md +63 -43
  161. package/templates/apps/api/.env.example +2 -1
  162. package/templates/apps/api/CLAUDE.md +3 -2
  163. package/templates/apps/api/src/__tests__/commerce-claim-registration.test.ts +2 -0
  164. package/templates/apps/api/src/__tests__/server.test.ts +116 -0
  165. package/templates/apps/api/src/config/__tests__/index.test.ts +115 -14
  166. package/templates/apps/api/src/config/index.ts +35 -16
  167. package/templates/apps/api/src/lib/__tests__/lead-capture-store.test.ts +30 -0
  168. package/templates/apps/api/src/lib/__tests__/lead-delivery.test.ts +96 -0
  169. package/templates/apps/api/src/lib/lead-capture-store.ts +12 -0
  170. package/templates/apps/api/src/lib/lead-delivery.ts +52 -0
  171. package/templates/apps/api/src/lib/stripe.ts +9 -0
  172. package/templates/apps/api/src/middleware/__tests__/auth.optional-cookie.test.ts +140 -0
  173. package/templates/apps/api/src/middleware/auth.ts +54 -0
  174. package/templates/apps/api/src/openapi/spec.ts +63 -12
  175. package/templates/apps/api/src/routes/checkout/__tests__/session.test.ts +5 -2
  176. package/templates/apps/api/src/routes/checkout/__tests__/sessions.test.ts +628 -0
  177. package/templates/apps/api/src/routes/checkout/sessions.ts +222 -24
  178. package/templates/apps/api/src/routes/leads/__tests__/capture.test.ts +88 -0
  179. package/templates/apps/api/src/routes/leads/__tests__/index.test.ts +100 -0
  180. package/templates/apps/api/src/routes/leads/index.ts +46 -1
  181. package/templates/apps/api/src/routes/webhooks/__tests__/stripe-flow-checkout.test.ts +1 -1
  182. package/templates/apps/api/src/routes/webhooks/__tests__/stripe-org-billing.test.ts +5 -1
  183. package/templates/apps/api/src/routes/webhooks/__tests__/stripe.test.ts +521 -20
  184. package/templates/apps/api/src/routes/webhooks/stripe.ts +124 -32
  185. package/templates/apps/api/src/server.ts +35 -0
  186. package/templates/apps/api/src/services/__tests__/lead-routing.test.ts +194 -0
  187. package/templates/apps/api/src/services/__tests__/leads-inbox.test.ts +124 -0
  188. package/templates/apps/api/src/services/__tests__/revalidation.test.ts +90 -15
  189. package/templates/apps/api/src/services/checkout-buyer.ts +72 -0
  190. package/templates/apps/api/src/services/lead-routing.ts +140 -30
  191. package/templates/apps/api/src/services/leads-inbox.ts +48 -11
  192. package/templates/apps/api/src/services/revalidation.ts +60 -15
  193. package/templates/apps/mcp/__tests__/parity.test.ts +5 -4
  194. package/templates/apps/mcp/__tests__/tools/create_project.test.ts +30 -24
  195. package/templates/apps/mcp/src/tools/create_project.ts +21 -6
  196. package/templates/apps/mcp/src/tools/purchase.ts +4 -2
  197. package/templates/apps/web/.env.example +13 -0
  198. package/templates/apps/web/CLAUDE.md +22 -28
  199. package/templates/apps/web/app/[locale]/(auth)/layout.tsx +1 -1
  200. package/templates/apps/web/app/[locale]/(authed)/leads/__tests__/page.test.tsx +24 -0
  201. package/templates/apps/web/app/[locale]/(authed)/leads/page.tsx +17 -6
  202. package/templates/apps/web/app/[locale]/[slug]/[detail]/__tests__/page.test.tsx +110 -0
  203. package/templates/apps/web/app/[locale]/[slug]/[detail]/page.tsx +60 -0
  204. package/templates/apps/web/app/[locale]/[slug]/page.tsx +1 -1
  205. package/templates/apps/web/app/[locale]/alternatives/__tests__/page.test.tsx +161 -0
  206. package/templates/apps/web/app/[locale]/alternatives/page.tsx +104 -0
  207. package/templates/apps/web/app/[locale]/contact/ConversationalIntakeWrapper.tsx +14 -6
  208. package/templates/apps/web/app/[locale]/contact/__tests__/ConversationalIntakeWrapper.test.tsx +10 -9
  209. package/templates/apps/web/app/[locale]/contact/__tests__/contact-form-text.test.ts +32 -0
  210. package/templates/apps/web/app/[locale]/contact/__tests__/contact.actions.test.ts +129 -0
  211. package/templates/apps/web/app/[locale]/contact/__tests__/page-renderer-migration.test.tsx +227 -84
  212. package/templates/apps/web/app/[locale]/contact/contact-form-text.ts +50 -0
  213. package/templates/apps/web/app/[locale]/contact/contact.actions.ts +73 -20
  214. package/templates/apps/web/app/[locale]/contact/page.tsx +105 -15
  215. package/templates/apps/web/app/[locale]/contact/site-contact-email.ts +54 -0
  216. package/templates/apps/web/app/[locale]/features/[slug]/page.tsx +64 -0
  217. package/templates/apps/web/app/[locale]/features/page.tsx +52 -0
  218. package/templates/apps/web/app/[locale]/{use-cases → for}/[slug]/page.tsx +21 -5
  219. package/templates/apps/web/app/[locale]/for/__tests__/page-renderer-migration.test.tsx +73 -0
  220. package/templates/apps/web/app/[locale]/{use-cases → for}/page.tsx +8 -7
  221. package/templates/apps/web/app/[locale]/glossary/page.tsx +1 -1
  222. package/templates/apps/web/app/[locale]/layout.tsx +65 -17
  223. package/templates/apps/web/app/[locale]/newsletter/__tests__/newsletter.actions.test.ts +75 -0
  224. package/templates/apps/web/app/[locale]/newsletter/__tests__/page.test.tsx +163 -0
  225. package/templates/apps/web/app/[locale]/newsletter/newsletter.actions.ts +66 -0
  226. package/templates/apps/web/app/[locale]/newsletter/page.tsx +106 -14
  227. package/templates/apps/web/app/[locale]/portfolio/[slug]/page.tsx +59 -0
  228. package/templates/apps/web/app/[locale]/{book-a-call → portfolio}/page.tsx +12 -13
  229. package/templates/apps/web/app/[locale]/vs/[slug]/__tests__/page.test.tsx +112 -0
  230. package/templates/apps/web/app/[locale]/vs/[slug]/page.tsx +70 -0
  231. package/templates/apps/web/app/api/revalidate/__tests__/route.test.ts +236 -44
  232. package/templates/apps/web/app/api/revalidate/route.ts +78 -36
  233. package/templates/apps/web/lib/__tests__/site-brand.test.ts +79 -0
  234. package/templates/apps/web/lib/__tests__/site-theme.test.ts +104 -11
  235. package/templates/apps/web/lib/__tests__/structured-data.test.tsx +21 -4
  236. package/templates/apps/web/lib/locale-guard.ts +18 -0
  237. package/templates/apps/web/lib/meet-placeholder.ts +5 -0
  238. package/templates/apps/web/lib/nav-config.ts +50 -37
  239. package/templates/apps/web/lib/site-brand.tsx +13 -9
  240. package/templates/apps/web/lib/site-identity.ts +14 -0
  241. package/templates/apps/web/lib/site-logo.tsx +36 -0
  242. package/templates/apps/web/lib/site-theme.ts +46 -26
  243. package/templates/apps/web/messages/en.json +45 -5
  244. package/templates/apps/web/middleware.ts +28 -4
  245. package/templates/content/_site.mdx +4 -2
  246. package/templates/content/en/BlogList/blog.mdx +37 -16
  247. package/templates/content/en/BookCall/book-a-call.mdx +80 -0
  248. package/templates/content/en/BookCall/onsite-estimate.mdx +56 -0
  249. package/templates/content/en/BookCall/onsite-service.mdx +56 -0
  250. package/templates/content/en/BookCall/start-project.mdx +56 -0
  251. package/templates/content/en/ContactPage/contact.mdx +43 -34
  252. package/templates/content/en/HomePage/home.mdx +10 -22
  253. package/templates/content/en/LandingPage/meet.mdx +59 -0
  254. package/templates/content/en/PurchasePolicyPage/purchase-policy.mdx +0 -1
  255. package/templates/content/en/UseCasesList/{use-cases.mdx → for.mdx} +19 -18
  256. package/templates/database/CHANGELOG.md +14 -0
  257. package/templates/database/package.json +1 -1
  258. package/templates/package.json +2 -1
  259. package/templates/tools/check-claude-md.ts +128 -0
  260. package/versions.json +33 -33
  261. package/site-templates/_base/content/en/BookCall/book-call.mdx +0 -53
  262. package/site-templates/_base/content/en/UseCase/first-use-case.mdx +0 -23
  263. package/site-templates/_base/content/en/UseCase/second-use-case.mdx +0 -23
  264. package/site-templates/_base/content/en/UseCase/third-use-case.mdx +0 -23
  265. package/site-templates/minimalism-site/DESIGN.md +0 -162
  266. package/site-templates/minimalism-site/TEMPLATE-MANIFEST.md +0 -470
  267. package/site-templates/minimalism-site/ailk-template.json +0 -23
  268. package/site-templates/minimalism-site/content/en/AboutPage/about.mdx +0 -110
  269. package/site-templates/minimalism-site/content/en/BookCall/book-call.mdx +0 -53
  270. package/site-templates/minimalism-site/content/en/ContactPage/contact.mdx +0 -34
  271. package/site-templates/minimalism-site/content/en/FAQPage/faq.mdx +0 -57
  272. package/site-templates/minimalism-site/content/en/LandingPage/referral.mdx +0 -77
  273. package/site-templates/minimalism-site/content/en/LandingPage/reports.mdx +0 -73
  274. package/site-templates/minimalism-site/content/en/ReportPage/annual-letter-2024.mdx +0 -52
  275. package/site-templates/minimalism-site/content/en/ReportPage/field-notes-2023.mdx +0 -52
  276. package/site-templates/minimalism-site/content/en/ReportPage/platform-shift-2025.mdx +0 -52
  277. package/site-templates/minimalism-site/content/en/ReportPage/state-of-the-market-2026.mdx +0 -52
  278. package/site-templates/minimalism-site/flows/referral.flow.json +0 -71
  279. package/site-templates/minimalism-site/provenance.json +0 -4
  280. package/site-templates/simple-service/DESIGN.md +0 -162
  281. package/site-templates/simple-service/TEMPLATE-MANIFEST.md +0 -333
  282. package/site-templates/simple-service/ailk-template.json +0 -11
  283. package/site-templates/simple-service/content/en/BookCall/book-call.mdx +0 -53
  284. package/site-templates/simple-service/content/en/ContactPage/contact.mdx +0 -32
  285. package/site-templates/simple-service/content/en/FAQPage/faq.mdx +0 -56
  286. package/site-templates/simple-service/content/en/HomePage/home.mdx +0 -85
  287. package/site-templates/simple-service/content/en/Service/landscape-design.mdx +0 -40
  288. package/site-templates/simple-service/content/en/Service/lawn-maintenance.mdx +0 -40
  289. package/site-templates/simple-service/content/en/Service/seasonal-cleanup.mdx +0 -40
  290. package/site-templates/simple-service/provenance.json +0 -4
  291. package/templates/.claude/skills/add-page/templates/route.tsx.tmpl +0 -28
  292. package/templates/apps/web/app/[locale]/contact/ContactForm.tsx +0 -211
  293. package/templates/apps/web/app/[locale]/contact/__tests__/ContactForm.test.tsx +0 -96
  294. package/templates/apps/web/app/[locale]/use-cases/__tests__/page-renderer-migration.test.tsx +0 -72
  295. package/templates/content/en/SoftwareProduct/product.mdx +0 -175
  296. /package/site-templates/{minimalism-site → designs/minimalism/sample}/content/en/HomePage/home.mdx +0 -0
  297. /package/site-templates/{minimalism-site/assets → designs/minimalism/sample/public}/avatar-placeholder-1.svg +0 -0
  298. /package/site-templates/{minimalism-site/assets → designs/minimalism/sample/public}/avatar-placeholder-2.svg +0 -0
  299. /package/site-templates/{minimalism-site/assets → designs/minimalism/sample/public}/avatar-placeholder-3.svg +0 -0
  300. /package/site-templates/{minimalism-site/assets → designs/minimalism/sample/public}/avatar-placeholder-4.svg +0 -0
  301. /package/site-templates/{minimalism-site/assets → designs/minimalism/sample/public}/avatar-placeholder-5.svg +0 -0
  302. /package/site-templates/{minimalism-site/assets → designs/minimalism/sample/public}/avatar-placeholder-6.svg +0 -0
  303. /package/site-templates/{minimalism-site/assets → designs/minimalism/sample/public}/hero-backdrop.svg +0 -0
  304. /package/site-templates/{minimalism-site/assets → designs/minimalism/sample/public}/logo-placeholder-1.svg +0 -0
  305. /package/site-templates/{minimalism-site/assets → designs/minimalism/sample/public}/logo-placeholder-2.svg +0 -0
  306. /package/site-templates/{minimalism-site/assets → designs/minimalism/sample/public}/logo-placeholder-3.svg +0 -0
  307. /package/site-templates/{minimalism-site/assets → designs/minimalism/sample/public}/wordmark-placeholder.svg +0 -0
  308. /package/site-templates/{minimalism-site → shapes/organization-service}/content/en/Service/first-engagement.mdx +0 -0
  309. /package/site-templates/{minimalism-site → shapes/organization-service}/content/en/Service/second-engagement.mdx +0 -0
  310. /package/site-templates/{minimalism-site → shapes/organization-service}/content/en/Service/third-engagement.mdx +0 -0
@@ -0,0 +1,76 @@
1
+ import { type CompiledDesignTheme } from "./design-compile.js";
2
+ import { type DesignPackage } from "./design-package.js";
3
+ import type { LayerOwnership } from "./lib/extract-module-bundle.js";
4
+ /** One resolved `--design` reference (D2). */
5
+ export interface ResolvedDesign {
6
+ /** "name" when the reference was a registry name, "path" when a directory. */
7
+ kind: "name" | "path";
8
+ /** Absolute directory holding the DESIGN.md. */
9
+ dir: string;
10
+ pkg: DesignPackage;
11
+ /** What the site records: the registry name when `pkg` deep-equals a shipped design's package, else `pkg.name`. */
12
+ recorded: string;
13
+ /** What a refusal names: the name, or the absolute directory. */
14
+ display: string;
15
+ /** True iff `recorded` is in `FREE_DESIGNS` by the identity rule below (D2). */
16
+ free: boolean;
17
+ }
18
+ /**
19
+ * Resolve a design reference to its package (D2). Classification mirrors
20
+ * `parse-args.ts`'s `parseDesign` (D1) exactly, so a programmatic caller
21
+ * accepts the same inputs the CLI does: a value with no `/` or `\` that
22
+ * names a recognized design resolves to `<designsDir>/<name>`; otherwise, if
23
+ * it names an existing directory (relative to `opts.cwd`), it resolves as a
24
+ * path; otherwise it is refused. A value with a separator is always a path.
25
+ *
26
+ * A path's package is compared, by deep equality, against each shipped
27
+ * design's own package: a byte-identical copy of a shipped design IS that
28
+ * design (`recorded`/`free` follow the shipped name), and any authored
29
+ * change makes it a distinct, non-Free design named by its own `pkg.name`.
30
+ *
31
+ * @throws TemplateError on an unrecognized bare name or a missing directory.
32
+ * @throws DesignPackageError (from `readDesignPackage`, never caught here) on
33
+ * a malformed package — naming the file and the field.
34
+ */
35
+ export declare function resolveDesign(ref: string, opts: {
36
+ designsDir: string;
37
+ cwd?: string;
38
+ }): ResolvedDesign;
39
+ /**
40
+ * Render a compiled theme's `theme:` frontmatter block (D5) — `theme:`, each
41
+ * treatment present as a bare `key: value`, then `colors:` with `light:`/
42
+ * `dark:` sub-blocks, each colour slot as `slot: <JSON.stringify(value)>` in
43
+ * `DESIGN_COLOR_MAP`'s order. Ends with a trailing newline.
44
+ */
45
+ export declare function renderThemeBlock(theme: CompiledDesignTheme): string;
46
+ /**
47
+ * Splice a compiled theme into `text`'s frontmatter `theme:` block (D5),
48
+ * replacing an existing one in place or inserting a fresh one immediately
49
+ * before the closing `---` when the frontmatter carries none. Nothing
50
+ * outside the block moves — for every committed `_site.mdx` and its own
51
+ * design, this is the identity function (byte-identity floor, AC-4).
52
+ *
53
+ * @throws TemplateError when `text` carries no frontmatter to write into.
54
+ */
55
+ export declare function spliceThemeBlock(text: string, theme: CompiledDesignTheme, file: string): string;
56
+ /**
57
+ * Install a design's `sample/` directory onto a scaffold (spec 6892 D4) — a
58
+ * FIXED, undeclared convention, not a design-package field: `sample/content/**`
59
+ * lands at the scaffold's `content/**`, `sample/public/**` at
60
+ * `apps/web/public/**`. A design with no `sample/` directory (e.g. `standard`)
61
+ * installs nothing.
62
+ *
63
+ * Refuses — before its first write, so a refused sample leaves `targetDir`
64
+ * untouched — any file outside those two roots, or any `.ts`/`.tsx`/`.js`/
65
+ * `.mjs` file (content only, the template §5.2 rule this design package
66
+ * amendment carries over). Every installed file's destination is recorded in
67
+ * `ownership` as `design:<name>` (`readDesignPackage(designDir).name`), the
68
+ * same call-scoped registry `installBundleTree` writes into.
69
+ *
70
+ * @throws Error on a file outside `content/`/`public/`, or a forbidden extension.
71
+ */
72
+ export declare function installDesignSample(opts: {
73
+ designDir: string;
74
+ targetDir: string;
75
+ ownership: LayerOwnership;
76
+ }): void;
@@ -0,0 +1,220 @@
1
+ /**
2
+ * Resolve a `--design` reference (a shipped name, or a directory holding a
3
+ * `DESIGN.md`) to its design package, and splice the compiled theme it
4
+ * produces into a scaffold's `content/_site.mdx` (#6813, spec
5
+ * docs/specs/6813-design-accepts-a-package-path-spec.md D2/D5).
6
+ *
7
+ * `resolveDesign` is the one resolver every front door (the CLI, `scaffold()`,
8
+ * `verify-scaffold.mjs`) passes a design reference through, before any
9
+ * network request or write (D8). It never touches `import.meta.url` — every
10
+ * directory it reads is supplied by the caller — so it stays importable from
11
+ * Jest's CJS transform, unlike `programmatic.ts`.
12
+ */
13
+ import { copyFileSync, existsSync, mkdirSync, readdirSync, statSync, } from "node:fs";
14
+ import { join, relative, resolve, sep } from "node:path";
15
+ import { isDeepStrictEqual } from "node:util";
16
+ import { DESIGN_COLOR_MAP } from "./design-compile.js";
17
+ import { readDesignPackage } from "./design-package.js";
18
+ import { FREE_DESIGNS } from "./lib/module-license-gate.js";
19
+ import { STARTER_DESIGNS, TemplateError } from "./template-manifest.js";
20
+ /** `path` is an existing DIRECTORY — a file at `path` is not (mirrors `parse-args.ts`'s own helper). */
21
+ function isExistingDir(path) {
22
+ try {
23
+ return statSync(path).isDirectory();
24
+ }
25
+ catch {
26
+ return false;
27
+ }
28
+ }
29
+ /**
30
+ * Resolve a design reference to its package (D2). Classification mirrors
31
+ * `parse-args.ts`'s `parseDesign` (D1) exactly, so a programmatic caller
32
+ * accepts the same inputs the CLI does: a value with no `/` or `\` that
33
+ * names a recognized design resolves to `<designsDir>/<name>`; otherwise, if
34
+ * it names an existing directory (relative to `opts.cwd`), it resolves as a
35
+ * path; otherwise it is refused. A value with a separator is always a path.
36
+ *
37
+ * A path's package is compared, by deep equality, against each shipped
38
+ * design's own package: a byte-identical copy of a shipped design IS that
39
+ * design (`recorded`/`free` follow the shipped name), and any authored
40
+ * change makes it a distinct, non-Free design named by its own `pkg.name`.
41
+ *
42
+ * @throws TemplateError on an unrecognized bare name or a missing directory.
43
+ * @throws DesignPackageError (from `readDesignPackage`, never caught here) on
44
+ * a malformed package — naming the file and the field.
45
+ */
46
+ export function resolveDesign(ref, opts) {
47
+ const cwd = opts.cwd ?? process.cwd();
48
+ const hasSeparator = ref.includes("/") || ref.includes("\\");
49
+ if (!hasSeparator && STARTER_DESIGNS.includes(ref)) {
50
+ const dir = join(opts.designsDir, ref);
51
+ return {
52
+ kind: "name",
53
+ dir,
54
+ pkg: readDesignPackage(dir),
55
+ recorded: ref,
56
+ display: ref,
57
+ free: FREE_DESIGNS.includes(ref),
58
+ };
59
+ }
60
+ const dir = resolve(cwd, ref);
61
+ if (!isExistingDir(dir)) {
62
+ throw new TemplateError(hasSeparator
63
+ ? `design directory "${ref}" does not exist`
64
+ : `unknown design "${ref}". Declared: ${STARTER_DESIGNS.join(", ")}`);
65
+ }
66
+ const pkg = readDesignPackage(dir);
67
+ for (const name of STARTER_DESIGNS) {
68
+ if (isDeepStrictEqual(pkg, readDesignPackage(join(opts.designsDir, name)))) {
69
+ return {
70
+ kind: "path",
71
+ dir,
72
+ pkg,
73
+ recorded: name,
74
+ display: dir,
75
+ free: FREE_DESIGNS.includes(name),
76
+ };
77
+ }
78
+ }
79
+ return { kind: "path", dir, pkg, recorded: pkg.name, display: dir, free: false };
80
+ }
81
+ /** The runtime colour slots, in `DESIGN_COLOR_MAP`'s light-mode row order — the order every committed `theme:` block uses. */
82
+ const RUNTIME_COLOR_SLOT_ORDER = DESIGN_COLOR_MAP.filter((row) => row.mode === "light").map((row) => row.runtime);
83
+ /**
84
+ * Render a compiled theme's `theme:` frontmatter block (D5) — `theme:`, each
85
+ * treatment present as a bare `key: value`, then `colors:` with `light:`/
86
+ * `dark:` sub-blocks, each colour slot as `slot: <JSON.stringify(value)>` in
87
+ * `DESIGN_COLOR_MAP`'s order. Ends with a trailing newline.
88
+ */
89
+ export function renderThemeBlock(theme) {
90
+ const lines = ["theme:"];
91
+ if (theme.corners !== undefined)
92
+ lines.push(` corners: ${theme.corners}`);
93
+ if (theme.eyebrowCase !== undefined)
94
+ lines.push(` eyebrowCase: ${theme.eyebrowCase}`);
95
+ if (theme.placeholders !== undefined)
96
+ lines.push(` placeholders: ${theme.placeholders}`);
97
+ if (theme.checkmarks !== undefined)
98
+ lines.push(` checkmarks: ${theme.checkmarks}`);
99
+ lines.push(" colors:");
100
+ for (const mode of ["light", "dark"]) {
101
+ lines.push(` ${mode}:`);
102
+ const palette = theme.colors[mode];
103
+ for (const slot of RUNTIME_COLOR_SLOT_ORDER) {
104
+ lines.push(` ${slot}: ${JSON.stringify(palette[slot])}`);
105
+ }
106
+ }
107
+ return `${lines.join("\n")}\n`;
108
+ }
109
+ /**
110
+ * Splice a compiled theme into `text`'s frontmatter `theme:` block (D5),
111
+ * replacing an existing one in place or inserting a fresh one immediately
112
+ * before the closing `---` when the frontmatter carries none. Nothing
113
+ * outside the block moves — for every committed `_site.mdx` and its own
114
+ * design, this is the identity function (byte-identity floor, AC-4).
115
+ *
116
+ * @throws TemplateError when `text` carries no frontmatter to write into.
117
+ */
118
+ export function spliceThemeBlock(text, theme, file) {
119
+ const lines = text.split("\n");
120
+ let closeIdx = -1;
121
+ if (lines[0] === "---") {
122
+ for (let i = 1; i < lines.length; i += 1) {
123
+ if (lines[i] === "---") {
124
+ closeIdx = i;
125
+ break;
126
+ }
127
+ }
128
+ }
129
+ if (closeIdx === -1) {
130
+ throw new TemplateError(`${file}: no frontmatter to write the theme into`);
131
+ }
132
+ const rendered = renderThemeBlock(theme).split("\n");
133
+ rendered.pop(); // drop the trailing "" the render's final "\n" split off
134
+ let themeStart = -1;
135
+ let themeEnd = -1;
136
+ for (let i = 1; i < closeIdx; i += 1) {
137
+ if (lines[i] === "theme:") {
138
+ themeStart = i;
139
+ let j = i + 1;
140
+ while (j < closeIdx && (lines[j] === "" || lines[j].startsWith(" "))) {
141
+ j += 1;
142
+ }
143
+ themeEnd = j;
144
+ break;
145
+ }
146
+ }
147
+ const next = themeStart === -1
148
+ ? [...lines.slice(0, closeIdx), ...rendered, ...lines.slice(closeIdx)]
149
+ : [...lines.slice(0, themeStart), ...rendered, ...lines.slice(themeEnd)];
150
+ return next.join("\n");
151
+ }
152
+ /** Forbidden extensions for a design sample's files (spec 6892 D4) — content only, never code. */
153
+ const SAMPLE_FORBIDDEN_EXTENSIONS = [".ts", ".tsx", ".js", ".mjs"];
154
+ function hasSampleForbiddenExtension(p) {
155
+ return SAMPLE_FORBIDDEN_EXTENSIONS.some((ext) => p.toLowerCase().endsWith(ext));
156
+ }
157
+ /** Every file under `dir`, as `/`-separated paths relative to `dir`. */
158
+ function listFiles(dir) {
159
+ const out = [];
160
+ const stack = [dir];
161
+ for (let cur = stack.pop(); cur !== undefined; cur = stack.pop()) {
162
+ for (const entry of readdirSync(cur, { withFileTypes: true })) {
163
+ const abs = join(cur, entry.name);
164
+ if (entry.isDirectory())
165
+ stack.push(abs);
166
+ else if (entry.isFile())
167
+ out.push(relative(dir, abs).split(sep).join("/"));
168
+ }
169
+ }
170
+ return out;
171
+ }
172
+ /** Where one `sample/` file lands on a scaffold (spec 6892 D4's fixed convention). */
173
+ function sampleDestination(rel) {
174
+ if (rel.startsWith("content/"))
175
+ return rel;
176
+ return `apps/web/public/${rel.slice("public/".length)}`;
177
+ }
178
+ /**
179
+ * Install a design's `sample/` directory onto a scaffold (spec 6892 D4) — a
180
+ * FIXED, undeclared convention, not a design-package field: `sample/content/**`
181
+ * lands at the scaffold's `content/**`, `sample/public/**` at
182
+ * `apps/web/public/**`. A design with no `sample/` directory (e.g. `standard`)
183
+ * installs nothing.
184
+ *
185
+ * Refuses — before its first write, so a refused sample leaves `targetDir`
186
+ * untouched — any file outside those two roots, or any `.ts`/`.tsx`/`.js`/
187
+ * `.mjs` file (content only, the template §5.2 rule this design package
188
+ * amendment carries over). Every installed file's destination is recorded in
189
+ * `ownership` as `design:<name>` (`readDesignPackage(designDir).name`), the
190
+ * same call-scoped registry `installBundleTree` writes into.
191
+ *
192
+ * @throws Error on a file outside `content/`/`public/`, or a forbidden extension.
193
+ */
194
+ export function installDesignSample(opts) {
195
+ const sampleDir = join(opts.designDir, "sample");
196
+ if (!existsSync(sampleDir))
197
+ return;
198
+ const name = readDesignPackage(opts.designDir).name;
199
+ const subject = `design:${name}`;
200
+ // README.md at the sample root is the ONE documented exception (spec 6892
201
+ // D5: "the narrative sections move to designs/<name>/sample/README.md,
202
+ // which is not installed") — every other file is real content and is
203
+ // validated against the two roots below.
204
+ const files = listFiles(sampleDir).filter((rel) => rel !== "README.md");
205
+ for (const rel of files) {
206
+ if (!rel.startsWith("content/") && !rel.startsWith("public/")) {
207
+ throw new Error(`${subject}: sample file "${rel}" is outside content/ and public/ (spec 6892 D4)`);
208
+ }
209
+ if (hasSampleForbiddenExtension(rel)) {
210
+ throw new Error(`${subject}: sample file "${rel}" is a code file — a design sample is content only (spec 6892 D4)`);
211
+ }
212
+ }
213
+ for (const rel of files) {
214
+ const destinationRel = sampleDestination(rel);
215
+ const destinationAbs = resolve(opts.targetDir, destinationRel);
216
+ mkdirSync(join(destinationAbs, ".."), { recursive: true });
217
+ copyFileSync(join(sampleDir, rel), destinationAbs);
218
+ opts.ownership.set(destinationRel, subject);
219
+ }
220
+ }
package/dist/index.d.ts CHANGED
@@ -5,10 +5,11 @@
5
5
  */
6
6
  export { copyTemplate, type CopyTemplateOptions } from "./copy.js";
7
7
  export { parseCliArgs, parseModules, ParseError, helpText, RECOGNIZED_MODULES, type ModuleName, type CliOptions, } from "./parse-args.js";
8
- export { CATALOG_TARGET_PATH, FREE_MODULES, addModule, LicenseRequiredError, PAID_MODULES, classifyModules, formatSurfaceDrift, scaffold, scaffoldSync, syncArchitectureSync, syncCatalogSync, syncRoutesSync, type AddModuleOptions, type ResolvePaidModulesOptions, type ScaffoldOptions, type ScaffoldResult, type SyncArchitectureOptions, type SyncArchitectureResult, type SyncCatalogResult, type SyncRoutesSyncOptions, } from "./programmatic.js";
8
+ export { CATALOG_TARGET_PATH, FREE_MODULES, addModule, LicenseRequiredError, PAID_MODULES, classifyModules, formatSurfaceDrift, scaffold, scaffoldSync, syncArchitectureSync, syncCatalogSync, syncClaudeMdSync, syncRoutesSync, type AddModuleOptions, type ResolvePaidModulesOptions, type ScaffoldOptions, type ScaffoldResult, type SyncArchitectureOptions, type SyncArchitectureResult, type SyncCatalogResult, type SyncClaudeMdResult, type SyncRoutesSyncOptions, } from "./programmatic.js";
9
9
  export { DEFAULT_AILK_MODULE_REGISTRY_URL, FetchModuleError, fetchModule, type FetchModuleOptions, } from "./lib/fetch-module.js";
10
10
  export { extractModuleBundle, type ExistingFilePolicy, type ExtractModuleBundleOptions, type InstallReportRow, } from "./lib/extract-module-bundle.js";
11
11
  export { ADD_MODULE_HELP, AddModuleRefusedError, applyModuleToScaffold, formatAddModuleReport, parseAddModuleArgs, type AddModuleReportRow, type AddModuleResult, type ApplyModuleOptions, } from "./add-module.js";
12
+ export { APPLY_DESIGN_HELP, applyDesign, formatApplyDesignReport, parseApplyDesignArgs, type ApplyDesignArgs, type ApplyDesignChange, type ApplyDesignOptions, type ApplyDesignResult, } from "./apply-design.js";
12
13
  export { SITE_ROSTER_PATH, readSiteRoster, siteRosterProblems, } from "./site-roster.js";
13
14
  export { SYNC_ROUTES_HELP, formatSyncRoutesReport, listTemplateRouteDirs, parseSyncRoutesArgs, syncRoutes, type RouteReport, type SyncRoutesOptions, type SyncRoutesResult, } from "./sync-routes.js";
14
15
  export { deriveArchitecture } from "./derive-architecture.js";
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@
5
5
  */
6
6
  export { copyTemplate } from "./copy.js";
7
7
  export { parseCliArgs, parseModules, ParseError, helpText, RECOGNIZED_MODULES, } from "./parse-args.js";
8
- export { CATALOG_TARGET_PATH, FREE_MODULES, addModule, LicenseRequiredError, PAID_MODULES, classifyModules, formatSurfaceDrift, scaffold, scaffoldSync, syncArchitectureSync, syncCatalogSync, syncRoutesSync, } from "./programmatic.js";
8
+ export { CATALOG_TARGET_PATH, FREE_MODULES, addModule, LicenseRequiredError, PAID_MODULES, classifyModules, formatSurfaceDrift, scaffold, scaffoldSync, syncArchitectureSync, syncCatalogSync, syncClaudeMdSync, syncRoutesSync, } from "./programmatic.js";
9
9
  // The paid-module fetch/extract primitives (K1, #5089 — Flavor 3). Exported
10
10
  // so tooling (and this repo's own evidence-run scripts) can drive the fetch
11
11
  // path directly without re-implementing its shape.
@@ -14,6 +14,9 @@ export { extractModuleBundle, } from "./lib/extract-module-bundle.js";
14
14
  // `create-ailk add-module` (#6653) — apply a purchased module to an existing
15
15
  // site in place. The pure core, beside `sync-routes`'s.
16
16
  export { ADD_MODULE_HELP, AddModuleRefusedError, applyModuleToScaffold, formatAddModuleReport, parseAddModuleArgs, } from "./add-module.js";
17
+ // `create-ailk apply-design` (#6819) — make an existing site wear a design,
18
+ // changing only its look. The pure core, beside `add-module`'s.
19
+ export { APPLY_DESIGN_HELP, applyDesign, formatApplyDesignReport, parseApplyDesignArgs, } from "./apply-design.js";
17
20
  // The site's page roster of record and its install-diff check (#6682).
18
21
  export { SITE_ROSTER_PATH, readSiteRoster, siteRosterProblems, } from "./site-roster.js";
19
22
  // `create-ailk sync-routes` (#4986) — the template-route drift check + copy.
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Frozen, published-generator `renderNavConfig` bodies (#6908 D2) — one per
3
+ * era a create-ailk release ever shipped (E1–E4, `docs/specs/6908-add-module-
4
+ * treats-every-pre-spec.md` § 1.2). `surfaces.ts`'s own `renderNavConfig`
5
+ * self-hashes its output (D1) so a nav it wrote can always prove itself; a
6
+ * nav written before the stamp existed carries none, and this module is the
7
+ * only way `add-module` can still recognize it as unedited.
8
+ *
9
+ * Each `render` below is copied VERBATIM from the named tag's own
10
+ * `packages/create-ailk/src/surfaces.ts`, at the named commit, with exactly
11
+ * two changes from the original:
12
+ *
13
+ * - `GATEABLE_SURFACES` is replaced by a frozen `{ id, navLabelKey }` table
14
+ * of that tag's own entries, in that tag's own order (the era's own
15
+ * `<era>_SURFACES` constant below) — so a later change to today's
16
+ * `GATEABLE_SURFACES` can never move a byte of a legacy render.
17
+ * - the `@working-theory/ui` import line stays fragment-assembled, exactly
18
+ * as the original does, so THIS file never contains the literal import
19
+ * string either (`tools/lint-architecture.ts` matches source text; see
20
+ * the comment on each `navItemImport` below).
21
+ *
22
+ * The list is CLOSED (D2): after D1 ships, every published generator is
23
+ * unstamped only up to 0.8.0 (E4), so a future generator change never needs a
24
+ * fifth entry. Fixtures produced by each tag's own code (never by this
25
+ * vendored copy) pin these bodies exactly — see
26
+ * `__tests__/fixtures/legacy-nav/index.json`.
27
+ */
28
+ /** One published nav-generator era, and the renderer that reproduces it byte-for-byte. */
29
+ export interface LegacyNavRenderer {
30
+ /** Era label, E1–E4 (spec § 1.2). */
31
+ era: string;
32
+ /** Every published create-ailk tag that shipped this exact `renderNavConfig` body. */
33
+ tags: readonly string[];
34
+ /** The representative tag commit the body and fixtures were taken from. */
35
+ commit: string;
36
+ /** Render this era's nav for an enabled surface set — no `options`; no published era before #6878 D6 took one. */
37
+ render(enabled: readonly string[]): string;
38
+ }
39
+ /**
40
+ * The closed set of published, pre-stamp `renderNavConfig` bodies (D2).
41
+ * `add-module`'s `isUneditedNav` tries these, in order, against an unstamped
42
+ * nav (`surfaces.ts` `readNavConfigStamp` returning `"absent"`) before giving
43
+ * up and reporting it as customer-edited.
44
+ */
45
+ export declare const LEGACY_NAV_RENDERERS: readonly LegacyNavRenderer[];