@hyperfrontend/builder 0.1.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 (561) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/FUNDING.md +141 -0
  3. package/LICENSE.md +21 -0
  4. package/README.md +162 -0
  5. package/SECURITY.md +82 -0
  6. package/THIRD_PARTY_LICENSES.md +13 -0
  7. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/array/index.cjs.js +7 -0
  8. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/array/index.esm.js +5 -0
  9. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/console/index.cjs.js +13 -0
  10. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/console/index.esm.js +8 -0
  11. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/date/index.cjs.js +5 -0
  12. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/date/index.esm.js +4 -0
  13. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/encoding/index.cjs.js +1 -0
  14. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/encoding/index.esm.js +1 -0
  15. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/error/index.cjs.js +6 -0
  16. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/error/index.esm.js +5 -0
  17. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/function/index.cjs.js +1 -0
  18. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/function/index.esm.js +1 -0
  19. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/json/index.cjs.js +7 -0
  20. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/json/index.esm.js +5 -0
  21. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/map/index.cjs.js +6 -0
  22. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/map/index.esm.js +5 -0
  23. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/math/index.cjs.js +7 -0
  24. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/math/index.esm.js +5 -0
  25. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/messaging/index.cjs.js +1 -0
  26. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/messaging/index.esm.js +1 -0
  27. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/number/index.cjs.js +1 -0
  28. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/number/index.esm.js +1 -0
  29. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/object/index.cjs.js +13 -0
  30. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/object/index.esm.js +8 -0
  31. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/promise/index.cjs.js +6 -0
  32. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/promise/index.esm.js +5 -0
  33. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/reflect/index.cjs.js +1 -0
  34. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/reflect/index.esm.js +1 -0
  35. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/regexp/index.cjs.js +6 -0
  36. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/regexp/index.esm.js +5 -0
  37. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/set/index.cjs.js +6 -0
  38. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/set/index.esm.js +5 -0
  39. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/string/index.cjs.js +1 -0
  40. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/string/index.esm.js +1 -0
  41. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/symbol/index.cjs.js +1 -0
  42. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/symbol/index.esm.js +1 -0
  43. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/timers/index.cjs.js +13 -0
  44. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/timers/index.esm.js +10 -0
  45. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/typed-arrays/index.cjs.js +1 -0
  46. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/typed-arrays/index.esm.js +1 -0
  47. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/url/index.cjs.js +6 -0
  48. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/url/index.esm.js +5 -0
  49. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/weak-map/index.cjs.js +1 -0
  50. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/weak-map/index.esm.js +1 -0
  51. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/weak-set/index.cjs.js +1 -0
  52. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/weak-set/index.esm.js +1 -0
  53. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/websocket/index.cjs.js +1 -0
  54. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/websocket/index.esm.js +1 -0
  55. package/_dependencies/@hyperfrontend/immutable-api-utils/index.cjs.js +1 -0
  56. package/_dependencies/@hyperfrontend/immutable-api-utils/index.esm.js +1 -0
  57. package/_dependencies/@hyperfrontend/immutable-api-utils/locked/index.cjs.js +1 -0
  58. package/_dependencies/@hyperfrontend/immutable-api-utils/locked/index.esm.js +1 -0
  59. package/_dependencies/@hyperfrontend/immutable-api-utils/locked-prop-descriptors/index.cjs.js +1 -0
  60. package/_dependencies/@hyperfrontend/immutable-api-utils/locked-prop-descriptors/index.esm.js +1 -0
  61. package/_dependencies/@hyperfrontend/immutable-api-utils/locked-props/index.cjs.js +1 -0
  62. package/_dependencies/@hyperfrontend/immutable-api-utils/locked-props/index.esm.js +1 -0
  63. package/_dependencies/@hyperfrontend/logging/index.cjs.js +191 -0
  64. package/_dependencies/@hyperfrontend/logging/index.esm.js +186 -0
  65. package/_dependencies/@hyperfrontend/project-scope/cli/index.cjs.js +196 -0
  66. package/_dependencies/@hyperfrontend/project-scope/cli/index.esm.js +196 -0
  67. package/_dependencies/@hyperfrontend/project-scope/core/encoding/index.cjs.js +82 -0
  68. package/_dependencies/@hyperfrontend/project-scope/core/encoding/index.esm.js +82 -0
  69. package/_dependencies/@hyperfrontend/project-scope/core/fs/index.cjs.js +154 -0
  70. package/_dependencies/@hyperfrontend/project-scope/core/fs/index.esm.js +149 -0
  71. package/_dependencies/@hyperfrontend/project-scope/core/index.cjs.js +459 -0
  72. package/_dependencies/@hyperfrontend/project-scope/core/index.esm.js +440 -0
  73. package/_dependencies/@hyperfrontend/project-scope/core/logger/index.cjs.js +84 -0
  74. package/_dependencies/@hyperfrontend/project-scope/core/logger/index.esm.js +80 -0
  75. package/_dependencies/@hyperfrontend/project-scope/core/path/index.cjs.js +26 -0
  76. package/_dependencies/@hyperfrontend/project-scope/core/path/index.esm.js +22 -0
  77. package/_dependencies/@hyperfrontend/project-scope/core/platform/index.cjs.js +1 -0
  78. package/_dependencies/@hyperfrontend/project-scope/core/platform/index.esm.js +1 -0
  79. package/_dependencies/@hyperfrontend/project-scope/heuristics/dependencies/index.cjs.js +90 -0
  80. package/_dependencies/@hyperfrontend/project-scope/heuristics/dependencies/index.esm.js +90 -0
  81. package/_dependencies/@hyperfrontend/project-scope/heuristics/entry-points/index.cjs.js +174 -0
  82. package/_dependencies/@hyperfrontend/project-scope/heuristics/entry-points/index.esm.js +174 -0
  83. package/_dependencies/@hyperfrontend/project-scope/heuristics/framework/index.cjs.js +174 -0
  84. package/_dependencies/@hyperfrontend/project-scope/heuristics/framework/index.esm.js +172 -0
  85. package/_dependencies/@hyperfrontend/project-scope/heuristics/index.cjs.js +184 -0
  86. package/_dependencies/@hyperfrontend/project-scope/heuristics/index.esm.js +184 -0
  87. package/_dependencies/@hyperfrontend/project-scope/heuristics/project-type/index.cjs.js +172 -0
  88. package/_dependencies/@hyperfrontend/project-scope/heuristics/project-type/index.esm.js +172 -0
  89. package/_dependencies/@hyperfrontend/project-scope/index.cjs.js +222 -0
  90. package/_dependencies/@hyperfrontend/project-scope/index.esm.js +219 -0
  91. package/_dependencies/@hyperfrontend/project-scope/models/index.cjs.js +2 -0
  92. package/_dependencies/@hyperfrontend/project-scope/models/index.esm.js +1 -0
  93. package/_dependencies/@hyperfrontend/project-scope/nx/index.cjs.js +94 -0
  94. package/_dependencies/@hyperfrontend/project-scope/nx/index.esm.js +94 -0
  95. package/_dependencies/@hyperfrontend/project-scope/project/config/index.cjs.js +172 -0
  96. package/_dependencies/@hyperfrontend/project-scope/project/config/index.esm.js +172 -0
  97. package/_dependencies/@hyperfrontend/project-scope/project/index.cjs.js +176 -0
  98. package/_dependencies/@hyperfrontend/project-scope/project/index.esm.js +176 -0
  99. package/_dependencies/@hyperfrontend/project-scope/project/package/index.cjs.js +88 -0
  100. package/_dependencies/@hyperfrontend/project-scope/project/package/index.esm.js +88 -0
  101. package/_dependencies/@hyperfrontend/project-scope/project/root/index.cjs.js +154 -0
  102. package/_dependencies/@hyperfrontend/project-scope/project/root/index.esm.js +153 -0
  103. package/_dependencies/@hyperfrontend/project-scope/project/traversal/index.cjs.js +91 -0
  104. package/_dependencies/@hyperfrontend/project-scope/project/traversal/index.esm.js +89 -0
  105. package/_dependencies/@hyperfrontend/project-scope/tech/backend/index.cjs.js +88 -0
  106. package/_dependencies/@hyperfrontend/project-scope/tech/backend/index.esm.js +88 -0
  107. package/_dependencies/@hyperfrontend/project-scope/tech/build/index.cjs.js +88 -0
  108. package/_dependencies/@hyperfrontend/project-scope/tech/build/index.esm.js +88 -0
  109. package/_dependencies/@hyperfrontend/project-scope/tech/frontend/index.cjs.js +88 -0
  110. package/_dependencies/@hyperfrontend/project-scope/tech/frontend/index.esm.js +88 -0
  111. package/_dependencies/@hyperfrontend/project-scope/tech/index.cjs.js +171 -0
  112. package/_dependencies/@hyperfrontend/project-scope/tech/index.esm.js +169 -0
  113. package/_dependencies/@hyperfrontend/project-scope/tech/legacy/index.cjs.js +88 -0
  114. package/_dependencies/@hyperfrontend/project-scope/tech/legacy/index.esm.js +88 -0
  115. package/_dependencies/@hyperfrontend/project-scope/tech/linting/index.cjs.js +88 -0
  116. package/_dependencies/@hyperfrontend/project-scope/tech/linting/index.esm.js +88 -0
  117. package/_dependencies/@hyperfrontend/project-scope/tech/monorepo/index.cjs.js +88 -0
  118. package/_dependencies/@hyperfrontend/project-scope/tech/monorepo/index.esm.js +88 -0
  119. package/_dependencies/@hyperfrontend/project-scope/tech/testing/index.cjs.js +88 -0
  120. package/_dependencies/@hyperfrontend/project-scope/tech/testing/index.esm.js +88 -0
  121. package/_dependencies/@hyperfrontend/project-scope/tech/types/index.cjs.js +88 -0
  122. package/_dependencies/@hyperfrontend/project-scope/tech/types/index.esm.js +88 -0
  123. package/_dependencies/@hyperfrontend/project-scope/vfs/index.cjs.js +102 -0
  124. package/_dependencies/@hyperfrontend/project-scope/vfs/index.esm.js +102 -0
  125. package/_dependencies/@hyperfrontend/versioning/changelog/compare/index.cjs.js +1 -0
  126. package/_dependencies/@hyperfrontend/versioning/changelog/compare/index.esm.js +1 -0
  127. package/_dependencies/@hyperfrontend/versioning/changelog/index.cjs.js +1 -0
  128. package/_dependencies/@hyperfrontend/versioning/changelog/index.esm.js +1 -0
  129. package/_dependencies/@hyperfrontend/versioning/changelog/models/index.cjs.js +1 -0
  130. package/_dependencies/@hyperfrontend/versioning/changelog/models/index.esm.js +1 -0
  131. package/_dependencies/@hyperfrontend/versioning/changelog/operations/index.cjs.js +1 -0
  132. package/_dependencies/@hyperfrontend/versioning/changelog/operations/index.esm.js +1 -0
  133. package/_dependencies/@hyperfrontend/versioning/changelog/parse/index.cjs.js +1 -0
  134. package/_dependencies/@hyperfrontend/versioning/changelog/parse/index.esm.js +1 -0
  135. package/_dependencies/@hyperfrontend/versioning/changelog/serialize/index.cjs.js +1 -0
  136. package/_dependencies/@hyperfrontend/versioning/changelog/serialize/index.esm.js +1 -0
  137. package/_dependencies/@hyperfrontend/versioning/commits/author/index.cjs.js +2403 -0
  138. package/_dependencies/@hyperfrontend/versioning/commits/author/index.esm.js +2381 -0
  139. package/_dependencies/@hyperfrontend/versioning/commits/classify/index.cjs.js +38 -0
  140. package/_dependencies/@hyperfrontend/versioning/commits/classify/index.esm.js +30 -0
  141. package/_dependencies/@hyperfrontend/versioning/commits/format/index.cjs.js +1 -0
  142. package/_dependencies/@hyperfrontend/versioning/commits/format/index.esm.js +1 -0
  143. package/_dependencies/@hyperfrontend/versioning/commits/index.cjs.js +2457 -0
  144. package/_dependencies/@hyperfrontend/versioning/commits/index.esm.js +2407 -0
  145. package/_dependencies/@hyperfrontend/versioning/commits/models/index.cjs.js +1 -0
  146. package/_dependencies/@hyperfrontend/versioning/commits/models/index.esm.js +1 -0
  147. package/_dependencies/@hyperfrontend/versioning/commits/parse/index.cjs.js +1 -0
  148. package/_dependencies/@hyperfrontend/versioning/commits/parse/index.esm.js +1 -0
  149. package/_dependencies/@hyperfrontend/versioning/commits/validate/index.cjs.js +27 -0
  150. package/_dependencies/@hyperfrontend/versioning/commits/validate/index.esm.js +25 -0
  151. package/_dependencies/@hyperfrontend/versioning/flow/executor/index.cjs.js +36 -0
  152. package/_dependencies/@hyperfrontend/versioning/flow/executor/index.esm.js +36 -0
  153. package/_dependencies/@hyperfrontend/versioning/flow/index.cjs.js +51 -0
  154. package/_dependencies/@hyperfrontend/versioning/flow/index.esm.js +51 -0
  155. package/_dependencies/@hyperfrontend/versioning/flow/models/index.cjs.js +30 -0
  156. package/_dependencies/@hyperfrontend/versioning/flow/models/index.esm.js +28 -0
  157. package/_dependencies/@hyperfrontend/versioning/flow/presets/index.cjs.js +47 -0
  158. package/_dependencies/@hyperfrontend/versioning/flow/presets/index.esm.js +45 -0
  159. package/_dependencies/@hyperfrontend/versioning/flow/steps/index.cjs.js +47 -0
  160. package/_dependencies/@hyperfrontend/versioning/flow/steps/index.esm.js +45 -0
  161. package/_dependencies/@hyperfrontend/versioning/git/index.cjs.js +8 -0
  162. package/_dependencies/@hyperfrontend/versioning/git/index.esm.js +9 -0
  163. package/_dependencies/@hyperfrontend/versioning/git/models/index.cjs.js +1 -0
  164. package/_dependencies/@hyperfrontend/versioning/git/models/index.esm.js +1 -0
  165. package/_dependencies/@hyperfrontend/versioning/git/operations/index.cjs.js +3 -0
  166. package/_dependencies/@hyperfrontend/versioning/git/operations/index.esm.js +3 -0
  167. package/_dependencies/@hyperfrontend/versioning/index.cjs.js +2481 -0
  168. package/_dependencies/@hyperfrontend/versioning/index.esm.js +2423 -0
  169. package/_dependencies/@hyperfrontend/versioning/registry/index.cjs.js +1 -0
  170. package/_dependencies/@hyperfrontend/versioning/registry/index.esm.js +1 -0
  171. package/_dependencies/@hyperfrontend/versioning/registry/models/index.cjs.js +1 -0
  172. package/_dependencies/@hyperfrontend/versioning/registry/models/index.esm.js +1 -0
  173. package/_dependencies/@hyperfrontend/versioning/registry/npm/index.cjs.js +1 -0
  174. package/_dependencies/@hyperfrontend/versioning/registry/npm/index.esm.js +1 -0
  175. package/_dependencies/@hyperfrontend/versioning/repository/index.cjs.js +18 -0
  176. package/_dependencies/@hyperfrontend/versioning/repository/index.esm.js +17 -0
  177. package/_dependencies/@hyperfrontend/versioning/repository/models/index.cjs.js +11 -0
  178. package/_dependencies/@hyperfrontend/versioning/repository/models/index.esm.js +10 -0
  179. package/_dependencies/@hyperfrontend/versioning/repository/parse/index.cjs.js +184 -0
  180. package/_dependencies/@hyperfrontend/versioning/repository/parse/index.esm.js +185 -0
  181. package/_dependencies/@hyperfrontend/versioning/repository/url/index.cjs.js +10 -0
  182. package/_dependencies/@hyperfrontend/versioning/repository/url/index.esm.js +8 -0
  183. package/_dependencies/@hyperfrontend/versioning/semver/compare/index.cjs.js +1 -0
  184. package/_dependencies/@hyperfrontend/versioning/semver/compare/index.esm.js +1 -0
  185. package/_dependencies/@hyperfrontend/versioning/semver/format/index.cjs.js +1 -0
  186. package/_dependencies/@hyperfrontend/versioning/semver/format/index.esm.js +1 -0
  187. package/_dependencies/@hyperfrontend/versioning/semver/increment/index.cjs.js +1 -0
  188. package/_dependencies/@hyperfrontend/versioning/semver/increment/index.esm.js +1 -0
  189. package/_dependencies/@hyperfrontend/versioning/semver/index.cjs.js +1 -0
  190. package/_dependencies/@hyperfrontend/versioning/semver/index.esm.js +1 -0
  191. package/_dependencies/@hyperfrontend/versioning/semver/models/index.cjs.js +1 -0
  192. package/_dependencies/@hyperfrontend/versioning/semver/models/index.esm.js +1 -0
  193. package/_dependencies/@hyperfrontend/versioning/semver/parse/index.cjs.js +1 -0
  194. package/_dependencies/@hyperfrontend/versioning/semver/parse/index.esm.js +1 -0
  195. package/_dependencies/@hyperfrontend/versioning/workspace/discovery/index.cjs.js +29 -0
  196. package/_dependencies/@hyperfrontend/versioning/workspace/discovery/index.esm.js +29 -0
  197. package/_dependencies/@hyperfrontend/versioning/workspace/index.cjs.js +29 -0
  198. package/_dependencies/@hyperfrontend/versioning/workspace/index.esm.js +29 -0
  199. package/_dependencies/@hyperfrontend/versioning/workspace/models/index.cjs.js +1 -0
  200. package/_dependencies/@hyperfrontend/versioning/workspace/models/index.esm.js +1 -0
  201. package/_dependencies/@hyperfrontend/versioning/workspace/operations/index.cjs.js +2 -0
  202. package/_dependencies/@hyperfrontend/versioning/workspace/operations/index.esm.js +2 -0
  203. package/_dependencies/@rollup/plugin-commonjs/index.cjs.js +6629 -0
  204. package/_dependencies/@rollup/plugin-commonjs/index.esm.js +6608 -0
  205. package/_dependencies/@rollup/plugin-json/index.cjs.js +2324 -0
  206. package/_dependencies/@rollup/plugin-json/index.esm.js +2322 -0
  207. package/_dependencies/@rollup/plugin-node-resolve/index.cjs.js +5430 -0
  208. package/_dependencies/@rollup/plugin-node-resolve/index.esm.js +5424 -0
  209. package/_dependencies/@rollup/plugin-terser/index.cjs.js +33220 -0
  210. package/_dependencies/@rollup/plugin-terser/index.esm.js +33217 -0
  211. package/_dependencies/@rollup/plugin-typescript/index.cjs.js +4840 -0
  212. package/_dependencies/@rollup/plugin-typescript/index.esm.js +4819 -0
  213. package/_dependencies/postject/index.cjs.js +5140 -0
  214. package/_dependencies/postject/index.esm.js +5131 -0
  215. package/_dependencies/rollup/index.cjs.js +24668 -0
  216. package/_dependencies/rollup/index.d.ts +1921 -0
  217. package/_dependencies/rollup/index.esm.js +24652 -0
  218. package/_dependencies/rollup-plugin-dts/index.cjs.js +6547 -0
  219. package/_dependencies/rollup-plugin-dts/index.esm.js +6537 -0
  220. package/_shared/bin/format/index.cjs.js +7 -0
  221. package/_shared/bin/format/index.esm.js +5 -0
  222. package/_shared/bin/native/codesign/index.cjs.js +30 -0
  223. package/_shared/bin/native/codesign/index.esm.js +26 -0
  224. package/_shared/bin/native/host-binary/index.cjs.js +13 -0
  225. package/_shared/bin/native/host-binary/index.esm.js +11 -0
  226. package/_shared/bin/native/inject/index.cjs.js +25 -0
  227. package/_shared/bin/native/inject/index.esm.js +18 -0
  228. package/_shared/bin/native/platform-check/index.cjs.js +13 -0
  229. package/_shared/bin/native/platform-check/index.esm.js +10 -0
  230. package/_shared/bin/native/sea-blob/index.cjs.js +21 -0
  231. package/_shared/bin/native/sea-blob/index.esm.js +19 -0
  232. package/_shared/bin/native/sea-config/index.cjs.js +9 -0
  233. package/_shared/bin/native/sea-config/index.esm.js +7 -0
  234. package/_shared/bin/script/bootstrap-footer/index.cjs.js +22 -0
  235. package/_shared/bin/script/bootstrap-footer/index.esm.js +19 -0
  236. package/_shared/bundle/declarations/flatten-paths/index.cjs.js +34 -0
  237. package/_shared/bundle/declarations/flatten-paths/index.esm.js +29 -0
  238. package/_shared/bundle/dependencies/collect-workspace-deps/index.cjs.js +24 -0
  239. package/_shared/bundle/dependencies/collect-workspace-deps/index.esm.js +21 -0
  240. package/_shared/bundle/dependencies/externalize-plugin/index.cjs.js +93 -0
  241. package/_shared/bundle/dependencies/externalize-plugin/index.esm.js +86 -0
  242. package/_shared/bundle/dependencies/prune/ast-utils/index.esm.js +31 -0
  243. package/_shared/bundle/dependencies/prune/namespace-usage/index.esm.js +208 -0
  244. package/_shared/bundle/dependencies/prune/specifiers/index.cjs.js +62 -0
  245. package/_shared/bundle/dependencies/prune/specifiers/index.esm.js +53 -0
  246. package/_shared/bundle/entries/discover-entries/index.cjs.js +87 -0
  247. package/_shared/bundle/entries/discover-entries/index.esm.js +80 -0
  248. package/_shared/bundle/entries/resolve-entries/index.cjs.js +38 -0
  249. package/_shared/bundle/entries/resolve-entries/index.esm.js +34 -0
  250. package/_shared/bundle/externals/validate-globals/index.cjs.js +14 -0
  251. package/_shared/bundle/externals/validate-globals/index.esm.js +12 -0
  252. package/_shared/bundle/fs/deps-root/index.cjs.js +7 -0
  253. package/_shared/bundle/fs/deps-root/index.esm.js +5 -0
  254. package/_shared/bundle/fs/empty-dirs/index.cjs.js +23 -0
  255. package/_shared/bundle/fs/empty-dirs/index.esm.js +21 -0
  256. package/_shared/bundle/fs/entry-dir/index.cjs.js +7 -0
  257. package/_shared/bundle/fs/entry-dir/index.esm.js +5 -0
  258. package/_shared/bundle/fs/posix-path/index.cjs.js +9 -0
  259. package/_shared/bundle/fs/posix-path/index.esm.js +4 -0
  260. package/_shared/bundle/fs/under-dir/index.cjs.js +5 -0
  261. package/_shared/bundle/fs/under-dir/index.esm.js +3 -0
  262. package/_shared/memory/recover/index.cjs.js +15 -0
  263. package/_shared/memory/recover/index.esm.js +14 -0
  264. package/_shared/package/finalize-files/index.cjs.js +16 -0
  265. package/_shared/package/finalize-files/index.esm.js +15 -0
  266. package/_shared/package/json/cdn-paths/index.cjs.js +13 -0
  267. package/_shared/package/json/cdn-paths/index.esm.js +11 -0
  268. package/_shared/package/json/filter-deps/index.cjs.js +37 -0
  269. package/_shared/package/json/filter-deps/index.esm.js +34 -0
  270. package/_shared/package/json/generate-exports/index.cjs.js +56 -0
  271. package/_shared/package/json/generate-exports/index.esm.js +52 -0
  272. package/_shared/package/json/inherit-fields/index.cjs.js +19 -0
  273. package/_shared/package/json/inherit-fields/index.esm.js +17 -0
  274. package/_shared/package/json/read-package-json/index.cjs.js +7 -0
  275. package/_shared/package/json/read-package-json/index.esm.js +6 -0
  276. package/_shared/package/json/reflect-files-allowlist/index.cjs.js +39 -0
  277. package/_shared/package/json/reflect-files-allowlist/index.esm.js +33 -0
  278. package/_shared/package/json/synthesize/index.cjs.js +72 -0
  279. package/_shared/package/json/synthesize/index.esm.js +68 -0
  280. package/_shared/package/json/write/index.cjs.js +9 -0
  281. package/_shared/package/json/write/index.esm.js +8 -0
  282. package/_shared/package/licenses/generate-content/index.cjs.js +17 -0
  283. package/_shared/package/licenses/generate-content/index.esm.js +17 -0
  284. package/_shared/package/licenses/license-url/index.esm.js +29 -0
  285. package/_shared/package/licenses/write/index.cjs.js +9 -0
  286. package/_shared/package/licenses/write/index.esm.js +8 -0
  287. package/_shared/presets/by-names/index.cjs.js +10 -0
  288. package/_shared/presets/by-names/index.esm.js +8 -0
  289. package/_shared/presets/by-prefix/index.cjs.js +7 -0
  290. package/_shared/presets/by-prefix/index.esm.js +5 -0
  291. package/bin/format.d.ts +18 -0
  292. package/bin/format.d.ts.map +1 -0
  293. package/bin/hf-build.d.ts +81 -0
  294. package/bin/hf-build.d.ts.map +1 -0
  295. package/bin/hf-build.js +208533 -0
  296. package/bin/hf-build.linux-x64 +0 -0
  297. package/bin/index.cjs.js +548 -0
  298. package/bin/index.d.ts +26 -0
  299. package/bin/index.d.ts.map +1 -0
  300. package/bin/index.esm.js +546 -0
  301. package/bin/native/build-native.d.ts +44 -0
  302. package/bin/native/build-native.d.ts.map +1 -0
  303. package/bin/native/codesign.d.ts +65 -0
  304. package/bin/native/codesign.d.ts.map +1 -0
  305. package/bin/native/dispatch.d.ts +75 -0
  306. package/bin/native/dispatch.d.ts.map +1 -0
  307. package/bin/native/host-binary.d.ts +36 -0
  308. package/bin/native/host-binary.d.ts.map +1 -0
  309. package/bin/native/index.cjs.js +264 -0
  310. package/bin/native/index.d.ts +407 -0
  311. package/bin/native/index.d.ts.map +1 -0
  312. package/bin/native/index.esm.js +249 -0
  313. package/bin/native/inject.d.ts +61 -0
  314. package/bin/native/inject.d.ts.map +1 -0
  315. package/bin/native/platform-check.d.ts +39 -0
  316. package/bin/native/platform-check.d.ts.map +1 -0
  317. package/bin/native/sea-blob.d.ts +40 -0
  318. package/bin/native/sea-blob.d.ts.map +1 -0
  319. package/bin/native/sea-config.d.ts +45 -0
  320. package/bin/native/sea-config.d.ts.map +1 -0
  321. package/bin/native/worker/index.cjs.js +88 -0
  322. package/bin/native/worker/index.d.ts +68 -0
  323. package/bin/native/worker/index.d.ts.map +1 -0
  324. package/bin/native/worker/index.esm.js +86 -0
  325. package/bin/native/worker/job-runner.d.ts +29 -0
  326. package/bin/native/worker/job-runner.d.ts.map +1 -0
  327. package/bin/native/worker/types.d.ts +38 -0
  328. package/bin/native/worker/types.d.ts.map +1 -0
  329. package/bin/run-bin-phase.d.ts +24 -0
  330. package/bin/run-bin-phase.d.ts.map +1 -0
  331. package/bin/script/bootstrap-footer.d.ts +41 -0
  332. package/bin/script/bootstrap-footer.d.ts.map +1 -0
  333. package/bin/script/build-bin.d.ts +36 -0
  334. package/bin/script/build-bin.d.ts.map +1 -0
  335. package/bin/script/index.cjs.js +265 -0
  336. package/bin/script/index.d.ts +79 -0
  337. package/bin/script/index.d.ts.map +1 -0
  338. package/bin/script/index.esm.js +262 -0
  339. package/build.d.ts +56 -0
  340. package/build.d.ts.map +1 -0
  341. package/bundle/declarations/dts-per-entry.d.ts +27 -0
  342. package/bundle/declarations/dts-per-entry.d.ts.map +1 -0
  343. package/bundle/declarations/dts-pre-pass.d.ts +18 -0
  344. package/bundle/declarations/dts-pre-pass.d.ts.map +1 -0
  345. package/bundle/declarations/flatten-paths.d.ts +28 -0
  346. package/bundle/declarations/flatten-paths.d.ts.map +1 -0
  347. package/bundle/declarations/generate-declarations.d.ts +33 -0
  348. package/bundle/declarations/generate-declarations.d.ts.map +1 -0
  349. package/bundle/declarations/index.cjs.js +868 -0
  350. package/bundle/declarations/index.d.ts +262 -0
  351. package/bundle/declarations/index.d.ts.map +1 -0
  352. package/bundle/declarations/index.esm.js +857 -0
  353. package/bundle/declarations/prune-orphan-dts.d.ts +33 -0
  354. package/bundle/declarations/prune-orphan-dts.d.ts.map +1 -0
  355. package/bundle/declarations/sibling-resolver.d.ts +125 -0
  356. package/bundle/declarations/sibling-resolver.d.ts.map +1 -0
  357. package/bundle/dedupe/attribute-modules.d.ts +178 -0
  358. package/bundle/dedupe/attribute-modules.d.ts.map +1 -0
  359. package/bundle/dedupe/extract-chunk.d.ts +103 -0
  360. package/bundle/dedupe/extract-chunk.d.ts.map +1 -0
  361. package/bundle/dedupe/hoist-shared.d.ts +37 -0
  362. package/bundle/dedupe/hoist-shared.d.ts.map +1 -0
  363. package/bundle/dedupe/index.cjs.js +818 -0
  364. package/bundle/dedupe/index.d.ts +400 -0
  365. package/bundle/dedupe/index.d.ts.map +1 -0
  366. package/bundle/dedupe/index.esm.js +766 -0
  367. package/bundle/dedupe/plan-hoists.d.ts +46 -0
  368. package/bundle/dedupe/plan-hoists.d.ts.map +1 -0
  369. package/bundle/dedupe/rewrite-entry.d.ts +39 -0
  370. package/bundle/dedupe/rewrite-entry.d.ts.map +1 -0
  371. package/bundle/dependencies/collect-workspace-deps.d.ts +34 -0
  372. package/bundle/dependencies/collect-workspace-deps.d.ts.map +1 -0
  373. package/bundle/dependencies/externalize-plugin.d.ts +100 -0
  374. package/bundle/dependencies/externalize-plugin.d.ts.map +1 -0
  375. package/bundle/dependencies/index.cjs.js +964 -0
  376. package/bundle/dependencies/index.d.ts +388 -0
  377. package/bundle/dependencies/index.d.ts.map +1 -0
  378. package/bundle/dependencies/index.esm.js +947 -0
  379. package/bundle/dependencies/pre-pass.d.ts +154 -0
  380. package/bundle/dependencies/pre-pass.d.ts.map +1 -0
  381. package/bundle/dependencies/prune/ast-utils.d.ts +121 -0
  382. package/bundle/dependencies/prune/ast-utils.d.ts.map +1 -0
  383. package/bundle/dependencies/prune/chunk-graph.d.ts +175 -0
  384. package/bundle/dependencies/prune/chunk-graph.d.ts.map +1 -0
  385. package/bundle/dependencies/prune/dead-export-pass.d.ts +32 -0
  386. package/bundle/dependencies/prune/dead-export-pass.d.ts.map +1 -0
  387. package/bundle/dependencies/prune/dead-exports.d.ts +36 -0
  388. package/bundle/dependencies/prune/dead-exports.d.ts.map +1 -0
  389. package/bundle/dependencies/prune/destructure-requires-pass.d.ts +31 -0
  390. package/bundle/dependencies/prune/destructure-requires-pass.d.ts.map +1 -0
  391. package/bundle/dependencies/prune/destructure-requires.d.ts +42 -0
  392. package/bundle/dependencies/prune/destructure-requires.d.ts.map +1 -0
  393. package/bundle/dependencies/prune/edits.d.ts +30 -0
  394. package/bundle/dependencies/prune/edits.d.ts.map +1 -0
  395. package/bundle/dependencies/prune/namespace-usage.d.ts +104 -0
  396. package/bundle/dependencies/prune/namespace-usage.d.ts.map +1 -0
  397. package/bundle/dependencies/prune/orphan-chunks.d.ts +69 -0
  398. package/bundle/dependencies/prune/orphan-chunks.d.ts.map +1 -0
  399. package/bundle/dependencies/prune/property-strip-pass.d.ts +38 -0
  400. package/bundle/dependencies/prune/property-strip-pass.d.ts.map +1 -0
  401. package/bundle/dependencies/prune/property-strip.d.ts +69 -0
  402. package/bundle/dependencies/prune/property-strip.d.ts.map +1 -0
  403. package/bundle/dependencies/prune/prune-dependencies.d.ts +52 -0
  404. package/bundle/dependencies/prune/prune-dependencies.d.ts.map +1 -0
  405. package/bundle/dependencies/prune/reachability.d.ts +36 -0
  406. package/bundle/dependencies/prune/reachability.d.ts.map +1 -0
  407. package/bundle/dependencies/prune/specifiers.d.ts +39 -0
  408. package/bundle/dependencies/prune/specifiers.d.ts.map +1 -0
  409. package/bundle/dependencies/prune/strip-comments.d.ts +47 -0
  410. package/bundle/dependencies/prune/strip-comments.d.ts.map +1 -0
  411. package/bundle/dependencies/prune/used-exports.d.ts +32 -0
  412. package/bundle/dependencies/prune/used-exports.d.ts.map +1 -0
  413. package/bundle/dependencies/resolve-bundled-deps.d.ts +37 -0
  414. package/bundle/dependencies/resolve-bundled-deps.d.ts.map +1 -0
  415. package/bundle/dependencies/resolve-dep-entry.d.ts +38 -0
  416. package/bundle/dependencies/resolve-dep-entry.d.ts.map +1 -0
  417. package/bundle/dependencies/resolve-workspace-bundled-deps.d.ts +96 -0
  418. package/bundle/dependencies/resolve-workspace-bundled-deps.d.ts.map +1 -0
  419. package/bundle/dependencies/worker/index.cjs.js +524 -0
  420. package/bundle/dependencies/worker/index.d.ts +102 -0
  421. package/bundle/dependencies/worker/index.d.ts.map +1 -0
  422. package/bundle/dependencies/worker/index.esm.js +515 -0
  423. package/bundle/dependencies/worker/job-runner.d.ts +115 -0
  424. package/bundle/dependencies/worker/job-runner.d.ts.map +1 -0
  425. package/bundle/entries/by-platform.d.ts +27 -0
  426. package/bundle/entries/by-platform.d.ts.map +1 -0
  427. package/bundle/entries/discover-entries.d.ts +24 -0
  428. package/bundle/entries/discover-entries.d.ts.map +1 -0
  429. package/bundle/entries/index.cjs.js +38 -0
  430. package/bundle/entries/index.d.ts +70 -0
  431. package/bundle/entries/index.d.ts.map +1 -0
  432. package/bundle/entries/index.esm.js +33 -0
  433. package/bundle/entries/resolve-entries.d.ts +19 -0
  434. package/bundle/entries/resolve-entries.d.ts.map +1 -0
  435. package/bundle/externals/index.cjs.js +54 -0
  436. package/bundle/externals/index.d.ts +74 -0
  437. package/bundle/externals/index.d.ts.map +1 -0
  438. package/bundle/externals/index.esm.js +51 -0
  439. package/bundle/externals/resolve-externals.d.ts +52 -0
  440. package/bundle/externals/resolve-externals.d.ts.map +1 -0
  441. package/bundle/externals/validate-globals.d.ts +19 -0
  442. package/bundle/externals/validate-globals.d.ts.map +1 -0
  443. package/bundle/fs/deps-root.d.ts +17 -0
  444. package/bundle/fs/deps-root.d.ts.map +1 -0
  445. package/bundle/fs/empty-dirs.d.ts +18 -0
  446. package/bundle/fs/empty-dirs.d.ts.map +1 -0
  447. package/bundle/fs/entry-dir.d.ts +21 -0
  448. package/bundle/fs/entry-dir.d.ts.map +1 -0
  449. package/bundle/fs/posix-path.d.ts +30 -0
  450. package/bundle/fs/posix-path.d.ts.map +1 -0
  451. package/bundle/fs/under-dir.d.ts +19 -0
  452. package/bundle/fs/under-dir.d.ts.map +1 -0
  453. package/bundle/index.cjs.js +4046 -0
  454. package/bundle/index.d.ts +25 -0
  455. package/bundle/index.d.ts.map +1 -0
  456. package/bundle/index.esm.js +3689 -0
  457. package/bundle/rollup/descriptor.d.ts +99 -0
  458. package/bundle/rollup/descriptor.d.ts.map +1 -0
  459. package/bundle/rollup/dispatch.d.ts +72 -0
  460. package/bundle/rollup/dispatch.d.ts.map +1 -0
  461. package/bundle/rollup/index.cjs.js +715 -0
  462. package/bundle/rollup/index.d.ts +174 -0
  463. package/bundle/rollup/index.d.ts.map +1 -0
  464. package/bundle/rollup/index.esm.js +698 -0
  465. package/bundle/rollup/worker/index.cjs.js +290 -0
  466. package/bundle/rollup/worker/index.d.ts +131 -0
  467. package/bundle/rollup/worker/index.d.ts.map +1 -0
  468. package/bundle/rollup/worker/index.esm.js +280 -0
  469. package/bundle/rollup/worker/job-runner.d.ts +18 -0
  470. package/bundle/rollup/worker/job-runner.d.ts.map +1 -0
  471. package/bundle/rollup/worker/types.d.ts +111 -0
  472. package/bundle/rollup/worker/types.d.ts.map +1 -0
  473. package/bundle/run-bundle-phase.d.ts +23 -0
  474. package/bundle/run-bundle-phase.d.ts.map +1 -0
  475. package/clean-output.d.ts +26 -0
  476. package/clean-output.d.ts.map +1 -0
  477. package/index.cjs.js +5317 -0
  478. package/index.d.ts +64 -0
  479. package/index.d.ts.map +1 -0
  480. package/index.esm.js +4910 -0
  481. package/memory/index.cjs.js +101 -0
  482. package/memory/index.d.ts +81 -0
  483. package/memory/index.d.ts.map +1 -0
  484. package/memory/index.esm.js +98 -0
  485. package/memory/monitor.d.ts +59 -0
  486. package/memory/monitor.d.ts.map +1 -0
  487. package/memory/recover.d.ts +19 -0
  488. package/memory/recover.d.ts.map +1 -0
  489. package/models/build-config.d.ts +266 -0
  490. package/models/build-config.d.ts.map +1 -0
  491. package/models/build-context.d.ts +68 -0
  492. package/models/build-context.d.ts.map +1 -0
  493. package/models/build-result.d.ts +43 -0
  494. package/models/build-result.d.ts.map +1 -0
  495. package/models/entry-point.d.ts +45 -0
  496. package/models/entry-point.d.ts.map +1 -0
  497. package/models/format-output.d.ts +34 -0
  498. package/models/format-output.d.ts.map +1 -0
  499. package/models/index.cjs.js +2 -0
  500. package/models/index.d.ts +581 -0
  501. package/models/index.d.ts.map +1 -0
  502. package/models/index.esm.js +1 -0
  503. package/models/package-json.d.ts +130 -0
  504. package/models/package-json.d.ts.map +1 -0
  505. package/package/assets/copy-assets.d.ts +31 -0
  506. package/package/assets/copy-assets.d.ts.map +1 -0
  507. package/package/assets/index.cjs.js +84 -0
  508. package/package/assets/index.d.ts +33 -0
  509. package/package/assets/index.d.ts.map +1 -0
  510. package/package/assets/index.esm.js +82 -0
  511. package/package/finalize-files.d.ts +25 -0
  512. package/package/finalize-files.d.ts.map +1 -0
  513. package/package/index.cjs.js +276 -0
  514. package/package/index.d.ts +56 -0
  515. package/package/index.d.ts.map +1 -0
  516. package/package/index.esm.js +231 -0
  517. package/package/json/cdn-paths.d.ts +41 -0
  518. package/package/json/cdn-paths.d.ts.map +1 -0
  519. package/package/json/filter-deps.d.ts +39 -0
  520. package/package/json/filter-deps.d.ts.map +1 -0
  521. package/package/json/generate-exports.d.ts +29 -0
  522. package/package/json/generate-exports.d.ts.map +1 -0
  523. package/package/json/index.cjs.js +24 -0
  524. package/package/json/index.d.ts +252 -0
  525. package/package/json/index.d.ts.map +1 -0
  526. package/package/json/index.esm.js +14 -0
  527. package/package/json/inherit-fields.d.ts +25 -0
  528. package/package/json/inherit-fields.d.ts.map +1 -0
  529. package/package/json/read-package-json.d.ts +18 -0
  530. package/package/json/read-package-json.d.ts.map +1 -0
  531. package/package/json/reflect-files-allowlist.d.ts +32 -0
  532. package/package/json/reflect-files-allowlist.d.ts.map +1 -0
  533. package/package/json/synthesize.d.ts +53 -0
  534. package/package/json/synthesize.d.ts.map +1 -0
  535. package/package/json/write.d.ts +18 -0
  536. package/package/json/write.d.ts.map +1 -0
  537. package/package/licenses/collect.d.ts +25 -0
  538. package/package/licenses/collect.d.ts.map +1 -0
  539. package/package/licenses/generate-content.d.ts +20 -0
  540. package/package/licenses/generate-content.d.ts.map +1 -0
  541. package/package/licenses/index.cjs.js +135 -0
  542. package/package/licenses/index.d.ts +73 -0
  543. package/package/licenses/index.d.ts.map +1 -0
  544. package/package/licenses/index.esm.js +89 -0
  545. package/package/licenses/license-url.d.ts +20 -0
  546. package/package/licenses/license-url.d.ts.map +1 -0
  547. package/package/licenses/types.d.ts +12 -0
  548. package/package/licenses/types.d.ts.map +1 -0
  549. package/package/licenses/write.d.ts +16 -0
  550. package/package/licenses/write.d.ts.map +1 -0
  551. package/package/run-package-phase.d.ts +30 -0
  552. package/package/run-package-phase.d.ts.map +1 -0
  553. package/package.json +347 -0
  554. package/presets/by-names.d.ts +20 -0
  555. package/presets/by-names.d.ts.map +1 -0
  556. package/presets/by-prefix.d.ts +22 -0
  557. package/presets/by-prefix.d.ts.map +1 -0
  558. package/presets/index.cjs.js +8 -0
  559. package/presets/index.d.ts +43 -0
  560. package/presets/index.d.ts.map +1 -0
  561. package/presets/index.esm.js +5 -0
@@ -0,0 +1,546 @@
1
+ import { createError } from '../_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/error/index.esm.js';
2
+ import { createPromise } from '../_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/promise/index.esm.js';
3
+ import { setTimeout } from '../_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/timers/index.esm.js';
4
+ import { existsSync, rmSync, mkdtempSync, readFileSync, unlinkSync } from 'node:fs';
5
+ import { tmpdir, freemem } from 'node:os';
6
+ import { dateNow } from '../_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/date/index.esm.js';
7
+ import { logger } from '../_dependencies/@hyperfrontend/logging/index.esm.js';
8
+ import { join, ensureDir, writeJsonFile, exists } from '../_dependencies/@hyperfrontend/project-scope/core/index.esm.js';
9
+ import { isArray } from '../_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/array/index.esm.js';
10
+ import { spawnSync, spawn } from 'node:child_process';
11
+ import { stringify, parse } from '../_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/json/index.esm.js';
12
+ import '../_dependencies/postject/index.esm.js';
13
+ import { join as join$1, getDirname } from '../_dependencies/@hyperfrontend/project-scope/core/path/index.esm.js';
14
+ import 'node:module';
15
+ import 'node:path';
16
+ import '../_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/object/index.esm.js';
17
+ import '../_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/set/index.esm.js';
18
+ import '../_dependencies/@hyperfrontend/project-scope/core/fs/index.esm.js';
19
+ import { recover } from '../_shared/memory/recover/index.esm.js';
20
+ import { normalizeFormats } from '../_shared/bin/format/index.esm.js';
21
+ import { removeCodesign } from '../_shared/bin/native/codesign/index.esm.js';
22
+ import { resolveHostBinary } from '../_shared/bin/native/host-binary/index.esm.js';
23
+ import { NODE_SEA_RESOURCE_NAME, NODE_SEA_MACHO_SEGMENT, NODE_SEA_FUSE } from '../_shared/bin/native/inject/index.esm.js';
24
+ import { currentPlatformTarget, currentPlatformMatches } from '../_shared/bin/native/platform-check/index.esm.js';
25
+ import { generateSeaBlob } from '../_shared/bin/native/sea-blob/index.esm.js';
26
+ import { generateSeaConfig } from '../_shared/bin/native/sea-config/index.esm.js';
27
+ import { defaultBootstrap } from '../_shared/bin/script/bootstrap-footer/index.esm.js';
28
+ import { buildWorkspaceRoutes } from '../_shared/bundle/dependencies/externalize-plugin/index.esm.js';
29
+ import { depsRootOf } from '../_shared/bundle/fs/deps-root/index.esm.js';
30
+
31
+ const log$3 = logger.channel('builder:bin:native:dispatch');
32
+ const REPORT_DIR_PREFIX$1 = 'hf-builder-inject-';
33
+ const SWC_NODE_REGISTER$1 = '@swc-node/register';
34
+ const swcNodeAvailable$1 = (workspaceRoot) => existsSync(join(workspaceRoot, 'node_modules', '@swc-node', 'register', 'index.js'));
35
+ /**
36
+ * Default worker-path resolution: prefers the built-and-published artifact, falls
37
+ * back to the workspace dist path, and finally to the in-source TypeScript file
38
+ * via `@swc-node/register` (bootstrap case where builder is building itself for
39
+ * the first time and the dist worker doesn't exist yet).
40
+ *
41
+ * Looks at, in order:
42
+ * 1. `<workspaceRoot>/dist/libs/builder/bin/native/worker/index.cjs.js`
43
+ * 2. `<workspaceRoot>/node_modules/@hyperfrontend/builder/bin/native/worker/index.cjs.js`
44
+ * 3. `<workspaceRoot>/libs/builder/src/bin/native/worker/index.ts` (with `--require \@swc-node/register`)
45
+ *
46
+ * @param workspaceRoot - Absolute workspace root.
47
+ * @returns Worker invocation descriptor, or `undefined` if no candidate exists.
48
+ *
49
+ * @example Locating the worker for an in-workspace consumer
50
+ * ```typescript
51
+ * const invocation = resolveDefaultInjectWorkerPath('/abs/repo')
52
+ * if (!invocation) throw new Error('builder inject worker artifact not found')
53
+ * ```
54
+ */
55
+ const resolveDefaultInjectWorkerPath = (workspaceRoot) => {
56
+ const distCandidates = [
57
+ join(workspaceRoot, 'dist', 'libs', 'builder', 'bin', 'native', 'worker', 'index.cjs.js'),
58
+ join(workspaceRoot, 'node_modules', '@hyperfrontend', 'builder', 'bin', 'native', 'worker', 'index.cjs.js'),
59
+ ];
60
+ for (const path of distCandidates) {
61
+ if (existsSync(path))
62
+ return { path, execArgv: [] };
63
+ }
64
+ const sourcePath = join(workspaceRoot, 'libs', 'builder', 'src', 'bin', 'native', 'worker', 'index.ts');
65
+ if (existsSync(sourcePath) && swcNodeAvailable$1(workspaceRoot)) {
66
+ return { path: sourcePath, execArgv: ['--require', SWC_NODE_REGISTER$1] };
67
+ }
68
+ return undefined;
69
+ };
70
+ const createReportDir$1 = () => mkdtempSync(join(tmpdir(), REPORT_DIR_PREFIX$1));
71
+ const reportPathFor$1 = (reportDir, job) => {
72
+ const safeLabel = job.outputBinary.replace(/[^a-zA-Z0-9_-]+/g, '_');
73
+ return join(reportDir, `inject-${safeLabel}.json`);
74
+ };
75
+ const runOne$1 = (job, options, label) => createPromise((resolve, reject) => {
76
+ const execPath = options.execPath ?? process.execPath;
77
+ const argv = [...(options.execArgv ?? []), options.workerPath, stringify(job)];
78
+ const child = spawn(execPath, argv, { stdio: ['ignore', 'pipe', 'pipe'] });
79
+ let capturedStderr = '';
80
+ child.stdout?.on('data', (chunk) => {
81
+ process.stdout.write(chunk);
82
+ });
83
+ child.stderr?.on('data', (chunk) => {
84
+ const text = typeof chunk === 'string' ? chunk : chunk.toString();
85
+ capturedStderr += text;
86
+ process.stderr.write(text);
87
+ });
88
+ child.on('error', (error) => {
89
+ reject(createError(`inject worker for ${label} failed to spawn: ${error.message}`));
90
+ });
91
+ child.on('exit', (code) => {
92
+ if (code !== 0) {
93
+ const tail = capturedStderr.trim().split('\n').slice(-10).join('\n');
94
+ reject(createError(`inject worker for ${label} exited with code ${code}\n${tail}`));
95
+ return;
96
+ }
97
+ resolve();
98
+ });
99
+ });
100
+ const readReport$1 = (reportPath, label) => {
101
+ if (!existsSync(reportPath)) {
102
+ throw createError(`inject worker for ${label} did not write a report at ${reportPath}`);
103
+ }
104
+ const data = parse(readFileSync(reportPath, 'utf8'));
105
+ return data;
106
+ };
107
+ /**
108
+ * Forks a single inject worker for the supplied job and waits for it to exit.
109
+ * The caller-provided job's `reportPath` is overwritten with a temp-dir path
110
+ * created by this function.
111
+ *
112
+ * The worker writes a JSON report at the temp path; this function reads it
113
+ * after the child exits and returns the per-job statistics. If the worker
114
+ * exits non-zero or fails to produce a report, the function throws with a
115
+ * label-rich message.
116
+ *
117
+ * The temp report directory is cleaned up before returning, regardless of
118
+ * success or failure.
119
+ *
120
+ * @param job - Inject job to dispatch.
121
+ * @param options - Worker path + optional memory monitor.
122
+ * @returns Worker report (output size + memory + duration) for the dispatched job.
123
+ *
124
+ * @example Dispatching a SEA inject for hf-build
125
+ * ```typescript
126
+ * const report = await dispatchInjectWorker(
127
+ * { hostBinary, outputBinary, blobPath, resourceName, machoSegmentName, sentinelFuse, reportPath: '' },
128
+ * { workerPath: '/abs/dist/.../worker.cjs.js', label: 'hf-build' }
129
+ * )
130
+ * ```
131
+ */
132
+ const dispatchInjectWorker = async (job, options) => {
133
+ const reportDir = createReportDir$1();
134
+ const label = options.label ?? job.outputBinary;
135
+ const reportPath = reportPathFor$1(reportDir, job);
136
+ const dispatched = { ...job, reportPath };
137
+ try {
138
+ options.monitor?.check(`bin:native:dispatch:${label}:start`);
139
+ log$3.info(`inject dispatch: ${label}`);
140
+ await runOne$1(dispatched, options, label);
141
+ const report = readReport$1(reportPath, label);
142
+ log$3.debug(`inject dispatch done: ${label} size=${report.outputSize}B heap=${report.endHeapMB.toFixed(1)}MB rss=${report.endRssMB.toFixed(1)}MB t=${report.durationMs}ms`);
143
+ options.monitor?.check(`bin:native:dispatch:${label}:end`);
144
+ return report;
145
+ }
146
+ finally {
147
+ rmSync(reportDir, { recursive: true, force: true });
148
+ }
149
+ };
150
+
151
+ const log$2 = logger.channel('builder:bin:native');
152
+ const BYTES_PER_MB = 1024 * 1024;
153
+ const formatMB = (bytes) => (bytes / BYTES_PER_MB).toFixed(1);
154
+ const memorySnapshot = (label) => {
155
+ const usage = process.memoryUsage();
156
+ log$2.debug(`${label}: heap=${formatMB(usage.heapUsed)}MB rss=${formatMB(usage.rss)}MB free=${formatMB(freemem())}MB`);
157
+ };
158
+ const requireSeaConfig = (bin) => {
159
+ if (!bin.sea)
160
+ throw createError(`buildNativeBin called for bin '${bin.name}' without a sea config`);
161
+ return bin.sea.platforms;
162
+ };
163
+ const requireCjsFormat = (bin) => {
164
+ if (!normalizeFormats(bin.format).includes('cjs')) {
165
+ throw createError(`SEA requires a CJS bin output; declare format: ['cjs'] or format: 'cjs' on bin ${bin.name}`);
166
+ }
167
+ };
168
+ const resolveOutputBinaryPath = (binDir, name, target) => {
169
+ const isWindows = target.startsWith('win32-');
170
+ return join(binDir, isWindows ? `${name}.${target}.exe` : `${name}.${target}`);
171
+ };
172
+ // why: the SEA config JSON and prep blob are build scaffolding consumed by the inject step; once the binary exists they are useless to consumers and must not remain in the publishable output.
173
+ const cleanupSeaIntermediates = (seaConfigPath, blobPath) => {
174
+ for (const file of [seaConfigPath, blobPath]) {
175
+ if (exists(file))
176
+ unlinkSync(file);
177
+ }
178
+ };
179
+ /**
180
+ * Builds the Node SEA native binary for a single bin declaration.
181
+ *
182
+ * Pipeline (current-platform-only — cross-platform matrices are orchestrated externally):
183
+ * 1. Validate the bin declares CJS — SEA requires a CJS bundle as the embedded script.
184
+ * 2. Skip silently with an info log if the current host doesn't match any declared platform.
185
+ * 3. Generate the SEA config JSON and write it to disk.
186
+ * 4. Spawn `node --experimental-sea-config <path>` to emit the SEA preparation blob.
187
+ * 5. Resolve the Node host binary for the current platform (defaults to `process.execPath`).
188
+ * 6. Dispatch a forked inject worker that clones the host, embeds the blob via
189
+ * postject, and writes the output binary.
190
+ * 7. On macOS, strip the signature the injection invalidated so the unsigned binary still runs.
191
+ * 8. Delete the SEA build intermediates (config JSON + prep blob) so only the
192
+ * runtime binary remains in the publishable output.
193
+ *
194
+ * Native binaries are not auto-wired into `package.json#bin` — they are shipped
195
+ * as separate release artifacts.
196
+ *
197
+ * @param inputs - Bin declaration, resolved context, and the path to the already-built CJS bundle.
198
+ * @returns A single {@link BinOutput} of kind `native` for the current platform, or `[]` if skipped.
199
+ *
200
+ * @example Producing the SEA binary for the current runner
201
+ * ```typescript
202
+ * const outputs = await buildNativeBin({
203
+ * bin: { name: 'hf-build', format: 'cjs', sea: { platforms: ['linux-x64'] } },
204
+ * ctx: context,
205
+ * cjsOutputPath: '/abs/dist/libs/builder/bin/hf-build.js',
206
+ * })
207
+ * ```
208
+ */
209
+ const buildNativeBin = async (inputs) => {
210
+ const { bin, ctx, cjsOutputPath } = inputs;
211
+ requireCjsFormat(bin);
212
+ const platforms = requireSeaConfig(bin);
213
+ const target = currentPlatformTarget();
214
+ if (!currentPlatformMatches(platforms)) {
215
+ log$2.info(`skipping native build for ${bin.name}: current platform ${target} not in declared targets [${platforms.join(', ')}]`);
216
+ return [];
217
+ }
218
+ const binDir = join(ctx.outputPath, 'bin');
219
+ ensureDir(binDir);
220
+ const seaConfigPath = join(binDir, `${bin.name}.sea-config.json`);
221
+ const blobPath = join(binDir, `${bin.name}.sea-prep.blob`);
222
+ const outputBinary = resolveOutputBinaryPath(binDir, bin.name, target);
223
+ log$2.info(`building native bin: ${bin.name} (${target})`);
224
+ memorySnapshot(`${bin.name}: pre-sea-config`);
225
+ const seaConfig = generateSeaConfig({ mainPath: cjsOutputPath, outputPath: blobPath });
226
+ writeJsonFile(seaConfigPath, seaConfig);
227
+ memorySnapshot(`${bin.name}: pre-sea-blob`);
228
+ const blobStart = dateNow();
229
+ generateSeaBlob({ seaConfigPath, outputBlobPath: blobPath });
230
+ log$2.debug(`${bin.name}: sea blob generated in ${dateNow() - blobStart}ms`);
231
+ const hostBinary = resolveHostBinary({ platform: target });
232
+ memorySnapshot(`${bin.name}: pre-inject (host=${hostBinary})`);
233
+ const invocation = resolveDefaultInjectWorkerPath(ctx.workspaceRoot);
234
+ if (!invocation) {
235
+ throw createError('inject worker could not be resolved for native bin build. Build @hyperfrontend/builder at least once before invoking the bin phase, or ensure @swc-node/register is installed for source-mode bootstrap.');
236
+ }
237
+ try {
238
+ const report = await dispatchInjectWorker({
239
+ hostBinary,
240
+ outputBinary,
241
+ blobPath,
242
+ resourceName: NODE_SEA_RESOURCE_NAME,
243
+ machoSegmentName: NODE_SEA_MACHO_SEGMENT,
244
+ sentinelFuse: NODE_SEA_FUSE,
245
+ reportPath: '',
246
+ }, { workerPath: invocation.path, execArgv: invocation.execArgv, label: bin.name });
247
+ log$2.debug(`${bin.name}: inject completed in ${report.durationMs}ms (worker end heap=${report.endHeapMB.toFixed(1)}MB rss=${report.endRssMB.toFixed(1)}MB)`);
248
+ }
249
+ catch (error) {
250
+ log$2.error(`${bin.name}: postject inject failed: ${error instanceof Error ? error.message : String(error)}`);
251
+ throw error;
252
+ }
253
+ memorySnapshot(`${bin.name}: post-inject`);
254
+ removeCodesign({ binary: outputBinary });
255
+ cleanupSeaIntermediates(seaConfigPath, blobPath);
256
+ memorySnapshot(`${bin.name}: native build complete`);
257
+ return [{ name: bin.name, kind: 'native', outputPath: outputBinary, platform: target }];
258
+ };
259
+
260
+ const SHEBANG = '#!/usr/bin/env node';
261
+ const BIN_FILE_MODE = 0o755;
262
+ const resolveBinOutputFile = (binDir, name, format, formats) => {
263
+ if (format === 'esm')
264
+ return join$1(binDir, `${name}.mjs`);
265
+ return formats.length === 1 ? join$1(binDir, `${name}.js`) : join$1(binDir, `${name}.cjs.js`);
266
+ };
267
+ const resolveBinFooter = (bin, format) => bin.bootstrap ?? defaultBootstrap({ runner: bin.runner ?? 'default', format });
268
+ /**
269
+ * Builds the worker descriptor for a single bin output (one (bin, format) pair).
270
+ *
271
+ * Bins are self-contained executable scripts: workspace deps are inlined and the
272
+ * worker writes to `<outputPath>/bin/<name>.<ext>` with the shebang banner, the
273
+ * resolved bootstrap footer, and `chmod 0o755` applied.
274
+ *
275
+ * Output naming convention:
276
+ * - ESM: `<name>.mjs`
277
+ * - CJS only: `<name>.js`
278
+ * - CJS alongside ESM: `<name>.cjs.js`
279
+ *
280
+ * @param bin - Bin declaration including name, runner, and per-bin bootstrap override.
281
+ * @param context - Resolved build context.
282
+ * @param format - Format being built (one of `bin.format`'s entries).
283
+ * @param formats - Full list of formats requested for this bin (drives the CJS filename).
284
+ * @param reportPath - Absolute path the worker will write its JSON report to.
285
+ * @returns Descriptor ready to be JSON-serialized for the worker.
286
+ *
287
+ * @example Producing the descriptor for an `hf-build` CJS bin alongside an ESM twin
288
+ * ```typescript
289
+ * const descriptor = toBinBuildDescriptor(bin, context, 'cjs', ['cjs', 'esm'], '/tmp/r.json')
290
+ * ```
291
+ */
292
+ const toBinBuildDescriptor = (bin, context, format, formats, reportPath) => {
293
+ const inputFile = join$1(context.projectRoot, 'src', 'bin', `${bin.name}.ts`);
294
+ const binDir = join$1(context.outputPath, 'bin');
295
+ const outputFile = resolveBinOutputFile(binDir, bin.name, format, formats);
296
+ const bundledDepsRoot = depsRootOf(context);
297
+ const workspaceRoutes = buildWorkspaceRoutes(context.workspaceBundledDeps);
298
+ const useExternalizePlugin = context.bundledDeps.length > 0 || workspaceRoutes.length > 0;
299
+ return {
300
+ format,
301
+ inputFile,
302
+ outputDir: getDirname(outputFile),
303
+ external: [],
304
+ sourcemap: false,
305
+ bundledDepsPlugin: useExternalizePlugin ? { deps: context.bundledDeps, depsRoot: bundledDepsRoot } : null,
306
+ workspaceRoutes,
307
+ tsConfigPath: context.tsConfigPath,
308
+ projectRoot: context.projectRoot,
309
+ workspaceRoot: context.workspaceRoot,
310
+ bundleWorkspaceDeps: true,
311
+ bundle: null,
312
+ bin: {
313
+ outputFile,
314
+ banner: SHEBANG,
315
+ footer: resolveBinFooter(bin, format),
316
+ exports: 'named',
317
+ inlineDynamicImports: true,
318
+ chmod: BIN_FILE_MODE,
319
+ },
320
+ reportPath,
321
+ };
322
+ };
323
+
324
+ const log$1 = logger.channel('builder:bundle:rollup:dispatch');
325
+ const REPORT_DIR_PREFIX = 'hf-builder-rollup-';
326
+ const SWC_NODE_REGISTER = '@swc-node/register';
327
+ const swcNodeAvailable = (workspaceRoot) => existsSync(join(workspaceRoot, 'node_modules', '@swc-node', 'register', 'index.js'));
328
+ /**
329
+ * Default worker-path resolution: prefers the built-and-published artifact, falls
330
+ * back to the workspace dist path, and finally to the in-source TypeScript file
331
+ * via `@swc-node/register` (bootstrap case where builder is building itself for
332
+ * the first time and the dist worker doesn't exist yet).
333
+ *
334
+ * Looks at, in order:
335
+ * 1. `<workspaceRoot>/dist/libs/builder/bundle/rollup/worker/index.cjs.js`
336
+ * 2. `<workspaceRoot>/node_modules/@hyperfrontend/builder/bundle/rollup/worker/index.cjs.js`
337
+ * 3. `<workspaceRoot>/libs/builder/src/bundle/rollup/worker/index.ts` (with `--require \@swc-node/register`)
338
+ *
339
+ * @param workspaceRoot - Absolute workspace root.
340
+ * @returns Worker invocation descriptor, or `undefined` if no candidate exists.
341
+ *
342
+ * @example Locating the worker for an in-workspace consumer
343
+ * ```typescript
344
+ * const invocation = resolveDefaultRollupWorkerPath('/abs/repo')
345
+ * if (!invocation) throw new Error('builder rollup worker artifact not found')
346
+ * ```
347
+ */
348
+ const resolveDefaultRollupWorkerPath = (workspaceRoot) => {
349
+ const distCandidates = [
350
+ join(workspaceRoot, 'dist', 'libs', 'builder', 'bundle', 'rollup', 'worker', 'index.cjs.js'),
351
+ join(workspaceRoot, 'node_modules', '@hyperfrontend', 'builder', 'bundle', 'rollup', 'worker', 'index.cjs.js'),
352
+ ];
353
+ for (const path of distCandidates) {
354
+ if (existsSync(path))
355
+ return { path, execArgv: [] };
356
+ }
357
+ const sourcePath = join(workspaceRoot, 'libs', 'builder', 'src', 'bundle', 'rollup', 'worker', 'index.ts');
358
+ if (existsSync(sourcePath) && swcNodeAvailable(workspaceRoot)) {
359
+ return { path: sourcePath, execArgv: ['--require', SWC_NODE_REGISTER] };
360
+ }
361
+ return undefined;
362
+ };
363
+ const createReportDir = () => mkdtempSync(join(tmpdir(), REPORT_DIR_PREFIX));
364
+ const reportPathFor = (reportDir, descriptor) => {
365
+ const safeLabel = descriptor.inputFile.replace(/[^a-zA-Z0-9_-]+/g, '_');
366
+ return join(reportDir, `${descriptor.format}-${safeLabel}.json`);
367
+ };
368
+ const runOne = (descriptor, options, label) => createPromise((resolve, reject) => {
369
+ const execPath = options.execPath ?? process.execPath;
370
+ const argv = [...(options.execArgv ?? []), options.workerPath, stringify(descriptor)];
371
+ const child = spawn(execPath, argv, { stdio: ['ignore', 'pipe', 'pipe'] });
372
+ let capturedStderr = '';
373
+ child.stdout?.on('data', (chunk) => {
374
+ process.stdout.write(chunk);
375
+ });
376
+ child.stderr?.on('data', (chunk) => {
377
+ const text = typeof chunk === 'string' ? chunk : chunk.toString();
378
+ capturedStderr += text;
379
+ process.stderr.write(text);
380
+ });
381
+ child.on('error', (error) => {
382
+ reject(createError(`rollup worker for ${label} failed to spawn: ${error.message}`));
383
+ });
384
+ child.on('exit', (code) => {
385
+ if (code !== 0) {
386
+ const tail = capturedStderr.trim().split('\n').slice(-10).join('\n');
387
+ reject(createError(`rollup worker for ${label} exited with code ${code}\n${tail}`));
388
+ return;
389
+ }
390
+ resolve();
391
+ });
392
+ });
393
+ const readReport = (reportPath, label) => {
394
+ if (!existsSync(reportPath)) {
395
+ throw createError(`rollup worker for ${label} did not write a report at ${reportPath}`);
396
+ }
397
+ const data = parse(readFileSync(reportPath, 'utf8'));
398
+ return data;
399
+ };
400
+ /**
401
+ * Forks a single rollup worker for the supplied descriptor and waits for it
402
+ * to exit. The caller-provided descriptor's `reportPath` is overwritten with
403
+ * a temp-dir path created by this function.
404
+ *
405
+ * Each worker writes a JSON report at the temp path; this function reads it
406
+ * after the child exits and returns the per-job statistics. If the worker
407
+ * exits non-zero or fails to produce a report, the function throws with a
408
+ * label-rich message.
409
+ *
410
+ * The temp report directory is cleaned up before returning, regardless of
411
+ * success or failure.
412
+ *
413
+ * @param descriptor - Build descriptor to dispatch.
414
+ * @param options - Worker path + optional memory monitor.
415
+ * @returns Worker report (output size + memory + duration) for the dispatched job.
416
+ *
417
+ * @example Dispatching a single ESM build
418
+ * ```typescript
419
+ * const report = await dispatchRollupWorker(descriptor, { workerPath: '/abs/dist/.../worker.cjs.js' })
420
+ * ```
421
+ */
422
+ const dispatchRollupWorker = async (descriptor, options) => {
423
+ const reportDir = createReportDir();
424
+ const label = options.label ?? `${descriptor.format}:${descriptor.inputFile}`;
425
+ const reportPath = reportPathFor(reportDir, descriptor);
426
+ const job = { ...descriptor, reportPath };
427
+ try {
428
+ options.monitor?.check(`bundle:rollup:dispatch:${label}:start`);
429
+ log$1.info(`rollup dispatch: ${label}`);
430
+ await runOne(job, options, label);
431
+ const report = readReport(reportPath, label);
432
+ log$1.debug(`rollup dispatch done: ${label} size=${report.outputSize}B heap=${report.endHeapMB.toFixed(1)}MB rss=${report.endRssMB.toFixed(1)}MB t=${report.durationMs}ms`);
433
+ options.monitor?.check(`bundle:rollup:dispatch:${label}:end`);
434
+ return report;
435
+ }
436
+ finally {
437
+ rmSync(reportDir, { recursive: true, force: true });
438
+ }
439
+ };
440
+
441
+ const log = logger.channel('builder:bin:script');
442
+ const resolveWorkerOrThrow = (workspaceRoot) => {
443
+ const invocation = resolveDefaultRollupWorkerPath(workspaceRoot);
444
+ if (!invocation) {
445
+ throw createError('rollup worker could not be resolved for bin script bundling. Build @hyperfrontend/builder at least once before invoking the bin phase, or ensure @swc-node/register is installed for source-mode bootstrap.');
446
+ }
447
+ return invocation;
448
+ };
449
+ /**
450
+ * Builds the JS outputs for a single bin declaration.
451
+ *
452
+ * For each declared format (CJS / ESM), forks a rollup worker that bundles
453
+ * `src/bin/<name>.ts`, prepends the `#!/usr/bin/env node` shebang, appends the
454
+ * resolved bootstrap footer (per-bin override or `defaultBootstrap`), writes
455
+ * the output to `<outputPath>/bin/<name>.<ext>`, and chmods it to `0o755` so
456
+ * the npm bin symlink is invokable. The worker isolates the heavy bin bundle
457
+ * (rollup + plugins + transitive deps loaded into the child) from the parent
458
+ * process.
459
+ *
460
+ * Output naming follows the convention:
461
+ * - ESM: `<name>.mjs`
462
+ * - CJS only: `<name>.js`
463
+ * - CJS alongside ESM: `<name>.cjs.js`
464
+ *
465
+ * Workspace dependencies are always inlined into bin bundles — bins are intended
466
+ * to ship as self-contained executable scripts.
467
+ *
468
+ * @param bin - Bin declaration including name, format(s), optional runner override, and bootstrap override.
469
+ * @param ctx - Resolved build context.
470
+ * @returns One `BinOutput` per emitted JS artifact.
471
+ *
472
+ * @example Building a CJS-only bin
473
+ * ```typescript
474
+ * const outputs = await buildJsBin({ name: 'cz', format: 'cjs', runner: 'runCz' }, context)
475
+ * ```
476
+ *
477
+ * @example Building dual CJS + ESM outputs
478
+ * ```typescript
479
+ * const outputs = await buildJsBin({ name: 'hf-build', format: ['cjs', 'esm'] }, context)
480
+ * ```
481
+ */
482
+ const buildJsBin = async (bin, ctx) => {
483
+ const formats = normalizeFormats(bin.format);
484
+ const binDir = join(ctx.outputPath, 'bin');
485
+ ensureDir(binDir);
486
+ const worker = resolveWorkerOrThrow(ctx.workspaceRoot);
487
+ const outputs = [];
488
+ for (const format of formats) {
489
+ const descriptor = toBinBuildDescriptor(bin, ctx, format, formats, '');
490
+ log.info(`building ${format} bin: ${bin.name}`);
491
+ await dispatchRollupWorker(descriptor, {
492
+ workerPath: worker.path,
493
+ execArgv: worker.execArgv,
494
+ label: `bin:${bin.name}:${format}`,
495
+ });
496
+ outputs.push({ name: bin.name, kind: format, outputPath: descriptor.bin?.outputFile });
497
+ }
498
+ return outputs;
499
+ };
500
+
501
+ const findCjsOutputPath = (jsOutputs) => {
502
+ for (const output of jsOutputs)
503
+ if (output.kind === 'cjs')
504
+ return output.outputPath;
505
+ return undefined;
506
+ };
507
+ /**
508
+ * Runs the bin phase: builds every declared JS bin, then emits a Node SEA native
509
+ * binary for any bin that opts in via `bin.sea`. Returns the flattened list of
510
+ * every output produced.
511
+ *
512
+ * A bin that declares a `sea` block must also produce a CJS output (`format: 'cjs'`
513
+ * or include `'cjs'` in the list); the CJS artifact becomes the SEA `main` script,
514
+ * and a bin without one throws. Native emission is skipped silently with an info
515
+ * log when the current host doesn't match any declared platform — CI orchestrates
516
+ * the matrix so each declared platform is built on the matching runner.
517
+ *
518
+ * @param ctx - Resolved build context.
519
+ * @param bins - Bin declarations to synthesize. Pass an empty array (or omit
520
+ * `config.bin` from the facade) to skip the phase entirely.
521
+ * @returns Flattened list of all bin outputs produced during the phase.
522
+ *
523
+ * @example Running the bin phase from a custom orchestrator
524
+ * ```typescript
525
+ * const binOutputs = await runBinPhase(context, config.bin ?? [])
526
+ * ```
527
+ */
528
+ const runBinPhase = async (ctx, bins) => {
529
+ const outputs = [];
530
+ for (const bin of bins) {
531
+ const jsOutputs = await buildJsBin(bin, ctx);
532
+ outputs.push(...jsOutputs);
533
+ if (!bin.sea)
534
+ continue;
535
+ const cjsOutputPath = findCjsOutputPath(jsOutputs);
536
+ if (!cjsOutputPath) {
537
+ throw createError(`SEA requires a CJS bin output; declare format: ['cjs'] or format: 'cjs' on bin ${bin.name}`);
538
+ }
539
+ await recover();
540
+ const nativeOutputs = await buildNativeBin({ bin, ctx, cjsOutputPath });
541
+ outputs.push(...nativeOutputs);
542
+ }
543
+ return outputs;
544
+ };
545
+
546
+ export { runBinPhase };
@@ -0,0 +1,44 @@
1
+ import type { BinConfig, BinOutput, BuildContext } from '../../models';
2
+ /**
3
+ * Inputs to {@link buildNativeBin}.
4
+ */
5
+ export interface BuildNativeBinInputs {
6
+ /** Bin declaration. Must include a `sea` block; otherwise the function throws. */
7
+ bin: BinConfig;
8
+ /** Resolved build context. */
9
+ ctx: BuildContext;
10
+ /** Absolute path to the CJS bundle the SEA blob will execute. Must already be written to disk. */
11
+ cjsOutputPath: string;
12
+ }
13
+ /**
14
+ * Builds the Node SEA native binary for a single bin declaration.
15
+ *
16
+ * Pipeline (current-platform-only — cross-platform matrices are orchestrated externally):
17
+ * 1. Validate the bin declares CJS — SEA requires a CJS bundle as the embedded script.
18
+ * 2. Skip silently with an info log if the current host doesn't match any declared platform.
19
+ * 3. Generate the SEA config JSON and write it to disk.
20
+ * 4. Spawn `node --experimental-sea-config <path>` to emit the SEA preparation blob.
21
+ * 5. Resolve the Node host binary for the current platform (defaults to `process.execPath`).
22
+ * 6. Dispatch a forked inject worker that clones the host, embeds the blob via
23
+ * postject, and writes the output binary.
24
+ * 7. On macOS, strip the signature the injection invalidated so the unsigned binary still runs.
25
+ * 8. Delete the SEA build intermediates (config JSON + prep blob) so only the
26
+ * runtime binary remains in the publishable output.
27
+ *
28
+ * Native binaries are not auto-wired into `package.json#bin` — they are shipped
29
+ * as separate release artifacts.
30
+ *
31
+ * @param inputs - Bin declaration, resolved context, and the path to the already-built CJS bundle.
32
+ * @returns A single {@link BinOutput} of kind `native` for the current platform, or `[]` if skipped.
33
+ *
34
+ * @example Producing the SEA binary for the current runner
35
+ * ```typescript
36
+ * const outputs = await buildNativeBin({
37
+ * bin: { name: 'hf-build', format: 'cjs', sea: { platforms: ['linux-x64'] } },
38
+ * ctx: context,
39
+ * cjsOutputPath: '/abs/dist/libs/builder/bin/hf-build.js',
40
+ * })
41
+ * ```
42
+ */
43
+ export declare const buildNativeBin: (inputs: BuildNativeBinInputs) => Promise<BinOutput[]>;
44
+ //# sourceMappingURL=build-native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-native.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/builder/src/bin/native/build-native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAe,MAAM,cAAc,CAAA;AA0BnF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,kFAAkF;IAClF,GAAG,EAAE,SAAS,CAAA;IACd,8BAA8B;IAC9B,GAAG,EAAE,YAAY,CAAA;IACjB,kGAAkG;IAClG,aAAa,EAAE,MAAM,CAAA;CACtB;AAyBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,cAAc,GAAU,QAAQ,oBAAoB,KAAG,OAAO,CAAC,SAAS,EAAE,CAgEtF,CAAA"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Inputs to {@link removeCodesign}.
3
+ */
4
+ export interface RemoveCodesignInputs {
5
+ /** Absolute path to the binary whose existing macOS signature should be removed. */
6
+ binary: string;
7
+ }
8
+ /**
9
+ * Inputs to {@link applyCodesign}.
10
+ */
11
+ export interface ApplyCodesignInputs {
12
+ /** Absolute path to the binary to sign. */
13
+ binary: string;
14
+ /** Signing identity passed to `codesign --sign`. Use `'-'` for an ad-hoc signature. */
15
+ identity?: string;
16
+ }
17
+ /**
18
+ * Result of a codesign invocation.
19
+ */
20
+ export interface CodesignResult {
21
+ /** Whether the codesign command was attempted (skipped silently on non-macOS hosts). */
22
+ ran: boolean;
23
+ /** Exit status of the codesign command, or `null` if it was skipped or did not start. */
24
+ status: number | null;
25
+ /** Captured stderr, useful for surfacing diagnostics. */
26
+ stderr: string;
27
+ }
28
+ /**
29
+ * Strips the macOS code signature from `inputs.binary` (via
30
+ * `codesign --remove-signature`) after postject's blob injection has
31
+ * invalidated it, leaving an unsigned binary that runs locally. No-op on
32
+ * non-macOS hosts.
33
+ *
34
+ * Re-signing the produced binary (with a real Apple Developer ID) is left to
35
+ * release tooling; this step only produces an unsigned executable that runs
36
+ * locally.
37
+ *
38
+ * @param inputs - Path to the binary to clean up.
39
+ * @returns Whether the command ran, its exit status, and captured stderr.
40
+ *
41
+ * @example Removing the signature on macOS before postject inject
42
+ * ```typescript
43
+ * removeCodesign({ binary: '/abs/dist/libs/builder/bin/hf-build.darwin-arm64' })
44
+ * ```
45
+ */
46
+ export declare const removeCodesign: (inputs: RemoveCodesignInputs) => CodesignResult;
47
+ /**
48
+ * Applies an ad-hoc (or identity-based) macOS code signature to the produced
49
+ * SEA binary. No-op on non-macOS hosts.
50
+ *
51
+ * Defaults to `--sign -` (ad-hoc signing), which is sufficient for local
52
+ * execution and satisfies macOS Catalina+ launch requirements without an
53
+ * Apple Developer identity. Release tooling can pass a real identity via
54
+ * `inputs.identity`.
55
+ *
56
+ * @param inputs - Binary path and optional signing identity.
57
+ * @returns Whether the command ran, its exit status, and captured stderr.
58
+ *
59
+ * @example Ad-hoc signing the produced SEA binary on macOS
60
+ * ```typescript
61
+ * applyCodesign({ binary: '/abs/dist/libs/builder/bin/hf-build.darwin-arm64' })
62
+ * ```
63
+ */
64
+ export declare const applyCodesign: (inputs: ApplyCodesignInputs) => CodesignResult;
65
+ //# sourceMappingURL=codesign.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codesign.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/builder/src/bin/native/codesign.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,oFAAoF;IACpF,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAA;IACd,uFAAuF;IACvF,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,wFAAwF;IACxF,GAAG,EAAE,OAAO,CAAA;IACZ,yFAAyF;IACzF,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAA;CACf;AAID;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,oBAAoB,KAAG,cAQ7D,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,mBAAmB,KAAG,cAS3D,CAAA"}