@powerlines/plugin-content-collections 0.1.341 → 0.1.342

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 (420) hide show
  1. package/README.md +14 -16
  2. package/dist/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +1 -3
  3. package/dist/_virtual/_rolldown/runtime.mjs +3 -0
  4. package/dist/helpers/create-emitter.cjs +2 -1
  5. package/dist/helpers/create-emitter.d.cts.map +1 -1
  6. package/dist/helpers/create-emitter.d.mts.map +1 -1
  7. package/dist/helpers/create-writer.cjs +9 -8
  8. package/dist/helpers/create-writer.d.cts +0 -1
  9. package/dist/helpers/create-writer.d.cts.map +1 -1
  10. package/dist/helpers/create-writer.d.mts +0 -1
  11. package/dist/helpers/create-writer.d.mts.map +1 -1
  12. package/dist/helpers/create-writer.mjs +2 -2
  13. package/dist/helpers/index.cjs +1 -0
  14. package/dist/index.cjs +15 -16
  15. package/dist/index.d.cts +0 -2
  16. package/dist/index.d.cts.map +1 -1
  17. package/dist/index.d.mts +0 -2
  18. package/dist/index.d.mts.map +1 -1
  19. package/dist/index.mjs +4 -5
  20. package/dist/index.mjs.map +1 -1
  21. package/dist/types/plugin.d.cts.map +1 -1
  22. package/dist/types/plugin.d.mts.map +1 -1
  23. package/package.json +30 -26
  24. package/dist/_virtual/rolldown_runtime.mjs +0 -32
  25. package/dist/node_modules/.pnpm/@content-collections_core@0.12.0_patch_hash_bceb89349da763f8c715d7b53875be4a1e5bc5161d7_3067b2e8f290866ec343d5ebc4494f7e/node_modules/@content-collections/core/dist/index.cjs +0 -1946
  26. package/dist/node_modules/.pnpm/@content-collections_core@0.12.0_patch_hash_bceb89349da763f8c715d7b53875be4a1e5bc5161d7_3067b2e8f290866ec343d5ebc4494f7e/node_modules/@content-collections/core/dist/index.mjs +0 -1939
  27. package/dist/node_modules/.pnpm/@content-collections_core@0.12.0_patch_hash_bceb89349da763f8c715d7b53875be4a1e5bc5161d7_3067b2e8f290866ec343d5ebc4494f7e/node_modules/@content-collections/core/dist/index.mjs.map +0 -1
  28. package/dist/node_modules/.pnpm/camelcase@8.0.0/node_modules/camelcase/index.cjs +0 -9
  29. package/dist/node_modules/.pnpm/camelcase@8.0.0/node_modules/camelcase/index.mjs +0 -10
  30. package/dist/node_modules/.pnpm/camelcase@8.0.0/node_modules/camelcase/index.mjs.map +0 -1
  31. package/dist/node_modules/.pnpm/esbuild@0.25.12/node_modules/esbuild/lib/main.cjs +0 -2124
  32. package/dist/node_modules/.pnpm/esbuild@0.25.12/node_modules/esbuild/lib/main.mjs +0 -2120
  33. package/dist/node_modules/.pnpm/esbuild@0.25.12/node_modules/esbuild/lib/main.mjs.map +0 -1
  34. package/dist/node_modules/.pnpm/esprima@4.0.1/node_modules/esprima/dist/esprima.cjs +0 -5342
  35. package/dist/node_modules/.pnpm/esprima@4.0.1/node_modules/esprima/dist/esprima.mjs +0 -5340
  36. package/dist/node_modules/.pnpm/esprima@4.0.1/node_modules/esprima/dist/esprima.mjs.map +0 -1
  37. package/dist/node_modules/.pnpm/extend-shallow@2.0.1/node_modules/extend-shallow/index.cjs +0 -35
  38. package/dist/node_modules/.pnpm/extend-shallow@2.0.1/node_modules/extend-shallow/index.mjs +0 -31
  39. package/dist/node_modules/.pnpm/extend-shallow@2.0.1/node_modules/extend-shallow/index.mjs.map +0 -1
  40. package/dist/node_modules/.pnpm/fdir@6.5.0_@types_picomatch@4.0.2_picomatch@4.0.3/node_modules/fdir/dist/index.cjs +0 -516
  41. package/dist/node_modules/.pnpm/fdir@6.5.0_@types_picomatch@4.0.2_picomatch@4.0.3/node_modules/fdir/dist/index.mjs +0 -515
  42. package/dist/node_modules/.pnpm/fdir@6.5.0_@types_picomatch@4.0.2_picomatch@4.0.3/node_modules/fdir/dist/index.mjs.map +0 -1
  43. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/index.cjs +0 -185
  44. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/index.mjs +0 -181
  45. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/index.mjs.map +0 -1
  46. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/defaults.cjs +0 -27
  47. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/defaults.mjs +0 -23
  48. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/defaults.mjs.map +0 -1
  49. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/engine.cjs +0 -33
  50. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/engine.mjs +0 -29
  51. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/engine.mjs.map +0 -1
  52. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/engines.cjs +0 -58
  53. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/engines.mjs +0 -54
  54. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/engines.mjs.map +0 -1
  55. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/excerpt.cjs +0 -28
  56. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/excerpt.mjs +0 -24
  57. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/excerpt.mjs.map +0 -1
  58. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/parse.cjs +0 -25
  59. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/parse.mjs +0 -21
  60. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/parse.mjs.map +0 -1
  61. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/stringify.cjs +0 -53
  62. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/stringify.mjs +0 -49
  63. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/stringify.mjs.map +0 -1
  64. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/to-file.cjs +0 -41
  65. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/to-file.mjs +0 -37
  66. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/to-file.mjs.map +0 -1
  67. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/utils.cjs +0 -66
  68. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/utils.mjs +0 -62
  69. package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/utils.mjs.map +0 -1
  70. package/dist/node_modules/.pnpm/is-extendable@0.1.1/node_modules/is-extendable/index.cjs +0 -24
  71. package/dist/node_modules/.pnpm/is-extendable@0.1.1/node_modules/is-extendable/index.mjs +0 -20
  72. package/dist/node_modules/.pnpm/is-extendable@0.1.1/node_modules/is-extendable/index.mjs.map +0 -1
  73. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/index.cjs +0 -18
  74. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/index.mjs +0 -14
  75. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/index.mjs.map +0 -1
  76. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/common.cjs +0 -51
  77. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/common.mjs +0 -47
  78. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/common.mjs.map +0 -1
  79. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/dumper.cjs +0 -452
  80. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/dumper.mjs +0 -448
  81. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/dumper.mjs.map +0 -1
  82. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/exception.cjs +0 -33
  83. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/exception.mjs +0 -29
  84. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/exception.mjs.map +0 -1
  85. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/loader.cjs +0 -820
  86. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/loader.mjs +0 -816
  87. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/loader.mjs.map +0 -1
  88. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/mark.cjs +0 -63
  89. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/mark.mjs +0 -59
  90. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/mark.mjs.map +0 -1
  91. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/core.cjs +0 -19
  92. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/core.mjs +0 -15
  93. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/core.mjs.map +0 -1
  94. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/default_full.cjs +0 -29
  95. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/default_full.mjs +0 -25
  96. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/default_full.mjs.map +0 -1
  97. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/default_safe.cjs +0 -34
  98. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/default_safe.mjs +0 -30
  99. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/default_safe.mjs.map +0 -1
  100. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/failsafe.cjs +0 -25
  101. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/failsafe.mjs +0 -21
  102. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/failsafe.mjs.map +0 -1
  103. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/json.cjs +0 -31
  104. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/json.mjs +0 -27
  105. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/json.mjs.map +0 -1
  106. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema.cjs +0 -88
  107. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema.mjs +0 -84
  108. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema.mjs.map +0 -1
  109. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/binary.cjs +0 -95
  110. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/binary.mjs +0 -91
  111. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/binary.mjs.map +0 -1
  112. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/bool.cjs +0 -46
  113. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/bool.mjs +0 -42
  114. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/bool.mjs.map +0 -1
  115. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/float.cjs +0 -77
  116. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/float.mjs +0 -73
  117. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/float.mjs.map +0 -1
  118. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/int.cjs +0 -136
  119. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/int.mjs +0 -132
  120. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/int.mjs.map +0 -1
  121. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/function.cjs +0 -57
  122. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/function.mjs +0 -53
  123. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/function.mjs.map +0 -1
  124. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/regexp.cjs +0 -53
  125. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/regexp.mjs +0 -49
  126. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/regexp.mjs.map +0 -1
  127. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/undefined.cjs +0 -34
  128. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/undefined.mjs +0 -30
  129. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/undefined.mjs.map +0 -1
  130. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/map.cjs +0 -23
  131. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/map.mjs +0 -19
  132. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/map.mjs.map +0 -1
  133. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/merge.cjs +0 -24
  134. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/merge.mjs +0 -20
  135. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/merge.mjs.map +0 -1
  136. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/null.cjs +0 -49
  137. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/null.mjs +0 -45
  138. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/null.mjs.map +0 -1
  139. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/omap.cjs +0 -42
  140. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/omap.mjs +0 -38
  141. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/omap.mjs.map +0 -1
  142. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/pairs.cjs +0 -47
  143. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/pairs.mjs +0 -43
  144. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/pairs.mjs.map +0 -1
  145. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/seq.cjs +0 -23
  146. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/seq.mjs +0 -19
  147. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/seq.mjs.map +0 -1
  148. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/set.cjs +0 -34
  149. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/set.mjs +0 -30
  150. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/set.mjs.map +0 -1
  151. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/str.cjs +0 -23
  152. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/str.mjs +0 -19
  153. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/str.mjs.map +0 -1
  154. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/timestamp.cjs +0 -62
  155. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/timestamp.mjs +0 -58
  156. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/timestamp.mjs.map +0 -1
  157. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type.cjs +0 -62
  158. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type.mjs +0 -58
  159. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type.mjs.map +0 -1
  160. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml.cjs +0 -53
  161. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml.mjs +0 -49
  162. package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml.mjs.map +0 -1
  163. package/dist/node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.cjs +0 -97
  164. package/dist/node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.mjs +0 -95
  165. package/dist/node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.mjs.map +0 -1
  166. package/dist/node_modules/.pnpm/p-limit@6.2.0/node_modules/p-limit/index.cjs +0 -62
  167. package/dist/node_modules/.pnpm/p-limit@6.2.0/node_modules/p-limit/index.mjs +0 -63
  168. package/dist/node_modules/.pnpm/p-limit@6.2.0/node_modules/p-limit/index.mjs.map +0 -1
  169. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.cjs +0 -28
  170. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.mjs +0 -24
  171. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.mjs.map +0 -1
  172. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.cjs +0 -175
  173. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.mjs +0 -171
  174. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.mjs.map +0 -1
  175. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/parse.cjs +0 -871
  176. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/parse.mjs +0 -867
  177. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/parse.mjs.map +0 -1
  178. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.cjs +0 -307
  179. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.mjs +0 -303
  180. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.mjs.map +0 -1
  181. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/scan.cjs +0 -300
  182. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/scan.mjs +0 -296
  183. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/scan.mjs.map +0 -1
  184. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.cjs +0 -60
  185. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.mjs +0 -56
  186. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.mjs.map +0 -1
  187. package/dist/node_modules/.pnpm/randombytes@2.1.0/node_modules/randombytes/index.cjs +0 -14
  188. package/dist/node_modules/.pnpm/randombytes@2.1.0/node_modules/randombytes/index.mjs +0 -12
  189. package/dist/node_modules/.pnpm/randombytes@2.1.0/node_modules/randombytes/index.mjs.map +0 -1
  190. package/dist/node_modules/.pnpm/section-matter@1.0.0/node_modules/section-matter/index.cjs +0 -117
  191. package/dist/node_modules/.pnpm/section-matter@1.0.0/node_modules/section-matter/index.mjs +0 -113
  192. package/dist/node_modules/.pnpm/section-matter@1.0.0/node_modules/section-matter/index.mjs.map +0 -1
  193. package/dist/node_modules/.pnpm/serialize-javascript@6.0.2/node_modules/serialize-javascript/index.cjs +0 -119
  194. package/dist/node_modules/.pnpm/serialize-javascript@6.0.2/node_modules/serialize-javascript/index.mjs +0 -115
  195. package/dist/node_modules/.pnpm/serialize-javascript@6.0.2/node_modules/serialize-javascript/index.mjs.map +0 -1
  196. package/dist/node_modules/.pnpm/strip-bom-string@1.0.0/node_modules/strip-bom-string/index.cjs +0 -25
  197. package/dist/node_modules/.pnpm/strip-bom-string@1.0.0/node_modules/strip-bom-string/index.mjs +0 -21
  198. package/dist/node_modules/.pnpm/strip-bom-string@1.0.0/node_modules/strip-bom-string/index.mjs.map +0 -1
  199. package/dist/node_modules/.pnpm/tinyglobby@0.2.15/node_modules/tinyglobby/dist/index.cjs +0 -294
  200. package/dist/node_modules/.pnpm/tinyglobby@0.2.15/node_modules/tinyglobby/dist/index.mjs +0 -293
  201. package/dist/node_modules/.pnpm/tinyglobby@0.2.15/node_modules/tinyglobby/dist/index.mjs.map +0 -1
  202. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-collection.cjs +0 -70
  203. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-collection.mjs +0 -66
  204. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-collection.mjs.map +0 -1
  205. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-doc.cjs +0 -57
  206. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-doc.mjs +0 -53
  207. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-doc.mjs.map +0 -1
  208. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-node.cjs +0 -102
  209. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-node.mjs +0 -98
  210. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-node.mjs.map +0 -1
  211. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-scalar.cjs +0 -74
  212. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-scalar.mjs +0 -70
  213. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-scalar.mjs.map +0 -1
  214. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/composer.cjs +0 -215
  215. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/composer.mjs +0 -211
  216. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/composer.mjs.map +0 -1
  217. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-map.cjs +0 -101
  218. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-map.mjs +0 -97
  219. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-map.mjs.map +0 -1
  220. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-scalar.cjs +0 -187
  221. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-scalar.mjs +0 -183
  222. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-scalar.mjs.map +0 -1
  223. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-seq.cjs +0 -56
  224. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-seq.mjs +0 -52
  225. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-seq.mjs.map +0 -1
  226. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-end.cjs +0 -49
  227. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-end.mjs +0 -45
  228. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-end.mjs.map +0 -1
  229. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-flow-collection.cjs +0 -174
  230. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-flow-collection.mjs +0 -170
  231. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-flow-collection.mjs.map +0 -1
  232. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-flow-scalar.cjs +0 -219
  233. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-flow-scalar.mjs +0 -215
  234. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-flow-scalar.mjs.map +0 -1
  235. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-props.cjs +0 -118
  236. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-props.mjs +0 -114
  237. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-props.mjs.map +0 -1
  238. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-contains-newline.cjs +0 -40
  239. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-contains-newline.mjs +0 -36
  240. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-contains-newline.mjs.map +0 -1
  241. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-empty-scalar-position.cjs +0 -38
  242. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-empty-scalar-position.mjs +0 -34
  243. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-empty-scalar-position.mjs.map +0 -1
  244. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-flow-indent-check.cjs +0 -24
  245. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-flow-indent-check.mjs +0 -20
  246. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-flow-indent-check.mjs.map +0 -1
  247. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-map-includes.cjs +0 -24
  248. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-map-includes.mjs +0 -20
  249. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-map-includes.mjs.map +0 -1
  250. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/Document.cjs +0 -303
  251. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/Document.mjs +0 -299
  252. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/Document.mjs.map +0 -1
  253. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/anchors.cjs +0 -75
  254. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/anchors.mjs +0 -71
  255. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/anchors.mjs.map +0 -1
  256. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/applyReviver.cjs +0 -51
  257. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/applyReviver.mjs +0 -47
  258. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/applyReviver.mjs.map +0 -1
  259. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/createNode.cjs +0 -77
  260. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/createNode.mjs +0 -73
  261. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/createNode.mjs.map +0 -1
  262. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/directives.cjs +0 -178
  263. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/directives.mjs +0 -174
  264. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/directives.mjs.map +0 -1
  265. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/errors.cjs +0 -64
  266. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/errors.mjs +0 -60
  267. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/errors.mjs.map +0 -1
  268. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/index.cjs +0 -75
  269. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/index.mjs +0 -71
  270. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/index.mjs.map +0 -1
  271. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/log.cjs +0 -25
  272. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/log.mjs +0 -21
  273. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/log.mjs.map +0 -1
  274. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Alias.cjs +0 -109
  275. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Alias.mjs +0 -105
  276. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Alias.mjs.map +0 -1
  277. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Collection.cjs +0 -135
  278. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Collection.mjs +0 -131
  279. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Collection.mjs.map +0 -1
  280. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Node.cjs +0 -48
  281. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Node.mjs +0 -44
  282. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Node.mjs.map +0 -1
  283. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Pair.cjs +0 -48
  284. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Pair.mjs +0 -44
  285. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Pair.mjs.map +0 -1
  286. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Scalar.cjs +0 -41
  287. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Scalar.mjs +0 -37
  288. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Scalar.mjs.map +0 -1
  289. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/YAMLMap.cjs +0 -126
  290. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/YAMLMap.mjs +0 -122
  291. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/YAMLMap.mjs.map +0 -1
  292. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/YAMLSeq.cjs +0 -123
  293. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/YAMLSeq.mjs +0 -119
  294. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/YAMLSeq.mjs.map +0 -1
  295. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/addPairToJSMap.cjs +0 -67
  296. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/addPairToJSMap.mjs +0 -63
  297. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/addPairToJSMap.mjs.map +0 -1
  298. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/identity.cjs +0 -61
  299. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/identity.mjs +0 -57
  300. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/identity.mjs.map +0 -1
  301. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/toJS.cjs +0 -49
  302. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/toJS.mjs +0 -45
  303. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/toJS.mjs.map +0 -1
  304. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-scalar.cjs +0 -282
  305. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-scalar.mjs +0 -278
  306. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-scalar.mjs.map +0 -1
  307. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-stringify.cjs +0 -62
  308. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-stringify.mjs +0 -58
  309. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-stringify.mjs.map +0 -1
  310. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-visit.cjs +0 -102
  311. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-visit.mjs +0 -98
  312. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-visit.mjs.map +0 -1
  313. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst.cjs +0 -93
  314. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst.mjs +0 -89
  315. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst.mjs.map +0 -1
  316. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/lexer.cjs +0 -531
  317. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/lexer.mjs +0 -527
  318. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/lexer.mjs.map +0 -1
  319. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/line-counter.cjs +0 -58
  320. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/line-counter.mjs +0 -54
  321. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/line-counter.mjs.map +0 -1
  322. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/parser.cjs +0 -871
  323. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/parser.mjs +0 -867
  324. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/parser.mjs.map +0 -1
  325. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/public-api.cjs +0 -105
  326. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/public-api.mjs +0 -101
  327. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/public-api.mjs.map +0 -1
  328. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/Schema.cjs +0 -45
  329. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/Schema.mjs +0 -41
  330. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/Schema.mjs.map +0 -1
  331. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/map.cjs +0 -31
  332. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/map.mjs +0 -27
  333. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/map.mjs.map +0 -1
  334. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/null.cjs +0 -27
  335. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/null.mjs +0 -23
  336. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/null.mjs.map +0 -1
  337. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/seq.cjs +0 -31
  338. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/seq.mjs +0 -27
  339. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/seq.mjs.map +0 -1
  340. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/string.cjs +0 -28
  341. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/string.mjs +0 -24
  342. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/string.mjs.map +0 -1
  343. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/bool.cjs +0 -31
  344. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/bool.mjs +0 -27
  345. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/bool.mjs.map +0 -1
  346. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/float.cjs +0 -55
  347. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/float.mjs +0 -51
  348. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/float.mjs.map +0 -1
  349. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/int.cjs +0 -53
  350. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/int.mjs +0 -49
  351. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/int.mjs.map +0 -1
  352. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/schema.cjs +0 -43
  353. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/schema.mjs +0 -39
  354. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/schema.mjs.map +0 -1
  355. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/json/schema.cjs +0 -77
  356. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/json/schema.mjs +0 -73
  357. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/json/schema.mjs.map +0 -1
  358. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/tags.cjs +0 -111
  359. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/tags.mjs +0 -107
  360. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/tags.mjs.map +0 -1
  361. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/binary.cjs +0 -62
  362. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/binary.mjs +0 -58
  363. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/binary.mjs.map +0 -1
  364. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/bool.cjs +0 -39
  365. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/bool.mjs +0 -35
  366. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/bool.mjs.map +0 -1
  367. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/float.cjs +0 -58
  368. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/float.mjs +0 -54
  369. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/float.mjs.map +0 -1
  370. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/int.cjs +0 -87
  371. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/int.mjs +0 -83
  372. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/int.mjs.map +0 -1
  373. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/merge.cjs +0 -53
  374. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/merge.mjs +0 -49
  375. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/merge.mjs.map +0 -1
  376. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/omap.cjs +0 -79
  377. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/omap.mjs +0 -75
  378. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/omap.mjs.map +0 -1
  379. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/pairs.cjs +0 -75
  380. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/pairs.mjs +0 -71
  381. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/pairs.mjs.map +0 -1
  382. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/schema.cjs +0 -65
  383. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/schema.mjs +0 -61
  384. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/schema.mjs.map +0 -1
  385. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/set.cjs +0 -82
  386. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/set.mjs +0 -78
  387. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/set.mjs.map +0 -1
  388. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/timestamp.cjs +0 -95
  389. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/timestamp.mjs +0 -91
  390. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/timestamp.mjs.map +0 -1
  391. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/foldFlowLines.cjs +0 -127
  392. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/foldFlowLines.mjs +0 -123
  393. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/foldFlowLines.mjs.map +0 -1
  394. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringify.cjs +0 -122
  395. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringify.mjs +0 -118
  396. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringify.mjs.map +0 -1
  397. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyCollection.cjs +0 -128
  398. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyCollection.mjs +0 -124
  399. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyCollection.mjs.map +0 -1
  400. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyComment.cjs +0 -31
  401. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyComment.mjs +0 -27
  402. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyComment.mjs.map +0 -1
  403. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyDocument.cjs +0 -75
  404. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyDocument.mjs +0 -71
  405. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyDocument.mjs.map +0 -1
  406. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyNumber.cjs +0 -32
  407. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyNumber.mjs +0 -28
  408. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyNumber.mjs.map +0 -1
  409. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyPair.cjs +0 -112
  410. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyPair.mjs +0 -108
  411. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyPair.mjs.map +0 -1
  412. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyString.cjs +0 -237
  413. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyString.mjs +0 -233
  414. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyString.mjs.map +0 -1
  415. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/visit.cjs +0 -202
  416. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/visit.mjs +0 -198
  417. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/visit.mjs.map +0 -1
  418. package/dist/node_modules/.pnpm/yocto-queue@1.2.2/node_modules/yocto-queue/index.cjs +0 -61
  419. package/dist/node_modules/.pnpm/yocto-queue@1.2.2/node_modules/yocto-queue/index.mjs +0 -61
  420. package/dist/node_modules/.pnpm/yocto-queue@1.2.2/node_modules/yocto-queue/index.mjs.map +0 -1
@@ -1,2120 +0,0 @@
1
- import { __commonJSMin, __require } from "../../../../../../_virtual/rolldown_runtime.mjs";
2
-
3
- //#region ../../node_modules/.pnpm/esbuild@0.25.12/node_modules/esbuild/lib/main.js
4
- var require_main = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5
- var __defProp = Object.defineProperty;
6
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
- var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __export = (target, all) => {
10
- for (var name in all) __defProp(target, name, {
11
- get: all[name],
12
- enumerable: true
13
- });
14
- };
15
- var __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from === "object" || typeof from === "function") {
17
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
18
- get: () => from[key],
19
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
- });
21
- }
22
- return to;
23
- };
24
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
- var node_exports = {};
26
- __export(node_exports, {
27
- analyzeMetafile: () => analyzeMetafile,
28
- analyzeMetafileSync: () => analyzeMetafileSync,
29
- build: () => build,
30
- buildSync: () => buildSync,
31
- context: () => context,
32
- default: () => node_default,
33
- formatMessages: () => formatMessages,
34
- formatMessagesSync: () => formatMessagesSync,
35
- initialize: () => initialize,
36
- stop: () => stop,
37
- transform: () => transform,
38
- transformSync: () => transformSync,
39
- version: () => version
40
- });
41
- module.exports = __toCommonJS(node_exports);
42
- function encodePacket(packet) {
43
- let visit = (value) => {
44
- if (value === null) bb.write8(0);
45
- else if (typeof value === "boolean") {
46
- bb.write8(1);
47
- bb.write8(+value);
48
- } else if (typeof value === "number") {
49
- bb.write8(2);
50
- bb.write32(value | 0);
51
- } else if (typeof value === "string") {
52
- bb.write8(3);
53
- bb.write(encodeUTF8(value));
54
- } else if (value instanceof Uint8Array) {
55
- bb.write8(4);
56
- bb.write(value);
57
- } else if (value instanceof Array) {
58
- bb.write8(5);
59
- bb.write32(value.length);
60
- for (let item of value) visit(item);
61
- } else {
62
- let keys = Object.keys(value);
63
- bb.write8(6);
64
- bb.write32(keys.length);
65
- for (let key of keys) {
66
- bb.write(encodeUTF8(key));
67
- visit(value[key]);
68
- }
69
- }
70
- };
71
- let bb = new ByteBuffer();
72
- bb.write32(0);
73
- bb.write32(packet.id << 1 | +!packet.isRequest);
74
- visit(packet.value);
75
- writeUInt32LE(bb.buf, bb.len - 4, 0);
76
- return bb.buf.subarray(0, bb.len);
77
- }
78
- function decodePacket(bytes) {
79
- let visit = () => {
80
- switch (bb.read8()) {
81
- case 0: return null;
82
- case 1: return !!bb.read8();
83
- case 2: return bb.read32();
84
- case 3: return decodeUTF8(bb.read());
85
- case 4: return bb.read();
86
- case 5: {
87
- let count = bb.read32();
88
- let value2 = [];
89
- for (let i = 0; i < count; i++) value2.push(visit());
90
- return value2;
91
- }
92
- case 6: {
93
- let count = bb.read32();
94
- let value2 = {};
95
- for (let i = 0; i < count; i++) value2[decodeUTF8(bb.read())] = visit();
96
- return value2;
97
- }
98
- default: throw new Error("Invalid packet");
99
- }
100
- };
101
- let bb = new ByteBuffer(bytes);
102
- let id = bb.read32();
103
- let isRequest = (id & 1) === 0;
104
- id >>>= 1;
105
- let value = visit();
106
- if (bb.ptr !== bytes.length) throw new Error("Invalid packet");
107
- return {
108
- id,
109
- isRequest,
110
- value
111
- };
112
- }
113
- var ByteBuffer = class {
114
- constructor(buf = new Uint8Array(1024)) {
115
- this.buf = buf;
116
- this.len = 0;
117
- this.ptr = 0;
118
- }
119
- _write(delta) {
120
- if (this.len + delta > this.buf.length) {
121
- let clone = new Uint8Array((this.len + delta) * 2);
122
- clone.set(this.buf);
123
- this.buf = clone;
124
- }
125
- this.len += delta;
126
- return this.len - delta;
127
- }
128
- write8(value) {
129
- let offset = this._write(1);
130
- this.buf[offset] = value;
131
- }
132
- write32(value) {
133
- let offset = this._write(4);
134
- writeUInt32LE(this.buf, value, offset);
135
- }
136
- write(bytes) {
137
- let offset = this._write(4 + bytes.length);
138
- writeUInt32LE(this.buf, bytes.length, offset);
139
- this.buf.set(bytes, offset + 4);
140
- }
141
- _read(delta) {
142
- if (this.ptr + delta > this.buf.length) throw new Error("Invalid packet");
143
- this.ptr += delta;
144
- return this.ptr - delta;
145
- }
146
- read8() {
147
- return this.buf[this._read(1)];
148
- }
149
- read32() {
150
- return readUInt32LE(this.buf, this._read(4));
151
- }
152
- read() {
153
- let length = this.read32();
154
- let bytes = new Uint8Array(length);
155
- let ptr = this._read(bytes.length);
156
- bytes.set(this.buf.subarray(ptr, ptr + length));
157
- return bytes;
158
- }
159
- };
160
- var encodeUTF8;
161
- var decodeUTF8;
162
- var encodeInvariant;
163
- if (typeof TextEncoder !== "undefined" && typeof TextDecoder !== "undefined") {
164
- let encoder = new TextEncoder();
165
- let decoder = new TextDecoder();
166
- encodeUTF8 = (text) => encoder.encode(text);
167
- decodeUTF8 = (bytes) => decoder.decode(bytes);
168
- encodeInvariant = "new TextEncoder().encode(\"\")";
169
- } else if (typeof Buffer !== "undefined") {
170
- encodeUTF8 = (text) => Buffer.from(text);
171
- decodeUTF8 = (bytes) => {
172
- let { buffer, byteOffset, byteLength } = bytes;
173
- return Buffer.from(buffer, byteOffset, byteLength).toString();
174
- };
175
- encodeInvariant = "Buffer.from(\"\")";
176
- } else throw new Error("No UTF-8 codec found");
177
- if (!(encodeUTF8("") instanceof Uint8Array)) throw new Error(`Invariant violation: "${encodeInvariant} instanceof Uint8Array" is incorrectly false
178
-
179
- This indicates that your JavaScript environment is broken. You cannot use
180
- esbuild in this environment because esbuild relies on this invariant. This
181
- is not a problem with esbuild. You need to fix your environment instead.
182
- `);
183
- function readUInt32LE(buffer, offset) {
184
- return buffer[offset++] | buffer[offset++] << 8 | buffer[offset++] << 16 | buffer[offset++] << 24;
185
- }
186
- function writeUInt32LE(buffer, value, offset) {
187
- buffer[offset++] = value;
188
- buffer[offset++] = value >> 8;
189
- buffer[offset++] = value >> 16;
190
- buffer[offset++] = value >> 24;
191
- }
192
- var quote = JSON.stringify;
193
- var buildLogLevelDefault = "warning";
194
- var transformLogLevelDefault = "silent";
195
- function validateAndJoinStringArray(values, what) {
196
- const toJoin = [];
197
- for (const value of values) {
198
- validateStringValue(value, what);
199
- if (value.indexOf(",") >= 0) throw new Error(`Invalid ${what}: ${value}`);
200
- toJoin.push(value);
201
- }
202
- return toJoin.join(",");
203
- }
204
- var canBeAnything = () => null;
205
- var mustBeBoolean = (value) => typeof value === "boolean" ? null : "a boolean";
206
- var mustBeString = (value) => typeof value === "string" ? null : "a string";
207
- var mustBeRegExp = (value) => value instanceof RegExp ? null : "a RegExp object";
208
- var mustBeInteger = (value) => typeof value === "number" && value === (value | 0) ? null : "an integer";
209
- var mustBeValidPortNumber = (value) => typeof value === "number" && value === (value | 0) && value >= 0 && value <= 65535 ? null : "a valid port number";
210
- var mustBeFunction = (value) => typeof value === "function" ? null : "a function";
211
- var mustBeArray = (value) => Array.isArray(value) ? null : "an array";
212
- var mustBeArrayOfStrings = (value) => Array.isArray(value) && value.every((x) => typeof x === "string") ? null : "an array of strings";
213
- var mustBeObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? null : "an object";
214
- var mustBeEntryPoints = (value) => typeof value === "object" && value !== null ? null : "an array or an object";
215
- var mustBeWebAssemblyModule = (value) => value instanceof WebAssembly.Module ? null : "a WebAssembly.Module";
216
- var mustBeObjectOrNull = (value) => typeof value === "object" && !Array.isArray(value) ? null : "an object or null";
217
- var mustBeStringOrBoolean = (value) => typeof value === "string" || typeof value === "boolean" ? null : "a string or a boolean";
218
- var mustBeStringOrObject = (value) => typeof value === "string" || typeof value === "object" && value !== null && !Array.isArray(value) ? null : "a string or an object";
219
- var mustBeStringOrArrayOfStrings = (value) => typeof value === "string" || Array.isArray(value) && value.every((x) => typeof x === "string") ? null : "a string or an array of strings";
220
- var mustBeStringOrUint8Array = (value) => typeof value === "string" || value instanceof Uint8Array ? null : "a string or a Uint8Array";
221
- var mustBeStringOrURL = (value) => typeof value === "string" || value instanceof URL ? null : "a string or a URL";
222
- function getFlag(object, keys, key, mustBeFn) {
223
- let value = object[key];
224
- keys[key + ""] = true;
225
- if (value === void 0) return void 0;
226
- let mustBe = mustBeFn(value);
227
- if (mustBe !== null) throw new Error(`${quote(key)} must be ${mustBe}`);
228
- return value;
229
- }
230
- function checkForInvalidFlags(object, keys, where) {
231
- for (let key in object) if (!(key in keys)) throw new Error(`Invalid option ${where}: ${quote(key)}`);
232
- }
233
- function validateInitializeOptions(options) {
234
- let keys = /* @__PURE__ */ Object.create(null);
235
- let wasmURL = getFlag(options, keys, "wasmURL", mustBeStringOrURL);
236
- let wasmModule = getFlag(options, keys, "wasmModule", mustBeWebAssemblyModule);
237
- let worker = getFlag(options, keys, "worker", mustBeBoolean);
238
- checkForInvalidFlags(options, keys, "in initialize() call");
239
- return {
240
- wasmURL,
241
- wasmModule,
242
- worker
243
- };
244
- }
245
- function validateMangleCache(mangleCache) {
246
- let validated;
247
- if (mangleCache !== void 0) {
248
- validated = /* @__PURE__ */ Object.create(null);
249
- for (let key in mangleCache) {
250
- let value = mangleCache[key];
251
- if (typeof value === "string" || value === false) validated[key] = value;
252
- else throw new Error(`Expected ${quote(key)} in mangle cache to map to either a string or false`);
253
- }
254
- }
255
- return validated;
256
- }
257
- function pushLogFlags(flags, options, keys, isTTY2, logLevelDefault) {
258
- let color = getFlag(options, keys, "color", mustBeBoolean);
259
- let logLevel = getFlag(options, keys, "logLevel", mustBeString);
260
- let logLimit = getFlag(options, keys, "logLimit", mustBeInteger);
261
- if (color !== void 0) flags.push(`--color=${color}`);
262
- else if (isTTY2) flags.push(`--color=true`);
263
- flags.push(`--log-level=${logLevel || logLevelDefault}`);
264
- flags.push(`--log-limit=${logLimit || 0}`);
265
- }
266
- function validateStringValue(value, what, key) {
267
- if (typeof value !== "string") throw new Error(`Expected value for ${what}${key !== void 0 ? " " + quote(key) : ""} to be a string, got ${typeof value} instead`);
268
- return value;
269
- }
270
- function pushCommonFlags(flags, options, keys) {
271
- let legalComments = getFlag(options, keys, "legalComments", mustBeString);
272
- let sourceRoot = getFlag(options, keys, "sourceRoot", mustBeString);
273
- let sourcesContent = getFlag(options, keys, "sourcesContent", mustBeBoolean);
274
- let target = getFlag(options, keys, "target", mustBeStringOrArrayOfStrings);
275
- let format = getFlag(options, keys, "format", mustBeString);
276
- let globalName = getFlag(options, keys, "globalName", mustBeString);
277
- let mangleProps = getFlag(options, keys, "mangleProps", mustBeRegExp);
278
- let reserveProps = getFlag(options, keys, "reserveProps", mustBeRegExp);
279
- let mangleQuoted = getFlag(options, keys, "mangleQuoted", mustBeBoolean);
280
- let minify = getFlag(options, keys, "minify", mustBeBoolean);
281
- let minifySyntax = getFlag(options, keys, "minifySyntax", mustBeBoolean);
282
- let minifyWhitespace = getFlag(options, keys, "minifyWhitespace", mustBeBoolean);
283
- let minifyIdentifiers = getFlag(options, keys, "minifyIdentifiers", mustBeBoolean);
284
- let lineLimit = getFlag(options, keys, "lineLimit", mustBeInteger);
285
- let drop = getFlag(options, keys, "drop", mustBeArrayOfStrings);
286
- let dropLabels = getFlag(options, keys, "dropLabels", mustBeArrayOfStrings);
287
- let charset = getFlag(options, keys, "charset", mustBeString);
288
- let treeShaking = getFlag(options, keys, "treeShaking", mustBeBoolean);
289
- let ignoreAnnotations = getFlag(options, keys, "ignoreAnnotations", mustBeBoolean);
290
- let jsx = getFlag(options, keys, "jsx", mustBeString);
291
- let jsxFactory = getFlag(options, keys, "jsxFactory", mustBeString);
292
- let jsxFragment = getFlag(options, keys, "jsxFragment", mustBeString);
293
- let jsxImportSource = getFlag(options, keys, "jsxImportSource", mustBeString);
294
- let jsxDev = getFlag(options, keys, "jsxDev", mustBeBoolean);
295
- let jsxSideEffects = getFlag(options, keys, "jsxSideEffects", mustBeBoolean);
296
- let define = getFlag(options, keys, "define", mustBeObject);
297
- let logOverride = getFlag(options, keys, "logOverride", mustBeObject);
298
- let supported = getFlag(options, keys, "supported", mustBeObject);
299
- let pure = getFlag(options, keys, "pure", mustBeArrayOfStrings);
300
- let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean);
301
- let platform = getFlag(options, keys, "platform", mustBeString);
302
- let tsconfigRaw = getFlag(options, keys, "tsconfigRaw", mustBeStringOrObject);
303
- let absPaths = getFlag(options, keys, "absPaths", mustBeArrayOfStrings);
304
- if (legalComments) flags.push(`--legal-comments=${legalComments}`);
305
- if (sourceRoot !== void 0) flags.push(`--source-root=${sourceRoot}`);
306
- if (sourcesContent !== void 0) flags.push(`--sources-content=${sourcesContent}`);
307
- if (target) flags.push(`--target=${validateAndJoinStringArray(Array.isArray(target) ? target : [target], "target")}`);
308
- if (format) flags.push(`--format=${format}`);
309
- if (globalName) flags.push(`--global-name=${globalName}`);
310
- if (platform) flags.push(`--platform=${platform}`);
311
- if (tsconfigRaw) flags.push(`--tsconfig-raw=${typeof tsconfigRaw === "string" ? tsconfigRaw : JSON.stringify(tsconfigRaw)}`);
312
- if (minify) flags.push("--minify");
313
- if (minifySyntax) flags.push("--minify-syntax");
314
- if (minifyWhitespace) flags.push("--minify-whitespace");
315
- if (minifyIdentifiers) flags.push("--minify-identifiers");
316
- if (lineLimit) flags.push(`--line-limit=${lineLimit}`);
317
- if (charset) flags.push(`--charset=${charset}`);
318
- if (treeShaking !== void 0) flags.push(`--tree-shaking=${treeShaking}`);
319
- if (ignoreAnnotations) flags.push(`--ignore-annotations`);
320
- if (drop) for (let what of drop) flags.push(`--drop:${validateStringValue(what, "drop")}`);
321
- if (dropLabels) flags.push(`--drop-labels=${validateAndJoinStringArray(dropLabels, "drop label")}`);
322
- if (absPaths) flags.push(`--abs-paths=${validateAndJoinStringArray(absPaths, "abs paths")}`);
323
- if (mangleProps) flags.push(`--mangle-props=${jsRegExpToGoRegExp(mangleProps)}`);
324
- if (reserveProps) flags.push(`--reserve-props=${jsRegExpToGoRegExp(reserveProps)}`);
325
- if (mangleQuoted !== void 0) flags.push(`--mangle-quoted=${mangleQuoted}`);
326
- if (jsx) flags.push(`--jsx=${jsx}`);
327
- if (jsxFactory) flags.push(`--jsx-factory=${jsxFactory}`);
328
- if (jsxFragment) flags.push(`--jsx-fragment=${jsxFragment}`);
329
- if (jsxImportSource) flags.push(`--jsx-import-source=${jsxImportSource}`);
330
- if (jsxDev) flags.push(`--jsx-dev`);
331
- if (jsxSideEffects) flags.push(`--jsx-side-effects`);
332
- if (define) for (let key in define) {
333
- if (key.indexOf("=") >= 0) throw new Error(`Invalid define: ${key}`);
334
- flags.push(`--define:${key}=${validateStringValue(define[key], "define", key)}`);
335
- }
336
- if (logOverride) for (let key in logOverride) {
337
- if (key.indexOf("=") >= 0) throw new Error(`Invalid log override: ${key}`);
338
- flags.push(`--log-override:${key}=${validateStringValue(logOverride[key], "log override", key)}`);
339
- }
340
- if (supported) for (let key in supported) {
341
- if (key.indexOf("=") >= 0) throw new Error(`Invalid supported: ${key}`);
342
- const value = supported[key];
343
- if (typeof value !== "boolean") throw new Error(`Expected value for supported ${quote(key)} to be a boolean, got ${typeof value} instead`);
344
- flags.push(`--supported:${key}=${value}`);
345
- }
346
- if (pure) for (let fn of pure) flags.push(`--pure:${validateStringValue(fn, "pure")}`);
347
- if (keepNames) flags.push(`--keep-names`);
348
- }
349
- function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeDefault) {
350
- var _a2;
351
- let flags = [];
352
- let entries = [];
353
- let keys = /* @__PURE__ */ Object.create(null);
354
- let stdinContents = null;
355
- let stdinResolveDir = null;
356
- pushLogFlags(flags, options, keys, isTTY2, logLevelDefault);
357
- pushCommonFlags(flags, options, keys);
358
- let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean);
359
- let bundle = getFlag(options, keys, "bundle", mustBeBoolean);
360
- let splitting = getFlag(options, keys, "splitting", mustBeBoolean);
361
- let preserveSymlinks = getFlag(options, keys, "preserveSymlinks", mustBeBoolean);
362
- let metafile = getFlag(options, keys, "metafile", mustBeBoolean);
363
- let outfile = getFlag(options, keys, "outfile", mustBeString);
364
- let outdir = getFlag(options, keys, "outdir", mustBeString);
365
- let outbase = getFlag(options, keys, "outbase", mustBeString);
366
- let tsconfig = getFlag(options, keys, "tsconfig", mustBeString);
367
- let resolveExtensions = getFlag(options, keys, "resolveExtensions", mustBeArrayOfStrings);
368
- let nodePathsInput = getFlag(options, keys, "nodePaths", mustBeArrayOfStrings);
369
- let mainFields = getFlag(options, keys, "mainFields", mustBeArrayOfStrings);
370
- let conditions = getFlag(options, keys, "conditions", mustBeArrayOfStrings);
371
- let external = getFlag(options, keys, "external", mustBeArrayOfStrings);
372
- let packages = getFlag(options, keys, "packages", mustBeString);
373
- let alias = getFlag(options, keys, "alias", mustBeObject);
374
- let loader = getFlag(options, keys, "loader", mustBeObject);
375
- let outExtension = getFlag(options, keys, "outExtension", mustBeObject);
376
- let publicPath = getFlag(options, keys, "publicPath", mustBeString);
377
- let entryNames = getFlag(options, keys, "entryNames", mustBeString);
378
- let chunkNames = getFlag(options, keys, "chunkNames", mustBeString);
379
- let assetNames = getFlag(options, keys, "assetNames", mustBeString);
380
- let inject = getFlag(options, keys, "inject", mustBeArrayOfStrings);
381
- let banner = getFlag(options, keys, "banner", mustBeObject);
382
- let footer = getFlag(options, keys, "footer", mustBeObject);
383
- let entryPoints = getFlag(options, keys, "entryPoints", mustBeEntryPoints);
384
- let absWorkingDir = getFlag(options, keys, "absWorkingDir", mustBeString);
385
- let stdin = getFlag(options, keys, "stdin", mustBeObject);
386
- let write = (_a2 = getFlag(options, keys, "write", mustBeBoolean)) != null ? _a2 : writeDefault;
387
- let allowOverwrite = getFlag(options, keys, "allowOverwrite", mustBeBoolean);
388
- let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject);
389
- keys.plugins = true;
390
- checkForInvalidFlags(options, keys, `in ${callName}() call`);
391
- if (sourcemap) flags.push(`--sourcemap${sourcemap === true ? "" : `=${sourcemap}`}`);
392
- if (bundle) flags.push("--bundle");
393
- if (allowOverwrite) flags.push("--allow-overwrite");
394
- if (splitting) flags.push("--splitting");
395
- if (preserveSymlinks) flags.push("--preserve-symlinks");
396
- if (metafile) flags.push(`--metafile`);
397
- if (outfile) flags.push(`--outfile=${outfile}`);
398
- if (outdir) flags.push(`--outdir=${outdir}`);
399
- if (outbase) flags.push(`--outbase=${outbase}`);
400
- if (tsconfig) flags.push(`--tsconfig=${tsconfig}`);
401
- if (packages) flags.push(`--packages=${packages}`);
402
- if (resolveExtensions) flags.push(`--resolve-extensions=${validateAndJoinStringArray(resolveExtensions, "resolve extension")}`);
403
- if (publicPath) flags.push(`--public-path=${publicPath}`);
404
- if (entryNames) flags.push(`--entry-names=${entryNames}`);
405
- if (chunkNames) flags.push(`--chunk-names=${chunkNames}`);
406
- if (assetNames) flags.push(`--asset-names=${assetNames}`);
407
- if (mainFields) flags.push(`--main-fields=${validateAndJoinStringArray(mainFields, "main field")}`);
408
- if (conditions) flags.push(`--conditions=${validateAndJoinStringArray(conditions, "condition")}`);
409
- if (external) for (let name of external) flags.push(`--external:${validateStringValue(name, "external")}`);
410
- if (alias) for (let old in alias) {
411
- if (old.indexOf("=") >= 0) throw new Error(`Invalid package name in alias: ${old}`);
412
- flags.push(`--alias:${old}=${validateStringValue(alias[old], "alias", old)}`);
413
- }
414
- if (banner) for (let type in banner) {
415
- if (type.indexOf("=") >= 0) throw new Error(`Invalid banner file type: ${type}`);
416
- flags.push(`--banner:${type}=${validateStringValue(banner[type], "banner", type)}`);
417
- }
418
- if (footer) for (let type in footer) {
419
- if (type.indexOf("=") >= 0) throw new Error(`Invalid footer file type: ${type}`);
420
- flags.push(`--footer:${type}=${validateStringValue(footer[type], "footer", type)}`);
421
- }
422
- if (inject) for (let path3 of inject) flags.push(`--inject:${validateStringValue(path3, "inject")}`);
423
- if (loader) for (let ext in loader) {
424
- if (ext.indexOf("=") >= 0) throw new Error(`Invalid loader extension: ${ext}`);
425
- flags.push(`--loader:${ext}=${validateStringValue(loader[ext], "loader", ext)}`);
426
- }
427
- if (outExtension) for (let ext in outExtension) {
428
- if (ext.indexOf("=") >= 0) throw new Error(`Invalid out extension: ${ext}`);
429
- flags.push(`--out-extension:${ext}=${validateStringValue(outExtension[ext], "out extension", ext)}`);
430
- }
431
- if (entryPoints) if (Array.isArray(entryPoints)) for (let i = 0, n = entryPoints.length; i < n; i++) {
432
- let entryPoint = entryPoints[i];
433
- if (typeof entryPoint === "object" && entryPoint !== null) {
434
- let entryPointKeys = /* @__PURE__ */ Object.create(null);
435
- let input = getFlag(entryPoint, entryPointKeys, "in", mustBeString);
436
- let output = getFlag(entryPoint, entryPointKeys, "out", mustBeString);
437
- checkForInvalidFlags(entryPoint, entryPointKeys, "in entry point at index " + i);
438
- if (input === void 0) throw new Error("Missing property \"in\" for entry point at index " + i);
439
- if (output === void 0) throw new Error("Missing property \"out\" for entry point at index " + i);
440
- entries.push([output, input]);
441
- } else entries.push(["", validateStringValue(entryPoint, "entry point at index " + i)]);
442
- }
443
- else for (let key in entryPoints) entries.push([key, validateStringValue(entryPoints[key], "entry point", key)]);
444
- if (stdin) {
445
- let stdinKeys = /* @__PURE__ */ Object.create(null);
446
- let contents = getFlag(stdin, stdinKeys, "contents", mustBeStringOrUint8Array);
447
- let resolveDir = getFlag(stdin, stdinKeys, "resolveDir", mustBeString);
448
- let sourcefile = getFlag(stdin, stdinKeys, "sourcefile", mustBeString);
449
- let loader2 = getFlag(stdin, stdinKeys, "loader", mustBeString);
450
- checkForInvalidFlags(stdin, stdinKeys, "in \"stdin\" object");
451
- if (sourcefile) flags.push(`--sourcefile=${sourcefile}`);
452
- if (loader2) flags.push(`--loader=${loader2}`);
453
- if (resolveDir) stdinResolveDir = resolveDir;
454
- if (typeof contents === "string") stdinContents = encodeUTF8(contents);
455
- else if (contents instanceof Uint8Array) stdinContents = contents;
456
- }
457
- let nodePaths = [];
458
- if (nodePathsInput) for (let value of nodePathsInput) {
459
- value += "";
460
- nodePaths.push(value);
461
- }
462
- return {
463
- entries,
464
- flags,
465
- write,
466
- stdinContents,
467
- stdinResolveDir,
468
- absWorkingDir,
469
- nodePaths,
470
- mangleCache: validateMangleCache(mangleCache)
471
- };
472
- }
473
- function flagsForTransformOptions(callName, options, isTTY2, logLevelDefault) {
474
- let flags = [];
475
- let keys = /* @__PURE__ */ Object.create(null);
476
- pushLogFlags(flags, options, keys, isTTY2, logLevelDefault);
477
- pushCommonFlags(flags, options, keys);
478
- let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean);
479
- let sourcefile = getFlag(options, keys, "sourcefile", mustBeString);
480
- let loader = getFlag(options, keys, "loader", mustBeString);
481
- let banner = getFlag(options, keys, "banner", mustBeString);
482
- let footer = getFlag(options, keys, "footer", mustBeString);
483
- let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject);
484
- checkForInvalidFlags(options, keys, `in ${callName}() call`);
485
- if (sourcemap) flags.push(`--sourcemap=${sourcemap === true ? "external" : sourcemap}`);
486
- if (sourcefile) flags.push(`--sourcefile=${sourcefile}`);
487
- if (loader) flags.push(`--loader=${loader}`);
488
- if (banner) flags.push(`--banner=${banner}`);
489
- if (footer) flags.push(`--footer=${footer}`);
490
- return {
491
- flags,
492
- mangleCache: validateMangleCache(mangleCache)
493
- };
494
- }
495
- function createChannel(streamIn) {
496
- const requestCallbacksByKey = {};
497
- const closeData = {
498
- didClose: false,
499
- reason: ""
500
- };
501
- let responseCallbacks = {};
502
- let nextRequestID = 0;
503
- let nextBuildKey = 0;
504
- let stdout = new Uint8Array(16 * 1024);
505
- let stdoutUsed = 0;
506
- let readFromStdout = (chunk) => {
507
- let limit = stdoutUsed + chunk.length;
508
- if (limit > stdout.length) {
509
- let swap = new Uint8Array(limit * 2);
510
- swap.set(stdout);
511
- stdout = swap;
512
- }
513
- stdout.set(chunk, stdoutUsed);
514
- stdoutUsed += chunk.length;
515
- let offset = 0;
516
- while (offset + 4 <= stdoutUsed) {
517
- let length = readUInt32LE(stdout, offset);
518
- if (offset + 4 + length > stdoutUsed) break;
519
- offset += 4;
520
- handleIncomingPacket(stdout.subarray(offset, offset + length));
521
- offset += length;
522
- }
523
- if (offset > 0) {
524
- stdout.copyWithin(0, offset, stdoutUsed);
525
- stdoutUsed -= offset;
526
- }
527
- };
528
- let afterClose = (error) => {
529
- closeData.didClose = true;
530
- if (error) closeData.reason = ": " + (error.message || error);
531
- const text = "The service was stopped" + closeData.reason;
532
- for (let id in responseCallbacks) responseCallbacks[id](text, null);
533
- responseCallbacks = {};
534
- };
535
- let sendRequest = (refs, value, callback) => {
536
- if (closeData.didClose) return callback("The service is no longer running" + closeData.reason, null);
537
- let id = nextRequestID++;
538
- responseCallbacks[id] = (error, response) => {
539
- try {
540
- callback(error, response);
541
- } finally {
542
- if (refs) refs.unref();
543
- }
544
- };
545
- if (refs) refs.ref();
546
- streamIn.writeToStdin(encodePacket({
547
- id,
548
- isRequest: true,
549
- value
550
- }));
551
- };
552
- let sendResponse = (id, value) => {
553
- if (closeData.didClose) throw new Error("The service is no longer running" + closeData.reason);
554
- streamIn.writeToStdin(encodePacket({
555
- id,
556
- isRequest: false,
557
- value
558
- }));
559
- };
560
- let handleRequest = async (id, request) => {
561
- try {
562
- if (request.command === "ping") {
563
- sendResponse(id, {});
564
- return;
565
- }
566
- if (typeof request.key === "number") {
567
- const requestCallbacks = requestCallbacksByKey[request.key];
568
- if (!requestCallbacks) return;
569
- const callback = requestCallbacks[request.command];
570
- if (callback) {
571
- await callback(id, request);
572
- return;
573
- }
574
- }
575
- throw new Error(`Invalid command: ` + request.command);
576
- } catch (e) {
577
- const errors = [extractErrorMessageV8(e, streamIn, null, void 0, "")];
578
- try {
579
- sendResponse(id, { errors });
580
- } catch {}
581
- }
582
- };
583
- let isFirstPacket = true;
584
- let handleIncomingPacket = (bytes) => {
585
- if (isFirstPacket) {
586
- isFirstPacket = false;
587
- let binaryVersion = String.fromCharCode(...bytes);
588
- if (binaryVersion !== "0.25.12") throw new Error(`Cannot start service: Host version "0.25.12" does not match binary version ${quote(binaryVersion)}`);
589
- return;
590
- }
591
- let packet = decodePacket(bytes);
592
- if (packet.isRequest) handleRequest(packet.id, packet.value);
593
- else {
594
- let callback = responseCallbacks[packet.id];
595
- delete responseCallbacks[packet.id];
596
- if (packet.value.error) callback(packet.value.error, {});
597
- else callback(null, packet.value);
598
- }
599
- };
600
- let buildOrContext = ({ callName, refs, options, isTTY: isTTY2, defaultWD: defaultWD2, callback }) => {
601
- let refCount = 0;
602
- const buildKey = nextBuildKey++;
603
- const requestCallbacks = {};
604
- const buildRefs = {
605
- ref() {
606
- if (++refCount === 1) {
607
- if (refs) refs.ref();
608
- }
609
- },
610
- unref() {
611
- if (--refCount === 0) {
612
- delete requestCallbacksByKey[buildKey];
613
- if (refs) refs.unref();
614
- }
615
- }
616
- };
617
- requestCallbacksByKey[buildKey] = requestCallbacks;
618
- buildRefs.ref();
619
- buildOrContextImpl(callName, buildKey, sendRequest, sendResponse, buildRefs, streamIn, requestCallbacks, options, isTTY2, defaultWD2, (err, res) => {
620
- try {
621
- callback(err, res);
622
- } finally {
623
- buildRefs.unref();
624
- }
625
- });
626
- };
627
- let transform2 = ({ callName, refs, input, options, isTTY: isTTY2, fs: fs3, callback }) => {
628
- const details = createObjectStash();
629
- let start = (inputPath) => {
630
- try {
631
- if (typeof input !== "string" && !(input instanceof Uint8Array)) throw new Error("The input to \"transform\" must be a string or a Uint8Array");
632
- let { flags, mangleCache } = flagsForTransformOptions(callName, options, isTTY2, transformLogLevelDefault);
633
- let request = {
634
- command: "transform",
635
- flags,
636
- inputFS: inputPath !== null,
637
- input: inputPath !== null ? encodeUTF8(inputPath) : typeof input === "string" ? encodeUTF8(input) : input
638
- };
639
- if (mangleCache) request.mangleCache = mangleCache;
640
- sendRequest(refs, request, (error, response) => {
641
- if (error) return callback(new Error(error), null);
642
- let errors = replaceDetailsInMessages(response.errors, details);
643
- let warnings = replaceDetailsInMessages(response.warnings, details);
644
- let outstanding = 1;
645
- let next = () => {
646
- if (--outstanding === 0) {
647
- let result = {
648
- warnings,
649
- code: response.code,
650
- map: response.map,
651
- mangleCache: void 0,
652
- legalComments: void 0
653
- };
654
- if ("legalComments" in response) result.legalComments = response == null ? void 0 : response.legalComments;
655
- if (response.mangleCache) result.mangleCache = response == null ? void 0 : response.mangleCache;
656
- callback(null, result);
657
- }
658
- };
659
- if (errors.length > 0) return callback(failureErrorWithLog("Transform failed", errors, warnings), null);
660
- if (response.codeFS) {
661
- outstanding++;
662
- fs3.readFile(response.code, (err, contents) => {
663
- if (err !== null) callback(err, null);
664
- else {
665
- response.code = contents;
666
- next();
667
- }
668
- });
669
- }
670
- if (response.mapFS) {
671
- outstanding++;
672
- fs3.readFile(response.map, (err, contents) => {
673
- if (err !== null) callback(err, null);
674
- else {
675
- response.map = contents;
676
- next();
677
- }
678
- });
679
- }
680
- next();
681
- });
682
- } catch (e) {
683
- let flags = [];
684
- try {
685
- pushLogFlags(flags, options, {}, isTTY2, transformLogLevelDefault);
686
- } catch {}
687
- const error = extractErrorMessageV8(e, streamIn, details, void 0, "");
688
- sendRequest(refs, {
689
- command: "error",
690
- flags,
691
- error
692
- }, () => {
693
- error.detail = details.load(error.detail);
694
- callback(failureErrorWithLog("Transform failed", [error], []), null);
695
- });
696
- }
697
- };
698
- if ((typeof input === "string" || input instanceof Uint8Array) && input.length > 1024 * 1024) {
699
- let next = start;
700
- start = () => fs3.writeFile(input, next);
701
- }
702
- start(null);
703
- };
704
- let formatMessages2 = ({ callName, refs, messages, options, callback }) => {
705
- if (!options) throw new Error(`Missing second argument in ${callName}() call`);
706
- let keys = {};
707
- let kind = getFlag(options, keys, "kind", mustBeString);
708
- let color = getFlag(options, keys, "color", mustBeBoolean);
709
- let terminalWidth = getFlag(options, keys, "terminalWidth", mustBeInteger);
710
- checkForInvalidFlags(options, keys, `in ${callName}() call`);
711
- if (kind === void 0) throw new Error(`Missing "kind" in ${callName}() call`);
712
- if (kind !== "error" && kind !== "warning") throw new Error(`Expected "kind" to be "error" or "warning" in ${callName}() call`);
713
- let request = {
714
- command: "format-msgs",
715
- messages: sanitizeMessages(messages, "messages", null, "", terminalWidth),
716
- isWarning: kind === "warning"
717
- };
718
- if (color !== void 0) request.color = color;
719
- if (terminalWidth !== void 0) request.terminalWidth = terminalWidth;
720
- sendRequest(refs, request, (error, response) => {
721
- if (error) return callback(new Error(error), null);
722
- callback(null, response.messages);
723
- });
724
- };
725
- let analyzeMetafile2 = ({ callName, refs, metafile, options, callback }) => {
726
- if (options === void 0) options = {};
727
- let keys = {};
728
- let color = getFlag(options, keys, "color", mustBeBoolean);
729
- let verbose = getFlag(options, keys, "verbose", mustBeBoolean);
730
- checkForInvalidFlags(options, keys, `in ${callName}() call`);
731
- let request = {
732
- command: "analyze-metafile",
733
- metafile
734
- };
735
- if (color !== void 0) request.color = color;
736
- if (verbose !== void 0) request.verbose = verbose;
737
- sendRequest(refs, request, (error, response) => {
738
- if (error) return callback(new Error(error), null);
739
- callback(null, response.result);
740
- });
741
- };
742
- return {
743
- readFromStdout,
744
- afterClose,
745
- service: {
746
- buildOrContext,
747
- transform: transform2,
748
- formatMessages: formatMessages2,
749
- analyzeMetafile: analyzeMetafile2
750
- }
751
- };
752
- }
753
- function buildOrContextImpl(callName, buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, options, isTTY2, defaultWD2, callback) {
754
- const details = createObjectStash();
755
- const isContext = callName === "context";
756
- const handleError = (e, pluginName) => {
757
- const flags = [];
758
- try {
759
- pushLogFlags(flags, options, {}, isTTY2, buildLogLevelDefault);
760
- } catch {}
761
- const message = extractErrorMessageV8(e, streamIn, details, void 0, pluginName);
762
- sendRequest(refs, {
763
- command: "error",
764
- flags,
765
- error: message
766
- }, () => {
767
- message.detail = details.load(message.detail);
768
- callback(failureErrorWithLog(isContext ? "Context failed" : "Build failed", [message], []), null);
769
- });
770
- };
771
- let plugins;
772
- if (typeof options === "object") {
773
- const value = options.plugins;
774
- if (value !== void 0) {
775
- if (!Array.isArray(value)) return handleError(/* @__PURE__ */ new Error(`"plugins" must be an array`), "");
776
- plugins = value;
777
- }
778
- }
779
- if (plugins && plugins.length > 0) {
780
- if (streamIn.isSync) return handleError(/* @__PURE__ */ new Error("Cannot use plugins in synchronous API calls"), "");
781
- handlePlugins(buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, options, plugins, details).then((result) => {
782
- if (!result.ok) return handleError(result.error, result.pluginName);
783
- try {
784
- buildOrContextContinue(result.requestPlugins, result.runOnEndCallbacks, result.scheduleOnDisposeCallbacks);
785
- } catch (e) {
786
- handleError(e, "");
787
- }
788
- }, (e) => handleError(e, ""));
789
- return;
790
- }
791
- try {
792
- buildOrContextContinue(null, (result, done) => done([], []), () => {});
793
- } catch (e) {
794
- handleError(e, "");
795
- }
796
- function buildOrContextContinue(requestPlugins, runOnEndCallbacks, scheduleOnDisposeCallbacks) {
797
- const writeDefault = streamIn.hasFS;
798
- const { entries, flags, write, stdinContents, stdinResolveDir, absWorkingDir, nodePaths, mangleCache } = flagsForBuildOptions(callName, options, isTTY2, buildLogLevelDefault, writeDefault);
799
- if (write && !streamIn.hasFS) throw new Error(`The "write" option is unavailable in this environment`);
800
- const request = {
801
- command: "build",
802
- key: buildKey,
803
- entries,
804
- flags,
805
- write,
806
- stdinContents,
807
- stdinResolveDir,
808
- absWorkingDir: absWorkingDir || defaultWD2,
809
- nodePaths,
810
- context: isContext
811
- };
812
- if (requestPlugins) request.plugins = requestPlugins;
813
- if (mangleCache) request.mangleCache = mangleCache;
814
- const buildResponseToResult = (response, callback2) => {
815
- const result = {
816
- errors: replaceDetailsInMessages(response.errors, details),
817
- warnings: replaceDetailsInMessages(response.warnings, details),
818
- outputFiles: void 0,
819
- metafile: void 0,
820
- mangleCache: void 0
821
- };
822
- const originalErrors = result.errors.slice();
823
- const originalWarnings = result.warnings.slice();
824
- if (response.outputFiles) result.outputFiles = response.outputFiles.map(convertOutputFiles);
825
- if (response.metafile) result.metafile = JSON.parse(response.metafile);
826
- if (response.mangleCache) result.mangleCache = response.mangleCache;
827
- if (response.writeToStdout !== void 0) console.log(decodeUTF8(response.writeToStdout).replace(/\n$/, ""));
828
- runOnEndCallbacks(result, (onEndErrors, onEndWarnings) => {
829
- if (originalErrors.length > 0 || onEndErrors.length > 0) return callback2(failureErrorWithLog("Build failed", originalErrors.concat(onEndErrors), originalWarnings.concat(onEndWarnings)), null, onEndErrors, onEndWarnings);
830
- callback2(null, result, onEndErrors, onEndWarnings);
831
- });
832
- };
833
- let latestResultPromise;
834
- let provideLatestResult;
835
- if (isContext) requestCallbacks["on-end"] = (id, request2) => new Promise((resolve) => {
836
- buildResponseToResult(request2, (err, result, onEndErrors, onEndWarnings) => {
837
- const response = {
838
- errors: onEndErrors,
839
- warnings: onEndWarnings
840
- };
841
- if (provideLatestResult) provideLatestResult(err, result);
842
- latestResultPromise = void 0;
843
- provideLatestResult = void 0;
844
- sendResponse(id, response);
845
- resolve();
846
- });
847
- });
848
- sendRequest(refs, request, (error, response) => {
849
- if (error) return callback(new Error(error), null);
850
- if (!isContext) return buildResponseToResult(response, (err, res) => {
851
- scheduleOnDisposeCallbacks();
852
- return callback(err, res);
853
- });
854
- if (response.errors.length > 0) return callback(failureErrorWithLog("Context failed", response.errors, response.warnings), null);
855
- let didDispose = false;
856
- const result = {
857
- rebuild: () => {
858
- if (!latestResultPromise) latestResultPromise = new Promise((resolve, reject) => {
859
- let settlePromise;
860
- provideLatestResult = (err, result2) => {
861
- if (!settlePromise) settlePromise = () => err ? reject(err) : resolve(result2);
862
- };
863
- const triggerAnotherBuild = () => {
864
- sendRequest(refs, {
865
- command: "rebuild",
866
- key: buildKey
867
- }, (error2, response2) => {
868
- if (error2) reject(new Error(error2));
869
- else if (settlePromise) settlePromise();
870
- else triggerAnotherBuild();
871
- });
872
- };
873
- triggerAnotherBuild();
874
- });
875
- return latestResultPromise;
876
- },
877
- watch: (options2 = {}) => new Promise((resolve, reject) => {
878
- if (!streamIn.hasFS) throw new Error(`Cannot use the "watch" API in this environment`);
879
- const keys = {};
880
- const delay = getFlag(options2, keys, "delay", mustBeInteger);
881
- checkForInvalidFlags(options2, keys, `in watch() call`);
882
- const request2 = {
883
- command: "watch",
884
- key: buildKey
885
- };
886
- if (delay) request2.delay = delay;
887
- sendRequest(refs, request2, (error2) => {
888
- if (error2) reject(new Error(error2));
889
- else resolve(void 0);
890
- });
891
- }),
892
- serve: (options2 = {}) => new Promise((resolve, reject) => {
893
- if (!streamIn.hasFS) throw new Error(`Cannot use the "serve" API in this environment`);
894
- const keys = {};
895
- const port = getFlag(options2, keys, "port", mustBeValidPortNumber);
896
- const host = getFlag(options2, keys, "host", mustBeString);
897
- const servedir = getFlag(options2, keys, "servedir", mustBeString);
898
- const keyfile = getFlag(options2, keys, "keyfile", mustBeString);
899
- const certfile = getFlag(options2, keys, "certfile", mustBeString);
900
- const fallback = getFlag(options2, keys, "fallback", mustBeString);
901
- const cors = getFlag(options2, keys, "cors", mustBeObject);
902
- const onRequest = getFlag(options2, keys, "onRequest", mustBeFunction);
903
- checkForInvalidFlags(options2, keys, `in serve() call`);
904
- const request2 = {
905
- command: "serve",
906
- key: buildKey,
907
- onRequest: !!onRequest
908
- };
909
- if (port !== void 0) request2.port = port;
910
- if (host !== void 0) request2.host = host;
911
- if (servedir !== void 0) request2.servedir = servedir;
912
- if (keyfile !== void 0) request2.keyfile = keyfile;
913
- if (certfile !== void 0) request2.certfile = certfile;
914
- if (fallback !== void 0) request2.fallback = fallback;
915
- if (cors) {
916
- const corsKeys = {};
917
- const origin = getFlag(cors, corsKeys, "origin", mustBeStringOrArrayOfStrings);
918
- checkForInvalidFlags(cors, corsKeys, `on "cors" object`);
919
- if (Array.isArray(origin)) request2.corsOrigin = origin;
920
- else if (origin !== void 0) request2.corsOrigin = [origin];
921
- }
922
- sendRequest(refs, request2, (error2, response2) => {
923
- if (error2) return reject(new Error(error2));
924
- if (onRequest) requestCallbacks["serve-request"] = (id, request3) => {
925
- onRequest(request3.args);
926
- sendResponse(id, {});
927
- };
928
- resolve(response2);
929
- });
930
- }),
931
- cancel: () => new Promise((resolve) => {
932
- if (didDispose) return resolve();
933
- sendRequest(refs, {
934
- command: "cancel",
935
- key: buildKey
936
- }, () => {
937
- resolve();
938
- });
939
- }),
940
- dispose: () => new Promise((resolve) => {
941
- if (didDispose) return resolve();
942
- didDispose = true;
943
- sendRequest(refs, {
944
- command: "dispose",
945
- key: buildKey
946
- }, () => {
947
- resolve();
948
- scheduleOnDisposeCallbacks();
949
- refs.unref();
950
- });
951
- })
952
- };
953
- refs.ref();
954
- callback(null, result);
955
- });
956
- }
957
- }
958
- var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, initialOptions, plugins, details) => {
959
- let onStartCallbacks = [];
960
- let onEndCallbacks = [];
961
- let onResolveCallbacks = {};
962
- let onLoadCallbacks = {};
963
- let onDisposeCallbacks = [];
964
- let nextCallbackID = 0;
965
- let i = 0;
966
- let requestPlugins = [];
967
- let isSetupDone = false;
968
- plugins = [...plugins];
969
- for (let item of plugins) {
970
- let keys = {};
971
- if (typeof item !== "object") throw new Error(`Plugin at index ${i} must be an object`);
972
- const name = getFlag(item, keys, "name", mustBeString);
973
- if (typeof name !== "string" || name === "") throw new Error(`Plugin at index ${i} is missing a name`);
974
- try {
975
- let setup = getFlag(item, keys, "setup", mustBeFunction);
976
- if (typeof setup !== "function") throw new Error(`Plugin is missing a setup function`);
977
- checkForInvalidFlags(item, keys, `on plugin ${quote(name)}`);
978
- let plugin = {
979
- name,
980
- onStart: false,
981
- onEnd: false,
982
- onResolve: [],
983
- onLoad: []
984
- };
985
- i++;
986
- let resolve = (path3, options = {}) => {
987
- if (!isSetupDone) throw new Error("Cannot call \"resolve\" before plugin setup has completed");
988
- if (typeof path3 !== "string") throw new Error(`The path to resolve must be a string`);
989
- let keys2 = /* @__PURE__ */ Object.create(null);
990
- let pluginName = getFlag(options, keys2, "pluginName", mustBeString);
991
- let importer = getFlag(options, keys2, "importer", mustBeString);
992
- let namespace = getFlag(options, keys2, "namespace", mustBeString);
993
- let resolveDir = getFlag(options, keys2, "resolveDir", mustBeString);
994
- let kind = getFlag(options, keys2, "kind", mustBeString);
995
- let pluginData = getFlag(options, keys2, "pluginData", canBeAnything);
996
- let importAttributes = getFlag(options, keys2, "with", mustBeObject);
997
- checkForInvalidFlags(options, keys2, "in resolve() call");
998
- return new Promise((resolve2, reject) => {
999
- const request = {
1000
- command: "resolve",
1001
- path: path3,
1002
- key: buildKey,
1003
- pluginName: name
1004
- };
1005
- if (pluginName != null) request.pluginName = pluginName;
1006
- if (importer != null) request.importer = importer;
1007
- if (namespace != null) request.namespace = namespace;
1008
- if (resolveDir != null) request.resolveDir = resolveDir;
1009
- if (kind != null) request.kind = kind;
1010
- else throw new Error(`Must specify "kind" when calling "resolve"`);
1011
- if (pluginData != null) request.pluginData = details.store(pluginData);
1012
- if (importAttributes != null) request.with = sanitizeStringMap(importAttributes, "with");
1013
- sendRequest(refs, request, (error, response) => {
1014
- if (error !== null) reject(new Error(error));
1015
- else resolve2({
1016
- errors: replaceDetailsInMessages(response.errors, details),
1017
- warnings: replaceDetailsInMessages(response.warnings, details),
1018
- path: response.path,
1019
- external: response.external,
1020
- sideEffects: response.sideEffects,
1021
- namespace: response.namespace,
1022
- suffix: response.suffix,
1023
- pluginData: details.load(response.pluginData)
1024
- });
1025
- });
1026
- });
1027
- };
1028
- let promise = setup({
1029
- initialOptions,
1030
- resolve,
1031
- onStart(callback) {
1032
- let registeredNote = extractCallerV8(new Error(`This error came from the "onStart" callback registered here:`), streamIn, "onStart");
1033
- onStartCallbacks.push({
1034
- name,
1035
- callback,
1036
- note: registeredNote
1037
- });
1038
- plugin.onStart = true;
1039
- },
1040
- onEnd(callback) {
1041
- let registeredNote = extractCallerV8(new Error(`This error came from the "onEnd" callback registered here:`), streamIn, "onEnd");
1042
- onEndCallbacks.push({
1043
- name,
1044
- callback,
1045
- note: registeredNote
1046
- });
1047
- plugin.onEnd = true;
1048
- },
1049
- onResolve(options, callback) {
1050
- let registeredNote = extractCallerV8(new Error(`This error came from the "onResolve" callback registered here:`), streamIn, "onResolve");
1051
- let keys2 = {};
1052
- let filter = getFlag(options, keys2, "filter", mustBeRegExp);
1053
- let namespace = getFlag(options, keys2, "namespace", mustBeString);
1054
- checkForInvalidFlags(options, keys2, `in onResolve() call for plugin ${quote(name)}`);
1055
- if (filter == null) throw new Error(`onResolve() call is missing a filter`);
1056
- let id = nextCallbackID++;
1057
- onResolveCallbacks[id] = {
1058
- name,
1059
- callback,
1060
- note: registeredNote
1061
- };
1062
- plugin.onResolve.push({
1063
- id,
1064
- filter: jsRegExpToGoRegExp(filter),
1065
- namespace: namespace || ""
1066
- });
1067
- },
1068
- onLoad(options, callback) {
1069
- let registeredNote = extractCallerV8(new Error(`This error came from the "onLoad" callback registered here:`), streamIn, "onLoad");
1070
- let keys2 = {};
1071
- let filter = getFlag(options, keys2, "filter", mustBeRegExp);
1072
- let namespace = getFlag(options, keys2, "namespace", mustBeString);
1073
- checkForInvalidFlags(options, keys2, `in onLoad() call for plugin ${quote(name)}`);
1074
- if (filter == null) throw new Error(`onLoad() call is missing a filter`);
1075
- let id = nextCallbackID++;
1076
- onLoadCallbacks[id] = {
1077
- name,
1078
- callback,
1079
- note: registeredNote
1080
- };
1081
- plugin.onLoad.push({
1082
- id,
1083
- filter: jsRegExpToGoRegExp(filter),
1084
- namespace: namespace || ""
1085
- });
1086
- },
1087
- onDispose(callback) {
1088
- onDisposeCallbacks.push(callback);
1089
- },
1090
- esbuild: streamIn.esbuild
1091
- });
1092
- if (promise) await promise;
1093
- requestPlugins.push(plugin);
1094
- } catch (e) {
1095
- return {
1096
- ok: false,
1097
- error: e,
1098
- pluginName: name
1099
- };
1100
- }
1101
- }
1102
- requestCallbacks["on-start"] = async (id, request) => {
1103
- details.clear();
1104
- let response = {
1105
- errors: [],
1106
- warnings: []
1107
- };
1108
- await Promise.all(onStartCallbacks.map(async ({ name, callback, note }) => {
1109
- try {
1110
- let result = await callback();
1111
- if (result != null) {
1112
- if (typeof result !== "object") throw new Error(`Expected onStart() callback in plugin ${quote(name)} to return an object`);
1113
- let keys = {};
1114
- let errors = getFlag(result, keys, "errors", mustBeArray);
1115
- let warnings = getFlag(result, keys, "warnings", mustBeArray);
1116
- checkForInvalidFlags(result, keys, `from onStart() callback in plugin ${quote(name)}`);
1117
- if (errors != null) response.errors.push(...sanitizeMessages(errors, "errors", details, name, void 0));
1118
- if (warnings != null) response.warnings.push(...sanitizeMessages(warnings, "warnings", details, name, void 0));
1119
- }
1120
- } catch (e) {
1121
- response.errors.push(extractErrorMessageV8(e, streamIn, details, note && note(), name));
1122
- }
1123
- }));
1124
- sendResponse(id, response);
1125
- };
1126
- requestCallbacks["on-resolve"] = async (id, request) => {
1127
- let response = {}, name = "", callback, note;
1128
- for (let id2 of request.ids) try {
1129
- ({name, callback, note} = onResolveCallbacks[id2]);
1130
- let result = await callback({
1131
- path: request.path,
1132
- importer: request.importer,
1133
- namespace: request.namespace,
1134
- resolveDir: request.resolveDir,
1135
- kind: request.kind,
1136
- pluginData: details.load(request.pluginData),
1137
- with: request.with
1138
- });
1139
- if (result != null) {
1140
- if (typeof result !== "object") throw new Error(`Expected onResolve() callback in plugin ${quote(name)} to return an object`);
1141
- let keys = {};
1142
- let pluginName = getFlag(result, keys, "pluginName", mustBeString);
1143
- let path3 = getFlag(result, keys, "path", mustBeString);
1144
- let namespace = getFlag(result, keys, "namespace", mustBeString);
1145
- let suffix = getFlag(result, keys, "suffix", mustBeString);
1146
- let external = getFlag(result, keys, "external", mustBeBoolean);
1147
- let sideEffects = getFlag(result, keys, "sideEffects", mustBeBoolean);
1148
- let pluginData = getFlag(result, keys, "pluginData", canBeAnything);
1149
- let errors = getFlag(result, keys, "errors", mustBeArray);
1150
- let warnings = getFlag(result, keys, "warnings", mustBeArray);
1151
- let watchFiles = getFlag(result, keys, "watchFiles", mustBeArrayOfStrings);
1152
- let watchDirs = getFlag(result, keys, "watchDirs", mustBeArrayOfStrings);
1153
- checkForInvalidFlags(result, keys, `from onResolve() callback in plugin ${quote(name)}`);
1154
- response.id = id2;
1155
- if (pluginName != null) response.pluginName = pluginName;
1156
- if (path3 != null) response.path = path3;
1157
- if (namespace != null) response.namespace = namespace;
1158
- if (suffix != null) response.suffix = suffix;
1159
- if (external != null) response.external = external;
1160
- if (sideEffects != null) response.sideEffects = sideEffects;
1161
- if (pluginData != null) response.pluginData = details.store(pluginData);
1162
- if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0);
1163
- if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0);
1164
- if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles");
1165
- if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs");
1166
- break;
1167
- }
1168
- } catch (e) {
1169
- response = {
1170
- id: id2,
1171
- errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)]
1172
- };
1173
- break;
1174
- }
1175
- sendResponse(id, response);
1176
- };
1177
- requestCallbacks["on-load"] = async (id, request) => {
1178
- let response = {}, name = "", callback, note;
1179
- for (let id2 of request.ids) try {
1180
- ({name, callback, note} = onLoadCallbacks[id2]);
1181
- let result = await callback({
1182
- path: request.path,
1183
- namespace: request.namespace,
1184
- suffix: request.suffix,
1185
- pluginData: details.load(request.pluginData),
1186
- with: request.with
1187
- });
1188
- if (result != null) {
1189
- if (typeof result !== "object") throw new Error(`Expected onLoad() callback in plugin ${quote(name)} to return an object`);
1190
- let keys = {};
1191
- let pluginName = getFlag(result, keys, "pluginName", mustBeString);
1192
- let contents = getFlag(result, keys, "contents", mustBeStringOrUint8Array);
1193
- let resolveDir = getFlag(result, keys, "resolveDir", mustBeString);
1194
- let pluginData = getFlag(result, keys, "pluginData", canBeAnything);
1195
- let loader = getFlag(result, keys, "loader", mustBeString);
1196
- let errors = getFlag(result, keys, "errors", mustBeArray);
1197
- let warnings = getFlag(result, keys, "warnings", mustBeArray);
1198
- let watchFiles = getFlag(result, keys, "watchFiles", mustBeArrayOfStrings);
1199
- let watchDirs = getFlag(result, keys, "watchDirs", mustBeArrayOfStrings);
1200
- checkForInvalidFlags(result, keys, `from onLoad() callback in plugin ${quote(name)}`);
1201
- response.id = id2;
1202
- if (pluginName != null) response.pluginName = pluginName;
1203
- if (contents instanceof Uint8Array) response.contents = contents;
1204
- else if (contents != null) response.contents = encodeUTF8(contents);
1205
- if (resolveDir != null) response.resolveDir = resolveDir;
1206
- if (pluginData != null) response.pluginData = details.store(pluginData);
1207
- if (loader != null) response.loader = loader;
1208
- if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0);
1209
- if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0);
1210
- if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles");
1211
- if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs");
1212
- break;
1213
- }
1214
- } catch (e) {
1215
- response = {
1216
- id: id2,
1217
- errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)]
1218
- };
1219
- break;
1220
- }
1221
- sendResponse(id, response);
1222
- };
1223
- let runOnEndCallbacks = (result, done) => done([], []);
1224
- if (onEndCallbacks.length > 0) runOnEndCallbacks = (result, done) => {
1225
- (async () => {
1226
- const onEndErrors = [];
1227
- const onEndWarnings = [];
1228
- for (const { name, callback, note } of onEndCallbacks) {
1229
- let newErrors;
1230
- let newWarnings;
1231
- try {
1232
- const value = await callback(result);
1233
- if (value != null) {
1234
- if (typeof value !== "object") throw new Error(`Expected onEnd() callback in plugin ${quote(name)} to return an object`);
1235
- let keys = {};
1236
- let errors = getFlag(value, keys, "errors", mustBeArray);
1237
- let warnings = getFlag(value, keys, "warnings", mustBeArray);
1238
- checkForInvalidFlags(value, keys, `from onEnd() callback in plugin ${quote(name)}`);
1239
- if (errors != null) newErrors = sanitizeMessages(errors, "errors", details, name, void 0);
1240
- if (warnings != null) newWarnings = sanitizeMessages(warnings, "warnings", details, name, void 0);
1241
- }
1242
- } catch (e) {
1243
- newErrors = [extractErrorMessageV8(e, streamIn, details, note && note(), name)];
1244
- }
1245
- if (newErrors) {
1246
- onEndErrors.push(...newErrors);
1247
- try {
1248
- result.errors.push(...newErrors);
1249
- } catch {}
1250
- }
1251
- if (newWarnings) {
1252
- onEndWarnings.push(...newWarnings);
1253
- try {
1254
- result.warnings.push(...newWarnings);
1255
- } catch {}
1256
- }
1257
- }
1258
- done(onEndErrors, onEndWarnings);
1259
- })();
1260
- };
1261
- let scheduleOnDisposeCallbacks = () => {
1262
- for (const cb of onDisposeCallbacks) setTimeout(() => cb(), 0);
1263
- };
1264
- isSetupDone = true;
1265
- return {
1266
- ok: true,
1267
- requestPlugins,
1268
- runOnEndCallbacks,
1269
- scheduleOnDisposeCallbacks
1270
- };
1271
- };
1272
- function createObjectStash() {
1273
- const map = /* @__PURE__ */ new Map();
1274
- let nextID = 0;
1275
- return {
1276
- clear() {
1277
- map.clear();
1278
- },
1279
- load(id) {
1280
- return map.get(id);
1281
- },
1282
- store(value) {
1283
- if (value === void 0) return -1;
1284
- const id = nextID++;
1285
- map.set(id, value);
1286
- return id;
1287
- }
1288
- };
1289
- }
1290
- function extractCallerV8(e, streamIn, ident) {
1291
- let note;
1292
- let tried = false;
1293
- return () => {
1294
- if (tried) return note;
1295
- tried = true;
1296
- try {
1297
- let lines = (e.stack + "").split("\n");
1298
- lines.splice(1, 1);
1299
- let location = parseStackLinesV8(streamIn, lines, ident);
1300
- if (location) {
1301
- note = {
1302
- text: e.message,
1303
- location
1304
- };
1305
- return note;
1306
- }
1307
- } catch {}
1308
- };
1309
- }
1310
- function extractErrorMessageV8(e, streamIn, stash, note, pluginName) {
1311
- let text = "Internal error";
1312
- let location = null;
1313
- try {
1314
- text = (e && e.message || e) + "";
1315
- } catch {}
1316
- try {
1317
- location = parseStackLinesV8(streamIn, (e.stack + "").split("\n"), "");
1318
- } catch {}
1319
- return {
1320
- id: "",
1321
- pluginName,
1322
- text,
1323
- location,
1324
- notes: note ? [note] : [],
1325
- detail: stash ? stash.store(e) : -1
1326
- };
1327
- }
1328
- function parseStackLinesV8(streamIn, lines, ident) {
1329
- let at = " at ";
1330
- if (streamIn.readFileSync && !lines[0].startsWith(at) && lines[1].startsWith(at)) for (let i = 1; i < lines.length; i++) {
1331
- let line = lines[i];
1332
- if (!line.startsWith(at)) continue;
1333
- line = line.slice(7);
1334
- while (true) {
1335
- let match = /^(?:new |async )?\S+ \((.*)\)$/.exec(line);
1336
- if (match) {
1337
- line = match[1];
1338
- continue;
1339
- }
1340
- match = /^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(line);
1341
- if (match) {
1342
- line = match[1];
1343
- continue;
1344
- }
1345
- match = /^(\S+):(\d+):(\d+)$/.exec(line);
1346
- if (match) {
1347
- let contents;
1348
- try {
1349
- contents = streamIn.readFileSync(match[1], "utf8");
1350
- } catch {
1351
- break;
1352
- }
1353
- let lineText = contents.split(/\r\n|\r|\n|\u2028|\u2029/)[+match[2] - 1] || "";
1354
- let column = +match[3] - 1;
1355
- let length = lineText.slice(column, column + ident.length) === ident ? ident.length : 0;
1356
- return {
1357
- file: match[1],
1358
- namespace: "file",
1359
- line: +match[2],
1360
- column: encodeUTF8(lineText.slice(0, column)).length,
1361
- length: encodeUTF8(lineText.slice(column, column + length)).length,
1362
- lineText: lineText + "\n" + lines.slice(1).join("\n"),
1363
- suggestion: ""
1364
- };
1365
- }
1366
- break;
1367
- }
1368
- }
1369
- return null;
1370
- }
1371
- function failureErrorWithLog(text, errors, warnings) {
1372
- let limit = 5;
1373
- text += errors.length < 1 ? "" : ` with ${errors.length} error${errors.length < 2 ? "" : "s"}:` + errors.slice(0, limit + 1).map((e, i) => {
1374
- if (i === limit) return "\n...";
1375
- if (!e.location) return `
1376
- error: ${e.text}`;
1377
- let { file, line, column } = e.location;
1378
- return `
1379
- ${file}:${line}:${column}: ERROR: ${e.pluginName ? `[plugin: ${e.pluginName}] ` : ""}${e.text}`;
1380
- }).join("");
1381
- let error = new Error(text);
1382
- for (const [key, value] of [["errors", errors], ["warnings", warnings]]) Object.defineProperty(error, key, {
1383
- configurable: true,
1384
- enumerable: true,
1385
- get: () => value,
1386
- set: (value2) => Object.defineProperty(error, key, {
1387
- configurable: true,
1388
- enumerable: true,
1389
- value: value2
1390
- })
1391
- });
1392
- return error;
1393
- }
1394
- function replaceDetailsInMessages(messages, stash) {
1395
- for (const message of messages) message.detail = stash.load(message.detail);
1396
- return messages;
1397
- }
1398
- function sanitizeLocation(location, where, terminalWidth) {
1399
- if (location == null) return null;
1400
- let keys = {};
1401
- let file = getFlag(location, keys, "file", mustBeString);
1402
- let namespace = getFlag(location, keys, "namespace", mustBeString);
1403
- let line = getFlag(location, keys, "line", mustBeInteger);
1404
- let column = getFlag(location, keys, "column", mustBeInteger);
1405
- let length = getFlag(location, keys, "length", mustBeInteger);
1406
- let lineText = getFlag(location, keys, "lineText", mustBeString);
1407
- let suggestion = getFlag(location, keys, "suggestion", mustBeString);
1408
- checkForInvalidFlags(location, keys, where);
1409
- if (lineText) {
1410
- const relevantASCII = lineText.slice(0, (column && column > 0 ? column : 0) + (length && length > 0 ? length : 0) + (terminalWidth && terminalWidth > 0 ? terminalWidth : 80));
1411
- if (!/[\x7F-\uFFFF]/.test(relevantASCII) && !/\n/.test(lineText)) lineText = relevantASCII;
1412
- }
1413
- return {
1414
- file: file || "",
1415
- namespace: namespace || "",
1416
- line: line || 0,
1417
- column: column || 0,
1418
- length: length || 0,
1419
- lineText: lineText || "",
1420
- suggestion: suggestion || ""
1421
- };
1422
- }
1423
- function sanitizeMessages(messages, property, stash, fallbackPluginName, terminalWidth) {
1424
- let messagesClone = [];
1425
- let index = 0;
1426
- for (const message of messages) {
1427
- let keys = {};
1428
- let id = getFlag(message, keys, "id", mustBeString);
1429
- let pluginName = getFlag(message, keys, "pluginName", mustBeString);
1430
- let text = getFlag(message, keys, "text", mustBeString);
1431
- let location = getFlag(message, keys, "location", mustBeObjectOrNull);
1432
- let notes = getFlag(message, keys, "notes", mustBeArray);
1433
- let detail = getFlag(message, keys, "detail", canBeAnything);
1434
- let where = `in element ${index} of "${property}"`;
1435
- checkForInvalidFlags(message, keys, where);
1436
- let notesClone = [];
1437
- if (notes) for (const note of notes) {
1438
- let noteKeys = {};
1439
- let noteText = getFlag(note, noteKeys, "text", mustBeString);
1440
- let noteLocation = getFlag(note, noteKeys, "location", mustBeObjectOrNull);
1441
- checkForInvalidFlags(note, noteKeys, where);
1442
- notesClone.push({
1443
- text: noteText || "",
1444
- location: sanitizeLocation(noteLocation, where, terminalWidth)
1445
- });
1446
- }
1447
- messagesClone.push({
1448
- id: id || "",
1449
- pluginName: pluginName || fallbackPluginName,
1450
- text: text || "",
1451
- location: sanitizeLocation(location, where, terminalWidth),
1452
- notes: notesClone,
1453
- detail: stash ? stash.store(detail) : -1
1454
- });
1455
- index++;
1456
- }
1457
- return messagesClone;
1458
- }
1459
- function sanitizeStringArray(values, property) {
1460
- const result = [];
1461
- for (const value of values) {
1462
- if (typeof value !== "string") throw new Error(`${quote(property)} must be an array of strings`);
1463
- result.push(value);
1464
- }
1465
- return result;
1466
- }
1467
- function sanitizeStringMap(map, property) {
1468
- const result = /* @__PURE__ */ Object.create(null);
1469
- for (const key in map) {
1470
- const value = map[key];
1471
- if (typeof value !== "string") throw new Error(`key ${quote(key)} in object ${quote(property)} must be a string`);
1472
- result[key] = value;
1473
- }
1474
- return result;
1475
- }
1476
- function convertOutputFiles({ path: path3, contents, hash }) {
1477
- let text = null;
1478
- return {
1479
- path: path3,
1480
- contents,
1481
- hash,
1482
- get text() {
1483
- const binary = this.contents;
1484
- if (text === null || binary !== contents) {
1485
- contents = binary;
1486
- text = decodeUTF8(binary);
1487
- }
1488
- return text;
1489
- }
1490
- };
1491
- }
1492
- function jsRegExpToGoRegExp(regexp) {
1493
- let result = regexp.source;
1494
- if (regexp.flags) result = `(?${regexp.flags})${result}`;
1495
- return result;
1496
- }
1497
- var fs = __require("node:fs");
1498
- var os = __require("node:os");
1499
- var path = __require("node:path");
1500
- var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH;
1501
- var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild";
1502
- var packageDarwin_arm64 = "@esbuild/darwin-arm64";
1503
- var packageDarwin_x64 = "@esbuild/darwin-x64";
1504
- var knownWindowsPackages = {
1505
- "win32 arm64 LE": "@esbuild/win32-arm64",
1506
- "win32 ia32 LE": "@esbuild/win32-ia32",
1507
- "win32 x64 LE": "@esbuild/win32-x64"
1508
- };
1509
- var knownUnixlikePackages = {
1510
- "aix ppc64 BE": "@esbuild/aix-ppc64",
1511
- "android arm64 LE": "@esbuild/android-arm64",
1512
- "darwin arm64 LE": "@esbuild/darwin-arm64",
1513
- "darwin x64 LE": "@esbuild/darwin-x64",
1514
- "freebsd arm64 LE": "@esbuild/freebsd-arm64",
1515
- "freebsd x64 LE": "@esbuild/freebsd-x64",
1516
- "linux arm LE": "@esbuild/linux-arm",
1517
- "linux arm64 LE": "@esbuild/linux-arm64",
1518
- "linux ia32 LE": "@esbuild/linux-ia32",
1519
- "linux mips64el LE": "@esbuild/linux-mips64el",
1520
- "linux ppc64 LE": "@esbuild/linux-ppc64",
1521
- "linux riscv64 LE": "@esbuild/linux-riscv64",
1522
- "linux s390x BE": "@esbuild/linux-s390x",
1523
- "linux x64 LE": "@esbuild/linux-x64",
1524
- "linux loong64 LE": "@esbuild/linux-loong64",
1525
- "netbsd arm64 LE": "@esbuild/netbsd-arm64",
1526
- "netbsd x64 LE": "@esbuild/netbsd-x64",
1527
- "openbsd arm64 LE": "@esbuild/openbsd-arm64",
1528
- "openbsd x64 LE": "@esbuild/openbsd-x64",
1529
- "sunos x64 LE": "@esbuild/sunos-x64"
1530
- };
1531
- var knownWebAssemblyFallbackPackages = {
1532
- "android arm LE": "@esbuild/android-arm",
1533
- "android x64 LE": "@esbuild/android-x64",
1534
- "openharmony arm64 LE": "@esbuild/openharmony-arm64"
1535
- };
1536
- function pkgAndSubpathForCurrentPlatform() {
1537
- let pkg;
1538
- let subpath;
1539
- let isWASM = false;
1540
- let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`;
1541
- if (platformKey in knownWindowsPackages) {
1542
- pkg = knownWindowsPackages[platformKey];
1543
- subpath = "esbuild.exe";
1544
- } else if (platformKey in knownUnixlikePackages) {
1545
- pkg = knownUnixlikePackages[platformKey];
1546
- subpath = "bin/esbuild";
1547
- } else if (platformKey in knownWebAssemblyFallbackPackages) {
1548
- pkg = knownWebAssemblyFallbackPackages[platformKey];
1549
- subpath = "bin/esbuild";
1550
- isWASM = true;
1551
- } else throw new Error(`Unsupported platform: ${platformKey}`);
1552
- return {
1553
- pkg,
1554
- subpath,
1555
- isWASM
1556
- };
1557
- }
1558
- function pkgForSomeOtherPlatform() {
1559
- const libMainJS = __require.resolve("esbuild");
1560
- const nodeModulesDirectory = path.dirname(path.dirname(path.dirname(libMainJS)));
1561
- if (path.basename(nodeModulesDirectory) === "node_modules") {
1562
- for (const unixKey in knownUnixlikePackages) try {
1563
- const pkg = knownUnixlikePackages[unixKey];
1564
- if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg;
1565
- } catch {}
1566
- for (const windowsKey in knownWindowsPackages) try {
1567
- const pkg = knownWindowsPackages[windowsKey];
1568
- if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg;
1569
- } catch {}
1570
- }
1571
- return null;
1572
- }
1573
- function downloadedBinPath(pkg, subpath) {
1574
- const esbuildLibDir = path.dirname(__require.resolve("esbuild"));
1575
- return path.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path.basename(subpath)}`);
1576
- }
1577
- function generateBinPath() {
1578
- if (isValidBinaryPath(ESBUILD_BINARY_PATH)) if (!fs.existsSync(ESBUILD_BINARY_PATH)) console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`);
1579
- else return {
1580
- binPath: ESBUILD_BINARY_PATH,
1581
- isWASM: false
1582
- };
1583
- const { pkg, subpath, isWASM } = pkgAndSubpathForCurrentPlatform();
1584
- let binPath;
1585
- try {
1586
- binPath = __require.resolve(`${pkg}/${subpath}`);
1587
- } catch (e) {
1588
- binPath = downloadedBinPath(pkg, subpath);
1589
- if (!fs.existsSync(binPath)) {
1590
- try {
1591
- __require.resolve(pkg);
1592
- } catch {
1593
- const otherPkg = pkgForSomeOtherPlatform();
1594
- if (otherPkg) {
1595
- let suggestions = `
1596
- Specifically the "${otherPkg}" package is present but this platform
1597
- needs the "${pkg}" package instead. People often get into this
1598
- situation by installing esbuild on Windows or macOS and copying "node_modules"
1599
- into a Docker image that runs Linux, or by copying "node_modules" between
1600
- Windows and WSL environments.
1601
-
1602
- If you are installing with npm, you can try not copying the "node_modules"
1603
- directory when you copy the files over, and running "npm ci" or "npm install"
1604
- on the destination platform after the copy. Or you could consider using yarn
1605
- instead of npm which has built-in support for installing a package on multiple
1606
- platforms simultaneously.
1607
-
1608
- If you are installing with yarn, you can try listing both this platform and the
1609
- other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
1610
- feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
1611
- Keep in mind that this means multiple copies of esbuild will be present.
1612
- `;
1613
- if (pkg === packageDarwin_x64 && otherPkg === packageDarwin_arm64 || pkg === packageDarwin_arm64 && otherPkg === packageDarwin_x64) suggestions = `
1614
- Specifically the "${otherPkg}" package is present but this platform
1615
- needs the "${pkg}" package instead. People often get into this
1616
- situation by installing esbuild with npm running inside of Rosetta 2 and then
1617
- trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta
1618
- 2 is Apple's on-the-fly x86_64-to-arm64 translation service).
1619
-
1620
- If you are installing with npm, you can try ensuring that both npm and node are
1621
- not running under Rosetta 2 and then reinstalling esbuild. This likely involves
1622
- changing how you installed npm and/or node. For example, installing node with
1623
- the universal installer here should work: https://nodejs.org/en/download/. Or
1624
- you could consider using yarn instead of npm which has built-in support for
1625
- installing a package on multiple platforms simultaneously.
1626
-
1627
- If you are installing with yarn, you can try listing both "arm64" and "x64"
1628
- in your ".yarnrc.yml" file using the "supportedArchitectures" feature:
1629
- https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
1630
- Keep in mind that this means multiple copies of esbuild will be present.
1631
- `;
1632
- throw new Error(`
1633
- You installed esbuild for another platform than the one you're currently using.
1634
- This won't work because esbuild is written with native code and needs to
1635
- install a platform-specific binary executable.
1636
- ${suggestions}
1637
- Another alternative is to use the "esbuild-wasm" package instead, which works
1638
- the same way on all platforms. But it comes with a heavy performance cost and
1639
- can sometimes be 10x slower than the "esbuild" package, so you may also not
1640
- want to do that.
1641
- `);
1642
- }
1643
- throw new Error(`The package "${pkg}" could not be found, and is needed by esbuild.
1644
-
1645
- If you are installing esbuild with npm, make sure that you don't specify the
1646
- "--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
1647
- of "package.json" is used by esbuild to install the correct binary executable
1648
- for your current platform.`);
1649
- }
1650
- throw e;
1651
- }
1652
- }
1653
- if (/\.zip\//.test(binPath)) {
1654
- let pnpapi;
1655
- try {
1656
- pnpapi = __require("pnpapi");
1657
- } catch (e) {}
1658
- if (pnpapi) {
1659
- const root = pnpapi.getPackageInformation(pnpapi.topLevel).packageLocation;
1660
- const binTargetPath = path.join(root, "node_modules", ".cache", "esbuild", `pnpapi-${pkg.replace("/", "-")}-0.25.12-${path.basename(subpath)}`);
1661
- if (!fs.existsSync(binTargetPath)) {
1662
- fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
1663
- fs.copyFileSync(binPath, binTargetPath);
1664
- fs.chmodSync(binTargetPath, 493);
1665
- }
1666
- return {
1667
- binPath: binTargetPath,
1668
- isWASM
1669
- };
1670
- }
1671
- }
1672
- return {
1673
- binPath,
1674
- isWASM
1675
- };
1676
- }
1677
- var child_process = __require("node:child_process");
1678
- var crypto = __require("node:crypto");
1679
- var path2 = __require("node:path");
1680
- var fs2 = __require("node:fs");
1681
- var os2 = __require("node:os");
1682
- var tty = __require("node:tty");
1683
- var worker_threads;
1684
- if (process.env.ESBUILD_WORKER_THREADS !== "0") {
1685
- try {
1686
- worker_threads = __require("node:worker_threads");
1687
- } catch {}
1688
- let [major, minor] = process.versions.node.split(".");
1689
- if (+major < 12 || +major === 12 && +minor < 17 || +major === 13 && +minor < 13) worker_threads = void 0;
1690
- }
1691
- var _a;
1692
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.25.12";
1693
- var esbuildCommandAndArgs = () => {
1694
- if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) throw new Error(`The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
1695
-
1696
- More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.`);
1697
- {
1698
- const { binPath, isWASM } = generateBinPath();
1699
- if (isWASM) return ["node", [binPath]];
1700
- else return [binPath, []];
1701
- }
1702
- };
1703
- var isTTY = () => tty.isatty(2);
1704
- var fsSync = {
1705
- readFile(tempFile, callback) {
1706
- try {
1707
- let contents = fs2.readFileSync(tempFile, "utf8");
1708
- try {
1709
- fs2.unlinkSync(tempFile);
1710
- } catch {}
1711
- callback(null, contents);
1712
- } catch (err) {
1713
- callback(err, null);
1714
- }
1715
- },
1716
- writeFile(contents, callback) {
1717
- try {
1718
- let tempFile = randomFileName();
1719
- fs2.writeFileSync(tempFile, contents);
1720
- callback(tempFile);
1721
- } catch {
1722
- callback(null);
1723
- }
1724
- }
1725
- };
1726
- var fsAsync = {
1727
- readFile(tempFile, callback) {
1728
- try {
1729
- fs2.readFile(tempFile, "utf8", (err, contents) => {
1730
- try {
1731
- fs2.unlink(tempFile, () => callback(err, contents));
1732
- } catch {
1733
- callback(err, contents);
1734
- }
1735
- });
1736
- } catch (err) {
1737
- callback(err, null);
1738
- }
1739
- },
1740
- writeFile(contents, callback) {
1741
- try {
1742
- let tempFile = randomFileName();
1743
- fs2.writeFile(tempFile, contents, (err) => err !== null ? callback(null) : callback(tempFile));
1744
- } catch {
1745
- callback(null);
1746
- }
1747
- }
1748
- };
1749
- var version = "0.25.12";
1750
- var build = (options) => ensureServiceIsRunning().build(options);
1751
- var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions);
1752
- var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
1753
- var formatMessages = (messages, options) => ensureServiceIsRunning().formatMessages(messages, options);
1754
- var analyzeMetafile = (messages, options) => ensureServiceIsRunning().analyzeMetafile(messages, options);
1755
- var buildSync = (options) => {
1756
- if (worker_threads && !isInternalWorkerThread) {
1757
- if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads);
1758
- return workerThreadService.buildSync(options);
1759
- }
1760
- let result;
1761
- runServiceSync((service) => service.buildOrContext({
1762
- callName: "buildSync",
1763
- refs: null,
1764
- options,
1765
- isTTY: isTTY(),
1766
- defaultWD,
1767
- callback: (err, res) => {
1768
- if (err) throw err;
1769
- result = res;
1770
- }
1771
- }));
1772
- return result;
1773
- };
1774
- var transformSync = (input, options) => {
1775
- if (worker_threads && !isInternalWorkerThread) {
1776
- if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads);
1777
- return workerThreadService.transformSync(input, options);
1778
- }
1779
- let result;
1780
- runServiceSync((service) => service.transform({
1781
- callName: "transformSync",
1782
- refs: null,
1783
- input,
1784
- options: options || {},
1785
- isTTY: isTTY(),
1786
- fs: fsSync,
1787
- callback: (err, res) => {
1788
- if (err) throw err;
1789
- result = res;
1790
- }
1791
- }));
1792
- return result;
1793
- };
1794
- var formatMessagesSync = (messages, options) => {
1795
- if (worker_threads && !isInternalWorkerThread) {
1796
- if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads);
1797
- return workerThreadService.formatMessagesSync(messages, options);
1798
- }
1799
- let result;
1800
- runServiceSync((service) => service.formatMessages({
1801
- callName: "formatMessagesSync",
1802
- refs: null,
1803
- messages,
1804
- options,
1805
- callback: (err, res) => {
1806
- if (err) throw err;
1807
- result = res;
1808
- }
1809
- }));
1810
- return result;
1811
- };
1812
- var analyzeMetafileSync = (metafile, options) => {
1813
- if (worker_threads && !isInternalWorkerThread) {
1814
- if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads);
1815
- return workerThreadService.analyzeMetafileSync(metafile, options);
1816
- }
1817
- let result;
1818
- runServiceSync((service) => service.analyzeMetafile({
1819
- callName: "analyzeMetafileSync",
1820
- refs: null,
1821
- metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile),
1822
- options,
1823
- callback: (err, res) => {
1824
- if (err) throw err;
1825
- result = res;
1826
- }
1827
- }));
1828
- return result;
1829
- };
1830
- var stop = () => {
1831
- if (stopService) stopService();
1832
- if (workerThreadService) workerThreadService.stop();
1833
- return Promise.resolve();
1834
- };
1835
- var initializeWasCalled = false;
1836
- var initialize = (options) => {
1837
- options = validateInitializeOptions(options || {});
1838
- if (options.wasmURL) throw new Error(`The "wasmURL" option only works in the browser`);
1839
- if (options.wasmModule) throw new Error(`The "wasmModule" option only works in the browser`);
1840
- if (options.worker) throw new Error(`The "worker" option only works in the browser`);
1841
- if (initializeWasCalled) throw new Error("Cannot call \"initialize\" more than once");
1842
- ensureServiceIsRunning();
1843
- initializeWasCalled = true;
1844
- return Promise.resolve();
1845
- };
1846
- var defaultWD = process.cwd();
1847
- var longLivedService;
1848
- var stopService;
1849
- var ensureServiceIsRunning = () => {
1850
- if (longLivedService) return longLivedService;
1851
- let [command, args] = esbuildCommandAndArgs();
1852
- let child = child_process.spawn(command, args.concat(`--service=0.25.12`, "--ping"), {
1853
- windowsHide: true,
1854
- stdio: [
1855
- "pipe",
1856
- "pipe",
1857
- "inherit"
1858
- ],
1859
- cwd: defaultWD
1860
- });
1861
- let { readFromStdout, afterClose, service } = createChannel({
1862
- writeToStdin(bytes) {
1863
- child.stdin.write(bytes, (err) => {
1864
- if (err) afterClose(err);
1865
- });
1866
- },
1867
- readFileSync: fs2.readFileSync,
1868
- isSync: false,
1869
- hasFS: true,
1870
- esbuild: node_exports
1871
- });
1872
- child.stdin.on("error", afterClose);
1873
- child.on("error", afterClose);
1874
- const stdin = child.stdin;
1875
- const stdout = child.stdout;
1876
- stdout.on("data", readFromStdout);
1877
- stdout.on("end", afterClose);
1878
- stopService = () => {
1879
- stdin.destroy();
1880
- stdout.destroy();
1881
- child.kill();
1882
- initializeWasCalled = false;
1883
- longLivedService = void 0;
1884
- stopService = void 0;
1885
- };
1886
- let refCount = 0;
1887
- child.unref();
1888
- if (stdin.unref) stdin.unref();
1889
- if (stdout.unref) stdout.unref();
1890
- const refs = {
1891
- ref() {
1892
- if (++refCount === 1) child.ref();
1893
- },
1894
- unref() {
1895
- if (--refCount === 0) child.unref();
1896
- }
1897
- };
1898
- longLivedService = {
1899
- build: (options) => new Promise((resolve, reject) => {
1900
- service.buildOrContext({
1901
- callName: "build",
1902
- refs,
1903
- options,
1904
- isTTY: isTTY(),
1905
- defaultWD,
1906
- callback: (err, res) => err ? reject(err) : resolve(res)
1907
- });
1908
- }),
1909
- context: (options) => new Promise((resolve, reject) => service.buildOrContext({
1910
- callName: "context",
1911
- refs,
1912
- options,
1913
- isTTY: isTTY(),
1914
- defaultWD,
1915
- callback: (err, res) => err ? reject(err) : resolve(res)
1916
- })),
1917
- transform: (input, options) => new Promise((resolve, reject) => service.transform({
1918
- callName: "transform",
1919
- refs,
1920
- input,
1921
- options: options || {},
1922
- isTTY: isTTY(),
1923
- fs: fsAsync,
1924
- callback: (err, res) => err ? reject(err) : resolve(res)
1925
- })),
1926
- formatMessages: (messages, options) => new Promise((resolve, reject) => service.formatMessages({
1927
- callName: "formatMessages",
1928
- refs,
1929
- messages,
1930
- options,
1931
- callback: (err, res) => err ? reject(err) : resolve(res)
1932
- })),
1933
- analyzeMetafile: (metafile, options) => new Promise((resolve, reject) => service.analyzeMetafile({
1934
- callName: "analyzeMetafile",
1935
- refs,
1936
- metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile),
1937
- options,
1938
- callback: (err, res) => err ? reject(err) : resolve(res)
1939
- }))
1940
- };
1941
- return longLivedService;
1942
- };
1943
- var runServiceSync = (callback) => {
1944
- let [command, args] = esbuildCommandAndArgs();
1945
- let stdin = new Uint8Array();
1946
- let { readFromStdout, afterClose, service } = createChannel({
1947
- writeToStdin(bytes) {
1948
- if (stdin.length !== 0) throw new Error("Must run at most one command");
1949
- stdin = bytes;
1950
- },
1951
- isSync: true,
1952
- hasFS: true,
1953
- esbuild: node_exports
1954
- });
1955
- callback(service);
1956
- readFromStdout(child_process.execFileSync(command, args.concat(`--service=0.25.12`), {
1957
- cwd: defaultWD,
1958
- windowsHide: true,
1959
- input: stdin,
1960
- maxBuffer: +process.env.ESBUILD_MAX_BUFFER || 16 * 1024 * 1024
1961
- }));
1962
- afterClose(null);
1963
- };
1964
- var randomFileName = () => {
1965
- return path2.join(os2.tmpdir(), `esbuild-${crypto.randomBytes(32).toString("hex")}`);
1966
- };
1967
- var workerThreadService = null;
1968
- var startWorkerThreadService = (worker_threads2) => {
1969
- let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
1970
- let worker = new worker_threads2.Worker(__filename, {
1971
- workerData: {
1972
- workerPort,
1973
- defaultWD,
1974
- esbuildVersion: "0.25.12"
1975
- },
1976
- transferList: [workerPort],
1977
- execArgv: []
1978
- });
1979
- let nextID = 0;
1980
- let fakeBuildError = (text) => {
1981
- let error = /* @__PURE__ */ new Error(`Build failed with 1 error:
1982
- error: ${text}`);
1983
- error.errors = [{
1984
- id: "",
1985
- pluginName: "",
1986
- text,
1987
- location: null,
1988
- notes: [],
1989
- detail: void 0
1990
- }];
1991
- error.warnings = [];
1992
- return error;
1993
- };
1994
- let validateBuildSyncOptions = (options) => {
1995
- if (!options) return;
1996
- let plugins = options.plugins;
1997
- if (plugins && plugins.length > 0) throw fakeBuildError(`Cannot use plugins in synchronous API calls`);
1998
- };
1999
- let applyProperties = (object, properties) => {
2000
- for (let key in properties) object[key] = properties[key];
2001
- };
2002
- let runCallSync = (command, args) => {
2003
- let id = nextID++;
2004
- let sharedBuffer = new SharedArrayBuffer(8);
2005
- let sharedBufferView = new Int32Array(sharedBuffer);
2006
- let msg = {
2007
- sharedBuffer,
2008
- id,
2009
- command,
2010
- args
2011
- };
2012
- worker.postMessage(msg);
2013
- let status = Atomics.wait(sharedBufferView, 0, 0);
2014
- if (status !== "ok" && status !== "not-equal") throw new Error("Internal error: Atomics.wait() failed: " + status);
2015
- let { message: { id: id2, resolve, reject, properties } } = worker_threads2.receiveMessageOnPort(mainPort);
2016
- if (id !== id2) throw new Error(`Internal error: Expected id ${id} but got id ${id2}`);
2017
- if (reject) {
2018
- applyProperties(reject, properties);
2019
- throw reject;
2020
- }
2021
- return resolve;
2022
- };
2023
- worker.unref();
2024
- return {
2025
- buildSync(options) {
2026
- validateBuildSyncOptions(options);
2027
- return runCallSync("build", [options]);
2028
- },
2029
- transformSync(input, options) {
2030
- return runCallSync("transform", [input, options]);
2031
- },
2032
- formatMessagesSync(messages, options) {
2033
- return runCallSync("formatMessages", [messages, options]);
2034
- },
2035
- analyzeMetafileSync(metafile, options) {
2036
- return runCallSync("analyzeMetafile", [metafile, options]);
2037
- },
2038
- stop() {
2039
- worker.terminate();
2040
- workerThreadService = null;
2041
- }
2042
- };
2043
- };
2044
- var startSyncServiceWorker = () => {
2045
- let workerPort = worker_threads.workerData.workerPort;
2046
- let parentPort = worker_threads.parentPort;
2047
- let extractProperties = (object) => {
2048
- let properties = {};
2049
- if (object && typeof object === "object") for (let key in object) properties[key] = object[key];
2050
- return properties;
2051
- };
2052
- try {
2053
- let service = ensureServiceIsRunning();
2054
- defaultWD = worker_threads.workerData.defaultWD;
2055
- parentPort.on("message", (msg) => {
2056
- (async () => {
2057
- let { sharedBuffer, id, command, args } = msg;
2058
- let sharedBufferView = new Int32Array(sharedBuffer);
2059
- try {
2060
- switch (command) {
2061
- case "build":
2062
- workerPort.postMessage({
2063
- id,
2064
- resolve: await service.build(args[0])
2065
- });
2066
- break;
2067
- case "transform":
2068
- workerPort.postMessage({
2069
- id,
2070
- resolve: await service.transform(args[0], args[1])
2071
- });
2072
- break;
2073
- case "formatMessages":
2074
- workerPort.postMessage({
2075
- id,
2076
- resolve: await service.formatMessages(args[0], args[1])
2077
- });
2078
- break;
2079
- case "analyzeMetafile":
2080
- workerPort.postMessage({
2081
- id,
2082
- resolve: await service.analyzeMetafile(args[0], args[1])
2083
- });
2084
- break;
2085
- default: throw new Error(`Invalid command: ${command}`);
2086
- }
2087
- } catch (reject) {
2088
- workerPort.postMessage({
2089
- id,
2090
- reject,
2091
- properties: extractProperties(reject)
2092
- });
2093
- }
2094
- Atomics.add(sharedBufferView, 0, 1);
2095
- Atomics.notify(sharedBufferView, 0, Infinity);
2096
- })();
2097
- });
2098
- } catch (reject) {
2099
- parentPort.on("message", (msg) => {
2100
- let { sharedBuffer, id } = msg;
2101
- let sharedBufferView = new Int32Array(sharedBuffer);
2102
- workerPort.postMessage({
2103
- id,
2104
- reject,
2105
- properties: extractProperties(reject)
2106
- });
2107
- Atomics.add(sharedBufferView, 0, 1);
2108
- Atomics.notify(sharedBufferView, 0, Infinity);
2109
- });
2110
- }
2111
- };
2112
- if (isInternalWorkerThread) startSyncServiceWorker();
2113
- var node_default = node_exports;
2114
- }));
2115
-
2116
- //#endregion
2117
- export default require_main();
2118
-
2119
- export { require_main };
2120
- //# sourceMappingURL=main.mjs.map