@stencil/core 4.43.2 → 5.0.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (368) hide show
  1. package/bin/stencil.mjs +2 -0
  2. package/dist/chunk-ClPoSABd.mjs +21 -0
  3. package/dist/client-DR9zhmKG.mjs +4449 -0
  4. package/dist/compiler/index.d.mts +187 -0
  5. package/dist/compiler/index.mjs +9 -0
  6. package/dist/compiler/utils/index.d.mts +3 -0
  7. package/dist/compiler/utils/index.mjs +5 -0
  8. package/dist/declarations/stencil-public-compiler.d.ts +4401 -0
  9. package/dist/declarations/stencil-public-compiler.js +53 -0
  10. package/dist/declarations/stencil-public-runtime.d.ts +1857 -0
  11. package/dist/index-Bxo2jCf6.d.mts +77 -0
  12. package/dist/index-szczUd2l.d.mts +6851 -0
  13. package/{internal/stencil-core/index.d.ts → dist/index.d.mts} +7 -3
  14. package/dist/index.mjs +4 -0
  15. package/dist/mock-doc.d.mts +1 -0
  16. package/dist/mock-doc.mjs +3 -0
  17. package/dist/node-sys-BGURUNOZ.mjs +1954 -0
  18. package/{internal → dist/runtime}/app-data/index.d.ts +11 -7
  19. package/dist/runtime/app-data/index.js +100 -0
  20. package/dist/runtime/app-globals/index.d.ts +5 -0
  21. package/dist/runtime/app-globals/index.js +6 -0
  22. package/dist/runtime/client/index.d.ts +2286 -0
  23. package/dist/runtime/client/index.js +4839 -0
  24. package/dist/runtime/index.d.ts +221 -0
  25. package/dist/runtime/index.js +4819 -0
  26. package/dist/runtime/server/index.d.mts +1277 -0
  27. package/dist/runtime/server/index.mjs +5376 -0
  28. package/dist/runtime/server/runner.d.mts +298 -0
  29. package/dist/runtime/server/runner.mjs +1976 -0
  30. package/dist/serialize-BJvhE9aQ.mjs +775 -0
  31. package/dist/stencil-private-Cgcr414u.d.ts +1893 -0
  32. package/dist/sys/node/index.d.mts +33 -0
  33. package/dist/sys/node/index.mjs +7 -0
  34. package/dist/sys/node/worker.d.mts +1 -0
  35. package/dist/sys/node/worker.mjs +60 -0
  36. package/dist/testing/index.d.mts +207 -0
  37. package/dist/testing/index.mjs +1188 -0
  38. package/dist/transpile-CJQcQEVa.mjs +21854 -0
  39. package/dist/validation-BdcPruW_.mjs +1451 -0
  40. package/package.json +88 -232
  41. package/bin/stencil +0 -57
  42. package/cli/config-flags.d.ts +0 -132
  43. package/cli/index.cjs +0 -5816
  44. package/cli/index.d.ts +0 -19
  45. package/cli/index.js +0 -5809
  46. package/cli/package.json +0 -14
  47. package/compiler/lib.d.ts +0 -22
  48. package/compiler/lib.decorators.d.ts +0 -384
  49. package/compiler/lib.decorators.legacy.d.ts +0 -22
  50. package/compiler/lib.dom.asynciterable.d.ts +0 -41
  51. package/compiler/lib.dom.d.ts +0 -29610
  52. package/compiler/lib.dom.iterable.d.ts +0 -493
  53. package/compiler/lib.es2015.collection.d.ts +0 -147
  54. package/compiler/lib.es2015.core.d.ts +0 -597
  55. package/compiler/lib.es2015.d.ts +0 -28
  56. package/compiler/lib.es2015.generator.d.ts +0 -77
  57. package/compiler/lib.es2015.iterable.d.ts +0 -605
  58. package/compiler/lib.es2015.promise.d.ts +0 -81
  59. package/compiler/lib.es2015.proxy.d.ts +0 -128
  60. package/compiler/lib.es2015.reflect.d.ts +0 -144
  61. package/compiler/lib.es2015.symbol.d.ts +0 -46
  62. package/compiler/lib.es2015.symbol.wellknown.d.ts +0 -326
  63. package/compiler/lib.es2016.array.include.d.ts +0 -116
  64. package/compiler/lib.es2016.d.ts +0 -21
  65. package/compiler/lib.es2016.full.d.ts +0 -23
  66. package/compiler/lib.es2016.intl.d.ts +0 -31
  67. package/compiler/lib.es2017.arraybuffer.d.ts +0 -21
  68. package/compiler/lib.es2017.d.ts +0 -26
  69. package/compiler/lib.es2017.date.d.ts +0 -31
  70. package/compiler/lib.es2017.full.d.ts +0 -23
  71. package/compiler/lib.es2017.intl.d.ts +0 -44
  72. package/compiler/lib.es2017.object.d.ts +0 -49
  73. package/compiler/lib.es2017.sharedmemory.d.ts +0 -135
  74. package/compiler/lib.es2017.string.d.ts +0 -45
  75. package/compiler/lib.es2017.typedarrays.d.ts +0 -53
  76. package/compiler/lib.es2018.asyncgenerator.d.ts +0 -77
  77. package/compiler/lib.es2018.asynciterable.d.ts +0 -53
  78. package/compiler/lib.es2018.d.ts +0 -24
  79. package/compiler/lib.es2018.full.d.ts +0 -24
  80. package/compiler/lib.es2018.intl.d.ts +0 -83
  81. package/compiler/lib.es2018.promise.d.ts +0 -30
  82. package/compiler/lib.es2018.regexp.d.ts +0 -37
  83. package/compiler/lib.es2019.array.d.ts +0 -79
  84. package/compiler/lib.es2019.d.ts +0 -24
  85. package/compiler/lib.es2019.full.d.ts +0 -24
  86. package/compiler/lib.es2019.intl.d.ts +0 -23
  87. package/compiler/lib.es2019.object.d.ts +0 -33
  88. package/compiler/lib.es2019.string.d.ts +0 -37
  89. package/compiler/lib.es2019.symbol.d.ts +0 -24
  90. package/compiler/lib.es2020.bigint.d.ts +0 -765
  91. package/compiler/lib.es2020.d.ts +0 -27
  92. package/compiler/lib.es2020.date.d.ts +0 -42
  93. package/compiler/lib.es2020.full.d.ts +0 -24
  94. package/compiler/lib.es2020.intl.d.ts +0 -474
  95. package/compiler/lib.es2020.number.d.ts +0 -28
  96. package/compiler/lib.es2020.promise.d.ts +0 -47
  97. package/compiler/lib.es2020.sharedmemory.d.ts +0 -99
  98. package/compiler/lib.es2020.string.d.ts +0 -44
  99. package/compiler/lib.es2020.symbol.wellknown.d.ts +0 -41
  100. package/compiler/lib.es2021.d.ts +0 -23
  101. package/compiler/lib.es2021.full.d.ts +0 -24
  102. package/compiler/lib.es2021.intl.d.ts +0 -166
  103. package/compiler/lib.es2021.promise.d.ts +0 -48
  104. package/compiler/lib.es2021.string.d.ts +0 -33
  105. package/compiler/lib.es2021.weakref.d.ts +0 -78
  106. package/compiler/lib.es2022.array.d.ts +0 -121
  107. package/compiler/lib.es2022.d.ts +0 -25
  108. package/compiler/lib.es2022.error.d.ts +0 -75
  109. package/compiler/lib.es2022.full.d.ts +0 -24
  110. package/compiler/lib.es2022.intl.d.ts +0 -121
  111. package/compiler/lib.es2022.object.d.ts +0 -26
  112. package/compiler/lib.es2022.regexp.d.ts +0 -39
  113. package/compiler/lib.es2022.string.d.ts +0 -25
  114. package/compiler/lib.es2023.array.d.ts +0 -924
  115. package/compiler/lib.es2023.collection.d.ts +0 -21
  116. package/compiler/lib.es2023.d.ts +0 -22
  117. package/compiler/lib.es2023.full.d.ts +0 -24
  118. package/compiler/lib.es2023.intl.d.ts +0 -56
  119. package/compiler/lib.es2024.arraybuffer.d.ts +0 -65
  120. package/compiler/lib.es2024.collection.d.ts +0 -29
  121. package/compiler/lib.es2024.d.ts +0 -26
  122. package/compiler/lib.es2024.full.d.ts +0 -24
  123. package/compiler/lib.es2024.object.d.ts +0 -29
  124. package/compiler/lib.es2024.promise.d.ts +0 -35
  125. package/compiler/lib.es2024.regexp.d.ts +0 -25
  126. package/compiler/lib.es2024.sharedmemory.d.ts +0 -68
  127. package/compiler/lib.es2024.string.d.ts +0 -29
  128. package/compiler/lib.es5.d.ts +0 -4594
  129. package/compiler/lib.es6.d.ts +0 -23
  130. package/compiler/lib.esnext.array.d.ts +0 -35
  131. package/compiler/lib.esnext.collection.d.ts +0 -96
  132. package/compiler/lib.esnext.d.ts +0 -27
  133. package/compiler/lib.esnext.decorators.d.ts +0 -28
  134. package/compiler/lib.esnext.disposable.d.ts +0 -193
  135. package/compiler/lib.esnext.float16.d.ts +0 -443
  136. package/compiler/lib.esnext.full.d.ts +0 -24
  137. package/compiler/lib.esnext.intl.d.ts +0 -21
  138. package/compiler/lib.esnext.iterator.d.ts +0 -148
  139. package/compiler/lib.esnext.promise.d.ts +0 -34
  140. package/compiler/lib.scripthost.d.ts +0 -322
  141. package/compiler/lib.webworker.asynciterable.d.ts +0 -41
  142. package/compiler/lib.webworker.d.ts +0 -9894
  143. package/compiler/lib.webworker.importscripts.d.ts +0 -23
  144. package/compiler/lib.webworker.iterable.d.ts +0 -287
  145. package/compiler/package.json +0 -8
  146. package/compiler/stencil.d.ts +0 -73
  147. package/compiler/stencil.js +0 -287816
  148. package/compiler/sys/in-memory-fs.d.ts +0 -227
  149. package/compiler/transpile.d.ts +0 -32
  150. package/dev-server/client/app-error.d.ts +0 -20
  151. package/dev-server/client/events.d.ts +0 -6
  152. package/dev-server/client/hmr-components.d.ts +0 -12
  153. package/dev-server/client/hmr-external-styles.d.ts +0 -1
  154. package/dev-server/client/hmr-images.d.ts +0 -1
  155. package/dev-server/client/hmr-inline-styles.d.ts +0 -1
  156. package/dev-server/client/hmr-util.d.ts +0 -39
  157. package/dev-server/client/hmr-window.d.ts +0 -10
  158. package/dev-server/client/index.d.ts +0 -6
  159. package/dev-server/client/index.js +0 -793
  160. package/dev-server/client/logger.d.ts +0 -6
  161. package/dev-server/client/package.json +0 -8
  162. package/dev-server/client/progress.d.ts +0 -3
  163. package/dev-server/client/status.d.ts +0 -4
  164. package/dev-server/client/test/hmr-util.spec.d.ts +0 -1
  165. package/dev-server/client/test/status.spec.d.ts +0 -1
  166. package/dev-server/connector.html +0 -6
  167. package/dev-server/index.d.ts +0 -3
  168. package/dev-server/index.js +0 -247
  169. package/dev-server/package.json +0 -8
  170. package/dev-server/server-process.js +0 -12095
  171. package/dev-server/server-worker-thread.js +0 -39
  172. package/dev-server/static/favicon.ico +0 -0
  173. package/dev-server/templates/directory-index.html +0 -176
  174. package/dev-server/templates/initial-load.html +0 -168
  175. package/dev-server/visualstudio.vbs +0 -82
  176. package/dev-server/xdg-open +0 -1066
  177. package/internal/app-data/index.cjs +0 -119
  178. package/internal/app-data/index.js +0 -92
  179. package/internal/app-data/package.json +0 -15
  180. package/internal/app-globals/index.d.ts +0 -2
  181. package/internal/app-globals/index.js +0 -14
  182. package/internal/app-globals/package.json +0 -14
  183. package/internal/child_process.d.ts +0 -7
  184. package/internal/client/index.js +0 -4736
  185. package/internal/client/package.json +0 -10
  186. package/internal/client/patch-browser.js +0 -45
  187. package/internal/client/polyfills/core-js.js +0 -11
  188. package/internal/client/polyfills/dom.js +0 -79
  189. package/internal/client/polyfills/es5-html-element.js +0 -1
  190. package/internal/client/polyfills/index.js +0 -34
  191. package/internal/client/polyfills/system.js +0 -6
  192. package/internal/client/shadow-css.js +0 -414
  193. package/internal/hydrate/index.js +0 -6671
  194. package/internal/hydrate/package.json +0 -7
  195. package/internal/hydrate/runner.d.ts +0 -287
  196. package/internal/hydrate/runner.js +0 -17950
  197. package/internal/index.d.ts +0 -4
  198. package/internal/index.js +0 -2
  199. package/internal/package.json +0 -9
  200. package/internal/stencil-core/index.cjs +0 -1
  201. package/internal/stencil-core/index.js +0 -18
  202. package/internal/stencil-core/jsx-dev-runtime.cjs +0 -7
  203. package/internal/stencil-core/jsx-dev-runtime.d.ts +0 -41
  204. package/internal/stencil-core/jsx-dev-runtime.js +0 -2
  205. package/internal/stencil-core/jsx-runtime.cjs +0 -8
  206. package/internal/stencil-core/jsx-runtime.d.ts +0 -40
  207. package/internal/stencil-core/jsx-runtime.js +0 -2
  208. package/internal/stencil-private.d.ts +0 -2549
  209. package/internal/stencil-public-compiler.d.ts +0 -2867
  210. package/internal/stencil-public-runtime.d.ts +0 -1860
  211. package/internal/testing/index.js +0 -6528
  212. package/internal/testing/jsx-dev-runtime.d.ts +0 -2
  213. package/internal/testing/jsx-dev-runtime.js +0 -8
  214. package/internal/testing/jsx-runtime.d.ts +0 -2
  215. package/internal/testing/jsx-runtime.js +0 -9
  216. package/internal/testing/package.json +0 -7
  217. package/internal/utils/index.d.ts +0 -1
  218. package/internal/utils/result.d.ts +0 -112
  219. package/mock-doc/index.cjs +0 -10165
  220. package/mock-doc/index.d.ts +0 -1172
  221. package/mock-doc/index.js +0 -10144
  222. package/mock-doc/package.json +0 -15
  223. package/readme.md +0 -94
  224. package/screenshot/compare/assets/favicon.ico +0 -0
  225. package/screenshot/compare/assets/logo.png +0 -0
  226. package/screenshot/compare/build/app.css +0 -1
  227. package/screenshot/compare/build/app.esm.js +0 -1
  228. package/screenshot/compare/build/app.js +0 -33
  229. package/screenshot/compare/build/p-081b0641.js +0 -1
  230. package/screenshot/compare/build/p-227a1e18.entry.js +0 -1
  231. package/screenshot/compare/build/p-2c298727.entry.js +0 -1
  232. package/screenshot/compare/build/p-5479268c.entry.js +0 -1
  233. package/screenshot/compare/build/p-573ec8a4.entry.js +0 -1
  234. package/screenshot/compare/build/p-6ba08604.entry.js +0 -1
  235. package/screenshot/compare/build/p-6bc63295.entry.js +0 -1
  236. package/screenshot/compare/build/p-7a3759fd.entry.js +0 -1
  237. package/screenshot/compare/build/p-7b4e3ba7.js +0 -1
  238. package/screenshot/compare/build/p-988eb362.css +0 -1
  239. package/screenshot/compare/build/p-9b6a9315.js +0 -1
  240. package/screenshot/compare/build/p-b4cc611c.entry.js +0 -1
  241. package/screenshot/compare/build/p-d1bf53f5.entry.js +0 -1
  242. package/screenshot/compare/build/p-e2efe0df.js +0 -1
  243. package/screenshot/compare/build/p-e8ca6d97.entry.js +0 -1
  244. package/screenshot/compare/build/p-ec2f13e0.entry.js +0 -1
  245. package/screenshot/compare/build/p-f0b99977.entry.js +0 -1
  246. package/screenshot/compare/build/p-f4745c2f.entry.js +0 -1
  247. package/screenshot/compare/build/p-fbbae598.js +0 -1
  248. package/screenshot/compare/host.config.json +0 -15
  249. package/screenshot/compare/index.html +0 -1
  250. package/screenshot/compare/manifest.json +0 -13
  251. package/screenshot/connector-base.d.ts +0 -42
  252. package/screenshot/connector-local.d.ts +0 -7
  253. package/screenshot/connector.js +0 -2
  254. package/screenshot/index.d.ts +0 -3
  255. package/screenshot/index.js +0 -2433
  256. package/screenshot/local-connector.js +0 -2
  257. package/screenshot/package.json +0 -15
  258. package/screenshot/pixel-match.d.ts +0 -1
  259. package/screenshot/pixel-match.js +0 -2315
  260. package/screenshot/screenshot-compare.d.ts +0 -20
  261. package/screenshot/screenshot-fs.d.ts +0 -14
  262. package/sys/node/460.node-fetch.js +0 -451
  263. package/sys/node/autoprefixer.js +0 -9
  264. package/sys/node/glob.js +0 -1
  265. package/sys/node/graceful-fs.js +0 -1
  266. package/sys/node/index.d.ts +0 -39
  267. package/sys/node/index.js +0 -64
  268. package/sys/node/node-fetch.js +0 -12
  269. package/sys/node/package.json +0 -8
  270. package/sys/node/prompts.js +0 -1
  271. package/sys/node/worker.js +0 -4
  272. package/testing/index.d.ts +0 -9
  273. package/testing/index.js +0 -13064
  274. package/testing/jest/jest-27-and-under/jest-config.d.ts +0 -16
  275. package/testing/jest/jest-27-and-under/jest-environment.d.ts +0 -2
  276. package/testing/jest/jest-27-and-under/jest-facade.d.ts +0 -155
  277. package/testing/jest/jest-27-and-under/jest-preprocessor.d.ts +0 -59
  278. package/testing/jest/jest-27-and-under/jest-preset.d.ts +0 -3
  279. package/testing/jest/jest-27-and-under/jest-runner.d.ts +0 -11
  280. package/testing/jest/jest-27-and-under/jest-screenshot.d.ts +0 -2
  281. package/testing/jest/jest-27-and-under/jest-serializer.d.ts +0 -4
  282. package/testing/jest/jest-27-and-under/jest-setup-test-framework.d.ts +0 -9
  283. package/testing/jest/jest-27-and-under/matchers/attributes.d.ts +0 -14
  284. package/testing/jest/jest-27-and-under/matchers/class-list.d.ts +0 -12
  285. package/testing/jest/jest-27-and-under/matchers/events.d.ts +0 -25
  286. package/testing/jest/jest-27-and-under/matchers/html.d.ts +0 -13
  287. package/testing/jest/jest-27-and-under/matchers/index.d.ts +0 -24
  288. package/testing/jest/jest-27-and-under/matchers/screenshot.d.ts +0 -5
  289. package/testing/jest/jest-27-and-under/matchers/text.d.ts +0 -4
  290. package/testing/jest/jest-27-and-under/test/jest-config.spec.d.ts +0 -1
  291. package/testing/jest/jest-27-and-under/test/jest-preprocessor.spec.d.ts +0 -1
  292. package/testing/jest/jest-27-and-under/test/jest-runner.spec.d.ts +0 -1
  293. package/testing/jest/jest-27-and-under/test/jest-serializer.spec.d.ts +0 -1
  294. package/testing/jest/jest-27-and-under/test/jest-setup-test-framework.spec.d.ts +0 -1
  295. package/testing/jest/jest-28/jest-config.d.ts +0 -16
  296. package/testing/jest/jest-28/jest-environment.d.ts +0 -2
  297. package/testing/jest/jest-28/jest-facade.d.ts +0 -134
  298. package/testing/jest/jest-28/jest-preprocessor.d.ts +0 -35
  299. package/testing/jest/jest-28/jest-preset.d.ts +0 -3
  300. package/testing/jest/jest-28/jest-runner.d.ts +0 -11
  301. package/testing/jest/jest-28/jest-screenshot.d.ts +0 -2
  302. package/testing/jest/jest-28/jest-serializer.d.ts +0 -4
  303. package/testing/jest/jest-28/jest-setup-test-framework.d.ts +0 -9
  304. package/testing/jest/jest-28/matchers/attributes.d.ts +0 -14
  305. package/testing/jest/jest-28/matchers/class-list.d.ts +0 -12
  306. package/testing/jest/jest-28/matchers/events.d.ts +0 -25
  307. package/testing/jest/jest-28/matchers/html.d.ts +0 -13
  308. package/testing/jest/jest-28/matchers/index.d.ts +0 -24
  309. package/testing/jest/jest-28/matchers/screenshot.d.ts +0 -5
  310. package/testing/jest/jest-28/matchers/text.d.ts +0 -4
  311. package/testing/jest/jest-28/test/jest-config.spec.d.ts +0 -1
  312. package/testing/jest/jest-28/test/jest-preprocessor.spec.d.ts +0 -1
  313. package/testing/jest/jest-28/test/jest-runner.spec.d.ts +0 -1
  314. package/testing/jest/jest-28/test/jest-serializer.spec.d.ts +0 -1
  315. package/testing/jest/jest-28/test/jest-setup-test-framework.spec.d.ts +0 -1
  316. package/testing/jest/jest-29/jest-config.d.ts +0 -16
  317. package/testing/jest/jest-29/jest-environment.d.ts +0 -2
  318. package/testing/jest/jest-29/jest-facade.d.ts +0 -136
  319. package/testing/jest/jest-29/jest-preprocessor.d.ts +0 -35
  320. package/testing/jest/jest-29/jest-preset.d.ts +0 -3
  321. package/testing/jest/jest-29/jest-runner.d.ts +0 -11
  322. package/testing/jest/jest-29/jest-screenshot.d.ts +0 -2
  323. package/testing/jest/jest-29/jest-serializer.d.ts +0 -4
  324. package/testing/jest/jest-29/jest-setup-test-framework.d.ts +0 -9
  325. package/testing/jest/jest-29/matchers/attributes.d.ts +0 -14
  326. package/testing/jest/jest-29/matchers/class-list.d.ts +0 -12
  327. package/testing/jest/jest-29/matchers/events.d.ts +0 -25
  328. package/testing/jest/jest-29/matchers/html.d.ts +0 -13
  329. package/testing/jest/jest-29/matchers/index.d.ts +0 -24
  330. package/testing/jest/jest-29/matchers/screenshot.d.ts +0 -5
  331. package/testing/jest/jest-29/matchers/text.d.ts +0 -4
  332. package/testing/jest/jest-29/test/jest-config.spec.d.ts +0 -1
  333. package/testing/jest/jest-29/test/jest-preprocessor.spec.d.ts +0 -1
  334. package/testing/jest/jest-29/test/jest-runner.spec.d.ts +0 -1
  335. package/testing/jest/jest-29/test/jest-serializer.spec.d.ts +0 -1
  336. package/testing/jest/jest-29/test/jest-setup-test-framework.spec.d.ts +0 -1
  337. package/testing/jest/jest-apis.d.ts +0 -86
  338. package/testing/jest/jest-facade.d.ts +0 -74
  339. package/testing/jest/jest-stencil-connector.d.ts +0 -65
  340. package/testing/jest/test/jest-stencil-connector.spec.d.ts +0 -1
  341. package/testing/jest-environment.js +0 -3
  342. package/testing/jest-preprocessor.js +0 -3
  343. package/testing/jest-preset.js +0 -2
  344. package/testing/jest-runner.js +0 -3
  345. package/testing/jest-setuptestframework.js +0 -3
  346. package/testing/mock-fetch.d.ts +0 -11
  347. package/testing/mocks.d.ts +0 -56
  348. package/testing/package.json +0 -8
  349. package/testing/puppeteer/index.d.ts +0 -2
  350. package/testing/puppeteer/puppeteer-browser.d.ts +0 -6
  351. package/testing/puppeteer/puppeteer-declarations.d.ts +0 -414
  352. package/testing/puppeteer/puppeteer-element.d.ts +0 -67
  353. package/testing/puppeteer/puppeteer-emulate.d.ts +0 -2
  354. package/testing/puppeteer/puppeteer-events.d.ts +0 -21
  355. package/testing/puppeteer/puppeteer-page.d.ts +0 -2
  356. package/testing/puppeteer/puppeteer-screenshot.d.ts +0 -27
  357. package/testing/puppeteer/test/puppeteer-screenshot.spec.d.ts +0 -1
  358. package/testing/reset-build-conditionals.d.ts +0 -12
  359. package/testing/spec-page.d.ts +0 -7
  360. package/testing/test/testing-utils.spec.d.ts +0 -1
  361. package/testing/test-transpile.d.ts +0 -2
  362. package/testing/testing-logger.d.ts +0 -26
  363. package/testing/testing-sys.d.ts +0 -6
  364. package/testing/testing-utils.d.ts +0 -80
  365. package/testing/testing.d.ts +0 -2
  366. /package/{internal → dist/declarations}/stencil-ext-modules.d.ts +0 -0
  367. /package/{internal → dist/declarations}/stencil-public-docs.d.ts +0 -0
  368. /package/{screenshot/compare/build/index.esm.js → dist/declarations/stencil-public-runtime.js} +0 -0
@@ -1,2867 +0,0 @@
1
- import type { ConfigFlags } from '../cli/config-flags';
2
- import type { PrerenderUrlResults, PrintLine } from '../internal';
3
- import type { BuildCtx, CompilerCtx } from './stencil-private';
4
- import type { JsonDocs } from './stencil-public-docs';
5
- import type { ResolutionHandler } from './stencil-public-runtime';
6
- export * from './stencil-public-docs';
7
- /**
8
- * https://stenciljs.com/docs/config/
9
- */
10
- export interface StencilConfig {
11
- /**
12
- * By default, Stencil will attempt to optimize small scripts by inlining them in HTML. Setting
13
- * this flag to `false` will prevent this optimization and keep all scripts separate from HTML.
14
- */
15
- allowInlineScripts?: boolean;
16
- /**
17
- * By setting `autoprefixCss` to `true`, Stencil will use the appropriate config to automatically
18
- * prefix css. For example, developers can write modern and standard css properties, such as
19
- * "transform", and Stencil will automatically add in the prefixed version, such as "-webkit-transform".
20
- * As of Stencil v2, autoprefixing CSS is no longer the default.
21
- * Defaults to `false`
22
- */
23
- autoprefixCss?: boolean | any;
24
- /**
25
- * By default, Stencil will statically analyze the application and generate a component graph of
26
- * how all the components are interconnected.
27
- *
28
- * From the component graph it is able to best decide how components should be grouped
29
- * depending on their usage with one another within the app.
30
- * By doing so it's able to bundle components together in order to reduce network requests.
31
- * However, bundles can be manually generated using the bundles config.
32
- *
33
- * The bundles config is an array of objects that represent how components are grouped together
34
- * in lazy-loaded bundles.
35
- * This config is rarely needed as Stencil handles this automatically behind the scenes.
36
- */
37
- bundles?: ConfigBundle[];
38
- /**
39
- * Stencil will cache build results in order to speed up rebuilds.
40
- * To disable this feature, set enableCache to false.
41
- */
42
- enableCache?: boolean;
43
- /**
44
- * The directory where sub-directories will be created for caching when `enableCache` is set
45
- * `true` or if using Stencil's Screenshot Connector.
46
- *
47
- * @default '.stencil'
48
- *
49
- * @example
50
- *
51
- * A Stencil config like the following:
52
- * ```ts
53
- * export const config = {
54
- * ...,
55
- * enableCache: true,
56
- * cacheDir: '.cache',
57
- * testing: {
58
- * screenshotConnector: 'connector.js'
59
- * }
60
- * }
61
- * ```
62
- *
63
- * Will result in the following file structure:
64
- * ```tree
65
- * stencil-project-root
66
- * └── .cache
67
- * ├── .build <-- Where build related file caching is written
68
- * |
69
- * └── screenshot-cache.json <-- Where screenshot caching is written
70
- * ```
71
- */
72
- cacheDir?: string;
73
- /**
74
- * Stencil is traditionally used to compile many components into an app,
75
- * and each component comes with its own compartmentalized styles.
76
- * However, it's still common to have styles which should be "global" across all components and the website.
77
- * A global CSS file is often useful to set CSS Variables.
78
- *
79
- * Additionally, the globalStyle config can be used to precompile styles with Sass, PostCSS, etc.
80
- * Below is an example folder structure containing a webapp's global sass file, named app.css.
81
- */
82
- globalStyle?: string;
83
- /**
84
- * Will generate {@link https://nodejs.org/api/packages.html#packages_exports export map} entry points
85
- * for each component in the build when `true`.
86
- *
87
- * @default false
88
- */
89
- generateExportMaps?: boolean;
90
- /**
91
- * When the hashFileNames config is set to true, and it is a production build,
92
- * the hashedFileNameLength config is used to determine how many characters the file name's hash should be.
93
- */
94
- hashedFileNameLength?: number;
95
- /**
96
- * During production builds, the content of each generated file is hashed to represent the content,
97
- * and the hashed value is used as the filename. If the content isn't updated between builds,
98
- * then it receives the same filename. When the content is updated, then the filename is different.
99
- *
100
- * By doing this, deployed apps can "forever-cache" the build directory and take full advantage of
101
- * content delivery networks (CDNs) and heavily caching files for faster apps.
102
- */
103
- hashFileNames?: boolean;
104
- /**
105
- * The namespace config is a string representing a namespace for the app.
106
- * For apps that are not meant to be a library of reusable components,
107
- * the default of App is just fine. However, if the app is meant to be consumed
108
- * as a third-party library, such as Ionic, a unique namespace is required.
109
- */
110
- namespace?: string;
111
- /**
112
- * Stencil is able to take an app's source and compile it to numerous targets,
113
- * such as an app to be deployed on an http server, or as a third-party library
114
- * to be distributed on npm. By default, Stencil apps have an output target type of www.
115
- *
116
- * The outputTargets config is an array of objects, with types of www and dist.
117
- */
118
- outputTargets?: OutputTarget[];
119
- /**
120
- * The plugins config can be used to add your own rollup plugins.
121
- * By default, Stencil does not come with Sass or PostCSS support.
122
- * However, either can be added using the plugin array.
123
- */
124
- plugins?: any[];
125
- /**
126
- * Generate js source map files for all bundles.
127
- * Set to `true` to always generate source maps, `false` to never generate source maps.
128
- * Set to `'dev'` to only generate source maps when the `--dev` flag is passed.
129
- * Defaults to `'dev'`.
130
- */
131
- sourceMap?: boolean | 'dev';
132
- /**
133
- * The srcDir config specifies the directory which should contain the source typescript files
134
- * for each component. The standard for Stencil apps is to use src, which is the default.
135
- */
136
- srcDir?: string;
137
- /**
138
- * Sets whether or not Stencil should transform path aliases set in a project's
139
- * `tsconfig.json` from the assigned module aliases to resolved relative paths.
140
- *
141
- * This behavior defaults to `true`, but may be opted-out of by setting this flag to `false`.
142
- */
143
- transformAliasedImportPaths?: boolean;
144
- /**
145
- * When `true`, Stencil will suppress diagnostics which warn about public members using reserved names
146
- * (for example, decorating a method named `focus` with `@Method()`). Defaults to `false`.
147
- */
148
- suppressReservedPublicNameWarnings?: boolean;
149
- /**
150
- * When `true`, we will validate a project's `package.json` based on the output target the user has designated
151
- * as `isPrimaryPackageOutputTarget: true` in their Stencil config.
152
- */
153
- validatePrimaryPackageOutputTarget?: boolean;
154
- /**
155
- * Passes custom configuration down to the "@rollup/plugin-commonjs" that Stencil uses under the hood.
156
- * For further information: https://stenciljs.com/docs/module-bundling
157
- */
158
- commonjs?: BundlingConfig;
159
- /**
160
- * Passes custom configuration down to the "@rollup/plugin-node-resolve" that Stencil uses under the hood.
161
- * For further information: https://stenciljs.com/docs/module-bundling
162
- */
163
- nodeResolve?: NodeResolveConfig;
164
- /**
165
- * Passes custom configuration down to rollup itself, not all rollup options can be overridden.
166
- */
167
- rollupConfig?: RollupConfig;
168
- /**
169
- * Sets if the ES5 build should be generated or not. Stencil generates a modern build without ES5,
170
- * whereas this setting to `true` will also create es5 builds for both dev and prod modes. Setting
171
- * `buildEs5` to `prod` will only build ES5 in prod mode. Basically if the app does not need to run
172
- * on legacy browsers (IE11 and Edge 18 and below), it's safe to not build ES5, which will also speed
173
- * up build times. Defaults to `false`.
174
- */
175
- buildEs5?: boolean | 'prod';
176
- /**
177
- * Sets if the JS browser files are minified or not. Stencil uses `terser` under the hood.
178
- * Defaults to `false` in dev mode and `true` in production mode.
179
- */
180
- minifyJs?: boolean;
181
- /**
182
- * Sets if the CSS is minified or not.
183
- * Defaults to `false` in dev mode and `true` in production mode.
184
- */
185
- minifyCss?: boolean;
186
- /**
187
- * Forces Stencil to run in `dev` mode if the value is `true` and `production` mode
188
- * if it's `false`.
189
- *
190
- * Defaults to `false` (ie. production) unless the `--dev` flag is used in the CLI.
191
- */
192
- devMode?: boolean;
193
- /**
194
- * Object to provide a custom logger. By default a `logger` is already provided for the
195
- * platform the compiler is running on, such as NodeJS or a browser.
196
- */
197
- logger?: Logger;
198
- /**
199
- * Config to add extra runtime for DOM features that require more polyfills. Note
200
- * that not all DOM APIs are fully polyfilled when using the slot polyfill. These
201
- * are opt-in since not all users will require the additional runtime.
202
- */
203
- extras?: ConfigExtras;
204
- /**
205
- * The hydrated flag identifies if a component and all of its child components
206
- * have finished hydrating. This helps prevent any flash of unstyled content (FOUC)
207
- * as various components are asynchronously downloaded and rendered. By default it
208
- * will add the `hydrated` CSS class to the element. The `hydratedFlag` config can be used
209
- * to change the name of the CSS class, change it to an attribute, or change which
210
- * type of CSS properties and values are assigned before and after hydrating. This config
211
- * can also be used to not include the hydrated flag at all by setting it to `null`.
212
- */
213
- hydratedFlag?: HydratedFlag | null;
214
- /**
215
- * Ionic prefers to hide all components prior to hydration with a style tag appended
216
- * to the head of the document containing some `visibility: hidden;` css rules.
217
- *
218
- * Disabling this will remove the style tag that sets `visibility: hidden;` on all
219
- * un-hydrated web components. This more closely follows the HTML spec, and allows
220
- * you to set your own fallback content.
221
- *
222
- */
223
- invisiblePrehydration?: boolean;
224
- /**
225
- * Sets the task queue used by stencil's runtime. The task queue schedules DOM read and writes
226
- * across the frames to efficiently render and reduce layout thrashing. By default,
227
- * `async` is used. It's recommended to also try each setting to decide which works
228
- * best for your use-case. In all cases, if your app has many CPU intensive tasks causing the
229
- * main thread to periodically lock-up, it's always recommended to try
230
- * [Web Workers](https://stenciljs.com/docs/web-workers) for those tasks.
231
- *
232
- * - `async`: DOM read and writes are scheduled in the next frame to prevent layout thrashing.
233
- * During intensive CPU tasks it will not reschedule rendering to happen in the next frame.
234
- * `async` is ideal for most apps, and if the app has many intensive tasks causing the main
235
- * thread to lock-up, it's recommended to try [Web Workers](https://stenciljs.com/docs/web-workers)
236
- * rather than the congestion async queue.
237
- *
238
- * - `congestionAsync`: DOM reads and writes are scheduled in the next frame to prevent layout
239
- * thrashing. When the app is heavily tasked and the queue becomes congested it will then
240
- * split the work across multiple frames to prevent blocking the main thread. However, it can
241
- * also introduce unnecessary reflows in some cases, especially during startup. `congestionAsync`
242
- * is ideal for apps running animations while also simultaneously executing intensive tasks
243
- * which may lock-up the main thread.
244
- *
245
- * - `immediate`: Makes writeTask() and readTask() callbacks to be executed synchronously. Tasks
246
- * are not scheduled to run in the next frame, but do note there is at least one microtask.
247
- * The `immediate` setting is ideal for apps that do not provide long running and smooth
248
- * animations. Like the async setting, if the app has intensive tasks causing the main thread
249
- * to lock-up, it's recommended to try [Web Workers](https://stenciljs.com/docs/web-workers).
250
- */
251
- taskQueue?: 'async' | 'immediate' | 'congestionAsync';
252
- /**
253
- * Provide a object of key/values accessible within the app, using the `Env` object.
254
- */
255
- env?: {
256
- [prop: string]: string | undefined;
257
- };
258
- docs?: StencilDocsConfig;
259
- globalScript?: string;
260
- srcIndexHtml?: string;
261
- testing?: TestingConfig;
262
- maxConcurrentWorkers?: number;
263
- preamble?: string;
264
- rollupPlugins?: {
265
- before?: any[];
266
- after?: any[];
267
- };
268
- entryComponentsHint?: string[];
269
- /**
270
- * Sets whether Stencil will write files to `dist/` during the build or not.
271
- *
272
- * By default this value is set to the opposite value of {@link devMode},
273
- * i.e. it will be `true` when building for production and `false` when
274
- * building for development.
275
- */
276
- buildDist?: boolean;
277
- buildLogFilePath?: string;
278
- devInspector?: boolean;
279
- devServer?: StencilDevServerConfig;
280
- sys?: CompilerSystem;
281
- tsconfig?: string;
282
- validateTypes?: boolean;
283
- /**
284
- * Sets whether Stencil will watch for changes in the source files and rebuild the project automatically.
285
- * @default true
286
- */
287
- watch?: boolean;
288
- /**
289
- * External directories to watch for changes. By default, Stencil will watch the root and {@link StencilConfig.srcDir}
290
- * directory for changes. If you want to watch additional directories, including e.g. `node_modules`, you can add them here.
291
- * @default []
292
- */
293
- watchExternalDirs?: string[];
294
- /**
295
- * An array of RegExp patterns that are matched against all source files before adding
296
- * to the watch list in watch mode. If the file path matches any of the patterns, when it
297
- * is updated, it will not trigger a re-run of tests.
298
- */
299
- watchIgnoredRegex?: RegExp | RegExp[];
300
- /**
301
- * An array of component tag names to exclude from production builds.
302
- * Useful to remove test, demo or experimental components from final output.
303
- *
304
- * **Note:** Exclusion only applies to production builds (default, or when `--prod` is used).
305
- * Development builds (with `--dev` flag) will include all components to support local testing.
306
- *
307
- * Supports glob patterns for matching multiple components:
308
- * - `['demo-*']` - Excludes all components starting with "demo-"
309
- * - `['*-test', '*-demo']` - Excludes components ending with "-test" or "-demo"
310
- * - `['my-component']` - Excludes a specific component
311
- *
312
- * Components matching these patterns will be completely excluded from all output targets.
313
- *
314
- * @example
315
- * ```ts
316
- * export const config: Config = {
317
- * excludeComponents: ['demo-*', 'test-component', '*-internal'],
318
- * };
319
- * ```
320
- *
321
- * @default []
322
- */
323
- excludeComponents?: string[];
324
- /**
325
- * Set whether unused dependencies should be excluded from the built output.
326
- */
327
- excludeUnusedDependencies?: boolean;
328
- stencilCoreResolvedId?: string;
329
- }
330
- interface ConfigExtrasBase {
331
- /**
332
- * Experimental flag. Projects that use a Stencil library built using the `dist` output target may have trouble lazily
333
- * loading components when using a bundler such as Vite or Parcel. Setting this flag to `true` will change how Stencil
334
- * lazily loads components in a way that works with additional bundlers. Setting this flag to `true` will increase
335
- * the size of the compiled output. Defaults to `false`.
336
- * @deprecated This flag has been deprecated in favor of `enableImportInjection`, which provides the same
337
- * functionality. `experimentalImportInjection` will be removed in a future major version of Stencil.
338
- */
339
- experimentalImportInjection?: boolean;
340
- /**
341
- * Projects that use a Stencil library built using the `dist` output target may have trouble lazily
342
- * loading components when using a bundler such as Vite or Parcel. Setting this flag to `true` will change how Stencil
343
- * lazily loads components in a way that works with additional bundlers. Setting this flag to `true` will increase
344
- * the size of the compiled output. Defaults to `false`.
345
- */
346
- enableImportInjection?: boolean;
347
- /**
348
- * Dispatches component lifecycle events. Mainly used for testing. Defaults to `false`.
349
- */
350
- lifecycleDOMEvents?: boolean;
351
- /**
352
- * It is possible to assign data to the actual `<script>` element's `data-opts` property,
353
- * which then gets passed to Stencil's initial bootstrap. This feature is only required
354
- * for very special cases and rarely needed. Defaults to `false`.
355
- * @deprecated This option has been deprecated and will be removed in a future major version of Stencil.
356
- */
357
- scriptDataOpts?: boolean;
358
- /**
359
- * When a component is first attached to the DOM, this setting will wait a single tick before
360
- * rendering. This works around an Angular issue, where Angular attaches the elements before
361
- * settings their initial state, leading to double renders and unnecessary event dispatches.
362
- * Defaults to `false`.
363
- */
364
- initializeNextTick?: boolean;
365
- /**
366
- * Enables the tagNameTransform option of `defineCustomElements()`, so the component tagName
367
- * can be customized at runtime. Defaults to `false`.
368
- * @deprecated This option has been deprecated in favour of `setTagTransformer` and `transformTag`. It will be removed in a future major version of Stencil.
369
- */
370
- tagNameTransform?: boolean;
371
- /**
372
- * Adds `transformTag` calls to css strings and querySelector(All) calls
373
- */
374
- additionalTagTransformers?: boolean | 'prod';
375
- /**
376
- * Experimental flag.
377
- * Updates the behavior of scoped components to align more closely with the behavior of the native
378
- * Shadow DOM when using `slot`s.
379
- * Defaults to `false`.
380
- */
381
- experimentalScopedSlotChanges?: boolean;
382
- /**
383
- * By default Stencil turns the stylesheet provided to `globalStyle` into a constructable stylesheet
384
- * and adds it to each component which can be useful for sharing styles efficiently across components.
385
- * In some cases this can be undesirable:
386
- * - If `globalStyle` is intended to configure the lightDOM only
387
- * - If `globalStyle` is large it can bloat the size of SSR output when using declarative-shadow-dom
388
- * Setting this to `false` will prevent Stencil from adding any `globalStyle` to each component.
389
- *
390
- * Defaults to `true`.
391
- */
392
- addGlobalStyleToComponents?: boolean;
393
- }
394
- type ConfigExtrasSlotFixes<ExperimentalFixesEnabled extends boolean, IndividualFlags extends boolean> = {
395
- /**
396
- * By default, the slot polyfill does not update `appendChild()` so that it appends
397
- * new child nodes into the correct child slot like how shadow dom works. This is an opt-in
398
- * polyfill for those who need it when using `element.appendChild(node)` and expecting the
399
- * child to be appended in the same location shadow dom would. This is not required for
400
- * IE11 or Edge 18, but can be enabled if the app is using `appendChild()`. Defaults to `false`.
401
- */
402
- appendChildSlotFix?: IndividualFlags;
403
- /**
404
- * By default, the runtime does not polyfill `cloneNode()` when cloning a component
405
- * that uses the slot polyfill. This is an opt-in polyfill for those who need it.
406
- * This is not required for IE11 or Edge 18, but can be enabled if the app is using
407
- * `cloneNode()` and unexpected node are being cloned due to the slot polyfill
408
- * simulating shadow dom. Defaults to `false`.
409
- */
410
- cloneNodeFix?: IndividualFlags;
411
- /**
412
- * Experimental flag to align the behavior of invoking `textContent` on a scoped component to act more like a
413
- * component that uses the shadow DOM. Defaults to `false`
414
- */
415
- scopedSlotTextContentFix?: IndividualFlags;
416
- /**
417
- * For browsers that do not support shadow dom (IE11 and Edge 18 and below), slot is polyfilled
418
- * to simulate the same behavior. However, the host element's `childNodes` and `children`
419
- * getters are not patched to only show the child nodes and elements of the default slot.
420
- * Defaults to `false`.
421
- */
422
- slotChildNodesFix?: IndividualFlags;
423
- /**
424
- * Enables all slot-related fixes such as {@link slotChildNodesFix}, and
425
- * {@link scopedSlotTextContentFix}.
426
- */
427
- experimentalSlotFixes?: ExperimentalFixesEnabled;
428
- };
429
- export type ConfigExtras = ConfigExtrasBase & (ConfigExtrasSlotFixes<true, true> | ConfigExtrasSlotFixes<false, boolean>);
430
- export interface Config extends StencilConfig {
431
- buildAppCore?: boolean;
432
- buildDocs?: boolean;
433
- configPath?: string;
434
- writeLog?: boolean;
435
- devServer?: DevServerConfig;
436
- flags?: ConfigFlags;
437
- fsNamespace?: string;
438
- logLevel?: LogLevel;
439
- rootDir?: string;
440
- packageJsonFilePath?: string;
441
- suppressLogs?: boolean;
442
- profile?: boolean;
443
- tsCompilerOptions?: any;
444
- tsWatchOptions?: any;
445
- _isValidated?: boolean;
446
- _isTesting?: boolean;
447
- }
448
- /**
449
- * A 'loose' type useful for wrapping an incomplete / possible malformed
450
- * object as we work on getting it comply with a particular Interface T.
451
- *
452
- * Example:
453
- *
454
- * ```ts
455
- * interface Foo {
456
- * bar: string
457
- * }
458
- *
459
- * function validateFoo(foo: Loose<Foo>): Foo {
460
- * let validatedFoo = {
461
- * ...foo,
462
- * bar: foo.bar || DEFAULT_BAR
463
- * }
464
- *
465
- * return validatedFoo
466
- * }
467
- * ```
468
- *
469
- * Use this when you need to take user input or something from some other part
470
- * of the world that we don't control and transform it into something
471
- * conforming to a given interface. For best results, pair with a validation
472
- * function as shown in the example.
473
- */
474
- type Loose<T extends Object> = Record<string, any> & Partial<T>;
475
- /**
476
- * A Loose version of the Config interface. This is intended to let us load a partial config
477
- * and have type information carry though as we construct an object which is a valid `Config`.
478
- */
479
- export type UnvalidatedConfig = Loose<Config>;
480
- /**
481
- * Helper type to strip optional markers from keys in a type, while preserving other type information for the key.
482
- * This type takes a union of keys, K, in type T to allow for the type T to be gradually updated.
483
- *
484
- * ```typescript
485
- * type Foo { bar?: number, baz?: string }
486
- * type ReqFieldFoo = RequireFields<Foo, 'bar'>; // { bar: number, baz?: string }
487
- * ```
488
- */
489
- type RequireFields<T, K extends keyof T> = T & {
490
- [P in K]-?: T[P];
491
- };
492
- /**
493
- * Fields in {@link Config} to make required for {@link ValidatedConfig}
494
- */
495
- type StrictConfigFields = keyof Pick<Config, 'buildEs5' | 'cacheDir' | 'devMode' | 'devServer' | 'extras' | 'flags' | 'fsNamespace' | 'hashFileNames' | 'hashedFileNameLength' | 'hydratedFlag' | 'logLevel' | 'logger' | 'minifyCss' | 'minifyJs' | 'namespace' | 'outputTargets' | 'packageJsonFilePath' | 'rollupConfig' | 'rootDir' | 'srcDir' | 'srcIndexHtml' | 'sys' | 'testing' | 'transformAliasedImportPaths' | 'validatePrimaryPackageOutputTarget'>;
496
- /**
497
- * A version of {@link Config} that makes certain fields required. This type represents a valid configuration entity.
498
- * When a configuration is received by the user, it is a bag of unverified data. In order to make stricter guarantees
499
- * about the data from a type-safety perspective, this type is intended to be used throughout the codebase once
500
- * validations have occurred at runtime.
501
- */
502
- export type ValidatedConfig = RequireFields<Config, StrictConfigFields> & {
503
- sourceMap: boolean;
504
- };
505
- export interface HydratedFlag {
506
- /**
507
- * Defaults to `hydrated`.
508
- */
509
- name?: string;
510
- /**
511
- * Can be either `class` or `attribute`. Defaults to `class`.
512
- */
513
- selector?: 'class' | 'attribute';
514
- /**
515
- * The CSS property used to show and hide components. Defaults to use the CSS `visibility`
516
- * property. Other commonly used CSS properties would be `display` with the `initialValue`
517
- * setting as `none`, or `opacity` with the `initialValue` as `0`. Defaults to `visibility`
518
- * and the default `initialValue` is `hidden`.
519
- */
520
- property?: string;
521
- /**
522
- * This is the CSS value to give all components before it has been hydrated.
523
- * Defaults to `hidden`.
524
- */
525
- initialValue?: string;
526
- /**
527
- * This is the CSS value to assign once a component has finished hydrating.
528
- * This is the CSS value that'll allow the component to show. Defaults to `inherit`.
529
- */
530
- hydratedValue?: string;
531
- }
532
- export interface StencilDevServerConfig {
533
- /**
534
- * IP address used by the dev server. The default is `0.0.0.0`, which points to all IPv4 addresses
535
- * on the local machine, such as `localhost`.
536
- */
537
- address?: string;
538
- /**
539
- * Base path to be used by the server. Defaults to the root pathname.
540
- */
541
- basePath?: string;
542
- /**
543
- * EXPERIMENTAL!
544
- * During development, node modules can be independently requested and bundled, making for
545
- * faster build times. This is only available using the Stencil Dev Server throughout
546
- * development. Production builds and builds with the `es5` flag will override
547
- * this setting to `false`. Default is `false`.
548
- */
549
- experimentalDevModules?: boolean;
550
- /**
551
- * If the dev server should respond with gzip compressed content. Defaults to `true`.
552
- */
553
- gzip?: boolean;
554
- /**
555
- * When set, the dev server will run via https using the SSL certificate and key you provide
556
- * (use `fs` if you want to read them from files).
557
- */
558
- https?: Credentials;
559
- /**
560
- * The URL the dev server should first open to. Defaults to `/`.
561
- */
562
- initialLoadUrl?: string;
563
- /**
564
- * When `true`, every request to the server will be logged within the terminal.
565
- * Defaults to `false`.
566
- */
567
- logRequests?: boolean;
568
- /**
569
- * By default, when dev server is started the local dev URL is opened in your default browser.
570
- * However, to prevent this URL to be opened change this value to `false`. Defaults to `true`.
571
- */
572
- openBrowser?: boolean;
573
- /**
574
- * Sets the server's port. Defaults to `3333`.
575
- */
576
- port?: number;
577
- /**
578
- * When set to `true`, the dev server will exit with an error if the specified port is already in use.
579
- * When set to `false`, the dev server will automatically try the next available port.
580
- * Defaults to `false`.
581
- */
582
- strictPort?: boolean;
583
- /**
584
- * When files are watched and updated, by default the dev server will use `hmr` (Hot Module Replacement)
585
- * to update the page without a full page refresh. To have the page do a full refresh use `pageReload`.
586
- * To disable any reloading, use `null`. Defaults to `hmr`.
587
- */
588
- reloadStrategy?: PageReloadStrategy;
589
- /**
590
- * Local path to a NodeJs file with a dev server request listener as the default export.
591
- * The user's request listener is given the first chance to handle every request the dev server
592
- * receives, and can choose to handle it or instead pass it on to the default dev server
593
- * by calling `next()`.
594
- *
595
- * Below is an example of a NodeJs file the `requestListenerPath` config is using.
596
- * The request and response arguments are the same as Node's `http` module and `RequestListener`
597
- * callback. https://nodejs.org/api/http.html#http_http_createserver_options_requestlistener
598
- *
599
- * ```js
600
- * module.exports = function (req, res, next) {
601
- * if (req.url === '/ping') {
602
- * // custom response overriding the dev server
603
- * res.setHeader('Content-Type', 'text/plain');
604
- * res.writeHead(200);
605
- * res.end('pong');
606
- * } else {
607
- * // pass request on to the default dev server
608
- * next();
609
- * }
610
- * };
611
- * ```
612
- */
613
- requestListenerPath?: string;
614
- /**
615
- * The root directory to serve the files from.
616
- */
617
- root?: string;
618
- /**
619
- * If the dev server should Server-Side Render (SSR) each page, meaning it'll dynamically generate
620
- * server-side rendered html on each page load. The `--ssr` flag will most commonly be used with
621
- * the`--dev --watch --serve` flags during development. Note that this is for development purposes
622
- * only, and the built-in dev server should not be used for production. Defaults to `false`.
623
- */
624
- ssr?: boolean;
625
- /**
626
- * If the dev server fails to start up within the given timeout (in milliseconds), the startup will
627
- * be canceled. Set to zero to disable the timeout. Defaults to `15000`.
628
- */
629
- startupTimeout?: number;
630
- /**
631
- * Whether to use the dev server's websocket client or not. Defaults to `true`.
632
- */
633
- websocket?: boolean;
634
- /**
635
- * If the dev server should fork a worker for the server process or not. A singled-threaded dev server
636
- * is slower, however it is useful for debugging http requests and responses. Defaults to `true`.
637
- */
638
- worker?: boolean;
639
- }
640
- export interface DevServerConfig extends StencilDevServerConfig {
641
- browserUrl?: string;
642
- devServerDir?: string;
643
- /**
644
- * A list of glob patterns like `subdir/*.js` to exclude from hot-module
645
- * reloading updates.
646
- */
647
- excludeHmr?: string[];
648
- historyApiFallback?: HistoryApiFallback;
649
- openBrowser?: boolean;
650
- prerenderConfig?: string;
651
- protocol?: 'http' | 'https';
652
- srcIndexHtml?: string;
653
- /**
654
- * Route to be used for the "ping" sub-route of the Stencil dev server.
655
- * This route will return a 200 status code once the Stencil build has finished.
656
- * Setting this to `null` will disable the ping route.
657
- *
658
- * Defaults to `/ping`
659
- */
660
- pingRoute?: string | null;
661
- }
662
- export interface HistoryApiFallback {
663
- index?: string;
664
- disableDotRule?: boolean;
665
- }
666
- export interface DevServerEditor {
667
- id: string;
668
- name?: string;
669
- supported?: boolean;
670
- priority?: number;
671
- }
672
- export type TaskCommand = 'build' | 'docs' | 'generate' | 'g' | 'help' | 'info' | 'prerender' | 'serve' | 'telemetry' | 'test' | 'version';
673
- export type PageReloadStrategy = 'hmr' | 'pageReload' | null;
674
- /**
675
- * The prerender config is used when prerendering a `www` output target.
676
- * Within `stencil.config.ts`, set the path to the prerendering
677
- * config file path using the `prerenderConfig` property, such as:
678
- *
679
- * ```tsx
680
- * import { Config } from '@stencil/core';
681
- * export const config: Config = {
682
- * outputTargets: [
683
- * {
684
- * type: 'www',
685
- * baseUrl: 'https://stenciljs.com/',
686
- * prerenderConfig: './prerender.config.ts',
687
- * }
688
- * ]
689
- * };
690
- * ```
691
- *
692
- * The `prerender.config.ts` should export a `config` object using
693
- * the `PrerenderConfig` interface.
694
- *
695
- * ```tsx
696
- * import { PrerenderConfig } from '@stencil/core';
697
- * export const config: PrerenderConfig = {
698
- * ...
699
- * };
700
- * ```
701
- *
702
- * For more info: https://stenciljs.com/docs/static-site-generation
703
- */
704
- export interface PrerenderConfig {
705
- /**
706
- * Run after each `document` is hydrated, but before it is serialized
707
- * into an HTML string. Hook is passed the `document` and its `URL`.
708
- */
709
- afterHydrate?(document: Document, url: URL, results: PrerenderUrlResults): any | Promise<any>;
710
- /**
711
- * Run before each `document` is hydrated. Hook is passed the `document` it's `URL`.
712
- */
713
- beforeHydrate?(document: Document, url: URL): any | Promise<any>;
714
- /**
715
- * Runs after the template Document object has serialize into an
716
- * HTML formatted string. Returns an HTML string to be used as the
717
- * base template for all prerendered pages.
718
- */
719
- afterSerializeTemplate?(html: string): string | Promise<string>;
720
- /**
721
- * Runs before the template Document object is serialize into an
722
- * HTML formatted string. Returns the Document to be serialized which
723
- * will become the base template html for all prerendered pages.
724
- */
725
- beforeSerializeTemplate?(document: Document): Document | Promise<Document>;
726
- /**
727
- * A hook to be used to generate the canonical `<link>` tag
728
- * which goes in the `<head>` of every prerendered page. Returning `null`
729
- * will not add a canonical url tag to the page.
730
- */
731
- canonicalUrl?(url: URL): string | null;
732
- /**
733
- * While prerendering, crawl same-origin URLs found within `<a href>` elements.
734
- * Defaults to `true`.
735
- */
736
- crawlUrls?: boolean;
737
- /**
738
- * URLs to start the prerendering from. By default the root URL of `/` is used.
739
- */
740
- entryUrls?: string[];
741
- /**
742
- * Return `true` the given `<a>` element should be crawled or not.
743
- */
744
- filterAnchor?(attrs: {
745
- [attrName: string]: string;
746
- }, base?: URL): boolean;
747
- /**
748
- * Return `true` if the given URL should be prerendered or not.
749
- */
750
- filterUrl?(url: URL, base: URL): boolean;
751
- /**
752
- * Returns the file path which the prerendered HTML content
753
- * should be written to.
754
- */
755
- filePath?(url: URL, filePath: string): string;
756
- /**
757
- * Returns the hydrate options to use for each individual prerendered page.
758
- */
759
- hydrateOptions?(url: URL): PrerenderHydrateOptions;
760
- /**
761
- * Returns the template file's content. The template is the base
762
- * HTML used for all prerendered pages.
763
- */
764
- loadTemplate?(filePath: string): string | Promise<string>;
765
- /**
766
- * Used to normalize the page's URL from a given a string and the current
767
- * page's base URL. Largely used when reading an anchor's `href` attribute
768
- * value and normalizing it into a `URL`.
769
- */
770
- normalizeUrl?(href: string, base: URL): URL;
771
- robotsTxt?(opts: RobotsTxtOpts): string | RobotsTxtResults;
772
- sitemapXml?(opts: SitemapXmpOpts): string | SitemapXmpResults;
773
- /**
774
- * Static Site Generated (SSG). Does not include Stencil's client-side
775
- * JavaScript, custom elements or preload modules.
776
- */
777
- staticSite?: boolean;
778
- /**
779
- * If the prerendered URLs should have a trailing "/"" or not. Defaults to `false`.
780
- */
781
- trailingSlash?: boolean;
782
- }
783
- export interface HydrateDocumentOptions {
784
- /**
785
- * Build ID that will be added to `<html data-stencil-build="BUILD_ID">`. By default
786
- * a random ID will be generated
787
- */
788
- buildId?: string;
789
- /**
790
- * Sets the `href` attribute on the `<link rel="canonical">`
791
- * tag within the `<head>`. If the value is not defined it will
792
- * ensure a canonical link tag is no included in the `<head>`.
793
- */
794
- canonicalUrl?: string;
795
- /**
796
- * Include the HTML comments and attributes used by the client-side
797
- * JavaScript to read the structure of the HTML and rebuild each
798
- * component. Defaults to `true`.
799
- */
800
- clientHydrateAnnotations?: boolean;
801
- /**
802
- * Constrain `setTimeout()` to 1ms, but still async. Also
803
- * only allows `setInterval()` to fire once, also constrained to 1ms.
804
- * Defaults to `true`.
805
- */
806
- constrainTimeouts?: boolean;
807
- /**
808
- * Sets `document.cookie`
809
- */
810
- cookie?: string;
811
- /**
812
- * Sets the `dir` attribute on the top level `<html>`.
813
- */
814
- direction?: string;
815
- /**
816
- * Component tag names listed here will not be prerendered, nor will
817
- * hydrated on the client-side. Components listed here will be ignored
818
- * as custom elements and treated no differently than a `<div>`.
819
- */
820
- excludeComponents?: string[];
821
- /**
822
- * Sets the `lang` attribute on the top level `<html>`.
823
- */
824
- language?: string;
825
- /**
826
- * Maximum number of components to hydrate on one page. Defaults to `300`.
827
- */
828
- maxHydrateCount?: number;
829
- /**
830
- * Sets `document.referrer`
831
- */
832
- referrer?: string;
833
- /**
834
- * Removes every `<script>` element found in the `document`. Defaults to `false`.
835
- */
836
- removeScripts?: boolean;
837
- /**
838
- * Removes CSS not used by elements within the `document`. Defaults to `true`.
839
- */
840
- removeUnusedStyles?: boolean;
841
- /**
842
- * The url the runtime uses for the resources, such as the assets directory.
843
- */
844
- resourcesUrl?: string;
845
- /**
846
- * Prints out runtime console logs to the NodeJS process. Defaults to `false`.
847
- */
848
- runtimeLogging?: boolean;
849
- /**
850
- * Component tags listed here will only be prerendered or server-side-rendered
851
- * and will not be client-side hydrated. This is useful for components that
852
- * are not dynamic and do not need to be defined as a custom element within the
853
- * browser. For example, a header or footer component would be a good example that
854
- * may not require any client-side JavaScript.
855
- */
856
- staticComponents?: string[];
857
- /**
858
- * The amount of milliseconds to wait for a page to finish rendering until
859
- * a timeout error is thrown. Defaults to `15000`.
860
- */
861
- timeout?: number;
862
- /**
863
- * Sets `document.title`.
864
- */
865
- title?: string;
866
- /**
867
- * Sets `location.href`
868
- */
869
- url?: string;
870
- /**
871
- * Sets `navigator.userAgent`
872
- */
873
- userAgent?: string;
874
- /**
875
- * Configure how Stencil serializes the components shadow root.
876
- * - If set to `declarative-shadow-dom` the component will be rendered within a Declarative Shadow DOM.
877
- * - If set to `scoped` Stencil will render the contents of the shadow root as a `scoped: true` component
878
- * and the shadow DOM will be created during client-side hydration.
879
- * - Alternatively you can mix and match the two by providing an object with `declarative-shadow-dom` and `scoped` keys,
880
- * the value arrays containing the tag names of the components that should be rendered in that mode.
881
- *
882
- * Examples:
883
- * - `{ 'declarative-shadow-dom': ['my-component-1', 'another-component'], default: 'scoped' }`
884
- * Render all components as `scoped` apart from `my-component-1` and `another-component`
885
- * - `{ 'scoped': ['an-option-component'], default: 'declarative-shadow-dom' }`
886
- * Render all components within `declarative-shadow-dom` apart from `an-option-component`
887
- * - `'scoped'` Render all components as `scoped`
888
- * - `false` disables shadow root serialization
889
- *
890
- * *NOTE* `true` has been deprecated in favor of `declarative-shadow-dom` and `scoped`
891
- * @default 'declarative-shadow-dom'
892
- */
893
- serializeShadowRoot?: 'declarative-shadow-dom' | 'scoped' | {
894
- 'declarative-shadow-dom'?: string[];
895
- scoped?: string[];
896
- default: 'declarative-shadow-dom' | 'scoped';
897
- } | boolean;
898
- }
899
- export interface SerializeDocumentOptions extends HydrateDocumentOptions {
900
- /**
901
- * Runs after the `document` has been hydrated.
902
- */
903
- afterHydrate?(document: any): any | Promise<any>;
904
- /**
905
- * Sets an approximate line width the HTML should attempt to stay within.
906
- * Note that this is "approximate", in that HTML may often not be able
907
- * to be split at an exact line width. Additionally, new lines created
908
- * is where HTML naturally already has whitespace, such as before an
909
- * attribute or spaces between words. Defaults to `100`.
910
- */
911
- approximateLineWidth?: number;
912
- /**
913
- * Runs before the `document` has been hydrated.
914
- */
915
- beforeHydrate?(document: any): any | Promise<any>;
916
- /**
917
- * Format the HTML in a nicely indented format.
918
- * Defaults to `false`.
919
- */
920
- prettyHtml?: boolean;
921
- /**
922
- * Remove quotes from attribute values when possible.
923
- * Defaults to `true`.
924
- */
925
- removeAttributeQuotes?: boolean;
926
- /**
927
- * Remove the `=""` from standardized `boolean` attributes,
928
- * such as `hidden` or `checked`. Defaults to `true`.
929
- */
930
- removeBooleanAttributeQuotes?: boolean;
931
- /**
932
- * Remove these standardized attributes when their value is empty:
933
- * `class`, `dir`, `id`, `lang`, and `name`, `title`. Defaults to `true`.
934
- */
935
- removeEmptyAttributes?: boolean;
936
- /**
937
- * Remove HTML comments. Defaults to `true`.
938
- */
939
- removeHtmlComments?: boolean;
940
- /**
941
- * The `fullDocument` flag determines the format of the rendered output. Set it to true to
942
- * generate a complete HTML document, or false to render only the component.
943
- * @default true
944
- */
945
- fullDocument?: boolean;
946
- /**
947
- * Style modes to render the component in.
948
- * @see https://stenciljs.com/docs/styling#style-modes
949
- */
950
- modes?: ResolutionHandler[];
951
- }
952
- export interface HydrateFactoryOptions extends SerializeDocumentOptions {
953
- serializeToHtml: boolean;
954
- destroyWindow: boolean;
955
- destroyDocument: boolean;
956
- }
957
- export interface PrerenderHydrateOptions extends SerializeDocumentOptions {
958
- /**
959
- * Adds `<link rel="modulepreload">` for modules that will eventually be requested.
960
- * Defaults to `true`.
961
- */
962
- addModulePreloads?: boolean;
963
- /**
964
- * Hash the content of assets, such as images, fonts and css files,
965
- * and add the hashed value as `v` querystring. For example,
966
- * `/assets/image.png?v=abcd1234`. This allows for assets to be
967
- * heavily cached by setting the server's response header with
968
- * `Cache-Control: max-age=31536000, immutable`.
969
- */
970
- hashAssets?: 'querystring';
971
- /**
972
- * External stylesheets from `<link rel="stylesheet">` are instead inlined
973
- * into `<style>` elements. Defaults to `false`.
974
- */
975
- inlineExternalStyleSheets?: boolean;
976
- /**
977
- * Minify CSS content within `<style>` elements. Defaults to `true`.
978
- */
979
- minifyStyleElements?: boolean;
980
- /**
981
- * Minify JavaScript content within `<script>` elements. Defaults to `true`.
982
- */
983
- minifyScriptElements?: boolean;
984
- /**
985
- * Entire `document` should be static. This is useful for specific pages that
986
- * should be static, rather than the entire site. If the whole site should be static,
987
- * use the `staticSite` property on the prerender config instead. If only certain
988
- * components should be static then use `staticComponents` instead.
989
- */
990
- staticDocument?: boolean;
991
- }
992
- export interface RobotsTxtOpts {
993
- urls: string[];
994
- sitemapUrl: string;
995
- baseUrl: string;
996
- dir: string;
997
- }
998
- export interface RobotsTxtResults {
999
- content: string;
1000
- filePath: string;
1001
- url: string;
1002
- }
1003
- export interface SitemapXmpOpts {
1004
- urls: string[];
1005
- baseUrl: string;
1006
- dir: string;
1007
- }
1008
- export interface SitemapXmpResults {
1009
- content: string;
1010
- filePath: string;
1011
- url: string;
1012
- }
1013
- /**
1014
- * Common system used by the compiler. All file reads, writes, access, etc. will all use
1015
- * this system. Additionally, throughout each build, the compiler will use an internal
1016
- * in-memory file system as to prevent unnecessary fs reads and writes. At the end of each
1017
- * build all actions the in-memory fs performed will be written to disk using this system.
1018
- * A NodeJS based system will use APIs such as `fs` and `crypto`, and a web-based system
1019
- * will use in-memory Maps and browser APIs. Either way, the compiler itself is unaware
1020
- * of the actual platform it's being ran on top of.
1021
- */
1022
- export interface CompilerSystem {
1023
- name: 'node' | 'in-memory';
1024
- version: string;
1025
- events?: BuildEvents;
1026
- details?: SystemDetails;
1027
- /**
1028
- * Add a callback which will be ran when destroy() is called.
1029
- */
1030
- addDestroy(cb: () => void): void;
1031
- /**
1032
- * Always returns a boolean, does not throw.
1033
- */
1034
- access(p: string): Promise<boolean>;
1035
- /**
1036
- * SYNC! Always returns a boolean, does not throw.
1037
- */
1038
- accessSync(p: string): boolean;
1039
- applyGlobalPatch?(fromDir: string): Promise<void>;
1040
- applyPrerenderGlobalPatch?(opts: {
1041
- devServerHostUrl: string;
1042
- window: any;
1043
- }): void;
1044
- cacheStorage?: CacheStorage;
1045
- checkVersion?: (logger: Logger, currentVersion: string) => Promise<() => void>;
1046
- copy?(copyTasks: Required<CopyTask>[], srcDir: string): Promise<CopyResults>;
1047
- /**
1048
- * Always returns a boolean if the files were copied or not. Does not throw.
1049
- */
1050
- copyFile(src: string, dst: string): Promise<boolean>;
1051
- /**
1052
- * Used to destroy any listeners, file watchers or child processes.
1053
- */
1054
- destroy(): Promise<void>;
1055
- /**
1056
- * Does not throw.
1057
- */
1058
- createDir(p: string, opts?: CompilerSystemCreateDirectoryOptions): Promise<CompilerSystemCreateDirectoryResults>;
1059
- /**
1060
- * SYNC! Does not throw.
1061
- */
1062
- createDirSync(p: string, opts?: CompilerSystemCreateDirectoryOptions): CompilerSystemCreateDirectoryResults;
1063
- homeDir(): string;
1064
- /**
1065
- * Used to determine if the current context of the terminal is TTY.
1066
- */
1067
- isTTY(): boolean;
1068
- /**
1069
- * Each platform has a different way to dynamically import modules.
1070
- */
1071
- dynamicImport?(p: string): Promise<any>;
1072
- /**
1073
- * Creates the worker controller for the current system.
1074
- *
1075
- * @param maxConcurrentWorkers the max number of concurrent workers to
1076
- * support
1077
- * @returns a worker controller appropriate for the current platform (node.js)
1078
- */
1079
- createWorkerController?(maxConcurrentWorkers: number): WorkerMainController;
1080
- encodeToBase64(str: string): string;
1081
- /**
1082
- * @deprecated
1083
- */
1084
- ensureDependencies?(opts: {
1085
- rootDir: string;
1086
- logger: Logger;
1087
- dependencies: CompilerDependency[];
1088
- }): Promise<{
1089
- stencilPath: string;
1090
- diagnostics: Diagnostic[];
1091
- }>;
1092
- /**
1093
- * @deprecated
1094
- */
1095
- ensureResources?(opts: {
1096
- rootDir: string;
1097
- logger: Logger;
1098
- dependencies: CompilerDependency[];
1099
- }): Promise<void>;
1100
- /**
1101
- * process.exit()
1102
- */
1103
- exit(exitCode: number): Promise<void>;
1104
- /**
1105
- * Optionally provide a fetch() function rather than using the built-in fetch().
1106
- * First arg is a url string or Request object (RequestInfo).
1107
- * Second arg is the RequestInit. Returns the Response object
1108
- */
1109
- fetch?(input: string | any, init?: any): Promise<any>;
1110
- /**
1111
- * Generates a sha1 digest encoded as HEX
1112
- */
1113
- generateContentHash?(content: string | any, length?: number): Promise<string>;
1114
- /**
1115
- * Generates a sha1 digest encoded as HEX from a file path
1116
- */
1117
- generateFileHash?(filePath: string | any, length?: number): Promise<string>;
1118
- /**
1119
- * Get the current directory.
1120
- */
1121
- getCurrentDirectory(): string;
1122
- /**
1123
- * The compiler's executing path.
1124
- */
1125
- getCompilerExecutingPath(): string;
1126
- /**
1127
- * The dev server's executing path.
1128
- */
1129
- getDevServerExecutingPath?(): string;
1130
- getEnvironmentVar?(key: string): string;
1131
- /**
1132
- * Gets the absolute file path when for a dependency module.
1133
- */
1134
- getLocalModulePath(opts: {
1135
- rootDir: string;
1136
- moduleId: string;
1137
- path: string;
1138
- }): string;
1139
- /**
1140
- * Gets the full url when requesting a dependency module to fetch from a CDN.
1141
- */
1142
- getRemoteModuleUrl(opts: {
1143
- moduleId: string;
1144
- path?: string;
1145
- version?: string;
1146
- }): string;
1147
- /**
1148
- * Async glob task. Only available in NodeJS compiler system.
1149
- */
1150
- glob?(pattern: string, options: {
1151
- cwd?: string;
1152
- nodir?: boolean;
1153
- [key: string]: any;
1154
- }): Promise<string[]>;
1155
- /**
1156
- * The number of logical processors available to run threads on the user's computer (cpus).
1157
- */
1158
- hardwareConcurrency: number;
1159
- /**
1160
- * Tests if the path is a symbolic link or not. Always resolves a boolean. Does not throw.
1161
- */
1162
- isSymbolicLink(p: string): Promise<boolean>;
1163
- lazyRequire?: LazyRequire;
1164
- nextTick(cb: () => void): void;
1165
- /**
1166
- * Normalize file system path.
1167
- */
1168
- normalizePath(p: string): string;
1169
- onProcessInterrupt?(cb: () => void): void;
1170
- parseYarnLockFile?: (content: string) => {
1171
- type: 'success' | 'merge' | 'conflict';
1172
- object: any;
1173
- };
1174
- platformPath: PlatformPath;
1175
- /**
1176
- * All return paths are full normalized paths, not just the basenames. Always returns an array, does not throw.
1177
- */
1178
- readDir(p: string): Promise<string[]>;
1179
- /**
1180
- * SYNC! All return paths are full normalized paths, not just the basenames. Always returns an array, does not throw.
1181
- */
1182
- readDirSync(p: string): string[];
1183
- /**
1184
- * Returns undefined if file is not found. Does not throw.
1185
- */
1186
- readFile(p: string): Promise<string>;
1187
- readFile(p: string, encoding: 'utf8'): Promise<string>;
1188
- readFile(p: string, encoding: 'binary'): Promise<any>;
1189
- /**
1190
- * SYNC! Returns undefined if file is not found. Does not throw.
1191
- */
1192
- readFileSync(p: string, encoding?: string): string;
1193
- /**
1194
- * Does not throw.
1195
- */
1196
- realpath(p: string): Promise<CompilerSystemRealpathResults>;
1197
- /**
1198
- * SYNC! Does not throw.
1199
- */
1200
- realpathSync(p: string): CompilerSystemRealpathResults;
1201
- /**
1202
- * Remove a callback which will be ran when destroy() is called.
1203
- */
1204
- removeDestroy(cb: () => void): void;
1205
- /**
1206
- * Rename old path to new path. Does not throw.
1207
- */
1208
- rename(oldPath: string, newPath: string): Promise<CompilerSystemRenameResults>;
1209
- resolveModuleId?(opts: ResolveModuleIdOptions): Promise<ResolveModuleIdResults>;
1210
- resolvePath(p: string): string;
1211
- /**
1212
- * Does not throw.
1213
- */
1214
- removeDir(p: string, opts?: CompilerSystemRemoveDirectoryOptions): Promise<CompilerSystemRemoveDirectoryResults>;
1215
- /**
1216
- * SYNC! Does not throw.
1217
- */
1218
- removeDirSync(p: string, opts?: CompilerSystemRemoveDirectoryOptions): CompilerSystemRemoveDirectoryResults;
1219
- /**
1220
- * Does not throw.
1221
- */
1222
- removeFile(p: string): Promise<CompilerSystemRemoveFileResults>;
1223
- /**
1224
- * SYNC! Does not throw.
1225
- */
1226
- removeFileSync(p: string): CompilerSystemRemoveFileResults;
1227
- setupCompiler?: (c: {
1228
- ts: any;
1229
- }) => void;
1230
- /**
1231
- * Always returns an object. Does not throw. Check for "error" property if there's an error.
1232
- */
1233
- stat(p: string): Promise<CompilerFsStats>;
1234
- /**
1235
- * SYNC! Always returns an object. Does not throw. Check for "error" property if there's an error.
1236
- */
1237
- statSync(p: string): CompilerFsStats;
1238
- tmpDirSync(): string;
1239
- watchDirectory?(p: string, callback: CompilerFileWatcherCallback, recursive?: boolean): CompilerFileWatcher;
1240
- /**
1241
- * A `watchFile` implementation in order to hook into the rest of the {@link CompilerSystem} implementation that is
1242
- * used when running Stencil's compiler in "watch mode".
1243
- *
1244
- * It is analogous to TypeScript's `watchFile` implementation.
1245
- *
1246
- * Note, this function may be called for full builds of Stencil projects by the TypeScript compiler. It should not
1247
- * assume that it will only be called in watch mode.
1248
- *
1249
- * This function should not perform any file watcher registration itself. Each `path` provided to it when called
1250
- * should already have been registered as a file to watch.
1251
- *
1252
- * @param path the path to the file that is being watched
1253
- * @param callback a callback to invoke when a file that is being watched has changed in some way
1254
- * @returns an object with a method for unhooking the file watcher from the system
1255
- */
1256
- watchFile?(path: string, callback: CompilerFileWatcherCallback): CompilerFileWatcher;
1257
- /**
1258
- * How many milliseconds to wait after a change before calling watch callbacks.
1259
- */
1260
- watchTimeout?: number;
1261
- /**
1262
- * Does not throw.
1263
- */
1264
- writeFile(p: string, content: string): Promise<CompilerSystemWriteFileResults>;
1265
- /**
1266
- * SYNC! Does not throw.
1267
- */
1268
- writeFileSync(p: string, content: string): CompilerSystemWriteFileResults;
1269
- }
1270
- export interface TranspileOnlyResults {
1271
- diagnostics: Diagnostic[];
1272
- output: string;
1273
- sourceMap: any;
1274
- }
1275
- export interface ParsedPath {
1276
- root: string;
1277
- dir: string;
1278
- base: string;
1279
- ext: string;
1280
- name: string;
1281
- }
1282
- export interface PlatformPath {
1283
- normalize(p: string): string;
1284
- join(...paths: string[]): string;
1285
- resolve(...pathSegments: string[]): string;
1286
- isAbsolute(p: string): boolean;
1287
- relative(from: string, to: string): string;
1288
- dirname(p: string): string;
1289
- basename(p: string, ext?: string): string;
1290
- extname(p: string): string;
1291
- parse(p: string): ParsedPath;
1292
- sep: string;
1293
- delimiter: string;
1294
- posix: any;
1295
- win32: any;
1296
- }
1297
- export interface CompilerDependency {
1298
- name: string;
1299
- version: string;
1300
- main: string;
1301
- resources?: string[];
1302
- }
1303
- export interface ResolveModuleIdOptions {
1304
- moduleId: string;
1305
- containingFile?: string;
1306
- exts?: string[];
1307
- packageFilter?: (pkg: any, pkgFile: string) => any;
1308
- }
1309
- export interface ResolveModuleIdResults {
1310
- moduleId: string;
1311
- resolveId: string;
1312
- pkgData: {
1313
- name: string;
1314
- version: string;
1315
- [key: string]: any;
1316
- };
1317
- pkgDirPath: string;
1318
- }
1319
- /**
1320
- * A controller which provides for communication and coordination between
1321
- * threaded workers.
1322
- */
1323
- export interface WorkerMainController {
1324
- /**
1325
- * Send a given set of arguments to a worker
1326
- */
1327
- send(...args: any[]): Promise<any>;
1328
- /**
1329
- * Handle a particular method
1330
- *
1331
- * @param name of the method to be passed to a worker
1332
- * @returns a Promise wrapping the results
1333
- */
1334
- handler(name: string): (...args: any[]) => Promise<any>;
1335
- /**
1336
- * Destroy the worker represented by this instance, rejecting all outstanding
1337
- * tasks and killing the child process.
1338
- */
1339
- destroy(): void;
1340
- /**
1341
- * The current setting for the max number of workers
1342
- */
1343
- maxWorkers: number;
1344
- }
1345
- export interface CopyResults {
1346
- diagnostics: Diagnostic[];
1347
- filePaths: string[];
1348
- dirPaths: string[];
1349
- }
1350
- export interface SystemDetails {
1351
- cpuModel: string;
1352
- freemem(): number;
1353
- platform: 'darwin' | 'windows' | 'linux' | '';
1354
- release: string;
1355
- totalmem: number;
1356
- }
1357
- export interface BuildOnEvents {
1358
- on(cb: (eventName: CompilerEventName, data: any) => void): BuildOnEventRemove;
1359
- on(eventName: CompilerEventFileAdd, cb: (path: string) => void): BuildOnEventRemove;
1360
- on(eventName: CompilerEventFileDelete, cb: (path: string) => void): BuildOnEventRemove;
1361
- on(eventName: CompilerEventFileUpdate, cb: (path: string) => void): BuildOnEventRemove;
1362
- on(eventName: CompilerEventDirAdd, cb: (path: string) => void): BuildOnEventRemove;
1363
- on(eventName: CompilerEventDirDelete, cb: (path: string) => void): BuildOnEventRemove;
1364
- on(eventName: CompilerEventBuildStart, cb: (buildStart: CompilerBuildStart) => void): BuildOnEventRemove;
1365
- on(eventName: CompilerEventBuildFinish, cb: (buildResults: CompilerBuildResults) => void): BuildOnEventRemove;
1366
- on(eventName: CompilerEventBuildLog, cb: (buildLog: BuildLog) => void): BuildOnEventRemove;
1367
- on(eventName: CompilerEventBuildNoChange, cb: () => void): BuildOnEventRemove;
1368
- }
1369
- export interface BuildEmitEvents {
1370
- emit(eventName: CompilerEventName, path: string): void;
1371
- emit(eventName: CompilerEventFileAdd, path: string): void;
1372
- emit(eventName: CompilerEventFileDelete, path: string): void;
1373
- emit(eventName: CompilerEventFileUpdate, path: string): void;
1374
- emit(eventName: CompilerEventDirAdd, path: string): void;
1375
- emit(eventName: CompilerEventDirDelete, path: string): void;
1376
- emit(eventName: CompilerEventBuildStart, buildStart: CompilerBuildStart): void;
1377
- emit(eventName: CompilerEventBuildFinish, buildResults: CompilerBuildResults): void;
1378
- emit(eventName: CompilerEventBuildNoChange, buildNoChange: BuildNoChangeResults): void;
1379
- emit(eventName: CompilerEventBuildLog, buildLog: BuildLog): void;
1380
- emit(eventName: CompilerEventFsChange, fsWatchResults: FsWatchResults): void;
1381
- }
1382
- export interface FsWatchResults {
1383
- dirsAdded: string[];
1384
- dirsDeleted: string[];
1385
- filesUpdated: string[];
1386
- filesAdded: string[];
1387
- filesDeleted: string[];
1388
- }
1389
- export interface BuildLog {
1390
- buildId: number;
1391
- messages: string[];
1392
- progress: number;
1393
- }
1394
- export interface BuildNoChangeResults {
1395
- buildId: number;
1396
- noChange: boolean;
1397
- }
1398
- export interface CompilerBuildResults {
1399
- buildId: number;
1400
- componentGraph?: BuildResultsComponentGraph;
1401
- diagnostics: Diagnostic[];
1402
- dirsAdded: string[];
1403
- dirsDeleted: string[];
1404
- duration: number;
1405
- filesAdded: string[];
1406
- filesChanged: string[];
1407
- filesDeleted: string[];
1408
- filesUpdated: string[];
1409
- hasError: boolean;
1410
- hasSuccessfulBuild: boolean;
1411
- hmr?: HotModuleReplacement;
1412
- hydrateAppFilePath?: string;
1413
- isRebuild: boolean;
1414
- namespace: string;
1415
- outputs: BuildOutput[];
1416
- rootDir: string;
1417
- srcDir: string;
1418
- timestamp: string;
1419
- }
1420
- export interface BuildResultsComponentGraph {
1421
- [scopeId: string]: string[];
1422
- }
1423
- export interface BuildOutput {
1424
- type: string;
1425
- files: string[];
1426
- }
1427
- export interface HotModuleReplacement {
1428
- componentsUpdated?: string[];
1429
- excludeHmr?: string[];
1430
- externalStylesUpdated?: string[];
1431
- imagesUpdated?: string[];
1432
- indexHtmlUpdated?: boolean;
1433
- inlineStylesUpdated?: HmrStyleUpdate[];
1434
- reloadStrategy: PageReloadStrategy;
1435
- scriptsAdded?: string[];
1436
- scriptsDeleted?: string[];
1437
- serviceWorkerUpdated?: boolean;
1438
- versionId?: string;
1439
- }
1440
- export interface HmrStyleUpdate {
1441
- styleId: string;
1442
- styleTag: string;
1443
- styleText: string;
1444
- }
1445
- export type BuildOnEventRemove = () => boolean;
1446
- export interface BuildEvents extends BuildOnEvents, BuildEmitEvents {
1447
- unsubscribeAll(): void;
1448
- }
1449
- export interface CompilerBuildStart {
1450
- buildId: number;
1451
- timestamp: string;
1452
- }
1453
- /**
1454
- * A type describing a function to call when an event is emitted by a file watcher
1455
- * @param fileName the path of the file tied to event
1456
- * @param eventKind a variant describing the type of event that was emitter (added, edited, etc.)
1457
- */
1458
- export type CompilerFileWatcherCallback = (fileName: string, eventKind: CompilerFileWatcherEvent) => void;
1459
- /**
1460
- * A type describing the different types of events that Stencil expects may happen when a file being watched is altered
1461
- * in some way
1462
- */
1463
- export type CompilerFileWatcherEvent = CompilerEventFileAdd | CompilerEventFileDelete | CompilerEventFileUpdate | CompilerEventDirAdd | CompilerEventDirDelete;
1464
- export type CompilerEventName = CompilerEventFsChange | CompilerEventFileUpdate | CompilerEventFileAdd | CompilerEventFileDelete | CompilerEventDirAdd | CompilerEventDirDelete | CompilerEventBuildStart | CompilerEventBuildFinish | CompilerEventBuildNoChange | CompilerEventBuildLog;
1465
- export type CompilerEventFsChange = 'fsChange';
1466
- export type CompilerEventFileUpdate = 'fileUpdate';
1467
- export type CompilerEventFileAdd = 'fileAdd';
1468
- export type CompilerEventFileDelete = 'fileDelete';
1469
- export type CompilerEventDirAdd = 'dirAdd';
1470
- export type CompilerEventDirDelete = 'dirDelete';
1471
- export type CompilerEventBuildStart = 'buildStart';
1472
- export type CompilerEventBuildFinish = 'buildFinish';
1473
- export type CompilerEventBuildLog = 'buildLog';
1474
- export type CompilerEventBuildNoChange = 'buildNoChange';
1475
- export interface CompilerFileWatcher {
1476
- close(): void | Promise<void>;
1477
- }
1478
- export interface CompilerFsStats {
1479
- /**
1480
- * If it's a directory. `false` if there was an error.
1481
- */
1482
- isDirectory: boolean;
1483
- /**
1484
- * If it's a file. `false` if there was an error.
1485
- */
1486
- isFile: boolean;
1487
- /**
1488
- * If it's a symlink. `false` if there was an error.
1489
- */
1490
- isSymbolicLink: boolean;
1491
- /**
1492
- * The size of the file in bytes. `0` for directories or if there was an error.
1493
- */
1494
- size: number;
1495
- /**
1496
- * The timestamp indicating the last time this file was modified expressed in milliseconds since the POSIX Epoch.
1497
- */
1498
- mtimeMs?: number;
1499
- /**
1500
- * Error if there was one, otherwise `null`. `stat` and `statSync` do not throw errors but always returns this interface.
1501
- */
1502
- error: any;
1503
- }
1504
- export interface CompilerSystemCreateDirectoryOptions {
1505
- /**
1506
- * Indicates whether parent directories should be created.
1507
- * @default false
1508
- */
1509
- recursive?: boolean;
1510
- /**
1511
- * A file mode. If a string is passed, it is parsed as an octal integer. If not specified
1512
- * @default 0o777.
1513
- */
1514
- mode?: number;
1515
- }
1516
- export interface CompilerSystemCreateDirectoryResults {
1517
- basename: string;
1518
- dirname: string;
1519
- path: string;
1520
- newDirs: string[];
1521
- error: any;
1522
- }
1523
- export interface CompilerSystemRemoveDirectoryOptions {
1524
- /**
1525
- * Indicates whether child files and subdirectories should be removed.
1526
- * @default false
1527
- */
1528
- recursive?: boolean;
1529
- }
1530
- export interface CompilerSystemRemoveDirectoryResults {
1531
- basename: string;
1532
- dirname: string;
1533
- path: string;
1534
- removedDirs: string[];
1535
- removedFiles: string[];
1536
- error: any;
1537
- }
1538
- export interface CompilerSystemRenameResults extends CompilerSystemRenamedPath {
1539
- renamed: CompilerSystemRenamedPath[];
1540
- oldDirs: string[];
1541
- oldFiles: string[];
1542
- newDirs: string[];
1543
- newFiles: string[];
1544
- error: any;
1545
- }
1546
- export interface CompilerSystemRenamedPath {
1547
- oldPath: string;
1548
- newPath: string;
1549
- isFile: boolean;
1550
- isDirectory: boolean;
1551
- }
1552
- export interface CompilerSystemRealpathResults {
1553
- path: string;
1554
- error: any;
1555
- }
1556
- export interface CompilerSystemRemoveFileResults {
1557
- basename: string;
1558
- dirname: string;
1559
- path: string;
1560
- error: any;
1561
- }
1562
- export interface CompilerSystemWriteFileResults {
1563
- path: string;
1564
- error: any;
1565
- }
1566
- export interface Credentials {
1567
- key: string;
1568
- cert: string;
1569
- }
1570
- export interface ConfigBundle {
1571
- components: string[];
1572
- }
1573
- /**
1574
- * A file and/or directory copy operation that may be specified as part of
1575
- * certain output targets for Stencil (in particular `dist`,
1576
- * `dist-custom-elements`, and `www`).
1577
- */
1578
- export interface CopyTask {
1579
- /**
1580
- * The source file path for a copy operation. This may be an absolute or
1581
- * relative path to a directory or a file, and may also include a glob
1582
- * pattern.
1583
- *
1584
- * If the path is a relative path it will be treated as relative to
1585
- * `Config.srcDir`.
1586
- */
1587
- src: string;
1588
- /**
1589
- * An optional destination file path for a copy operation. This may be an
1590
- * absolute or relative path.
1591
- *
1592
- * If relative, this will be treated as relative to the output directory for
1593
- * the output target for which this copy operation is configured.
1594
- */
1595
- dest?: string;
1596
- /**
1597
- * An optional array of glob patterns to exclude from the copy operation.
1598
- * @default ['**\/__mocks__/**', '**\/__fixtures__/**', '**\/dist/**', '**\/.{idea,git,cache,output,temp}/**', '**\/.ds_store', '**\/.gitignore', '**\/desktop.ini', '**\/thumbs.db']
1599
- */
1600
- ignore?: string[];
1601
- /**
1602
- * Whether or not Stencil should issue warnings if it cannot find the
1603
- * specified source files or directories. Defaults to `false`.
1604
- *
1605
- * To receive warnings if a copy task source can't be found set this to
1606
- * `true`.
1607
- */
1608
- warn?: boolean;
1609
- /**
1610
- * Whether or not directory structure should be preserved when copying files
1611
- * from a source directory. Defaults to `true` if no `dest` path is supplied,
1612
- * else it defaults to `false`.
1613
- *
1614
- * If this is set to `false`, all the files from a source directory will be
1615
- * copied directly to the destination directory, but if it's set to `true` they
1616
- * will be copied to a new directory inside the destination directory with
1617
- * the same name as their original source directory.
1618
- *
1619
- * So if, for instance, `src` is set to `"images"` and `keepDirStructure` is
1620
- * set to `true` the copy task will then produce the following directory
1621
- * structure:
1622
- *
1623
- * ```
1624
- * images
1625
- * └── foo.png
1626
- * dist
1627
- * └── images
1628
- * └── foo.png
1629
- * ```
1630
- *
1631
- * Conversely if `keepDirStructure` is set to `false` then files in `images/`
1632
- * will be copied to `dist` without first creating a new subdirectory,
1633
- * resulting in the following directory structure:
1634
- *
1635
- * ```
1636
- * images
1637
- * └── foo.png
1638
- * dist
1639
- * └── foo.png
1640
- * ```
1641
- *
1642
- * If a `dest` path is supplied then `keepDirStructure`
1643
- * will default to `false`, so that Stencil will write the
1644
- * copied files directly into the `dest` directory without creating a new
1645
- * subdirectory. This behavior can be overridden by setting
1646
- * `keepDirStructure` to `true`.
1647
- */
1648
- keepDirStructure?: boolean;
1649
- }
1650
- /**
1651
- * Configuration for generating documentation from Stencil components.
1652
- */
1653
- export interface StencilDocsConfig {
1654
- /**
1655
- * Options for processing and rendering Markdown documentation files.
1656
- */
1657
- markdown?: {
1658
- /**
1659
- * Styling for how the target component will be represented within documentation (e.g., in component diagrams).
1660
- */
1661
- targetComponent?: {
1662
- /**
1663
- * Background color used for nodes representing the component in diagrams (e.g., Mermaid graphs).
1664
- * Use standard color names or hex codes.
1665
- * @example '#f0f0f0' (light gray)
1666
- */
1667
- background?: string;
1668
- /**
1669
- * Text color used within nodes representing the component in diagrams (e.g., Mermaid graphs).
1670
- * Use standard color names or hex codes.
1671
- * @example '#333' (dark gray)
1672
- */
1673
- textColor?: string;
1674
- };
1675
- };
1676
- }
1677
- export interface BundlingConfig {
1678
- /**
1679
- * @deprecated the `namedExports` field is no longer honored by `@rollup/plugin-commonjs` and is not used by Stencil.
1680
- * This field can be safely removed from your Stencil configuration file.
1681
- */
1682
- namedExports?: {
1683
- [key: string]: string[];
1684
- };
1685
- }
1686
- export interface NodeResolveConfig {
1687
- exportConditions?: string[];
1688
- browser?: boolean;
1689
- moduleDirectories?: string[];
1690
- modulePaths?: string[];
1691
- dedupe?: string[] | ((importee: string) => boolean);
1692
- extensions?: readonly string[];
1693
- jail?: string;
1694
- mainFields?: readonly string[];
1695
- modulesOnly?: boolean;
1696
- preferBuiltins?: boolean | ((module: string) => boolean);
1697
- resolveOnly?: ReadonlyArray<string | RegExp> | null | ((module: string) => boolean);
1698
- rootDir?: string;
1699
- allowExportsFolderMapping?: boolean;
1700
- /**
1701
- * @see https://github.com/browserify/resolve#resolveid-opts-cb
1702
- * @deprecated the `customResolveOptions` field is no longer honored in future versions of
1703
- * `@rollup/plugin-node-resolve`. If you are currently using it, please open a new issue in the Stencil repo to
1704
- * describe your use case & provide input (https://github.com/stenciljs/core/issues/new/choose)
1705
- */
1706
- customResolveOptions?: {
1707
- basedir?: string;
1708
- package?: string;
1709
- extensions?: string[];
1710
- readFile?: Function;
1711
- isFile?: Function;
1712
- isDirectory?: Function;
1713
- packageFilter?: Function;
1714
- pathFilter?: Function;
1715
- paths?: Function | string[];
1716
- moduleDirectory?: string | string[];
1717
- preserveSymlinks?: boolean;
1718
- };
1719
- }
1720
- export interface RollupConfig {
1721
- inputOptions?: RollupInputOptions;
1722
- outputOptions?: RollupOutputOptions;
1723
- }
1724
- export interface RollupInputOptions {
1725
- context?: string;
1726
- moduleContext?: ((id: string) => string) | {
1727
- [id: string]: string;
1728
- };
1729
- treeshake?: boolean;
1730
- maxParallelFileOps?: number;
1731
- external?: (string | RegExp)[] | string | RegExp | ((source: string, importer: string | undefined, isResolved: boolean) => boolean | null | undefined);
1732
- }
1733
- export interface RollupOutputOptions {
1734
- globals?: {
1735
- [name: string]: string;
1736
- } | ((name: string) => string);
1737
- }
1738
- export interface Testing {
1739
- run(opts: TestingRunOptions): Promise<boolean>;
1740
- destroy(): Promise<void>;
1741
- }
1742
- export declare type Path = string;
1743
- export declare type TransformerConfig = [string, Record<string, unknown>];
1744
- /**
1745
- * Options for initiating a run of Stencil tests (spec and/or end-to-end)
1746
- */
1747
- export interface TestingRunOptions {
1748
- /**
1749
- * If true, run end-to-end tests
1750
- */
1751
- e2e?: boolean;
1752
- /**
1753
- * If true, run screenshot tests
1754
- */
1755
- screenshot?: boolean;
1756
- /**
1757
- * If true, run spec tests
1758
- */
1759
- spec?: boolean;
1760
- /**
1761
- * If true, update 'golden' screenshots. Otherwise, compare against priori.
1762
- */
1763
- updateScreenshot?: boolean;
1764
- }
1765
- export interface JestConfig {
1766
- /**
1767
- * This option tells Jest that all imported modules in your tests should be mocked automatically.
1768
- * All modules used in your tests will have a replacement implementation, keeping the API surface. Default: false
1769
- */
1770
- automock?: boolean;
1771
- /**
1772
- * By default, Jest runs all tests and produces all errors into the console upon completion.
1773
- * The bail config option can be used here to have Jest stop running tests after the first failure. Default: false
1774
- */
1775
- bail?: boolean | number;
1776
- /**
1777
- * The directory where Jest should store its cached dependency information. Jest attempts to scan your dependency tree once (up-front)
1778
- * and cache it in order to ease some of the filesystem raking that needs to happen while running tests. This config option lets you
1779
- * customize where Jest stores that cache data on disk. Default: "/tmp/<path>"
1780
- */
1781
- cacheDirectory?: string;
1782
- /**
1783
- * Automatically clear mock calls and instances between every test. Equivalent to calling jest.clearAllMocks()
1784
- * between each test. This does not remove any mock implementation that may have been provided. Default: false
1785
- */
1786
- clearMocks?: boolean;
1787
- /**
1788
- * Indicates whether the coverage information should be collected while executing the test. Because this retrofits all
1789
- * executed files with coverage collection statements, it may significantly slow down your tests. Default: false
1790
- */
1791
- collectCoverage?: boolean;
1792
- /**
1793
- * An array of glob patterns indicating a set of files for which coverage information should be collected.
1794
- * If a file matches the specified glob pattern, coverage information will be collected for it even if no tests exist
1795
- * for this file and it's never required in the test suite. Default: undefined
1796
- */
1797
- collectCoverageFrom?: any[];
1798
- /**
1799
- * The directory where Jest should output its coverage files. Default: undefined
1800
- */
1801
- coverageDirectory?: string;
1802
- /**
1803
- * An array of regexp pattern strings that are matched against all file paths before executing the test. If the file path matches
1804
- * any of the patterns, coverage information will be skipped. These pattern strings match against the full path.
1805
- * Use the <rootDir> string token to include the path to your project's root directory to prevent it from accidentally
1806
- * ignoring all of your files in different environments that may have different root directories.
1807
- * Example: ["<rootDir>/build/", "<rootDir>/node_modules/"]. Default: ["/node_modules/"]
1808
- */
1809
- coveragePathIgnorePatterns?: any[];
1810
- /**
1811
- * A list of reporter names that Jest uses when writing coverage reports. Any istanbul reporter can be used.
1812
- * Default: `["json", "lcov", "text"]`
1813
- */
1814
- coverageReporters?: any[];
1815
- /**
1816
- * This will be used to configure minimum threshold enforcement for coverage results. Thresholds can be specified as global,
1817
- * as a glob, and as a directory or file path. If thresholds aren't met, jest will fail. Thresholds specified as a positive
1818
- * number are taken to be the minimum percentage required. Thresholds specified as a negative number represent the maximum
1819
- * number of uncovered entities allowed. Default: undefined
1820
- */
1821
- coverageThreshold?: any;
1822
- errorOnDeprecated?: boolean;
1823
- forceCoverageMatch?: any[];
1824
- globals?: any;
1825
- globalSetup?: string;
1826
- globalTeardown?: string;
1827
- /**
1828
- * An array of directory names to be searched recursively up from the requiring module's location. Setting this option will
1829
- * override the default, if you wish to still search node_modules for packages include it along with any other
1830
- * options: ["node_modules", "bower_components"]. Default: ["node_modules"]
1831
- */
1832
- moduleDirectories?: string[];
1833
- /**
1834
- * An array of file extensions your modules use. If you require modules without specifying a file extension,
1835
- * these are the extensions Jest will look for. Default: ['ts', 'tsx', 'js', 'json']
1836
- */
1837
- moduleFileExtensions?: string[];
1838
- moduleNameMapper?: any;
1839
- modulePaths?: any[];
1840
- modulePathIgnorePatterns?: any[];
1841
- notify?: boolean;
1842
- notifyMode?: string;
1843
- preset?: string;
1844
- prettierPath?: string;
1845
- projects?: any;
1846
- reporters?: any;
1847
- resetMocks?: boolean;
1848
- resetModules?: boolean;
1849
- resolver?: Path | null;
1850
- restoreMocks?: boolean;
1851
- rootDir?: string;
1852
- roots?: any[];
1853
- runner?: string;
1854
- /**
1855
- * The paths to modules that run some code to configure or set up the testing environment before each test.
1856
- * Since every test runs in its own environment, these scripts will be executed in the testing environment
1857
- * immediately before executing the test code itself. Default: []
1858
- */
1859
- setupFiles?: string[];
1860
- setupFilesAfterEnv?: string[];
1861
- snapshotSerializers?: any[];
1862
- testEnvironment?: string;
1863
- testEnvironmentOptions?: any;
1864
- testMatch?: string[];
1865
- testPathIgnorePatterns?: string[];
1866
- testPreset?: string;
1867
- testRegex?: string[];
1868
- testResultsProcessor?: string;
1869
- testRunner?: string;
1870
- testURL?: string;
1871
- timers?: string;
1872
- transform?: {
1873
- [regex: string]: Path | TransformerConfig;
1874
- };
1875
- transformIgnorePatterns?: any[];
1876
- unmockedModulePathPatterns?: any[];
1877
- verbose?: boolean;
1878
- watchPathIgnorePatterns?: any[];
1879
- }
1880
- export interface TestingConfig extends JestConfig {
1881
- /**
1882
- * The `allowableMismatchedPixels` value is used to determine an acceptable
1883
- * number of pixels that can be mismatched before the image is considered
1884
- * to have changes. Realistically, two screenshots representing the same
1885
- * content may have a small number of pixels that are not identical due to
1886
- * anti-aliasing, which is perfectly normal. If the `allowableMismatchedRatio`
1887
- * is provided it will take precedence, otherwise `allowableMismatchedPixels`
1888
- * will be used.
1889
- */
1890
- allowableMismatchedPixels?: number;
1891
- /**
1892
- * The `allowableMismatchedRatio` ranges from `0` to `1` and is used to
1893
- * determine an acceptable ratio of pixels that can be mismatched before
1894
- * the image is considered to have changes. Realistically, two screenshots
1895
- * representing the same content may have a small number of pixels that
1896
- * are not identical due to anti-aliasing, which is perfectly normal. The
1897
- * `allowableMismatchedRatio` is the number of pixels that were mismatched,
1898
- * divided by the total number of pixels in the screenshot. For example,
1899
- * a ratio value of `0.06` means 6% of the pixels can be mismatched before
1900
- * the image is considered to have changes. If the `allowableMismatchedRatio`
1901
- * is provided it will take precedence, otherwise `allowableMismatchedPixels`
1902
- * will be used.
1903
- */
1904
- allowableMismatchedRatio?: number;
1905
- /**
1906
- * Matching threshold while comparing two screenshots. Value ranges from `0` to `1`.
1907
- * Smaller values make the comparison more sensitive. The `pixelmatchThreshold`
1908
- * value helps to ignore anti-aliasing. Default: `0.1`
1909
- */
1910
- pixelmatchThreshold?: number;
1911
- /**
1912
- * Additional arguments to pass to the browser instance.
1913
- */
1914
- browserArgs?: string[];
1915
- /**
1916
- * Path to a Chromium or Chrome executable to run instead of the bundled Chromium.
1917
- * @default env.PUPPETEER_EXECUTABLE_PATH || env.CHROME_PATH || puppeteer.computeExecutablePath()
1918
- */
1919
- browserExecutablePath?: string;
1920
- /**
1921
- * Url of remote Chrome instance to use instead of local Chrome.
1922
- */
1923
- browserWSEndpoint?: string;
1924
- /**
1925
- * The browser channel to use for e2e tests (stable, beta, dev or canary).
1926
- * @default 'chrome'
1927
- */
1928
- browserChannel?: 'chrome' | 'chrome-beta' | 'chrome-dev' | 'chrome-canary';
1929
- /**
1930
- * Whether to run browser e2e tests in headless mode using Chrome Headless Shell
1931
- * @ref https://developer.chrome.com/blog/chrome-headless-shell
1932
- * @default shell
1933
- */
1934
- browserHeadless?: boolean | 'shell';
1935
- /**
1936
- * Slows down e2e browser operations by the specified amount of milliseconds.
1937
- * Useful so that you can see what is going on.
1938
- */
1939
- browserSlowMo?: number;
1940
- /**
1941
- * By default, all E2E pages wait until the "load" event, this global setting can be used
1942
- * to change the default `waitUntil` behavior.
1943
- */
1944
- browserWaitUntil?: 'load' | 'domcontentloaded' | 'networkidle0' | 'networkidle2';
1945
- /**
1946
- * Whether to auto-open a DevTools panel for each tab.
1947
- * If this option is true, the headless option will be set false
1948
- */
1949
- browserDevtools?: boolean;
1950
- /**
1951
- * Array of browser emulations to be used during _screenshot_ tests. A full screenshot
1952
- * test is ran for each emulation.
1953
- *
1954
- * To emulate a device display for your e2e tests, use the `setViewport` method on a test's E2E page.
1955
- * An example can be found in [the Stencil docs](https://stenciljs.com/docs/end-to-end-testing#emulate-a-display).
1956
- */
1957
- emulate?: EmulateConfig[];
1958
- /**
1959
- * Path to the Screenshot Connector module.
1960
- */
1961
- screenshotConnector?: string;
1962
- /**
1963
- * Timeout for the pixelmatch worker to resolve (in ms).
1964
- * @default 2500
1965
- */
1966
- screenshotTimeout?: number | null;
1967
- /**
1968
- * Amount of time in milliseconds to wait before a screenshot is taken.
1969
- */
1970
- waitBeforeScreenshot?: number;
1971
- }
1972
- export interface EmulateConfig {
1973
- /**
1974
- * Predefined device descriptor name, such as "iPhone X" or "Nexus 10".
1975
- * For a complete list please see: https://github.com/puppeteer/puppeteer/blob/main/src/common/DeviceDescriptors.ts
1976
- */
1977
- device?: string;
1978
- /**
1979
- * User-Agent to be used. Defaults to the user-agent of the installed Puppeteer version.
1980
- */
1981
- userAgent?: string;
1982
- viewport?: EmulateViewport;
1983
- }
1984
- export interface EmulateViewport {
1985
- /**
1986
- * Page width in pixels.
1987
- */
1988
- width: number;
1989
- /**
1990
- * page height in pixels.
1991
- */
1992
- height: number;
1993
- /**
1994
- * Specify device scale factor (can be thought of as dpr). Defaults to 1.
1995
- */
1996
- deviceScaleFactor?: number;
1997
- /**
1998
- * Whether the meta viewport tag is taken into account. Defaults to false.
1999
- */
2000
- isMobile?: boolean;
2001
- /**
2002
- * Specifies if viewport supports touch events. Defaults to false
2003
- */
2004
- hasTouch?: boolean;
2005
- /**
2006
- * Specifies if viewport is in landscape mode. Defaults to false.
2007
- */
2008
- isLandscape?: boolean;
2009
- }
2010
- /**
2011
- * This sets the log level hierarchy for our terminal logger, ranging from
2012
- * most to least verbose.
2013
- *
2014
- * Ordering the levels like this lets us easily check whether we should log a
2015
- * message at a given time. For instance, if the log level is set to `'warn'`,
2016
- * then anything passed to the logger with level `'warn'` or `'error'` should
2017
- * be logged, but we should _not_ log anything with level `'info'` or `'debug'`.
2018
- *
2019
- * If we have a current log level `currentLevel` and a message with level
2020
- * `msgLevel` is passed to the logger, we can determine whether or not we should
2021
- * log it by checking if the log level on the message is further up or at the
2022
- * same level in the hierarchy than `currentLevel`, like so:
2023
- *
2024
- * ```ts
2025
- * LOG_LEVELS.indexOf(msgLevel) >= LOG_LEVELS.indexOf(currentLevel)
2026
- * ```
2027
- *
2028
- * NOTE: for the reasons described above, do not change the order of the entries
2029
- * in this array without good reason!
2030
- */
2031
- export declare const LOG_LEVELS: readonly ["debug", "info", "warn", "error"];
2032
- export type LogLevel = (typeof LOG_LEVELS)[number];
2033
- /**
2034
- * Abstract interface representing a logger with the capability to accept log
2035
- * messages at various levels (debug, info, warn, and error), set colors, log
2036
- * time spans, print diagnostic messages, and more.
2037
- *
2038
- * A Node.js-specific implementation of this interface is used when Stencil is
2039
- * building and compiling a project.
2040
- */
2041
- export interface Logger {
2042
- enableColors: (useColors: boolean) => void;
2043
- setLevel: (level: LogLevel) => void;
2044
- getLevel: () => LogLevel;
2045
- debug: (...msg: any[]) => void;
2046
- info: (...msg: any[]) => void;
2047
- warn: (...msg: any[]) => void;
2048
- error: (...msg: any[]) => void;
2049
- createTimeSpan: (startMsg: string, debug?: boolean, appendTo?: string[]) => LoggerTimeSpan;
2050
- printDiagnostics: (diagnostics: Diagnostic[], cwd?: string) => void;
2051
- red: (msg: string) => string;
2052
- green: (msg: string) => string;
2053
- yellow: (msg: string) => string;
2054
- blue: (msg: string) => string;
2055
- magenta: (msg: string) => string;
2056
- cyan: (msg: string) => string;
2057
- gray: (msg: string) => string;
2058
- bold: (msg: string) => string;
2059
- dim: (msg: string) => string;
2060
- bgRed: (msg: string) => string;
2061
- emoji: (e: string) => string;
2062
- setLogFilePath?: (p: string) => void;
2063
- writeLogs?: (append: boolean) => void;
2064
- createLineUpdater?: () => Promise<LoggerLineUpdater>;
2065
- }
2066
- export interface LoggerLineUpdater {
2067
- update(text: string): Promise<void>;
2068
- stop(): Promise<void>;
2069
- }
2070
- export interface LoggerTimeSpan {
2071
- duration(): number;
2072
- finish(finishedMsg: string, color?: string, bold?: boolean, newLineSuffix?: boolean): number;
2073
- }
2074
- export interface OutputTargetDist extends OutputTargetValidationConfig {
2075
- type: 'dist';
2076
- buildDir?: string;
2077
- collectionDir?: string | null;
2078
- /**
2079
- * When `true` this flag will transform aliased import paths defined in
2080
- * a project's `tsconfig.json` to relative import paths in the compiled output's
2081
- * `dist-collection` bundle if it is generated (i.e. `collectionDir` is set).
2082
- *
2083
- * Paths will be left in aliased format if `false`.
2084
- *
2085
- * @example
2086
- * // tsconfig.json
2087
- * {
2088
- * paths: {
2089
- * "@utils/*": ['/src/utils/*']
2090
- * }
2091
- * }
2092
- *
2093
- * // Source file
2094
- * import * as dateUtils from '@utils/date-utils';
2095
- * // Output file
2096
- * import * as dateUtils from '../utils/date-utils';
2097
- */
2098
- transformAliasedImportPathsInCollection?: boolean | null;
2099
- typesDir?: string;
2100
- /**
2101
- * Provide a custom path for the ESM loader directory, containing files you can import
2102
- * in an initiation script within your application to register all your components for
2103
- * lazy loading.
2104
- *
2105
- * @default /dist/loader
2106
- */
2107
- esmLoaderPath?: string;
2108
- copy?: CopyTask[];
2109
- polyfills?: boolean;
2110
- empty?: boolean;
2111
- }
2112
- export interface OutputTargetDistCollection extends OutputTargetValidationConfig {
2113
- type: 'dist-collection';
2114
- empty?: boolean;
2115
- dir: string;
2116
- collectionDir: string;
2117
- /**
2118
- * When `true` this flag will transform aliased import paths defined in
2119
- * a project's `tsconfig.json` to relative import paths in the compiled output.
2120
- *
2121
- * Paths will be left in aliased format if `false` or `undefined`.
2122
- *
2123
- * @example
2124
- * // tsconfig.json
2125
- * {
2126
- * paths: {
2127
- * "@utils/*": ['/src/utils/*']
2128
- * }
2129
- * }
2130
- *
2131
- * // Source file
2132
- * import * as dateUtils from '@utils/date-utils';
2133
- * // Output file
2134
- * import * as dateUtils from '../utils/date-utils';
2135
- */
2136
- transformAliasedImportPaths?: boolean | null;
2137
- }
2138
- export interface OutputTargetDistTypes extends OutputTargetValidationConfig {
2139
- type: 'dist-types';
2140
- dir: string;
2141
- typesDir: string;
2142
- }
2143
- export interface OutputTargetDistLazy extends OutputTargetBase {
2144
- type: 'dist-lazy';
2145
- dir?: string;
2146
- esmDir?: string;
2147
- esmEs5Dir?: string;
2148
- systemDir?: string;
2149
- cjsDir?: string;
2150
- polyfills?: boolean;
2151
- isBrowserBuild?: boolean;
2152
- esmIndexFile?: string;
2153
- cjsIndexFile?: string;
2154
- systemLoaderFile?: string;
2155
- legacyLoaderFile?: string;
2156
- empty?: boolean;
2157
- }
2158
- export interface OutputTargetDistGlobalStyles extends OutputTargetBase {
2159
- type: 'dist-global-styles';
2160
- file: string;
2161
- }
2162
- export interface OutputTargetDistLazyLoader extends OutputTargetBase {
2163
- type: 'dist-lazy-loader';
2164
- dir: string;
2165
- esmDir: string;
2166
- esmEs5Dir?: string;
2167
- cjsDir: string;
2168
- componentDts: string;
2169
- empty: boolean;
2170
- }
2171
- export interface OutputTargetHydrate extends OutputTargetBase {
2172
- type: 'dist-hydrate-script';
2173
- dir?: string;
2174
- /**
2175
- * Whether to generate a package.json file in the hydrate output directory.
2176
- * Defaults to `true`
2177
- * @deprecated
2178
- * In the next major release, the `package.json` file will be completely removed from the `dist-hydrate-script` output (use `exports` from your library's main `package.json`)
2179
- */
2180
- generatePackageJson?: boolean;
2181
- /**
2182
- * Module IDs that should not be bundled into the script.
2183
- * By default, all node builtin's, such as `fs` or `path`
2184
- * will be considered "external" and not bundled.
2185
- */
2186
- external?: string[];
2187
- empty?: boolean;
2188
- minify?: boolean;
2189
- }
2190
- export interface OutputTargetCustom extends OutputTargetBase {
2191
- type: 'custom';
2192
- name: string;
2193
- /**
2194
- * Indicate when the output target should be executed.
2195
- *
2196
- * - `"onBuildOnly"`: Executed only when `stencil build` is called without `--watch`.
2197
- * - `"always"`: Executed on every build, including in `watch` mode.
2198
- *
2199
- * Defaults to "always".
2200
- */
2201
- taskShouldRun?: 'onBuildOnly' | 'always';
2202
- validate?: (config: Config, diagnostics: Diagnostic[]) => void;
2203
- generator: (config: Config, compilerCtx: CompilerCtx, buildCtx: BuildCtx, docs: JsonDocs) => Promise<void>;
2204
- copy?: CopyTask[];
2205
- }
2206
- /**
2207
- * Output target for generating [custom data](https://github.com/microsoft/vscode-custom-data) for VS Code as a JSON
2208
- * file.
2209
- */
2210
- export interface OutputTargetDocsVscode extends OutputTargetBase {
2211
- /**
2212
- * Designates this output target to be used for generating VS Code custom data.
2213
- * @see OutputTargetBase#type
2214
- */
2215
- type: 'docs-vscode';
2216
- /**
2217
- * The location on disk to write the JSON file.
2218
- */
2219
- file: string;
2220
- /**
2221
- * A base URL to find the source code of the component(s) described in the JSON file.
2222
- */
2223
- sourceCodeBaseUrl?: string;
2224
- }
2225
- export interface OutputTargetDocsReadme extends OutputTargetBase {
2226
- type: 'docs-readme';
2227
- /**
2228
- * The root directory where README files should be written
2229
- *
2230
- * defaults to {@link Config.srcDir}
2231
- */
2232
- dir?: string;
2233
- dependencies?: boolean;
2234
- /**
2235
- * Controls how READMEs are written to the destination directory.
2236
- *
2237
- * - `true`: Always overwrite the destination README with the full content.
2238
- * - `false` (default): Only update the autogenerated content, preserving existing custom content above it.
2239
- * - `'if-missing'`: Write the full README only if no file exists at the destination.
2240
- *
2241
- * This option enables workflows requiring consistent, idempotent output across builds,
2242
- * and supports setups where custom documentation may need to coexist or vary between environments.
2243
- */
2244
- overwriteExisting?: boolean | 'if-missing';
2245
- footer?: string;
2246
- strict?: boolean;
2247
- }
2248
- export interface OutputTargetDocsJson extends OutputTargetBase {
2249
- type: 'docs-json';
2250
- file: string;
2251
- /**
2252
- * Set an optional file path where Stencil should write a `d.ts` file to disk
2253
- * at build-time containing type declarations for {@link JsonDocs} and related
2254
- * interfaces. If this is omitted or set to `null` Stencil will not write such
2255
- * a file.
2256
- */
2257
- typesFile?: string | null;
2258
- strict?: boolean;
2259
- /**
2260
- * An optional file path pointing to a public type library which should be
2261
- * included and documented in the same way as other types which are included
2262
- * in this output target.
2263
- *
2264
- * This could be useful if, for instance, there are some important interfaces
2265
- * used in a few places in a Stencil project which don't form part of the
2266
- * public API for any of the project's components. Such interfaces will not
2267
- * be included in the `docs-json` output by default, but if they're declared
2268
- * and exported from a 'supplemental' file designated with this property then
2269
- * they'll be included in the output, facilitating their documentation.
2270
- */
2271
- supplementalPublicTypes?: string;
2272
- }
2273
- export interface OutputTargetDocsCustomElementsManifest extends OutputTargetBase {
2274
- type: 'docs-custom-elements-manifest';
2275
- /**
2276
- * The file path where the custom-elements.json manifest will be written.
2277
- * Defaults to 'custom-elements.json' in the root directory.
2278
- */
2279
- file: string;
2280
- strict?: boolean;
2281
- }
2282
- export interface OutputTargetDocsCustom extends OutputTargetBase {
2283
- type: 'docs-custom';
2284
- generator: (docs: JsonDocs, config: Config) => void | Promise<void>;
2285
- strict?: boolean;
2286
- }
2287
- export interface OutputTargetStats extends OutputTargetBase {
2288
- type: 'stats';
2289
- file?: string;
2290
- }
2291
- export interface OutputTargetBaseNext {
2292
- type: string;
2293
- dir?: string;
2294
- }
2295
- /**
2296
- * The collection of valid export behaviors.
2297
- * Used to generate a type for typed configs as well as output target validation
2298
- * for the `dist-custom-elements` output target.
2299
- *
2300
- * Adding a value to this const array will automatically add it as a valid option on the
2301
- * output target configuration for `customElementsExportBehavior`.
2302
- *
2303
- * - `default`: No additional export or definition behavior will happen.
2304
- * - `auto-define-custom-elements`: Enables the auto-definition of a component and its children (recursively) in the custom elements registry. This
2305
- * functionality allows consumers to bypass the explicit call to define a component, its children, its children's
2306
- * children, etc. Users of this flag should be aware that enabling this functionality may increase bundle size.
2307
- * - `bundle`: A `defineCustomElements` function will be exported from the distribution directory. This behavior was added to allow easy migration
2308
- * from `dist-custom-elements-bundle` to `dist-custom-elements`.
2309
- * - `single-export-module`: All components will be re-exported from the specified directory's root `index.js` file.
2310
- */
2311
- export declare const CustomElementsExportBehaviorOptions: readonly ["default", "auto-define-custom-elements", "bundle", "single-export-module"];
2312
- /**
2313
- * This type is auto-generated based on the values in `CustomElementsExportBehaviorOptions` array.
2314
- * This is used on the output target config for intellisense in typed configs.
2315
- */
2316
- export type CustomElementsExportBehavior = (typeof CustomElementsExportBehaviorOptions)[number];
2317
- export interface OutputTargetDistCustomElements extends OutputTargetValidationConfig {
2318
- type: 'dist-custom-elements';
2319
- empty?: boolean;
2320
- /**
2321
- * Triggers the following behaviors when enabled:
2322
- * 1. All `@stencil/core/*` module references are treated as external during bundling.
2323
- * 2. File names are not hashed.
2324
- * 3. File minification will follow the behavior defined at the root of the Stencil config.
2325
- */
2326
- externalRuntime?: boolean;
2327
- copy?: CopyTask[];
2328
- includeGlobalScripts?: boolean;
2329
- minify?: boolean;
2330
- /**
2331
- * Enables the generation of type definition files for the output target.
2332
- */
2333
- generateTypeDeclarations?: boolean;
2334
- /**
2335
- * Define the export/definition behavior for the output target's generated output.
2336
- * This controls if/how custom elements will be defined or where components will be exported from.
2337
- * If omitted, no auto-definition behavior or re-exporting will happen.
2338
- */
2339
- customElementsExportBehavior?: CustomElementsExportBehavior;
2340
- /**
2341
- * Generate an auto-loader script that uses MutationObserver to lazily load
2342
- * and define custom elements as they appear in the DOM.
2343
- *
2344
- * When set to `true`, generates a `loader.js` file that auto-starts on import.
2345
- * Can also be configured with an object for more control:
2346
- * - `fileName`: Custom filename for the loader (default: 'loader.js')
2347
- * - `autoStart`: Whether to auto-start the loader on import (default: true)
2348
- *
2349
- * @example
2350
- * ```typescript
2351
- * // Simple usage
2352
- * autoLoader: true
2353
- *
2354
- * // With options
2355
- * autoLoader: {
2356
- * fileName: 'my-loader.js',
2357
- * autoStart: false
2358
- * }
2359
- * ```
2360
- */
2361
- autoLoader?: boolean | {
2362
- /**
2363
- * Custom filename for the generated loader script.
2364
- * @default 'loader.js'
2365
- */
2366
- fileName?: string;
2367
- /**
2368
- * Whether to automatically start the loader when the script is imported.
2369
- * If false, you must call `start()` manually.
2370
- * @default true
2371
- */
2372
- autoStart?: boolean;
2373
- };
2374
- }
2375
- /**
2376
- * The base type for output targets. All output targets should extend this base type.
2377
- */
2378
- export interface OutputTargetBase {
2379
- /**
2380
- * A unique string to differentiate one output target from another
2381
- */
2382
- type: string;
2383
- }
2384
- /**
2385
- * Output targets that can have validation for common `package.json` field values
2386
- * (module, types, etc.). This allows them to be marked for validation in a project's Stencil config.
2387
- */
2388
- interface OutputTargetValidationConfig extends OutputTargetBaseNext {
2389
- isPrimaryPackageOutputTarget?: boolean;
2390
- }
2391
- export type EligiblePrimaryPackageOutputTarget = OutputTargetDist | OutputTargetDistCustomElements | OutputTargetDistCollection | OutputTargetDistTypes;
2392
- export type OutputTargetBuild = OutputTargetDistCollection | OutputTargetDistLazy;
2393
- export interface OutputTargetCopy extends OutputTargetBase {
2394
- type: 'copy';
2395
- dir: string;
2396
- copy?: CopyTask[];
2397
- copyAssets?: 'collection' | 'dist';
2398
- }
2399
- export interface OutputTargetWww extends OutputTargetBase {
2400
- /**
2401
- * Webapp output target.
2402
- */
2403
- type: 'www';
2404
- /**
2405
- * The directory to write the app's JavaScript and CSS build
2406
- * files to. The default is to place this directory as a child
2407
- * to the `dir` config. Default: `build`
2408
- */
2409
- buildDir?: string;
2410
- /**
2411
- * The directory to write the entire application to.
2412
- * Note, the `buildDir` is where the app's JavaScript and CSS build
2413
- * files are written. Default: `www`
2414
- */
2415
- dir?: string;
2416
- /**
2417
- * Empty the build directory of all files and directories on first build.
2418
- * Default: `true`
2419
- */
2420
- empty?: boolean;
2421
- /**
2422
- * The default index html file of the app, commonly found at the
2423
- * root of the `src` directory.
2424
- * Default: `index.html`
2425
- */
2426
- indexHtml?: string;
2427
- /**
2428
- * The copy config is an array of objects that defines any files or folders that should
2429
- * be copied over to the build directory.
2430
- *
2431
- * Each object in the array must include a src property which can be either an absolute path,
2432
- * a relative path or a glob pattern. The config can also provide an optional dest property
2433
- * which can be either an absolute path or a path relative to the build directory.
2434
- * Also note that any files within src/assets are automatically copied to www/assets for convenience.
2435
- *
2436
- * In the copy config below, it will copy the entire directory from src/docs-content over to www/docs-content.
2437
- */
2438
- copy?: CopyTask[];
2439
- /**
2440
- * The base url of the app, it's required during prerendering to be the absolute path
2441
- * of your app, such as: `https://my.app.com/app`.
2442
- *
2443
- * Default: `/`
2444
- */
2445
- baseUrl?: string;
2446
- /**
2447
- * By default, stencil will include all the polyfills required by legacy browsers in the ES5 build.
2448
- * If it's `false`, stencil will not emit this polyfills anymore and it's your responsibility to provide them before
2449
- * stencil initializes.
2450
- */
2451
- polyfills?: boolean;
2452
- /**
2453
- * Path to an external node module which has exports of the prerender config object.
2454
- * ```
2455
- * module.exports = {
2456
- * afterHydrate(document, url) {
2457
- * document.title = `URL: ${url.href}`;
2458
- * }
2459
- * }
2460
- * ```
2461
- */
2462
- prerenderConfig?: string;
2463
- /**
2464
- * Service worker config for production builds. During development builds
2465
- * service worker script will be injected to automatically deregister existing
2466
- * service workers. When set to `false` neither a service worker registration
2467
- * or deregistration will be added to the index.html.
2468
- */
2469
- serviceWorker?: ServiceWorkerConfig | null | false;
2470
- appDir?: string;
2471
- }
2472
- export type OutputTarget = OutputTargetCopy | OutputTargetCustom | OutputTargetDist | OutputTargetDistCollection | OutputTargetDistCustomElements | OutputTargetDistLazy | OutputTargetDistGlobalStyles | OutputTargetDistLazyLoader | OutputTargetDocsJson | OutputTargetDocsCustom | OutputTargetDocsReadme | OutputTargetDocsVscode | OutputTargetDocsCustomElementsManifest | OutputTargetWww | OutputTargetHydrate | OutputTargetStats | OutputTargetDistTypes;
2473
- /**
2474
- * Our custom configuration interface for generated caching Service Workers
2475
- * using the Workbox library (see https://developer.chrome.com/docs/workbox/).
2476
- *
2477
- * Although we are using Workbox we are unfortunately unable to depend on the
2478
- * published types for the library because they must be compiled using the
2479
- * `webworker` lib for TypeScript, which cannot be used at the same time as
2480
- * the `dom` lib. So as a workaround we maintain our own interface here. See
2481
- * here to refer to the published version:
2482
- * https://github.com/DefinitelyTyped/DefinitelyTyped/blob/c7b4dadae5b320ad1311a8f82242b8f2f41b7b8c/types/workbox-build/generate-sw.d.ts#L3
2483
- */
2484
- export interface ServiceWorkerConfig {
2485
- unregister?: boolean;
2486
- swDest?: string;
2487
- swSrc?: string;
2488
- globPatterns?: string[];
2489
- globDirectory?: string | string[];
2490
- globIgnores?: string | string[];
2491
- templatedUrls?: any;
2492
- maximumFileSizeToCacheInBytes?: number;
2493
- manifestTransforms?: any;
2494
- modifyUrlPrefix?: any;
2495
- dontCacheBustURLsMatching?: RegExp;
2496
- navigateFallback?: string;
2497
- navigateFallbackWhitelist?: RegExp[];
2498
- navigateFallbackBlacklist?: RegExp[];
2499
- cacheId?: string;
2500
- skipWaiting?: boolean;
2501
- clientsClaim?: boolean;
2502
- directoryIndex?: string;
2503
- runtimeCaching?: any[];
2504
- ignoreUrlParametersMatching?: any[];
2505
- handleFetch?: boolean;
2506
- }
2507
- export interface LoadConfigInit {
2508
- /**
2509
- * User config object to merge into default config and
2510
- * config loaded from a file path.
2511
- */
2512
- config?: UnvalidatedConfig;
2513
- /**
2514
- * Absolute path to a Stencil config file. This path cannot be
2515
- * relative and it does not resolve config files within a directory.
2516
- */
2517
- configPath?: string;
2518
- logger?: Logger;
2519
- sys?: CompilerSystem;
2520
- /**
2521
- * When set to true, if the "tsconfig.json" file is not found
2522
- * it'll automatically generate and save a default tsconfig
2523
- * within the root directory.
2524
- */
2525
- initTsConfig?: boolean;
2526
- }
2527
- /**
2528
- * Results from an attempt to load a config. The values on this interface
2529
- * have not yet been validated and are not ready to be used for arbitrary
2530
- * operations around the codebase.
2531
- */
2532
- export interface LoadConfigResults {
2533
- config: ValidatedConfig;
2534
- diagnostics: Diagnostic[];
2535
- tsconfig: {
2536
- path: string;
2537
- compilerOptions: any;
2538
- files: string[];
2539
- include: string[];
2540
- exclude: string[];
2541
- extends: string;
2542
- };
2543
- }
2544
- export interface Diagnostic {
2545
- absFilePath?: string | undefined;
2546
- code?: string;
2547
- columnNumber?: number | undefined;
2548
- debugText?: string;
2549
- header?: string;
2550
- language?: string;
2551
- level: 'error' | 'warn' | 'info' | 'log' | 'debug';
2552
- lineNumber?: number | undefined;
2553
- lines: PrintLine[];
2554
- messageText: string;
2555
- relFilePath?: string | undefined;
2556
- type: string;
2557
- }
2558
- export interface CacheStorage {
2559
- get(key: string): Promise<any>;
2560
- set(key: string, value: any): Promise<void>;
2561
- }
2562
- export interface WorkerOptions {
2563
- maxConcurrentWorkers?: number;
2564
- maxConcurrentTasksPerWorker?: number;
2565
- logger?: Logger;
2566
- }
2567
- export interface RollupInterface {
2568
- rollup: {
2569
- (config: any): Promise<any>;
2570
- };
2571
- plugins: {
2572
- nodeResolve(opts: any): any;
2573
- replace(opts: any): any;
2574
- commonjs(opts: any): any;
2575
- json(): any;
2576
- };
2577
- }
2578
- export interface ResolveModuleOptions {
2579
- manuallyResolve?: boolean;
2580
- packageJson?: boolean;
2581
- }
2582
- export interface PrerenderStartOptions {
2583
- buildId?: string;
2584
- hydrateAppFilePath?: string;
2585
- componentGraph?: BuildResultsComponentGraph;
2586
- srcIndexHtmlPath?: string;
2587
- }
2588
- export interface PrerenderResults {
2589
- buildId: string;
2590
- diagnostics: Diagnostic[];
2591
- urls: number;
2592
- duration: number;
2593
- average: number;
2594
- }
2595
- /**
2596
- * Input for CSS optimization functions, including the input CSS
2597
- * string and a few boolean options which turn on or off various
2598
- * optimizations.
2599
- */
2600
- export interface OptimizeCssInput {
2601
- input: string;
2602
- filePath?: string;
2603
- autoprefixer?: boolean | null | AutoprefixerOptions;
2604
- minify?: boolean;
2605
- sourceMap?: boolean;
2606
- resolveUrl?: (url: string) => Promise<string> | string;
2607
- }
2608
- /**
2609
- * This is not a real interface describing the options which can
2610
- * be passed to autoprefixer, for that see the docs, here:
2611
- * https://github.com/postcss/autoprefixer#options
2612
- *
2613
- * Instead, this basically just serves as a label type to track
2614
- * that arguments are being passed consistently.
2615
- */
2616
- export type AutoprefixerOptions = Object;
2617
- /**
2618
- * Output from CSS optimization functions, wrapping up optimized
2619
- * CSS and any diagnostics produced during optimization.
2620
- */
2621
- export interface OptimizeCssOutput {
2622
- output: string;
2623
- diagnostics: Diagnostic[];
2624
- }
2625
- export interface OptimizeJsInput {
2626
- input: string;
2627
- filePath?: string;
2628
- target?: 'es5' | 'latest';
2629
- pretty?: boolean;
2630
- sourceMap?: boolean;
2631
- }
2632
- export interface OptimizeJsOutput {
2633
- output: string;
2634
- sourceMap: any;
2635
- diagnostics: Diagnostic[];
2636
- }
2637
- export interface LazyRequire {
2638
- ensure(fromDir: string, moduleIds: string[]): Promise<Diagnostic[]>;
2639
- require(fromDir: string, moduleId: string): any;
2640
- getModulePath(fromDir: string, moduleId: string): string;
2641
- }
2642
- /**
2643
- * @deprecated This interface is no longer used by Stencil
2644
- * TODO(STENCIL-743): Remove this interface
2645
- */
2646
- export interface FsWatcherItem {
2647
- close(): void;
2648
- }
2649
- /**
2650
- * @deprecated This interface is no longer used by Stencil
2651
- * TODO(STENCIL-743): Remove this interface
2652
- */
2653
- export interface MakeDirectoryOptions {
2654
- /**
2655
- * Indicates whether parent folders should be created.
2656
- * @default false
2657
- */
2658
- recursive?: boolean;
2659
- /**
2660
- * A file mode. If a string is passed, it is parsed as an octal integer. If not specified
2661
- * @default 0o777.
2662
- */
2663
- mode?: number;
2664
- }
2665
- /**
2666
- * @deprecated This interface is no longer used by Stencil
2667
- * TODO(STENCIL-743): Remove this interface
2668
- */
2669
- export interface FsStats {
2670
- isFile(): boolean;
2671
- isDirectory(): boolean;
2672
- isBlockDevice(): boolean;
2673
- isCharacterDevice(): boolean;
2674
- isSymbolicLink(): boolean;
2675
- isFIFO(): boolean;
2676
- isSocket(): boolean;
2677
- dev: number;
2678
- ino: number;
2679
- mode: number;
2680
- nlink: number;
2681
- uid: number;
2682
- gid: number;
2683
- rdev: number;
2684
- size: number;
2685
- blksize: number;
2686
- blocks: number;
2687
- atime: Date;
2688
- mtime: Date;
2689
- ctime: Date;
2690
- birthtime: Date;
2691
- }
2692
- export interface Compiler {
2693
- build(): Promise<CompilerBuildResults>;
2694
- createWatcher(): Promise<CompilerWatcher>;
2695
- destroy(): Promise<void>;
2696
- sys: CompilerSystem;
2697
- }
2698
- export interface CompilerWatcher extends BuildOnEvents {
2699
- start: () => Promise<WatcherCloseResults>;
2700
- close: () => Promise<WatcherCloseResults>;
2701
- request: (data: CompilerRequest) => Promise<CompilerRequestResponse>;
2702
- }
2703
- export interface CompilerRequest {
2704
- path?: string;
2705
- }
2706
- export interface WatcherCloseResults {
2707
- exitCode: number;
2708
- }
2709
- export interface CompilerRequestResponse {
2710
- path: string;
2711
- nodeModuleId: string;
2712
- nodeModuleVersion: string;
2713
- nodeResolvedPath: string;
2714
- cachePath: string;
2715
- cacheHit: boolean;
2716
- content: string;
2717
- status: number;
2718
- }
2719
- /**
2720
- * Options for Stencil's string-to-string transpiler
2721
- */
2722
- export interface TranspileOptions {
2723
- /**
2724
- * A component can be defined as a custom element by using `customelement`, or the
2725
- * component class can be exported by using `module`. Default is `customelement`.
2726
- */
2727
- componentExport?: 'customelement' | 'module' | string | undefined;
2728
- /**
2729
- * Sets how and if component metadata should be assigned on the compiled
2730
- * component output. The `compilerstatic` value will set the metadata to
2731
- * a static `COMPILER_META` getter on the component class. This option
2732
- * is useful for unit testing preprocessors. Default is `null`.
2733
- */
2734
- componentMetadata?: 'runtimestatic' | 'compilerstatic' | string | undefined;
2735
- /**
2736
- * The actual internal import path for any `@stencil/core` imports.
2737
- * Default is `@stencil/core/internal/client`.
2738
- */
2739
- coreImportPath?: string;
2740
- /**
2741
- * The current working directory. Default is `/`.
2742
- */
2743
- currentDirectory?: string;
2744
- /**
2745
- * The filename of the code being compiled. Default is `module.tsx`.
2746
- */
2747
- file?: string;
2748
- /**
2749
- * Module format to use for the compiled code output, which can be either `esm` or `cjs`.
2750
- * Default is `esm`.
2751
- */
2752
- module?: 'cjs' | 'esm' | string;
2753
- /**
2754
- * Sets how and if any properties, methods and events are proxied on the
2755
- * component class. The `defineproperty` value sets the getters and setters
2756
- * using Object.defineProperty. Default is `defineproperty`.
2757
- */
2758
- proxy?: 'defineproperty' | string | undefined;
2759
- /**
2760
- * How component styles should be associated to the component. The `static`
2761
- * setting will assign the styles as a static getter on the component class.
2762
- */
2763
- style?: 'static' | string | undefined;
2764
- /**
2765
- * How style data should be added for imports. For example, the `queryparams` value
2766
- * adds the component's tagname and encapsulation info as querystring parameter
2767
- * to the style's import, such as `style.css?tag=my-tag&encapsulation=shadow`. This
2768
- * style data can be used by bundlers to further optimize each component's css.
2769
- * Set to `null` to not include the querystring parameters. Default is `queryparams`.
2770
- */
2771
- styleImportData?: 'queryparams' | string | undefined;
2772
- /**
2773
- * The JavaScript source target TypeScript should to transpile to. Values can be
2774
- * `latest`, `esnext`, `es2017`, `es2015`, or `es5`. Defaults to `latest`.
2775
- */
2776
- target?: CompileTarget;
2777
- /**
2778
- * Create a source map. Using `inline` will inline the source map into the
2779
- * code, otherwise the source map will be in the returned `map` property.
2780
- * Default is `true`.
2781
- */
2782
- sourceMap?: boolean | 'inline';
2783
- /**
2784
- * Base directory to resolve non-relative module names. Same as the `baseUrl`
2785
- * TypeScript compiler option: https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping
2786
- */
2787
- baseUrl?: string;
2788
- /**
2789
- * List of path mapping entries for module names to locations relative to the `baseUrl`.
2790
- * Same as the `paths` TypeScript compiler option:
2791
- * https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping
2792
- */
2793
- paths?: {
2794
- [key: string]: string[];
2795
- };
2796
- /**
2797
- * JSX mode for TypeScript compilation. Can be 'react', 'react-jsx', 'react-jsxdev', etc.
2798
- * Same as the `jsx` TypeScript compiler option.
2799
- */
2800
- jsx?: number;
2801
- /**
2802
- * Module specifier for JSX factory. Used with automatic JSX runtime.
2803
- * Same as the `jsxImportSource` TypeScript compiler option.
2804
- */
2805
- jsxImportSource?: string;
2806
- /**
2807
- * Passed in Stencil Compiler System, otherwise falls back to the internal in-memory only system.
2808
- */
2809
- sys?: CompilerSystem;
2810
- /**
2811
- * This option enables the same behavior as {@link Config.transformAliasedImportPaths}, transforming paths aliased in
2812
- * `tsconfig.json` to relative paths.
2813
- */
2814
- transformAliasedImportPaths?: boolean;
2815
- /**
2816
- * List of tags to transform, by default only the incoming component tag is transformed
2817
- */
2818
- tagsToTransform?: string[];
2819
- /**
2820
- * Adds `transformTag` calls to css strings and querySelector(All) calls
2821
- */
2822
- additionalTagTransformers?: boolean;
2823
- }
2824
- export type CompileTarget = 'latest' | 'esnext' | 'es2020' | 'es2019' | 'es2018' | 'es2017' | 'es2015' | 'es5' | string | undefined;
2825
- export interface TranspileResults {
2826
- code: string;
2827
- data?: any[];
2828
- diagnostics: Diagnostic[];
2829
- imports?: {
2830
- path: string;
2831
- }[];
2832
- inputFileExtension: string;
2833
- inputFilePath: string;
2834
- map: any;
2835
- outputFilePath: string;
2836
- }
2837
- export interface TransformOptions {
2838
- coreImportPath: string;
2839
- componentExport: 'lazy' | 'module' | 'customelement' | null;
2840
- componentMetadata: 'runtimestatic' | 'compilerstatic' | null;
2841
- currentDirectory: string;
2842
- file?: string;
2843
- isolatedModules?: boolean;
2844
- module?: 'cjs' | 'esm';
2845
- proxy: 'defineproperty' | null;
2846
- style: 'static' | null;
2847
- styleImportData: 'queryparams' | null;
2848
- target?: string;
2849
- }
2850
- export interface CompileScriptMinifyOptions {
2851
- target?: CompileTarget;
2852
- pretty?: boolean;
2853
- }
2854
- export interface DevServer extends BuildEmitEvents {
2855
- address: string;
2856
- basePath: string;
2857
- browserUrl: string;
2858
- protocol: string;
2859
- port: number;
2860
- root: string;
2861
- close(): Promise<void>;
2862
- }
2863
- export interface CliInitOptions {
2864
- args: string[];
2865
- logger: Logger;
2866
- sys: CompilerSystem;
2867
- }