@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
@@ -1,92 +0,0 @@
1
- import { createAppRunner } from '@fougere/core';
2
- import type { App, CallRecord } from '@fougere/core';
3
- import type { CallsView } from '../../fronds/analysis/handlers/DevtoolsHandler.js';
4
- import type { ui as createUi } from '../../src/ui.js';
5
- import { machineWanted, printMachine } from '../../src/machine.js';
6
- import pc from 'picocolors';
7
-
8
- type Ui = ReturnType<typeof createUi>;
9
-
10
- /** How long between two reads. Fast enough to read as a stream, cheap enough to ignore. */
11
- const EVERY_MS = 500;
12
-
13
- const ROUTE = { local: pc.green, remote: pc.cyan, system: pc.magenta } as const;
14
-
15
- /**
16
- * `fougere devtools` — the call log of every running app of this project, followed.
17
- *
18
- * A cursor per address, because each app numbers its own ring: asking for what this reader
19
- * has not seen is the whole protocol, and it is per source or nothing.
20
- */
21
- export default class DevtoolsCommand {
22
- constructor(private app: App, private ui: Ui) {}
23
-
24
- async run(raw: Record<string, unknown>) {
25
- const since: Record<string, number> = {};
26
-
27
- if (machineWanted(raw)) return printMachine(await this.view(raw, since));
28
-
29
- const first = await this.view(raw, since);
30
- this.announce(first);
31
-
32
- const told: Record<string, number> = {};
33
- for (let view = first; ; view = await this.view(raw, since)) {
34
- for (const source of view.sources) {
35
- since[source.url] = source.cursor;
36
-
37
- // Said once per address, and only when it grows: a ring that dropped is not a
38
- // quiet period, and repeating it every half second would bury the calls.
39
- if (source.dropped > (told[source.url] ?? 0)) {
40
- this.ui.warn(`${source.url} dropped ${source.dropped - (told[source.url] ?? 0)} call(s) — its ring is smaller than this traffic`);
41
- told[source.url] = source.dropped;
42
- }
43
- }
44
-
45
- for (const call of view.calls) process.stdout.write(render(call, view.sources.length > 1) + '\n');
46
- await new Promise((wake) => setTimeout(wake, EVERY_MS));
47
- }
48
- }
49
-
50
- /** What is being watched, and what refused — stated before the first line scrolls. */
51
- private announce(view: CallsView): void {
52
- for (const source of view.sources) {
53
- const name = source.frond ? `${pc.bold(source.frond)} ${pc.dim(source.url)}` : pc.bold(source.url);
54
- if (source.refusal) this.ui.warn(`${name} — ${source.refusal}`);
55
- else this.ui.step(`following ${name}`);
56
- }
57
- this.ui.info(pc.dim('ctrl-c to stop'));
58
- }
59
-
60
- private view(raw: Record<string, unknown>, since: Record<string, number>): Promise<CallsView> {
61
- return createAppRunner(this.app)(
62
- { entity: 'devtools', op: 'execute' },
63
- { params: {}, query: {}, input: { ...raw, since }, state: {} },
64
- ) as Promise<CallsView>;
65
- }
66
- }
67
-
68
- function render(call: CallRecord & { source: string }, many: boolean): string {
69
- // Padded BEFORE colouring: an escape sequence counts in a string's length, so padding a
70
- // coloured value moves the column by however many bytes the colour took.
71
- const at = many ? pc.dim(pad(new URL(call.source).port || call.source, 5)) : '';
72
- const frond = pc.dim(pad(call.frond ?? '—', 9));
73
- const address = pc.bold(pad(`${call.entity}.${call.operation}${call.surface ? `/${call.surface}` : ''}`, 22));
74
- const route = call.route
75
- ? (ROUTE[call.route] ?? pc.dim)(pad(call.route, 9))
76
- : pc.red(pad('unrouted', 9));
77
- const took = pc.dim(lead(call.ms === undefined ? '' : `${call.ms}ms`, 7));
78
- const verdict = call.verdict === 'failed'
79
- ? pc.red(call.refusal?.code ?? 'failed')
80
- : call.verdict === 'ok' ? pc.dim('ok') : pc.yellow('running');
81
-
82
- return [at, frond, address, route, took, verdict, call.trace ? pc.dim(call.trace.slice(3, 11)) : '']
83
- .filter(Boolean).join(' ');
84
- }
85
-
86
- function pad(value: string, width: number): string {
87
- return value.length >= width ? value : value + ' '.repeat(width - value.length);
88
- }
89
-
90
- function lead(value: string, width: number): string {
91
- return value.length >= width ? value : ' '.repeat(width - value.length) + value;
92
- }
@@ -1,136 +0,0 @@
1
- import type { App } from '@fougere/core';
2
- import { createAppRunner } from '@fougere/core';
3
- import type { ui as createUi } from '../../src/ui.js';
4
- import type {
5
- ExplainResult,
6
- ExplainListing,
7
- ExplainedBinding,
8
- } from '../../fronds/analysis/handlers/ExplainHandler.js';
9
- import pc from 'picocolors';
10
- import { machineText, printMachine } from '../../src/machine.js';
11
-
12
- type Ui = ReturnType<typeof createUi>;
13
-
14
- export default class ExplainCommand {
15
- constructor(private app: App, private ui: Ui) {}
16
-
17
- async run(raw: Record<string, unknown>) {
18
- const names = raw.names as 'operations' | 'fronds' | undefined;
19
- const operation = (raw.operation as string | undefined)?.trim();
20
-
21
- // No operation named — the question is what this project serves at all. The same
22
- // model answers both, so the facade is the one that was asked, never a guess.
23
- if (names || !operation) return this.listing(raw, names);
24
-
25
- const result = await this.ask('execute', raw) as ExplainResult;
26
-
27
- if (raw.json === true) return printMachine(result);
28
-
29
- this.ui.note(renderExplain(result), result.operation);
30
- }
31
-
32
- private async listing(raw: Record<string, unknown>, names?: 'operations' | 'fronds') {
33
- const listing = await this.ask('list', raw) as ExplainListing;
34
-
35
- // A completion script has no JSON parser: one name per line, nothing else on stdout.
36
- if (names) {
37
- const values = names === 'fronds'
38
- ? listing.fronds.map((frond) => frond.name)
39
- : listing.operations;
40
- if (values.length > 0) process.stdout.write(values.join('\n') + '\n');
41
-
42
- return;
43
- }
44
-
45
- if (raw.json === true) return printMachine(listing);
46
-
47
- this.ui.note(renderListing(listing), 'what this project serves');
48
- }
49
-
50
- private ask(op: string, raw: Record<string, unknown>) {
51
- return createAppRunner(this.app)(
52
- { entity: 'explain', op },
53
- { params: {}, query: {}, input: raw, state: {} },
54
- );
55
- }
56
- }
57
-
58
- /** Kept as the name `tests/explain.test.ts` pins the key order through. */
59
- export function renderExplainJson(result: ExplainResult): string {
60
- return machineText(result);
61
- }
62
-
63
- export function renderExplain(result: ExplainResult): string {
64
- const lines = [
65
- `${pc.dim('Handler:')} ${result.handler.class}.${result.handler.method}`,
66
- `${pc.dim('Address:')} ${result.handler.address}.${result.operation.split('.').at(-1)}`,
67
- `${pc.dim('Kind:')} ${result.kind}`,
68
- `${pc.dim('Input:')} ${result.input ?? '—'}`,
69
- `${pc.dim('Output:')} ${result.output ? `${result.output.type}${result.output.cardinality ? ` (${result.output.cardinality})` : ''}` : '—'}`,
70
- ];
71
-
72
- if (result.description) lines.push(`${pc.dim('Purpose:')} ${result.description}`);
73
-
74
- lines.push('', pc.bold('Parameters'));
75
- if (result.parameters.length === 0) lines.push(' —');
76
- for (const parameter of result.parameters) {
77
- const optional = parameter.optional ? '?' : '';
78
- lines.push(` ${parameter.name}${optional}: ${parameter.type ?? 'unknown'} ${pc.dim('→')} ${bindingName(parameter.binding)}`);
79
- }
80
-
81
- lines.push('', pc.bold('Collectors'));
82
- if (result.collectors.length === 0) lines.push(' —');
83
- for (const collector of result.collectors) {
84
- lines.push(` ${collector.typeName} ${pc.dim('→')} ${collector.class}`);
85
- }
86
-
87
- lines.push(
88
- '',
89
- `${pc.dim('Surfaces:')} ${result.exposure.surfaces.join(', ') || '—'}`,
90
- `${pc.dim('Adapters:')} ${result.exposure.adapters.join(', ') || '—'}`,
91
- `${pc.dim('Placement:')} ${result.placement.frond} / ${result.placement.runtime}${result.placement.remote ? ` (${result.placement.remote})` : ''}`,
92
- // Where the work GOES, under where it answers. The hop count is what a sampling rate, a
93
- // histogram's bounds and a load threshold are all a function of — each hard-coded today.
94
- `${pc.dim('Reach:')} ${renderReach(result.reach)}`,
95
- );
96
-
97
- if (result.handler.file) lines.push(`${pc.dim('Source:')} ${result.handler.file}`);
98
-
99
- return lines.join('\n');
100
- }
101
-
102
- /** What this op reaches, and the part of it that costs a round trip. */
103
- function renderReach(reach: ExplainResult['reach']): string {
104
- if (reach.fronds.length === 0) return pc.dim('nothing outside its own frond');
105
-
106
- const named = reach.fronds
107
- .map((one) => (one.runtime === 'remote' ? pc.yellow(one.frond) : pc.cyan(one.frond)))
108
- .join(', ');
109
-
110
- return `${named} ${pc.dim(`— ${reach.hops} hop(s)`)}`;
111
- }
112
-
113
- export function renderListing(listing: ExplainListing): string {
114
- const lines = [pc.bold('Fronds')];
115
- if (listing.fronds.length === 0) lines.push(' —');
116
- for (const frond of listing.fronds) {
117
- const where = frond.remote ? `remote ${pc.dim(frond.remote)}` : 'local';
118
- lines.push(` ${frond.name} ${pc.dim('→')} ${where}, ${frond.operations} operation(s)`);
119
- }
120
-
121
- lines.push('', pc.bold('Operations'));
122
- if (listing.operations.length === 0) lines.push(' —');
123
- for (const operation of listing.operations) lines.push(` ${operation}`);
124
-
125
- return lines.join('\n');
126
- }
127
-
128
- function bindingName(binding: ExplainedBinding | null): string {
129
- if (!binding) return 'unbound';
130
- switch (binding.kind) {
131
- case 'collector': return `collector:${binding.typeName}`;
132
- case 'fact': return `fact:${binding.factName}`;
133
- case 'param': return `param:${binding.name}${binding.coerce ? ` (${binding.coerce})` : ''}`;
134
- default: return binding.kind;
135
- }
136
- }
@@ -1,119 +0,0 @@
1
- import { createAppRunner } from '@fougere/core';
2
- import type { Change } from '@fougere/schema';
3
- import type { App } from '@fougere/core';
4
- import type { ui as createUi } from '../../src/ui.js';
5
- import type { FreezeInspection } from '../../fronds/analysis/handlers/FreezeHandler.js';
6
- import pc from 'picocolors';
7
- import { machineWanted, printMachine } from '../../src/machine.js';
8
-
9
- type Ui = ReturnType<typeof createUi>;
10
-
11
- /**
12
- * Cutting a version — inspect, ask what only a human knows, then record.
13
- *
14
- * The question is asked between the two ops and nowhere else: a field gone plus a field
15
- * appeared is either a rename or a drop-and-add, the two produce opposite DDL, and the
16
- * intent left with the person who made the change. Nothing is written until it is settled.
17
- */
18
- export default class FreezeCommand {
19
- constructor(private app: App, private ui: Ui) {}
20
-
21
- async run(raw: Record<string, unknown>) {
22
- if (!raw.version) {
23
- this.ui.error('Usage: fougere freeze <version>');
24
-
25
- return;
26
- }
27
-
28
- const freeze = (input: Record<string, unknown>) =>
29
- createAppRunner(this.app)({ entity: 'freeze', op: 'execute' }, { params: {}, query: {}, input, state: {} }) as Promise<FreezeInspection>;
30
-
31
- // Idempotent while it refuses: this writes when nothing is ambiguous, and reports
32
- // otherwise — so the first call is both the inspection and the happy path.
33
- const seen = await freeze(raw);
34
-
35
- // The question below cannot be put to a machine, so the inspection is the answer:
36
- // `ambiguous` says what a human still has to settle, and nothing was written.
37
- if (machineWanted(raw)) return printMachine(seen);
38
-
39
- if (seen.entities.length === 0) {
40
- this.ui.warn('No entities found. Run this from a Fougere project root.');
41
-
42
- return;
43
- }
44
-
45
- if (seen.written) {
46
- this.report(seen);
47
-
48
- return;
49
- }
50
-
51
- const renamed = await this.settle(seen);
52
- if (renamed === undefined) return;
53
-
54
- this.report(await freeze({ ...raw, renamed }));
55
- }
56
-
57
- /** Turn every ambiguity into a declaration, or `undefined` when the answer is a refusal. */
58
- private async settle(seen: FreezeInspection): Promise<Record<string, Record<string, string>> | undefined> {
59
- const renamed: Record<string, Record<string, string>> = {};
60
- const pending = Object.entries(seen.ambiguous);
61
- if (pending.length === 0) return renamed;
62
-
63
- this.ui.warn('A field left and a field of the same shape appeared. Only you know which.');
64
-
65
- for (const [entity, pairs] of pending) {
66
- // Grouped by what LEFT: one departed field is one question, however many
67
- // candidates carry its shape.
68
- const byRemoved = new Map<string, string[]>();
69
- for (const { removed, added } of pairs) byRemoved.set(removed, [...(byRemoved.get(removed) ?? []), added]);
70
-
71
- for (const [removed, candidates] of byRemoved) {
72
- const answer = await this.ui.select({
73
- message: `${entity}.${pc.bold(removed)} — what happened to it?`,
74
- options: [
75
- ...candidates.map((added) => ({ value: added, label: `renamed to ${added}`, hint: 'the data moves with it' })),
76
- { value: '', label: 'dropped', hint: 'the column goes, and what it held goes with it' },
77
- ],
78
- });
79
- // An empty answer is a cancel as much as a "dropped" — writing on either would
80
- // record a decision nobody made.
81
- if (!answer) {
82
- this.ui.warn(`${entity}.${removed} treated as dropped — say so explicitly if that is right.`);
83
-
84
- return undefined;
85
- }
86
- renamed[entity] = { ...renamed[entity], [removed]: answer };
87
- }
88
- }
89
-
90
- return renamed;
91
- }
92
-
93
- private report(written: FreezeInspection) {
94
- const { step } = written;
95
- if (!step) {
96
- this.ui.success(`${written.version} recorded — ${written.entities.length} entities, and nothing before it`);
97
-
98
- return;
99
- }
100
-
101
- const moved = Object.entries(step.entities);
102
- const count = moved.reduce((total, [, answer]) => total + answer.changes.length, 0);
103
-
104
- this.ui.success(`${written.version} recorded — ${count} change(s) since ${written.previous}`);
105
- for (const [entity, answer] of moved) {
106
- this.ui.step(`${pc.bold(entity)} — ${answer.changes.map(describeChange).join(', ')}`);
107
- }
108
- if (step.entitiesAdded.length > 0) this.ui.step(`new: ${step.entitiesAdded.join(', ')}`);
109
- if (step.entitiesRemoved.length > 0) this.ui.step(`gone: ${step.entitiesRemoved.join(', ')}`);
110
- }
111
- }
112
-
113
- function describeChange(change: Change): string {
114
- if (change.kind === 'renamed') return `${change.from} → ${change.to}`;
115
- // An axis that moved names WHICH: "restated title" says nothing a reader can act on.
116
- if (change.kind === 'restated') return `${change.field}: ${change.axis} moved`;
117
-
118
- return `${change.kind} ${change.field}`;
119
- }
@@ -1,46 +0,0 @@
1
- import { readFile } from 'node:fs/promises';
2
- import { join } from 'node:path';
3
- import { generateKeyPair, issueGrant } from '@fougere/core/node';
4
- import type { App } from '@fougere/core';
5
- import type { ui as createUi } from '../../src/ui.js';
6
- import { ROOT_KEY, packed } from './grant-material.js';
7
-
8
- type Ui = ReturnType<typeof createUi>;
9
-
10
- /**
11
- * Vouch for one frond: bind its name to a fresh key, signed by the root.
12
- *
13
- * The key is printed and never stored — it belongs to the deployment, not to the
14
- * repository. Re-running issues a NEW key rather than showing the old one, which is
15
- * what rotation is: run it again, redeploy that frond, and nobody else's config moves.
16
- */
17
- export default class GrantCommand {
18
- constructor(private app: App, private ui: Ui) {}
19
-
20
- async run(raw: Record<string, unknown>) {
21
- const frond = raw.frond as string | undefined;
22
- if (!frond) {
23
- this.ui.error('Usage: fougere grant <frond>');
24
-
25
- return;
26
- }
27
-
28
- let rootPrivateKey: string;
29
- try {
30
- rootPrivateKey = await readFile(join(process.cwd(), ROOT_KEY), 'utf8');
31
- } catch {
32
- this.ui.error(`No ${ROOT_KEY} — run \`fougere keys\` first.`);
33
-
34
- return;
35
- }
36
-
37
- const { privateKey, publicKey } = generateKeyPair();
38
- const grant = issueGrant(rootPrivateKey, frond, publicKey);
39
-
40
- this.ui.success(`granted — '${frond}' will be admitted by any receiver trusting this root`);
41
- this.ui.note(
42
- `FOUGERE_KEY=${packed(privateKey)}\nFOUGERE_GRANT=${grant}`,
43
- `Inject into '${frond}' at launch — secret, shown once`,
44
- );
45
- }
46
- }
@@ -1,91 +0,0 @@
1
- import type { GraphResult } from '../../fronds/analysis/handlers/GraphHandler.js';
2
- import type { DeclaredTopology, EntityNode, DomainCluster, App } from '@fougere/core';
3
- import { createAppRunner } from '@fougere/core';
4
- import type { ui as createUi } from '../../src/ui.js';
5
- import pc from 'picocolors';
6
- import { machineWanted, printMachine } from '../../src/machine.js';
7
-
8
- type Ui = ReturnType<typeof createUi>;
9
-
10
- export default class GraphCommand {
11
- constructor(private app: App, private ui: Ui) {}
12
-
13
- async run(raw: Record<string, unknown>) {
14
- // Ride the call contract — the same envelope every consumer uses.
15
- const result = await createAppRunner(this.app)(
16
- { entity: 'graph', op: 'execute' },
17
- { params: {}, query: {}, input: raw, state: {} },
18
- ) as GraphResult;
19
-
20
- if (machineWanted(raw)) return printMachine(result);
21
-
22
- if (result.totalFronds === 0) {
23
- this.ui.warn('No fronds found. Run this from a Fougere project root.');
24
-
25
- return;
26
- }
27
-
28
- this.ui.step(`${pc.bold(String(result.totalEntities))} entities, ${pc.bold(String(result.totalRefs))} refs, ${pc.bold(String(result.totalFronds))} frond(s)`);
29
- this.ui.note(renderFronds(result.declared), 'Fronds');
30
- this.ui.note(renderGraph(result.nodes), 'Entity Graph');
31
-
32
- const min = (raw.minEntities as number) ?? 6;
33
- if (result.clusters.length > 1 && result.totalEntities >= min) {
34
- this.ui.note(renderClusters(result.clusters), 'Suggested Domains');
35
- }
36
-
37
- if (result.totalFronds === 1 && result.clusters.length > 1 && result.totalEntities >= min) {
38
- this.ui.info(`${pc.dim('Tip:')} ${result.clusters.length} natural domains detected. Consider splitting into separate fronds.`);
39
- }
40
-
41
- }
42
- }
43
-
44
- /**
45
- * Where each frond runs, and which reaches which. Read from `remotes:` and from what handlers
46
- * ask for — never from a call, so this says the same thing with nothing running.
47
- */
48
- function renderFronds(declared: DeclaredTopology): string {
49
- const reached = new Map<string, string[]>();
50
- for (const edge of declared.edges) {
51
- reached.set(edge.from, [...(reached.get(edge.from) ?? []), edge.to]);
52
- }
53
-
54
- const width = Math.max(0, ...declared.fronds.map((one) => one.frond.length));
55
-
56
- return declared.fronds.map((one) => {
57
- const name = pc.bold(one.frond.padEnd(width));
58
- const where = one.placement === 'local' ? pc.dim('local ') : pc.yellow('remote');
59
- const at = one.at ? ` ${pc.dim(one.at)}` : '';
60
- const calls = reached.get(one.frond);
61
- const out = calls ? ` ${pc.dim('→')} ${calls.map((to) => pc.cyan(to)).join(', ')}` : '';
62
-
63
- return ` ${name} ${where}${at}${out}`;
64
- }).join('\n');
65
- }
66
-
67
- function renderGraph(nodes: Record<string, EntityNode>): string {
68
- return Object.entries(nodes).map(([name, node]) => {
69
- const refs = node.refs.length > 0
70
- ? ` ${pc.dim('→')} ${node.refs.map((r) => pc.cyan(r)).join(', ')}`
71
- : '';
72
- const badge = node.referencedBy.length > 0
73
- ? pc.dim(` (${node.referencedBy.length} incoming)`)
74
- : '';
75
-
76
- return ` ${pc.bold(name)}${refs}${badge}`;
77
- }).join('\n');
78
- }
79
-
80
- function renderClusters(clusters: DomainCluster[]): string {
81
- return clusters.map((cluster) => {
82
- const header = ` ${pc.green(pc.bold(cluster.name + '/'))} ${pc.dim(`(${cluster.entities.length} entities)`)}`;
83
- const entities = cluster.entities.map((e) => ` ${e}`);
84
- const crossRefs = cluster.crossRefs.length > 0
85
- ? [` ${pc.dim('cross-refs:')}`, ...cluster.crossRefs.map((r) =>
86
- ` ${r.from} ${pc.dim('→')} ${pc.yellow(r.to)} ${pc.dim(`(${r.targetCluster})`)}`)]
87
- : [];
88
-
89
- return [header, ...entities, ...crossRefs, ''].join('\n');
90
- }).join('\n');
91
- }
@@ -1,57 +0,0 @@
1
- import { mkdir, readFile, writeFile, appendFile, access } from 'node:fs/promises';
2
- import { join } from 'node:path';
3
- import { generateKeyPair } from '@fougere/core/node';
4
- import type { App } from '@fougere/core';
5
- import type { ui as createUi } from '../../src/ui.js';
6
- import { ROOT_KEY, packed } from './grant-material.js';
7
-
8
- type Ui = ReturnType<typeof createUi>;
9
-
10
- /**
11
- * Create the authority — a command, not a service.
12
- *
13
- * This is the whole of it: it runs at deployment time and exits. Nothing stays alive,
14
- * nothing is joined at boot, and no frond reaches anything to prove who it is. What a
15
- * receiver ends up holding is ONE public key, so a frond granted tomorrow is admitted
16
- * by a receiver deployed today without its config being touched.
17
- *
18
- * The private key is written and never printed: it signs grants, and a grant is the
19
- * only thing that has to travel.
20
- */
21
- export default class KeysCommand {
22
- constructor(private app: App, private ui: Ui) {}
23
-
24
- async run() {
25
- const path = join(process.cwd(), ROOT_KEY);
26
- if (await exists(path)) {
27
- this.ui.error(`${ROOT_KEY} already exists — a second root would split the system in two.`);
28
- this.ui.info('Delete it deliberately to start over; every grant issued so far stops being recognized.');
29
-
30
- return;
31
- }
32
-
33
- const { privateKey, publicKey } = generateKeyPair();
34
- await mkdir(join(process.cwd(), '.fougere'), { recursive: true });
35
- await writeFile(path, privateKey, { mode: 0o600 });
36
- await ignore(ROOT_KEY);
37
-
38
- this.ui.success(`root created — ${ROOT_KEY} (never commit it; added to .gitignore)`);
39
- this.ui.note(
40
- `FOUGERE_ROOT_KEY=${packed(publicKey)}`,
41
- 'Every frond that ANSWERS — public, safe in an image or a manifest',
42
- );
43
- this.ui.info('Then `fougere grant <frond>` for each frond that CALLS.');
44
- }
45
- }
46
-
47
- async function exists(path: string): Promise<boolean> {
48
- return access(path).then(() => true, () => false);
49
- }
50
-
51
- /** Keep the root out of a commit — the one mistake that cannot be walked back. */
52
- async function ignore(entry: string): Promise<void> {
53
- const path = join(process.cwd(), '.gitignore');
54
- const current = await readFile(path, 'utf8').catch(() => '');
55
- if (current.split('\n').some((line) => line.trim() === entry)) return;
56
- await appendFile(path, `${current.endsWith('\n') || current === '' ? '' : '\n'}${entry}\n`);
57
- }
@@ -1,46 +0,0 @@
1
- import type { App } from '@fougere/core';
2
- import { createAppRunner } from '@fougere/core';
3
- import type { LoadScenario } from '../../fronds/analysis/handlers/LoadHandler.js';
4
- import type { ui as createUi } from '../../src/ui.js';
5
- import pc from 'picocolors';
6
- import { machineWanted, printMachine } from '../../src/machine.js';
7
-
8
- type Ui = ReturnType<typeof createUi>;
9
-
10
- /**
11
- * The command the generated header has been naming all along.
12
- *
13
- * What it writes is derived — the operations from what the project serves, a body for each from
14
- * the entity's own fields, the envelope from the one function that states it. What it cannot
15
- * derive is what the load IS: the weights, the stages and the thresholds are facts about your
16
- * users, and the file says so where they sit.
17
- */
18
- export default class LoadCommand {
19
- constructor(private app: App, private ui: Ui) {}
20
-
21
- async run(raw: Record<string, unknown>) {
22
- const result = await createAppRunner(this.app)(
23
- { entity: 'load', op: 'execute' },
24
- { params: {}, query: {}, input: raw, state: {} },
25
- ) as LoadScenario;
26
-
27
- if (machineWanted(raw)) return printMachine(result);
28
-
29
- if (result.operations.length === 0) {
30
- this.ui.warn('No operation answers the default facade — nothing to put under load.');
31
-
32
- return;
33
- }
34
-
35
- if (!result.file) {
36
- process.stdout.write(result.script);
37
-
38
- return;
39
- }
40
-
41
- this.ui.step(`${pc.bold(String(result.operations.length))} operation(s) against ${pc.dim(result.facade)}`);
42
- this.ui.note(result.operations.map((one) => ` ${one}`).join('\n'), 'Under load');
43
- this.ui.info(`${pc.dim('Written to')} ${result.file} ${pc.dim('— edit the weights, the stages and the thresholds.')}`);
44
- this.ui.info(`${pc.dim('Then:')} k6 run ${result.file}`);
45
- }
46
- }
@@ -1,61 +0,0 @@
1
- import { createAppRunner } from '@fougere/core';
2
- import type { App } from '@fougere/core';
3
- import type { ui as createUi } from '../../src/ui.js';
4
- import type { MigrationPlan } from '../../fronds/analysis/handlers/MigrateHandler.js';
5
- import pc from 'picocolors';
6
- import { machineWanted, printMachine } from '../../src/machine.js';
7
-
8
- type Ui = ReturnType<typeof createUi>;
9
-
10
- /**
11
- * Catching a database up with the frozen chain.
12
- *
13
- * Prints by default and moves nothing: what this runs drops and renames columns, so the
14
- * plan is read before it is agreed to. `--apply` is that agreement.
15
- */
16
- export default class MigrateCommand {
17
- constructor(private app: App, private ui: Ui) {}
18
-
19
- async run(raw: Record<string, unknown>) {
20
- const result = (await createAppRunner(this.app)(
21
- { entity: 'migrate', op: 'execute' },
22
- { params: {}, query: {}, input: raw, state: {} },
23
- )) as MigrationPlan;
24
-
25
- if (machineWanted(raw)) return printMachine(result);
26
-
27
- if (result.chain.length === 0) {
28
- this.ui.warn('No frozen step to apply. `fougere freeze <version>` records one.');
29
-
30
- return;
31
- }
32
-
33
- if (result.refusals.length > 0) {
34
- this.ui.error(`This chain cannot be realised as it stands (${result.chain.join(' → ')}):`);
35
- for (const one of result.refusals) this.ui.step(`${pc.bold(`${one.entity}.${one.field}`)} — ${one.reason}`);
36
-
37
- return;
38
- }
39
-
40
- if (result.changes.length === 0) {
41
- this.ui.success(`Up to date — ${result.chain.join(' → ')} already realised.`);
42
-
43
- return;
44
- }
45
-
46
- for (const change of result.changes) {
47
- this.ui.step(
48
- change.kind === 'renameColumn'
49
- ? `${change.table}: ${pc.bold(change.from)} → ${pc.bold(change.to)}`
50
- : `${change.table}: drop ${pc.bold(change.column)}`,
51
- );
52
- }
53
-
54
- if (result.ran.length === 0) {
55
- this.ui.info(`${result.changes.length} statement(s) — run again with ${pc.bold('--apply')} to make it so.`);
56
-
57
- return;
58
- }
59
- this.ui.success(`${result.ran.length} statement(s) run.`);
60
- }
61
- }