@fougere/cli 0.12.5-alpha.0 → 0.13.0-alpha.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 (350) hide show
  1. package/dist/.fougere/scan.generated.d.ts +3 -0
  2. package/dist/.fougere/scan.generated.d.ts.map +1 -0
  3. package/dist/.fougere/scan.generated.js +140 -0
  4. package/dist/.fougere/scan.generated.js.map +1 -0
  5. package/dist/app/commands/BuildCommand.d.ts +18 -0
  6. package/dist/app/commands/BuildCommand.d.ts.map +1 -0
  7. package/dist/app/commands/BuildCommand.js +35 -0
  8. package/dist/app/commands/BuildCommand.js.map +1 -0
  9. package/dist/app/commands/CallCommand.d.ts +16 -0
  10. package/dist/app/commands/CallCommand.d.ts.map +1 -0
  11. package/dist/app/commands/CallCommand.js +73 -0
  12. package/dist/app/commands/CallCommand.js.map +1 -0
  13. package/dist/app/commands/CheckCommand.d.ts +11 -0
  14. package/dist/app/commands/CheckCommand.d.ts.map +1 -0
  15. package/dist/app/commands/CheckCommand.js +59 -0
  16. package/dist/app/commands/CheckCommand.js.map +1 -0
  17. package/dist/app/commands/CompletionCommand.d.ts +7 -0
  18. package/dist/app/commands/CompletionCommand.d.ts.map +1 -0
  19. package/dist/app/commands/CompletionCommand.js +23 -0
  20. package/dist/app/commands/CompletionCommand.js.map +1 -0
  21. package/dist/app/commands/DevtoolsCommand.d.ts +20 -0
  22. package/dist/app/commands/DevtoolsCommand.d.ts.map +1 -0
  23. package/dist/app/commands/DevtoolsCommand.js +79 -0
  24. package/dist/app/commands/DevtoolsCommand.js.map +1 -0
  25. package/dist/app/commands/ExplainCommand.d.ts +18 -0
  26. package/dist/app/commands/ExplainCommand.d.ts.map +1 -0
  27. package/dist/app/commands/ExplainCommand.js +111 -0
  28. package/dist/app/commands/ExplainCommand.js.map +1 -0
  29. package/dist/app/commands/FreezeCommand.d.ts +21 -0
  30. package/dist/app/commands/FreezeCommand.d.ts.map +1 -0
  31. package/dist/app/commands/FreezeCommand.js +102 -0
  32. package/dist/app/commands/FreezeCommand.js.map +1 -0
  33. package/dist/app/commands/GrantCommand.d.ts +18 -0
  34. package/dist/app/commands/GrantCommand.d.ts.map +1 -0
  35. package/dist/app/commands/GrantCommand.js +39 -0
  36. package/dist/app/commands/GrantCommand.js.map +1 -0
  37. package/dist/app/commands/GraphCommand.d.ts +11 -0
  38. package/dist/app/commands/GraphCommand.d.ts.map +1 -0
  39. package/dist/app/commands/GraphCommand.js +72 -0
  40. package/dist/app/commands/GraphCommand.js.map +1 -0
  41. package/dist/app/commands/KeysCommand.d.ts +22 -0
  42. package/dist/app/commands/KeysCommand.d.ts.map +1 -0
  43. package/dist/app/commands/KeysCommand.js +50 -0
  44. package/dist/app/commands/KeysCommand.js.map +1 -0
  45. package/dist/app/commands/LoadCommand.d.ts +19 -0
  46. package/dist/app/commands/LoadCommand.d.ts.map +1 -0
  47. package/dist/app/commands/LoadCommand.js +37 -0
  48. package/dist/app/commands/LoadCommand.js.map +1 -0
  49. package/dist/app/commands/MigrateCommand.d.ts +17 -0
  50. package/dist/app/commands/MigrateCommand.d.ts.map +1 -0
  51. package/dist/app/commands/MigrateCommand.js +47 -0
  52. package/dist/app/commands/MigrateCommand.js.map +1 -0
  53. package/dist/app/commands/NewCommand.d.ts +24 -0
  54. package/dist/app/commands/NewCommand.d.ts.map +1 -0
  55. package/dist/app/commands/NewCommand.js +108 -0
  56. package/dist/app/commands/NewCommand.js.map +1 -0
  57. package/dist/app/commands/ServeCommand.d.ts +17 -0
  58. package/dist/app/commands/ServeCommand.d.ts.map +1 -0
  59. package/dist/app/commands/ServeCommand.js +92 -0
  60. package/dist/app/commands/ServeCommand.js.map +1 -0
  61. package/dist/app/commands/grant-material.d.ts +5 -0
  62. package/dist/app/commands/grant-material.d.ts.map +1 -0
  63. package/{app/commands/grant-material.ts → dist/app/commands/grant-material.js} +2 -2
  64. package/dist/app/commands/grant-material.js.map +1 -0
  65. package/dist/fronds/analysis/entities/Build.d.ts +10 -0
  66. package/dist/fronds/analysis/entities/Build.d.ts.map +1 -0
  67. package/dist/fronds/analysis/entities/Build.js +9 -0
  68. package/dist/fronds/analysis/entities/Build.js.map +1 -0
  69. package/dist/fronds/analysis/entities/Check.d.ts +8 -0
  70. package/dist/fronds/analysis/entities/Check.d.ts.map +1 -0
  71. package/dist/fronds/analysis/entities/Check.js +7 -0
  72. package/dist/fronds/analysis/entities/Check.js.map +1 -0
  73. package/dist/fronds/analysis/entities/Devtools.d.ts +10 -0
  74. package/dist/fronds/analysis/entities/Devtools.d.ts.map +1 -0
  75. package/dist/fronds/analysis/entities/Devtools.js +9 -0
  76. package/dist/fronds/analysis/entities/Devtools.js.map +1 -0
  77. package/dist/fronds/analysis/entities/Explain.d.ts +11 -0
  78. package/dist/fronds/analysis/entities/Explain.d.ts.map +1 -0
  79. package/dist/fronds/analysis/entities/Explain.js +10 -0
  80. package/dist/fronds/analysis/entities/Explain.js.map +1 -0
  81. package/dist/fronds/analysis/entities/Freeze.d.ts +10 -0
  82. package/dist/fronds/analysis/entities/Freeze.d.ts.map +1 -0
  83. package/dist/fronds/analysis/entities/Freeze.js +9 -0
  84. package/dist/fronds/analysis/entities/Freeze.js.map +1 -0
  85. package/dist/fronds/analysis/entities/Graph.d.ts +9 -0
  86. package/dist/fronds/analysis/entities/Graph.d.ts.map +1 -0
  87. package/dist/fronds/analysis/entities/Graph.js +8 -0
  88. package/dist/fronds/analysis/entities/Graph.js.map +1 -0
  89. package/dist/fronds/analysis/entities/Load.d.ts +10 -0
  90. package/dist/fronds/analysis/entities/Load.d.ts.map +1 -0
  91. package/dist/fronds/analysis/entities/Load.js +9 -0
  92. package/dist/fronds/analysis/entities/Load.js.map +1 -0
  93. package/dist/fronds/analysis/entities/Migrate.d.ts +10 -0
  94. package/dist/fronds/analysis/entities/Migrate.d.ts.map +1 -0
  95. package/dist/fronds/analysis/entities/Migrate.js +9 -0
  96. package/dist/fronds/analysis/entities/Migrate.js.map +1 -0
  97. package/dist/fronds/analysis/handlers/BuildHandler.d.ts +50 -0
  98. package/dist/fronds/analysis/handlers/BuildHandler.d.ts.map +1 -0
  99. package/dist/fronds/analysis/handlers/BuildHandler.js +63 -0
  100. package/dist/fronds/analysis/handlers/BuildHandler.js.map +1 -0
  101. package/dist/fronds/analysis/handlers/CheckHandler.d.ts +30 -0
  102. package/dist/fronds/analysis/handlers/CheckHandler.d.ts.map +1 -0
  103. package/dist/fronds/analysis/handlers/CheckHandler.js +196 -0
  104. package/dist/fronds/analysis/handlers/CheckHandler.js.map +1 -0
  105. package/dist/fronds/analysis/handlers/DevtoolsHandler.d.ts +45 -0
  106. package/dist/fronds/analysis/handlers/DevtoolsHandler.d.ts.map +1 -0
  107. package/dist/fronds/analysis/handlers/DevtoolsHandler.js +61 -0
  108. package/dist/fronds/analysis/handlers/DevtoolsHandler.js.map +1 -0
  109. package/dist/fronds/analysis/handlers/ExplainHandler.d.ts +99 -0
  110. package/dist/fronds/analysis/handlers/ExplainHandler.d.ts.map +1 -0
  111. package/dist/fronds/analysis/handlers/ExplainHandler.js +157 -0
  112. package/dist/fronds/analysis/handlers/ExplainHandler.js.map +1 -0
  113. package/dist/fronds/analysis/handlers/FreezeHandler.d.ts +55 -0
  114. package/dist/fronds/analysis/handlers/FreezeHandler.d.ts.map +1 -0
  115. package/dist/fronds/analysis/handlers/FreezeHandler.js +145 -0
  116. package/dist/fronds/analysis/handlers/FreezeHandler.js.map +1 -0
  117. package/dist/fronds/analysis/handlers/GraphHandler.d.ts +23 -0
  118. package/dist/fronds/analysis/handlers/GraphHandler.d.ts.map +1 -0
  119. package/dist/fronds/analysis/handlers/GraphHandler.js +23 -0
  120. package/dist/fronds/analysis/handlers/GraphHandler.js.map +1 -0
  121. package/dist/fronds/analysis/handlers/LoadHandler.d.ts +26 -0
  122. package/dist/fronds/analysis/handlers/LoadHandler.d.ts.map +1 -0
  123. package/dist/fronds/analysis/handlers/LoadHandler.js +35 -0
  124. package/dist/fronds/analysis/handlers/LoadHandler.js.map +1 -0
  125. package/dist/fronds/analysis/handlers/MigrateHandler.d.ts +34 -0
  126. package/dist/fronds/analysis/handlers/MigrateHandler.d.ts.map +1 -0
  127. package/dist/fronds/analysis/handlers/MigrateHandler.js +92 -0
  128. package/dist/fronds/analysis/handlers/MigrateHandler.js.map +1 -0
  129. package/dist/fronds/analysis/services/ProjectScan.d.ts +22 -0
  130. package/dist/fronds/analysis/services/ProjectScan.d.ts.map +1 -0
  131. package/dist/fronds/analysis/services/ProjectScan.js +48 -0
  132. package/dist/fronds/analysis/services/ProjectScan.js.map +1 -0
  133. package/dist/fronds/analysis/versions.d.ts +21 -0
  134. package/dist/fronds/analysis/versions.d.ts.map +1 -0
  135. package/dist/fronds/analysis/versions.js +48 -0
  136. package/dist/fronds/analysis/versions.js.map +1 -0
  137. package/dist/fronds/scaffold/entities/BuildFrond.d.ts +7 -0
  138. package/dist/fronds/scaffold/entities/BuildFrond.d.ts.map +1 -0
  139. package/dist/fronds/scaffold/entities/BuildFrond.js +6 -0
  140. package/dist/fronds/scaffold/entities/BuildFrond.js.map +1 -0
  141. package/dist/fronds/scaffold/entities/Call.d.ts +8 -0
  142. package/dist/fronds/scaffold/entities/Call.d.ts.map +1 -0
  143. package/{fronds/scaffold/entities/Call.ts → dist/fronds/scaffold/entities/Call.js} +4 -3
  144. package/dist/fronds/scaffold/entities/Call.js.map +1 -0
  145. package/dist/fronds/scaffold/entities/Completion.d.ts +7 -0
  146. package/dist/fronds/scaffold/entities/Completion.d.ts.map +1 -0
  147. package/dist/fronds/scaffold/entities/Completion.js +6 -0
  148. package/dist/fronds/scaffold/entities/Completion.js.map +1 -0
  149. package/dist/fronds/scaffold/entities/Grant.d.ts +8 -0
  150. package/dist/fronds/scaffold/entities/Grant.d.ts.map +1 -0
  151. package/{fronds/scaffold/entities/Grant.ts → dist/fronds/scaffold/entities/Grant.js} +4 -3
  152. package/dist/fronds/scaffold/entities/Grant.js.map +1 -0
  153. package/dist/fronds/scaffold/entities/Keys.d.ts +6 -0
  154. package/dist/fronds/scaffold/entities/Keys.d.ts.map +1 -0
  155. package/{fronds/scaffold/entities/Keys.ts → dist/fronds/scaffold/entities/Keys.js} +3 -2
  156. package/dist/fronds/scaffold/entities/Keys.js.map +1 -0
  157. package/dist/fronds/scaffold/entities/New.d.ts +19 -0
  158. package/dist/fronds/scaffold/entities/New.d.ts.map +1 -0
  159. package/dist/fronds/scaffold/entities/New.js +18 -0
  160. package/dist/fronds/scaffold/entities/New.js.map +1 -0
  161. package/dist/fronds/scaffold/entities/Serve.d.ts +10 -0
  162. package/dist/fronds/scaffold/entities/Serve.d.ts.map +1 -0
  163. package/dist/fronds/scaffold/entities/Serve.js +9 -0
  164. package/dist/fronds/scaffold/entities/Serve.js.map +1 -0
  165. package/dist/fronds/scaffold/entities/Sync.d.ts +8 -0
  166. package/dist/fronds/scaffold/entities/Sync.d.ts.map +1 -0
  167. package/dist/fronds/scaffold/entities/Sync.js +7 -0
  168. package/dist/fronds/scaffold/entities/Sync.js.map +1 -0
  169. package/dist/fronds/scaffold/handlers/BuildFrondHandler.d.ts +11 -0
  170. package/dist/fronds/scaffold/handlers/BuildFrondHandler.d.ts.map +1 -0
  171. package/dist/fronds/scaffold/handlers/BuildFrondHandler.js +82 -0
  172. package/dist/fronds/scaffold/handlers/BuildFrondHandler.js.map +1 -0
  173. package/dist/fronds/scaffold/handlers/CallHandler.d.ts +10 -0
  174. package/dist/fronds/scaffold/handlers/CallHandler.d.ts.map +1 -0
  175. package/{fronds/scaffold/handlers/CallHandler.ts → dist/fronds/scaffold/handlers/CallHandler.js} +3 -2
  176. package/dist/fronds/scaffold/handlers/CallHandler.js.map +1 -0
  177. package/dist/fronds/scaffold/handlers/CompletionHandler.d.ts +9 -0
  178. package/dist/fronds/scaffold/handlers/CompletionHandler.d.ts.map +1 -0
  179. package/{fronds/scaffold/handlers/CompletionHandler.ts → dist/fronds/scaffold/handlers/CompletionHandler.js} +3 -2
  180. package/dist/fronds/scaffold/handlers/CompletionHandler.js.map +1 -0
  181. package/dist/fronds/scaffold/handlers/GrantHandler.d.ts +9 -0
  182. package/dist/fronds/scaffold/handlers/GrantHandler.d.ts.map +1 -0
  183. package/{fronds/scaffold/handlers/GrantHandler.ts → dist/fronds/scaffold/handlers/GrantHandler.js} +3 -2
  184. package/dist/fronds/scaffold/handlers/GrantHandler.js.map +1 -0
  185. package/dist/fronds/scaffold/handlers/KeysHandler.d.ts +9 -0
  186. package/dist/fronds/scaffold/handlers/KeysHandler.d.ts.map +1 -0
  187. package/{fronds/scaffold/handlers/KeysHandler.ts → dist/fronds/scaffold/handlers/KeysHandler.js} +3 -2
  188. package/dist/fronds/scaffold/handlers/KeysHandler.js.map +1 -0
  189. package/dist/fronds/scaffold/handlers/NewHandler.d.ts +9 -0
  190. package/dist/fronds/scaffold/handlers/NewHandler.d.ts.map +1 -0
  191. package/{fronds/scaffold/handlers/NewHandler.ts → dist/fronds/scaffold/handlers/NewHandler.js} +3 -2
  192. package/dist/fronds/scaffold/handlers/NewHandler.js.map +1 -0
  193. package/dist/fronds/scaffold/handlers/ServeHandler.d.ts +10 -0
  194. package/dist/fronds/scaffold/handlers/ServeHandler.d.ts.map +1 -0
  195. package/{fronds/scaffold/handlers/ServeHandler.ts → dist/fronds/scaffold/handlers/ServeHandler.js} +3 -2
  196. package/dist/fronds/scaffold/handlers/ServeHandler.js.map +1 -0
  197. package/dist/fronds/scaffold/handlers/SyncHandler.d.ts +18 -0
  198. package/dist/fronds/scaffold/handlers/SyncHandler.d.ts.map +1 -0
  199. package/dist/fronds/scaffold/handlers/SyncHandler.js +327 -0
  200. package/dist/fronds/scaffold/handlers/SyncHandler.js.map +1 -0
  201. package/dist/fronds/scaffold/services/ProjectWriter.d.ts +54 -0
  202. package/dist/fronds/scaffold/services/ProjectWriter.d.ts.map +1 -0
  203. package/dist/fronds/scaffold/services/ProjectWriter.js +315 -0
  204. package/dist/fronds/scaffold/services/ProjectWriter.js.map +1 -0
  205. package/dist/src/bin.d.ts.map +1 -0
  206. package/dist/src/bin.js +11 -0
  207. package/dist/src/bin.js.map +1 -0
  208. package/dist/src/bridge.d.ts.map +1 -0
  209. package/dist/src/bridge.js.map +1 -0
  210. package/dist/src/completion.d.ts.map +1 -0
  211. package/dist/src/completion.js.map +1 -0
  212. package/dist/src/index.d.ts.map +1 -0
  213. package/dist/src/index.js.map +1 -0
  214. package/dist/src/loader.d.ts.map +1 -0
  215. package/dist/src/loader.js.map +1 -0
  216. package/dist/src/machine.d.ts.map +1 -0
  217. package/dist/src/machine.js.map +1 -0
  218. package/dist/src/main.d.ts +2 -0
  219. package/dist/src/main.d.ts.map +1 -0
  220. package/dist/src/main.js +19 -0
  221. package/dist/src/main.js.map +1 -0
  222. package/dist/src/runner.d.ts.map +1 -0
  223. package/dist/{runner.js → src/runner.js} +22 -22
  224. package/dist/src/runner.js.map +1 -0
  225. package/dist/src/theme.d.ts.map +1 -0
  226. package/dist/src/theme.js.map +1 -0
  227. package/dist/src/typescript/EntityTypes.d.ts.map +1 -0
  228. package/dist/src/typescript/EntityTypes.js.map +1 -0
  229. package/dist/src/typescript/FacadeTypes.d.ts.map +1 -0
  230. package/dist/src/typescript/FacadeTypes.js.map +1 -0
  231. package/dist/src/typescript/syntax.d.ts.map +1 -0
  232. package/dist/src/typescript/syntax.js.map +1 -0
  233. package/dist/{ui.d.ts → src/ui.d.ts} +0 -1
  234. package/dist/src/ui.d.ts.map +1 -0
  235. package/dist/{ui.js → src/ui.js} +24 -22
  236. package/dist/src/ui.js.map +1 -0
  237. package/package.json +25 -29
  238. package/templates/frond/fronds/tsconfig.json +17 -0
  239. package/templates/workspace/fronds/tsconfig.json +2 -4
  240. package/templates/workspace/package.json +1 -1
  241. package/templates/workspace/pnpm-workspace.yaml +5 -3
  242. package/app/commands/BuildCommand.ts +0 -43
  243. package/app/commands/CallCommand.ts +0 -70
  244. package/app/commands/CheckCommand.ts +0 -70
  245. package/app/commands/CompletionCommand.ts +0 -24
  246. package/app/commands/DevtoolsCommand.ts +0 -92
  247. package/app/commands/ExplainCommand.ts +0 -136
  248. package/app/commands/FreezeCommand.ts +0 -119
  249. package/app/commands/GrantCommand.ts +0 -46
  250. package/app/commands/GraphCommand.ts +0 -91
  251. package/app/commands/KeysCommand.ts +0 -57
  252. package/app/commands/LoadCommand.ts +0 -46
  253. package/app/commands/MigrateCommand.ts +0 -61
  254. package/app/commands/NewCommand.ts +0 -137
  255. package/app/commands/ServeCommand.ts +0 -108
  256. package/dist/bin.d.ts.map +0 -1
  257. package/dist/bin.js +0 -64
  258. package/dist/bin.js.map +0 -1
  259. package/dist/bridge.d.ts.map +0 -1
  260. package/dist/bridge.js.map +0 -1
  261. package/dist/completion.d.ts.map +0 -1
  262. package/dist/completion.js.map +0 -1
  263. package/dist/index.d.ts.map +0 -1
  264. package/dist/index.js.map +0 -1
  265. package/dist/loader.d.ts.map +0 -1
  266. package/dist/loader.js.map +0 -1
  267. package/dist/machine.d.ts.map +0 -1
  268. package/dist/machine.js.map +0 -1
  269. package/dist/runner.d.ts.map +0 -1
  270. package/dist/runner.js.map +0 -1
  271. package/dist/theme.d.ts.map +0 -1
  272. package/dist/theme.js.map +0 -1
  273. package/dist/typescript/EntityTypes.d.ts.map +0 -1
  274. package/dist/typescript/EntityTypes.js.map +0 -1
  275. package/dist/typescript/FacadeTypes.d.ts.map +0 -1
  276. package/dist/typescript/FacadeTypes.js.map +0 -1
  277. package/dist/typescript/syntax.d.ts.map +0 -1
  278. package/dist/typescript/syntax.js.map +0 -1
  279. package/dist/ui.d.ts.map +0 -1
  280. package/dist/ui.js.map +0 -1
  281. package/fronds/analysis/entities/Build.ts +0 -8
  282. package/fronds/analysis/entities/Check.ts +0 -6
  283. package/fronds/analysis/entities/Devtools.ts +0 -8
  284. package/fronds/analysis/entities/Explain.ts +0 -9
  285. package/fronds/analysis/entities/Freeze.ts +0 -8
  286. package/fronds/analysis/entities/Graph.ts +0 -7
  287. package/fronds/analysis/entities/Load.ts +0 -8
  288. package/fronds/analysis/entities/Migrate.ts +0 -8
  289. package/fronds/analysis/handlers/BuildHandler.ts +0 -87
  290. package/fronds/analysis/handlers/CheckHandler.ts +0 -217
  291. package/fronds/analysis/handlers/DevtoolsHandler.ts +0 -97
  292. package/fronds/analysis/handlers/ExplainHandler.ts +0 -263
  293. package/fronds/analysis/handlers/FreezeHandler.ts +0 -183
  294. package/fronds/analysis/handlers/GraphHandler.ts +0 -38
  295. package/fronds/analysis/handlers/LoadHandler.ts +0 -44
  296. package/fronds/analysis/handlers/MigrateHandler.ts +0 -110
  297. package/fronds/analysis/services/ProjectScan.ts +0 -55
  298. package/fronds/analysis/versions.ts +0 -59
  299. package/fronds/scaffold/entities/BuildFrond.ts +0 -5
  300. package/fronds/scaffold/entities/Completion.ts +0 -5
  301. package/fronds/scaffold/entities/New.ts +0 -19
  302. package/fronds/scaffold/entities/Serve.ts +0 -8
  303. package/fronds/scaffold/entities/Sync.ts +0 -6
  304. package/fronds/scaffold/handlers/BuildFrondHandler.ts +0 -96
  305. package/fronds/scaffold/handlers/SyncHandler.ts +0 -376
  306. package/fronds/scaffold/services/ProjectWriter.ts +0 -339
  307. package/fronds/shims.d.ts +0 -9
  308. package/src/bin.ts +0 -77
  309. package/src/bridge.ts +0 -118
  310. package/src/completion.ts +0 -145
  311. package/src/index.ts +0 -1
  312. package/src/loader.ts +0 -28
  313. package/src/machine.ts +0 -17
  314. package/src/runner.ts +0 -152
  315. package/src/theme.ts +0 -19
  316. package/src/typescript/EntityTypes.ts +0 -92
  317. package/src/typescript/FacadeTypes.ts +0 -50
  318. package/src/typescript/syntax.ts +0 -11
  319. package/src/ui.ts +0 -142
  320. package/templates/flat/AGENTS.md +0 -14
  321. package/templates/flat/CLAUDE.md +0 -87
  322. package/templates/flat/_gitignore +0 -6
  323. package/templates/flat/app/app.vue +0 -25
  324. package/templates/flat/app/pages/index.vue +0 -7
  325. package/templates/flat/fougere.config.ts +0 -7
  326. package/templates/flat/nuxt.config.ts +0 -4
  327. package/templates/flat/package.json +0 -24
  328. package/templates/flat/pnpm-workspace.yaml +0 -6
  329. package/templates/flat/tsconfig.frond.json +0 -25
  330. package/templates/flat/tsconfig.json +0 -3
  331. /package/dist/{bin.d.ts → src/bin.d.ts} +0 -0
  332. /package/dist/{bridge.d.ts → src/bridge.d.ts} +0 -0
  333. /package/dist/{bridge.js → src/bridge.js} +0 -0
  334. /package/dist/{completion.d.ts → src/completion.d.ts} +0 -0
  335. /package/dist/{completion.js → src/completion.js} +0 -0
  336. /package/dist/{index.d.ts → src/index.d.ts} +0 -0
  337. /package/dist/{index.js → src/index.js} +0 -0
  338. /package/dist/{loader.d.ts → src/loader.d.ts} +0 -0
  339. /package/dist/{loader.js → src/loader.js} +0 -0
  340. /package/dist/{machine.d.ts → src/machine.d.ts} +0 -0
  341. /package/dist/{machine.js → src/machine.js} +0 -0
  342. /package/dist/{runner.d.ts → src/runner.d.ts} +0 -0
  343. /package/dist/{theme.d.ts → src/theme.d.ts} +0 -0
  344. /package/dist/{theme.js → src/theme.js} +0 -0
  345. /package/dist/{typescript → src/typescript}/EntityTypes.d.ts +0 -0
  346. /package/dist/{typescript → src/typescript}/EntityTypes.js +0 -0
  347. /package/dist/{typescript → src/typescript}/FacadeTypes.d.ts +0 -0
  348. /package/dist/{typescript → src/typescript}/FacadeTypes.js +0 -0
  349. /package/dist/{typescript → src/typescript}/syntax.d.ts +0 -0
  350. /package/dist/{typescript → src/typescript}/syntax.js +0 -0
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The client end lives in app/commands/CallCommand (it boots the project app
3
+ * and drives one operation). This handler exists only so the runner registers
4
+ * the `call` subcommand.
5
+ */
6
+ export default class CallHandler {
7
+ /** Invoke one operation of a frond from the terminal. */
8
+ execute(): Promise<void>;
9
+ }
10
+ //# sourceMappingURL=CallHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CallHandler.d.ts","sourceRoot":"","sources":["../../../../fronds/scaffold/handlers/CallHandler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,yDAAyD;IACnD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAG;CAClC"}
@@ -4,6 +4,7 @@
4
4
  * the `call` subcommand.
5
5
  */
6
6
  export default class CallHandler {
7
- /** Invoke one operation of a frond from the terminal. */
8
- async execute(): Promise<void> {}
7
+ /** Invoke one operation of a frond from the terminal. */
8
+ async execute() { }
9
9
  }
10
+ //# sourceMappingURL=CallHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CallHandler.js","sourceRoot":"","sources":["../../../../fronds/scaffold/handlers/CallHandler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,yDAAyD;IACzD,KAAK,CAAC,OAAO,KAAmB,CAAC;CAClC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The completion script is produced by CompletionCommand (it holds the app and
3
+ * prints it). This handler exists only so the runner registers the subcommand.
4
+ */
5
+ export default class CompletionHandler {
6
+ /** Print the shell completion script for this CLI. */
7
+ execute(): Promise<void>;
8
+ }
9
+ //# sourceMappingURL=CompletionHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CompletionHandler.d.ts","sourceRoot":"","sources":["../../../../fronds/scaffold/handlers/CompletionHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACpC,sDAAsD;IAChD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAG;CAClC"}
@@ -3,6 +3,7 @@
3
3
  * prints it). This handler exists only so the runner registers the subcommand.
4
4
  */
5
5
  export default class CompletionHandler {
6
- /** Print the shell completion script for this CLI. */
7
- async execute(): Promise<void> {}
6
+ /** Print the shell completion script for this CLI. */
7
+ async execute() { }
8
8
  }
9
+ //# sourceMappingURL=CompletionHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CompletionHandler.js","sourceRoot":"","sources":["../../../../fronds/scaffold/handlers/CompletionHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACpC,sDAAsD;IACtD,KAAK,CAAC,OAAO,KAAmB,CAAC;CAClC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The work lives in app/commands/GrantCommand (it prints secrets). This handler
3
+ * exists only so the runner registers the `grant` subcommand.
4
+ */
5
+ export default class GrantHandler {
6
+ /** Bind a frond's name to a fresh key, signed by the root. */
7
+ execute(): Promise<void>;
8
+ }
9
+ //# sourceMappingURL=GrantHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GrantHandler.d.ts","sourceRoot":"","sources":["../../../../fronds/scaffold/handlers/GrantHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,8DAA8D;IACxD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAG;CAClC"}
@@ -3,6 +3,7 @@
3
3
  * exists only so the runner registers the `grant` subcommand.
4
4
  */
5
5
  export default class GrantHandler {
6
- /** Bind a frond's name to a fresh key, signed by the root. */
7
- async execute(): Promise<void> {}
6
+ /** Bind a frond's name to a fresh key, signed by the root. */
7
+ async execute() { }
8
8
  }
9
+ //# sourceMappingURL=GrantHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GrantHandler.js","sourceRoot":"","sources":["../../../../fronds/scaffold/handlers/GrantHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,8DAA8D;IAC9D,KAAK,CAAC,OAAO,KAAmB,CAAC;CAClC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The work lives in app/commands/KeysCommand (it writes the root key). This
3
+ * handler exists only so the runner registers the `keys` subcommand.
4
+ */
5
+ export default class KeysHandler {
6
+ /** Create the root key a split deployment's grants are signed by. */
7
+ execute(): Promise<void>;
8
+ }
9
+ //# sourceMappingURL=KeysHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeysHandler.d.ts","sourceRoot":"","sources":["../../../../fronds/scaffold/handlers/KeysHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,qEAAqE;IAC/D,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAG;CAClC"}
@@ -3,6 +3,7 @@
3
3
  * handler exists only so the runner registers the `keys` subcommand.
4
4
  */
5
5
  export default class KeysHandler {
6
- /** Create the root key a split deployment's grants are signed by. */
7
- async execute(): Promise<void> {}
6
+ /** Create the root key a split deployment's grants are signed by. */
7
+ async execute() { }
8
8
  }
9
+ //# sourceMappingURL=KeysHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeysHandler.js","sourceRoot":"","sources":["../../../../fronds/scaffold/handlers/KeysHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,qEAAqE;IACrE,KAAK,CAAC,OAAO,KAAmB,CAAC;CAClC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The guided flow lives in app/commands/NewCommand (it prompts and composes).
3
+ * This handler exists only so the runner registers the `new` subcommand.
4
+ */
5
+ export default class NewHandler {
6
+ /** Create a Fougere workspace. */
7
+ execute(): Promise<void>;
8
+ }
9
+ //# sourceMappingURL=NewHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NewHandler.d.ts","sourceRoot":"","sources":["../../../../fronds/scaffold/handlers/NewHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,kCAAkC;IAC5B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAG;CAClC"}
@@ -3,6 +3,7 @@
3
3
  * This handler exists only so the runner registers the `new` subcommand.
4
4
  */
5
5
  export default class NewHandler {
6
- /** Create a Fougere project, workspace or flat. */
7
- async execute(): Promise<void> {}
6
+ /** Create a Fougere workspace. */
7
+ async execute() { }
8
8
  }
9
+ //# sourceMappingURL=NewHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NewHandler.js","sourceRoot":"","sources":["../../../../fronds/scaffold/handlers/NewHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,kCAAkC;IAClC,KAAK,CAAC,OAAO,KAAmB,CAAC;CAClC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The host lives in app/commands/ServeCommand (it boots the frond alone and
3
+ * exposes it over HTTP). This handler exists only so the runner registers the
4
+ * `serve` subcommand.
5
+ */
6
+ export default class ServeHandler {
7
+ /** Host a frond in its own process, behind JSON-RPC. */
8
+ execute(): Promise<void>;
9
+ }
10
+ //# sourceMappingURL=ServeHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServeHandler.d.ts","sourceRoot":"","sources":["../../../../fronds/scaffold/handlers/ServeHandler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,wDAAwD;IAClD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAG;CAClC"}
@@ -4,6 +4,7 @@
4
4
  * `serve` subcommand.
5
5
  */
6
6
  export default class ServeHandler {
7
- /** Host a frond in its own process, behind JSON-RPC. */
8
- async execute(): Promise<void> {}
7
+ /** Host a frond in its own process, behind JSON-RPC. */
8
+ async execute() { }
9
9
  }
10
+ //# sourceMappingURL=ServeHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServeHandler.js","sourceRoot":"","sources":["../../../../fronds/scaffold/handlers/ServeHandler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,wDAAwD;IACxD,KAAK,CAAC,OAAO,KAAmB,CAAC;CAClC"}
@@ -0,0 +1,18 @@
1
+ export declare function entityClassName(name: string): string;
2
+ export default class SyncHandler {
3
+ private cwd;
4
+ /** Mirror a remote frond's contract into local entities. */
5
+ execute(input: {
6
+ frond: string;
7
+ from: string;
8
+ }): Promise<{
9
+ path: string;
10
+ entities: string[];
11
+ removed: string[];
12
+ }>;
13
+ /** Delete the files this run did not write — and only the ones sync itself produced. */
14
+ private prune;
15
+ /** Write/update .fougere/remotes.json — read by @fougere/nuxt for auto-aliasing. */
16
+ private updateRemotesRegistry;
17
+ }
18
+ //# sourceMappingURL=SyncHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SyncHandler.d.ts","sourceRoot":"","sources":["../../../../fronds/scaffold/handlers/SyncHandler.ts"],"names":[],"mappings":"AAyCA,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAYpD;AAyDD,MAAM,CAAC,OAAO,OAAO,WAAW;IAE9B,OAAO,CAAC,GAAG,CAAiB;IAE5B,4DAA4D;IACtD,OAAO,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAqMtH;IAED,wFAAwF;IACxF,OAAO,CAAC,KAAK;IAeb,oFAAoF;IACpF,OAAO,CAAC,qBAAqB;CAmB9B"}
@@ -0,0 +1,327 @@
1
+ import { existsSync, mkdirSync, writeFileSync, readFileSync, readdirSync, rmSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ import { upperFirst } from '@fougere/schema';
4
+ import { EntityTypes } from '../../../src/typescript/EntityTypes.js';
5
+ import { FacadeTypes } from '../../../src/typescript/FacadeTypes.js';
6
+ // The card's shape is declared once, in core, and imported here. A private copy of it
7
+ // lived in this file and went stale the day an op stopped being a bare name: nothing
8
+ // compared the copy to the original, so the drift cost nothing until someone read it.
9
+ import { assertIdentityCard } from '@fougere/core';
10
+ import { resolveConventions, frondPackage } from '@fougere/core';
11
+ import { loadConfig } from '@fougere/core/node';
12
+ import { facadeModule } from '@fougere/compiler';
13
+ import { ErrorCode } from '@fougere/core/contract';
14
+ /**
15
+ * A union of enum MEMBERS, from what the card said this operation refuses.
16
+ *
17
+ * `ErrorCode` is a string enum, so `'CONFLICT'` is not assignable to it: a literal reads as the
18
+ * right thing and then refuses to narrow `FougereError<Code>`, which is the whole point. A code
19
+ * this version does not know is dropped rather than written — the far side may be newer, and a
20
+ * name that resolves to nothing would stop the consumer's build.
21
+ */
22
+ function codesOf(errors) {
23
+ const known = (errors ?? []).filter((code) => code in ErrorCode);
24
+ if (known.length === 0)
25
+ return 'never';
26
+ return known.map((code) => `ErrorCode.${code}`).join(' | ');
27
+ }
28
+ function assertSafeName(kind, name) {
29
+ if (typeof name !== 'string' || !/^[A-Za-z_$][A-Za-z0-9_$-]*$/.test(name)) {
30
+ throw new Error(`Invalid ${kind} name '${name}' received from remote`);
31
+ }
32
+ }
33
+ /**
34
+ * The line every generated file carries. It is what makes pruning safe: sync removes what
35
+ * IT wrote and nothing else, so a file a human dropped into the folder survives.
36
+ */
37
+ const GENERATED = 'Generated by `fougere sync`';
38
+ export function entityClassName(name) {
39
+ assertSafeName('entity', name);
40
+ const identifier = name
41
+ .split('-')
42
+ .filter(Boolean)
43
+ .map(upperFirst)
44
+ .join('');
45
+ if (!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(identifier)) {
46
+ throw new Error(`Entity name '${name}' cannot be represented as a TypeScript identifier`);
47
+ }
48
+ return identifier;
49
+ }
50
+ /**
51
+ * One entry — a facade or a fact — validated the same way, because sync consumes the same two
52
+ * values from both: a name it can turn into a class, and a descriptor it can rebuild.
53
+ *
54
+ * A missing descriptor is legal on either side and means different things: a facade that
55
+ * stores nothing (a health check, a search across shapes), or a fact whose announced type
56
+ * is not a declared entity. Neither produces a row class, and demanding one here refused
57
+ * the WHOLE card over a single entry.
58
+ */
59
+ function assertEntry(kind, frondName, entry) {
60
+ if (!entry || typeof entry !== 'object') {
61
+ throw new Error(`Remote frond '${frondName}' contains an invalid ${kind} entry`);
62
+ }
63
+ assertSafeName(kind, entry.name);
64
+ if (entry.schema === undefined)
65
+ return;
66
+ // `ops` is not checked because it is not used: sync writes entities, and the name
67
+ // and the descriptor below are the only two values that reach a file. The clause
68
+ // that stood here demanded strings — the shape ops had before they carried their
69
+ // kind and their views — and so refused every real host. Validate what you consume.
70
+ const descriptor = entry.schema;
71
+ if (!descriptor
72
+ || typeof descriptor !== 'object'
73
+ || Array.isArray(descriptor)
74
+ || descriptor.type !== 'object'
75
+ || !descriptor.properties
76
+ || typeof descriptor.properties !== 'object'
77
+ || Array.isArray(descriptor.properties)
78
+ || descriptor['x-fougere-version'] !== 1
79
+ || descriptor['x-fougere-vendor'] !== 'fougere') {
80
+ throw new Error(`Remote ${kind} '${entry.name}' has no valid schema descriptor`);
81
+ }
82
+ }
83
+ function identityCardOf(value) {
84
+ // The card's own shape is validated by the package that declares it — `fronds`, and each
85
+ // frond's `facades`. What stays here is what only a writer of files needs: a name safe to
86
+ // become one, and the descriptor a class is generated from.
87
+ const card = assertIdentityCard(value, 'Remote rpc.discover');
88
+ for (const frond of card.fronds) {
89
+ assertSafeName('frond', frond.name);
90
+ // Absent rather than empty is tolerated: a host older than the fact list says nothing
91
+ // about facts, and refusing it would break sync against every previous version for a
92
+ // feature the consumer may not use.
93
+ if (frond.facts !== undefined && !Array.isArray(frond.facts)) {
94
+ throw new Error(`Remote frond '${frond.name}' has no valid facts array`);
95
+ }
96
+ for (const facade of frond.facades)
97
+ assertEntry('facade', frond.name, facade);
98
+ for (const fact of frond.facts ?? [])
99
+ assertEntry('fact', frond.name, fact);
100
+ }
101
+ return card;
102
+ }
103
+ export default class SyncHandler {
104
+ // cwd is ambient in a CLI — not a DI service (the container resolves by type).
105
+ cwd = process.cwd();
106
+ /** Mirror a remote frond's contract into local entities. */
107
+ async execute(input) {
108
+ assertSafeName('frond', input.frond);
109
+ let remoteUrl;
110
+ try {
111
+ remoteUrl = new URL(input.from);
112
+ }
113
+ catch {
114
+ throw new Error(`Invalid remote URL '${input.from}'`);
115
+ }
116
+ if (remoteUrl.protocol !== 'http:' && remoteUrl.protocol !== 'https:') {
117
+ throw new Error(`Remote URL must use http or https, got '${remoteUrl.protocol}'`);
118
+ }
119
+ const baseUrl = remoteUrl.toString().replace(/\/$/, '');
120
+ // The served frond answers `rpc.discover` on its call endpoint with its
121
+ // identity card — the same surface every consumer reads, no side endpoint.
122
+ const res = await fetch(`${baseUrl}/_fougere/call`, {
123
+ method: 'POST',
124
+ headers: { 'content-type': 'application/json' },
125
+ body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'rpc.discover', params: { params: {}, query: {}, state: {} } }),
126
+ signal: AbortSignal.timeout(10_000),
127
+ });
128
+ if (!res.ok) {
129
+ throw new Error(`Failed to reach ${baseUrl}/_fougere/call: ${res.status} ${res.statusText}`);
130
+ }
131
+ const rpc = (await res.json());
132
+ if (rpc.error)
133
+ throw new Error(`Remote error: ${rpc.error.message}`);
134
+ const card = identityCardOf(rpc.result);
135
+ const target = card.fronds.find((f) => f.name === input.frond);
136
+ if (!target) {
137
+ throw new Error(`Frond '${input.frond}' not found on ${baseUrl}. Available: ${card.fronds.map((f) => f.name).join(', ')}`);
138
+ }
139
+ // The consumer's own convention: a synced frond is laid out like the ones they wrote,
140
+ // and the export map below is what makes `@fronds/<name>/<dir>/X.js` resolve.
141
+ const conventions = resolveConventions((await loadConfig(this.cwd)).conventions);
142
+ const entities = conventions.dirs.entities;
143
+ const handlers = conventions.dirs.handlers;
144
+ const frondDir = join(this.cwd, '.fougere', 'remotes', input.frond);
145
+ const entitiesDir = join(frondDir, entities);
146
+ const handlersDir = join(frondDir, handlers);
147
+ mkdirSync(entitiesDir, { recursive: true });
148
+ mkdirSync(handlersDir, { recursive: true });
149
+ /**
150
+ * What was written under each name — the barrel below is a projection of exactly this.
151
+ *
152
+ * Three combinations, and all three occur: a facade with rows behind it (both files), a
153
+ * facade with none (the façade type alone), and a fact (the row class alone, because
154
+ * nothing calls a fact).
155
+ */
156
+ const generated = new Map();
157
+ /** Absolute paths written by THIS run — anything else generated here is now stale. */
158
+ const written = new Set();
159
+ const claim = (name) => {
160
+ const className = entityClassName(name);
161
+ if (generated.has(className))
162
+ throw new Error(`Remote declares duplicate entity '${className}'`);
163
+ generated.set(className, { row: false, facade: false });
164
+ return className;
165
+ };
166
+ /**
167
+ * One card, one class.
168
+ *
169
+ * `Card.toSchema` gives the JUDGE — validate, from, getFields — and now takes the
170
+ * row shape as a type argument, so the same declaration gives the TYPE. Both
171
+ * come off the same card: nothing to keep in step, and the file a consumer reads
172
+ * has the shape of the one they would have written by hand
173
+ * (`class Post extends entity({…}) {}`).
174
+ */
175
+ const writeRow = (className, descriptor) => {
176
+ written.add(join(entitiesDir, `${className}.ts`));
177
+ writeFileSync(join(entitiesDir, `${className}.ts`), [
178
+ `import { Card } from '@fougere/schema';`,
179
+ ``,
180
+ `// Generated by \`fougere sync\` from ${baseUrl} — do not edit.`,
181
+ EntityTypes.of(descriptor).render({ name: className }),
182
+ ``,
183
+ `export default ${className};`,
184
+ ``,
185
+ ].join('\n'));
186
+ generated.get(className).row = true;
187
+ };
188
+ /** What the card says of each address — the same three facts a scan gives. */
189
+ const served = [];
190
+ for (const { name, schema: descriptor, ops } of target.facades) {
191
+ const className = claim(name);
192
+ generated.get(className).facade = true;
193
+ served.push({
194
+ at: name,
195
+ handler: `import('./${handlers}/${className}Handler.js').${className}Handler`,
196
+ ops: (ops ?? []).map((op) => ({ name: op.name, codes: codesOf(op.errors) })),
197
+ });
198
+ // No shape behind this facade: its operations still travel, its rows do not exist.
199
+ // `rowType` falls back to `unknown`, which is the truth rather than an empty class.
200
+ if (descriptor !== undefined)
201
+ writeRow(className, descriptor);
202
+ /**
203
+ * The facade's type, next to the row's — what `Facade<T>` needs and what nothing
204
+ * carried across a repository boundary.
205
+ *
206
+ * Writing `Facade<ArticleHandler>` used to require importing the handler's class.
207
+ * `sync` does not ship handlers and should not: a handler is behaviour with state,
208
+ * and behaviour does not travel. Its OPERATIONS do — the card names them, says how
209
+ * much each returns, and that is exactly a signature.
210
+ */
211
+ written.add(join(handlersDir, `${className}Handler.ts`));
212
+ writeFileSync(join(handlersDir, `${className}Handler.ts`), [
213
+ ...(descriptor !== undefined ? [`import type { ${className} } from '../entities/${className}.js';`, ``] : []),
214
+ `// Generated by \`fougere sync\` from ${baseUrl} — do not edit.`,
215
+ `// The shape of an invocation, restated rather than imported: this file is a`,
216
+ `// contract, and a contract that drags a runtime dependency is not one.`,
217
+ `type Invocation = { params?: Record<string, string>; query?: Record<string, unknown>; body?: unknown; state?: Record<string, unknown> };`,
218
+ ``,
219
+ FacadeTypes.of(ops ?? []).render({
220
+ name: `${className}Handler`,
221
+ ...(descriptor !== undefined ? { rowType: className } : {}),
222
+ }),
223
+ ``,
224
+ ].join('\n'));
225
+ }
226
+ /**
227
+ * The facts, which is the only reason a subscriber needs this command at all.
228
+ *
229
+ * A fact has no operation, so no façade type is written: a listener spells
230
+ * `reindex(fact: Fact<PostPublished>)` and the class is the whole of what it needs.
231
+ * Announced without a declared shape, there is nothing to write — a class built from
232
+ * a bare name would validate everything, which is worse than the absence.
233
+ */
234
+ for (const { name, schema: descriptor } of target.facts ?? []) {
235
+ const className = claim(name);
236
+ if (descriptor === undefined) {
237
+ generated.delete(className);
238
+ continue;
239
+ }
240
+ writeRow(className, descriptor);
241
+ }
242
+ /**
243
+ * The facade module, written from the CARD rather than from a scan.
244
+ *
245
+ * A frond in another repository cannot be scanned — there are no sources here. What the
246
+ * card carries is exactly the three facts the module needs: the addresses, the operations,
247
+ * and what each one refuses. The handler TYPE is the one thing it cannot carry, so the
248
+ * synthetic interface written above stands in its place: it names the same operations with
249
+ * the same answers, which is what a page reads.
250
+ *
251
+ * `facadeModule` is the compiler's own, not a copy: two spellings of one format would
252
+ * drift the day either gained a member.
253
+ */
254
+ writeFileSync(join(frondDir, 'facade.ts'), facadeModule(served, `${baseUrl} — a card, not a scan`));
255
+ // Barrel index
256
+ // One binding carries the value AND the type, because a class is both — the pair of
257
+ // re-exports that stood here was the price of declaring them separately.
258
+ const indexLines = [...generated].flatMap(([name, { row, facade }]) => [
259
+ ...(row ? [`export { default as ${name} } from './${entities}/${name}.js';`] : []),
260
+ ...(facade ? [`export type { ${name}Handler } from './${handlers}/${name}Handler.js';`] : []),
261
+ ]);
262
+ writeFileSync(join(frondDir, 'index.ts'), indexLines.join('\n') + '\n');
263
+ // Package.json
264
+ writeFileSync(join(frondDir, 'package.json'), JSON.stringify({
265
+ name: frondPackage(input.frond, conventions),
266
+ version: '0.0.0-synced',
267
+ type: 'module',
268
+ fougere: { frond: input.frond, synced: true, source: baseUrl },
269
+ exports: {
270
+ '.': './index.ts',
271
+ [`./${entities}/*`]: `./${entities}/*.ts`,
272
+ [`./${handlers}/*`]: `./${handlers}/*.ts`,
273
+ './package.json': './package.json',
274
+ },
275
+ }, null, 2) + '\n');
276
+ // .fougere/remotes.json is the central registry of synced remotes.
277
+ this.updateRemotesRegistry(input.frond, baseUrl, frondDir);
278
+ /**
279
+ * What the host no longer serves stops being importable here.
280
+ *
281
+ * The barrel is rewritten every run, so a dropped entity loses its export on its own
282
+ * — but the FILE stayed, and the generated `package.json` exports `'./entities/*'` as
283
+ * a wildcard, so `@fronds/blog/entities/Ticket.js` kept resolving to a class nothing
284
+ * behind it answers for. The consumer compiles, its local validator accepts, and the call
285
+ * comes back NOT_FOUND at the facade — or never leaves, because the page dropped the
286
+ * call and kept the type.
287
+ */
288
+ const removed = [...this.prune(entitiesDir, written), ...this.prune(handlersDir, written)];
289
+ return { path: entitiesDir, entities: [...generated.keys()], removed };
290
+ }
291
+ /** Delete the files this run did not write — and only the ones sync itself produced. */
292
+ prune(dir, written) {
293
+ const dropped = [];
294
+ for (const name of readdirSync(dir)) {
295
+ const path = join(dir, name);
296
+ if (written.has(path))
297
+ continue;
298
+ // Never remove what sync did not write. The folder is sync's, but a human who put
299
+ // something there meant it, and a delete is not the place to be clever.
300
+ if (!readFileSync(path, 'utf-8').includes(GENERATED))
301
+ continue;
302
+ rmSync(path);
303
+ dropped.push(name);
304
+ }
305
+ return dropped;
306
+ }
307
+ /** Write/update .fougere/remotes.json — read by @fougere/nuxt for auto-aliasing. */
308
+ updateRemotesRegistry(name, baseUrl, localPath) {
309
+ const registryPath = join(this.cwd, '.fougere', 'remotes.json');
310
+ let registry = {};
311
+ if (existsSync(registryPath)) {
312
+ try {
313
+ const parsed = JSON.parse(readFileSync(registryPath, 'utf-8'));
314
+ if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed))
315
+ throw new Error('expected an object');
316
+ registry = parsed;
317
+ }
318
+ catch (cause) {
319
+ throw new Error(`Cannot update corrupt remote registry at ${registryPath}`, { cause });
320
+ }
321
+ }
322
+ registry[name] = { url: baseUrl, path: localPath };
323
+ mkdirSync(join(this.cwd, '.fougere'), { recursive: true });
324
+ writeFileSync(registryPath, JSON.stringify(registry, null, 2) + '\n');
325
+ }
326
+ }
327
+ //# sourceMappingURL=SyncHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SyncHandler.js","sourceRoot":"","sources":["../../../../fronds/scaffold/handlers/SyncHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAClG,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,sFAAsF;AACtF,qFAAqF;AACrF,sFAAsF;AACtF,OAAO,EAAE,kBAA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AAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC;QAChE,IAAI,QAAQ,GAAkD,EAAE,CAAC;QAEjE,IAAI,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;YAC7B,IAAI,CAAC;gBACH,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;gBACxE,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;oBAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;gBAC1G,QAAQ,GAAG,MAAuD,CAAC;YACrE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,4CAA4C,YAAY,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;YACzF,CAAC;QACH,CAAC;QAED,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QACnD,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3D,aAAa,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACxE,CAAC;CAEF"}
@@ -0,0 +1,54 @@
1
+ import { type Conventions } from '@fougere/core';
2
+ export default class ProjectWriter {
3
+ /** The workspace shell — fougere.config, pnpm-workspace (fronds/* apps/*), package.json. */
4
+ createWorkspace(dir: string, name: string): {
5
+ path: string;
6
+ };
7
+ /** Add a frond (business hexagon) under fronds/<name>. */
8
+ addFrond(wsDir: string, template: string, name: string, conventions?: Conventions): {
9
+ path: string;
10
+ };
11
+ /** Add an app (consumer) under apps/<name>, from the host package that owns its wiring. */
12
+ addApp(wsDir: string, template: string, name: string): {
13
+ path: string;
14
+ };
15
+ /**
16
+ * What can be scaffolded, of a kind.
17
+ *
18
+ * A FROND comes from this package: it is Fougere's own vocabulary, entities and handlers,
19
+ * and no other package owns it. An APP comes from its HOST — the registry is the hosts this
20
+ * CLI depends on, so `fougere new` offers what is published rather than what was copied here.
21
+ */
22
+ listTemplates(kind: 'fronds' | 'apps'): string[];
23
+ /**
24
+ * Every app depends on every frond of the workspace — stated once composition is done,
25
+ * because that is when the names exist.
26
+ *
27
+ * A template cannot carry it: the frond is named at composition time (`blog:catalog`),
28
+ * so a dependency written into `templates/apps/nuxt` would name the template instead
29
+ * and resolve to nothing. Which is what happened — the generated app imported
30
+ * `@fronds/blog` whatever you had called it, and did not start.
31
+ *
32
+ * `fronds/` and `apps/` are the registry, like `listTemplates`: nothing to declare.
33
+ */
34
+ linkFronds(wsDir: string, conventions?: Conventions): void;
35
+ /**
36
+ * Every `@fougere/*` dependency, pinned to the version that scaffolded it.
37
+ *
38
+ * The templates say `latest`, which reads as "whatever is current" and is not: pnpm
39
+ * answers from a metadata cache, and a fresh project installed 0.6 while the registry
40
+ * said 0.7 — measured. A version is also what makes an install reproducible, which
41
+ * `latest` never was.
42
+ *
43
+ * Read off this CLI's own package, because the scaffold and the packages it names ship
44
+ * together: the version that wrote the file is the one it was written for.
45
+ */
46
+ pinVersions(wsDir: string, conventions?: Conventions): void;
47
+ /**
48
+ * Dev mode: rewrite every `@fougere/*` dependency in the workspace to a
49
+ * `link:` into this monorepo, so `pnpm install` resolves offline (the
50
+ * packages aren't on npm yet). No-op once the packages are published.
51
+ */
52
+ linkLocal(wsDir: string): void;
53
+ }
54
+ //# sourceMappingURL=ProjectWriter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProjectWriter.d.ts","sourceRoot":"","sources":["../../../../fronds/scaffold/services/ProjectWriter.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,WAAW,EAAqC,MAAM,eAAe,CAAC;AA2IpF,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,4FAA4F;IAC5F,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAM3D;IAED,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,GAAE,WAAiC,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAcxH;IAED,2FAA2F;IAC3F,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAUtE;IAED;;;;;;OAMG;IACH,aAAa,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,EAAE,CAO/C;IAED;;;;;;;;;;OAUG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,GAAE,WAAiC,GAAG,IAAI,CAoB9E;IAED;;;;;;;;;;OAUG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,GAAE,WAAiC,GAAG,IAAI,CAyB/E;IAED;;;;OAIG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAwC7B;CACF"}