@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,964 @@
1
+ 'use strict';
2
+
3
+ const node_module = require('node:module');
4
+ const node_path = require('node:path');
5
+ const node_child_process = require('node:child_process');
6
+ const node_fs = require('node:fs');
7
+ const node_os = require('node:os');
8
+ const index_cjs_js$4 = require('../../_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/error/index.cjs.js');
9
+ const index_cjs_js$3 = require('../../_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/json/index.cjs.js');
10
+ const index_cjs_js$2 = require('../../_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/promise/index.cjs.js');
11
+ const index_cjs_js = require('../../_dependencies/@hyperfrontend/logging/index.cjs.js');
12
+ const index_cjs_js$1 = require('../../_dependencies/@hyperfrontend/project-scope/core/index.cjs.js');
13
+ const index_cjs_js$7 = require('../../_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/array/index.cjs.js');
14
+ const index_cjs_js$6 = require('../../_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/object/index.cjs.js');
15
+ const index_cjs_js$5 = require('../../_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/set/index.cjs.js');
16
+ const index_cjs_js$8 = require('../../_dependencies/@hyperfrontend/project-scope/core/fs/index.cjs.js');
17
+ const index_cjs_js$a = require('../../_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/map/index.cjs.js');
18
+ const index_cjs_js$9 = require('../../_dependencies/@hyperfrontend/project-scope/core/path/index.cjs.js');
19
+ const commonjs = require('../../_dependencies/@rollup/plugin-commonjs/index.cjs.js');
20
+ const json = require('../../_dependencies/@rollup/plugin-json/index.cjs.js');
21
+ const nodeResolve = require('../../_dependencies/@rollup/plugin-node-resolve/index.cjs.js');
22
+ const typescript = require('../../_dependencies/@rollup/plugin-typescript/index.cjs.js');
23
+ const index_cjs_js$b = require('../../_dependencies/rollup/index.cjs.js');
24
+ const { normalizeToForwardSlashes, join } = require('../../_shared/bundle/fs/posix-path/index.cjs.js');
25
+ const { relativeImport, buildWorkspaceRoutes, createExternalizeBundledDepsPlugin } = require('../../_shared/bundle/dependencies/externalize-plugin/index.cjs.js');
26
+
27
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
28
+
29
+ const commonjs__default = /*#__PURE__*/_interopDefaultCompat(commonjs);
30
+ const json__default = /*#__PURE__*/_interopDefaultCompat(json);
31
+ const nodeResolve__default = /*#__PURE__*/_interopDefaultCompat(nodeResolve);
32
+ const typescript__default = /*#__PURE__*/_interopDefaultCompat(typescript);
33
+
34
+ const log = index_cjs_js.logger.channel('builder:bundle:dependencies:pre-pass');
35
+ const REPORT_DIR_PREFIX = 'hf-builder-prepass-';
36
+ const createReportDir = () => node_fs.mkdtempSync(index_cjs_js$1.join(node_os.tmpdir(), REPORT_DIR_PREFIX));
37
+ const reportPathFor = (reportDir, job, index) => index_cjs_js$1.join(reportDir, `${index}-${job.dep.replace(/\//g, '__')}-${job.kind}-${job.format}.json`);
38
+ const runOne = (job, reportPath, options) => index_cjs_js$2.createPromise((resolve, reject) => {
39
+ const execPath = options.execPath ?? process.execPath;
40
+ const argv = [...(options.execArgv ?? []), options.workerPath, index_cjs_js$3.stringify({ ...job, reportPath })];
41
+ const child = node_child_process.spawn(execPath, argv, { stdio: ['ignore', 'pipe', 'pipe'] });
42
+ let capturedStderr = '';
43
+ child.stdout?.on('data', (chunk) => {
44
+ process.stdout.write(chunk);
45
+ });
46
+ child.stderr?.on('data', (chunk) => {
47
+ const text = typeof chunk === 'string' ? chunk : chunk.toString();
48
+ capturedStderr += text;
49
+ process.stderr.write(text);
50
+ });
51
+ child.on('error', (error) => {
52
+ reject(index_cjs_js$4.createError(`pre-pass worker for ${job.dep} (${job.kind}/${job.format}) failed to spawn: ${error.message}`));
53
+ });
54
+ child.on('exit', (code) => {
55
+ if (code !== 0) {
56
+ const tail = capturedStderr.trim().split('\n').slice(-10).join('\n');
57
+ reject(index_cjs_js$4.createError(`pre-pass worker for ${job.dep} (${job.kind}/${job.format}) exited with code ${code}\n${tail}`));
58
+ return;
59
+ }
60
+ resolve();
61
+ });
62
+ });
63
+ const readReport = (reportPath, job) => {
64
+ if (!node_fs.existsSync(reportPath)) {
65
+ throw index_cjs_js$4.createError(`pre-pass worker for ${job.dep} (${job.kind}/${job.format}) did not write a report at ${reportPath}`);
66
+ }
67
+ const data = index_cjs_js$3.parse(node_fs.readFileSync(reportPath, 'utf8'));
68
+ return { job, outputSize: data.outputSize, endHeapMB: data.endHeapMB, endRssMB: data.endRssMB, durationMs: data.durationMs };
69
+ };
70
+ const SWC_NODE_REGISTER = '@swc-node/register';
71
+ const swcNodeAvailable = (workspaceRoot) => node_fs.existsSync(index_cjs_js$1.join(workspaceRoot, 'node_modules', '@swc-node', 'register', 'index.js'));
72
+ /**
73
+ * Default worker-path resolution: prefers the built-and-published artifact, falls
74
+ * back to the workspace dist path, and finally to the in-source TypeScript file
75
+ * via `@swc-node/register` (bootstrap case where builder is building itself for
76
+ * the first time and the dist worker doesn't exist yet).
77
+ *
78
+ * Looks at, in order:
79
+ * 1. `<workspaceRoot>/dist/libs/builder/bundle/dependencies/worker/index.cjs.js`
80
+ * 2. `<workspaceRoot>/node_modules/@hyperfrontend/builder/bundle/dependencies/worker/index.cjs.js`
81
+ * 3. `<workspaceRoot>/libs/builder/src/bundle/dependencies/worker/index.ts` (with `--require \@swc-node/register`)
82
+ *
83
+ * @param workspaceRoot - Absolute workspace root.
84
+ * @returns Worker invocation descriptor, or `undefined` if no candidate exists.
85
+ *
86
+ * @example Locating the worker for an in-workspace consumer
87
+ * ```typescript
88
+ * const invocation = resolveDefaultWorkerPath('/abs/repo')
89
+ * if (!invocation) throw new Error('builder worker artifact not found')
90
+ * ```
91
+ */
92
+ const resolveDefaultWorkerPath = (workspaceRoot) => {
93
+ const distCandidates = [
94
+ index_cjs_js$1.join(workspaceRoot, 'dist', 'libs', 'builder', 'bundle', 'dependencies', 'worker', 'index.cjs.js'),
95
+ index_cjs_js$1.join(workspaceRoot, 'node_modules', '@hyperfrontend', 'builder', 'bundle', 'dependencies', 'worker', 'index.cjs.js'),
96
+ ];
97
+ for (const path of distCandidates) {
98
+ if (node_fs.existsSync(path))
99
+ return { path, execArgv: [] };
100
+ }
101
+ const sourcePath = index_cjs_js$1.join(workspaceRoot, 'libs', 'builder', 'src', 'bundle', 'dependencies', 'worker', 'index.ts');
102
+ if (node_fs.existsSync(sourcePath) && swcNodeAvailable(workspaceRoot)) {
103
+ return { path: sourcePath, execArgv: ['--require', SWC_NODE_REGISTER] };
104
+ }
105
+ return undefined;
106
+ };
107
+ /**
108
+ * Sequentially runs the supplied pre-pass jobs by forking a fresh Node child
109
+ * per invocation. Strict sequential execution is mandatory — concurrent
110
+ * children would simultaneously pressure RAM and OOM the container.
111
+ *
112
+ * Each child writes a JSON report to a parent-supplied path; this function
113
+ * reads the report after the child exits and accumulates per-job statistics.
114
+ * If any worker exits non-zero or fails to produce a report, the function
115
+ * throws with the failed job's context.
116
+ *
117
+ * The report directory is created in the OS temp dir and removed before
118
+ * returning, regardless of success or failure.
119
+ *
120
+ * @param jobs - Pre-pass jobs to run.
121
+ * @param options - Worker path + optional memory monitor.
122
+ * @returns One result per supplied job, in the order the jobs were given.
123
+ *
124
+ * @example Pre-passing rollup and one of its plugins
125
+ * ```typescript
126
+ * const results = await runPrePass(jobs, { workerPath: '/abs/dist/libs/builder/bundle/dependencies/worker.cjs.js' })
127
+ * ```
128
+ */
129
+ const runPrePass = async (jobs, options) => {
130
+ if (jobs.length === 0)
131
+ return [];
132
+ const reportDir = createReportDir();
133
+ const results = [];
134
+ try {
135
+ for (const [index, job] of jobs.entries()) {
136
+ const reportPath = reportPathFor(reportDir, job, index);
137
+ log.info(`pre-pass ${index + 1}/${jobs.length}: ${job.dep} (${job.kind}/${job.format})`);
138
+ options.monitor?.check(`bundle:dependencies:prepass:${index + 1}/${jobs.length}:${job.dep}:${job.kind}:${job.format}:start`);
139
+ await runOne(job, reportPath, options);
140
+ const result = readReport(reportPath, job);
141
+ log.debug(`pre-pass ${index + 1}/${jobs.length} done: ${job.dep} size=${result.outputSize}B heap=${result.endHeapMB.toFixed(1)}MB rss=${result.endRssMB.toFixed(1)}MB t=${result.durationMs}ms`);
142
+ options.monitor?.check(`bundle:dependencies:prepass:${index + 1}/${jobs.length}:${job.dep}:${job.kind}:${job.format}:end`);
143
+ results.push(result);
144
+ }
145
+ return results;
146
+ }
147
+ finally {
148
+ node_fs.rmSync(reportDir, { recursive: true, force: true });
149
+ }
150
+ };
151
+
152
+ /**
153
+ * Packages that are never eligible for bundling, regardless of how they're
154
+ * declared or what overrides the caller supplies.
155
+ *
156
+ * `typescript` is the lone permanent entry: it is a consumer requirement of
157
+ * every `@hyperfrontend/builder` project, far too large to inline, and its
158
+ * monolithic `lib/typescript.d.ts` defeats `rollup-plugin-dts`. The framework
159
+ * refuses to bundle it so this invariant cannot be undone by configuration.
160
+ */
161
+ const ALWAYS_EXCLUDED = index_cjs_js$5.createSet(['typescript']);
162
+ const readPkg$1 = (packageJsonPath) => (index_cjs_js$8.exists(packageJsonPath) ? index_cjs_js$8.readJsonFile(packageJsonPath) : {});
163
+ /**
164
+ * Resolves the list of third-party dependencies that should be pre-passed
165
+ * (bundled once into `_dependencies/<dep>/`) for the build.
166
+ *
167
+ * Algorithm:
168
+ * 1. Read `dependencies` from the project's `package.json`.
169
+ * 2. Subtract `peerDependencies` — those stay external.
170
+ * 3. Subtract anything matching `isWorkspacePackage` — workspace deps are inlined per the existing flow.
171
+ * 4. Apply `include` / `exclude` overrides.
172
+ *
173
+ * The returned list is sorted and de-duplicated.
174
+ *
175
+ * @param packageJsonPath - Absolute path to the project's `package.json`.
176
+ * @param options - Caller overrides.
177
+ * @returns Sorted list of third-party package names to pre-pass.
178
+ *
179
+ * @example Resolving bundled deps for a workspace library
180
+ * ```typescript
181
+ * const deps = resolveBundledDeps('/abs/libs/foo/package.json', {
182
+ * isWorkspacePackage: (n) => n.startsWith('@hyperfrontend/'),
183
+ * })
184
+ * ```
185
+ */
186
+ const resolveBundledDeps = (packageJsonPath, options = {}) => {
187
+ const pkg = readPkg$1(packageJsonPath);
188
+ const deps = index_cjs_js$6.keys(pkg.dependencies ?? {});
189
+ const peerDeps = index_cjs_js$5.createSet(index_cjs_js$6.keys(pkg.peerDependencies ?? {}));
190
+ const isWorkspace = options.isWorkspacePackage ?? (() => false);
191
+ const includeSet = index_cjs_js$5.createSet(options.include ?? []);
192
+ const excludeSet = index_cjs_js$5.createSet(options.exclude ?? []);
193
+ const eligible = deps.filter((name) => !peerDeps.has(name) && !isWorkspace(name) && !ALWAYS_EXCLUDED.has(name));
194
+ const merged = index_cjs_js$5.createSet([...eligible, ...includeSet]);
195
+ const filtered = index_cjs_js$7.from(merged).filter((name) => !excludeSet.has(name) && !peerDeps.has(name) && !isWorkspace(name) && !ALWAYS_EXCLUDED.has(name));
196
+ return filtered.sort();
197
+ };
198
+
199
+ const readPkg = (packageJsonPath) => (index_cjs_js$8.exists(packageJsonPath) ? index_cjs_js$8.readJsonFile(packageJsonPath) : {});
200
+ const dirnameOf$1 = (filePath) => {
201
+ const normalized = index_cjs_js$9.normalizeToForwardSlashes(filePath);
202
+ const idx = normalized.lastIndexOf('/');
203
+ return idx <= 0 ? normalized : normalized.slice(0, idx);
204
+ };
205
+ const absolutize = (relativeTo, value) => {
206
+ if (node_path.isAbsolute(value))
207
+ return index_cjs_js$9.normalizeToForwardSlashes(value);
208
+ return index_cjs_js$9.normalizeToForwardSlashes(node_path.resolve(relativeTo, value));
209
+ };
210
+ /**
211
+ * Reads a tsconfig and follows its `extends` chain to merge `compilerOptions.paths`.
212
+ * Later (i.e. inheriting) configs win on key collisions. Each `paths` entry is
213
+ * stored relative to the originating tsconfig's `baseUrl`, which is itself
214
+ * relative to the tsconfig's directory; we absolutize as we go so callers can
215
+ * rely on the returned values being absolute.
216
+ *
217
+ * The function tolerates missing `extends` targets — a typical layout has the
218
+ * project tsconfig extending a workspace-root one, which extends nothing.
219
+ *
220
+ * @param tsconfigPath - Absolute path to the tsconfig to read.
221
+ * @param visited - Set of tsconfig paths already followed (cycle guard).
222
+ * @returns Map keyed by `paths` entry name, with each value an array of absolute candidate paths.
223
+ */
224
+ const readTsconfigPaths = (tsconfigPath, visited = index_cjs_js$5.createSet([])) => {
225
+ const result = index_cjs_js$a.createMap([]);
226
+ if (visited.has(tsconfigPath))
227
+ return result;
228
+ visited.add(tsconfigPath);
229
+ const fragment = index_cjs_js$8.readJsonFileIfExists(tsconfigPath);
230
+ if (!fragment)
231
+ return result;
232
+ if (fragment.extends) {
233
+ const extendsPath = absolutize(dirnameOf$1(tsconfigPath), fragment.extends);
234
+ const extendsResolved = extendsPath.endsWith('.json') ? extendsPath : `${extendsPath}.json`;
235
+ const inherited = readTsconfigPaths(extendsResolved, visited);
236
+ for (const [key, paths] of inherited)
237
+ result.set(key, paths);
238
+ }
239
+ const localBaseUrl = absolutize(dirnameOf$1(tsconfigPath), fragment.compilerOptions?.baseUrl ?? '.');
240
+ const localPaths = fragment.compilerOptions?.paths ?? {};
241
+ for (const key of index_cjs_js$6.keys(localPaths)) {
242
+ const list = (localPaths[key] ?? []).map((rel) => absolutize(localBaseUrl, rel));
243
+ result.set(key, list);
244
+ }
245
+ return result;
246
+ };
247
+ /**
248
+ * Loads tsconfig path-mappings from a workspace, preferring `tsconfig.base.json`
249
+ * at the workspace root and falling back to a `tsconfig.json` extends chain when
250
+ * the base form is absent.
251
+ *
252
+ * @param workspaceRoot - Absolute workspace root.
253
+ * @returns Map keyed by tsconfig `paths` key (e.g. `@hyperfrontend/logging`),
254
+ * with values pointing at absolute source files.
255
+ *
256
+ * @example Loading the workspace's path-mapping table
257
+ * ```typescript
258
+ * const paths = loadWorkspacePathMappings('/abs/repo')
259
+ * paths.get('@hyperfrontend/logging') // => ['/abs/repo/libs/logging/src/index.ts']
260
+ * ```
261
+ */
262
+ const loadWorkspacePathMappings = (workspaceRoot) => {
263
+ const candidates = [index_cjs_js$9.join(workspaceRoot, 'tsconfig.base.json'), index_cjs_js$9.join(workspaceRoot, 'tsconfig.json')];
264
+ for (const candidate of candidates) {
265
+ if (!index_cjs_js$8.exists(candidate))
266
+ continue;
267
+ const map = readTsconfigPaths(candidate);
268
+ if (map.size > 0)
269
+ return map;
270
+ }
271
+ return index_cjs_js$a.createMap([]);
272
+ };
273
+ /**
274
+ * Splits a tsconfig key like `@hyperfrontend/foo/bar/baz` into the package name
275
+ * (`@hyperfrontend/foo`) and the sub-path (`bar/baz`). Returns `''` for the
276
+ * sub-path when the key is the package root.
277
+ *
278
+ * @param specifier - Tsconfig `paths` key.
279
+ * @returns Split into `packageName` and `subPath`.
280
+ */
281
+ const splitSpecifier = (specifier) => {
282
+ if (specifier.startsWith('@')) {
283
+ const slashAfterScope = specifier.indexOf('/');
284
+ if (slashAfterScope < 0)
285
+ return { packageName: specifier, subPath: '' };
286
+ const slashAfterName = specifier.indexOf('/', slashAfterScope + 1);
287
+ if (slashAfterName < 0)
288
+ return { packageName: specifier, subPath: '' };
289
+ return { packageName: specifier.slice(0, slashAfterName), subPath: specifier.slice(slashAfterName + 1) };
290
+ }
291
+ const slash = specifier.indexOf('/');
292
+ if (slash < 0)
293
+ return { packageName: specifier, subPath: '' };
294
+ return { packageName: specifier.slice(0, slash), subPath: specifier.slice(slash + 1) };
295
+ };
296
+ const firstResolvable = (paths) => {
297
+ for (const candidate of paths) {
298
+ if (index_cjs_js$8.exists(candidate))
299
+ return candidate;
300
+ }
301
+ return undefined;
302
+ };
303
+ /**
304
+ * Walks parent directories upward from `fromPath` until a `package.json` is
305
+ * found, then returns the directory that owns it. Used to pin a workspace
306
+ * dep's source file back to its own project root so we can locate that dep's
307
+ * tsconfig.
308
+ *
309
+ * @param fromPath - Absolute path to a `.ts` source file inside the dep.
310
+ * @returns The dep's project-root directory, or `undefined` when no `package.json` ancestor exists.
311
+ */
312
+ const findOwningProjectRoot = (fromPath) => {
313
+ const normalized = index_cjs_js$9.normalizeToForwardSlashes(fromPath);
314
+ const segments = normalized.split('/').filter((s) => s.length > 0);
315
+ for (let i = segments.length; i > 0; i--) {
316
+ const candidateDir = `/${segments.slice(0, i).join('/')}`;
317
+ if (index_cjs_js$8.exists(`${candidateDir}/package.json`))
318
+ return candidateDir;
319
+ }
320
+ return undefined;
321
+ };
322
+ const TSCONFIG_CANDIDATES = ['tsconfig.lib.json', 'tsconfig.json'];
323
+ /**
324
+ * Locates the tsconfig the typescript plugin should use when transforming a
325
+ * workspace dep's source. Prefers `tsconfig.lib.json` (the build-time config
326
+ * used by the dep itself) and falls back to `tsconfig.json` so non-publishable
327
+ * deps remain compilable.
328
+ *
329
+ * @param projectRoot - Absolute path to the dep's project-root directory.
330
+ * @returns Absolute path to the chosen tsconfig, or `undefined` when none of the candidates exist.
331
+ */
332
+ const findDepTsConfig = (projectRoot) => {
333
+ for (const name of TSCONFIG_CANDIDATES) {
334
+ const candidate = index_cjs_js$9.join(projectRoot, name);
335
+ if (index_cjs_js$8.exists(candidate))
336
+ return candidate;
337
+ }
338
+ return undefined;
339
+ };
340
+ const collectMatchingSpecifiers = (packageName, mappings) => {
341
+ const matches = [];
342
+ for (const [specifier, paths] of mappings) {
343
+ const split = splitSpecifier(specifier);
344
+ if (split.packageName !== packageName)
345
+ continue;
346
+ const inputPath = firstResolvable(paths);
347
+ if (!inputPath)
348
+ continue;
349
+ matches.push({ specifier, inputPath });
350
+ }
351
+ return matches;
352
+ };
353
+ /**
354
+ * Resolves the list of workspace `@hyperfrontend/*` deps that should be hoisted
355
+ * into `_dependencies/<name>(/<sub>)?/index.<ext>.js`.
356
+ *
357
+ * Algorithm:
358
+ * 1. Read the project's `package.json#dependencies`, retain entries matching
359
+ * `isWorkspacePackage`, and apply caller `include` / `exclude` overrides.
360
+ * Peer deps and excluded packages are skipped; `include` cannot resurrect a
361
+ * peer dep.
362
+ * 2. Load workspace path-mappings (tsconfig `paths`).
363
+ * 3. For each eligible workspace dep, apply the per-dep hoist policy
364
+ * (`options.policy`, defaulting to `'sub-path'`):
365
+ * - `'sub-path'` (the zero-config default) emits one entry per resolvable
366
+ * tsconfig specifier (root + every sub-path with a real source file),
367
+ * preserving sub-module granularity and supporting subpath-only packages
368
+ * that expose no root export.
369
+ * - `'whole-surface'` is an explicit opt-in collapse: it emits a single entry
370
+ * for the package root, so it requires the dep to expose a root export.
371
+ * 4. The returned list is sorted by `specifier` for stable downstream ordering.
372
+ *
373
+ * Because the caller requested `bundleAllDeps`, an eligible dep that cannot be
374
+ * fully resolved is a contract violation, not a soft skip. The function throws
375
+ * (rather than silently externalising) when an eligible dep has no resolvable
376
+ * tsconfig mapping, when a mapped source has no owning tsconfig, or when a dep
377
+ * is explicitly opted into `'whole-surface'` yet exposes no root export — each
378
+ * with a message naming the dep and the remedy.
379
+ *
380
+ * @param packageJsonPath - Absolute path to the project's `package.json`.
381
+ * @param workspaceRoot - Absolute workspace root used to load `tsconfig.base.json` paths.
382
+ * @param options - Caller overrides + workspace-package predicate + per-package policy map.
383
+ * @returns Resolved workspace-dep pre-pass entries sorted by specifier.
384
+ * @throws {Error} When an eligible workspace dep cannot be bundled (no mapping, no root export under `'whole-surface'`, or no owning tsconfig).
385
+ *
386
+ * @example Resolving workspace pre-pass entries for builder
387
+ * ```typescript
388
+ * const entries = resolveWorkspaceBundledDeps(
389
+ * '/abs/libs/builder/package.json',
390
+ * '/abs/repo',
391
+ * { isWorkspacePackage: (n) => n.startsWith('@hyperfrontend/') }
392
+ * )
393
+ * ```
394
+ */
395
+ const resolveWorkspaceBundledDeps = (packageJsonPath, workspaceRoot, options) => {
396
+ const pkg = readPkg(packageJsonPath);
397
+ const declared = index_cjs_js$6.keys(pkg.dependencies ?? {});
398
+ const peerDeps = index_cjs_js$5.createSet(index_cjs_js$6.keys(pkg.peerDependencies ?? {}));
399
+ const includeSet = index_cjs_js$5.createSet(options.include ?? []);
400
+ const excludeSet = index_cjs_js$5.createSet(options.exclude ?? []);
401
+ const isWorkspace = options.isWorkspacePackage;
402
+ const policyMap = options.policy ?? {};
403
+ // why: granularity is the zero-config default — every public sub-path becomes its own chunk so consumers reuse/tree-shake at sub-module resolution, and subpath-only packages resolve with no configuration. `'whole-surface'` is an explicit opt-in collapse.
404
+ const policyFor = (name) => policyMap[name] ?? 'sub-path';
405
+ const eligible = declared.filter((name) => isWorkspace(name) && !peerDeps.has(name));
406
+ const merged = index_cjs_js$5.createSet([...eligible, ...index_cjs_js$7.from(includeSet).filter((name) => isWorkspace(name) && !peerDeps.has(name))]);
407
+ const filtered = index_cjs_js$7.from(merged).filter((name) => !excludeSet.has(name));
408
+ if (filtered.length === 0)
409
+ return [];
410
+ const mappings = loadWorkspacePathMappings(workspaceRoot);
411
+ const results = [];
412
+ const tsConfigByPackage = index_cjs_js$a.createMap([]);
413
+ const resolveTsConfigForPackage = (inputPath) => {
414
+ const projectRoot = findOwningProjectRoot(inputPath);
415
+ if (!projectRoot)
416
+ return undefined;
417
+ const cached = tsConfigByPackage.get(projectRoot);
418
+ if (cached)
419
+ return cached;
420
+ const found = findDepTsConfig(projectRoot);
421
+ if (found)
422
+ tsConfigByPackage.set(projectRoot, found);
423
+ return found;
424
+ };
425
+ for (const packageName of filtered) {
426
+ const matches = collectMatchingSpecifiers(packageName, mappings);
427
+ if (matches.length === 0) {
428
+ throw index_cjs_js$4.createError(`bundleAllDeps: workspace dependency "${packageName}" has no resolvable tsconfig path mapping under ${workspaceRoot} (no matching paths entry, or its mapped source files are missing), so it cannot be bundled. Add a "${packageName}" (or "${packageName}/<sub-path>") entry to tsconfig.base.json paths pointing at an existing source file, or exclude it via bundleAllDeps.exclude.`);
429
+ }
430
+ const policy = policyFor(packageName);
431
+ const pushEntry = (specifier, inputPath) => {
432
+ const tsConfigPath = resolveTsConfigForPackage(inputPath);
433
+ if (!tsConfigPath) {
434
+ throw index_cjs_js$4.createError(`bundleAllDeps: workspace dependency "${specifier}" resolves to ${inputPath}, but no tsconfig (tsconfig.lib.json / tsconfig.json) was found in its project root, so it cannot be transformed during bundling.`);
435
+ }
436
+ const split = splitSpecifier(specifier);
437
+ results.push({ packageName, subPath: split.subPath, specifier, inputPath, tsConfigPath, policy });
438
+ };
439
+ if (policy === 'whole-surface') {
440
+ const root = matches.find((m) => m.specifier === packageName);
441
+ if (!root) {
442
+ throw index_cjs_js$4.createError(`bundleAllDeps: workspace dependency "${packageName}" is explicitly set to the 'whole-surface' hoist policy but is subpath-only (no root export; tsconfig exposes only ${matches.map((m) => `"${m.specifier}"`).join(', ')}). Remove the 'whole-surface' override for it (sub-path is the default), or add a root export.`);
443
+ }
444
+ pushEntry(root.specifier, root.inputPath);
445
+ continue;
446
+ }
447
+ for (const match of matches)
448
+ pushEntry(match.specifier, match.inputPath);
449
+ }
450
+ return results.sort((a, b) => a.specifier.localeCompare(b.specifier));
451
+ };
452
+
453
+ const stripTrailingIndexDts = (filePath) => {
454
+ const normalized = normalizeToForwardSlashes(filePath);
455
+ const trimmed = normalized.replace(/\/index\.d\.ts$/, '');
456
+ return trimmed === normalized ? normalized.replace(/\.d\.ts$/, '') : trimmed;
457
+ };
458
+ const stripTrailingSlash = (value) => (value.endsWith('/') ? value.slice(0, -1) : value);
459
+ const dirnameOf = (filePath) => {
460
+ const normalized = normalizeToForwardSlashes(filePath);
461
+ const idx = normalized.lastIndexOf('/');
462
+ return idx <= 0 ? normalized : normalized.slice(0, idx);
463
+ };
464
+ /**
465
+ * Computes the directory (without trailing slash) that owns a sibling's
466
+ * `index.d.ts`. Used to test whether an absolute resolved id falls inside the
467
+ * sibling's directory tree.
468
+ *
469
+ * @param sibling - Sibling-entry record.
470
+ * @returns Sibling's directory with no trailing slash.
471
+ */
472
+ const siblingDir = (sibling) => stripTrailingSlash(dirnameOf(sibling.indexDtsPath));
473
+ const startsWithDir = (resolved, dir) => {
474
+ const normalizedResolved = normalizeToForwardSlashes(resolved);
475
+ if (normalizedResolved === dir)
476
+ return true;
477
+ return normalizedResolved.startsWith(`${dir}/`);
478
+ };
479
+ /**
480
+ * Returns the sibling entry whose directory contains `absolutePath`, or `undefined`
481
+ * when no sibling owns the path.
482
+ *
483
+ * @param absolutePath - Resolved absolute path of an import.
484
+ * @param siblings - Sibling-entry records.
485
+ * @returns Owning sibling entry, or `undefined`.
486
+ *
487
+ * @example Identifying a sibling for a resolved type import
488
+ * ```typescript
489
+ * const owner = findOwningSibling('/abs/dist/libs/foo/models/index.d.ts', siblings)
490
+ * ```
491
+ */
492
+ const findOwningSibling = (absolutePath, siblings) => {
493
+ const normalized = normalizeToForwardSlashes(absolutePath);
494
+ let best;
495
+ let bestDirLength = -1;
496
+ for (const sibling of siblings) {
497
+ const dir = siblingDir(sibling);
498
+ if (!startsWithDir(normalized, dir))
499
+ continue;
500
+ if (dir.length > bestDirLength) {
501
+ best = sibling;
502
+ bestDirLength = dir.length;
503
+ }
504
+ }
505
+ return best;
506
+ };
507
+ /**
508
+ * Computes the bare-specifier form of a sibling import as emitted in the
509
+ * rewritten `.d.ts` (e.g., `../models`, `../../models`, `./bundle/declarations`).
510
+ *
511
+ * Always omits the trailing `index.d.ts` so both `moduleResolution: 'bundler'`
512
+ * and `node` accept it.
513
+ *
514
+ * @param selfDtsPath - Absolute path to the current entry's `index.d.ts`.
515
+ * @param sibling - The sibling entry being targeted.
516
+ * @returns POSIX-style relative specifier ready for `id` in a rollup external resolution.
517
+ *
518
+ * @example Computing a sibling import from `bundle/index.d.ts` to `models/`
519
+ * ```typescript
520
+ * computeSiblingSpecifier(
521
+ * '/abs/dist/libs/foo/bundle/index.d.ts',
522
+ * { srcPath: 'models', indexDtsPath: '/abs/dist/libs/foo/models/index.d.ts' }
523
+ * ) // => '../models'
524
+ * ```
525
+ */
526
+ const computeSiblingSpecifier = (selfDtsPath, sibling) => {
527
+ const fromDir = dirnameOf(selfDtsPath);
528
+ const toDir = siblingDir(sibling);
529
+ const fromSegments = fromDir.split('/').filter((s) => s.length > 0);
530
+ const toSegments = toDir.split('/').filter((s) => s.length > 0);
531
+ let common = 0;
532
+ while (common < fromSegments.length && common < toSegments.length && fromSegments[common] === toSegments[common]) {
533
+ common += 1;
534
+ }
535
+ const upSegments = fromSegments.length - common;
536
+ const downSegments = toSegments.slice(common);
537
+ if (upSegments === 0 && downSegments.length === 0)
538
+ return '.';
539
+ const ups = '../'.repeat(upSegments);
540
+ const downs = downSegments.join('/');
541
+ if (upSegments === 0)
542
+ return `./${downs}`;
543
+ return downs.length > 0 ? `${ups}${downs}` : ups.replace(/\/$/, '');
544
+ };
545
+ /**
546
+ * Resolves a relative or absolute `source` against `importer` (or `selfDtsPath`
547
+ * when no importer is given) and returns the absolute filesystem candidate
548
+ * suitable for matching against sibling entries.
549
+ *
550
+ * Mirrors TypeScript's lookup rules at the level we need: when the candidate
551
+ * exists as `<candidate>/index.d.ts` we treat that as the resolved file,
552
+ * otherwise the candidate path itself.
553
+ *
554
+ * @param source - The import specifier as it appears in source.
555
+ * @param importer - Absolute path of the importing module, when known.
556
+ * @param selfDtsPath - Absolute path to the entry currently being rewritten (fallback importer).
557
+ * @returns Absolute candidate path for sibling matching.
558
+ */
559
+ const resolveCandidate = (source, importer, selfDtsPath) => {
560
+ if (node_path.isAbsolute(source))
561
+ return normalizeToForwardSlashes(source);
562
+ if (source.startsWith('.')) {
563
+ const fromDir = dirnameOf(importer ?? selfDtsPath);
564
+ return normalizeToForwardSlashes(node_path.resolve(fromDir, source));
565
+ }
566
+ return source;
567
+ };
568
+ /**
569
+ * Returns a rollup plugin that externalizes any import resolving inside a
570
+ * sibling entry's directory tree, rewriting the emitted specifier to a POSIX
571
+ * relative path stripped of `/index` and `.d.ts` suffixes.
572
+ *
573
+ * The plugin's `resolveId` hook returns `null` for everything that does not
574
+ * resolve into a sibling — that lets the rest of the rollup-plugin-dts chain
575
+ * inline third-party type imports as before.
576
+ *
577
+ * Self-ownership is enforced by adding the current entry into the ownership
578
+ * pool: when the deepest-matching entry directory is the entry being rewritten
579
+ * (and not a sibling), the resolver returns `null` so rollup keeps the path
580
+ * internal. This matters for the package root entry whose directory prefix-
581
+ * matches every other entry's path — without including self, root would
582
+ * spuriously claim its own subtree's files.
583
+ *
584
+ * @param input - Self + sibling entry descriptors.
585
+ * @returns Rollup plugin.
586
+ *
587
+ * @example Plugin instance for the bundle entry pass
588
+ * ```typescript
589
+ * const plugin = createSiblingExternalizePlugin({
590
+ * selfSrcPath: 'bundle',
591
+ * selfDtsPath: '/abs/dist/libs/foo/bundle/index.d.ts',
592
+ * siblings: [{ srcPath: 'models', indexDtsPath: '/abs/dist/libs/foo/models/index.d.ts' }],
593
+ * })
594
+ * ```
595
+ */
596
+ const createSiblingExternalizePlugin = (input) => {
597
+ const { selfSrcPath, selfDtsPath, siblings } = input;
598
+ const selfEntry = { srcPath: selfSrcPath, indexDtsPath: selfDtsPath };
599
+ const ownershipPool = [selfEntry, ...siblings];
600
+ const selfDtsResolved = normalizeToForwardSlashes(selfDtsPath);
601
+ return {
602
+ name: 'externalize-sibling-subpaths',
603
+ resolveId(source, importer) {
604
+ if (siblings.length === 0)
605
+ return null;
606
+ const candidate = resolveCandidate(source, importer, selfDtsPath);
607
+ const indexCandidate = candidate.endsWith('.d.ts') ? candidate : `${stripTrailingIndexDts(candidate)}/index.d.ts`;
608
+ const owner = findOwningSibling(candidate, ownershipPool) ?? findOwningSibling(indexCandidate, ownershipPool);
609
+ if (!owner)
610
+ return null;
611
+ if (normalizeToForwardSlashes(owner.indexDtsPath) === selfDtsResolved)
612
+ return null;
613
+ return { id: computeSiblingSpecifier(selfDtsPath, owner), external: true };
614
+ },
615
+ };
616
+ };
617
+
618
+ const BYTES_PER_MB = 1024 * 1024;
619
+ const SUPPRESSED_WARNING_CODES = new Set([
620
+ 'CIRCULAR_DEPENDENCY',
621
+ 'UNRESOLVED_IMPORT',
622
+ 'EMPTY_BUNDLE',
623
+ 'UNUSED_EXTERNAL_IMPORT',
624
+ 'MIXED_EXPORTS',
625
+ ]);
626
+ /**
627
+ * Suppresses `MISSING_EXPORT` warnings caused by a package augmenting a
628
+ * DefinitelyTyped (`@types/*`) module to add members absent from the published
629
+ * stub. `rollup-plugin-dts` resolves e.g. `import * as estree from 'estree'` to
630
+ * `@types/estree` but cannot follow the `declare module 'estree'` augmentation
631
+ * (rollup's own `rollup.d.ts` adds `Decorator` this way) across the external
632
+ * boundary, so it reports the augmented members as not exported. The
633
+ * augmentation still resolves correctly in the emitted d.ts, so the warning is
634
+ * noise during the d.ts pre-pass.
635
+ *
636
+ * @param warning - The rollup log entry.
637
+ * @returns `true` when the warning is a `@types/*` augmentation false positive.
638
+ */
639
+ const isTypesAugmentationMiss = (warning) => warning.code === 'MISSING_EXPORT' && typeof warning.exporter === 'string' && warning.exporter.includes('/@types/');
640
+ /**
641
+ * Shared rollup `onwarn` handler for every pre-pass job. Drops the known-benign
642
+ * warning classes that bundling third-party / workspace deps routinely emits
643
+ * (see {@link SUPPRESSED_WARNING_CODES} and {@link isTypesAugmentationMiss}) and
644
+ * forwards everything else to rollup's default handler.
645
+ *
646
+ * @param warning - The rollup log entry.
647
+ * @param defaultHandler - Rollup's default warning handler.
648
+ *
649
+ * @example Wiring the handler into a rollup config
650
+ * ```typescript
651
+ * const config: RollupOptions = { input, plugins, onwarn: onWarn }
652
+ * ```
653
+ */
654
+ const onWarn = (warning, defaultHandler) => {
655
+ if (warning.code && SUPPRESSED_WARNING_CODES.has(warning.code))
656
+ return;
657
+ if (isTypesAugmentationMiss(warning))
658
+ return;
659
+ defaultHandler(warning);
660
+ };
661
+ const matchesAnyDep = (id, deps) => {
662
+ for (const d of deps) {
663
+ if (id === d || id.startsWith(`${d}/`))
664
+ return true;
665
+ }
666
+ return false;
667
+ };
668
+ const matchesAnyExactSpecifier = (id, specifiers) => {
669
+ if (!specifiers || specifiers.length === 0)
670
+ return false;
671
+ for (const s of specifiers) {
672
+ if (id === s)
673
+ return true;
674
+ }
675
+ return false;
676
+ };
677
+ /**
678
+ * Packages whose JS implementation is intentionally NOT inlined during the JS pre-pass.
679
+ *
680
+ * Mirrors `ALWAYS_EXTERNAL_TYPE_DEPS` for the JS half. `typescript` is permanent
681
+ * consumer-supplied — both `@rollup/plugin-typescript` and `rollup-plugin-dts`
682
+ * follow `require('typescript')` into the compiler; without this gate, ~30 MB
683
+ * of typescript bytecode ends up inlined into `_dependencies/<plugin>/index.<fmt>.js`.
684
+ */
685
+ const ALWAYS_EXTERNAL_JS_DEPS = new Set(['typescript']);
686
+ const isExternalJsDep = (id) => {
687
+ for (const name of ALWAYS_EXTERNAL_JS_DEPS) {
688
+ if (id === name || id.startsWith(`${name}/`))
689
+ return true;
690
+ }
691
+ return false;
692
+ };
693
+ /**
694
+ * Builds the canonical externalize plugin for a pre-pass job when the parent
695
+ * supplied npm deps or workspace routes. Mirrors the plugin install on the
696
+ * per-entry rollup side so chunk-internal cross-bundled-dep specifiers get
697
+ * rewritten to relative paths under `_dependencies/` instead of leaking as bare
698
+ * `require('@hyperfrontend/...')` calls into the published artifact.
699
+ *
700
+ * @param job - Pre-pass job spec; only `npmDeps`, `workspaceRoutes`, `depsRoot`, and `outputPath` are read here.
701
+ * @param format - Output format the plugin should rewrite specifiers for (`'esm'`, `'cjs'`, or `'dts'`).
702
+ * @returns The plugin when routing data is supplied, or `undefined` to opt out of rewriting.
703
+ */
704
+ const maybeExternalizePlugin = (job, format) => {
705
+ const npmDeps = job.npmDeps ?? [];
706
+ const workspaceRoutes = job.workspaceRoutes ?? [];
707
+ if (npmDeps.length === 0 && workspaceRoutes.length === 0)
708
+ return undefined;
709
+ if (!job.depsRoot)
710
+ return undefined;
711
+ return createExternalizeBundledDepsPlugin({
712
+ deps: npmDeps,
713
+ entryOutDir: node_path.dirname(job.outputPath),
714
+ format,
715
+ depsRoot: job.depsRoot,
716
+ workspaceRoutes,
717
+ });
718
+ };
719
+ const buildJsConfig = (job) => {
720
+ const plugins = [];
721
+ const externalizePlugin = maybeExternalizePlugin(job, job.format);
722
+ const hasExternalize = externalizePlugin !== undefined;
723
+ if (externalizePlugin)
724
+ plugins.push(externalizePlugin);
725
+ plugins.push(json__default.default(), nodeResolve__default.default({ preferBuiltins: true, extensions: ['.mjs', '.js', '.cjs', '.json'] }), commonjs__default.default({ ignoreDynamicRequires: true }));
726
+ return {
727
+ input: job.inputPath,
728
+ // why: when the externalize plugin is active, it owns rewriting of bundled-dep specifiers to relative paths under depsRoot. The `external` callback must not short-circuit those — rollup consults `external` before plugin resolveId can run, so any matchesAnyDep hit there leaks bare specifiers into the chunk.
729
+ external: (id) => node_module.isBuiltin(id) || id.startsWith('node:') || (!hasExternalize && matchesAnyDep(id, job.otherDeps)) || isExternalJsDep(id),
730
+ onwarn: onWarn,
731
+ plugins,
732
+ };
733
+ };
734
+ const requireWorkspaceField = (job, field) => {
735
+ const value = job[field];
736
+ if (!value) {
737
+ throw new Error(`workspace pre-pass job for ${job.dep} (${job.kind}/${job.format}) missing ${field}`);
738
+ }
739
+ return value;
740
+ };
741
+ /**
742
+ * Builds a JS rollup config for a workspace-source pre-pass. The input is a
743
+ * `.ts` source file; `@rollup/plugin-typescript` transpiles it (and any
744
+ * transitive workspace files reached via tsconfig path-mapping) while sibling
745
+ * pre-passed specifiers stay external so each chunk is self-contained.
746
+ *
747
+ * The plugin is driven by the dep's own tsconfig (resolved by the parent and
748
+ * passed through `job.tsConfigPath`), keeping the workspace pre-pass agnostic
749
+ * of any workspace-root tsconfig.
750
+ *
751
+ * @param job - Pre-pass job spec with `tsConfigPath` and `workspaceRoot` populated.
752
+ * @returns Rollup options ready for the worker to invoke.
753
+ */
754
+ const buildWorkspaceJsConfig = (job) => {
755
+ const tsConfigPath = requireWorkspaceField(job, 'tsConfigPath');
756
+ const workspaceRoot = requireWorkspaceField(job, 'workspaceRoot');
757
+ const tsPlugin = typescript__default.default({
758
+ tsconfig: tsConfigPath,
759
+ declaration: false,
760
+ declarationMap: false,
761
+ sourceMap: false,
762
+ compilerOptions: {
763
+ baseUrl: workspaceRoot,
764
+ outDir: node_path.dirname(job.outputPath),
765
+ noEmitOnError: false,
766
+ noEmit: false,
767
+ module: 'esnext',
768
+ },
769
+ });
770
+ const plugins = [];
771
+ const externalizePlugin = maybeExternalizePlugin(job, job.format);
772
+ const hasExternalize = externalizePlugin !== undefined;
773
+ if (externalizePlugin)
774
+ plugins.push(externalizePlugin);
775
+ plugins.push(json__default.default(), nodeResolve__default.default({ preferBuiltins: true, extensions: ['.ts', '.mjs', '.js', '.cjs', '.json'] }), commonjs__default.default({ ignoreDynamicRequires: true }), tsPlugin);
776
+ return {
777
+ input: job.inputPath,
778
+ external: (id) => node_module.isBuiltin(id) ||
779
+ id.startsWith('node:') ||
780
+ (!hasExternalize && matchesAnyDep(id, job.otherDeps)) ||
781
+ (!hasExternalize && matchesAnyExactSpecifier(id, job.otherWorkspaceSpecifiers)) ||
782
+ isExternalJsDep(id),
783
+ onwarn: onWarn,
784
+ plugins,
785
+ };
786
+ };
787
+ const buildJsOutput = (job) => ({
788
+ file: job.outputPath,
789
+ format: job.format === 'esm' ? 'esm' : 'cjs',
790
+ sourcemap: false,
791
+ inlineDynamicImports: true,
792
+ exports: 'auto',
793
+ generatedCode: { constBindings: true },
794
+ });
795
+ /**
796
+ * Packages whose `.d.ts` is intentionally NOT inlined during the d.ts pre-pass.
797
+ *
798
+ * `typescript` is a permanent consumer requirement — never bundled, never inlined,
799
+ * never copied into `_dependencies/`. The compiler is too large (~10 MB just for
800
+ * `lib/typescript.d.ts`), its namespace re-exports defeat `rollup-plugin-dts`,
801
+ * and every consumer of `@hyperfrontend/builder` is, by definition, already a
802
+ * TypeScript project. Emitted `.d.ts` keeps `import type ... from 'typescript'`
803
+ * intact so the consumer's own install satisfies the type imports.
804
+ */
805
+ const ALWAYS_EXTERNAL_TYPE_DEPS = new Set(['typescript']);
806
+ const isExternalTypeDep = (id) => {
807
+ for (const name of ALWAYS_EXTERNAL_TYPE_DEPS) {
808
+ if (id === name || id.startsWith(`${name}/`))
809
+ return true;
810
+ }
811
+ return false;
812
+ };
813
+ const loadDtsFactory = async () => {
814
+ const dtsModule = await import('../../_dependencies/rollup-plugin-dts/index.cjs.js');
815
+ /* istanbul ignore next -- @preserve fallback path for CJS-style rollup-plugin-dts module shapes */
816
+ return (dtsModule.default ?? dtsModule);
817
+ };
818
+ const maybeSiblingPlugin = (job) => {
819
+ if (!job.siblingEntries || job.siblingEntries.length === 0 || !job.selfDtsPath)
820
+ return undefined;
821
+ return createSiblingExternalizePlugin({
822
+ selfSrcPath: job.selfSrcPath ?? '',
823
+ selfDtsPath: job.selfDtsPath,
824
+ siblings: job.siblingEntries,
825
+ });
826
+ };
827
+ const buildDtsConfig = async (job) => {
828
+ const dtsFactory = await loadDtsFactory();
829
+ const plugins = [];
830
+ const siblingPlugin = maybeSiblingPlugin(job);
831
+ if (siblingPlugin)
832
+ plugins.push(siblingPlugin);
833
+ const externalizePlugin = maybeExternalizePlugin(job, 'dts');
834
+ const hasExternalize = externalizePlugin !== undefined;
835
+ if (externalizePlugin)
836
+ plugins.push(externalizePlugin);
837
+ plugins.push(dtsFactory({ respectExternal: true }));
838
+ return {
839
+ input: job.inputPath,
840
+ external: (id) => node_module.isBuiltin(id) || id.startsWith('node:') || (!hasExternalize && matchesAnyDep(id, job.otherDeps)) || isExternalTypeDep(id),
841
+ onwarn: onWarn,
842
+ plugins,
843
+ };
844
+ };
845
+ /**
846
+ * Builds a d.ts rollup config for a workspace-source pre-pass. The input is a
847
+ * `.ts` source file; `rollup-plugin-dts` drives TypeScript using the project's
848
+ * tsconfig so workspace path-mappings resolve and transitive type imports are
849
+ * properly inlined or externalized.
850
+ *
851
+ * @param job - Pre-pass job spec with `tsConfigPath` and `workspaceRoot` populated.
852
+ * @returns Rollup options ready for the worker to invoke.
853
+ */
854
+ const buildWorkspaceDtsConfig = async (job) => {
855
+ const tsConfigPath = requireWorkspaceField(job, 'tsConfigPath');
856
+ const workspaceRoot = requireWorkspaceField(job, 'workspaceRoot');
857
+ const dtsFactory = await loadDtsFactory();
858
+ const plugins = [];
859
+ const externalizePlugin = maybeExternalizePlugin(job, 'dts');
860
+ const hasExternalize = externalizePlugin !== undefined;
861
+ if (externalizePlugin)
862
+ plugins.push(externalizePlugin);
863
+ plugins.push(dtsFactory({ respectExternal: true, tsconfig: tsConfigPath, compilerOptions: { baseUrl: workspaceRoot } }));
864
+ return {
865
+ input: job.inputPath,
866
+ external: (id) => node_module.isBuiltin(id) ||
867
+ id.startsWith('node:') ||
868
+ (!hasExternalize && matchesAnyDep(id, job.otherDeps)) ||
869
+ (!hasExternalize && matchesAnyExactSpecifier(id, job.otherWorkspaceSpecifiers)) ||
870
+ isExternalTypeDep(id),
871
+ onwarn: onWarn,
872
+ plugins,
873
+ };
874
+ };
875
+ const buildDtsOutput = (job) => ({
876
+ file: job.outputPath,
877
+ format: 'es',
878
+ sourcemap: false,
879
+ inlineDynamicImports: true,
880
+ });
881
+ const ensureParentDir = (filePath) => {
882
+ node_fs.mkdirSync(node_path.dirname(filePath), { recursive: true });
883
+ };
884
+ const buildConfigForJob = async (job) => {
885
+ switch (job.kind) {
886
+ case 'dts':
887
+ return buildDtsConfig(job);
888
+ case 'workspace-js':
889
+ return buildWorkspaceJsConfig(job);
890
+ case 'workspace-dts':
891
+ return buildWorkspaceDtsConfig(job);
892
+ default:
893
+ return buildJsConfig(job);
894
+ }
895
+ };
896
+ /**
897
+ * Runs a single pre-pass rollup invocation as described by `job` and writes the
898
+ * resulting report to `job.reportPath`.
899
+ *
900
+ * Public so callers (and tests) can drive the worker logic without spawning a
901
+ * new Node process.
902
+ *
903
+ * @param job - Job spec describing the rollup invocation.
904
+ * @returns The on-disk report data the worker would have persisted.
905
+ *
906
+ * @example Driving the worker logic in-process for a fixture
907
+ * ```typescript
908
+ * const report = await runPrePassWorkerJob({ kind: 'js', dep: 'rollup', ... })
909
+ * ```
910
+ */
911
+ const runPrePassWorkerJob = async (job) => {
912
+ const startedAt = Date.now();
913
+ ensureParentDir(job.outputPath);
914
+ ensureParentDir(job.reportPath);
915
+ const config = await buildConfigForJob(job);
916
+ const output = job.kind === 'dts' || job.kind === 'workspace-dts' ? buildDtsOutput(job) : buildJsOutput(job);
917
+ const bundle = await index_cjs_js$b.rollup(config);
918
+ try {
919
+ await bundle.write(output);
920
+ }
921
+ finally {
922
+ await bundle.close();
923
+ }
924
+ const memory = process.memoryUsage();
925
+ const report = {
926
+ outputSize: node_fs.statSync(job.outputPath).size,
927
+ endHeapMB: memory.heapUsed / BYTES_PER_MB,
928
+ endRssMB: memory.rss / BYTES_PER_MB,
929
+ durationMs: Date.now() - startedAt,
930
+ };
931
+ node_fs.writeFileSync(job.reportPath, JSON.stringify(report));
932
+ return report;
933
+ };
934
+
935
+ const isMainModule = () => {
936
+ if (typeof require !== 'undefined' && typeof module !== 'undefined' && require.main === module) {
937
+ return true;
938
+ }
939
+ const argv1 = process.argv[1] ?? '';
940
+ return argv1.endsWith('index.cjs.js') || argv1.endsWith('index.esm.js') || argv1.endsWith('index.ts') || argv1.endsWith('index.js');
941
+ };
942
+ if (isMainModule()) {
943
+ const raw = process.argv[2];
944
+ if (!raw) {
945
+ process.stderr.write('pre-pass worker: missing job spec on argv\n');
946
+ process.exit(2);
947
+ }
948
+ const job = JSON.parse(raw);
949
+ runPrePassWorkerJob(job).then(() => process.exit(0), (error) => {
950
+ const message = error instanceof Error ? (error.stack ?? error.message) : String(error);
951
+ process.stderr.write(`pre-pass worker for ${job.dep}/${job.kind}/${job.format} failed: ${message}\n`);
952
+ process.exit(1);
953
+ });
954
+ }
955
+
956
+ exports.buildWorkspaceRoutes = buildWorkspaceRoutes;
957
+ exports.createExternalizeBundledDepsPlugin = createExternalizeBundledDepsPlugin;
958
+ exports.loadWorkspacePathMappings = loadWorkspacePathMappings;
959
+ exports.relativeImport = relativeImport;
960
+ exports.resolveBundledDeps = resolveBundledDeps;
961
+ exports.resolveDefaultWorkerPath = resolveDefaultWorkerPath;
962
+ exports.resolveWorkspaceBundledDeps = resolveWorkspaceBundledDeps;
963
+ exports.runPrePass = runPrePass;
964
+ exports.runPrePassWorkerJob = runPrePassWorkerJob;