@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.
- package/bin/stencil.mjs +2 -0
- package/dist/chunk-ClPoSABd.mjs +21 -0
- package/dist/client-DR9zhmKG.mjs +4449 -0
- package/dist/compiler/index.d.mts +187 -0
- package/dist/compiler/index.mjs +9 -0
- package/dist/compiler/utils/index.d.mts +3 -0
- package/dist/compiler/utils/index.mjs +5 -0
- package/dist/declarations/stencil-public-compiler.d.ts +4401 -0
- package/dist/declarations/stencil-public-compiler.js +53 -0
- package/dist/declarations/stencil-public-runtime.d.ts +1857 -0
- package/dist/index-Bxo2jCf6.d.mts +77 -0
- package/dist/index-szczUd2l.d.mts +6851 -0
- package/{internal/stencil-core/index.d.ts → dist/index.d.mts} +7 -3
- package/dist/index.mjs +4 -0
- package/dist/mock-doc.d.mts +1 -0
- package/dist/mock-doc.mjs +3 -0
- package/dist/node-sys-BGURUNOZ.mjs +1954 -0
- package/{internal → dist/runtime}/app-data/index.d.ts +11 -7
- package/dist/runtime/app-data/index.js +100 -0
- package/dist/runtime/app-globals/index.d.ts +5 -0
- package/dist/runtime/app-globals/index.js +6 -0
- package/dist/runtime/client/index.d.ts +2286 -0
- package/dist/runtime/client/index.js +4839 -0
- package/dist/runtime/index.d.ts +221 -0
- package/dist/runtime/index.js +4819 -0
- package/dist/runtime/server/index.d.mts +1277 -0
- package/dist/runtime/server/index.mjs +5376 -0
- package/dist/runtime/server/runner.d.mts +298 -0
- package/dist/runtime/server/runner.mjs +1976 -0
- package/dist/serialize-BJvhE9aQ.mjs +775 -0
- package/dist/stencil-private-Cgcr414u.d.ts +1893 -0
- package/dist/sys/node/index.d.mts +33 -0
- package/dist/sys/node/index.mjs +7 -0
- package/dist/sys/node/worker.d.mts +1 -0
- package/dist/sys/node/worker.mjs +60 -0
- package/dist/testing/index.d.mts +207 -0
- package/dist/testing/index.mjs +1188 -0
- package/dist/transpile-CJQcQEVa.mjs +21854 -0
- package/dist/validation-BdcPruW_.mjs +1451 -0
- package/package.json +88 -232
- package/bin/stencil +0 -57
- package/cli/config-flags.d.ts +0 -132
- package/cli/index.cjs +0 -5816
- package/cli/index.d.ts +0 -19
- package/cli/index.js +0 -5809
- package/cli/package.json +0 -14
- package/compiler/lib.d.ts +0 -22
- package/compiler/lib.decorators.d.ts +0 -384
- package/compiler/lib.decorators.legacy.d.ts +0 -22
- package/compiler/lib.dom.asynciterable.d.ts +0 -41
- package/compiler/lib.dom.d.ts +0 -29610
- package/compiler/lib.dom.iterable.d.ts +0 -493
- package/compiler/lib.es2015.collection.d.ts +0 -147
- package/compiler/lib.es2015.core.d.ts +0 -597
- package/compiler/lib.es2015.d.ts +0 -28
- package/compiler/lib.es2015.generator.d.ts +0 -77
- package/compiler/lib.es2015.iterable.d.ts +0 -605
- package/compiler/lib.es2015.promise.d.ts +0 -81
- package/compiler/lib.es2015.proxy.d.ts +0 -128
- package/compiler/lib.es2015.reflect.d.ts +0 -144
- package/compiler/lib.es2015.symbol.d.ts +0 -46
- package/compiler/lib.es2015.symbol.wellknown.d.ts +0 -326
- package/compiler/lib.es2016.array.include.d.ts +0 -116
- package/compiler/lib.es2016.d.ts +0 -21
- package/compiler/lib.es2016.full.d.ts +0 -23
- package/compiler/lib.es2016.intl.d.ts +0 -31
- package/compiler/lib.es2017.arraybuffer.d.ts +0 -21
- package/compiler/lib.es2017.d.ts +0 -26
- package/compiler/lib.es2017.date.d.ts +0 -31
- package/compiler/lib.es2017.full.d.ts +0 -23
- package/compiler/lib.es2017.intl.d.ts +0 -44
- package/compiler/lib.es2017.object.d.ts +0 -49
- package/compiler/lib.es2017.sharedmemory.d.ts +0 -135
- package/compiler/lib.es2017.string.d.ts +0 -45
- package/compiler/lib.es2017.typedarrays.d.ts +0 -53
- package/compiler/lib.es2018.asyncgenerator.d.ts +0 -77
- package/compiler/lib.es2018.asynciterable.d.ts +0 -53
- package/compiler/lib.es2018.d.ts +0 -24
- package/compiler/lib.es2018.full.d.ts +0 -24
- package/compiler/lib.es2018.intl.d.ts +0 -83
- package/compiler/lib.es2018.promise.d.ts +0 -30
- package/compiler/lib.es2018.regexp.d.ts +0 -37
- package/compiler/lib.es2019.array.d.ts +0 -79
- package/compiler/lib.es2019.d.ts +0 -24
- package/compiler/lib.es2019.full.d.ts +0 -24
- package/compiler/lib.es2019.intl.d.ts +0 -23
- package/compiler/lib.es2019.object.d.ts +0 -33
- package/compiler/lib.es2019.string.d.ts +0 -37
- package/compiler/lib.es2019.symbol.d.ts +0 -24
- package/compiler/lib.es2020.bigint.d.ts +0 -765
- package/compiler/lib.es2020.d.ts +0 -27
- package/compiler/lib.es2020.date.d.ts +0 -42
- package/compiler/lib.es2020.full.d.ts +0 -24
- package/compiler/lib.es2020.intl.d.ts +0 -474
- package/compiler/lib.es2020.number.d.ts +0 -28
- package/compiler/lib.es2020.promise.d.ts +0 -47
- package/compiler/lib.es2020.sharedmemory.d.ts +0 -99
- package/compiler/lib.es2020.string.d.ts +0 -44
- package/compiler/lib.es2020.symbol.wellknown.d.ts +0 -41
- package/compiler/lib.es2021.d.ts +0 -23
- package/compiler/lib.es2021.full.d.ts +0 -24
- package/compiler/lib.es2021.intl.d.ts +0 -166
- package/compiler/lib.es2021.promise.d.ts +0 -48
- package/compiler/lib.es2021.string.d.ts +0 -33
- package/compiler/lib.es2021.weakref.d.ts +0 -78
- package/compiler/lib.es2022.array.d.ts +0 -121
- package/compiler/lib.es2022.d.ts +0 -25
- package/compiler/lib.es2022.error.d.ts +0 -75
- package/compiler/lib.es2022.full.d.ts +0 -24
- package/compiler/lib.es2022.intl.d.ts +0 -121
- package/compiler/lib.es2022.object.d.ts +0 -26
- package/compiler/lib.es2022.regexp.d.ts +0 -39
- package/compiler/lib.es2022.string.d.ts +0 -25
- package/compiler/lib.es2023.array.d.ts +0 -924
- package/compiler/lib.es2023.collection.d.ts +0 -21
- package/compiler/lib.es2023.d.ts +0 -22
- package/compiler/lib.es2023.full.d.ts +0 -24
- package/compiler/lib.es2023.intl.d.ts +0 -56
- package/compiler/lib.es2024.arraybuffer.d.ts +0 -65
- package/compiler/lib.es2024.collection.d.ts +0 -29
- package/compiler/lib.es2024.d.ts +0 -26
- package/compiler/lib.es2024.full.d.ts +0 -24
- package/compiler/lib.es2024.object.d.ts +0 -29
- package/compiler/lib.es2024.promise.d.ts +0 -35
- package/compiler/lib.es2024.regexp.d.ts +0 -25
- package/compiler/lib.es2024.sharedmemory.d.ts +0 -68
- package/compiler/lib.es2024.string.d.ts +0 -29
- package/compiler/lib.es5.d.ts +0 -4594
- package/compiler/lib.es6.d.ts +0 -23
- package/compiler/lib.esnext.array.d.ts +0 -35
- package/compiler/lib.esnext.collection.d.ts +0 -96
- package/compiler/lib.esnext.d.ts +0 -27
- package/compiler/lib.esnext.decorators.d.ts +0 -28
- package/compiler/lib.esnext.disposable.d.ts +0 -193
- package/compiler/lib.esnext.float16.d.ts +0 -443
- package/compiler/lib.esnext.full.d.ts +0 -24
- package/compiler/lib.esnext.intl.d.ts +0 -21
- package/compiler/lib.esnext.iterator.d.ts +0 -148
- package/compiler/lib.esnext.promise.d.ts +0 -34
- package/compiler/lib.scripthost.d.ts +0 -322
- package/compiler/lib.webworker.asynciterable.d.ts +0 -41
- package/compiler/lib.webworker.d.ts +0 -9894
- package/compiler/lib.webworker.importscripts.d.ts +0 -23
- package/compiler/lib.webworker.iterable.d.ts +0 -287
- package/compiler/package.json +0 -8
- package/compiler/stencil.d.ts +0 -73
- package/compiler/stencil.js +0 -287816
- package/compiler/sys/in-memory-fs.d.ts +0 -227
- package/compiler/transpile.d.ts +0 -32
- package/dev-server/client/app-error.d.ts +0 -20
- package/dev-server/client/events.d.ts +0 -6
- package/dev-server/client/hmr-components.d.ts +0 -12
- package/dev-server/client/hmr-external-styles.d.ts +0 -1
- package/dev-server/client/hmr-images.d.ts +0 -1
- package/dev-server/client/hmr-inline-styles.d.ts +0 -1
- package/dev-server/client/hmr-util.d.ts +0 -39
- package/dev-server/client/hmr-window.d.ts +0 -10
- package/dev-server/client/index.d.ts +0 -6
- package/dev-server/client/index.js +0 -793
- package/dev-server/client/logger.d.ts +0 -6
- package/dev-server/client/package.json +0 -8
- package/dev-server/client/progress.d.ts +0 -3
- package/dev-server/client/status.d.ts +0 -4
- package/dev-server/client/test/hmr-util.spec.d.ts +0 -1
- package/dev-server/client/test/status.spec.d.ts +0 -1
- package/dev-server/connector.html +0 -6
- package/dev-server/index.d.ts +0 -3
- package/dev-server/index.js +0 -247
- package/dev-server/package.json +0 -8
- package/dev-server/server-process.js +0 -12095
- package/dev-server/server-worker-thread.js +0 -39
- package/dev-server/static/favicon.ico +0 -0
- package/dev-server/templates/directory-index.html +0 -176
- package/dev-server/templates/initial-load.html +0 -168
- package/dev-server/visualstudio.vbs +0 -82
- package/dev-server/xdg-open +0 -1066
- package/internal/app-data/index.cjs +0 -119
- package/internal/app-data/index.js +0 -92
- package/internal/app-data/package.json +0 -15
- package/internal/app-globals/index.d.ts +0 -2
- package/internal/app-globals/index.js +0 -14
- package/internal/app-globals/package.json +0 -14
- package/internal/child_process.d.ts +0 -7
- package/internal/client/index.js +0 -4736
- package/internal/client/package.json +0 -10
- package/internal/client/patch-browser.js +0 -45
- package/internal/client/polyfills/core-js.js +0 -11
- package/internal/client/polyfills/dom.js +0 -79
- package/internal/client/polyfills/es5-html-element.js +0 -1
- package/internal/client/polyfills/index.js +0 -34
- package/internal/client/polyfills/system.js +0 -6
- package/internal/client/shadow-css.js +0 -414
- package/internal/hydrate/index.js +0 -6671
- package/internal/hydrate/package.json +0 -7
- package/internal/hydrate/runner.d.ts +0 -287
- package/internal/hydrate/runner.js +0 -17950
- package/internal/index.d.ts +0 -4
- package/internal/index.js +0 -2
- package/internal/package.json +0 -9
- package/internal/stencil-core/index.cjs +0 -1
- package/internal/stencil-core/index.js +0 -18
- package/internal/stencil-core/jsx-dev-runtime.cjs +0 -7
- package/internal/stencil-core/jsx-dev-runtime.d.ts +0 -41
- package/internal/stencil-core/jsx-dev-runtime.js +0 -2
- package/internal/stencil-core/jsx-runtime.cjs +0 -8
- package/internal/stencil-core/jsx-runtime.d.ts +0 -40
- package/internal/stencil-core/jsx-runtime.js +0 -2
- package/internal/stencil-private.d.ts +0 -2549
- package/internal/stencil-public-compiler.d.ts +0 -2867
- package/internal/stencil-public-runtime.d.ts +0 -1860
- package/internal/testing/index.js +0 -6528
- package/internal/testing/jsx-dev-runtime.d.ts +0 -2
- package/internal/testing/jsx-dev-runtime.js +0 -8
- package/internal/testing/jsx-runtime.d.ts +0 -2
- package/internal/testing/jsx-runtime.js +0 -9
- package/internal/testing/package.json +0 -7
- package/internal/utils/index.d.ts +0 -1
- package/internal/utils/result.d.ts +0 -112
- package/mock-doc/index.cjs +0 -10165
- package/mock-doc/index.d.ts +0 -1172
- package/mock-doc/index.js +0 -10144
- package/mock-doc/package.json +0 -15
- package/readme.md +0 -94
- package/screenshot/compare/assets/favicon.ico +0 -0
- package/screenshot/compare/assets/logo.png +0 -0
- package/screenshot/compare/build/app.css +0 -1
- package/screenshot/compare/build/app.esm.js +0 -1
- package/screenshot/compare/build/app.js +0 -33
- package/screenshot/compare/build/p-081b0641.js +0 -1
- package/screenshot/compare/build/p-227a1e18.entry.js +0 -1
- package/screenshot/compare/build/p-2c298727.entry.js +0 -1
- package/screenshot/compare/build/p-5479268c.entry.js +0 -1
- package/screenshot/compare/build/p-573ec8a4.entry.js +0 -1
- package/screenshot/compare/build/p-6ba08604.entry.js +0 -1
- package/screenshot/compare/build/p-6bc63295.entry.js +0 -1
- package/screenshot/compare/build/p-7a3759fd.entry.js +0 -1
- package/screenshot/compare/build/p-7b4e3ba7.js +0 -1
- package/screenshot/compare/build/p-988eb362.css +0 -1
- package/screenshot/compare/build/p-9b6a9315.js +0 -1
- package/screenshot/compare/build/p-b4cc611c.entry.js +0 -1
- package/screenshot/compare/build/p-d1bf53f5.entry.js +0 -1
- package/screenshot/compare/build/p-e2efe0df.js +0 -1
- package/screenshot/compare/build/p-e8ca6d97.entry.js +0 -1
- package/screenshot/compare/build/p-ec2f13e0.entry.js +0 -1
- package/screenshot/compare/build/p-f0b99977.entry.js +0 -1
- package/screenshot/compare/build/p-f4745c2f.entry.js +0 -1
- package/screenshot/compare/build/p-fbbae598.js +0 -1
- package/screenshot/compare/host.config.json +0 -15
- package/screenshot/compare/index.html +0 -1
- package/screenshot/compare/manifest.json +0 -13
- package/screenshot/connector-base.d.ts +0 -42
- package/screenshot/connector-local.d.ts +0 -7
- package/screenshot/connector.js +0 -2
- package/screenshot/index.d.ts +0 -3
- package/screenshot/index.js +0 -2433
- package/screenshot/local-connector.js +0 -2
- package/screenshot/package.json +0 -15
- package/screenshot/pixel-match.d.ts +0 -1
- package/screenshot/pixel-match.js +0 -2315
- package/screenshot/screenshot-compare.d.ts +0 -20
- package/screenshot/screenshot-fs.d.ts +0 -14
- package/sys/node/460.node-fetch.js +0 -451
- package/sys/node/autoprefixer.js +0 -9
- package/sys/node/glob.js +0 -1
- package/sys/node/graceful-fs.js +0 -1
- package/sys/node/index.d.ts +0 -39
- package/sys/node/index.js +0 -64
- package/sys/node/node-fetch.js +0 -12
- package/sys/node/package.json +0 -8
- package/sys/node/prompts.js +0 -1
- package/sys/node/worker.js +0 -4
- package/testing/index.d.ts +0 -9
- package/testing/index.js +0 -13064
- package/testing/jest/jest-27-and-under/jest-config.d.ts +0 -16
- package/testing/jest/jest-27-and-under/jest-environment.d.ts +0 -2
- package/testing/jest/jest-27-and-under/jest-facade.d.ts +0 -155
- package/testing/jest/jest-27-and-under/jest-preprocessor.d.ts +0 -59
- package/testing/jest/jest-27-and-under/jest-preset.d.ts +0 -3
- package/testing/jest/jest-27-and-under/jest-runner.d.ts +0 -11
- package/testing/jest/jest-27-and-under/jest-screenshot.d.ts +0 -2
- package/testing/jest/jest-27-and-under/jest-serializer.d.ts +0 -4
- package/testing/jest/jest-27-and-under/jest-setup-test-framework.d.ts +0 -9
- package/testing/jest/jest-27-and-under/matchers/attributes.d.ts +0 -14
- package/testing/jest/jest-27-and-under/matchers/class-list.d.ts +0 -12
- package/testing/jest/jest-27-and-under/matchers/events.d.ts +0 -25
- package/testing/jest/jest-27-and-under/matchers/html.d.ts +0 -13
- package/testing/jest/jest-27-and-under/matchers/index.d.ts +0 -24
- package/testing/jest/jest-27-and-under/matchers/screenshot.d.ts +0 -5
- package/testing/jest/jest-27-and-under/matchers/text.d.ts +0 -4
- package/testing/jest/jest-27-and-under/test/jest-config.spec.d.ts +0 -1
- package/testing/jest/jest-27-and-under/test/jest-preprocessor.spec.d.ts +0 -1
- package/testing/jest/jest-27-and-under/test/jest-runner.spec.d.ts +0 -1
- package/testing/jest/jest-27-and-under/test/jest-serializer.spec.d.ts +0 -1
- package/testing/jest/jest-27-and-under/test/jest-setup-test-framework.spec.d.ts +0 -1
- package/testing/jest/jest-28/jest-config.d.ts +0 -16
- package/testing/jest/jest-28/jest-environment.d.ts +0 -2
- package/testing/jest/jest-28/jest-facade.d.ts +0 -134
- package/testing/jest/jest-28/jest-preprocessor.d.ts +0 -35
- package/testing/jest/jest-28/jest-preset.d.ts +0 -3
- package/testing/jest/jest-28/jest-runner.d.ts +0 -11
- package/testing/jest/jest-28/jest-screenshot.d.ts +0 -2
- package/testing/jest/jest-28/jest-serializer.d.ts +0 -4
- package/testing/jest/jest-28/jest-setup-test-framework.d.ts +0 -9
- package/testing/jest/jest-28/matchers/attributes.d.ts +0 -14
- package/testing/jest/jest-28/matchers/class-list.d.ts +0 -12
- package/testing/jest/jest-28/matchers/events.d.ts +0 -25
- package/testing/jest/jest-28/matchers/html.d.ts +0 -13
- package/testing/jest/jest-28/matchers/index.d.ts +0 -24
- package/testing/jest/jest-28/matchers/screenshot.d.ts +0 -5
- package/testing/jest/jest-28/matchers/text.d.ts +0 -4
- package/testing/jest/jest-28/test/jest-config.spec.d.ts +0 -1
- package/testing/jest/jest-28/test/jest-preprocessor.spec.d.ts +0 -1
- package/testing/jest/jest-28/test/jest-runner.spec.d.ts +0 -1
- package/testing/jest/jest-28/test/jest-serializer.spec.d.ts +0 -1
- package/testing/jest/jest-28/test/jest-setup-test-framework.spec.d.ts +0 -1
- package/testing/jest/jest-29/jest-config.d.ts +0 -16
- package/testing/jest/jest-29/jest-environment.d.ts +0 -2
- package/testing/jest/jest-29/jest-facade.d.ts +0 -136
- package/testing/jest/jest-29/jest-preprocessor.d.ts +0 -35
- package/testing/jest/jest-29/jest-preset.d.ts +0 -3
- package/testing/jest/jest-29/jest-runner.d.ts +0 -11
- package/testing/jest/jest-29/jest-screenshot.d.ts +0 -2
- package/testing/jest/jest-29/jest-serializer.d.ts +0 -4
- package/testing/jest/jest-29/jest-setup-test-framework.d.ts +0 -9
- package/testing/jest/jest-29/matchers/attributes.d.ts +0 -14
- package/testing/jest/jest-29/matchers/class-list.d.ts +0 -12
- package/testing/jest/jest-29/matchers/events.d.ts +0 -25
- package/testing/jest/jest-29/matchers/html.d.ts +0 -13
- package/testing/jest/jest-29/matchers/index.d.ts +0 -24
- package/testing/jest/jest-29/matchers/screenshot.d.ts +0 -5
- package/testing/jest/jest-29/matchers/text.d.ts +0 -4
- package/testing/jest/jest-29/test/jest-config.spec.d.ts +0 -1
- package/testing/jest/jest-29/test/jest-preprocessor.spec.d.ts +0 -1
- package/testing/jest/jest-29/test/jest-runner.spec.d.ts +0 -1
- package/testing/jest/jest-29/test/jest-serializer.spec.d.ts +0 -1
- package/testing/jest/jest-29/test/jest-setup-test-framework.spec.d.ts +0 -1
- package/testing/jest/jest-apis.d.ts +0 -86
- package/testing/jest/jest-facade.d.ts +0 -74
- package/testing/jest/jest-stencil-connector.d.ts +0 -65
- package/testing/jest/test/jest-stencil-connector.spec.d.ts +0 -1
- package/testing/jest-environment.js +0 -3
- package/testing/jest-preprocessor.js +0 -3
- package/testing/jest-preset.js +0 -2
- package/testing/jest-runner.js +0 -3
- package/testing/jest-setuptestframework.js +0 -3
- package/testing/mock-fetch.d.ts +0 -11
- package/testing/mocks.d.ts +0 -56
- package/testing/package.json +0 -8
- package/testing/puppeteer/index.d.ts +0 -2
- package/testing/puppeteer/puppeteer-browser.d.ts +0 -6
- package/testing/puppeteer/puppeteer-declarations.d.ts +0 -414
- package/testing/puppeteer/puppeteer-element.d.ts +0 -67
- package/testing/puppeteer/puppeteer-emulate.d.ts +0 -2
- package/testing/puppeteer/puppeteer-events.d.ts +0 -21
- package/testing/puppeteer/puppeteer-page.d.ts +0 -2
- package/testing/puppeteer/puppeteer-screenshot.d.ts +0 -27
- package/testing/puppeteer/test/puppeteer-screenshot.spec.d.ts +0 -1
- package/testing/reset-build-conditionals.d.ts +0 -12
- package/testing/spec-page.d.ts +0 -7
- package/testing/test/testing-utils.spec.d.ts +0 -1
- package/testing/test-transpile.d.ts +0 -2
- package/testing/testing-logger.d.ts +0 -26
- package/testing/testing-sys.d.ts +0 -6
- package/testing/testing-utils.d.ts +0 -80
- package/testing/testing.d.ts +0 -2
- /package/{internal → dist/declarations}/stencil-ext-modules.d.ts +0 -0
- /package/{internal → dist/declarations}/stencil-public-docs.d.ts +0 -0
- /package/{screenshot/compare/build/index.esm.js → dist/declarations/stencil-public-runtime.js} +0 -0
|
@@ -0,0 +1,4401 @@
|
|
|
1
|
+
import { ListenTargetOptions, ResolutionHandler } from "./stencil-public-runtime.js";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/result.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* A Result wraps up a success state and a failure state, allowing you to
|
|
6
|
+
* return a single type from a function and discriminate between the two
|
|
7
|
+
* possible states in a principled way.
|
|
8
|
+
*
|
|
9
|
+
* Using it could look something like this:
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { result } from './';
|
|
13
|
+
*
|
|
14
|
+
* const mightFail = (input: number): Result<number, string> => {
|
|
15
|
+
* try {
|
|
16
|
+
* let value: number = calculateSomethingWithInput(input);
|
|
17
|
+
* return result.ok(value);
|
|
18
|
+
* } catch (e) {
|
|
19
|
+
* return result.err(e.message);
|
|
20
|
+
* }
|
|
21
|
+
* }
|
|
22
|
+
*
|
|
23
|
+
* const sumResult = mightFail(2);
|
|
24
|
+
*
|
|
25
|
+
* const msg = result.map(sumResult, (sum: number) => `the sum was: ${sum}`);
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* A few utility methods are defined in this module, like `map` and `unwrap`,
|
|
29
|
+
* which are (probably obviously) inspired by the correspond methods on
|
|
30
|
+
* `std::result::Result` in Rust.
|
|
31
|
+
*/
|
|
32
|
+
type Result<OnSuccess, OnFailure> = Ok<OnSuccess> | Err<OnFailure>;
|
|
33
|
+
/**
|
|
34
|
+
* Type for the Ok state of a Result
|
|
35
|
+
*/
|
|
36
|
+
type Ok<T> = {
|
|
37
|
+
isOk: true;
|
|
38
|
+
isErr: false;
|
|
39
|
+
value: T;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Type for the Err state of a Result
|
|
43
|
+
*/
|
|
44
|
+
type Err<T> = {
|
|
45
|
+
isOk: false;
|
|
46
|
+
isErr: true;
|
|
47
|
+
value: T;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Create an `Ok` given a value. This doesn't do any checking that the value is
|
|
51
|
+
* 'ok-ish' since doing so would make an undue assumption about what is 'ok'.
|
|
52
|
+
* Instead, this trusts the user to determine, at the call site, whether
|
|
53
|
+
* something is `ok()` or `err()`.
|
|
54
|
+
*
|
|
55
|
+
* @param value the value to wrap up in an `Ok`
|
|
56
|
+
* @returns an Ok wrapping the value
|
|
57
|
+
*/
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/compiler/sys/in-memory-fs.d.ts
|
|
60
|
+
/**
|
|
61
|
+
* An in-memory FS which proxies the underlying OS filesystem using a simple
|
|
62
|
+
* in-memory cache. FS writes can accumulate on the in-memory system, using an
|
|
63
|
+
* API similar to Node.js' `"fs"` module, and then be committed to disk as a
|
|
64
|
+
* unit.
|
|
65
|
+
*
|
|
66
|
+
* Files written to the in-memory system can be edited, deleted, and so on.
|
|
67
|
+
* This allows the compiler to proceed freely as if it is modifying the
|
|
68
|
+
* filesystem, modifying the world in whatever way suits it, while deferring
|
|
69
|
+
* actual FS writes until the end of the compilation process, making actual
|
|
70
|
+
* changes to the filesystem on disk contingent on an error-free build or any
|
|
71
|
+
* other condition.
|
|
72
|
+
*
|
|
73
|
+
* Usage example:
|
|
74
|
+
*
|
|
75
|
+
* ```ts
|
|
76
|
+
* // create an in-memory FS
|
|
77
|
+
* const sys = createSystem();
|
|
78
|
+
* const inMemoryFs = createInMemoryFs(sys);
|
|
79
|
+
*
|
|
80
|
+
* // do a few fs operations
|
|
81
|
+
* await inMemoryFs.writeFile("path/to/file.js", 'console.log("hey!");')
|
|
82
|
+
* await inMemoryFs.remove("path/to/another_file.ts");
|
|
83
|
+
*
|
|
84
|
+
* // commit the results to disk
|
|
85
|
+
* const commitStats = await inMemoryFs.commit();
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* In the above example the write operation and the delete operation (w/
|
|
89
|
+
* `.remove`) are both queued in the in-memory proxy but not committed to
|
|
90
|
+
* disk until the `.commit` method is called.
|
|
91
|
+
*/
|
|
92
|
+
type InMemoryFileSystem = ReturnType<typeof createInMemoryFs>;
|
|
93
|
+
/**
|
|
94
|
+
* A node in the in-memory file system. This may represent a file or
|
|
95
|
+
* a directory, and pending copy, write, and delete operations may be stored
|
|
96
|
+
* on it.
|
|
97
|
+
*/
|
|
98
|
+
interface FsItem {
|
|
99
|
+
fileText: string;
|
|
100
|
+
isFile: boolean;
|
|
101
|
+
isDirectory: boolean;
|
|
102
|
+
size: number;
|
|
103
|
+
mtimeMs: number;
|
|
104
|
+
exists: boolean;
|
|
105
|
+
queueCopyFileToDest: string;
|
|
106
|
+
queueWriteToDisk: boolean;
|
|
107
|
+
queueDeleteFromDisk?: boolean;
|
|
108
|
+
useCache: boolean;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Options supported by write methods on the in-memory filesystem.
|
|
112
|
+
*/
|
|
113
|
+
interface FsWriteOptions {
|
|
114
|
+
/**
|
|
115
|
+
* only use the in-memory cache and do not write the file to disk
|
|
116
|
+
*/
|
|
117
|
+
inMemoryOnly?: boolean;
|
|
118
|
+
clearFileCache?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* flush the write to disk immediately, skipping the in-memory cache
|
|
121
|
+
*/
|
|
122
|
+
immediateWrite?: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* specify that the cache should be used
|
|
125
|
+
*/
|
|
126
|
+
useCache?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* An optional tag for the current output target for which this file is being
|
|
129
|
+
* written.
|
|
130
|
+
*/
|
|
131
|
+
outputTargetType?: string;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Results from a write operation on the in-memory filesystem.
|
|
135
|
+
*/
|
|
136
|
+
interface FsWriteResults {
|
|
137
|
+
changedContent: boolean;
|
|
138
|
+
queuedWrite: boolean;
|
|
139
|
+
ignored: boolean;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Options supported by read methods on the in-memory filesystem.
|
|
143
|
+
*/
|
|
144
|
+
interface FsReadOptions {
|
|
145
|
+
useCache?: boolean;
|
|
146
|
+
setHash?: boolean;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Options supported by the readdir option on the in-memory filesystem.
|
|
150
|
+
*/
|
|
151
|
+
interface FsReaddirOptions {
|
|
152
|
+
inMemoryOnly?: boolean;
|
|
153
|
+
recursive?: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Directory names to exclude. Just the basename,
|
|
156
|
+
* not the entire path. Basically for "node_modules".
|
|
157
|
+
*/
|
|
158
|
+
excludeDirNames?: string[];
|
|
159
|
+
/**
|
|
160
|
+
* Extensions we know we can avoid. Each extension
|
|
161
|
+
* should include the `.` so that we can test for both
|
|
162
|
+
* `.d.ts.` and `.ts`. If `excludeExtensions` isn't provided it
|
|
163
|
+
* doesn't try to exclude anything. This only checks against
|
|
164
|
+
* the filename, not directory names when recursive.
|
|
165
|
+
*/
|
|
166
|
+
excludeExtensions?: string[];
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* A result from a directory read operation
|
|
170
|
+
*/
|
|
171
|
+
interface FsReaddirItem {
|
|
172
|
+
absPath: string;
|
|
173
|
+
relPath: string;
|
|
174
|
+
isDirectory: boolean;
|
|
175
|
+
isFile: boolean;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Information about a file in the in-memory filesystem.
|
|
179
|
+
*/
|
|
180
|
+
interface FsStat {
|
|
181
|
+
exists: boolean;
|
|
182
|
+
isFile: boolean;
|
|
183
|
+
isDirectory: boolean;
|
|
184
|
+
size: number;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Create an in-memory FS which proxies the underlying OS filesystem using an
|
|
188
|
+
* in-memory cache. FS writes can accumulate on the in-memory system, using an
|
|
189
|
+
* API similar to Node.js' `"fs"` module, and then be committed to disk as a
|
|
190
|
+
* unit.
|
|
191
|
+
*
|
|
192
|
+
* Files written to the in-memory system can be edited, deleted, and so on.
|
|
193
|
+
* This allows the compiler to proceed freely as if it is modifying the
|
|
194
|
+
* filesystem, modifying the world in whatever way suits it, while deferring
|
|
195
|
+
* actual FS writes until the end of the compilation process, making actual
|
|
196
|
+
* changes to the filesystem on disk contingent on an error-free build or any
|
|
197
|
+
* other condition.
|
|
198
|
+
*
|
|
199
|
+
* @param sys a compiler system object
|
|
200
|
+
* @returns an in-memory filesystem interface
|
|
201
|
+
*/
|
|
202
|
+
declare const createInMemoryFs: (sys: CompilerSystem) => {
|
|
203
|
+
access: (filePath: string) => Promise<boolean>;
|
|
204
|
+
accessSync: (filePath: string) => boolean;
|
|
205
|
+
cancelDeleteDirectoriesFromDisk: (dirPaths: string[]) => void;
|
|
206
|
+
cancelDeleteFilesFromDisk: (filePaths: string[]) => void;
|
|
207
|
+
clearCache: () => void;
|
|
208
|
+
clearDirCache: (dirPath: string) => void;
|
|
209
|
+
clearFileCache: (filePath: string) => void;
|
|
210
|
+
commit: () => Promise<FsCommitResults>;
|
|
211
|
+
copyFile: (src: string, dest: string) => Promise<void>;
|
|
212
|
+
emptyDirs: (dirs: string[]) => Promise<void>;
|
|
213
|
+
getBuildOutputs: () => BuildOutput[];
|
|
214
|
+
getItem: (itemPath: string) => FsItem;
|
|
215
|
+
getMemoryStats: () => string;
|
|
216
|
+
readFile: (filePath: string, opts?: FsReadOptions) => Promise<string>;
|
|
217
|
+
readFileSync: (filePath: string, opts?: FsReadOptions) => string;
|
|
218
|
+
readdir: (dirPath: string, opts?: FsReaddirOptions) => Promise<FsReaddirItem[]>;
|
|
219
|
+
remove: (itemPath: string) => Promise<void>;
|
|
220
|
+
stat: (itemPath: string) => Promise<FsStat>;
|
|
221
|
+
statSync: (itemPath: string) => FsStat;
|
|
222
|
+
sys: CompilerSystem;
|
|
223
|
+
writeFile: (filePath: string, content: string, opts?: FsWriteOptions) => Promise<FsWriteResults>;
|
|
224
|
+
writeFiles: (files: {
|
|
225
|
+
[filePath: string]: string;
|
|
226
|
+
} | Map<string, string>, opts?: FsWriteOptions) => Promise<FsWriteResults[]>;
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* The information needed to carry out a file copy operation.
|
|
230
|
+
*
|
|
231
|
+
* `[ source, destination ]`
|
|
232
|
+
*/
|
|
233
|
+
type FileCopyTuple = [string, string];
|
|
234
|
+
/**
|
|
235
|
+
* Collected instructions for all pending filesystem operations saved
|
|
236
|
+
* to the in-memory filesystem.
|
|
237
|
+
*/
|
|
238
|
+
/**
|
|
239
|
+
* Results from committing pending filesystem operations
|
|
240
|
+
*/
|
|
241
|
+
interface FsCommitResults {
|
|
242
|
+
filesCopied: FileCopyTuple[];
|
|
243
|
+
filesWritten: string[];
|
|
244
|
+
filesDeleted: string[];
|
|
245
|
+
dirsDeleted: string[];
|
|
246
|
+
dirsAdded: string[];
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Given the current state of the in-memory proxy filesystem, collect all of
|
|
250
|
+
* the changes that need to be made in order to commit the currently-pending
|
|
251
|
+
* operations (e.g. write, copy, delete) to the OS filesystem.
|
|
252
|
+
*
|
|
253
|
+
* @param items the storage data structure for the in-memory FS cache
|
|
254
|
+
* @returns a collection of all the operations that need to be done
|
|
255
|
+
*/
|
|
256
|
+
//#endregion
|
|
257
|
+
//#region src/declarations/stencil-public-docs.d.ts
|
|
258
|
+
/**
|
|
259
|
+
* The Type Library holds information about the types which are used in a
|
|
260
|
+
* Stencil project. During compilation, Stencil gathers information about the
|
|
261
|
+
* types which form part of a component's public API, such as properties
|
|
262
|
+
* decorated with `@Prop`, `@Event`, `@Watch`, etc. This type information is
|
|
263
|
+
* then added to the Type Library, where it can be accessed later on for
|
|
264
|
+
* generating documentation.
|
|
265
|
+
*
|
|
266
|
+
* This information is included in the file written by the `docs-json` output
|
|
267
|
+
* target (see {@link JsonDocs.typeLibrary}).
|
|
268
|
+
*/
|
|
269
|
+
type JsonDocsTypeLibrary = Record<string, ComponentCompilerReferencedType>;
|
|
270
|
+
/**
|
|
271
|
+
* A container for JSDoc metadata for a project
|
|
272
|
+
*/
|
|
273
|
+
interface JsonDocs {
|
|
274
|
+
/**
|
|
275
|
+
* The metadata for the JSDocs for each component in a Stencil project
|
|
276
|
+
*/
|
|
277
|
+
components: JsonDocsComponent[];
|
|
278
|
+
/**
|
|
279
|
+
* The timestamp at which the metadata was generated, in the format YYYY-MM-DDThh:mm:ss
|
|
280
|
+
*/
|
|
281
|
+
timestamp: string;
|
|
282
|
+
compiler: {
|
|
283
|
+
/**
|
|
284
|
+
* The name of the compiler that generated the metadata
|
|
285
|
+
*/
|
|
286
|
+
name: string;
|
|
287
|
+
/**
|
|
288
|
+
* The version of the Stencil compiler that generated the metadata
|
|
289
|
+
*/
|
|
290
|
+
version: string;
|
|
291
|
+
/**
|
|
292
|
+
* The version of TypeScript that was used to generate the metadata
|
|
293
|
+
*/
|
|
294
|
+
typescriptVersion: string;
|
|
295
|
+
};
|
|
296
|
+
typeLibrary: JsonDocsTypeLibrary;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Container for JSDoc metadata for a single Stencil component
|
|
300
|
+
*/
|
|
301
|
+
interface JsonDocsComponent {
|
|
302
|
+
/**
|
|
303
|
+
* The directory containing the Stencil component, minus the file name.
|
|
304
|
+
*
|
|
305
|
+
* @example /workspaces/stencil-project/src/components/my-component
|
|
306
|
+
*/
|
|
307
|
+
dirPath?: string;
|
|
308
|
+
/**
|
|
309
|
+
* The name of the file containing the Stencil component, with no path
|
|
310
|
+
*
|
|
311
|
+
* @example my-component.tsx
|
|
312
|
+
*/
|
|
313
|
+
fileName?: string;
|
|
314
|
+
/**
|
|
315
|
+
* The full path of the file containing the Stencil component
|
|
316
|
+
*
|
|
317
|
+
* @example /workspaces/stencil-project/src/components/my-component/my-component.tsx
|
|
318
|
+
*/
|
|
319
|
+
filePath?: string;
|
|
320
|
+
/**
|
|
321
|
+
* The path to the component's `readme.md` file, including the filename
|
|
322
|
+
*
|
|
323
|
+
* @example /workspaces/stencil-project/src/components/my-component/readme.md
|
|
324
|
+
*/
|
|
325
|
+
readmePath?: string;
|
|
326
|
+
/**
|
|
327
|
+
* The path to the component's `usage` directory
|
|
328
|
+
*
|
|
329
|
+
* @example /workspaces/stencil-project/src/components/my-component/usage/
|
|
330
|
+
*/
|
|
331
|
+
usagesDir?: string;
|
|
332
|
+
/**
|
|
333
|
+
* The encapsulation strategy for a component
|
|
334
|
+
*/
|
|
335
|
+
encapsulation: 'shadow' | 'scoped' | 'none';
|
|
336
|
+
/**
|
|
337
|
+
* The tag name for the component, for use in HTML
|
|
338
|
+
*/
|
|
339
|
+
tag: string;
|
|
340
|
+
/**
|
|
341
|
+
* The contents of a component's `readme.md` that are user generated.
|
|
342
|
+
*
|
|
343
|
+
* Auto-generated contents are not stored in this reference.
|
|
344
|
+
*/
|
|
345
|
+
readme: string;
|
|
346
|
+
/**
|
|
347
|
+
* The description of a Stencil component, found in the JSDoc that sits above the component's declaration
|
|
348
|
+
*/
|
|
349
|
+
docs: string;
|
|
350
|
+
/**
|
|
351
|
+
* JSDoc tags found in the JSDoc comment written atop a component's declaration
|
|
352
|
+
*/
|
|
353
|
+
docsTags: JsonDocsTag[];
|
|
354
|
+
/**
|
|
355
|
+
* The text from the class-level JSDoc for a Stencil component, if present.
|
|
356
|
+
*/
|
|
357
|
+
overview?: string;
|
|
358
|
+
/**
|
|
359
|
+
* A mapping of usage example file names to their contents for the component.
|
|
360
|
+
*/
|
|
361
|
+
usage: JsonDocsUsage;
|
|
362
|
+
/**
|
|
363
|
+
* Array of metadata for a component's `@Prop`s
|
|
364
|
+
*/
|
|
365
|
+
props: JsonDocsProp[];
|
|
366
|
+
/**
|
|
367
|
+
* Array of metadata for a component's `@Method`s
|
|
368
|
+
*/
|
|
369
|
+
methods: JsonDocsMethod[];
|
|
370
|
+
/**
|
|
371
|
+
* Array of metadata for a component's `@Event`s
|
|
372
|
+
*/
|
|
373
|
+
events: JsonDocsEvent[];
|
|
374
|
+
/**
|
|
375
|
+
* Array of metadata for a component's `@Listen` handlers
|
|
376
|
+
*/
|
|
377
|
+
listeners: JsonDocsListener[];
|
|
378
|
+
/**
|
|
379
|
+
* Array of metadata for a component's CSS styling information
|
|
380
|
+
*/
|
|
381
|
+
styles: JsonDocsStyle[];
|
|
382
|
+
/**
|
|
383
|
+
* Array of component Slot information, generated from `@slot` tags
|
|
384
|
+
*/
|
|
385
|
+
slots: JsonDocsSlot[];
|
|
386
|
+
/**
|
|
387
|
+
* Array of component Parts information, generate from `@part` tags
|
|
388
|
+
*/
|
|
389
|
+
parts: JsonDocsPart[];
|
|
390
|
+
/**
|
|
391
|
+
* Array of custom states defined via @AttachInternals({ states: {...} })
|
|
392
|
+
*/
|
|
393
|
+
customStates: JsonDocsCustomState[];
|
|
394
|
+
/**
|
|
395
|
+
* Array of metadata describing where the current component is used
|
|
396
|
+
*/
|
|
397
|
+
dependents: string[];
|
|
398
|
+
/**
|
|
399
|
+
* Array of metadata listing the components which are used in current component
|
|
400
|
+
*/
|
|
401
|
+
dependencies: string[];
|
|
402
|
+
/**
|
|
403
|
+
* Describes a tree of components coupling
|
|
404
|
+
*/
|
|
405
|
+
dependencyGraph: JsonDocsDependencyGraph;
|
|
406
|
+
/**
|
|
407
|
+
* A deprecation reason/description found following a `@deprecated` tag
|
|
408
|
+
*/
|
|
409
|
+
deprecation?: string;
|
|
410
|
+
}
|
|
411
|
+
interface JsonDocsDependencyGraph {
|
|
412
|
+
[tagName: string]: string[];
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* A descriptor for a single JSDoc tag found in a block comment
|
|
416
|
+
*/
|
|
417
|
+
interface JsonDocsTag {
|
|
418
|
+
/**
|
|
419
|
+
* The tag name (immediately following the '@')
|
|
420
|
+
*/
|
|
421
|
+
name: string;
|
|
422
|
+
/**
|
|
423
|
+
* The description that immediately follows the tag name
|
|
424
|
+
*/
|
|
425
|
+
text?: string;
|
|
426
|
+
}
|
|
427
|
+
interface JsonDocsValue {
|
|
428
|
+
value?: string;
|
|
429
|
+
type: string;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* A mapping of file names to their contents.
|
|
433
|
+
*
|
|
434
|
+
* This type is meant to be used when reading one or more usage markdown files associated with a component. For the
|
|
435
|
+
* given directory structure:
|
|
436
|
+
* ```
|
|
437
|
+
* src/components/my-component
|
|
438
|
+
* ├── my-component.tsx
|
|
439
|
+
* └── usage
|
|
440
|
+
* ├── bar.md
|
|
441
|
+
* └── foo.md
|
|
442
|
+
* ```
|
|
443
|
+
* an instance of this type would include the name of the markdown file, mapped to its contents:
|
|
444
|
+
* ```ts
|
|
445
|
+
* {
|
|
446
|
+
* 'bar': STRING_CONTENTS_OF_BAR.MD
|
|
447
|
+
* 'foo': STRING_CONTENTS_OF_FOO.MD
|
|
448
|
+
* }
|
|
449
|
+
* ```
|
|
450
|
+
*/
|
|
451
|
+
interface JsonDocsUsage {
|
|
452
|
+
[key: string]: string;
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* An intermediate representation of a `@Prop` decorated member's JSDoc
|
|
456
|
+
*/
|
|
457
|
+
interface JsonDocsProp {
|
|
458
|
+
/**
|
|
459
|
+
* the name of the prop
|
|
460
|
+
*/
|
|
461
|
+
name: string;
|
|
462
|
+
complexType?: ComponentCompilerPropertyComplexType;
|
|
463
|
+
/**
|
|
464
|
+
* the type of the prop, in terms of the TypeScript type system (as opposed to JavaScript's or HTML's)
|
|
465
|
+
*/
|
|
466
|
+
type: string;
|
|
467
|
+
/**
|
|
468
|
+
* `true` if the prop was configured as "mutable" where it was declared, `false` otherwise
|
|
469
|
+
*/
|
|
470
|
+
mutable: boolean;
|
|
471
|
+
/**
|
|
472
|
+
* The name of the attribute that is exposed to configure a compiled web component
|
|
473
|
+
*/
|
|
474
|
+
attr?: string;
|
|
475
|
+
/**
|
|
476
|
+
* `true` if the prop was configured to "reflect" back to HTML where it (the prop) was declared, `false` otherwise
|
|
477
|
+
*/
|
|
478
|
+
reflectToAttr: boolean;
|
|
479
|
+
/**
|
|
480
|
+
* the JSDoc description text associated with the prop
|
|
481
|
+
*/
|
|
482
|
+
docs: string;
|
|
483
|
+
/**
|
|
484
|
+
* JSDoc tags associated with the prop
|
|
485
|
+
*/
|
|
486
|
+
docsTags: JsonDocsTag[];
|
|
487
|
+
/**
|
|
488
|
+
* The default value of the prop
|
|
489
|
+
*/
|
|
490
|
+
default?: string;
|
|
491
|
+
/**
|
|
492
|
+
* Deprecation text associated with the prop. This is the text that immediately follows a `@deprecated` tag
|
|
493
|
+
*/
|
|
494
|
+
deprecation?: string;
|
|
495
|
+
values: JsonDocsValue[];
|
|
496
|
+
/**
|
|
497
|
+
* `true` if a component is declared with a '?', `false` otherwise
|
|
498
|
+
*
|
|
499
|
+
* @example
|
|
500
|
+
* ```tsx
|
|
501
|
+
* @Prop() componentProps?: any;
|
|
502
|
+
* ```
|
|
503
|
+
*/
|
|
504
|
+
optional: boolean;
|
|
505
|
+
/**
|
|
506
|
+
* `true` if a component is declared with a '!', `false` otherwise
|
|
507
|
+
*
|
|
508
|
+
* @example
|
|
509
|
+
* ```tsx
|
|
510
|
+
* @Prop() componentProps!: any;
|
|
511
|
+
* ```
|
|
512
|
+
*/
|
|
513
|
+
required: boolean;
|
|
514
|
+
/**
|
|
515
|
+
* `true` if the prop has a `get()`. `false` otherwise
|
|
516
|
+
*/
|
|
517
|
+
getter: boolean;
|
|
518
|
+
/**
|
|
519
|
+
* `true` if the prop has a `set()`. `false` otherwise
|
|
520
|
+
*/
|
|
521
|
+
setter: boolean;
|
|
522
|
+
}
|
|
523
|
+
interface JsonDocsMethod {
|
|
524
|
+
name: string;
|
|
525
|
+
docs: string;
|
|
526
|
+
docsTags: JsonDocsTag[];
|
|
527
|
+
deprecation?: string;
|
|
528
|
+
signature: string;
|
|
529
|
+
returns: JsonDocsMethodReturn;
|
|
530
|
+
parameters: JsonDocMethodParameter[];
|
|
531
|
+
complexType: ComponentCompilerMethodComplexType;
|
|
532
|
+
}
|
|
533
|
+
interface JsonDocsMethodReturn {
|
|
534
|
+
type: string;
|
|
535
|
+
docs: string;
|
|
536
|
+
}
|
|
537
|
+
interface JsonDocMethodParameter {
|
|
538
|
+
name: string;
|
|
539
|
+
type: string;
|
|
540
|
+
docs: string;
|
|
541
|
+
}
|
|
542
|
+
interface JsonDocsEvent {
|
|
543
|
+
event: string;
|
|
544
|
+
bubbles: boolean;
|
|
545
|
+
cancelable: boolean;
|
|
546
|
+
composed: boolean;
|
|
547
|
+
complexType: ComponentCompilerEventComplexType;
|
|
548
|
+
docs: string;
|
|
549
|
+
docsTags: JsonDocsTag[];
|
|
550
|
+
deprecation?: string;
|
|
551
|
+
detail: string;
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* Type describing a CSS Style, as described by a JSDoc-style comment
|
|
555
|
+
*/
|
|
556
|
+
interface JsonDocsStyle {
|
|
557
|
+
/**
|
|
558
|
+
* The name of the style
|
|
559
|
+
*/
|
|
560
|
+
name: string;
|
|
561
|
+
/**
|
|
562
|
+
* The type/description associated with the style
|
|
563
|
+
*/
|
|
564
|
+
docs: string;
|
|
565
|
+
/**
|
|
566
|
+
* The annotation used in the JSDoc of the style (e.g. `@prop`)
|
|
567
|
+
*/
|
|
568
|
+
annotation: string;
|
|
569
|
+
/**
|
|
570
|
+
* The mode associated with the style
|
|
571
|
+
*/
|
|
572
|
+
mode: string | undefined;
|
|
573
|
+
}
|
|
574
|
+
interface JsonDocsListener {
|
|
575
|
+
event: string;
|
|
576
|
+
target?: string;
|
|
577
|
+
capture: boolean;
|
|
578
|
+
passive: boolean;
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* A descriptor for a slot
|
|
582
|
+
*
|
|
583
|
+
* Objects of this type are translated from the JSDoc tag, `@slot`
|
|
584
|
+
*/
|
|
585
|
+
interface JsonDocsSlot {
|
|
586
|
+
/**
|
|
587
|
+
* The name of the slot. Defaults to an empty string for an unnamed slot.
|
|
588
|
+
*/
|
|
589
|
+
name: string;
|
|
590
|
+
/**
|
|
591
|
+
* A textual description of the slot.
|
|
592
|
+
*/
|
|
593
|
+
docs: string;
|
|
594
|
+
}
|
|
595
|
+
/**
|
|
596
|
+
* A descriptor of a CSS Shadow Part
|
|
597
|
+
*
|
|
598
|
+
* Objects of this type are translated from the JSDoc tag, `@part`, or the 'part'
|
|
599
|
+
* attribute on a component in TSX
|
|
600
|
+
*/
|
|
601
|
+
interface JsonDocsPart {
|
|
602
|
+
/**
|
|
603
|
+
* The name of the Shadow part
|
|
604
|
+
*/
|
|
605
|
+
name: string;
|
|
606
|
+
/**
|
|
607
|
+
* A textual description of the Shadow part.
|
|
608
|
+
*/
|
|
609
|
+
docs: string;
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* A descriptor for a Custom State defined via @AttachInternals({ states: {...} })
|
|
613
|
+
*
|
|
614
|
+
* Custom states are exposed via the ElementInternals.states CustomStateSet
|
|
615
|
+
* and can be targeted with the CSS `:state()` pseudo-class.
|
|
616
|
+
*
|
|
617
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/CustomStateSet
|
|
618
|
+
*/
|
|
619
|
+
interface JsonDocsCustomState {
|
|
620
|
+
/**
|
|
621
|
+
* The name of the custom state (without dashes)
|
|
622
|
+
*/
|
|
623
|
+
name: string;
|
|
624
|
+
/**
|
|
625
|
+
* The initial/default value of the state
|
|
626
|
+
*/
|
|
627
|
+
initialValue: boolean;
|
|
628
|
+
/**
|
|
629
|
+
* A textual description of the custom state
|
|
630
|
+
*/
|
|
631
|
+
docs: string;
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* Represents a parsed block comment in a CSS, Sass, etc. file for a custom property.
|
|
635
|
+
*/
|
|
636
|
+
interface StyleDoc {
|
|
637
|
+
/**
|
|
638
|
+
* The name of the CSS property
|
|
639
|
+
*/
|
|
640
|
+
name: string;
|
|
641
|
+
/**
|
|
642
|
+
* The user-defined description of the CSS property
|
|
643
|
+
*/
|
|
644
|
+
docs: string;
|
|
645
|
+
/**
|
|
646
|
+
* The JSDoc-style annotation (e.g. `@prop`) that was used in the block comment to detect the comment.
|
|
647
|
+
* Used to inform Stencil where the start of a new property's description starts (and where the previous description
|
|
648
|
+
* ends).
|
|
649
|
+
*/
|
|
650
|
+
annotation: 'prop';
|
|
651
|
+
/**
|
|
652
|
+
* The Stencil style-mode that is associated with this property.
|
|
653
|
+
*/
|
|
654
|
+
mode: string | undefined;
|
|
655
|
+
}
|
|
656
|
+
//#endregion
|
|
657
|
+
//#region src/declarations/stencil-private.d.ts
|
|
658
|
+
interface SourceMap {
|
|
659
|
+
file: string;
|
|
660
|
+
mappings: string;
|
|
661
|
+
names: string[];
|
|
662
|
+
sourceRoot?: string;
|
|
663
|
+
sources: string[];
|
|
664
|
+
sourcesContent?: (string | null)[];
|
|
665
|
+
version: number;
|
|
666
|
+
}
|
|
667
|
+
interface PrintLine {
|
|
668
|
+
lineIndex: number;
|
|
669
|
+
lineNumber: number;
|
|
670
|
+
text: string;
|
|
671
|
+
errorCharStart: number;
|
|
672
|
+
errorLength?: number;
|
|
673
|
+
}
|
|
674
|
+
type ModuleFormat = 'amd' | 'cjs' | 'es' | 'iife' | 'system' | 'umd' | 'commonjs' | 'esm' | 'module' | 'systemjs';
|
|
675
|
+
interface RollupResultModule {
|
|
676
|
+
id: string;
|
|
677
|
+
}
|
|
678
|
+
interface RollupResults {
|
|
679
|
+
modules: RollupResultModule[];
|
|
680
|
+
}
|
|
681
|
+
interface BuildCtx {
|
|
682
|
+
buildId: number;
|
|
683
|
+
buildResults: CompilerBuildResults;
|
|
684
|
+
buildStats?: Result<CompilerBuildStats, {
|
|
685
|
+
diagnostics: Diagnostic[];
|
|
686
|
+
}>;
|
|
687
|
+
buildMessages: string[];
|
|
688
|
+
bundleBuildCount: number;
|
|
689
|
+
collections: CollectionCompilerMeta[];
|
|
690
|
+
compilerCtx: CompilerCtx;
|
|
691
|
+
esmBrowserComponentBundle: ReadonlyArray<BundleModule>;
|
|
692
|
+
esmComponentBundle: ReadonlyArray<BundleModule>;
|
|
693
|
+
es5ComponentBundle: ReadonlyArray<BundleModule>;
|
|
694
|
+
systemComponentBundle: ReadonlyArray<BundleModule>;
|
|
695
|
+
commonJsComponentBundle: ReadonlyArray<BundleModule>;
|
|
696
|
+
components: ComponentCompilerMeta[];
|
|
697
|
+
componentGraph: Map<string, string[]>;
|
|
698
|
+
config: ValidatedConfig;
|
|
699
|
+
createTimeSpan(msg: string, debug?: boolean): LoggerTimeSpan;
|
|
700
|
+
data: any;
|
|
701
|
+
debug: (msg: string) => void;
|
|
702
|
+
diagnostics: Diagnostic[];
|
|
703
|
+
dirsAdded: string[];
|
|
704
|
+
dirsDeleted: string[];
|
|
705
|
+
entryModules: EntryModule[];
|
|
706
|
+
filesAdded: string[];
|
|
707
|
+
filesChanged: string[];
|
|
708
|
+
filesDeleted: string[];
|
|
709
|
+
filesUpdated: string[];
|
|
710
|
+
filesWritten: string[];
|
|
711
|
+
globalStyle: string | undefined;
|
|
712
|
+
hasConfigChanges: boolean;
|
|
713
|
+
hasError: boolean;
|
|
714
|
+
hasFinished: boolean;
|
|
715
|
+
hasHtmlChanges: boolean;
|
|
716
|
+
hasPrintedResults: boolean;
|
|
717
|
+
hasServiceWorkerChanges: boolean;
|
|
718
|
+
hasScriptChanges: boolean;
|
|
719
|
+
hasStyleChanges: boolean;
|
|
720
|
+
hasWarning: boolean;
|
|
721
|
+
hydrateAppFilePath: string;
|
|
722
|
+
indexBuildCount: number;
|
|
723
|
+
indexDoc: Document;
|
|
724
|
+
isRebuild: boolean;
|
|
725
|
+
/**
|
|
726
|
+
* A collection of Stencil's intermediate representation of components, tied to the current build
|
|
727
|
+
*/
|
|
728
|
+
moduleFiles: Module[];
|
|
729
|
+
packageJson: PackageJsonData;
|
|
730
|
+
pendingCopyTasks: Promise<CopyResults>[];
|
|
731
|
+
progress(task: BuildTask): void;
|
|
732
|
+
requiresFullBuild: boolean;
|
|
733
|
+
rollupResults?: RollupResults;
|
|
734
|
+
scriptsAdded: string[];
|
|
735
|
+
scriptsDeleted: string[];
|
|
736
|
+
startTime: number;
|
|
737
|
+
styleBuildCount: number;
|
|
738
|
+
/**
|
|
739
|
+
* A promise that resolves to the global styles for the current build.
|
|
740
|
+
*/
|
|
741
|
+
stylesPromise: Promise<string>;
|
|
742
|
+
stylesUpdated: BuildStyleUpdate[];
|
|
743
|
+
timeSpan: LoggerTimeSpan;
|
|
744
|
+
timestamp: string;
|
|
745
|
+
transpileBuildCount: number;
|
|
746
|
+
validateTypesBuild?(): Promise<void>;
|
|
747
|
+
validateTypesHandler?: (results: any) => Promise<void>;
|
|
748
|
+
validateTypesPromise?: Promise<any>;
|
|
749
|
+
}
|
|
750
|
+
interface BuildStyleUpdate {
|
|
751
|
+
styleTag: string;
|
|
752
|
+
styleText: string;
|
|
753
|
+
styleMode: string;
|
|
754
|
+
}
|
|
755
|
+
type BuildTask = any;
|
|
756
|
+
interface CompilerBuildStats {
|
|
757
|
+
timestamp: string;
|
|
758
|
+
compiler: {
|
|
759
|
+
name: string;
|
|
760
|
+
version: string;
|
|
761
|
+
};
|
|
762
|
+
app: {
|
|
763
|
+
namespace: string;
|
|
764
|
+
fsNamespace: string;
|
|
765
|
+
components: number;
|
|
766
|
+
entries: number;
|
|
767
|
+
bundles: number;
|
|
768
|
+
outputs: any;
|
|
769
|
+
};
|
|
770
|
+
options: {
|
|
771
|
+
minifyJs: boolean;
|
|
772
|
+
minifyCss: boolean;
|
|
773
|
+
hashFileNames: boolean;
|
|
774
|
+
hashedFileNameLength: number;
|
|
775
|
+
buildEs5: boolean | 'prod';
|
|
776
|
+
};
|
|
777
|
+
formats: {
|
|
778
|
+
esmBrowser: ReadonlyArray<CompilerBuildStatBundle>;
|
|
779
|
+
esm: ReadonlyArray<CompilerBuildStatBundle>;
|
|
780
|
+
es5: ReadonlyArray<CompilerBuildStatBundle>;
|
|
781
|
+
system: ReadonlyArray<CompilerBuildStatBundle>;
|
|
782
|
+
commonjs: ReadonlyArray<CompilerBuildStatBundle>;
|
|
783
|
+
};
|
|
784
|
+
components: BuildComponent[];
|
|
785
|
+
entries: EntryModule[];
|
|
786
|
+
rollupResults: RollupResults;
|
|
787
|
+
sourceGraph?: BuildSourceGraph;
|
|
788
|
+
componentGraph: BuildResultsComponentGraph;
|
|
789
|
+
collections: CompilerBuildStatCollection[];
|
|
790
|
+
}
|
|
791
|
+
interface CompilerBuildStatCollection {
|
|
792
|
+
name: string;
|
|
793
|
+
source: string;
|
|
794
|
+
tags: string[][];
|
|
795
|
+
}
|
|
796
|
+
interface CompilerBuildStatBundle {
|
|
797
|
+
key: string;
|
|
798
|
+
components: string[];
|
|
799
|
+
bundleId: string;
|
|
800
|
+
fileName: string;
|
|
801
|
+
imports: string[];
|
|
802
|
+
originalByteSize: number;
|
|
803
|
+
}
|
|
804
|
+
interface BuildSourceGraph {
|
|
805
|
+
[filePath: string]: string[];
|
|
806
|
+
}
|
|
807
|
+
interface BuildComponent {
|
|
808
|
+
tag: string;
|
|
809
|
+
dependencyOf?: string[];
|
|
810
|
+
dependencies?: string[];
|
|
811
|
+
}
|
|
812
|
+
interface RollupChunkResult {
|
|
813
|
+
type: 'chunk';
|
|
814
|
+
entryKey: string;
|
|
815
|
+
fileName: string;
|
|
816
|
+
code: string;
|
|
817
|
+
isEntry: boolean;
|
|
818
|
+
isComponent: boolean;
|
|
819
|
+
isCore: boolean;
|
|
820
|
+
isIndex: boolean;
|
|
821
|
+
isBrowserLoader: boolean;
|
|
822
|
+
imports: string[];
|
|
823
|
+
moduleFormat: ModuleFormat;
|
|
824
|
+
map?: RollupSourceMap;
|
|
825
|
+
}
|
|
826
|
+
interface RollupSourceMap {
|
|
827
|
+
file: string;
|
|
828
|
+
mappings: string;
|
|
829
|
+
names: string[];
|
|
830
|
+
sources: string[];
|
|
831
|
+
sourcesContent: string[];
|
|
832
|
+
version: number;
|
|
833
|
+
toString(): string;
|
|
834
|
+
toUrl(): string;
|
|
835
|
+
}
|
|
836
|
+
interface BundleModule {
|
|
837
|
+
entryKey: string;
|
|
838
|
+
rollupResult: RollupChunkResult;
|
|
839
|
+
cmps: ComponentCompilerMeta[];
|
|
840
|
+
output: BundleModuleOutput;
|
|
841
|
+
}
|
|
842
|
+
interface BundleModuleOutput {
|
|
843
|
+
bundleId: string;
|
|
844
|
+
fileName: string;
|
|
845
|
+
code: string;
|
|
846
|
+
}
|
|
847
|
+
interface Cache {
|
|
848
|
+
get(key: string): Promise<string | null>;
|
|
849
|
+
put(key: string, value: string): Promise<boolean>;
|
|
850
|
+
has(key: string): Promise<boolean>;
|
|
851
|
+
createKey(domain: string, ...args: any[]): Promise<string>;
|
|
852
|
+
commit(): Promise<void>;
|
|
853
|
+
clear(): void;
|
|
854
|
+
clearDiskCache(): Promise<void>;
|
|
855
|
+
getMemoryStats(): string;
|
|
856
|
+
initCacheDir(): Promise<void>;
|
|
857
|
+
}
|
|
858
|
+
interface CollectionCompilerMeta {
|
|
859
|
+
collectionName: string;
|
|
860
|
+
moduleId?: string;
|
|
861
|
+
moduleDir: string;
|
|
862
|
+
moduleFiles: Module[];
|
|
863
|
+
global?: Module;
|
|
864
|
+
compiler?: CollectionCompilerVersion;
|
|
865
|
+
isInitialized?: boolean;
|
|
866
|
+
hasExports?: boolean;
|
|
867
|
+
dependencies?: string[];
|
|
868
|
+
bundles?: {
|
|
869
|
+
components: string[];
|
|
870
|
+
}[];
|
|
871
|
+
}
|
|
872
|
+
interface CollectionCompilerVersion {
|
|
873
|
+
name: string;
|
|
874
|
+
version: string;
|
|
875
|
+
typescriptVersion?: string;
|
|
876
|
+
}
|
|
877
|
+
interface CompilerCtx {
|
|
878
|
+
version: number;
|
|
879
|
+
activeBuildId: number;
|
|
880
|
+
activeDirsAdded: string[];
|
|
881
|
+
activeDirsDeleted: string[];
|
|
882
|
+
activeFilesAdded: string[];
|
|
883
|
+
activeFilesDeleted: string[];
|
|
884
|
+
activeFilesUpdated: string[];
|
|
885
|
+
addWatchDir: (path: string, recursive: boolean) => void;
|
|
886
|
+
addWatchFile: (path: string) => void;
|
|
887
|
+
cache: Cache;
|
|
888
|
+
cssModuleImports: Map<string, string[]>;
|
|
889
|
+
cachedGlobalStyle: string;
|
|
890
|
+
collections: CollectionCompilerMeta[];
|
|
891
|
+
compilerOptions: any;
|
|
892
|
+
events: BuildEvents;
|
|
893
|
+
fs: InMemoryFileSystem;
|
|
894
|
+
hasSuccessfulBuild: boolean;
|
|
895
|
+
isActivelyBuilding: boolean;
|
|
896
|
+
lastBuildResults: CompilerBuildResults;
|
|
897
|
+
/**
|
|
898
|
+
* A mapping of a file path to a Stencil {@link Module}
|
|
899
|
+
*/
|
|
900
|
+
moduleMap: ModuleMap;
|
|
901
|
+
nodeMap: NodeMap;
|
|
902
|
+
resolvedCollections: Set<string>;
|
|
903
|
+
rollupCacheHydrate: any;
|
|
904
|
+
rollupCacheLazy: any;
|
|
905
|
+
rollupCacheNative: any;
|
|
906
|
+
styleModeNames: Set<string>;
|
|
907
|
+
changedModules: Set<string>;
|
|
908
|
+
changedFiles: Set<string>;
|
|
909
|
+
worker?: CompilerWorkerContext;
|
|
910
|
+
rollupCache: Map<string, any>;
|
|
911
|
+
reset(): void;
|
|
912
|
+
}
|
|
913
|
+
type NodeMap = WeakMap<any, ComponentCompilerMeta>;
|
|
914
|
+
/**
|
|
915
|
+
* Record, for a specific component, whether or not it has various features
|
|
916
|
+
* which need to be handled correctly in the compilation pipeline.
|
|
917
|
+
*
|
|
918
|
+
* Note: this must be serializable to JSON.
|
|
919
|
+
*/
|
|
920
|
+
interface ComponentCompilerFeatures {
|
|
921
|
+
hasAttribute: boolean;
|
|
922
|
+
hasAttributeChangedCallbackFn: boolean;
|
|
923
|
+
hasComponentWillLoadFn: boolean;
|
|
924
|
+
hasComponentDidLoadFn: boolean;
|
|
925
|
+
hasComponentShouldUpdateFn: boolean;
|
|
926
|
+
hasComponentWillUpdateFn: boolean;
|
|
927
|
+
hasComponentDidUpdateFn: boolean;
|
|
928
|
+
hasComponentWillRenderFn: boolean;
|
|
929
|
+
hasComponentDidRenderFn: boolean;
|
|
930
|
+
hasConnectedCallbackFn: boolean;
|
|
931
|
+
hasDeserializer: boolean;
|
|
932
|
+
hasDisconnectedCallbackFn: boolean;
|
|
933
|
+
hasElement: boolean;
|
|
934
|
+
hasEvent: boolean;
|
|
935
|
+
hasLifecycle: boolean;
|
|
936
|
+
hasListener: boolean;
|
|
937
|
+
hasListenerTarget: boolean;
|
|
938
|
+
hasListenerTargetWindow: boolean;
|
|
939
|
+
hasListenerTargetDocument: boolean;
|
|
940
|
+
hasListenerTargetBody: boolean;
|
|
941
|
+
/**
|
|
942
|
+
* @deprecated Prevented from new apps, but left in for older collections
|
|
943
|
+
*/
|
|
944
|
+
hasListenerTargetParent: boolean;
|
|
945
|
+
hasMember: boolean;
|
|
946
|
+
hasMethod: boolean;
|
|
947
|
+
hasMode: boolean;
|
|
948
|
+
hasModernPropertyDecls: boolean;
|
|
949
|
+
hasProp: boolean;
|
|
950
|
+
hasPropBoolean: boolean;
|
|
951
|
+
hasPropNumber: boolean;
|
|
952
|
+
hasPropString: boolean;
|
|
953
|
+
hasPropMutable: boolean;
|
|
954
|
+
hasReflect: boolean;
|
|
955
|
+
hasRenderFn: boolean;
|
|
956
|
+
hasSerializer: boolean;
|
|
957
|
+
hasSlot: boolean;
|
|
958
|
+
hasState: boolean;
|
|
959
|
+
hasStyle: boolean;
|
|
960
|
+
hasVdomAttribute: boolean;
|
|
961
|
+
hasVdomClass: boolean;
|
|
962
|
+
hasVdomFunctional: boolean;
|
|
963
|
+
hasVdomKey: boolean;
|
|
964
|
+
hasVdomListener: boolean;
|
|
965
|
+
hasVdomPropOrAttr: boolean;
|
|
966
|
+
hasVdomRef: boolean;
|
|
967
|
+
hasVdomRender: boolean;
|
|
968
|
+
hasVdomStyle: boolean;
|
|
969
|
+
hasVdomText: boolean;
|
|
970
|
+
hasVdomXlink: boolean;
|
|
971
|
+
hasWatchCallback: boolean;
|
|
972
|
+
htmlAttrNames: string[];
|
|
973
|
+
htmlTagNames: string[];
|
|
974
|
+
htmlParts: string[];
|
|
975
|
+
isUpdateable: boolean;
|
|
976
|
+
/**
|
|
977
|
+
* A plain component is one that doesn't have:
|
|
978
|
+
* - any members decorated with `@Prop()`, `@State()`, `@Element()`, `@Method()`
|
|
979
|
+
* - any methods decorated with `@Listen()`
|
|
980
|
+
* - any styles
|
|
981
|
+
* - any lifecycle methods, including `render()`
|
|
982
|
+
*/
|
|
983
|
+
isPlain: boolean;
|
|
984
|
+
/**
|
|
985
|
+
* A collection of tag names of web components that a component references in its JSX/h() function
|
|
986
|
+
*/
|
|
987
|
+
potentialCmpRefs: string[];
|
|
988
|
+
}
|
|
989
|
+
/**
|
|
990
|
+
* Metadata about a given component
|
|
991
|
+
*
|
|
992
|
+
* Note: must be serializable to JSON!
|
|
993
|
+
*/
|
|
994
|
+
interface ComponentCompilerMeta extends ComponentCompilerFeatures {
|
|
995
|
+
assetsDirs: CompilerAssetDir[];
|
|
996
|
+
/**
|
|
997
|
+
* The name to which an `ElementInternals` object (the return value of
|
|
998
|
+
* `HTMLElement.attachInternals`) should be attached at runtime. If this is
|
|
999
|
+
* `null` then `attachInternals` should not be called.
|
|
1000
|
+
*/
|
|
1001
|
+
attachInternalsMemberName: string | null;
|
|
1002
|
+
/**
|
|
1003
|
+
* Custom states to initialize on the ElementInternals.states CustomStateSet.
|
|
1004
|
+
* These are defined via @AttachInternals({ states: {...} }).
|
|
1005
|
+
*/
|
|
1006
|
+
attachInternalsCustomStates: ComponentCompilerCustomState[];
|
|
1007
|
+
componentClassName: string;
|
|
1008
|
+
/**
|
|
1009
|
+
* A list of web component tag names that are either:
|
|
1010
|
+
* - directly referenced in a Stencil component's JSX/h() function
|
|
1011
|
+
* - are referenced by a web component that is directly referenced in a Stencil component's JSX/h() function
|
|
1012
|
+
*/
|
|
1013
|
+
dependencies: string[];
|
|
1014
|
+
/**
|
|
1015
|
+
* A list of web component tag names that either:
|
|
1016
|
+
* - directly reference the current component directly in their JSX/h() function
|
|
1017
|
+
* - indirectly/transitively reference the current component directly in their JSX/h() function
|
|
1018
|
+
*/
|
|
1019
|
+
dependents: string[];
|
|
1020
|
+
deserializers: ComponentCompilerChangeHandler[];
|
|
1021
|
+
/**
|
|
1022
|
+
* A list of web component tag names that are directly referenced in a Stencil component's JSX/h() function
|
|
1023
|
+
*/
|
|
1024
|
+
directDependencies: string[];
|
|
1025
|
+
/**
|
|
1026
|
+
* A list of web component tag names that the current component directly in their JSX/h() function
|
|
1027
|
+
*/
|
|
1028
|
+
directDependents: string[];
|
|
1029
|
+
docs: CompilerJsDoc;
|
|
1030
|
+
doesExtend: boolean;
|
|
1031
|
+
elementRef: string;
|
|
1032
|
+
encapsulation: Encapsulation;
|
|
1033
|
+
events: ComponentCompilerEvent[];
|
|
1034
|
+
excludeFromCollection: boolean;
|
|
1035
|
+
/**
|
|
1036
|
+
* Whether or not the component is form-associated
|
|
1037
|
+
*/
|
|
1038
|
+
formAssociated: boolean;
|
|
1039
|
+
internal: boolean;
|
|
1040
|
+
isCollectionDependency: boolean;
|
|
1041
|
+
jsFilePath: string;
|
|
1042
|
+
listeners: ComponentCompilerListener[];
|
|
1043
|
+
methods: ComponentCompilerMethod[];
|
|
1044
|
+
properties: ComponentCompilerProperty[];
|
|
1045
|
+
serializers: ComponentCompilerChangeHandler[];
|
|
1046
|
+
shadowDelegatesFocus: boolean;
|
|
1047
|
+
/**
|
|
1048
|
+
* Slot assignment mode for shadow DOM. 'manual', enables imperative slotting
|
|
1049
|
+
* using HTMLSlotElement.assign(). Only applicable when encapsulation is 'shadow'.
|
|
1050
|
+
*/
|
|
1051
|
+
slotAssignment: 'manual' | null;
|
|
1052
|
+
sourceFilePath: string;
|
|
1053
|
+
sourceMapPath: string;
|
|
1054
|
+
states: ComponentCompilerState[];
|
|
1055
|
+
styleDocs: CompilerStyleDoc[];
|
|
1056
|
+
styles: StyleCompiler[];
|
|
1057
|
+
tagName: string;
|
|
1058
|
+
virtualProperties: ComponentCompilerVirtualProperty[];
|
|
1059
|
+
watchers: ComponentCompilerChangeHandler[];
|
|
1060
|
+
}
|
|
1061
|
+
/**
|
|
1062
|
+
* The supported style encapsulation modes on a Stencil component:
|
|
1063
|
+
* 1. 'shadow' - native Shadow DOM
|
|
1064
|
+
* 2. 'scoped' - encapsulated styles and polyfilled slots
|
|
1065
|
+
* 3. 'none' - a basic HTML element
|
|
1066
|
+
*/
|
|
1067
|
+
type Encapsulation = 'shadow' | 'scoped' | 'none';
|
|
1068
|
+
/**
|
|
1069
|
+
* Intermediate Representation (IR) of a static property on a Stencil component
|
|
1070
|
+
*/
|
|
1071
|
+
interface ComponentCompilerStaticProperty {
|
|
1072
|
+
mutable: boolean;
|
|
1073
|
+
optional: boolean;
|
|
1074
|
+
required: boolean;
|
|
1075
|
+
type: ComponentCompilerPropertyType;
|
|
1076
|
+
complexType: ComponentCompilerPropertyComplexType;
|
|
1077
|
+
attribute?: string;
|
|
1078
|
+
reflect?: boolean;
|
|
1079
|
+
docs: CompilerJsDoc;
|
|
1080
|
+
defaultValue?: string;
|
|
1081
|
+
getter: boolean;
|
|
1082
|
+
setter: boolean;
|
|
1083
|
+
ogPropName?: string;
|
|
1084
|
+
}
|
|
1085
|
+
/**
|
|
1086
|
+
* Intermediate Representation (IR) of a property on a Stencil component
|
|
1087
|
+
*/
|
|
1088
|
+
interface ComponentCompilerProperty extends ComponentCompilerStaticProperty {
|
|
1089
|
+
name: string;
|
|
1090
|
+
internal: boolean;
|
|
1091
|
+
}
|
|
1092
|
+
interface ComponentCompilerVirtualProperty {
|
|
1093
|
+
name: string;
|
|
1094
|
+
type: string;
|
|
1095
|
+
docs: string;
|
|
1096
|
+
}
|
|
1097
|
+
type ComponentCompilerPropertyType = 'any' | 'string' | 'boolean' | 'number' | 'unknown';
|
|
1098
|
+
/**
|
|
1099
|
+
* Information about a type used in a Stencil component or exported
|
|
1100
|
+
* from a Stencil project.
|
|
1101
|
+
*/
|
|
1102
|
+
interface ComponentCompilerPropertyComplexType {
|
|
1103
|
+
/**
|
|
1104
|
+
* The string of the original type annotation in the Stencil source code
|
|
1105
|
+
*/
|
|
1106
|
+
original: string;
|
|
1107
|
+
/**
|
|
1108
|
+
* A 'resolved' type, where e.g. imported types have been resolved and inlined
|
|
1109
|
+
*
|
|
1110
|
+
* For instance, an annotation like `(foo: Foo) => string;` will be
|
|
1111
|
+
* converted to `(foo: { foo: string }) => string;`.
|
|
1112
|
+
*/
|
|
1113
|
+
resolved: string;
|
|
1114
|
+
/**
|
|
1115
|
+
* A record of the types which were referenced in the assorted type
|
|
1116
|
+
* annotation in the original source file.
|
|
1117
|
+
*/
|
|
1118
|
+
references: ComponentCompilerTypeReferences;
|
|
1119
|
+
}
|
|
1120
|
+
/**
|
|
1121
|
+
* A record of `ComponentCompilerTypeReference` entities.
|
|
1122
|
+
*
|
|
1123
|
+
* Each key in this record is intended to be the names of the types used by a component. However, this is not enforced
|
|
1124
|
+
* by the type system (I.E. any string can be used as a key).
|
|
1125
|
+
*
|
|
1126
|
+
* Note any key can be a user defined type or a TypeScript standard type.
|
|
1127
|
+
*/
|
|
1128
|
+
type ComponentCompilerTypeReferences = Record<string, ComponentCompilerTypeReference>;
|
|
1129
|
+
/**
|
|
1130
|
+
* Describes a reference to a type used by a component.
|
|
1131
|
+
*/
|
|
1132
|
+
interface ComponentCompilerTypeReference {
|
|
1133
|
+
/**
|
|
1134
|
+
* A type may be defined:
|
|
1135
|
+
* - locally (in the same file as the component that uses it)
|
|
1136
|
+
* - globally
|
|
1137
|
+
* - by importing it into a file (and is defined elsewhere)
|
|
1138
|
+
*/
|
|
1139
|
+
location: 'local' | 'global' | 'import';
|
|
1140
|
+
/**
|
|
1141
|
+
* The path to the type reference, if applicable (global types should not need a path associated with them)
|
|
1142
|
+
*/
|
|
1143
|
+
path?: string;
|
|
1144
|
+
/**
|
|
1145
|
+
* An ID for this type which is unique within a Stencil project.
|
|
1146
|
+
*/
|
|
1147
|
+
id: string;
|
|
1148
|
+
/**
|
|
1149
|
+
* Whether this type was imported as a default import (e.g., `import MyEnum from './my-enum'`)
|
|
1150
|
+
* vs a named import (e.g., `import { MyType } from './my-type'`)
|
|
1151
|
+
*/
|
|
1152
|
+
isDefault?: boolean;
|
|
1153
|
+
/**
|
|
1154
|
+
* The name used in the import statement (before any user-defined alias).
|
|
1155
|
+
* For `import { XAxisOption as moo }`, this would be "XAxisOption".
|
|
1156
|
+
* This is the name exported by the source module.
|
|
1157
|
+
*/
|
|
1158
|
+
referenceLocation?: string;
|
|
1159
|
+
}
|
|
1160
|
+
/**
|
|
1161
|
+
* Information about a type which is referenced by another type on a Stencil
|
|
1162
|
+
* component, for instance a {@link ComponentCompilerPropertyComplexType} or a
|
|
1163
|
+
* {@link ComponentCompilerEventComplexType}.
|
|
1164
|
+
*/
|
|
1165
|
+
interface ComponentCompilerReferencedType {
|
|
1166
|
+
/**
|
|
1167
|
+
* The path to the module where the type is declared.
|
|
1168
|
+
*/
|
|
1169
|
+
path: string;
|
|
1170
|
+
/**
|
|
1171
|
+
* The string of the original type annotation in the Stencil source code
|
|
1172
|
+
*/
|
|
1173
|
+
declaration: string;
|
|
1174
|
+
/**
|
|
1175
|
+
* An extracted docstring
|
|
1176
|
+
*/
|
|
1177
|
+
docstring: string;
|
|
1178
|
+
}
|
|
1179
|
+
interface ComponentCompilerStaticEvent {
|
|
1180
|
+
name: string;
|
|
1181
|
+
method: string;
|
|
1182
|
+
bubbles: boolean;
|
|
1183
|
+
cancelable: boolean;
|
|
1184
|
+
composed: boolean;
|
|
1185
|
+
docs: CompilerJsDoc;
|
|
1186
|
+
complexType: ComponentCompilerEventComplexType;
|
|
1187
|
+
}
|
|
1188
|
+
interface ComponentCompilerEvent extends ComponentCompilerStaticEvent {
|
|
1189
|
+
internal: boolean;
|
|
1190
|
+
}
|
|
1191
|
+
interface ComponentCompilerEventComplexType {
|
|
1192
|
+
original: string;
|
|
1193
|
+
resolved: string;
|
|
1194
|
+
references: ComponentCompilerTypeReferences;
|
|
1195
|
+
}
|
|
1196
|
+
interface ComponentCompilerListener {
|
|
1197
|
+
name: string;
|
|
1198
|
+
method: string;
|
|
1199
|
+
capture: boolean;
|
|
1200
|
+
passive: boolean;
|
|
1201
|
+
target: ListenTargetOptions | undefined;
|
|
1202
|
+
}
|
|
1203
|
+
interface ComponentCompilerStaticMethod {
|
|
1204
|
+
docs: CompilerJsDoc;
|
|
1205
|
+
complexType: ComponentCompilerMethodComplexType;
|
|
1206
|
+
}
|
|
1207
|
+
interface ComponentCompilerMethodComplexType {
|
|
1208
|
+
signature: string;
|
|
1209
|
+
parameters: JsonDocMethodParameter[];
|
|
1210
|
+
references: ComponentCompilerTypeReferences;
|
|
1211
|
+
return: string;
|
|
1212
|
+
}
|
|
1213
|
+
interface ComponentCompilerChangeHandler {
|
|
1214
|
+
propName: string;
|
|
1215
|
+
methodName: string;
|
|
1216
|
+
handlerOptions?: {
|
|
1217
|
+
immediate?: boolean;
|
|
1218
|
+
};
|
|
1219
|
+
}
|
|
1220
|
+
interface ComponentCompilerMethod extends ComponentCompilerStaticMethod {
|
|
1221
|
+
name: string;
|
|
1222
|
+
internal: boolean;
|
|
1223
|
+
}
|
|
1224
|
+
interface ComponentCompilerState {
|
|
1225
|
+
name: string;
|
|
1226
|
+
}
|
|
1227
|
+
/**
|
|
1228
|
+
* Metadata about a custom state defined via @AttachInternals({ states: {...} })
|
|
1229
|
+
*
|
|
1230
|
+
* Custom states are exposed via the ElementInternals.states CustomStateSet
|
|
1231
|
+
* and can be targeted with the CSS :state() pseudo-class.
|
|
1232
|
+
*/
|
|
1233
|
+
interface ComponentCompilerCustomState {
|
|
1234
|
+
/**
|
|
1235
|
+
* The name of the custom state (without dashes)
|
|
1236
|
+
*/
|
|
1237
|
+
name: string;
|
|
1238
|
+
/**
|
|
1239
|
+
* The initial value of the state
|
|
1240
|
+
*/
|
|
1241
|
+
initialValue: boolean;
|
|
1242
|
+
/**
|
|
1243
|
+
* Optional JSDoc description for the state
|
|
1244
|
+
*/
|
|
1245
|
+
docs: string;
|
|
1246
|
+
}
|
|
1247
|
+
/**
|
|
1248
|
+
* Representation of JSDoc that is pulled off a node in the AST
|
|
1249
|
+
*/
|
|
1250
|
+
interface CompilerJsDoc {
|
|
1251
|
+
/**
|
|
1252
|
+
* The text associated with the JSDoc
|
|
1253
|
+
*/
|
|
1254
|
+
text: string;
|
|
1255
|
+
/**
|
|
1256
|
+
* Tags included in the JSDoc
|
|
1257
|
+
*/
|
|
1258
|
+
tags: CompilerJsDocTagInfo[];
|
|
1259
|
+
}
|
|
1260
|
+
/**
|
|
1261
|
+
* Representation of a tag that exists in a JSDoc
|
|
1262
|
+
*/
|
|
1263
|
+
interface CompilerJsDocTagInfo {
|
|
1264
|
+
/**
|
|
1265
|
+
* The name of the tag - e.g. `@deprecated`
|
|
1266
|
+
*/
|
|
1267
|
+
name: string;
|
|
1268
|
+
/**
|
|
1269
|
+
* Additional text that is associated with the tag - e.g. `@deprecated use v2 of this API`
|
|
1270
|
+
*/
|
|
1271
|
+
text?: string;
|
|
1272
|
+
}
|
|
1273
|
+
/**
|
|
1274
|
+
* The (internal) representation of a CSS block comment in a CSS, Sass, etc. file. This data structure is used during
|
|
1275
|
+
* the initial compilation phases of Stencil, as a piece of {@link ComponentCompilerMeta}.
|
|
1276
|
+
*/
|
|
1277
|
+
interface CompilerStyleDoc {
|
|
1278
|
+
/**
|
|
1279
|
+
* The name of the CSS property
|
|
1280
|
+
*/
|
|
1281
|
+
name: string;
|
|
1282
|
+
/**
|
|
1283
|
+
* The user-defined description of the CSS property
|
|
1284
|
+
*/
|
|
1285
|
+
docs: string;
|
|
1286
|
+
/**
|
|
1287
|
+
* The JSDoc-style annotation (e.g. `@prop`) that was used in the block comment to detect the comment.
|
|
1288
|
+
* Used to inform Stencil where the start of a new property's description starts (and where the previous description
|
|
1289
|
+
* ends).
|
|
1290
|
+
*/
|
|
1291
|
+
annotation: 'prop';
|
|
1292
|
+
/**
|
|
1293
|
+
* The Stencil style-mode that is associated with this property.
|
|
1294
|
+
*/
|
|
1295
|
+
mode: string;
|
|
1296
|
+
}
|
|
1297
|
+
interface CompilerAssetDir {
|
|
1298
|
+
absolutePath?: string;
|
|
1299
|
+
cmpRelativePath?: string;
|
|
1300
|
+
originalComponentPath?: string;
|
|
1301
|
+
}
|
|
1302
|
+
interface EntryModule {
|
|
1303
|
+
entryKey: string;
|
|
1304
|
+
cmps: ComponentCompilerMeta[];
|
|
1305
|
+
}
|
|
1306
|
+
/**
|
|
1307
|
+
* A mapping from a TypeScript or JavaScript source file path on disk, to a Stencil {@link Module}.
|
|
1308
|
+
*
|
|
1309
|
+
* It is advised that the key (path) be normalized before storing/retrieving the `Module` to avoid unnecessary lookup
|
|
1310
|
+
* failures.
|
|
1311
|
+
*/
|
|
1312
|
+
type ModuleMap = Map<string, Module>;
|
|
1313
|
+
/**
|
|
1314
|
+
* Stencil's Intermediate Representation (IR) of a module, bundling together
|
|
1315
|
+
* various pieces of information like the classes declared within it, the path
|
|
1316
|
+
* to the original source file, HTML tag names defined in the file, and so on.
|
|
1317
|
+
*
|
|
1318
|
+
* Note that this gets serialized/parsed as JSON and therefore cannot contain a
|
|
1319
|
+
* `Map` or a `Set`.
|
|
1320
|
+
*/
|
|
1321
|
+
interface Module {
|
|
1322
|
+
cmps: ComponentCompilerMeta[];
|
|
1323
|
+
isMixin: boolean;
|
|
1324
|
+
isExtended: boolean;
|
|
1325
|
+
/**
|
|
1326
|
+
* Indicates this module contains mixin/abstract classes that can be extended by other projects.
|
|
1327
|
+
* These are classes with Stencil static members (properties, states, etc.) but no @Component decorator.
|
|
1328
|
+
*/
|
|
1329
|
+
hasExportableMixins: boolean;
|
|
1330
|
+
/**
|
|
1331
|
+
* A collection of modules that a component will need. The modules in this list must have import statements generated
|
|
1332
|
+
* in order for the component to function.
|
|
1333
|
+
*/
|
|
1334
|
+
coreRuntimeApis: string[];
|
|
1335
|
+
/**
|
|
1336
|
+
* A collection of modules that a component will need for a specific output target. The modules in this list must
|
|
1337
|
+
* have import statements generated in order for the component to function, but only for a specific output target.
|
|
1338
|
+
*/
|
|
1339
|
+
outputTargetCoreRuntimeApis: Partial<Record<OutputTarget['type'], string[]>>;
|
|
1340
|
+
collectionName: string;
|
|
1341
|
+
dtsFilePath: string;
|
|
1342
|
+
excludeFromCollection: boolean;
|
|
1343
|
+
externalImports: string[];
|
|
1344
|
+
htmlAttrNames: string[];
|
|
1345
|
+
htmlTagNames: string[];
|
|
1346
|
+
htmlParts: string[];
|
|
1347
|
+
isCollectionDependency: boolean;
|
|
1348
|
+
isLegacy: boolean;
|
|
1349
|
+
jsFilePath: string;
|
|
1350
|
+
localImports: string[];
|
|
1351
|
+
/**
|
|
1352
|
+
* Source file paths of functional components that are used in JSX/h() calls.
|
|
1353
|
+
* This is used to ensure htmlTagNames are properly propagated from functional
|
|
1354
|
+
* component dependencies even when they're accessed indirectly (e.g., via barrel files).
|
|
1355
|
+
*/
|
|
1356
|
+
functionalComponentDeps: string[];
|
|
1357
|
+
originalImports: string[];
|
|
1358
|
+
originalCollectionComponentPath: string;
|
|
1359
|
+
potentialCmpRefs: string[];
|
|
1360
|
+
sourceFilePath: string;
|
|
1361
|
+
staticSourceFile: any;
|
|
1362
|
+
staticSourceFileText: string;
|
|
1363
|
+
sourceMapPath: string;
|
|
1364
|
+
sourceMapFileText: string;
|
|
1365
|
+
hasVdomAttribute: boolean;
|
|
1366
|
+
hasVdomClass: boolean;
|
|
1367
|
+
hasVdomFunctional: boolean;
|
|
1368
|
+
hasVdomKey: boolean;
|
|
1369
|
+
hasVdomListener: boolean;
|
|
1370
|
+
hasVdomPropOrAttr: boolean;
|
|
1371
|
+
hasVdomRef: boolean;
|
|
1372
|
+
hasVdomRender: boolean;
|
|
1373
|
+
hasVdomStyle: boolean;
|
|
1374
|
+
hasVdomText: boolean;
|
|
1375
|
+
hasVdomXlink: boolean;
|
|
1376
|
+
}
|
|
1377
|
+
interface PrerenderUrlResults {
|
|
1378
|
+
anchorUrls: string[];
|
|
1379
|
+
diagnostics: Diagnostic[];
|
|
1380
|
+
filePath: string;
|
|
1381
|
+
}
|
|
1382
|
+
interface PrerenderUrlRequest {
|
|
1383
|
+
appDir: string;
|
|
1384
|
+
buildId: string;
|
|
1385
|
+
baseUrl: string;
|
|
1386
|
+
componentGraphPath: string;
|
|
1387
|
+
devServerHostUrl: string;
|
|
1388
|
+
hydrateAppFilePath: string;
|
|
1389
|
+
isDebug: boolean;
|
|
1390
|
+
prerenderConfigPath: string;
|
|
1391
|
+
staticSite: boolean;
|
|
1392
|
+
templateId: string;
|
|
1393
|
+
url: string;
|
|
1394
|
+
writeToFilePath: string;
|
|
1395
|
+
}
|
|
1396
|
+
interface StyleCompiler {
|
|
1397
|
+
modeName: string;
|
|
1398
|
+
styleId: string;
|
|
1399
|
+
styleStr: string;
|
|
1400
|
+
styleIdentifier: string;
|
|
1401
|
+
externalStyles: ExternalStyleCompiler[];
|
|
1402
|
+
}
|
|
1403
|
+
interface ExternalStyleCompiler {
|
|
1404
|
+
absolutePath: string;
|
|
1405
|
+
relativePath: string;
|
|
1406
|
+
originalComponentPath: string;
|
|
1407
|
+
}
|
|
1408
|
+
/**
|
|
1409
|
+
* Input CSS to be transformed into ESM
|
|
1410
|
+
*/
|
|
1411
|
+
interface TransformCssToEsmInput {
|
|
1412
|
+
input: string;
|
|
1413
|
+
module?: 'cjs' | 'esm' | string;
|
|
1414
|
+
file?: string;
|
|
1415
|
+
tag?: string;
|
|
1416
|
+
tags?: string[];
|
|
1417
|
+
addTagTransformers: boolean;
|
|
1418
|
+
encapsulation?: string;
|
|
1419
|
+
/**
|
|
1420
|
+
* The mode under which the CSS will be applied.
|
|
1421
|
+
*
|
|
1422
|
+
* Corresponds to a key used when `@Component`'s `styleUrls` field is an object:
|
|
1423
|
+
* ```ts
|
|
1424
|
+
* @Component({
|
|
1425
|
+
* tag: 'todo-list',
|
|
1426
|
+
* styleUrls: {
|
|
1427
|
+
* ios: 'todo-list.ios.scss',
|
|
1428
|
+
* md: 'todo-list.md.scss',
|
|
1429
|
+
* }
|
|
1430
|
+
* })
|
|
1431
|
+
* ```
|
|
1432
|
+
* In the example above, two `TransformCssToEsmInput`s should be created, one for 'ios' and one for 'md' (this field
|
|
1433
|
+
* is not shared by multiple fields, nor is it a composite of multiple modes).
|
|
1434
|
+
*/
|
|
1435
|
+
mode?: string;
|
|
1436
|
+
sourceMap?: boolean;
|
|
1437
|
+
minify?: boolean;
|
|
1438
|
+
docs?: boolean;
|
|
1439
|
+
autoprefixer?: any;
|
|
1440
|
+
styleImportData?: string;
|
|
1441
|
+
}
|
|
1442
|
+
interface TransformCssToEsmOutput {
|
|
1443
|
+
styleText: string;
|
|
1444
|
+
output: string;
|
|
1445
|
+
map: any;
|
|
1446
|
+
diagnostics: Diagnostic[];
|
|
1447
|
+
defaultVarName: string;
|
|
1448
|
+
styleDocs: StyleDoc[];
|
|
1449
|
+
imports: {
|
|
1450
|
+
varName: string;
|
|
1451
|
+
importPath: string;
|
|
1452
|
+
}[];
|
|
1453
|
+
}
|
|
1454
|
+
interface PackageJsonData {
|
|
1455
|
+
name?: string;
|
|
1456
|
+
version?: string;
|
|
1457
|
+
main?: string;
|
|
1458
|
+
exports?: {
|
|
1459
|
+
[key: string]: string | {
|
|
1460
|
+
[key: string]: string;
|
|
1461
|
+
};
|
|
1462
|
+
};
|
|
1463
|
+
description?: string;
|
|
1464
|
+
bin?: {
|
|
1465
|
+
[key: string]: string;
|
|
1466
|
+
};
|
|
1467
|
+
browser?: string;
|
|
1468
|
+
module?: string;
|
|
1469
|
+
'jsnext:main'?: string;
|
|
1470
|
+
'collection:main'?: string;
|
|
1471
|
+
unpkg?: string;
|
|
1472
|
+
collection?: string;
|
|
1473
|
+
types?: string;
|
|
1474
|
+
files?: string[];
|
|
1475
|
+
['dist-tags']?: {
|
|
1476
|
+
latest: string;
|
|
1477
|
+
};
|
|
1478
|
+
dependencies?: {
|
|
1479
|
+
[moduleId: string]: string;
|
|
1480
|
+
};
|
|
1481
|
+
devDependencies?: {
|
|
1482
|
+
[moduleId: string]: string;
|
|
1483
|
+
};
|
|
1484
|
+
repository?: {
|
|
1485
|
+
type?: string;
|
|
1486
|
+
url?: string;
|
|
1487
|
+
};
|
|
1488
|
+
private?: boolean;
|
|
1489
|
+
scripts?: {
|
|
1490
|
+
[runName: string]: string;
|
|
1491
|
+
};
|
|
1492
|
+
license?: string;
|
|
1493
|
+
keywords?: string[];
|
|
1494
|
+
}
|
|
1495
|
+
/**
|
|
1496
|
+
* An abstraction to bundle up four methods which _may_ be handled by
|
|
1497
|
+
* dispatching work to workers running in other OS threads or may be called
|
|
1498
|
+
* synchronously. Environment and `CompilerSystem` related setup code will
|
|
1499
|
+
* determine which one, but in either case the call sites for these methods can
|
|
1500
|
+
* dispatch to this shared interface.
|
|
1501
|
+
*/
|
|
1502
|
+
interface CompilerWorkerContext {
|
|
1503
|
+
optimizeCss(inputOpts: OptimizeCssInput): Promise<OptimizeCssOutput>;
|
|
1504
|
+
prepareModule(input: string, minifyOpts: any, transpile: boolean, inlineHelpers: boolean): Promise<{
|
|
1505
|
+
output: string;
|
|
1506
|
+
diagnostics: Diagnostic[];
|
|
1507
|
+
sourceMap?: SourceMap;
|
|
1508
|
+
}>;
|
|
1509
|
+
prerenderWorker(prerenderRequest: PrerenderUrlRequest): Promise<PrerenderUrlResults>;
|
|
1510
|
+
transformCssToEsm(input: TransformCssToEsmInput): Promise<TransformCssToEsmOutput>;
|
|
1511
|
+
}
|
|
1512
|
+
//#endregion
|
|
1513
|
+
//#region src/declarations/stencil-public-compiler.d.ts
|
|
1514
|
+
/**
|
|
1515
|
+
* https://stenciljs.com/docs/config/
|
|
1516
|
+
*/
|
|
1517
|
+
interface StencilConfig {
|
|
1518
|
+
/**
|
|
1519
|
+
* By default, Stencil will attempt to optimize small scripts by inlining them in HTML. Setting
|
|
1520
|
+
* this flag to `false` will prevent this optimization and keep all scripts separate from HTML.
|
|
1521
|
+
*/
|
|
1522
|
+
allowInlineScripts?: boolean;
|
|
1523
|
+
/**
|
|
1524
|
+
* By setting `autoprefixCss` to `true`, Stencil will use the appropriate config to automatically
|
|
1525
|
+
* prefix css. For example, developers can write modern and standard css properties, such as
|
|
1526
|
+
* "transform", and Stencil will automatically add in the prefixed version, such as "-webkit-transform".
|
|
1527
|
+
* As of Stencil v2, autoprefixing CSS is no longer the default.
|
|
1528
|
+
* Defaults to `false`
|
|
1529
|
+
*/
|
|
1530
|
+
autoprefixCss?: boolean | any;
|
|
1531
|
+
/**
|
|
1532
|
+
* By default, Stencil will statically analyze the application and generate a component graph of
|
|
1533
|
+
* how all the components are interconnected.
|
|
1534
|
+
*
|
|
1535
|
+
* From the component graph it is able to best decide how components should be grouped
|
|
1536
|
+
* depending on their usage with one another within the app.
|
|
1537
|
+
* By doing so it's able to bundle components together in order to reduce network requests.
|
|
1538
|
+
* However, bundles can be manually generated using the bundles config.
|
|
1539
|
+
*
|
|
1540
|
+
* The bundles config is an array of objects that represent how components are grouped together
|
|
1541
|
+
* in lazy-loaded bundles.
|
|
1542
|
+
* This config is rarely needed as Stencil handles this automatically behind the scenes.
|
|
1543
|
+
*/
|
|
1544
|
+
bundles?: ConfigBundle[];
|
|
1545
|
+
/**
|
|
1546
|
+
* Stencil will cache build results in order to speed up rebuilds.
|
|
1547
|
+
* To disable this feature, set enableCache to false.
|
|
1548
|
+
*/
|
|
1549
|
+
enableCache?: boolean;
|
|
1550
|
+
/**
|
|
1551
|
+
* The directory where sub-directories will be created for caching when `enableCache` is set
|
|
1552
|
+
* `true` or if using Stencil's Screenshot Connector.
|
|
1553
|
+
*
|
|
1554
|
+
* @default '.stencil'
|
|
1555
|
+
*
|
|
1556
|
+
* @example
|
|
1557
|
+
*
|
|
1558
|
+
* A Stencil config like the following:
|
|
1559
|
+
* ```ts
|
|
1560
|
+
* export const config = {
|
|
1561
|
+
* ...,
|
|
1562
|
+
* enableCache: true,
|
|
1563
|
+
* cacheDir: '.cache',
|
|
1564
|
+
* testing: {
|
|
1565
|
+
* screenshotConnector: 'connector.js'
|
|
1566
|
+
* }
|
|
1567
|
+
* }
|
|
1568
|
+
* ```
|
|
1569
|
+
*
|
|
1570
|
+
* Will result in the following file structure:
|
|
1571
|
+
* ```tree
|
|
1572
|
+
* stencil-project-root
|
|
1573
|
+
* └── .cache
|
|
1574
|
+
* ├── .build <-- Where build related file caching is written
|
|
1575
|
+
* |
|
|
1576
|
+
* └── screenshot-cache.json <-- Where screenshot caching is written
|
|
1577
|
+
* ```
|
|
1578
|
+
*/
|
|
1579
|
+
cacheDir?: string;
|
|
1580
|
+
/**
|
|
1581
|
+
* Stencil is traditionally used to compile many components into an app,
|
|
1582
|
+
* and each component comes with its own compartmentalized styles.
|
|
1583
|
+
* However, it's still common to have styles which should be "global" across all components and the website.
|
|
1584
|
+
* A global CSS file is often useful to set CSS Variables.
|
|
1585
|
+
*
|
|
1586
|
+
* Additionally, the globalStyle config can be used to precompile styles with Sass, PostCSS, etc.
|
|
1587
|
+
* Below is an example folder structure containing a webapp's global sass file, named app.css.
|
|
1588
|
+
*/
|
|
1589
|
+
globalStyle?: string;
|
|
1590
|
+
/**
|
|
1591
|
+
* Will generate {@link https://nodejs.org/api/packages.html#packages_exports export map} entry points
|
|
1592
|
+
* for each component in the build when `true`.
|
|
1593
|
+
*
|
|
1594
|
+
* @default false
|
|
1595
|
+
*/
|
|
1596
|
+
generateExportMaps?: boolean;
|
|
1597
|
+
/**
|
|
1598
|
+
* When the hashFileNames config is set to true, and it is a production build,
|
|
1599
|
+
* the hashedFileNameLength config is used to determine how many characters the file name's hash should be.
|
|
1600
|
+
*/
|
|
1601
|
+
hashedFileNameLength?: number;
|
|
1602
|
+
/**
|
|
1603
|
+
* During production builds, the content of each generated file is hashed to represent the content,
|
|
1604
|
+
* and the hashed value is used as the filename. If the content isn't updated between builds,
|
|
1605
|
+
* then it receives the same filename. When the content is updated, then the filename is different.
|
|
1606
|
+
*
|
|
1607
|
+
* By doing this, deployed apps can "forever-cache" the build directory and take full advantage of
|
|
1608
|
+
* content delivery networks (CDNs) and heavily caching files for faster apps.
|
|
1609
|
+
*/
|
|
1610
|
+
hashFileNames?: boolean;
|
|
1611
|
+
/**
|
|
1612
|
+
* The namespace config is a string representing a namespace for the app.
|
|
1613
|
+
* For apps that are not meant to be a library of reusable components,
|
|
1614
|
+
* the default of App is just fine. However, if the app is meant to be consumed
|
|
1615
|
+
* as a third-party library, such as Ionic, a unique namespace is required.
|
|
1616
|
+
*/
|
|
1617
|
+
namespace?: string;
|
|
1618
|
+
/**
|
|
1619
|
+
* Stencil is able to take an app's source and compile it to numerous targets,
|
|
1620
|
+
* such as an app to be deployed on an http server, or as a third-party library
|
|
1621
|
+
* to be distributed on npm. By default, Stencil apps have an output target type of www.
|
|
1622
|
+
*
|
|
1623
|
+
* The outputTargets config is an array of objects, with types of www and dist.
|
|
1624
|
+
*/
|
|
1625
|
+
outputTargets?: OutputTarget[];
|
|
1626
|
+
/**
|
|
1627
|
+
* The plugins config can be used to add your own rollup plugins.
|
|
1628
|
+
* By default, Stencil does not come with Sass or PostCSS support.
|
|
1629
|
+
* However, either can be added using the plugin array.
|
|
1630
|
+
*/
|
|
1631
|
+
plugins?: any[];
|
|
1632
|
+
/**
|
|
1633
|
+
* Generate js source map files for all bundles.
|
|
1634
|
+
* Set to `true` to always generate source maps, `false` to never generate source maps.
|
|
1635
|
+
* Set to `'dev'` to only generate source maps when the `--dev` flag is passed.
|
|
1636
|
+
* Defaults to `'dev'`.
|
|
1637
|
+
*/
|
|
1638
|
+
sourceMap?: boolean | 'dev';
|
|
1639
|
+
/**
|
|
1640
|
+
* The srcDir config specifies the directory which should contain the source typescript files
|
|
1641
|
+
* for each component. The standard for Stencil apps is to use src, which is the default.
|
|
1642
|
+
*/
|
|
1643
|
+
srcDir?: string;
|
|
1644
|
+
/**
|
|
1645
|
+
* Sets whether or not Stencil should transform path aliases set in a project's
|
|
1646
|
+
* `tsconfig.json` from the assigned module aliases to resolved relative paths.
|
|
1647
|
+
*
|
|
1648
|
+
* This behavior defaults to `true`, but may be opted-out of by setting this flag to `false`.
|
|
1649
|
+
*/
|
|
1650
|
+
transformAliasedImportPaths?: boolean;
|
|
1651
|
+
/**
|
|
1652
|
+
* When `true`, Stencil will suppress diagnostics which warn about public members using reserved names
|
|
1653
|
+
* (for example, decorating a method named `focus` with `@Method()`). Defaults to `false`.
|
|
1654
|
+
*/
|
|
1655
|
+
suppressReservedPublicNameWarnings?: boolean;
|
|
1656
|
+
/**
|
|
1657
|
+
* When `true`, we will validate a project's `package.json` based on the output target the user has designated
|
|
1658
|
+
* as `isPrimaryPackageOutputTarget: true` in their Stencil config.
|
|
1659
|
+
*/
|
|
1660
|
+
validatePrimaryPackageOutputTarget?: boolean;
|
|
1661
|
+
/**
|
|
1662
|
+
* Passes custom configuration down to the "@rollup/plugin-commonjs" that Stencil uses under the hood.
|
|
1663
|
+
* For further information: https://stenciljs.com/docs/module-bundling
|
|
1664
|
+
*/
|
|
1665
|
+
commonjs?: BundlingConfig;
|
|
1666
|
+
/**
|
|
1667
|
+
* Passes custom configuration down to the "@rollup/plugin-node-resolve" that Stencil uses under the hood.
|
|
1668
|
+
* For further information: https://stenciljs.com/docs/module-bundling
|
|
1669
|
+
*/
|
|
1670
|
+
nodeResolve?: NodeResolveConfig;
|
|
1671
|
+
/**
|
|
1672
|
+
* Passes custom configuration down to rollup itself, not all rollup options can be overridden.
|
|
1673
|
+
*/
|
|
1674
|
+
rollupConfig?: RollupConfig;
|
|
1675
|
+
/**
|
|
1676
|
+
* Sets if the ES5 build should be generated or not. Stencil generates a modern build without ES5,
|
|
1677
|
+
* whereas this setting to `true` will also create es5 builds for both dev and prod modes. Setting
|
|
1678
|
+
* `buildEs5` to `prod` will only build ES5 in prod mode. Basically if the app does not need to run
|
|
1679
|
+
* on legacy browsers (IE11 and Edge 18 and below), it's safe to not build ES5, which will also speed
|
|
1680
|
+
* up build times. Defaults to `false`.
|
|
1681
|
+
*/
|
|
1682
|
+
buildEs5?: boolean | 'prod';
|
|
1683
|
+
/**
|
|
1684
|
+
* Sets if the JS browser files are minified or not. Stencil uses `terser` under the hood.
|
|
1685
|
+
* Defaults to `false` in dev mode and `true` in production mode.
|
|
1686
|
+
*/
|
|
1687
|
+
minifyJs?: boolean;
|
|
1688
|
+
/**
|
|
1689
|
+
* Sets if the CSS is minified or not.
|
|
1690
|
+
* Defaults to `false` in dev mode and `true` in production mode.
|
|
1691
|
+
*/
|
|
1692
|
+
minifyCss?: boolean;
|
|
1693
|
+
/**
|
|
1694
|
+
* Forces Stencil to run in `dev` mode if the value is `true` and `production` mode
|
|
1695
|
+
* if it's `false`.
|
|
1696
|
+
*
|
|
1697
|
+
* Defaults to `false` (ie. production) unless the `--dev` flag is used in the CLI.
|
|
1698
|
+
*/
|
|
1699
|
+
devMode?: boolean;
|
|
1700
|
+
/**
|
|
1701
|
+
* Object to provide a custom logger. By default a `logger` is already provided for the
|
|
1702
|
+
* platform the compiler is running on, such as NodeJS or a browser.
|
|
1703
|
+
*/
|
|
1704
|
+
logger?: Logger;
|
|
1705
|
+
/**
|
|
1706
|
+
* Config to add extra runtime for DOM features that require more polyfills. Note
|
|
1707
|
+
* that not all DOM APIs are fully polyfilled when using the slot polyfill. These
|
|
1708
|
+
* are opt-in since not all users will require the additional runtime.
|
|
1709
|
+
*/
|
|
1710
|
+
extras?: ConfigExtras;
|
|
1711
|
+
/**
|
|
1712
|
+
* The hydrated flag identifies if a component and all of its child components
|
|
1713
|
+
* have finished hydrating. This helps prevent any flash of unstyled content (FOUC)
|
|
1714
|
+
* as various components are asynchronously downloaded and rendered. By default it
|
|
1715
|
+
* will add the `hydrated` CSS class to the element. The `hydratedFlag` config can be used
|
|
1716
|
+
* to change the name of the CSS class, change it to an attribute, or change which
|
|
1717
|
+
* type of CSS properties and values are assigned before and after hydrating. This config
|
|
1718
|
+
* can also be used to not include the hydrated flag at all by setting it to `null`.
|
|
1719
|
+
*/
|
|
1720
|
+
hydratedFlag?: HydratedFlag | null;
|
|
1721
|
+
/**
|
|
1722
|
+
* Ionic prefers to hide all components prior to hydration with a style tag appended
|
|
1723
|
+
* to the head of the document containing some `visibility: hidden;` css rules.
|
|
1724
|
+
*
|
|
1725
|
+
* Disabling this will remove the style tag that sets `visibility: hidden;` on all
|
|
1726
|
+
* un-hydrated web components. This more closely follows the HTML spec, and allows
|
|
1727
|
+
* you to set your own fallback content.
|
|
1728
|
+
*
|
|
1729
|
+
*/
|
|
1730
|
+
invisiblePrehydration?: boolean;
|
|
1731
|
+
/**
|
|
1732
|
+
* Sets the task queue used by stencil's runtime. The task queue schedules DOM read and writes
|
|
1733
|
+
* across the frames to efficiently render and reduce layout thrashing. By default,
|
|
1734
|
+
* `async` is used. It's recommended to also try each setting to decide which works
|
|
1735
|
+
* best for your use-case. In all cases, if your app has many CPU intensive tasks causing the
|
|
1736
|
+
* main thread to periodically lock-up, it's always recommended to try
|
|
1737
|
+
* [Web Workers](https://stenciljs.com/docs/web-workers) for those tasks.
|
|
1738
|
+
*
|
|
1739
|
+
* - `async`: DOM read and writes are scheduled in the next frame to prevent layout thrashing.
|
|
1740
|
+
* During intensive CPU tasks it will not reschedule rendering to happen in the next frame.
|
|
1741
|
+
* `async` is ideal for most apps, and if the app has many intensive tasks causing the main
|
|
1742
|
+
* thread to lock-up, it's recommended to try [Web Workers](https://stenciljs.com/docs/web-workers)
|
|
1743
|
+
* rather than the congestion async queue.
|
|
1744
|
+
*
|
|
1745
|
+
* - `congestionAsync`: DOM reads and writes are scheduled in the next frame to prevent layout
|
|
1746
|
+
* thrashing. When the app is heavily tasked and the queue becomes congested it will then
|
|
1747
|
+
* split the work across multiple frames to prevent blocking the main thread. However, it can
|
|
1748
|
+
* also introduce unnecessary reflows in some cases, especially during startup. `congestionAsync`
|
|
1749
|
+
* is ideal for apps running animations while also simultaneously executing intensive tasks
|
|
1750
|
+
* which may lock-up the main thread.
|
|
1751
|
+
*
|
|
1752
|
+
* - `immediate`: Makes writeTask() and readTask() callbacks to be executed synchronously. Tasks
|
|
1753
|
+
* are not scheduled to run in the next frame, but do note there is at least one microtask.
|
|
1754
|
+
* The `immediate` setting is ideal for apps that do not provide long running and smooth
|
|
1755
|
+
* animations. Like the async setting, if the app has intensive tasks causing the main thread
|
|
1756
|
+
* to lock-up, it's recommended to try [Web Workers](https://stenciljs.com/docs/web-workers).
|
|
1757
|
+
*/
|
|
1758
|
+
taskQueue?: 'async' | 'immediate' | 'congestionAsync';
|
|
1759
|
+
/**
|
|
1760
|
+
* Provide a object of key/values accessible within the app, using the `Env` object.
|
|
1761
|
+
*/
|
|
1762
|
+
env?: {
|
|
1763
|
+
[prop: string]: string | undefined;
|
|
1764
|
+
};
|
|
1765
|
+
docs?: StencilDocsConfig;
|
|
1766
|
+
globalScript?: string;
|
|
1767
|
+
srcIndexHtml?: string;
|
|
1768
|
+
testing?: TestingConfig;
|
|
1769
|
+
maxConcurrentWorkers?: number;
|
|
1770
|
+
preamble?: string;
|
|
1771
|
+
rollupPlugins?: {
|
|
1772
|
+
before?: any[];
|
|
1773
|
+
after?: any[];
|
|
1774
|
+
};
|
|
1775
|
+
entryComponentsHint?: string[];
|
|
1776
|
+
/**
|
|
1777
|
+
* Sets whether Stencil will write files to `dist/` during the build or not.
|
|
1778
|
+
*
|
|
1779
|
+
* By default this value is set to the opposite value of {@link devMode},
|
|
1780
|
+
* i.e. it will be `true` when building for production and `false` when
|
|
1781
|
+
* building for development.
|
|
1782
|
+
*/
|
|
1783
|
+
buildDist?: boolean;
|
|
1784
|
+
buildLogFilePath?: string;
|
|
1785
|
+
devInspector?: boolean;
|
|
1786
|
+
devServer?: StencilDevServerConfig;
|
|
1787
|
+
sys?: CompilerSystem;
|
|
1788
|
+
tsconfig?: string;
|
|
1789
|
+
validateTypes?: boolean;
|
|
1790
|
+
/**
|
|
1791
|
+
* Sets whether Stencil will watch for changes in the source files and rebuild the project automatically.
|
|
1792
|
+
* @default true
|
|
1793
|
+
*/
|
|
1794
|
+
watch?: boolean;
|
|
1795
|
+
/**
|
|
1796
|
+
* External directories to watch for changes. By default, Stencil will watch the root and {@link StencilConfig.srcDir}
|
|
1797
|
+
* directory for changes. If you want to watch additional directories, including e.g. `node_modules`, you can add them here.
|
|
1798
|
+
* @default []
|
|
1799
|
+
*/
|
|
1800
|
+
watchExternalDirs?: string[];
|
|
1801
|
+
/**
|
|
1802
|
+
* An array of RegExp patterns that are matched against all source files before adding
|
|
1803
|
+
* to the watch list in watch mode. If the file path matches any of the patterns, when it
|
|
1804
|
+
* is updated, it will not trigger a re-run of tests.
|
|
1805
|
+
*/
|
|
1806
|
+
watchIgnoredRegex?: RegExp | RegExp[];
|
|
1807
|
+
/**
|
|
1808
|
+
* An array of component tag names to exclude from production builds.
|
|
1809
|
+
* Useful to remove test, demo or experimental components from final output.
|
|
1810
|
+
*
|
|
1811
|
+
* **Note:** Exclusion only applies to production builds (default, or when `--prod` is used).
|
|
1812
|
+
* Development builds (with `--dev` flag) will include all components to support local testing.
|
|
1813
|
+
*
|
|
1814
|
+
* Supports glob patterns for matching multiple components:
|
|
1815
|
+
* - `['demo-*']` - Excludes all components starting with "demo-"
|
|
1816
|
+
* - `['*-test', '*-demo']` - Excludes components ending with "-test" or "-demo"
|
|
1817
|
+
* - `['my-component']` - Excludes a specific component
|
|
1818
|
+
*
|
|
1819
|
+
* Components matching these patterns will be completely excluded from all output targets.
|
|
1820
|
+
*
|
|
1821
|
+
* @example
|
|
1822
|
+
* ```ts
|
|
1823
|
+
* export const config: Config = {
|
|
1824
|
+
* excludeComponents: ['demo-*', 'test-component', '*-internal'],
|
|
1825
|
+
* };
|
|
1826
|
+
* ```
|
|
1827
|
+
*
|
|
1828
|
+
* @default []
|
|
1829
|
+
*/
|
|
1830
|
+
excludeComponents?: string[];
|
|
1831
|
+
/**
|
|
1832
|
+
* Set whether unused dependencies should be excluded from the built output.
|
|
1833
|
+
*/
|
|
1834
|
+
excludeUnusedDependencies?: boolean;
|
|
1835
|
+
stencilCoreResolvedId?: string;
|
|
1836
|
+
}
|
|
1837
|
+
interface ConfigExtrasBase {
|
|
1838
|
+
/**
|
|
1839
|
+
* Experimental flag. Projects that use a Stencil library built using the `dist` output target may have trouble lazily
|
|
1840
|
+
* loading components when using a bundler such as Vite or Parcel. Setting this flag to `true` will change how Stencil
|
|
1841
|
+
* lazily loads components in a way that works with additional bundlers. Setting this flag to `true` will increase
|
|
1842
|
+
* the size of the compiled output. Defaults to `false`.
|
|
1843
|
+
* @deprecated This flag has been deprecated in favor of `enableImportInjection`, which provides the same
|
|
1844
|
+
* functionality. `experimentalImportInjection` will be removed in a future major version of Stencil.
|
|
1845
|
+
*/
|
|
1846
|
+
experimentalImportInjection?: boolean;
|
|
1847
|
+
/**
|
|
1848
|
+
* Projects that use a Stencil library built using the `dist` output target may have trouble lazily
|
|
1849
|
+
* loading components when using a bundler such as Vite or Parcel. Setting this flag to `true` will change how Stencil
|
|
1850
|
+
* lazily loads components in a way that works with additional bundlers. Setting this flag to `true` will increase
|
|
1851
|
+
* the size of the compiled output. Defaults to `false`.
|
|
1852
|
+
*/
|
|
1853
|
+
enableImportInjection?: boolean;
|
|
1854
|
+
/**
|
|
1855
|
+
* Dispatches component lifecycle events. Mainly used for testing. Defaults to `false`.
|
|
1856
|
+
*/
|
|
1857
|
+
lifecycleDOMEvents?: boolean;
|
|
1858
|
+
/**
|
|
1859
|
+
* When a component is first attached to the DOM, this setting will wait a single tick before
|
|
1860
|
+
* rendering. This works around an Angular issue, where Angular attaches the elements before
|
|
1861
|
+
* settings their initial state, leading to double renders and unnecessary event dispatches.
|
|
1862
|
+
* Defaults to `false`.
|
|
1863
|
+
*/
|
|
1864
|
+
initializeNextTick?: boolean;
|
|
1865
|
+
/**
|
|
1866
|
+
* Enables the tagNameTransform option of `defineCustomElements()`, so the component tagName
|
|
1867
|
+
* can be customized at runtime. Defaults to `false`.
|
|
1868
|
+
* @deprecated This option has been deprecated in favour of `setTagTransformer` and `transformTag`. It will be removed in a future major version of Stencil.
|
|
1869
|
+
*/
|
|
1870
|
+
tagNameTransform?: boolean;
|
|
1871
|
+
/**
|
|
1872
|
+
* Adds `transformTag` calls to css strings and querySelector(All) calls
|
|
1873
|
+
*/
|
|
1874
|
+
additionalTagTransformers?: boolean | 'prod';
|
|
1875
|
+
/**
|
|
1876
|
+
* Experimental flag.
|
|
1877
|
+
* Updates the behavior of scoped components to align more closely with the behavior of the native
|
|
1878
|
+
* Shadow DOM when using `slot`s.
|
|
1879
|
+
* Defaults to `false`.
|
|
1880
|
+
*/
|
|
1881
|
+
experimentalScopedSlotChanges?: boolean;
|
|
1882
|
+
/**
|
|
1883
|
+
* By default Stencil turns the stylesheet provided to `globalStyle` into a constructable stylesheet
|
|
1884
|
+
* and adds it to each component which can be useful for sharing styles efficiently across components.
|
|
1885
|
+
* In some cases this can be undesirable:
|
|
1886
|
+
* - If `globalStyle` is intended to configure the lightDOM only
|
|
1887
|
+
* - If `globalStyle` is large it can bloat the size of SSR output when using declarative-shadow-dom
|
|
1888
|
+
* Setting this to `false` will prevent Stencil from adding any `globalStyle` to each component.
|
|
1889
|
+
*
|
|
1890
|
+
* Defaults to `true`.
|
|
1891
|
+
*/
|
|
1892
|
+
addGlobalStyleToComponents?: boolean;
|
|
1893
|
+
}
|
|
1894
|
+
type ConfigExtrasSlotFixes<ExperimentalFixesEnabled extends boolean, IndividualFlags extends boolean> = {
|
|
1895
|
+
/**
|
|
1896
|
+
* By default, the slot polyfill does not update `appendChild()` so that it appends
|
|
1897
|
+
* new child nodes into the correct child slot like how shadow dom works. This is an opt-in
|
|
1898
|
+
* polyfill for those who need it when using `element.appendChild(node)` and expecting the
|
|
1899
|
+
* child to be appended in the same location shadow dom would. This is not required for
|
|
1900
|
+
* IE11 or Edge 18, but can be enabled if the app is using `appendChild()`. Defaults to `false`.
|
|
1901
|
+
*/
|
|
1902
|
+
appendChildSlotFix?: IndividualFlags;
|
|
1903
|
+
/**
|
|
1904
|
+
* By default, the runtime does not polyfill `cloneNode()` when cloning a component
|
|
1905
|
+
* that uses the slot polyfill. This is an opt-in polyfill for those who need it.
|
|
1906
|
+
* This is not required for IE11 or Edge 18, but can be enabled if the app is using
|
|
1907
|
+
* `cloneNode()` and unexpected node are being cloned due to the slot polyfill
|
|
1908
|
+
* simulating shadow dom. Defaults to `false`.
|
|
1909
|
+
*/
|
|
1910
|
+
cloneNodeFix?: IndividualFlags;
|
|
1911
|
+
/**
|
|
1912
|
+
* Experimental flag to align the behavior of invoking `textContent` on a scoped component to act more like a
|
|
1913
|
+
* component that uses the shadow DOM. Defaults to `false`
|
|
1914
|
+
*/
|
|
1915
|
+
scopedSlotTextContentFix?: IndividualFlags;
|
|
1916
|
+
/**
|
|
1917
|
+
* For browsers that do not support shadow dom (IE11 and Edge 18 and below), slot is polyfilled
|
|
1918
|
+
* to simulate the same behavior. However, the host element's `childNodes` and `children`
|
|
1919
|
+
* getters are not patched to only show the child nodes and elements of the default slot.
|
|
1920
|
+
* Defaults to `false`.
|
|
1921
|
+
*/
|
|
1922
|
+
slotChildNodesFix?: IndividualFlags;
|
|
1923
|
+
/**
|
|
1924
|
+
* Enables all slot-related fixes such as {@link slotChildNodesFix}, and
|
|
1925
|
+
* {@link scopedSlotTextContentFix}.
|
|
1926
|
+
*/
|
|
1927
|
+
experimentalSlotFixes?: ExperimentalFixesEnabled;
|
|
1928
|
+
};
|
|
1929
|
+
type ConfigExtras = ConfigExtrasBase & (ConfigExtrasSlotFixes<true, true> | ConfigExtrasSlotFixes<false, boolean>);
|
|
1930
|
+
interface Config extends StencilConfig {
|
|
1931
|
+
buildAppCore?: boolean;
|
|
1932
|
+
buildDocs?: boolean;
|
|
1933
|
+
configPath?: string;
|
|
1934
|
+
writeLog?: boolean;
|
|
1935
|
+
devServer?: DevServerConfig;
|
|
1936
|
+
fsNamespace?: string;
|
|
1937
|
+
logLevel?: LogLevel;
|
|
1938
|
+
rootDir?: string;
|
|
1939
|
+
packageJsonFilePath?: string;
|
|
1940
|
+
suppressLogs?: boolean;
|
|
1941
|
+
profile?: boolean;
|
|
1942
|
+
tsCompilerOptions?: any;
|
|
1943
|
+
tsWatchOptions?: any;
|
|
1944
|
+
_isValidated?: boolean;
|
|
1945
|
+
_isTesting?: boolean;
|
|
1946
|
+
/**
|
|
1947
|
+
* Whether running in a CI environment (disables interactive features, adjusts worker count)
|
|
1948
|
+
*/
|
|
1949
|
+
ci?: boolean;
|
|
1950
|
+
/**
|
|
1951
|
+
* Enable server-side rendering mode
|
|
1952
|
+
*/
|
|
1953
|
+
ssr?: boolean;
|
|
1954
|
+
/**
|
|
1955
|
+
* Enable prerendering
|
|
1956
|
+
*/
|
|
1957
|
+
prerender?: boolean;
|
|
1958
|
+
/**
|
|
1959
|
+
* Path to output docs JSON file (when --docsJson flag is used)
|
|
1960
|
+
*/
|
|
1961
|
+
docsJsonPath?: string;
|
|
1962
|
+
/**
|
|
1963
|
+
* Path to output stats JSON file, or true to use default path
|
|
1964
|
+
*/
|
|
1965
|
+
statsJsonPath?: string | boolean;
|
|
1966
|
+
/**
|
|
1967
|
+
* Whether to generate service worker
|
|
1968
|
+
*/
|
|
1969
|
+
generateServiceWorker?: boolean;
|
|
1970
|
+
/**
|
|
1971
|
+
* Whether e2e tests are being run
|
|
1972
|
+
*/
|
|
1973
|
+
e2eTests?: boolean;
|
|
1974
|
+
/**
|
|
1975
|
+
* Dev server address override
|
|
1976
|
+
*/
|
|
1977
|
+
devServerAddress?: string;
|
|
1978
|
+
/**
|
|
1979
|
+
* Dev server port override
|
|
1980
|
+
*/
|
|
1981
|
+
devServerPort?: number;
|
|
1982
|
+
/**
|
|
1983
|
+
* Whether to open browser on dev server start
|
|
1984
|
+
*/
|
|
1985
|
+
devServerOpen?: boolean;
|
|
1986
|
+
}
|
|
1987
|
+
/**
|
|
1988
|
+
* A 'loose' type useful for wrapping an incomplete / possible malformed
|
|
1989
|
+
* object as we work on getting it comply with a particular Interface T.
|
|
1990
|
+
*
|
|
1991
|
+
* Example:
|
|
1992
|
+
*
|
|
1993
|
+
* ```ts
|
|
1994
|
+
* interface Foo {
|
|
1995
|
+
* bar: string
|
|
1996
|
+
* }
|
|
1997
|
+
*
|
|
1998
|
+
* function validateFoo(foo: Loose<Foo>): Foo {
|
|
1999
|
+
* let validatedFoo = {
|
|
2000
|
+
* ...foo,
|
|
2001
|
+
* bar: foo.bar || DEFAULT_BAR
|
|
2002
|
+
* }
|
|
2003
|
+
*
|
|
2004
|
+
* return validatedFoo
|
|
2005
|
+
* }
|
|
2006
|
+
* ```
|
|
2007
|
+
*
|
|
2008
|
+
* Use this when you need to take user input or something from some other part
|
|
2009
|
+
* of the world that we don't control and transform it into something
|
|
2010
|
+
* conforming to a given interface. For best results, pair with a validation
|
|
2011
|
+
* function as shown in the example.
|
|
2012
|
+
*/
|
|
2013
|
+
type Loose<T extends Object> = Record<string, any> & Partial<T>;
|
|
2014
|
+
/**
|
|
2015
|
+
* A Loose version of the Config interface. This is intended to let us load a partial config
|
|
2016
|
+
* and have type information carry though as we construct an object which is a valid `Config`.
|
|
2017
|
+
*/
|
|
2018
|
+
type UnvalidatedConfig = Loose<Config>;
|
|
2019
|
+
/**
|
|
2020
|
+
* Helper type to strip optional markers from keys in a type, while preserving other type information for the key.
|
|
2021
|
+
* This type takes a union of keys, K, in type T to allow for the type T to be gradually updated.
|
|
2022
|
+
*
|
|
2023
|
+
* ```typescript
|
|
2024
|
+
* type Foo { bar?: number, baz?: string }
|
|
2025
|
+
* type ReqFieldFoo = RequireFields<Foo, 'bar'>; // { bar: number, baz?: string }
|
|
2026
|
+
* ```
|
|
2027
|
+
*/
|
|
2028
|
+
type RequireFields<T, K extends keyof T> = T & { [P in K]-?: T[P] };
|
|
2029
|
+
/**
|
|
2030
|
+
* Fields in {@link Config} to make required for {@link ValidatedConfig}
|
|
2031
|
+
*/
|
|
2032
|
+
type StrictConfigFields = keyof Pick<Config, 'buildEs5' | 'cacheDir' | 'devMode' | 'devServer' | 'extras' | 'fsNamespace' | 'hashFileNames' | 'hashedFileNameLength' | 'hydratedFlag' | 'logLevel' | 'logger' | 'minifyCss' | 'minifyJs' | 'namespace' | 'outputTargets' | 'packageJsonFilePath' | 'rollupConfig' | 'rootDir' | 'srcDir' | 'srcIndexHtml' | 'sys' | 'testing' | 'transformAliasedImportPaths' | 'validatePrimaryPackageOutputTarget'>;
|
|
2033
|
+
/**
|
|
2034
|
+
* A version of {@link Config} that makes certain fields required. This type represents a valid configuration entity.
|
|
2035
|
+
* When a configuration is received by the user, it is a bag of unverified data. In order to make stricter guarantees
|
|
2036
|
+
* about the data from a type-safety perspective, this type is intended to be used throughout the codebase once
|
|
2037
|
+
* validations have occurred at runtime.
|
|
2038
|
+
*/
|
|
2039
|
+
type ValidatedConfig = RequireFields<Config, StrictConfigFields> & {
|
|
2040
|
+
sourceMap: boolean;
|
|
2041
|
+
};
|
|
2042
|
+
interface HydratedFlag {
|
|
2043
|
+
/**
|
|
2044
|
+
* Defaults to `hydrated`.
|
|
2045
|
+
*/
|
|
2046
|
+
name?: string;
|
|
2047
|
+
/**
|
|
2048
|
+
* Can be either `class` or `attribute`. Defaults to `class`.
|
|
2049
|
+
*/
|
|
2050
|
+
selector?: 'class' | 'attribute';
|
|
2051
|
+
/**
|
|
2052
|
+
* The CSS property used to show and hide components. Defaults to use the CSS `visibility`
|
|
2053
|
+
* property. Other commonly used CSS properties would be `display` with the `initialValue`
|
|
2054
|
+
* setting as `none`, or `opacity` with the `initialValue` as `0`. Defaults to `visibility`
|
|
2055
|
+
* and the default `initialValue` is `hidden`.
|
|
2056
|
+
*/
|
|
2057
|
+
property?: string;
|
|
2058
|
+
/**
|
|
2059
|
+
* This is the CSS value to give all components before it has been hydrated.
|
|
2060
|
+
* Defaults to `hidden`.
|
|
2061
|
+
*/
|
|
2062
|
+
initialValue?: string;
|
|
2063
|
+
/**
|
|
2064
|
+
* This is the CSS value to assign once a component has finished hydrating.
|
|
2065
|
+
* This is the CSS value that'll allow the component to show. Defaults to `inherit`.
|
|
2066
|
+
*/
|
|
2067
|
+
hydratedValue?: string;
|
|
2068
|
+
}
|
|
2069
|
+
interface StencilDevServerConfig {
|
|
2070
|
+
/**
|
|
2071
|
+
* IP address used by the dev server. The default is `0.0.0.0`, which points to all IPv4 addresses
|
|
2072
|
+
* on the local machine, such as `localhost`.
|
|
2073
|
+
*/
|
|
2074
|
+
address?: string;
|
|
2075
|
+
/**
|
|
2076
|
+
* Base path to be used by the server. Defaults to the root pathname.
|
|
2077
|
+
*/
|
|
2078
|
+
basePath?: string;
|
|
2079
|
+
/**
|
|
2080
|
+
* EXPERIMENTAL!
|
|
2081
|
+
* During development, node modules can be independently requested and bundled, making for
|
|
2082
|
+
* faster build times. This is only available using the Stencil Dev Server throughout
|
|
2083
|
+
* development. Production builds and builds with the `es5` flag will override
|
|
2084
|
+
* this setting to `false`. Default is `false`.
|
|
2085
|
+
*/
|
|
2086
|
+
experimentalDevModules?: boolean;
|
|
2087
|
+
/**
|
|
2088
|
+
* If the dev server should respond with gzip compressed content. Defaults to `true`.
|
|
2089
|
+
*/
|
|
2090
|
+
gzip?: boolean;
|
|
2091
|
+
/**
|
|
2092
|
+
* When set, the dev server will run via https using the SSL certificate and key you provide
|
|
2093
|
+
* (use `fs` if you want to read them from files).
|
|
2094
|
+
*/
|
|
2095
|
+
https?: Credentials;
|
|
2096
|
+
/**
|
|
2097
|
+
* The URL the dev server should first open to. Defaults to `/`.
|
|
2098
|
+
*/
|
|
2099
|
+
initialLoadUrl?: string;
|
|
2100
|
+
/**
|
|
2101
|
+
* When `true`, every request to the server will be logged within the terminal.
|
|
2102
|
+
* Defaults to `false`.
|
|
2103
|
+
*/
|
|
2104
|
+
logRequests?: boolean;
|
|
2105
|
+
/**
|
|
2106
|
+
* When set to `true`, the local dev URL is opened in your default browser when the dev server starts.
|
|
2107
|
+
* Defaults to `false`.
|
|
2108
|
+
*/
|
|
2109
|
+
openBrowser?: boolean;
|
|
2110
|
+
/**
|
|
2111
|
+
* Sets the server's port. Defaults to `3333`.
|
|
2112
|
+
*/
|
|
2113
|
+
port?: number;
|
|
2114
|
+
/**
|
|
2115
|
+
* When set to `true`, the dev server will exit with an error if the specified port is already in use.
|
|
2116
|
+
* When set to `false`, the dev server will automatically try the next available port.
|
|
2117
|
+
* Defaults to `false`.
|
|
2118
|
+
*/
|
|
2119
|
+
strictPort?: boolean;
|
|
2120
|
+
/**
|
|
2121
|
+
* When files are watched and updated, by default the dev server will use `hmr` (Hot Module Replacement)
|
|
2122
|
+
* to update the page without a full page refresh. To have the page do a full refresh use `pageReload`.
|
|
2123
|
+
* To disable any reloading, use `null`. Defaults to `hmr`.
|
|
2124
|
+
*/
|
|
2125
|
+
reloadStrategy?: PageReloadStrategy;
|
|
2126
|
+
/**
|
|
2127
|
+
* Local path to a NodeJs file with a dev server request listener as the default export.
|
|
2128
|
+
* The user's request listener is given the first chance to handle every request the dev server
|
|
2129
|
+
* receives, and can choose to handle it or instead pass it on to the default dev server
|
|
2130
|
+
* by calling `next()`.
|
|
2131
|
+
*
|
|
2132
|
+
* Below is an example of a NodeJs file the `requestListenerPath` config is using.
|
|
2133
|
+
* The request and response arguments are the same as Node's `http` module and `RequestListener`
|
|
2134
|
+
* callback. https://nodejs.org/api/http.html#http_http_createserver_options_requestlistener
|
|
2135
|
+
*
|
|
2136
|
+
* ```js
|
|
2137
|
+
* module.exports = function (req, res, next) {
|
|
2138
|
+
* if (req.url === '/ping') {
|
|
2139
|
+
* // custom response overriding the dev server
|
|
2140
|
+
* res.setHeader('Content-Type', 'text/plain');
|
|
2141
|
+
* res.writeHead(200);
|
|
2142
|
+
* res.end('pong');
|
|
2143
|
+
* } else {
|
|
2144
|
+
* // pass request on to the default dev server
|
|
2145
|
+
* next();
|
|
2146
|
+
* }
|
|
2147
|
+
* };
|
|
2148
|
+
* ```
|
|
2149
|
+
*/
|
|
2150
|
+
requestListenerPath?: string;
|
|
2151
|
+
/**
|
|
2152
|
+
* The root directory to serve the files from.
|
|
2153
|
+
*/
|
|
2154
|
+
root?: string;
|
|
2155
|
+
/**
|
|
2156
|
+
* If the dev server should Server-Side Render (SSR) each page, meaning it'll dynamically generate
|
|
2157
|
+
* server-side rendered html on each page load. The `--ssr` flag will most commonly be used with
|
|
2158
|
+
* the`--dev --watch --serve` flags during development. Note that this is for development purposes
|
|
2159
|
+
* only, and the built-in dev server should not be used for production. Defaults to `false`.
|
|
2160
|
+
*/
|
|
2161
|
+
ssr?: boolean;
|
|
2162
|
+
/**
|
|
2163
|
+
* If the dev server fails to start up within the given timeout (in milliseconds), the startup will
|
|
2164
|
+
* be canceled. Set to zero to disable the timeout. Defaults to `15000`.
|
|
2165
|
+
*/
|
|
2166
|
+
startupTimeout?: number;
|
|
2167
|
+
/**
|
|
2168
|
+
* Whether to use the dev server's websocket client or not. Defaults to `true`.
|
|
2169
|
+
*/
|
|
2170
|
+
websocket?: boolean;
|
|
2171
|
+
/**
|
|
2172
|
+
* If the dev server should fork a worker for the server process or not. A singled-threaded dev server
|
|
2173
|
+
* is slower, however it is useful for debugging http requests and responses. Defaults to `true`.
|
|
2174
|
+
*/
|
|
2175
|
+
worker?: boolean;
|
|
2176
|
+
}
|
|
2177
|
+
interface DevServerConfig extends StencilDevServerConfig {
|
|
2178
|
+
browserUrl?: string;
|
|
2179
|
+
devServerDir?: string;
|
|
2180
|
+
/**
|
|
2181
|
+
* A list of glob patterns like `subdir/*.js` to exclude from hot-module
|
|
2182
|
+
* reloading updates.
|
|
2183
|
+
*/
|
|
2184
|
+
excludeHmr?: string[];
|
|
2185
|
+
historyApiFallback?: HistoryApiFallback;
|
|
2186
|
+
openBrowser?: boolean;
|
|
2187
|
+
prerenderConfig?: string;
|
|
2188
|
+
protocol?: 'http' | 'https';
|
|
2189
|
+
srcIndexHtml?: string;
|
|
2190
|
+
/**
|
|
2191
|
+
* Route to be used for the "ping" sub-route of the Stencil dev server.
|
|
2192
|
+
* This route will return a 200 status code once the Stencil build has finished.
|
|
2193
|
+
* Setting this to `null` will disable the ping route.
|
|
2194
|
+
*
|
|
2195
|
+
* Defaults to `/ping`
|
|
2196
|
+
*/
|
|
2197
|
+
pingRoute?: string | null;
|
|
2198
|
+
}
|
|
2199
|
+
interface HistoryApiFallback {
|
|
2200
|
+
index?: string;
|
|
2201
|
+
disableDotRule?: boolean;
|
|
2202
|
+
}
|
|
2203
|
+
interface DevServerEditor {
|
|
2204
|
+
id: string;
|
|
2205
|
+
name?: string;
|
|
2206
|
+
supported?: boolean;
|
|
2207
|
+
priority?: number;
|
|
2208
|
+
}
|
|
2209
|
+
type PageReloadStrategy = 'hmr' | 'pageReload' | null;
|
|
2210
|
+
/**
|
|
2211
|
+
* The prerender config is used when prerendering a `www` output target.
|
|
2212
|
+
* Within `stencil.config.ts`, set the path to the prerendering
|
|
2213
|
+
* config file path using the `prerenderConfig` property, such as:
|
|
2214
|
+
*
|
|
2215
|
+
* ```tsx
|
|
2216
|
+
* import { Config } from '@stencil/core';
|
|
2217
|
+
* export const config: Config = {
|
|
2218
|
+
* outputTargets: [
|
|
2219
|
+
* {
|
|
2220
|
+
* type: 'www',
|
|
2221
|
+
* baseUrl: 'https://stenciljs.com/',
|
|
2222
|
+
* prerenderConfig: './prerender.config.ts',
|
|
2223
|
+
* }
|
|
2224
|
+
* ]
|
|
2225
|
+
* };
|
|
2226
|
+
* ```
|
|
2227
|
+
*
|
|
2228
|
+
* The `prerender.config.ts` should export a `config` object using
|
|
2229
|
+
* the `PrerenderConfig` interface.
|
|
2230
|
+
*
|
|
2231
|
+
* ```tsx
|
|
2232
|
+
* import { PrerenderConfig } from '@stencil/core';
|
|
2233
|
+
* export const config: PrerenderConfig = {
|
|
2234
|
+
* ...
|
|
2235
|
+
* };
|
|
2236
|
+
* ```
|
|
2237
|
+
*
|
|
2238
|
+
* For more info: https://stenciljs.com/docs/static-site-generation
|
|
2239
|
+
*/
|
|
2240
|
+
interface PrerenderConfig {
|
|
2241
|
+
/**
|
|
2242
|
+
* Run after each `document` is hydrated, but before it is serialized
|
|
2243
|
+
* into an HTML string. Hook is passed the `document` and its `URL`.
|
|
2244
|
+
*/
|
|
2245
|
+
afterHydrate?(document: Document, url: URL, results: PrerenderUrlResults): any | Promise<any>;
|
|
2246
|
+
/**
|
|
2247
|
+
* Run before each `document` is hydrated. Hook is passed the `document` it's `URL`.
|
|
2248
|
+
*/
|
|
2249
|
+
beforeHydrate?(document: Document, url: URL): any | Promise<any>;
|
|
2250
|
+
/**
|
|
2251
|
+
* Runs after the template Document object has serialize into an
|
|
2252
|
+
* HTML formatted string. Returns an HTML string to be used as the
|
|
2253
|
+
* base template for all prerendered pages.
|
|
2254
|
+
*/
|
|
2255
|
+
afterSerializeTemplate?(html: string): string | Promise<string>;
|
|
2256
|
+
/**
|
|
2257
|
+
* Runs before the template Document object is serialize into an
|
|
2258
|
+
* HTML formatted string. Returns the Document to be serialized which
|
|
2259
|
+
* will become the base template html for all prerendered pages.
|
|
2260
|
+
*/
|
|
2261
|
+
beforeSerializeTemplate?(document: Document): Document | Promise<Document>;
|
|
2262
|
+
/**
|
|
2263
|
+
* A hook to be used to generate the canonical `<link>` tag
|
|
2264
|
+
* which goes in the `<head>` of every prerendered page. Returning `null`
|
|
2265
|
+
* will not add a canonical url tag to the page.
|
|
2266
|
+
*/
|
|
2267
|
+
canonicalUrl?(url: URL): string | null;
|
|
2268
|
+
/**
|
|
2269
|
+
* While prerendering, crawl same-origin URLs found within `<a href>` elements.
|
|
2270
|
+
* Defaults to `true`.
|
|
2271
|
+
*/
|
|
2272
|
+
crawlUrls?: boolean;
|
|
2273
|
+
/**
|
|
2274
|
+
* URLs to start the prerendering from. By default the root URL of `/` is used.
|
|
2275
|
+
*/
|
|
2276
|
+
entryUrls?: string[];
|
|
2277
|
+
/**
|
|
2278
|
+
* Return `true` the given `<a>` element should be crawled or not.
|
|
2279
|
+
*/
|
|
2280
|
+
filterAnchor?(attrs: {
|
|
2281
|
+
[attrName: string]: string;
|
|
2282
|
+
}, base?: URL): boolean;
|
|
2283
|
+
/**
|
|
2284
|
+
* Return `true` if the given URL should be prerendered or not.
|
|
2285
|
+
*/
|
|
2286
|
+
filterUrl?(url: URL, base: URL): boolean;
|
|
2287
|
+
/**
|
|
2288
|
+
* Returns the file path which the prerendered HTML content
|
|
2289
|
+
* should be written to.
|
|
2290
|
+
*/
|
|
2291
|
+
filePath?(url: URL, filePath: string): string;
|
|
2292
|
+
/**
|
|
2293
|
+
* Returns the hydrate options to use for each individual prerendered page.
|
|
2294
|
+
*/
|
|
2295
|
+
hydrateOptions?(url: URL): PrerenderHydrateOptions;
|
|
2296
|
+
/**
|
|
2297
|
+
* Returns the template file's content. The template is the base
|
|
2298
|
+
* HTML used for all prerendered pages.
|
|
2299
|
+
*/
|
|
2300
|
+
loadTemplate?(filePath: string): string | Promise<string>;
|
|
2301
|
+
/**
|
|
2302
|
+
* Used to normalize the page's URL from a given a string and the current
|
|
2303
|
+
* page's base URL. Largely used when reading an anchor's `href` attribute
|
|
2304
|
+
* value and normalizing it into a `URL`.
|
|
2305
|
+
*/
|
|
2306
|
+
normalizeUrl?(href: string, base: URL): URL;
|
|
2307
|
+
robotsTxt?(opts: RobotsTxtOpts): string | RobotsTxtResults;
|
|
2308
|
+
sitemapXml?(opts: SitemapXmpOpts): string | SitemapXmpResults;
|
|
2309
|
+
/**
|
|
2310
|
+
* Static Site Generated (SSG). Does not include Stencil's client-side
|
|
2311
|
+
* JavaScript, custom elements or preload modules.
|
|
2312
|
+
*/
|
|
2313
|
+
staticSite?: boolean;
|
|
2314
|
+
/**
|
|
2315
|
+
* If the prerendered URLs should have a trailing "/"" or not. Defaults to `false`.
|
|
2316
|
+
*/
|
|
2317
|
+
trailingSlash?: boolean;
|
|
2318
|
+
}
|
|
2319
|
+
interface HydrateDocumentOptions {
|
|
2320
|
+
/**
|
|
2321
|
+
* Build ID that will be added to `<html data-stencil-build="BUILD_ID">`. By default
|
|
2322
|
+
* a random ID will be generated
|
|
2323
|
+
*/
|
|
2324
|
+
buildId?: string;
|
|
2325
|
+
/**
|
|
2326
|
+
* Sets the `href` attribute on the `<link rel="canonical">`
|
|
2327
|
+
* tag within the `<head>`. If the value is not defined it will
|
|
2328
|
+
* ensure a canonical link tag is no included in the `<head>`.
|
|
2329
|
+
*/
|
|
2330
|
+
canonicalUrl?: string;
|
|
2331
|
+
/**
|
|
2332
|
+
* Include the HTML comments and attributes used by the client-side
|
|
2333
|
+
* JavaScript to read the structure of the HTML and rebuild each
|
|
2334
|
+
* component. Defaults to `true`.
|
|
2335
|
+
*/
|
|
2336
|
+
clientHydrateAnnotations?: boolean;
|
|
2337
|
+
/**
|
|
2338
|
+
* Constrain `setTimeout()` to 1ms, but still async. Also
|
|
2339
|
+
* only allows `setInterval()` to fire once, also constrained to 1ms.
|
|
2340
|
+
* Defaults to `true`.
|
|
2341
|
+
*/
|
|
2342
|
+
constrainTimeouts?: boolean;
|
|
2343
|
+
/**
|
|
2344
|
+
* Sets `document.cookie`
|
|
2345
|
+
*/
|
|
2346
|
+
cookie?: string;
|
|
2347
|
+
/**
|
|
2348
|
+
* Sets the `dir` attribute on the top level `<html>`.
|
|
2349
|
+
*/
|
|
2350
|
+
direction?: string;
|
|
2351
|
+
/**
|
|
2352
|
+
* Component tag names listed here will not be prerendered, nor will
|
|
2353
|
+
* hydrated on the client-side. Components listed here will be ignored
|
|
2354
|
+
* as custom elements and treated no differently than a `<div>`.
|
|
2355
|
+
*/
|
|
2356
|
+
excludeComponents?: string[];
|
|
2357
|
+
/**
|
|
2358
|
+
* Sets the `lang` attribute on the top level `<html>`.
|
|
2359
|
+
*/
|
|
2360
|
+
language?: string;
|
|
2361
|
+
/**
|
|
2362
|
+
* Maximum number of components to hydrate on one page. Defaults to `300`.
|
|
2363
|
+
*/
|
|
2364
|
+
maxHydrateCount?: number;
|
|
2365
|
+
/**
|
|
2366
|
+
* Sets `document.referrer`
|
|
2367
|
+
*/
|
|
2368
|
+
referrer?: string;
|
|
2369
|
+
/**
|
|
2370
|
+
* Removes every `<script>` element found in the `document`. Defaults to `false`.
|
|
2371
|
+
*/
|
|
2372
|
+
removeScripts?: boolean;
|
|
2373
|
+
/**
|
|
2374
|
+
* Removes CSS not used by elements within the `document`. Defaults to `true`.
|
|
2375
|
+
*/
|
|
2376
|
+
removeUnusedStyles?: boolean;
|
|
2377
|
+
/**
|
|
2378
|
+
* The url the runtime uses for the resources, such as the assets directory.
|
|
2379
|
+
*/
|
|
2380
|
+
resourcesUrl?: string;
|
|
2381
|
+
/**
|
|
2382
|
+
* Prints out runtime console logs to the NodeJS process. Defaults to `false`.
|
|
2383
|
+
*/
|
|
2384
|
+
runtimeLogging?: boolean;
|
|
2385
|
+
/**
|
|
2386
|
+
* Component tags listed here will only be prerendered or server-side-rendered
|
|
2387
|
+
* and will not be client-side hydrated. This is useful for components that
|
|
2388
|
+
* are not dynamic and do not need to be defined as a custom element within the
|
|
2389
|
+
* browser. For example, a header or footer component would be a good example that
|
|
2390
|
+
* may not require any client-side JavaScript.
|
|
2391
|
+
*/
|
|
2392
|
+
staticComponents?: string[];
|
|
2393
|
+
/**
|
|
2394
|
+
* The amount of milliseconds to wait for a page to finish rendering until
|
|
2395
|
+
* a timeout error is thrown. Defaults to `15000`.
|
|
2396
|
+
*/
|
|
2397
|
+
timeout?: number;
|
|
2398
|
+
/**
|
|
2399
|
+
* Sets `document.title`.
|
|
2400
|
+
*/
|
|
2401
|
+
title?: string;
|
|
2402
|
+
/**
|
|
2403
|
+
* Sets `location.href`
|
|
2404
|
+
*/
|
|
2405
|
+
url?: string;
|
|
2406
|
+
/**
|
|
2407
|
+
* Sets `navigator.userAgent`
|
|
2408
|
+
*/
|
|
2409
|
+
userAgent?: string;
|
|
2410
|
+
/**
|
|
2411
|
+
* Configure how Stencil serializes the components shadow root.
|
|
2412
|
+
* - If set to `declarative-shadow-dom` the component will be rendered within a Declarative Shadow DOM.
|
|
2413
|
+
* - If set to `scoped` Stencil will render the contents of the shadow root as a `scoped: true` component
|
|
2414
|
+
* and the shadow DOM will be created during client-side hydration.
|
|
2415
|
+
* - Alternatively you can mix and match the two by providing an object with `declarative-shadow-dom` and `scoped` keys,
|
|
2416
|
+
* the value arrays containing the tag names of the components that should be rendered in that mode.
|
|
2417
|
+
*
|
|
2418
|
+
* Examples:
|
|
2419
|
+
* - `{ 'declarative-shadow-dom': ['my-component-1', 'another-component'], default: 'scoped' }`
|
|
2420
|
+
* Render all components as `scoped` apart from `my-component-1` and `another-component`
|
|
2421
|
+
* - `{ 'scoped': ['an-option-component'], default: 'declarative-shadow-dom' }`
|
|
2422
|
+
* Render all components within `declarative-shadow-dom` apart from `an-option-component`
|
|
2423
|
+
* - `'scoped'` Render all components as `scoped`
|
|
2424
|
+
* - `false` disables shadow root serialization
|
|
2425
|
+
*
|
|
2426
|
+
* *NOTE* `true` has been deprecated in favor of `declarative-shadow-dom` and `scoped`
|
|
2427
|
+
* @default 'declarative-shadow-dom'
|
|
2428
|
+
*/
|
|
2429
|
+
serializeShadowRoot?: 'declarative-shadow-dom' | 'scoped' | {
|
|
2430
|
+
'declarative-shadow-dom'?: string[];
|
|
2431
|
+
scoped?: string[];
|
|
2432
|
+
default: 'declarative-shadow-dom' | 'scoped';
|
|
2433
|
+
} | boolean;
|
|
2434
|
+
}
|
|
2435
|
+
interface SerializeDocumentOptions extends HydrateDocumentOptions {
|
|
2436
|
+
/**
|
|
2437
|
+
* Runs after the `document` has been hydrated.
|
|
2438
|
+
*/
|
|
2439
|
+
afterHydrate?(document: any): any | Promise<any>;
|
|
2440
|
+
/**
|
|
2441
|
+
* Sets an approximate line width the HTML should attempt to stay within.
|
|
2442
|
+
* Note that this is "approximate", in that HTML may often not be able
|
|
2443
|
+
* to be split at an exact line width. Additionally, new lines created
|
|
2444
|
+
* is where HTML naturally already has whitespace, such as before an
|
|
2445
|
+
* attribute or spaces between words. Defaults to `100`.
|
|
2446
|
+
*/
|
|
2447
|
+
approximateLineWidth?: number;
|
|
2448
|
+
/**
|
|
2449
|
+
* Runs before the `document` has been hydrated.
|
|
2450
|
+
*/
|
|
2451
|
+
beforeHydrate?(document: any): any | Promise<any>;
|
|
2452
|
+
/**
|
|
2453
|
+
* Format the HTML in a nicely indented format.
|
|
2454
|
+
* Defaults to `false`.
|
|
2455
|
+
*/
|
|
2456
|
+
prettyHtml?: boolean;
|
|
2457
|
+
/**
|
|
2458
|
+
* Remove quotes from attribute values when possible.
|
|
2459
|
+
* Defaults to `true`.
|
|
2460
|
+
*/
|
|
2461
|
+
removeAttributeQuotes?: boolean;
|
|
2462
|
+
/**
|
|
2463
|
+
* Remove the `=""` from standardized `boolean` attributes,
|
|
2464
|
+
* such as `hidden` or `checked`. Defaults to `true`.
|
|
2465
|
+
*/
|
|
2466
|
+
removeBooleanAttributeQuotes?: boolean;
|
|
2467
|
+
/**
|
|
2468
|
+
* Remove these standardized attributes when their value is empty:
|
|
2469
|
+
* `class`, `dir`, `id`, `lang`, and `name`, `title`. Defaults to `true`.
|
|
2470
|
+
*/
|
|
2471
|
+
removeEmptyAttributes?: boolean;
|
|
2472
|
+
/**
|
|
2473
|
+
* Remove HTML comments. Defaults to `true`.
|
|
2474
|
+
*/
|
|
2475
|
+
removeHtmlComments?: boolean;
|
|
2476
|
+
/**
|
|
2477
|
+
* The `fullDocument` flag determines the format of the rendered output. Set it to true to
|
|
2478
|
+
* generate a complete HTML document, or false to render only the component.
|
|
2479
|
+
* @default true
|
|
2480
|
+
*/
|
|
2481
|
+
fullDocument?: boolean;
|
|
2482
|
+
/**
|
|
2483
|
+
* Style modes to render the component in.
|
|
2484
|
+
* @see https://stenciljs.com/docs/styling#style-modes
|
|
2485
|
+
*/
|
|
2486
|
+
modes?: ResolutionHandler[];
|
|
2487
|
+
}
|
|
2488
|
+
interface HydrateFactoryOptions extends SerializeDocumentOptions {
|
|
2489
|
+
serializeToHtml: boolean;
|
|
2490
|
+
destroyWindow: boolean;
|
|
2491
|
+
destroyDocument: boolean;
|
|
2492
|
+
}
|
|
2493
|
+
interface PrerenderHydrateOptions extends SerializeDocumentOptions {
|
|
2494
|
+
/**
|
|
2495
|
+
* Adds `<link rel="modulepreload">` for modules that will eventually be requested.
|
|
2496
|
+
* Defaults to `true`.
|
|
2497
|
+
*/
|
|
2498
|
+
addModulePreloads?: boolean;
|
|
2499
|
+
/**
|
|
2500
|
+
* Hash the content of assets, such as images, fonts and css files,
|
|
2501
|
+
* and add the hashed value as `v` querystring. For example,
|
|
2502
|
+
* `/assets/image.png?v=abcd1234`. This allows for assets to be
|
|
2503
|
+
* heavily cached by setting the server's response header with
|
|
2504
|
+
* `Cache-Control: max-age=31536000, immutable`.
|
|
2505
|
+
*/
|
|
2506
|
+
hashAssets?: 'querystring';
|
|
2507
|
+
/**
|
|
2508
|
+
* External stylesheets from `<link rel="stylesheet">` are instead inlined
|
|
2509
|
+
* into `<style>` elements. Defaults to `false`.
|
|
2510
|
+
*/
|
|
2511
|
+
inlineExternalStyleSheets?: boolean;
|
|
2512
|
+
/**
|
|
2513
|
+
* Minify CSS content within `<style>` elements. Defaults to `true`.
|
|
2514
|
+
*/
|
|
2515
|
+
minifyStyleElements?: boolean;
|
|
2516
|
+
/**
|
|
2517
|
+
* Minify JavaScript content within `<script>` elements. Defaults to `true`.
|
|
2518
|
+
*/
|
|
2519
|
+
minifyScriptElements?: boolean;
|
|
2520
|
+
/**
|
|
2521
|
+
* Entire `document` should be static. This is useful for specific pages that
|
|
2522
|
+
* should be static, rather than the entire site. If the whole site should be static,
|
|
2523
|
+
* use the `staticSite` property on the prerender config instead. If only certain
|
|
2524
|
+
* components should be static then use `staticComponents` instead.
|
|
2525
|
+
*/
|
|
2526
|
+
staticDocument?: boolean;
|
|
2527
|
+
}
|
|
2528
|
+
interface RobotsTxtOpts {
|
|
2529
|
+
urls: string[];
|
|
2530
|
+
sitemapUrl: string;
|
|
2531
|
+
baseUrl: string;
|
|
2532
|
+
dir: string;
|
|
2533
|
+
}
|
|
2534
|
+
interface RobotsTxtResults {
|
|
2535
|
+
content: string;
|
|
2536
|
+
filePath: string;
|
|
2537
|
+
url: string;
|
|
2538
|
+
}
|
|
2539
|
+
interface SitemapXmpOpts {
|
|
2540
|
+
urls: string[];
|
|
2541
|
+
baseUrl: string;
|
|
2542
|
+
dir: string;
|
|
2543
|
+
}
|
|
2544
|
+
interface SitemapXmpResults {
|
|
2545
|
+
content: string;
|
|
2546
|
+
filePath: string;
|
|
2547
|
+
url: string;
|
|
2548
|
+
}
|
|
2549
|
+
/**
|
|
2550
|
+
* Common system used by the compiler. All file reads, writes, access, etc. will all use
|
|
2551
|
+
* this system. Additionally, throughout each build, the compiler will use an internal
|
|
2552
|
+
* in-memory file system as to prevent unnecessary fs reads and writes. At the end of each
|
|
2553
|
+
* build all actions the in-memory fs performed will be written to disk using this system.
|
|
2554
|
+
* A NodeJS based system will use APIs such as `fs` and `crypto`, and a web-based system
|
|
2555
|
+
* will use in-memory Maps and browser APIs. Either way, the compiler itself is unaware
|
|
2556
|
+
* of the actual platform it's being ran on top of.
|
|
2557
|
+
*/
|
|
2558
|
+
interface CompilerSystem {
|
|
2559
|
+
name: 'node' | 'in-memory';
|
|
2560
|
+
version: string;
|
|
2561
|
+
events?: BuildEvents;
|
|
2562
|
+
details?: SystemDetails;
|
|
2563
|
+
/**
|
|
2564
|
+
* Add a callback which will be ran when destroy() is called.
|
|
2565
|
+
*/
|
|
2566
|
+
addDestroy(cb: () => void): void;
|
|
2567
|
+
/**
|
|
2568
|
+
* Always returns a boolean, does not throw.
|
|
2569
|
+
*/
|
|
2570
|
+
access(p: string): Promise<boolean>;
|
|
2571
|
+
/**
|
|
2572
|
+
* SYNC! Always returns a boolean, does not throw.
|
|
2573
|
+
*/
|
|
2574
|
+
accessSync(p: string): boolean;
|
|
2575
|
+
applyGlobalPatch?(fromDir: string): Promise<void>;
|
|
2576
|
+
applyPrerenderGlobalPatch?(opts: {
|
|
2577
|
+
devServerHostUrl: string;
|
|
2578
|
+
window: any;
|
|
2579
|
+
}): void;
|
|
2580
|
+
cacheStorage?: CacheStorage;
|
|
2581
|
+
checkVersion?: (logger: Logger, currentVersion: string) => Promise<() => void>;
|
|
2582
|
+
copy?(copyTasks: Required<CopyTask>[], srcDir: string): Promise<CopyResults>;
|
|
2583
|
+
/**
|
|
2584
|
+
* Always returns a boolean if the files were copied or not. Does not throw.
|
|
2585
|
+
*/
|
|
2586
|
+
copyFile(src: string, dst: string): Promise<boolean>;
|
|
2587
|
+
/**
|
|
2588
|
+
* Used to destroy any listeners, file watchers or child processes.
|
|
2589
|
+
*/
|
|
2590
|
+
destroy(): Promise<void>;
|
|
2591
|
+
/**
|
|
2592
|
+
* Does not throw.
|
|
2593
|
+
*/
|
|
2594
|
+
createDir(p: string, opts?: CompilerSystemCreateDirectoryOptions): Promise<CompilerSystemCreateDirectoryResults>;
|
|
2595
|
+
/**
|
|
2596
|
+
* SYNC! Does not throw.
|
|
2597
|
+
*/
|
|
2598
|
+
createDirSync(p: string, opts?: CompilerSystemCreateDirectoryOptions): CompilerSystemCreateDirectoryResults;
|
|
2599
|
+
homeDir(): string;
|
|
2600
|
+
/**
|
|
2601
|
+
* Used to determine if the current context of the terminal is TTY.
|
|
2602
|
+
*/
|
|
2603
|
+
isTTY(): boolean;
|
|
2604
|
+
/**
|
|
2605
|
+
* Each platform has a different way to dynamically import modules.
|
|
2606
|
+
*/
|
|
2607
|
+
dynamicImport?(p: string): Promise<any>;
|
|
2608
|
+
/**
|
|
2609
|
+
* Creates the worker controller for the current system.
|
|
2610
|
+
*
|
|
2611
|
+
* @param maxConcurrentWorkers the max number of concurrent workers to
|
|
2612
|
+
* support
|
|
2613
|
+
* @returns a worker controller appropriate for the current platform (node.js)
|
|
2614
|
+
*/
|
|
2615
|
+
createWorkerController?(maxConcurrentWorkers: number): WorkerMainController;
|
|
2616
|
+
encodeToBase64(str: string): string;
|
|
2617
|
+
/**
|
|
2618
|
+
* @deprecated
|
|
2619
|
+
*/
|
|
2620
|
+
ensureDependencies?(opts: {
|
|
2621
|
+
rootDir: string;
|
|
2622
|
+
logger: Logger;
|
|
2623
|
+
dependencies: CompilerDependency[];
|
|
2624
|
+
}): Promise<{
|
|
2625
|
+
stencilPath: string;
|
|
2626
|
+
diagnostics: Diagnostic[];
|
|
2627
|
+
}>;
|
|
2628
|
+
/**
|
|
2629
|
+
* @deprecated
|
|
2630
|
+
*/
|
|
2631
|
+
ensureResources?(opts: {
|
|
2632
|
+
rootDir: string;
|
|
2633
|
+
logger: Logger;
|
|
2634
|
+
dependencies: CompilerDependency[];
|
|
2635
|
+
}): Promise<void>;
|
|
2636
|
+
/**
|
|
2637
|
+
* process.exit()
|
|
2638
|
+
*/
|
|
2639
|
+
exit(exitCode: number): Promise<void>;
|
|
2640
|
+
/**
|
|
2641
|
+
* Optionally provide a fetch() function rather than using the built-in fetch().
|
|
2642
|
+
* First arg is a url string or Request object (RequestInfo).
|
|
2643
|
+
* Second arg is the RequestInit. Returns the Response object
|
|
2644
|
+
*/
|
|
2645
|
+
fetch?(input: string | any, init?: any): Promise<any>;
|
|
2646
|
+
/**
|
|
2647
|
+
* Generates a sha1 digest encoded as HEX
|
|
2648
|
+
*/
|
|
2649
|
+
generateContentHash?(content: string | any, length?: number): Promise<string>;
|
|
2650
|
+
/**
|
|
2651
|
+
* Generates a sha1 digest encoded as HEX from a file path
|
|
2652
|
+
*/
|
|
2653
|
+
generateFileHash?(filePath: string | any, length?: number): Promise<string>;
|
|
2654
|
+
/**
|
|
2655
|
+
* Get the current directory.
|
|
2656
|
+
*/
|
|
2657
|
+
getCurrentDirectory(): string;
|
|
2658
|
+
/**
|
|
2659
|
+
* The compiler's executing path.
|
|
2660
|
+
*/
|
|
2661
|
+
getCompilerExecutingPath(): string;
|
|
2662
|
+
getEnvironmentVar?(key: string): string;
|
|
2663
|
+
/**
|
|
2664
|
+
* Gets the absolute file path when for a dependency module.
|
|
2665
|
+
*/
|
|
2666
|
+
getLocalModulePath(opts: {
|
|
2667
|
+
rootDir: string;
|
|
2668
|
+
moduleId: string;
|
|
2669
|
+
path: string;
|
|
2670
|
+
}): string;
|
|
2671
|
+
/**
|
|
2672
|
+
* Gets the full url when requesting a dependency module to fetch from a CDN.
|
|
2673
|
+
*/
|
|
2674
|
+
getRemoteModuleUrl(opts: {
|
|
2675
|
+
moduleId: string;
|
|
2676
|
+
path?: string;
|
|
2677
|
+
version?: string;
|
|
2678
|
+
}): string;
|
|
2679
|
+
/**
|
|
2680
|
+
* Async glob task. Only available in NodeJS compiler system.
|
|
2681
|
+
*/
|
|
2682
|
+
glob?(pattern: string, options: {
|
|
2683
|
+
cwd?: string;
|
|
2684
|
+
nodir?: boolean;
|
|
2685
|
+
[key: string]: any;
|
|
2686
|
+
}): Promise<string[]>;
|
|
2687
|
+
/**
|
|
2688
|
+
* The number of logical processors available to run threads on the user's computer (cpus).
|
|
2689
|
+
*/
|
|
2690
|
+
hardwareConcurrency: number;
|
|
2691
|
+
/**
|
|
2692
|
+
* Tests if the path is a symbolic link or not. Always resolves a boolean. Does not throw.
|
|
2693
|
+
*/
|
|
2694
|
+
isSymbolicLink(p: string): Promise<boolean>;
|
|
2695
|
+
lazyRequire?: LazyRequire;
|
|
2696
|
+
nextTick(cb: () => void): void;
|
|
2697
|
+
/**
|
|
2698
|
+
* Normalize file system path.
|
|
2699
|
+
*/
|
|
2700
|
+
normalizePath(p: string): string;
|
|
2701
|
+
onProcessInterrupt?(cb: () => void): void;
|
|
2702
|
+
parseYarnLockFile?: (content: string) => {
|
|
2703
|
+
type: 'success' | 'merge' | 'conflict';
|
|
2704
|
+
object: any;
|
|
2705
|
+
};
|
|
2706
|
+
platformPath: PlatformPath;
|
|
2707
|
+
/**
|
|
2708
|
+
* All return paths are full normalized paths, not just the basenames. Always returns an array, does not throw.
|
|
2709
|
+
*/
|
|
2710
|
+
readDir(p: string): Promise<string[]>;
|
|
2711
|
+
/**
|
|
2712
|
+
* SYNC! All return paths are full normalized paths, not just the basenames. Always returns an array, does not throw.
|
|
2713
|
+
*/
|
|
2714
|
+
readDirSync(p: string): string[];
|
|
2715
|
+
/**
|
|
2716
|
+
* Returns undefined if file is not found. Does not throw.
|
|
2717
|
+
*/
|
|
2718
|
+
readFile(p: string): Promise<string>;
|
|
2719
|
+
readFile(p: string, encoding: 'utf8'): Promise<string>;
|
|
2720
|
+
readFile(p: string, encoding: 'binary'): Promise<any>;
|
|
2721
|
+
/**
|
|
2722
|
+
* SYNC! Returns undefined if file is not found. Does not throw.
|
|
2723
|
+
*/
|
|
2724
|
+
readFileSync(p: string, encoding?: string): string;
|
|
2725
|
+
/**
|
|
2726
|
+
* Does not throw.
|
|
2727
|
+
*/
|
|
2728
|
+
realpath(p: string): Promise<CompilerSystemRealpathResults>;
|
|
2729
|
+
/**
|
|
2730
|
+
* SYNC! Does not throw.
|
|
2731
|
+
*/
|
|
2732
|
+
realpathSync(p: string): CompilerSystemRealpathResults;
|
|
2733
|
+
/**
|
|
2734
|
+
* Remove a callback which will be ran when destroy() is called.
|
|
2735
|
+
*/
|
|
2736
|
+
removeDestroy(cb: () => void): void;
|
|
2737
|
+
/**
|
|
2738
|
+
* Rename old path to new path. Does not throw.
|
|
2739
|
+
*/
|
|
2740
|
+
rename(oldPath: string, newPath: string): Promise<CompilerSystemRenameResults>;
|
|
2741
|
+
resolveModuleId?(opts: ResolveModuleIdOptions): Promise<ResolveModuleIdResults>;
|
|
2742
|
+
resolvePath(p: string): string;
|
|
2743
|
+
/**
|
|
2744
|
+
* Does not throw.
|
|
2745
|
+
*/
|
|
2746
|
+
removeDir(p: string, opts?: CompilerSystemRemoveDirectoryOptions): Promise<CompilerSystemRemoveDirectoryResults>;
|
|
2747
|
+
/**
|
|
2748
|
+
* SYNC! Does not throw.
|
|
2749
|
+
*/
|
|
2750
|
+
removeDirSync(p: string, opts?: CompilerSystemRemoveDirectoryOptions): CompilerSystemRemoveDirectoryResults;
|
|
2751
|
+
/**
|
|
2752
|
+
* Does not throw.
|
|
2753
|
+
*/
|
|
2754
|
+
removeFile(p: string): Promise<CompilerSystemRemoveFileResults>;
|
|
2755
|
+
/**
|
|
2756
|
+
* SYNC! Does not throw.
|
|
2757
|
+
*/
|
|
2758
|
+
removeFileSync(p: string): CompilerSystemRemoveFileResults;
|
|
2759
|
+
setupCompiler?: (c: {
|
|
2760
|
+
ts: any;
|
|
2761
|
+
}) => void;
|
|
2762
|
+
/**
|
|
2763
|
+
* Always returns an object. Does not throw. Check for "error" property if there's an error.
|
|
2764
|
+
*/
|
|
2765
|
+
stat(p: string): Promise<CompilerFsStats>;
|
|
2766
|
+
/**
|
|
2767
|
+
* SYNC! Always returns an object. Does not throw. Check for "error" property if there's an error.
|
|
2768
|
+
*/
|
|
2769
|
+
statSync(p: string): CompilerFsStats;
|
|
2770
|
+
tmpDirSync(): string;
|
|
2771
|
+
watchDirectory?(p: string, callback: CompilerFileWatcherCallback, recursive?: boolean): CompilerFileWatcher;
|
|
2772
|
+
/**
|
|
2773
|
+
* A `watchFile` implementation in order to hook into the rest of the {@link CompilerSystem} implementation that is
|
|
2774
|
+
* used when running Stencil's compiler in "watch mode".
|
|
2775
|
+
*
|
|
2776
|
+
* It is analogous to TypeScript's `watchFile` implementation.
|
|
2777
|
+
*
|
|
2778
|
+
* Note, this function may be called for full builds of Stencil projects by the TypeScript compiler. It should not
|
|
2779
|
+
* assume that it will only be called in watch mode.
|
|
2780
|
+
*
|
|
2781
|
+
* This function should not perform any file watcher registration itself. Each `path` provided to it when called
|
|
2782
|
+
* should already have been registered as a file to watch.
|
|
2783
|
+
*
|
|
2784
|
+
* @param path the path to the file that is being watched
|
|
2785
|
+
* @param callback a callback to invoke when a file that is being watched has changed in some way
|
|
2786
|
+
* @returns an object with a method for unhooking the file watcher from the system
|
|
2787
|
+
*/
|
|
2788
|
+
watchFile?(path: string, callback: CompilerFileWatcherCallback): CompilerFileWatcher;
|
|
2789
|
+
/**
|
|
2790
|
+
* How many milliseconds to wait after a change before calling watch callbacks.
|
|
2791
|
+
*/
|
|
2792
|
+
watchTimeout?: number;
|
|
2793
|
+
/**
|
|
2794
|
+
* Does not throw.
|
|
2795
|
+
*/
|
|
2796
|
+
writeFile(p: string, content: string): Promise<CompilerSystemWriteFileResults>;
|
|
2797
|
+
/**
|
|
2798
|
+
* SYNC! Does not throw.
|
|
2799
|
+
*/
|
|
2800
|
+
writeFileSync(p: string, content: string): CompilerSystemWriteFileResults;
|
|
2801
|
+
}
|
|
2802
|
+
interface TranspileOnlyResults {
|
|
2803
|
+
diagnostics: Diagnostic[];
|
|
2804
|
+
output: string;
|
|
2805
|
+
sourceMap: any;
|
|
2806
|
+
}
|
|
2807
|
+
interface ParsedPath {
|
|
2808
|
+
root: string;
|
|
2809
|
+
dir: string;
|
|
2810
|
+
base: string;
|
|
2811
|
+
ext: string;
|
|
2812
|
+
name: string;
|
|
2813
|
+
}
|
|
2814
|
+
interface PlatformPath {
|
|
2815
|
+
normalize(p: string): string;
|
|
2816
|
+
join(...paths: string[]): string;
|
|
2817
|
+
resolve(...pathSegments: string[]): string;
|
|
2818
|
+
isAbsolute(p: string): boolean;
|
|
2819
|
+
relative(from: string, to: string): string;
|
|
2820
|
+
dirname(p: string): string;
|
|
2821
|
+
basename(p: string, ext?: string): string;
|
|
2822
|
+
extname(p: string): string;
|
|
2823
|
+
parse(p: string): ParsedPath;
|
|
2824
|
+
sep: string;
|
|
2825
|
+
delimiter: string;
|
|
2826
|
+
posix: any;
|
|
2827
|
+
win32: any;
|
|
2828
|
+
}
|
|
2829
|
+
interface CompilerDependency {
|
|
2830
|
+
name: string;
|
|
2831
|
+
version: string;
|
|
2832
|
+
main: string;
|
|
2833
|
+
resources?: string[];
|
|
2834
|
+
}
|
|
2835
|
+
interface ResolveModuleIdOptions {
|
|
2836
|
+
moduleId: string;
|
|
2837
|
+
containingFile?: string;
|
|
2838
|
+
exts?: string[];
|
|
2839
|
+
packageFilter?: (pkg: any, pkgFile: string) => any;
|
|
2840
|
+
}
|
|
2841
|
+
interface ResolveModuleIdResults {
|
|
2842
|
+
moduleId: string;
|
|
2843
|
+
resolveId: string;
|
|
2844
|
+
pkgData: {
|
|
2845
|
+
name: string;
|
|
2846
|
+
version: string;
|
|
2847
|
+
[key: string]: any;
|
|
2848
|
+
};
|
|
2849
|
+
pkgDirPath: string;
|
|
2850
|
+
}
|
|
2851
|
+
/**
|
|
2852
|
+
* A controller which provides for communication and coordination between
|
|
2853
|
+
* threaded workers.
|
|
2854
|
+
*/
|
|
2855
|
+
interface WorkerMainController {
|
|
2856
|
+
/**
|
|
2857
|
+
* Send a given set of arguments to a worker
|
|
2858
|
+
*/
|
|
2859
|
+
send(...args: any[]): Promise<any>;
|
|
2860
|
+
/**
|
|
2861
|
+
* Handle a particular method
|
|
2862
|
+
*
|
|
2863
|
+
* @param name of the method to be passed to a worker
|
|
2864
|
+
* @returns a Promise wrapping the results
|
|
2865
|
+
*/
|
|
2866
|
+
handler(name: string): (...args: any[]) => Promise<any>;
|
|
2867
|
+
/**
|
|
2868
|
+
* Destroy the worker represented by this instance, rejecting all outstanding
|
|
2869
|
+
* tasks and killing the child process.
|
|
2870
|
+
*/
|
|
2871
|
+
destroy(): void;
|
|
2872
|
+
/**
|
|
2873
|
+
* The current setting for the max number of workers
|
|
2874
|
+
*/
|
|
2875
|
+
maxWorkers: number;
|
|
2876
|
+
}
|
|
2877
|
+
interface CopyResults {
|
|
2878
|
+
diagnostics: Diagnostic[];
|
|
2879
|
+
filePaths: string[];
|
|
2880
|
+
dirPaths: string[];
|
|
2881
|
+
}
|
|
2882
|
+
interface SystemDetails {
|
|
2883
|
+
cpuModel: string;
|
|
2884
|
+
freemem(): number;
|
|
2885
|
+
platform: 'darwin' | 'windows' | 'linux' | '';
|
|
2886
|
+
release: string;
|
|
2887
|
+
totalmem: number;
|
|
2888
|
+
}
|
|
2889
|
+
interface BuildOnEvents {
|
|
2890
|
+
on(cb: (eventName: CompilerEventName, data: any) => void): BuildOnEventRemove;
|
|
2891
|
+
on(eventName: CompilerEventFileAdd, cb: (path: string) => void): BuildOnEventRemove;
|
|
2892
|
+
on(eventName: CompilerEventFileDelete, cb: (path: string) => void): BuildOnEventRemove;
|
|
2893
|
+
on(eventName: CompilerEventFileUpdate, cb: (path: string) => void): BuildOnEventRemove;
|
|
2894
|
+
on(eventName: CompilerEventDirAdd, cb: (path: string) => void): BuildOnEventRemove;
|
|
2895
|
+
on(eventName: CompilerEventDirDelete, cb: (path: string) => void): BuildOnEventRemove;
|
|
2896
|
+
on(eventName: CompilerEventBuildStart, cb: (buildStart: CompilerBuildStart) => void): BuildOnEventRemove;
|
|
2897
|
+
on(eventName: CompilerEventBuildFinish, cb: (buildResults: CompilerBuildResults) => void): BuildOnEventRemove;
|
|
2898
|
+
on(eventName: CompilerEventBuildLog, cb: (buildLog: BuildLog) => void): BuildOnEventRemove;
|
|
2899
|
+
on(eventName: CompilerEventBuildNoChange, cb: () => void): BuildOnEventRemove;
|
|
2900
|
+
}
|
|
2901
|
+
interface BuildEmitEvents {
|
|
2902
|
+
emit(eventName: CompilerEventName, path: string): void;
|
|
2903
|
+
emit(eventName: CompilerEventFileAdd, path: string): void;
|
|
2904
|
+
emit(eventName: CompilerEventFileDelete, path: string): void;
|
|
2905
|
+
emit(eventName: CompilerEventFileUpdate, path: string): void;
|
|
2906
|
+
emit(eventName: CompilerEventDirAdd, path: string): void;
|
|
2907
|
+
emit(eventName: CompilerEventDirDelete, path: string): void;
|
|
2908
|
+
emit(eventName: CompilerEventBuildStart, buildStart: CompilerBuildStart): void;
|
|
2909
|
+
emit(eventName: CompilerEventBuildFinish, buildResults: CompilerBuildResults): void;
|
|
2910
|
+
emit(eventName: CompilerEventBuildNoChange, buildNoChange: BuildNoChangeResults): void;
|
|
2911
|
+
emit(eventName: CompilerEventBuildLog, buildLog: BuildLog): void;
|
|
2912
|
+
emit(eventName: CompilerEventFsChange, fsWatchResults: FsWatchResults): void;
|
|
2913
|
+
}
|
|
2914
|
+
interface FsWatchResults {
|
|
2915
|
+
dirsAdded: string[];
|
|
2916
|
+
dirsDeleted: string[];
|
|
2917
|
+
filesUpdated: string[];
|
|
2918
|
+
filesAdded: string[];
|
|
2919
|
+
filesDeleted: string[];
|
|
2920
|
+
}
|
|
2921
|
+
interface BuildLog {
|
|
2922
|
+
buildId: number;
|
|
2923
|
+
messages: string[];
|
|
2924
|
+
progress: number;
|
|
2925
|
+
}
|
|
2926
|
+
interface BuildNoChangeResults {
|
|
2927
|
+
buildId: number;
|
|
2928
|
+
noChange: boolean;
|
|
2929
|
+
}
|
|
2930
|
+
interface CompilerBuildResults {
|
|
2931
|
+
buildId: number;
|
|
2932
|
+
componentGraph?: BuildResultsComponentGraph;
|
|
2933
|
+
diagnostics: Diagnostic[];
|
|
2934
|
+
dirsAdded: string[];
|
|
2935
|
+
dirsDeleted: string[];
|
|
2936
|
+
duration: number;
|
|
2937
|
+
filesAdded: string[];
|
|
2938
|
+
filesChanged: string[];
|
|
2939
|
+
filesDeleted: string[];
|
|
2940
|
+
filesUpdated: string[];
|
|
2941
|
+
hasError: boolean;
|
|
2942
|
+
hasSuccessfulBuild: boolean;
|
|
2943
|
+
hmr?: HotModuleReplacement;
|
|
2944
|
+
hydrateAppFilePath?: string;
|
|
2945
|
+
isRebuild: boolean;
|
|
2946
|
+
namespace: string;
|
|
2947
|
+
outputs: BuildOutput[];
|
|
2948
|
+
rootDir: string;
|
|
2949
|
+
srcDir: string;
|
|
2950
|
+
timestamp: string;
|
|
2951
|
+
}
|
|
2952
|
+
interface BuildResultsComponentGraph {
|
|
2953
|
+
[scopeId: string]: string[];
|
|
2954
|
+
}
|
|
2955
|
+
interface BuildOutput {
|
|
2956
|
+
type: string;
|
|
2957
|
+
files: string[];
|
|
2958
|
+
}
|
|
2959
|
+
interface HotModuleReplacement {
|
|
2960
|
+
componentsUpdated?: string[];
|
|
2961
|
+
excludeHmr?: string[];
|
|
2962
|
+
externalStylesUpdated?: string[];
|
|
2963
|
+
imagesUpdated?: string[];
|
|
2964
|
+
indexHtmlUpdated?: boolean;
|
|
2965
|
+
inlineStylesUpdated?: HmrStyleUpdate[];
|
|
2966
|
+
reloadStrategy: PageReloadStrategy;
|
|
2967
|
+
scriptsAdded?: string[];
|
|
2968
|
+
scriptsDeleted?: string[];
|
|
2969
|
+
serviceWorkerUpdated?: boolean;
|
|
2970
|
+
versionId?: string;
|
|
2971
|
+
}
|
|
2972
|
+
interface HmrStyleUpdate {
|
|
2973
|
+
styleId: string;
|
|
2974
|
+
styleTag: string;
|
|
2975
|
+
styleText: string;
|
|
2976
|
+
}
|
|
2977
|
+
type BuildOnEventRemove = () => boolean;
|
|
2978
|
+
interface BuildEvents extends BuildOnEvents, BuildEmitEvents {
|
|
2979
|
+
unsubscribeAll(): void;
|
|
2980
|
+
}
|
|
2981
|
+
interface CompilerBuildStart {
|
|
2982
|
+
buildId: number;
|
|
2983
|
+
timestamp: string;
|
|
2984
|
+
}
|
|
2985
|
+
/**
|
|
2986
|
+
* A type describing a function to call when an event is emitted by a file watcher
|
|
2987
|
+
* @param fileName the path of the file tied to event
|
|
2988
|
+
* @param eventKind a variant describing the type of event that was emitter (added, edited, etc.)
|
|
2989
|
+
*/
|
|
2990
|
+
type CompilerFileWatcherCallback = (fileName: string, eventKind: CompilerFileWatcherEvent) => void;
|
|
2991
|
+
/**
|
|
2992
|
+
* A type describing the different types of events that Stencil expects may happen when a file being watched is altered
|
|
2993
|
+
* in some way
|
|
2994
|
+
*/
|
|
2995
|
+
type CompilerFileWatcherEvent = CompilerEventFileAdd | CompilerEventFileDelete | CompilerEventFileUpdate | CompilerEventDirAdd | CompilerEventDirDelete;
|
|
2996
|
+
type CompilerEventName = CompilerEventFsChange | CompilerEventFileUpdate | CompilerEventFileAdd | CompilerEventFileDelete | CompilerEventDirAdd | CompilerEventDirDelete | CompilerEventBuildStart | CompilerEventBuildFinish | CompilerEventBuildNoChange | CompilerEventBuildLog;
|
|
2997
|
+
type CompilerEventFsChange = 'fsChange';
|
|
2998
|
+
type CompilerEventFileUpdate = 'fileUpdate';
|
|
2999
|
+
type CompilerEventFileAdd = 'fileAdd';
|
|
3000
|
+
type CompilerEventFileDelete = 'fileDelete';
|
|
3001
|
+
type CompilerEventDirAdd = 'dirAdd';
|
|
3002
|
+
type CompilerEventDirDelete = 'dirDelete';
|
|
3003
|
+
type CompilerEventBuildStart = 'buildStart';
|
|
3004
|
+
type CompilerEventBuildFinish = 'buildFinish';
|
|
3005
|
+
type CompilerEventBuildLog = 'buildLog';
|
|
3006
|
+
type CompilerEventBuildNoChange = 'buildNoChange';
|
|
3007
|
+
interface CompilerFileWatcher {
|
|
3008
|
+
close(): void | Promise<void>;
|
|
3009
|
+
}
|
|
3010
|
+
interface CompilerFsStats {
|
|
3011
|
+
/**
|
|
3012
|
+
* If it's a directory. `false` if there was an error.
|
|
3013
|
+
*/
|
|
3014
|
+
isDirectory: boolean;
|
|
3015
|
+
/**
|
|
3016
|
+
* If it's a file. `false` if there was an error.
|
|
3017
|
+
*/
|
|
3018
|
+
isFile: boolean;
|
|
3019
|
+
/**
|
|
3020
|
+
* If it's a symlink. `false` if there was an error.
|
|
3021
|
+
*/
|
|
3022
|
+
isSymbolicLink: boolean;
|
|
3023
|
+
/**
|
|
3024
|
+
* The size of the file in bytes. `0` for directories or if there was an error.
|
|
3025
|
+
*/
|
|
3026
|
+
size: number;
|
|
3027
|
+
/**
|
|
3028
|
+
* The timestamp indicating the last time this file was modified expressed in milliseconds since the POSIX Epoch.
|
|
3029
|
+
*/
|
|
3030
|
+
mtimeMs?: number;
|
|
3031
|
+
/**
|
|
3032
|
+
* Error if there was one, otherwise `null`. `stat` and `statSync` do not throw errors but always returns this interface.
|
|
3033
|
+
*/
|
|
3034
|
+
error: any;
|
|
3035
|
+
}
|
|
3036
|
+
interface CompilerSystemCreateDirectoryOptions {
|
|
3037
|
+
/**
|
|
3038
|
+
* Indicates whether parent directories should be created.
|
|
3039
|
+
* @default false
|
|
3040
|
+
*/
|
|
3041
|
+
recursive?: boolean;
|
|
3042
|
+
/**
|
|
3043
|
+
* A file mode. If a string is passed, it is parsed as an octal integer. If not specified
|
|
3044
|
+
* @default 0o777.
|
|
3045
|
+
*/
|
|
3046
|
+
mode?: number;
|
|
3047
|
+
}
|
|
3048
|
+
interface CompilerSystemCreateDirectoryResults {
|
|
3049
|
+
basename: string;
|
|
3050
|
+
dirname: string;
|
|
3051
|
+
path: string;
|
|
3052
|
+
newDirs: string[];
|
|
3053
|
+
error: any;
|
|
3054
|
+
}
|
|
3055
|
+
interface CompilerSystemRemoveDirectoryOptions {
|
|
3056
|
+
/**
|
|
3057
|
+
* Indicates whether child files and subdirectories should be removed.
|
|
3058
|
+
* @default false
|
|
3059
|
+
*/
|
|
3060
|
+
recursive?: boolean;
|
|
3061
|
+
}
|
|
3062
|
+
interface CompilerSystemRemoveDirectoryResults {
|
|
3063
|
+
basename: string;
|
|
3064
|
+
dirname: string;
|
|
3065
|
+
path: string;
|
|
3066
|
+
removedDirs: string[];
|
|
3067
|
+
removedFiles: string[];
|
|
3068
|
+
error: any;
|
|
3069
|
+
}
|
|
3070
|
+
interface CompilerSystemRenameResults extends CompilerSystemRenamedPath {
|
|
3071
|
+
renamed: CompilerSystemRenamedPath[];
|
|
3072
|
+
oldDirs: string[];
|
|
3073
|
+
oldFiles: string[];
|
|
3074
|
+
newDirs: string[];
|
|
3075
|
+
newFiles: string[];
|
|
3076
|
+
error: any;
|
|
3077
|
+
}
|
|
3078
|
+
interface CompilerSystemRenamedPath {
|
|
3079
|
+
oldPath: string;
|
|
3080
|
+
newPath: string;
|
|
3081
|
+
isFile: boolean;
|
|
3082
|
+
isDirectory: boolean;
|
|
3083
|
+
}
|
|
3084
|
+
interface CompilerSystemRealpathResults {
|
|
3085
|
+
path: string;
|
|
3086
|
+
error: any;
|
|
3087
|
+
}
|
|
3088
|
+
interface CompilerSystemRemoveFileResults {
|
|
3089
|
+
basename: string;
|
|
3090
|
+
dirname: string;
|
|
3091
|
+
path: string;
|
|
3092
|
+
error: any;
|
|
3093
|
+
}
|
|
3094
|
+
interface CompilerSystemWriteFileResults {
|
|
3095
|
+
path: string;
|
|
3096
|
+
error: any;
|
|
3097
|
+
}
|
|
3098
|
+
interface Credentials {
|
|
3099
|
+
key: string;
|
|
3100
|
+
cert: string;
|
|
3101
|
+
}
|
|
3102
|
+
interface ConfigBundle {
|
|
3103
|
+
components: string[];
|
|
3104
|
+
}
|
|
3105
|
+
/**
|
|
3106
|
+
* A file and/or directory copy operation that may be specified as part of
|
|
3107
|
+
* certain output targets for Stencil (in particular `dist`,
|
|
3108
|
+
* `dist-custom-elements`, and `www`).
|
|
3109
|
+
*/
|
|
3110
|
+
interface CopyTask {
|
|
3111
|
+
/**
|
|
3112
|
+
* The source file path for a copy operation. This may be an absolute or
|
|
3113
|
+
* relative path to a directory or a file, and may also include a glob
|
|
3114
|
+
* pattern.
|
|
3115
|
+
*
|
|
3116
|
+
* If the path is a relative path it will be treated as relative to
|
|
3117
|
+
* `Config.srcDir`.
|
|
3118
|
+
*/
|
|
3119
|
+
src: string;
|
|
3120
|
+
/**
|
|
3121
|
+
* An optional destination file path for a copy operation. This may be an
|
|
3122
|
+
* absolute or relative path.
|
|
3123
|
+
*
|
|
3124
|
+
* If relative, this will be treated as relative to the output directory for
|
|
3125
|
+
* the output target for which this copy operation is configured.
|
|
3126
|
+
*/
|
|
3127
|
+
dest?: string;
|
|
3128
|
+
/**
|
|
3129
|
+
* An optional array of glob patterns to exclude from the copy operation.
|
|
3130
|
+
* @default ['**\/__mocks__/**', '**\/__fixtures__/**', '**\/dist/**', '**\/.{idea,git,cache,output,temp}/**', '**\/.ds_store', '**\/.gitignore', '**\/desktop.ini', '**\/thumbs.db']
|
|
3131
|
+
*/
|
|
3132
|
+
ignore?: string[];
|
|
3133
|
+
/**
|
|
3134
|
+
* Whether or not Stencil should issue warnings if it cannot find the
|
|
3135
|
+
* specified source files or directories. Defaults to `false`.
|
|
3136
|
+
*
|
|
3137
|
+
* To receive warnings if a copy task source can't be found set this to
|
|
3138
|
+
* `true`.
|
|
3139
|
+
*/
|
|
3140
|
+
warn?: boolean;
|
|
3141
|
+
/**
|
|
3142
|
+
* Whether or not directory structure should be preserved when copying files
|
|
3143
|
+
* from a source directory. Defaults to `true` if no `dest` path is supplied,
|
|
3144
|
+
* else it defaults to `false`.
|
|
3145
|
+
*
|
|
3146
|
+
* If this is set to `false`, all the files from a source directory will be
|
|
3147
|
+
* copied directly to the destination directory, but if it's set to `true` they
|
|
3148
|
+
* will be copied to a new directory inside the destination directory with
|
|
3149
|
+
* the same name as their original source directory.
|
|
3150
|
+
*
|
|
3151
|
+
* So if, for instance, `src` is set to `"images"` and `keepDirStructure` is
|
|
3152
|
+
* set to `true` the copy task will then produce the following directory
|
|
3153
|
+
* structure:
|
|
3154
|
+
*
|
|
3155
|
+
* ```
|
|
3156
|
+
* images
|
|
3157
|
+
* └── foo.png
|
|
3158
|
+
* dist
|
|
3159
|
+
* └── images
|
|
3160
|
+
* └── foo.png
|
|
3161
|
+
* ```
|
|
3162
|
+
*
|
|
3163
|
+
* Conversely if `keepDirStructure` is set to `false` then files in `images/`
|
|
3164
|
+
* will be copied to `dist` without first creating a new subdirectory,
|
|
3165
|
+
* resulting in the following directory structure:
|
|
3166
|
+
*
|
|
3167
|
+
* ```
|
|
3168
|
+
* images
|
|
3169
|
+
* └── foo.png
|
|
3170
|
+
* dist
|
|
3171
|
+
* └── foo.png
|
|
3172
|
+
* ```
|
|
3173
|
+
*
|
|
3174
|
+
* If a `dest` path is supplied then `keepDirStructure`
|
|
3175
|
+
* will default to `false`, so that Stencil will write the
|
|
3176
|
+
* copied files directly into the `dest` directory without creating a new
|
|
3177
|
+
* subdirectory. This behavior can be overridden by setting
|
|
3178
|
+
* `keepDirStructure` to `true`.
|
|
3179
|
+
*/
|
|
3180
|
+
keepDirStructure?: boolean;
|
|
3181
|
+
}
|
|
3182
|
+
/**
|
|
3183
|
+
* Configuration for generating documentation from Stencil components.
|
|
3184
|
+
*/
|
|
3185
|
+
interface StencilDocsConfig {
|
|
3186
|
+
/**
|
|
3187
|
+
* Options for processing and rendering Markdown documentation files.
|
|
3188
|
+
*/
|
|
3189
|
+
markdown?: {
|
|
3190
|
+
/**
|
|
3191
|
+
* Styling for how the target component will be represented within documentation (e.g., in component diagrams).
|
|
3192
|
+
*/
|
|
3193
|
+
targetComponent?: {
|
|
3194
|
+
/**
|
|
3195
|
+
* Background color used for nodes representing the component in diagrams (e.g., Mermaid graphs).
|
|
3196
|
+
* Use standard color names or hex codes.
|
|
3197
|
+
* @example '#f0f0f0' (light gray)
|
|
3198
|
+
*/
|
|
3199
|
+
background?: string;
|
|
3200
|
+
/**
|
|
3201
|
+
* Text color used within nodes representing the component in diagrams (e.g., Mermaid graphs).
|
|
3202
|
+
* Use standard color names or hex codes.
|
|
3203
|
+
* @example '#333' (dark gray)
|
|
3204
|
+
*/
|
|
3205
|
+
textColor?: string;
|
|
3206
|
+
};
|
|
3207
|
+
};
|
|
3208
|
+
}
|
|
3209
|
+
interface BundlingConfig {
|
|
3210
|
+
/**
|
|
3211
|
+
* @deprecated the `namedExports` field is no longer honored by `@rollup/plugin-commonjs` and is not used by Stencil.
|
|
3212
|
+
* This field can be safely removed from your Stencil configuration file.
|
|
3213
|
+
*/
|
|
3214
|
+
namedExports?: {
|
|
3215
|
+
[key: string]: string[];
|
|
3216
|
+
};
|
|
3217
|
+
}
|
|
3218
|
+
interface NodeResolveConfig {
|
|
3219
|
+
exportConditions?: string[];
|
|
3220
|
+
browser?: boolean;
|
|
3221
|
+
moduleDirectories?: string[];
|
|
3222
|
+
modulePaths?: string[];
|
|
3223
|
+
dedupe?: string[] | ((importee: string) => boolean);
|
|
3224
|
+
extensions?: readonly string[];
|
|
3225
|
+
jail?: string;
|
|
3226
|
+
mainFields?: readonly string[];
|
|
3227
|
+
modulesOnly?: boolean;
|
|
3228
|
+
preferBuiltins?: boolean | ((module: string) => boolean);
|
|
3229
|
+
resolveOnly?: ReadonlyArray<string | RegExp> | null | ((module: string) => boolean);
|
|
3230
|
+
rootDir?: string;
|
|
3231
|
+
allowExportsFolderMapping?: boolean;
|
|
3232
|
+
/**
|
|
3233
|
+
* @see https://github.com/browserify/resolve#resolveid-opts-cb
|
|
3234
|
+
* @deprecated the `customResolveOptions` field is no longer honored in future versions of
|
|
3235
|
+
* `@rollup/plugin-node-resolve`. If you are currently using it, please open a new issue in the Stencil repo to
|
|
3236
|
+
* describe your use case & provide input (https://github.com/stenciljs/core/issues/new/choose)
|
|
3237
|
+
*/
|
|
3238
|
+
customResolveOptions?: {
|
|
3239
|
+
basedir?: string;
|
|
3240
|
+
package?: string;
|
|
3241
|
+
extensions?: string[];
|
|
3242
|
+
readFile?: Function;
|
|
3243
|
+
isFile?: Function;
|
|
3244
|
+
isDirectory?: Function;
|
|
3245
|
+
packageFilter?: Function;
|
|
3246
|
+
pathFilter?: Function;
|
|
3247
|
+
paths?: Function | string[];
|
|
3248
|
+
moduleDirectory?: string | string[];
|
|
3249
|
+
preserveSymlinks?: boolean;
|
|
3250
|
+
};
|
|
3251
|
+
}
|
|
3252
|
+
interface RollupConfig {
|
|
3253
|
+
inputOptions?: RollupInputOptions;
|
|
3254
|
+
outputOptions?: RollupOutputOptions;
|
|
3255
|
+
}
|
|
3256
|
+
interface RollupInputOptions {
|
|
3257
|
+
context?: string;
|
|
3258
|
+
moduleContext?: ((id: string) => string) | {
|
|
3259
|
+
[id: string]: string;
|
|
3260
|
+
};
|
|
3261
|
+
treeshake?: boolean;
|
|
3262
|
+
maxParallelFileOps?: number;
|
|
3263
|
+
external?: (string | RegExp)[] | string | RegExp | ((source: string, importer: string | undefined, isResolved: boolean) => boolean | null | undefined);
|
|
3264
|
+
}
|
|
3265
|
+
interface RollupOutputOptions {
|
|
3266
|
+
globals?: {
|
|
3267
|
+
[name: string]: string;
|
|
3268
|
+
} | ((name: string) => string);
|
|
3269
|
+
}
|
|
3270
|
+
interface Testing {
|
|
3271
|
+
run(opts: TestingRunOptions): Promise<boolean>;
|
|
3272
|
+
destroy(): Promise<void>;
|
|
3273
|
+
}
|
|
3274
|
+
declare type Path = string;
|
|
3275
|
+
declare type TransformerConfig = [string, Record<string, unknown>];
|
|
3276
|
+
/**
|
|
3277
|
+
* Options for initiating a run of Stencil tests (spec and/or end-to-end)
|
|
3278
|
+
*/
|
|
3279
|
+
interface TestingRunOptions {
|
|
3280
|
+
/**
|
|
3281
|
+
* If true, run end-to-end tests
|
|
3282
|
+
*/
|
|
3283
|
+
e2e?: boolean;
|
|
3284
|
+
/**
|
|
3285
|
+
* If true, run screenshot tests
|
|
3286
|
+
*/
|
|
3287
|
+
screenshot?: boolean;
|
|
3288
|
+
/**
|
|
3289
|
+
* If true, run spec tests
|
|
3290
|
+
*/
|
|
3291
|
+
spec?: boolean;
|
|
3292
|
+
/**
|
|
3293
|
+
* If true, update 'golden' screenshots. Otherwise, compare against priori.
|
|
3294
|
+
*/
|
|
3295
|
+
updateScreenshot?: boolean;
|
|
3296
|
+
}
|
|
3297
|
+
interface JestConfig {
|
|
3298
|
+
/**
|
|
3299
|
+
* This option tells Jest that all imported modules in your tests should be mocked automatically.
|
|
3300
|
+
* All modules used in your tests will have a replacement implementation, keeping the API surface. Default: false
|
|
3301
|
+
*/
|
|
3302
|
+
automock?: boolean;
|
|
3303
|
+
/**
|
|
3304
|
+
* By default, Jest runs all tests and produces all errors into the console upon completion.
|
|
3305
|
+
* The bail config option can be used here to have Jest stop running tests after the first failure. Default: false
|
|
3306
|
+
*/
|
|
3307
|
+
bail?: boolean | number;
|
|
3308
|
+
/**
|
|
3309
|
+
* The directory where Jest should store its cached dependency information. Jest attempts to scan your dependency tree once (up-front)
|
|
3310
|
+
* and cache it in order to ease some of the filesystem raking that needs to happen while running tests. This config option lets you
|
|
3311
|
+
* customize where Jest stores that cache data on disk. Default: "/tmp/<path>"
|
|
3312
|
+
*/
|
|
3313
|
+
cacheDirectory?: string;
|
|
3314
|
+
/**
|
|
3315
|
+
* Automatically clear mock calls and instances between every test. Equivalent to calling jest.clearAllMocks()
|
|
3316
|
+
* between each test. This does not remove any mock implementation that may have been provided. Default: false
|
|
3317
|
+
*/
|
|
3318
|
+
clearMocks?: boolean;
|
|
3319
|
+
/**
|
|
3320
|
+
* Indicates whether the coverage information should be collected while executing the test. Because this retrofits all
|
|
3321
|
+
* executed files with coverage collection statements, it may significantly slow down your tests. Default: false
|
|
3322
|
+
*/
|
|
3323
|
+
collectCoverage?: boolean;
|
|
3324
|
+
/**
|
|
3325
|
+
* An array of glob patterns indicating a set of files for which coverage information should be collected.
|
|
3326
|
+
* If a file matches the specified glob pattern, coverage information will be collected for it even if no tests exist
|
|
3327
|
+
* for this file and it's never required in the test suite. Default: undefined
|
|
3328
|
+
*/
|
|
3329
|
+
collectCoverageFrom?: any[];
|
|
3330
|
+
/**
|
|
3331
|
+
* The directory where Jest should output its coverage files. Default: undefined
|
|
3332
|
+
*/
|
|
3333
|
+
coverageDirectory?: string;
|
|
3334
|
+
/**
|
|
3335
|
+
* An array of regexp pattern strings that are matched against all file paths before executing the test. If the file path matches
|
|
3336
|
+
* any of the patterns, coverage information will be skipped. These pattern strings match against the full path.
|
|
3337
|
+
* Use the <rootDir> string token to include the path to your project's root directory to prevent it from accidentally
|
|
3338
|
+
* ignoring all of your files in different environments that may have different root directories.
|
|
3339
|
+
* Example: ["<rootDir>/build/", "<rootDir>/node_modules/"]. Default: ["/node_modules/"]
|
|
3340
|
+
*/
|
|
3341
|
+
coveragePathIgnorePatterns?: any[];
|
|
3342
|
+
/**
|
|
3343
|
+
* A list of reporter names that Jest uses when writing coverage reports. Any istanbul reporter can be used.
|
|
3344
|
+
* Default: `["json", "lcov", "text"]`
|
|
3345
|
+
*/
|
|
3346
|
+
coverageReporters?: any[];
|
|
3347
|
+
/**
|
|
3348
|
+
* This will be used to configure minimum threshold enforcement for coverage results. Thresholds can be specified as global,
|
|
3349
|
+
* as a glob, and as a directory or file path. If thresholds aren't met, jest will fail. Thresholds specified as a positive
|
|
3350
|
+
* number are taken to be the minimum percentage required. Thresholds specified as a negative number represent the maximum
|
|
3351
|
+
* number of uncovered entities allowed. Default: undefined
|
|
3352
|
+
*/
|
|
3353
|
+
coverageThreshold?: any;
|
|
3354
|
+
errorOnDeprecated?: boolean;
|
|
3355
|
+
forceCoverageMatch?: any[];
|
|
3356
|
+
globals?: any;
|
|
3357
|
+
globalSetup?: string;
|
|
3358
|
+
globalTeardown?: string;
|
|
3359
|
+
/**
|
|
3360
|
+
* An array of directory names to be searched recursively up from the requiring module's location. Setting this option will
|
|
3361
|
+
* override the default, if you wish to still search node_modules for packages include it along with any other
|
|
3362
|
+
* options: ["node_modules", "bower_components"]. Default: ["node_modules"]
|
|
3363
|
+
*/
|
|
3364
|
+
moduleDirectories?: string[];
|
|
3365
|
+
/**
|
|
3366
|
+
* An array of file extensions your modules use. If you require modules without specifying a file extension,
|
|
3367
|
+
* these are the extensions Jest will look for. Default: ['ts', 'tsx', 'js', 'json']
|
|
3368
|
+
*/
|
|
3369
|
+
moduleFileExtensions?: string[];
|
|
3370
|
+
moduleNameMapper?: any;
|
|
3371
|
+
modulePaths?: any[];
|
|
3372
|
+
modulePathIgnorePatterns?: any[];
|
|
3373
|
+
notify?: boolean;
|
|
3374
|
+
notifyMode?: string;
|
|
3375
|
+
preset?: string;
|
|
3376
|
+
prettierPath?: string;
|
|
3377
|
+
projects?: any;
|
|
3378
|
+
reporters?: any;
|
|
3379
|
+
resetMocks?: boolean;
|
|
3380
|
+
resetModules?: boolean;
|
|
3381
|
+
resolver?: Path | null;
|
|
3382
|
+
restoreMocks?: boolean;
|
|
3383
|
+
rootDir?: string;
|
|
3384
|
+
roots?: any[];
|
|
3385
|
+
runner?: string;
|
|
3386
|
+
/**
|
|
3387
|
+
* The paths to modules that run some code to configure or set up the testing environment before each test.
|
|
3388
|
+
* Since every test runs in its own environment, these scripts will be executed in the testing environment
|
|
3389
|
+
* immediately before executing the test code itself. Default: []
|
|
3390
|
+
*/
|
|
3391
|
+
setupFiles?: string[];
|
|
3392
|
+
setupFilesAfterEnv?: string[];
|
|
3393
|
+
snapshotSerializers?: any[];
|
|
3394
|
+
testEnvironment?: string;
|
|
3395
|
+
testEnvironmentOptions?: any;
|
|
3396
|
+
testMatch?: string[];
|
|
3397
|
+
testPathIgnorePatterns?: string[];
|
|
3398
|
+
testPreset?: string;
|
|
3399
|
+
testRegex?: string[];
|
|
3400
|
+
testResultsProcessor?: string;
|
|
3401
|
+
testRunner?: string;
|
|
3402
|
+
testURL?: string;
|
|
3403
|
+
timers?: string;
|
|
3404
|
+
transform?: {
|
|
3405
|
+
[regex: string]: Path | TransformerConfig;
|
|
3406
|
+
};
|
|
3407
|
+
transformIgnorePatterns?: any[];
|
|
3408
|
+
unmockedModulePathPatterns?: any[];
|
|
3409
|
+
verbose?: boolean;
|
|
3410
|
+
watchPathIgnorePatterns?: any[];
|
|
3411
|
+
}
|
|
3412
|
+
interface TestingConfig extends JestConfig {
|
|
3413
|
+
/**
|
|
3414
|
+
* The `allowableMismatchedPixels` value is used to determine an acceptable
|
|
3415
|
+
* number of pixels that can be mismatched before the image is considered
|
|
3416
|
+
* to have changes. Realistically, two screenshots representing the same
|
|
3417
|
+
* content may have a small number of pixels that are not identical due to
|
|
3418
|
+
* anti-aliasing, which is perfectly normal. If the `allowableMismatchedRatio`
|
|
3419
|
+
* is provided it will take precedence, otherwise `allowableMismatchedPixels`
|
|
3420
|
+
* will be used.
|
|
3421
|
+
*/
|
|
3422
|
+
allowableMismatchedPixels?: number;
|
|
3423
|
+
/**
|
|
3424
|
+
* The `allowableMismatchedRatio` ranges from `0` to `1` and is used to
|
|
3425
|
+
* determine an acceptable ratio of pixels that can be mismatched before
|
|
3426
|
+
* the image is considered to have changes. Realistically, two screenshots
|
|
3427
|
+
* representing the same content may have a small number of pixels that
|
|
3428
|
+
* are not identical due to anti-aliasing, which is perfectly normal. The
|
|
3429
|
+
* `allowableMismatchedRatio` is the number of pixels that were mismatched,
|
|
3430
|
+
* divided by the total number of pixels in the screenshot. For example,
|
|
3431
|
+
* a ratio value of `0.06` means 6% of the pixels can be mismatched before
|
|
3432
|
+
* the image is considered to have changes. If the `allowableMismatchedRatio`
|
|
3433
|
+
* is provided it will take precedence, otherwise `allowableMismatchedPixels`
|
|
3434
|
+
* will be used.
|
|
3435
|
+
*/
|
|
3436
|
+
allowableMismatchedRatio?: number;
|
|
3437
|
+
/**
|
|
3438
|
+
* Matching threshold while comparing two screenshots. Value ranges from `0` to `1`.
|
|
3439
|
+
* Smaller values make the comparison more sensitive. The `pixelmatchThreshold`
|
|
3440
|
+
* value helps to ignore anti-aliasing. Default: `0.1`
|
|
3441
|
+
*/
|
|
3442
|
+
pixelmatchThreshold?: number;
|
|
3443
|
+
/**
|
|
3444
|
+
* Additional arguments to pass to the browser instance.
|
|
3445
|
+
*/
|
|
3446
|
+
browserArgs?: string[];
|
|
3447
|
+
/**
|
|
3448
|
+
* Path to a Chromium or Chrome executable to run instead of the bundled Chromium.
|
|
3449
|
+
* @default env.PUPPETEER_EXECUTABLE_PATH || env.CHROME_PATH || puppeteer.computeExecutablePath()
|
|
3450
|
+
*/
|
|
3451
|
+
browserExecutablePath?: string;
|
|
3452
|
+
/**
|
|
3453
|
+
* Url of remote Chrome instance to use instead of local Chrome.
|
|
3454
|
+
*/
|
|
3455
|
+
browserWSEndpoint?: string;
|
|
3456
|
+
/**
|
|
3457
|
+
* The browser channel to use for e2e tests (stable, beta, dev or canary).
|
|
3458
|
+
* @default 'chrome'
|
|
3459
|
+
*/
|
|
3460
|
+
browserChannel?: 'chrome' | 'chrome-beta' | 'chrome-dev' | 'chrome-canary';
|
|
3461
|
+
/**
|
|
3462
|
+
* Whether to run browser e2e tests in headless mode using Chrome Headless Shell
|
|
3463
|
+
* @ref https://developer.chrome.com/blog/chrome-headless-shell
|
|
3464
|
+
* @default shell
|
|
3465
|
+
*/
|
|
3466
|
+
browserHeadless?: boolean | 'shell';
|
|
3467
|
+
/**
|
|
3468
|
+
* Slows down e2e browser operations by the specified amount of milliseconds.
|
|
3469
|
+
* Useful so that you can see what is going on.
|
|
3470
|
+
*/
|
|
3471
|
+
browserSlowMo?: number;
|
|
3472
|
+
/**
|
|
3473
|
+
* By default, all E2E pages wait until the "load" event, this global setting can be used
|
|
3474
|
+
* to change the default `waitUntil` behavior.
|
|
3475
|
+
*/
|
|
3476
|
+
browserWaitUntil?: 'load' | 'domcontentloaded' | 'networkidle0' | 'networkidle2';
|
|
3477
|
+
/**
|
|
3478
|
+
* Whether to auto-open a DevTools panel for each tab.
|
|
3479
|
+
* If this option is true, the headless option will be set false
|
|
3480
|
+
*/
|
|
3481
|
+
browserDevtools?: boolean;
|
|
3482
|
+
/**
|
|
3483
|
+
* Array of browser emulations to be used during _screenshot_ tests. A full screenshot
|
|
3484
|
+
* test is ran for each emulation.
|
|
3485
|
+
*
|
|
3486
|
+
* To emulate a device display for your e2e tests, use the `setViewport` method on a test's E2E page.
|
|
3487
|
+
* An example can be found in [the Stencil docs](https://stenciljs.com/docs/end-to-end-testing#emulate-a-display).
|
|
3488
|
+
*/
|
|
3489
|
+
emulate?: EmulateConfig[];
|
|
3490
|
+
/**
|
|
3491
|
+
* Path to the Screenshot Connector module.
|
|
3492
|
+
*/
|
|
3493
|
+
screenshotConnector?: string;
|
|
3494
|
+
/**
|
|
3495
|
+
* Timeout for the pixelmatch worker to resolve (in ms).
|
|
3496
|
+
* @default 2500
|
|
3497
|
+
*/
|
|
3498
|
+
screenshotTimeout?: number | null;
|
|
3499
|
+
/**
|
|
3500
|
+
* Amount of time in milliseconds to wait before a screenshot is taken.
|
|
3501
|
+
*/
|
|
3502
|
+
waitBeforeScreenshot?: number;
|
|
3503
|
+
}
|
|
3504
|
+
interface EmulateConfig {
|
|
3505
|
+
/**
|
|
3506
|
+
* Predefined device descriptor name, such as "iPhone X" or "Nexus 10".
|
|
3507
|
+
* For a complete list please see: https://github.com/puppeteer/puppeteer/blob/main/src/common/DeviceDescriptors.ts
|
|
3508
|
+
*/
|
|
3509
|
+
device?: string;
|
|
3510
|
+
/**
|
|
3511
|
+
* User-Agent to be used. Defaults to the user-agent of the installed Puppeteer version.
|
|
3512
|
+
*/
|
|
3513
|
+
userAgent?: string;
|
|
3514
|
+
viewport?: EmulateViewport;
|
|
3515
|
+
}
|
|
3516
|
+
interface EmulateViewport {
|
|
3517
|
+
/**
|
|
3518
|
+
* Page width in pixels.
|
|
3519
|
+
*/
|
|
3520
|
+
width: number;
|
|
3521
|
+
/**
|
|
3522
|
+
* page height in pixels.
|
|
3523
|
+
*/
|
|
3524
|
+
height: number;
|
|
3525
|
+
/**
|
|
3526
|
+
* Specify device scale factor (can be thought of as dpr). Defaults to 1.
|
|
3527
|
+
*/
|
|
3528
|
+
deviceScaleFactor?: number;
|
|
3529
|
+
/**
|
|
3530
|
+
* Whether the meta viewport tag is taken into account. Defaults to false.
|
|
3531
|
+
*/
|
|
3532
|
+
isMobile?: boolean;
|
|
3533
|
+
/**
|
|
3534
|
+
* Specifies if viewport supports touch events. Defaults to false
|
|
3535
|
+
*/
|
|
3536
|
+
hasTouch?: boolean;
|
|
3537
|
+
/**
|
|
3538
|
+
* Specifies if viewport is in landscape mode. Defaults to false.
|
|
3539
|
+
*/
|
|
3540
|
+
isLandscape?: boolean;
|
|
3541
|
+
}
|
|
3542
|
+
/**
|
|
3543
|
+
* This sets the log level hierarchy for our terminal logger, ranging from
|
|
3544
|
+
* most to least verbose.
|
|
3545
|
+
*
|
|
3546
|
+
* Ordering the levels like this lets us easily check whether we should log a
|
|
3547
|
+
* message at a given time. For instance, if the log level is set to `'warn'`,
|
|
3548
|
+
* then anything passed to the logger with level `'warn'` or `'error'` should
|
|
3549
|
+
* be logged, but we should _not_ log anything with level `'info'` or `'debug'`.
|
|
3550
|
+
*
|
|
3551
|
+
* If we have a current log level `currentLevel` and a message with level
|
|
3552
|
+
* `msgLevel` is passed to the logger, we can determine whether or not we should
|
|
3553
|
+
* log it by checking if the log level on the message is further up or at the
|
|
3554
|
+
* same level in the hierarchy than `currentLevel`, like so:
|
|
3555
|
+
*
|
|
3556
|
+
* ```ts
|
|
3557
|
+
* LOG_LEVELS.indexOf(msgLevel) >= LOG_LEVELS.indexOf(currentLevel)
|
|
3558
|
+
* ```
|
|
3559
|
+
*
|
|
3560
|
+
* NOTE: for the reasons described above, do not change the order of the entries
|
|
3561
|
+
* in this array without good reason!
|
|
3562
|
+
*/
|
|
3563
|
+
declare const LOG_LEVELS: readonly ["debug", "info", "warn", "error"];
|
|
3564
|
+
type LogLevel = (typeof LOG_LEVELS)[number];
|
|
3565
|
+
/**
|
|
3566
|
+
* Abstract interface representing a logger with the capability to accept log
|
|
3567
|
+
* messages at various levels (debug, info, warn, and error), set colors, log
|
|
3568
|
+
* time spans, print diagnostic messages, and more.
|
|
3569
|
+
*
|
|
3570
|
+
* A Node.js-specific implementation of this interface is used when Stencil is
|
|
3571
|
+
* building and compiling a project.
|
|
3572
|
+
*/
|
|
3573
|
+
interface Logger {
|
|
3574
|
+
enableColors: (useColors: boolean) => void;
|
|
3575
|
+
setLevel: (level: LogLevel) => void;
|
|
3576
|
+
getLevel: () => LogLevel;
|
|
3577
|
+
debug: (...msg: any[]) => void;
|
|
3578
|
+
info: (...msg: any[]) => void;
|
|
3579
|
+
warn: (...msg: any[]) => void;
|
|
3580
|
+
error: (...msg: any[]) => void;
|
|
3581
|
+
createTimeSpan: (startMsg: string, debug?: boolean, appendTo?: string[]) => LoggerTimeSpan;
|
|
3582
|
+
printDiagnostics: (diagnostics: Diagnostic[], cwd?: string) => void;
|
|
3583
|
+
red: (msg: string) => string;
|
|
3584
|
+
green: (msg: string) => string;
|
|
3585
|
+
yellow: (msg: string) => string;
|
|
3586
|
+
blue: (msg: string) => string;
|
|
3587
|
+
magenta: (msg: string) => string;
|
|
3588
|
+
cyan: (msg: string) => string;
|
|
3589
|
+
gray: (msg: string) => string;
|
|
3590
|
+
bold: (msg: string) => string;
|
|
3591
|
+
dim: (msg: string) => string;
|
|
3592
|
+
bgRed: (msg: string) => string;
|
|
3593
|
+
emoji: (e: string) => string;
|
|
3594
|
+
setLogFilePath?: (p: string) => void;
|
|
3595
|
+
writeLogs?: (append: boolean) => void;
|
|
3596
|
+
createLineUpdater?: () => Promise<LoggerLineUpdater>;
|
|
3597
|
+
}
|
|
3598
|
+
interface LoggerLineUpdater {
|
|
3599
|
+
update(text: string): Promise<void>;
|
|
3600
|
+
stop(): Promise<void>;
|
|
3601
|
+
}
|
|
3602
|
+
interface LoggerTimeSpan {
|
|
3603
|
+
duration(): number;
|
|
3604
|
+
finish(finishedMsg: string, color?: string, bold?: boolean, newLineSuffix?: boolean): number;
|
|
3605
|
+
}
|
|
3606
|
+
interface OutputTargetDist extends OutputTargetValidationConfig {
|
|
3607
|
+
type: 'dist';
|
|
3608
|
+
buildDir?: string;
|
|
3609
|
+
collectionDir?: string | null;
|
|
3610
|
+
/**
|
|
3611
|
+
* When `true` this flag will transform aliased import paths defined in
|
|
3612
|
+
* a project's `tsconfig.json` to relative import paths in the compiled output's
|
|
3613
|
+
* `dist-collection` bundle if it is generated (i.e. `collectionDir` is set).
|
|
3614
|
+
*
|
|
3615
|
+
* Paths will be left in aliased format if `false`.
|
|
3616
|
+
*
|
|
3617
|
+
* @example
|
|
3618
|
+
* // tsconfig.json
|
|
3619
|
+
* {
|
|
3620
|
+
* paths: {
|
|
3621
|
+
* "@utils/*": ['/src/utils/*']
|
|
3622
|
+
* }
|
|
3623
|
+
* }
|
|
3624
|
+
*
|
|
3625
|
+
* // Source file
|
|
3626
|
+
* import * as dateUtils from '@utils/date-utils';
|
|
3627
|
+
* // Output file
|
|
3628
|
+
* import * as dateUtils from '../utils/date-utils';
|
|
3629
|
+
*/
|
|
3630
|
+
transformAliasedImportPathsInCollection?: boolean | null;
|
|
3631
|
+
typesDir?: string;
|
|
3632
|
+
/**
|
|
3633
|
+
* Provide a custom path for the ESM loader directory, containing files you can import
|
|
3634
|
+
* in an initiation script within your application to register all your components for
|
|
3635
|
+
* lazy loading.
|
|
3636
|
+
*
|
|
3637
|
+
* @default /dist/loader
|
|
3638
|
+
*/
|
|
3639
|
+
esmLoaderPath?: string;
|
|
3640
|
+
copy?: CopyTask[];
|
|
3641
|
+
polyfills?: boolean;
|
|
3642
|
+
empty?: boolean;
|
|
3643
|
+
}
|
|
3644
|
+
interface OutputTargetDistCollection extends OutputTargetValidationConfig {
|
|
3645
|
+
type: 'dist-collection';
|
|
3646
|
+
empty?: boolean;
|
|
3647
|
+
dir: string;
|
|
3648
|
+
collectionDir: string;
|
|
3649
|
+
/**
|
|
3650
|
+
* When `true` this flag will transform aliased import paths defined in
|
|
3651
|
+
* a project's `tsconfig.json` to relative import paths in the compiled output.
|
|
3652
|
+
*
|
|
3653
|
+
* Paths will be left in aliased format if `false` or `undefined`.
|
|
3654
|
+
*
|
|
3655
|
+
* @example
|
|
3656
|
+
* // tsconfig.json
|
|
3657
|
+
* {
|
|
3658
|
+
* paths: {
|
|
3659
|
+
* "@utils/*": ['/src/utils/*']
|
|
3660
|
+
* }
|
|
3661
|
+
* }
|
|
3662
|
+
*
|
|
3663
|
+
* // Source file
|
|
3664
|
+
* import * as dateUtils from '@utils/date-utils';
|
|
3665
|
+
* // Output file
|
|
3666
|
+
* import * as dateUtils from '../utils/date-utils';
|
|
3667
|
+
*/
|
|
3668
|
+
transformAliasedImportPaths?: boolean | null;
|
|
3669
|
+
}
|
|
3670
|
+
interface OutputTargetDistTypes extends OutputTargetValidationConfig {
|
|
3671
|
+
type: 'dist-types';
|
|
3672
|
+
dir: string;
|
|
3673
|
+
typesDir: string;
|
|
3674
|
+
}
|
|
3675
|
+
interface OutputTargetDistLazy extends OutputTargetBase {
|
|
3676
|
+
type: 'dist-lazy';
|
|
3677
|
+
dir?: string;
|
|
3678
|
+
esmDir?: string;
|
|
3679
|
+
esmEs5Dir?: string;
|
|
3680
|
+
systemDir?: string;
|
|
3681
|
+
cjsDir?: string;
|
|
3682
|
+
polyfills?: boolean;
|
|
3683
|
+
isBrowserBuild?: boolean;
|
|
3684
|
+
esmIndexFile?: string;
|
|
3685
|
+
cjsIndexFile?: string;
|
|
3686
|
+
systemLoaderFile?: string;
|
|
3687
|
+
legacyLoaderFile?: string;
|
|
3688
|
+
empty?: boolean;
|
|
3689
|
+
}
|
|
3690
|
+
interface OutputTargetDistGlobalStyles extends OutputTargetBase {
|
|
3691
|
+
type: 'dist-global-styles';
|
|
3692
|
+
file: string;
|
|
3693
|
+
}
|
|
3694
|
+
interface OutputTargetDistLazyLoader extends OutputTargetBase {
|
|
3695
|
+
type: 'dist-lazy-loader';
|
|
3696
|
+
dir: string;
|
|
3697
|
+
esmDir: string;
|
|
3698
|
+
esmEs5Dir?: string;
|
|
3699
|
+
cjsDir: string;
|
|
3700
|
+
componentDts: string;
|
|
3701
|
+
empty: boolean;
|
|
3702
|
+
}
|
|
3703
|
+
interface OutputTargetHydrate extends OutputTargetBase {
|
|
3704
|
+
type: 'dist-hydrate-script';
|
|
3705
|
+
dir?: string;
|
|
3706
|
+
/**
|
|
3707
|
+
* Whether to generate a package.json file in the hydrate output directory.
|
|
3708
|
+
* Defaults to `true`
|
|
3709
|
+
* @deprecated
|
|
3710
|
+
* 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`)
|
|
3711
|
+
*/
|
|
3712
|
+
generatePackageJson?: boolean;
|
|
3713
|
+
/**
|
|
3714
|
+
* Module IDs that should not be bundled into the script.
|
|
3715
|
+
* By default, all node builtin's, such as `fs` or `path`
|
|
3716
|
+
* will be considered "external" and not bundled.
|
|
3717
|
+
*/
|
|
3718
|
+
external?: string[];
|
|
3719
|
+
empty?: boolean;
|
|
3720
|
+
minify?: boolean;
|
|
3721
|
+
}
|
|
3722
|
+
interface OutputTargetCustom extends OutputTargetBase {
|
|
3723
|
+
type: 'custom';
|
|
3724
|
+
name: string;
|
|
3725
|
+
/**
|
|
3726
|
+
* Indicate when the output target should be executed.
|
|
3727
|
+
*
|
|
3728
|
+
* - `"onBuildOnly"`: Executed only when `stencil build` is called without `--watch`.
|
|
3729
|
+
* - `"always"`: Executed on every build, including in `watch` mode.
|
|
3730
|
+
*
|
|
3731
|
+
* Defaults to "always".
|
|
3732
|
+
*/
|
|
3733
|
+
taskShouldRun?: 'onBuildOnly' | 'always';
|
|
3734
|
+
validate?: (config: Config, diagnostics: Diagnostic[]) => void;
|
|
3735
|
+
generator: (config: Config, compilerCtx: CompilerCtx, buildCtx: BuildCtx, docs: JsonDocs) => Promise<void>;
|
|
3736
|
+
copy?: CopyTask[];
|
|
3737
|
+
}
|
|
3738
|
+
/**
|
|
3739
|
+
* Output target for generating [custom data](https://github.com/microsoft/vscode-custom-data) for VS Code as a JSON
|
|
3740
|
+
* file.
|
|
3741
|
+
*/
|
|
3742
|
+
interface OutputTargetDocsVscode extends OutputTargetBase {
|
|
3743
|
+
/**
|
|
3744
|
+
* Designates this output target to be used for generating VS Code custom data.
|
|
3745
|
+
* @see OutputTargetBase#type
|
|
3746
|
+
*/
|
|
3747
|
+
type: 'docs-vscode';
|
|
3748
|
+
/**
|
|
3749
|
+
* The location on disk to write the JSON file.
|
|
3750
|
+
*/
|
|
3751
|
+
file: string;
|
|
3752
|
+
/**
|
|
3753
|
+
* A base URL to find the source code of the component(s) described in the JSON file.
|
|
3754
|
+
*/
|
|
3755
|
+
sourceCodeBaseUrl?: string;
|
|
3756
|
+
}
|
|
3757
|
+
interface OutputTargetDocsReadme extends OutputTargetBase {
|
|
3758
|
+
type: 'docs-readme';
|
|
3759
|
+
/**
|
|
3760
|
+
* The root directory where README files should be written
|
|
3761
|
+
*
|
|
3762
|
+
* defaults to {@link Config.srcDir}
|
|
3763
|
+
*/
|
|
3764
|
+
dir?: string;
|
|
3765
|
+
dependencies?: boolean;
|
|
3766
|
+
/**
|
|
3767
|
+
* Controls how READMEs are written to the destination directory.
|
|
3768
|
+
*
|
|
3769
|
+
* - `true`: Always overwrite the destination README with the full content.
|
|
3770
|
+
* - `false` (default): Only update the autogenerated content, preserving existing custom content above it.
|
|
3771
|
+
* - `'if-missing'`: Write the full README only if no file exists at the destination.
|
|
3772
|
+
*
|
|
3773
|
+
* This option enables workflows requiring consistent, idempotent output across builds,
|
|
3774
|
+
* and supports setups where custom documentation may need to coexist or vary between environments.
|
|
3775
|
+
*/
|
|
3776
|
+
overwriteExisting?: boolean | 'if-missing';
|
|
3777
|
+
footer?: string;
|
|
3778
|
+
strict?: boolean;
|
|
3779
|
+
}
|
|
3780
|
+
interface OutputTargetDocsJson extends OutputTargetBase {
|
|
3781
|
+
type: 'docs-json';
|
|
3782
|
+
file: string;
|
|
3783
|
+
/**
|
|
3784
|
+
* Set an optional file path where Stencil should write a `d.ts` file to disk
|
|
3785
|
+
* at build-time containing type declarations for {@link JsonDocs} and related
|
|
3786
|
+
* interfaces. If this is omitted or set to `null` Stencil will not write such
|
|
3787
|
+
* a file.
|
|
3788
|
+
*/
|
|
3789
|
+
typesFile?: string | null;
|
|
3790
|
+
strict?: boolean;
|
|
3791
|
+
/**
|
|
3792
|
+
* An optional file path pointing to a public type library which should be
|
|
3793
|
+
* included and documented in the same way as other types which are included
|
|
3794
|
+
* in this output target.
|
|
3795
|
+
*
|
|
3796
|
+
* This could be useful if, for instance, there are some important interfaces
|
|
3797
|
+
* used in a few places in a Stencil project which don't form part of the
|
|
3798
|
+
* public API for any of the project's components. Such interfaces will not
|
|
3799
|
+
* be included in the `docs-json` output by default, but if they're declared
|
|
3800
|
+
* and exported from a 'supplemental' file designated with this property then
|
|
3801
|
+
* they'll be included in the output, facilitating their documentation.
|
|
3802
|
+
*/
|
|
3803
|
+
supplementalPublicTypes?: string;
|
|
3804
|
+
}
|
|
3805
|
+
interface OutputTargetDocsCustomElementsManifest extends OutputTargetBase {
|
|
3806
|
+
type: 'docs-custom-elements-manifest';
|
|
3807
|
+
/**
|
|
3808
|
+
* The file path where the custom-elements.json manifest will be written.
|
|
3809
|
+
* Defaults to 'custom-elements.json' in the root directory.
|
|
3810
|
+
*/
|
|
3811
|
+
file: string;
|
|
3812
|
+
strict?: boolean;
|
|
3813
|
+
}
|
|
3814
|
+
interface OutputTargetDocsCustom extends OutputTargetBase {
|
|
3815
|
+
type: 'docs-custom';
|
|
3816
|
+
generator: (docs: JsonDocs, config: Config) => void | Promise<void>;
|
|
3817
|
+
strict?: boolean;
|
|
3818
|
+
}
|
|
3819
|
+
interface OutputTargetStats extends OutputTargetBase {
|
|
3820
|
+
type: 'stats';
|
|
3821
|
+
file?: string;
|
|
3822
|
+
}
|
|
3823
|
+
interface OutputTargetBaseNext {
|
|
3824
|
+
type: string;
|
|
3825
|
+
dir?: string;
|
|
3826
|
+
}
|
|
3827
|
+
/**
|
|
3828
|
+
* The collection of valid export behaviors.
|
|
3829
|
+
* Used to generate a type for typed configs as well as output target validation
|
|
3830
|
+
* for the `dist-custom-elements` output target.
|
|
3831
|
+
*
|
|
3832
|
+
* Adding a value to this const array will automatically add it as a valid option on the
|
|
3833
|
+
* output target configuration for `customElementsExportBehavior`.
|
|
3834
|
+
*
|
|
3835
|
+
* - `default`: No additional export or definition behavior will happen.
|
|
3836
|
+
* - `auto-define-custom-elements`: Enables the auto-definition of a component and its children (recursively) in the custom elements registry. This
|
|
3837
|
+
* functionality allows consumers to bypass the explicit call to define a component, its children, its children's
|
|
3838
|
+
* children, etc. Users of this flag should be aware that enabling this functionality may increase bundle size.
|
|
3839
|
+
* - `bundle`: A `defineCustomElements` function will be exported from the distribution directory. This behavior was added to allow easy migration
|
|
3840
|
+
* from `dist-custom-elements-bundle` to `dist-custom-elements`.
|
|
3841
|
+
* - `single-export-module`: All components will be re-exported from the specified directory's root `index.js` file.
|
|
3842
|
+
*/
|
|
3843
|
+
declare const CustomElementsExportBehaviorOptions: readonly ["default", "auto-define-custom-elements", "bundle", "single-export-module"];
|
|
3844
|
+
/**
|
|
3845
|
+
* This type is auto-generated based on the values in `CustomElementsExportBehaviorOptions` array.
|
|
3846
|
+
* This is used on the output target config for intellisense in typed configs.
|
|
3847
|
+
*/
|
|
3848
|
+
type CustomElementsExportBehavior = (typeof CustomElementsExportBehaviorOptions)[number];
|
|
3849
|
+
interface OutputTargetDistCustomElements extends OutputTargetValidationConfig {
|
|
3850
|
+
type: 'dist-custom-elements';
|
|
3851
|
+
empty?: boolean;
|
|
3852
|
+
/**
|
|
3853
|
+
* Triggers the following behaviors when enabled:
|
|
3854
|
+
* 1. All `@stencil/core/*` module references are treated as external during bundling.
|
|
3855
|
+
* 2. File names are not hashed.
|
|
3856
|
+
* 3. File minification will follow the behavior defined at the root of the Stencil config.
|
|
3857
|
+
*/
|
|
3858
|
+
externalRuntime?: boolean;
|
|
3859
|
+
copy?: CopyTask[];
|
|
3860
|
+
includeGlobalScripts?: boolean;
|
|
3861
|
+
minify?: boolean;
|
|
3862
|
+
/**
|
|
3863
|
+
* Enables the generation of type definition files for the output target.
|
|
3864
|
+
*/
|
|
3865
|
+
generateTypeDeclarations?: boolean;
|
|
3866
|
+
/**
|
|
3867
|
+
* Define the export/definition behavior for the output target's generated output.
|
|
3868
|
+
* This controls if/how custom elements will be defined or where components will be exported from.
|
|
3869
|
+
* If omitted, no auto-definition behavior or re-exporting will happen.
|
|
3870
|
+
*/
|
|
3871
|
+
customElementsExportBehavior?: CustomElementsExportBehavior;
|
|
3872
|
+
/**
|
|
3873
|
+
* Generate an auto-loader script that uses MutationObserver to lazily load
|
|
3874
|
+
* and define custom elements as they appear in the DOM.
|
|
3875
|
+
*
|
|
3876
|
+
* When set to `true`, generates a `loader.js` file that auto-starts on import.
|
|
3877
|
+
* Can also be configured with an object for more control:
|
|
3878
|
+
* - `fileName`: Custom filename for the loader (default: 'loader.js')
|
|
3879
|
+
* - `autoStart`: Whether to auto-start the loader on import (default: true)
|
|
3880
|
+
*
|
|
3881
|
+
* @example
|
|
3882
|
+
* ```typescript
|
|
3883
|
+
* // Simple usage
|
|
3884
|
+
* autoLoader: true
|
|
3885
|
+
*
|
|
3886
|
+
* // With options
|
|
3887
|
+
* autoLoader: {
|
|
3888
|
+
* fileName: 'my-loader.js',
|
|
3889
|
+
* autoStart: false
|
|
3890
|
+
* }
|
|
3891
|
+
* ```
|
|
3892
|
+
*/
|
|
3893
|
+
autoLoader?: boolean | {
|
|
3894
|
+
/**
|
|
3895
|
+
* Custom filename for the generated loader script.
|
|
3896
|
+
* @default 'loader.js'
|
|
3897
|
+
*/
|
|
3898
|
+
fileName?: string;
|
|
3899
|
+
/**
|
|
3900
|
+
* Whether to automatically start the loader when the script is imported.
|
|
3901
|
+
* If false, you must call `start()` manually.
|
|
3902
|
+
* @default true
|
|
3903
|
+
*/
|
|
3904
|
+
autoStart?: boolean;
|
|
3905
|
+
};
|
|
3906
|
+
}
|
|
3907
|
+
/**
|
|
3908
|
+
* The base type for output targets. All output targets should extend this base type.
|
|
3909
|
+
*/
|
|
3910
|
+
interface OutputTargetBase {
|
|
3911
|
+
/**
|
|
3912
|
+
* A unique string to differentiate one output target from another
|
|
3913
|
+
*/
|
|
3914
|
+
type: string;
|
|
3915
|
+
}
|
|
3916
|
+
/**
|
|
3917
|
+
* Output targets that can have validation for common `package.json` field values
|
|
3918
|
+
* (module, types, etc.). This allows them to be marked for validation in a project's Stencil config.
|
|
3919
|
+
*/
|
|
3920
|
+
interface OutputTargetValidationConfig extends OutputTargetBaseNext {
|
|
3921
|
+
isPrimaryPackageOutputTarget?: boolean;
|
|
3922
|
+
}
|
|
3923
|
+
type EligiblePrimaryPackageOutputTarget = OutputTargetDist | OutputTargetDistCustomElements | OutputTargetDistCollection | OutputTargetDistTypes;
|
|
3924
|
+
type OutputTargetBuild = OutputTargetDistCollection | OutputTargetDistLazy;
|
|
3925
|
+
interface OutputTargetCopy extends OutputTargetBase {
|
|
3926
|
+
type: 'copy';
|
|
3927
|
+
dir: string;
|
|
3928
|
+
copy?: CopyTask[];
|
|
3929
|
+
copyAssets?: 'collection' | 'dist';
|
|
3930
|
+
}
|
|
3931
|
+
interface OutputTargetWww extends OutputTargetBase {
|
|
3932
|
+
/**
|
|
3933
|
+
* Webapp output target.
|
|
3934
|
+
*/
|
|
3935
|
+
type: 'www';
|
|
3936
|
+
/**
|
|
3937
|
+
* The directory to write the app's JavaScript and CSS build
|
|
3938
|
+
* files to. The default is to place this directory as a child
|
|
3939
|
+
* to the `dir` config. Default: `build`
|
|
3940
|
+
*/
|
|
3941
|
+
buildDir?: string;
|
|
3942
|
+
/**
|
|
3943
|
+
* The directory to write the entire application to.
|
|
3944
|
+
* Note, the `buildDir` is where the app's JavaScript and CSS build
|
|
3945
|
+
* files are written. Default: `www`
|
|
3946
|
+
*/
|
|
3947
|
+
dir?: string;
|
|
3948
|
+
/**
|
|
3949
|
+
* Empty the build directory of all files and directories on first build.
|
|
3950
|
+
* Default: `true`
|
|
3951
|
+
*/
|
|
3952
|
+
empty?: boolean;
|
|
3953
|
+
/**
|
|
3954
|
+
* The default index html file of the app, commonly found at the
|
|
3955
|
+
* root of the `src` directory.
|
|
3956
|
+
* Default: `index.html`
|
|
3957
|
+
*/
|
|
3958
|
+
indexHtml?: string;
|
|
3959
|
+
/**
|
|
3960
|
+
* The copy config is an array of objects that defines any files or folders that should
|
|
3961
|
+
* be copied over to the build directory.
|
|
3962
|
+
*
|
|
3963
|
+
* Each object in the array must include a src property which can be either an absolute path,
|
|
3964
|
+
* a relative path or a glob pattern. The config can also provide an optional dest property
|
|
3965
|
+
* which can be either an absolute path or a path relative to the build directory.
|
|
3966
|
+
* Also note that any files within src/assets are automatically copied to www/assets for convenience.
|
|
3967
|
+
*
|
|
3968
|
+
* In the copy config below, it will copy the entire directory from src/docs-content over to www/docs-content.
|
|
3969
|
+
*/
|
|
3970
|
+
copy?: CopyTask[];
|
|
3971
|
+
/**
|
|
3972
|
+
* The base url of the app, it's required during prerendering to be the absolute path
|
|
3973
|
+
* of your app, such as: `https://my.app.com/app`.
|
|
3974
|
+
*
|
|
3975
|
+
* Default: `/`
|
|
3976
|
+
*/
|
|
3977
|
+
baseUrl?: string;
|
|
3978
|
+
/**
|
|
3979
|
+
* By default, stencil will include all the polyfills required by legacy browsers in the ES5 build.
|
|
3980
|
+
* If it's `false`, stencil will not emit this polyfills anymore and it's your responsibility to provide them before
|
|
3981
|
+
* stencil initializes.
|
|
3982
|
+
*/
|
|
3983
|
+
polyfills?: boolean;
|
|
3984
|
+
/**
|
|
3985
|
+
* Path to an external node module which has exports of the prerender config object.
|
|
3986
|
+
* ```
|
|
3987
|
+
* module.exports = {
|
|
3988
|
+
* afterHydrate(document, url) {
|
|
3989
|
+
* document.title = `URL: ${url.href}`;
|
|
3990
|
+
* }
|
|
3991
|
+
* }
|
|
3992
|
+
* ```
|
|
3993
|
+
*/
|
|
3994
|
+
prerenderConfig?: string;
|
|
3995
|
+
/**
|
|
3996
|
+
* Service worker config for production builds. During development builds
|
|
3997
|
+
* service worker script will be injected to automatically deregister existing
|
|
3998
|
+
* service workers. When set to `false` neither a service worker registration
|
|
3999
|
+
* or deregistration will be added to the index.html.
|
|
4000
|
+
*/
|
|
4001
|
+
serviceWorker?: ServiceWorkerConfig | null | false;
|
|
4002
|
+
appDir?: string;
|
|
4003
|
+
}
|
|
4004
|
+
type OutputTarget = OutputTargetCopy | OutputTargetCustom | OutputTargetDist | OutputTargetDistCollection | OutputTargetDistCustomElements | OutputTargetDistLazy | OutputTargetDistGlobalStyles | OutputTargetDistLazyLoader | OutputTargetDocsJson | OutputTargetDocsCustom | OutputTargetDocsReadme | OutputTargetDocsVscode | OutputTargetDocsCustomElementsManifest | OutputTargetWww | OutputTargetHydrate | OutputTargetStats | OutputTargetDistTypes;
|
|
4005
|
+
/**
|
|
4006
|
+
* Our custom configuration interface for generated caching Service Workers
|
|
4007
|
+
* using the Workbox library (see https://developer.chrome.com/docs/workbox/).
|
|
4008
|
+
*
|
|
4009
|
+
* Although we are using Workbox we are unfortunately unable to depend on the
|
|
4010
|
+
* published types for the library because they must be compiled using the
|
|
4011
|
+
* `webworker` lib for TypeScript, which cannot be used at the same time as
|
|
4012
|
+
* the `dom` lib. So as a workaround we maintain our own interface here. See
|
|
4013
|
+
* here to refer to the published version:
|
|
4014
|
+
* https://github.com/DefinitelyTyped/DefinitelyTyped/blob/c7b4dadae5b320ad1311a8f82242b8f2f41b7b8c/types/workbox-build/generate-sw.d.ts#L3
|
|
4015
|
+
*/
|
|
4016
|
+
interface ServiceWorkerConfig {
|
|
4017
|
+
unregister?: boolean;
|
|
4018
|
+
swDest?: string;
|
|
4019
|
+
swSrc?: string;
|
|
4020
|
+
globPatterns?: string[];
|
|
4021
|
+
globDirectory?: string | string[];
|
|
4022
|
+
globIgnores?: string | string[];
|
|
4023
|
+
templatedUrls?: any;
|
|
4024
|
+
maximumFileSizeToCacheInBytes?: number;
|
|
4025
|
+
manifestTransforms?: any;
|
|
4026
|
+
modifyUrlPrefix?: any;
|
|
4027
|
+
dontCacheBustURLsMatching?: RegExp;
|
|
4028
|
+
navigateFallback?: string;
|
|
4029
|
+
navigateFallbackWhitelist?: RegExp[];
|
|
4030
|
+
navigateFallbackBlacklist?: RegExp[];
|
|
4031
|
+
cacheId?: string;
|
|
4032
|
+
skipWaiting?: boolean;
|
|
4033
|
+
clientsClaim?: boolean;
|
|
4034
|
+
directoryIndex?: string;
|
|
4035
|
+
runtimeCaching?: any[];
|
|
4036
|
+
ignoreUrlParametersMatching?: any[];
|
|
4037
|
+
handleFetch?: boolean;
|
|
4038
|
+
}
|
|
4039
|
+
interface LoadConfigInit {
|
|
4040
|
+
/**
|
|
4041
|
+
* User config object to merge into default config and
|
|
4042
|
+
* config loaded from a file path.
|
|
4043
|
+
*/
|
|
4044
|
+
config?: UnvalidatedConfig;
|
|
4045
|
+
/**
|
|
4046
|
+
* Absolute path to a Stencil config file. This path cannot be
|
|
4047
|
+
* relative and it does not resolve config files within a directory.
|
|
4048
|
+
*/
|
|
4049
|
+
configPath?: string;
|
|
4050
|
+
logger?: Logger;
|
|
4051
|
+
sys?: CompilerSystem;
|
|
4052
|
+
/**
|
|
4053
|
+
* When set to true, if the "tsconfig.json" file is not found
|
|
4054
|
+
* it'll automatically generate and save a default tsconfig
|
|
4055
|
+
* within the root directory.
|
|
4056
|
+
*/
|
|
4057
|
+
initTsConfig?: boolean;
|
|
4058
|
+
}
|
|
4059
|
+
/**
|
|
4060
|
+
* Results from an attempt to load a config. The values on this interface
|
|
4061
|
+
* have not yet been validated and are not ready to be used for arbitrary
|
|
4062
|
+
* operations around the codebase.
|
|
4063
|
+
*/
|
|
4064
|
+
interface LoadConfigResults {
|
|
4065
|
+
config: ValidatedConfig;
|
|
4066
|
+
diagnostics: Diagnostic[];
|
|
4067
|
+
tsconfig: {
|
|
4068
|
+
path: string;
|
|
4069
|
+
compilerOptions: any;
|
|
4070
|
+
files: string[];
|
|
4071
|
+
include: string[];
|
|
4072
|
+
exclude: string[];
|
|
4073
|
+
extends: string;
|
|
4074
|
+
};
|
|
4075
|
+
}
|
|
4076
|
+
interface Diagnostic {
|
|
4077
|
+
absFilePath?: string | undefined;
|
|
4078
|
+
code?: string;
|
|
4079
|
+
columnNumber?: number | undefined;
|
|
4080
|
+
debugText?: string;
|
|
4081
|
+
header?: string;
|
|
4082
|
+
language?: string;
|
|
4083
|
+
level: 'error' | 'warn' | 'info' | 'log' | 'debug';
|
|
4084
|
+
lineNumber?: number | undefined;
|
|
4085
|
+
lines: PrintLine[];
|
|
4086
|
+
messageText: string;
|
|
4087
|
+
relFilePath?: string | undefined;
|
|
4088
|
+
type: string;
|
|
4089
|
+
}
|
|
4090
|
+
interface CacheStorage {
|
|
4091
|
+
get(key: string): Promise<any>;
|
|
4092
|
+
set(key: string, value: any): Promise<void>;
|
|
4093
|
+
}
|
|
4094
|
+
interface WorkerOptions {
|
|
4095
|
+
maxConcurrentWorkers?: number;
|
|
4096
|
+
maxConcurrentTasksPerWorker?: number;
|
|
4097
|
+
logger?: Logger;
|
|
4098
|
+
}
|
|
4099
|
+
interface RollupInterface {
|
|
4100
|
+
rollup: {
|
|
4101
|
+
(config: any): Promise<any>;
|
|
4102
|
+
};
|
|
4103
|
+
plugins: {
|
|
4104
|
+
nodeResolve(opts: any): any;
|
|
4105
|
+
replace(opts: any): any;
|
|
4106
|
+
commonjs(opts: any): any;
|
|
4107
|
+
json(): any;
|
|
4108
|
+
};
|
|
4109
|
+
}
|
|
4110
|
+
interface ResolveModuleOptions {
|
|
4111
|
+
manuallyResolve?: boolean;
|
|
4112
|
+
packageJson?: boolean;
|
|
4113
|
+
}
|
|
4114
|
+
interface PrerenderStartOptions {
|
|
4115
|
+
buildId?: string;
|
|
4116
|
+
hydrateAppFilePath?: string;
|
|
4117
|
+
componentGraph?: BuildResultsComponentGraph;
|
|
4118
|
+
srcIndexHtmlPath?: string;
|
|
4119
|
+
}
|
|
4120
|
+
interface PrerenderResults {
|
|
4121
|
+
buildId: string;
|
|
4122
|
+
diagnostics: Diagnostic[];
|
|
4123
|
+
urls: number;
|
|
4124
|
+
duration: number;
|
|
4125
|
+
average: number;
|
|
4126
|
+
}
|
|
4127
|
+
/**
|
|
4128
|
+
* Input for CSS optimization functions, including the input CSS
|
|
4129
|
+
* string and a few boolean options which turn on or off various
|
|
4130
|
+
* optimizations.
|
|
4131
|
+
*/
|
|
4132
|
+
interface OptimizeCssInput {
|
|
4133
|
+
input: string;
|
|
4134
|
+
filePath?: string;
|
|
4135
|
+
autoprefixer?: boolean | null | AutoprefixerOptions;
|
|
4136
|
+
minify?: boolean;
|
|
4137
|
+
sourceMap?: boolean;
|
|
4138
|
+
resolveUrl?: (url: string) => Promise<string> | string;
|
|
4139
|
+
}
|
|
4140
|
+
/**
|
|
4141
|
+
* This is not a real interface describing the options which can
|
|
4142
|
+
* be passed to autoprefixer, for that see the docs, here:
|
|
4143
|
+
* https://github.com/postcss/autoprefixer#options
|
|
4144
|
+
*
|
|
4145
|
+
* Instead, this basically just serves as a label type to track
|
|
4146
|
+
* that arguments are being passed consistently.
|
|
4147
|
+
*/
|
|
4148
|
+
type AutoprefixerOptions = Object;
|
|
4149
|
+
/**
|
|
4150
|
+
* Output from CSS optimization functions, wrapping up optimized
|
|
4151
|
+
* CSS and any diagnostics produced during optimization.
|
|
4152
|
+
*/
|
|
4153
|
+
interface OptimizeCssOutput {
|
|
4154
|
+
output: string;
|
|
4155
|
+
diagnostics: Diagnostic[];
|
|
4156
|
+
}
|
|
4157
|
+
interface OptimizeJsInput {
|
|
4158
|
+
input: string;
|
|
4159
|
+
filePath?: string;
|
|
4160
|
+
target?: 'es5' | 'latest';
|
|
4161
|
+
pretty?: boolean;
|
|
4162
|
+
sourceMap?: boolean;
|
|
4163
|
+
}
|
|
4164
|
+
interface OptimizeJsOutput {
|
|
4165
|
+
output: string;
|
|
4166
|
+
sourceMap: any;
|
|
4167
|
+
diagnostics: Diagnostic[];
|
|
4168
|
+
}
|
|
4169
|
+
interface LazyRequire {
|
|
4170
|
+
ensure(fromDir: string, moduleIds: string[]): Promise<Diagnostic[]>;
|
|
4171
|
+
require(fromDir: string, moduleId: string): any;
|
|
4172
|
+
getModulePath(fromDir: string, moduleId: string): string;
|
|
4173
|
+
}
|
|
4174
|
+
/**
|
|
4175
|
+
* @deprecated This interface is no longer used by Stencil
|
|
4176
|
+
* TODO(STENCIL-743): Remove this interface
|
|
4177
|
+
*/
|
|
4178
|
+
interface FsWatcherItem {
|
|
4179
|
+
close(): void;
|
|
4180
|
+
}
|
|
4181
|
+
/**
|
|
4182
|
+
* @deprecated This interface is no longer used by Stencil
|
|
4183
|
+
* TODO(STENCIL-743): Remove this interface
|
|
4184
|
+
*/
|
|
4185
|
+
interface MakeDirectoryOptions {
|
|
4186
|
+
/**
|
|
4187
|
+
* Indicates whether parent folders should be created.
|
|
4188
|
+
* @default false
|
|
4189
|
+
*/
|
|
4190
|
+
recursive?: boolean;
|
|
4191
|
+
/**
|
|
4192
|
+
* A file mode. If a string is passed, it is parsed as an octal integer. If not specified
|
|
4193
|
+
* @default 0o777.
|
|
4194
|
+
*/
|
|
4195
|
+
mode?: number;
|
|
4196
|
+
}
|
|
4197
|
+
/**
|
|
4198
|
+
* @deprecated This interface is no longer used by Stencil
|
|
4199
|
+
* TODO(STENCIL-743): Remove this interface
|
|
4200
|
+
*/
|
|
4201
|
+
interface FsStats {
|
|
4202
|
+
isFile(): boolean;
|
|
4203
|
+
isDirectory(): boolean;
|
|
4204
|
+
isBlockDevice(): boolean;
|
|
4205
|
+
isCharacterDevice(): boolean;
|
|
4206
|
+
isSymbolicLink(): boolean;
|
|
4207
|
+
isFIFO(): boolean;
|
|
4208
|
+
isSocket(): boolean;
|
|
4209
|
+
dev: number;
|
|
4210
|
+
ino: number;
|
|
4211
|
+
mode: number;
|
|
4212
|
+
nlink: number;
|
|
4213
|
+
uid: number;
|
|
4214
|
+
gid: number;
|
|
4215
|
+
rdev: number;
|
|
4216
|
+
size: number;
|
|
4217
|
+
blksize: number;
|
|
4218
|
+
blocks: number;
|
|
4219
|
+
atime: Date;
|
|
4220
|
+
mtime: Date;
|
|
4221
|
+
ctime: Date;
|
|
4222
|
+
birthtime: Date;
|
|
4223
|
+
}
|
|
4224
|
+
interface Compiler {
|
|
4225
|
+
build(): Promise<CompilerBuildResults>;
|
|
4226
|
+
createWatcher(): Promise<CompilerWatcher>;
|
|
4227
|
+
destroy(): Promise<void>;
|
|
4228
|
+
sys: CompilerSystem;
|
|
4229
|
+
}
|
|
4230
|
+
interface CompilerWatcher extends BuildOnEvents {
|
|
4231
|
+
start: () => Promise<WatcherCloseResults>;
|
|
4232
|
+
close: () => Promise<WatcherCloseResults>;
|
|
4233
|
+
request: (data: CompilerRequest) => Promise<CompilerRequestResponse>;
|
|
4234
|
+
}
|
|
4235
|
+
interface CompilerRequest {
|
|
4236
|
+
path?: string;
|
|
4237
|
+
}
|
|
4238
|
+
interface WatcherCloseResults {
|
|
4239
|
+
exitCode: number;
|
|
4240
|
+
}
|
|
4241
|
+
interface CompilerRequestResponse {
|
|
4242
|
+
path: string;
|
|
4243
|
+
nodeModuleId: string;
|
|
4244
|
+
nodeModuleVersion: string;
|
|
4245
|
+
nodeResolvedPath: string;
|
|
4246
|
+
cachePath: string;
|
|
4247
|
+
cacheHit: boolean;
|
|
4248
|
+
content: string;
|
|
4249
|
+
status: number;
|
|
4250
|
+
}
|
|
4251
|
+
/**
|
|
4252
|
+
* Options for Stencil's string-to-string transpiler
|
|
4253
|
+
*/
|
|
4254
|
+
interface TranspileOptions {
|
|
4255
|
+
/**
|
|
4256
|
+
* A component can be defined as a custom element by using `customelement`, or the
|
|
4257
|
+
* component class can be exported by using `module`. Default is `customelement`.
|
|
4258
|
+
*/
|
|
4259
|
+
componentExport?: 'customelement' | 'module' | string | undefined;
|
|
4260
|
+
/**
|
|
4261
|
+
* Sets how and if component metadata should be assigned on the compiled
|
|
4262
|
+
* component output. The `compilerstatic` value will set the metadata to
|
|
4263
|
+
* a static `COMPILER_META` getter on the component class. This option
|
|
4264
|
+
* is useful for unit testing preprocessors. Default is `null`.
|
|
4265
|
+
*/
|
|
4266
|
+
componentMetadata?: 'runtimestatic' | 'compilerstatic' | string | undefined;
|
|
4267
|
+
/**
|
|
4268
|
+
* The actual internal import path for any `@stencil/core` imports.
|
|
4269
|
+
* Default is `@stencil/core/runtime/client`.
|
|
4270
|
+
*/
|
|
4271
|
+
coreImportPath?: string;
|
|
4272
|
+
/**
|
|
4273
|
+
* The current working directory. Default is `/`.
|
|
4274
|
+
*/
|
|
4275
|
+
currentDirectory?: string;
|
|
4276
|
+
/**
|
|
4277
|
+
* The filename of the code being compiled. Default is `module.tsx`.
|
|
4278
|
+
*/
|
|
4279
|
+
file?: string;
|
|
4280
|
+
/**
|
|
4281
|
+
* Module format to use for the compiled code output, which can be either `esm` or `cjs`.
|
|
4282
|
+
* Default is `esm`.
|
|
4283
|
+
*/
|
|
4284
|
+
module?: 'cjs' | 'esm' | string;
|
|
4285
|
+
/**
|
|
4286
|
+
* Sets how and if any properties, methods and events are proxied on the
|
|
4287
|
+
* component class. The `defineproperty` value sets the getters and setters
|
|
4288
|
+
* using Object.defineProperty. Default is `defineproperty`.
|
|
4289
|
+
*/
|
|
4290
|
+
proxy?: 'defineproperty' | string | undefined;
|
|
4291
|
+
/**
|
|
4292
|
+
* How component styles should be associated to the component. The `static`
|
|
4293
|
+
* setting will assign the styles as a static getter on the component class.
|
|
4294
|
+
*/
|
|
4295
|
+
style?: 'static' | string | undefined;
|
|
4296
|
+
/**
|
|
4297
|
+
* How style data should be added for imports. For example, the `queryparams` value
|
|
4298
|
+
* adds the component's tagname and encapsulation info as querystring parameter
|
|
4299
|
+
* to the style's import, such as `style.css?tag=my-tag&encapsulation=shadow`. This
|
|
4300
|
+
* style data can be used by bundlers to further optimize each component's css.
|
|
4301
|
+
* Set to `null` to not include the querystring parameters. Default is `queryparams`.
|
|
4302
|
+
*/
|
|
4303
|
+
styleImportData?: 'queryparams' | string | undefined;
|
|
4304
|
+
/**
|
|
4305
|
+
* The JavaScript source target TypeScript should to transpile to. Values can be
|
|
4306
|
+
* `latest`, `esnext`, `es2017`, `es2015`, or `es5`. Defaults to `latest`.
|
|
4307
|
+
*/
|
|
4308
|
+
target?: CompileTarget;
|
|
4309
|
+
/**
|
|
4310
|
+
* Create a source map. Using `inline` will inline the source map into the
|
|
4311
|
+
* code, otherwise the source map will be in the returned `map` property.
|
|
4312
|
+
* Default is `true`.
|
|
4313
|
+
*/
|
|
4314
|
+
sourceMap?: boolean | 'inline';
|
|
4315
|
+
/**
|
|
4316
|
+
* Base directory to resolve non-relative module names. Same as the `baseUrl`
|
|
4317
|
+
* TypeScript compiler option: https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping
|
|
4318
|
+
*/
|
|
4319
|
+
baseUrl?: string;
|
|
4320
|
+
/**
|
|
4321
|
+
* List of path mapping entries for module names to locations relative to the `baseUrl`.
|
|
4322
|
+
* Same as the `paths` TypeScript compiler option:
|
|
4323
|
+
* https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping
|
|
4324
|
+
*/
|
|
4325
|
+
paths?: {
|
|
4326
|
+
[key: string]: string[];
|
|
4327
|
+
};
|
|
4328
|
+
/**
|
|
4329
|
+
* JSX mode for TypeScript compilation. Can be 'react', 'react-jsx', 'react-jsxdev', etc.
|
|
4330
|
+
* Same as the `jsx` TypeScript compiler option.
|
|
4331
|
+
*/
|
|
4332
|
+
jsx?: number;
|
|
4333
|
+
/**
|
|
4334
|
+
* Module specifier for JSX factory. Used with automatic JSX runtime.
|
|
4335
|
+
* Same as the `jsxImportSource` TypeScript compiler option.
|
|
4336
|
+
*/
|
|
4337
|
+
jsxImportSource?: string;
|
|
4338
|
+
/**
|
|
4339
|
+
* Passed in Stencil Compiler System, otherwise falls back to the internal in-memory only system.
|
|
4340
|
+
*/
|
|
4341
|
+
sys?: CompilerSystem;
|
|
4342
|
+
/**
|
|
4343
|
+
* This option enables the same behavior as {@link Config.transformAliasedImportPaths}, transforming paths aliased in
|
|
4344
|
+
* `tsconfig.json` to relative paths.
|
|
4345
|
+
*/
|
|
4346
|
+
transformAliasedImportPaths?: boolean;
|
|
4347
|
+
/**
|
|
4348
|
+
* List of tags to transform, by default only the incoming component tag is transformed
|
|
4349
|
+
*/
|
|
4350
|
+
tagsToTransform?: string[];
|
|
4351
|
+
/**
|
|
4352
|
+
* Adds `transformTag` calls to css strings and querySelector(All) calls
|
|
4353
|
+
*/
|
|
4354
|
+
additionalTagTransformers?: boolean;
|
|
4355
|
+
}
|
|
4356
|
+
type CompileTarget = 'latest' | 'esnext' | 'es2020' | 'es2019' | 'es2018' | 'es2017' | 'es2015' | 'es5' | string | undefined;
|
|
4357
|
+
interface TranspileResults {
|
|
4358
|
+
code: string;
|
|
4359
|
+
data?: any[];
|
|
4360
|
+
diagnostics: Diagnostic[];
|
|
4361
|
+
imports?: {
|
|
4362
|
+
path: string;
|
|
4363
|
+
}[];
|
|
4364
|
+
inputFileExtension: string;
|
|
4365
|
+
inputFilePath: string;
|
|
4366
|
+
map: any;
|
|
4367
|
+
outputFilePath: string;
|
|
4368
|
+
}
|
|
4369
|
+
interface TransformOptions {
|
|
4370
|
+
coreImportPath: string;
|
|
4371
|
+
componentExport: 'lazy' | 'module' | 'customelement' | null;
|
|
4372
|
+
componentMetadata: 'runtimestatic' | 'compilerstatic' | null;
|
|
4373
|
+
currentDirectory: string;
|
|
4374
|
+
file?: string;
|
|
4375
|
+
isolatedModules?: boolean;
|
|
4376
|
+
module?: 'cjs' | 'esm';
|
|
4377
|
+
proxy: 'defineproperty' | null;
|
|
4378
|
+
style: 'static' | null;
|
|
4379
|
+
styleImportData: 'queryparams' | null;
|
|
4380
|
+
target?: string;
|
|
4381
|
+
}
|
|
4382
|
+
interface CompileScriptMinifyOptions {
|
|
4383
|
+
target?: CompileTarget;
|
|
4384
|
+
pretty?: boolean;
|
|
4385
|
+
}
|
|
4386
|
+
interface DevServer extends BuildEmitEvents {
|
|
4387
|
+
address: string;
|
|
4388
|
+
basePath: string;
|
|
4389
|
+
browserUrl: string;
|
|
4390
|
+
protocol: string;
|
|
4391
|
+
port: number;
|
|
4392
|
+
root: string;
|
|
4393
|
+
close(): Promise<void>;
|
|
4394
|
+
}
|
|
4395
|
+
interface CliInitOptions {
|
|
4396
|
+
args: string[];
|
|
4397
|
+
logger: Logger;
|
|
4398
|
+
sys: CompilerSystem;
|
|
4399
|
+
}
|
|
4400
|
+
//#endregion
|
|
4401
|
+
export { AutoprefixerOptions, BuildEmitEvents, BuildEvents, BuildLog, BuildNoChangeResults, BuildOnEventRemove, BuildOnEvents, BuildOutput, BuildResultsComponentGraph, BundlingConfig, CacheStorage, CliInitOptions, CompileScriptMinifyOptions, CompileTarget, Compiler, CompilerBuildResults, CompilerBuildStart, CompilerDependency, CompilerEventBuildFinish, CompilerEventBuildLog, CompilerEventBuildNoChange, CompilerEventBuildStart, CompilerEventDirAdd, CompilerEventDirDelete, CompilerEventFileAdd, CompilerEventFileDelete, CompilerEventFileUpdate, CompilerEventFsChange, CompilerEventName, CompilerFileWatcher, CompilerFileWatcherCallback, CompilerFileWatcherEvent, CompilerFsStats, CompilerRequest, CompilerRequestResponse, CompilerSystem, CompilerSystemCreateDirectoryOptions, CompilerSystemCreateDirectoryResults, CompilerSystemRealpathResults, CompilerSystemRemoveDirectoryOptions, CompilerSystemRemoveDirectoryResults, CompilerSystemRemoveFileResults, CompilerSystemRenameResults, CompilerSystemRenamedPath, CompilerSystemWriteFileResults, CompilerWatcher, Config, ConfigBundle, ConfigExtras, CopyResults, CopyTask, Credentials, CustomElementsExportBehavior, CustomElementsExportBehaviorOptions, DevServer, DevServerConfig, DevServerEditor, Diagnostic, EligiblePrimaryPackageOutputTarget, EmulateConfig, EmulateViewport, FsStats, FsWatchResults, FsWatcherItem, HistoryApiFallback, HmrStyleUpdate, HotModuleReplacement, HydrateDocumentOptions, HydrateFactoryOptions, HydratedFlag, JestConfig, JsonDocMethodParameter, JsonDocs, JsonDocsComponent, JsonDocsCustomState, JsonDocsDependencyGraph, JsonDocsEvent, JsonDocsListener, JsonDocsMethod, JsonDocsMethodReturn, JsonDocsPart, JsonDocsProp, JsonDocsSlot, JsonDocsStyle, JsonDocsTag, JsonDocsTypeLibrary, JsonDocsUsage, JsonDocsValue, LOG_LEVELS, LazyRequire, LoadConfigInit, LoadConfigResults, LogLevel, Logger, LoggerLineUpdater, LoggerTimeSpan, MakeDirectoryOptions, NodeResolveConfig, OptimizeCssInput, OptimizeCssOutput, OptimizeJsInput, OptimizeJsOutput, OutputTarget, OutputTargetBase, OutputTargetBaseNext, OutputTargetBuild, OutputTargetCopy, OutputTargetCustom, OutputTargetDist, OutputTargetDistCollection, OutputTargetDistCustomElements, OutputTargetDistGlobalStyles, OutputTargetDistLazy, OutputTargetDistLazyLoader, OutputTargetDistTypes, OutputTargetDocsCustom, OutputTargetDocsCustomElementsManifest, OutputTargetDocsJson, OutputTargetDocsReadme, OutputTargetDocsVscode, OutputTargetHydrate, OutputTargetStats, OutputTargetWww, PageReloadStrategy, ParsedPath, Path, PlatformPath, PrerenderConfig, PrerenderHydrateOptions, PrerenderResults, PrerenderStartOptions, ResolveModuleIdOptions, ResolveModuleIdResults, ResolveModuleOptions, RobotsTxtOpts, RobotsTxtResults, RollupConfig, RollupInputOptions, RollupInterface, RollupOutputOptions, SerializeDocumentOptions, ServiceWorkerConfig, SitemapXmpOpts, SitemapXmpResults, StencilConfig, StencilDevServerConfig, StencilDocsConfig, StyleDoc, SystemDetails, Testing, TestingConfig, TestingRunOptions, TransformOptions, TransformerConfig, TranspileOnlyResults, TranspileOptions, TranspileResults, UnvalidatedConfig, ValidatedConfig, WatcherCloseResults, WorkerMainController, WorkerOptions };
|