@fougere/cli 0.12.5-alpha.0 → 0.13.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (350) hide show
  1. package/dist/.fougere/scan.generated.d.ts +3 -0
  2. package/dist/.fougere/scan.generated.d.ts.map +1 -0
  3. package/dist/.fougere/scan.generated.js +140 -0
  4. package/dist/.fougere/scan.generated.js.map +1 -0
  5. package/dist/app/commands/BuildCommand.d.ts +18 -0
  6. package/dist/app/commands/BuildCommand.d.ts.map +1 -0
  7. package/dist/app/commands/BuildCommand.js +35 -0
  8. package/dist/app/commands/BuildCommand.js.map +1 -0
  9. package/dist/app/commands/CallCommand.d.ts +16 -0
  10. package/dist/app/commands/CallCommand.d.ts.map +1 -0
  11. package/dist/app/commands/CallCommand.js +73 -0
  12. package/dist/app/commands/CallCommand.js.map +1 -0
  13. package/dist/app/commands/CheckCommand.d.ts +11 -0
  14. package/dist/app/commands/CheckCommand.d.ts.map +1 -0
  15. package/dist/app/commands/CheckCommand.js +59 -0
  16. package/dist/app/commands/CheckCommand.js.map +1 -0
  17. package/dist/app/commands/CompletionCommand.d.ts +7 -0
  18. package/dist/app/commands/CompletionCommand.d.ts.map +1 -0
  19. package/dist/app/commands/CompletionCommand.js +23 -0
  20. package/dist/app/commands/CompletionCommand.js.map +1 -0
  21. package/dist/app/commands/DevtoolsCommand.d.ts +20 -0
  22. package/dist/app/commands/DevtoolsCommand.d.ts.map +1 -0
  23. package/dist/app/commands/DevtoolsCommand.js +79 -0
  24. package/dist/app/commands/DevtoolsCommand.js.map +1 -0
  25. package/dist/app/commands/ExplainCommand.d.ts +18 -0
  26. package/dist/app/commands/ExplainCommand.d.ts.map +1 -0
  27. package/dist/app/commands/ExplainCommand.js +111 -0
  28. package/dist/app/commands/ExplainCommand.js.map +1 -0
  29. package/dist/app/commands/FreezeCommand.d.ts +21 -0
  30. package/dist/app/commands/FreezeCommand.d.ts.map +1 -0
  31. package/dist/app/commands/FreezeCommand.js +102 -0
  32. package/dist/app/commands/FreezeCommand.js.map +1 -0
  33. package/dist/app/commands/GrantCommand.d.ts +18 -0
  34. package/dist/app/commands/GrantCommand.d.ts.map +1 -0
  35. package/dist/app/commands/GrantCommand.js +39 -0
  36. package/dist/app/commands/GrantCommand.js.map +1 -0
  37. package/dist/app/commands/GraphCommand.d.ts +11 -0
  38. package/dist/app/commands/GraphCommand.d.ts.map +1 -0
  39. package/dist/app/commands/GraphCommand.js +72 -0
  40. package/dist/app/commands/GraphCommand.js.map +1 -0
  41. package/dist/app/commands/KeysCommand.d.ts +22 -0
  42. package/dist/app/commands/KeysCommand.d.ts.map +1 -0
  43. package/dist/app/commands/KeysCommand.js +50 -0
  44. package/dist/app/commands/KeysCommand.js.map +1 -0
  45. package/dist/app/commands/LoadCommand.d.ts +19 -0
  46. package/dist/app/commands/LoadCommand.d.ts.map +1 -0
  47. package/dist/app/commands/LoadCommand.js +37 -0
  48. package/dist/app/commands/LoadCommand.js.map +1 -0
  49. package/dist/app/commands/MigrateCommand.d.ts +17 -0
  50. package/dist/app/commands/MigrateCommand.d.ts.map +1 -0
  51. package/dist/app/commands/MigrateCommand.js +47 -0
  52. package/dist/app/commands/MigrateCommand.js.map +1 -0
  53. package/dist/app/commands/NewCommand.d.ts +24 -0
  54. package/dist/app/commands/NewCommand.d.ts.map +1 -0
  55. package/dist/app/commands/NewCommand.js +108 -0
  56. package/dist/app/commands/NewCommand.js.map +1 -0
  57. package/dist/app/commands/ServeCommand.d.ts +17 -0
  58. package/dist/app/commands/ServeCommand.d.ts.map +1 -0
  59. package/dist/app/commands/ServeCommand.js +92 -0
  60. package/dist/app/commands/ServeCommand.js.map +1 -0
  61. package/dist/app/commands/grant-material.d.ts +5 -0
  62. package/dist/app/commands/grant-material.d.ts.map +1 -0
  63. package/{app/commands/grant-material.ts → dist/app/commands/grant-material.js} +2 -2
  64. package/dist/app/commands/grant-material.js.map +1 -0
  65. package/dist/fronds/analysis/entities/Build.d.ts +10 -0
  66. package/dist/fronds/analysis/entities/Build.d.ts.map +1 -0
  67. package/dist/fronds/analysis/entities/Build.js +9 -0
  68. package/dist/fronds/analysis/entities/Build.js.map +1 -0
  69. package/dist/fronds/analysis/entities/Check.d.ts +8 -0
  70. package/dist/fronds/analysis/entities/Check.d.ts.map +1 -0
  71. package/dist/fronds/analysis/entities/Check.js +7 -0
  72. package/dist/fronds/analysis/entities/Check.js.map +1 -0
  73. package/dist/fronds/analysis/entities/Devtools.d.ts +10 -0
  74. package/dist/fronds/analysis/entities/Devtools.d.ts.map +1 -0
  75. package/dist/fronds/analysis/entities/Devtools.js +9 -0
  76. package/dist/fronds/analysis/entities/Devtools.js.map +1 -0
  77. package/dist/fronds/analysis/entities/Explain.d.ts +11 -0
  78. package/dist/fronds/analysis/entities/Explain.d.ts.map +1 -0
  79. package/dist/fronds/analysis/entities/Explain.js +10 -0
  80. package/dist/fronds/analysis/entities/Explain.js.map +1 -0
  81. package/dist/fronds/analysis/entities/Freeze.d.ts +10 -0
  82. package/dist/fronds/analysis/entities/Freeze.d.ts.map +1 -0
  83. package/dist/fronds/analysis/entities/Freeze.js +9 -0
  84. package/dist/fronds/analysis/entities/Freeze.js.map +1 -0
  85. package/dist/fronds/analysis/entities/Graph.d.ts +9 -0
  86. package/dist/fronds/analysis/entities/Graph.d.ts.map +1 -0
  87. package/dist/fronds/analysis/entities/Graph.js +8 -0
  88. package/dist/fronds/analysis/entities/Graph.js.map +1 -0
  89. package/dist/fronds/analysis/entities/Load.d.ts +10 -0
  90. package/dist/fronds/analysis/entities/Load.d.ts.map +1 -0
  91. package/dist/fronds/analysis/entities/Load.js +9 -0
  92. package/dist/fronds/analysis/entities/Load.js.map +1 -0
  93. package/dist/fronds/analysis/entities/Migrate.d.ts +10 -0
  94. package/dist/fronds/analysis/entities/Migrate.d.ts.map +1 -0
  95. package/dist/fronds/analysis/entities/Migrate.js +9 -0
  96. package/dist/fronds/analysis/entities/Migrate.js.map +1 -0
  97. package/dist/fronds/analysis/handlers/BuildHandler.d.ts +50 -0
  98. package/dist/fronds/analysis/handlers/BuildHandler.d.ts.map +1 -0
  99. package/dist/fronds/analysis/handlers/BuildHandler.js +63 -0
  100. package/dist/fronds/analysis/handlers/BuildHandler.js.map +1 -0
  101. package/dist/fronds/analysis/handlers/CheckHandler.d.ts +30 -0
  102. package/dist/fronds/analysis/handlers/CheckHandler.d.ts.map +1 -0
  103. package/dist/fronds/analysis/handlers/CheckHandler.js +196 -0
  104. package/dist/fronds/analysis/handlers/CheckHandler.js.map +1 -0
  105. package/dist/fronds/analysis/handlers/DevtoolsHandler.d.ts +45 -0
  106. package/dist/fronds/analysis/handlers/DevtoolsHandler.d.ts.map +1 -0
  107. package/dist/fronds/analysis/handlers/DevtoolsHandler.js +61 -0
  108. package/dist/fronds/analysis/handlers/DevtoolsHandler.js.map +1 -0
  109. package/dist/fronds/analysis/handlers/ExplainHandler.d.ts +99 -0
  110. package/dist/fronds/analysis/handlers/ExplainHandler.d.ts.map +1 -0
  111. package/dist/fronds/analysis/handlers/ExplainHandler.js +157 -0
  112. package/dist/fronds/analysis/handlers/ExplainHandler.js.map +1 -0
  113. package/dist/fronds/analysis/handlers/FreezeHandler.d.ts +55 -0
  114. package/dist/fronds/analysis/handlers/FreezeHandler.d.ts.map +1 -0
  115. package/dist/fronds/analysis/handlers/FreezeHandler.js +145 -0
  116. package/dist/fronds/analysis/handlers/FreezeHandler.js.map +1 -0
  117. package/dist/fronds/analysis/handlers/GraphHandler.d.ts +23 -0
  118. package/dist/fronds/analysis/handlers/GraphHandler.d.ts.map +1 -0
  119. package/dist/fronds/analysis/handlers/GraphHandler.js +23 -0
  120. package/dist/fronds/analysis/handlers/GraphHandler.js.map +1 -0
  121. package/dist/fronds/analysis/handlers/LoadHandler.d.ts +26 -0
  122. package/dist/fronds/analysis/handlers/LoadHandler.d.ts.map +1 -0
  123. package/dist/fronds/analysis/handlers/LoadHandler.js +35 -0
  124. package/dist/fronds/analysis/handlers/LoadHandler.js.map +1 -0
  125. package/dist/fronds/analysis/handlers/MigrateHandler.d.ts +34 -0
  126. package/dist/fronds/analysis/handlers/MigrateHandler.d.ts.map +1 -0
  127. package/dist/fronds/analysis/handlers/MigrateHandler.js +92 -0
  128. package/dist/fronds/analysis/handlers/MigrateHandler.js.map +1 -0
  129. package/dist/fronds/analysis/services/ProjectScan.d.ts +22 -0
  130. package/dist/fronds/analysis/services/ProjectScan.d.ts.map +1 -0
  131. package/dist/fronds/analysis/services/ProjectScan.js +48 -0
  132. package/dist/fronds/analysis/services/ProjectScan.js.map +1 -0
  133. package/dist/fronds/analysis/versions.d.ts +21 -0
  134. package/dist/fronds/analysis/versions.d.ts.map +1 -0
  135. package/dist/fronds/analysis/versions.js +48 -0
  136. package/dist/fronds/analysis/versions.js.map +1 -0
  137. package/dist/fronds/scaffold/entities/BuildFrond.d.ts +7 -0
  138. package/dist/fronds/scaffold/entities/BuildFrond.d.ts.map +1 -0
  139. package/dist/fronds/scaffold/entities/BuildFrond.js +6 -0
  140. package/dist/fronds/scaffold/entities/BuildFrond.js.map +1 -0
  141. package/dist/fronds/scaffold/entities/Call.d.ts +8 -0
  142. package/dist/fronds/scaffold/entities/Call.d.ts.map +1 -0
  143. package/{fronds/scaffold/entities/Call.ts → dist/fronds/scaffold/entities/Call.js} +4 -3
  144. package/dist/fronds/scaffold/entities/Call.js.map +1 -0
  145. package/dist/fronds/scaffold/entities/Completion.d.ts +7 -0
  146. package/dist/fronds/scaffold/entities/Completion.d.ts.map +1 -0
  147. package/dist/fronds/scaffold/entities/Completion.js +6 -0
  148. package/dist/fronds/scaffold/entities/Completion.js.map +1 -0
  149. package/dist/fronds/scaffold/entities/Grant.d.ts +8 -0
  150. package/dist/fronds/scaffold/entities/Grant.d.ts.map +1 -0
  151. package/{fronds/scaffold/entities/Grant.ts → dist/fronds/scaffold/entities/Grant.js} +4 -3
  152. package/dist/fronds/scaffold/entities/Grant.js.map +1 -0
  153. package/dist/fronds/scaffold/entities/Keys.d.ts +6 -0
  154. package/dist/fronds/scaffold/entities/Keys.d.ts.map +1 -0
  155. package/{fronds/scaffold/entities/Keys.ts → dist/fronds/scaffold/entities/Keys.js} +3 -2
  156. package/dist/fronds/scaffold/entities/Keys.js.map +1 -0
  157. package/dist/fronds/scaffold/entities/New.d.ts +19 -0
  158. package/dist/fronds/scaffold/entities/New.d.ts.map +1 -0
  159. package/dist/fronds/scaffold/entities/New.js +18 -0
  160. package/dist/fronds/scaffold/entities/New.js.map +1 -0
  161. package/dist/fronds/scaffold/entities/Serve.d.ts +10 -0
  162. package/dist/fronds/scaffold/entities/Serve.d.ts.map +1 -0
  163. package/dist/fronds/scaffold/entities/Serve.js +9 -0
  164. package/dist/fronds/scaffold/entities/Serve.js.map +1 -0
  165. package/dist/fronds/scaffold/entities/Sync.d.ts +8 -0
  166. package/dist/fronds/scaffold/entities/Sync.d.ts.map +1 -0
  167. package/dist/fronds/scaffold/entities/Sync.js +7 -0
  168. package/dist/fronds/scaffold/entities/Sync.js.map +1 -0
  169. package/dist/fronds/scaffold/handlers/BuildFrondHandler.d.ts +11 -0
  170. package/dist/fronds/scaffold/handlers/BuildFrondHandler.d.ts.map +1 -0
  171. package/dist/fronds/scaffold/handlers/BuildFrondHandler.js +82 -0
  172. package/dist/fronds/scaffold/handlers/BuildFrondHandler.js.map +1 -0
  173. package/dist/fronds/scaffold/handlers/CallHandler.d.ts +10 -0
  174. package/dist/fronds/scaffold/handlers/CallHandler.d.ts.map +1 -0
  175. package/{fronds/scaffold/handlers/CallHandler.ts → dist/fronds/scaffold/handlers/CallHandler.js} +3 -2
  176. package/dist/fronds/scaffold/handlers/CallHandler.js.map +1 -0
  177. package/dist/fronds/scaffold/handlers/CompletionHandler.d.ts +9 -0
  178. package/dist/fronds/scaffold/handlers/CompletionHandler.d.ts.map +1 -0
  179. package/{fronds/scaffold/handlers/CompletionHandler.ts → dist/fronds/scaffold/handlers/CompletionHandler.js} +3 -2
  180. package/dist/fronds/scaffold/handlers/CompletionHandler.js.map +1 -0
  181. package/dist/fronds/scaffold/handlers/GrantHandler.d.ts +9 -0
  182. package/dist/fronds/scaffold/handlers/GrantHandler.d.ts.map +1 -0
  183. package/{fronds/scaffold/handlers/GrantHandler.ts → dist/fronds/scaffold/handlers/GrantHandler.js} +3 -2
  184. package/dist/fronds/scaffold/handlers/GrantHandler.js.map +1 -0
  185. package/dist/fronds/scaffold/handlers/KeysHandler.d.ts +9 -0
  186. package/dist/fronds/scaffold/handlers/KeysHandler.d.ts.map +1 -0
  187. package/{fronds/scaffold/handlers/KeysHandler.ts → dist/fronds/scaffold/handlers/KeysHandler.js} +3 -2
  188. package/dist/fronds/scaffold/handlers/KeysHandler.js.map +1 -0
  189. package/dist/fronds/scaffold/handlers/NewHandler.d.ts +9 -0
  190. package/dist/fronds/scaffold/handlers/NewHandler.d.ts.map +1 -0
  191. package/{fronds/scaffold/handlers/NewHandler.ts → dist/fronds/scaffold/handlers/NewHandler.js} +3 -2
  192. package/dist/fronds/scaffold/handlers/NewHandler.js.map +1 -0
  193. package/dist/fronds/scaffold/handlers/ServeHandler.d.ts +10 -0
  194. package/dist/fronds/scaffold/handlers/ServeHandler.d.ts.map +1 -0
  195. package/{fronds/scaffold/handlers/ServeHandler.ts → dist/fronds/scaffold/handlers/ServeHandler.js} +3 -2
  196. package/dist/fronds/scaffold/handlers/ServeHandler.js.map +1 -0
  197. package/dist/fronds/scaffold/handlers/SyncHandler.d.ts +18 -0
  198. package/dist/fronds/scaffold/handlers/SyncHandler.d.ts.map +1 -0
  199. package/dist/fronds/scaffold/handlers/SyncHandler.js +327 -0
  200. package/dist/fronds/scaffold/handlers/SyncHandler.js.map +1 -0
  201. package/dist/fronds/scaffold/services/ProjectWriter.d.ts +54 -0
  202. package/dist/fronds/scaffold/services/ProjectWriter.d.ts.map +1 -0
  203. package/dist/fronds/scaffold/services/ProjectWriter.js +315 -0
  204. package/dist/fronds/scaffold/services/ProjectWriter.js.map +1 -0
  205. package/dist/src/bin.d.ts.map +1 -0
  206. package/dist/src/bin.js +11 -0
  207. package/dist/src/bin.js.map +1 -0
  208. package/dist/src/bridge.d.ts.map +1 -0
  209. package/dist/src/bridge.js.map +1 -0
  210. package/dist/src/completion.d.ts.map +1 -0
  211. package/dist/src/completion.js.map +1 -0
  212. package/dist/src/index.d.ts.map +1 -0
  213. package/dist/src/index.js.map +1 -0
  214. package/dist/src/loader.d.ts.map +1 -0
  215. package/dist/src/loader.js.map +1 -0
  216. package/dist/src/machine.d.ts.map +1 -0
  217. package/dist/src/machine.js.map +1 -0
  218. package/dist/src/main.d.ts +2 -0
  219. package/dist/src/main.d.ts.map +1 -0
  220. package/dist/src/main.js +19 -0
  221. package/dist/src/main.js.map +1 -0
  222. package/dist/src/runner.d.ts.map +1 -0
  223. package/dist/{runner.js → src/runner.js} +22 -22
  224. package/dist/src/runner.js.map +1 -0
  225. package/dist/src/theme.d.ts.map +1 -0
  226. package/dist/src/theme.js.map +1 -0
  227. package/dist/src/typescript/EntityTypes.d.ts.map +1 -0
  228. package/dist/src/typescript/EntityTypes.js.map +1 -0
  229. package/dist/src/typescript/FacadeTypes.d.ts.map +1 -0
  230. package/dist/src/typescript/FacadeTypes.js.map +1 -0
  231. package/dist/src/typescript/syntax.d.ts.map +1 -0
  232. package/dist/src/typescript/syntax.js.map +1 -0
  233. package/dist/{ui.d.ts → src/ui.d.ts} +0 -1
  234. package/dist/src/ui.d.ts.map +1 -0
  235. package/dist/{ui.js → src/ui.js} +24 -22
  236. package/dist/src/ui.js.map +1 -0
  237. package/package.json +25 -29
  238. package/templates/frond/fronds/tsconfig.json +17 -0
  239. package/templates/workspace/fronds/tsconfig.json +2 -4
  240. package/templates/workspace/package.json +1 -1
  241. package/templates/workspace/pnpm-workspace.yaml +5 -3
  242. package/app/commands/BuildCommand.ts +0 -43
  243. package/app/commands/CallCommand.ts +0 -70
  244. package/app/commands/CheckCommand.ts +0 -70
  245. package/app/commands/CompletionCommand.ts +0 -24
  246. package/app/commands/DevtoolsCommand.ts +0 -92
  247. package/app/commands/ExplainCommand.ts +0 -136
  248. package/app/commands/FreezeCommand.ts +0 -119
  249. package/app/commands/GrantCommand.ts +0 -46
  250. package/app/commands/GraphCommand.ts +0 -91
  251. package/app/commands/KeysCommand.ts +0 -57
  252. package/app/commands/LoadCommand.ts +0 -46
  253. package/app/commands/MigrateCommand.ts +0 -61
  254. package/app/commands/NewCommand.ts +0 -137
  255. package/app/commands/ServeCommand.ts +0 -108
  256. package/dist/bin.d.ts.map +0 -1
  257. package/dist/bin.js +0 -64
  258. package/dist/bin.js.map +0 -1
  259. package/dist/bridge.d.ts.map +0 -1
  260. package/dist/bridge.js.map +0 -1
  261. package/dist/completion.d.ts.map +0 -1
  262. package/dist/completion.js.map +0 -1
  263. package/dist/index.d.ts.map +0 -1
  264. package/dist/index.js.map +0 -1
  265. package/dist/loader.d.ts.map +0 -1
  266. package/dist/loader.js.map +0 -1
  267. package/dist/machine.d.ts.map +0 -1
  268. package/dist/machine.js.map +0 -1
  269. package/dist/runner.d.ts.map +0 -1
  270. package/dist/runner.js.map +0 -1
  271. package/dist/theme.d.ts.map +0 -1
  272. package/dist/theme.js.map +0 -1
  273. package/dist/typescript/EntityTypes.d.ts.map +0 -1
  274. package/dist/typescript/EntityTypes.js.map +0 -1
  275. package/dist/typescript/FacadeTypes.d.ts.map +0 -1
  276. package/dist/typescript/FacadeTypes.js.map +0 -1
  277. package/dist/typescript/syntax.d.ts.map +0 -1
  278. package/dist/typescript/syntax.js.map +0 -1
  279. package/dist/ui.d.ts.map +0 -1
  280. package/dist/ui.js.map +0 -1
  281. package/fronds/analysis/entities/Build.ts +0 -8
  282. package/fronds/analysis/entities/Check.ts +0 -6
  283. package/fronds/analysis/entities/Devtools.ts +0 -8
  284. package/fronds/analysis/entities/Explain.ts +0 -9
  285. package/fronds/analysis/entities/Freeze.ts +0 -8
  286. package/fronds/analysis/entities/Graph.ts +0 -7
  287. package/fronds/analysis/entities/Load.ts +0 -8
  288. package/fronds/analysis/entities/Migrate.ts +0 -8
  289. package/fronds/analysis/handlers/BuildHandler.ts +0 -87
  290. package/fronds/analysis/handlers/CheckHandler.ts +0 -217
  291. package/fronds/analysis/handlers/DevtoolsHandler.ts +0 -97
  292. package/fronds/analysis/handlers/ExplainHandler.ts +0 -263
  293. package/fronds/analysis/handlers/FreezeHandler.ts +0 -183
  294. package/fronds/analysis/handlers/GraphHandler.ts +0 -38
  295. package/fronds/analysis/handlers/LoadHandler.ts +0 -44
  296. package/fronds/analysis/handlers/MigrateHandler.ts +0 -110
  297. package/fronds/analysis/services/ProjectScan.ts +0 -55
  298. package/fronds/analysis/versions.ts +0 -59
  299. package/fronds/scaffold/entities/BuildFrond.ts +0 -5
  300. package/fronds/scaffold/entities/Completion.ts +0 -5
  301. package/fronds/scaffold/entities/New.ts +0 -19
  302. package/fronds/scaffold/entities/Serve.ts +0 -8
  303. package/fronds/scaffold/entities/Sync.ts +0 -6
  304. package/fronds/scaffold/handlers/BuildFrondHandler.ts +0 -96
  305. package/fronds/scaffold/handlers/SyncHandler.ts +0 -376
  306. package/fronds/scaffold/services/ProjectWriter.ts +0 -339
  307. package/fronds/shims.d.ts +0 -9
  308. package/src/bin.ts +0 -77
  309. package/src/bridge.ts +0 -118
  310. package/src/completion.ts +0 -145
  311. package/src/index.ts +0 -1
  312. package/src/loader.ts +0 -28
  313. package/src/machine.ts +0 -17
  314. package/src/runner.ts +0 -152
  315. package/src/theme.ts +0 -19
  316. package/src/typescript/EntityTypes.ts +0 -92
  317. package/src/typescript/FacadeTypes.ts +0 -50
  318. package/src/typescript/syntax.ts +0 -11
  319. package/src/ui.ts +0 -142
  320. package/templates/flat/AGENTS.md +0 -14
  321. package/templates/flat/CLAUDE.md +0 -87
  322. package/templates/flat/_gitignore +0 -6
  323. package/templates/flat/app/app.vue +0 -25
  324. package/templates/flat/app/pages/index.vue +0 -7
  325. package/templates/flat/fougere.config.ts +0 -7
  326. package/templates/flat/nuxt.config.ts +0 -4
  327. package/templates/flat/package.json +0 -24
  328. package/templates/flat/pnpm-workspace.yaml +0 -6
  329. package/templates/flat/tsconfig.frond.json +0 -25
  330. package/templates/flat/tsconfig.json +0 -3
  331. /package/dist/{bin.d.ts → src/bin.d.ts} +0 -0
  332. /package/dist/{bridge.d.ts → src/bridge.d.ts} +0 -0
  333. /package/dist/{bridge.js → src/bridge.js} +0 -0
  334. /package/dist/{completion.d.ts → src/completion.d.ts} +0 -0
  335. /package/dist/{completion.js → src/completion.js} +0 -0
  336. /package/dist/{index.d.ts → src/index.d.ts} +0 -0
  337. /package/dist/{index.js → src/index.js} +0 -0
  338. /package/dist/{loader.d.ts → src/loader.d.ts} +0 -0
  339. /package/dist/{loader.js → src/loader.js} +0 -0
  340. /package/dist/{machine.d.ts → src/machine.d.ts} +0 -0
  341. /package/dist/{machine.js → src/machine.js} +0 -0
  342. /package/dist/{runner.d.ts → src/runner.d.ts} +0 -0
  343. /package/dist/{theme.d.ts → src/theme.d.ts} +0 -0
  344. /package/dist/{theme.js → src/theme.js} +0 -0
  345. /package/dist/{typescript → src/typescript}/EntityTypes.d.ts +0 -0
  346. /package/dist/{typescript → src/typescript}/EntityTypes.js +0 -0
  347. /package/dist/{typescript → src/typescript}/FacadeTypes.d.ts +0 -0
  348. /package/dist/{typescript → src/typescript}/FacadeTypes.js +0 -0
  349. /package/dist/{typescript → src/typescript}/syntax.d.ts +0 -0
  350. /package/dist/{typescript → src/typescript}/syntax.js +0 -0
@@ -1,30 +1,33 @@
1
1
  /** Fougere CLI UI — beautiful terminal interface. */
2
- import * as clack from '@clack/prompts';
2
+ import { createRequire } from 'node:module';
3
3
  import pc from 'picocolors';
4
- import { consola } from 'consola';
5
4
  import { defaultTheme } from './theme.js';
5
+ const load = createRequire(import.meta.url);
6
+ let loaded;
7
+ /** Loaded at the first prompt or line it draws — `fougere --help` draws none. */
8
+ const clack = () => (loaded ??= load('@clack/prompts'));
6
9
  export function ui(options) {
7
10
  const c = { ...defaultTheme, ...options?.colors };
8
11
  return {
9
12
  // ── Lifecycle ─────────────────────────────────
10
13
  /** Start a new CLI session with a branded header. */
11
14
  intro(title = 'Fougere') {
12
- clack.intro(c.brand(title));
15
+ clack().intro(c.brand(title));
13
16
  },
14
17
  /** End the session with a message. */
15
18
  outro(message) {
16
- clack.outro(c.success(message));
19
+ clack().outro(c.success(message));
17
20
  },
18
21
  /** Cancel and exit. */
19
22
  cancel(message = 'Cancelled.') {
20
- clack.cancel(c.muted(message));
23
+ clack().cancel(c.muted(message));
21
24
  process.exit(0);
22
25
  },
23
26
  // ── Prompts ───────────────────────────────────
24
27
  /** Text input. */
25
28
  async text(opts) {
26
- const result = await clack.text(opts);
27
- if (clack.isCancel(result)) {
29
+ const result = await clack().text(opts);
30
+ if (clack().isCancel(result)) {
28
31
  this.cancel();
29
32
  return '';
30
33
  }
@@ -32,8 +35,8 @@ export function ui(options) {
32
35
  },
33
36
  /** Yes/no confirmation. */
34
37
  async confirm(opts) {
35
- const result = await clack.confirm(opts);
36
- if (clack.isCancel(result)) {
38
+ const result = await clack().confirm(opts);
39
+ if (clack().isCancel(result)) {
37
40
  this.cancel();
38
41
  return false;
39
42
  }
@@ -41,8 +44,8 @@ export function ui(options) {
41
44
  },
42
45
  /** Select one from a list. */
43
46
  async select(opts) {
44
- const result = await clack.select(opts);
45
- if (clack.isCancel(result)) {
47
+ const result = await clack().select(opts);
48
+ if (clack().isCancel(result)) {
46
49
  this.cancel();
47
50
  return '';
48
51
  }
@@ -50,8 +53,8 @@ export function ui(options) {
50
53
  },
51
54
  /** Multi-select from a list. */
52
55
  async multiselect(opts) {
53
- const result = await clack.multiselect(opts);
54
- if (clack.isCancel(result)) {
56
+ const result = await clack().multiselect(opts);
57
+ if (clack().isCancel(result)) {
55
58
  this.cancel();
56
59
  return [];
57
60
  }
@@ -60,7 +63,7 @@ export function ui(options) {
60
63
  // ── Spinner ───────────────────────────────────
61
64
  /** Start a spinner. Returns stop/update functions. */
62
65
  spinner(message) {
63
- const s = clack.spinner();
66
+ const s = clack().spinner();
64
67
  s.start(message);
65
68
  return {
66
69
  update: (msg) => s.message(msg),
@@ -70,32 +73,31 @@ export function ui(options) {
70
73
  // ── Output ────────────────────────────────────
71
74
  /** Informational message. */
72
75
  info(message) {
73
- clack.log.info(message);
76
+ clack().log.info(message);
74
77
  },
75
78
  /** Success message. */
76
79
  success(message) {
77
- clack.log.success(c.success(message));
80
+ clack().log.success(c.success(message));
78
81
  },
79
82
  /** Warning message. */
80
83
  warn(message) {
81
- clack.log.warn(c.warn(message));
84
+ clack().log.warn(c.warn(message));
82
85
  },
83
86
  /** Error message. */
84
87
  error(message) {
85
- clack.log.error(c.error(message));
88
+ clack().log.error(c.error(message));
86
89
  },
87
90
  /** Step indicator. */
88
91
  step(message) {
89
- clack.log.step(message);
92
+ clack().log.step(message);
90
93
  },
91
94
  /** Note box — multiline content in a box. */
92
95
  note(message, title) {
93
- clack.note(message, title);
96
+ clack().note(message, title);
94
97
  },
95
- // ── Raw colors/consola ────────────────────────
98
+ // ── Raw colors ────────────────────────────────
96
99
  colors: c,
97
100
  pc,
98
- consola,
99
101
  };
100
102
  }
101
103
  //# sourceMappingURL=ui.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/ui.ts"],"names":[],"mappings":"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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fougere/cli",
3
- "version": "0.12.5-alpha.0",
3
+ "version": "0.13.0-alpha.0",
4
4
  "description": "The Fougere CLI — compose a workspace, serve a frond, call an operation.",
5
5
  "keywords": [
6
6
  "fougere",
@@ -16,54 +16,50 @@
16
16
  "directory": "packages/cli"
17
17
  },
18
18
  "type": "module",
19
- "main": "dist/index.js",
20
- "types": "dist/index.d.ts",
19
+ "main": "dist/src/index.js",
20
+ "types": "dist/src/index.d.ts",
21
21
  "bin": {
22
- "fougere": "dist/bin.js"
22
+ "fougere": "dist/src/bin.js"
23
23
  },
24
24
  "exports": {
25
25
  ".": {
26
- "types": "./dist/index.d.ts",
27
- "import": "./dist/index.js"
26
+ "types": "./dist/src/index.d.ts",
27
+ "import": "./dist/src/index.js"
28
28
  },
29
- "./bin": "./dist/bin.js"
29
+ "./bin": "./dist/src/bin.js"
30
30
  },
31
31
  "files": [
32
32
  "dist",
33
- "app",
34
- "fronds",
35
- "templates",
36
- "src"
33
+ "templates"
37
34
  ],
38
35
  "dependencies": {
39
36
  "@clack/prompts": "^0.10.0",
37
+ "@fougere/compiler": "0.13.0-alpha.0",
38
+ "@fougere/container": "0.13.0-alpha.0",
39
+ "@fougere/core": "0.13.0-alpha.0",
40
+ "@fougere/defaults": "0.13.0-alpha.0",
41
+ "@fougere/schema": "0.13.0-alpha.0",
42
+ "@fougere/testing": "0.13.0-alpha.0",
43
+ "@fougere/transport-http": "0.13.0-alpha.0",
40
44
  "citty": "^0.2.1",
41
- "consola": "^3.4.2",
42
45
  "jiti": "^2.4.2",
43
46
  "picocolors": "^1.1.1",
44
- "safe-regex": "^2.1.1",
45
- "@fougere/compiler": "0.12.5-alpha.0",
46
- "@fougere/container": "0.12.5-alpha.0",
47
- "@fougere/core": "0.12.5-alpha.0",
48
- "@fougere/schema": "0.12.5-alpha.0",
49
- "@fougere/testing": "0.12.5-alpha.0",
50
- "@fougere/transport-http": "0.12.5-alpha.0",
51
- "@fougere/defaults": "0.12.5-alpha.0"
47
+ "safe-regex": "^2.1.1"
52
48
  },
53
49
  "devDependencies": {
54
- "vitest": "^4.1.0",
55
- "@fougere/next": "0.12.5-alpha.0",
56
- "@fougere/nuxt": "0.12.5-alpha.0",
57
- "@fougere/oclif": "0.12.5-alpha.0",
58
- "@fougere/react": "0.12.5-alpha.0",
59
- "@fougere/admin": "0.12.5-alpha.0",
60
- "@fougere/svelte": "0.12.5-alpha.0"
50
+ "@fougere/admin": "0.13.0-alpha.0",
51
+ "@fougere/next": "0.13.0-alpha.0",
52
+ "@fougere/nuxt": "0.13.0-alpha.0",
53
+ "@fougere/oclif": "0.13.0-alpha.0",
54
+ "@fougere/react": "0.13.0-alpha.0",
55
+ "@fougere/svelte": "0.13.0-alpha.0",
56
+ "vitest": "^4.1.0"
61
57
  },
62
58
  "publishConfig": {
63
59
  "access": "public"
64
60
  },
65
61
  "peerDependencies": {
66
- "@fougere/adapter-sql": "^0.12.5-alpha.0"
62
+ "@fougere/adapter-sql": "^0.13.0-alpha.0"
67
63
  },
68
64
  "peerDependenciesMeta": {
69
65
  "@fougere/adapter-sql": {
@@ -71,7 +67,7 @@
71
67
  }
72
68
  },
73
69
  "scripts": {
74
- "build": "rm -rf dist && tsc && chmod +x dist/bin.js && node dist/bin.js build",
70
+ "build": "rm -rf dist && node scripts/scan.ts && tsc && chmod +x dist/src/bin.js",
75
71
  "test": "vitest run",
76
72
  "test:watch": "vitest",
77
73
  "typecheck": "tsc --noEmit && tsc -p tsconfig.runtime.json && tsc -p tsconfig.templates.json"
@@ -0,0 +1,17 @@
1
+ {
2
+ // A frond is autonomous TypeScript domain code — it typechecks on its own, against this file.
3
+ "extends": "@fougere/core/tsconfig",
4
+ "compilerOptions": {
5
+ "target": "ES2022",
6
+ "module": "Node16",
7
+ "moduleResolution": "Node16",
8
+ "lib": ["ESNext"],
9
+ "types": ["node"],
10
+ "strict": true,
11
+ "esModuleInterop": true,
12
+ "skipLibCheck": true,
13
+ "noEmit": true,
14
+ "rootDir": "."
15
+ },
16
+ "include": ["."]
17
+ }
@@ -2,6 +2,7 @@
2
2
  // A frond is autonomous TypeScript domain code — it typechecks on its own, against
3
3
  // this file, without Nuxt and without `.nuxt/tsconfig.json`. `pnpm typecheck` at the
4
4
  // workspace root runs it, and it is the cheapest judge you have.
5
+ "extends": "@fougere/core/tsconfig",
5
6
  "compilerOptions": {
6
7
  "target": "ES2022",
7
8
  "module": "Node16",
@@ -12,10 +13,7 @@
12
13
  "esModuleInterop": true,
13
14
  "skipLibCheck": true,
14
15
  "noEmit": true,
15
- "rootDir": ".",
16
- // A frond names its neighbours, it does not walk to them: the alias the Nuxt module
17
- // registers at runtime (`@fronds/<name>` → the frond directory), stated for the compiler.
18
- "paths": { "@fronds/*": ["./*"] }
16
+ "rootDir": "."
19
17
  },
20
18
  "include": ["."]
21
19
  }
@@ -2,7 +2,7 @@
2
2
  "name": "fougere-workspace",
3
3
  "private": true,
4
4
  "type": "module",
5
- "packageManager": "pnpm@11.20.0",
5
+ "packageManager": "pnpm@12.6.0",
6
6
  "scripts": {
7
7
  "dev": "pnpm --filter './apps/*' --parallel dev",
8
8
  "build": "pnpm --filter './apps/*' -r build",
@@ -2,9 +2,11 @@ packages:
2
2
  - fronds/*
3
3
  - apps/*
4
4
 
5
- # pnpm 11 fails an install rather than warning about a build script it was not
6
- # told to run, and it reads the allowlist here — `pnpm.onlyBuiltDependencies` in
7
- # package.json is the pnpm 10 location, now ignored in silence.
8
5
  allowBuilds:
9
6
  better-sqlite3: true
10
7
  esbuild: true
8
+
9
+ # A project is created the day a version is published: the delay pnpm can apply to a fresh
10
+ # release would hold back the very version the scaffold was written for.
11
+ minimumReleaseAgeExclude:
12
+ - '@fougere/*'
@@ -1,43 +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 { BuildReport } from '../../fronds/analysis/handlers/BuildHandler.js';
5
- import pc from 'picocolors';
6
- import { machineWanted, printMachine } from '../../src/machine.js';
7
-
8
- type Ui = ReturnType<typeof createUi>;
9
-
10
- /**
11
- * `fougere build` — the scan, written down.
12
- *
13
- * It reports what the module HOLDS rather than that it was written: a build that found
14
- * one frond where the project has three has succeeded at the wrong thing, and the path
15
- * alone does not say so.
16
- */
17
- export default class BuildCommand {
18
- constructor(private app: App, private ui: Ui) {}
19
-
20
- async run(raw: Record<string, unknown>) {
21
- const built = (await createAppRunner(this.app)(
22
- { entity: 'build', op: 'execute' },
23
- { params: {}, query: {}, input: raw, state: {} },
24
- )) as BuildReport;
25
-
26
- if (machineWanted(raw)) return printMachine(built);
27
-
28
- if (built.fronds.length === 0) {
29
- this.ui.warn('No fronds found. Run this from a Fougere project root.');
30
-
31
- return;
32
- }
33
-
34
- this.ui.success(`${built.path} — ${built.fronds.length} frond(s), ${built.entities} entities, ${built.handlers} handlers`);
35
- this.ui.step(built.fronds.map((name) => pc.bold(name)).join(', '));
36
-
37
- // A diagnostic travels INTO the module, so a boot from it says the same thing. Saying
38
- // it here too is not a duplicate: this is the moment someone can still fix the source.
39
- for (const diagnostic of built.diagnostics) this.ui.warn(diagnostic);
40
-
41
- this.ui.step(pc.dim('hand it to createApp as `scan:` — nothing reads a disk after this'));
42
- }
43
- }
@@ -1,70 +0,0 @@
1
- import { createAppRunner } from '@fougere/core';
2
- import { lowerFirst } from '@fougere/core/contract';
3
- import { bootApp } from '@fougere/defaults';
4
- import type { App } from '@fougere/core';
5
- import type { ui as createUi } from '../../src/ui.js';
6
-
7
- type Ui = ReturnType<typeof createUi>;
8
-
9
- /**
10
- * Parse `--field value` / `--field=value` / `--flag` from the raw argv.
11
- * `call`'s payload is free-form (any entity's fields), so it can't be declared
12
- * on the Call entity — citty would boolean-ify undeclared flags. We read the
13
- * tail ourselves; positionals (the target) are ignored (not `--`-prefixed).
14
- */
15
- function parseFlags(tokens: string[]): Record<string, unknown> {
16
- const out: Record<string, unknown> = {};
17
- for (let i = 0; i < tokens.length; i++) {
18
- const t = tokens[i];
19
- if (!t.startsWith('--')) continue;
20
- const eq = t.indexOf('=');
21
- if (eq !== -1) { out[t.slice(2, eq)] = t.slice(eq + 1); continue; }
22
- const key = t.slice(2);
23
- const next = tokens[i + 1];
24
- if (next === undefined || next.startsWith('--')) out[key] = true;
25
- else { out[key] = next; i++; }
26
- }
27
-
28
- return out;
29
- }
30
-
31
- /**
32
- * The client end of the gradient: drive one operation on the project's app and
33
- * print the result. It follows the topology — if `remotes:` sends the frond
34
- * elsewhere, the call travels there. Same envelope every consumer uses.
35
- */
36
- export default class CallCommand {
37
- constructor(private app: App, private ui: Ui) {}
38
-
39
- async run(raw: Record<string, unknown>) {
40
- const target = raw.operation as string | undefined;
41
- if (!target || !target.includes('.')) {
42
- this.ui.error('Usage: fougere call <entity>.<op> [--field value …]');
43
-
44
- return;
45
- }
46
- const [entityName, op] = target.split('.');
47
-
48
- // Flags → invocation, by the same rule the framework's binding uses:
49
- // a primitive param (like `id`) resolves from `params`, an object from
50
- // `body`. So `--id` is a route param, every other flag is the body.
51
- const flags = parseFlags(process.argv.slice(2));
52
- const params: Record<string, string> = {};
53
- const input: Record<string, unknown> = {};
54
- for (const [k, v] of Object.entries(flags)) {
55
- if (k === 'id') params.id = String(v);
56
- else input[k] = v;
57
- }
58
-
59
- const app = await bootApp(process.cwd(), {});
60
- try {
61
- const result = await createAppRunner(app)(
62
- { entity: lowerFirst(entityName), op },
63
- { params, query: {}, input, state: {} },
64
- );
65
- this.ui.note(JSON.stringify(result, null, 2), target);
66
- } finally {
67
- await app.dispose();
68
- }
69
- }
70
- }
@@ -1,70 +0,0 @@
1
- import type { CheckResult } from '../../fronds/analysis/handlers/CheckHandler.js';
2
- import type { Diagnostic } from '@fougere/core';
3
- import type { App } from '@fougere/core';
4
- import { createAppRunner } from '@fougere/core';
5
- import type { ui as createUi } from '../../src/ui.js';
6
- import pc from 'picocolors';
7
- import { relative } from 'node:path';
8
- import { machineWanted, printMachine } from '../../src/machine.js';
9
-
10
- type Ui = ReturnType<typeof createUi>;
11
-
12
- export default class CheckCommand {
13
- constructor(private app: App, private ui: Ui) {}
14
-
15
- async run(raw: Record<string, unknown>) {
16
- // Ride the call contract — the same envelope every consumer uses.
17
- const result = await createAppRunner(this.app)(
18
- { entity: 'check', op: 'execute' },
19
- { params: {}, query: {}, input: raw, state: {} },
20
- ) as CheckResult;
21
-
22
- // A non-zero exit is what makes this usable in CI, so it is decided before the two
23
- // renderings rather than inside the terminal one.
24
- const blocking = result.findings.filter((f) => f.severity === 'blocking').length;
25
- if (blocking > 0) process.exitCode = 1;
26
-
27
- if (machineWanted(raw)) return printMachine(result);
28
-
29
- if (result.fronds === 0) {
30
- this.ui.warn('No fronds found. Run this from a Fougere project root.');
31
-
32
- return;
33
- }
34
-
35
- this.ui.step(`${pc.bold(String(result.fronds))} frond(s), ${pc.bold(String(result.handlers))} handler(s)`);
36
-
37
- if (result.findings.length === 0) {
38
- this.ui.success('Nothing to report.');
39
-
40
- return;
41
- }
42
-
43
- this.ui.note(result.findings.map(render).join('\n\n'), 'Findings');
44
-
45
- // Warnings do not fail: an unresolvable base class with no operation is ordinary,
46
- // and a check that cries wolf stops being read.
47
- this.ui.info(`${blocking} blocking, ${result.findings.length - blocking} warning(s)`);
48
- }
49
- }
50
-
51
- function render(f: Diagnostic): string {
52
- const mark = f.severity === 'blocking' ? pc.red('✗') : pc.yellow('⚠');
53
- const where = relative(process.cwd(), f.filePath) || f.filePath;
54
- const what = f.subject ? ` ${f.subject}` : '';
55
-
56
- return ` ${mark} ${pc.bold(`[${f.code}]`)}${what}\n${wrap(f.message, 76, ' ')}\n ${pc.dim(where)}`;
57
- }
58
-
59
- /** A box grows to its longest line, so a one-line sentence makes an unreadable box. */
60
- function wrap(text: string, width: number, indent: string): string {
61
- const lines: string[] = [];
62
- let line = '';
63
- for (const word of text.split(' ')) {
64
- if (line && line.length + 1 + word.length > width) { lines.push(line); line = word; }
65
- else line = line ? `${line} ${word}` : word;
66
- }
67
- if (line) lines.push(line);
68
-
69
- return lines.map((l) => indent + l).join('\n');
70
- }
@@ -1,24 +0,0 @@
1
- import type { App } from '@fougere/core';
2
- // `dist/`, not `src/` — app/ ships raw and is loaded by jiti at runtime, but the
3
- // published package carries only dist/, app/, fronds/ and templates/.
4
- import { generateZshCompletion, generateBashCompletion } from '../../dist/completion.js';
5
-
6
- export default class CompletionCommand {
7
- constructor(private app: App) {}
8
-
9
- async run(raw: Record<string, unknown>) {
10
- const shell = (raw.shell as string) || detectShell();
11
- const script = shell === 'bash'
12
- ? generateBashCompletion(this.app)
13
- : generateZshCompletion(this.app);
14
- console.log(script);
15
- }
16
- }
17
-
18
- function detectShell(): string {
19
- const shell = process.env.SHELL ?? '';
20
- if (shell.includes('zsh')) return 'zsh';
21
- if (shell.includes('bash')) return 'bash';
22
-
23
- return 'zsh';
24
- }
@@ -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
- }