everything-dev 0.3.2 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. package/README.md +64 -0
  2. package/cli.js +10 -0
  3. package/dist/_virtual/_rolldown/runtime.cjs +29 -0
  4. package/dist/api-contract.cjs +172 -0
  5. package/dist/api-contract.cjs.map +1 -0
  6. package/dist/api-contract.mjs +171 -0
  7. package/dist/api-contract.mjs.map +1 -0
  8. package/dist/api.cjs +124 -0
  9. package/dist/api.cjs.map +1 -0
  10. package/dist/api.d.cts +36 -0
  11. package/dist/api.d.cts.map +1 -0
  12. package/dist/api.d.mts +36 -0
  13. package/dist/api.d.mts.map +1 -0
  14. package/dist/api.mjs +119 -0
  15. package/dist/api.mjs.map +1 -0
  16. package/dist/app.cjs +156 -0
  17. package/dist/app.cjs.map +1 -0
  18. package/dist/app.mjs +153 -0
  19. package/dist/app.mjs.map +1 -0
  20. package/dist/cli/catalog.cjs +30 -0
  21. package/dist/cli/catalog.cjs.map +1 -0
  22. package/dist/cli/catalog.mjs +29 -0
  23. package/dist/cli/catalog.mjs.map +1 -0
  24. package/dist/cli/help.cjs +16 -0
  25. package/dist/cli/help.cjs.map +1 -0
  26. package/dist/cli/help.mjs +16 -0
  27. package/dist/cli/help.mjs.map +1 -0
  28. package/dist/cli/init.cjs +317 -0
  29. package/dist/cli/init.cjs.map +1 -0
  30. package/dist/cli/init.d.cts +36 -0
  31. package/dist/cli/init.d.cts.map +1 -0
  32. package/dist/cli/init.d.mts +36 -0
  33. package/dist/cli/init.d.mts.map +1 -0
  34. package/dist/cli/init.mjs +309 -0
  35. package/dist/cli/init.mjs.map +1 -0
  36. package/dist/cli/parse.cjs +96 -0
  37. package/dist/cli/parse.cjs.map +1 -0
  38. package/dist/cli/parse.mjs +95 -0
  39. package/dist/cli/parse.mjs.map +1 -0
  40. package/dist/cli/prompts.cjs +42 -0
  41. package/dist/cli/prompts.cjs.map +1 -0
  42. package/dist/cli/prompts.mjs +41 -0
  43. package/dist/cli/prompts.mjs.map +1 -0
  44. package/dist/cli.cjs +167 -0
  45. package/dist/cli.cjs.map +1 -0
  46. package/dist/cli.d.cts +1 -0
  47. package/dist/cli.d.mts +1 -0
  48. package/dist/cli.mjs +166 -0
  49. package/dist/cli.mjs.map +1 -0
  50. package/dist/components/dev-view.cjs +307 -0
  51. package/dist/components/dev-view.cjs.map +1 -0
  52. package/dist/components/dev-view.mjs +306 -0
  53. package/dist/components/dev-view.mjs.map +1 -0
  54. package/dist/components/streaming-view.cjs +146 -0
  55. package/dist/components/streaming-view.cjs.map +1 -0
  56. package/dist/components/streaming-view.mjs +144 -0
  57. package/dist/components/streaming-view.mjs.map +1 -0
  58. package/dist/config.cjs +280 -0
  59. package/dist/config.cjs.map +1 -0
  60. package/dist/config.d.cts +35 -0
  61. package/dist/config.d.cts.map +1 -0
  62. package/dist/config.d.mts +35 -0
  63. package/dist/config.d.mts.map +1 -0
  64. package/dist/config.mjs +266 -0
  65. package/dist/config.mjs.map +1 -0
  66. package/dist/contract.cjs +209 -0
  67. package/dist/contract.cjs.map +1 -0
  68. package/dist/contract.d.cts +490 -0
  69. package/dist/contract.d.cts.map +1 -0
  70. package/dist/contract.d.mts +490 -0
  71. package/dist/contract.d.mts.map +1 -0
  72. package/dist/contract.meta.cjs +104 -0
  73. package/dist/contract.meta.cjs.map +1 -0
  74. package/dist/contract.meta.d.cts +141 -0
  75. package/dist/contract.meta.d.cts.map +1 -0
  76. package/dist/contract.meta.d.mts +141 -0
  77. package/dist/contract.meta.d.mts.map +1 -0
  78. package/dist/contract.meta.mjs +102 -0
  79. package/dist/contract.meta.mjs.map +1 -0
  80. package/dist/contract.mjs +186 -0
  81. package/dist/contract.mjs.map +1 -0
  82. package/dist/dev-logs.cjs +53 -0
  83. package/dist/dev-logs.cjs.map +1 -0
  84. package/dist/dev-logs.mjs +51 -0
  85. package/dist/dev-logs.mjs.map +1 -0
  86. package/dist/dev-session.cjs +195 -0
  87. package/dist/dev-session.cjs.map +1 -0
  88. package/dist/dev-session.mjs +194 -0
  89. package/dist/dev-session.mjs.map +1 -0
  90. package/dist/fastkv.cjs +89 -0
  91. package/dist/fastkv.cjs.map +1 -0
  92. package/dist/fastkv.d.cts +11 -0
  93. package/dist/fastkv.d.cts.map +1 -0
  94. package/dist/fastkv.d.mts +11 -0
  95. package/dist/fastkv.d.mts.map +1 -0
  96. package/dist/fastkv.mjs +82 -0
  97. package/dist/fastkv.mjs.map +1 -0
  98. package/dist/federation.server.cjs +27 -0
  99. package/dist/federation.server.cjs.map +1 -0
  100. package/dist/federation.server.mjs +27 -0
  101. package/dist/federation.server.mjs.map +1 -0
  102. package/dist/host.cjs +367 -0
  103. package/dist/host.cjs.map +1 -0
  104. package/dist/host.d.cts +22 -0
  105. package/dist/host.d.cts.map +1 -0
  106. package/dist/host.d.mts +22 -0
  107. package/dist/host.d.mts.map +1 -0
  108. package/dist/host.mjs +364 -0
  109. package/dist/host.mjs.map +1 -0
  110. package/dist/index.cjs +122 -0
  111. package/dist/index.d.cts +7 -0
  112. package/dist/index.d.mts +7 -0
  113. package/dist/index.mjs +9 -0
  114. package/dist/integrity.cjs +39 -0
  115. package/dist/integrity.cjs.map +1 -0
  116. package/dist/integrity.d.cts +7 -0
  117. package/dist/integrity.d.cts.map +1 -0
  118. package/dist/integrity.d.mts +7 -0
  119. package/dist/integrity.d.mts.map +1 -0
  120. package/dist/integrity.mjs +35 -0
  121. package/dist/integrity.mjs.map +1 -0
  122. package/dist/mf.cjs +77 -0
  123. package/dist/mf.cjs.map +1 -0
  124. package/dist/mf.d.cts +19 -0
  125. package/dist/mf.d.cts.map +1 -0
  126. package/dist/mf.d.mts +19 -0
  127. package/dist/mf.d.mts.map +1 -0
  128. package/dist/mf.mjs +71 -0
  129. package/dist/mf.mjs.map +1 -0
  130. package/dist/near-cli.cjs +196 -0
  131. package/dist/near-cli.cjs.map +1 -0
  132. package/dist/near-cli.mjs +193 -0
  133. package/dist/near-cli.mjs.map +1 -0
  134. package/dist/network.cjs +9 -0
  135. package/dist/network.cjs.map +1 -0
  136. package/dist/network.mjs +8 -0
  137. package/dist/network.mjs.map +1 -0
  138. package/dist/orchestrator.cjs +441 -0
  139. package/dist/orchestrator.cjs.map +1 -0
  140. package/dist/orchestrator.d.cts +40 -0
  141. package/dist/orchestrator.d.cts.map +1 -0
  142. package/dist/orchestrator.d.mts +40 -0
  143. package/dist/orchestrator.d.mts.map +1 -0
  144. package/dist/orchestrator.mjs +436 -0
  145. package/dist/orchestrator.mjs.map +1 -0
  146. package/dist/plugin.cjs +825 -0
  147. package/dist/plugin.cjs.map +1 -0
  148. package/dist/plugin.d.cts +347 -0
  149. package/dist/plugin.d.cts.map +1 -0
  150. package/dist/plugin.d.mts +348 -0
  151. package/dist/plugin.d.mts.map +1 -0
  152. package/dist/plugin.mjs +822 -0
  153. package/dist/plugin.mjs.map +1 -0
  154. package/dist/process-registry.cjs +120 -0
  155. package/dist/process-registry.cjs.map +1 -0
  156. package/dist/process-registry.d.cts +25 -0
  157. package/dist/process-registry.d.cts.map +1 -0
  158. package/dist/process-registry.d.mts +25 -0
  159. package/dist/process-registry.d.mts.map +1 -0
  160. package/dist/process-registry.mjs +119 -0
  161. package/dist/process-registry.mjs.map +1 -0
  162. package/dist/sdk.cjs +61 -0
  163. package/dist/sdk.d.cts +5 -0
  164. package/dist/sdk.d.mts +5 -0
  165. package/dist/sdk.mjs +6 -0
  166. package/dist/shared.cjs +143 -0
  167. package/dist/shared.cjs.map +1 -0
  168. package/dist/shared.d.cts +33 -0
  169. package/dist/shared.d.cts.map +1 -0
  170. package/dist/shared.d.mts +33 -0
  171. package/dist/shared.d.mts.map +1 -0
  172. package/dist/shared.mjs +140 -0
  173. package/dist/shared.mjs.map +1 -0
  174. package/dist/types.cjs +160 -0
  175. package/dist/types.cjs.map +1 -0
  176. package/dist/types.d.cts +269 -0
  177. package/dist/types.d.cts.map +1 -0
  178. package/dist/types.d.mts +269 -0
  179. package/dist/types.d.mts.map +1 -0
  180. package/dist/types.mjs +144 -0
  181. package/dist/types.mjs.map +1 -0
  182. package/dist/ui/head.cjs +67 -0
  183. package/dist/ui/head.cjs.map +1 -0
  184. package/dist/ui/head.d.cts +19 -0
  185. package/dist/ui/head.d.cts.map +1 -0
  186. package/dist/ui/head.d.mts +19 -0
  187. package/dist/ui/head.d.mts.map +1 -0
  188. package/dist/ui/head.mjs +61 -0
  189. package/dist/ui/head.mjs.map +1 -0
  190. package/dist/ui/index.cjs +32 -0
  191. package/dist/ui/index.d.cts +7 -0
  192. package/dist/ui/index.d.mts +7 -0
  193. package/dist/ui/index.mjs +6 -0
  194. package/dist/ui/metadata.cjs +106 -0
  195. package/dist/ui/metadata.cjs.map +1 -0
  196. package/dist/ui/metadata.d.cts +35 -0
  197. package/dist/ui/metadata.d.cts.map +1 -0
  198. package/dist/ui/metadata.d.mts +35 -0
  199. package/dist/ui/metadata.d.mts.map +1 -0
  200. package/dist/ui/metadata.mjs +100 -0
  201. package/dist/ui/metadata.mjs.map +1 -0
  202. package/dist/ui/router.cjs +56 -0
  203. package/dist/ui/router.cjs.map +1 -0
  204. package/dist/ui/router.d.cts +11 -0
  205. package/dist/ui/router.d.cts.map +1 -0
  206. package/dist/ui/router.d.mts +11 -0
  207. package/dist/ui/router.d.mts.map +1 -0
  208. package/dist/ui/router.mjs +51 -0
  209. package/dist/ui/router.mjs.map +1 -0
  210. package/dist/ui/runtime.cjs +65 -0
  211. package/dist/ui/runtime.cjs.map +1 -0
  212. package/dist/ui/runtime.d.cts +29 -0
  213. package/dist/ui/runtime.d.cts.map +1 -0
  214. package/dist/ui/runtime.d.mts +29 -0
  215. package/dist/ui/runtime.d.mts.map +1 -0
  216. package/dist/ui/runtime.mjs +53 -0
  217. package/dist/ui/runtime.mjs.map +1 -0
  218. package/dist/ui/types.cjs +0 -0
  219. package/dist/ui/types.d.cts +52 -0
  220. package/dist/ui/types.d.cts.map +1 -0
  221. package/dist/ui/types.d.mts +52 -0
  222. package/dist/ui/types.d.mts.map +1 -0
  223. package/dist/ui/types.mjs +1 -0
  224. package/dist/utils/banner.cjs +24 -0
  225. package/dist/utils/banner.cjs.map +1 -0
  226. package/dist/utils/banner.mjs +23 -0
  227. package/dist/utils/banner.mjs.map +1 -0
  228. package/dist/utils/linkify.cjs +15 -0
  229. package/dist/utils/linkify.cjs.map +1 -0
  230. package/dist/utils/linkify.mjs +14 -0
  231. package/dist/utils/linkify.mjs.map +1 -0
  232. package/dist/utils/run.cjs +40 -0
  233. package/dist/utils/run.cjs.map +1 -0
  234. package/dist/utils/run.mjs +39 -0
  235. package/dist/utils/run.mjs.map +1 -0
  236. package/dist/utils/theme.cjs +44 -0
  237. package/dist/utils/theme.cjs.map +1 -0
  238. package/dist/utils/theme.mjs +37 -0
  239. package/dist/utils/theme.mjs.map +1 -0
  240. package/package.json +269 -80
  241. package/src/api-contract.ts +309 -0
  242. package/src/api.ts +181 -0
  243. package/src/app.ts +346 -0
  244. package/src/cli/catalog.ts +49 -0
  245. package/src/cli/help.ts +13 -0
  246. package/src/cli/init.ts +415 -0
  247. package/src/cli/parse.ts +130 -0
  248. package/src/cli/prompts.ts +64 -0
  249. package/src/cli.ts +203 -1507
  250. package/src/components/dev-view.tsx +104 -41
  251. package/src/components/streaming-view.ts +89 -22
  252. package/src/config.ts +462 -532
  253. package/src/contract.meta.ts +96 -0
  254. package/src/contract.ts +164 -561
  255. package/src/dev-logs.ts +85 -0
  256. package/src/dev-session.ts +318 -0
  257. package/src/fastkv.ts +153 -0
  258. package/src/federation.server.ts +43 -0
  259. package/src/host.ts +526 -0
  260. package/src/index.ts +6 -3
  261. package/src/integrity.ts +54 -0
  262. package/src/mf.ts +105 -0
  263. package/src/near-cli.ts +284 -0
  264. package/src/network.ts +3 -0
  265. package/src/orchestrator.ts +648 -0
  266. package/src/plugin.ts +1116 -2303
  267. package/src/process-registry.ts +154 -0
  268. package/src/scripts/sync-api-contract.ts +24 -0
  269. package/src/sdk.ts +14 -0
  270. package/src/shared.ts +206 -0
  271. package/src/types.ts +152 -206
  272. package/src/ui/head.ts +34 -27
  273. package/src/ui/index.ts +3 -3
  274. package/src/ui/metadata.ts +95 -0
  275. package/src/ui/router.ts +22 -6
  276. package/src/ui/runtime.ts +55 -6
  277. package/src/ui/types.ts +24 -11
  278. package/src/utils/banner.ts +10 -6
  279. package/src/utils/run.ts +26 -27
  280. package/src/utils/theme.ts +3 -66
  281. package/src/components/monitor-view.tsx +0 -475
  282. package/src/components/status-view.tsx +0 -173
  283. package/src/lib/env.ts +0 -109
  284. package/src/lib/near-cli.ts +0 -289
  285. package/src/lib/nova.ts +0 -266
  286. package/src/lib/orchestrator.ts +0 -276
  287. package/src/lib/process-registry.ts +0 -166
  288. package/src/lib/process.ts +0 -549
  289. package/src/lib/resource-monitor/assertions.ts +0 -234
  290. package/src/lib/resource-monitor/command.ts +0 -283
  291. package/src/lib/resource-monitor/diff.ts +0 -157
  292. package/src/lib/resource-monitor/errors.ts +0 -127
  293. package/src/lib/resource-monitor/index.ts +0 -305
  294. package/src/lib/resource-monitor/platform/darwin.ts +0 -306
  295. package/src/lib/resource-monitor/platform/index.ts +0 -35
  296. package/src/lib/resource-monitor/platform/linux.ts +0 -332
  297. package/src/lib/resource-monitor/platform/windows.ts +0 -298
  298. package/src/lib/resource-monitor/snapshot.ts +0 -217
  299. package/src/lib/resource-monitor/types.ts +0 -74
  300. package/src/lib/session-recorder/errors.ts +0 -102
  301. package/src/lib/session-recorder/flows/login.ts +0 -210
  302. package/src/lib/session-recorder/index.ts +0 -361
  303. package/src/lib/session-recorder/playwright.ts +0 -257
  304. package/src/lib/session-recorder/report.ts +0 -353
  305. package/src/lib/session-recorder/server.ts +0 -267
  306. package/src/lib/session-recorder/types.ts +0 -115
  307. package/src/lib/sync.ts +0 -1
  308. package/src/ui/files.ts +0 -134
@@ -0,0 +1,29 @@
1
+ import { bosContract } from "../contract.mjs";
2
+ import { cliCommandMeta } from "../contract.meta.mjs";
3
+
4
+ //#region src/cli/catalog.ts
5
+ function splitCamelCase(value) {
6
+ return value.replace(/([a-z0-9])([A-Z])/g, "$1 $2").split(/\s+/).map((part) => part.trim()).filter(Boolean).map((part) => part.toLowerCase());
7
+ }
8
+ const commandCatalog = Object.entries(bosContract).map(([key, procedure]) => {
9
+ const meta = cliCommandMeta[key] ?? { summary: splitCamelCase(String(key)).join(" ") };
10
+ return {
11
+ key,
12
+ commandPath: meta.commandPath ?? splitCamelCase(String(key)),
13
+ summary: meta.summary,
14
+ meta,
15
+ procedure
16
+ };
17
+ });
18
+ function findCommandDescriptor(args) {
19
+ const sorted = [...commandCatalog].sort((a, b) => b.commandPath.length - a.commandPath.length);
20
+ for (const descriptor of sorted) if (args.slice(0, descriptor.commandPath.length).map((part) => part.toLowerCase()).join(" ") === descriptor.commandPath.join(" ")) return {
21
+ descriptor,
22
+ consumed: descriptor.commandPath.length
23
+ };
24
+ return null;
25
+ }
26
+
27
+ //#endregion
28
+ export { commandCatalog, findCommandDescriptor };
29
+ //# sourceMappingURL=catalog.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.mjs","names":[],"sources":["../../src/cli/catalog.ts"],"sourcesContent":["import { bosContract } from \"../contract\";\nimport { type CliCommandMeta, cliCommandMeta } from \"../contract.meta\";\n\nexport type CommandDescriptor = {\n key: keyof typeof bosContract;\n commandPath: string[];\n summary: string;\n meta: CliCommandMeta;\n procedure: (typeof bosContract)[keyof typeof bosContract];\n};\n\nfunction splitCamelCase(value: string): string[] {\n return value\n .replace(/([a-z0-9])([A-Z])/g, \"$1 $2\")\n .split(/\\s+/)\n .map((part) => part.trim())\n .filter(Boolean)\n .map((part) => part.toLowerCase());\n}\n\nexport const commandCatalog: CommandDescriptor[] = (\n Object.entries(bosContract) as Array<\n [keyof typeof bosContract, (typeof bosContract)[keyof typeof bosContract]]\n >\n).map(([key, procedure]) => {\n const meta = cliCommandMeta[key as keyof typeof cliCommandMeta] ?? {\n summary: splitCamelCase(String(key)).join(\" \"),\n };\n return {\n key,\n commandPath: meta.commandPath ?? splitCamelCase(String(key)),\n summary: meta.summary,\n meta,\n procedure,\n };\n});\n\nexport function findCommandDescriptor(\n args: string[],\n): { descriptor: CommandDescriptor; consumed: number } | null {\n const sorted = [...commandCatalog].sort((a, b) => b.commandPath.length - a.commandPath.length);\n for (const descriptor of sorted) {\n const parts = args.slice(0, descriptor.commandPath.length).map((part) => part.toLowerCase());\n if (parts.join(\" \") === descriptor.commandPath.join(\" \")) {\n return { descriptor, consumed: descriptor.commandPath.length };\n }\n }\n return null;\n}\n"],"mappings":";;;;AAWA,SAAS,eAAe,OAAyB;AAC/C,QAAO,MACJ,QAAQ,sBAAsB,QAAQ,CACtC,MAAM,MAAM,CACZ,KAAK,SAAS,KAAK,MAAM,CAAC,CAC1B,OAAO,QAAQ,CACf,KAAK,SAAS,KAAK,aAAa,CAAC;;AAGtC,MAAa,iBACX,OAAO,QAAQ,YAAY,CAG3B,KAAK,CAAC,KAAK,eAAe;CAC1B,MAAM,OAAO,eAAe,QAAuC,EACjE,SAAS,eAAe,OAAO,IAAI,CAAC,CAAC,KAAK,IAAI,EAC/C;AACD,QAAO;EACL;EACA,aAAa,KAAK,eAAe,eAAe,OAAO,IAAI,CAAC;EAC5D,SAAS,KAAK;EACd;EACA;EACD;EACD;AAEF,SAAgB,sBACd,MAC4D;CAC5D,MAAM,SAAS,CAAC,GAAG,eAAe,CAAC,MAAM,GAAG,MAAM,EAAE,YAAY,SAAS,EAAE,YAAY,OAAO;AAC9F,MAAK,MAAM,cAAc,OAEvB,KADc,KAAK,MAAM,GAAG,WAAW,YAAY,OAAO,CAAC,KAAK,SAAS,KAAK,aAAa,CAAC,CAClF,KAAK,IAAI,KAAK,WAAW,YAAY,KAAK,IAAI,CACtD,QAAO;EAAE;EAAY,UAAU,WAAW,YAAY;EAAQ;AAGlE,QAAO"}
@@ -0,0 +1,16 @@
1
+ const require_catalog = require('./catalog.cjs');
2
+
3
+ //#region src/cli/help.ts
4
+ function printHelp() {
5
+ process.stdout.write(`everything-dev commands\n\n`);
6
+ for (const command of require_catalog.commandCatalog) {
7
+ process.stdout.write(` everything-dev ${command.commandPath.join(" ")}`);
8
+ process.stdout.write(command.meta.longRunning ? " (long running)" : "");
9
+ process.stdout.write(`\n ${command.summary}\n`);
10
+ }
11
+ process.stdout.write(`\n'bos' is an alias for 'everything-dev'.\n`);
12
+ }
13
+
14
+ //#endregion
15
+ exports.printHelp = printHelp;
16
+ //# sourceMappingURL=help.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help.cjs","names":["commandCatalog"],"sources":["../../src/cli/help.ts"],"sourcesContent":["import { commandCatalog } from \"./catalog\";\n\nexport function printHelp() {\n process.stdout.write(`everything-dev commands\\n\\n`);\n\n for (const command of commandCatalog) {\n process.stdout.write(` everything-dev ${command.commandPath.join(\" \")}`);\n process.stdout.write(command.meta.longRunning ? \" (long running)\" : \"\");\n process.stdout.write(`\\n ${command.summary}\\n`);\n }\n\n process.stdout.write(`\\n'bos' is an alias for 'everything-dev'.\\n`);\n}\n"],"mappings":";;;AAEA,SAAgB,YAAY;AAC1B,SAAQ,OAAO,MAAM,8BAA8B;AAEnD,MAAK,MAAM,WAAWA,gCAAgB;AACpC,UAAQ,OAAO,MAAM,oBAAoB,QAAQ,YAAY,KAAK,IAAI,GAAG;AACzE,UAAQ,OAAO,MAAM,QAAQ,KAAK,cAAc,oBAAoB,GAAG;AACvE,UAAQ,OAAO,MAAM,SAAS,QAAQ,QAAQ,IAAI;;AAGpD,SAAQ,OAAO,MAAM,8CAA8C"}
@@ -0,0 +1,16 @@
1
+ import { commandCatalog } from "./catalog.mjs";
2
+
3
+ //#region src/cli/help.ts
4
+ function printHelp() {
5
+ process.stdout.write(`everything-dev commands\n\n`);
6
+ for (const command of commandCatalog) {
7
+ process.stdout.write(` everything-dev ${command.commandPath.join(" ")}`);
8
+ process.stdout.write(command.meta.longRunning ? " (long running)" : "");
9
+ process.stdout.write(`\n ${command.summary}\n`);
10
+ }
11
+ process.stdout.write(`\n'bos' is an alias for 'everything-dev'.\n`);
12
+ }
13
+
14
+ //#endregion
15
+ export { printHelp };
16
+ //# sourceMappingURL=help.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help.mjs","names":[],"sources":["../../src/cli/help.ts"],"sourcesContent":["import { commandCatalog } from \"./catalog\";\n\nexport function printHelp() {\n process.stdout.write(`everything-dev commands\\n\\n`);\n\n for (const command of commandCatalog) {\n process.stdout.write(` everything-dev ${command.commandPath.join(\" \")}`);\n process.stdout.write(command.meta.longRunning ? \" (long running)\" : \"\");\n process.stdout.write(`\\n ${command.summary}\\n`);\n }\n\n process.stdout.write(`\\n'bos' is an alias for 'everything-dev'.\\n`);\n}\n"],"mappings":";;;AAEA,SAAgB,YAAY;AAC1B,SAAQ,OAAO,MAAM,8BAA8B;AAEnD,MAAK,MAAM,WAAW,gBAAgB;AACpC,UAAQ,OAAO,MAAM,oBAAoB,QAAQ,YAAY,KAAK,IAAI,GAAG;AACzE,UAAQ,OAAO,MAAM,QAAQ,KAAK,cAAc,oBAAoB,GAAG;AACvE,UAAQ,OAAO,MAAM,SAAS,QAAQ,QAAQ,IAAI;;AAGpD,SAAQ,OAAO,MAAM,8CAA8C"}
@@ -0,0 +1,317 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_fastkv = require('../fastkv.cjs');
4
+ let node_fs = require("node:fs");
5
+ let node_path = require("node:path");
6
+ let node_child_process = require("node:child_process");
7
+ let node_module = require("node:module");
8
+ let node_os = require("node:os");
9
+ let node_stream_promises = require("node:stream/promises");
10
+ let glob = require("glob");
11
+
12
+ //#region src/cli/init.ts
13
+ const require$1 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
14
+ async function resolveSourceDir(opts) {
15
+ if (opts.source) {
16
+ const sourceDir = (0, node_path.resolve)(opts.source);
17
+ if (!(0, node_fs.existsSync)((0, node_path.join)(sourceDir, "bos.config.json"))) throw new Error(`No bos.config.json found in source directory: ${sourceDir}`);
18
+ return {
19
+ sourceDir,
20
+ parentConfig: JSON.parse((0, node_fs.readFileSync)((0, node_path.join)(sourceDir, "bos.config.json"), "utf-8")),
21
+ cleanup: async () => {}
22
+ };
23
+ }
24
+ const parentConfig = await fetchParentConfig(opts.account, opts.gateway);
25
+ if (!parentConfig.repository) throw new Error("Parent config has no repository field — cannot locate template source");
26
+ const { dir: sourceDir, cleanup } = await downloadTarball(parentConfig.repository);
27
+ return {
28
+ sourceDir,
29
+ parentConfig,
30
+ cleanup
31
+ };
32
+ }
33
+ async function fetchParentConfig(account, gateway) {
34
+ return require_fastkv.fetchBosConfigFromFastKv(`bos://${account}/${gateway}`);
35
+ }
36
+ async function downloadTarball(repoUrl) {
37
+ const parsed = parseGitHubUrl(repoUrl);
38
+ if (!parsed) throw new Error(`Cannot parse repository URL: ${repoUrl}`);
39
+ const { owner, repo, branch } = parsed;
40
+ const tarballUrl = `https://api.github.com/repos/${owner}/${repo}/tarball/${branch}`;
41
+ const tmpDir = mkTmpDir("bos-init-tarball-");
42
+ const tarballPath = (0, node_path.join)(tmpDir, "source.tar.gz");
43
+ const response = await fetch(tarballUrl, {
44
+ headers: { "User-Agent": "everything-dev" },
45
+ redirect: "follow"
46
+ });
47
+ if (!response.ok) {
48
+ (0, node_fs.rmSync)(tmpDir, {
49
+ recursive: true,
50
+ force: true
51
+ });
52
+ throw new Error(`GitHub tarball download failed: ${response.status} ${response.statusText}`);
53
+ }
54
+ if (!response.body) {
55
+ (0, node_fs.rmSync)(tmpDir, {
56
+ recursive: true,
57
+ force: true
58
+ });
59
+ throw new Error("GitHub tarball download returned empty body");
60
+ }
61
+ const fileStream = (0, node_fs.createWriteStream)(tarballPath);
62
+ const reader = response.body;
63
+ await (0, node_stream_promises.pipeline)(reader, fileStream);
64
+ const extractDir = mkTmpDir("bos-init-extract-");
65
+ try {
66
+ await require$1("tar").extract({
67
+ cwd: extractDir,
68
+ file: tarballPath,
69
+ strip: 1
70
+ });
71
+ } catch {
72
+ await execCommand("tar", [
73
+ "-xzf",
74
+ tarballPath,
75
+ "--strip-components=1",
76
+ "-C",
77
+ extractDir
78
+ ]);
79
+ }
80
+ (0, node_fs.rmSync)(tmpDir, {
81
+ recursive: true,
82
+ force: true
83
+ });
84
+ return {
85
+ dir: extractDir,
86
+ cleanup: async () => {
87
+ (0, node_fs.rmSync)(extractDir, {
88
+ recursive: true,
89
+ force: true
90
+ });
91
+ }
92
+ };
93
+ }
94
+ function parseGitHubUrl(url) {
95
+ const httpsMatch = url.match(/^https?:\/\/github\.com\/([^/]+)\/([^/]+?)(?:\.git)?(?:\/.*)?$/);
96
+ if (httpsMatch) return {
97
+ owner: httpsMatch[1],
98
+ repo: httpsMatch[2],
99
+ branch: "main"
100
+ };
101
+ const sshMatch = url.match(/^git@github\.com:([^/]+)\/([^/]+?)(?:\.git)?$/);
102
+ if (sshMatch) return {
103
+ owner: sshMatch[1],
104
+ repo: sshMatch[2],
105
+ branch: "main"
106
+ };
107
+ return null;
108
+ }
109
+ async function readTemplatekeep(sourceDir) {
110
+ const keepFile = (0, node_path.join)(sourceDir, ".templatekeep");
111
+ if (!(0, node_fs.existsSync)(keepFile)) return [];
112
+ return (0, node_fs.readFileSync)(keepFile, "utf-8").split("\n").map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
113
+ }
114
+ async function copyFilteredFiles(sourceDir, destination, patterns, options) {
115
+ if (patterns.length === 0) return 0;
116
+ const effectivePatterns = options.withHost ? [...patterns, "host/**"] : patterns.filter((p) => !p.startsWith("host/") && p !== "host/**");
117
+ const allFiles = /* @__PURE__ */ new Set();
118
+ for (const pattern of effectivePatterns) {
119
+ const matches = await (0, glob.glob)(pattern, {
120
+ cwd: sourceDir,
121
+ nodir: true,
122
+ dot: true,
123
+ absolute: false
124
+ });
125
+ for (const match of matches) allFiles.add(match);
126
+ }
127
+ (0, node_fs.mkdirSync)(destination, { recursive: true });
128
+ let count = 0;
129
+ for (const filePath of allFiles) {
130
+ const src = (0, node_path.join)(sourceDir, filePath);
131
+ if (!(0, node_fs.lstatSync)(src).isFile()) continue;
132
+ const dest = (0, node_path.join)(destination, filePath);
133
+ (0, node_fs.mkdirSync)((0, node_path.dirname)(dest), { recursive: true });
134
+ (0, node_fs.writeFileSync)(dest, (0, node_fs.readFileSync)(src));
135
+ count++;
136
+ }
137
+ return count;
138
+ }
139
+ async function personalizeConfig(destination, opts) {
140
+ const configPath = (0, node_path.join)(destination, "bos.config.json");
141
+ if ((0, node_fs.existsSync)(configPath)) {
142
+ const config = JSON.parse((0, node_fs.readFileSync)(configPath, "utf-8"));
143
+ config.extends = `bos://${opts.parentAccount}/${opts.parentGateway}`;
144
+ if (opts.name) config.account = opts.name;
145
+ if (opts.domain) config.domain = opts.domain;
146
+ if (config.app && typeof config.app === "object") {
147
+ const app = config.app;
148
+ for (const entryKey of Object.keys(app)) {
149
+ const entry = app[entryKey];
150
+ if (entry && typeof entry === "object") {
151
+ const e = entry;
152
+ delete e.production;
153
+ delete e.productionIntegrity;
154
+ delete e.ssr;
155
+ delete e.ssrIntegrity;
156
+ }
157
+ }
158
+ }
159
+ if (config.plugins && typeof config.plugins === "object") {
160
+ const plugins = config.plugins;
161
+ for (const pluginKey of Object.keys(plugins)) {
162
+ const plugin = plugins[pluginKey];
163
+ if (plugin && typeof plugin === "object") {
164
+ const p = plugin;
165
+ delete p.production;
166
+ delete p.productionIntegrity;
167
+ }
168
+ }
169
+ }
170
+ (0, node_fs.writeFileSync)(configPath, `${JSON.stringify(config, null, 2)}\n`);
171
+ }
172
+ const pkgPath = (0, node_path.join)(destination, "package.json");
173
+ if ((0, node_fs.existsSync)(pkgPath)) {
174
+ const pkg = JSON.parse((0, node_fs.readFileSync)(pkgPath, "utf-8"));
175
+ if (pkg.workspaces && typeof pkg.workspaces === "object") {
176
+ const ws = pkg.workspaces;
177
+ if (Array.isArray(ws.packages)) ws.packages = ws.packages.filter((p) => p !== "host" && !p.startsWith("packages/"));
178
+ }
179
+ if (pkg.scripts && typeof pkg.scripts === "object") {
180
+ const scripts = pkg.scripts;
181
+ const rewrite = (key, from, to) => {
182
+ if (scripts[key]?.includes(from)) scripts[key] = scripts[key].replaceAll(from, to);
183
+ };
184
+ rewrite("dev", "packages/everything-dev/cli.js", "node_modules/.bin/bos");
185
+ rewrite("dev:ui", "packages/everything-dev/cli.js", "node_modules/.bin/bos");
186
+ rewrite("dev:api", "packages/everything-dev/cli.js", "node_modules/.bin/bos");
187
+ rewrite("dev:proxy", "packages/everything-dev/cli.js", "node_modules/.bin/bos");
188
+ rewrite("build", "packages/everything-dev/cli.js", "node_modules/.bin/bos");
189
+ rewrite("deploy", "packages/everything-dev/cli.js", "node_modules/.bin/bos");
190
+ rewrite("publish", "packages/everything-dev/cli.js", "node_modules/.bin/bos");
191
+ rewrite("start", "packages/everything-dev/cli.js", "node_modules/.bin/bos");
192
+ if (scripts["sync:api-contract"]) delete scripts["sync:api-contract"];
193
+ if (scripts.postinstall) delete scripts.postinstall;
194
+ if (scripts.typecheck?.includes("sync:api-contract")) scripts.typecheck = scripts.typecheck.replace("bun run sync:api-contract && ", "");
195
+ }
196
+ if (pkg.devDependencies && typeof pkg.devDependencies === "object") {
197
+ const deps = pkg.devDependencies;
198
+ delete deps["every-plugin"];
199
+ delete deps["everything-dev"];
200
+ }
201
+ if (!pkg.dependencies) pkg.dependencies = {};
202
+ const deps = pkg.dependencies;
203
+ if (!deps["everything-dev"]) deps["everything-dev"] = "^1.1.0";
204
+ if (!deps["every-plugin"]) deps["every-plugin"] = "^2.0.0";
205
+ (0, node_fs.writeFileSync)(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`);
206
+ }
207
+ await resolveWorkspaceRefs(destination, opts.workspaceOpts);
208
+ }
209
+ async function runBunInstall(destination) {
210
+ await execCommand("bun", ["install"], destination);
211
+ }
212
+ const WORKSPACE_VERSION_MAP = {
213
+ "everything-dev": "^1.1.0",
214
+ "every-plugin": "^2.0.0"
215
+ };
216
+ const WORKSPACE_LOCAL_PATHS = {
217
+ "everything-dev": "packages/everything-dev",
218
+ "every-plugin": "packages/every-plugin"
219
+ };
220
+ async function resolveWorkspaceRefs(destination, options) {
221
+ const files = await (0, glob.glob)("**/package.json", {
222
+ cwd: destination,
223
+ nodir: true,
224
+ dot: false,
225
+ absolute: false,
226
+ ignore: ["**/node_modules/**"]
227
+ });
228
+ for (const file of files) {
229
+ const filePath = (0, node_path.join)(destination, file);
230
+ const content = (0, node_fs.readFileSync)(filePath, "utf-8");
231
+ if (!content.includes("workspace:")) continue;
232
+ const pkg = JSON.parse(content);
233
+ let modified = false;
234
+ for (const depField of [
235
+ "dependencies",
236
+ "devDependencies",
237
+ "peerDependencies"
238
+ ]) {
239
+ const deps = pkg[depField];
240
+ if (!deps || typeof deps !== "object") continue;
241
+ const map = deps;
242
+ for (const [name, version] of Object.entries(map)) if (version === "workspace:*") {
243
+ const resolved = WORKSPACE_VERSION_MAP[name];
244
+ if (resolved) {
245
+ map[name] = resolved;
246
+ modified = true;
247
+ } else if (name === "host") {
248
+ delete map[name];
249
+ modified = true;
250
+ }
251
+ }
252
+ }
253
+ if (modified) (0, node_fs.writeFileSync)(filePath, `${JSON.stringify(pkg, null, 2)}\n`);
254
+ }
255
+ if (options?.localOverrides && options.sourceDir) {
256
+ const rootPkgPath = (0, node_path.join)(destination, "package.json");
257
+ if ((0, node_fs.existsSync)(rootPkgPath)) {
258
+ const pkg = JSON.parse((0, node_fs.readFileSync)(rootPkgPath, "utf-8"));
259
+ if (!pkg.overrides) pkg.overrides = {};
260
+ const overrides = pkg.overrides;
261
+ const rootWorkspaces = (pkg.workspaces?.packages ?? []).filter(Boolean);
262
+ for (const [name, relPath] of Object.entries(WORKSPACE_LOCAL_PATHS)) if (!rootWorkspaces.some((ws) => ws === relPath || ws === `plugins/${name}`)) {
263
+ if ((0, node_fs.existsSync)((0, node_path.join)(options.sourceDir, relPath, "package.json"))) {
264
+ overrides[name] = `file:${relPath}`;
265
+ rootWorkspaces.push(relPath);
266
+ }
267
+ }
268
+ if (rootWorkspaces.length > 0) {
269
+ if (!pkg.workspaces) pkg.workspaces = {};
270
+ pkg.workspaces.packages = rootWorkspaces;
271
+ }
272
+ (0, node_fs.writeFileSync)(rootPkgPath, `${JSON.stringify(pkg, null, 2)}\n`);
273
+ }
274
+ }
275
+ }
276
+ function mkTmpDir(prefix) {
277
+ const base = (0, node_path.join)((0, node_os.tmpdir)(), prefix);
278
+ let attempt = 0;
279
+ while (true) {
280
+ const dir = `${base}-${Date.now()}-${attempt}`;
281
+ try {
282
+ (0, node_fs.mkdirSync)(dir, { recursive: true });
283
+ return dir;
284
+ } catch {
285
+ attempt++;
286
+ if (attempt > 10) throw new Error("Failed to create temp directory");
287
+ }
288
+ }
289
+ }
290
+ function execCommand(command, args, cwd) {
291
+ return new Promise((resolve, reject) => {
292
+ const child = (0, node_child_process.spawn)(command, args, {
293
+ cwd,
294
+ stdio: "pipe",
295
+ shell: true
296
+ });
297
+ let stderr = "";
298
+ child.stderr?.on("data", (data) => {
299
+ stderr += data.toString();
300
+ });
301
+ child.on("close", (code) => {
302
+ if (code === 0) resolve();
303
+ else reject(/* @__PURE__ */ new Error(`Command '${command} ${args.join(" ")}' failed with exit code ${code}: ${stderr}`));
304
+ });
305
+ child.on("error", reject);
306
+ });
307
+ }
308
+
309
+ //#endregion
310
+ exports.copyFilteredFiles = copyFilteredFiles;
311
+ exports.downloadTarball = downloadTarball;
312
+ exports.fetchParentConfig = fetchParentConfig;
313
+ exports.personalizeConfig = personalizeConfig;
314
+ exports.readTemplatekeep = readTemplatekeep;
315
+ exports.resolveSourceDir = resolveSourceDir;
316
+ exports.runBunInstall = runBunInstall;
317
+ //# sourceMappingURL=init.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.cjs","names":["require","fetchBosConfigFromFastKv"],"sources":["../../src/cli/init.ts"],"sourcesContent":["import { spawn } from \"node:child_process\";\nimport {\n createWriteStream,\n existsSync,\n lstatSync,\n mkdirSync,\n readFileSync,\n rmSync,\n writeFileSync,\n} from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport { tmpdir } from \"node:os\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { pipeline } from \"node:stream/promises\";\nimport { glob } from \"glob\";\nimport { fetchBosConfigFromFastKv } from \"../fastkv\";\nimport type { BosConfig } from \"../types\";\n\nconst require = createRequire(import.meta.url);\n\ninterface SourceResult {\n sourceDir: string;\n parentConfig: BosConfig;\n cleanup: () => Promise<void>;\n}\n\nexport async function resolveSourceDir(opts: {\n account: string;\n gateway: string;\n source?: string;\n}): Promise<SourceResult> {\n if (opts.source) {\n const sourceDir = resolve(opts.source);\n if (!existsSync(join(sourceDir, \"bos.config.json\"))) {\n throw new Error(`No bos.config.json found in source directory: ${sourceDir}`);\n }\n const parentConfig = JSON.parse(\n readFileSync(join(sourceDir, \"bos.config.json\"), \"utf-8\"),\n ) as BosConfig;\n return { sourceDir, parentConfig, cleanup: async () => {} };\n }\n\n const parentConfig = await fetchParentConfig(opts.account, opts.gateway);\n\n if (!parentConfig.repository) {\n throw new Error(\"Parent config has no repository field — cannot locate template source\");\n }\n\n const { dir: sourceDir, cleanup } = await downloadTarball(parentConfig.repository);\n return { sourceDir, parentConfig, cleanup };\n}\n\nexport async function fetchParentConfig(account: string, gateway: string): Promise<BosConfig> {\n const bosUrl = `bos://${account}/${gateway}`;\n return fetchBosConfigFromFastKv<BosConfig>(bosUrl);\n}\n\nexport async function downloadTarball(\n repoUrl: string,\n): Promise<{ dir: string; cleanup: () => Promise<void> }> {\n const parsed = parseGitHubUrl(repoUrl);\n if (!parsed) {\n throw new Error(`Cannot parse repository URL: ${repoUrl}`);\n }\n\n const { owner, repo, branch } = parsed;\n const tarballUrl = `https://api.github.com/repos/${owner}/${repo}/tarball/${branch}`;\n\n const tmpDir = mkTmpDir(\"bos-init-tarball-\");\n const tarballPath = join(tmpDir, \"source.tar.gz\");\n\n const response = await fetch(tarballUrl, {\n headers: { \"User-Agent\": \"everything-dev\" },\n redirect: \"follow\",\n });\n\n if (!response.ok) {\n rmSync(tmpDir, { recursive: true, force: true });\n throw new Error(`GitHub tarball download failed: ${response.status} ${response.statusText}`);\n }\n\n if (!response.body) {\n rmSync(tmpDir, { recursive: true, force: true });\n throw new Error(\"GitHub tarball download returned empty body\");\n }\n\n const fileStream = createWriteStream(tarballPath);\n const reader = response.body as unknown as NodeJS.ReadableStream;\n await pipeline(reader, fileStream);\n\n const extractDir = mkTmpDir(\"bos-init-extract-\");\n try {\n const tar = require(\"tar\") as {\n extract: (opts: { cwd: string; file: string; strip: number }) => Promise<void>;\n };\n await tar.extract({ cwd: extractDir, file: tarballPath, strip: 1 });\n } catch {\n await execCommand(\"tar\", [\"-xzf\", tarballPath, \"--strip-components=1\", \"-C\", extractDir]);\n }\n\n rmSync(tmpDir, { recursive: true, force: true });\n\n return {\n dir: extractDir,\n cleanup: async () => {\n rmSync(extractDir, { recursive: true, force: true });\n },\n };\n}\n\nfunction parseGitHubUrl(url: string): { owner: string; repo: string; branch: string } | null {\n const httpsMatch = url.match(/^https?:\\/\\/github\\.com\\/([^/]+)\\/([^/]+?)(?:\\.git)?(?:\\/.*)?$/);\n if (httpsMatch) {\n return { owner: httpsMatch[1], repo: httpsMatch[2], branch: \"main\" };\n }\n\n const sshMatch = url.match(/^git@github\\.com:([^/]+)\\/([^/]+?)(?:\\.git)?$/);\n if (sshMatch) {\n return { owner: sshMatch[1], repo: sshMatch[2], branch: \"main\" };\n }\n\n return null;\n}\n\nexport async function readTemplatekeep(sourceDir: string): Promise<string[]> {\n const keepFile = join(sourceDir, \".templatekeep\");\n if (!existsSync(keepFile)) {\n return [];\n }\n\n const content = readFileSync(keepFile, \"utf-8\");\n return content\n .split(\"\\n\")\n .map((line) => line.trim())\n .filter((line) => line.length > 0 && !line.startsWith(\"#\"));\n}\n\nexport async function copyFilteredFiles(\n sourceDir: string,\n destination: string,\n patterns: string[],\n options: { withHost: boolean },\n): Promise<number> {\n if (patterns.length === 0) {\n return 0;\n }\n\n const effectivePatterns = options.withHost\n ? [...patterns, \"host/**\"]\n : patterns.filter((p) => !p.startsWith(\"host/\") && p !== \"host/**\");\n\n const allFiles = new Set<string>();\n for (const pattern of effectivePatterns) {\n const matches = await glob(pattern, {\n cwd: sourceDir,\n nodir: true,\n dot: true,\n absolute: false,\n });\n for (const match of matches) {\n allFiles.add(match);\n }\n }\n\n mkdirSync(destination, { recursive: true });\n\n let count = 0;\n for (const filePath of allFiles) {\n const src = join(sourceDir, filePath);\n const stat = lstatSync(src);\n if (!stat.isFile()) continue;\n\n const dest = join(destination, filePath);\n mkdirSync(dirname(dest), { recursive: true });\n const content = readFileSync(src);\n writeFileSync(dest, content);\n count++;\n }\n\n return count;\n}\n\nexport async function personalizeConfig(\n destination: string,\n opts: {\n parentAccount: string;\n parentGateway: string;\n name?: string;\n domain?: string;\n workspaceOpts?: { localOverrides?: boolean; sourceDir?: string };\n },\n): Promise<void> {\n const configPath = join(destination, \"bos.config.json\");\n if (existsSync(configPath)) {\n const config = JSON.parse(readFileSync(configPath, \"utf-8\")) as Record<string, unknown>;\n\n config.extends = `bos://${opts.parentAccount}/${opts.parentGateway}`;\n\n if (opts.name) {\n config.account = opts.name;\n }\n if (opts.domain) {\n config.domain = opts.domain;\n }\n\n if (config.app && typeof config.app === \"object\") {\n const app = config.app as Record<string, unknown>;\n for (const entryKey of Object.keys(app)) {\n const entry = app[entryKey];\n if (entry && typeof entry === \"object\") {\n const e = entry as Record<string, unknown>;\n delete e.production;\n delete e.productionIntegrity;\n delete e.ssr;\n delete e.ssrIntegrity;\n }\n }\n }\n\n if (config.plugins && typeof config.plugins === \"object\") {\n const plugins = config.plugins as Record<string, unknown>;\n for (const pluginKey of Object.keys(plugins)) {\n const plugin = plugins[pluginKey];\n if (plugin && typeof plugin === \"object\") {\n const p = plugin as Record<string, unknown>;\n delete p.production;\n delete p.productionIntegrity;\n }\n }\n }\n\n writeFileSync(configPath, `${JSON.stringify(config, null, 2)}\\n`);\n }\n\n const pkgPath = join(destination, \"package.json\");\n if (existsSync(pkgPath)) {\n const pkg = JSON.parse(readFileSync(pkgPath, \"utf-8\")) as Record<string, unknown>;\n\n if (pkg.workspaces && typeof pkg.workspaces === \"object\") {\n const ws = pkg.workspaces as { packages?: string[] };\n if (Array.isArray(ws.packages)) {\n ws.packages = ws.packages.filter((p: string) => p !== \"host\" && !p.startsWith(\"packages/\"));\n }\n }\n\n if (pkg.scripts && typeof pkg.scripts === \"object\") {\n const scripts = pkg.scripts as Record<string, string>;\n const rewrite = (key: string, from: string, to: string) => {\n if (scripts[key]?.includes(from)) {\n scripts[key] = scripts[key].replaceAll(from, to);\n }\n };\n rewrite(\"dev\", \"packages/everything-dev/cli.js\", \"node_modules/.bin/bos\");\n rewrite(\"dev:ui\", \"packages/everything-dev/cli.js\", \"node_modules/.bin/bos\");\n rewrite(\"dev:api\", \"packages/everything-dev/cli.js\", \"node_modules/.bin/bos\");\n rewrite(\"dev:proxy\", \"packages/everything-dev/cli.js\", \"node_modules/.bin/bos\");\n rewrite(\"build\", \"packages/everything-dev/cli.js\", \"node_modules/.bin/bos\");\n rewrite(\"deploy\", \"packages/everything-dev/cli.js\", \"node_modules/.bin/bos\");\n rewrite(\"publish\", \"packages/everything-dev/cli.js\", \"node_modules/.bin/bos\");\n rewrite(\"start\", \"packages/everything-dev/cli.js\", \"node_modules/.bin/bos\");\n\n if (scripts[\"sync:api-contract\"]) {\n delete scripts[\"sync:api-contract\"];\n }\n if (scripts.postinstall) {\n delete scripts.postinstall;\n }\n if (scripts.typecheck?.includes(\"sync:api-contract\")) {\n scripts.typecheck = scripts.typecheck.replace(\"bun run sync:api-contract && \", \"\");\n }\n }\n\n if (pkg.devDependencies && typeof pkg.devDependencies === \"object\") {\n const deps = pkg.devDependencies as Record<string, string>;\n delete deps[\"every-plugin\"];\n delete deps[\"everything-dev\"];\n }\n\n if (!pkg.dependencies) pkg.dependencies = {};\n const deps = pkg.dependencies as Record<string, string>;\n if (!deps[\"everything-dev\"]) deps[\"everything-dev\"] = \"^1.1.0\";\n if (!deps[\"every-plugin\"]) deps[\"every-plugin\"] = \"^2.0.0\";\n\n writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\\n`);\n }\n\n await resolveWorkspaceRefs(destination, opts.workspaceOpts);\n}\n\nexport async function runBunInstall(destination: string): Promise<void> {\n await execCommand(\"bun\", [\"install\"], destination);\n}\n\nconst WORKSPACE_VERSION_MAP: Record<string, string> = {\n \"everything-dev\": \"^1.1.0\",\n \"every-plugin\": \"^2.0.0\",\n};\n\nconst WORKSPACE_LOCAL_PATHS: Record<string, string> = {\n \"everything-dev\": \"packages/everything-dev\",\n \"every-plugin\": \"packages/every-plugin\",\n};\n\nasync function resolveWorkspaceRefs(\n destination: string,\n options?: { localOverrides?: boolean; sourceDir?: string },\n): Promise<void> {\n const files = await glob(\"**/package.json\", {\n cwd: destination,\n nodir: true,\n dot: false,\n absolute: false,\n ignore: [\"**/node_modules/**\"],\n });\n\n for (const file of files) {\n const filePath = join(destination, file);\n const content = readFileSync(filePath, \"utf-8\");\n if (!content.includes(\"workspace:\")) continue;\n\n const pkg = JSON.parse(content) as Record<string, unknown>;\n let modified = false;\n\n for (const depField of [\"dependencies\", \"devDependencies\", \"peerDependencies\"]) {\n const deps = pkg[depField];\n if (!deps || typeof deps !== \"object\") continue;\n const map = deps as Record<string, string>;\n for (const [name, version] of Object.entries(map)) {\n if (version === \"workspace:*\") {\n const resolved = WORKSPACE_VERSION_MAP[name];\n if (resolved) {\n map[name] = resolved;\n modified = true;\n } else if (name === \"host\") {\n delete map[name];\n modified = true;\n }\n }\n }\n }\n\n if (modified) {\n writeFileSync(filePath, `${JSON.stringify(pkg, null, 2)}\\n`);\n }\n }\n\n if (options?.localOverrides && options.sourceDir) {\n const rootPkgPath = join(destination, \"package.json\");\n if (existsSync(rootPkgPath)) {\n const pkg = JSON.parse(readFileSync(rootPkgPath, \"utf-8\")) as Record<string, unknown>;\n if (!pkg.overrides) pkg.overrides = {};\n const overrides = pkg.overrides as Record<string, string>;\n\n const rootWorkspaces = ((pkg.workspaces as Record<string, string[]>)?.packages ?? []).filter(\n Boolean,\n );\n\n for (const [name, relPath] of Object.entries(WORKSPACE_LOCAL_PATHS)) {\n if (!rootWorkspaces.some((ws) => ws === relPath || ws === `plugins/${name}`)) {\n const srcPkgPath = join(options.sourceDir, relPath, \"package.json\");\n if (existsSync(srcPkgPath)) {\n overrides[name] = `file:${relPath}`;\n rootWorkspaces.push(relPath);\n }\n }\n }\n\n if (rootWorkspaces.length > 0) {\n if (!pkg.workspaces) pkg.workspaces = {};\n (pkg.workspaces as Record<string, string[]>).packages = rootWorkspaces;\n }\n\n writeFileSync(rootPkgPath, `${JSON.stringify(pkg, null, 2)}\\n`);\n }\n }\n}\n\nfunction mkTmpDir(prefix: string): string {\n const base = join(tmpdir(), prefix);\n let attempt = 0;\n while (true) {\n const dir = `${base}-${Date.now()}-${attempt}`;\n try {\n mkdirSync(dir, { recursive: true });\n return dir;\n } catch {\n attempt++;\n if (attempt > 10) throw new Error(\"Failed to create temp directory\");\n }\n }\n}\n\nfunction execCommand(command: string, args: string[], cwd?: string): Promise<void> {\n return new Promise((resolve, reject) => {\n const child = spawn(command, args, {\n cwd,\n stdio: \"pipe\",\n shell: true,\n });\n let stderr = \"\";\n child.stderr?.on(\"data\", (data: Buffer) => {\n stderr += data.toString();\n });\n child.on(\"close\", (code) => {\n if (code === 0) resolve();\n else\n reject(\n new Error(\n `Command '${command} ${args.join(\" \")}' failed with exit code ${code}: ${stderr}`,\n ),\n );\n });\n child.on(\"error\", reject);\n });\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,MAAMA,yFAAwC;AAQ9C,eAAsB,iBAAiB,MAIb;AACxB,KAAI,KAAK,QAAQ;EACf,MAAM,mCAAoB,KAAK,OAAO;AACtC,MAAI,6CAAiB,WAAW,kBAAkB,CAAC,CACjD,OAAM,IAAI,MAAM,iDAAiD,YAAY;AA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ig } from "../types.cjs";
2
+
3
+ //#region src/cli/init.d.ts
4
+ interface SourceResult {
5
+ sourceDir: string;
6
+ parentConfig: BosConfig;
7
+ cleanup: () => Promise<void>;
8
+ }
9
+ declare function resolveSourceDir(opts: {
10
+ account: string;
11
+ gateway: string;
12
+ source?: string;
13
+ }): Promise<SourceResult>;
14
+ declare function fetchParentConfig(account: string, gateway: string): Promise<BosConfig>;
15
+ declare function downloadTarball(repoUrl: string): Promise<{
16
+ dir: string;
17
+ cleanup: () => Promise<void>;
18
+ }>;
19
+ declare function readTemplatekeep(sourceDir: string): Promise<string[]>;
20
+ declare function copyFilteredFiles(sourceDir: string, destination: string, patterns: string[], options: {
21
+ withHost: boolean;
22
+ }): Promise<number>;
23
+ declare function personalizeConfig(destination: string, opts: {
24
+ parentAccount: string;
25
+ parentGateway: string;
26
+ name?: string;
27
+ domain?: string;
28
+ workspaceOpts?: {
29
+ localOverrides?: boolean;
30
+ sourceDir?: string;
31
+ };
32
+ }): Promise<void>;
33
+ declare function runBunInstall(destination: string): Promise<void>;
34
+ //#endregion
35
+ export { copyFilteredFiles, downloadTarball, fetchParentConfig, personalizeConfig, readTemplatekeep, resolveSourceDir, runBunInstall };
36
+ //# sourceMappingURL=init.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.cts","names":[],"sources":["../../src/cli/init.ts"],"mappings":";;;UAoBU,YAAA;EACR,SAAA;EACA,YAAA,EAAc,SAAA;EACd,OAAA,QAAe,OAAA;AAAA;AAAA,iBAGK,gBAAA,CAAiB,IAAA;EACrC,OAAA;EACA,OAAA;EACA,MAAA;AAAA,IACE,OAAA,CAAQ,YAAA;AAAA,iBAsBU,iBAAA,CAAkB,OAAA,UAAiB,OAAA,WAAkB,OAAA,CAAQ,SAAA;AAAA,iBAK7D,eAAA,CACpB,OAAA,WACC,OAAA;EAAU,GAAA;EAAa,OAAA,QAAe,OAAA;AAAA;AAAA,iBAiEnB,gBAAA,CAAiB,SAAA,WAAoB,OAAA;AAAA,iBAarC,iBAAA,CACpB,SAAA,UACA,WAAA,UACA,QAAA,YACA,OAAA;EAAW,QAAA;AAAA,IACV,OAAA;AAAA,iBAwCmB,iBAAA,CACpB,WAAA,UACA,IAAA;EACE,aAAA;EACA,aAAA;EACA,IAAA;EACA,MAAA;EACA,aAAA;IAAkB,cAAA;IAA0B,SAAA;EAAA;AAAA,IAE7C,OAAA;AAAA,iBAkGmB,aAAA,CAAc,WAAA,WAAsB,OAAA"}
@@ -0,0 +1,36 @@
1
+ import { BosConfig } from "../types.mjs";
2
+
3
+ //#region src/cli/init.d.ts
4
+ interface SourceResult {
5
+ sourceDir: string;
6
+ parentConfig: BosConfig;
7
+ cleanup: () => Promise<void>;
8
+ }
9
+ declare function resolveSourceDir(opts: {
10
+ account: string;
11
+ gateway: string;
12
+ source?: string;
13
+ }): Promise<SourceResult>;
14
+ declare function fetchParentConfig(account: string, gateway: string): Promise<BosConfig>;
15
+ declare function downloadTarball(repoUrl: string): Promise<{
16
+ dir: string;
17
+ cleanup: () => Promise<void>;
18
+ }>;
19
+ declare function readTemplatekeep(sourceDir: string): Promise<string[]>;
20
+ declare function copyFilteredFiles(sourceDir: string, destination: string, patterns: string[], options: {
21
+ withHost: boolean;
22
+ }): Promise<number>;
23
+ declare function personalizeConfig(destination: string, opts: {
24
+ parentAccount: string;
25
+ parentGateway: string;
26
+ name?: string;
27
+ domain?: string;
28
+ workspaceOpts?: {
29
+ localOverrides?: boolean;
30
+ sourceDir?: string;
31
+ };
32
+ }): Promise<void>;
33
+ declare function runBunInstall(destination: string): Promise<void>;
34
+ //#endregion
35
+ export { copyFilteredFiles, downloadTarball, fetchParentConfig, personalizeConfig, readTemplatekeep, resolveSourceDir, runBunInstall };
36
+ //# sourceMappingURL=init.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.mts","names":[],"sources":["../../src/cli/init.ts"],"mappings":";;;UAoBU,YAAA;EACR,SAAA;EACA,YAAA,EAAc,SAAA;EACd,OAAA,QAAe,OAAA;AAAA;AAAA,iBAGK,gBAAA,CAAiB,IAAA;EACrC,OAAA;EACA,OAAA;EACA,MAAA;AAAA,IACE,OAAA,CAAQ,YAAA;AAAA,iBAsBU,iBAAA,CAAkB,OAAA,UAAiB,OAAA,WAAkB,OAAA,CAAQ,SAAA;AAAA,iBAK7D,eAAA,CACpB,OAAA,WACC,OAAA;EAAU,GAAA;EAAa,OAAA,QAAe,OAAA;AAAA;AAAA,iBAiEnB,gBAAA,CAAiB,SAAA,WAAoB,OAAA;AAAA,iBAarC,iBAAA,CACpB,SAAA,UACA,WAAA,UACA,QAAA,YACA,OAAA;EAAW,QAAA;AAAA,IACV,OAAA;AAAA,iBAwCmB,iBAAA,CACpB,WAAA,UACA,IAAA;EACE,aAAA;EACA,aAAA;EACA,IAAA;EACA,MAAA;EACA,aAAA;IAAkB,cAAA;IAA0B,SAAA;EAAA;AAAA,IAE7C,OAAA;AAAA,iBAkGmB,aAAA,CAAc,WAAA,WAAsB,OAAA"}