@stencil/core 4.43.5 → 5.0.0-alpha.10

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 (376) hide show
  1. package/bin/stencil.mjs +2 -0
  2. package/dist/app-data/index.d.ts +2 -0
  3. package/dist/app-data/index.js +104 -0
  4. package/dist/app-globals/index.d.ts +5 -0
  5. package/dist/app-globals/index.js +5 -0
  6. package/dist/chunk-z9aeyW2b.mjs +15 -0
  7. package/dist/client-aTQ7xHxx.mjs +4678 -0
  8. package/dist/compiler/index.d.mts +192 -0
  9. package/dist/compiler/index.mjs +3 -0
  10. package/dist/compiler/utils/index.d.mts +2 -0
  11. package/dist/compiler/utils/index.mjs +3 -0
  12. package/dist/compiler-lTINDSgw.mjs +23136 -0
  13. package/{internal → dist/declarations}/stencil-ext-modules.d.ts +8 -8
  14. package/dist/declarations/stencil-public-compiler.d.ts +4374 -0
  15. package/dist/declarations/stencil-public-compiler.js +51 -0
  16. package/dist/declarations/stencil-public-docs.d.ts +505 -0
  17. package/dist/declarations/stencil-public-runtime.d.ts +1982 -0
  18. package/dist/declarations/stencil-public-runtime.js +0 -0
  19. package/dist/index-BvkyxSY6.d.mts +205 -0
  20. package/dist/index-vY35H18z.d.mts +6525 -0
  21. package/dist/index-xAkMgLX_.d.ts +1942 -0
  22. package/{internal/stencil-core/index.d.ts → dist/index.d.mts} +11 -4
  23. package/dist/index.mjs +2 -0
  24. package/dist/jsx-runtime.d.mts +18 -0
  25. package/dist/jsx-runtime.mjs +2 -0
  26. package/dist/mock-doc.d.mts +1 -0
  27. package/dist/mock-doc.mjs +2 -0
  28. package/dist/node--akYC-sG.mjs +1937 -0
  29. package/dist/regular-expression-CFVJOTUh.mjs +508 -0
  30. package/dist/runtime/client/lazy.js +4930 -0
  31. package/dist/runtime/client/runtime.d.ts +2386 -0
  32. package/dist/runtime/client/runtime.js +4924 -0
  33. package/dist/runtime/index.d.ts +211 -0
  34. package/dist/runtime/index.js +4795 -0
  35. package/dist/runtime/server/index.d.mts +1179 -0
  36. package/dist/runtime/server/index.mjs +5140 -0
  37. package/dist/runtime/server/runner.d.mts +319 -0
  38. package/dist/runtime/server/runner.mjs +13642 -0
  39. package/dist/signals/index.d.ts +47 -0
  40. package/dist/signals/index.js +199 -0
  41. package/dist/sys/node/index.d.mts +32 -0
  42. package/dist/sys/node/index.mjs +2 -0
  43. package/dist/sys/node/worker.d.mts +1 -0
  44. package/dist/sys/node/worker.mjs +48 -0
  45. package/dist/testing/index.d.mts +303 -0
  46. package/dist/testing/index.mjs +1477 -0
  47. package/dist/validation-ByxKj8bC.mjs +1458 -0
  48. package/package.json +108 -228
  49. package/bin/stencil +0 -57
  50. package/cli/config-flags.d.ts +0 -132
  51. package/cli/index.cjs +0 -6041
  52. package/cli/index.d.ts +0 -19
  53. package/cli/index.js +0 -6034
  54. package/cli/package.json +0 -14
  55. package/compiler/lib.d.ts +0 -22
  56. package/compiler/lib.decorators.d.ts +0 -384
  57. package/compiler/lib.decorators.legacy.d.ts +0 -22
  58. package/compiler/lib.dom.asynciterable.d.ts +0 -41
  59. package/compiler/lib.dom.d.ts +0 -29610
  60. package/compiler/lib.dom.iterable.d.ts +0 -493
  61. package/compiler/lib.es2015.collection.d.ts +0 -147
  62. package/compiler/lib.es2015.core.d.ts +0 -597
  63. package/compiler/lib.es2015.d.ts +0 -28
  64. package/compiler/lib.es2015.generator.d.ts +0 -77
  65. package/compiler/lib.es2015.iterable.d.ts +0 -605
  66. package/compiler/lib.es2015.promise.d.ts +0 -81
  67. package/compiler/lib.es2015.proxy.d.ts +0 -128
  68. package/compiler/lib.es2015.reflect.d.ts +0 -144
  69. package/compiler/lib.es2015.symbol.d.ts +0 -46
  70. package/compiler/lib.es2015.symbol.wellknown.d.ts +0 -326
  71. package/compiler/lib.es2016.array.include.d.ts +0 -116
  72. package/compiler/lib.es2016.d.ts +0 -21
  73. package/compiler/lib.es2016.full.d.ts +0 -23
  74. package/compiler/lib.es2016.intl.d.ts +0 -31
  75. package/compiler/lib.es2017.arraybuffer.d.ts +0 -21
  76. package/compiler/lib.es2017.d.ts +0 -26
  77. package/compiler/lib.es2017.date.d.ts +0 -31
  78. package/compiler/lib.es2017.full.d.ts +0 -23
  79. package/compiler/lib.es2017.intl.d.ts +0 -44
  80. package/compiler/lib.es2017.object.d.ts +0 -49
  81. package/compiler/lib.es2017.sharedmemory.d.ts +0 -135
  82. package/compiler/lib.es2017.string.d.ts +0 -45
  83. package/compiler/lib.es2017.typedarrays.d.ts +0 -53
  84. package/compiler/lib.es2018.asyncgenerator.d.ts +0 -77
  85. package/compiler/lib.es2018.asynciterable.d.ts +0 -53
  86. package/compiler/lib.es2018.d.ts +0 -24
  87. package/compiler/lib.es2018.full.d.ts +0 -24
  88. package/compiler/lib.es2018.intl.d.ts +0 -83
  89. package/compiler/lib.es2018.promise.d.ts +0 -30
  90. package/compiler/lib.es2018.regexp.d.ts +0 -37
  91. package/compiler/lib.es2019.array.d.ts +0 -79
  92. package/compiler/lib.es2019.d.ts +0 -24
  93. package/compiler/lib.es2019.full.d.ts +0 -24
  94. package/compiler/lib.es2019.intl.d.ts +0 -23
  95. package/compiler/lib.es2019.object.d.ts +0 -33
  96. package/compiler/lib.es2019.string.d.ts +0 -37
  97. package/compiler/lib.es2019.symbol.d.ts +0 -24
  98. package/compiler/lib.es2020.bigint.d.ts +0 -765
  99. package/compiler/lib.es2020.d.ts +0 -27
  100. package/compiler/lib.es2020.date.d.ts +0 -42
  101. package/compiler/lib.es2020.full.d.ts +0 -24
  102. package/compiler/lib.es2020.intl.d.ts +0 -474
  103. package/compiler/lib.es2020.number.d.ts +0 -28
  104. package/compiler/lib.es2020.promise.d.ts +0 -47
  105. package/compiler/lib.es2020.sharedmemory.d.ts +0 -99
  106. package/compiler/lib.es2020.string.d.ts +0 -44
  107. package/compiler/lib.es2020.symbol.wellknown.d.ts +0 -41
  108. package/compiler/lib.es2021.d.ts +0 -23
  109. package/compiler/lib.es2021.full.d.ts +0 -24
  110. package/compiler/lib.es2021.intl.d.ts +0 -166
  111. package/compiler/lib.es2021.promise.d.ts +0 -48
  112. package/compiler/lib.es2021.string.d.ts +0 -33
  113. package/compiler/lib.es2021.weakref.d.ts +0 -78
  114. package/compiler/lib.es2022.array.d.ts +0 -121
  115. package/compiler/lib.es2022.d.ts +0 -25
  116. package/compiler/lib.es2022.error.d.ts +0 -75
  117. package/compiler/lib.es2022.full.d.ts +0 -24
  118. package/compiler/lib.es2022.intl.d.ts +0 -121
  119. package/compiler/lib.es2022.object.d.ts +0 -26
  120. package/compiler/lib.es2022.regexp.d.ts +0 -39
  121. package/compiler/lib.es2022.string.d.ts +0 -25
  122. package/compiler/lib.es2023.array.d.ts +0 -924
  123. package/compiler/lib.es2023.collection.d.ts +0 -21
  124. package/compiler/lib.es2023.d.ts +0 -22
  125. package/compiler/lib.es2023.full.d.ts +0 -24
  126. package/compiler/lib.es2023.intl.d.ts +0 -56
  127. package/compiler/lib.es2024.arraybuffer.d.ts +0 -65
  128. package/compiler/lib.es2024.collection.d.ts +0 -29
  129. package/compiler/lib.es2024.d.ts +0 -26
  130. package/compiler/lib.es2024.full.d.ts +0 -24
  131. package/compiler/lib.es2024.object.d.ts +0 -29
  132. package/compiler/lib.es2024.promise.d.ts +0 -35
  133. package/compiler/lib.es2024.regexp.d.ts +0 -25
  134. package/compiler/lib.es2024.sharedmemory.d.ts +0 -68
  135. package/compiler/lib.es2024.string.d.ts +0 -29
  136. package/compiler/lib.es5.d.ts +0 -4594
  137. package/compiler/lib.es6.d.ts +0 -23
  138. package/compiler/lib.esnext.array.d.ts +0 -35
  139. package/compiler/lib.esnext.collection.d.ts +0 -96
  140. package/compiler/lib.esnext.d.ts +0 -27
  141. package/compiler/lib.esnext.decorators.d.ts +0 -28
  142. package/compiler/lib.esnext.disposable.d.ts +0 -193
  143. package/compiler/lib.esnext.float16.d.ts +0 -443
  144. package/compiler/lib.esnext.full.d.ts +0 -24
  145. package/compiler/lib.esnext.intl.d.ts +0 -21
  146. package/compiler/lib.esnext.iterator.d.ts +0 -148
  147. package/compiler/lib.esnext.promise.d.ts +0 -34
  148. package/compiler/lib.scripthost.d.ts +0 -322
  149. package/compiler/lib.webworker.asynciterable.d.ts +0 -41
  150. package/compiler/lib.webworker.d.ts +0 -9894
  151. package/compiler/lib.webworker.importscripts.d.ts +0 -23
  152. package/compiler/lib.webworker.iterable.d.ts +0 -287
  153. package/compiler/package.json +0 -8
  154. package/compiler/stencil.d.ts +0 -73
  155. package/compiler/stencil.js +0 -288221
  156. package/compiler/sys/in-memory-fs.d.ts +0 -227
  157. package/compiler/transpile.d.ts +0 -32
  158. package/dev-server/client/app-error.d.ts +0 -20
  159. package/dev-server/client/events.d.ts +0 -6
  160. package/dev-server/client/hmr-components.d.ts +0 -12
  161. package/dev-server/client/hmr-external-styles.d.ts +0 -1
  162. package/dev-server/client/hmr-images.d.ts +0 -1
  163. package/dev-server/client/hmr-inline-styles.d.ts +0 -1
  164. package/dev-server/client/hmr-util.d.ts +0 -39
  165. package/dev-server/client/hmr-window.d.ts +0 -10
  166. package/dev-server/client/index.d.ts +0 -6
  167. package/dev-server/client/index.js +0 -793
  168. package/dev-server/client/logger.d.ts +0 -6
  169. package/dev-server/client/package.json +0 -8
  170. package/dev-server/client/progress.d.ts +0 -3
  171. package/dev-server/client/status.d.ts +0 -4
  172. package/dev-server/client/test/hmr-util.spec.d.ts +0 -1
  173. package/dev-server/client/test/status.spec.d.ts +0 -1
  174. package/dev-server/connector.html +0 -6
  175. package/dev-server/index.d.ts +0 -3
  176. package/dev-server/index.js +0 -247
  177. package/dev-server/package.json +0 -8
  178. package/dev-server/server-process.js +0 -12304
  179. package/dev-server/server-worker-thread.js +0 -39
  180. package/dev-server/static/favicon.ico +0 -0
  181. package/dev-server/templates/directory-index.html +0 -176
  182. package/dev-server/templates/initial-load.html +0 -168
  183. package/dev-server/visualstudio.vbs +0 -82
  184. package/dev-server/xdg-open +0 -1066
  185. package/internal/app-data/index.cjs +0 -119
  186. package/internal/app-data/index.d.ts +0 -26
  187. package/internal/app-data/index.js +0 -92
  188. package/internal/app-data/package.json +0 -15
  189. package/internal/app-globals/index.d.ts +0 -2
  190. package/internal/app-globals/index.js +0 -14
  191. package/internal/app-globals/package.json +0 -14
  192. package/internal/child_process.d.ts +0 -7
  193. package/internal/client/index.js +0 -4777
  194. package/internal/client/package.json +0 -10
  195. package/internal/client/patch-browser.js +0 -45
  196. package/internal/client/polyfills/core-js.js +0 -11
  197. package/internal/client/polyfills/dom.js +0 -79
  198. package/internal/client/polyfills/es5-html-element.js +0 -1
  199. package/internal/client/polyfills/index.js +0 -34
  200. package/internal/client/polyfills/system.js +0 -6
  201. package/internal/client/shadow-css.js +0 -414
  202. package/internal/hydrate/index.js +0 -6915
  203. package/internal/hydrate/package.json +0 -7
  204. package/internal/hydrate/runner.d.ts +0 -287
  205. package/internal/hydrate/runner.js +0 -18173
  206. package/internal/index.d.ts +0 -4
  207. package/internal/index.js +0 -2
  208. package/internal/package.json +0 -9
  209. package/internal/stencil-core/index.cjs +0 -1
  210. package/internal/stencil-core/index.js +0 -18
  211. package/internal/stencil-core/jsx-dev-runtime.cjs +0 -7
  212. package/internal/stencil-core/jsx-dev-runtime.d.ts +0 -41
  213. package/internal/stencil-core/jsx-dev-runtime.js +0 -2
  214. package/internal/stencil-core/jsx-runtime.cjs +0 -8
  215. package/internal/stencil-core/jsx-runtime.d.ts +0 -40
  216. package/internal/stencil-core/jsx-runtime.js +0 -2
  217. package/internal/stencil-private.d.ts +0 -2549
  218. package/internal/stencil-public-compiler.d.ts +0 -2922
  219. package/internal/stencil-public-docs.d.ts +0 -472
  220. package/internal/stencil-public-runtime.d.ts +0 -1861
  221. package/internal/testing/index.js +0 -6779
  222. package/internal/testing/jsx-dev-runtime.d.ts +0 -2
  223. package/internal/testing/jsx-dev-runtime.js +0 -8
  224. package/internal/testing/jsx-runtime.d.ts +0 -2
  225. package/internal/testing/jsx-runtime.js +0 -9
  226. package/internal/testing/package.json +0 -7
  227. package/internal/utils/index.d.ts +0 -1
  228. package/internal/utils/result.d.ts +0 -112
  229. package/mock-doc/index.cjs +0 -10163
  230. package/mock-doc/index.d.ts +0 -1172
  231. package/mock-doc/index.js +0 -10142
  232. package/mock-doc/package.json +0 -15
  233. package/readme.md +0 -94
  234. package/screenshot/compare/assets/favicon.ico +0 -0
  235. package/screenshot/compare/assets/logo.png +0 -0
  236. package/screenshot/compare/build/app.css +0 -1
  237. package/screenshot/compare/build/app.esm.js +0 -1
  238. package/screenshot/compare/build/app.js +0 -33
  239. package/screenshot/compare/build/p-081b0641.js +0 -1
  240. package/screenshot/compare/build/p-227a1e18.entry.js +0 -1
  241. package/screenshot/compare/build/p-2c298727.entry.js +0 -1
  242. package/screenshot/compare/build/p-5479268c.entry.js +0 -1
  243. package/screenshot/compare/build/p-573ec8a4.entry.js +0 -1
  244. package/screenshot/compare/build/p-6ba08604.entry.js +0 -1
  245. package/screenshot/compare/build/p-6bc63295.entry.js +0 -1
  246. package/screenshot/compare/build/p-7a3759fd.entry.js +0 -1
  247. package/screenshot/compare/build/p-7b4e3ba7.js +0 -1
  248. package/screenshot/compare/build/p-988eb362.css +0 -1
  249. package/screenshot/compare/build/p-9b6a9315.js +0 -1
  250. package/screenshot/compare/build/p-b4cc611c.entry.js +0 -1
  251. package/screenshot/compare/build/p-d1bf53f5.entry.js +0 -1
  252. package/screenshot/compare/build/p-e2efe0df.js +0 -1
  253. package/screenshot/compare/build/p-e8ca6d97.entry.js +0 -1
  254. package/screenshot/compare/build/p-ec2f13e0.entry.js +0 -1
  255. package/screenshot/compare/build/p-f0b99977.entry.js +0 -1
  256. package/screenshot/compare/build/p-f4745c2f.entry.js +0 -1
  257. package/screenshot/compare/build/p-fbbae598.js +0 -1
  258. package/screenshot/compare/host.config.json +0 -15
  259. package/screenshot/compare/index.html +0 -1
  260. package/screenshot/compare/manifest.json +0 -13
  261. package/screenshot/connector-base.d.ts +0 -42
  262. package/screenshot/connector-local.d.ts +0 -7
  263. package/screenshot/connector.js +0 -2
  264. package/screenshot/index.d.ts +0 -3
  265. package/screenshot/index.js +0 -2642
  266. package/screenshot/local-connector.js +0 -2
  267. package/screenshot/package.json +0 -15
  268. package/screenshot/pixel-match.d.ts +0 -1
  269. package/screenshot/pixel-match.js +0 -2315
  270. package/screenshot/screenshot-compare.d.ts +0 -20
  271. package/screenshot/screenshot-fs.d.ts +0 -14
  272. package/sys/node/460.node-fetch.js +0 -451
  273. package/sys/node/autoprefixer.js +0 -9
  274. package/sys/node/glob.js +0 -1
  275. package/sys/node/graceful-fs.js +0 -1
  276. package/sys/node/index.d.ts +0 -39
  277. package/sys/node/index.js +0 -62
  278. package/sys/node/node-fetch.js +0 -12
  279. package/sys/node/package.json +0 -8
  280. package/sys/node/prompts.js +0 -1
  281. package/sys/node/worker.js +0 -4
  282. package/testing/index.d.ts +0 -9
  283. package/testing/index.js +0 -13276
  284. package/testing/jest/jest-27-and-under/jest-config.d.ts +0 -16
  285. package/testing/jest/jest-27-and-under/jest-environment.d.ts +0 -2
  286. package/testing/jest/jest-27-and-under/jest-facade.d.ts +0 -155
  287. package/testing/jest/jest-27-and-under/jest-preprocessor.d.ts +0 -59
  288. package/testing/jest/jest-27-and-under/jest-preset.d.ts +0 -3
  289. package/testing/jest/jest-27-and-under/jest-runner.d.ts +0 -11
  290. package/testing/jest/jest-27-and-under/jest-screenshot.d.ts +0 -2
  291. package/testing/jest/jest-27-and-under/jest-serializer.d.ts +0 -4
  292. package/testing/jest/jest-27-and-under/jest-setup-test-framework.d.ts +0 -9
  293. package/testing/jest/jest-27-and-under/matchers/attributes.d.ts +0 -14
  294. package/testing/jest/jest-27-and-under/matchers/class-list.d.ts +0 -12
  295. package/testing/jest/jest-27-and-under/matchers/events.d.ts +0 -25
  296. package/testing/jest/jest-27-and-under/matchers/html.d.ts +0 -13
  297. package/testing/jest/jest-27-and-under/matchers/index.d.ts +0 -24
  298. package/testing/jest/jest-27-and-under/matchers/screenshot.d.ts +0 -5
  299. package/testing/jest/jest-27-and-under/matchers/text.d.ts +0 -4
  300. package/testing/jest/jest-27-and-under/test/jest-config.spec.d.ts +0 -1
  301. package/testing/jest/jest-27-and-under/test/jest-preprocessor.spec.d.ts +0 -1
  302. package/testing/jest/jest-27-and-under/test/jest-runner.spec.d.ts +0 -1
  303. package/testing/jest/jest-27-and-under/test/jest-serializer.spec.d.ts +0 -1
  304. package/testing/jest/jest-27-and-under/test/jest-setup-test-framework.spec.d.ts +0 -1
  305. package/testing/jest/jest-28/jest-config.d.ts +0 -16
  306. package/testing/jest/jest-28/jest-environment.d.ts +0 -2
  307. package/testing/jest/jest-28/jest-facade.d.ts +0 -134
  308. package/testing/jest/jest-28/jest-preprocessor.d.ts +0 -35
  309. package/testing/jest/jest-28/jest-preset.d.ts +0 -3
  310. package/testing/jest/jest-28/jest-runner.d.ts +0 -11
  311. package/testing/jest/jest-28/jest-screenshot.d.ts +0 -2
  312. package/testing/jest/jest-28/jest-serializer.d.ts +0 -4
  313. package/testing/jest/jest-28/jest-setup-test-framework.d.ts +0 -9
  314. package/testing/jest/jest-28/matchers/attributes.d.ts +0 -14
  315. package/testing/jest/jest-28/matchers/class-list.d.ts +0 -12
  316. package/testing/jest/jest-28/matchers/events.d.ts +0 -25
  317. package/testing/jest/jest-28/matchers/html.d.ts +0 -13
  318. package/testing/jest/jest-28/matchers/index.d.ts +0 -24
  319. package/testing/jest/jest-28/matchers/screenshot.d.ts +0 -5
  320. package/testing/jest/jest-28/matchers/text.d.ts +0 -4
  321. package/testing/jest/jest-28/test/jest-config.spec.d.ts +0 -1
  322. package/testing/jest/jest-28/test/jest-preprocessor.spec.d.ts +0 -1
  323. package/testing/jest/jest-28/test/jest-runner.spec.d.ts +0 -1
  324. package/testing/jest/jest-28/test/jest-serializer.spec.d.ts +0 -1
  325. package/testing/jest/jest-28/test/jest-setup-test-framework.spec.d.ts +0 -1
  326. package/testing/jest/jest-29/jest-config.d.ts +0 -16
  327. package/testing/jest/jest-29/jest-environment.d.ts +0 -2
  328. package/testing/jest/jest-29/jest-facade.d.ts +0 -136
  329. package/testing/jest/jest-29/jest-preprocessor.d.ts +0 -35
  330. package/testing/jest/jest-29/jest-preset.d.ts +0 -3
  331. package/testing/jest/jest-29/jest-runner.d.ts +0 -11
  332. package/testing/jest/jest-29/jest-screenshot.d.ts +0 -2
  333. package/testing/jest/jest-29/jest-serializer.d.ts +0 -4
  334. package/testing/jest/jest-29/jest-setup-test-framework.d.ts +0 -9
  335. package/testing/jest/jest-29/matchers/attributes.d.ts +0 -14
  336. package/testing/jest/jest-29/matchers/class-list.d.ts +0 -12
  337. package/testing/jest/jest-29/matchers/events.d.ts +0 -25
  338. package/testing/jest/jest-29/matchers/html.d.ts +0 -13
  339. package/testing/jest/jest-29/matchers/index.d.ts +0 -24
  340. package/testing/jest/jest-29/matchers/screenshot.d.ts +0 -5
  341. package/testing/jest/jest-29/matchers/text.d.ts +0 -4
  342. package/testing/jest/jest-29/test/jest-config.spec.d.ts +0 -1
  343. package/testing/jest/jest-29/test/jest-preprocessor.spec.d.ts +0 -1
  344. package/testing/jest/jest-29/test/jest-runner.spec.d.ts +0 -1
  345. package/testing/jest/jest-29/test/jest-serializer.spec.d.ts +0 -1
  346. package/testing/jest/jest-29/test/jest-setup-test-framework.spec.d.ts +0 -1
  347. package/testing/jest/jest-apis.d.ts +0 -86
  348. package/testing/jest/jest-facade.d.ts +0 -74
  349. package/testing/jest/jest-stencil-connector.d.ts +0 -65
  350. package/testing/jest/test/jest-stencil-connector.spec.d.ts +0 -1
  351. package/testing/jest-environment.js +0 -3
  352. package/testing/jest-preprocessor.js +0 -3
  353. package/testing/jest-preset.js +0 -2
  354. package/testing/jest-runner.js +0 -3
  355. package/testing/jest-setuptestframework.js +0 -3
  356. package/testing/mock-fetch.d.ts +0 -11
  357. package/testing/mocks.d.ts +0 -56
  358. package/testing/package.json +0 -8
  359. package/testing/puppeteer/index.d.ts +0 -2
  360. package/testing/puppeteer/puppeteer-browser.d.ts +0 -6
  361. package/testing/puppeteer/puppeteer-declarations.d.ts +0 -414
  362. package/testing/puppeteer/puppeteer-element.d.ts +0 -67
  363. package/testing/puppeteer/puppeteer-emulate.d.ts +0 -2
  364. package/testing/puppeteer/puppeteer-events.d.ts +0 -21
  365. package/testing/puppeteer/puppeteer-page.d.ts +0 -2
  366. package/testing/puppeteer/puppeteer-screenshot.d.ts +0 -27
  367. package/testing/puppeteer/test/puppeteer-screenshot.spec.d.ts +0 -1
  368. package/testing/reset-build-conditionals.d.ts +0 -12
  369. package/testing/spec-page.d.ts +0 -7
  370. package/testing/test/testing-utils.spec.d.ts +0 -1
  371. package/testing/test-transpile.d.ts +0 -2
  372. package/testing/testing-logger.d.ts +0 -26
  373. package/testing/testing-sys.d.ts +0 -6
  374. package/testing/testing-utils.d.ts +0 -80
  375. package/testing/testing.d.ts +0 -2
  376. /package/{screenshot/compare/build/index.esm.js → dist/declarations/stencil-public-docs.js} +0 -0
@@ -0,0 +1,1458 @@
1
+ import { t as __exportAll } from "./chunk-z9aeyW2b.mjs";
2
+ import { $ as VALID_CONFIG_OUTPUT_TARGETS, C as ASSETS, F as DOCS_README, H as LISTENER_FLAGS, I as DOCS_VSCODE, J as STANDALONE, M as DOCS_CUSTOM, N as DOCS_CUSTOM_ELEMENTS_MANIFEST, O as COPY, P as DOCS_JSON, Q as TYPES, R as GENERATED_DTS, T as COLLECTION, U as LOADER_BUNDLE, W as MEMBER_FLAGS, Y as STATS, _ as sortBy, b as toTitleCase, et as WATCH_FLAGS, i as flatOne, j as DIST_LAZY, k as CUSTOM, n as dashToPascalCase, p as isString, q as SSR_WASM, r as escapeWithPattern, u as isIterable, w as CMP_FLAGS, y as toDashCase, z as GLOBAL_STYLE } from "./regular-expression-CFVJOTUh.mjs";
3
+ import path, { basename, dirname, relative } from "node:path";
4
+ import picomatch from "picomatch";
5
+ //#region src/utils/byte-size.ts
6
+ /**
7
+ * Used to learn the size of a string in bytes.
8
+ *
9
+ * @param str The string to measure
10
+ * @returns number
11
+ */
12
+ const byteSize = (str) => Buffer.byteLength(str, "utf8");
13
+ //#endregion
14
+ //#region src/utils/format-component-runtime-meta.ts
15
+ const formatLazyBundleRuntimeMeta = (bundleId, cmps) => {
16
+ return [bundleId, cmps.map((cmp) => formatComponentRuntimeMeta(cmp, true))];
17
+ };
18
+ /**
19
+ * Transform metadata about a component from the compiler to a compact form for
20
+ * use at runtime.
21
+ *
22
+ * @param compilerMeta component metadata gathered during compilation
23
+ * @param includeMethods include methods in the component's members or not
24
+ * @returns a compact format for component metadata, intended for runtime use
25
+ */
26
+ const formatComponentRuntimeMeta = (compilerMeta, includeMethods) => {
27
+ let flags = 0;
28
+ if (compilerMeta.encapsulation === "shadow") {
29
+ flags |= CMP_FLAGS.shadowDomEncapsulation;
30
+ if (compilerMeta.shadowDelegatesFocus) flags |= CMP_FLAGS.shadowDelegatesFocus;
31
+ if (compilerMeta.slotAssignment === "manual") flags |= CMP_FLAGS.shadowSlotAssignmentManual;
32
+ if (compilerMeta.shadowMode === "closed") flags |= CMP_FLAGS.shadowModeClosed;
33
+ } else if (compilerMeta.encapsulation === "scoped") flags |= CMP_FLAGS.scopedCssEncapsulation;
34
+ if (compilerMeta.formAssociated) flags |= CMP_FLAGS.formAssociated;
35
+ if (compilerMeta.encapsulation !== "shadow" && compilerMeta.htmlTagNames.includes("slot")) flags |= CMP_FLAGS.hasSlotRelocation;
36
+ if (compilerMeta.hasSlot) flags |= CMP_FLAGS.hasSlot;
37
+ if (compilerMeta.hasMode) flags |= CMP_FLAGS.hasMode;
38
+ if (compilerMeta.hasModernPropertyDecls) flags |= CMP_FLAGS.hasModernPropertyDecls;
39
+ if (compilerMeta.patches) {
40
+ if (compilerMeta.patches.all) flags |= CMP_FLAGS.patchAll;
41
+ if (compilerMeta.patches.children) flags |= CMP_FLAGS.patchChildren;
42
+ if (compilerMeta.patches.clone) flags |= CMP_FLAGS.patchClone;
43
+ if (compilerMeta.patches.insert) flags |= CMP_FLAGS.patchInsert;
44
+ }
45
+ const members = formatComponentRuntimeMembers(compilerMeta, includeMethods);
46
+ const hostListeners = formatHostListeners(compilerMeta);
47
+ const watchers = formatComponentRuntimeReactiveHandlers(compilerMeta, "watchers");
48
+ const serializers = formatComponentRuntimeReactiveHandlers(compilerMeta, "serializers");
49
+ const deserializers = formatComponentRuntimeReactiveHandlers(compilerMeta, "deserializers");
50
+ return trimFalsy([
51
+ flags,
52
+ compilerMeta.tagName,
53
+ Object.keys(members).length > 0 ? members : void 0,
54
+ hostListeners.length > 0 ? hostListeners : void 0,
55
+ Object.keys(watchers).length > 0 ? watchers : void 0,
56
+ Object.keys(serializers).length > 0 ? serializers : void 0,
57
+ Object.keys(deserializers).length > 0 ? deserializers : void 0
58
+ ]);
59
+ };
60
+ const stringifyRuntimeData = (data) => {
61
+ const json = JSON.stringify(data);
62
+ if (json.length > 1e4) return `JSON.parse(${JSON.stringify(json)})`;
63
+ return json;
64
+ };
65
+ /**
66
+ * Transforms Stencil compiler metadata into a {@link d.ComponentCompilerMeta} object.
67
+ * This handles processing any compiler metadata transformed from components' uses of `@Watch()`, `@PropSerialize()`, and `@AttrDeserialize()`.
68
+ * The map of watched properties to their callback(s) will be immediately available
69
+ * to the runtime at bootstrap.
70
+ *
71
+ * @param compilerMeta Component metadata gathered during compilation
72
+ * @param decorator The decorator type to be processed: 'watchers', 'serializers', or 'deserializers'
73
+ * @returns An object mapping watched properties to their respective callback(s)
74
+ */
75
+ const formatComponentRuntimeReactiveHandlers = (compilerMeta, decorator) => {
76
+ const handlers = {};
77
+ compilerMeta[decorator]?.forEach(({ propName, methodName, handlerOptions }) => {
78
+ let watcherFlags = 0;
79
+ if (handlerOptions?.immediate) watcherFlags |= WATCH_FLAGS.Immediate;
80
+ handlers[propName] = [...handlers[propName] ?? [], { [methodName]: watcherFlags }];
81
+ });
82
+ return handlers;
83
+ };
84
+ const formatComponentRuntimeMembers = (compilerMeta, includeMethods = true) => {
85
+ return {
86
+ ...formatPropertiesRuntimeMember(compilerMeta.properties),
87
+ ...formatStatesRuntimeMember(compilerMeta.states),
88
+ ...includeMethods ? formatMethodsRuntimeMember(compilerMeta.methods) : {}
89
+ };
90
+ };
91
+ const formatPropertiesRuntimeMember = (properties) => {
92
+ const runtimeMembers = {};
93
+ properties.forEach((member) => {
94
+ runtimeMembers[member.name] = trimFalsy([formatFlags(member), formatAttrName(member)]);
95
+ });
96
+ return runtimeMembers;
97
+ };
98
+ const formatFlags = (compilerProperty) => {
99
+ let type = formatPropType(compilerProperty.type);
100
+ if (compilerProperty.mutable) type |= MEMBER_FLAGS.Mutable;
101
+ if (compilerProperty.reflect) type |= MEMBER_FLAGS.ReflectAttr;
102
+ if (compilerProperty.getter) type |= MEMBER_FLAGS.Getter;
103
+ if (compilerProperty.setter) type |= MEMBER_FLAGS.Setter;
104
+ return type;
105
+ };
106
+ /**
107
+ * We mainly add the alternative kebab-case attribute name because it might
108
+ * be used in an HTML environment (non JSX). Since we support hydration of
109
+ * complex types we provide a kebab-case attribute name for properties with
110
+ * these types.
111
+ */
112
+ const kebabCaseSupportForTypes = ["string", "unknown"];
113
+ const formatAttrName = (compilerProperty) => {
114
+ if (kebabCaseSupportForTypes.includes(typeof compilerProperty.attribute)) {
115
+ if (compilerProperty.name === compilerProperty.attribute) return;
116
+ return compilerProperty.attribute;
117
+ }
118
+ };
119
+ const formatPropType = (type) => {
120
+ if (type === "string") return MEMBER_FLAGS.String;
121
+ if (type === "number") return MEMBER_FLAGS.Number;
122
+ if (type === "boolean") return MEMBER_FLAGS.Boolean;
123
+ if (type === "any") return MEMBER_FLAGS.Any;
124
+ return MEMBER_FLAGS.Unknown;
125
+ };
126
+ const formatStatesRuntimeMember = (states) => {
127
+ const runtimeMembers = {};
128
+ states.forEach((member) => {
129
+ runtimeMembers[member.name] = [MEMBER_FLAGS.State];
130
+ });
131
+ return runtimeMembers;
132
+ };
133
+ const formatMethodsRuntimeMember = (methods) => {
134
+ const runtimeMembers = {};
135
+ methods.forEach((member) => {
136
+ runtimeMembers[member.name] = [MEMBER_FLAGS.Method];
137
+ });
138
+ return runtimeMembers;
139
+ };
140
+ const formatHostListeners = (compilerMeta) => {
141
+ return compilerMeta.listeners.map((compilerListener) => {
142
+ return [
143
+ computeListenerFlags(compilerListener),
144
+ compilerListener.name,
145
+ compilerListener.method
146
+ ];
147
+ });
148
+ };
149
+ const computeListenerFlags = (listener) => {
150
+ let flags = 0;
151
+ if (listener.capture) flags |= LISTENER_FLAGS.Capture;
152
+ if (listener.passive) flags |= LISTENER_FLAGS.Passive;
153
+ switch (listener.target) {
154
+ case "document":
155
+ flags |= LISTENER_FLAGS.TargetDocument;
156
+ break;
157
+ case "window":
158
+ flags |= LISTENER_FLAGS.TargetWindow;
159
+ break;
160
+ case "body":
161
+ flags |= LISTENER_FLAGS.TargetBody;
162
+ break;
163
+ }
164
+ return flags;
165
+ };
166
+ const trimFalsy = (data) => {
167
+ const arr = data;
168
+ for (let i = arr.length - 1; i >= 0; i--) {
169
+ if (arr[i]) break;
170
+ arr.pop();
171
+ }
172
+ return arr;
173
+ };
174
+ //#endregion
175
+ //#region src/utils/is-glob.ts
176
+ /**
177
+ * Check if a string is a glob pattern (e.g. 'src/*.js' or something like that)
178
+ *
179
+ * @param str a string to check
180
+ * @returns whether the string is a glob pattern or not
181
+ */
182
+ const isGlob = (str) => {
183
+ const chars = {
184
+ "{": "}",
185
+ "(": ")",
186
+ "[": "]"
187
+ };
188
+ const regex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
189
+ if (str === "") return false;
190
+ let match;
191
+ while (match = regex.exec(str)) {
192
+ if (match[2]) return true;
193
+ let idx = match.index + match[0].length;
194
+ const open = match[1];
195
+ const close = open ? chars[open] : null;
196
+ if (open && close) {
197
+ const n = str.indexOf(close, idx);
198
+ if (n !== -1) idx = n + 1;
199
+ }
200
+ str = str.slice(idx);
201
+ }
202
+ return false;
203
+ };
204
+ //#endregion
205
+ //#region src/utils/is-root-path.ts
206
+ /**
207
+ * Checks if the path is the Operating System (OS) root path, such as "/" or "C:\". This function does not take the OS
208
+ * the code is running on into account when performing this evaluation.
209
+ * @param p the path to check
210
+ * @returns `true` if the path is an OS root path, `false` otherwise
211
+ */
212
+ const isRootPath = (p) => p === "/" || windowsPathRegex.test(p);
213
+ const windowsPathRegex = /^(?:[a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?[\\/]$/;
214
+ //#endregion
215
+ //#region src/utils/message-utils.ts
216
+ /**
217
+ * Builds a template `Diagnostic` entity for a build error. The created `Diagnostic` is returned, and have little
218
+ * detail attached to it regarding the specifics of the error - it is the responsibility of the caller of this method
219
+ * to attach the specifics of the error message.
220
+ *
221
+ * The created `Diagnostic` is pushed to the `diagnostics` argument as a side effect of calling this method.
222
+ *
223
+ * @param diagnostics the existing diagnostics that the created template `Diagnostic` should be added to
224
+ * @returns the created `Diagnostic`
225
+ */
226
+ const buildError = (diagnostics) => {
227
+ const diagnostic = {
228
+ level: "error",
229
+ type: "build",
230
+ header: "Build Error",
231
+ messageText: "build error",
232
+ relFilePath: void 0,
233
+ absFilePath: void 0,
234
+ lines: []
235
+ };
236
+ if (diagnostics) diagnostics.push(diagnostic);
237
+ return diagnostic;
238
+ };
239
+ /**
240
+ * Builds a template `Diagnostic` entity for a build warning. The created `Diagnostic` is returned, and have little
241
+ * detail attached to it regarding the specifics of the warning - it is the responsibility of the caller of this method
242
+ * to attach the specifics of the warning message.
243
+ *
244
+ * The created `Diagnostic` is pushed to the `diagnostics` argument as a side effect of calling this method.
245
+ *
246
+ * @param diagnostics the existing diagnostics that the created template `Diagnostic` should be added to
247
+ * @returns the created `Diagnostic`
248
+ */
249
+ const buildWarn = (diagnostics) => {
250
+ const diagnostic = {
251
+ level: "warn",
252
+ type: "build",
253
+ header: "Build Warn",
254
+ messageText: "build warn",
255
+ lines: []
256
+ };
257
+ diagnostics.push(diagnostic);
258
+ return diagnostic;
259
+ };
260
+ /**
261
+ * Create a diagnostic message suited for representing an error in a JSON
262
+ * file. This includes information about the exact lines in the JSON file which
263
+ * caused the error and the path to the file.
264
+ *
265
+ * @param compilerCtx the current compiler context
266
+ * @param diagnostics a list of diagnostics used as a return param
267
+ * @param jsonFilePath the path to the JSON file where the error occurred
268
+ * @param msg the error message
269
+ * @param jsonField the key for the field which caused the error, used for finding
270
+ * the error line in the original JSON file. Only root-level keys (with minimal
271
+ * indentation, typically 2 spaces) are highlighted to avoid matching nested keys.
272
+ * @returns a reference to the newly-created diagnostic
273
+ */
274
+ const buildJsonFileError = (compilerCtx, diagnostics, jsonFilePath, msg, jsonField) => {
275
+ const err = buildError(diagnostics);
276
+ err.messageText = msg;
277
+ err.absFilePath = jsonFilePath;
278
+ if (typeof jsonField === "string") try {
279
+ const lines = compilerCtx.fs.readFileSync(jsonFilePath).replace(/\r/g, "\n").split("\n");
280
+ let bestMatch = null;
281
+ const ROOT_LEVEL_INDENTATION = 2;
282
+ for (let i = 0; i < lines.length; i++) {
283
+ const txtLine = lines[i];
284
+ const txtIndex = txtLine.indexOf(jsonField);
285
+ if (txtIndex > -1) {
286
+ const indentation = txtLine.search(/\S/);
287
+ if (indentation === ROOT_LEVEL_INDENTATION) {
288
+ bestMatch = {
289
+ lineIndex: i,
290
+ charIndex: txtIndex,
291
+ indentation
292
+ };
293
+ break;
294
+ } else if (bestMatch === null || indentation < bestMatch.indentation) bestMatch = {
295
+ lineIndex: i,
296
+ charIndex: txtIndex,
297
+ indentation
298
+ };
299
+ }
300
+ }
301
+ if (bestMatch !== null && bestMatch.indentation === ROOT_LEVEL_INDENTATION) {
302
+ const i = bestMatch.lineIndex;
303
+ const txtIndex = bestMatch.charIndex;
304
+ const txtLine = lines[i];
305
+ const warnLine = {
306
+ lineIndex: i,
307
+ lineNumber: i + 1,
308
+ text: txtLine,
309
+ errorCharStart: txtIndex,
310
+ errorLength: jsonField.length
311
+ };
312
+ err.lineNumber = warnLine.lineNumber;
313
+ err.columnNumber = txtIndex + 1;
314
+ err.lines.push(warnLine);
315
+ if (i > 0) {
316
+ const beforeWarnLine = {
317
+ lineIndex: warnLine.lineIndex - 1,
318
+ lineNumber: warnLine.lineNumber - 1,
319
+ text: lines[i - 1],
320
+ errorCharStart: -1,
321
+ errorLength: -1
322
+ };
323
+ err.lines.unshift(beforeWarnLine);
324
+ }
325
+ if (i < lines.length - 1) {
326
+ const afterWarnLine = {
327
+ lineIndex: warnLine.lineIndex + 1,
328
+ lineNumber: warnLine.lineNumber + 1,
329
+ text: lines[i + 1],
330
+ errorCharStart: -1,
331
+ errorLength: -1
332
+ };
333
+ err.lines.push(afterWarnLine);
334
+ }
335
+ }
336
+ } catch {}
337
+ return err;
338
+ };
339
+ /**
340
+ * Builds a diagnostic from an `Error`, appends it to the `diagnostics` parameter, and returns the created diagnostic
341
+ * @param diagnostics the series of diagnostics the newly created diagnostics should be added to
342
+ * @param err the error to derive information from in generating the diagnostic
343
+ * @param msg an optional message to use in place of `err` to generate the diagnostic
344
+ * @returns the generated diagnostic
345
+ */
346
+ const catchError = (diagnostics, err, msg) => {
347
+ const diagnostic = {
348
+ level: "error",
349
+ type: "build",
350
+ header: "Build Error",
351
+ messageText: "build error",
352
+ lines: []
353
+ };
354
+ if (isString(msg)) diagnostic.messageText = msg.length ? msg : "UNKNOWN ERROR";
355
+ else if (err != null) if (err.stack != null) diagnostic.messageText = err.stack.toString();
356
+ else if (err.message != null) diagnostic.messageText = err.message.length ? err.message : "UNKNOWN ERROR";
357
+ else diagnostic.messageText = err.toString();
358
+ if (diagnostics != null && !shouldIgnoreError(diagnostic.messageText)) diagnostics.push(diagnostic);
359
+ return diagnostic;
360
+ };
361
+ /**
362
+ * Determine if the provided diagnostics have any build errors
363
+ * @param diagnostics the diagnostics to inspect
364
+ * @returns true if any of the diagnostics in the list provided are errors that did not occur at runtime. false
365
+ * otherwise.
366
+ */
367
+ const hasError = (diagnostics) => {
368
+ if (diagnostics == null || diagnostics.length === 0) return false;
369
+ return diagnostics.some((d) => d.level === "error" && d.type !== "runtime");
370
+ };
371
+ /**
372
+ * Determine if the provided diagnostics have any warnings
373
+ * @param diagnostics the diagnostics to inspect
374
+ * @returns true if any of the diagnostics in the list provided are warnings. false otherwise.
375
+ */
376
+ const hasWarning = (diagnostics) => {
377
+ if (diagnostics == null || diagnostics.length === 0) return false;
378
+ return diagnostics.some((d) => d.level === "warn");
379
+ };
380
+ const shouldIgnoreError = (msg) => {
381
+ return msg === TASK_CANCELED_MSG;
382
+ };
383
+ const TASK_CANCELED_MSG = `task canceled`;
384
+ //#endregion
385
+ //#region src/utils/logger/logger-utils.ts
386
+ /**
387
+ * Iterate through a series of diagnostics to provide minor fix-ups for various edge cases, deduplicate messages, etc.
388
+ * @param compilerCtx the current compiler context
389
+ * @param diagnostics the diagnostics to normalize
390
+ * @returns the normalize documents
391
+ */
392
+ const normalizeDiagnostics = (compilerCtx, diagnostics) => {
393
+ const maxErrorsToNormalize = 25;
394
+ const normalizedErrors = [];
395
+ const normalizedOthers = [];
396
+ const dups = /* @__PURE__ */ new Set();
397
+ for (let i = 0; i < diagnostics.length; i++) {
398
+ const diagnostic = normalizeDiagnostic(compilerCtx, diagnostics[i]);
399
+ const key = (diagnostic.absFilePath ?? "") + (diagnostic.code ?? "") + diagnostic.messageText + diagnostic.type;
400
+ if (dups.has(key)) continue;
401
+ dups.add(key);
402
+ const total = normalizedErrors.length + normalizedOthers.length;
403
+ if (diagnostic.level === "error") normalizedErrors.push(diagnostic);
404
+ else if (total < maxErrorsToNormalize) normalizedOthers.push(diagnostic);
405
+ }
406
+ return [...normalizedErrors, ...normalizedOthers];
407
+ };
408
+ /**
409
+ * Perform post-processing on a `Diagnostic` to handle a few message edge cases, massaging error message text and
410
+ * updating build failure contexts
411
+ * @param compilerCtx the current compiler
412
+ * @param diagnostic the diagnostic to normalize
413
+ * @returns the altered diagnostic
414
+ */
415
+ const normalizeDiagnostic = (compilerCtx, diagnostic) => {
416
+ if (diagnostic.messageText) {
417
+ if (typeof diagnostic.messageText.message === "string") diagnostic.messageText = diagnostic.messageText.message;
418
+ else if (typeof diagnostic.messageText === "string" && diagnostic.messageText.indexOf("Error: ") === 0) diagnostic.messageText = diagnostic.messageText.slice(7);
419
+ }
420
+ if (diagnostic.messageText) {
421
+ if (diagnostic.messageText.includes(`Cannot find name 'h'`)) {
422
+ diagnostic.header = `Missing "h" import for JSX types`;
423
+ diagnostic.messageText = `In order to load accurate JSX types for components, the "h" function must be imported from "@stencil/core" by each component using JSX. For example: import { Component, h } from '@stencil/core';`;
424
+ if (diagnostic.absFilePath) try {
425
+ const srcLines = splitLineBreaks(compilerCtx.fs.readFileSync(diagnostic.absFilePath));
426
+ for (let i = 0; i < srcLines.length; i++) {
427
+ const srcLine = srcLines[i];
428
+ if (srcLine.includes("@stencil/core")) {
429
+ const msgLines = [];
430
+ const beforeLineIndex = i - 1;
431
+ if (beforeLineIndex > -1) {
432
+ const beforeLine = {
433
+ lineIndex: beforeLineIndex,
434
+ lineNumber: beforeLineIndex + 1,
435
+ text: srcLines[beforeLineIndex],
436
+ errorCharStart: -1,
437
+ errorLength: -1
438
+ };
439
+ msgLines.push(beforeLine);
440
+ }
441
+ const errorLine = {
442
+ lineIndex: i,
443
+ lineNumber: i + 1,
444
+ text: srcLine,
445
+ errorCharStart: 0,
446
+ errorLength: -1
447
+ };
448
+ msgLines.push(errorLine);
449
+ diagnostic.lineNumber = errorLine.lineNumber;
450
+ diagnostic.columnNumber = srcLine.indexOf("}");
451
+ const afterLineIndex = i + 1;
452
+ if (afterLineIndex < srcLines.length) {
453
+ const afterLine = {
454
+ lineIndex: afterLineIndex,
455
+ lineNumber: afterLineIndex + 1,
456
+ text: srcLines[afterLineIndex],
457
+ errorCharStart: -1,
458
+ errorLength: -1
459
+ };
460
+ msgLines.push(afterLine);
461
+ }
462
+ diagnostic.lines = msgLines;
463
+ break;
464
+ }
465
+ }
466
+ } catch {}
467
+ }
468
+ }
469
+ return diagnostic;
470
+ };
471
+ /**
472
+ * Split a corpus by newlines. Carriage returns are treated a newlines.
473
+ * @param sourceText the corpus to split
474
+ * @returns the split text
475
+ */
476
+ const splitLineBreaks = (sourceText) => {
477
+ if (typeof sourceText !== "string") return [];
478
+ sourceText = sourceText.replace(/\\r/g, "\n");
479
+ return sourceText.split("\n");
480
+ };
481
+ const escapeHtml = (unsafe) => {
482
+ if (unsafe === void 0) return "undefined";
483
+ if (unsafe === null) return "null";
484
+ if (typeof unsafe !== "string") unsafe = unsafe.toString();
485
+ return unsafe.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
486
+ };
487
+ //#endregion
488
+ //#region src/utils/logger/logger-rolldown.ts
489
+ const isRolldownError = (e) => typeof e === "object" && e !== null && "message" in e;
490
+ const loadRolldownDiagnostics = (config, compilerCtx, buildCtx, rolldownError) => {
491
+ const formattedCode = formatErrorCode(rolldownError.code);
492
+ const diagnostic = {
493
+ level: "error",
494
+ type: "bundling",
495
+ language: "javascript",
496
+ code: rolldownError.code,
497
+ header: `Rolldown${formattedCode.length > 0 ? ": " + formattedCode : ""}`,
498
+ messageText: formattedCode,
499
+ relFilePath: void 0,
500
+ absFilePath: void 0,
501
+ lines: []
502
+ };
503
+ if (config.logLevel === "debug" && rolldownError.stack) diagnostic.messageText = rolldownError.stack;
504
+ else if (rolldownError.message) diagnostic.messageText = rolldownError.message;
505
+ if (rolldownError.plugin) diagnostic.messageText += ` (plugin: ${rolldownError.plugin}${rolldownError.hook ? `, ${rolldownError.hook}` : ""})`;
506
+ const loc = rolldownError.loc;
507
+ if (loc != null) {
508
+ const srcFile = loc.file || rolldownError.id;
509
+ if (isString(srcFile)) try {
510
+ const sourceText = compilerCtx.fs.readFileSync(srcFile);
511
+ if (sourceText) {
512
+ diagnostic.absFilePath = srcFile;
513
+ try {
514
+ const srcLines = splitLineBreaks(sourceText);
515
+ const errorLine = {
516
+ lineIndex: loc.line - 1,
517
+ lineNumber: loc.line,
518
+ text: srcLines[loc.line - 1],
519
+ errorCharStart: loc.column,
520
+ errorLength: 0
521
+ };
522
+ diagnostic.lineNumber = errorLine.lineNumber;
523
+ diagnostic.columnNumber = errorLine.errorCharStart;
524
+ const highlightLine = errorLine.text?.slice(loc.column) ?? "";
525
+ for (let i = 0; i < highlightLine.length; i++) {
526
+ if (charBreak.has(highlightLine.charAt(i))) break;
527
+ errorLine.errorLength++;
528
+ }
529
+ diagnostic.lines.push(errorLine);
530
+ if (errorLine.errorLength === 0 && errorLine.errorCharStart > 0) {
531
+ errorLine.errorLength = 1;
532
+ errorLine.errorCharStart--;
533
+ }
534
+ if (errorLine.lineIndex > 0) {
535
+ const previousLine = {
536
+ lineIndex: errorLine.lineIndex - 1,
537
+ lineNumber: errorLine.lineNumber - 1,
538
+ text: srcLines[errorLine.lineIndex - 1],
539
+ errorCharStart: -1,
540
+ errorLength: -1
541
+ };
542
+ diagnostic.lines.unshift(previousLine);
543
+ }
544
+ if (errorLine.lineIndex + 1 < srcLines.length) {
545
+ const nextLine = {
546
+ lineIndex: errorLine.lineIndex + 1,
547
+ lineNumber: errorLine.lineNumber + 1,
548
+ text: srcLines[errorLine.lineIndex + 1],
549
+ errorCharStart: -1,
550
+ errorLength: -1
551
+ };
552
+ diagnostic.lines.push(nextLine);
553
+ }
554
+ } catch {
555
+ diagnostic.messageText += `\nError parsing: ${diagnostic.absFilePath}, line: ${loc.line}, column: ${loc.column}`;
556
+ diagnostic.debugText = sourceText;
557
+ }
558
+ } else if (typeof rolldownError.frame === "string") diagnostic.messageText += "\n" + rolldownError.frame;
559
+ } catch {}
560
+ }
561
+ buildCtx.diagnostics.push(diagnostic);
562
+ };
563
+ const createOnWarnFn = (diagnostics, bundleModulesFiles) => {
564
+ const previousWarns = /* @__PURE__ */ new Set();
565
+ return function onWarningMessage(warning) {
566
+ if (warning == null || warning.code && ignoreWarnCodes.has(warning.code) || warning.message && previousWarns.has(warning.message)) return;
567
+ if (warning.message) previousWarns.add(warning.message);
568
+ let label = "";
569
+ if (bundleModulesFiles) {
570
+ label = bundleModulesFiles.reduce((cmps, m) => {
571
+ cmps.push(...m.cmps);
572
+ return cmps;
573
+ }, []).join(", ").trim();
574
+ if (label.length) label += ": ";
575
+ }
576
+ const diagnostic = buildWarn(diagnostics);
577
+ diagnostic.header = `Bundling Warning ${warning.code}`;
578
+ diagnostic.messageText = label + (warning.message || warning);
579
+ };
580
+ };
581
+ const ignoreWarnCodes = new Set([
582
+ "THIS_IS_UNDEFINED",
583
+ "NON_EXISTENT_EXPORT",
584
+ "CIRCULAR_DEPENDENCY",
585
+ "EMPTY_BUNDLE",
586
+ "UNUSED_EXTERNAL_IMPORT"
587
+ ]);
588
+ const charBreak = new Set([
589
+ " ",
590
+ "=",
591
+ ".",
592
+ ",",
593
+ "?",
594
+ ":",
595
+ ";",
596
+ "(",
597
+ ")",
598
+ "{",
599
+ "}",
600
+ "[",
601
+ "]",
602
+ "|",
603
+ `'`,
604
+ `"`,
605
+ "`"
606
+ ]);
607
+ const formatErrorCode = (errorCode) => {
608
+ if (typeof errorCode === "string") return errorCode.split("_").map((c) => {
609
+ return toTitleCase(c.toLowerCase());
610
+ }).join(" ");
611
+ return (errorCode || "").trim();
612
+ };
613
+ //#endregion
614
+ //#region src/utils/path.ts
615
+ /**
616
+ * Convert Windows backslash paths to slash paths: foo\\bar ➔ foo/bar
617
+ * Forward-slash paths can be used in Windows as long as they're not
618
+ * extended-length paths and don't contain any non-ascii characters.
619
+ * This was created since the path methods in Node.js outputs \\ paths on Windows.
620
+ * @param path the Windows-based path to convert
621
+ * @param relativize whether or not a relative path should have `./` prepended
622
+ * @returns the converted path
623
+ */
624
+ const normalizePath = (path, relativize = true) => {
625
+ if (typeof path !== "string") throw new Error(`invalid path to normalize`);
626
+ path = normalizeSlashes(path.trim());
627
+ const reducedComponents = reducePathComponents(pathComponents(path, getRootLength(path)));
628
+ const rootPart = reducedComponents[0];
629
+ const secondPart = reducedComponents[1];
630
+ const normalized = rootPart + reducedComponents.slice(1).join("/");
631
+ if (normalized === "") return ".";
632
+ if (rootPart === "" && secondPart && path.includes("/") && !secondPart.startsWith(".") && !secondPart.startsWith("@") && relativize) return "./" + normalized;
633
+ return normalized;
634
+ };
635
+ const normalizeSlashes = (path) => path.replace(backslashRegExp, "/");
636
+ const altDirectorySeparator = "\\";
637
+ const urlSchemeSeparator = "://";
638
+ const backslashRegExp = /\\/g;
639
+ const reducePathComponents = (components) => {
640
+ if (!Array.isArray(components) || components.length === 0) return [];
641
+ const reduced = [components[0]];
642
+ for (let i = 1; i < components.length; i++) {
643
+ const component = components[i];
644
+ if (!component) continue;
645
+ if (component === ".") continue;
646
+ if (component === "..") {
647
+ if (reduced.length > 1) {
648
+ if (reduced[reduced.length - 1] !== "..") {
649
+ reduced.pop();
650
+ continue;
651
+ }
652
+ } else if (reduced[0]) continue;
653
+ }
654
+ reduced.push(component);
655
+ }
656
+ return reduced;
657
+ };
658
+ const getRootLength = (path) => {
659
+ const rootLength = getEncodedRootLength(path);
660
+ return rootLength < 0 ? ~rootLength : rootLength;
661
+ };
662
+ const getEncodedRootLength = (path) => {
663
+ if (!path) return 0;
664
+ const ch0 = path.charCodeAt(0);
665
+ if (ch0 === 47 || ch0 === 92) {
666
+ if (path.charCodeAt(1) !== ch0) return 1;
667
+ const p1 = path.indexOf(ch0 === 47 ? "/" : altDirectorySeparator, 2);
668
+ if (p1 < 0) return path.length;
669
+ return p1 + 1;
670
+ }
671
+ if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58) {
672
+ const ch2 = path.charCodeAt(2);
673
+ if (ch2 === 47 || ch2 === 92) return 3;
674
+ if (path.length === 2) return 2;
675
+ }
676
+ const schemeEnd = path.indexOf(urlSchemeSeparator);
677
+ if (schemeEnd !== -1) {
678
+ const authorityStart = schemeEnd + 3;
679
+ const authorityEnd = path.indexOf("/", authorityStart);
680
+ if (authorityEnd !== -1) {
681
+ const scheme = path.slice(0, schemeEnd);
682
+ const authority = path.slice(authorityStart, authorityEnd);
683
+ if (scheme === "file" && (authority === "" || authority === "localhost") && isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) {
684
+ const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2);
685
+ if (volumeSeparatorEnd !== -1) {
686
+ if (path.charCodeAt(volumeSeparatorEnd) === 47) return ~(volumeSeparatorEnd + 1);
687
+ if (volumeSeparatorEnd === path.length) return ~volumeSeparatorEnd;
688
+ }
689
+ }
690
+ return ~(authorityEnd + 1);
691
+ }
692
+ return ~path.length;
693
+ }
694
+ return 0;
695
+ };
696
+ const isVolumeCharacter = (charCode) => charCode >= 97 && charCode <= 122 || charCode >= 65 && charCode <= 90;
697
+ const getFileUrlVolumeSeparatorEnd = (url, start) => {
698
+ const ch0 = url.charCodeAt(start);
699
+ if (ch0 === 58) return start + 1;
700
+ if (ch0 === 37 && url.charCodeAt(start + 1) === 51) {
701
+ const ch2 = url.charCodeAt(start + 2);
702
+ if (ch2 === 97 || ch2 === 65) return start + 3;
703
+ }
704
+ return -1;
705
+ };
706
+ const pathComponents = (path, rootLength) => {
707
+ const root = path.substring(0, rootLength);
708
+ const rest = path.substring(rootLength).split("/");
709
+ const restLen = rest.length;
710
+ if (restLen > 0 && !rest[restLen - 1]) rest.pop();
711
+ return [root, ...rest];
712
+ };
713
+ /**
714
+ * Same as normalizePath(), expect it'll also strip any query strings
715
+ * from the path name. So /dir/file.css?tag=cmp-a becomes /dir/file.css
716
+ * @param p the path to normalize
717
+ * @returns the normalized path, sans any query strings
718
+ */
719
+ const normalizeFsPath = (p) => normalizePath(p.split("?")[0].replace(/\0/g, ""));
720
+ const normalizeFsPathQuery = (importPath) => {
721
+ const pathParts = importPath.split("?");
722
+ const filePath = normalizePath(pathParts[0]);
723
+ const filePathParts = filePath.split(".");
724
+ const ext = filePathParts.length > 1 ? filePathParts.pop().toLowerCase() : null;
725
+ const params = pathParts.length > 1 ? new URLSearchParams(pathParts[1]) : null;
726
+ return {
727
+ filePath,
728
+ ext,
729
+ format: params ? params.get("format") : null
730
+ };
731
+ };
732
+ /**
733
+ * A wrapped version of node.js' {@link path.relative} which adds our custom
734
+ * normalization logic. This solves the relative path between `from` and `to`!
735
+ *
736
+ * The calculation of the returned path follows that of Node's logic, with one exception - if the calculated path
737
+ * results in an empty string, a string of length one with a period (`'.'`) is returned.
738
+ *
739
+ * @throws the underlying node.js function can throw if either path is not a
740
+ * string
741
+ * @param from the path where relative resolution starts
742
+ * @param to the destination path
743
+ * @returns the resolved relative path
744
+ */
745
+ function relative$1(from, to) {
746
+ /**
747
+ * When normalizing, we should _not_ attempt to relativize the path returned by the native Node `relative` method.
748
+ * When finding the relative path between `from` and `to`, Node does not prepend './' to a non-zero length calculated
749
+ * path. However, our algorithm does differ from that of Node's, as described in this function's JSDoc when a zero
750
+ * length string is encountered.
751
+ */
752
+ return normalizePath(path.relative(from, to), false);
753
+ }
754
+ /**
755
+ * A wrapped version of node.js' {@link path.join} which adds our custom
756
+ * normalization logic. This joins all the arguments (path fragments) into a
757
+ * single path.
758
+ *
759
+ * The calculation of the returned path follows that of Node's logic, with one exception - any trailing slashes will
760
+ * be removed from the calculated path.
761
+ *
762
+ * @throws the underlying node function will throw if any argument is not a
763
+ * string
764
+ * @param paths the paths to join together
765
+ * @returns a joined path!
766
+ */
767
+ function join$1(...paths) {
768
+ /**
769
+ * When normalizing, we should _not_ attempt to relativize the path returned by the native Node `join` method. When
770
+ * calculating the path from each of the string-based parts, Node does not prepend './' to any calculated path.
771
+ *
772
+ * Note that our algorithm does differ from Node's, as described in this function's JSDoc regarding trailing
773
+ * slashes.
774
+ */
775
+ return normalizePath(path.join(...paths), false);
776
+ }
777
+ /**
778
+ * A wrapped version of node.js' {@link path.resolve} which adds our custom
779
+ * normalization logic. This resolves a path to a given (relative or absolute)
780
+ * path.
781
+ *
782
+ * @throws the underlying node function will throw if any argument is not a
783
+ * string
784
+ * @param paths a path or path fragments to resolve
785
+ * @returns a resolved path!
786
+ */
787
+ function resolve$1(...paths) {
788
+ /**
789
+ * When normalizing, we should _not_ attempt to relativize the path returned by the native Node `resolve` method. When
790
+ * calculating the path from each of the string-based parts, Node does not prepend './' to the calculated path.
791
+ */
792
+ return normalizePath(path.resolve(...paths), false);
793
+ }
794
+ /**
795
+ * A wrapped version of node.js' {@link path.normalize} which adds our custom
796
+ * normalization logic. This normalizes a path, de-duping repeated segment
797
+ * separators and resolving `'..'` segments.
798
+ *
799
+ * @throws the underlying node function will throw if the argument is not a
800
+ * string
801
+ * @param toNormalize a path to normalize
802
+ * @returns a normalized path!
803
+ */
804
+ function normalize(toNormalize) {
805
+ /**
806
+ * When normalizing, we should _not_ attempt to relativize the path returned by the native Node `normalize` method.
807
+ * When calculating the path from each of the string-based parts, Node does not prepend './' to the calculated path.
808
+ */
809
+ return normalizePath(path.normalize(toNormalize), false);
810
+ }
811
+ //#endregion
812
+ //#region src/utils/logger/logger-typescript.ts
813
+ /**
814
+ * Augment a `Diagnostic` with information from a `Node` in the AST to provide richer error information
815
+ * @param d the diagnostic to augment
816
+ * @param node the node to augment with additional information
817
+ * @returns the augmented diagnostic
818
+ */
819
+ const augmentDiagnosticWithNode = (d, node) => {
820
+ if (!node) return d;
821
+ const sourceFile = node.getSourceFile();
822
+ if (!sourceFile) return d;
823
+ d.absFilePath = normalizePath(sourceFile.fileName);
824
+ const sourceText = sourceFile.text;
825
+ const srcLines = splitLineBreaks(sourceText);
826
+ const start = node.getStart();
827
+ const end = node.getEnd();
828
+ const posStart = sourceFile.getLineAndCharacterOfPosition(start);
829
+ const errorLine = {
830
+ lineIndex: posStart.line,
831
+ lineNumber: posStart.line + 1,
832
+ text: srcLines[posStart.line],
833
+ errorCharStart: posStart.character,
834
+ errorLength: Math.max(end - start, 1)
835
+ };
836
+ d.lineNumber = errorLine.lineNumber;
837
+ d.columnNumber = errorLine.errorCharStart + 1;
838
+ d.lines.push(errorLine);
839
+ if (errorLine.errorLength === 0 && errorLine.errorCharStart > 0) {
840
+ errorLine.errorLength = 1;
841
+ errorLine.errorCharStart--;
842
+ }
843
+ if (errorLine.lineIndex > 0) {
844
+ const previousLine = {
845
+ lineIndex: errorLine.lineIndex - 1,
846
+ lineNumber: errorLine.lineNumber - 1,
847
+ text: srcLines[errorLine.lineIndex - 1],
848
+ errorCharStart: -1,
849
+ errorLength: -1
850
+ };
851
+ d.lines.unshift(previousLine);
852
+ }
853
+ if (errorLine.lineIndex + 1 < srcLines.length) {
854
+ const nextLine = {
855
+ lineIndex: errorLine.lineIndex + 1,
856
+ lineNumber: errorLine.lineNumber + 1,
857
+ text: srcLines[errorLine.lineIndex + 1],
858
+ errorCharStart: -1,
859
+ errorLength: -1
860
+ };
861
+ d.lines.push(nextLine);
862
+ }
863
+ return d;
864
+ };
865
+ /**
866
+ * Ok, so formatting overkill, we know. But whatever, it makes for great
867
+ * error reporting within a terminal. So, yeah, let's code it up, shall we?
868
+ */
869
+ /**
870
+ * Convert an array of TypeScript diagnostics to Stencil diagnostic format.
871
+ *
872
+ * @param tsDiagnostics - array of TypeScript diagnostic objects
873
+ * @returns array of Stencil diagnostic objects
874
+ */
875
+ const loadTypeScriptDiagnostics = (tsDiagnostics) => {
876
+ const diagnostics = [];
877
+ const maxErrors = Math.min(tsDiagnostics.length, 50);
878
+ for (let i = 0; i < maxErrors; i++) diagnostics.push(loadTypeScriptDiagnostic(tsDiagnostics[i]));
879
+ return diagnostics;
880
+ };
881
+ /**
882
+ * Convert a TypeScript diagnostic object into our internal, Stencil-specific
883
+ * diagnostic format
884
+ *
885
+ * @param tsDiagnostic a TypeScript diagnostic message record
886
+ * @returns a Stencil diagnostic, suitable for showing an error to the user
887
+ */
888
+ const loadTypeScriptDiagnostic = (tsDiagnostic) => {
889
+ const d = {
890
+ absFilePath: void 0,
891
+ code: tsDiagnostic.code.toString(),
892
+ columnNumber: void 0,
893
+ header: "TypeScript",
894
+ language: "typescript",
895
+ level: "warn",
896
+ lineNumber: void 0,
897
+ lines: [],
898
+ messageText: flattenDiagnosticMessageText(tsDiagnostic, tsDiagnostic.messageText),
899
+ relFilePath: void 0,
900
+ type: "typescript"
901
+ };
902
+ if (tsDiagnostic.category === 1) d.level = "error";
903
+ if (tsDiagnostic.file && typeof tsDiagnostic.start === "number") {
904
+ d.absFilePath = tsDiagnostic.file.fileName;
905
+ const sourceText = tsDiagnostic.file.text;
906
+ const srcLines = splitLineBreaks(sourceText);
907
+ const posData = tsDiagnostic.file.getLineAndCharacterOfPosition(tsDiagnostic.start);
908
+ const errorLine = {
909
+ lineIndex: posData.line,
910
+ lineNumber: posData.line + 1,
911
+ text: srcLines[posData.line],
912
+ errorCharStart: posData.character,
913
+ errorLength: Math.max(tsDiagnostic.length ?? 0, 1)
914
+ };
915
+ d.lineNumber = errorLine.lineNumber;
916
+ d.columnNumber = errorLine.errorCharStart + 1;
917
+ d.lines.push(errorLine);
918
+ if (errorLine.errorLength === 0 && errorLine.errorCharStart > 0) {
919
+ errorLine.errorLength = 1;
920
+ errorLine.errorCharStart--;
921
+ }
922
+ if (errorLine.lineIndex > 0) {
923
+ const previousLine = {
924
+ lineIndex: errorLine.lineIndex - 1,
925
+ lineNumber: errorLine.lineNumber - 1,
926
+ text: srcLines[errorLine.lineIndex - 1],
927
+ errorCharStart: -1,
928
+ errorLength: -1
929
+ };
930
+ d.lines.unshift(previousLine);
931
+ }
932
+ if (errorLine.lineIndex + 1 < srcLines.length) {
933
+ const nextLine = {
934
+ lineIndex: errorLine.lineIndex + 1,
935
+ lineNumber: errorLine.lineNumber + 1,
936
+ text: srcLines[errorLine.lineIndex + 1],
937
+ errorCharStart: -1,
938
+ errorLength: -1
939
+ };
940
+ d.lines.push(nextLine);
941
+ }
942
+ }
943
+ return d;
944
+ };
945
+ /**
946
+ * Flatten a TypeScript diagnostic object into a string which can be easily
947
+ * included in a Stencil diagnostic record.
948
+ *
949
+ * @param tsDiagnostic a TypeScript diagnostic record
950
+ * @param diag a {@link DiagnosticMessageChain} or a string with further info
951
+ * @returns a string with the relevant error message
952
+ */
953
+ const flattenDiagnosticMessageText = (tsDiagnostic, diag) => {
954
+ if (typeof diag === "string") return diag;
955
+ else if (diag === void 0) return "";
956
+ const ignoreCodes = [];
957
+ const isStencilConfig = (tsDiagnostic.file?.fileName ?? "").includes("stencil.config");
958
+ if (isStencilConfig) ignoreCodes.push(2322);
959
+ let result = "";
960
+ if (!ignoreCodes.includes(diag.code)) {
961
+ result = diag.messageText;
962
+ if (isIterable(diag.next)) for (const kid of diag.next) result += flattenDiagnosticMessageText(tsDiagnostic, kid);
963
+ }
964
+ if (isStencilConfig) {
965
+ result = result.replace(`type 'StencilConfig'`, `Stencil Config`);
966
+ result = result.replace(`Object literal may only specify known properties, but `, ``);
967
+ result = result.replace(`Object literal may only specify known properties, and `, ``);
968
+ }
969
+ return result.trim();
970
+ };
971
+ //#endregion
972
+ //#region src/utils/output-target.ts
973
+ /**
974
+ * Checks if a component tag name matches any of the exclude patterns.
975
+ * Supports glob patterns using minimatch.
976
+ *
977
+ * @param tagName The component's tag name to check
978
+ * @param excludePatterns Array of patterns to match against (supports globs)
979
+ * @returns true if the component should be excluded, false otherwise
980
+ */
981
+ const shouldExcludeComponent = (tagName, excludePatterns) => {
982
+ if (!excludePatterns || excludePatterns.length === 0) return false;
983
+ return excludePatterns.some((pattern) => {
984
+ if (isGlob(pattern)) return picomatch.isMatch(tagName, pattern);
985
+ return pattern === tagName;
986
+ });
987
+ };
988
+ /**
989
+ * Filters out components that match the excludeComponents patterns from the config.
990
+ * Only applies filtering to production builds (when devMode is false) - dev builds include all components.
991
+ *
992
+ * @param components Array of component metadata
993
+ * @param config The validated Stencil configuration
994
+ * @returns Object containing filtered components and excluded components
995
+ */
996
+ const filterExcludedComponents = (components, config) => {
997
+ if (config.devMode) return {
998
+ components,
999
+ excludedComponents: []
1000
+ };
1001
+ const excludePatterns = config.excludeComponents;
1002
+ if (!excludePatterns || excludePatterns.length === 0) return {
1003
+ components,
1004
+ excludedComponents: []
1005
+ };
1006
+ const excludedComponents = [];
1007
+ const excludedTags = [];
1008
+ const filtered = components.filter((cmp) => {
1009
+ const shouldExclude = shouldExcludeComponent(cmp.tagName, excludePatterns);
1010
+ if (shouldExclude) {
1011
+ excludedComponents.push(cmp);
1012
+ excludedTags.push(cmp.tagName);
1013
+ config.logger.debug(`Excluding component from build: ${cmp.tagName}`);
1014
+ }
1015
+ return !shouldExclude;
1016
+ });
1017
+ if (excludedTags.length > 0) {
1018
+ const tagList = excludedTags.join(", ");
1019
+ config.logger.info(`Excluding ${excludedTags.length} component${excludedTags.length === 1 ? "" : "s"} from production build: ${tagList}`);
1020
+ }
1021
+ return {
1022
+ components: filtered,
1023
+ excludedComponents
1024
+ };
1025
+ };
1026
+ const relativeImport = (pathFrom, pathTo, ext, addPrefix = true) => {
1027
+ let relativePath = relative(dirname(pathFrom), dirname(pathTo));
1028
+ if (addPrefix) {
1029
+ if (relativePath === "") relativePath = ".";
1030
+ else if (relativePath[0] !== ".") relativePath = "./" + relativePath;
1031
+ }
1032
+ return normalizePath(`${relativePath}/${basename(pathTo, ext)}`);
1033
+ };
1034
+ const getComponentsDtsSrcFilePath = (config) => join$1(config.srcDir, GENERATED_DTS);
1035
+ /**
1036
+ * Helper to get an appropriate file path for `components.d.ts` for an output target.
1037
+ *
1038
+ * @param typesDir the directory where types are generated
1039
+ * @returns a properly-formatted path
1040
+ */
1041
+ const getComponentsDtsTypesFilePath = (typesDir) => join$1(typesDir, GENERATED_DTS);
1042
+ const isOutputTargetLoaderBundle = (o) => o.type === LOADER_BUNDLE;
1043
+ const isOutputTargetStandalone = (o) => o.type === STANDALONE;
1044
+ const isOutputTargetSsr = (o) => o.type === "ssr";
1045
+ const isOutputTargetSsrWasm = (o) => o.type === SSR_WASM;
1046
+ const isOutputTargetCollection = (o) => o.type === COLLECTION;
1047
+ const isOutputTargetTypes = (o) => o.type === TYPES;
1048
+ const isOutputTargetGlobalStyle = (o) => o.type === GLOBAL_STYLE;
1049
+ const isOutputTargetAssets = (o) => o.type === ASSETS;
1050
+ const isOutputTargetCopy = (o) => o.type === COPY;
1051
+ const isOutputTargetDistLazy = (o) => o.type === DIST_LAZY;
1052
+ const isOutputTargetCustom = (o) => o.type === CUSTOM;
1053
+ const isOutputTargetDocs = (o) => o.type === "docs-readme" || o.type === "docs-json" || o.type === "docs-custom" || o.type === "docs-vscode" || o.type === "docs-custom-elements-manifest";
1054
+ const isOutputTargetDocsReadme = (o) => o.type === DOCS_README;
1055
+ const isOutputTargetDocsJson = (o) => o.type === DOCS_JSON;
1056
+ const isOutputTargetDocsCustom = (o) => o.type === DOCS_CUSTOM;
1057
+ const isOutputTargetDocsVscode = (o) => o.type === DOCS_VSCODE;
1058
+ const isOutputTargetDocsCustomElementsManifest = (o) => o.type === DOCS_CUSTOM_ELEMENTS_MANIFEST;
1059
+ const isOutputTargetWww = (o) => o.type === "www";
1060
+ const isOutputTargetStats = (o) => o.type === STATS;
1061
+ /**
1062
+ * Retrieve the Stencil component compiler metadata from a collection of Stencil {@link d.Module}s
1063
+ * @param moduleFiles the collection of `Module`s to retrieve the metadata from
1064
+ * @returns the metadata, lexicographically sorted by the tag names of the components
1065
+ */
1066
+ const getComponentsFromModules = (moduleFiles) => sortBy(flatOne(moduleFiles.map((m) => m.cmps)), (c) => c.tagName);
1067
+ /**
1068
+ * Check whether a given output target is a valid one to be set in a Stencil config
1069
+ *
1070
+ * @param targetType the type which we want to check
1071
+ * @returns whether or not the targetType is a valid, configurable output target.
1072
+ */
1073
+ function isValidConfigOutputTarget(targetType) {
1074
+ return VALID_CONFIG_OUTPUT_TARGETS.includes(targetType);
1075
+ }
1076
+ /**
1077
+ * Filter output targets based on devMode and their skipInDev setting.
1078
+ * In dev mode, targets with `skipInDev: true` are filtered out.
1079
+ * In prod mode, all targets are included.
1080
+ *
1081
+ * @param targets Array of output targets to filter
1082
+ * @param devMode Whether we're in dev mode
1083
+ * @returns Filtered array of active targets
1084
+ */
1085
+ const filterActiveTargets = (targets, devMode) => {
1086
+ if (!devMode) return targets;
1087
+ return targets.filter((t) => !t.skipInDev);
1088
+ };
1089
+ //#endregion
1090
+ //#region src/utils/result.ts
1091
+ var result_exports = /* @__PURE__ */ __exportAll({
1092
+ err: () => err,
1093
+ map: () => map,
1094
+ ok: () => ok,
1095
+ unwrap: () => unwrap,
1096
+ unwrapErr: () => unwrapErr
1097
+ });
1098
+ /**
1099
+ * Create an `Ok` given a value. This doesn't do any checking that the value is
1100
+ * 'ok-ish' since doing so would make an undue assumption about what is 'ok'.
1101
+ * Instead, this trusts the user to determine, at the call site, whether
1102
+ * something is `ok()` or `err()`.
1103
+ *
1104
+ * @param value the value to wrap up in an `Ok`
1105
+ * @returns an Ok wrapping the value
1106
+ */
1107
+ const ok = (value) => ({
1108
+ isOk: true,
1109
+ isErr: false,
1110
+ value
1111
+ });
1112
+ /**
1113
+ * Create an `Err` given a value.
1114
+ *
1115
+ * @param value the value to wrap up in an `Err`
1116
+ * @returns an Ok wrapping the value
1117
+ */
1118
+ const err = (value) => ({
1119
+ isOk: false,
1120
+ isErr: true,
1121
+ value
1122
+ });
1123
+ function map(result, fn) {
1124
+ if (result.isOk) {
1125
+ const val = fn(result.value);
1126
+ if (val instanceof Promise) return val.then((newVal) => ok(newVal));
1127
+ else return ok(val);
1128
+ }
1129
+ if (result.isErr) {
1130
+ const value = result.value;
1131
+ return err(value);
1132
+ }
1133
+ throw "should never get here";
1134
+ }
1135
+ /**
1136
+ * Unwrap a {@link Result}, return the value inside if it is an `Ok` and
1137
+ * throw with the wrapped value if it is an `Err`.
1138
+ *
1139
+ * @throws with the wrapped value if it is an `Err`.
1140
+ * @param result a result to peer inside of
1141
+ * @returns the wrapped value, if `Ok`
1142
+ */
1143
+ const unwrap = (result) => {
1144
+ if (result.isOk) return result.value;
1145
+ else throw result.value;
1146
+ };
1147
+ /**
1148
+ * Unwrap a {@link Result}, return the value inside if it is an `Err` and
1149
+ * throw with the wrapped value if it is an `Ok`.
1150
+ *
1151
+ * @throws with the wrapped value if it is an `Ok`.
1152
+ * @param result a result to peer inside of
1153
+ * @returns the wrapped value, if `Err`
1154
+ */
1155
+ const unwrapErr = (result) => {
1156
+ if (result.isErr) return result.value;
1157
+ else throw result.value;
1158
+ };
1159
+ //#endregion
1160
+ //#region src/utils/sourcemaps.ts
1161
+ function rolldownToStencilSourceMap(rolldownSourceMap) {
1162
+ if (!rolldownSourceMap || !rolldownSourceMap.file) return null;
1163
+ return {
1164
+ file: rolldownSourceMap.file,
1165
+ mappings: rolldownSourceMap.mappings,
1166
+ names: rolldownSourceMap.names,
1167
+ sources: rolldownSourceMap.sources,
1168
+ sourcesContent: rolldownSourceMap.sourcesContent,
1169
+ version: rolldownSourceMap.version
1170
+ };
1171
+ }
1172
+ /**
1173
+ * A JavaScript formatted string used to link generated code back to the original. This string follows the guidelines
1174
+ * found in the [Linking generated code to source maps](https://sourcemaps.info/spec.html#h.lmz475t4mvbx) section of
1175
+ * the Sourcemaps V3 specification proposal.
1176
+ */
1177
+ const JS_SOURCE_MAPPING_URL_LINKER = "//# sourceMappingURL=";
1178
+ /**
1179
+ * Generates an RFC-3986 compliant string for the given input.
1180
+ * More information about RFC-3986 can be found [here](https://datatracker.ietf.org/doc/html/rfc3986)
1181
+ * This function's original source is derived from
1182
+ * [MDN's encodeURIComponent documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent#description)
1183
+ * @param filename the filename to encode
1184
+ * @returns the encoded URI
1185
+ */
1186
+ const encodeToRfc3986 = (filename) => {
1187
+ return encodeURIComponent(filename).replace(/[!'()*]/g, (matchedCharacter) => {
1188
+ return "%" + matchedCharacter.charCodeAt(0).toString(16);
1189
+ });
1190
+ };
1191
+ /**
1192
+ * Generates a string used to link generated code with the original source, to be placed at the end of the generated
1193
+ * code.
1194
+ * @param url the url of the source map
1195
+ * @returns a linker string, of the format {@link JS_SOURCE_MAPPING_URL_LINKER}=<url>
1196
+ */
1197
+ const getSourceMappingUrlLinker = (url) => {
1198
+ return `${JS_SOURCE_MAPPING_URL_LINKER}${encodeToRfc3986(url)}`;
1199
+ };
1200
+ /**
1201
+ * Generates a string used to link generated code with the original source, to be placed at the end of the generated
1202
+ * code as an inline source map.
1203
+ * @param sourceMapContents the sourceMapContents of the source map
1204
+ * @returns a linker string, of the format {@link JS_SOURCE_MAPPING_URL_LINKER}<dataUriPrefixAndMime><sourceMapContents>
1205
+ */
1206
+ const getInlineSourceMappingUrlLinker = (sourceMapContents) => {
1207
+ return `${JS_SOURCE_MAPPING_URL_LINKER}data:application/json;charset=utf-8;base64,${Buffer.from(sourceMapContents, "utf8").toString("base64")}`;
1208
+ };
1209
+ /**
1210
+ * Generates a string used to link generated code with the original source, to be placed at the end of the generated
1211
+ * code. This function prepends a newline to the string.
1212
+ * @param url the url of the source map
1213
+ * @returns a linker string, of the format {@link JS_SOURCE_MAPPING_URL_LINKER}=<url>.map, prepended with a newline
1214
+ */
1215
+ const getSourceMappingUrlForEndOfFile = (url) => {
1216
+ return `\n${getSourceMappingUrlLinker(url)}.map`;
1217
+ };
1218
+ //#endregion
1219
+ //#region src/utils/url-paths.ts
1220
+ /**
1221
+ * Determines whether a string should be considered a remote url or not.
1222
+ *
1223
+ * This helper only checks the provided string to evaluate is one of a few pre-defined schemes, and should not be
1224
+ * considered all-encompassing
1225
+ *
1226
+ * @param p the string to evaluate
1227
+ * @returns `true` if the provided string is a remote url, `false` otherwise
1228
+ */
1229
+ const isRemoteUrl = (p) => {
1230
+ if (isString(p)) {
1231
+ p = p.toLowerCase();
1232
+ return p.startsWith("https://") || p.startsWith("http://");
1233
+ }
1234
+ return false;
1235
+ };
1236
+ //#endregion
1237
+ //#region src/utils/util.ts
1238
+ /**
1239
+ * A set of JSDoc tags which should be excluded from JSDoc comments
1240
+ * included in output typedefs.
1241
+ */
1242
+ const SUPPRESSED_JSDOC_TAGS = [
1243
+ "virtualProp",
1244
+ "slot",
1245
+ "part",
1246
+ "internal"
1247
+ ];
1248
+ const LINE_BREAK_REGEX = /\r?\n|\r/g;
1249
+ /**
1250
+ * Create a stylistically-appropriate JS variable name from a filename
1251
+ *
1252
+ * If the filename has any of the special characters "?", "#", "&" and "=" it
1253
+ * will take the string before the left-most instance of one of those
1254
+ * characters.
1255
+ *
1256
+ * @param fileName the filename which serves as starting material
1257
+ * @returns a JS variable name based on the filename
1258
+ */
1259
+ const createJsVarName = (fileName) => {
1260
+ if (isString(fileName)) {
1261
+ fileName = fileName.split("?")[0];
1262
+ fileName = fileName.split("#")[0];
1263
+ fileName = fileName.split("&")[0];
1264
+ fileName = fileName.split("=")[0];
1265
+ fileName = toDashCase(fileName);
1266
+ fileName = fileName.replace(/[|;$%@"<>()+,.{}_!/\\]/g, "-");
1267
+ fileName = dashToPascalCase(fileName);
1268
+ if (fileName.length > 1) fileName = fileName[0].toLowerCase() + fileName.slice(1);
1269
+ else fileName = fileName.toLowerCase();
1270
+ if (fileName.length > 0 && !isNaN(fileName[0])) fileName = "_" + fileName;
1271
+ }
1272
+ return fileName;
1273
+ };
1274
+ /**
1275
+ * Create a function that lowercases the first string parameter before passing it to the provided function
1276
+ * @param fn the function to pass the lowercased path to
1277
+ * @returns the result of the provided function
1278
+ */
1279
+ const lowerPathParam = (fn) => (p) => fn(p.toLowerCase());
1280
+ /**
1281
+ * Determine if a stringified file path is a TypeScript declaration file based on the extension at the end of the path.
1282
+ * @param p the path to evaluate
1283
+ * @returns `true` if the path ends in `.d.ts` (case-sensitive), `false` otherwise.
1284
+ */
1285
+ const isDtsFile = lowerPathParam((p) => p.endsWith(".d.ts") || p.endsWith(".d.mts") || p.endsWith(".d.cts"));
1286
+ /**
1287
+ * Determine if a stringified file path is a TypeScript file based on the extension at the end of the path. This
1288
+ * function does _not_ consider type declaration files (`.d.ts` files) to be TypeScript files.
1289
+ * @param p the path to evaluate
1290
+ * @returns `true` if the path ends in `.ts` (case-sensitive) but does _not_ end in `.d.ts`, `false` otherwise.
1291
+ */
1292
+ const isTsFile = lowerPathParam((p) => !isDtsFile(p) && (p.endsWith(".ts") || p.endsWith(".mts") || p.endsWith(".cts")));
1293
+ /**
1294
+ * Determine if a stringified file path is a TSX file based on the extension at the end of the path
1295
+ * @param p the path to evaluate
1296
+ * @returns `true` if the path ends in `.tsx` (case-sensitive), `false` otherwise.
1297
+ */
1298
+ const isTsxFile = lowerPathParam((p) => p.endsWith(".tsx") || p.endsWith(".mtsx") || p.endsWith(".ctsx"));
1299
+ /**
1300
+ * Determine if a stringified file path is a JSX file based on the extension at the end of the path
1301
+ * @param p the path to evaluate
1302
+ * @returns `true` if the path ends in `.jsx` (case-sensitive), `false` otherwise.
1303
+ */
1304
+ const isJsxFile = lowerPathParam((p) => p.endsWith(".jsx") || p.endsWith(".mjsx") || p.endsWith(".cjsx"));
1305
+ /**
1306
+ * Determine if a stringified file path is a JavaScript file based on the extension at the end of the path
1307
+ * @param p the path to evaluate
1308
+ * @returns `true` if the path ends in `.js` (case-sensitive), `false` otherwise.
1309
+ */
1310
+ const isJsFile = lowerPathParam((p) => p.endsWith(".js") || p.endsWith(".mjs") || p.endsWith(".cjs"));
1311
+ /**
1312
+ * Generate the preamble to be placed atop the main file of the build
1313
+ * @param config the Stencil configuration file
1314
+ * @returns the generated preamble
1315
+ */
1316
+ const generatePreamble = (config) => {
1317
+ const { preamble } = config;
1318
+ if (!preamble) return "";
1319
+ const preambleComment = preamble.split("\n").map((l) => ` * ${l}`);
1320
+ preambleComment.unshift(`/*!`);
1321
+ preambleComment.push(` */`);
1322
+ return preambleComment.join("\n");
1323
+ };
1324
+ function getTextDocs(docs) {
1325
+ if (docs == null) return "";
1326
+ return [escapeWithPattern(docs.text.replace(LINE_BREAK_REGEX, " "), /\*\//, "*\\/", true), ...docs.tags.filter((tag) => tag.name !== "internal").map((tag) => {
1327
+ const tagText = escapeWithPattern((tag.text || "").replace(LINE_BREAK_REGEX, " "), /\*\//, "*\\/", true);
1328
+ return `@${tag.name} ${tagText}`;
1329
+ })].join("\n").trim();
1330
+ }
1331
+ /**
1332
+ * Adds a doc block to a string
1333
+ * @param str the string to add a doc block to
1334
+ * @param docs the compiled JS docs
1335
+ * @param indentation number of spaces to indent the block with
1336
+ * @returns the doc block
1337
+ */
1338
+ function addDocBlock(str, docs, indentation = 0) {
1339
+ if (!docs) return str;
1340
+ return [formatDocBlock(docs, indentation), str].filter(Boolean).join(`\n`);
1341
+ }
1342
+ /**
1343
+ * Formats the given compiled docs to a JavaScript doc block
1344
+ * @param docs the compiled JS docs
1345
+ * @param indentation number of spaces to indent the block with
1346
+ * @returns the formatted doc block
1347
+ */
1348
+ function formatDocBlock(docs, indentation = 0) {
1349
+ const textDocs = getDocBlockLines(docs);
1350
+ if (!textDocs.filter(Boolean).length) return "";
1351
+ const spaces = new Array(indentation + 1).join(" ");
1352
+ return [
1353
+ spaces + "/**",
1354
+ ...textDocs.map((line) => spaces + ` * ${line}`),
1355
+ spaces + " */"
1356
+ ].join(`\n`);
1357
+ }
1358
+ /**
1359
+ * Get all lines which are part of the doc block
1360
+ *
1361
+ * @param docs the compiled JS docs
1362
+ * @returns list of lines part of the doc block
1363
+ */
1364
+ function getDocBlockLines(docs) {
1365
+ return [...docs.text.split(LINE_BREAK_REGEX), ...docs.tags.filter((tag) => !SUPPRESSED_JSDOC_TAGS.includes(tag.name)).map((tag) => `@${tag.name} ${tag.text || ""}`.split(LINE_BREAK_REGEX))].flat().filter(Boolean);
1366
+ }
1367
+ /**
1368
+ * Retrieve a project's dependencies from the current build context
1369
+ * @param buildCtx the current build context to query for a specific package
1370
+ * @returns a list of package names the project is dependent on
1371
+ */
1372
+ const getDependencies = (buildCtx) => Object.keys(buildCtx?.packageJson?.dependencies ?? {}).filter((pkgName) => !SKIP_DEPS.includes(pkgName));
1373
+ /**
1374
+ * Utility to determine whether a project has a dependency on a package
1375
+ * @param buildCtx the current build context to query for a specific package
1376
+ * @param depName the name of the dependency/package
1377
+ * @returns `true` if the project has a dependency a packaged with the provided name, `false` otherwise
1378
+ */
1379
+ const hasDependency = (buildCtx, depName) => {
1380
+ return getDependencies(buildCtx).includes(depName);
1381
+ };
1382
+ const readPackageJson = async (config, compilerCtx, buildCtx) => {
1383
+ try {
1384
+ const pkgJson = await compilerCtx.fs.readFile(config.packageJsonFilePath);
1385
+ if (pkgJson) {
1386
+ const parseResults = parsePackageJson(pkgJson, config.packageJsonFilePath);
1387
+ if (parseResults.diagnostic) buildCtx.diagnostics.push(parseResults.diagnostic);
1388
+ else buildCtx.packageJson = parseResults.data;
1389
+ }
1390
+ } catch {
1391
+ if (!config.outputTargets.some((o) => o.type.includes("dist"))) {
1392
+ const diagnostic = buildError(buildCtx.diagnostics);
1393
+ diagnostic.header = `Missing "package.json"`;
1394
+ diagnostic.messageText = `Valid "package.json" file is required for distribution: ${config.packageJsonFilePath}`;
1395
+ }
1396
+ }
1397
+ };
1398
+ /**
1399
+ * Parse a string read from a `package.json` file
1400
+ * @param pkgJsonStr the string read from a `package.json` file
1401
+ * @param pkgJsonFilePath the path to the already read `package.json` file
1402
+ * @returns the results of parsing the provided contents of the `package.json` file
1403
+ */
1404
+ const parsePackageJson = (pkgJsonStr, pkgJsonFilePath) => {
1405
+ const parseResult = {
1406
+ diagnostic: null,
1407
+ data: null,
1408
+ filePath: pkgJsonFilePath
1409
+ };
1410
+ try {
1411
+ parseResult.data = JSON.parse(pkgJsonStr);
1412
+ } catch (e) {
1413
+ parseResult.diagnostic = buildError();
1414
+ parseResult.diagnostic.absFilePath = isString(pkgJsonFilePath) ? pkgJsonFilePath : void 0;
1415
+ parseResult.diagnostic.header = `Error Parsing JSON`;
1416
+ if (e instanceof Error) parseResult.diagnostic.messageText = e.message;
1417
+ }
1418
+ return parseResult;
1419
+ };
1420
+ const SKIP_DEPS = ["@stencil/core"];
1421
+ /**
1422
+ * Check whether a string is a member of a ReadonlyArray<string>
1423
+ *
1424
+ * We need a little helper for this because unfortunately `includes` is typed
1425
+ * on `ReadonlyArray<T>` as `(el: T): boolean` so a `string` cannot be passed
1426
+ * to `includes` on a `ReadonlyArray` 😢 thus we have a little helper function
1427
+ * where we do the type coercion just once.
1428
+ *
1429
+ * see microsoft/TypeScript#31018 for some discussion of this
1430
+ *
1431
+ * @param readOnlyArray the array we're checking
1432
+ * @param maybeMember a value which is possibly a member of the array
1433
+ * @returns whether the array contains the member or not
1434
+ */
1435
+ const readOnlyArrayHasStringMember = (readOnlyArray, maybeMember) => readOnlyArray.includes(maybeMember);
1436
+ //#endregion
1437
+ //#region src/utils/validation.ts
1438
+ /**
1439
+ * Validates that a component tag meets required naming conventions to be used for a web component
1440
+ * @param tag the tag to validate
1441
+ * @returns an error message if the tag has an invalid name, undefined if the tag name passes all checks
1442
+ */
1443
+ const validateComponentTag = (tag) => {
1444
+ if (typeof tag !== "string") return `Tag "${tag}" must be a string type`;
1445
+ if (tag !== tag.trim()) return `Tag can not contain white spaces`;
1446
+ if (tag !== tag.toLowerCase()) return `Tag can not contain upper case characters`;
1447
+ if (tag.length === 0) return `Received empty tag value`;
1448
+ if (tag.indexOf(" ") > -1) return `"${tag}" tag cannot contain a space`;
1449
+ if (tag.indexOf(",") > -1) return `"${tag}" tag cannot be used for multiple tags`;
1450
+ const invalidChars = tag.replace(/\w|-/g, "");
1451
+ if (invalidChars !== "") return `"${tag}" tag contains invalid characters: ${invalidChars}`;
1452
+ if (tag.indexOf("-") === -1) return `"${tag}" tag must contain a dash (-) to work as a valid web component`;
1453
+ if (tag.indexOf("--") > -1) return `"${tag}" tag cannot contain multiple dashes (--) next to each other`;
1454
+ if (tag.indexOf("-") === 0) return `"${tag}" tag cannot start with a dash (-)`;
1455
+ if (tag.lastIndexOf("-") === tag.length - 1) return `"${tag}" tag cannot end with a dash (-)`;
1456
+ };
1457
+ //#endregion
1458
+ export { loadTypeScriptDiagnostics as $, isOutputTargetCollection as A, isOutputTargetGlobalStyle as B, result_exports as C, formatComponentRuntimeMeta as Ct, getComponentsDtsTypesFilePath as D, getComponentsDtsSrcFilePath as E, byteSize as Et, isOutputTargetDocsCustom as F, isOutputTargetStats as G, isOutputTargetSsr as H, isOutputTargetDocsCustomElementsManifest as I, isValidConfigOutputTarget as J, isOutputTargetTypes as K, isOutputTargetDocsJson as L, isOutputTargetCustom as M, isOutputTargetDistLazy as N, getComponentsFromModules as O, isOutputTargetDocs as P, loadTypeScriptDiagnostic as Q, isOutputTargetDocsReadme as R, ok as S, isGlob as St, filterExcludedComponents as T, stringifyRuntimeData as Tt, isOutputTargetSsrWasm as U, isOutputTargetLoaderBundle as V, isOutputTargetStandalone as W, shouldExcludeComponent as X, relativeImport as Y, augmentDiagnosticWithNode as Z, getSourceMappingUrlForEndOfFile as _, catchError as _t, getTextDocs as a, relative$1 as at, err as b, shouldIgnoreError as bt, isJsFile as c, isRolldownError as ct, isTsxFile as d, normalizeDiagnostics as dt, join$1 as et, parsePackageJson as f, splitLineBreaks as ft, getInlineSourceMappingUrlLinker as g, buildWarn as gt, isRemoteUrl as h, buildJsonFileError as ht, generatePreamble as i, normalizePath as it, isOutputTargetCopy as j, isOutputTargetAssets as k, isJsxFile as l, loadRolldownDiagnostics as lt, readPackageJson as m, buildError as mt, addDocBlock as n, normalizeFsPath as nt, hasDependency as o, resolve$1 as ot, readOnlyArrayHasStringMember as p, TASK_CANCELED_MSG as pt, isOutputTargetWww as q, createJsVarName as r, normalizeFsPathQuery as rt, isDtsFile as s, createOnWarnFn as st, validateComponentTag as t, normalize as tt, isTsFile as u, escapeHtml as ut, getSourceMappingUrlLinker as v, hasError as vt, filterActiveTargets as w, formatLazyBundleRuntimeMeta as wt, map as x, isRootPath as xt, rolldownToStencilSourceMap as y, hasWarning as yt, isOutputTargetDocsVscode as z };