bsmnt 0.4.0 → 0.4.2

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 (536) hide show
  1. package/dist/{helpers/add → application/add-hooks}/index.d.ts +4 -4
  2. package/dist/application/add-hooks/index.d.ts.map +1 -0
  3. package/dist/{helpers/add → application/add-hooks}/index.js +22 -35
  4. package/dist/application/add-hooks/index.js.map +1 -0
  5. package/dist/{utils → application/add-integration}/format-results.d.ts +1 -6
  6. package/dist/application/add-integration/format-results.d.ts.map +1 -0
  7. package/dist/{utils → application/add-integration}/format-results.js +1 -6
  8. package/dist/application/add-integration/format-results.js.map +1 -0
  9. package/dist/{helpers/integrate → application/add-integration}/index.d.ts +2 -1
  10. package/dist/application/add-integration/index.d.ts.map +1 -0
  11. package/dist/{helpers/integrate → application/add-integration}/index.js +46 -41
  12. package/dist/application/add-integration/index.js.map +1 -0
  13. package/dist/application/create-project/build-context.d.ts +9 -0
  14. package/dist/application/create-project/build-context.d.ts.map +1 -0
  15. package/dist/application/create-project/build-context.js +13 -0
  16. package/dist/application/create-project/build-context.js.map +1 -0
  17. package/dist/application/create-project/index.d.ts +44 -0
  18. package/dist/application/create-project/index.d.ts.map +1 -0
  19. package/dist/application/create-project/index.js +70 -0
  20. package/dist/application/create-project/index.js.map +1 -0
  21. package/dist/application/create-project/map-selection-to-registry.d.ts +3 -0
  22. package/dist/application/create-project/map-selection-to-registry.d.ts.map +1 -0
  23. package/dist/application/create-project/map-selection-to-registry.js +30 -0
  24. package/dist/application/create-project/map-selection-to-registry.js.map +1 -0
  25. package/dist/application/create-project/resolve-selection.d.ts +15 -0
  26. package/dist/application/create-project/resolve-selection.d.ts.map +1 -0
  27. package/dist/application/create-project/resolve-selection.js +11 -0
  28. package/dist/application/create-project/resolve-selection.js.map +1 -0
  29. package/dist/{helpers/skills → application/install-skills}/index.d.ts +1 -1
  30. package/dist/application/install-skills/index.d.ts.map +1 -0
  31. package/dist/{helpers/skills → application/install-skills}/index.js +31 -44
  32. package/dist/application/install-skills/index.js.map +1 -0
  33. package/dist/{utils/detect-project.d.ts → application/shared/project-detection.d.ts} +8 -15
  34. package/dist/application/shared/project-detection.d.ts.map +1 -0
  35. package/dist/{utils/detect-project.js → application/shared/project-detection.js} +8 -24
  36. package/dist/application/shared/project-detection.js.map +1 -0
  37. package/dist/core/create/build-plan.d.ts +8 -0
  38. package/dist/core/create/build-plan.d.ts.map +1 -0
  39. package/dist/core/create/build-plan.js +89 -0
  40. package/dist/core/create/build-plan.js.map +1 -0
  41. package/dist/core/create/execute-plan.d.ts +23 -0
  42. package/dist/core/create/execute-plan.d.ts.map +1 -0
  43. package/dist/core/create/execute-plan.js +23 -0
  44. package/dist/core/create/execute-plan.js.map +1 -0
  45. package/dist/core/create/internal-ids.d.ts +23 -0
  46. package/dist/core/create/internal-ids.d.ts.map +1 -0
  47. package/dist/core/create/internal-ids.js +36 -0
  48. package/dist/core/create/internal-ids.js.map +1 -0
  49. package/dist/core/create/registry.d.ts +12 -0
  50. package/dist/core/create/registry.d.ts.map +1 -0
  51. package/dist/core/create/registry.js +33 -0
  52. package/dist/core/create/registry.js.map +1 -0
  53. package/dist/core/create/types.d.ts +96 -0
  54. package/dist/core/create/types.d.ts.map +1 -0
  55. package/dist/core/create/types.js +2 -0
  56. package/dist/core/create/types.js.map +1 -0
  57. package/dist/domain/agents.d.ts +61 -0
  58. package/dist/domain/agents.d.ts.map +1 -0
  59. package/dist/domain/agents.js +35 -0
  60. package/dist/domain/agents.js.map +1 -0
  61. package/dist/domain/animations.d.ts +20 -0
  62. package/dist/domain/animations.d.ts.map +1 -0
  63. package/dist/domain/animations.js +13 -0
  64. package/dist/domain/animations.js.map +1 -0
  65. package/dist/domain/cms.d.ts +24 -0
  66. package/dist/domain/cms.d.ts.map +1 -0
  67. package/dist/domain/cms.js +13 -0
  68. package/dist/domain/cms.js.map +1 -0
  69. package/dist/domain/hooks.d.ts +67 -0
  70. package/dist/domain/hooks.d.ts.map +1 -0
  71. package/dist/domain/hooks.js +52 -0
  72. package/dist/domain/hooks.js.map +1 -0
  73. package/dist/domain/skills.d.ts +70 -0
  74. package/dist/domain/skills.d.ts.map +1 -0
  75. package/dist/domain/skills.js +84 -0
  76. package/dist/domain/skills.js.map +1 -0
  77. package/dist/domain/templates.d.ts +51 -0
  78. package/dist/domain/templates.d.ts.map +1 -0
  79. package/dist/domain/templates.js +27 -0
  80. package/dist/domain/templates.js.map +1 -0
  81. package/dist/index.js +124 -115
  82. package/dist/index.js.map +1 -1
  83. package/dist/infrastructure/agents/register-sanity-mcp.d.ts +12 -0
  84. package/dist/infrastructure/agents/register-sanity-mcp.d.ts.map +1 -0
  85. package/dist/infrastructure/agents/register-sanity-mcp.js +153 -0
  86. package/dist/infrastructure/agents/register-sanity-mcp.js.map +1 -0
  87. package/dist/infrastructure/create/apply-copy-paths.d.ts +3 -0
  88. package/dist/infrastructure/create/apply-copy-paths.d.ts.map +1 -0
  89. package/dist/infrastructure/create/apply-copy-paths.js +12 -0
  90. package/dist/infrastructure/create/apply-copy-paths.js.map +1 -0
  91. package/dist/infrastructure/create/apply-merge-paths.d.ts +3 -0
  92. package/dist/infrastructure/create/apply-merge-paths.d.ts.map +1 -0
  93. package/dist/infrastructure/create/apply-merge-paths.js +17 -0
  94. package/dist/infrastructure/create/apply-merge-paths.js.map +1 -0
  95. package/dist/infrastructure/create/apply-package-json.d.ts +8 -0
  96. package/dist/infrastructure/create/apply-package-json.d.ts.map +1 -0
  97. package/dist/infrastructure/create/apply-package-json.js +46 -0
  98. package/dist/infrastructure/create/apply-package-json.js.map +1 -0
  99. package/dist/infrastructure/create/copy-template.d.ts +10 -0
  100. package/dist/infrastructure/create/copy-template.d.ts.map +1 -0
  101. package/dist/infrastructure/create/copy-template.js.map +1 -0
  102. package/dist/infrastructure/create/executor.d.ts +3 -0
  103. package/dist/infrastructure/create/executor.d.ts.map +1 -0
  104. package/dist/infrastructure/create/executor.js +21 -0
  105. package/dist/infrastructure/create/executor.js.map +1 -0
  106. package/dist/{helpers/create/init-git.d.ts → infrastructure/create/init-git-repo.d.ts} +2 -3
  107. package/dist/infrastructure/create/init-git-repo.d.ts.map +1 -0
  108. package/dist/{helpers/create/init-git.js → infrastructure/create/init-git-repo.js} +1 -4
  109. package/dist/infrastructure/create/init-git-repo.js.map +1 -0
  110. package/dist/{helpers/create/install.d.ts → infrastructure/create/install-dependencies.d.ts} +1 -1
  111. package/dist/infrastructure/create/install-dependencies.d.ts.map +1 -0
  112. package/dist/{helpers/create/install.js → infrastructure/create/install-dependencies.js} +1 -1
  113. package/dist/infrastructure/create/install-dependencies.js.map +1 -0
  114. package/dist/infrastructure/create/lifecycle-registry.d.ts +3 -0
  115. package/dist/infrastructure/create/lifecycle-registry.d.ts.map +1 -0
  116. package/dist/infrastructure/create/lifecycle-registry.js +38 -0
  117. package/dist/infrastructure/create/lifecycle-registry.js.map +1 -0
  118. package/dist/infrastructure/create/merge-registry.d.ts +3 -0
  119. package/dist/infrastructure/create/merge-registry.d.ts.map +1 -0
  120. package/dist/infrastructure/create/merge-registry.js +27 -0
  121. package/dist/infrastructure/create/merge-registry.js.map +1 -0
  122. package/dist/infrastructure/create/rename-files.d.ts.map +1 -0
  123. package/dist/infrastructure/create/rename-files.js.map +1 -0
  124. package/dist/{helpers → infrastructure}/create/setup-agent.d.ts +9 -7
  125. package/dist/infrastructure/create/setup-agent.d.ts.map +1 -0
  126. package/dist/infrastructure/create/setup-agent.js +77 -0
  127. package/dist/infrastructure/create/setup-agent.js.map +1 -0
  128. package/dist/infrastructure/create/setup-sanity.d.ts.map +1 -0
  129. package/dist/{helpers → infrastructure}/create/setup-sanity.js +1 -19
  130. package/dist/infrastructure/create/setup-sanity.js.map +1 -0
  131. package/dist/infrastructure/integrations/inject-integration.d.ts +9 -0
  132. package/dist/infrastructure/integrations/inject-integration.d.ts.map +1 -0
  133. package/dist/{helpers/integrate/merge-orchestrator.js → infrastructure/integrations/inject-integration.js} +26 -38
  134. package/dist/infrastructure/integrations/inject-integration.js.map +1 -0
  135. package/dist/modules/features/agents/index.d.ts +3 -0
  136. package/dist/modules/features/agents/index.d.ts.map +1 -0
  137. package/dist/modules/features/agents/index.js +4 -0
  138. package/dist/modules/features/agents/index.js.map +1 -0
  139. package/dist/modules/features/agents/shared.d.ts +4 -0
  140. package/dist/modules/features/agents/shared.d.ts.map +1 -0
  141. package/dist/modules/features/agents/shared.js +21 -0
  142. package/dist/modules/features/agents/shared.js.map +1 -0
  143. package/dist/{configs/animations.d.ts → modules/features/animation/config.d.ts} +1 -1
  144. package/dist/modules/features/animation/config.d.ts.map +1 -0
  145. package/dist/{configs/animations.js → modules/features/animation/config.js} +1 -1
  146. package/dist/modules/features/animation/config.js.map +1 -0
  147. package/dist/modules/features/animation/gsap.d.ts +3 -0
  148. package/dist/modules/features/animation/gsap.d.ts.map +1 -0
  149. package/dist/modules/features/animation/gsap.js +16 -0
  150. package/dist/modules/features/animation/gsap.js.map +1 -0
  151. package/dist/modules/features/animation/index.d.ts +3 -0
  152. package/dist/modules/features/animation/index.d.ts.map +1 -0
  153. package/dist/modules/features/animation/index.js +4 -0
  154. package/dist/modules/features/animation/index.js.map +1 -0
  155. package/dist/modules/features/animation/motion.d.ts +3 -0
  156. package/dist/modules/features/animation/motion.d.ts.map +1 -0
  157. package/dist/modules/features/animation/motion.js +16 -0
  158. package/dist/modules/features/animation/motion.js.map +1 -0
  159. package/dist/modules/features/cms/index.d.ts +3 -0
  160. package/dist/modules/features/cms/index.d.ts.map +1 -0
  161. package/dist/modules/features/cms/index.js +7 -0
  162. package/dist/modules/features/cms/index.js.map +1 -0
  163. package/dist/modules/features/cms/sanity/config.d.ts.map +1 -0
  164. package/dist/{helpers/integrate → modules/features/cms}/sanity/config.js +3 -2
  165. package/dist/modules/features/cms/sanity/config.js.map +1 -0
  166. package/dist/modules/features/cms/sanity/index.d.ts +3 -0
  167. package/dist/modules/features/cms/sanity/index.d.ts.map +1 -0
  168. package/dist/modules/features/cms/sanity/index.js +61 -0
  169. package/dist/modules/features/cms/sanity/index.js.map +1 -0
  170. package/dist/{helpers/integrate/sanity/mergers/check-integration-merger.d.ts → modules/features/cms/sanity/mergers/check-integration.d.ts} +1 -1
  171. package/dist/modules/features/cms/sanity/mergers/check-integration.d.ts.map +1 -0
  172. package/dist/{helpers/integrate/sanity/mergers/check-integration-merger.js → modules/features/cms/sanity/mergers/check-integration.js} +1 -1
  173. package/dist/modules/features/cms/sanity/mergers/check-integration.js.map +1 -0
  174. package/dist/{helpers/integrate/sanity/mergers/layout-merger.d.ts → modules/features/cms/sanity/mergers/layout.d.ts} +1 -1
  175. package/dist/modules/features/cms/sanity/mergers/layout.d.ts.map +1 -0
  176. package/dist/{helpers/integrate/sanity/mergers/layout-merger.js → modules/features/cms/sanity/mergers/layout.js} +1 -1
  177. package/dist/modules/features/cms/sanity/mergers/layout.js.map +1 -0
  178. package/dist/modules/features/cms/sanity/mergers/sitemap.d.ts +13 -0
  179. package/dist/modules/features/cms/sanity/mergers/sitemap.d.ts.map +1 -0
  180. package/dist/modules/features/cms/sanity/mergers/sitemap.js +92 -0
  181. package/dist/modules/features/cms/sanity/mergers/sitemap.js.map +1 -0
  182. package/dist/modules/features/cms/sanity-pagebuilder/config.d.ts +14 -0
  183. package/dist/modules/features/cms/sanity-pagebuilder/config.d.ts.map +1 -0
  184. package/dist/modules/features/cms/sanity-pagebuilder/config.js +44 -0
  185. package/dist/modules/features/cms/sanity-pagebuilder/config.js.map +1 -0
  186. package/dist/modules/features/cms/sanity-pagebuilder/index.d.ts +3 -0
  187. package/dist/modules/features/cms/sanity-pagebuilder/index.d.ts.map +1 -0
  188. package/dist/modules/features/cms/sanity-pagebuilder/index.js +46 -0
  189. package/dist/modules/features/cms/sanity-pagebuilder/index.js.map +1 -0
  190. package/dist/modules/features/hooks/factory.d.ts +4 -0
  191. package/dist/modules/features/hooks/factory.d.ts.map +1 -0
  192. package/dist/modules/features/hooks/factory.js +26 -0
  193. package/dist/modules/features/hooks/factory.js.map +1 -0
  194. package/dist/modules/features/hooks/index.d.ts +3 -0
  195. package/dist/modules/features/hooks/index.d.ts.map +1 -0
  196. package/dist/modules/features/hooks/index.js +4 -0
  197. package/dist/modules/features/hooks/index.js.map +1 -0
  198. package/dist/modules/presets/index.d.ts +3 -0
  199. package/dist/modules/presets/index.d.ts.map +1 -0
  200. package/dist/modules/presets/index.js +11 -0
  201. package/dist/modules/presets/index.js.map +1 -0
  202. package/dist/modules/presets/next-default.d.ts +3 -0
  203. package/dist/modules/presets/next-default.d.ts.map +1 -0
  204. package/dist/modules/presets/next-default.js +9 -0
  205. package/dist/modules/presets/next-default.js.map +1 -0
  206. package/dist/modules/presets/next-experiments.d.ts +3 -0
  207. package/dist/modules/presets/next-experiments.d.ts.map +1 -0
  208. package/dist/modules/presets/next-experiments.js +9 -0
  209. package/dist/modules/presets/next-experiments.js.map +1 -0
  210. package/dist/modules/presets/next-pagebuilder.d.ts +3 -0
  211. package/dist/modules/presets/next-pagebuilder.d.ts.map +1 -0
  212. package/dist/modules/presets/next-pagebuilder.js +10 -0
  213. package/dist/modules/presets/next-pagebuilder.js.map +1 -0
  214. package/dist/modules/presets/next-webgl.d.ts +3 -0
  215. package/dist/modules/presets/next-webgl.d.ts.map +1 -0
  216. package/dist/modules/presets/next-webgl.js +9 -0
  217. package/dist/modules/presets/next-webgl.js.map +1 -0
  218. package/dist/paths.d.ts +7 -1
  219. package/dist/paths.d.ts.map +1 -1
  220. package/dist/paths.js +8 -2
  221. package/dist/paths.js.map +1 -1
  222. package/index.js +2 -2
  223. package/package.json +11 -4
  224. package/src/modules/features/cms/sanity/files/.knip.json +8 -0
  225. package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/api/blog/[slug]/route.ts +3 -4
  226. package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/api/revalidate/route.ts +1 -4
  227. package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/blog/[slug]/page.tsx +8 -9
  228. package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/layout.tsx +2 -2
  229. package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/sitemap.md/route.ts +18 -29
  230. package/src/modules/features/cms/sanity/files/app/sitemap.xml/route.ts +51 -0
  231. package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/env.ts +2 -4
  232. package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/queries.ts +0 -42
  233. package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schemas/index.ts +1 -1
  234. package/src/modules/features/cms/sanity/files/lib/scripts/copy-sanity-mcp.ts +23 -0
  235. package/src/modules/features/cms/sanity/files/lib/scripts/generate-page.ts +297 -0
  236. package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/utils/json-ld.tsx +1 -6
  237. package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/utils/metadata.ts +2 -2
  238. package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/utils/url.ts +4 -2
  239. package/src/{helpers/integrate → modules/features/cms}/sanity/files/proxy.ts +11 -11
  240. package/src/template-hooks/use-device-perf.ts +27 -17
  241. package/src/templates/next-default/.env.example +3 -3
  242. package/src/templates/next-default/.vscode/extensions.json +1 -5
  243. package/src/templates/next-default/.vscode/settings.json +1 -1
  244. package/src/templates/next-default/.zed/settings.json +47 -0
  245. package/src/templates/next-default/README.md +7 -6
  246. package/src/templates/next-default/_gitignore +1 -3
  247. package/src/templates/next-default/app/layout.tsx +21 -35
  248. package/src/templates/next-default/app/robots.ts +3 -4
  249. package/src/templates/next-default/app/sitemap.xml/route.ts +29 -29
  250. package/src/templates/next-default/biome.json +9 -2
  251. package/src/templates/next-default/components/ui/image/index.tsx +2 -1
  252. package/src/templates/next-default/components/ui/link/index.tsx +35 -35
  253. package/src/templates/next-default/lefthook.yml +25 -0
  254. package/src/templates/next-default/lib/README.md +8 -4
  255. package/src/templates/next-default/lib/hooks/use-media.ts +6 -3
  256. package/src/templates/next-default/lib/scripts/dev.ts +32 -0
  257. package/src/templates/next-default/lib/styles/README.md +13 -0
  258. package/src/templates/next-default/lib/styles/fonts.ts +20 -0
  259. package/src/templates/next-default/lib/styles/global.css +15 -196
  260. package/src/templates/next-default/lib/styles/index.css +3 -0
  261. package/src/templates/next-default/lib/styles/tokens.css +182 -0
  262. package/src/templates/next-default/lib/utils/README.md +40 -0
  263. package/src/templates/next-default/lib/utils/easings.ts +240 -0
  264. package/src/templates/next-default/lib/utils/fetch.ts +84 -0
  265. package/src/templates/next-default/lib/utils/global-css.d.ts +1 -0
  266. package/src/templates/next-default/lib/utils/json-ld.tsx +70 -68
  267. package/src/templates/next-default/lib/utils/math.ts +236 -0
  268. package/src/templates/next-default/lib/utils/metadata.ts +26 -27
  269. package/src/templates/next-default/lib/utils/strings.ts +246 -0
  270. package/src/templates/next-default/lib/utils/types.d.ts +15 -0
  271. package/src/templates/next-default/lib/utils/url.ts +8 -5
  272. package/src/templates/next-default/lib/utils/viewport.ts +199 -0
  273. package/src/templates/next-default/package.json +12 -7
  274. package/src/templates/next-default/svg.d.ts +1 -0
  275. package/src/templates/next-experiments/.env.example +3 -3
  276. package/src/templates/next-experiments/.knip.json +3 -0
  277. package/src/templates/next-experiments/.vscode/extensions.json +1 -5
  278. package/src/templates/next-experiments/.vscode/settings.json +1 -1
  279. package/src/templates/next-experiments/.zed/settings.json +47 -0
  280. package/src/templates/next-experiments/README.md +7 -6
  281. package/src/templates/next-experiments/_gitignore +1 -3
  282. package/src/templates/next-experiments/app/layout.tsx +21 -35
  283. package/src/templates/next-experiments/app/robots.ts +5 -2
  284. package/src/templates/next-experiments/app/sitemap.xml/route.ts +51 -0
  285. package/src/templates/next-experiments/biome.json +4 -2
  286. package/src/templates/next-experiments/components/layout/navigation-menu.tsx +1 -1
  287. package/src/templates/next-experiments/components/layout/wrapper/index.tsx +6 -6
  288. package/src/templates/next-experiments/components/ui/image/index.tsx +33 -33
  289. package/src/templates/next-experiments/lib/README.md +8 -4
  290. package/src/templates/next-experiments/lib/hooks/use-media.ts +6 -3
  291. package/src/templates/next-experiments/lib/scripts/dev.ts +32 -0
  292. package/src/templates/next-experiments/lib/styles/README.md +13 -0
  293. package/src/templates/next-experiments/lib/styles/fonts.ts +20 -0
  294. package/src/templates/next-experiments/lib/styles/global.css +16 -196
  295. package/src/templates/next-experiments/lib/styles/index.css +3 -0
  296. package/src/templates/next-experiments/lib/styles/tokens.css +182 -0
  297. package/src/templates/next-experiments/lib/utils/README.md +40 -0
  298. package/src/templates/next-experiments/lib/utils/easings.ts +240 -0
  299. package/src/templates/next-experiments/lib/utils/fetch.ts +84 -0
  300. package/src/templates/next-experiments/lib/utils/global-css.d.ts +1 -0
  301. package/src/templates/next-experiments/lib/utils/json-ld.tsx +70 -68
  302. package/src/templates/next-experiments/lib/utils/math.ts +236 -0
  303. package/src/templates/next-experiments/lib/utils/metadata.ts +26 -27
  304. package/src/templates/next-experiments/lib/utils/strings.ts +246 -0
  305. package/src/templates/next-experiments/lib/utils/types.d.ts +15 -0
  306. package/src/templates/next-experiments/lib/utils/url.ts +8 -5
  307. package/src/templates/next-experiments/lib/utils/viewport.ts +199 -0
  308. package/src/templates/next-experiments/package.json +6 -6
  309. package/src/templates/next-experiments/svg.d.ts +1 -0
  310. package/src/templates/next-pagebuilder/.vscode/extensions.json +16 -0
  311. package/src/templates/next-pagebuilder/.vscode/settings.json +105 -0
  312. package/src/templates/next-pagebuilder/.zed/settings.json +47 -0
  313. package/src/templates/next-pagebuilder/_gitignore +1 -3
  314. package/src/templates/next-pagebuilder/app/(content)/[[...slug]]/page.tsx +17 -8
  315. package/src/templates/next-pagebuilder/app/(content)/layout.tsx +18 -7
  316. package/src/templates/next-pagebuilder/app/actions/refresh.ts +5 -0
  317. package/src/templates/next-pagebuilder/app/robots.ts +3 -4
  318. package/src/templates/next-pagebuilder/biome.json +17 -0
  319. package/src/templates/next-pagebuilder/components/layout/footer/index.tsx +17 -22
  320. package/src/templates/next-pagebuilder/components/layout/header/index.tsx +3 -5
  321. package/src/templates/next-pagebuilder/components/layout/json-ld/index.tsx +11 -10
  322. package/src/templates/next-pagebuilder/components/layout/wrapper/index.tsx +14 -4
  323. package/src/templates/next-pagebuilder/components/page-builder/components/article-content/index.tsx +4 -9
  324. package/src/templates/next-pagebuilder/components/page-builder/components/article-content/related-post-item.tsx +4 -4
  325. package/src/templates/next-pagebuilder/components/page-builder/components/{post-collection → content-collection}/content-card.tsx +2 -2
  326. package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/content-filters.tsx +93 -0
  327. package/src/templates/next-pagebuilder/components/page-builder/components/{post-collection → content-collection}/content-grid.tsx +7 -9
  328. package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/content-pagination-nav.tsx +71 -0
  329. package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/index.tsx +219 -0
  330. package/src/templates/next-pagebuilder/components/page-builder/components/{post-collection → content-collection}/types.ts +7 -4
  331. package/src/templates/next-pagebuilder/components/page-builder/renderer.tsx +17 -5
  332. package/src/templates/next-pagebuilder/components/page-builder/types.ts +9 -7
  333. package/src/templates/next-pagebuilder/components/page-document/index.tsx +19 -4
  334. package/src/templates/next-pagebuilder/lefthook.yml +25 -0
  335. package/src/templates/next-pagebuilder/lib/integrations/sanity/sanity.types.ts +208 -0
  336. package/src/templates/next-pagebuilder/lib/styles/global.css +0 -1
  337. package/src/templates/next-pagebuilder/next.config.ts +1 -0
  338. package/src/templates/next-pagebuilder/package.json +13 -26
  339. package/src/templates/next-pagebuilder/postcss.config.mjs +27 -1
  340. package/src/templates/next-pagebuilder/svg.d.ts +1 -0
  341. package/src/templates/next-webgl/.env.example +3 -3
  342. package/src/templates/next-webgl/.vscode/extensions.json +1 -5
  343. package/src/templates/next-webgl/.vscode/settings.json +1 -1
  344. package/src/templates/next-webgl/.zed/settings.json +47 -0
  345. package/src/templates/next-webgl/README.md +7 -6
  346. package/src/templates/next-webgl/_gitignore +1 -3
  347. package/src/templates/next-webgl/app/layout.tsx +21 -35
  348. package/src/templates/next-webgl/app/robots.ts +3 -4
  349. package/src/templates/next-webgl/app/sitemap.xml/route.ts +29 -29
  350. package/src/templates/next-webgl/biome.json +9 -2
  351. package/src/templates/next-webgl/components/ui/image/index.tsx +2 -1
  352. package/src/templates/next-webgl/components/webgl/components/scene/index.tsx +0 -2
  353. package/src/templates/next-webgl/lefthook.yml +25 -0
  354. package/src/templates/next-webgl/lib/README.md +8 -4
  355. package/src/templates/next-webgl/lib/hooks/use-media.ts +6 -3
  356. package/src/templates/next-webgl/lib/scripts/dev.ts +32 -0
  357. package/src/templates/next-webgl/lib/styles/README.md +13 -0
  358. package/src/templates/next-webgl/lib/styles/fonts.ts +20 -0
  359. package/src/templates/next-webgl/lib/styles/global.css +16 -196
  360. package/src/templates/next-webgl/lib/styles/index.css +3 -0
  361. package/src/templates/next-webgl/lib/styles/tokens.css +182 -0
  362. package/src/templates/next-webgl/lib/utils/README.md +40 -0
  363. package/src/templates/next-webgl/lib/utils/easings.ts +240 -0
  364. package/src/templates/next-webgl/lib/utils/fetch.ts +84 -0
  365. package/src/templates/next-webgl/lib/utils/global-css.d.ts +1 -0
  366. package/src/templates/next-webgl/lib/utils/json-ld.tsx +70 -68
  367. package/src/templates/next-webgl/lib/utils/math.ts +236 -0
  368. package/src/templates/next-webgl/lib/utils/metadata.ts +26 -27
  369. package/src/templates/next-webgl/lib/utils/strings.ts +246 -0
  370. package/src/templates/next-webgl/lib/utils/types.d.ts +15 -0
  371. package/src/templates/next-webgl/lib/utils/url.ts +8 -5
  372. package/src/templates/next-webgl/lib/utils/viewport.ts +199 -0
  373. package/src/templates/next-webgl/package.json +13 -8
  374. package/src/templates/next-webgl/svg.d.ts +1 -0
  375. package/src/templates/next-webgl/tsconfig.tsbuildinfo +1 -1
  376. package/dist/configs/animations.d.ts.map +0 -1
  377. package/dist/configs/animations.js.map +0 -1
  378. package/dist/configs/skills.d.ts +0 -27
  379. package/dist/configs/skills.d.ts.map +0 -1
  380. package/dist/configs/skills.js +0 -18
  381. package/dist/configs/skills.js.map +0 -1
  382. package/dist/configs/skills.json +0 -26
  383. package/dist/helpers/add/hooks-config.d.ts +0 -22
  384. package/dist/helpers/add/hooks-config.d.ts.map +0 -1
  385. package/dist/helpers/add/hooks-config.js +0 -31
  386. package/dist/helpers/add/hooks-config.js.map +0 -1
  387. package/dist/helpers/add/index.d.ts.map +0 -1
  388. package/dist/helpers/add/index.js.map +0 -1
  389. package/dist/helpers/create/copy-template.d.ts +0 -11
  390. package/dist/helpers/create/copy-template.d.ts.map +0 -1
  391. package/dist/helpers/create/copy-template.js.map +0 -1
  392. package/dist/helpers/create/index.d.ts +0 -24
  393. package/dist/helpers/create/index.d.ts.map +0 -1
  394. package/dist/helpers/create/index.js +0 -99
  395. package/dist/helpers/create/index.js.map +0 -1
  396. package/dist/helpers/create/init-git.d.ts.map +0 -1
  397. package/dist/helpers/create/init-git.js.map +0 -1
  398. package/dist/helpers/create/install.d.ts.map +0 -1
  399. package/dist/helpers/create/install.js.map +0 -1
  400. package/dist/helpers/create/rename-files.d.ts.map +0 -1
  401. package/dist/helpers/create/rename-files.js.map +0 -1
  402. package/dist/helpers/create/setup-agent.d.ts.map +0 -1
  403. package/dist/helpers/create/setup-agent.js +0 -91
  404. package/dist/helpers/create/setup-agent.js.map +0 -1
  405. package/dist/helpers/create/setup-sanity.d.ts.map +0 -1
  406. package/dist/helpers/create/setup-sanity.js.map +0 -1
  407. package/dist/helpers/create/update-package.d.ts +0 -20
  408. package/dist/helpers/create/update-package.d.ts.map +0 -1
  409. package/dist/helpers/create/update-package.js +0 -97
  410. package/dist/helpers/create/update-package.js.map +0 -1
  411. package/dist/helpers/integrate/index.d.ts.map +0 -1
  412. package/dist/helpers/integrate/index.js.map +0 -1
  413. package/dist/helpers/integrate/merge-config.d.ts +0 -21
  414. package/dist/helpers/integrate/merge-config.d.ts.map +0 -1
  415. package/dist/helpers/integrate/merge-config.js +0 -42
  416. package/dist/helpers/integrate/merge-config.js.map +0 -1
  417. package/dist/helpers/integrate/merge-orchestrator.d.ts +0 -10
  418. package/dist/helpers/integrate/merge-orchestrator.d.ts.map +0 -1
  419. package/dist/helpers/integrate/merge-orchestrator.js.map +0 -1
  420. package/dist/helpers/integrate/sanity/config.d.ts.map +0 -1
  421. package/dist/helpers/integrate/sanity/config.js.map +0 -1
  422. package/dist/helpers/integrate/sanity/mergers/check-integration-merger.d.ts.map +0 -1
  423. package/dist/helpers/integrate/sanity/mergers/check-integration-merger.js.map +0 -1
  424. package/dist/helpers/integrate/sanity/mergers/layout-merger.d.ts.map +0 -1
  425. package/dist/helpers/integrate/sanity/mergers/layout-merger.js.map +0 -1
  426. package/dist/helpers/integrate/sanity/mergers/sitemap-merger.d.ts +0 -11
  427. package/dist/helpers/integrate/sanity/mergers/sitemap-merger.d.ts.map +0 -1
  428. package/dist/helpers/integrate/sanity/mergers/sitemap-merger.js +0 -133
  429. package/dist/helpers/integrate/sanity/mergers/sitemap-merger.js.map +0 -1
  430. package/dist/helpers/skills/index.d.ts.map +0 -1
  431. package/dist/helpers/skills/index.js.map +0 -1
  432. package/dist/utils/detect-project.d.ts.map +0 -1
  433. package/dist/utils/detect-project.js.map +0 -1
  434. package/dist/utils/format-results.d.ts.map +0 -1
  435. package/dist/utils/format-results.js.map +0 -1
  436. package/src/helpers/integrate/sanity/files/lib/integrations/sanity/WEBHOOK-SETUP.md +0 -74
  437. package/src/helpers/integrate/sanity/files/lib/integrations/sanity/sitemap.ts +0 -90
  438. package/src/template-hooks/config.js +0 -32
  439. package/src/templates/next-default/css.d.ts +0 -1
  440. package/src/templates/next-default/lib/utils/portable-text-to-markdown.ts +0 -83
  441. package/src/templates/next-default/tsconfig.tsbuildinfo +0 -1
  442. package/src/templates/next-experiments/css.d.ts +0 -1
  443. package/src/templates/next-experiments/lib/utils/portable-text-to-markdown.ts +0 -83
  444. package/src/templates/next-pagebuilder/app/api/[[...slug]]/route.ts +0 -100
  445. package/src/templates/next-pagebuilder/app/api/draft-mode/disable/route.ts +0 -7
  446. package/src/templates/next-pagebuilder/app/api/draft-mode/enable/route.ts +0 -20
  447. package/src/templates/next-pagebuilder/app/api/revalidate/route.ts +0 -121
  448. package/src/templates/next-pagebuilder/app/sitemap.md/route.ts +0 -124
  449. package/src/templates/next-pagebuilder/app/studio/[[...tool]]/page.tsx +0 -8
  450. package/src/templates/next-pagebuilder/components/page-builder/components/post-collection/index.tsx +0 -28
  451. package/src/templates/next-pagebuilder/components/sanity/draft-mode-toggle.tsx +0 -27
  452. package/src/templates/next-pagebuilder/components/sanity/rich-text.tsx +0 -87
  453. package/src/templates/next-pagebuilder/components/sanity/visual-editing.tsx +0 -27
  454. package/src/templates/next-pagebuilder/components/ui/sanity-image/index.tsx +0 -41
  455. package/src/templates/next-pagebuilder/lib/integrations/check-integration.ts +0 -5
  456. package/src/templates/next-pagebuilder/lib/integrations/sanity/client.ts +0 -27
  457. package/src/templates/next-pagebuilder/lib/integrations/sanity/components/disable-draft-mode.tsx +0 -23
  458. package/src/templates/next-pagebuilder/lib/integrations/sanity/components/page-builder-input.tsx +0 -36
  459. package/src/templates/next-pagebuilder/lib/integrations/sanity/components/page-category-input.tsx +0 -50
  460. package/src/templates/next-pagebuilder/lib/integrations/sanity/components/rich-text.tsx +0 -84
  461. package/src/templates/next-pagebuilder/lib/integrations/sanity/confirm-publish-action.ts +0 -40
  462. package/src/templates/next-pagebuilder/lib/integrations/sanity/env.ts +0 -34
  463. package/src/templates/next-pagebuilder/lib/integrations/sanity/fetchers/layout.ts +0 -35
  464. package/src/templates/next-pagebuilder/lib/integrations/sanity/icons.ts +0 -58
  465. package/src/templates/next-pagebuilder/lib/integrations/sanity/live/index.tsx +0 -61
  466. package/src/templates/next-pagebuilder/lib/integrations/sanity/markdown-proxy.config.ts +0 -50
  467. package/src/templates/next-pagebuilder/lib/integrations/sanity/page-builder-config.ts +0 -132
  468. package/src/templates/next-pagebuilder/lib/integrations/sanity/page-category.ts +0 -28
  469. package/src/templates/next-pagebuilder/lib/integrations/sanity/queries.ts +0 -281
  470. package/src/templates/next-pagebuilder/lib/integrations/sanity/sanity.cli.ts +0 -29
  471. package/src/templates/next-pagebuilder/lib/integrations/sanity/sanity.config.ts +0 -211
  472. package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/components/index.ts +0 -4
  473. package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/components/reusable/blog-content.ts +0 -89
  474. package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/components/reusable/description.ts +0 -29
  475. package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/components/reusable/hero.ts +0 -28
  476. package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/components/singleton/content-collection.ts +0 -45
  477. package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/content/author.ts +0 -70
  478. package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/content/blog-category.ts +0 -55
  479. package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/index.ts +0 -96
  480. package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/layout/company-data.ts +0 -62
  481. package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/layout/footer.ts +0 -79
  482. package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/layout/navbar.ts +0 -74
  483. package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/link.ts +0 -125
  484. package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/logo-field.ts +0 -9
  485. package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/metadata.ts +0 -68
  486. package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/nav-objects.ts +0 -192
  487. package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/page-builder.ts +0 -39
  488. package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/page-folder.ts +0 -124
  489. package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/page.ts +0 -232
  490. package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/richText.ts +0 -63
  491. package/src/templates/next-pagebuilder/lib/integrations/sanity/singletons.ts +0 -44
  492. package/src/templates/next-pagebuilder/lib/integrations/sanity/structure.ts +0 -453
  493. package/src/templates/next-pagebuilder/lib/integrations/sanity/utils/image.ts +0 -8
  494. package/src/templates/next-pagebuilder/lib/integrations/sanity/utils/link.ts +0 -137
  495. package/src/templates/next-pagebuilder/lib/integrations/sanity/utils/page-builder-markdown.ts +0 -81
  496. package/src/templates/next-pagebuilder/lib/scripts/sanity-typegen.ts +0 -45
  497. package/src/templates/next-pagebuilder/lib/utils/json-ld.tsx +0 -213
  498. package/src/templates/next-pagebuilder/lib/utils/metadata.ts +0 -167
  499. package/src/templates/next-pagebuilder/lib/utils/sitemap.ts +0 -37
  500. package/src/templates/next-pagebuilder/proxy.ts +0 -81
  501. package/src/templates/next-webgl/css.d.ts +0 -1
  502. package/src/templates/next-webgl/lib/utils/portable-text-to-markdown.ts +0 -83
  503. package/dist/{helpers → infrastructure}/create/copy-template.js +0 -0
  504. package/dist/{helpers → infrastructure}/create/rename-files.d.ts +0 -0
  505. package/dist/{helpers → infrastructure}/create/rename-files.js +0 -0
  506. package/dist/{helpers → infrastructure}/create/setup-sanity.d.ts +0 -0
  507. package/dist/{helpers/integrate → modules/features/cms}/sanity/config.d.ts +0 -0
  508. package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/api/draft-mode/disable/route.ts +0 -0
  509. package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/api/draft-mode/enable/route.ts +0 -0
  510. package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/studio/[[...tool]]/page.tsx +0 -0
  511. package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/studio/layout.tsx +0 -0
  512. package/src/{helpers/integrate → modules/features/cms}/sanity/files/components/ui/sanity-image/index.tsx +0 -0
  513. package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/README.md +0 -0
  514. package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/check-integration.ts +0 -0
  515. package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/MARKDOWN-PROXY.md +0 -0
  516. package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/README.md +0 -0
  517. package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/client.ts +0 -0
  518. package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/components/disable-draft-mode.tsx +0 -0
  519. package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/components/rich-text.tsx +0 -0
  520. package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/confirm-publish-action.ts +0 -0
  521. package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/live/index.tsx +1 -1
  522. package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/markdown-proxy.config.ts +0 -0
  523. package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/sanity.cli.ts +0 -0
  524. package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/sanity.config.ts +1 -1
  525. /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/sanity.types.ts +0 -0
  526. /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schema.json +0 -0
  527. /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schemas/article.ts +0 -0
  528. /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schemas/example.ts +0 -0
  529. /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schemas/link.ts +0 -0
  530. /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schemas/metadata.ts +0 -0
  531. /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schemas/navigation.ts +0 -0
  532. /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schemas/richText.ts +0 -0
  533. /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/structure.ts +0 -0
  534. /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/utils/image.ts +0 -0
  535. /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/utils/link.ts +0 -0
  536. /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/utils/portable-text-to-markdown.ts +0 -0
@@ -1,14 +1,14 @@
1
+ import { type HookId } from "../../domain/hooks.js";
1
2
  /**
2
3
  * Copy selected hook files from the template-hooks source directory into the
3
4
  * target project's `hooks/` directory.
4
5
  *
5
- * Only hooks whose filenames appear in the {@link hooksConfig} manifest are
6
- * considered valid. Unknown filenames are silently skipped.
6
+ * Only hooks whose ids appear in the shared hook catalog are considered valid.
7
7
  *
8
8
  * @param targetDir - Absolute path to the scaffolded project directory
9
- * @param hookNames - Array of hook filenames to install (e.g. `["use-battery.ts"]`)
9
+ * @param hookIds - Array of hook ids to install (e.g. `["use-battery"]`)
10
10
  */
11
- export declare function addHooks(targetDir: string, hookNames: string[]): Promise<void>;
11
+ export declare function addHooks(targetDir: string, hookIds: HookId[]): Promise<void>;
12
12
  /**
13
13
  * Interactive flow for adding hooks to an existing project.
14
14
  * Validates the project, prompts for hook selection, copies files,
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/application/add-hooks/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAIN,KAAK,MAAM,EACX,MAAM,uBAAuB,CAAC;AAG/B;;;;;;;;GAQG;AACH,wBAAsB,QAAQ,CAC7B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EAAE,GACf,OAAO,CAAC,IAAI,CAAC,CAgBf;AAQD;;;;GAIG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CA4HlD"}
@@ -3,30 +3,26 @@ import fs from "fs-extra";
3
3
  import ora from "ora";
4
4
  import pc from "picocolors";
5
5
  import prompts from "prompts";
6
+ import { expandHookSelection, HOOK_CATALOG, HOOKS, } from "../../domain/hooks.js";
6
7
  import { TEMPLATE_HOOKS_DIR } from "../../paths.js";
7
- import { hooksConfig } from "./hooks-config.js";
8
8
  /**
9
9
  * Copy selected hook files from the template-hooks source directory into the
10
10
  * target project's `hooks/` directory.
11
11
  *
12
- * Only hooks whose filenames appear in the {@link hooksConfig} manifest are
13
- * considered valid. Unknown filenames are silently skipped.
12
+ * Only hooks whose ids appear in the shared hook catalog are considered valid.
14
13
  *
15
14
  * @param targetDir - Absolute path to the scaffolded project directory
16
- * @param hookNames - Array of hook filenames to install (e.g. `["use-battery.ts"]`)
15
+ * @param hookIds - Array of hook ids to install (e.g. `["use-battery"]`)
17
16
  */
18
- export async function addHooks(targetDir, hookNames) {
19
- if (hookNames.length === 0)
17
+ export async function addHooks(targetDir, hookIds) {
18
+ if (hookIds.length === 0)
20
19
  return;
21
20
  const projectHooksDir = path.join(targetDir, "hooks");
22
21
  await fs.ensureDir(projectHooksDir);
23
- for (const hookFile of hookNames) {
24
- // Validate against the known manifest
25
- const known = hooksConfig.find((h) => h.file === hookFile);
26
- if (!known)
27
- continue;
28
- const sourcePath = path.join(TEMPLATE_HOOKS_DIR, hookFile);
29
- const destPath = path.join(projectHooksDir, hookFile);
22
+ for (const hookId of hookIds) {
23
+ const hook = HOOKS[hookId];
24
+ const sourcePath = path.join(TEMPLATE_HOOKS_DIR, hook.file);
25
+ const destPath = path.join(projectHooksDir, hook.file);
30
26
  if (await fs.pathExists(sourcePath)) {
31
27
  await fs.copy(sourcePath, destPath);
32
28
  }
@@ -39,19 +35,16 @@ export async function addHooks(targetDir, hookNames) {
39
35
  */
40
36
  export async function addToProject() {
41
37
  const targetDir = process.cwd();
42
- // 1. Validate current directory has a package.json
43
38
  const pkgPath = path.join(targetDir, "package.json");
44
39
  if (!(await fs.pathExists(pkgPath))) {
45
40
  console.log(pc.red("\n No package.json found in the current directory."));
46
41
  console.log(pc.yellow(" Make sure you're in a project directory.\n"));
47
42
  return;
48
43
  }
49
- // 2. Detect src/ prefix for hooks directory
50
44
  const usesSrc = await fs.pathExists(path.join(targetDir, "src/app"));
51
45
  const hooksDir = usesSrc
52
46
  ? path.join(targetDir, "src/hooks")
53
47
  : path.join(targetDir, "hooks");
54
- // 3. Prompt for what to add
55
48
  const { category } = (await prompts({
56
49
  type: "select",
57
50
  name: "category",
@@ -69,52 +62,47 @@ export async function addToProject() {
69
62
  return;
70
63
  }
71
64
  if (category === "hooks") {
72
- // 4. Check which hooks are already installed
73
65
  const installedHooks = new Set();
74
- for (const hook of hooksConfig) {
66
+ for (const hook of HOOK_CATALOG) {
75
67
  const hookPath = path.join(hooksDir, hook.file);
76
68
  if (await fs.pathExists(hookPath)) {
77
- installedHooks.add(hook.file);
69
+ installedHooks.add(hook.id);
78
70
  }
79
71
  }
80
- const availableHooks = hooksConfig.filter((h) => !installedHooks.has(h.file));
72
+ const availableHooks = HOOK_CATALOG.filter((hook) => !installedHooks.has(hook.id));
81
73
  if (availableHooks.length === 0) {
82
74
  console.log(pc.green("\n All available hooks are already installed.\n"));
83
75
  return;
84
76
  }
85
- // 5. Prompt for hook selection
86
77
  const { selectedHooks } = (await prompts({
87
78
  type: "multiselect",
88
79
  name: "selectedHooks",
89
80
  message: "Select hooks to add:",
90
81
  choices: availableHooks.map((h) => ({
91
- title: h.name,
92
- value: h.file,
82
+ title: h.label,
83
+ value: h.id,
93
84
  })),
94
85
  }));
95
86
  if (!selectedHooks || selectedHooks.length === 0) {
96
87
  console.log(pc.yellow("\n No hooks selected.\n"));
97
88
  return;
98
89
  }
99
- // 6. Copy hooks and inject dependencies
90
+ const hooksToInstall = expandHookSelection(selectedHooks);
100
91
  const spinner = ora("Adding hooks...").start();
101
92
  try {
102
- // Copy hook files
103
93
  await fs.ensureDir(hooksDir);
104
- for (const hookFile of selectedHooks) {
105
- const sourcePath = path.join(TEMPLATE_HOOKS_DIR, hookFile);
106
- const destPath = path.join(hooksDir, hookFile);
94
+ for (const hookId of hooksToInstall) {
95
+ const hook = HOOKS[hookId];
96
+ const sourcePath = path.join(TEMPLATE_HOOKS_DIR, hook.file);
97
+ const destPath = path.join(hooksDir, hook.file);
107
98
  if (await fs.pathExists(sourcePath)) {
108
99
  await fs.copy(sourcePath, destPath);
109
100
  }
110
101
  }
111
- // Inject dependencies into package.json
112
102
  const pkg = (await fs.readJson(pkgPath));
113
103
  let depsAdded = false;
114
- for (const hookFile of selectedHooks) {
115
- const hookCfg = hooksConfig.find((h) => h.file === hookFile);
116
- if (!hookCfg)
117
- continue;
104
+ for (const hookId of hooksToInstall) {
105
+ const hookCfg = HOOKS[hookId];
118
106
  if (Object.keys(hookCfg.dependencies).length > 0) {
119
107
  pkg.dependencies = {
120
108
  ...pkg.dependencies,
@@ -139,9 +127,8 @@ export async function addToProject() {
139
127
  spinner.fail("Failed to add hooks");
140
128
  throw error;
141
129
  }
142
- // 7. Summary
143
130
  const hookNames = selectedHooks
144
- .map((f) => hooksConfig.find((h) => h.file === f)?.name ?? f)
131
+ .map((hookId) => HOOKS[hookId].label)
145
132
  .join(", ");
146
133
  console.log(`\n ${pc.bold(pc.green("Done!"))} Added: ${pc.cyan(hookNames)}`);
147
134
  console.log(`\n ${pc.bold("Next steps:")}`);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/application/add-hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EACN,mBAAmB,EACnB,YAAY,EACZ,KAAK,GAEL,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;;;;;;;GAQG;AACH,MAAM,CAA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,CACV,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAChE,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QAC7C,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;QACxC,OAAO,CAAC,GAAG,EAAE,CAAC;IACf,CAAC;AACF,CAAC"}
@@ -13,12 +13,7 @@ export interface MergeResults {
13
13
  skipped?: SkippedEntry[];
14
14
  failed?: FailedEntry[];
15
15
  }
16
- /**
17
- * Format merge results for display with colored output.
18
- *
19
- * Accepts results from injectIntegration or injectLayer and returns
20
- * an array of human-readable, color-coded lines.
21
- */
16
+ /** Convert merge results into human-readable, colorized terminal lines. */
22
17
  export declare function formatMergeResults(results: MergeResults): string[];
23
18
  export {};
24
19
  //# sourceMappingURL=format-results.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-results.d.ts","sourceRoot":"","sources":["../../../src/application/add-integration/format-results.ts"],"names":[],"mappings":"AAEA,UAAU,YAAY;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CACf;AAED,UAAU,WAAW;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;CACvB;AAED,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,EAAE,CAgClE"}
@@ -1,10 +1,5 @@
1
1
  import pc from "picocolors";
2
- /**
3
- * Format merge results for display with colored output.
4
- *
5
- * Accepts results from injectIntegration or injectLayer and returns
6
- * an array of human-readable, color-coded lines.
7
- */
2
+ /** Convert merge results into human-readable, colorized terminal lines. */
8
3
  export function formatMergeResults(results) {
9
4
  const lines = [];
10
5
  if (results.replaced && results.replaced.length > 0) {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-results.js","sourceRoot":"","sources":["../../../src/application/add-integration/format-results.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAoB5B,2EAA2E;AAC3E,MAAM,UAAU,kBAAkB,CAAC,OAAqB;IACvD,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrD,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5E,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjD,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACxE,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjD,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACvE,CAAC;IAED,IAAI,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACnD,KAAK,CAAC,IAAI,CACT,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAC5B,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CACjD,CACD,CAAC;IACH,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjD,KAAK,CAAC,IAAI,CACT,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAC3B,EAAE,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,GAAG,CAAC,CAC5C,CACD,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC"}
@@ -1,5 +1,6 @@
1
+ import { type CmsId } from "../../domain/cms.js";
1
2
  interface AddIntegrationOptions {
2
- cms?: string;
3
+ cms?: CmsId;
3
4
  }
4
5
  /**
5
6
  * Adds an integration to the current working directory project.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/application/add-integration/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAkB9D,UAAU,qBAAqB;IAC9B,GAAG,CAAC,EAAE,KAAK,CAAC;CACZ;AAuDD;;;;;;GAMG;AACH,wBAAsB,cAAc,CACnC,OAAO,GAAE,qBAA0B,GACjC,OAAO,CAAC,IAAI,CAAC,CA0Of"}
@@ -4,10 +4,15 @@ import fs from "fs-extra";
4
4
  import ora from "ora";
5
5
  import pc from "picocolors";
6
6
  import prompts from "prompts";
7
- import { checkExistingIntegration, validateNextProject, } from "../../utils/detect-project.js";
8
- import { formatMergeResults } from "../../utils/format-results.js";
9
- import { injectIntegration } from "./merge-orchestrator.js";
10
- import { sanityConfig } from "./sanity/config.js";
7
+ import { AGENT_CATALOG } from "../../domain/agents.js";
8
+ import { CMS_CATALOG } from "../../domain/cms.js";
9
+ import { buildSkillInstallCommand, getSkillInstallDefinition, } from "../../domain/skills.js";
10
+ import { getSanityMcpManualInstruction, registerSanityMcp, } from "../../infrastructure/agents/register-sanity-mcp.js";
11
+ import { setupSanity } from "../../infrastructure/create/setup-sanity.js";
12
+ import { injectIntegration } from "../../infrastructure/integrations/inject-integration.js";
13
+ import { sanityConfig } from "../../modules/features/cms/sanity/config.js";
14
+ import { checkExistingIntegration, validateNextProject, } from "../shared/project-detection.js";
15
+ import { formatMergeResults } from "./format-results.js";
11
16
  /**
12
17
  * Add CMS dependencies to package.json from integration config manifests.
13
18
  */
@@ -60,18 +65,16 @@ export async function addIntegration(options = {}) {
60
65
  validationSpinner.succeed(pc.green(`Found Next.js project: ${pc.cyan(validation.pkg.name ?? "unnamed")} (${projectStructure} structure)`));
61
66
  // 2. Select integration (or use flag)
62
67
  let integration = options.cms;
63
- if (!integration || integration === "none") {
68
+ if (!integration) {
64
69
  const { selectedIntegration } = (await prompts({
65
70
  type: "select",
66
71
  name: "selectedIntegration",
67
72
  message: "Which integration would you like to add?",
68
- choices: [
69
- {
70
- title: "Sanity CMS",
71
- description: "Headless CMS with real-time collaboration",
72
- value: "sanity",
73
- },
74
- ],
73
+ choices: CMS_CATALOG.map((cms) => ({
74
+ title: cms.label,
75
+ description: cms.description,
76
+ value: cms.id,
77
+ })),
75
78
  }));
76
79
  if (!selectedIntegration) {
77
80
  console.log(pc.yellow("\nOperation cancelled.\n"));
@@ -125,45 +128,48 @@ export async function addIntegration(options = {}) {
125
128
  const message = e instanceof Error ? e.message : String(e);
126
129
  depsSpinner.warn(pc.yellow(`Failed to update package.json: ${message}`));
127
130
  }
128
- // 6. Register Sanity MCP Server + Agent Toolkit
131
+ // 6. Optional MCP registration + Agent Toolkit
129
132
  if (integration === "sanity") {
130
- // MCP registration (Claude Code only)
131
- const claudeDir = path.join(targetDir, ".claude");
132
- if (fs.existsSync(claudeDir)) {
133
- const mcpSpinner = ora("Registering Sanity MCP server...").start();
134
- try {
135
- execSync("claude mcp add Sanity -t http https://mcp.sanity.io --scope user", { stdio: "pipe" });
136
- mcpSpinner.succeed(pc.green("Sanity MCP server registered."));
137
- }
138
- catch (e) {
139
- const stderr = e instanceof Error && "stderr" in e
140
- ? String(e.stderr)
141
- : "";
142
- if (stderr.includes("already exists")) {
143
- mcpSpinner.succeed(pc.green("Sanity MCP server already registered."));
133
+ const detectedMcpAgents = AGENT_CATALOG.filter((agent) => fs.existsSync(path.join(targetDir, agent.folder)));
134
+ if (detectedMcpAgents.length > 0) {
135
+ const { mcpAgents } = (await prompts({
136
+ type: "multiselect",
137
+ name: "mcpAgents",
138
+ message: "Which agents should receive Sanity MCP setup?",
139
+ choices: detectedMcpAgents.map((agent) => ({
140
+ title: agent.label,
141
+ value: agent.id,
142
+ selected: true,
143
+ })),
144
+ min: 1,
145
+ hint: "Space to select, Enter to confirm",
146
+ }));
147
+ if (mcpAgents && mcpAgents.length > 0) {
148
+ const mcpSpinner = ora("Registering Sanity MCP server...").start();
149
+ const mcpResult = await registerSanityMcp(targetDir, mcpAgents);
150
+ if (mcpResult.failed.length === 0) {
151
+ mcpSpinner.succeed(pc.green("Sanity MCP server configured."));
144
152
  }
145
153
  else {
146
- mcpSpinner.warn(pc.yellow("Could not register Sanity MCP server. Run manually: claude mcp add Sanity -t http https://mcp.sanity.io --scope user"));
154
+ mcpSpinner.warn(pc.yellow("Sanity MCP setup completed with warnings."));
155
+ for (const failure of mcpResult.failed) {
156
+ const agent = AGENT_CATALOG.find((candidate) => candidate.id === failure.agent);
157
+ const label = agent?.label ?? failure.agent;
158
+ console.log(pc.yellow(` - ${label}: ${failure.reason || "Failed to configure automatically."}`));
159
+ console.log(pc.dim(` Manual: ${getSanityMcpManualInstruction(failure.agent)}`));
160
+ }
147
161
  }
148
162
  }
149
163
  }
150
164
  // Agent toolkit skills — detect all known agent directories
151
- const agentDirMap = {
152
- ".claude": "claude-code",
153
- ".opencode": "opencode",
154
- ".cursor": "cursor",
155
- ".codex": "codex",
156
- ".gemini": "gemini-cli",
157
- };
158
- const detectedAgents = Object.entries(agentDirMap)
159
- .filter(([dir]) => fs.existsSync(path.join(targetDir, dir)))
160
- .map(([, arg]) => arg);
165
+ const detectedAgents = AGENT_CATALOG.filter((agent) => fs.existsSync(path.join(targetDir, agent.folder))).map((agent) => agent.cliArg);
161
166
  if (detectedAgents.length > 0) {
162
167
  const skillsSpinner = ora("Installing Sanity agent toolkit...").start();
163
168
  let installed = false;
169
+ const install = getSkillInstallDefinition("sanity-agent-toolkit");
164
170
  for (const agentArg of detectedAgents) {
165
171
  try {
166
- execSync(`bunx skills add sanity-io/agent-toolkit -a ${agentArg} -y`, {
172
+ execSync(buildSkillInstallCommand("sanity-agent-toolkit", { agentArg }), {
167
173
  cwd: targetDir,
168
174
  stdio: "ignore",
169
175
  });
@@ -177,7 +183,7 @@ export async function addIntegration(options = {}) {
177
183
  skillsSpinner.succeed(pc.green("Sanity agent toolkit installed."));
178
184
  }
179
185
  else {
180
- skillsSpinner.warn(pc.yellow("Could not install Sanity agent toolkit. Add manually: bunx skills add sanity-io/agent-toolkit"));
186
+ skillsSpinner.warn(pc.yellow(`Could not install Sanity agent toolkit. Add manually: bunx skills add ${install.source}`));
181
187
  }
182
188
  }
183
189
  }
@@ -185,7 +191,6 @@ export async function addIntegration(options = {}) {
185
191
  let sanitySetupDone = false;
186
192
  if (integration === "sanity") {
187
193
  try {
188
- const { setupSanity } = await import("../create/setup-sanity.js");
189
194
  sanitySetupDone = await setupSanity(targetDir);
190
195
  }
191
196
  catch (e) {
@@ -0,0 +1 @@
1
+ {"version":3,"file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AAO,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;YACrD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC,CAAC;QAC/D,CAAC;IACF,CAAC;IAED,OAAO,CAAC,GAAG,EAAE,CAAC;AACf,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { CreateContext, CreateSelection } from "../../core/create/types.js";
2
+ export interface BuildCreateContextOptions {
3
+ projectName: string;
4
+ targetDir: string;
5
+ pathPrefix?: "" | "src/";
6
+ selection: CreateSelection;
7
+ }
8
+ export declare function buildCreateContext({ projectName, targetDir, pathPrefix, selection, }: BuildCreateContextOptions): CreateContext;
9
+ //# sourceMappingURL=build-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-context.d.ts","sourceRoot":"","sources":["../../../src/application/create-project/build-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,aAAa,EACb,eAAe,EACf,MAAM,4BAA4B,CAAC;AAEpC,MAAM,WAAW,yBAAyB;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,EAAE,GAAG,MAAM,CAAC;IACzB,SAAS,EAAE,eAAe,CAAC;CAC3B;AAED,wBAAgB,kBAAkB,CAAC,EAClC,WAAW,EACX,SAAS,EACT,UAAe,EACf,SAAS,GACT,EAAE,yBAAyB,GAAG,aAAa,CAW3C"}
@@ -0,0 +1,13 @@
1
+ export function buildCreateContext({ projectName, targetDir, pathPrefix = "", selection, }) {
2
+ return {
3
+ projectName,
4
+ targetDir,
5
+ pathPrefix,
6
+ template: selection.template,
7
+ cms: selection.cms,
8
+ animation: selection.animation,
9
+ agents: selection.agents,
10
+ hooks: selection.hooks,
11
+ };
12
+ }
13
+ //# sourceMappingURL=build-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-context.js","sourceRoot":"","sources":["../../../src/application/create-project/build-context.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,kBAAkB,CAAC,EAClC,WAAW,EACX,SAAS,EACT,UAAU,GAAG,EAAE,EACf,SAAS,GACkB;IAC3B,OAAO;QACN,WAAW;QACX,SAAS;QACT,UAAU;QACV,QAAQ,EAAE,SAAS,CAAC,QAAQ;QAC5B,GAAG,EAAE,SAAS,CAAC,GAAG;QAClB,SAAS,EAAE,SAAS,CAAC,SAAS;QAC9B,MAAM,EAAE,SAAS,CAAC,MAAM;QACxB,KAAK,EAAE,SAAS,CAAC,KAAK;KACtB,CAAC;AACH,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { type CreatePlanExecutor } from "../../core/create/execute-plan.js";
2
+ import { type CreateRegistry } from "../../core/create/registry.js";
3
+ import type { CreateSelection } from "../../core/create/types.js";
4
+ import type { AgentId } from "../../domain/agents.js";
5
+ import type { AnimationId } from "../../domain/animations.js";
6
+ import type { CmsId } from "../../domain/cms.js";
7
+ import type { HookId } from "../../domain/hooks.js";
8
+ import type { TemplateId } from "../../domain/templates.js";
9
+ import { type BuildCreateContextOptions } from "./build-context.js";
10
+ /** User-facing inputs collected by the `create` command. */
11
+ export interface CreateProjectOptions {
12
+ projectName: string;
13
+ targetDir: string;
14
+ template: TemplateId;
15
+ cms: CmsId | null;
16
+ animation: AnimationId | null;
17
+ agents: AgentId[];
18
+ hooks: HookId[];
19
+ }
20
+ /** High-level result returned to the CLI after project creation finishes. */
21
+ export interface CreateProjectResult {
22
+ success: boolean;
23
+ sanitySetupDone: boolean;
24
+ }
25
+ export interface RunComposableCreateProjectOptions extends Omit<BuildCreateContextOptions, "selection"> {
26
+ selection: CreateSelection;
27
+ registry: CreateRegistry;
28
+ executor: CreatePlanExecutor;
29
+ }
30
+ export interface RunComposableCreateProjectResult {
31
+ sanitySetupDone: boolean;
32
+ }
33
+ /**
34
+ * Resolve prompt selections into a composable plan and execute the full create
35
+ * pipeline through the infrastructure executor.
36
+ */
37
+ export declare function createProject(options: CreateProjectOptions): Promise<CreateProjectResult>;
38
+ /**
39
+ * Execute the scaffold pipeline in order: build context, build the plan,
40
+ * execute file/package work, run lifecycle hooks, then report post-create
41
+ * effects such as Sanity setup.
42
+ */
43
+ export declare function runComposableCreateProject({ selection, projectName, targetDir, pathPrefix, registry, executor, }: RunComposableCreateProjectOptions): Promise<RunComposableCreateProjectResult>;
44
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/application/create-project/index.ts"],"names":[],"mappings":"AACA,OAAO,EACN,KAAK,kBAAkB,EAEvB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EACN,KAAK,cAAc,EAEnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAO5D,OAAO,EACN,KAAK,yBAAyB,EAE9B,MAAM,oBAAoB,CAAC;AAI5B,4DAA4D;AAC5D,MAAM,WAAW,oBAAoB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,UAAU,CAAC;IACrB,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC;IAClB,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,6EAA6E;AAC7E,MAAM,WAAW,mBAAmB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,iCAChB,SAAQ,IAAI,CAAC,yBAAyB,EAAE,WAAW,CAAC;IACpD,SAAS,EAAE,eAAe,CAAC;IAC3B,QAAQ,EAAE,cAAc,CAAC;IACzB,QAAQ,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,WAAW,gCAAgC;IAChD,eAAe,EAAE,OAAO,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAsB,aAAa,CAClC,OAAO,EAAE,oBAAoB,GAC3B,OAAO,CAAC,mBAAmB,CAAC,CAgC9B;AAED;;;;GAIG;AACH,wBAAsB,0BAA0B,CAAC,EAChD,SAAS,EACT,WAAW,EACX,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,GACR,EAAE,iCAAiC,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAsB/E"}
@@ -0,0 +1,70 @@
1
+ import { buildCreatePlan } from "../../core/create/build-plan.js";
2
+ import { executeCreatePlan, } from "../../core/create/execute-plan.js";
3
+ import { CREATE_LIFECYCLE_STEP_IDS } from "../../core/create/internal-ids.js";
4
+ import { createRegistry, } from "../../core/create/registry.js";
5
+ import { createInfrastructureCreateExecutor } from "../../infrastructure/create/executor.js";
6
+ import { agentFeatures } from "../../modules/features/agents/index.js";
7
+ import { animationFeatures } from "../../modules/features/animation/index.js";
8
+ import { cmsFeatures } from "../../modules/features/cms/index.js";
9
+ import { hookFeatures } from "../../modules/features/hooks/index.js";
10
+ import { presetModules } from "../../modules/presets/index.js";
11
+ import { buildCreateContext, } from "./build-context.js";
12
+ import { mapSelectionToRegistry } from "./map-selection-to-registry.js";
13
+ import { resolveComposableCreateSelection } from "./resolve-selection.js";
14
+ /**
15
+ * Resolve prompt selections into a composable plan and execute the full create
16
+ * pipeline through the infrastructure executor.
17
+ */
18
+ export async function createProject(options) {
19
+ const { projectName, targetDir, template, cms, animation, agents, hooks } = options;
20
+ const selection = resolveComposableCreateSelection({
21
+ template,
22
+ cms,
23
+ animation,
24
+ agents,
25
+ hooks,
26
+ });
27
+ const result = await runComposableCreateProject({
28
+ selection,
29
+ projectName,
30
+ targetDir,
31
+ registry: createRegistry({
32
+ presets: presetModules,
33
+ features: [
34
+ ...cmsFeatures,
35
+ ...animationFeatures,
36
+ ...hookFeatures,
37
+ ...agentFeatures,
38
+ ],
39
+ }),
40
+ executor: createInfrastructureCreateExecutor(),
41
+ });
42
+ return {
43
+ success: true,
44
+ sanitySetupDone: result.sanitySetupDone,
45
+ };
46
+ }
47
+ /**
48
+ * Execute the scaffold pipeline in order: build context, build the plan,
49
+ * execute file/package work, run lifecycle hooks, then report post-create
50
+ * effects such as Sanity setup.
51
+ */
52
+ export async function runComposableCreateProject({ selection, projectName, targetDir, pathPrefix, registry, executor, }) {
53
+ const context = buildCreateContext({
54
+ selection,
55
+ projectName,
56
+ targetDir,
57
+ pathPrefix,
58
+ });
59
+ const registrySelection = mapSelectionToRegistry(selection);
60
+ const plan = buildCreatePlan({
61
+ selection: registrySelection,
62
+ context,
63
+ registry,
64
+ });
65
+ const executionResult = await executeCreatePlan(plan, context, executor);
66
+ return {
67
+ sanitySetupDone: executionResult.completedLifecycleStepIds.includes(CREATE_LIFECYCLE_STEP_IDS.sanitySetupProject),
68
+ };
69
+ }
70
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/application/create-project/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAEN,iBAAiB,GACjB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAEN,cAAc,GACd,MAAM,+BAA+B,CAAC;AAOvC,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACv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AS;QACT,WAAW;QACX,SAAS;QACT,UAAU;KACV,CAAC,CAAC;IACH,MAAM,iBAAiB,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAE5D,MAAM,IAAI,GAAG,eAAe,CAAC;QAC5B,SAAS,EAAE,iBAAiB;QAC5B,OAAO;QACP,QAAQ;KACR,CAAC,CAAC;IAEH,MAAM,eAAe,GAAG,MAAM,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAEzE,OAAO;QACN,eAAe,EAAE,eAAe,CAAC,yBAAyB,CAAC,QAAQ,CAClE,yBAAyB,CAAC,kBAAkB,CAC5C;KACD,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { CreateSelection, RegistrySelection } from "../../core/create/types.js";
2
+ export declare function mapSelectionToRegistry(selection: CreateSelection): RegistrySelection;
3
+ //# sourceMappingURL=map-selection-to-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map-selection-to-registry.d.ts","sourceRoot":"","sources":["../../../src/application/create-project/map-selection-to-registry.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACX,eAAe,EAEf,iBAAiB,EACjB,MAAM,4BAA4B,CAAC;AAEpC,wBAAgB,sBAAsB,CACrC,SAAS,EAAE,eAAe,GACxB,iBAAiB,CAYnB"}
@@ -0,0 +1,30 @@
1
+ import { AGENT_FEATURE_MODULE_IDS, ANIMATION_FEATURE_MODULE_IDS, CMS_FEATURE_MODULE_IDS, HOOK_FEATURE_MODULE_IDS, PRESET_MODULE_IDS, } from "../../core/create/internal-ids.js";
2
+ export function mapSelectionToRegistry(selection) {
3
+ const featureIds = [
4
+ mapCmsToFeatureId(selection.cms),
5
+ mapAnimationToFeatureId(selection.animation),
6
+ ...selection.agents.map(mapAgentToFeatureId),
7
+ ...selection.hooks.map(mapHookToFeatureId),
8
+ ].filter((featureId) => featureId !== null);
9
+ return {
10
+ presetId: PRESET_MODULE_IDS[selection.template],
11
+ featureIds,
12
+ };
13
+ }
14
+ function mapCmsToFeatureId(cms) {
15
+ if (cms === null)
16
+ return null;
17
+ return CMS_FEATURE_MODULE_IDS[cms];
18
+ }
19
+ function mapAnimationToFeatureId(animation) {
20
+ if (animation === null)
21
+ return null;
22
+ return ANIMATION_FEATURE_MODULE_IDS[animation];
23
+ }
24
+ function mapAgentToFeatureId(agent) {
25
+ return AGENT_FEATURE_MODULE_IDS[agent];
26
+ }
27
+ function mapHookToFeatureId(hook) {
28
+ return HOOK_FEATURE_MODULE_IDS[hook];
29
+ }
30
+ //# sourceMappingURL=map-selection-to-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map-selection-to-registry.js","sourceRoot":"","sources":["../../../src/application/create-project/map-selection-to-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,wBAAwB,EACxB,4BAA4B,EAC5B,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,GACjB,MAAM,mCAAmC,CAAC;AAO3C,MAAM,UAAU,sBAAsB,CACrC,SAA0B;IAE1B,MAAM,UAAU,GAAG;QAClB,iBAAiB,CAAC,SAAS,CAAC,GAAG,CAAC;QAChC,uBAAuB,CAAC,SAAS,CAAC,SAAS,CAAC;QAC5C,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC;QAC5C,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,kBAAkB,CAAC;KAC1C,CAAC,MAAM,CAAC,CAAC,SAAS,EAAgC,EAAE,CAAC,SAAS,KAAK,IAAI,CAAC,CAAC;IAE1E,OAAO;QACN,QAAQ,EAAE,iBAAiB,CAAC,SAAS,CAAC,QAAQ,CAAC;QAC/C,UAAU;KACV,CAAC;AACH,CAAC;AAED,SAAS,iBAAiB,CACzB,GAA2B;IAE3B,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC9B,OAAO,sBAAsB,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,uBAAuB,CAC/B,SAAuC;IAEvC,IAAI,SAAS,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACpC,OAAO,4BAA4B,CAAC,SAAS,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,mBAAmB,CAC3B,KAAwC;IAExC,OAAO,wBAAwB,CAAC,KAAK,CAAC,CAAC;AACxC,CAAC;AAED,SAAS,kBAAkB,CAC1B,IAAsC;IAEtC,OAAO,uBAAuB,CAAC,IAAI,CAAC,CAAC;AACtC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { CreateSelection } from "../../core/create/types.js";
2
+ import type { AgentId } from "../../domain/agents.js";
3
+ import type { AnimationId } from "../../domain/animations.js";
4
+ import type { CmsId } from "../../domain/cms.js";
5
+ import { type HookId } from "../../domain/hooks.js";
6
+ import type { TemplateId } from "../../domain/templates.js";
7
+ export interface ResolveComposableCreateSelectionOptions {
8
+ template: TemplateId;
9
+ cms: CmsId | null;
10
+ animation: AnimationId | null;
11
+ agents: AgentId[];
12
+ hooks: HookId[];
13
+ }
14
+ export declare function resolveComposableCreateSelection({ template, cms, animation, agents, hooks, }: ResolveComposableCreateSelectionOptions): CreateSelection;
15
+ //# sourceMappingURL=resolve-selection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-selection.d.ts","sourceRoot":"","sources":["../../../src/application/create-project/resolve-selection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,MAAM,WAAW,uCAAuC;IACvD,QAAQ,EAAE,UAAU,CAAC;IACrB,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC;IAClB,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,wBAAgB,gCAAgC,CAAC,EAChD,QAAQ,EACR,GAAG,EACH,SAAS,EACT,MAAM,EACN,KAAK,GACL,EAAE,uCAAuC,GAAG,eAAe,CAQ3D"}
@@ -0,0 +1,11 @@
1
+ import { expandHookSelection } from "../../domain/hooks.js";
2
+ export function resolveComposableCreateSelection({ template, cms, animation, agents, hooks, }) {
3
+ return {
4
+ template,
5
+ cms,
6
+ animation,
7
+ agents: [...new Set(agents)],
8
+ hooks: expandHookSelection([...new Set(hooks)]),
9
+ };
10
+ }
11
+ //# sourceMappingURL=resolve-selection.js.map