every-plugin 2.10.0 → 3.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (462) hide show
  1. package/bin/every-plugin-serve.mjs +12 -0
  2. package/bin/every-plugin.mjs +59 -0
  3. package/dist/_virtual/_rolldown/runtime.cjs +1 -2
  4. package/dist/build/artifact-names.cjs +119 -0
  5. package/dist/build/artifact-names.cjs.map +1 -0
  6. package/dist/build/artifact-names.d.cts +68 -0
  7. package/dist/build/artifact-names.d.cts.map +1 -0
  8. package/dist/build/artifact-names.d.mts +68 -0
  9. package/dist/build/artifact-names.d.mts.map +1 -0
  10. package/dist/build/artifact-names.mjs +102 -0
  11. package/dist/build/artifact-names.mjs.map +1 -0
  12. package/dist/build/contract-types.cjs +89 -0
  13. package/dist/build/contract-types.cjs.map +1 -0
  14. package/dist/build/contract-types.mjs +81 -0
  15. package/dist/build/contract-types.mjs.map +1 -0
  16. package/dist/build/rspack/build-report-plugin.cjs +37 -0
  17. package/dist/build/rspack/build-report-plugin.cjs.map +1 -0
  18. package/dist/build/rspack/build-report-plugin.d.cts +18 -0
  19. package/dist/build/rspack/build-report-plugin.d.cts.map +1 -0
  20. package/dist/build/rspack/build-report-plugin.d.mts +18 -0
  21. package/dist/build/rspack/build-report-plugin.d.mts.map +1 -0
  22. package/dist/build/rspack/build-report-plugin.mjs +37 -0
  23. package/dist/build/rspack/build-report-plugin.mjs.map +1 -0
  24. package/dist/build/rspack/chunk-completeness-plugin.cjs +47 -0
  25. package/dist/build/rspack/chunk-completeness-plugin.cjs.map +1 -0
  26. package/dist/build/rspack/chunk-completeness-plugin.mjs +47 -0
  27. package/dist/build/rspack/chunk-completeness-plugin.mjs.map +1 -0
  28. package/dist/build/rspack/compose.cjs +69 -0
  29. package/dist/build/rspack/compose.cjs.map +1 -0
  30. package/dist/build/rspack/compose.d.cts +20 -0
  31. package/dist/build/rspack/compose.d.cts.map +1 -0
  32. package/dist/build/rspack/compose.d.mts +20 -0
  33. package/dist/build/rspack/compose.d.mts.map +1 -0
  34. package/dist/build/rspack/compose.mjs +65 -0
  35. package/dist/build/rspack/compose.mjs.map +1 -0
  36. package/dist/build/rspack/fix-mf-data-uri-plugin.cjs +11 -11
  37. package/dist/build/rspack/fix-mf-data-uri-plugin.cjs.map +1 -1
  38. package/dist/build/rspack/fix-mf-data-uri-plugin.d.cts +2 -0
  39. package/dist/build/rspack/fix-mf-data-uri-plugin.d.cts.map +1 -1
  40. package/dist/build/rspack/fix-mf-data-uri-plugin.d.mts +2 -0
  41. package/dist/build/rspack/fix-mf-data-uri-plugin.d.mts.map +1 -1
  42. package/dist/build/rspack/fix-mf-data-uri-plugin.mjs +11 -10
  43. package/dist/build/rspack/fix-mf-data-uri-plugin.mjs.map +1 -1
  44. package/dist/build/rspack/generated-config.cjs +35 -0
  45. package/dist/build/rspack/generated-config.cjs.map +1 -0
  46. package/dist/build/rspack/generated-config.mjs +32 -0
  47. package/dist/build/rspack/generated-config.mjs.map +1 -0
  48. package/dist/build/rspack/index.cjs +8 -5
  49. package/dist/build/rspack/index.d.cts +5 -3
  50. package/dist/build/rspack/index.d.mts +5 -3
  51. package/dist/build/rspack/index.mjs +5 -3
  52. package/dist/build/rspack/module-federation.cjs +2 -2
  53. package/dist/build/rspack/module-federation.cjs.map +1 -1
  54. package/dist/build/rspack/module-federation.mjs +1 -1
  55. package/dist/build/rspack/module-federation.mjs.map +1 -1
  56. package/dist/build/rspack/plugin.cjs +44 -69
  57. package/dist/build/rspack/plugin.cjs.map +1 -1
  58. package/dist/build/rspack/plugin.d.cts +4 -13
  59. package/dist/build/rspack/plugin.d.cts.map +1 -1
  60. package/dist/build/rspack/plugin.d.mts +4 -13
  61. package/dist/build/rspack/plugin.d.mts.map +1 -1
  62. package/dist/build/rspack/plugin.mjs +44 -69
  63. package/dist/build/rspack/plugin.mjs.map +1 -1
  64. package/dist/build/rspack/utils.cjs +7 -5
  65. package/dist/build/rspack/utils.cjs.map +1 -1
  66. package/dist/build/rspack/utils.mjs +7 -6
  67. package/dist/build/rspack/utils.mjs.map +1 -1
  68. package/dist/build/ui/factory.cjs +88 -0
  69. package/dist/build/ui/factory.cjs.map +1 -0
  70. package/dist/build/ui/factory.d.cts +11 -0
  71. package/dist/build/ui/factory.d.cts.map +1 -0
  72. package/dist/build/ui/factory.d.mts +11 -0
  73. package/dist/build/ui/factory.d.mts.map +1 -0
  74. package/dist/build/ui/factory.mjs +80 -0
  75. package/dist/build/ui/factory.mjs.map +1 -0
  76. package/dist/build/ui/generated-config.cjs +118 -0
  77. package/dist/build/ui/generated-config.cjs.map +1 -0
  78. package/dist/build/ui/generated-config.d.cts +33 -0
  79. package/dist/build/ui/generated-config.d.cts.map +1 -0
  80. package/dist/build/ui/generated-config.d.mts +33 -0
  81. package/dist/build/ui/generated-config.d.mts.map +1 -0
  82. package/dist/build/ui/generated-config.mjs +111 -0
  83. package/dist/build/ui/generated-config.mjs.map +1 -0
  84. package/dist/build/ui/hash-artifacts-plugin.cjs +61 -0
  85. package/dist/build/ui/hash-artifacts-plugin.cjs.map +1 -0
  86. package/dist/build/ui/hash-artifacts-plugin.d.cts +20 -0
  87. package/dist/build/ui/hash-artifacts-plugin.d.cts.map +1 -0
  88. package/dist/build/ui/hash-artifacts-plugin.d.mts +20 -0
  89. package/dist/build/ui/hash-artifacts-plugin.d.mts.map +1 -0
  90. package/dist/build/ui/hash-artifacts-plugin.mjs +58 -0
  91. package/dist/build/ui/hash-artifacts-plugin.mjs.map +1 -0
  92. package/dist/build/ui/index.cjs +90 -0
  93. package/dist/build/ui/index.cjs.map +1 -0
  94. package/dist/build/ui/index.d.cts +29 -0
  95. package/dist/build/ui/index.d.cts.map +1 -0
  96. package/dist/build/ui/index.d.mts +29 -0
  97. package/dist/build/ui/index.d.mts.map +1 -0
  98. package/dist/build/ui/index.mjs +68 -0
  99. package/dist/build/ui/index.mjs.map +1 -0
  100. package/dist/build/ui/manifest-plugin.cjs +37 -0
  101. package/dist/build/ui/manifest-plugin.cjs.map +1 -0
  102. package/dist/build/ui/manifest-plugin.d.cts +19 -0
  103. package/dist/build/ui/manifest-plugin.d.cts.map +1 -0
  104. package/dist/build/ui/manifest-plugin.d.mts +19 -0
  105. package/dist/build/ui/manifest-plugin.d.mts.map +1 -0
  106. package/dist/build/ui/manifest-plugin.mjs +37 -0
  107. package/dist/build/ui/manifest-plugin.mjs.map +1 -0
  108. package/dist/build/ui/rsbuild-config.cjs +203 -0
  109. package/dist/build/ui/rsbuild-config.cjs.map +1 -0
  110. package/dist/build/ui/rsbuild-config.d.cts +45 -0
  111. package/dist/build/ui/rsbuild-config.d.cts.map +1 -0
  112. package/dist/build/ui/rsbuild-config.d.mts +45 -0
  113. package/dist/build/ui/rsbuild-config.d.mts.map +1 -0
  114. package/dist/build/ui/rsbuild-config.mjs +200 -0
  115. package/dist/build/ui/rsbuild-config.mjs.map +1 -0
  116. package/dist/build/ui/stubs.cjs +107 -0
  117. package/dist/build/ui/stubs.cjs.map +1 -0
  118. package/dist/build/ui/stubs.d.cts +25 -0
  119. package/dist/build/ui/stubs.d.cts.map +1 -0
  120. package/dist/build/ui/stubs.d.mts +25 -0
  121. package/dist/build/ui/stubs.d.mts.map +1 -0
  122. package/dist/build/ui/stubs.mjs +106 -0
  123. package/dist/build/ui/stubs.mjs.map +1 -0
  124. package/dist/cli.cjs +83 -0
  125. package/dist/cli.cjs.map +1 -0
  126. package/dist/cli.d.cts +6 -0
  127. package/dist/cli.d.cts.map +1 -0
  128. package/dist/cli.d.mts +6 -0
  129. package/dist/cli.d.mts.map +1 -0
  130. package/dist/cli.mjs +82 -0
  131. package/dist/cli.mjs.map +1 -0
  132. package/dist/dev/serve.cjs +390 -0
  133. package/dist/dev/serve.cjs.map +1 -0
  134. package/dist/dev/serve.d.cts +23 -0
  135. package/dist/dev/serve.d.cts.map +1 -0
  136. package/dist/dev/serve.d.mts +23 -0
  137. package/dist/dev/serve.d.mts.map +1 -0
  138. package/dist/dev/serve.mjs +384 -0
  139. package/dist/dev/serve.mjs.map +1 -0
  140. package/dist/dev/watch-kill.cjs +39 -0
  141. package/dist/dev/watch-kill.cjs.map +1 -0
  142. package/dist/dev/watch-kill.mjs +38 -0
  143. package/dist/dev/watch-kill.mjs.map +1 -0
  144. package/dist/effect-helpers.cjs +23 -0
  145. package/dist/effect-helpers.cjs.map +1 -0
  146. package/dist/effect-helpers.d.cts +20 -0
  147. package/dist/effect-helpers.d.cts.map +1 -0
  148. package/dist/effect-helpers.d.mts +20 -0
  149. package/dist/effect-helpers.d.mts.map +1 -0
  150. package/dist/effect-helpers.mjs +22 -0
  151. package/dist/effect-helpers.mjs.map +1 -0
  152. package/dist/errors.cjs +49 -69
  153. package/dist/errors.cjs.map +1 -1
  154. package/dist/errors.d.cts +13 -96
  155. package/dist/errors.d.cts.map +1 -1
  156. package/dist/errors.d.mts +13 -96
  157. package/dist/errors.d.mts.map +1 -1
  158. package/dist/errors.mjs +16 -34
  159. package/dist/errors.mjs.map +1 -1
  160. package/dist/identity.cjs +19 -0
  161. package/dist/identity.cjs.map +1 -0
  162. package/dist/identity.d.cts +33 -0
  163. package/dist/identity.d.cts.map +1 -0
  164. package/dist/identity.d.mts +33 -0
  165. package/dist/identity.d.mts.map +1 -0
  166. package/dist/identity.mjs +16 -0
  167. package/dist/identity.mjs.map +1 -0
  168. package/dist/index.cjs +8 -5
  169. package/dist/index.d.cts +8 -6
  170. package/dist/index.d.mts +8 -6
  171. package/dist/index.mjs +6 -4
  172. package/dist/plugin.cjs +12 -26
  173. package/dist/plugin.cjs.map +1 -1
  174. package/dist/plugin.d.cts +44 -25
  175. package/dist/plugin.d.cts.map +1 -1
  176. package/dist/plugin.d.mts +45 -26
  177. package/dist/plugin.d.mts.map +1 -1
  178. package/dist/plugin.mjs +15 -29
  179. package/dist/plugin.mjs.map +1 -1
  180. package/dist/remote-entry.cjs +103 -0
  181. package/dist/remote-entry.cjs.map +1 -0
  182. package/dist/remote-entry.d.cts +53 -0
  183. package/dist/remote-entry.d.cts.map +1 -0
  184. package/dist/remote-entry.d.mts +53 -0
  185. package/dist/remote-entry.d.mts.map +1 -0
  186. package/dist/remote-entry.mjs +98 -0
  187. package/dist/remote-entry.mjs.map +1 -0
  188. package/dist/runtime/errors.cjs +140 -34
  189. package/dist/runtime/errors.cjs.map +1 -1
  190. package/dist/runtime/errors.d.cts +42 -7
  191. package/dist/runtime/errors.d.cts.map +1 -1
  192. package/dist/runtime/errors.d.mts +42 -7
  193. package/dist/runtime/errors.d.mts.map +1 -1
  194. package/dist/runtime/errors.mjs +136 -31
  195. package/dist/runtime/errors.mjs.map +1 -1
  196. package/dist/runtime/index.cjs +95 -23
  197. package/dist/runtime/index.cjs.map +1 -1
  198. package/dist/runtime/index.d.cts +16 -0
  199. package/dist/runtime/index.d.cts.map +1 -1
  200. package/dist/runtime/index.d.mts +16 -0
  201. package/dist/runtime/index.d.mts.map +1 -1
  202. package/dist/runtime/index.mjs +98 -26
  203. package/dist/runtime/index.mjs.map +1 -1
  204. package/dist/runtime/mf-config.cjs +3 -78
  205. package/dist/runtime/mf-config.cjs.map +1 -1
  206. package/dist/runtime/mf-config.d.cts +3 -49
  207. package/dist/runtime/mf-config.d.cts.map +1 -1
  208. package/dist/runtime/mf-config.d.mts +3 -49
  209. package/dist/runtime/mf-config.d.mts.map +1 -1
  210. package/dist/runtime/mf-config.mjs +5 -78
  211. package/dist/runtime/mf-config.mjs.map +1 -1
  212. package/dist/runtime/services/module-federation.service.cjs +63 -12
  213. package/dist/runtime/services/module-federation.service.cjs.map +1 -1
  214. package/dist/runtime/services/module-federation.service.d.cts +4 -13
  215. package/dist/runtime/services/module-federation.service.d.mts +4 -13
  216. package/dist/runtime/services/module-federation.service.mjs +63 -14
  217. package/dist/runtime/services/module-federation.service.mjs.map +1 -1
  218. package/dist/runtime/services/normalize.cjs +2 -22
  219. package/dist/runtime/services/normalize.d.cts +2 -21
  220. package/dist/runtime/services/normalize.d.mts +2 -21
  221. package/dist/runtime/services/normalize.mjs +2 -21
  222. package/dist/runtime/services/plugin-lifecycle.service.cjs +9 -11
  223. package/dist/runtime/services/plugin-lifecycle.service.cjs.map +1 -1
  224. package/dist/runtime/services/plugin-lifecycle.service.d.cts +3 -16
  225. package/dist/runtime/services/plugin-lifecycle.service.d.mts +3 -16
  226. package/dist/runtime/services/plugin-lifecycle.service.mjs +10 -13
  227. package/dist/runtime/services/plugin-lifecycle.service.mjs.map +1 -1
  228. package/dist/runtime/services/plugin-loader.service.cjs +30 -29
  229. package/dist/runtime/services/plugin-loader.service.cjs.map +1 -1
  230. package/dist/runtime/services/plugin-loader.service.d.cts +6 -53
  231. package/dist/runtime/services/plugin-loader.service.d.mts +6 -53
  232. package/dist/runtime/services/plugin-loader.service.mjs +29 -30
  233. package/dist/runtime/services/plugin-loader.service.mjs.map +1 -1
  234. package/dist/runtime/services/plugin.service.cjs +10 -12
  235. package/dist/runtime/services/plugin.service.cjs.map +1 -1
  236. package/dist/runtime/services/plugin.service.d.cts +14 -36
  237. package/dist/runtime/services/plugin.service.d.cts.map +1 -1
  238. package/dist/runtime/services/plugin.service.d.mts +14 -36
  239. package/dist/runtime/services/plugin.service.d.mts.map +1 -1
  240. package/dist/runtime/services/plugin.service.mjs +14 -18
  241. package/dist/runtime/services/plugin.service.mjs.map +1 -1
  242. package/dist/runtime/services/secrets.service.cjs +12 -12
  243. package/dist/runtime/services/secrets.service.cjs.map +1 -1
  244. package/dist/runtime/services/secrets.service.d.cts +3 -15
  245. package/dist/runtime/services/secrets.service.d.mts +3 -15
  246. package/dist/runtime/services/secrets.service.mjs +12 -13
  247. package/dist/runtime/services/secrets.service.mjs.map +1 -1
  248. package/dist/runtime/services/shared-identity.cjs +40 -0
  249. package/dist/runtime/services/shared-identity.cjs.map +1 -0
  250. package/dist/runtime/services/shared-identity.mjs +38 -0
  251. package/dist/runtime/services/shared-identity.mjs.map +1 -0
  252. package/dist/runtime/validation.cjs +2 -2
  253. package/dist/runtime/validation.cjs.map +1 -1
  254. package/dist/runtime/validation.mjs +2 -2
  255. package/dist/runtime/validation.mjs.map +1 -1
  256. package/dist/shared-deps-spec.cjs +384 -0
  257. package/dist/shared-deps-spec.cjs.map +1 -0
  258. package/dist/shared-deps-spec.d.cts +182 -0
  259. package/dist/shared-deps-spec.d.cts.map +1 -0
  260. package/dist/shared-deps-spec.d.mts +182 -0
  261. package/dist/shared-deps-spec.d.mts.map +1 -0
  262. package/dist/shared-deps-spec.mjs +368 -0
  263. package/dist/shared-deps-spec.mjs.map +1 -0
  264. package/dist/types.d.cts +22 -41
  265. package/dist/types.d.cts.map +1 -1
  266. package/dist/types.d.mts +22 -41
  267. package/dist/types.d.mts.map +1 -1
  268. package/dist/ui/manifest/construct.cjs +268 -0
  269. package/dist/ui/manifest/construct.cjs.map +1 -0
  270. package/dist/ui/manifest/construct.d.cts +48 -0
  271. package/dist/ui/manifest/construct.d.cts.map +1 -0
  272. package/dist/ui/manifest/construct.d.mts +48 -0
  273. package/dist/ui/manifest/construct.d.mts.map +1 -0
  274. package/dist/ui/manifest/construct.mjs +268 -0
  275. package/dist/ui/manifest/construct.mjs.map +1 -0
  276. package/dist/ui/manifest/contract.cjs +34 -0
  277. package/dist/ui/manifest/contract.cjs.map +1 -0
  278. package/dist/ui/manifest/contract.d.cts +26 -0
  279. package/dist/ui/manifest/contract.d.cts.map +1 -0
  280. package/dist/ui/manifest/contract.d.mts +26 -0
  281. package/dist/ui/manifest/contract.d.mts.map +1 -0
  282. package/dist/ui/manifest/contract.mjs +26 -0
  283. package/dist/ui/manifest/contract.mjs.map +1 -0
  284. package/dist/ui/manifest/descriptor.cjs +64 -0
  285. package/dist/ui/manifest/descriptor.cjs.map +1 -0
  286. package/dist/ui/manifest/descriptor.d.cts +60 -0
  287. package/dist/ui/manifest/descriptor.d.cts.map +1 -0
  288. package/dist/ui/manifest/descriptor.d.mts +60 -0
  289. package/dist/ui/manifest/descriptor.d.mts.map +1 -0
  290. package/dist/ui/manifest/descriptor.mjs +61 -0
  291. package/dist/ui/manifest/descriptor.mjs.map +1 -0
  292. package/dist/ui/manifest/generator.cjs +128 -0
  293. package/dist/ui/manifest/generator.cjs.map +1 -0
  294. package/dist/ui/manifest/generator.d.cts +41 -0
  295. package/dist/ui/manifest/generator.d.cts.map +1 -0
  296. package/dist/ui/manifest/generator.d.mts +41 -0
  297. package/dist/ui/manifest/generator.d.mts.map +1 -0
  298. package/dist/ui/manifest/generator.mjs +125 -0
  299. package/dist/ui/manifest/generator.mjs.map +1 -0
  300. package/dist/ui/manifest/index.cjs +35 -0
  301. package/dist/ui/manifest/index.d.cts +9 -0
  302. package/dist/ui/manifest/index.d.mts +9 -0
  303. package/dist/ui/manifest/index.mjs +9 -0
  304. package/dist/ui/manifest/manifest-schema.cjs +97 -0
  305. package/dist/ui/manifest/manifest-schema.cjs.map +1 -0
  306. package/dist/ui/manifest/manifest-schema.d.cts +132 -0
  307. package/dist/ui/manifest/manifest-schema.d.cts.map +1 -0
  308. package/dist/ui/manifest/manifest-schema.d.mts +132 -0
  309. package/dist/ui/manifest/manifest-schema.d.mts.map +1 -0
  310. package/dist/ui/manifest/manifest-schema.mjs +90 -0
  311. package/dist/ui/manifest/manifest-schema.mjs.map +1 -0
  312. package/dist/ui/manifest/mount-registry.cjs +52 -0
  313. package/dist/ui/manifest/mount-registry.cjs.map +1 -0
  314. package/dist/ui/manifest/mount-registry.d.cts +61 -0
  315. package/dist/ui/manifest/mount-registry.d.cts.map +1 -0
  316. package/dist/ui/manifest/mount-registry.d.mts +61 -0
  317. package/dist/ui/manifest/mount-registry.d.mts.map +1 -0
  318. package/dist/ui/manifest/mount-registry.mjs +48 -0
  319. package/dist/ui/manifest/mount-registry.mjs.map +1 -0
  320. package/dist/ui/manifest/nav.cjs +13 -0
  321. package/dist/ui/manifest/nav.cjs.map +1 -0
  322. package/dist/ui/manifest/nav.d.cts +34 -0
  323. package/dist/ui/manifest/nav.d.cts.map +1 -0
  324. package/dist/ui/manifest/nav.d.mts +34 -0
  325. package/dist/ui/manifest/nav.d.mts.map +1 -0
  326. package/dist/ui/manifest/nav.mjs +13 -0
  327. package/dist/ui/manifest/nav.mjs.map +1 -0
  328. package/dist/ui/manifest/route-config.cjs +33 -0
  329. package/dist/ui/manifest/route-config.cjs.map +1 -0
  330. package/dist/ui/manifest/route-config.d.cts +40 -0
  331. package/dist/ui/manifest/route-config.d.cts.map +1 -0
  332. package/dist/ui/manifest/route-config.d.mts +40 -0
  333. package/dist/ui/manifest/route-config.d.mts.map +1 -0
  334. package/dist/ui/manifest/route-config.mjs +33 -0
  335. package/dist/ui/manifest/route-config.mjs.map +1 -0
  336. package/dist/version-manifest.cjs +65 -0
  337. package/dist/version-manifest.cjs.map +1 -0
  338. package/dist/version-manifest.d.cts +52 -0
  339. package/dist/version-manifest.d.cts.map +1 -0
  340. package/dist/version-manifest.d.mts +52 -0
  341. package/dist/version-manifest.d.mts.map +1 -0
  342. package/dist/version-manifest.mjs +63 -0
  343. package/dist/version-manifest.mjs.map +1 -0
  344. package/package.json +165 -68
  345. package/skills/plugin-client/SKILL.md +24 -5
  346. package/skills/plugin-development/SKILL.md +79 -47
  347. package/skills/plugin-testing/SKILL.md +41 -12
  348. package/src/build/artifact-names.ts +117 -0
  349. package/src/build/contract-types.ts +101 -0
  350. package/src/build/rspack/build-report-plugin.ts +34 -0
  351. package/src/build/rspack/chunk-completeness-plugin.ts +57 -0
  352. package/src/build/rspack/compose.ts +87 -0
  353. package/src/build/rspack/fix-mf-data-uri-plugin.ts +23 -12
  354. package/src/build/rspack/generated-config.ts +35 -0
  355. package/src/build/rspack/index.ts +10 -5
  356. package/src/build/rspack/module-federation.ts +1 -1
  357. package/src/build/rspack/plugin.ts +103 -105
  358. package/src/build/rspack/utils.ts +8 -2
  359. package/src/build/ui/factory.ts +96 -0
  360. package/src/build/ui/generated-config.ts +133 -0
  361. package/src/build/ui/hash-artifacts-plugin.ts +79 -0
  362. package/src/build/ui/index.ts +98 -0
  363. package/src/build/ui/manifest-plugin.ts +54 -0
  364. package/src/build/ui/rsbuild-config.ts +256 -0
  365. package/src/build/ui/stubs.ts +103 -0
  366. package/src/cli.ts +100 -0
  367. package/src/dev/serve.ts +477 -0
  368. package/src/dev/watch-kill.ts +58 -0
  369. package/src/effect-helpers.ts +25 -0
  370. package/src/errors.ts +16 -18
  371. package/src/identity.ts +36 -0
  372. package/src/index.ts +4 -0
  373. package/src/plugin.ts +70 -92
  374. package/src/remote-entry.ts +171 -0
  375. package/src/runtime/errors.ts +186 -27
  376. package/src/runtime/index.ts +132 -43
  377. package/src/runtime/mf-config.ts +12 -107
  378. package/src/runtime/services/module-federation.service.ts +221 -117
  379. package/src/runtime/services/normalize.ts +1 -18
  380. package/src/runtime/services/plugin-lifecycle.service.ts +66 -75
  381. package/src/runtime/services/plugin-loader.service.ts +239 -212
  382. package/src/runtime/services/plugin.service.ts +61 -43
  383. package/src/runtime/services/secrets.service.ts +20 -15
  384. package/src/runtime/services/shared-identity.ts +68 -0
  385. package/src/runtime/validation.ts +5 -7
  386. package/src/shared-deps-spec.ts +478 -0
  387. package/src/types.ts +22 -48
  388. package/src/ui/manifest/construct.ts +403 -0
  389. package/src/ui/manifest/contract.ts +33 -0
  390. package/src/ui/manifest/descriptor.ts +96 -0
  391. package/src/ui/manifest/generator.ts +238 -0
  392. package/src/ui/manifest/index.ts +55 -0
  393. package/src/ui/manifest/manifest-schema.ts +107 -0
  394. package/src/ui/manifest/mount-registry.ts +50 -0
  395. package/src/ui/manifest/nav.ts +43 -0
  396. package/src/ui/manifest/route-config.ts +82 -0
  397. package/src/version-manifest.ts +88 -0
  398. package/dist/build/rspack/dev-server-middleware.cjs +0 -194
  399. package/dist/build/rspack/dev-server-middleware.cjs.map +0 -1
  400. package/dist/build/rspack/dev-server-middleware.mjs +0 -193
  401. package/dist/build/rspack/dev-server-middleware.mjs.map +0 -1
  402. package/dist/build/shared-deps.cjs +0 -83
  403. package/dist/build/shared-deps.cjs.map +0 -1
  404. package/dist/build/shared-deps.d.cts +0 -67
  405. package/dist/build/shared-deps.d.cts.map +0 -1
  406. package/dist/build/shared-deps.d.mts +0 -67
  407. package/dist/build/shared-deps.d.mts.map +0 -1
  408. package/dist/build/shared-deps.mjs +0 -79
  409. package/dist/build/shared-deps.mjs.map +0 -1
  410. package/dist/effect.cjs +0 -9
  411. package/dist/effect.d.cts +0 -1
  412. package/dist/effect.d.mts +0 -1
  413. package/dist/effect.mjs +0 -3
  414. package/dist/orpc-openapi.cjs +0 -17
  415. package/dist/orpc-openapi.d.cts +0 -2
  416. package/dist/orpc-openapi.d.mts +0 -2
  417. package/dist/orpc-openapi.mjs +0 -5
  418. package/dist/orpc.cjs +0 -46
  419. package/dist/orpc.d.cts +0 -7
  420. package/dist/orpc.d.mts +0 -7
  421. package/dist/orpc.mjs +0 -11
  422. package/dist/package.cjs +0 -23
  423. package/dist/package.cjs.map +0 -1
  424. package/dist/package.mjs +0 -17
  425. package/dist/package.mjs.map +0 -1
  426. package/dist/runtime/services/module-federation.service.d.cts.map +0 -1
  427. package/dist/runtime/services/module-federation.service.d.mts.map +0 -1
  428. package/dist/runtime/services/normalize.cjs.map +0 -1
  429. package/dist/runtime/services/normalize.d.cts.map +0 -1
  430. package/dist/runtime/services/normalize.d.mts.map +0 -1
  431. package/dist/runtime/services/normalize.mjs.map +0 -1
  432. package/dist/runtime/services/plugin-lifecycle.service.d.cts.map +0 -1
  433. package/dist/runtime/services/plugin-lifecycle.service.d.mts.map +0 -1
  434. package/dist/runtime/services/plugin-loader.service.d.cts.map +0 -1
  435. package/dist/runtime/services/plugin-loader.service.d.mts.map +0 -1
  436. package/dist/runtime/services/secrets.service.d.cts.map +0 -1
  437. package/dist/runtime/services/secrets.service.d.mts.map +0 -1
  438. package/dist/testing/index.cjs +0 -57
  439. package/dist/testing/index.cjs.map +0 -1
  440. package/dist/testing/index.d.cts +0 -54
  441. package/dist/testing/index.d.cts.map +0 -1
  442. package/dist/testing/index.d.mts +0 -54
  443. package/dist/testing/index.d.mts.map +0 -1
  444. package/dist/testing/index.mjs +0 -55
  445. package/dist/testing/index.mjs.map +0 -1
  446. package/dist/zod-core.cjs +0 -9
  447. package/dist/zod-core.d.cts +0 -1
  448. package/dist/zod-core.d.mts +0 -1
  449. package/dist/zod-core.mjs +0 -3
  450. package/dist/zod.cjs +0 -11
  451. package/dist/zod.d.cts +0 -2
  452. package/dist/zod.d.mts +0 -2
  453. package/dist/zod.mjs +0 -3
  454. package/src/build/rspack/dev-server-middleware.ts +0 -250
  455. package/src/build/shared-deps.ts +0 -102
  456. package/src/effect.ts +0 -1
  457. package/src/orpc-openapi.ts +0 -2
  458. package/src/orpc.ts +0 -9
  459. package/src/testing/index.ts +0 -87
  460. package/src/testing/mocks/module-federation.service.ts +0 -41
  461. package/src/zod-core.ts +0 -1
  462. package/src/zod.ts +0 -3
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ import { fileURLToPath } from "node:url";
3
+
4
+ if (process.env.EVERY_PLUGIN_TSX !== "1") {
5
+ const { spawnSync } = await import("node:child_process");
6
+ const result = spawnSync(process.execPath, ["--import", "tsx", fileURLToPath(import.meta.url)], {
7
+ stdio: "inherit",
8
+ env: { ...process.env, EVERY_PLUGIN_TSX: "1" },
9
+ });
10
+ process.exit(result.status ?? 0);
11
+ }
12
+ await import("../src/dev/serve.ts");
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from "node:child_process";
3
+ import { existsSync } from "node:fs";
4
+ import { fileURLToPath } from "node:url";
5
+
6
+ const [cmd, ...args] = process.argv.slice(2);
7
+
8
+ const usage = () => console.log("Usage: every-plugin <dev|types|build|deploy|preview> [args…]");
9
+
10
+ if (!cmd || cmd === "--help" || cmd === "-h" || cmd === "help") {
11
+ usage();
12
+ process.exit(cmd ? 0 : 1);
13
+ }
14
+
15
+ const binPath = fileURLToPath(import.meta.url);
16
+ const distCli = new URL("../dist/cli.cjs", import.meta.url);
17
+
18
+ // Dev always runs the TS source through tsx with the `development` export
19
+ // condition (source-first framework resolution per ADR 0018). Everything
20
+ // else runs the built dist when it exists; a fresh checkout has no dist yet,
21
+ // so the bootstrap build falls back to tsx + src with the same condition —
22
+ // the config chain's package-internal imports resolve source over a dist
23
+ // that does not exist yet.
24
+ if (cmd === "dev" && process.env.EVERY_PLUGIN_TSX !== "1") {
25
+ const result = spawnSync(
26
+ process.execPath,
27
+ ["--import", "tsx", "--conditions=development", binPath, ...process.argv.slice(2)],
28
+ { stdio: "inherit", env: { ...process.env, EVERY_PLUGIN_TSX: "1" } },
29
+ );
30
+ process.exit(result.status ?? 0);
31
+ }
32
+
33
+ if (cmd !== "dev" && existsSync(distCli)) {
34
+ const mod = await import(distCli.href);
35
+ const runCliCommand = mod.runCliCommand ?? mod.default?.runCliCommand;
36
+ await runCliCommand(cmd, args).catch((err) => {
37
+ console.error(String(err instanceof Error ? err.message : err));
38
+ process.exit(1);
39
+ });
40
+ process.exit(0);
41
+ }
42
+
43
+ if (process.env.EVERY_PLUGIN_TSX !== "1") {
44
+ const result = spawnSync(
45
+ process.execPath,
46
+ ["--import", "tsx", "--conditions=development", binPath, ...process.argv.slice(2)],
47
+ {
48
+ stdio: "inherit",
49
+ env: { ...process.env, EVERY_PLUGIN_TSX: "1" },
50
+ },
51
+ );
52
+ process.exit(result.status ?? 0);
53
+ }
54
+
55
+ const { runCliCommand } = await import("../src/cli.ts");
56
+ await runCliCommand(cmd, args).catch((err) => {
57
+ console.error(String(err instanceof Error ? err.message : err));
58
+ process.exit(1);
59
+ });
@@ -19,11 +19,10 @@ var __copyProps = (to, from, except, desc) => {
19
19
  }
20
20
  return to;
21
21
  };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
23
23
  value: mod,
24
24
  enumerable: true
25
25
  }) : target, mod));
26
26
 
27
27
  //#endregion
28
-
29
28
  exports.__toESM = __toESM;
@@ -0,0 +1,119 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ let zod = require("zod");
4
+ let node_crypto = require("node:crypto");
5
+ node_crypto = require_runtime.__toESM(node_crypto, 1);
6
+
7
+ //#region src/build/artifact-names.ts
8
+ /** Dev-mode entry names: the in-memory dev server serves these exact names,
9
+ * and dev consumers (the host's html shell, the compose client payload, the
10
+ * readiness probe) append them — dev has no build report to discover hashed
11
+ * names from. */
12
+ const DEV_ENTRY_FILENAME = "remoteEntry.js";
13
+ const DEV_SERVER_ENTRY_FILENAME = "remoteEntry.server.js";
14
+ /** Fixed-name build outputs that get additive immutable hashed copies. */
15
+ const MF_MANIFEST_FILENAME = "mf-manifest.json";
16
+ const STYLE_FILENAME = "style.css";
17
+ const HASHED_ENTRY_PATTERN = "remoteEntry.[contenthash].js";
18
+ const HASHED_SERVER_ENTRY_PATTERN = "remoteEntry.server.[contenthash].js";
19
+ /** The dev-stack signal: everything a dev server spawns (watch or no-watch
20
+ * one-shot builds) serves the fixed dev entry names, because every dev
21
+ * consumer appends them and no build report exists to discover hashed names
22
+ * from. Every other invocation — local builds, host-test production builds,
23
+ * regression container builds, deploys — is a build and emits content-hashed
24
+ * entries + build reports. NODE_ENV cannot carry this decision (vitest runs
25
+ * as "test", bundler CLIs default "production" even for dev watches), and
26
+ * DEPLOY=true only marks deploy builds — so the dev server stamps its own
27
+ * children. */
28
+ function isBuildInvocation() {
29
+ return process.env.BOS_DEV_SERVER !== "1";
30
+ }
31
+ function uiEntryFilename(input) {
32
+ if (!input.isBuild) return input.server ? DEV_SERVER_ENTRY_FILENAME : DEV_ENTRY_FILENAME;
33
+ return input.server ? HASHED_SERVER_ENTRY_PATTERN : HASHED_ENTRY_PATTERN;
34
+ }
35
+ const HASH_SEGMENT_PATTERN = /\.[a-f0-9]{8,}\./;
36
+ /**
37
+ * Serving classification for bundle objects: anything whose name carries a
38
+ * content-hash segment (including hashed entrypoints like
39
+ * `remoteEntry.8f3a….js`) is immutable by construction; fixed-name
40
+ * entrypoints and non-hashed files a redeploy replaces in place must
41
+ * revalidate.
42
+ */
43
+ function isImmutableBundlePath(name) {
44
+ const base = name.split("/").pop() ?? name;
45
+ return HASH_SEGMENT_PATTERN.test(base);
46
+ }
47
+ function cacheControlOf(name) {
48
+ return isImmutableBundlePath(name) ? "public, max-age=31536000, immutable" : "public, max-age=0, must-revalidate";
49
+ }
50
+ /** Short content hash used to mint additive hashed copies of fixed-name artifacts. */
51
+ function contentHashOf(content) {
52
+ return node_crypto.default.createHash("sha256").update(content).digest("hex").slice(0, 16);
53
+ }
54
+ function hashedArtifactName(base, hash, ext) {
55
+ return `${base}.${hash}.${ext.replace(/^\./, "")}`;
56
+ }
57
+ /** Find the content-hashed entry asset for a base name ("remoteEntry", "remoteEntry.server"). */
58
+ function findHashedEntry(assetNames, base) {
59
+ return assetNames.find((name) => {
60
+ const rest = name.startsWith(`${base}.`) ? name.slice(base.length + 1) : null;
61
+ if (rest === null) return false;
62
+ const hash = rest.slice(0, -3);
63
+ return name.endsWith(".js") && /^[a-f0-9]{8,}$/.test(hash);
64
+ }) ?? null;
65
+ }
66
+ const BuildEntryReportSchema = zod.z.object({
67
+ entry: zod.z.string().min(1),
68
+ browserManifest: zod.z.string().min(1).optional(),
69
+ css: zod.z.string().min(1).optional()
70
+ });
71
+ /**
72
+ * The additive-copy plan for one compiled dist root: each supplied fixed-name
73
+ * artifact gets an immutable hashed copy. The hashed entry itself needs no
74
+ * copy — the build report carries its name to the deploy leg. Returns null
75
+ * when the build predates hashed entry names (only fixed names emitted).
76
+ */
77
+ function planArtifactCopies(input) {
78
+ const entry = findHashedEntry(input.assetNames, input.entryBase);
79
+ if (!entry) return null;
80
+ const copies = [];
81
+ const report = { entry };
82
+ const hashedCopy = (fixedName, reportField) => {
83
+ const content = input.contents?.[fixedName];
84
+ if (content === void 0) return;
85
+ const dot = fixedName.lastIndexOf(".");
86
+ const base = fixedName.slice(0, dot);
87
+ const ext = fixedName.slice(dot + 1);
88
+ const hashed = hashedArtifactName(base, contentHashOf(content), ext);
89
+ copies.push({
90
+ from: fixedName,
91
+ to: hashed
92
+ });
93
+ report[reportField] = hashed;
94
+ };
95
+ hashedCopy(MF_MANIFEST_FILENAME, "browserManifest");
96
+ hashedCopy(STYLE_FILENAME, "css");
97
+ return {
98
+ copies,
99
+ report
100
+ };
101
+ }
102
+
103
+ //#endregion
104
+ exports.BuildEntryReportSchema = BuildEntryReportSchema;
105
+ exports.DEV_ENTRY_FILENAME = DEV_ENTRY_FILENAME;
106
+ exports.DEV_SERVER_ENTRY_FILENAME = DEV_SERVER_ENTRY_FILENAME;
107
+ exports.HASHED_ENTRY_PATTERN = HASHED_ENTRY_PATTERN;
108
+ exports.HASHED_SERVER_ENTRY_PATTERN = HASHED_SERVER_ENTRY_PATTERN;
109
+ exports.MF_MANIFEST_FILENAME = MF_MANIFEST_FILENAME;
110
+ exports.STYLE_FILENAME = STYLE_FILENAME;
111
+ exports.cacheControlOf = cacheControlOf;
112
+ exports.contentHashOf = contentHashOf;
113
+ exports.findHashedEntry = findHashedEntry;
114
+ exports.hashedArtifactName = hashedArtifactName;
115
+ exports.isBuildInvocation = isBuildInvocation;
116
+ exports.isImmutableBundlePath = isImmutableBundlePath;
117
+ exports.planArtifactCopies = planArtifactCopies;
118
+ exports.uiEntryFilename = uiEntryFilename;
119
+ //# sourceMappingURL=artifact-names.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact-names.cjs","names":["crypto","z"],"sources":["../../src/build/artifact-names.ts"],"sourcesContent":["import crypto from \"node:crypto\";\nimport { z } from \"zod\";\n\n/** Dev-mode entry names: the in-memory dev server serves these exact names,\n * and dev consumers (the host's html shell, the compose client payload, the\n * readiness probe) append them — dev has no build report to discover hashed\n * names from. */\nexport const DEV_ENTRY_FILENAME = \"remoteEntry.js\";\nexport const DEV_SERVER_ENTRY_FILENAME = \"remoteEntry.server.js\";\n/** Fixed-name build outputs that get additive immutable hashed copies. */\nexport const MF_MANIFEST_FILENAME = \"mf-manifest.json\";\nexport const STYLE_FILENAME = \"style.css\";\nexport const HASHED_ENTRY_PATTERN = \"remoteEntry.[contenthash].js\";\nexport const HASHED_SERVER_ENTRY_PATTERN = \"remoteEntry.server.[contenthash].js\";\n\n/** The dev-stack signal: everything a dev server spawns (watch or no-watch\n * one-shot builds) serves the fixed dev entry names, because every dev\n * consumer appends them and no build report exists to discover hashed names\n * from. Every other invocation — local builds, host-test production builds,\n * regression container builds, deploys — is a build and emits content-hashed\n * entries + build reports. NODE_ENV cannot carry this decision (vitest runs\n * as \"test\", bundler CLIs default \"production\" even for dev watches), and\n * DEPLOY=true only marks deploy builds — so the dev server stamps its own\n * children. */\nexport function isBuildInvocation(): boolean {\n return process.env.BOS_DEV_SERVER !== \"1\";\n}\n\nexport function uiEntryFilename(input: { isBuild: boolean; server?: boolean }): string {\n if (!input.isBuild) return input.server ? DEV_SERVER_ENTRY_FILENAME : DEV_ENTRY_FILENAME;\n return input.server ? HASHED_SERVER_ENTRY_PATTERN : HASHED_ENTRY_PATTERN;\n}\n\nconst HASH_SEGMENT_PATTERN = /\\.[a-f0-9]{8,}\\./;\n\n/**\n * Serving classification for bundle objects: anything whose name carries a\n * content-hash segment (including hashed entrypoints like\n * `remoteEntry.8f3a….js`) is immutable by construction; fixed-name\n * entrypoints and non-hashed files a redeploy replaces in place must\n * revalidate.\n */\nexport function isImmutableBundlePath(name: string): boolean {\n const base = name.split(\"/\").pop() ?? name;\n return HASH_SEGMENT_PATTERN.test(base);\n}\n\nexport function cacheControlOf(name: string): string {\n return isImmutableBundlePath(name)\n ? \"public, max-age=31536000, immutable\"\n : \"public, max-age=0, must-revalidate\";\n}\n\n/** Short content hash used to mint additive hashed copies of fixed-name artifacts. */\nexport function contentHashOf(content: string | Uint8Array): string {\n return crypto.createHash(\"sha256\").update(content).digest(\"hex\").slice(0, 16);\n}\n\nexport function hashedArtifactName(base: string, hash: string, ext: string): string {\n return `${base}.${hash}.${ext.replace(/^\\./, \"\")}`;\n}\n\n/** Find the content-hashed entry asset for a base name (\"remoteEntry\", \"remoteEntry.server\"). */\nexport function findHashedEntry(assetNames: string[], base: string): string | null {\n const hashed = assetNames.find((name) => {\n const rest = name.startsWith(`${base}.`) ? name.slice(base.length + 1) : null;\n if (rest === null) return false;\n const hash = rest.slice(0, -3);\n return name.endsWith(\".js\") && /^[a-f0-9]{8,}$/.test(hash);\n });\n return hashed ?? null;\n}\n\nexport const BuildEntryReportSchema = z.object({\n entry: z.string().min(1),\n browserManifest: z.string().min(1).optional(),\n css: z.string().min(1).optional(),\n});\nexport type BuildEntryReport = z.infer<typeof BuildEntryReportSchema>;\n\nexport interface ArtifactCopy {\n from: string;\n to: string;\n}\n\n/**\n * The additive-copy plan for one compiled dist root: each supplied fixed-name\n * artifact gets an immutable hashed copy. The hashed entry itself needs no\n * copy — the build report carries its name to the deploy leg. Returns null\n * when the build predates hashed entry names (only fixed names emitted).\n */\nexport function planArtifactCopies(input: {\n assetNames: string[];\n entryBase: string;\n contents?: Record<string, string | Uint8Array | undefined>;\n}): { copies: Array<ArtifactCopy>; report: BuildEntryReport } | null {\n const entry = findHashedEntry(input.assetNames, input.entryBase);\n if (!entry) return null;\n\n const copies: Array<ArtifactCopy> = [];\n const report: BuildEntryReport = { entry };\n\n const hashedCopy = (fixedName: string, reportField: \"browserManifest\" | \"css\") => {\n const content = input.contents?.[fixedName];\n if (content === undefined) return;\n const dot = fixedName.lastIndexOf(\".\");\n const base = fixedName.slice(0, dot);\n const ext = fixedName.slice(dot + 1);\n const hashed = hashedArtifactName(base, contentHashOf(content), ext);\n copies.push({ from: fixedName, to: hashed });\n report[reportField] = hashed;\n };\n hashedCopy(MF_MANIFEST_FILENAME, \"browserManifest\");\n hashedCopy(STYLE_FILENAME, \"css\");\n\n return { copies, report };\n}\n"],"mappings":";;;;;;;;;;;AAOA,MAAa,qBAAqB;AAClC,MAAa,4BAA4B;;AAEzC,MAAa,uBAAuB;AACpC,MAAa,iBAAiB;AAC9B,MAAa,uBAAuB;AACpC,MAAa,8BAA8B;;;;;;;;;;AAW3C,SAAgB,oBAA6B;CAC3C,OAAO,QAAQ,IAAI,mBAAmB;AACxC;AAEA,SAAgB,gBAAgB,OAAuD;CACrF,IAAI,CAAC,MAAM,SAAS,OAAO,MAAM,SAAS,4BAA4B;CACtE,OAAO,MAAM,SAAS,8BAA8B;AACtD;AAEA,MAAM,uBAAuB;;;;;;;;AAS7B,SAAgB,sBAAsB,MAAuB;CAC3D,MAAM,OAAO,KAAK,MAAM,GAAG,CAAC,CAAC,IAAI,KAAK;CACtC,OAAO,qBAAqB,KAAK,IAAI;AACvC;AAEA,SAAgB,eAAe,MAAsB;CACnD,OAAO,sBAAsB,IAAI,IAC7B,wCACA;AACN;;AAGA,SAAgB,cAAc,SAAsC;CAClE,OAAOA,oBAAO,WAAW,QAAQ,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,GAAG,EAAE;AAC9E;AAEA,SAAgB,mBAAmB,MAAc,MAAc,KAAqB;CAClF,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,IAAI,QAAQ,OAAO,EAAE;AACjD;;AAGA,SAAgB,gBAAgB,YAAsB,MAA6B;CAOjF,OANe,WAAW,MAAM,SAAS;EACvC,MAAM,OAAO,KAAK,WAAW,GAAG,KAAK,EAAE,IAAI,KAAK,MAAM,KAAK,SAAS,CAAC,IAAI;EACzE,IAAI,SAAS,MAAM,OAAO;EAC1B,MAAM,OAAO,KAAK,MAAM,GAAG,EAAE;EAC7B,OAAO,KAAK,SAAS,KAAK,KAAK,iBAAiB,KAAK,IAAI;CAC3D,CACY,KAAK;AACnB;AAEA,MAAa,yBAAyBC,MAAE,OAAO;CAC7C,OAAOA,MAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACvB,iBAAiBA,MAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;CAC5C,KAAKA,MAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;AAClC,CAAC;;;;;;;AAcD,SAAgB,mBAAmB,OAIkC;CACnE,MAAM,QAAQ,gBAAgB,MAAM,YAAY,MAAM,SAAS;CAC/D,IAAI,CAAC,OAAO,OAAO;CAEnB,MAAM,SAA8B,CAAC;CACrC,MAAM,SAA2B,EAAE,MAAM;CAEzC,MAAM,cAAc,WAAmB,gBAA2C;EAChF,MAAM,UAAU,MAAM,WAAW;EACjC,IAAI,YAAY,QAAW;EAC3B,MAAM,MAAM,UAAU,YAAY,GAAG;EACrC,MAAM,OAAO,UAAU,MAAM,GAAG,GAAG;EACnC,MAAM,MAAM,UAAU,MAAM,MAAM,CAAC;EACnC,MAAM,SAAS,mBAAmB,MAAM,cAAc,OAAO,GAAG,GAAG;EACnE,OAAO,KAAK;GAAE,MAAM;GAAW,IAAI;EAAO,CAAC;EAC3C,OAAO,eAAe;CACxB;CACA,WAAW,sBAAsB,iBAAiB;CAClD,WAAW,gBAAgB,KAAK;CAEhC,OAAO;EAAE;EAAQ;CAAO;AAC1B"}
@@ -0,0 +1,68 @@
1
+ import { z } from "zod";
2
+ //#region src/build/artifact-names.d.ts
3
+ /** Dev-mode entry names: the in-memory dev server serves these exact names,
4
+ * and dev consumers (the host's html shell, the compose client payload, the
5
+ * readiness probe) append them — dev has no build report to discover hashed
6
+ * names from. */
7
+ declare const DEV_ENTRY_FILENAME = "remoteEntry.js";
8
+ declare const DEV_SERVER_ENTRY_FILENAME = "remoteEntry.server.js";
9
+ /** Fixed-name build outputs that get additive immutable hashed copies. */
10
+ declare const MF_MANIFEST_FILENAME = "mf-manifest.json";
11
+ declare const STYLE_FILENAME = "style.css";
12
+ declare const HASHED_ENTRY_PATTERN = "remoteEntry.[contenthash].js";
13
+ declare const HASHED_SERVER_ENTRY_PATTERN = "remoteEntry.server.[contenthash].js";
14
+ /** The dev-stack signal: everything a dev server spawns (watch or no-watch
15
+ * one-shot builds) serves the fixed dev entry names, because every dev
16
+ * consumer appends them and no build report exists to discover hashed names
17
+ * from. Every other invocation — local builds, host-test production builds,
18
+ * regression container builds, deploys — is a build and emits content-hashed
19
+ * entries + build reports. NODE_ENV cannot carry this decision (vitest runs
20
+ * as "test", bundler CLIs default "production" even for dev watches), and
21
+ * DEPLOY=true only marks deploy builds — so the dev server stamps its own
22
+ * children. */
23
+ declare function isBuildInvocation(): boolean;
24
+ declare function uiEntryFilename(input: {
25
+ isBuild: boolean;
26
+ server?: boolean;
27
+ }): string;
28
+ /**
29
+ * Serving classification for bundle objects: anything whose name carries a
30
+ * content-hash segment (including hashed entrypoints like
31
+ * `remoteEntry.8f3a….js`) is immutable by construction; fixed-name
32
+ * entrypoints and non-hashed files a redeploy replaces in place must
33
+ * revalidate.
34
+ */
35
+ declare function isImmutableBundlePath(name: string): boolean;
36
+ declare function cacheControlOf(name: string): string;
37
+ /** Short content hash used to mint additive hashed copies of fixed-name artifacts. */
38
+ declare function contentHashOf(content: string | Uint8Array): string;
39
+ declare function hashedArtifactName(base: string, hash: string, ext: string): string;
40
+ /** Find the content-hashed entry asset for a base name ("remoteEntry", "remoteEntry.server"). */
41
+ declare function findHashedEntry(assetNames: string[], base: string): string | null;
42
+ declare const BuildEntryReportSchema: z.ZodObject<{
43
+ entry: z.ZodString;
44
+ browserManifest: z.ZodOptional<z.ZodString>;
45
+ css: z.ZodOptional<z.ZodString>;
46
+ }, z.core.$strip>;
47
+ type BuildEntryReport = z.infer<typeof BuildEntryReportSchema>;
48
+ interface ArtifactCopy {
49
+ from: string;
50
+ to: string;
51
+ }
52
+ /**
53
+ * The additive-copy plan for one compiled dist root: each supplied fixed-name
54
+ * artifact gets an immutable hashed copy. The hashed entry itself needs no
55
+ * copy — the build report carries its name to the deploy leg. Returns null
56
+ * when the build predates hashed entry names (only fixed names emitted).
57
+ */
58
+ declare function planArtifactCopies(input: {
59
+ assetNames: string[];
60
+ entryBase: string;
61
+ contents?: Record<string, string | Uint8Array | undefined>;
62
+ }): {
63
+ copies: Array<ArtifactCopy>;
64
+ report: BuildEntryReport;
65
+ } | null;
66
+ //#endregion
67
+ export { ArtifactCopy, BuildEntryReport, BuildEntryReportSchema, DEV_ENTRY_FILENAME, DEV_SERVER_ENTRY_FILENAME, HASHED_ENTRY_PATTERN, HASHED_SERVER_ENTRY_PATTERN, MF_MANIFEST_FILENAME, STYLE_FILENAME, cacheControlOf, contentHashOf, findHashedEntry, hashedArtifactName, isBuildInvocation, isImmutableBundlePath, planArtifactCopies, uiEntryFilename };
68
+ //# sourceMappingURL=artifact-names.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact-names.d.cts","names":[],"sources":["../../src/build/artifact-names.ts"],"mappings":";;;;;;cAOa;cACA;;cAEA;cACA;cACA;cACA;;;;;;;;;;iBAWG;iBAIA,gBAAgB;EAAS;EAAkB;;;;;;;;;iBAc3C,sBAAsB;iBAKtB,eAAe;;iBAOf,cAAc,kBAAkB;iBAIhC,mBAAmB,cAAc,cAAc;;iBAK/C,gBAAgB,sBAAsB;cAUzC,wBAAsB,EAAA;;;;GAIjC,EAAA,KAAA;KACU,mBAAmB,EAAE,aAAa;UAE7B;EACf;EACA;;;;;;;;iBASc,mBAAmB;EACjC;EACA;EACA,WAAW,wBAAwB;;EAC/B,QAAQ,MAAM;EAAe,QAAQ"}
@@ -0,0 +1,68 @@
1
+ import { z } from "zod";
2
+ //#region src/build/artifact-names.d.ts
3
+ /** Dev-mode entry names: the in-memory dev server serves these exact names,
4
+ * and dev consumers (the host's html shell, the compose client payload, the
5
+ * readiness probe) append them — dev has no build report to discover hashed
6
+ * names from. */
7
+ declare const DEV_ENTRY_FILENAME = "remoteEntry.js";
8
+ declare const DEV_SERVER_ENTRY_FILENAME = "remoteEntry.server.js";
9
+ /** Fixed-name build outputs that get additive immutable hashed copies. */
10
+ declare const MF_MANIFEST_FILENAME = "mf-manifest.json";
11
+ declare const STYLE_FILENAME = "style.css";
12
+ declare const HASHED_ENTRY_PATTERN = "remoteEntry.[contenthash].js";
13
+ declare const HASHED_SERVER_ENTRY_PATTERN = "remoteEntry.server.[contenthash].js";
14
+ /** The dev-stack signal: everything a dev server spawns (watch or no-watch
15
+ * one-shot builds) serves the fixed dev entry names, because every dev
16
+ * consumer appends them and no build report exists to discover hashed names
17
+ * from. Every other invocation — local builds, host-test production builds,
18
+ * regression container builds, deploys — is a build and emits content-hashed
19
+ * entries + build reports. NODE_ENV cannot carry this decision (vitest runs
20
+ * as "test", bundler CLIs default "production" even for dev watches), and
21
+ * DEPLOY=true only marks deploy builds — so the dev server stamps its own
22
+ * children. */
23
+ declare function isBuildInvocation(): boolean;
24
+ declare function uiEntryFilename(input: {
25
+ isBuild: boolean;
26
+ server?: boolean;
27
+ }): string;
28
+ /**
29
+ * Serving classification for bundle objects: anything whose name carries a
30
+ * content-hash segment (including hashed entrypoints like
31
+ * `remoteEntry.8f3a….js`) is immutable by construction; fixed-name
32
+ * entrypoints and non-hashed files a redeploy replaces in place must
33
+ * revalidate.
34
+ */
35
+ declare function isImmutableBundlePath(name: string): boolean;
36
+ declare function cacheControlOf(name: string): string;
37
+ /** Short content hash used to mint additive hashed copies of fixed-name artifacts. */
38
+ declare function contentHashOf(content: string | Uint8Array): string;
39
+ declare function hashedArtifactName(base: string, hash: string, ext: string): string;
40
+ /** Find the content-hashed entry asset for a base name ("remoteEntry", "remoteEntry.server"). */
41
+ declare function findHashedEntry(assetNames: string[], base: string): string | null;
42
+ declare const BuildEntryReportSchema: z.ZodObject<{
43
+ entry: z.ZodString;
44
+ browserManifest: z.ZodOptional<z.ZodString>;
45
+ css: z.ZodOptional<z.ZodString>;
46
+ }, z.core.$strip>;
47
+ type BuildEntryReport = z.infer<typeof BuildEntryReportSchema>;
48
+ interface ArtifactCopy {
49
+ from: string;
50
+ to: string;
51
+ }
52
+ /**
53
+ * The additive-copy plan for one compiled dist root: each supplied fixed-name
54
+ * artifact gets an immutable hashed copy. The hashed entry itself needs no
55
+ * copy — the build report carries its name to the deploy leg. Returns null
56
+ * when the build predates hashed entry names (only fixed names emitted).
57
+ */
58
+ declare function planArtifactCopies(input: {
59
+ assetNames: string[];
60
+ entryBase: string;
61
+ contents?: Record<string, string | Uint8Array | undefined>;
62
+ }): {
63
+ copies: Array<ArtifactCopy>;
64
+ report: BuildEntryReport;
65
+ } | null;
66
+ //#endregion
67
+ export { ArtifactCopy, BuildEntryReport, BuildEntryReportSchema, DEV_ENTRY_FILENAME, DEV_SERVER_ENTRY_FILENAME, HASHED_ENTRY_PATTERN, HASHED_SERVER_ENTRY_PATTERN, MF_MANIFEST_FILENAME, STYLE_FILENAME, cacheControlOf, contentHashOf, findHashedEntry, hashedArtifactName, isBuildInvocation, isImmutableBundlePath, planArtifactCopies, uiEntryFilename };
68
+ //# sourceMappingURL=artifact-names.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact-names.d.mts","names":[],"sources":["../../src/build/artifact-names.ts"],"mappings":";;;;;;cAOa;cACA;;cAEA;cACA;cACA;cACA;;;;;;;;;;iBAWG;iBAIA,gBAAgB;EAAS;EAAkB;;;;;;;;;iBAc3C,sBAAsB;iBAKtB,eAAe;;iBAOf,cAAc,kBAAkB;iBAIhC,mBAAmB,cAAc,cAAc;;iBAK/C,gBAAgB,sBAAsB;cAUzC,wBAAsB,EAAA;;;;GAIjC,EAAA,KAAA;KACU,mBAAmB,EAAE,aAAa;UAE7B;EACf;EACA;;;;;;;;iBASc,mBAAmB;EACjC;EACA;EACA,WAAW,wBAAwB;;EAC/B,QAAQ,MAAM;EAAe,QAAQ"}
@@ -0,0 +1,102 @@
1
+ import { z } from "zod";
2
+ import crypto from "node:crypto";
3
+
4
+ //#region src/build/artifact-names.ts
5
+ /** Dev-mode entry names: the in-memory dev server serves these exact names,
6
+ * and dev consumers (the host's html shell, the compose client payload, the
7
+ * readiness probe) append them — dev has no build report to discover hashed
8
+ * names from. */
9
+ const DEV_ENTRY_FILENAME = "remoteEntry.js";
10
+ const DEV_SERVER_ENTRY_FILENAME = "remoteEntry.server.js";
11
+ /** Fixed-name build outputs that get additive immutable hashed copies. */
12
+ const MF_MANIFEST_FILENAME = "mf-manifest.json";
13
+ const STYLE_FILENAME = "style.css";
14
+ const HASHED_ENTRY_PATTERN = "remoteEntry.[contenthash].js";
15
+ const HASHED_SERVER_ENTRY_PATTERN = "remoteEntry.server.[contenthash].js";
16
+ /** The dev-stack signal: everything a dev server spawns (watch or no-watch
17
+ * one-shot builds) serves the fixed dev entry names, because every dev
18
+ * consumer appends them and no build report exists to discover hashed names
19
+ * from. Every other invocation — local builds, host-test production builds,
20
+ * regression container builds, deploys — is a build and emits content-hashed
21
+ * entries + build reports. NODE_ENV cannot carry this decision (vitest runs
22
+ * as "test", bundler CLIs default "production" even for dev watches), and
23
+ * DEPLOY=true only marks deploy builds — so the dev server stamps its own
24
+ * children. */
25
+ function isBuildInvocation() {
26
+ return process.env.BOS_DEV_SERVER !== "1";
27
+ }
28
+ function uiEntryFilename(input) {
29
+ if (!input.isBuild) return input.server ? DEV_SERVER_ENTRY_FILENAME : DEV_ENTRY_FILENAME;
30
+ return input.server ? HASHED_SERVER_ENTRY_PATTERN : HASHED_ENTRY_PATTERN;
31
+ }
32
+ const HASH_SEGMENT_PATTERN = /\.[a-f0-9]{8,}\./;
33
+ /**
34
+ * Serving classification for bundle objects: anything whose name carries a
35
+ * content-hash segment (including hashed entrypoints like
36
+ * `remoteEntry.8f3a….js`) is immutable by construction; fixed-name
37
+ * entrypoints and non-hashed files a redeploy replaces in place must
38
+ * revalidate.
39
+ */
40
+ function isImmutableBundlePath(name) {
41
+ const base = name.split("/").pop() ?? name;
42
+ return HASH_SEGMENT_PATTERN.test(base);
43
+ }
44
+ function cacheControlOf(name) {
45
+ return isImmutableBundlePath(name) ? "public, max-age=31536000, immutable" : "public, max-age=0, must-revalidate";
46
+ }
47
+ /** Short content hash used to mint additive hashed copies of fixed-name artifacts. */
48
+ function contentHashOf(content) {
49
+ return crypto.createHash("sha256").update(content).digest("hex").slice(0, 16);
50
+ }
51
+ function hashedArtifactName(base, hash, ext) {
52
+ return `${base}.${hash}.${ext.replace(/^\./, "")}`;
53
+ }
54
+ /** Find the content-hashed entry asset for a base name ("remoteEntry", "remoteEntry.server"). */
55
+ function findHashedEntry(assetNames, base) {
56
+ return assetNames.find((name) => {
57
+ const rest = name.startsWith(`${base}.`) ? name.slice(base.length + 1) : null;
58
+ if (rest === null) return false;
59
+ const hash = rest.slice(0, -3);
60
+ return name.endsWith(".js") && /^[a-f0-9]{8,}$/.test(hash);
61
+ }) ?? null;
62
+ }
63
+ const BuildEntryReportSchema = z.object({
64
+ entry: z.string().min(1),
65
+ browserManifest: z.string().min(1).optional(),
66
+ css: z.string().min(1).optional()
67
+ });
68
+ /**
69
+ * The additive-copy plan for one compiled dist root: each supplied fixed-name
70
+ * artifact gets an immutable hashed copy. The hashed entry itself needs no
71
+ * copy — the build report carries its name to the deploy leg. Returns null
72
+ * when the build predates hashed entry names (only fixed names emitted).
73
+ */
74
+ function planArtifactCopies(input) {
75
+ const entry = findHashedEntry(input.assetNames, input.entryBase);
76
+ if (!entry) return null;
77
+ const copies = [];
78
+ const report = { entry };
79
+ const hashedCopy = (fixedName, reportField) => {
80
+ const content = input.contents?.[fixedName];
81
+ if (content === void 0) return;
82
+ const dot = fixedName.lastIndexOf(".");
83
+ const base = fixedName.slice(0, dot);
84
+ const ext = fixedName.slice(dot + 1);
85
+ const hashed = hashedArtifactName(base, contentHashOf(content), ext);
86
+ copies.push({
87
+ from: fixedName,
88
+ to: hashed
89
+ });
90
+ report[reportField] = hashed;
91
+ };
92
+ hashedCopy(MF_MANIFEST_FILENAME, "browserManifest");
93
+ hashedCopy(STYLE_FILENAME, "css");
94
+ return {
95
+ copies,
96
+ report
97
+ };
98
+ }
99
+
100
+ //#endregion
101
+ export { BuildEntryReportSchema, DEV_ENTRY_FILENAME, DEV_SERVER_ENTRY_FILENAME, HASHED_ENTRY_PATTERN, HASHED_SERVER_ENTRY_PATTERN, MF_MANIFEST_FILENAME, STYLE_FILENAME, cacheControlOf, contentHashOf, findHashedEntry, hashedArtifactName, isBuildInvocation, isImmutableBundlePath, planArtifactCopies, uiEntryFilename };
102
+ //# sourceMappingURL=artifact-names.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact-names.mjs","names":[],"sources":["../../src/build/artifact-names.ts"],"sourcesContent":["import crypto from \"node:crypto\";\nimport { z } from \"zod\";\n\n/** Dev-mode entry names: the in-memory dev server serves these exact names,\n * and dev consumers (the host's html shell, the compose client payload, the\n * readiness probe) append them — dev has no build report to discover hashed\n * names from. */\nexport const DEV_ENTRY_FILENAME = \"remoteEntry.js\";\nexport const DEV_SERVER_ENTRY_FILENAME = \"remoteEntry.server.js\";\n/** Fixed-name build outputs that get additive immutable hashed copies. */\nexport const MF_MANIFEST_FILENAME = \"mf-manifest.json\";\nexport const STYLE_FILENAME = \"style.css\";\nexport const HASHED_ENTRY_PATTERN = \"remoteEntry.[contenthash].js\";\nexport const HASHED_SERVER_ENTRY_PATTERN = \"remoteEntry.server.[contenthash].js\";\n\n/** The dev-stack signal: everything a dev server spawns (watch or no-watch\n * one-shot builds) serves the fixed dev entry names, because every dev\n * consumer appends them and no build report exists to discover hashed names\n * from. Every other invocation — local builds, host-test production builds,\n * regression container builds, deploys — is a build and emits content-hashed\n * entries + build reports. NODE_ENV cannot carry this decision (vitest runs\n * as \"test\", bundler CLIs default \"production\" even for dev watches), and\n * DEPLOY=true only marks deploy builds — so the dev server stamps its own\n * children. */\nexport function isBuildInvocation(): boolean {\n return process.env.BOS_DEV_SERVER !== \"1\";\n}\n\nexport function uiEntryFilename(input: { isBuild: boolean; server?: boolean }): string {\n if (!input.isBuild) return input.server ? DEV_SERVER_ENTRY_FILENAME : DEV_ENTRY_FILENAME;\n return input.server ? HASHED_SERVER_ENTRY_PATTERN : HASHED_ENTRY_PATTERN;\n}\n\nconst HASH_SEGMENT_PATTERN = /\\.[a-f0-9]{8,}\\./;\n\n/**\n * Serving classification for bundle objects: anything whose name carries a\n * content-hash segment (including hashed entrypoints like\n * `remoteEntry.8f3a….js`) is immutable by construction; fixed-name\n * entrypoints and non-hashed files a redeploy replaces in place must\n * revalidate.\n */\nexport function isImmutableBundlePath(name: string): boolean {\n const base = name.split(\"/\").pop() ?? name;\n return HASH_SEGMENT_PATTERN.test(base);\n}\n\nexport function cacheControlOf(name: string): string {\n return isImmutableBundlePath(name)\n ? \"public, max-age=31536000, immutable\"\n : \"public, max-age=0, must-revalidate\";\n}\n\n/** Short content hash used to mint additive hashed copies of fixed-name artifacts. */\nexport function contentHashOf(content: string | Uint8Array): string {\n return crypto.createHash(\"sha256\").update(content).digest(\"hex\").slice(0, 16);\n}\n\nexport function hashedArtifactName(base: string, hash: string, ext: string): string {\n return `${base}.${hash}.${ext.replace(/^\\./, \"\")}`;\n}\n\n/** Find the content-hashed entry asset for a base name (\"remoteEntry\", \"remoteEntry.server\"). */\nexport function findHashedEntry(assetNames: string[], base: string): string | null {\n const hashed = assetNames.find((name) => {\n const rest = name.startsWith(`${base}.`) ? name.slice(base.length + 1) : null;\n if (rest === null) return false;\n const hash = rest.slice(0, -3);\n return name.endsWith(\".js\") && /^[a-f0-9]{8,}$/.test(hash);\n });\n return hashed ?? null;\n}\n\nexport const BuildEntryReportSchema = z.object({\n entry: z.string().min(1),\n browserManifest: z.string().min(1).optional(),\n css: z.string().min(1).optional(),\n});\nexport type BuildEntryReport = z.infer<typeof BuildEntryReportSchema>;\n\nexport interface ArtifactCopy {\n from: string;\n to: string;\n}\n\n/**\n * The additive-copy plan for one compiled dist root: each supplied fixed-name\n * artifact gets an immutable hashed copy. The hashed entry itself needs no\n * copy — the build report carries its name to the deploy leg. Returns null\n * when the build predates hashed entry names (only fixed names emitted).\n */\nexport function planArtifactCopies(input: {\n assetNames: string[];\n entryBase: string;\n contents?: Record<string, string | Uint8Array | undefined>;\n}): { copies: Array<ArtifactCopy>; report: BuildEntryReport } | null {\n const entry = findHashedEntry(input.assetNames, input.entryBase);\n if (!entry) return null;\n\n const copies: Array<ArtifactCopy> = [];\n const report: BuildEntryReport = { entry };\n\n const hashedCopy = (fixedName: string, reportField: \"browserManifest\" | \"css\") => {\n const content = input.contents?.[fixedName];\n if (content === undefined) return;\n const dot = fixedName.lastIndexOf(\".\");\n const base = fixedName.slice(0, dot);\n const ext = fixedName.slice(dot + 1);\n const hashed = hashedArtifactName(base, contentHashOf(content), ext);\n copies.push({ from: fixedName, to: hashed });\n report[reportField] = hashed;\n };\n hashedCopy(MF_MANIFEST_FILENAME, \"browserManifest\");\n hashedCopy(STYLE_FILENAME, \"css\");\n\n return { copies, report };\n}\n"],"mappings":";;;;;;;;AAOA,MAAa,qBAAqB;AAClC,MAAa,4BAA4B;;AAEzC,MAAa,uBAAuB;AACpC,MAAa,iBAAiB;AAC9B,MAAa,uBAAuB;AACpC,MAAa,8BAA8B;;;;;;;;;;AAW3C,SAAgB,oBAA6B;CAC3C,OAAO,QAAQ,IAAI,mBAAmB;AACxC;AAEA,SAAgB,gBAAgB,OAAuD;CACrF,IAAI,CAAC,MAAM,SAAS,OAAO,MAAM,SAAS,4BAA4B;CACtE,OAAO,MAAM,SAAS,8BAA8B;AACtD;AAEA,MAAM,uBAAuB;;;;;;;;AAS7B,SAAgB,sBAAsB,MAAuB;CAC3D,MAAM,OAAO,KAAK,MAAM,GAAG,CAAC,CAAC,IAAI,KAAK;CACtC,OAAO,qBAAqB,KAAK,IAAI;AACvC;AAEA,SAAgB,eAAe,MAAsB;CACnD,OAAO,sBAAsB,IAAI,IAC7B,wCACA;AACN;;AAGA,SAAgB,cAAc,SAAsC;CAClE,OAAO,OAAO,WAAW,QAAQ,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,GAAG,EAAE;AAC9E;AAEA,SAAgB,mBAAmB,MAAc,MAAc,KAAqB;CAClF,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,IAAI,QAAQ,OAAO,EAAE;AACjD;;AAGA,SAAgB,gBAAgB,YAAsB,MAA6B;CAOjF,OANe,WAAW,MAAM,SAAS;EACvC,MAAM,OAAO,KAAK,WAAW,GAAG,KAAK,EAAE,IAAI,KAAK,MAAM,KAAK,SAAS,CAAC,IAAI;EACzE,IAAI,SAAS,MAAM,OAAO;EAC1B,MAAM,OAAO,KAAK,MAAM,GAAG,EAAE;EAC7B,OAAO,KAAK,SAAS,KAAK,KAAK,iBAAiB,KAAK,IAAI;CAC3D,CACY,KAAK;AACnB;AAEA,MAAa,yBAAyB,EAAE,OAAO;CAC7C,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACvB,iBAAiB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;CAC5C,KAAK,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;AAClC,CAAC;;;;;;;AAcD,SAAgB,mBAAmB,OAIkC;CACnE,MAAM,QAAQ,gBAAgB,MAAM,YAAY,MAAM,SAAS;CAC/D,IAAI,CAAC,OAAO,OAAO;CAEnB,MAAM,SAA8B,CAAC;CACrC,MAAM,SAA2B,EAAE,MAAM;CAEzC,MAAM,cAAc,WAAmB,gBAA2C;EAChF,MAAM,UAAU,MAAM,WAAW;EACjC,IAAI,YAAY,QAAW;EAC3B,MAAM,MAAM,UAAU,YAAY,GAAG;EACrC,MAAM,OAAO,UAAU,MAAM,GAAG,GAAG;EACnC,MAAM,MAAM,UAAU,MAAM,MAAM,CAAC;EACnC,MAAM,SAAS,mBAAmB,MAAM,cAAc,OAAO,GAAG,GAAG;EACnE,OAAO,KAAK;GAAE,MAAM;GAAW,IAAI;EAAO,CAAC;EAC3C,OAAO,eAAe;CACxB;CACA,WAAW,sBAAsB,iBAAiB;CAClD,WAAW,gBAAgB,KAAK;CAEhC,OAAO;EAAE;EAAQ;CAAO;AAC1B"}
@@ -0,0 +1,89 @@
1
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
+ let node_fs = require("node:fs");
3
+ node_fs = require_runtime.__toESM(node_fs, 1);
4
+ let node_module = require("node:module");
5
+ let node_path = require("node:path");
6
+ node_path = require_runtime.__toESM(node_path, 1);
7
+ let node_child_process = require("node:child_process");
8
+ let node_util = require("node:util");
9
+
10
+ //#region src/build/contract-types.ts
11
+ const execFileAsync = (0, node_util.promisify)(node_child_process.execFile);
12
+ const CONTRACT_ENTRY = node_path.default.join("src", "contract.ts");
13
+ const CONTRACT_TYPES_DIR = "types";
14
+ const CONTRACT_TYPES_FILE = node_path.default.join("types", "contract.d.ts");
15
+ function contractTypesUpToDate(cwd) {
16
+ const entry = node_path.default.join(cwd, CONTRACT_ENTRY);
17
+ const outFile = node_path.default.join(cwd, CONTRACT_TYPES_FILE);
18
+ if (!node_fs.default.existsSync(entry) || !node_fs.default.existsSync(outFile)) return false;
19
+ return node_fs.default.statSync(outFile).mtimeMs >= node_fs.default.statSync(entry).mtimeMs;
20
+ }
21
+ function resolveTscBinary(cwd) {
22
+ for (const from of [node_path.default.join(cwd, "package.json"), node_path.default.join(__dirname, "..", "..", "..", "package.json")]) try {
23
+ const pkgJsonPath = (0, node_module.createRequire)(node_path.default.resolve(from)).resolve("typescript/package.json");
24
+ return node_path.default.join(node_path.default.dirname(pkgJsonPath), "bin", "tsc");
25
+ } catch {}
26
+ return "tsc";
27
+ }
28
+ /**
29
+ * Regenerates types/contract.d.ts for a plugin workspace by invoking the
30
+ * workspace's TypeScript 7 binary with explicit flags — no tsconfig file
31
+ * involved, so emit layout is deterministic and there is nothing to sync.
32
+ *
33
+ * - "skipped": the workspace has no src/contract.ts
34
+ * - "up-to-date": types/contract.d.ts is newer than src/contract.ts
35
+ * - "generated": declarations were re-emitted (types/ is cleaned first, so
36
+ * stale nested layouts never survive)
37
+ */
38
+ async function generateContractTypes(cwd = process.cwd()) {
39
+ const entry = node_path.default.join(cwd, CONTRACT_ENTRY);
40
+ if (!node_fs.default.existsSync(entry)) return "skipped";
41
+ if (contractTypesUpToDate(cwd)) return "up-to-date";
42
+ const outDir = node_path.default.join(cwd, CONTRACT_TYPES_DIR);
43
+ node_fs.default.rmSync(outDir, {
44
+ recursive: true,
45
+ force: true
46
+ });
47
+ node_fs.default.mkdirSync(outDir, { recursive: true });
48
+ const tsc = resolveTscBinary(cwd);
49
+ const args = [
50
+ "--ignoreConfig",
51
+ "--emitDeclarationOnly",
52
+ "--declaration",
53
+ "--rootDir",
54
+ "src",
55
+ "--outDir",
56
+ CONTRACT_TYPES_DIR,
57
+ "--target",
58
+ "esnext",
59
+ "--module",
60
+ "esnext",
61
+ "--moduleResolution",
62
+ "bundler",
63
+ "--strict",
64
+ "--skipLibCheck",
65
+ CONTRACT_ENTRY
66
+ ];
67
+ try {
68
+ await execFileAsync(process.execPath, [tsc, ...args], { cwd });
69
+ } catch (error) {
70
+ const err = error;
71
+ const detail = [
72
+ err.stderr,
73
+ err.stdout,
74
+ err.message
75
+ ].filter(Boolean).join("\n").trim();
76
+ throw new Error(`Contract type generation failed for ${node_path.default.basename(cwd)} — tsc exited non-zero:\n${detail}`);
77
+ }
78
+ if (!node_fs.default.existsSync(node_path.default.join(cwd, CONTRACT_TYPES_FILE))) throw new Error(`Contract type generation produced no output — expected ${node_path.default.join(cwd, CONTRACT_TYPES_FILE)}`);
79
+ return "generated";
80
+ }
81
+
82
+ //#endregion
83
+ exports.CONTRACT_ENTRY = CONTRACT_ENTRY;
84
+ exports.CONTRACT_TYPES_DIR = CONTRACT_TYPES_DIR;
85
+ exports.CONTRACT_TYPES_FILE = CONTRACT_TYPES_FILE;
86
+ exports.contractTypesUpToDate = contractTypesUpToDate;
87
+ exports.generateContractTypes = generateContractTypes;
88
+ exports.resolveTscBinary = resolveTscBinary;
89
+ //# sourceMappingURL=contract-types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract-types.cjs","names":["promisify","execFile","path","fs","createRequire"],"sources":["../../src/build/contract-types.ts"],"sourcesContent":["import { execFile } from \"node:child_process\";\nimport fs from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport { promisify } from \"node:util\";\n\nconst execFileAsync = promisify(execFile);\n\nexport type ContractTypesStatus = \"generated\" | \"up-to-date\" | \"skipped\";\n\nexport const CONTRACT_ENTRY = path.join(\"src\", \"contract.ts\");\nexport const CONTRACT_TYPES_DIR = \"types\";\nexport const CONTRACT_TYPES_FILE = path.join(\"types\", \"contract.d.ts\");\n\nexport function contractTypesUpToDate(cwd: string): boolean {\n const entry = path.join(cwd, CONTRACT_ENTRY);\n const outFile = path.join(cwd, CONTRACT_TYPES_FILE);\n if (!fs.existsSync(entry) || !fs.existsSync(outFile)) return false;\n return fs.statSync(outFile).mtimeMs >= fs.statSync(entry).mtimeMs;\n}\n\nexport function resolveTscBinary(cwd: string): string {\n for (const from of [\n path.join(cwd, \"package.json\"),\n path.join(import.meta.dirname, \"..\", \"..\", \"..\", \"package.json\"),\n ]) {\n try {\n const req = createRequire(path.resolve(from));\n const pkgJsonPath = req.resolve(\"typescript/package.json\");\n return path.join(path.dirname(pkgJsonPath), \"bin\", \"tsc\");\n } catch {\n // try the next resolution root\n }\n }\n return \"tsc\";\n}\n\n/**\n * Regenerates types/contract.d.ts for a plugin workspace by invoking the\n * workspace's TypeScript 7 binary with explicit flags — no tsconfig file\n * involved, so emit layout is deterministic and there is nothing to sync.\n *\n * - \"skipped\": the workspace has no src/contract.ts\n * - \"up-to-date\": types/contract.d.ts is newer than src/contract.ts\n * - \"generated\": declarations were re-emitted (types/ is cleaned first, so\n * stale nested layouts never survive)\n */\nexport async function generateContractTypes(\n cwd: string = process.cwd(),\n): Promise<ContractTypesStatus> {\n const entry = path.join(cwd, CONTRACT_ENTRY);\n if (!fs.existsSync(entry)) {\n return \"skipped\";\n }\n\n if (contractTypesUpToDate(cwd)) {\n return \"up-to-date\";\n }\n\n const outDir = path.join(cwd, CONTRACT_TYPES_DIR);\n fs.rmSync(outDir, { recursive: true, force: true });\n fs.mkdirSync(outDir, { recursive: true });\n\n const tsc = resolveTscBinary(cwd);\n const args = [\n \"--ignoreConfig\",\n \"--emitDeclarationOnly\",\n \"--declaration\",\n \"--rootDir\",\n \"src\",\n \"--outDir\",\n CONTRACT_TYPES_DIR,\n \"--target\",\n \"esnext\",\n \"--module\",\n \"esnext\",\n \"--moduleResolution\",\n \"bundler\",\n \"--strict\",\n \"--skipLibCheck\",\n CONTRACT_ENTRY,\n ];\n\n try {\n await execFileAsync(process.execPath, [tsc, ...args], { cwd });\n } catch (error) {\n const err = error as { message?: string; stdout?: string; stderr?: string };\n const detail = [err.stderr, err.stdout, err.message].filter(Boolean).join(\"\\n\").trim();\n throw new Error(\n `Contract type generation failed for ${path.basename(cwd)} — tsc exited non-zero:\\n${detail}`,\n );\n }\n\n if (!fs.existsSync(path.join(cwd, CONTRACT_TYPES_FILE))) {\n throw new Error(\n `Contract type generation produced no output — expected ${path.join(cwd, CONTRACT_TYPES_FILE)}`,\n );\n }\n\n return \"generated\";\n}\n"],"mappings":";;;;;;;;;;AAMA,MAAM,oBAAgBA,qBAAUC,2BAAQ;AAIxC,MAAa,iBAAiBC,kBAAK,KAAK,OAAO,aAAa;AAC5D,MAAa,qBAAqB;AAClC,MAAa,sBAAsBA,kBAAK,KAAK,SAAS,eAAe;AAErE,SAAgB,sBAAsB,KAAsB;CAC1D,MAAM,QAAQA,kBAAK,KAAK,KAAK,cAAc;CAC3C,MAAM,UAAUA,kBAAK,KAAK,KAAK,mBAAmB;CAClD,IAAI,CAACC,gBAAG,WAAW,KAAK,KAAK,CAACA,gBAAG,WAAW,OAAO,GAAG,OAAO;CAC7D,OAAOA,gBAAG,SAAS,OAAO,CAAC,CAAC,WAAWA,gBAAG,SAAS,KAAK,CAAC,CAAC;AAC5D;AAEA,SAAgB,iBAAiB,KAAqB;CACpD,KAAK,MAAM,QAAQ,CACjBD,kBAAK,KAAK,KAAK,cAAc,GAC7BA,kBAAK,gBAA0B,MAAM,MAAM,MAAM,cAAc,CACjE,GACE,IAAI;EAEF,MAAM,kBADME,2BAAcF,kBAAK,QAAQ,IAAI,CACrB,CAAC,CAAC,QAAQ,yBAAyB;EACzD,OAAOA,kBAAK,KAAKA,kBAAK,QAAQ,WAAW,GAAG,OAAO,KAAK;CAC1D,QAAQ,CAER;CAEF,OAAO;AACT;;;;;;;;;;;AAYA,eAAsB,sBACpB,MAAc,QAAQ,IAAI,GACI;CAC9B,MAAM,QAAQA,kBAAK,KAAK,KAAK,cAAc;CAC3C,IAAI,CAACC,gBAAG,WAAW,KAAK,GACtB,OAAO;CAGT,IAAI,sBAAsB,GAAG,GAC3B,OAAO;CAGT,MAAM,SAASD,kBAAK,KAAK,KAAK,kBAAkB;CAChD,gBAAG,OAAO,QAAQ;EAAE,WAAW;EAAM,OAAO;CAAK,CAAC;CAClD,gBAAG,UAAU,QAAQ,EAAE,WAAW,KAAK,CAAC;CAExC,MAAM,MAAM,iBAAiB,GAAG;CAChC,MAAM,OAAO;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CAEA,IAAI;EACF,MAAM,cAAc,QAAQ,UAAU,CAAC,KAAK,GAAG,IAAI,GAAG,EAAE,IAAI,CAAC;CAC/D,SAAS,OAAO;EACd,MAAM,MAAM;EACZ,MAAM,SAAS;GAAC,IAAI;GAAQ,IAAI;GAAQ,IAAI;EAAO,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK;EACrF,MAAM,IAAI,MACR,uCAAuCA,kBAAK,SAAS,GAAG,EAAE,2BAA2B,QACvF;CACF;CAEA,IAAI,CAACC,gBAAG,WAAWD,kBAAK,KAAK,KAAK,mBAAmB,CAAC,GACpD,MAAM,IAAI,MACR,0DAA0DA,kBAAK,KAAK,KAAK,mBAAmB,GAC9F;CAGF,OAAO;AACT"}