@fougere/cli 0.12.4-alpha.0 → 0.12.6-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 (337) 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 +131 -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 +93 -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 +21 -0
  158. package/dist/fronds/scaffold/entities/New.d.ts.map +1 -0
  159. package/dist/fronds/scaffold/entities/New.js +20 -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 +20 -0
  198. package/dist/fronds/scaffold/handlers/SyncHandler.d.ts.map +1 -0
  199. package/dist/fronds/scaffold/handlers/SyncHandler.js +349 -0
  200. package/dist/fronds/scaffold/handlers/SyncHandler.js.map +1 -0
  201. package/dist/fronds/scaffold/services/ProjectWriter.d.ts +71 -0
  202. package/dist/fronds/scaffold/services/ProjectWriter.d.ts.map +1 -0
  203. package/dist/fronds/scaffold/services/ProjectWriter.js +341 -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 +8 -0
  215. package/dist/src/loader.d.ts.map +1 -0
  216. package/dist/{loader.js → src/loader.js} +10 -3
  217. package/dist/src/loader.js.map +1 -0
  218. package/dist/src/machine.d.ts.map +1 -0
  219. package/dist/src/machine.js.map +1 -0
  220. package/dist/src/main.d.ts +2 -0
  221. package/dist/src/main.d.ts.map +1 -0
  222. package/dist/src/main.js +19 -0
  223. package/dist/src/main.js.map +1 -0
  224. package/dist/src/runner.d.ts.map +1 -0
  225. package/dist/{runner.js → src/runner.js} +22 -22
  226. package/dist/src/runner.js.map +1 -0
  227. package/dist/src/theme.d.ts.map +1 -0
  228. package/dist/src/theme.js.map +1 -0
  229. package/dist/src/typescript/EntityTypes.d.ts.map +1 -0
  230. package/dist/src/typescript/EntityTypes.js.map +1 -0
  231. package/dist/src/typescript/FacadeTypes.d.ts.map +1 -0
  232. package/dist/src/typescript/FacadeTypes.js.map +1 -0
  233. package/dist/src/typescript/syntax.d.ts.map +1 -0
  234. package/dist/src/typescript/syntax.js.map +1 -0
  235. package/dist/{ui.d.ts → src/ui.d.ts} +0 -1
  236. package/dist/src/ui.d.ts.map +1 -0
  237. package/dist/{ui.js → src/ui.js} +24 -22
  238. package/dist/src/ui.js.map +1 -0
  239. package/package.json +23 -27
  240. package/templates/workspace/fronds/tsconfig.json +4 -1
  241. package/app/commands/BuildCommand.ts +0 -43
  242. package/app/commands/CallCommand.ts +0 -70
  243. package/app/commands/CheckCommand.ts +0 -70
  244. package/app/commands/CompletionCommand.ts +0 -24
  245. package/app/commands/DevtoolsCommand.ts +0 -92
  246. package/app/commands/ExplainCommand.ts +0 -136
  247. package/app/commands/FreezeCommand.ts +0 -119
  248. package/app/commands/GrantCommand.ts +0 -46
  249. package/app/commands/GraphCommand.ts +0 -91
  250. package/app/commands/KeysCommand.ts +0 -57
  251. package/app/commands/LoadCommand.ts +0 -46
  252. package/app/commands/MigrateCommand.ts +0 -61
  253. package/app/commands/NewCommand.ts +0 -137
  254. package/app/commands/ServeCommand.ts +0 -108
  255. package/dist/bin.d.ts.map +0 -1
  256. package/dist/bin.js +0 -64
  257. package/dist/bin.js.map +0 -1
  258. package/dist/bridge.d.ts.map +0 -1
  259. package/dist/bridge.js.map +0 -1
  260. package/dist/completion.d.ts.map +0 -1
  261. package/dist/completion.js.map +0 -1
  262. package/dist/index.d.ts.map +0 -1
  263. package/dist/index.js.map +0 -1
  264. package/dist/loader.d.ts +0 -4
  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 -21
  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/dist/{bin.d.ts → src/bin.d.ts} +0 -0
  321. /package/dist/{bridge.d.ts → src/bridge.d.ts} +0 -0
  322. /package/dist/{bridge.js → src/bridge.js} +0 -0
  323. /package/dist/{completion.d.ts → src/completion.d.ts} +0 -0
  324. /package/dist/{completion.js → src/completion.js} +0 -0
  325. /package/dist/{index.d.ts → src/index.d.ts} +0 -0
  326. /package/dist/{index.js → src/index.js} +0 -0
  327. /package/dist/{machine.d.ts → src/machine.d.ts} +0 -0
  328. /package/dist/{machine.js → src/machine.js} +0 -0
  329. /package/dist/{runner.d.ts → src/runner.d.ts} +0 -0
  330. /package/dist/{theme.d.ts → src/theme.d.ts} +0 -0
  331. /package/dist/{theme.js → src/theme.js} +0 -0
  332. /package/dist/{typescript → src/typescript}/EntityTypes.d.ts +0 -0
  333. /package/dist/{typescript → src/typescript}/EntityTypes.js +0 -0
  334. /package/dist/{typescript → src/typescript}/FacadeTypes.d.ts +0 -0
  335. /package/dist/{typescript → src/typescript}/FacadeTypes.js +0 -0
  336. /package/dist/{typescript → src/typescript}/syntax.d.ts +0 -0
  337. /package/dist/{typescript → src/typescript}/syntax.js +0 -0
@@ -0,0 +1,92 @@
1
+ import { loadConfig } from '@fougere/core/node';
2
+ import { chainOf } from '../versions.js';
3
+ /**
4
+ * Catching the database up with the frozen chain.
5
+ *
6
+ * Every step is replayed in order and what has already happened is SKIPPED, read off the
7
+ * columns themselves rather than a ledger of applied migrations. That is what makes the
8
+ * chain safe to replay whole: nothing here has to know which version the database sits
9
+ * at, and a column renamed by hand is seen rather than contradicted.
10
+ *
11
+ * The additive pass is not repeated here — a boot already creates missing tables and
12
+ * columns. What this adds is the half that touches live data, and only what a human
13
+ * declared at `fougere freeze`.
14
+ */
15
+ export default class MigrateHandler {
16
+ projectScan;
17
+ constructor(projectScan) {
18
+ this.projectScan = projectScan;
19
+ }
20
+ /**
21
+ * Realise the frozen steps this database has not caught up with.
22
+ *
23
+ * `json` is the presentation's, so it is not part of what this operation receives.
24
+ */
25
+ async execute(input) {
26
+ const scan = await this.projectScan.at(input.root ?? undefined);
27
+ const perFrond = await Promise.all(scan.fronds.map((frond) => stepsOf(frond.source.path)));
28
+ const steps = perFrond.flat();
29
+ if (steps.length === 0)
30
+ return { chain: [], changes: [], refusals: [], ran: [] };
31
+ const config = await loadConfig(scan.root);
32
+ // `fougere migrate --root ../app` read that project's config and planned against a
33
+ // database beside the CLI's own directory — the loudest form of this bug.
34
+ const { resolveStorage } = await import('@fougere/defaults');
35
+ const storage = resolveStorage(config.db ?? {}, undefined, scan.root);
36
+ if (!storage.db) {
37
+ return {
38
+ chain: versionsOf(steps),
39
+ changes: [],
40
+ refusals: [{ entity: '*', field: '*', reason: 'no `db` in fougere.config.ts — nothing to migrate' }],
41
+ ran: [],
42
+ };
43
+ }
44
+ // Resolved from the project rather than named in this package's dependencies:
45
+ // `@fougere/adapter-sql` declares `better-sqlite3`, so a CLI depending on it installs
46
+ // 26 MB of native module into every `npm create fougere`. A project that migrates
47
+ // declares the adapter itself, which is where this resolves from.
48
+ const { actualState, desiredTables, planStep, collapseChain, applyStep } = await import('@fougere/adapter-sql');
49
+ const tables = desiredTables(scan);
50
+ // Each frond's chain is composed on its own — its versions are its own line — and the
51
+ // results are gathered by SOURCE, because an engine is what a statement runs against.
52
+ const composed = collapseChain(perFrond.map((chain) => collapseChain(chain.map(({ step }) => step))));
53
+ const sourceOf = storage.sourceOf ?? (() => 'db');
54
+ const changes = [];
55
+ const refusals = [];
56
+ const ran = [];
57
+ for (const source of storage.sources?.() ?? ['db']) {
58
+ const db = (source === 'db' ? storage.db : storage.dbOf?.(source));
59
+ if (!db)
60
+ continue;
61
+ const mine = onSource(composed, source, sourceOf);
62
+ if (Object.keys(mine.entities).length === 0)
63
+ continue;
64
+ const plan = planStep(mine, tables, { actual: await actualState(db) });
65
+ changes.push(...plan.changes);
66
+ refusals.push(...plan.refusals);
67
+ // Held back: a refusal anywhere stops every engine, for the reason it stops every
68
+ // statement — half a chain is worse across two engines than within one.
69
+ if (input.apply && refusals.length === 0)
70
+ ran.push(...(await applyStep(plan, db)));
71
+ }
72
+ return { chain: versionsOf(steps), changes, refusals, ran: refusals.length > 0 ? [] : ran };
73
+ }
74
+ }
75
+ /** The versions read, oldest first and each named once however many fronds cut it. */
76
+ function versionsOf(steps) {
77
+ return [...new Set(steps.map(({ version }) => version))].sort((a, b) => a.localeCompare(b, 'en', { numeric: true }));
78
+ }
79
+ /** The part of a step whose entities live on one engine. */
80
+ function onSource(step, source, sourceOf) {
81
+ return {
82
+ ...step,
83
+ entities: Object.fromEntries(Object.entries(step.entities).filter(([entity]) => sourceOf(entity) === source)),
84
+ };
85
+ }
86
+ /** Every recorded step, oldest first — the chain composes, so it is replayed whole. */
87
+ async function stepsOf(frondPath) {
88
+ const chain = await chainOf(frondPath);
89
+ // The first version has a shape and no step — there was nothing before it to move from.
90
+ return chain.flatMap(({ name, step }) => (step ? [{ version: name, step }] : []));
91
+ }
92
+ //# sourceMappingURL=MigrateHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MigrateHandler.js","sourceRoot":"","sources":["../../../../fronds/analysis/handlers/MigrateHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIhD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAYzC;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,OAAO,OAAO,cAAc;IACb,WAAW;IAA/B,YAAoB,WAAwB;2BAAxB,WAAW;IAAgB,CAAC;IAEhD;;;;OAIG;IACH,KAAK,CAAC,OAAO,CAAC,KAA4B;QACxC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,IAAI,SAAS,CAAC,CAAC;QAChE,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3F,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC9B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,QA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ACF;AAED,sFAAsF;AACtF,SAAS,UAAU,CAAC,KAAqC;IACvD,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACvH,CAAC;AAED,4DAA4D;AAC5D,SAAS,QAAQ,CAAC,IAAa,EAAE,MAAc,EAAE,QAAoC;IACnF,OAAO;QACL,GAAG,IAAI;QACP,QAAQ,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC,CAAC;KAC9G,CAAC;AACJ,CAAC;AAED,uFAAuF;AACvF,KAAK,UAAU,OAAO,CAAC,SAAiB;IACtC,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,CAAC;IAEvC,wFAAwF;IACxF,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACpF,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { type FougereConfig, type ScanResult } from '@fougere/core';
2
+ /**
3
+ * Read a target project without booting it — what every analysis command needs first.
4
+ *
5
+ * `graph` and `check` had the same five lines each: resolve the root against the
6
+ * CLI's cwd, install a jiti loader so the scan can import TypeScript sources, scan.
7
+ * Two copies of one gesture, and the second was written by copying the first.
8
+ *
9
+ * Not a boot: `bootApp` runs migrations and seeds, so an analysis command
10
+ * that booted would write to the target's database. The cost is stated rather than
11
+ * hidden, though — the scan IMPORTS the modules it reads, so a frond's top-level
12
+ * code runs. "No application cycle, no database", not "no side effect".
13
+ */
14
+ export default class ProjectScan {
15
+ private cwd;
16
+ /** Scan the project at `root`, relative to where the command was invoked. */
17
+ at(root?: string): Promise<ScanResult & {
18
+ root: string;
19
+ config: FougereConfig;
20
+ }>;
21
+ }
22
+ //# sourceMappingURL=ProjectScan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProjectScan.d.ts","sourceRoot":"","sources":["../../../../fronds/analysis/services/ProjectScan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAMpE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,OAAO,OAAO,WAAW;IAE9B,OAAO,CAAC,GAAG,CAAiB;IAE5B,6EAA6E;IACvE,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,aAAa,CAAA;KAAE,CAAC,CA8BrF;CACF"}
@@ -0,0 +1,48 @@
1
+ import { scanProject, frondAliases } from '@fougere/compiler';
2
+ import { nested, resolveConventions } from '@fougere/core';
3
+ import { setModuleLoader, loadConfig } from '@fougere/core/node';
4
+ import { resolve } from 'node:path';
5
+ /**
6
+ * Read a target project without booting it — what every analysis command needs first.
7
+ *
8
+ * `graph` and `check` had the same five lines each: resolve the root against the
9
+ * CLI's cwd, install a jiti loader so the scan can import TypeScript sources, scan.
10
+ * Two copies of one gesture, and the second was written by copying the first.
11
+ *
12
+ * Not a boot: `bootApp` runs migrations and seeds, so an analysis command
13
+ * that booted would write to the target's database. The cost is stated rather than
14
+ * hidden, though — the scan IMPORTS the modules it reads, so a frond's top-level
15
+ * code runs. "No application cycle, no database", not "no side effect".
16
+ */
17
+ export default class ProjectScan {
18
+ // cwd is ambient in a CLI — not a DI service (the container resolves by type).
19
+ cwd = process.cwd();
20
+ /** Scan the project at `root`, relative to where the command was invoked. */
21
+ async at(root) {
22
+ const target = resolve(this.cwd, root || '.');
23
+ // The scan reads `.ts` sources; the default loader is a plain `import`, which
24
+ // cannot. Installed once per call because the loader is module-global — the
25
+ // CLI's own app was loaded with its own, and this replaces it for the target.
26
+ const { createJiti } = await import('jiti');
27
+ const install = (alias) => {
28
+ const jiti = createJiti(import.meta.url, { interopDefault: true, ...(alias ? { alias } : {}) });
29
+ setModuleLoader((filePath) => jiti.import(filePath));
30
+ };
31
+ /**
32
+ * The config is read BEFORE the aliases, because it names the scope they are built
33
+ * from. Safe because nothing in `fougere.config.ts` may import `@fronds/*` — the one
34
+ * import that would need the name to read the file that declares it.
35
+ */
36
+ install();
37
+ const config = await loadConfig(target);
38
+ const conventions = resolveConventions(config.conventions);
39
+ // The scope is the framework's own convention; the loader has to know it, or a frond
40
+ // naming its neighbour is unreadable to the very tool that checks it.
41
+ install(await frondAliases(target, conventions));
42
+ const scanned = await scanProject(target, undefined, conventions);
43
+ // A scan reads the disk, and the disk is flat: who inherits from whom is in the config.
44
+ // Stamped here so every reader of a project gets what a boot would have given it.
45
+ return { root: target, config, ...scanned, fronds: nested(scanned.fronds, config.fronds) };
46
+ }
47
+ }
48
+ //# sourceMappingURL=ProjectScan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProjectScan.js","sourceRoot":"","sources":["../../../../fronds/analysis/services/ProjectScan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MA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,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;IAC7F,CAAC;CACF"}
@@ -0,0 +1,21 @@
1
+ import type { SetDiff } from '@fougere/schema';
2
+ /**
3
+ * Where a FROND keeps what its shapes used to be — beside `entities/`, not under a dot.
4
+ * Written by `fougere freeze`, replayed by `fougere migrate`.
5
+ */
6
+ export declare const VERSIONS = "versions";
7
+ /** One cut version: its name, and the step that reached it — absent on the first. */
8
+ export interface Version {
9
+ name: string;
10
+ step?: SetDiff & {
11
+ previous?: string;
12
+ };
13
+ }
14
+ /**
15
+ * The versions a frond has cut, oldest first — read by FOLLOWING each step's `previous`.
16
+ *
17
+ * That link is the fact recorded the day the version was cut. Sorting directory names is
18
+ * a guess about the same fact, and a hotfix cut after a later version orders it wrong.
19
+ */
20
+ export declare function chainOf(frondPath: string): Promise<Version[]>;
21
+ //# sourceMappingURL=versions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../fronds/analysis/versions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;GAGG;AACH,eAAO,MAAM,QAAQ,aAAa,CAAC;AAEnC,qFAAqF;AACrF,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACxC;AAED;;;;;GAKG;AACH,wBAAsB,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAoCnE"}
@@ -0,0 +1,48 @@
1
+ import { readFile, readdir } from 'node:fs/promises';
2
+ import { join } from 'node:path';
3
+ /**
4
+ * Where a FROND keeps what its shapes used to be — beside `entities/`, not under a dot.
5
+ * Written by `fougere freeze`, replayed by `fougere migrate`.
6
+ */
7
+ export const VERSIONS = 'versions';
8
+ /**
9
+ * The versions a frond has cut, oldest first — read by FOLLOWING each step's `previous`.
10
+ *
11
+ * That link is the fact recorded the day the version was cut. Sorting directory names is
12
+ * a guess about the same fact, and a hotfix cut after a later version orders it wrong.
13
+ */
14
+ export async function chainOf(frondPath) {
15
+ const directory = join(frondPath, VERSIONS);
16
+ const found = await readdir(directory, { withFileTypes: true }).catch(() => []);
17
+ const names = found.filter((entry) => entry.isDirectory()).map((entry) => entry.name);
18
+ if (names.length === 0)
19
+ return [];
20
+ const steps = new Map();
21
+ for (const name of names) {
22
+ const raw = await readFile(join(directory, name, 'from.json'), 'utf8').catch(() => undefined);
23
+ steps.set(name, raw ? JSON.parse(raw) : undefined);
24
+ }
25
+ const roots = names.filter((name) => steps.get(name)?.previous === undefined);
26
+ if (roots.length !== 1) {
27
+ const said = roots.length === 0 ? 'none starts it' : `${roots.join(', ')} each start one`;
28
+ throw new Error(`${directory}: a frond's versions are ONE line and ${said}.`);
29
+ }
30
+ const next = new Map();
31
+ for (const [name, step] of steps)
32
+ if (step?.previous !== undefined)
33
+ next.set(step.previous, name);
34
+ const chain = [];
35
+ const seen = new Set();
36
+ for (let at = roots[0]; at !== undefined && !seen.has(at); at = next.get(at)) {
37
+ seen.add(at);
38
+ chain.push({ name: at, step: steps.get(at) });
39
+ }
40
+ // One check for every way the links fail to be a line: a fork (two versions claiming
41
+ // the same `previous`), a cycle, or a step naming a version that is not there.
42
+ const adrift = names.filter((name) => !seen.has(name));
43
+ if (adrift.length > 0) {
44
+ throw new Error(`${directory}: ${adrift.join(', ')} follow no version in the chain that starts at ${roots[0]}.`);
45
+ }
46
+ return chain;
47
+ }
48
+ //# sourceMappingURL=versions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../fronds/analysis/versions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE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CAAC,IAAI,CAAC,kDAAkD,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACnH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,7 @@
1
+ declare const BuildFrond_base: import("@fougere/schema").SchemaConstructor<{
2
+ frond: import("@fougere/schema").Field<string>;
3
+ }>;
4
+ export default class BuildFrond extends BuildFrond_base {
5
+ }
6
+ export {};
7
+ //# sourceMappingURL=BuildFrond.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BuildFrond.d.ts","sourceRoot":"","sources":["../../../../fronds/scaffold/entities/BuildFrond.ts"],"names":[],"mappings":";;;AAEA,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,eAEtC;CAAG"}
@@ -0,0 +1,6 @@
1
+ import { entity, text } from '@fougere/schema';
2
+ export default class BuildFrond extends entity({
3
+ frond: text({ description: 'Frond name to build (e.g. blog)' }),
4
+ }) {
5
+ }
6
+ //# sourceMappingURL=BuildFrond.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BuildFrond.js","sourceRoot":"","sources":["../../../../fronds/scaffold/entities/BuildFrond.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MAAM,CAAC;IAC7C,KAAK,EAAE,IAAI,CAAC,EAAE,WAAW,EAAE,iCAAiC,EAAE,CAAC;CAChE,CAAC;CAAG"}
@@ -0,0 +1,8 @@
1
+ declare const Call_base: import("@fougere/schema").SchemaConstructor<{
2
+ operation: import("@fougere/schema").Field<string>;
3
+ }>;
4
+ /** `fougere call <entity>.<op> [--field value …]` — invoke one operation, print the result. */
5
+ export default class Call extends Call_base {
6
+ }
7
+ export {};
8
+ //# sourceMappingURL=Call.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Call.d.ts","sourceRoot":"","sources":["../../../../fronds/scaffold/entities/Call.ts"],"names":[],"mappings":";;;AAEA,+FAA+F;AAC/F,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,SAEhC;CAAG"}
@@ -1,6 +1,7 @@
1
1
  import { entity, text } from "@fougere/schema";
2
-
3
2
  /** `fougere call <entity>.<op> [--field value …]` — invoke one operation, print the result. */
4
3
  export default class Call extends entity({
5
- operation: text({ min: 1, description: "entity.op to invoke (e.g. post.create)" }),
6
- }) {}
4
+ operation: text({ min: 1, description: "entity.op to invoke (e.g. post.create)" }),
5
+ }) {
6
+ }
7
+ //# sourceMappingURL=Call.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Call.js","sourceRoot":"","sources":["../../../../fronds/scaffold/entities/Call.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE/C,+FAA+F;AAC/F,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,MAAM,CAAC;IACvC,SAAS,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,WAAW,EAAE,wCAAwC,EAAE,CAAC;CACnF,CAAC;CAAG"}
@@ -0,0 +1,7 @@
1
+ declare const Completion_base: import("@fougere/schema").SchemaConstructor<{
2
+ shell: import("@fougere/schema").Field<"bash" | "zsh">;
3
+ }>;
4
+ export default class Completion extends Completion_base {
5
+ }
6
+ export {};
7
+ //# sourceMappingURL=Completion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Completion.d.ts","sourceRoot":"","sources":["../../../../fronds/scaffold/entities/Completion.ts"],"names":[],"mappings":";;;AAEA,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,eAEtC;CAAG"}
@@ -0,0 +1,6 @@
1
+ import { entity, oneOf } from '@fougere/schema';
2
+ export default class Completion extends entity({
3
+ shell: oneOf('zsh', 'bash', { description: 'Shell type (default: auto-detect)' }),
4
+ }) {
5
+ }
6
+ //# sourceMappingURL=Completion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Completion.js","sourceRoot":"","sources":["../../../../fronds/scaffold/entities/Completion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MAAM,CAAC;IAC7C,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;CAClF,CAAC;CAAG"}
@@ -0,0 +1,8 @@
1
+ declare const Grant_base: import("@fougere/schema").SchemaConstructor<{
2
+ frond: import("@fougere/schema").Field<string>;
3
+ }>;
4
+ /** `fougere grant <frond>` — vouch for one frond, so any receiver admits it. */
5
+ export default class Grant extends Grant_base {
6
+ }
7
+ export {};
8
+ //# sourceMappingURL=Grant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Grant.d.ts","sourceRoot":"","sources":["../../../../fronds/scaffold/entities/Grant.ts"],"names":[],"mappings":";;;AAEA,gFAAgF;AAChF,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,UAEjC;CAAG"}
@@ -1,6 +1,7 @@
1
1
  import { entity, text } from "@fougere/schema";
2
-
3
2
  /** `fougere grant <frond>` — vouch for one frond, so any receiver admits it. */
4
3
  export default class Grant extends entity({
5
- frond: text({ min: 1, description: "Frond to vouch for" }),
6
- }) {}
4
+ frond: text({ min: 1, description: "Frond to vouch for" }),
5
+ }) {
6
+ }
7
+ //# sourceMappingURL=Grant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Grant.js","sourceRoot":"","sources":["../../../../fronds/scaffold/entities/Grant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE/C,gFAAgF;AAChF,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,MAAM,CAAC;IACxC,KAAK,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;CAC3D,CAAC;CAAG"}
@@ -0,0 +1,6 @@
1
+ declare const Keys_base: import("@fougere/schema").SchemaConstructor<{}>;
2
+ /** `fougere keys` — create the root this system's grants are signed by. Once. */
3
+ export default class Keys extends Keys_base {
4
+ }
5
+ export {};
6
+ //# sourceMappingURL=Keys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Keys.d.ts","sourceRoot":"","sources":["../../../../fronds/scaffold/entities/Keys.ts"],"names":[],"mappings":";AAEA,iFAAiF;AACjF,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,SAAU;CAAG"}
@@ -1,4 +1,5 @@
1
1
  import { entity } from "@fougere/schema";
2
-
3
2
  /** `fougere keys` — create the root this system's grants are signed by. Once. */
4
- export default class Keys extends entity({}) {}
3
+ export default class Keys extends entity({}) {
4
+ }
5
+ //# sourceMappingURL=Keys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Keys.js","sourceRoot":"","sources":["../../../../fronds/scaffold/entities/Keys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,iFAAiF;AACjF,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,MAAM,CAAC,EAAE,CAAC;CAAG"}
@@ -0,0 +1,21 @@
1
+ declare const New_base: import("@fougere/schema").SchemaConstructor<{
2
+ name: import("@fougere/schema").Field<string>;
3
+ force: import("@fougere/schema").Field<boolean>;
4
+ bare: import("@fougere/schema").Field<boolean>;
5
+ flat: import("@fougere/schema").Field<boolean>;
6
+ local: import("@fougere/schema").Field<boolean>;
7
+ frond: import("@fougere/schema").Field<string>;
8
+ app: import("@fougere/schema").Field<string>;
9
+ }>;
10
+ /**
11
+ * `fougere new [name]` — the workspace composer.
12
+ *
13
+ * Guided when it has a TTY and nothing to compose from; stated when `--frond` or
14
+ * `--app` is given, which is the only form a script, a CI job or an agent can drive.
15
+ * `--bare` is the third: the empty shell, nothing composed. `--flat` is the fourth, and
16
+ * it selects a SHAPE rather than a composition: one app that is its own domain.
17
+ */
18
+ export default class New extends New_base {
19
+ }
20
+ export {};
21
+ //# sourceMappingURL=New.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"New.d.ts","sourceRoot":"","sources":["../../../../fronds/scaffold/entities/New.ts"],"names":[],"mappings":";;;;;;;;;AAEA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,QAQ/B;CAAG"}
@@ -0,0 +1,20 @@
1
+ import { entity, text, bool } from "@fougere/schema";
2
+ /**
3
+ * `fougere new [name]` — the workspace composer.
4
+ *
5
+ * Guided when it has a TTY and nothing to compose from; stated when `--frond` or
6
+ * `--app` is given, which is the only form a script, a CI job or an agent can drive.
7
+ * `--bare` is the third: the empty shell, nothing composed. `--flat` is the fourth, and
8
+ * it selects a SHAPE rather than a composition: one app that is its own domain.
9
+ */
10
+ export default class New extends entity({
11
+ name: text({ description: "Workspace name" }),
12
+ force: bool({ description: "Overwrite existing directory", default: false }),
13
+ bare: bool({ description: "Skip the guided flow — just the empty shell", default: false }),
14
+ flat: bool({ description: "One domain: no fronds/ — the app root is the frond", default: false }),
15
+ local: bool({ description: "Link @fougere/* to this monorepo (dev — installs offline)", default: false }),
16
+ frond: text({ description: "Fronds to add, no prompt — 'blog' or 'blog:shop', comma-separated", default: "" }),
17
+ app: text({ description: "Apps to add, no prompt — 'nuxt' or 'nuxt:web', comma-separated", default: "" }),
18
+ }) {
19
+ }
20
+ //# sourceMappingURL=New.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"New.js","sourceRoot":"","sources":["../../../../fronds/scaffold/entities/New.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAErD;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,MAAM,CAAC;IACtC,IAAI,EAAE,IAAI,CAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAC7C,KAAK,EAAE,IAAI,CAAC,EAAE,WAAW,EAAE,8BAA8B,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5E,IAAI,EAAE,IAAI,CAAC,EAAE,WAAW,EAAE,6CAA6C,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC1F,IAAI,EAAE,IAAI,CAAC,EAAE,WAAW,EAAE,oDAAoD,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACjG,KAAK,EAAE,IAAI,CAAC,EAAE,WAAW,EAAE,2DAA2D,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACzG,KAAK,EAAE,IAAI,CAAC,EAAE,WAAW,EAAE,mEAAmE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC9G,GAAG,EAAE,IAAI,CAAC,EAAE,WAAW,EAAE,gEAAgE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;CAC1G,CAAC;CAAG"}
@@ -0,0 +1,10 @@
1
+ declare const Serve_base: import("@fougere/schema").SchemaConstructor<{
2
+ frond: import("@fougere/schema").Field<string>;
3
+ port: import("@fougere/schema").Field<number | null>;
4
+ watch: import("@fougere/schema").Field<boolean | null>;
5
+ }>;
6
+ /** `fougere serve <frond>` — run one frond alone in its own process (JSON-RPC over HTTP). */
7
+ export default class Serve extends Serve_base {
8
+ }
9
+ export {};
10
+ //# sourceMappingURL=Serve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Serve.d.ts","sourceRoot":"","sources":["../../../../fronds/scaffold/entities/Serve.ts"],"names":[],"mappings":";;;;;AAEA,6FAA6F;AAC7F,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,UAIjC;CAAG"}
@@ -0,0 +1,9 @@
1
+ import { entity, text, number, bool, optional } from "@fougere/schema";
2
+ /** `fougere serve <frond>` — run one frond alone in its own process (JSON-RPC over HTTP). */
3
+ export default class Serve extends entity({
4
+ frond: text({ min: 1, description: "Frond to host in its own process" }),
5
+ port: optional(number({ description: "Port to listen on (default 4100)" })),
6
+ watch: optional(bool({ description: "Rebuild the app when the frond changes" })),
7
+ }) {
8
+ }
9
+ //# sourceMappingURL=Serve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Serve.js","sourceRoot":"","sources":["../../../../fronds/scaffold/entities/Serve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEvE,6FAA6F;AAC7F,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,MAAM,CAAC;IACxC,KAAK,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;IACxE,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC,CAAC;IAC3E,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,wCAAwC,EAAE,CAAC,CAAC;CACjF,CAAC;CAAG"}
@@ -0,0 +1,8 @@
1
+ declare const Sync_base: import("@fougere/schema").SchemaConstructor<{
2
+ frond: import("@fougere/schema").Field<string>;
3
+ from: import("@fougere/schema").Field<string>;
4
+ }>;
5
+ export default class Sync extends Sync_base {
6
+ }
7
+ export {};
8
+ //# sourceMappingURL=Sync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sync.d.ts","sourceRoot":"","sources":["../../../../fronds/scaffold/entities/Sync.ts"],"names":[],"mappings":";;;;AAEA,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,SAGhC;CAAG"}
@@ -0,0 +1,7 @@
1
+ import { entity, text } from '@fougere/schema';
2
+ export default class Sync extends entity({
3
+ frond: text({ description: 'Frond name to sync (e.g. blog)' }),
4
+ from: text({ description: 'Remote URL (e.g. http://blog-service:3000)' }),
5
+ }) {
6
+ }
7
+ //# sourceMappingURL=Sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sync.js","sourceRoot":"","sources":["../../../../fronds/scaffold/entities/Sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,MAAM,CAAC;IACvC,KAAK,EAAE,IAAI,CAAC,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IAC9D,IAAI,EAAE,IAAI,CAAC,EAAE,WAAW,EAAE,4CAA4C,EAAE,CAAC;CAC1E,CAAC;CAAG"}
@@ -0,0 +1,11 @@
1
+ export default class BuildFrondHandler {
2
+ private cwd;
3
+ /** Build a frond into a standalone deployable package. */
4
+ execute(input: {
5
+ frond: string;
6
+ }): Promise<{
7
+ path: string;
8
+ entities: string[];
9
+ }>;
10
+ }
11
+ //# sourceMappingURL=BuildFrondHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BuildFrondHandler.d.ts","sourceRoot":"","sources":["../../../../fronds/scaffold/handlers/BuildFrondHandler.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,OAAO,iBAAiB;IAEpC,OAAO,CAAC,GAAG,CAAiB;IAE5B,0DAA0D;IACpD,OAAO,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAmFrF;CACF"}
@@ -0,0 +1,82 @@
1
+ import { execSync } from 'node:child_process';
2
+ import { existsSync, writeFileSync, readFileSync, readdirSync, unlinkSync } from 'node:fs';
3
+ import { join, basename } from 'node:path';
4
+ import { resolveConventions, frondPackage } from '@fougere/core';
5
+ import { loadConfig } from '@fougere/core/node';
6
+ export default class BuildFrondHandler {
7
+ // cwd is ambient in a CLI — not a DI service (the container resolves by type).
8
+ cwd = process.cwd();
9
+ /** Build a frond into a standalone deployable package. */
10
+ async execute(input) {
11
+ const conventions = resolveConventions((await loadConfig(this.cwd)).conventions);
12
+ const frondDir = join(this.cwd, conventions.fronds, input.frond);
13
+ if (!existsSync(frondDir)) {
14
+ throw new Error(`Frond '${input.frond}' not found at ${frondDir}`);
15
+ }
16
+ const entitiesDir = join(frondDir, conventions.dirs.entities);
17
+ if (!existsSync(entitiesDir)) {
18
+ throw new Error(`No ${conventions.dirs.entities}/ directory in frond '${input.frond}'`);
19
+ }
20
+ // Discover entity files
21
+ const entityFiles = readdirSync(entitiesDir)
22
+ .filter((f) => f.endsWith('.ts') && !f.endsWith('.d.ts'))
23
+ .sort();
24
+ if (entityFiles.length === 0) {
25
+ throw new Error(`No .ts files in ${entitiesDir}`);
26
+ }
27
+ const entityNames = entityFiles.map((f) => basename(f, '.ts'));
28
+ // Generate barrel index.ts
29
+ const indexLines = entityNames.map((name) => `export { default as ${name} } from './${conventions.dirs.entities}/${name}.js';`);
30
+ writeFileSync(join(frondDir, 'index.ts'), indexLines.join('\n') + '\n');
31
+ // Generate tsconfig.build.json
32
+ const tsconfig = {
33
+ compilerOptions: {
34
+ target: 'ES2022',
35
+ module: 'Node16',
36
+ moduleResolution: 'Node16',
37
+ declaration: true,
38
+ outDir: './dist',
39
+ rootDir: '.',
40
+ strict: true,
41
+ esModuleInterop: true,
42
+ skipLibCheck: true,
43
+ },
44
+ include: ['index.ts', `${conventions.dirs.entities}/**/*.ts`],
45
+ };
46
+ const tsconfigPath = join(frondDir, 'tsconfig.build.json');
47
+ writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 2));
48
+ try {
49
+ execSync('npx tsc -p tsconfig.build.json', { cwd: frondDir, stdio: 'inherit' });
50
+ }
51
+ finally {
52
+ try {
53
+ unlinkSync(tsconfigPath);
54
+ }
55
+ catch { /* ignore */ }
56
+ }
57
+ // Update package.json
58
+ const pkgPath = join(frondDir, 'package.json');
59
+ const pkg = existsSync(pkgPath)
60
+ ? JSON.parse(readFileSync(pkgPath, 'utf-8'))
61
+ : { name: frondPackage(input.frond, conventions), version: '0.0.1', type: 'module' };
62
+ pkg.exports = {
63
+ '.': {
64
+ types: './dist/index.d.ts',
65
+ default: './dist/index.js',
66
+ },
67
+ [`./${conventions.dirs.entities}/*`]: {
68
+ types: `./dist/${conventions.dirs.entities}/*.d.ts`,
69
+ default: `./dist/${conventions.dirs.entities}/*.js`,
70
+ },
71
+ './package.json': './package.json',
72
+ };
73
+ // Only publish dist + package.json
74
+ pkg.files = ['dist', 'package.json'];
75
+ // Ensure peerDependencies on @fougere/schema
76
+ pkg.peerDependencies ??= {};
77
+ pkg.peerDependencies['@fougere/schema'] ??= '*';
78
+ writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n');
79
+ return { path: join(frondDir, 'dist'), entities: entityNames };
80
+ }
81
+ }
82
+ //# sourceMappingURL=BuildFrondHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BuildFrondHandler.js","sourceRoot":"","sources":["../../../../fronds/scaffold/handlers/BuildFrondHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACpC,+EAA+E;IACvE,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAE5B,0DAA0D;IAC1D,KAAK,CAAC,OAAO,CAAC,KAAwB;QACpC,MAAM,WAAW,GAAG,kB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