everything-dev 0.3.3 → 1.3.3

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 (313) 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 +287 -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 +279 -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/internal/manifest-normalizer.cjs +140 -0
  123. package/dist/internal/manifest-normalizer.cjs.map +1 -0
  124. package/dist/internal/manifest-normalizer.mjs +138 -0
  125. package/dist/internal/manifest-normalizer.mjs.map +1 -0
  126. package/dist/mf.cjs +77 -0
  127. package/dist/mf.cjs.map +1 -0
  128. package/dist/mf.d.cts +19 -0
  129. package/dist/mf.d.cts.map +1 -0
  130. package/dist/mf.d.mts +19 -0
  131. package/dist/mf.d.mts.map +1 -0
  132. package/dist/mf.mjs +71 -0
  133. package/dist/mf.mjs.map +1 -0
  134. package/dist/near-cli.cjs +196 -0
  135. package/dist/near-cli.cjs.map +1 -0
  136. package/dist/near-cli.mjs +193 -0
  137. package/dist/near-cli.mjs.map +1 -0
  138. package/dist/network.cjs +9 -0
  139. package/dist/network.cjs.map +1 -0
  140. package/dist/network.mjs +8 -0
  141. package/dist/network.mjs.map +1 -0
  142. package/dist/orchestrator.cjs +441 -0
  143. package/dist/orchestrator.cjs.map +1 -0
  144. package/dist/orchestrator.d.cts +40 -0
  145. package/dist/orchestrator.d.cts.map +1 -0
  146. package/dist/orchestrator.d.mts +40 -0
  147. package/dist/orchestrator.d.mts.map +1 -0
  148. package/dist/orchestrator.mjs +436 -0
  149. package/dist/orchestrator.mjs.map +1 -0
  150. package/dist/plugin.cjs +830 -0
  151. package/dist/plugin.cjs.map +1 -0
  152. package/dist/plugin.d.cts +347 -0
  153. package/dist/plugin.d.cts.map +1 -0
  154. package/dist/plugin.d.mts +348 -0
  155. package/dist/plugin.d.mts.map +1 -0
  156. package/dist/plugin.mjs +827 -0
  157. package/dist/plugin.mjs.map +1 -0
  158. package/dist/process-registry.cjs +120 -0
  159. package/dist/process-registry.cjs.map +1 -0
  160. package/dist/process-registry.d.cts +25 -0
  161. package/dist/process-registry.d.cts.map +1 -0
  162. package/dist/process-registry.d.mts +25 -0
  163. package/dist/process-registry.d.mts.map +1 -0
  164. package/dist/process-registry.mjs +119 -0
  165. package/dist/process-registry.mjs.map +1 -0
  166. package/dist/sdk.cjs +61 -0
  167. package/dist/sdk.d.cts +5 -0
  168. package/dist/sdk.d.mts +5 -0
  169. package/dist/sdk.mjs +6 -0
  170. package/dist/shared.cjs +143 -0
  171. package/dist/shared.cjs.map +1 -0
  172. package/dist/shared.d.cts +33 -0
  173. package/dist/shared.d.cts.map +1 -0
  174. package/dist/shared.d.mts +33 -0
  175. package/dist/shared.d.mts.map +1 -0
  176. package/dist/shared.mjs +140 -0
  177. package/dist/shared.mjs.map +1 -0
  178. package/dist/types.cjs +160 -0
  179. package/dist/types.cjs.map +1 -0
  180. package/dist/types.d.cts +269 -0
  181. package/dist/types.d.cts.map +1 -0
  182. package/dist/types.d.mts +269 -0
  183. package/dist/types.d.mts.map +1 -0
  184. package/dist/types.mjs +144 -0
  185. package/dist/types.mjs.map +1 -0
  186. package/dist/ui/head.cjs +67 -0
  187. package/dist/ui/head.cjs.map +1 -0
  188. package/dist/ui/head.d.cts +19 -0
  189. package/dist/ui/head.d.cts.map +1 -0
  190. package/dist/ui/head.d.mts +19 -0
  191. package/dist/ui/head.d.mts.map +1 -0
  192. package/dist/ui/head.mjs +61 -0
  193. package/dist/ui/head.mjs.map +1 -0
  194. package/dist/ui/index.cjs +32 -0
  195. package/dist/ui/index.d.cts +7 -0
  196. package/dist/ui/index.d.mts +7 -0
  197. package/dist/ui/index.mjs +6 -0
  198. package/dist/ui/metadata.cjs +106 -0
  199. package/dist/ui/metadata.cjs.map +1 -0
  200. package/dist/ui/metadata.d.cts +35 -0
  201. package/dist/ui/metadata.d.cts.map +1 -0
  202. package/dist/ui/metadata.d.mts +35 -0
  203. package/dist/ui/metadata.d.mts.map +1 -0
  204. package/dist/ui/metadata.mjs +100 -0
  205. package/dist/ui/metadata.mjs.map +1 -0
  206. package/dist/ui/router.cjs +56 -0
  207. package/dist/ui/router.cjs.map +1 -0
  208. package/dist/ui/router.d.cts +11 -0
  209. package/dist/ui/router.d.cts.map +1 -0
  210. package/dist/ui/router.d.mts +11 -0
  211. package/dist/ui/router.d.mts.map +1 -0
  212. package/dist/ui/router.mjs +51 -0
  213. package/dist/ui/router.mjs.map +1 -0
  214. package/dist/ui/runtime.cjs +65 -0
  215. package/dist/ui/runtime.cjs.map +1 -0
  216. package/dist/ui/runtime.d.cts +29 -0
  217. package/dist/ui/runtime.d.cts.map +1 -0
  218. package/dist/ui/runtime.d.mts +29 -0
  219. package/dist/ui/runtime.d.mts.map +1 -0
  220. package/dist/ui/runtime.mjs +53 -0
  221. package/dist/ui/runtime.mjs.map +1 -0
  222. package/dist/ui/types.cjs +0 -0
  223. package/dist/ui/types.d.cts +52 -0
  224. package/dist/ui/types.d.cts.map +1 -0
  225. package/dist/ui/types.d.mts +52 -0
  226. package/dist/ui/types.d.mts.map +1 -0
  227. package/dist/ui/types.mjs +1 -0
  228. package/dist/utils/banner.cjs +24 -0
  229. package/dist/utils/banner.cjs.map +1 -0
  230. package/dist/utils/banner.mjs +23 -0
  231. package/dist/utils/banner.mjs.map +1 -0
  232. package/dist/utils/linkify.cjs +15 -0
  233. package/dist/utils/linkify.cjs.map +1 -0
  234. package/dist/utils/linkify.mjs +14 -0
  235. package/dist/utils/linkify.mjs.map +1 -0
  236. package/dist/utils/run.cjs +40 -0
  237. package/dist/utils/run.cjs.map +1 -0
  238. package/dist/utils/run.mjs +39 -0
  239. package/dist/utils/run.mjs.map +1 -0
  240. package/dist/utils/theme.cjs +44 -0
  241. package/dist/utils/theme.cjs.map +1 -0
  242. package/dist/utils/theme.mjs +37 -0
  243. package/dist/utils/theme.mjs.map +1 -0
  244. package/package.json +269 -80
  245. package/src/api-contract.ts +309 -0
  246. package/src/api.ts +181 -0
  247. package/src/app.ts +346 -0
  248. package/src/cli/catalog.ts +49 -0
  249. package/src/cli/help.ts +13 -0
  250. package/src/cli/init.ts +386 -0
  251. package/src/cli/parse.ts +130 -0
  252. package/src/cli/prompts.ts +64 -0
  253. package/src/cli.ts +203 -1507
  254. package/src/components/dev-view.tsx +307 -255
  255. package/src/components/streaming-view.ts +164 -128
  256. package/src/config.ts +462 -532
  257. package/src/contract.meta.ts +96 -0
  258. package/src/contract.ts +164 -561
  259. package/src/dev-logs.ts +85 -0
  260. package/src/dev-session.ts +318 -0
  261. package/src/fastkv.ts +153 -0
  262. package/src/federation.server.ts +43 -0
  263. package/src/host.ts +526 -0
  264. package/src/index.ts +6 -3
  265. package/src/integrity.ts +54 -0
  266. package/src/internal/manifest-normalizer.ts +251 -0
  267. package/src/mf.ts +105 -0
  268. package/src/near-cli.ts +284 -0
  269. package/src/network.ts +3 -0
  270. package/src/orchestrator.ts +648 -0
  271. package/src/plugin.ts +1130 -2311
  272. package/src/process-registry.ts +154 -0
  273. package/src/scripts/sync-api-contract.ts +24 -0
  274. package/src/sdk.ts +14 -0
  275. package/src/shared.ts +206 -0
  276. package/src/types.ts +152 -206
  277. package/src/ui/head.ts +34 -27
  278. package/src/ui/index.ts +3 -3
  279. package/src/ui/metadata.ts +95 -0
  280. package/src/ui/router.ts +22 -6
  281. package/src/ui/runtime.ts +55 -6
  282. package/src/ui/types.ts +24 -11
  283. package/src/utils/banner.ts +10 -6
  284. package/src/utils/run.ts +26 -27
  285. package/src/utils/theme.ts +3 -66
  286. package/src/components/monitor-view.tsx +0 -475
  287. package/src/components/status-view.tsx +0 -173
  288. package/src/lib/env.ts +0 -109
  289. package/src/lib/near-cli.ts +0 -289
  290. package/src/lib/nova.ts +0 -266
  291. package/src/lib/orchestrator.ts +0 -276
  292. package/src/lib/process-registry.ts +0 -166
  293. package/src/lib/process.ts +0 -550
  294. package/src/lib/resource-monitor/assertions.ts +0 -234
  295. package/src/lib/resource-monitor/command.ts +0 -283
  296. package/src/lib/resource-monitor/diff.ts +0 -157
  297. package/src/lib/resource-monitor/errors.ts +0 -127
  298. package/src/lib/resource-monitor/index.ts +0 -305
  299. package/src/lib/resource-monitor/platform/darwin.ts +0 -306
  300. package/src/lib/resource-monitor/platform/index.ts +0 -35
  301. package/src/lib/resource-monitor/platform/linux.ts +0 -332
  302. package/src/lib/resource-monitor/platform/windows.ts +0 -298
  303. package/src/lib/resource-monitor/snapshot.ts +0 -217
  304. package/src/lib/resource-monitor/types.ts +0 -74
  305. package/src/lib/session-recorder/errors.ts +0 -102
  306. package/src/lib/session-recorder/flows/login.ts +0 -210
  307. package/src/lib/session-recorder/index.ts +0 -361
  308. package/src/lib/session-recorder/playwright.ts +0 -257
  309. package/src/lib/session-recorder/report.ts +0 -353
  310. package/src/lib/session-recorder/server.ts +0 -268
  311. package/src/lib/session-recorder/types.ts +0 -115
  312. package/src/lib/sync.ts +0 -1
  313. package/src/ui/files.ts +0 -134
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router.cjs","names":[],"sources":["../../src/ui/router.ts"],"sourcesContent":["import type { AnyRouter } from \"@tanstack/react-router\";\nimport type { HeadData, HeadLink, HeadMeta, HeadScript } from \"./types\";\n\nexport function getMetaKey(meta: HeadMeta): string {\n if (!meta) return \"null\";\n if (\"title\" in meta) return \"title\";\n if (\"charSet\" in meta) return \"charSet\";\n if (\"name\" in meta) return `name:${(meta as { name: string }).name}`;\n if (\"property\" in meta) {\n return `property:${(meta as { property: string }).property}`;\n }\n if (\"httpEquiv\" in meta) {\n return `httpEquiv:${(meta as { httpEquiv: string }).httpEquiv}`;\n }\n return JSON.stringify(meta);\n}\n\nexport function getLinkKey(link: HeadLink): string {\n const rel = (link as { rel?: string }).rel ?? \"\";\n const href = (link as { href?: string }).href ?? \"\";\n return `${rel}:${href}`;\n}\n\nexport function getScriptKey(script: HeadScript): string {\n if (!script) return \"null\";\n if (\"src\" in script && script.src) return `src:${script.src}`;\n if (\"children\" in script && script.children) {\n return `children:${typeof script.children === \"string\" ? script.children : JSON.stringify(script.children)}`;\n }\n return JSON.stringify(script);\n}\n\nexport async function collectHeadData(router: AnyRouter): Promise<HeadData> {\n await router.load();\n\n const metaMap = new Map<string, HeadMeta>();\n const linkMap = new Map<string, HeadLink>();\n const scriptMap = new Map<string, HeadScript>();\n\n for (const match of router.state.matches) {\n const route =\n (\n router as AnyRouter & {\n routesById?: Record<string, { options?: { head?: (...args: unknown[]) => unknown } }>;\n }\n ).routesById?.[(match as { routeId: string }).routeId] ??\n (match as { route?: { options?: { head?: (...args: unknown[]) => unknown } } }).route;\n const headFn = route?.options?.head;\n if (!headFn) continue;\n\n try {\n const headResult = (await headFn({\n loaderData: match.loaderData,\n matches: router.state.matches,\n match,\n params: match.params,\n })) as {\n meta?: HeadMeta[];\n links?: HeadLink[];\n scripts?: HeadScript[];\n };\n\n if (headResult?.meta) {\n for (const meta of headResult.meta) {\n metaMap.set(getMetaKey(meta), meta);\n }\n }\n if (headResult?.links) {\n for (const link of headResult.links) {\n linkMap.set(getLinkKey(link), link);\n }\n }\n if (headResult?.scripts) {\n for (const script of headResult.scripts) {\n scriptMap.set(getScriptKey(script), script);\n }\n }\n } catch (error) {\n console.warn(`[collectHeadData] head() failed for ${match.routeId}:`, error);\n }\n }\n\n return {\n meta: [...metaMap.values()],\n links: [...linkMap.values()],\n scripts: [...scriptMap.values()],\n };\n}\n"],"mappings":";;;AAGA,SAAgB,WAAW,MAAwB;AACjD,KAAI,CAAC,KAAM,QAAO;AAClB,KAAI,WAAW,KAAM,QAAO;AAC5B,KAAI,aAAa,KAAM,QAAO;AAC9B,KAAI,UAAU,KAAM,QAAO,QAAS,KAA0B;AAC9D,KAAI,cAAc,KAChB,QAAO,YAAa,KAA8B;AAEpD,KAAI,eAAe,KACjB,QAAO,aAAc,KAA+B;AAEtD,QAAO,KAAK,UAAU,KAAK;;AAG7B,SAAgB,WAAW,MAAwB;AAGjD,QAAO,GAFM,KAA0B,OAAO,GAEhC,GADA,KAA2B,QAAQ;;AAInD,SAAgB,aAAa,QAA4B;AACvD,KAAI,CAAC,OAAQ,QAAO;AACpB,KAAI,SAAS,UAAU,OAAO,IAAK,QAAO,OAAO,OAAO;AACxD,KAAI,cAAc,UAAU,OAAO,SACjC,QAAO,YAAY,OAAO,OAAO,aAAa,WAAW,OAAO,WAAW,KAAK,UAAU,OAAO,SAAS;AAE5G,QAAO,KAAK,UAAU,OAAO;;AAG/B,eAAsB,gBAAgB,QAAsC;AAC1E,OAAM,OAAO,MAAM;CAEnB,MAAM,0BAAU,IAAI,KAAuB;CAC3C,MAAM,0BAAU,IAAI,KAAuB;CAC3C,MAAM,4BAAY,IAAI,KAAyB;AAE/C,MAAK,MAAM,SAAS,OAAO,MAAM,SAAS;EAQxC,MAAM,UALF,OAGA,aAAc,MAA8B,YAC7C,MAA+E,QAC5D,SAAS;AAC/B,MAAI,CAAC,OAAQ;AAEb,MAAI;GACF,MAAM,aAAc,MAAM,OAAO;IAC/B,YAAY,MAAM;IAClB,SAAS,OAAO,MAAM;IACtB;IACA,QAAQ,MAAM;IACf,CAAC;AAMF,OAAI,YAAY,KACd,MAAK,MAAM,QAAQ,WAAW,KAC5B,SAAQ,IAAI,WAAW,KAAK,EAAE,KAAK;AAGvC,OAAI,YAAY,MACd,MAAK,MAAM,QAAQ,WAAW,MAC5B,SAAQ,IAAI,WAAW,KAAK,EAAE,KAAK;AAGvC,OAAI,YAAY,QACd,MAAK,MAAM,UAAU,WAAW,QAC9B,WAAU,IAAI,aAAa,OAAO,EAAE,OAAO;WAGxC,OAAO;AACd,WAAQ,KAAK,uCAAuC,MAAM,QAAQ,IAAI,MAAM;;;AAIhF,QAAO;EACL,MAAM,CAAC,GAAG,QAAQ,QAAQ,CAAC;EAC3B,OAAO,CAAC,GAAG,QAAQ,QAAQ,CAAC;EAC5B,SAAS,CAAC,GAAG,UAAU,QAAQ,CAAC;EACjC"}
@@ -0,0 +1,11 @@
1
+ import { HeadData, HeadLink, HeadMeta, HeadScript } from "./types.cjs";
2
+ import { AnyRouter } from "@tanstack/react-router";
3
+
4
+ //#region src/ui/router.d.ts
5
+ declare function getMetaKey(meta: HeadMeta): string;
6
+ declare function getLinkKey(link: HeadLink): string;
7
+ declare function getScriptKey(script: HeadScript): string;
8
+ declare function collectHeadData(router: AnyRouter): Promise<HeadData>;
9
+ //#endregion
10
+ export { collectHeadData, getLinkKey, getMetaKey, getScriptKey };
11
+ //# sourceMappingURL=router.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router.d.cts","names":[],"sources":["../../src/ui/router.ts"],"mappings":";;;;iBAGgB,UAAA,CAAW,IAAA,EAAM,QAAA;AAAA,iBAcjB,UAAA,CAAW,IAAA,EAAM,QAAA;AAAA,iBAMjB,YAAA,CAAa,MAAA,EAAQ,UAAA;AAAA,iBASf,eAAA,CAAgB,MAAA,EAAQ,SAAA,GAAY,OAAA,CAAQ,QAAA"}
@@ -0,0 +1,11 @@
1
+ import { HeadData, HeadLink, HeadMeta, HeadScript } from "./types.mjs";
2
+ import { AnyRouter } from "@tanstack/react-router";
3
+
4
+ //#region src/ui/router.d.ts
5
+ declare function getMetaKey(meta: HeadMeta): string;
6
+ declare function getLinkKey(link: HeadLink): string;
7
+ declare function getScriptKey(script: HeadScript): string;
8
+ declare function collectHeadData(router: AnyRouter): Promise<HeadData>;
9
+ //#endregion
10
+ export { collectHeadData, getLinkKey, getMetaKey, getScriptKey };
11
+ //# sourceMappingURL=router.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router.d.mts","names":[],"sources":["../../src/ui/router.ts"],"mappings":";;;;iBAGgB,UAAA,CAAW,IAAA,EAAM,QAAA;AAAA,iBAcjB,UAAA,CAAW,IAAA,EAAM,QAAA;AAAA,iBAMjB,YAAA,CAAa,MAAA,EAAQ,UAAA;AAAA,iBASf,eAAA,CAAgB,MAAA,EAAQ,SAAA,GAAY,OAAA,CAAQ,QAAA"}
@@ -0,0 +1,51 @@
1
+ //#region src/ui/router.ts
2
+ function getMetaKey(meta) {
3
+ if (!meta) return "null";
4
+ if ("title" in meta) return "title";
5
+ if ("charSet" in meta) return "charSet";
6
+ if ("name" in meta) return `name:${meta.name}`;
7
+ if ("property" in meta) return `property:${meta.property}`;
8
+ if ("httpEquiv" in meta) return `httpEquiv:${meta.httpEquiv}`;
9
+ return JSON.stringify(meta);
10
+ }
11
+ function getLinkKey(link) {
12
+ return `${link.rel ?? ""}:${link.href ?? ""}`;
13
+ }
14
+ function getScriptKey(script) {
15
+ if (!script) return "null";
16
+ if ("src" in script && script.src) return `src:${script.src}`;
17
+ if ("children" in script && script.children) return `children:${typeof script.children === "string" ? script.children : JSON.stringify(script.children)}`;
18
+ return JSON.stringify(script);
19
+ }
20
+ async function collectHeadData(router) {
21
+ await router.load();
22
+ const metaMap = /* @__PURE__ */ new Map();
23
+ const linkMap = /* @__PURE__ */ new Map();
24
+ const scriptMap = /* @__PURE__ */ new Map();
25
+ for (const match of router.state.matches) {
26
+ const headFn = (router.routesById?.[match.routeId] ?? match.route)?.options?.head;
27
+ if (!headFn) continue;
28
+ try {
29
+ const headResult = await headFn({
30
+ loaderData: match.loaderData,
31
+ matches: router.state.matches,
32
+ match,
33
+ params: match.params
34
+ });
35
+ if (headResult?.meta) for (const meta of headResult.meta) metaMap.set(getMetaKey(meta), meta);
36
+ if (headResult?.links) for (const link of headResult.links) linkMap.set(getLinkKey(link), link);
37
+ if (headResult?.scripts) for (const script of headResult.scripts) scriptMap.set(getScriptKey(script), script);
38
+ } catch (error) {
39
+ console.warn(`[collectHeadData] head() failed for ${match.routeId}:`, error);
40
+ }
41
+ }
42
+ return {
43
+ meta: [...metaMap.values()],
44
+ links: [...linkMap.values()],
45
+ scripts: [...scriptMap.values()]
46
+ };
47
+ }
48
+
49
+ //#endregion
50
+ export { collectHeadData, getLinkKey, getMetaKey, getScriptKey };
51
+ //# sourceMappingURL=router.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router.mjs","names":[],"sources":["../../src/ui/router.ts"],"sourcesContent":["import type { AnyRouter } from \"@tanstack/react-router\";\nimport type { HeadData, HeadLink, HeadMeta, HeadScript } from \"./types\";\n\nexport function getMetaKey(meta: HeadMeta): string {\n if (!meta) return \"null\";\n if (\"title\" in meta) return \"title\";\n if (\"charSet\" in meta) return \"charSet\";\n if (\"name\" in meta) return `name:${(meta as { name: string }).name}`;\n if (\"property\" in meta) {\n return `property:${(meta as { property: string }).property}`;\n }\n if (\"httpEquiv\" in meta) {\n return `httpEquiv:${(meta as { httpEquiv: string }).httpEquiv}`;\n }\n return JSON.stringify(meta);\n}\n\nexport function getLinkKey(link: HeadLink): string {\n const rel = (link as { rel?: string }).rel ?? \"\";\n const href = (link as { href?: string }).href ?? \"\";\n return `${rel}:${href}`;\n}\n\nexport function getScriptKey(script: HeadScript): string {\n if (!script) return \"null\";\n if (\"src\" in script && script.src) return `src:${script.src}`;\n if (\"children\" in script && script.children) {\n return `children:${typeof script.children === \"string\" ? script.children : JSON.stringify(script.children)}`;\n }\n return JSON.stringify(script);\n}\n\nexport async function collectHeadData(router: AnyRouter): Promise<HeadData> {\n await router.load();\n\n const metaMap = new Map<string, HeadMeta>();\n const linkMap = new Map<string, HeadLink>();\n const scriptMap = new Map<string, HeadScript>();\n\n for (const match of router.state.matches) {\n const route =\n (\n router as AnyRouter & {\n routesById?: Record<string, { options?: { head?: (...args: unknown[]) => unknown } }>;\n }\n ).routesById?.[(match as { routeId: string }).routeId] ??\n (match as { route?: { options?: { head?: (...args: unknown[]) => unknown } } }).route;\n const headFn = route?.options?.head;\n if (!headFn) continue;\n\n try {\n const headResult = (await headFn({\n loaderData: match.loaderData,\n matches: router.state.matches,\n match,\n params: match.params,\n })) as {\n meta?: HeadMeta[];\n links?: HeadLink[];\n scripts?: HeadScript[];\n };\n\n if (headResult?.meta) {\n for (const meta of headResult.meta) {\n metaMap.set(getMetaKey(meta), meta);\n }\n }\n if (headResult?.links) {\n for (const link of headResult.links) {\n linkMap.set(getLinkKey(link), link);\n }\n }\n if (headResult?.scripts) {\n for (const script of headResult.scripts) {\n scriptMap.set(getScriptKey(script), script);\n }\n }\n } catch (error) {\n console.warn(`[collectHeadData] head() failed for ${match.routeId}:`, error);\n }\n }\n\n return {\n meta: [...metaMap.values()],\n links: [...linkMap.values()],\n scripts: [...scriptMap.values()],\n };\n}\n"],"mappings":";AAGA,SAAgB,WAAW,MAAwB;AACjD,KAAI,CAAC,KAAM,QAAO;AAClB,KAAI,WAAW,KAAM,QAAO;AAC5B,KAAI,aAAa,KAAM,QAAO;AAC9B,KAAI,UAAU,KAAM,QAAO,QAAS,KAA0B;AAC9D,KAAI,cAAc,KAChB,QAAO,YAAa,KAA8B;AAEpD,KAAI,eAAe,KACjB,QAAO,aAAc,KAA+B;AAEtD,QAAO,KAAK,UAAU,KAAK;;AAG7B,SAAgB,WAAW,MAAwB;AAGjD,QAAO,GAFM,KAA0B,OAAO,GAEhC,GADA,KAA2B,QAAQ;;AAInD,SAAgB,aAAa,QAA4B;AACvD,KAAI,CAAC,OAAQ,QAAO;AACpB,KAAI,SAAS,UAAU,OAAO,IAAK,QAAO,OAAO,OAAO;AACxD,KAAI,cAAc,UAAU,OAAO,SACjC,QAAO,YAAY,OAAO,OAAO,aAAa,WAAW,OAAO,WAAW,KAAK,UAAU,OAAO,SAAS;AAE5G,QAAO,KAAK,UAAU,OAAO;;AAG/B,eAAsB,gBAAgB,QAAsC;AAC1E,OAAM,OAAO,MAAM;CAEnB,MAAM,0BAAU,IAAI,KAAuB;CAC3C,MAAM,0BAAU,IAAI,KAAuB;CAC3C,MAAM,4BAAY,IAAI,KAAyB;AAE/C,MAAK,MAAM,SAAS,OAAO,MAAM,SAAS;EAQxC,MAAM,UALF,OAGA,aAAc,MAA8B,YAC7C,MAA+E,QAC5D,SAAS;AAC/B,MAAI,CAAC,OAAQ;AAEb,MAAI;GACF,MAAM,aAAc,MAAM,OAAO;IAC/B,YAAY,MAAM;IAClB,SAAS,OAAO,MAAM;IACtB;IACA,QAAQ,MAAM;IACf,CAAC;AAMF,OAAI,YAAY,KACd,MAAK,MAAM,QAAQ,WAAW,KAC5B,SAAQ,IAAI,WAAW,KAAK,EAAE,KAAK;AAGvC,OAAI,YAAY,MACd,MAAK,MAAM,QAAQ,WAAW,MAC5B,SAAQ,IAAI,WAAW,KAAK,EAAE,KAAK;AAGvC,OAAI,YAAY,QACd,MAAK,MAAM,UAAU,WAAW,QAC9B,WAAU,IAAI,aAAa,OAAO,EAAE,OAAO;WAGxC,OAAO;AACd,WAAQ,KAAK,uCAAuC,MAAM,QAAQ,IAAI,MAAM;;;AAIhF,QAAO;EACL,MAAM,CAAC,GAAG,QAAQ,QAAQ,CAAC;EAC3B,OAAO,CAAC,GAAG,QAAQ,QAAQ,CAAC;EAC5B,SAAS,CAAC,GAAG,UAAU,QAAQ,CAAC;EACjC"}
@@ -0,0 +1,65 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_network = require('../network.cjs');
3
+
4
+ //#region src/ui/runtime.ts
5
+ function getRuntimeConfig() {
6
+ if (typeof window === "undefined") throw new Error("Runtime config is only available in the browser");
7
+ if (!window.__RUNTIME_CONFIG__) throw new Error("Missing runtime config");
8
+ return window.__RUNTIME_CONFIG__;
9
+ }
10
+ function getActiveRuntime(runtimeConfig) {
11
+ return runtimeConfig?.runtime;
12
+ }
13
+ function getRuntimeBasePath(runtimeConfig) {
14
+ return getActiveRuntime(runtimeConfig)?.runtimeBasePath || "/";
15
+ }
16
+ function buildRuntimeHref(pathname, runtimeConfig) {
17
+ const basePath = getRuntimeBasePath(runtimeConfig);
18
+ if (basePath === "/") return pathname;
19
+ if (!pathname.startsWith("/")) return `${basePath}/${pathname}`;
20
+ return pathname === "/" ? basePath : `${basePath}${pathname}`;
21
+ }
22
+ function buildPublishedAccountHref(accountId) {
23
+ return `/apps/${encodeURIComponent(accountId)}`;
24
+ }
25
+ function buildPublishedGatewayHref(accountId, gatewayId) {
26
+ return `${buildPublishedAccountHref(accountId)}/${encodeURIComponent(gatewayId)}`;
27
+ }
28
+ function getAssetsUrl(config) {
29
+ return (config ?? getRuntimeConfig())?.assetsUrl ?? "";
30
+ }
31
+ function getHostUrl(config) {
32
+ const cfg = config ?? getRuntimeConfig();
33
+ if (typeof window === "undefined") return "";
34
+ return cfg?.hostUrl ?? window.location.origin;
35
+ }
36
+ function getApiBaseUrl(config) {
37
+ const base = (config ?? getRuntimeConfig())?.rpcBase;
38
+ if (typeof window === "undefined") return "/api/rpc";
39
+ return base ? `${window.location.origin}${base}` : `${window.location.origin}/api/rpc`;
40
+ }
41
+ function getAccount(config) {
42
+ return (config ?? getRuntimeConfig())?.account ?? "every.near";
43
+ }
44
+ function getNetworkId(config) {
45
+ const cfg = config ?? getRuntimeConfig();
46
+ return cfg?.networkId ?? require_network.getNetworkIdForAccount(cfg?.account ?? "every.near");
47
+ }
48
+ function getRepository(config) {
49
+ return (config ?? getRuntimeConfig())?.repository;
50
+ }
51
+
52
+ //#endregion
53
+ exports.buildPublishedAccountHref = buildPublishedAccountHref;
54
+ exports.buildPublishedGatewayHref = buildPublishedGatewayHref;
55
+ exports.buildRuntimeHref = buildRuntimeHref;
56
+ exports.getAccount = getAccount;
57
+ exports.getActiveRuntime = getActiveRuntime;
58
+ exports.getApiBaseUrl = getApiBaseUrl;
59
+ exports.getAssetsUrl = getAssetsUrl;
60
+ exports.getHostUrl = getHostUrl;
61
+ exports.getNetworkId = getNetworkId;
62
+ exports.getRepository = getRepository;
63
+ exports.getRuntimeBasePath = getRuntimeBasePath;
64
+ exports.getRuntimeConfig = getRuntimeConfig;
65
+ //# sourceMappingURL=runtime.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.cjs","names":["getNetworkIdForAccount"],"sources":["../../src/ui/runtime.ts"],"sourcesContent":["import { getNetworkIdForAccount } from \"../network\";\nimport type { ClientRuntimeConfig } from \"../types\";\n\nexport type { ClientRuntimeInfo } from \"../types\";\n\ndeclare global {\n interface Window {\n __RUNTIME_CONFIG__?: ClientRuntimeConfig;\n }\n}\n\nexport function getRuntimeConfig(): ClientRuntimeConfig {\n if (typeof window === \"undefined\") {\n throw new Error(\"Runtime config is only available in the browser\");\n }\n\n if (!window.__RUNTIME_CONFIG__) {\n throw new Error(\"Missing runtime config\");\n }\n\n return window.__RUNTIME_CONFIG__;\n}\n\nexport function getActiveRuntime(runtimeConfig?: Partial<ClientRuntimeConfig>) {\n return runtimeConfig?.runtime;\n}\n\nexport function getRuntimeBasePath(runtimeConfig?: Partial<ClientRuntimeConfig>) {\n return getActiveRuntime(runtimeConfig)?.runtimeBasePath || \"/\";\n}\n\nexport function buildRuntimeHref(pathname: string, runtimeConfig?: Partial<ClientRuntimeConfig>) {\n const basePath = getRuntimeBasePath(runtimeConfig);\n if (basePath === \"/\") {\n return pathname;\n }\n\n if (!pathname.startsWith(\"/\")) {\n return `${basePath}/${pathname}`;\n }\n\n return pathname === \"/\" ? basePath : `${basePath}${pathname}`;\n}\n\nexport function buildPublishedAccountHref(accountId: string) {\n return `/apps/${encodeURIComponent(accountId)}`;\n}\n\nexport function buildPublishedGatewayHref(accountId: string, gatewayId: string) {\n return `${buildPublishedAccountHref(accountId)}/${encodeURIComponent(gatewayId)}`;\n}\n\nexport function getAssetsUrl(config?: Partial<ClientRuntimeConfig>): string {\n const cfg = config ?? getRuntimeConfig();\n return cfg?.assetsUrl ?? \"\";\n}\n\nexport function getHostUrl(config?: Partial<ClientRuntimeConfig>): string {\n const cfg = config ?? getRuntimeConfig();\n if (typeof window === \"undefined\") return \"\";\n return cfg?.hostUrl ?? window.location.origin;\n}\n\nexport function getApiBaseUrl(config?: Partial<ClientRuntimeConfig>): string {\n const cfg = config ?? getRuntimeConfig();\n const base = cfg?.rpcBase;\n if (typeof window === \"undefined\") return \"/api/rpc\";\n return base ? `${window.location.origin}${base}` : `${window.location.origin}/api/rpc`;\n}\n\nexport function getAccount(config?: Partial<ClientRuntimeConfig>): string {\n const cfg = config ?? getRuntimeConfig();\n return cfg?.account ?? \"every.near\";\n}\n\nexport function getNetworkId(config?: Partial<ClientRuntimeConfig>): \"mainnet\" | \"testnet\" {\n const cfg = config ?? getRuntimeConfig();\n return cfg?.networkId ?? getNetworkIdForAccount(cfg?.account ?? \"every.near\");\n}\n\nexport function getRepository(config?: Partial<ClientRuntimeConfig>): string | undefined {\n const cfg = config ?? getRuntimeConfig();\n return cfg?.repository;\n}\n"],"mappings":";;;;AAWA,SAAgB,mBAAwC;AACtD,KAAI,OAAO,WAAW,YACpB,OAAM,IAAI,MAAM,kDAAkD;AAGpE,KAAI,CAAC,OAAO,mBACV,OAAM,IAAI,MAAM,yBAAyB;AAG3C,QAAO,OAAO;;AAGhB,SAAgB,iBAAiB,eAA8C;AAC7E,QAAO,eAAe;;AAGxB,SAAgB,mBAAmB,eAA8C;AAC/E,QAAO,iBAAiB,cAAc,EAAE,mBAAmB;;AAG7D,SAAgB,iBAAiB,UAAkB,eAA8C;CAC/F,MAAM,WAAW,mBAAmB,cAAc;AAClD,KAAI,aAAa,IACf,QAAO;AAGT,KAAI,CAAC,SAAS,WAAW,IAAI,CAC3B,QAAO,GAAG,SAAS,GAAG;AAGxB,QAAO,aAAa,MAAM,WAAW,GAAG,WAAW;;AAGrD,SAAgB,0BAA0B,WAAmB;AAC3D,QAAO,SAAS,mBAAmB,UAAU;;AAG/C,SAAgB,0BAA0B,WAAmB,WAAmB;AAC9E,QAAO,GAAG,0BAA0B,UAAU,CAAC,GAAG,mBAAmB,UAAU;;AAGjF,SAAgB,aAAa,QAA+C;AAE1E,SADY,UAAU,kBAAkB,GAC5B,aAAa;;AAG3B,SAAgB,WAAW,QAA+C;CACxE,MAAM,MAAM,UAAU,kBAAkB;AACxC,KAAI,OAAO,WAAW,YAAa,QAAO;AAC1C,QAAO,KAAK,WAAW,OAAO,SAAS;;AAGzC,SAAgB,cAAc,QAA+C;CAE3E,MAAM,QADM,UAAU,kBAAkB,GACtB;AAClB,KAAI,OAAO,WAAW,YAAa,QAAO;AAC1C,QAAO,OAAO,GAAG,OAAO,SAAS,SAAS,SAAS,GAAG,OAAO,SAAS,OAAO;;AAG/E,SAAgB,WAAW,QAA+C;AAExE,SADY,UAAU,kBAAkB,GAC5B,WAAW;;AAGzB,SAAgB,aAAa,QAA8D;CACzF,MAAM,MAAM,UAAU,kBAAkB;AACxC,QAAO,KAAK,aAAaA,uCAAuB,KAAK,WAAW,aAAa;;AAG/E,SAAgB,cAAc,QAA2D;AAEvF,SADY,UAAU,kBAAkB,GAC5B"}
@@ -0,0 +1,29 @@
1
+ import { ClientRuntimeConfig, ClientRuntimeInfo } from "../types.cjs";
2
+
3
+ //#region src/ui/runtime.d.ts
4
+ declare global {
5
+ interface Window {
6
+ __RUNTIME_CONFIG__?: ClientRuntimeConfig;
7
+ }
8
+ }
9
+ declare function getRuntimeConfig(): ClientRuntimeConfig;
10
+ declare function getActiveRuntime(runtimeConfig?: Partial<ClientRuntimeConfig>): {
11
+ accountId: string;
12
+ gatewayId: string;
13
+ runtimeBasePath: string;
14
+ title: string | null;
15
+ hostUrl: string | null;
16
+ } | undefined;
17
+ declare function getRuntimeBasePath(runtimeConfig?: Partial<ClientRuntimeConfig>): string;
18
+ declare function buildRuntimeHref(pathname: string, runtimeConfig?: Partial<ClientRuntimeConfig>): string;
19
+ declare function buildPublishedAccountHref(accountId: string): string;
20
+ declare function buildPublishedGatewayHref(accountId: string, gatewayId: string): string;
21
+ declare function getAssetsUrl(config?: Partial<ClientRuntimeConfig>): string;
22
+ declare function getHostUrl(config?: Partial<ClientRuntimeConfig>): string;
23
+ declare function getApiBaseUrl(config?: Partial<ClientRuntimeConfig>): string;
24
+ declare function getAccount(config?: Partial<ClientRuntimeConfig>): string;
25
+ declare function getNetworkId(config?: Partial<ClientRuntimeConfig>): "mainnet" | "testnet";
26
+ declare function getRepository(config?: Partial<ClientRuntimeConfig>): string | undefined;
27
+ //#endregion
28
+ export { type ClientRuntimeInfo, buildPublishedAccountHref, buildPublishedGatewayHref, buildRuntimeHref, getAccount, getActiveRuntime, getApiBaseUrl, getAssetsUrl, getHostUrl, getNetworkId, getRepository, getRuntimeBasePath, getRuntimeConfig };
29
+ //# sourceMappingURL=runtime.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.cts","names":[],"sources":["../../src/ui/runtime.ts"],"mappings":";;;QAKQ,MAAA;EAAA,UACI,MAAA;IACR,kBAAA,GAAqB,mBAAA;EAAA;AAAA;AAAA,iBAIT,gBAAA,CAAA,GAAoB,mBAAA;AAAA,iBAYpB,gBAAA,CAAiB,aAAA,GAAgB,OAAA,CAAQ,mBAAA;;;;;;;iBAIzC,kBAAA,CAAmB,aAAA,GAAgB,OAAA,CAAQ,mBAAA;AAAA,iBAI3C,gBAAA,CAAiB,QAAA,UAAkB,aAAA,GAAgB,OAAA,CAAQ,mBAAA;AAAA,iBAa3D,yBAAA,CAA0B,SAAA;AAAA,iBAI1B,yBAAA,CAA0B,SAAA,UAAmB,SAAA;AAAA,iBAI7C,YAAA,CAAa,MAAA,GAAS,OAAA,CAAQ,mBAAA;AAAA,iBAK9B,UAAA,CAAW,MAAA,GAAS,OAAA,CAAQ,mBAAA;AAAA,iBAM5B,aAAA,CAAc,MAAA,GAAS,OAAA,CAAQ,mBAAA;AAAA,iBAO/B,UAAA,CAAW,MAAA,GAAS,OAAA,CAAQ,mBAAA;AAAA,iBAK5B,YAAA,CAAa,MAAA,GAAS,OAAA,CAAQ,mBAAA;AAAA,iBAK9B,aAAA,CAAc,MAAA,GAAS,OAAA,CAAQ,mBAAA"}
@@ -0,0 +1,29 @@
1
+ import { ClientRuntimeConfig, ClientRuntimeInfo } from "../types.mjs";
2
+
3
+ //#region src/ui/runtime.d.ts
4
+ declare global {
5
+ interface Window {
6
+ __RUNTIME_CONFIG__?: ClientRuntimeConfig;
7
+ }
8
+ }
9
+ declare function getRuntimeConfig(): ClientRuntimeConfig;
10
+ declare function getActiveRuntime(runtimeConfig?: Partial<ClientRuntimeConfig>): {
11
+ accountId: string;
12
+ gatewayId: string;
13
+ runtimeBasePath: string;
14
+ title: string | null;
15
+ hostUrl: string | null;
16
+ } | undefined;
17
+ declare function getRuntimeBasePath(runtimeConfig?: Partial<ClientRuntimeConfig>): string;
18
+ declare function buildRuntimeHref(pathname: string, runtimeConfig?: Partial<ClientRuntimeConfig>): string;
19
+ declare function buildPublishedAccountHref(accountId: string): string;
20
+ declare function buildPublishedGatewayHref(accountId: string, gatewayId: string): string;
21
+ declare function getAssetsUrl(config?: Partial<ClientRuntimeConfig>): string;
22
+ declare function getHostUrl(config?: Partial<ClientRuntimeConfig>): string;
23
+ declare function getApiBaseUrl(config?: Partial<ClientRuntimeConfig>): string;
24
+ declare function getAccount(config?: Partial<ClientRuntimeConfig>): string;
25
+ declare function getNetworkId(config?: Partial<ClientRuntimeConfig>): "mainnet" | "testnet";
26
+ declare function getRepository(config?: Partial<ClientRuntimeConfig>): string | undefined;
27
+ //#endregion
28
+ export { type ClientRuntimeInfo, buildPublishedAccountHref, buildPublishedGatewayHref, buildRuntimeHref, getAccount, getActiveRuntime, getApiBaseUrl, getAssetsUrl, getHostUrl, getNetworkId, getRepository, getRuntimeBasePath, getRuntimeConfig };
29
+ //# sourceMappingURL=runtime.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.mts","names":[],"sources":["../../src/ui/runtime.ts"],"mappings":";;;QAKQ,MAAA;EAAA,UACI,MAAA;IACR,kBAAA,GAAqB,mBAAA;EAAA;AAAA;AAAA,iBAIT,gBAAA,CAAA,GAAoB,mBAAA;AAAA,iBAYpB,gBAAA,CAAiB,aAAA,GAAgB,OAAA,CAAQ,mBAAA;;;;;;;iBAIzC,kBAAA,CAAmB,aAAA,GAAgB,OAAA,CAAQ,mBAAA;AAAA,iBAI3C,gBAAA,CAAiB,QAAA,UAAkB,aAAA,GAAgB,OAAA,CAAQ,mBAAA;AAAA,iBAa3D,yBAAA,CAA0B,SAAA;AAAA,iBAI1B,yBAAA,CAA0B,SAAA,UAAmB,SAAA;AAAA,iBAI7C,YAAA,CAAa,MAAA,GAAS,OAAA,CAAQ,mBAAA;AAAA,iBAK9B,UAAA,CAAW,MAAA,GAAS,OAAA,CAAQ,mBAAA;AAAA,iBAM5B,aAAA,CAAc,MAAA,GAAS,OAAA,CAAQ,mBAAA;AAAA,iBAO/B,UAAA,CAAW,MAAA,GAAS,OAAA,CAAQ,mBAAA;AAAA,iBAK5B,YAAA,CAAa,MAAA,GAAS,OAAA,CAAQ,mBAAA;AAAA,iBAK9B,aAAA,CAAc,MAAA,GAAS,OAAA,CAAQ,mBAAA"}
@@ -0,0 +1,53 @@
1
+ import { getNetworkIdForAccount } from "../network.mjs";
2
+
3
+ //#region src/ui/runtime.ts
4
+ function getRuntimeConfig() {
5
+ if (typeof window === "undefined") throw new Error("Runtime config is only available in the browser");
6
+ if (!window.__RUNTIME_CONFIG__) throw new Error("Missing runtime config");
7
+ return window.__RUNTIME_CONFIG__;
8
+ }
9
+ function getActiveRuntime(runtimeConfig) {
10
+ return runtimeConfig?.runtime;
11
+ }
12
+ function getRuntimeBasePath(runtimeConfig) {
13
+ return getActiveRuntime(runtimeConfig)?.runtimeBasePath || "/";
14
+ }
15
+ function buildRuntimeHref(pathname, runtimeConfig) {
16
+ const basePath = getRuntimeBasePath(runtimeConfig);
17
+ if (basePath === "/") return pathname;
18
+ if (!pathname.startsWith("/")) return `${basePath}/${pathname}`;
19
+ return pathname === "/" ? basePath : `${basePath}${pathname}`;
20
+ }
21
+ function buildPublishedAccountHref(accountId) {
22
+ return `/apps/${encodeURIComponent(accountId)}`;
23
+ }
24
+ function buildPublishedGatewayHref(accountId, gatewayId) {
25
+ return `${buildPublishedAccountHref(accountId)}/${encodeURIComponent(gatewayId)}`;
26
+ }
27
+ function getAssetsUrl(config) {
28
+ return (config ?? getRuntimeConfig())?.assetsUrl ?? "";
29
+ }
30
+ function getHostUrl(config) {
31
+ const cfg = config ?? getRuntimeConfig();
32
+ if (typeof window === "undefined") return "";
33
+ return cfg?.hostUrl ?? window.location.origin;
34
+ }
35
+ function getApiBaseUrl(config) {
36
+ const base = (config ?? getRuntimeConfig())?.rpcBase;
37
+ if (typeof window === "undefined") return "/api/rpc";
38
+ return base ? `${window.location.origin}${base}` : `${window.location.origin}/api/rpc`;
39
+ }
40
+ function getAccount(config) {
41
+ return (config ?? getRuntimeConfig())?.account ?? "every.near";
42
+ }
43
+ function getNetworkId(config) {
44
+ const cfg = config ?? getRuntimeConfig();
45
+ return cfg?.networkId ?? getNetworkIdForAccount(cfg?.account ?? "every.near");
46
+ }
47
+ function getRepository(config) {
48
+ return (config ?? getRuntimeConfig())?.repository;
49
+ }
50
+
51
+ //#endregion
52
+ export { buildPublishedAccountHref, buildPublishedGatewayHref, buildRuntimeHref, getAccount, getActiveRuntime, getApiBaseUrl, getAssetsUrl, getHostUrl, getNetworkId, getRepository, getRuntimeBasePath, getRuntimeConfig };
53
+ //# sourceMappingURL=runtime.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.mjs","names":[],"sources":["../../src/ui/runtime.ts"],"sourcesContent":["import { getNetworkIdForAccount } from \"../network\";\nimport type { ClientRuntimeConfig } from \"../types\";\n\nexport type { ClientRuntimeInfo } from \"../types\";\n\ndeclare global {\n interface Window {\n __RUNTIME_CONFIG__?: ClientRuntimeConfig;\n }\n}\n\nexport function getRuntimeConfig(): ClientRuntimeConfig {\n if (typeof window === \"undefined\") {\n throw new Error(\"Runtime config is only available in the browser\");\n }\n\n if (!window.__RUNTIME_CONFIG__) {\n throw new Error(\"Missing runtime config\");\n }\n\n return window.__RUNTIME_CONFIG__;\n}\n\nexport function getActiveRuntime(runtimeConfig?: Partial<ClientRuntimeConfig>) {\n return runtimeConfig?.runtime;\n}\n\nexport function getRuntimeBasePath(runtimeConfig?: Partial<ClientRuntimeConfig>) {\n return getActiveRuntime(runtimeConfig)?.runtimeBasePath || \"/\";\n}\n\nexport function buildRuntimeHref(pathname: string, runtimeConfig?: Partial<ClientRuntimeConfig>) {\n const basePath = getRuntimeBasePath(runtimeConfig);\n if (basePath === \"/\") {\n return pathname;\n }\n\n if (!pathname.startsWith(\"/\")) {\n return `${basePath}/${pathname}`;\n }\n\n return pathname === \"/\" ? basePath : `${basePath}${pathname}`;\n}\n\nexport function buildPublishedAccountHref(accountId: string) {\n return `/apps/${encodeURIComponent(accountId)}`;\n}\n\nexport function buildPublishedGatewayHref(accountId: string, gatewayId: string) {\n return `${buildPublishedAccountHref(accountId)}/${encodeURIComponent(gatewayId)}`;\n}\n\nexport function getAssetsUrl(config?: Partial<ClientRuntimeConfig>): string {\n const cfg = config ?? getRuntimeConfig();\n return cfg?.assetsUrl ?? \"\";\n}\n\nexport function getHostUrl(config?: Partial<ClientRuntimeConfig>): string {\n const cfg = config ?? getRuntimeConfig();\n if (typeof window === \"undefined\") return \"\";\n return cfg?.hostUrl ?? window.location.origin;\n}\n\nexport function getApiBaseUrl(config?: Partial<ClientRuntimeConfig>): string {\n const cfg = config ?? getRuntimeConfig();\n const base = cfg?.rpcBase;\n if (typeof window === \"undefined\") return \"/api/rpc\";\n return base ? `${window.location.origin}${base}` : `${window.location.origin}/api/rpc`;\n}\n\nexport function getAccount(config?: Partial<ClientRuntimeConfig>): string {\n const cfg = config ?? getRuntimeConfig();\n return cfg?.account ?? \"every.near\";\n}\n\nexport function getNetworkId(config?: Partial<ClientRuntimeConfig>): \"mainnet\" | \"testnet\" {\n const cfg = config ?? getRuntimeConfig();\n return cfg?.networkId ?? getNetworkIdForAccount(cfg?.account ?? \"every.near\");\n}\n\nexport function getRepository(config?: Partial<ClientRuntimeConfig>): string | undefined {\n const cfg = config ?? getRuntimeConfig();\n return cfg?.repository;\n}\n"],"mappings":";;;AAWA,SAAgB,mBAAwC;AACtD,KAAI,OAAO,WAAW,YACpB,OAAM,IAAI,MAAM,kDAAkD;AAGpE,KAAI,CAAC,OAAO,mBACV,OAAM,IAAI,MAAM,yBAAyB;AAG3C,QAAO,OAAO;;AAGhB,SAAgB,iBAAiB,eAA8C;AAC7E,QAAO,eAAe;;AAGxB,SAAgB,mBAAmB,eAA8C;AAC/E,QAAO,iBAAiB,cAAc,EAAE,mBAAmB;;AAG7D,SAAgB,iBAAiB,UAAkB,eAA8C;CAC/F,MAAM,WAAW,mBAAmB,cAAc;AAClD,KAAI,aAAa,IACf,QAAO;AAGT,KAAI,CAAC,SAAS,WAAW,IAAI,CAC3B,QAAO,GAAG,SAAS,GAAG;AAGxB,QAAO,aAAa,MAAM,WAAW,GAAG,WAAW;;AAGrD,SAAgB,0BAA0B,WAAmB;AAC3D,QAAO,SAAS,mBAAmB,UAAU;;AAG/C,SAAgB,0BAA0B,WAAmB,WAAmB;AAC9E,QAAO,GAAG,0BAA0B,UAAU,CAAC,GAAG,mBAAmB,UAAU;;AAGjF,SAAgB,aAAa,QAA+C;AAE1E,SADY,UAAU,kBAAkB,GAC5B,aAAa;;AAG3B,SAAgB,WAAW,QAA+C;CACxE,MAAM,MAAM,UAAU,kBAAkB;AACxC,KAAI,OAAO,WAAW,YAAa,QAAO;AAC1C,QAAO,KAAK,WAAW,OAAO,SAAS;;AAGzC,SAAgB,cAAc,QAA+C;CAE3E,MAAM,QADM,UAAU,kBAAkB,GACtB;AAClB,KAAI,OAAO,WAAW,YAAa,QAAO;AAC1C,QAAO,OAAO,GAAG,OAAO,SAAS,SAAS,SAAS,GAAG,OAAO,SAAS,OAAO;;AAG/E,SAAgB,WAAW,QAA+C;AAExE,SADY,UAAU,kBAAkB,GAC5B,WAAW;;AAGzB,SAAgB,aAAa,QAA8D;CACzF,MAAM,MAAM,UAAU,kBAAkB;AACxC,QAAO,KAAK,aAAa,uBAAuB,KAAK,WAAW,aAAa;;AAG/E,SAAgB,cAAc,QAA2D;AAEvF,SADY,UAAU,kBAAkB,GAC5B"}
File without changes
@@ -0,0 +1,52 @@
1
+ import { ClientRuntimeConfig } from "../types.cjs";
2
+ import { QueryClient } from "@tanstack/react-query";
3
+ import { AnyRouteMatch, AnyRouter, RouterHistory } from "@tanstack/react-router";
4
+
5
+ //#region src/ui/types.d.ts
6
+ interface RouterContext<TSession = unknown> {
7
+ queryClient: QueryClient;
8
+ assetsUrl: string;
9
+ runtimeConfig?: Partial<ClientRuntimeConfig>;
10
+ session?: TSession;
11
+ }
12
+ interface RouterContextWithApi<TApiClient = unknown, TSession = unknown> extends RouterContext<TSession> {
13
+ apiClient?: TApiClient;
14
+ }
15
+ interface CreateRouterOptions<TApiClient = unknown, TSession = unknown> {
16
+ history?: RouterHistory;
17
+ context?: Partial<RouterContextWithApi<TApiClient, TSession>>;
18
+ basepath?: string;
19
+ }
20
+ type HeadMeta = NonNullable<AnyRouteMatch["meta"]>[number];
21
+ type HeadLink = NonNullable<AnyRouteMatch["links"]>[number];
22
+ type HeadScript = NonNullable<AnyRouteMatch["headScripts"]>[number];
23
+ interface HeadData {
24
+ meta: HeadMeta[];
25
+ links: HeadLink[];
26
+ scripts: HeadScript[];
27
+ }
28
+ interface RenderOptions<TSession = unknown> {
29
+ assetsUrl: string;
30
+ runtimeConfig: Partial<ClientRuntimeConfig>;
31
+ basepath?: string;
32
+ session?: TSession;
33
+ }
34
+ interface RenderOptionsWithApi<TApiClient = unknown, TSession = unknown> extends RenderOptions<TSession> {
35
+ apiClient: TApiClient;
36
+ }
37
+ interface RenderResult {
38
+ stream: ReadableStream;
39
+ statusCode: number;
40
+ headers: Headers;
41
+ }
42
+ interface RouterModule<TApiClient = unknown, TSession = unknown> {
43
+ createRouter: (opts?: CreateRouterOptions<TApiClient, TSession>) => {
44
+ router: AnyRouter;
45
+ queryClient: QueryClient;
46
+ };
47
+ getRouteHead: (pathname: string, context?: Partial<RouterContextWithApi<TApiClient, TSession>>) => Promise<HeadData>;
48
+ renderToStream: (request: Request, options: RenderOptionsWithApi<TApiClient, TSession>) => Promise<RenderResult>;
49
+ }
50
+ //#endregion
51
+ export { CreateRouterOptions, HeadData, HeadLink, HeadMeta, HeadScript, RenderOptions, RenderOptionsWithApi, RenderResult, RouterContext, RouterContextWithApi, RouterModule };
52
+ //# sourceMappingURL=types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.cts","names":[],"sources":["../../src/ui/types.ts"],"mappings":";;;;;UAIiB,aAAA;EACf,WAAA,EAAa,WAAA;EACb,SAAA;EACA,aAAA,GAAgB,OAAA,CAAQ,mBAAA;EACxB,OAAA,GAAU,QAAA;AAAA;AAAA,UAGK,oBAAA,mDACP,aAAA,CAAc,QAAA;EACtB,SAAA,GAAY,UAAA;AAAA;AAAA,UAGG,mBAAA;EACf,OAAA,GAAU,aAAA;EACV,OAAA,GAAU,OAAA,CAAQ,oBAAA,CAAqB,UAAA,EAAY,QAAA;EACnD,QAAA;AAAA;AAAA,KAGU,QAAA,GAAW,WAAA,CAAY,aAAA;AAAA,KACvB,QAAA,GAAW,WAAA,CAAY,aAAA;AAAA,KACvB,UAAA,GAAa,WAAA,CAAY,aAAA;AAAA,UAEpB,QAAA;EACf,IAAA,EAAM,QAAA;EACN,KAAA,EAAO,QAAA;EACP,OAAA,EAAS,UAAA;AAAA;AAAA,UAGM,aAAA;EACf,SAAA;EACA,aAAA,EAAe,OAAA,CAAQ,mBAAA;EACvB,QAAA;EACA,OAAA,GAAU,QAAA;AAAA;AAAA,UAGK,oBAAA,mDACP,aAAA,CAAc,QAAA;EACtB,SAAA,EAAW,UAAA;AAAA;AAAA,UAGI,YAAA;EACf,MAAA,EAAQ,cAAA;EACR,UAAA;EACA,OAAA,EAAS,OAAA;AAAA;AAAA,UAGM,YAAA;EACf,YAAA,GAAe,IAAA,GAAO,mBAAA,CAAoB,UAAA,EAAY,QAAA;IACpD,MAAA,EAAQ,SAAA;IACR,WAAA,EAAa,WAAA;EAAA;EAEf,YAAA,GACE,QAAA,UACA,OAAA,GAAU,OAAA,CAAQ,oBAAA,CAAqB,UAAA,EAAY,QAAA,OAChD,OAAA,CAAQ,QAAA;EACb,cAAA,GACE,OAAA,EAAS,OAAA,EACT,OAAA,EAAS,oBAAA,CAAqB,UAAA,EAAY,QAAA,MACvC,OAAA,CAAQ,YAAA;AAAA"}
@@ -0,0 +1,52 @@
1
+ import { ClientRuntimeConfig } from "../types.mjs";
2
+ import { QueryClient } from "@tanstack/react-query";
3
+ import { AnyRouteMatch, AnyRouter, RouterHistory } from "@tanstack/react-router";
4
+
5
+ //#region src/ui/types.d.ts
6
+ interface RouterContext<TSession = unknown> {
7
+ queryClient: QueryClient;
8
+ assetsUrl: string;
9
+ runtimeConfig?: Partial<ClientRuntimeConfig>;
10
+ session?: TSession;
11
+ }
12
+ interface RouterContextWithApi<TApiClient = unknown, TSession = unknown> extends RouterContext<TSession> {
13
+ apiClient?: TApiClient;
14
+ }
15
+ interface CreateRouterOptions<TApiClient = unknown, TSession = unknown> {
16
+ history?: RouterHistory;
17
+ context?: Partial<RouterContextWithApi<TApiClient, TSession>>;
18
+ basepath?: string;
19
+ }
20
+ type HeadMeta = NonNullable<AnyRouteMatch["meta"]>[number];
21
+ type HeadLink = NonNullable<AnyRouteMatch["links"]>[number];
22
+ type HeadScript = NonNullable<AnyRouteMatch["headScripts"]>[number];
23
+ interface HeadData {
24
+ meta: HeadMeta[];
25
+ links: HeadLink[];
26
+ scripts: HeadScript[];
27
+ }
28
+ interface RenderOptions<TSession = unknown> {
29
+ assetsUrl: string;
30
+ runtimeConfig: Partial<ClientRuntimeConfig>;
31
+ basepath?: string;
32
+ session?: TSession;
33
+ }
34
+ interface RenderOptionsWithApi<TApiClient = unknown, TSession = unknown> extends RenderOptions<TSession> {
35
+ apiClient: TApiClient;
36
+ }
37
+ interface RenderResult {
38
+ stream: ReadableStream;
39
+ statusCode: number;
40
+ headers: Headers;
41
+ }
42
+ interface RouterModule<TApiClient = unknown, TSession = unknown> {
43
+ createRouter: (opts?: CreateRouterOptions<TApiClient, TSession>) => {
44
+ router: AnyRouter;
45
+ queryClient: QueryClient;
46
+ };
47
+ getRouteHead: (pathname: string, context?: Partial<RouterContextWithApi<TApiClient, TSession>>) => Promise<HeadData>;
48
+ renderToStream: (request: Request, options: RenderOptionsWithApi<TApiClient, TSession>) => Promise<RenderResult>;
49
+ }
50
+ //#endregion
51
+ export { CreateRouterOptions, HeadData, HeadLink, HeadMeta, HeadScript, RenderOptions, RenderOptionsWithApi, RenderResult, RouterContext, RouterContextWithApi, RouterModule };
52
+ //# sourceMappingURL=types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.mts","names":[],"sources":["../../src/ui/types.ts"],"mappings":";;;;;UAIiB,aAAA;EACf,WAAA,EAAa,WAAA;EACb,SAAA;EACA,aAAA,GAAgB,OAAA,CAAQ,mBAAA;EACxB,OAAA,GAAU,QAAA;AAAA;AAAA,UAGK,oBAAA,mDACP,aAAA,CAAc,QAAA;EACtB,SAAA,GAAY,UAAA;AAAA;AAAA,UAGG,mBAAA;EACf,OAAA,GAAU,aAAA;EACV,OAAA,GAAU,OAAA,CAAQ,oBAAA,CAAqB,UAAA,EAAY,QAAA;EACnD,QAAA;AAAA;AAAA,KAGU,QAAA,GAAW,WAAA,CAAY,aAAA;AAAA,KACvB,QAAA,GAAW,WAAA,CAAY,aAAA;AAAA,KACvB,UAAA,GAAa,WAAA,CAAY,aAAA;AAAA,UAEpB,QAAA;EACf,IAAA,EAAM,QAAA;EACN,KAAA,EAAO,QAAA;EACP,OAAA,EAAS,UAAA;AAAA;AAAA,UAGM,aAAA;EACf,SAAA;EACA,aAAA,EAAe,OAAA,CAAQ,mBAAA;EACvB,QAAA;EACA,OAAA,GAAU,QAAA;AAAA;AAAA,UAGK,oBAAA,mDACP,aAAA,CAAc,QAAA;EACtB,SAAA,EAAW,UAAA;AAAA;AAAA,UAGI,YAAA;EACf,MAAA,EAAQ,cAAA;EACR,UAAA;EACA,OAAA,EAAS,OAAA;AAAA;AAAA,UAGM,YAAA;EACf,YAAA,GAAe,IAAA,GAAO,mBAAA,CAAoB,UAAA,EAAY,QAAA;IACpD,MAAA,EAAQ,SAAA;IACR,WAAA,EAAa,WAAA;EAAA;EAEf,YAAA,GACE,QAAA,UACA,OAAA,GAAU,OAAA,CAAQ,oBAAA,CAAqB,UAAA,EAAY,QAAA,OAChD,OAAA,CAAQ,QAAA;EACb,cAAA,GACE,OAAA,EAAS,OAAA,EACT,OAAA,EAAS,oBAAA,CAAqB,UAAA,EAAY,QAAA,MACvC,OAAA,CAAQ,YAAA;AAAA"}
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,24 @@
1
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
+ const require_theme = require('./theme.cjs');
3
+ let node_module = require("node:module");
4
+
5
+ //#region src/utils/banner.ts
6
+ const pkg = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href)("../../package.json");
7
+ const ASCII_BOS = `
8
+ ██████╗ ██████╗ ███████╗
9
+ ██╔══██╗██╔═══██╗██╔════╝
10
+ ██████╔╝██║ ██║███████╗
11
+ ██╔══██╗██║ ██║╚════██║
12
+ ██████╔╝╚██████╔╝███████║
13
+ ╚═════╝ ╚═════╝ ╚══════╝`;
14
+ function printBanner(title = "everything-dev", version = pkg.version) {
15
+ console.log(require_theme.gradients.cyber(ASCII_BOS));
16
+ console.log();
17
+ console.log(require_theme.colors.dim(` ${title} ${require_theme.colors.cyan(`v${version}`)}`));
18
+ console.log(require_theme.colors.dim(` ${require_theme.divider(30)}`));
19
+ console.log();
20
+ }
21
+
22
+ //#endregion
23
+ exports.printBanner = printBanner;
24
+ //# sourceMappingURL=banner.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"banner.cjs","names":["gradients","colors","divider"],"sources":["../../src/utils/banner.ts"],"sourcesContent":["import { createRequire } from \"node:module\";\nimport { colors, divider, gradients } from \"./theme\";\n\nconst require = createRequire(import.meta.url);\nconst pkg = require(\"../../package.json\") as { version: string };\n\nconst ASCII_BOS = `\n ██████╗ ██████╗ ███████╗\n ██╔══██╗██╔═══██╗██╔════╝\n ██████╔╝██║ ██║███████╗\n ██╔══██╗██║ ██║╚════██║\n ██████╔╝╚██████╔╝███████║\n ╚═════╝ ╚═════╝ ╚══════╝`;\n\nexport function printBanner(title = \"everything-dev\", version = pkg.version) {\n console.log(gradients.cyber(ASCII_BOS));\n console.log();\n console.log(colors.dim(` ${title} ${colors.cyan(`v${version}`)}`));\n console.log(colors.dim(` ${divider(30)}`));\n console.log();\n}\n"],"mappings":";;;;;AAIA,MAAM,mFADwC,CAC1B,qBAAqB;AAEzC,MAAM,YAAY;;;;;;;AAQlB,SAAgB,YAAY,QAAQ,kBAAkB,UAAU,IAAI,SAAS;AAC3E,SAAQ,IAAIA,wBAAU,MAAM,UAAU,CAAC;AACvC,SAAQ,KAAK;AACb,SAAQ,IAAIC,qBAAO,IAAI,KAAK,MAAM,GAAGA,qBAAO,KAAK,IAAI,UAAU,GAAG,CAAC;AACnE,SAAQ,IAAIA,qBAAO,IAAI,KAAKC,sBAAQ,GAAG,GAAG,CAAC;AAC3C,SAAQ,KAAK"}
@@ -0,0 +1,23 @@
1
+ import { colors, divider, gradients } from "./theme.mjs";
2
+ import { createRequire } from "node:module";
3
+
4
+ //#region src/utils/banner.ts
5
+ const pkg = createRequire(import.meta.url)("../../package.json");
6
+ const ASCII_BOS = `
7
+ ██████╗ ██████╗ ███████╗
8
+ ██╔══██╗██╔═══██╗██╔════╝
9
+ ██████╔╝██║ ██║███████╗
10
+ ██╔══██╗██║ ██║╚════██║
11
+ ██████╔╝╚██████╔╝███████║
12
+ ╚═════╝ ╚═════╝ ╚══════╝`;
13
+ function printBanner(title = "everything-dev", version = pkg.version) {
14
+ console.log(gradients.cyber(ASCII_BOS));
15
+ console.log();
16
+ console.log(colors.dim(` ${title} ${colors.cyan(`v${version}`)}`));
17
+ console.log(colors.dim(` ${divider(30)}`));
18
+ console.log();
19
+ }
20
+
21
+ //#endregion
22
+ export { printBanner };
23
+ //# sourceMappingURL=banner.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"banner.mjs","names":[],"sources":["../../src/utils/banner.ts"],"sourcesContent":["import { createRequire } from \"node:module\";\nimport { colors, divider, gradients } from \"./theme\";\n\nconst require = createRequire(import.meta.url);\nconst pkg = require(\"../../package.json\") as { version: string };\n\nconst ASCII_BOS = `\n ██████╗ ██████╗ ███████╗\n ██╔══██╗██╔═══██╗██╔════╝\n ██████╔╝██║ ██║███████╗\n ██╔══██╗██║ ██║╚════██║\n ██████╔╝╚██████╔╝███████║\n ╚═════╝ ╚═════╝ ╚══════╝`;\n\nexport function printBanner(title = \"everything-dev\", version = pkg.version) {\n console.log(gradients.cyber(ASCII_BOS));\n console.log();\n console.log(colors.dim(` ${title} ${colors.cyan(`v${version}`)}`));\n console.log(colors.dim(` ${divider(30)}`));\n console.log();\n}\n"],"mappings":";;;;AAIA,MAAM,MADU,cAAc,OAAO,KAAK,IAAI,CAC1B,qBAAqB;AAEzC,MAAM,YAAY;;;;;;;AAQlB,SAAgB,YAAY,QAAQ,kBAAkB,UAAU,IAAI,SAAS;AAC3E,SAAQ,IAAI,UAAU,MAAM,UAAU,CAAC;AACvC,SAAQ,KAAK;AACb,SAAQ,IAAI,OAAO,IAAI,KAAK,MAAM,GAAG,OAAO,KAAK,IAAI,UAAU,GAAG,CAAC;AACnE,SAAQ,IAAI,OAAO,IAAI,KAAK,QAAQ,GAAG,GAAG,CAAC;AAC3C,SAAQ,KAAK"}
@@ -0,0 +1,15 @@
1
+
2
+ //#region src/utils/linkify.ts
3
+ const URL_REGEX = /https?:\/\/[^\s<>"{}|\\^`[\]]+/g;
4
+ const OSC_START = "\x1B]8;;";
5
+ const OSC_END = "\x07";
6
+ const OSC_RESET = "\x1B]8;;\x07";
7
+ const linkify = (text) => {
8
+ return text.replace(URL_REGEX, (url) => {
9
+ return `${OSC_START}${url}${OSC_END}${url}${OSC_RESET}`;
10
+ });
11
+ };
12
+
13
+ //#endregion
14
+ exports.linkify = linkify;
15
+ //# sourceMappingURL=linkify.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linkify.cjs","names":[],"sources":["../../src/utils/linkify.ts"],"sourcesContent":["const URL_REGEX = /https?:\\/\\/[^\\s<>\"{}|\\\\^`[\\]]+/g;\n\nconst OSC_START = \"\\x1b]8;;\";\nconst OSC_END = \"\\x07\";\nconst OSC_RESET = \"\\x1b]8;;\\x07\";\n\nexport const linkify = (text: string): string => {\n return text.replace(URL_REGEX, (url) => {\n return `${OSC_START}${url}${OSC_END}${url}${OSC_RESET}`;\n });\n};\n"],"mappings":";;AAAA,MAAM,YAAY;AAElB,MAAM,YAAY;AAClB,MAAM,UAAU;AAChB,MAAM,YAAY;AAElB,MAAa,WAAW,SAAyB;AAC/C,QAAO,KAAK,QAAQ,YAAY,QAAQ;AACtC,SAAO,GAAG,YAAY,MAAM,UAAU,MAAM;GAC5C"}
@@ -0,0 +1,14 @@
1
+ //#region src/utils/linkify.ts
2
+ const URL_REGEX = /https?:\/\/[^\s<>"{}|\\^`[\]]+/g;
3
+ const OSC_START = "\x1B]8;;";
4
+ const OSC_END = "\x07";
5
+ const OSC_RESET = "\x1B]8;;\x07";
6
+ const linkify = (text) => {
7
+ return text.replace(URL_REGEX, (url) => {
8
+ return `${OSC_START}${url}${OSC_END}${url}${OSC_RESET}`;
9
+ });
10
+ };
11
+
12
+ //#endregion
13
+ export { linkify };
14
+ //# sourceMappingURL=linkify.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linkify.mjs","names":[],"sources":["../../src/utils/linkify.ts"],"sourcesContent":["const URL_REGEX = /https?:\\/\\/[^\\s<>\"{}|\\\\^`[\\]]+/g;\n\nconst OSC_START = \"\\x1b]8;;\";\nconst OSC_END = \"\\x07\";\nconst OSC_RESET = \"\\x1b]8;;\\x07\";\n\nexport const linkify = (text: string): string => {\n return text.replace(URL_REGEX, (url) => {\n return `${OSC_START}${url}${OSC_END}${url}${OSC_RESET}`;\n });\n};\n"],"mappings":";AAAA,MAAM,YAAY;AAElB,MAAM,YAAY;AAClB,MAAM,UAAU;AAChB,MAAM,YAAY;AAElB,MAAa,WAAW,SAAyB;AAC/C,QAAO,KAAK,QAAQ,YAAY,QAAQ;AACtC,SAAO,GAAG,YAAY,MAAM,UAAU,MAAM;GAC5C"}
@@ -0,0 +1,40 @@
1
+
2
+ //#region src/utils/run.ts
3
+ async function run(cmd, args, options = {}) {
4
+ const proc = Bun.spawn({
5
+ cmd: [cmd, ...args],
6
+ cwd: options.cwd,
7
+ env: options.env ? {
8
+ ...process.env,
9
+ ...options.env
10
+ } : process.env,
11
+ stdio: options.capture ? [
12
+ "inherit",
13
+ "pipe",
14
+ "pipe"
15
+ ] : [
16
+ "inherit",
17
+ "inherit",
18
+ "inherit"
19
+ ]
20
+ });
21
+ if (!options.capture) {
22
+ const exitCode = await proc.exited;
23
+ if (exitCode !== 0) throw new Error(`${cmd} ${args.join(" ")} failed with exit code ${exitCode}`);
24
+ return;
25
+ }
26
+ const [stdout, stderr, exitCode] = await Promise.all([
27
+ new Response(proc.stdout).text(),
28
+ new Response(proc.stderr).text(),
29
+ proc.exited
30
+ ]);
31
+ return {
32
+ stdout,
33
+ stderr,
34
+ exitCode
35
+ };
36
+ }
37
+
38
+ //#endregion
39
+ exports.run = run;
40
+ //# sourceMappingURL=run.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.cjs","names":[],"sources":["../../src/utils/run.ts"],"sourcesContent":["type RunResult = { stdout: string; stderr: string; exitCode: number };\n\nexport async function run(\n cmd: string,\n args: string[],\n options: { cwd?: string; env?: Record<string, string>; capture?: boolean } = {},\n): Promise<RunResult | undefined> {\n const proc = Bun.spawn({\n cmd: [cmd, ...args],\n cwd: options.cwd,\n env: options.env ? { ...(process.env as Record<string, string>), ...options.env } : process.env,\n stdio: options.capture ? [\"inherit\", \"pipe\", \"pipe\"] : [\"inherit\", \"inherit\", \"inherit\"],\n });\n\n if (!options.capture) {\n const exitCode = await proc.exited;\n if (exitCode !== 0) {\n throw new Error(`${cmd} ${args.join(\" \")} failed with exit code ${exitCode}`);\n }\n return;\n }\n\n const [stdout, stderr, exitCode] = await Promise.all([\n new Response(proc.stdout).text(),\n new Response(proc.stderr).text(),\n proc.exited,\n ]);\n\n const result = { stdout, stderr, exitCode };\n return result;\n}\n"],"mappings":";;AAEA,eAAsB,IACpB,KACA,MACA,UAA6E,EAAE,EAC/C;CAChC,MAAM,OAAO,IAAI,MAAM;EACrB,KAAK,CAAC,KAAK,GAAG,KAAK;EACnB,KAAK,QAAQ;EACb,KAAK,QAAQ,MAAM;GAAE,GAAI,QAAQ;GAAgC,GAAG,QAAQ;GAAK,GAAG,QAAQ;EAC5F,OAAO,QAAQ,UAAU;GAAC;GAAW;GAAQ;GAAO,GAAG;GAAC;GAAW;GAAW;GAAU;EACzF,CAAC;AAEF,KAAI,CAAC,QAAQ,SAAS;EACpB,MAAM,WAAW,MAAM,KAAK;AAC5B,MAAI,aAAa,EACf,OAAM,IAAI,MAAM,GAAG,IAAI,GAAG,KAAK,KAAK,IAAI,CAAC,yBAAyB,WAAW;AAE/E;;CAGF,MAAM,CAAC,QAAQ,QAAQ,YAAY,MAAM,QAAQ,IAAI;EACnD,IAAI,SAAS,KAAK,OAAO,CAAC,MAAM;EAChC,IAAI,SAAS,KAAK,OAAO,CAAC,MAAM;EAChC,KAAK;EACN,CAAC;AAGF,QADe;EAAE;EAAQ;EAAQ;EAAU"}
@@ -0,0 +1,39 @@
1
+ //#region src/utils/run.ts
2
+ async function run(cmd, args, options = {}) {
3
+ const proc = Bun.spawn({
4
+ cmd: [cmd, ...args],
5
+ cwd: options.cwd,
6
+ env: options.env ? {
7
+ ...process.env,
8
+ ...options.env
9
+ } : process.env,
10
+ stdio: options.capture ? [
11
+ "inherit",
12
+ "pipe",
13
+ "pipe"
14
+ ] : [
15
+ "inherit",
16
+ "inherit",
17
+ "inherit"
18
+ ]
19
+ });
20
+ if (!options.capture) {
21
+ const exitCode = await proc.exited;
22
+ if (exitCode !== 0) throw new Error(`${cmd} ${args.join(" ")} failed with exit code ${exitCode}`);
23
+ return;
24
+ }
25
+ const [stdout, stderr, exitCode] = await Promise.all([
26
+ new Response(proc.stdout).text(),
27
+ new Response(proc.stderr).text(),
28
+ proc.exited
29
+ ]);
30
+ return {
31
+ stdout,
32
+ stderr,
33
+ exitCode
34
+ };
35
+ }
36
+
37
+ //#endregion
38
+ export { run };
39
+ //# sourceMappingURL=run.mjs.map