@stencil/core 4.43.3 → 5.0.0-alpha.2

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