diff --git a/src/cli/public.ts b/src/cli/public.ts index 055928059e5..5358491b90c 100644 --- a/src/cli/public.ts +++ b/src/cli/public.ts @@ -1,4 +1,4 @@ -import { CliInitOptions, CompilerSystem, Config, ConfigFlags, Logger, TaskCommand } from '@stencil/core/internal'; +import type { CliInitOptions, CompilerSystem, Config, ConfigFlags, Logger, TaskCommand } from '@stencil/core/internal'; /** * Runs the CLI with the given options. This is used by Stencil's default `bin/stencil` file, diff --git a/src/client/client-build.ts b/src/client/client-build.ts index 01cb3a53fd7..0e35fe6fe84 100644 --- a/src/client/client-build.ts +++ b/src/client/client-build.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { BUILD } from '@app-data'; export const Build: d.UserBuildConditionals = { diff --git a/src/client/client-host-ref.ts b/src/client/client-host-ref.ts index 33c6f092d7d..9a02d3613d5 100644 --- a/src/client/client-host-ref.ts +++ b/src/client/client-host-ref.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { addHostEventListeners } from '@runtime'; import { BUILD } from '@app-data'; diff --git a/src/client/client-load-module.ts b/src/client/client-load-module.ts index 3a5fe76e896..1772931b77b 100644 --- a/src/client/client-load-module.ts +++ b/src/client/client-load-module.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { BUILD } from '@app-data'; import { consoleError, consoleDevError } from './client-log'; diff --git a/src/client/client-patch-browser.ts b/src/client/client-patch-browser.ts index 7ac32a0ebce..b00a46682b2 100644 --- a/src/client/client-patch-browser.ts +++ b/src/client/client-patch-browser.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { BUILD, NAMESPACE } from '@app-data'; import { consoleDevInfo, H, doc, plt, promiseResolve, win } from '@platform'; import { getDynamicImportFunction } from '@utils'; diff --git a/src/client/client-style.ts b/src/client/client-style.ts index 1f9f5dbc630..53532b3a5d9 100644 --- a/src/client/client-style.ts +++ b/src/client/client-style.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; export const styles: d.StyleMap = /*@__PURE__*/ new Map(); export const modeResolutionChain: d.ResolutionHandler[] = []; diff --git a/src/client/client-task-queue.ts b/src/client/client-task-queue.ts index 9d09d4c3051..976107fa782 100644 --- a/src/client/client-task-queue.ts +++ b/src/client/client-task-queue.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { consoleError } from './client-log'; import { plt, promiseResolve } from './client-window'; import { PLATFORM_FLAGS } from '../runtime/runtime-constants'; @@ -82,7 +82,6 @@ const flush = () => { } else { queueCongestion = 0; } - } else { consume(queueDomWrites); if ((queuePending = queueDomReads.length > 0)) { diff --git a/src/client/client-window.ts b/src/client/client-window.ts index 1f878cc5fa2..b5f2e891b3e 100644 --- a/src/client/client-window.ts +++ b/src/client/client-window.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { BUILD } from '@app-data'; export const win = typeof window !== 'undefined' ? window : ({} as Window); diff --git a/src/compiler/app-core/app-es5-disabled.ts b/src/compiler/app-core/app-es5-disabled.ts index 88cd064ea3c..a7fdf0368be 100644 --- a/src/compiler/app-core/app-es5-disabled.ts +++ b/src/compiler/app-core/app-es5-disabled.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { escapeHtml } from '@utils'; import { join } from 'path'; @@ -142,8 +142,5 @@ h2 { }; const inlineHTML = (html: string) => { - return html - .replace(/\n/g, '\\n') - .replace(/\'/g, `\\'`) - .trim(); + return html.replace(/\n/g, '\\n').replace(/\'/g, `\\'`).trim(); }; diff --git a/src/compiler/app-core/app-polyfills.ts b/src/compiler/app-core/app-polyfills.ts index 56653ba26cf..3b4466931b7 100644 --- a/src/compiler/app-core/app-polyfills.ts +++ b/src/compiler/app-core/app-polyfills.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { join } from 'path'; export const getClientPolyfill = async (config: d.Config, compilerCtx: d.CompilerCtx, polyfillFile: string) => { diff --git a/src/compiler/app-core/bundle-app-core.ts b/src/compiler/app-core/bundle-app-core.ts index 19925ea306d..271677698ae 100644 --- a/src/compiler/app-core/bundle-app-core.ts +++ b/src/compiler/app-core/bundle-app-core.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { OutputOptions, RollupBuild } from 'rollup'; import { STENCIL_CORE_ID } from '../bundle/entry-alias-ids'; diff --git a/src/compiler/build/build-ctx.ts b/src/compiler/build/build-ctx.ts index 388e3234110..777d38d60f1 100644 --- a/src/compiler/build/build-ctx.ts +++ b/src/compiler/build/build-ctx.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { hasError, hasWarning } from '@utils'; /** diff --git a/src/compiler/build/build-hmr.ts b/src/compiler/build/build-hmr.ts index 417241faaac..f9b1dfb7c6e 100644 --- a/src/compiler/build/build-hmr.ts +++ b/src/compiler/build/build-hmr.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { getScopeId } from '../style/scope-css'; import { isOutputTargetWww } from '../output-targets/output-utils'; import minimatch from 'minimatch'; diff --git a/src/compiler/build/build-results.ts b/src/compiler/build/build-results.ts index 33949b266d5..09757084353 100644 --- a/src/compiler/build/build-results.ts +++ b/src/compiler/build/build-results.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { generateHmr } from './build-hmr'; import { getBuildTimestamp } from './build-ctx'; import { hasError, isString, normalizeDiagnostics, fromEntries } from '@utils'; diff --git a/src/compiler/build/build.ts b/src/compiler/build/build.ts index 0f67b0f14ad..b867ba0fa3f 100644 --- a/src/compiler/build/build.ts +++ b/src/compiler/build/build.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { buildAbort, buildFinish } from './build-finish'; import { catchError, isString, readPackageJson } from '@utils'; import { createDocument } from '@stencil/core/mock-doc'; diff --git a/src/compiler/build/compiler-ctx.ts b/src/compiler/build/compiler-ctx.ts index ed13406f763..c1fa84dbce9 100644 --- a/src/compiler/build/compiler-ctx.ts +++ b/src/compiler/build/compiler-ctx.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { basename, dirname, extname, join } from 'path'; import { buildEvents } from '../events'; import { normalizePath } from '@utils'; diff --git a/src/compiler/build/full-build.ts b/src/compiler/build/full-build.ts index 84222083ba2..25348ee266b 100644 --- a/src/compiler/build/full-build.ts +++ b/src/compiler/build/full-build.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { build } from './build'; import { BuildContext } from './build-ctx'; import { createTsBuildProgram } from '../transpile/create-build-program'; diff --git a/src/compiler/build/validate-files.ts b/src/compiler/build/validate-files.ts index a5c43bd6686..23bd59e67a9 100644 --- a/src/compiler/build/validate-files.ts +++ b/src/compiler/build/validate-files.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { validateBuildPackageJson } from '../types/validate-build-package-json'; import { validateManifestJson } from '../html/validate-manifest-json'; diff --git a/src/compiler/build/write-build.ts b/src/compiler/build/write-build.ts index dad752386ad..bdc2ec7f3c0 100644 --- a/src/compiler/build/write-build.ts +++ b/src/compiler/build/write-build.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { catchError } from '@utils'; import { outputServiceWorkers } from '../output-targets/output-service-workers'; import { validateBuildFiles } from './validate-files'; diff --git a/src/compiler/bundle/app-data-plugin.ts b/src/compiler/bundle/app-data-plugin.ts index 8d7710b8c27..543348fe4d2 100644 --- a/src/compiler/bundle/app-data-plugin.ts +++ b/src/compiler/bundle/app-data-plugin.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import MagicString from 'magic-string'; import { createJsVarName, normalizePath, isString, loadTypeScriptDiagnostics } from '@utils'; import type { Plugin } from 'rollup'; diff --git a/src/compiler/bundle/ext-format-plugin.ts b/src/compiler/bundle/ext-format-plugin.ts index 8543f1a8fae..3c7b40367a9 100644 --- a/src/compiler/bundle/ext-format-plugin.ts +++ b/src/compiler/bundle/ext-format-plugin.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { basename } from 'path'; import { createJsVarName, normalizeFsPathQuery } from '@utils'; import type { Plugin, TransformPluginContext } from 'rollup'; diff --git a/src/compiler/bundle/ext-transforms-plugin.ts b/src/compiler/bundle/ext-transforms-plugin.ts index de34889f560..0e24ed89b47 100644 --- a/src/compiler/bundle/ext-transforms-plugin.ts +++ b/src/compiler/bundle/ext-transforms-plugin.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import type { BundleOptions } from './bundle-interface'; import { hasError, normalizeFsPath } from '@utils'; import { isOutputTargetDistCollection } from '../output-targets/output-utils'; diff --git a/src/compiler/bundle/file-load-plugin.ts b/src/compiler/bundle/file-load-plugin.ts index 6102cabf488..26997e8979d 100644 --- a/src/compiler/bundle/file-load-plugin.ts +++ b/src/compiler/bundle/file-load-plugin.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { normalizeFsPath } from '@utils'; import type { Plugin } from 'rollup'; diff --git a/src/compiler/bundle/plugin-helper.ts b/src/compiler/bundle/plugin-helper.ts index b917113ca22..bfadfe03a54 100644 --- a/src/compiler/bundle/plugin-helper.ts +++ b/src/compiler/bundle/plugin-helper.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { buildError } from '@utils'; import { relative } from 'path'; diff --git a/src/compiler/bundle/test/core-resolve-plugin.spec.ts b/src/compiler/bundle/test/core-resolve-plugin.spec.ts index cf954a7b269..73b8b74b850 100644 --- a/src/compiler/bundle/test/core-resolve-plugin.spec.ts +++ b/src/compiler/bundle/test/core-resolve-plugin.spec.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { createSystem } from '../../../compiler/sys/stencil-sys'; import { getHydratedFlagHead, getStencilInternalModule } from '../core-resolve-plugin'; diff --git a/src/compiler/bundle/typescript-plugin.ts b/src/compiler/bundle/typescript-plugin.ts index 3a8e8b8bb78..50e87b04d38 100644 --- a/src/compiler/bundle/typescript-plugin.ts +++ b/src/compiler/bundle/typescript-plugin.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import type { BundleOptions } from './bundle-interface'; import { getModule } from '../transpile/transpiled-module'; import { isString, normalizeFsPath } from '@utils'; diff --git a/src/compiler/bundle/user-index-plugin.ts b/src/compiler/bundle/user-index-plugin.ts index 86796bd31dc..1352ae8e00c 100644 --- a/src/compiler/bundle/user-index-plugin.ts +++ b/src/compiler/bundle/user-index-plugin.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import type { Plugin } from 'rollup'; import { USER_INDEX_ENTRY_ID } from './entry-alias-ids'; import { join } from 'path'; diff --git a/src/compiler/bundle/worker-plugin.ts b/src/compiler/bundle/worker-plugin.ts index 164230c4957..6f85952a524 100644 --- a/src/compiler/bundle/worker-plugin.ts +++ b/src/compiler/bundle/worker-plugin.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import type { Plugin, TransformResult, PluginContext } from 'rollup'; import { bundleOutput } from './bundle-output'; import { normalizeFsPath, hasError } from '@utils'; diff --git a/src/compiler/config/config-utils.ts b/src/compiler/config/config-utils.ts index 855c2e1d8fe..7456f5da9b3 100644 --- a/src/compiler/config/config-utils.ts +++ b/src/compiler/config/config-utils.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { isAbsolute, join } from 'path'; export const getAbsolutePath = (config: d.Config, dir: string) => { diff --git a/src/compiler/config/outputs/index.ts b/src/compiler/config/outputs/index.ts index c061ef5fdab..c4f53c933f4 100644 --- a/src/compiler/config/outputs/index.ts +++ b/src/compiler/config/outputs/index.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { buildError } from '@utils'; import { VALID_TYPES_NEXT } from '../../output-targets/output-utils'; import { validateCollection } from './validate-collection'; diff --git a/src/compiler/config/outputs/validate-angular.ts b/src/compiler/config/outputs/validate-angular.ts index 19180b2fc0d..267674cb5fc 100644 --- a/src/compiler/config/outputs/validate-angular.ts +++ b/src/compiler/config/outputs/validate-angular.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { isOutputTargetAngular } from '../../output-targets/output-utils'; import { isAbsolute, join } from 'path'; diff --git a/src/compiler/config/outputs/validate-collection.ts b/src/compiler/config/outputs/validate-collection.ts index 86939610a03..eeb580b0d68 100644 --- a/src/compiler/config/outputs/validate-collection.ts +++ b/src/compiler/config/outputs/validate-collection.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { getAbsolutePath } from '../config-utils'; import { isOutputTargetDistCollection } from '../../output-targets/output-utils'; import { join } from 'path'; diff --git a/src/compiler/config/outputs/validate-custom-element-bundle.ts b/src/compiler/config/outputs/validate-custom-element-bundle.ts index 84190508c73..4858e38e80e 100644 --- a/src/compiler/config/outputs/validate-custom-element-bundle.ts +++ b/src/compiler/config/outputs/validate-custom-element-bundle.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { COPY, isOutputTargetDistCustomElementsBundle } from '../../output-targets/output-utils'; import { getAbsolutePath } from '../config-utils'; import { isBoolean } from '@utils'; diff --git a/src/compiler/config/outputs/validate-custom-element.ts b/src/compiler/config/outputs/validate-custom-element.ts index aab57a85b85..7eaf3853254 100644 --- a/src/compiler/config/outputs/validate-custom-element.ts +++ b/src/compiler/config/outputs/validate-custom-element.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { getAbsolutePath } from '../config-utils'; import { isBoolean } from '@utils'; import { isOutputTargetDistCustomElements } from '../../output-targets/output-utils'; diff --git a/src/compiler/config/outputs/validate-custom-output.ts b/src/compiler/config/outputs/validate-custom-output.ts index 43c62d3e4b9..095d40562ed 100644 --- a/src/compiler/config/outputs/validate-custom-output.ts +++ b/src/compiler/config/outputs/validate-custom-output.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { catchError } from '@utils'; import { COPY, isOutputTargetCustom } from '../../output-targets/output-utils'; diff --git a/src/compiler/config/outputs/validate-dist.ts b/src/compiler/config/outputs/validate-dist.ts index 712e6a3e6ef..34b4cfa9a4e 100644 --- a/src/compiler/config/outputs/validate-dist.ts +++ b/src/compiler/config/outputs/validate-dist.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { getAbsolutePath } from '../config-utils'; import { COPY, diff --git a/src/compiler/config/outputs/validate-docs.ts b/src/compiler/config/outputs/validate-docs.ts index d9a262fa65b..70ca43aacf1 100644 --- a/src/compiler/config/outputs/validate-docs.ts +++ b/src/compiler/config/outputs/validate-docs.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { buildError } from '@utils'; import { isAbsolute, join } from 'path'; import { isOutputTargetDocsCustom, isOutputTargetDocsJson, isOutputTargetDocsReadme, isOutputTargetDocsVscode } from '../../output-targets/output-utils'; diff --git a/src/compiler/config/outputs/validate-hydrate-script.ts b/src/compiler/config/outputs/validate-hydrate-script.ts index 6c8fe855b85..3c34b003d1a 100644 --- a/src/compiler/config/outputs/validate-hydrate-script.ts +++ b/src/compiler/config/outputs/validate-hydrate-script.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { DIST_HYDRATE_SCRIPT, isOutputTargetDist, isOutputTargetHydrate, isOutputTargetWww } from '../../output-targets/output-utils'; import { isBoolean, isString } from '@utils'; import { isAbsolute, join } from 'path'; diff --git a/src/compiler/config/outputs/validate-lazy.ts b/src/compiler/config/outputs/validate-lazy.ts index af98eb3a767..ea34911aa41 100644 --- a/src/compiler/config/outputs/validate-lazy.ts +++ b/src/compiler/config/outputs/validate-lazy.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { DIST_LAZY, isOutputTargetDistLazy } from '../../output-targets/output-utils'; import { getAbsolutePath } from '../config-utils'; import { isBoolean } from '@utils'; diff --git a/src/compiler/config/outputs/validate-stats.ts b/src/compiler/config/outputs/validate-stats.ts index a484d5980bb..c523099cc94 100644 --- a/src/compiler/config/outputs/validate-stats.ts +++ b/src/compiler/config/outputs/validate-stats.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { isAbsolute, join } from 'path'; import { STATS, isOutputTargetStats } from '../../output-targets/output-utils'; diff --git a/src/compiler/config/outputs/validate-www.ts b/src/compiler/config/outputs/validate-www.ts index 2e278cc9634..40547cea8ff 100644 --- a/src/compiler/config/outputs/validate-www.ts +++ b/src/compiler/config/outputs/validate-www.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { buildError, isBoolean, isString } from '@utils'; import { COPY, DIST_GLOBAL_STYLES, DIST_LAZY, WWW, isOutputTargetWww, isOutputTargetDist } from '../../output-targets/output-utils'; import { getAbsolutePath } from '../config-utils'; diff --git a/src/compiler/config/test/load-config.spec.ts b/src/compiler/config/test/load-config.spec.ts index 54802088ba5..074e8458412 100644 --- a/src/compiler/config/test/load-config.spec.ts +++ b/src/compiler/config/test/load-config.spec.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { createSystem } from '../../../compiler/sys/stencil-sys'; import { loadConfig } from '../load-config'; import { normalizePath } from '../../../utils'; diff --git a/src/compiler/config/test/validate-config.spec.ts b/src/compiler/config/test/validate-config.spec.ts index 39729ce9a62..cfe58ed3f33 100644 --- a/src/compiler/config/test/validate-config.spec.ts +++ b/src/compiler/config/test/validate-config.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { mockLogger, mockStencilSystem } from '@stencil/core/testing'; import { validateConfig } from '../validate-config'; @@ -316,7 +316,7 @@ describe('validation', () => { }); it('should set taskQueue', () => { - userConfig.taskQueue = 'congestionAsync' + userConfig.taskQueue = 'congestionAsync'; const { config } = validateConfig(userConfig); expect(config.taskQueue).toBe('congestionAsync'); }); diff --git a/src/compiler/config/test/validate-custom.spec.ts b/src/compiler/config/test/validate-custom.spec.ts index 4969df1284f..d9b02b31773 100644 --- a/src/compiler/config/test/validate-custom.spec.ts +++ b/src/compiler/config/test/validate-custom.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { mockConfig } from '@stencil/core/testing'; import { validateConfig } from '../validate-config'; import { buildWarn } from '@utils'; diff --git a/src/compiler/config/test/validate-dev-server.spec.ts b/src/compiler/config/test/validate-dev-server.spec.ts index c6b48b67ba6..12c85e3973d 100644 --- a/src/compiler/config/test/validate-dev-server.spec.ts +++ b/src/compiler/config/test/validate-dev-server.spec.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { normalizePath } from '../../../utils'; import { validateConfig } from '../validate-config'; import path from 'path'; diff --git a/src/compiler/config/test/validate-docs.spec.ts b/src/compiler/config/test/validate-docs.spec.ts index 65798110c1c..86fbf927280 100644 --- a/src/compiler/config/test/validate-docs.spec.ts +++ b/src/compiler/config/test/validate-docs.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { mockConfig } from '@stencil/core/testing'; import { validateConfig } from '../validate-config'; diff --git a/src/compiler/config/test/validate-namespace.spec.ts b/src/compiler/config/test/validate-namespace.spec.ts index 35195ec7f63..391f3ec4ac7 100644 --- a/src/compiler/config/test/validate-namespace.spec.ts +++ b/src/compiler/config/test/validate-namespace.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { validateNamespace } from '../validate-namespace'; describe('validateNamespace', () => { diff --git a/src/compiler/config/test/validate-output-dist.spec.ts b/src/compiler/config/test/validate-output-dist.spec.ts index 43f1ba63f42..82a928a30d0 100644 --- a/src/compiler/config/test/validate-output-dist.spec.ts +++ b/src/compiler/config/test/validate-output-dist.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { validateConfig } from '../validate-config'; import { mockConfig } from '@stencil/core/testing'; import path from 'path'; diff --git a/src/compiler/config/test/validate-output-www.spec.ts b/src/compiler/config/test/validate-output-www.spec.ts index a5c80f1590b..00380f61d59 100644 --- a/src/compiler/config/test/validate-output-www.spec.ts +++ b/src/compiler/config/test/validate-output-www.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { isOutputTargetCopy, isOutputTargetWww } from '../../output-targets/output-utils'; import { validateConfig } from '../validate-config'; import path from 'path'; diff --git a/src/compiler/config/test/validate-paths.spec.ts b/src/compiler/config/test/validate-paths.spec.ts index 4a889f3bed6..216eabc2f69 100644 --- a/src/compiler/config/test/validate-paths.spec.ts +++ b/src/compiler/config/test/validate-paths.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { mockLogger, mockStencilSystem } from '@stencil/core/testing'; import { validateConfig } from '../validate-config'; import path from 'path'; diff --git a/src/compiler/config/test/validate-rollup-config.spec.ts b/src/compiler/config/test/validate-rollup-config.spec.ts index ec5b51ab3e3..b45802dbcd5 100644 --- a/src/compiler/config/test/validate-rollup-config.spec.ts +++ b/src/compiler/config/test/validate-rollup-config.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { validateRollupConfig } from '../validate-rollup-config'; describe('validateStats', () => { diff --git a/src/compiler/config/test/validate-service-worker.spec.ts b/src/compiler/config/test/validate-service-worker.spec.ts index 4e9acf4bf0a..f26bc3d6039 100644 --- a/src/compiler/config/test/validate-service-worker.spec.ts +++ b/src/compiler/config/test/validate-service-worker.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { mockStencilSystem } from '@stencil/core/testing'; import { validateServiceWorker } from '../validate-service-worker'; diff --git a/src/compiler/config/test/validate-stats.spec.ts b/src/compiler/config/test/validate-stats.spec.ts index 985382ec2f5..492d136cba8 100644 --- a/src/compiler/config/test/validate-stats.spec.ts +++ b/src/compiler/config/test/validate-stats.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { mockConfig } from '@stencil/core/testing'; import { validateConfig } from '../validate-config'; diff --git a/src/compiler/config/test/validate-testing.spec.ts b/src/compiler/config/test/validate-testing.spec.ts index 6b476137308..17b340937a1 100644 --- a/src/compiler/config/test/validate-testing.spec.ts +++ b/src/compiler/config/test/validate-testing.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { mockLogger, mockStencilSystem } from '@stencil/core/testing'; import { validateConfig } from '../validate-config'; import path from 'path'; diff --git a/src/compiler/config/test/validate-workers.spec.ts b/src/compiler/config/test/validate-workers.spec.ts index eabd0ae9ae7..07d98f87370 100644 --- a/src/compiler/config/test/validate-workers.spec.ts +++ b/src/compiler/config/test/validate-workers.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { validateConfig } from '../validate-config'; import { mockLogger } from '@stencil/core/testing'; import path from 'path'; diff --git a/src/compiler/config/validate-copy.ts b/src/compiler/config/validate-copy.ts index 3258338bbdd..abae78e5a0c 100644 --- a/src/compiler/config/validate-copy.ts +++ b/src/compiler/config/validate-copy.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { unique } from '@utils'; export const validateCopy = (copy: d.CopyTask[] | boolean, defaultCopy: d.CopyTask[] = []): d.CopyTask[] => { diff --git a/src/compiler/config/validate-dev-server.ts b/src/compiler/config/validate-dev-server.ts index e35d9438f05..90429f9aaf5 100644 --- a/src/compiler/config/validate-dev-server.ts +++ b/src/compiler/config/validate-dev-server.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { buildError, isBoolean, isNumber, isString, normalizePath } from '@utils'; import { isAbsolute, join } from 'path'; import { isOutputTargetWww } from '../output-targets/output-utils'; diff --git a/src/compiler/config/validate-namespace.ts b/src/compiler/config/validate-namespace.ts index 9d414dca790..cfcd70f2f78 100644 --- a/src/compiler/config/validate-namespace.ts +++ b/src/compiler/config/validate-namespace.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { buildError, dashToPascalCase, isString } from '@utils'; import { isOutputTargetDist } from '../output-targets/output-utils'; diff --git a/src/compiler/config/validate-paths.ts b/src/compiler/config/validate-paths.ts index 8bd738a695c..12a2c126c32 100644 --- a/src/compiler/config/validate-paths.ts +++ b/src/compiler/config/validate-paths.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { isAbsolute, join } from 'path'; export const validatePaths = (config: d.Config) => { diff --git a/src/compiler/config/validate-plugins.ts b/src/compiler/config/validate-plugins.ts index 562e6958a90..00cdbc66c2c 100644 --- a/src/compiler/config/validate-plugins.ts +++ b/src/compiler/config/validate-plugins.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { buildWarn } from '@utils'; export const validatePlugins = (config: d.Config, diagnostics: d.Diagnostic[]) => { diff --git a/src/compiler/config/validate-prerender.ts b/src/compiler/config/validate-prerender.ts index 00a9a5a1956..8827d34a881 100644 --- a/src/compiler/config/validate-prerender.ts +++ b/src/compiler/config/validate-prerender.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { buildError, normalizePath } from '@utils'; import { isAbsolute, join } from 'path'; diff --git a/src/compiler/config/validate-rollup-config.ts b/src/compiler/config/validate-rollup-config.ts index 5e8b944f9c9..6a872fbc80b 100644 --- a/src/compiler/config/validate-rollup-config.ts +++ b/src/compiler/config/validate-rollup-config.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { isObject, pluck } from '@utils'; export const validateRollupConfig = (config: d.Config) => { diff --git a/src/compiler/config/validate-service-worker.ts b/src/compiler/config/validate-service-worker.ts index b6df82ad68f..7ca0f6760c4 100644 --- a/src/compiler/config/validate-service-worker.ts +++ b/src/compiler/config/validate-service-worker.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { HOST_CONFIG_FILENAME } from '../prerender/host-config'; import { isAbsolute, join } from 'path'; import { isString } from '@utils'; diff --git a/src/compiler/config/validate-testing.ts b/src/compiler/config/validate-testing.ts index 6779d03febf..c36a1693a01 100644 --- a/src/compiler/config/validate-testing.ts +++ b/src/compiler/config/validate-testing.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { buildError, isString } from '@utils'; import { isAbsolute, join, basename, dirname } from 'path'; import { isLocalModule } from '../sys/resolve/resolve-utils'; diff --git a/src/compiler/config/validate-workers.ts b/src/compiler/config/validate-workers.ts index ee209056d0b..6c4dc4f0f6e 100644 --- a/src/compiler/config/validate-workers.ts +++ b/src/compiler/config/validate-workers.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; export const validateWorkers = (config: d.Config) => { if (typeof config.maxConcurrentWorkers !== 'number') { diff --git a/src/compiler/docs/custom/index.ts b/src/compiler/docs/custom/index.ts index 8e28b9d36de..a357b942d01 100644 --- a/src/compiler/docs/custom/index.ts +++ b/src/compiler/docs/custom/index.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { isOutputTargetDocsCustom } from '../../output-targets/output-utils'; export const generateCustomDocs = async (config: d.Config, docsData: d.JsonDocs, outputTargets: d.OutputTarget[]) => { diff --git a/src/compiler/docs/docs.ts b/src/compiler/docs/docs.ts index cb349c9dee9..7833e33d711 100644 --- a/src/compiler/docs/docs.ts +++ b/src/compiler/docs/docs.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { catchError, hasError, normalizeDiagnostics } from '@utils'; import { BuildContext } from '../build/build-ctx'; import { transpileApp } from '../transpile/transpile-app'; diff --git a/src/compiler/docs/generate-doc-data.ts b/src/compiler/docs/generate-doc-data.ts index 0e74d02a113..7a25fae5991 100644 --- a/src/compiler/docs/generate-doc-data.ts +++ b/src/compiler/docs/generate-doc-data.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { AUTO_GENERATE_COMMENT } from './constants'; import { basename, dirname, join, relative } from 'path'; import { flatOne, normalizePath, sortBy, unique } from '@utils'; diff --git a/src/compiler/docs/json/index.ts b/src/compiler/docs/json/index.ts index 6332e3fd6c5..ab0b20990ff 100644 --- a/src/compiler/docs/json/index.ts +++ b/src/compiler/docs/json/index.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { isOutputTargetDocsJson } from '../../output-targets/output-utils'; import { join } from 'path'; diff --git a/src/compiler/docs/readme/docs-util.ts b/src/compiler/docs/readme/docs-util.ts index 841261d7fad..9e533dcd471 100644 --- a/src/compiler/docs/readme/docs-util.ts +++ b/src/compiler/docs/readme/docs-util.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; export class MarkdownTable { private rows: RowData[] = []; diff --git a/src/compiler/docs/readme/index.ts b/src/compiler/docs/readme/index.ts index 43744c9f92a..a077ed00ec0 100644 --- a/src/compiler/docs/readme/index.ts +++ b/src/compiler/docs/readme/index.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { generateReadme } from './output-docs'; import { isOutputTargetDocsReadme } from '../../output-targets/output-utils'; diff --git a/src/compiler/docs/readme/markdown-css-props.ts b/src/compiler/docs/readme/markdown-css-props.ts index 2f6168d25c2..eaad536586c 100644 --- a/src/compiler/docs/readme/markdown-css-props.ts +++ b/src/compiler/docs/readme/markdown-css-props.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { MarkdownTable } from './docs-util'; export const stylesToMarkdown = (styles: d.JsonDocsStyle[]) => { diff --git a/src/compiler/docs/readme/markdown-dependencies.ts b/src/compiler/docs/readme/markdown-dependencies.ts index ba65e101ddf..e772d673e07 100644 --- a/src/compiler/docs/readme/markdown-dependencies.ts +++ b/src/compiler/docs/readme/markdown-dependencies.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { normalizePath } from '@utils'; import { relative } from 'path'; diff --git a/src/compiler/docs/readme/markdown-events.ts b/src/compiler/docs/readme/markdown-events.ts index 199e03936eb..43bd865815e 100644 --- a/src/compiler/docs/readme/markdown-events.ts +++ b/src/compiler/docs/readme/markdown-events.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { MarkdownTable } from './docs-util'; export const eventsToMarkdown = (events: d.JsonDocsEvent[]) => { diff --git a/src/compiler/docs/readme/markdown-methods.ts b/src/compiler/docs/readme/markdown-methods.ts index 0454c917f21..7373f54df2f 100644 --- a/src/compiler/docs/readme/markdown-methods.ts +++ b/src/compiler/docs/readme/markdown-methods.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { MarkdownTable } from './docs-util'; export const methodsToMarkdown = (methods: d.JsonDocsMethod[]) => { diff --git a/src/compiler/docs/readme/markdown-parts.ts b/src/compiler/docs/readme/markdown-parts.ts index a54c8633a8f..744fc4432ee 100644 --- a/src/compiler/docs/readme/markdown-parts.ts +++ b/src/compiler/docs/readme/markdown-parts.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { MarkdownTable } from './docs-util'; export const partsToMarkdown = (parts: d.JsonDocsSlot[]) => { diff --git a/src/compiler/docs/readme/markdown-props.ts b/src/compiler/docs/readme/markdown-props.ts index d3ee2e20c78..66516f366da 100644 --- a/src/compiler/docs/readme/markdown-props.ts +++ b/src/compiler/docs/readme/markdown-props.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { MarkdownTable } from './docs-util'; export const propsToMarkdown = (props: d.JsonDocsProp[]) => { diff --git a/src/compiler/docs/readme/markdown-slots.ts b/src/compiler/docs/readme/markdown-slots.ts index 4169ff02f7c..ff0ce05204f 100644 --- a/src/compiler/docs/readme/markdown-slots.ts +++ b/src/compiler/docs/readme/markdown-slots.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { MarkdownTable } from './docs-util'; export const slotsToMarkdown = (slots: d.JsonDocsSlot[]) => { diff --git a/src/compiler/docs/readme/markdown-usage.ts b/src/compiler/docs/readme/markdown-usage.ts index 182f882773d..15e2e9325c0 100644 --- a/src/compiler/docs/readme/markdown-usage.ts +++ b/src/compiler/docs/readme/markdown-usage.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { toTitleCase } from '@utils'; export const usageToMarkdown = (usages: d.JsonDocsUsage) => { diff --git a/src/compiler/docs/readme/output-docs.ts b/src/compiler/docs/readme/output-docs.ts index 8b47490675e..f8aeb882baa 100644 --- a/src/compiler/docs/readme/output-docs.ts +++ b/src/compiler/docs/readme/output-docs.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { propsToMarkdown } from './markdown-props'; import { eventsToMarkdown } from './markdown-events'; import { join, relative } from 'path'; diff --git a/src/compiler/docs/style-docs.ts b/src/compiler/docs/style-docs.ts index 393aa6f2883..dee6bc399d7 100644 --- a/src/compiler/docs/style-docs.ts +++ b/src/compiler/docs/style-docs.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; export function parseStyleDocs(styleDocs: d.StyleDoc[], styleText: string) { if (typeof styleText !== 'string') { @@ -36,10 +36,7 @@ function parseCssComment(styleDocs: d.StyleDoc[], comment: string) { return line; }); - comment = lines - .join(' ') - .replace(/\t/g, ' ') - .trim(); + comment = lines.join(' ').replace(/\t/g, ' ').trim(); while (comment.includes(' ')) { comment = comment.replace(' ', ' '); diff --git a/src/compiler/docs/test/style-docs.spec.ts b/src/compiler/docs/test/style-docs.spec.ts index 68510da1bf2..fafb0a9cfad 100644 --- a/src/compiler/docs/test/style-docs.spec.ts +++ b/src/compiler/docs/test/style-docs.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { parseStyleDocs } from '../style-docs'; describe('style-docs', () => { diff --git a/src/compiler/docs/vscode/index.ts b/src/compiler/docs/vscode/index.ts index 5395c61d969..b42748a62b3 100644 --- a/src/compiler/docs/vscode/index.ts +++ b/src/compiler/docs/vscode/index.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { getNameText } from '../generate-doc-data'; import { isOutputTargetDocsVscode } from '../../output-targets/output-utils'; import { join } from 'path'; diff --git a/src/compiler/entries/component-bundles.ts b/src/compiler/entries/component-bundles.ts index e290bc94aa9..6ae118a2a9d 100644 --- a/src/compiler/entries/component-bundles.ts +++ b/src/compiler/entries/component-bundles.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { sortBy } from '@utils'; import { getDefaultBundles } from './default-bundles'; diff --git a/src/compiler/entries/component-graph.ts b/src/compiler/entries/component-graph.ts index 99834f49ce2..2b0a317796e 100644 --- a/src/compiler/entries/component-graph.ts +++ b/src/compiler/entries/component-graph.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { getScopeId } from '../style/scope-css'; export const generateModuleGraph = (cmps: d.ComponentCompilerMeta[], bundleModules: d.BundleModule[]) => { diff --git a/src/compiler/entries/default-bundles.ts b/src/compiler/entries/default-bundles.ts index d202b695a0f..3b81c311549 100644 --- a/src/compiler/entries/default-bundles.ts +++ b/src/compiler/entries/default-bundles.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { buildError, buildWarn, flatOne, unique, validateComponentTag } from '@utils'; import { getUsedComponents } from '../html/used-components'; diff --git a/src/compiler/entries/entry-modules.ts b/src/compiler/entries/entry-modules.ts index 5992b88d87d..a28f735ffa4 100644 --- a/src/compiler/entries/entry-modules.ts +++ b/src/compiler/entries/entry-modules.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { catchError, sortBy } from '@utils'; import { DEFAULT_STYLE_MODE } from '@utils'; import { generateComponentBundles } from './component-bundles'; diff --git a/src/compiler/entries/resolve-component-dependencies.ts b/src/compiler/entries/resolve-component-dependencies.ts index 8602dad0408..9fc1a8c601c 100644 --- a/src/compiler/entries/resolve-component-dependencies.ts +++ b/src/compiler/entries/resolve-component-dependencies.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { flatOne, unique } from '@utils'; export function resolveComponentDependencies(cmps: d.ComponentCompilerMeta[]) { diff --git a/src/compiler/events.ts b/src/compiler/events.ts index af0643eac0a..0133dc2dad2 100644 --- a/src/compiler/events.ts +++ b/src/compiler/events.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; export const buildEvents = (): d.BuildEvents => { const evCallbacks: EventCallback[] = []; diff --git a/src/compiler/fs-watch/fs-watch-rebuild.ts b/src/compiler/fs-watch/fs-watch-rebuild.ts index 4b022d194c3..40aaf6f680e 100644 --- a/src/compiler/fs-watch/fs-watch-rebuild.ts +++ b/src/compiler/fs-watch/fs-watch-rebuild.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { basename } from 'path'; import { unique } from '@utils'; @@ -39,11 +39,7 @@ export const hasStyleChanges = (buildCtx: d.BuildCtx) => { }); }; -const getExt = (filePath: string) => - filePath - .split('.') - .pop() - .toLowerCase(); +const getExt = (filePath: string) => filePath.split('.').pop().toLowerCase(); const SCRIPT_EXT = ['ts', 'tsx', 'js', 'jsx']; export const isScriptExt = (ext: string) => SCRIPT_EXT.includes(ext); diff --git a/src/compiler/html/add-script-attr.ts b/src/compiler/html/add-script-attr.ts index d8e20e3a508..bf2334045aa 100644 --- a/src/compiler/html/add-script-attr.ts +++ b/src/compiler/html/add-script-attr.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { getAbsoluteBuildDir } from './html-utils'; import { join } from 'path'; diff --git a/src/compiler/html/html-utils.ts b/src/compiler/html/html-utils.ts index 6f39dde0eb9..d22ef0025cd 100644 --- a/src/compiler/html/html-utils.ts +++ b/src/compiler/html/html-utils.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { join, relative } from 'path'; export const getAbsoluteBuildDir = (outputTarget: d.OutputTargetWww) => { diff --git a/src/compiler/html/inject-module-preloads.ts b/src/compiler/html/inject-module-preloads.ts index bb72d5e067a..17e5eac455a 100644 --- a/src/compiler/html/inject-module-preloads.ts +++ b/src/compiler/html/inject-module-preloads.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { getAbsoluteBuildDir } from './html-utils'; import { join } from 'path'; diff --git a/src/compiler/html/inject-sw-script.ts b/src/compiler/html/inject-sw-script.ts index e0e2630e43b..4be22b5e663 100644 --- a/src/compiler/html/inject-sw-script.ts +++ b/src/compiler/html/inject-sw-script.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { generateServiceWorkerUrl } from '../service-worker/service-worker-util'; import { UNREGISTER_SW, getRegisterSW } from '../service-worker/generate-sw'; diff --git a/src/compiler/html/inline-esm-import.ts b/src/compiler/html/inline-esm-import.ts index 06d5697a187..bbd492fcf86 100644 --- a/src/compiler/html/inline-esm-import.ts +++ b/src/compiler/html/inline-esm-import.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { getAbsoluteBuildDir } from './html-utils'; import { generateHashedCopy } from '../output-targets/copy/hashed-copy'; import { injectModulePreloads } from './inject-module-preloads'; diff --git a/src/compiler/html/inline-style-sheets.ts b/src/compiler/html/inline-style-sheets.ts index 977b79f98e1..d9226961faa 100644 --- a/src/compiler/html/inline-style-sheets.ts +++ b/src/compiler/html/inline-style-sheets.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { join } from 'path'; export const inlineStyleSheets = (compilerCtx: d.CompilerCtx, doc: Document, maxSize: number, outputTarget: d.OutputTargetWww) => { diff --git a/src/compiler/html/remove-unused-styles.ts b/src/compiler/html/remove-unused-styles.ts index 0d6314f0e43..1091505e1e3 100644 --- a/src/compiler/html/remove-unused-styles.ts +++ b/src/compiler/html/remove-unused-styles.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { getUsedSelectors, UsedSelectors } from '../style/css-parser/used-selectors'; import { hasError, catchError } from '@utils'; import { parseCss } from '../style/css-parser/parse-css'; diff --git a/src/compiler/html/test/remove-unused-styles.spec.ts b/src/compiler/html/test/remove-unused-styles.spec.ts index 3718bfa392e..918e1615e68 100644 --- a/src/compiler/html/test/remove-unused-styles.spec.ts +++ b/src/compiler/html/test/remove-unused-styles.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { mockDocument } from '@stencil/core/testing'; import { removeUnusedStyles } from '../remove-unused-styles'; @@ -271,20 +271,12 @@ describe('removeUnusedStyles', () => { }); function expectSelector(css: string, selector: string) { - selector = selector - .replace(/ \{ /g, '{') - .replace(/ \} /g, '}') - .replace(/\: /g, ':') - .replace(/\; /g, ';'); + selector = selector.replace(/ \{ /g, '{').replace(/ \} /g, '}').replace(/\: /g, ':').replace(/\; /g, ';'); expect(css).toContain(selector); } function expectNoSelector(css: string, selector: string) { - selector = selector - .replace(/ \{ /g, '{') - .replace(/ \} /g, '}') - .replace(/\: /g, ':') - .replace(/\; /g, ';'); + selector = selector.replace(/ \{ /g, '{').replace(/ \} /g, '}').replace(/\: /g, ':').replace(/\; /g, ';'); expect(css).not.toContain(selector); } }); diff --git a/src/compiler/html/update-global-styles-link.ts b/src/compiler/html/update-global-styles-link.ts index 379b24aacf3..1fd44d0568b 100644 --- a/src/compiler/html/update-global-styles-link.ts +++ b/src/compiler/html/update-global-styles-link.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { getAbsoluteBuildDir } from './html-utils'; import { join } from 'path'; diff --git a/src/compiler/html/used-components.ts b/src/compiler/html/used-components.ts index 0c61d5383c0..4eba24a8ac1 100644 --- a/src/compiler/html/used-components.ts +++ b/src/compiler/html/used-components.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; export const getUsedComponents = (doc: Document, cmps: d.ComponentCompilerMeta[]) => { const tags = new Set(cmps.map(cmp => cmp.tagName.toUpperCase())); diff --git a/src/compiler/html/validate-manifest-json.ts b/src/compiler/html/validate-manifest-json.ts index e50101052ae..59986b4a807 100644 --- a/src/compiler/html/validate-manifest-json.ts +++ b/src/compiler/html/validate-manifest-json.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { buildError, buildJsonFileError } from '@utils'; import { dirname, join } from 'path'; import { isOutputTargetWww } from '../output-targets/output-utils'; diff --git a/src/compiler/optimize/autoprefixer.ts b/src/compiler/optimize/autoprefixer.ts index 003f9a10a20..de58cb110ae 100644 --- a/src/compiler/optimize/autoprefixer.ts +++ b/src/compiler/optimize/autoprefixer.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { IS_NODE_ENV, requireFunc } from '@utils'; let cssProcessor: any; diff --git a/src/compiler/optimize/minify-js.ts b/src/compiler/optimize/minify-js.ts index df0a230bb68..3de72784dec 100644 --- a/src/compiler/optimize/minify-js.ts +++ b/src/compiler/optimize/minify-js.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { splitLineBreaks } from '@utils'; import terser, { CompressOptions, MangleOptions, ManglePropertiesOptions, MinifyOptions } from 'terser'; diff --git a/src/compiler/output-targets/copy/assets-copy-tasks.ts b/src/compiler/output-targets/copy/assets-copy-tasks.ts index 0685b744e2f..95f6cc57d0c 100644 --- a/src/compiler/output-targets/copy/assets-copy-tasks.ts +++ b/src/compiler/output-targets/copy/assets-copy-tasks.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { dirname, join, relative } from 'path'; import { normalizePath } from '@utils'; diff --git a/src/compiler/output-targets/copy/hashed-copy.ts b/src/compiler/output-targets/copy/hashed-copy.ts index f5e4a31bf97..261388cef2d 100644 --- a/src/compiler/output-targets/copy/hashed-copy.ts +++ b/src/compiler/output-targets/copy/hashed-copy.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { dirname, extname, join } from 'path'; export const generateHashedCopy = async (config: d.Config, compilerCtx: d.CompilerCtx, path: string) => { diff --git a/src/compiler/output-targets/copy/local-copy-tasks.ts b/src/compiler/output-targets/copy/local-copy-tasks.ts index 98d112ec206..22771e7cf2a 100644 --- a/src/compiler/output-targets/copy/local-copy-tasks.ts +++ b/src/compiler/output-targets/copy/local-copy-tasks.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { isAbsolute, join } from 'path'; export const getSrcAbsPath = (config: d.Config, src: string) => { diff --git a/src/compiler/output-targets/copy/output-copy.ts b/src/compiler/output-targets/copy/output-copy.ts index 8ab3c4d1a79..e515e9c601f 100644 --- a/src/compiler/output-targets/copy/output-copy.ts +++ b/src/compiler/output-targets/copy/output-copy.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { buildError, isGlob, normalizePath } from '@utils'; import { canSkipAssetsCopy, getComponentAssetsCopyTasks } from './assets-copy-tasks'; import { getDestAbsPath, getSrcAbsPath } from './local-copy-tasks'; diff --git a/src/compiler/output-targets/dist-collection/index.ts b/src/compiler/output-targets/dist-collection/index.ts index a5477d4b04c..40df545347d 100644 --- a/src/compiler/output-targets/dist-collection/index.ts +++ b/src/compiler/output-targets/dist-collection/index.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { catchError } from '@utils'; import { isOutputTargetDistCollection } from '../output-utils'; import { join, relative } from 'path'; diff --git a/src/compiler/output-targets/dist-custom-elements-bundle/custom-elements-build-conditionals.ts b/src/compiler/output-targets/dist-custom-elements-bundle/custom-elements-build-conditionals.ts index 3380311affe..262a99d3e79 100644 --- a/src/compiler/output-targets/dist-custom-elements-bundle/custom-elements-build-conditionals.ts +++ b/src/compiler/output-targets/dist-custom-elements-bundle/custom-elements-build-conditionals.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { getBuildFeatures, updateBuildConditionals } from '../../app-core/app-data'; export const getCustomElementsBuildConditionals = (config: d.Config, cmps: d.ComponentCompilerMeta[]) => { diff --git a/src/compiler/output-targets/dist-custom-elements-bundle/custom-elements-types.ts b/src/compiler/output-targets/dist-custom-elements-bundle/custom-elements-types.ts index 498f6e9de66..892edab8d89 100644 --- a/src/compiler/output-targets/dist-custom-elements-bundle/custom-elements-types.ts +++ b/src/compiler/output-targets/dist-custom-elements-bundle/custom-elements-types.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { isOutputTargetDistCustomElementsBundle } from '../output-utils'; import { dirname, join, relative } from 'path'; import { normalizePath, dashToPascalCase } from '@utils'; diff --git a/src/compiler/output-targets/dist-custom-elements-bundle/index.ts b/src/compiler/output-targets/dist-custom-elements-bundle/index.ts index 791f51c6a25..fd14d534d58 100644 --- a/src/compiler/output-targets/dist-custom-elements-bundle/index.ts +++ b/src/compiler/output-targets/dist-custom-elements-bundle/index.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import type { BundleOptions } from '../../bundle/bundle-interface'; import { bundleOutput } from '../../bundle/bundle-output'; import { catchError, dashToPascalCase, formatComponentRuntimeMeta, hasError, stringifyRuntimeData } from '@utils'; diff --git a/src/compiler/output-targets/dist-custom-elements/index.ts b/src/compiler/output-targets/dist-custom-elements/index.ts index 1463f5c181b..f439e53dd23 100644 --- a/src/compiler/output-targets/dist-custom-elements/index.ts +++ b/src/compiler/output-targets/dist-custom-elements/index.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { catchError } from '@utils'; import { isOutputTargetDistCustomElements } from '../output-utils'; import { nativeComponentTransform } from '../../transformers/component-native/tranform-to-native-component'; diff --git a/src/compiler/output-targets/dist-hydrate-script/bundle-hydrate-factory.ts b/src/compiler/output-targets/dist-hydrate-script/bundle-hydrate-factory.ts index 676266e2b56..1066e583247 100644 --- a/src/compiler/output-targets/dist-hydrate-script/bundle-hydrate-factory.ts +++ b/src/compiler/output-targets/dist-hydrate-script/bundle-hydrate-factory.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import type { BundleOptions } from '../../bundle/bundle-interface'; import { bundleOutput } from '../../bundle/bundle-output'; import { getHydrateBuildConditionals } from './hydrate-build-conditionals'; diff --git a/src/compiler/output-targets/dist-hydrate-script/generate-hydrate-app.ts b/src/compiler/output-targets/dist-hydrate-script/generate-hydrate-app.ts index 38b9d906d5d..f494ca071a6 100644 --- a/src/compiler/output-targets/dist-hydrate-script/generate-hydrate-app.ts +++ b/src/compiler/output-targets/dist-hydrate-script/generate-hydrate-app.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { bundleHydrateFactory } from './bundle-hydrate-factory'; import { catchError, createOnWarnFn, loadRollupDiagnostics } from '@utils'; import { getBuildFeatures, updateBuildConditionals } from '../../app-core/app-data'; diff --git a/src/compiler/output-targets/dist-hydrate-script/hydrate-build-conditionals.ts b/src/compiler/output-targets/dist-hydrate-script/hydrate-build-conditionals.ts index 2150ccfb2e8..132c080a4fa 100644 --- a/src/compiler/output-targets/dist-hydrate-script/hydrate-build-conditionals.ts +++ b/src/compiler/output-targets/dist-hydrate-script/hydrate-build-conditionals.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { getBuildFeatures } from '../../app-core/app-data'; export const getHydrateBuildConditionals = (cmps: d.ComponentCompilerMeta[]) => { diff --git a/src/compiler/output-targets/dist-hydrate-script/index.ts b/src/compiler/output-targets/dist-hydrate-script/index.ts index cc7f7f3b5bc..eecb8ad01b2 100644 --- a/src/compiler/output-targets/dist-hydrate-script/index.ts +++ b/src/compiler/output-targets/dist-hydrate-script/index.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { generateHydrateApp } from './generate-hydrate-app'; import { isOutputTargetHydrate } from '../output-utils'; @@ -6,7 +6,7 @@ export const outputHydrateScript = async (config: d.Config, compilerCtx: d.Compi if (!config.buildDist) { return; } - + const hydrateOutputTargets = config.outputTargets.filter(isOutputTargetHydrate); if (hydrateOutputTargets.length > 0) { const timespan = buildCtx.createTimeSpan(`generate hydrate app started`); diff --git a/src/compiler/output-targets/dist-hydrate-script/relocate-hydrate-context.ts b/src/compiler/output-targets/dist-hydrate-script/relocate-hydrate-context.ts index 698161e3d5d..7a6b9ede0fc 100644 --- a/src/compiler/output-targets/dist-hydrate-script/relocate-hydrate-context.ts +++ b/src/compiler/output-targets/dist-hydrate-script/relocate-hydrate-context.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { getGlobalScriptData } from '../../bundle/app-data-plugin'; import { HYDRATE_APP_CLOSURE_START } from './hydrate-factory-closure'; diff --git a/src/compiler/output-targets/dist-hydrate-script/update-to-hydrate-components.ts b/src/compiler/output-targets/dist-hydrate-script/update-to-hydrate-components.ts index fe23063bf50..b80495333be 100644 --- a/src/compiler/output-targets/dist-hydrate-script/update-to-hydrate-components.ts +++ b/src/compiler/output-targets/dist-hydrate-script/update-to-hydrate-components.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { dashToPascalCase, sortBy, toTitleCase } from '@utils'; export const updateToHydrateComponents = async (cmps: d.ComponentCompilerMeta[]) => { diff --git a/src/compiler/output-targets/dist-hydrate-script/write-hydrate-outputs.ts b/src/compiler/output-targets/dist-hydrate-script/write-hydrate-outputs.ts index 4e84517d296..f9ae9fe9251 100644 --- a/src/compiler/output-targets/dist-hydrate-script/write-hydrate-outputs.ts +++ b/src/compiler/output-targets/dist-hydrate-script/write-hydrate-outputs.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { basename, join } from 'path'; import { relocateHydrateContextConst } from './relocate-hydrate-context'; import type { RollupOutput } from 'rollup'; diff --git a/src/compiler/output-targets/dist-lazy/generate-cjs.ts b/src/compiler/output-targets/dist-lazy/generate-cjs.ts index 66258c0a342..f11b621361a 100644 --- a/src/compiler/output-targets/dist-lazy/generate-cjs.ts +++ b/src/compiler/output-targets/dist-lazy/generate-cjs.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { generateRollupOutput } from '../../app-core/bundle-app-core'; import { generateLazyModules } from './generate-lazy-module'; import { join } from 'path'; diff --git a/src/compiler/output-targets/dist-lazy/generate-esm-browser.ts b/src/compiler/output-targets/dist-lazy/generate-esm-browser.ts index 76187ee1fd1..78c1cef42f8 100644 --- a/src/compiler/output-targets/dist-lazy/generate-esm-browser.ts +++ b/src/compiler/output-targets/dist-lazy/generate-esm-browser.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { generateRollupOutput } from '../../app-core/bundle-app-core'; import { generateLazyModules } from './generate-lazy-module'; import type { OutputOptions, RollupBuild } from 'rollup'; diff --git a/src/compiler/output-targets/dist-lazy/generate-esm.ts b/src/compiler/output-targets/dist-lazy/generate-esm.ts index 34498d8f63e..3b89ef3cfb2 100644 --- a/src/compiler/output-targets/dist-lazy/generate-esm.ts +++ b/src/compiler/output-targets/dist-lazy/generate-esm.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { generateLazyModules } from './generate-lazy-module'; import { generateRollupOutput } from '../../app-core/bundle-app-core'; import { join } from 'path'; diff --git a/src/compiler/output-targets/dist-lazy/generate-lazy-module.ts b/src/compiler/output-targets/dist-lazy/generate-lazy-module.ts index b99ceb5623a..4d1f2da9b10 100644 --- a/src/compiler/output-targets/dist-lazy/generate-lazy-module.ts +++ b/src/compiler/output-targets/dist-lazy/generate-lazy-module.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { writeLazyModule } from './write-lazy-entry-module'; import { formatComponentRuntimeMeta, stringifyRuntimeData, hasDependency } from '@utils'; import { optimizeModule } from '../../optimize/optimize-module'; diff --git a/src/compiler/output-targets/dist-lazy/generate-system.ts b/src/compiler/output-targets/dist-lazy/generate-system.ts index 38a60f71444..e2226fe4b7c 100644 --- a/src/compiler/output-targets/dist-lazy/generate-system.ts +++ b/src/compiler/output-targets/dist-lazy/generate-system.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { generateRollupOutput } from '../../app-core/bundle-app-core'; import { generateLazyModules } from './generate-lazy-module'; import { getAppBrowserCorePolyfills } from '../../app-core/app-polyfills'; diff --git a/src/compiler/output-targets/dist-lazy/lazy-build-conditionals.ts b/src/compiler/output-targets/dist-lazy/lazy-build-conditionals.ts index ccfb61192b1..e37e60cf688 100644 --- a/src/compiler/output-targets/dist-lazy/lazy-build-conditionals.ts +++ b/src/compiler/output-targets/dist-lazy/lazy-build-conditionals.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { getBuildFeatures, updateBuildConditionals } from '../../app-core/app-data'; import { isOutputTargetHydrate } from '../output-utils'; diff --git a/src/compiler/output-targets/dist-lazy/lazy-component-plugin.ts b/src/compiler/output-targets/dist-lazy/lazy-component-plugin.ts index e1fcafb0580..3c2641cca8b 100644 --- a/src/compiler/output-targets/dist-lazy/lazy-component-plugin.ts +++ b/src/compiler/output-targets/dist-lazy/lazy-component-plugin.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { normalizePath } from '@utils'; import type { Plugin } from 'rollup'; diff --git a/src/compiler/output-targets/dist-lazy/lazy-output.ts b/src/compiler/output-targets/dist-lazy/lazy-output.ts index 1e5a7f545ad..6816830973f 100644 --- a/src/compiler/output-targets/dist-lazy/lazy-output.ts +++ b/src/compiler/output-targets/dist-lazy/lazy-output.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import type { BundleOptions } from '../../bundle/bundle-interface'; import { bundleOutput } from '../../bundle/bundle-output'; import { catchError } from '@utils'; diff --git a/src/compiler/output-targets/dist-lazy/write-lazy-entry-module.ts b/src/compiler/output-targets/dist-lazy/write-lazy-entry-module.ts index 227cf359919..7a75e1ce97d 100644 --- a/src/compiler/output-targets/dist-lazy/write-lazy-entry-module.ts +++ b/src/compiler/output-targets/dist-lazy/write-lazy-entry-module.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { join } from 'path'; export const writeLazyModule = async ( diff --git a/src/compiler/output-targets/docs/output-docs.ts b/src/compiler/output-targets/docs/output-docs.ts index f9651561d7e..c6713d6e035 100644 --- a/src/compiler/output-targets/docs/output-docs.ts +++ b/src/compiler/output-targets/docs/output-docs.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { generateDocData } from '../../../compiler/docs/generate-doc-data'; import { isOutputTargetCustom, diff --git a/src/compiler/output-targets/empty-dir.ts b/src/compiler/output-targets/empty-dir.ts index e5ebcac4bbe..f094f4a94f2 100644 --- a/src/compiler/output-targets/empty-dir.ts +++ b/src/compiler/output-targets/empty-dir.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { isOutputTargetDist, isOutputTargetDistLazyLoader, diff --git a/src/compiler/output-targets/index.ts b/src/compiler/output-targets/index.ts index f34a80155c3..cd2af0f0277 100644 --- a/src/compiler/output-targets/index.ts +++ b/src/compiler/output-targets/index.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { outputAngular } from './output-angular'; import { outputCopy } from './copy/output-copy'; import { outputCustomElements } from './dist-custom-elements'; diff --git a/src/compiler/output-targets/output-angular.ts b/src/compiler/output-targets/output-angular.ts index a8618772782..b1c57527015 100644 --- a/src/compiler/output-targets/output-angular.ts +++ b/src/compiler/output-targets/output-angular.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { dashToPascalCase, sortBy } from '@utils'; import { dirname, join } from 'path'; import ts from 'typescript'; @@ -153,7 +153,7 @@ const generateAngularArray = (compilerCtx: d.CompilerCtx, components: d.Componen .join(',\n'); const c = ` -import * as d from '${proxyPath}'; +import type * as d from '${proxyPath}'; export const DIRECTIVES = [ ${directives} diff --git a/src/compiler/output-targets/output-collection.ts b/src/compiler/output-targets/output-collection.ts index e5b7e170f77..7d3a51f602a 100644 --- a/src/compiler/output-targets/output-collection.ts +++ b/src/compiler/output-targets/output-collection.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { COLLECTION_MANIFEST_FILE_NAME, flatOne, normalizePath, sortBy } from '@utils'; import { isOutputTargetDistCollection } from './output-utils'; import { join, relative } from 'path'; diff --git a/src/compiler/output-targets/output-custom.ts b/src/compiler/output-targets/output-custom.ts index 4c560889a36..eeabe426e52 100644 --- a/src/compiler/output-targets/output-custom.ts +++ b/src/compiler/output-targets/output-custom.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { catchError } from '@utils'; import { isOutputTargetCustom } from './output-utils'; diff --git a/src/compiler/output-targets/output-docs.ts b/src/compiler/output-targets/output-docs.ts index ca4e84da520..2aa10c8c07c 100644 --- a/src/compiler/output-targets/output-docs.ts +++ b/src/compiler/output-targets/output-docs.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { generateDocData } from '../docs/generate-doc-data'; import { generateCustomDocs } from '../docs/custom'; import { generateJsonDocs } from '../docs/json'; diff --git a/src/compiler/output-targets/output-lazy-loader.ts b/src/compiler/output-targets/output-lazy-loader.ts index a34ac50cc12..6929e12e1b0 100644 --- a/src/compiler/output-targets/output-lazy-loader.ts +++ b/src/compiler/output-targets/output-lazy-loader.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { getClientPolyfill } from '../app-core/app-polyfills'; import { isOutputTargetDistLazyLoader, relativeImport } from './output-utils'; import { join, relative } from 'path'; diff --git a/src/compiler/output-targets/output-service-workers.ts b/src/compiler/output-targets/output-service-workers.ts index b3fa6a8291f..4cf7bea1856 100644 --- a/src/compiler/output-targets/output-service-workers.ts +++ b/src/compiler/output-targets/output-service-workers.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { generateServiceWorker } from '../service-worker/generate-sw'; import { isOutputTargetWww } from './output-utils'; diff --git a/src/compiler/output-targets/output-types.ts b/src/compiler/output-targets/output-types.ts index 7e8fd6e272b..d28df349c47 100644 --- a/src/compiler/output-targets/output-types.ts +++ b/src/compiler/output-targets/output-types.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { generateTypes } from '../types/generate-types'; import { isOutputTargetDistTypes } from './output-utils'; diff --git a/src/compiler/output-targets/output-utils.ts b/src/compiler/output-targets/output-utils.ts index 0775aa8523a..b1a38e3b6b3 100644 --- a/src/compiler/output-targets/output-utils.ts +++ b/src/compiler/output-targets/output-utils.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { basename, dirname, join, relative } from 'path'; import { flatOne, normalizePath, sortBy } from '@utils'; diff --git a/src/compiler/output-targets/output-www.ts b/src/compiler/output-targets/output-www.ts index 2fc5305def0..53874b27eba 100644 --- a/src/compiler/output-targets/output-www.ts +++ b/src/compiler/output-targets/output-www.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { addScriptDataAttribute } from '../html/add-script-attr'; import { catchError, flatOne, unique } from '@utils'; import { cloneDocument, serializeNodeToHtml } from '@stencil/core/mock-doc'; diff --git a/src/compiler/output-targets/test/build-conditionals.spec.ts b/src/compiler/output-targets/test/build-conditionals.spec.ts index dfaaacf2905..1acac251482 100644 --- a/src/compiler/output-targets/test/build-conditionals.spec.ts +++ b/src/compiler/output-targets/test/build-conditionals.spec.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { getLazyBuildConditionals } from '../dist-lazy/lazy-build-conditionals'; import { getCustomElementsBuildConditionals } from '../dist-custom-elements-bundle/custom-elements-build-conditionals'; import { mockConfig } from '@stencil/core/testing'; diff --git a/src/compiler/output-targets/test/output-targets-www-dist.spec.ts b/src/compiler/output-targets/test/output-targets-www-dist.spec.ts index 14316c288ce..7181430c250 100644 --- a/src/compiler/output-targets/test/output-targets-www-dist.spec.ts +++ b/src/compiler/output-targets/test/output-targets-www-dist.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { doNotExpectFiles, expectFiles } from '../../../testing/testing-utils'; import { Compiler, Config } from '@stencil/core/compiler'; import { mockConfig } from '@stencil/core/testing'; diff --git a/src/compiler/plugin/plugin.ts b/src/compiler/plugin/plugin.ts index eb01b41582a..331cab55bc2 100644 --- a/src/compiler/plugin/plugin.ts +++ b/src/compiler/plugin/plugin.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { basename, relative } from 'path'; import { buildError, catchError, isFunction, isString } from '@utils'; import { isOutputTargetDocs } from '../output-targets/output-utils'; diff --git a/src/compiler/plugin/test/plugin.spec.ts b/src/compiler/plugin/test/plugin.spec.ts index dfadf0256de..d6642244548 100644 --- a/src/compiler/plugin/test/plugin.spec.ts +++ b/src/compiler/plugin/test/plugin.spec.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { createCompiler } from '@stencil/core/compiler'; import { mockConfig } from '@stencil/core/testing'; import { normalizePath } from '@utils'; @@ -44,7 +44,7 @@ xdescribe('plugin', () => { function myPlugin() { return { - transform: function(sourceText: string) { + transform: function (sourceText: string) { return new Promise(resolve => { sourceText += `\nconsole.log('transformed!')`; resolve(sourceText); diff --git a/src/compiler/prerender/crawl-urls.ts b/src/compiler/prerender/crawl-urls.ts index e4a7ef52612..572fc4f45f2 100644 --- a/src/compiler/prerender/crawl-urls.ts +++ b/src/compiler/prerender/crawl-urls.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { catchError } from '@utils'; export const crawlAnchorsForNextUrls = ( diff --git a/src/compiler/prerender/host-config.ts b/src/compiler/prerender/host-config.ts index 2a4de6d6823..1b5cae83208 100644 --- a/src/compiler/prerender/host-config.ts +++ b/src/compiler/prerender/host-config.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { join, relative } from 'path'; export const generateHostConfig = async ( diff --git a/src/compiler/prerender/prerender-config.ts b/src/compiler/prerender/prerender-config.ts index 99d1f0abb35..78abd511a28 100644 --- a/src/compiler/prerender/prerender-config.ts +++ b/src/compiler/prerender/prerender-config.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { catchError, requireFunc, loadTypeScriptDiagnostics, IS_NODE_ENV } from '@utils'; import { resolve } from 'path'; diff --git a/src/compiler/prerender/prerender-hydrate-options.ts b/src/compiler/prerender/prerender-hydrate-options.ts index 5f37d6c21fc..058860a3e06 100644 --- a/src/compiler/prerender/prerender-hydrate-options.ts +++ b/src/compiler/prerender/prerender-hydrate-options.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { catchError } from '@utils'; export const getHydrateOptions = (prerenderConfig: d.PrerenderConfig, url: URL, diagnostics: d.Diagnostic[]) => { diff --git a/src/compiler/prerender/prerender-optimize.ts b/src/compiler/prerender/prerender-optimize.ts index 72d4403b4d8..73aaaa3d74f 100644 --- a/src/compiler/prerender/prerender-optimize.ts +++ b/src/compiler/prerender/prerender-optimize.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { flatOne, unique } from '@utils'; import { getScopeId } from '../style/scope-css'; import { injectModulePreloads } from '../html/inject-module-preloads'; diff --git a/src/compiler/prerender/prerender-queue.ts b/src/compiler/prerender/prerender-queue.ts index bf38fade822..74a1cc82878 100644 --- a/src/compiler/prerender/prerender-queue.ts +++ b/src/compiler/prerender/prerender-queue.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { buildError, catchError } from '@utils'; import { crawlAnchorsForNextUrls } from './crawl-urls'; import { getWriteFilePathFromUrlPath } from './prerendered-write-path'; diff --git a/src/compiler/prerender/prerender-template-html.ts b/src/compiler/prerender/prerender-template-html.ts index 56eeafcf98e..261523e4493 100644 --- a/src/compiler/prerender/prerender-template-html.ts +++ b/src/compiler/prerender/prerender-template-html.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { catchError, isPromise } from '@utils'; import { hasStencilScript, inlineExternalStyleSheets, minifyScriptElements, minifyStyleElements, removeStencilScripts } from './prerender-optimize'; import { createDocument, serializeNodeToHtml } from '@stencil/core/mock-doc'; diff --git a/src/compiler/prerender/prerendered-write-path.ts b/src/compiler/prerender/prerendered-write-path.ts index 640eb3e9e3e..b092c581493 100644 --- a/src/compiler/prerender/prerendered-write-path.ts +++ b/src/compiler/prerender/prerendered-write-path.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import path from 'path'; export const getWriteFilePathFromUrlPath = (manager: d.PrerenderManager, inputHref: string) => { diff --git a/src/compiler/prerender/robots-txt.ts b/src/compiler/prerender/robots-txt.ts index fe4a2f8edc5..25c9cb91ff3 100644 --- a/src/compiler/prerender/robots-txt.ts +++ b/src/compiler/prerender/robots-txt.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { catchError } from '@utils'; import { getSitemapUrls } from './sitemap-xml'; import { join } from 'path'; diff --git a/src/compiler/prerender/sitemap-xml.ts b/src/compiler/prerender/sitemap-xml.ts index 6bb91304757..1089dfb383a 100644 --- a/src/compiler/prerender/sitemap-xml.ts +++ b/src/compiler/prerender/sitemap-xml.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { catchError } from '@utils'; import { join } from 'path'; diff --git a/src/compiler/prerender/test/crawl-urls.spec.ts b/src/compiler/prerender/test/crawl-urls.spec.ts index 7556baa4ffc..245c1c2c6c7 100644 --- a/src/compiler/prerender/test/crawl-urls.spec.ts +++ b/src/compiler/prerender/test/crawl-urls.spec.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { crawlAnchorsForNextUrls } from '../crawl-urls'; describe('crawlAnchorsForNextUrls', () => { diff --git a/src/compiler/prerender/test/prerendered-write-path.spec.ts b/src/compiler/prerender/test/prerendered-write-path.spec.ts index 691647438d3..07e5e9bb20b 100644 --- a/src/compiler/prerender/test/prerendered-write-path.spec.ts +++ b/src/compiler/prerender/test/prerendered-write-path.spec.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { getWriteFilePathFromUrlPath } from '../prerendered-write-path'; import { mockConfig } from '@stencil/core/testing'; import { validateWww } from '../../config/outputs/validate-www'; diff --git a/src/compiler/service-worker/generate-sw.ts b/src/compiler/service-worker/generate-sw.ts index 2bd1d756b3c..3d689acd7aa 100644 --- a/src/compiler/service-worker/generate-sw.ts +++ b/src/compiler/service-worker/generate-sw.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { basename } from 'path'; import { buildWarn, catchError } from '@utils'; import { isOutputTargetWww } from '../output-targets/output-utils'; diff --git a/src/compiler/service-worker/service-worker-util.ts b/src/compiler/service-worker/service-worker-util.ts index f1484a0fa9a..34757ada673 100644 --- a/src/compiler/service-worker/service-worker-util.ts +++ b/src/compiler/service-worker/service-worker-util.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { normalizePath } from '@utils'; import { relative } from 'path'; diff --git a/src/compiler/service-worker/test/service-worker-util.spec.ts b/src/compiler/service-worker/test/service-worker-util.spec.ts index 9da551ab8c8..3268b19c790 100644 --- a/src/compiler/service-worker/test/service-worker-util.spec.ts +++ b/src/compiler/service-worker/test/service-worker-util.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { generateServiceWorkerUrl } from '../service-worker-util'; import { validateConfig } from '../../config/validate-config'; import { mockConfig } from '@stencil/core/testing'; diff --git a/src/compiler/service-worker/test/service-worker.spec.ts b/src/compiler/service-worker/test/service-worker.spec.ts index b4c300f1f81..bd2fb251a38 100644 --- a/src/compiler/service-worker/test/service-worker.spec.ts +++ b/src/compiler/service-worker/test/service-worker.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { Compiler, Config } from '@stencil/core/compiler'; import { mockConfig } from '@stencil/core/testing'; import path from 'path'; diff --git a/src/compiler/style/css-imports.ts b/src/compiler/style/css-imports.ts index 54f1967f7ec..18c828f7918 100644 --- a/src/compiler/style/css-imports.ts +++ b/src/compiler/style/css-imports.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { basename, dirname, isAbsolute, join, relative } from 'path'; import { buildError, normalizePath } from '@utils'; import { getModuleId } from '../sys/resolve/resolve-utils'; diff --git a/src/compiler/style/css-parser/css-parse-declarations.d.ts b/src/compiler/style/css-parser/css-parse-declarations.d.ts index ccdfe02c5e2..83948e50847 100644 --- a/src/compiler/style/css-parser/css-parse-declarations.d.ts +++ b/src/compiler/style/css-parser/css-parse-declarations.d.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { UsedSelectors } from './used-selectors'; export interface ParseCssResults { diff --git a/src/compiler/style/css-parser/parse-css.ts b/src/compiler/style/css-parser/parse-css.ts index 67de063095a..c3052479b40 100644 --- a/src/compiler/style/css-parser/parse-css.ts +++ b/src/compiler/style/css-parser/parse-css.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { ParseCssResults, CssNode, CssParsePosition } from './css-parse-declarations'; export const parseCss = (css: string, filePath?: string): ParseCssResults => { @@ -159,11 +159,11 @@ export const parseCss = (css: string, filePath?: string): ParseCssResults => { return trim(m[0]) .replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g, '') - .replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g, function(m) { + .replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g, function (m) { return m.replace(/,/g, '\u200C'); }) .split(/\s*(?![^(]*\)),\s*/) - .map(function(s) { + .map(function (s) { return s.replace(/\u200C/g, ','); }); }; @@ -471,7 +471,7 @@ const addParent = (obj?: any, parent?: any) => { for (const k in obj) { const value = obj[k]; if (Array.isArray(value)) { - value.forEach(function(v) { + value.forEach(function (v) { addParent(v, childParent); }); } else if (value && typeof value === 'object') { diff --git a/src/compiler/style/global-styles.ts b/src/compiler/style/global-styles.ts index 1011e2b6ec6..45d1e3f4e69 100644 --- a/src/compiler/style/global-styles.ts +++ b/src/compiler/style/global-styles.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { catchError, normalizePath } from '@utils'; import { getCssImports } from './css-imports'; import { isOutputTargetDistGlobalStyles } from '../output-targets/output-utils'; diff --git a/src/compiler/style/normalize-styles.ts b/src/compiler/style/normalize-styles.ts index d857c1ba7a2..dc2cddd264f 100644 --- a/src/compiler/style/normalize-styles.ts +++ b/src/compiler/style/normalize-styles.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { DEFAULT_STYLE_MODE, normalizePath } from '@utils'; import { dirname, isAbsolute, join, relative } from 'path'; diff --git a/src/compiler/style/optimize-css.ts b/src/compiler/style/optimize-css.ts index 2147d15eee2..db6a889cd61 100644 --- a/src/compiler/style/optimize-css.ts +++ b/src/compiler/style/optimize-css.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { optimizeCssId } from '../../version'; import { hasError, normalizePath } from '@utils'; diff --git a/src/compiler/style/style-utils.ts b/src/compiler/style/style-utils.ts index cbe4e1a5e47..ad713af2779 100644 --- a/src/compiler/style/style-utils.ts +++ b/src/compiler/style/style-utils.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; export const getStyleId = (cmp: d.ComponentCompilerMeta, modeName: string, isScopedStyles: boolean) => { return `${cmp.tagName}${modeName}${isScopedStyles ? '.sc' : ''}`; diff --git a/src/compiler/style/test/css-imports.spec.ts b/src/compiler/style/test/css-imports.spec.ts index c53a2b0ea56..eef1154e11a 100644 --- a/src/compiler/style/test/css-imports.spec.ts +++ b/src/compiler/style/test/css-imports.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { getCssImports, isCssNodeModule, isLocalCssImport, replaceImportDeclarations } from '../css-imports'; import { mockBuildCtx, mockConfig, mockCompilerCtx } from '@stencil/core/testing'; import { normalizePath } from '@utils'; @@ -417,5 +417,4 @@ describe('css-imports', () => { expect(results).toEqual([]); }); }); - }); diff --git a/src/compiler/style/test/optimize-css.spec.ts b/src/compiler/style/test/optimize-css.spec.ts index ef7ff1a5cd7..1a768c8f195 100644 --- a/src/compiler/style/test/optimize-css.spec.ts +++ b/src/compiler/style/test/optimize-css.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { optimizeCss } from '../optimize-css'; import { mockCompilerCtx, mockConfig } from '@stencil/core/testing'; import path from 'path'; diff --git a/src/compiler/style/test/style-rebuild.spec.ts b/src/compiler/style/test/style-rebuild.spec.ts index 660d70c16f1..437405224be 100644 --- a/src/compiler/style/test/style-rebuild.spec.ts +++ b/src/compiler/style/test/style-rebuild.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { createCompiler, validateConfig } from '@stencil/core/compiler'; import { mockConfig, mockLogger, mockStencilSystem } from '@stencil/core/testing'; import path from 'path'; diff --git a/src/compiler/sys/config.ts b/src/compiler/sys/config.ts index 7595111982c..bb66a106f97 100644 --- a/src/compiler/sys/config.ts +++ b/src/compiler/sys/config.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { createLogger } from './logger/console-logger'; import { createSystem } from './stencil-sys'; import { setPlatformPath } from '../sys/modules/path'; diff --git a/src/compiler/sys/fetch/fetch-module-async.ts b/src/compiler/sys/fetch/fetch-module-async.ts index af1b9c50f86..d37933e11df 100644 --- a/src/compiler/sys/fetch/fetch-module-async.ts +++ b/src/compiler/sys/fetch/fetch-module-async.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { known404Urls, httpFetch } from './fetch-utils'; import { skipFilePathFetch, skipUrlFetch } from './fetch-utils'; import { writeFetchSuccessAsync } from './write-fetch-success'; diff --git a/src/compiler/sys/fetch/fetch-module-sync.ts b/src/compiler/sys/fetch/fetch-module-sync.ts index 203f80d1105..7b0e40573c9 100644 --- a/src/compiler/sys/fetch/fetch-module-sync.ts +++ b/src/compiler/sys/fetch/fetch-module-sync.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { known404Urls } from './fetch-utils'; import { isString } from '@utils'; import { skipFilePathFetch, skipUrlFetch } from './fetch-utils'; diff --git a/src/compiler/sys/fetch/tests/fetch-module.spec.ts b/src/compiler/sys/fetch/tests/fetch-module.spec.ts index fd1aa844b99..696a989731b 100644 --- a/src/compiler/sys/fetch/tests/fetch-module.spec.ts +++ b/src/compiler/sys/fetch/tests/fetch-module.spec.ts @@ -1,4 +1,4 @@ -import * as d from '../../../../declarations'; +import type * as d from '../../../../declarations'; import { getNodeModuleFetchUrl, getStencilModuleUrl, getStencilRootUrl, skipFilePathFetch } from '../fetch-utils'; import { createSystem } from '../../stencil-sys'; diff --git a/src/compiler/sys/fs-patch.ts b/src/compiler/sys/fs-patch.ts index b79d3f40502..8d49a9b8e28 100644 --- a/src/compiler/sys/fs-patch.ts +++ b/src/compiler/sys/fs-patch.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { FsObj } from './modules/fs'; import fs from 'fs'; diff --git a/src/compiler/sys/logger/console-logger.ts b/src/compiler/sys/logger/console-logger.ts index e1e201d60d4..2a1af85c7aa 100644 --- a/src/compiler/sys/logger/console-logger.ts +++ b/src/compiler/sys/logger/console-logger.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { IS_BROWSER_ENV } from '@utils'; export const createLogger = () => { diff --git a/src/compiler/sys/modules/path.ts b/src/compiler/sys/modules/path.ts index a9fc5859ded..88e3d970011 100644 --- a/src/compiler/sys/modules/path.ts +++ b/src/compiler/sys/modules/path.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { normalizePath, IS_NODE_ENV, requireFunc } from '@utils'; import pathBrowserify from 'path-browserify'; diff --git a/src/compiler/sys/resolve/resolve-utils.ts b/src/compiler/sys/resolve/resolve-utils.ts index 01db377f7d9..1411623c54a 100644 --- a/src/compiler/sys/resolve/resolve-utils.ts +++ b/src/compiler/sys/resolve/resolve-utils.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { IS_BROWSER_ENV, IS_FETCH_ENV, normalizePath } from '@utils'; const COMMON_DIR_MODULE_EXTS = ['.tsx', '.ts', '.mjs', '.js', '.jsx', '.json', '.md']; diff --git a/src/compiler/sys/tests/in-memory-fs.spec.ts b/src/compiler/sys/tests/in-memory-fs.spec.ts index eac8258b0b7..3a5bf791446 100644 --- a/src/compiler/sys/tests/in-memory-fs.spec.ts +++ b/src/compiler/sys/tests/in-memory-fs.spec.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { createTestingSystem } from '../../../testing/testing-sys'; import { getCommitInstructions, createInMemoryFs, shouldIgnore } from '../in-memory-fs'; import { normalizePath } from '../../../utils'; diff --git a/src/compiler/sys/tests/stencil-sys.spec.ts b/src/compiler/sys/tests/stencil-sys.spec.ts index 88bc9e3f899..2b7ce85346b 100644 --- a/src/compiler/sys/tests/stencil-sys.spec.ts +++ b/src/compiler/sys/tests/stencil-sys.spec.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { createSystem } from '../stencil-sys'; describe('stencil system', () => { diff --git a/src/compiler/sys/typescript/tests/typescript-resolve-module.spec.ts b/src/compiler/sys/typescript/tests/typescript-resolve-module.spec.ts index 1e4444a514a..aff88cfabe3 100644 --- a/src/compiler/sys/typescript/tests/typescript-resolve-module.spec.ts +++ b/src/compiler/sys/typescript/tests/typescript-resolve-module.spec.ts @@ -1,4 +1,4 @@ -import * as d from '../../../../declarations'; +import type * as d from '../../../../declarations'; import { createInMemoryFs } from '../../../sys/in-memory-fs'; import { createSystem } from '../../../sys/stencil-sys'; import { ensureExtension } from '../typescript-resolve-module'; diff --git a/src/compiler/sys/typescript/tests/typescript-sys.spec.ts b/src/compiler/sys/typescript/tests/typescript-sys.spec.ts index 0f3e9fc2df5..608993dc7a8 100644 --- a/src/compiler/sys/typescript/tests/typescript-sys.spec.ts +++ b/src/compiler/sys/typescript/tests/typescript-sys.spec.ts @@ -1,4 +1,4 @@ -import * as d from '../../../../declarations'; +import type * as d from '../../../../declarations'; import { createSystem } from '../../../../compiler/sys/stencil-sys'; import { getTypescriptPathFromUrl } from '../typescript-sys'; diff --git a/src/compiler/sys/worker/web-worker-main.ts b/src/compiler/sys/worker/web-worker-main.ts index f2704cf1dcb..f5798e3b4e4 100644 --- a/src/compiler/sys/worker/web-worker-main.ts +++ b/src/compiler/sys/worker/web-worker-main.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { TASK_CANCELED_MSG } from '@utils'; export const createWebWorkerMainController = (sys: d.CompilerSystem, maxConcurrentWorkers: number): d.WorkerMainController => { diff --git a/src/compiler/transformers/add-component-meta-proxy.ts b/src/compiler/transformers/add-component-meta-proxy.ts index d2cc4e75d83..4bfad58e57f 100644 --- a/src/compiler/transformers/add-component-meta-proxy.ts +++ b/src/compiler/transformers/add-component-meta-proxy.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { convertValueToLiteral } from './transform-utils'; import { formatComponentRuntimeMeta } from '@utils'; import { PROXY_CUSTOM_ELEMENT, RUNTIME_APIS, addCoreRuntimeApi } from './core-runtime-apis'; diff --git a/src/compiler/transformers/add-component-meta-static.ts b/src/compiler/transformers/add-component-meta-static.ts index 5f241861bab..200ad8174f6 100644 --- a/src/compiler/transformers/add-component-meta-static.ts +++ b/src/compiler/transformers/add-component-meta-static.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { convertValueToLiteral, createStaticGetter } from './transform-utils'; import ts from 'typescript'; diff --git a/src/compiler/transformers/add-imports.ts b/src/compiler/transformers/add-imports.ts index 29008e902c8..fb9d29cb628 100644 --- a/src/compiler/transformers/add-imports.ts +++ b/src/compiler/transformers/add-imports.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import ts from 'typescript'; export const addImports = (transformOpts: d.TransformOptions, tsSourceFile: ts.SourceFile, importFnNames: string[], importPath: string) => { diff --git a/src/compiler/transformers/add-static-style.ts b/src/compiler/transformers/add-static-style.ts index a4d3a91939a..cc0c0c75a93 100644 --- a/src/compiler/transformers/add-static-style.ts +++ b/src/compiler/transformers/add-static-style.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { createStaticGetter } from './transform-utils'; import { DEFAULT_STYLE_MODE, dashToPascalCase } from '@utils'; import { getScopeId } from '../style/scope-css'; diff --git a/src/compiler/transformers/collections/add-external-import.ts b/src/compiler/transformers/collections/add-external-import.ts index 56c324cd16d..d6ebc693045 100644 --- a/src/compiler/transformers/collections/add-external-import.ts +++ b/src/compiler/transformers/collections/add-external-import.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { dirname } from 'path'; import { isString, parsePackageJson } from '@utils'; import { parseCollection } from './parse-collection-module'; diff --git a/src/compiler/transformers/collections/parse-collection-components.ts b/src/compiler/transformers/collections/parse-collection-components.ts index 11810af0e54..52240331c33 100644 --- a/src/compiler/transformers/collections/parse-collection-components.ts +++ b/src/compiler/transformers/collections/parse-collection-components.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { join } from 'path'; import { updateModule } from '../static-to-meta/parse-static'; import ts from 'typescript'; diff --git a/src/compiler/transformers/collections/parse-collection-manifest.ts b/src/compiler/transformers/collections/parse-collection-manifest.ts index 7bf8b54716a..55d7cdaa5bd 100644 --- a/src/compiler/transformers/collections/parse-collection-manifest.ts +++ b/src/compiler/transformers/collections/parse-collection-manifest.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { join } from 'path'; import { normalizePath } from '@utils'; import { parseCollectionComponents, transpileCollectionModule } from './parse-collection-components'; diff --git a/src/compiler/transformers/collections/parse-collection-module.ts b/src/compiler/transformers/collections/parse-collection-module.ts index 45bc1f37682..c15ff806d39 100644 --- a/src/compiler/transformers/collections/parse-collection-module.ts +++ b/src/compiler/transformers/collections/parse-collection-module.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { dirname, join, relative } from 'path'; import { normalizePath } from '@utils'; import { parseCollectionManifest } from './parse-collection-manifest'; diff --git a/src/compiler/transformers/component-build-conditionals.ts b/src/compiler/transformers/component-build-conditionals.ts index 3e144df4430..a5d63281806 100644 --- a/src/compiler/transformers/component-build-conditionals.ts +++ b/src/compiler/transformers/component-build-conditionals.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { DEFAULT_STYLE_MODE } from '@utils'; export const setComponentBuildConditionals = (cmpMeta: d.ComponentCompilerMeta) => { @@ -33,7 +33,7 @@ export const setComponentBuildConditionals = (cmpMeta: d.ComponentCompilerMeta) cmpMeta.hasListenerTargetWindow = cmpMeta.listeners.some(l => l.target === 'window'); cmpMeta.hasListenerTargetDocument = cmpMeta.listeners.some(l => l.target === 'document'); cmpMeta.hasListenerTargetBody = cmpMeta.listeners.some(l => l.target === 'body'); - cmpMeta.hasListenerTargetParent = cmpMeta.listeners.some(l => l.target === 'parent' as any); + cmpMeta.hasListenerTargetParent = cmpMeta.listeners.some(l => l.target === ('parent' as any)); cmpMeta.hasListenerTarget = cmpMeta.listeners.some(l => !!l.target); } diff --git a/src/compiler/transformers/component-hydrate/hydrate-component.ts b/src/compiler/transformers/component-hydrate/hydrate-component.ts index 6dec3f39268..7504c2f32aa 100644 --- a/src/compiler/transformers/component-hydrate/hydrate-component.ts +++ b/src/compiler/transformers/component-hydrate/hydrate-component.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { addLazyElementGetter } from '../component-lazy/lazy-element-getter'; import { addHydrateRuntimeCmpMeta } from './hydrate-runtime-cmp-meta'; import { addWatchers } from '../watcher-meta-transform'; diff --git a/src/compiler/transformers/component-hydrate/hydrate-runtime-cmp-meta.ts b/src/compiler/transformers/component-hydrate/hydrate-runtime-cmp-meta.ts index c2d32fd7f48..71db5d27df9 100644 --- a/src/compiler/transformers/component-hydrate/hydrate-runtime-cmp-meta.ts +++ b/src/compiler/transformers/component-hydrate/hydrate-runtime-cmp-meta.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { addStaticStyleGetterWithinClass } from '../add-static-style'; import { CMP_FLAGS, formatComponentRuntimeMeta } from '@utils'; import { convertValueToLiteral, createStaticGetter } from '../transform-utils'; diff --git a/src/compiler/transformers/component-hydrate/tranform-to-hydrate-component.ts b/src/compiler/transformers/component-hydrate/tranform-to-hydrate-component.ts index c2f148fbd80..172b4e40f45 100644 --- a/src/compiler/transformers/component-hydrate/tranform-to-hydrate-component.ts +++ b/src/compiler/transformers/component-hydrate/tranform-to-hydrate-component.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { addImports } from '../add-imports'; import { addLegacyApis } from '../core-runtime-apis'; import { getComponentMeta, getModuleFromSourceFile } from '../transform-utils'; diff --git a/src/compiler/transformers/component-lazy/lazy-component.ts b/src/compiler/transformers/component-lazy/lazy-component.ts index 151d53ee251..a4ebad4a474 100644 --- a/src/compiler/transformers/component-lazy/lazy-component.ts +++ b/src/compiler/transformers/component-lazy/lazy-component.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { addLazyElementGetter } from './lazy-element-getter'; import { addStaticStylePropertyToClass } from '../add-static-style'; import { addWatchers } from '../watcher-meta-transform'; diff --git a/src/compiler/transformers/component-lazy/lazy-constructor.ts b/src/compiler/transformers/component-lazy/lazy-constructor.ts index 96a33f4cbdf..612f77b5bb3 100644 --- a/src/compiler/transformers/component-lazy/lazy-constructor.ts +++ b/src/compiler/transformers/component-lazy/lazy-constructor.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { addCreateEvents } from '../create-event'; import { addLegacyProps } from '../legacy-props'; import { REGISTER_INSTANCE, RUNTIME_APIS, addCoreRuntimeApi } from '../core-runtime-apis'; diff --git a/src/compiler/transformers/component-lazy/lazy-element-getter.ts b/src/compiler/transformers/component-lazy/lazy-element-getter.ts index 7b2fbc85111..297318509b9 100644 --- a/src/compiler/transformers/component-lazy/lazy-element-getter.ts +++ b/src/compiler/transformers/component-lazy/lazy-element-getter.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { GET_ELEMENT, RUNTIME_APIS, addCoreRuntimeApi } from '../core-runtime-apis'; import ts from 'typescript'; diff --git a/src/compiler/transformers/component-lazy/transform-lazy-component.ts b/src/compiler/transformers/component-lazy/transform-lazy-component.ts index 93282d91dff..53a385b7507 100644 --- a/src/compiler/transformers/component-lazy/transform-lazy-component.ts +++ b/src/compiler/transformers/component-lazy/transform-lazy-component.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { addImports } from '../add-imports'; import { addLegacyApis } from '../core-runtime-apis'; import { getComponentMeta, getModuleFromSourceFile } from '../transform-utils'; diff --git a/src/compiler/transformers/component-native/native-component.ts b/src/compiler/transformers/component-native/native-component.ts index d686f48cf72..2a05d255cb0 100644 --- a/src/compiler/transformers/component-native/native-component.ts +++ b/src/compiler/transformers/component-native/native-component.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { addNativeComponentMeta } from './native-meta'; import { addNativeConnectedCallback } from './native-connected-callback'; import { addNativeElementGetter } from './native-element-getter'; diff --git a/src/compiler/transformers/component-native/native-constructor.ts b/src/compiler/transformers/component-native/native-constructor.ts index 87621c37c45..fc451885535 100644 --- a/src/compiler/transformers/component-native/native-constructor.ts +++ b/src/compiler/transformers/component-native/native-constructor.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { addCreateEvents } from '../create-event'; import { addLegacyProps } from '../legacy-props'; import { ATTACH_SHADOW, RUNTIME_APIS, addCoreRuntimeApi } from '../core-runtime-apis'; diff --git a/src/compiler/transformers/component-native/native-element-getter.ts b/src/compiler/transformers/component-native/native-element-getter.ts index ab5588059c8..d152575ed7a 100644 --- a/src/compiler/transformers/component-native/native-element-getter.ts +++ b/src/compiler/transformers/component-native/native-element-getter.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import ts from 'typescript'; export const addNativeElementGetter = (classMembers: ts.ClassElement[], cmp: d.ComponentCompilerMeta) => { diff --git a/src/compiler/transformers/component-native/native-meta.ts b/src/compiler/transformers/component-native/native-meta.ts index 0bc690c2252..f78cb19d3ba 100644 --- a/src/compiler/transformers/component-native/native-meta.ts +++ b/src/compiler/transformers/component-native/native-meta.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { convertValueToLiteral, createStaticGetter } from '../transform-utils'; import ts from 'typescript'; diff --git a/src/compiler/transformers/component-native/native-static-style.ts b/src/compiler/transformers/component-native/native-static-style.ts index 48594a3ce38..bc05f59b17b 100644 --- a/src/compiler/transformers/component-native/native-static-style.ts +++ b/src/compiler/transformers/component-native/native-static-style.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { createStaticGetter } from '../transform-utils'; import { DEFAULT_STYLE_MODE, dashToPascalCase } from '@utils'; import { getScopeId } from '../../style/scope-css'; diff --git a/src/compiler/transformers/component-native/tranform-to-native-component.ts b/src/compiler/transformers/component-native/tranform-to-native-component.ts index 98650d280ad..6a983e2f0d8 100644 --- a/src/compiler/transformers/component-native/tranform-to-native-component.ts +++ b/src/compiler/transformers/component-native/tranform-to-native-component.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { addImports } from '../add-imports'; import { addLegacyApis } from '../core-runtime-apis'; import { addModuleMetadataProxies } from '../add-component-meta-proxy'; diff --git a/src/compiler/transformers/core-runtime-apis.ts b/src/compiler/transformers/core-runtime-apis.ts index ea7a35e8b66..2a41cbad932 100644 --- a/src/compiler/transformers/core-runtime-apis.ts +++ b/src/compiler/transformers/core-runtime-apis.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; export const ATTACH_SHADOW = '__stencil_attachShadow'; export const CREATE_EVENT = '__stencil_createEvent'; diff --git a/src/compiler/transformers/create-event.ts b/src/compiler/transformers/create-event.ts index 9826fb71a17..0c81c115759 100644 --- a/src/compiler/transformers/create-event.ts +++ b/src/compiler/transformers/create-event.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { CREATE_EVENT, RUNTIME_APIS, addCoreRuntimeApi } from './core-runtime-apis'; import { EVENT_FLAGS } from '@utils'; import ts from 'typescript'; diff --git a/src/compiler/transformers/decorators-to-static/component-decorator.ts b/src/compiler/transformers/decorators-to-static/component-decorator.ts index dd7cce687bf..c5b1a61078c 100644 --- a/src/compiler/transformers/decorators-to-static/component-decorator.ts +++ b/src/compiler/transformers/decorators-to-static/component-decorator.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { augmentDiagnosticWithNode, buildError, validateComponentTag, isString, buildWarn } from '@utils'; import { getDeclarationParameters } from './decorator-utils'; import { convertValueToLiteral, createStaticGetter } from '../transform-utils'; @@ -39,7 +39,7 @@ export const componentDecoratorToStatic = ( styleToStatic(newMembers, componentOptions); const assetsDirs = componentOptions.assetsDirs || []; - + if (isString((componentOptions as any).assetsDir)) { assetsDirs.push((componentOptions as any).assetsDir); const warn = buildWarn(diagnostics); diff --git a/src/compiler/transformers/decorators-to-static/convert-decorators.ts b/src/compiler/transformers/decorators-to-static/convert-decorators.ts index ebfb4ab5076..96ac41be722 100644 --- a/src/compiler/transformers/decorators-to-static/convert-decorators.ts +++ b/src/compiler/transformers/decorators-to-static/convert-decorators.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { CLASS_DECORATORS_TO_REMOVE, MEMBER_DECORATORS_TO_REMOVE } from './decorators-constants'; import { componentDecoratorToStatic } from './component-decorator'; import { elementDecoratorsToStatic } from './element-decorator'; diff --git a/src/compiler/transformers/decorators-to-static/element-decorator.ts b/src/compiler/transformers/decorators-to-static/element-decorator.ts index 765e004ef6f..08499f4d4b0 100644 --- a/src/compiler/transformers/decorators-to-static/element-decorator.ts +++ b/src/compiler/transformers/decorators-to-static/element-decorator.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { buildError } from '@utils'; import { createStaticGetter } from '../transform-utils'; import { isDecoratorNamed } from './decorator-utils'; diff --git a/src/compiler/transformers/decorators-to-static/event-decorator.ts b/src/compiler/transformers/decorators-to-static/event-decorator.ts index 29b45febc0d..443fecf1108 100644 --- a/src/compiler/transformers/decorators-to-static/event-decorator.ts +++ b/src/compiler/transformers/decorators-to-static/event-decorator.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { augmentDiagnosticWithNode, buildWarn } from '@utils'; import { convertValueToLiteral, createStaticGetter, getAttributeTypeInfo, resolveType, serializeSymbol, validateReferences } from '../transform-utils'; import { getDeclarationParameters, isDecoratorNamed } from './decorator-utils'; diff --git a/src/compiler/transformers/decorators-to-static/listen-decorator.ts b/src/compiler/transformers/decorators-to-static/listen-decorator.ts index f5d9d75b597..c9a33ed6d40 100644 --- a/src/compiler/transformers/decorators-to-static/listen-decorator.ts +++ b/src/compiler/transformers/decorators-to-static/listen-decorator.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { augmentDiagnosticWithNode, buildError, flatOne } from '@utils'; import { convertValueToLiteral, createStaticGetter } from '../transform-utils'; import { getDeclarationParameters, isDecoratorNamed } from './decorator-utils'; @@ -31,7 +31,7 @@ const parseListenDecorators = (diagnostics: d.Diagnostic[], method: ts.MethodDec } const listener = parseListener(eventNames[0], listenOptions, methodName); - if (listener.target === 'parent' as any) { + if (listener.target === ('parent' as any)) { const err = buildError(diagnostics); err.messageText = 'The "parent" target is no longer available as of Stencil 2. Please use "window", "document" or "body" instead.'; augmentDiagnosticWithNode(err, listenDecorator); diff --git a/src/compiler/transformers/decorators-to-static/prop-decorator.ts b/src/compiler/transformers/decorators-to-static/prop-decorator.ts index 4891f591662..848d3f595af 100644 --- a/src/compiler/transformers/decorators-to-static/prop-decorator.ts +++ b/src/compiler/transformers/decorators-to-static/prop-decorator.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { augmentDiagnosticWithNode, buildError, buildWarn, catchError, toDashCase } from '@utils'; import { convertValueToLiteral, diff --git a/src/compiler/transformers/decorators-to-static/state-decorator.ts b/src/compiler/transformers/decorators-to-static/state-decorator.ts index 18f3e8da7c8..fed752a01ff 100644 --- a/src/compiler/transformers/decorators-to-static/state-decorator.ts +++ b/src/compiler/transformers/decorators-to-static/state-decorator.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { createStaticGetter } from '../transform-utils'; import { isDecoratorNamed } from './decorator-utils'; import ts from 'typescript'; diff --git a/src/compiler/transformers/decorators-to-static/style-to-static.ts b/src/compiler/transformers/decorators-to-static/style-to-static.ts index 09b4380dbdc..3194abb4dc1 100644 --- a/src/compiler/transformers/decorators-to-static/style-to-static.ts +++ b/src/compiler/transformers/decorators-to-static/style-to-static.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { basename, dirname, extname, join } from 'path'; import { ConvertIdentifier, convertValueToLiteral, createStaticGetter } from '../transform-utils'; import { DEFAULT_STYLE_MODE } from '@utils'; diff --git a/src/compiler/transformers/decorators-to-static/watch-decorator.ts b/src/compiler/transformers/decorators-to-static/watch-decorator.ts index 727f127679d..1dad4758af5 100644 --- a/src/compiler/transformers/decorators-to-static/watch-decorator.ts +++ b/src/compiler/transformers/decorators-to-static/watch-decorator.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { convertValueToLiteral, createStaticGetter } from '../transform-utils'; import { flatOne, buildError, augmentDiagnosticWithNode, buildWarn } from '@utils'; import { getDeclarationParameters, isDecoratorNamed } from './decorator-utils'; diff --git a/src/compiler/transformers/define-custom-element.ts b/src/compiler/transformers/define-custom-element.ts index a98679b048a..a8f847f7507 100644 --- a/src/compiler/transformers/define-custom-element.ts +++ b/src/compiler/transformers/define-custom-element.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { convertValueToLiteral } from './transform-utils'; import { DEFINE_CUSTOM_ELEMENT, RUNTIME_APIS, addCoreRuntimeApi } from './core-runtime-apis'; import { formatComponentRuntimeMeta } from '@utils'; diff --git a/src/compiler/transformers/host-data-transform.ts b/src/compiler/transformers/host-data-transform.ts index 88de0a0cdca..4f0a0d1876b 100644 --- a/src/compiler/transformers/host-data-transform.ts +++ b/src/compiler/transformers/host-data-transform.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { H, HOST, RUNTIME_APIS, addCoreRuntimeApi } from './core-runtime-apis'; import ts from 'typescript'; diff --git a/src/compiler/transformers/legacy-props.ts b/src/compiler/transformers/legacy-props.ts index b1d1cb7570d..5e6525422b2 100644 --- a/src/compiler/transformers/legacy-props.ts +++ b/src/compiler/transformers/legacy-props.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { GET_CONNECT, GET_CONTEXT, RUNTIME_APIS, addCoreRuntimeApi } from './core-runtime-apis'; import ts from 'typescript'; diff --git a/src/compiler/transformers/remove-collection-imports.ts b/src/compiler/transformers/remove-collection-imports.ts index c35261a0549..84c0db369ba 100644 --- a/src/compiler/transformers/remove-collection-imports.ts +++ b/src/compiler/transformers/remove-collection-imports.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import ts from 'typescript'; export const removeCollectionImports = (compilerCtx: d.CompilerCtx): ts.TransformerFactory => { diff --git a/src/compiler/transformers/reserved-public-members.ts b/src/compiler/transformers/reserved-public-members.ts index 6911b3f4079..3012db99f42 100644 --- a/src/compiler/transformers/reserved-public-members.ts +++ b/src/compiler/transformers/reserved-public-members.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { augmentDiagnosticWithNode, buildWarn } from '@utils'; import ts from 'typescript'; diff --git a/src/compiler/transformers/static-to-meta/call-expression.ts b/src/compiler/transformers/static-to-meta/call-expression.ts index cd6f7e587e6..a33773c7e42 100644 --- a/src/compiler/transformers/static-to-meta/call-expression.ts +++ b/src/compiler/transformers/static-to-meta/call-expression.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { gatherVdomMeta } from './vdom'; import { H } from '../core-runtime-apis'; import ts from 'typescript'; diff --git a/src/compiler/transformers/static-to-meta/class-methods.ts b/src/compiler/transformers/static-to-meta/class-methods.ts index d16e5512efb..23b2a5f8e76 100644 --- a/src/compiler/transformers/static-to-meta/class-methods.ts +++ b/src/compiler/transformers/static-to-meta/class-methods.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import ts from 'typescript'; import { isMethod } from '../transform-utils'; diff --git a/src/compiler/transformers/static-to-meta/component.ts b/src/compiler/transformers/static-to-meta/component.ts index 05948511af0..f50065083f9 100644 --- a/src/compiler/transformers/static-to-meta/component.ts +++ b/src/compiler/transformers/static-to-meta/component.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { addComponentMetaStatic } from '../add-component-meta-static'; import { dirname, isAbsolute, join, relative } from 'path'; import { normalizePath, unique } from '@utils'; diff --git a/src/compiler/transformers/static-to-meta/events.ts b/src/compiler/transformers/static-to-meta/events.ts index 949e1e1dfb5..f29da22e748 100644 --- a/src/compiler/transformers/static-to-meta/events.ts +++ b/src/compiler/transformers/static-to-meta/events.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { getStaticValue, isInternal } from '../transform-utils'; import ts from 'typescript'; diff --git a/src/compiler/transformers/static-to-meta/import.ts b/src/compiler/transformers/static-to-meta/import.ts index 5b2891069b1..2a2dad7a6c9 100644 --- a/src/compiler/transformers/static-to-meta/import.ts +++ b/src/compiler/transformers/static-to-meta/import.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { addExternalImport } from '../collections/add-external-import'; import { isAbsolute, resolve } from 'path'; import { normalizePath } from '@utils'; diff --git a/src/compiler/transformers/static-to-meta/listeners.ts b/src/compiler/transformers/static-to-meta/listeners.ts index 38e65fe07dd..45cbeb0677e 100644 --- a/src/compiler/transformers/static-to-meta/listeners.ts +++ b/src/compiler/transformers/static-to-meta/listeners.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { getStaticValue } from '../transform-utils'; import ts from 'typescript'; diff --git a/src/compiler/transformers/static-to-meta/methods.ts b/src/compiler/transformers/static-to-meta/methods.ts index 7a5ba28f56e..9ab43e76463 100644 --- a/src/compiler/transformers/static-to-meta/methods.ts +++ b/src/compiler/transformers/static-to-meta/methods.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { getStaticValue, isInternal } from '../transform-utils'; import ts from 'typescript'; diff --git a/src/compiler/transformers/static-to-meta/parse-static.ts b/src/compiler/transformers/static-to-meta/parse-static.ts index 1d4bc89e1a5..1a9217f3ed8 100644 --- a/src/compiler/transformers/static-to-meta/parse-static.ts +++ b/src/compiler/transformers/static-to-meta/parse-static.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { createModule, getModule } from '../../transpile/transpiled-module'; import { dirname, basename, join } from 'path'; import { normalizePath } from '@utils'; diff --git a/src/compiler/transformers/static-to-meta/props.ts b/src/compiler/transformers/static-to-meta/props.ts index 02feb57052b..9e7237be71f 100644 --- a/src/compiler/transformers/static-to-meta/props.ts +++ b/src/compiler/transformers/static-to-meta/props.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { getStaticValue, isInternal } from '../transform-utils'; import ts from 'typescript'; diff --git a/src/compiler/transformers/static-to-meta/states.ts b/src/compiler/transformers/static-to-meta/states.ts index 6a9a4659750..0cbf83dff47 100644 --- a/src/compiler/transformers/static-to-meta/states.ts +++ b/src/compiler/transformers/static-to-meta/states.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { getStaticValue } from '../transform-utils'; import ts from 'typescript'; diff --git a/src/compiler/transformers/static-to-meta/string-literal.ts b/src/compiler/transformers/static-to-meta/string-literal.ts index bc4f861e564..1de677b4e86 100644 --- a/src/compiler/transformers/static-to-meta/string-literal.ts +++ b/src/compiler/transformers/static-to-meta/string-literal.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import ts from 'typescript'; export const parseStringLiteral = (m: d.Module | d.ComponentCompilerMeta, node: ts.StringLiteral) => { diff --git a/src/compiler/transformers/static-to-meta/styles.ts b/src/compiler/transformers/static-to-meta/styles.ts index 1b28d294b3d..2f2b2c14a3b 100644 --- a/src/compiler/transformers/static-to-meta/styles.ts +++ b/src/compiler/transformers/static-to-meta/styles.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { ConvertIdentifier, getStaticValue } from '../transform-utils'; import { DEFAULT_STYLE_MODE, sortBy } from '@utils'; import { normalizeStyles } from '../../style/normalize-styles'; diff --git a/src/compiler/transformers/static-to-meta/vdom.ts b/src/compiler/transformers/static-to-meta/vdom.ts index 0966e4f4626..f66002d2495 100644 --- a/src/compiler/transformers/static-to-meta/vdom.ts +++ b/src/compiler/transformers/static-to-meta/vdom.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import ts from 'typescript'; export const gatherVdomMeta = (m: d.Module | d.ComponentCompilerMeta, args: ts.NodeArray) => { diff --git a/src/compiler/transformers/static-to-meta/visitor.ts b/src/compiler/transformers/static-to-meta/visitor.ts index 131dd0f0a12..16f651f208f 100644 --- a/src/compiler/transformers/static-to-meta/visitor.ts +++ b/src/compiler/transformers/static-to-meta/visitor.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { dirname } from 'path'; import { getModuleLegacy, resetModuleLegacy } from '../../build/compiler-ctx'; import { parseCallExpression } from './call-expression'; diff --git a/src/compiler/transformers/static-to-meta/watchers.ts b/src/compiler/transformers/static-to-meta/watchers.ts index f13360b0d4a..40dbbc83c67 100644 --- a/src/compiler/transformers/static-to-meta/watchers.ts +++ b/src/compiler/transformers/static-to-meta/watchers.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { getStaticValue } from '../transform-utils'; import ts from 'typescript'; diff --git a/src/compiler/transformers/test/lazy-component.spec.ts b/src/compiler/transformers/test/lazy-component.spec.ts index c52ef49a2e3..7a617832ae0 100644 --- a/src/compiler/transformers/test/lazy-component.spec.ts +++ b/src/compiler/transformers/test/lazy-component.spec.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { transpileModule } from './transpile'; import { lazyComponentTransform } from '../component-lazy/transform-lazy-component'; import { mockCompilerCtx } from '@stencil/core/testing'; diff --git a/src/compiler/transformers/test/transpile.ts b/src/compiler/transformers/test/transpile.ts index 5a5380e732b..59b4aa01a5b 100644 --- a/src/compiler/transformers/test/transpile.ts +++ b/src/compiler/transformers/test/transpile.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { convertDecoratorsToStatic } from '../decorators-to-static/convert-decorators'; import { convertStaticToMeta } from '../static-to-meta/visitor'; import { mockBuildCtx, mockCompilerCtx, mockConfig, mockStencilSystem } from '@stencil/core/testing'; diff --git a/src/compiler/transformers/update-component-class.ts b/src/compiler/transformers/update-component-class.ts index 3f50d2cf715..15b0387abad 100644 --- a/src/compiler/transformers/update-component-class.ts +++ b/src/compiler/transformers/update-component-class.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import ts from 'typescript'; export const updateComponentClass = ( diff --git a/src/compiler/transformers/watcher-meta-transform.ts b/src/compiler/transformers/watcher-meta-transform.ts index 73751cc008f..c6e33a2201d 100644 --- a/src/compiler/transformers/watcher-meta-transform.ts +++ b/src/compiler/transformers/watcher-meta-transform.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { convertValueToLiteral, createStaticGetter } from './transform-utils'; import ts from 'typescript'; diff --git a/src/compiler/transpile/create-build-program.ts b/src/compiler/transpile/create-build-program.ts index a1596e6147b..c6041140d3f 100644 --- a/src/compiler/transpile/create-build-program.ts +++ b/src/compiler/transpile/create-build-program.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { getTsOptionsToExtend } from './ts-config'; import { GENERATED_DTS } from '../output-targets/output-utils'; import ts from 'typescript'; diff --git a/src/compiler/transpile/create-watch-program.ts b/src/compiler/transpile/create-watch-program.ts index 36573c74f71..dbb443927b6 100644 --- a/src/compiler/transpile/create-watch-program.ts +++ b/src/compiler/transpile/create-watch-program.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { getTsOptionsToExtend } from './ts-config'; import ts from 'typescript'; diff --git a/src/compiler/transpile/transpiled-module.ts b/src/compiler/transpile/transpiled-module.ts index b00f8954233..49cd780f376 100644 --- a/src/compiler/transpile/transpiled-module.ts +++ b/src/compiler/transpile/transpiled-module.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { normalizePath } from '@utils'; import ts from 'typescript'; diff --git a/src/compiler/types/generate-app-types.ts b/src/compiler/types/generate-app-types.ts index 17f9ebb1a5f..a101a9af4ca 100644 --- a/src/compiler/types/generate-app-types.ts +++ b/src/compiler/types/generate-app-types.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { COMPONENTS_DTS_HEADER, sortImportNames } from './types-utils'; import { generateComponentTypes } from './generate-component-types'; import { GENERATED_DTS, getComponentsDtsSrcFilePath } from '../output-targets/output-utils'; diff --git a/src/compiler/types/generate-component-types.ts b/src/compiler/types/generate-component-types.ts index 2e2c9c1f4eb..259b055dbe2 100644 --- a/src/compiler/types/generate-component-types.ts +++ b/src/compiler/types/generate-component-types.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { dashToPascalCase, sortBy } from '@utils'; import { generateEventTypes } from './generate-event-types'; import { generateMethodTypes } from './generate-method-types'; diff --git a/src/compiler/types/generate-event-types.ts b/src/compiler/types/generate-event-types.ts index f23c9611a32..833b90bcc5e 100644 --- a/src/compiler/types/generate-event-types.ts +++ b/src/compiler/types/generate-event-types.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { getTextDocs, toTitleCase } from '@utils'; export const generateEventTypes = (cmpEvents: d.ComponentCompilerEvent[]): d.TypeInfo => { diff --git a/src/compiler/types/generate-method-types.ts b/src/compiler/types/generate-method-types.ts index 58783644a0c..639ded20641 100644 --- a/src/compiler/types/generate-method-types.ts +++ b/src/compiler/types/generate-method-types.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { getTextDocs } from '@utils'; export const generateMethodTypes = (cmpMethods: d.ComponentCompilerMethod[]): d.TypeInfo => { diff --git a/src/compiler/types/generate-prop-types.ts b/src/compiler/types/generate-prop-types.ts index c283f329d74..15b8562a297 100644 --- a/src/compiler/types/generate-prop-types.ts +++ b/src/compiler/types/generate-prop-types.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { getTextDocs } from '@utils'; export const generatePropTypes = (cmpMeta: d.ComponentCompilerMeta): d.TypeInfo => { diff --git a/src/compiler/types/generate-types.ts b/src/compiler/types/generate-types.ts index bf2b02a299a..f2f2c9b2d5a 100644 --- a/src/compiler/types/generate-types.ts +++ b/src/compiler/types/generate-types.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { copyStencilCoreDts, updateStencilTypesImports } from './stencil-types'; import { join, relative } from 'path'; import { generateAppTypes } from './generate-app-types'; diff --git a/src/compiler/types/stencil-types.ts b/src/compiler/types/stencil-types.ts index 6b76da5be1f..19da5a04578 100644 --- a/src/compiler/types/stencil-types.ts +++ b/src/compiler/types/stencil-types.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { dirname, join, relative } from 'path'; import { isOutputTargetDistTypes } from '../output-targets/output-utils'; import { normalizePath } from '@utils'; diff --git a/src/compiler/types/tests/validate-package-json.spec.ts b/src/compiler/types/tests/validate-package-json.spec.ts index 007896d5835..005ae291cf6 100644 --- a/src/compiler/types/tests/validate-package-json.spec.ts +++ b/src/compiler/types/tests/validate-package-json.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { mockBuildCtx, mockCompilerCtx, mockConfig } from '@stencil/core/testing'; import * as v from '../validate-build-package-json'; import path from 'path'; diff --git a/src/compiler/types/types-utils.ts b/src/compiler/types/types-utils.ts index 6591a72f171..844356f0cef 100644 --- a/src/compiler/types/types-utils.ts +++ b/src/compiler/types/types-utils.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; export const COMPONENTS_DTS_HEADER = `/* eslint-disable */ /* tslint:disable */ diff --git a/src/compiler/types/update-import-refs.ts b/src/compiler/types/update-import-refs.ts index 56e3c43a7ad..9bb3b4b67f6 100644 --- a/src/compiler/types/update-import-refs.ts +++ b/src/compiler/types/update-import-refs.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { dirname, resolve } from 'path'; /** diff --git a/src/compiler/types/validate-build-package-json.ts b/src/compiler/types/validate-build-package-json.ts index 0a1ebc0da1e..a1e9cf7c7c5 100644 --- a/src/compiler/types/validate-build-package-json.ts +++ b/src/compiler/types/validate-build-package-json.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { COLLECTION_MANIFEST_FILE_NAME, buildJsonFileError, isGlob, normalizePath } from '@utils'; import { dirname, join, relative } from 'path'; import { getComponentsDtsTypesFilePath, isOutputTargetDistCollection, isOutputTargetDistTypes } from '../output-targets/output-utils'; diff --git a/src/declarations/stencil-core/index.ts b/src/declarations/stencil-core/index.ts index 28e3f4051b2..95c7f202d58 100644 --- a/src/declarations/stencil-core/index.ts +++ b/src/declarations/stencil-core/index.ts @@ -1,4 +1,4 @@ -export { +export type { Build, ChildNode, Component, @@ -42,4 +42,4 @@ export { writeTask, } from '../stencil-public-runtime'; -export { StencilConfig as Config, PrerenderConfig } from '../stencil-public-compiler'; +export type { StencilConfig as Config, PrerenderConfig } from '../stencil-public-compiler'; diff --git a/src/declarations/stencil-private.ts b/src/declarations/stencil-private.ts index c6ae1a3f692..2ee97d4e9a9 100644 --- a/src/declarations/stencil-private.ts +++ b/src/declarations/stencil-private.ts @@ -1,4 +1,4 @@ -import { +import type { BuildEvents, BuildLog, BuildOutput, @@ -25,7 +25,7 @@ import { LoggerLineUpdater, } from './stencil-public-compiler'; -import { ComponentInterface, ListenOptions, ListenTargetOptions, VNode, VNodeData } from './stencil-public-runtime'; +import type { ComponentInterface, ListenOptions, ListenTargetOptions, VNode, VNodeData } from './stencil-public-runtime'; export interface PrintLine { lineIndex: number; diff --git a/src/dev-server/dev-server-client/app-update.ts b/src/dev-server/dev-server-client/app-update.ts index 0cdc7909e07..161675e66db 100644 --- a/src/dev-server/dev-server-client/app-update.ts +++ b/src/dev-server/dev-server-client/app-update.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { appError, clearAppErrorModal, hmrWindow, logBuild, logDiagnostic, logReload, logWarn, emitBuildStatus, onBuildResults } from '../client'; import { OPEN_IN_EDITOR_URL } from '../dev-server-constants'; diff --git a/src/dev-server/dev-server-client/client-web-socket.ts b/src/dev-server/dev-server-client/client-web-socket.ts index c4a36542173..dded816ed7d 100644 --- a/src/dev-server/dev-server-client/client-web-socket.ts +++ b/src/dev-server/dev-server-client/client-web-socket.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { emitBuildLog, emitBuildResults, emitBuildStatus, logDisabled, logReload, logWarn } from '../client'; export const initClientWebSocket = (win: d.DevClientWindow, config: d.DevClientConfig) => { diff --git a/src/dev-server/dev-server-client/index.ts b/src/dev-server/dev-server-client/index.ts index bfeb7d9a99a..f58c2ba5b74 100644 --- a/src/dev-server/dev-server-client/index.ts +++ b/src/dev-server/dev-server-client/index.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { applyPolyfills } from './polyfills'; import { initDevClient } from './init-dev-client'; diff --git a/src/dev-server/dev-server-client/init-dev-client.ts b/src/dev-server/dev-server-client/init-dev-client.ts index 4bae61a079c..1c0f9c08c1d 100644 --- a/src/dev-server/dev-server-client/init-dev-client.ts +++ b/src/dev-server/dev-server-client/init-dev-client.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import * as c from '../dev-server-constants'; import { appReset, initAppUpdate } from './app-update'; import { initBuildProgress, initBuildStatus } from '../client'; diff --git a/src/dev-server/dev-server-utils.ts b/src/dev-server/dev-server-utils.ts index 28e6f2f2893..a3a37d1166e 100644 --- a/src/dev-server/dev-server-utils.ts +++ b/src/dev-server/dev-server-utils.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import * as c from './dev-server-constants'; import { version } from '../version'; import util from 'util'; @@ -112,11 +112,7 @@ export function isCssFile(filePath: string) { const TXT_EXT = ['css', 'html', 'htm', 'js', 'json', 'svg', 'xml']; export function isSimpleText(filePath: string) { - const ext = filePath - .toLowerCase() - .trim() - .split('.') - .pop(); + const ext = filePath.toLowerCase().trim().split('.').pop(); return TXT_EXT.includes(ext); } diff --git a/src/dev-server/index.ts b/src/dev-server/index.ts index cc277ad8c2a..939f82121f8 100644 --- a/src/dev-server/index.ts +++ b/src/dev-server/index.ts @@ -1,4 +1,4 @@ -import { +import type { BuildOnEventRemove, CompilerBuildResults, CompilerEventName, diff --git a/src/dev-server/public.ts b/src/dev-server/public.ts index 1ca7ffff5c2..6f5653c2775 100644 --- a/src/dev-server/public.ts +++ b/src/dev-server/public.ts @@ -1,4 +1,4 @@ -import { DevServer, Logger, StencilDevServerConfig as DevServerConfig } from '@stencil/core/internal'; +import type { DevServer, Logger, StencilDevServerConfig as DevServerConfig } from '@stencil/core/internal'; export declare function start(devServerConfig: DevServerConfig, logger: Logger): Promise; export declare function openInBrowser(opts: { url: string }): Promise; diff --git a/src/dev-server/serve-404.ts b/src/dev-server/serve-404.ts index 10a66fb5cb6..c7e96362525 100644 --- a/src/dev-server/serve-404.ts +++ b/src/dev-server/serve-404.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import * as http from 'http'; import fs from 'graceful-fs'; import path from 'path'; diff --git a/src/dev-server/serve-500.ts b/src/dev-server/serve-500.ts index cabce7028e9..74379d110a1 100644 --- a/src/dev-server/serve-500.ts +++ b/src/dev-server/serve-500.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import * as http from 'http'; import { responseHeaders, sendError, sendMsg } from './dev-server-utils'; import util from 'util'; diff --git a/src/dev-server/serve-compiler-request.ts b/src/dev-server/serve-compiler-request.ts index cb8a8e25878..c8e53fbc651 100644 --- a/src/dev-server/serve-compiler-request.ts +++ b/src/dev-server/serve-compiler-request.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import * as util from './dev-server-utils'; import { serve404 } from './serve-404'; import { serve500 } from './serve-500'; diff --git a/src/dev-server/serve-file.ts b/src/dev-server/serve-file.ts index 900164a5a1b..ad303e978a8 100644 --- a/src/dev-server/serve-file.ts +++ b/src/dev-server/serve-file.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import * as util from './dev-server-utils'; import { version } from '../version'; import { serve500 } from './serve-500'; diff --git a/src/dev-server/server-http.ts b/src/dev-server/server-http.ts index 73f6af7f138..be00a1af42a 100644 --- a/src/dev-server/server-http.ts +++ b/src/dev-server/server-http.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { createRequestHandler } from './request-handler'; import { findClosestOpenPort } from './find-closest-port'; import * as http from 'http'; diff --git a/src/dev-server/server-web-socket.ts b/src/dev-server/server-web-socket.ts index e6b3a5636f3..34a9f7164d7 100644 --- a/src/dev-server/server-web-socket.ts +++ b/src/dev-server/server-web-socket.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import * as ws from 'ws'; import * as http from 'http'; import { noop } from '@utils'; diff --git a/src/dev-server/server-worker.ts b/src/dev-server/server-worker.ts index a418a8c113e..0bc1b0a7648 100644 --- a/src/dev-server/server-worker.ts +++ b/src/dev-server/server-worker.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { createMessageReceiver, sendMsg } from './dev-server-utils'; import { startDevServerWorker } from './start-server-worker'; import fs from 'graceful-fs'; diff --git a/src/dev-server/start-server-worker.ts b/src/dev-server/start-server-worker.ts index 384c360e851..deb2353ea9a 100644 --- a/src/dev-server/start-server-worker.ts +++ b/src/dev-server/start-server-worker.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { createHttpServer } from './server-http'; import { createNodeSys } from '../sys/node/node-sys'; import { createWebSocket } from './server-web-socket'; diff --git a/src/dev-server/test/req-handler.spec.ts b/src/dev-server/test/req-handler.spec.ts index d0a451dbd20..55a100b7a70 100644 --- a/src/dev-server/test/req-handler.spec.ts +++ b/src/dev-server/test/req-handler.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { appendDevServerClientIframe } from '../serve-file'; import { createRequestHandler } from '../request-handler'; import { createSystem } from '../../compiler/sys/stencil-sys'; diff --git a/src/dev-server/test/util.spec.ts b/src/dev-server/test/util.spec.ts index e399249034e..a38ea1fe9b7 100644 --- a/src/dev-server/test/util.spec.ts +++ b/src/dev-server/test/util.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { getBrowserUrl, getDevServerClientUrl } from '../dev-server-utils'; import { DEV_SERVER_URL } from '../dev-server-constants'; diff --git a/src/hydrate/platform/hydrate-app.ts b/src/hydrate/platform/hydrate-app.ts index ac292574c25..600d9f492c9 100644 --- a/src/hydrate/platform/hydrate-app.ts +++ b/src/hydrate/platform/hydrate-app.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { connectedCallback, insertVdomAnnotations } from '@runtime'; import { doc, getHostRef, loadModule, plt, registerHost } from '@platform'; import { proxyHostElement } from './proxy-host-element'; diff --git a/src/hydrate/platform/index.ts b/src/hydrate/platform/index.ts index afaca1d25bc..cb8c00b9f35 100644 --- a/src/hydrate/platform/index.ts +++ b/src/hydrate/platform/index.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { addHostEventListeners } from '@runtime'; export const cmpModules = new Map(); diff --git a/src/hydrate/platform/proxy-host-element.ts b/src/hydrate/platform/proxy-host-element.ts index e5a04bf22c7..42a9598c4a1 100644 --- a/src/hydrate/platform/proxy-host-element.ts +++ b/src/hydrate/platform/proxy-host-element.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { consoleError, getHostRef } from '@platform'; import { getValue, parsePropertyValue, setValue } from '@runtime'; import { CMP_FLAGS, MEMBER_FLAGS } from '@utils'; diff --git a/src/hydrate/runner/hydrate-factory.ts b/src/hydrate/runner/hydrate-factory.ts index 33e6d10ccc3..b38fb0b61eb 100644 --- a/src/hydrate/runner/hydrate-factory.ts +++ b/src/hydrate/runner/hydrate-factory.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; export function hydrateFactory( win: Window, diff --git a/src/hydrate/runner/inspect-element.ts b/src/hydrate/runner/inspect-element.ts index 20cf79d32b1..868042bd782 100644 --- a/src/hydrate/runner/inspect-element.ts +++ b/src/hydrate/runner/inspect-element.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; export function inspectElement(results: d.HydrateResults, elm: Element, depth: number) { const children = elm.children; diff --git a/src/hydrate/runner/patch-dom-implementation.ts b/src/hydrate/runner/patch-dom-implementation.ts index 662cb837958..8e05cc91e3c 100644 --- a/src/hydrate/runner/patch-dom-implementation.ts +++ b/src/hydrate/runner/patch-dom-implementation.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { MockWindow, patchWindow } from '@stencil/core/mock-doc'; export function patchDomImplementation(doc: any, opts: d.HydrateFactoryOptions) { diff --git a/src/hydrate/runner/render-utils.ts b/src/hydrate/runner/render-utils.ts index 780acb0cc29..0101acc970e 100644 --- a/src/hydrate/runner/render-utils.ts +++ b/src/hydrate/runner/render-utils.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; export function normalizeHydrateOptions(inputOpts: d.HydrateDocumentOptions) { const outputOpts: d.HydrateFactoryOptions = Object.assign( diff --git a/src/hydrate/runner/render.ts b/src/hydrate/runner/render.ts index 99e34bf3140..5dcffa333cd 100644 --- a/src/hydrate/runner/render.ts +++ b/src/hydrate/runner/render.ts @@ -1,4 +1,4 @@ -import { HydrateDocumentOptions, HydrateFactoryOptions, HydrateResults, SerializeDocumentOptions } from '../../declarations'; +import type { HydrateDocumentOptions, HydrateFactoryOptions, HydrateResults, SerializeDocumentOptions } from '../../declarations'; import { generateHydrateResults, normalizeHydrateOptions, renderBuildError, renderCatchError } from './render-utils'; import { hasError, isPromise } from '@utils'; import { hydrateFactory } from '@hydrate-factory'; diff --git a/src/hydrate/runner/runtime-log.ts b/src/hydrate/runner/runtime-log.ts index 20c5fb24f1b..9372916b097 100644 --- a/src/hydrate/runner/runtime-log.ts +++ b/src/hydrate/runner/runtime-log.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { renderCatchError, renderBuildDiagnostic } from './render-utils'; export function runtimeLogging(win: Window & typeof globalThis, opts: d.HydrateDocumentOptions, results: d.HydrateResults) { diff --git a/src/hydrate/runner/window-initialize.ts b/src/hydrate/runner/window-initialize.ts index 9440310698c..7c041911e19 100644 --- a/src/hydrate/runner/window-initialize.ts +++ b/src/hydrate/runner/window-initialize.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { constrainTimeouts } from '@stencil/core/mock-doc'; import { renderCatchError } from './render-utils'; import { runtimeLogging } from './runtime-log'; diff --git a/src/runtime/bootstrap-custom-element.ts b/src/runtime/bootstrap-custom-element.ts index 27d48fecce6..fa1d0bf14a1 100644 --- a/src/runtime/bootstrap-custom-element.ts +++ b/src/runtime/bootstrap-custom-element.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { attachStyles, getScopeId, registerStyle } from './styles'; import { BUILD } from '@app-data'; import { CMP_FLAGS } from '@utils'; diff --git a/src/runtime/bootstrap-lazy.ts b/src/runtime/bootstrap-lazy.ts index c1850012f05..3a9eafdbf34 100644 --- a/src/runtime/bootstrap-lazy.ts +++ b/src/runtime/bootstrap-lazy.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { appDidLoad } from './update-component'; import { BUILD } from '@app-data'; import { CMP_FLAGS } from '@utils'; diff --git a/src/runtime/client-hydrate.ts b/src/runtime/client-hydrate.ts index ce4d5d7914a..5191ee3da82 100644 --- a/src/runtime/client-hydrate.ts +++ b/src/runtime/client-hydrate.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { BUILD } from '@app-data'; import { CONTENT_REF_ID, HYDRATE_CHILD_ID, HYDRATE_ID, NODE_TYPE, ORG_LOCATION_ID, SLOT_NODE_ID, TEXT_NODE_ID } from './runtime-constants'; import { doc, plt, supportsShadow } from '@platform'; diff --git a/src/runtime/connect.ts b/src/runtime/connect.ts index af6098e45c8..ba22161ca16 100644 --- a/src/runtime/connect.ts +++ b/src/runtime/connect.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { doc } from '@platform'; export const getConnect = (_ref: d.HostRef, tagName: string) => { diff --git a/src/runtime/connected-callback.ts b/src/runtime/connected-callback.ts index 4becb84f0f2..235213fa9d0 100644 --- a/src/runtime/connected-callback.ts +++ b/src/runtime/connected-callback.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { addHostEventListeners, doc, getHostRef, nextTick, plt, supportsShadow } from '@platform'; import { addStyle } from './styles'; import { attachToAncestor } from './update-component'; diff --git a/src/runtime/disconnected-callback.ts b/src/runtime/disconnected-callback.ts index 30a6363ed39..8a5a197ee4c 100644 --- a/src/runtime/disconnected-callback.ts +++ b/src/runtime/disconnected-callback.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { BUILD } from '@app-data'; import { getHostRef, plt } from '@platform'; import { PLATFORM_FLAGS } from './runtime-constants'; diff --git a/src/runtime/dom-extras.ts b/src/runtime/dom-extras.ts index 16cf262a9a2..1abc53aa803 100644 --- a/src/runtime/dom-extras.ts +++ b/src/runtime/dom-extras.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { BUILD } from '@app-data'; import { CMP_FLAGS, HOST_FLAGS } from '@utils'; import { PLATFORM_FLAGS } from './runtime-constants'; @@ -7,7 +7,7 @@ import { plt, supportsShadow, getHostRef } from '@platform'; export const patchCloneNode = (HostElementPrototype: any) => { const orgCloneNode = HostElementPrototype.cloneNode; - HostElementPrototype.cloneNode = function(deep?: boolean) { + HostElementPrototype.cloneNode = function (deep?: boolean) { const srcNode = this; const isShadowDom = BUILD.shadowDom ? srcNode.shadowRoot && supportsShadow : false; const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false) as Node; @@ -31,7 +31,7 @@ export const patchCloneNode = (HostElementPrototype: any) => { export const patchSlotAppendChild = (HostElementPrototype: any) => { HostElementPrototype.__appendChild = HostElementPrototype.appendChild; - HostElementPrototype.appendChild = function(this: d.RenderNode, newChild: d.RenderNode) { + HostElementPrototype.appendChild = function (this: d.RenderNode, newChild: d.RenderNode) { const slotName = (newChild['s-sn'] = getSlotName(newChild)); const slotNode = getHostSlotNode(this.childNodes, slotName); if (slotNode) { @@ -75,7 +75,7 @@ export const patchChildSlotNodes = (elm: any, cmpMeta: d.ComponentRuntimeMeta) = result.push(slot); } } - return result + return result; } return FakeNodeList.from(childNodes); }, diff --git a/src/runtime/element.ts b/src/runtime/element.ts index 8a152c2d6c6..255061ecd3a 100644 --- a/src/runtime/element.ts +++ b/src/runtime/element.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { BUILD } from '@app-data'; import { getHostRef } from '@platform'; diff --git a/src/runtime/event-emitter.ts b/src/runtime/event-emitter.ts index 36067aa0276..e6da82ca74d 100644 --- a/src/runtime/event-emitter.ts +++ b/src/runtime/event-emitter.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { BUILD } from '@app-data'; import { consoleDevWarn, plt } from '@platform'; import { EVENT_FLAGS } from '@utils'; diff --git a/src/runtime/hmr-component.ts b/src/runtime/hmr-component.ts index bf14c745ac3..bb78f605595 100644 --- a/src/runtime/hmr-component.ts +++ b/src/runtime/hmr-component.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { getHostRef } from '@platform'; import { HOST_FLAGS } from '@utils'; import { initializeComponent } from './initialize-component'; diff --git a/src/runtime/host-listener.ts b/src/runtime/host-listener.ts index 33888df3db2..224fa80d30a 100644 --- a/src/runtime/host-listener.ts +++ b/src/runtime/host-listener.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { BUILD } from '@app-data'; import { doc, plt, supportsListenerOptions, win } from '@platform'; import { HOST_FLAGS, LISTENER_FLAGS } from '@utils'; diff --git a/src/runtime/initialize-component.ts b/src/runtime/initialize-component.ts index 4dd77cf6867..15c72b84a89 100644 --- a/src/runtime/initialize-component.ts +++ b/src/runtime/initialize-component.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { BUILD } from '@app-data'; import { consoleError, loadModule, styles } from '@platform'; import { CMP_FLAGS, HOST_FLAGS } from '@utils'; diff --git a/src/runtime/mode.ts b/src/runtime/mode.ts index c49869ae0fe..8d888d0d925 100644 --- a/src/runtime/mode.ts +++ b/src/runtime/mode.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { getHostRef, modeResolutionChain } from '@platform'; // Private diff --git a/src/runtime/profile.ts b/src/runtime/profile.ts index 1a60fb03542..c9fc973d352 100644 --- a/src/runtime/profile.ts +++ b/src/runtime/profile.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { BUILD } from '@app-data'; import { getHostRef, win } from '@platform'; import { HOST_FLAGS } from '@utils'; diff --git a/src/runtime/proxy-component.ts b/src/runtime/proxy-component.ts index 97bcff42de9..e9a916b6d9e 100644 --- a/src/runtime/proxy-component.ts +++ b/src/runtime/proxy-component.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { BUILD } from '@app-data'; import { consoleDevWarn, getHostRef, plt } from '@platform'; import { getValue, setValue } from './set-value'; @@ -53,7 +53,7 @@ export const proxyComponent = (Cstr: d.ComponentConstructor, cmpMeta: d.Componen if (BUILD.observeAttribute && (!BUILD.lazyLoad || flags & PROXY_FLAGS.isElementConstructor)) { const attrNameToPropName = new Map(); - prototype.attributeChangedCallback = function(attrName: string, _oldValue: string, newValue: string) { + prototype.attributeChangedCallback = function (attrName: string, _oldValue: string, newValue: string) { plt.jmp(() => { const propName = attrNameToPropName.get(attrName); this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue; diff --git a/src/runtime/set-value.ts b/src/runtime/set-value.ts index e91a6cd06e9..fea936c9ee2 100644 --- a/src/runtime/set-value.ts +++ b/src/runtime/set-value.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { BUILD } from '@app-data'; import { consoleDevWarn, consoleError, getHostRef } from '@platform'; import { HOST_FLAGS } from '@utils'; diff --git a/src/runtime/styles.ts b/src/runtime/styles.ts index b16a999619a..a71617dc496 100644 --- a/src/runtime/styles.ts +++ b/src/runtime/styles.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { BUILD } from '@app-data'; import { CMP_FLAGS } from '@utils'; import { doc, plt, styles, supportsConstructibleStylesheets, supportsShadow } from '@platform'; diff --git a/src/runtime/test/client-hydrate-to-vdom.spec.tsx b/src/runtime/test/client-hydrate-to-vdom.spec.tsx index d11df955c04..e7ea1ec45c4 100644 --- a/src/runtime/test/client-hydrate-to-vdom.spec.tsx +++ b/src/runtime/test/client-hydrate-to-vdom.spec.tsx @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { Component, Host, h } from '@stencil/core'; import { newSpecPage } from '@stencil/core/testing'; import { initializeClientHydrate } from '../client-hydrate'; diff --git a/src/runtime/update-component.ts b/src/runtime/update-component.ts index 112f0e4a34c..1296a77a536 100644 --- a/src/runtime/update-component.ts +++ b/src/runtime/update-component.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { attachStyles } from './styles'; import { BUILD, NAMESPACE } from '@app-data'; import { CMP_FLAGS, HOST_FLAGS } from '@utils'; diff --git a/src/runtime/vdom/h.ts b/src/runtime/vdom/h.ts index 21bdbb07acb..7aced532ae7 100644 --- a/src/runtime/vdom/h.ts +++ b/src/runtime/vdom/h.ts @@ -7,7 +7,7 @@ * Modified for Stencil's compiler and vdom */ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { BUILD } from '@app-data'; import { consoleDevError, consoleDevWarn } from '@platform'; import { isComplexType } from '@utils'; @@ -124,11 +124,7 @@ export const isHost = (node: any): node is d.VNode => node && node.$tag$ === Hos const vdomFnUtils: d.FunctionalUtilities = { forEach: (children, cb) => children.map(convertToPublic).forEach(cb), - map: (children, cb) => - children - .map(convertToPublic) - .map(cb) - .map(convertToPrivate), + map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate), }; const convertToPublic = (node: d.VNode): d.ChildNode => ({ @@ -152,11 +148,7 @@ const convertToPrivate = (node: d.ChildNode): d.VNode => { vnodeData.name = node.vname; } - return h( - node.vtag, - vnodeData, - ...node.vchildren || [], - ); + return h(node.vtag, vnodeData, ...(node.vchildren || [])); } const vnode = newVNode(node.vtag as any, node.vtext); diff --git a/src/runtime/vdom/test/attributes.spec.ts b/src/runtime/vdom/test/attributes.spec.ts index f0b57199088..ea53f7b195b 100755 --- a/src/runtime/vdom/test/attributes.spec.ts +++ b/src/runtime/vdom/test/attributes.spec.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { h, newVNode } from '../h'; import { patch } from '../vdom-render'; import { SVG_NS, XLINK_NS } from '@utils'; @@ -76,7 +76,7 @@ describe('attributes', () => { }); }); - describe('svg', function() { + describe('svg', function () { it('adds correctly xlink namespaced attribute', () => { const testUrl = '/test'; const vnode1 = h( diff --git a/src/runtime/vdom/test/event-listeners.spec.ts b/src/runtime/vdom/test/event-listeners.spec.ts index 765d9ebac26..b013d4a0f97 100644 --- a/src/runtime/vdom/test/event-listeners.spec.ts +++ b/src/runtime/vdom/test/event-listeners.spec.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { h, newVNode } from '../h'; import { patch } from '../vdom-render'; diff --git a/src/runtime/vdom/test/h.spec.ts b/src/runtime/vdom/test/h.spec.ts index f3995e15255..6d9d19bef59 100644 --- a/src/runtime/vdom/test/h.spec.ts +++ b/src/runtime/vdom/test/h.spec.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { h, newVNode } from '../h'; describe('h()', () => { diff --git a/src/runtime/vdom/test/is-same-vnode.spec.ts b/src/runtime/vdom/test/is-same-vnode.spec.ts index 97f1036dbec..4cb8a80dcdd 100644 --- a/src/runtime/vdom/test/is-same-vnode.spec.ts +++ b/src/runtime/vdom/test/is-same-vnode.spec.ts @@ -1,4 +1,4 @@ -// import * as d from '../declarations'; +// import type * as d from '../declarations'; import { h } from '../h'; import { isSameVnode } from '../vdom-render'; diff --git a/src/runtime/vdom/test/patch-svg.spec.ts b/src/runtime/vdom/test/patch-svg.spec.ts index 2fd46ca20fa..ec710a79f82 100644 --- a/src/runtime/vdom/test/patch-svg.spec.ts +++ b/src/runtime/vdom/test/patch-svg.spec.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { h, newVNode } from '../h'; import { patch } from '../vdom-render'; import { SVG_NS } from '@utils'; diff --git a/src/runtime/vdom/test/patch.spec.ts b/src/runtime/vdom/test/patch.spec.ts index 052d149a69f..24003231120 100755 --- a/src/runtime/vdom/test/patch.spec.ts +++ b/src/runtime/vdom/test/patch.spec.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { h, newVNode } from '../h'; import { patch } from '../vdom-render'; import { shuffleArray } from '@stencil/core/testing'; @@ -223,7 +223,7 @@ describe('renderer', () => { prevElm.className = 'class'; const text = document.createTextNode('Foobar'); - (text).testProperty = function() { + (text).testProperty = function () { /**/ }; // ensures we dont recreate the Text Node prevElm.appendChild(text); @@ -596,7 +596,7 @@ describe('renderer', () => { const vnode1 = h( 'span', null, - ...arr.map(function(n) { + ...arr.map(function (n) { return spanNumWithOpacity(n, '1'); }), ); @@ -609,15 +609,13 @@ describe('renderer', () => { for (i = 0; i < elms; ++i) { expect(elm.children[i].innerHTML).toEqual(i.toString()); - opacities[i] = Math.random() - .toFixed(5) - .toString(); + opacities[i] = Math.random().toFixed(5).toString(); } const vnode2 = h( 'span', null, - ...arr.map(function(n) { + ...arr.map(function (n) { return spanNumWithOpacity(shufArr[n], opacities[n]); }), ); @@ -678,7 +676,7 @@ describe('renderer', () => { patch(vnode1, vnode2); expect(map(inner, hostElm.children)).toEqual( - arr.filter(function(x) { + arr.filter(function (x) { return x != null; }), ); @@ -850,7 +848,7 @@ describe('renderer', () => { }); function prop(name: any) { - return function(obj: any) { + return function (obj: any) { return obj[name]; }; } diff --git a/src/runtime/vdom/test/to-vnode.ts b/src/runtime/vdom/test/to-vnode.ts index a4e6b1a2740..633bb5e1603 100755 --- a/src/runtime/vdom/test/to-vnode.ts +++ b/src/runtime/vdom/test/to-vnode.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { NODE_TYPE } from '../../runtime-constants'; import { newVNode } from '../h'; diff --git a/src/runtime/vdom/test/update-element.spec.ts b/src/runtime/vdom/test/update-element.spec.ts index 2c1191e69c9..baae529128e 100644 --- a/src/runtime/vdom/test/update-element.spec.ts +++ b/src/runtime/vdom/test/update-element.spec.ts @@ -1,4 +1,4 @@ -import * as d from '../../../declarations'; +import type * as d from '../../../declarations'; import { NODE_TYPE } from '../../runtime-constants'; import { updateElement } from '../update-element'; import * as setAccessor from '../set-accessor'; diff --git a/src/runtime/vdom/update-element.ts b/src/runtime/vdom/update-element.ts index 97825e91aad..c6504e41d22 100644 --- a/src/runtime/vdom/update-element.ts +++ b/src/runtime/vdom/update-element.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { BUILD } from '@app-data'; import { EMPTY_OBJ } from '@utils'; import { NODE_TYPE } from '../runtime-constants'; diff --git a/src/runtime/vdom/vdom-annotations.ts b/src/runtime/vdom/vdom-annotations.ts index e7d82dfdc9c..964974600a8 100644 --- a/src/runtime/vdom/vdom-annotations.ts +++ b/src/runtime/vdom/vdom-annotations.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { CONTENT_REF_ID, HYDRATE_CHILD_ID, HYDRATE_ID, NODE_TYPE, ORG_LOCATION_ID, SLOT_NODE_ID, TEXT_NODE_ID } from '../runtime-constants'; import { getHostRef } from '@platform'; diff --git a/src/runtime/vdom/vdom-render.ts b/src/runtime/vdom/vdom-render.ts index 5390f1fe015..70d99ae40a2 100644 --- a/src/runtime/vdom/vdom-render.ts +++ b/src/runtime/vdom/vdom-render.ts @@ -6,7 +6,7 @@ * * Modified for Stencil's renderer and slot projection */ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { BUILD } from '@app-data'; import { CMP_FLAGS, HTML_NS, SVG_NS, isDef } from '@utils'; import { consoleError, doc, plt, supportsShadow } from '@platform'; diff --git a/src/screenshot/connector-base.ts b/src/screenshot/connector-base.ts index c32fa0551fd..e2dfa94c1bd 100644 --- a/src/screenshot/connector-base.ts +++ b/src/screenshot/connector-base.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/internal'; +import type * as d from '@stencil/core/internal'; import { emptyDir, fileExists, mkDir, readDir, readFile, readFileBuffer, rmDir, writeFile } from './screenshot-fs'; import { join } from 'path'; import { tmpdir } from 'os'; diff --git a/src/screenshot/connector-local.ts b/src/screenshot/connector-local.ts index ee5f7c8812b..02ae2b3f581 100644 --- a/src/screenshot/connector-local.ts +++ b/src/screenshot/connector-local.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/internal'; +import type * as d from '@stencil/core/internal'; import { fileExists, readFile, writeFile } from './screenshot-fs'; import { join, relative } from 'path'; import { normalizePath } from '@utils'; diff --git a/src/screenshot/pixel-match.ts b/src/screenshot/pixel-match.ts index 3fd07494e39..d775c31b45a 100644 --- a/src/screenshot/pixel-match.ts +++ b/src/screenshot/pixel-match.ts @@ -1,17 +1,11 @@ -import * as d from '@stencil/core/internal'; +import type * as d from '@stencil/core/internal'; import fs from 'fs'; import pixelmatch from 'pixelmatch'; import { PNG } from 'pngjs'; function getMismatchedPixels(pixelMatchInput: d.PixelMatchInput) { - const imgA = fs - .createReadStream(pixelMatchInput.imageAPath) - .pipe(new PNG()) - .on('parsed', doneReading); - const imgB = fs - .createReadStream(pixelMatchInput.imageBPath) - .pipe(new PNG()) - .on('parsed', doneReading); + const imgA = fs.createReadStream(pixelMatchInput.imageAPath).pipe(new PNG()).on('parsed', doneReading); + const imgB = fs.createReadStream(pixelMatchInput.imageBPath).pipe(new PNG()).on('parsed', doneReading); let filesRead = 0; diff --git a/src/screenshot/screenshot-compare.ts b/src/screenshot/screenshot-compare.ts index 6fd69ba52ad..13457892e4f 100644 --- a/src/screenshot/screenshot-compare.ts +++ b/src/screenshot/screenshot-compare.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/internal'; +import type * as d from '@stencil/core/internal'; import { normalizePath } from '@utils'; import { writeScreenshotData, writeScreenshotImage } from './screenshot-fs'; import { createHash } from 'crypto'; @@ -15,9 +15,7 @@ export async function compareScreenshot( testPath: string, pixelmatchThreshold: number, ) { - const currentImageHash = createHash('md5') - .update(currentScreenshotBuf) - .digest('hex'); + const currentImageHash = createHash('md5').update(currentScreenshotBuf).digest('hex'); const currentImageName = `${currentImageHash}.png`; const currentImagePath = join(screenshotBuildData.imagesDir, currentImageName); @@ -184,8 +182,5 @@ function getScreenshotId(emulateConfig: d.EmulateConfig, uniqueDescription: stri hash.update(emulateConfig.viewport.hasTouch + ':'); hash.update(emulateConfig.viewport.isMobile + ':'); - return hash - .digest('hex') - .substr(0, 8) - .toLowerCase(); + return hash.digest('hex').substr(0, 8).toLowerCase(); } diff --git a/src/screenshot/screenshot-fs.ts b/src/screenshot/screenshot-fs.ts index d3c1264c433..7426737a5f9 100644 --- a/src/screenshot/screenshot-fs.ts +++ b/src/screenshot/screenshot-fs.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/internal'; +import type * as d from '@stencil/core/internal'; import fs from 'fs'; import path from 'path'; diff --git a/src/sys/deno/deno-load-typescript.ts b/src/sys/deno/deno-load-typescript.ts deleted file mode 100644 index b555a1aaf10..00000000000 --- a/src/sys/deno/deno-load-typescript.ts +++ /dev/null @@ -1,58 +0,0 @@ -import type * as d from '../../declarations'; -import { noop } from '@utils'; -import type { System } from 'typescript'; - -export const denoLoadTypeScript = (sys: d.CompilerSystem, typescriptPath: string): any => - new Promise(async (promiseResolve, promiseReject) => { - try { - // ensure typescript compiler doesn't think it's nodejs - (globalThis as any).process.browser = true; - - // fake cjs module.exports so typescript import gets added to it - const orgModule = (globalThis as any).module; - (globalThis as any).module = { exports: {} }; - - // use actual dynamic import(), and typescript will be added to the fake module.exports - await sys.dynamicImport(typescriptPath); - - // get the typescript export from the fake cjs module.exports - const importedTs = (globalThis as any).module.exports; - - if (orgModule) { - (globalThis as any).module = orgModule; - } else { - delete (globalThis as any).module; - } - - // add our half-baked ts.sys (that'll get replaced later)// create a half-baked sys just to get us going - // later on we'll wire up ts.sys w/ the actual stencil sys - const tsSys: System = { - args: [], - createDirectory: noop, - directoryExists: p => { - const s = sys.statSync(p); - return !!s && s.isDirectory(); - }, - exit: sys.exit, - fileExists: p => { - const s = sys.statSync(p); - return !!s && s.isFile(); - }, - getCurrentDirectory: sys.getCurrentDirectory, - getDirectories: () => [], - getExecutingFilePath: () => typescriptPath, - newLine: '\n', - readDirectory: () => [], - readFile: sys.readFileSync, - resolvePath: sys.platformPath.resolve, - useCaseSensitiveFileNames: false, - write: noop, - writeFile: noop, - }; - importedTs.sys = tsSys; - - promiseResolve(importedTs); - } catch (e) { - promiseReject(e); - } - }); diff --git a/src/sys/node/node-copy-tasks.ts b/src/sys/node/node-copy-tasks.ts index 27ec5d333e9..75bdcda866f 100644 --- a/src/sys/node/node-copy-tasks.ts +++ b/src/sys/node/node-copy-tasks.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { buildError, catchError, flatOne, isGlob, normalizePath } from '@utils'; import { copyFile, mkdir, readdir, stat } from './node-fs-promisify'; import path from 'path'; diff --git a/src/sys/node/node-lazy-require.ts b/src/sys/node/node-lazy-require.ts index 9dff860ede2..e983ecf10b5 100644 --- a/src/sys/node/node-lazy-require.ts +++ b/src/sys/node/node-lazy-require.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import path from 'path'; import { NodeResolveModule } from './node-resolve-module'; import { readFile } from './node-fs-promisify'; diff --git a/src/sys/node/node-load-typescript.ts b/src/sys/node/node-load-typescript.ts deleted file mode 100644 index 50e34949281..00000000000 --- a/src/sys/node/node-load-typescript.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { requireFunc } from '@utils'; - -export const nodeLoadTypeScript = (typeScriptPath: string) => { - const nodeModuleId = typeScriptPath || 'typescript'; - return requireFunc(nodeModuleId); -}; diff --git a/src/sys/node/node-resolve-module.ts b/src/sys/node/node-resolve-module.ts index 38f2bde059d..dca14ea4bdd 100644 --- a/src/sys/node/node-resolve-module.ts +++ b/src/sys/node/node-resolve-module.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import fs from 'graceful-fs'; import path from 'path'; import { normalizePath } from '@utils'; diff --git a/src/sys/node/node-setup-process.ts b/src/sys/node/node-setup-process.ts index c8435008c06..9c25599665b 100644 --- a/src/sys/node/node-setup-process.ts +++ b/src/sys/node/node-setup-process.ts @@ -1,7 +1,7 @@ -import { Logger } from '../../declarations'; +import type { Logger } from '../../declarations'; import { shouldIgnoreError } from '@utils'; -export function setupNodeProcess(c: { process: any, logger: Logger }) { +export function setupNodeProcess(c: { process: any; logger: Logger }) { c.process.on(`unhandledRejection`, (e: any) => { if (!shouldIgnoreError(e)) { let msg = 'unhandledRejection'; diff --git a/src/sys/node/node-stencil-version-checker.ts b/src/sys/node/node-stencil-version-checker.ts index 691d7e122cb..658a699899c 100644 --- a/src/sys/node/node-stencil-version-checker.ts +++ b/src/sys/node/node-stencil-version-checker.ts @@ -1,4 +1,4 @@ -import { Logger, PackageJsonData } from '../../declarations'; +import type { Logger, PackageJsonData } from '../../declarations'; import { isString, noop } from '@utils'; import fs from 'graceful-fs'; import path from 'path'; diff --git a/src/sys/node/node-worker-main.ts b/src/sys/node/node-worker-main.ts index 6a83bea4839..497843e048c 100644 --- a/src/sys/node/node-worker-main.ts +++ b/src/sys/node/node-worker-main.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import * as cp from 'child_process'; import { EventEmitter } from 'events'; import { TASK_CANCELED_MSG } from '@utils'; diff --git a/src/sys/node/public.ts b/src/sys/node/public.ts index 18d9c6d6fb7..fee66bf018c 100644 --- a/src/sys/node/public.ts +++ b/src/sys/node/public.ts @@ -1,4 +1,4 @@ -import { CompilerSystem, Logger } from '@stencil/core/internal'; +import type { CompilerSystem, Logger } from '@stencil/core/internal'; /** * Creates a "logger", based off of NodeJS APIs, that will be used by the compiler and dev-server. diff --git a/src/testing/index.ts b/src/testing/index.ts index dff6e482149..8bc5e9eb339 100644 --- a/src/testing/index.ts +++ b/src/testing/index.ts @@ -9,6 +9,6 @@ export { newSpecPage } from './spec-page'; export { shuffleArray } from './testing-utils'; export { transpile } from './test-transpile'; -export { EventSpy, SpecPage, Testing } from '@stencil/core/internal'; +export type { EventSpy, SpecPage, Testing } from '@stencil/core/internal'; export { E2EElement, E2EPage, newE2EPage } from './puppeteer'; diff --git a/src/testing/jest/jest-config.ts b/src/testing/jest/jest-config.ts index 97c7f4c6de1..22b3de82d45 100644 --- a/src/testing/jest/jest-config.ts +++ b/src/testing/jest/jest-config.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/internal'; +import type * as d from '@stencil/core/internal'; import type { Config } from '@jest/types'; import { isString } from '@utils'; diff --git a/src/testing/jest/jest-environment.ts b/src/testing/jest/jest-environment.ts index 60745a53561..62bc7f365e6 100644 --- a/src/testing/jest/jest-environment.ts +++ b/src/testing/jest/jest-environment.ts @@ -1,4 +1,4 @@ -import { E2EProcessEnv, JestEnvironmentGlobal } from '@stencil/core/internal'; +import type { E2EProcessEnv, JestEnvironmentGlobal } from '@stencil/core/internal'; import { connectBrowser, disconnectBrowser, newBrowserPage } from '../puppeteer/puppeteer-browser'; export function createJestPuppeteerEnvironment() { diff --git a/src/testing/jest/jest-preprocessor.ts b/src/testing/jest/jest-preprocessor.ts index d5c6ca647b3..2f8c0b7ee3f 100644 --- a/src/testing/jest/jest-preprocessor.ts +++ b/src/testing/jest/jest-preprocessor.ts @@ -1,4 +1,4 @@ -import { TranspileOptions, Diagnostic } from '@stencil/core/internal'; +import type { TranspileOptions, Diagnostic } from '@stencil/core/internal'; import { loadTypeScriptDiagnostic, normalizePath } from '@utils'; import { transpile } from '../test-transpile'; import ts from 'typescript'; diff --git a/src/testing/jest/jest-runner.ts b/src/testing/jest/jest-runner.ts index 669f1e6b17f..f8182d099ee 100644 --- a/src/testing/jest/jest-runner.ts +++ b/src/testing/jest/jest-runner.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/internal'; +import type * as d from '@stencil/core/internal'; import { buildJestArgv, getProjectListFromCLIArgs } from './jest-config'; import { setScreenshotEmulateData } from '../puppeteer/puppeteer-emulate'; import type { AggregatedResult } from '@jest/test-result'; diff --git a/src/testing/jest/jest-screenshot.ts b/src/testing/jest/jest-screenshot.ts index 5e8c5e0335b..a62b3a63ba9 100644 --- a/src/testing/jest/jest-screenshot.ts +++ b/src/testing/jest/jest-screenshot.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/internal'; +import type * as d from '@stencil/core/internal'; import { runJest } from './jest-runner'; import { join } from 'path'; diff --git a/src/testing/jest/jest-setup-test-framework.ts b/src/testing/jest/jest-setup-test-framework.ts index 2cc553c1b35..99cafd9466b 100644 --- a/src/testing/jest/jest-setup-test-framework.ts +++ b/src/testing/jest/jest-setup-test-framework.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/internal'; +import type * as d from '@stencil/core/internal'; import { BUILD } from '@app-data'; import { expectExtend } from '../matchers'; import { setupGlobal, teardownGlobal } from '@stencil/core/mock-doc'; diff --git a/src/testing/jest/test/jest-config.spec.ts b/src/testing/jest/test/jest-config.spec.ts index d652f741e85..6b9a18b6f56 100644 --- a/src/testing/jest/test/jest-config.spec.ts +++ b/src/testing/jest/test/jest-config.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { buildJestArgv } from '../jest-config'; import { mockConfig } from '@stencil/core/testing'; import { parseFlags } from '../../../cli/parse-flags'; diff --git a/src/testing/jest/test/jest-runner.spec.ts b/src/testing/jest/test/jest-runner.spec.ts index fe4b77ec31f..7b694772c06 100644 --- a/src/testing/jest/test/jest-runner.spec.ts +++ b/src/testing/jest/test/jest-runner.spec.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/declarations'; +import type * as d from '@stencil/core/declarations'; import { getEmulateConfigs, includeTestFile } from '../jest-runner'; describe('jest-runner', () => { diff --git a/src/testing/matchers/events.ts b/src/testing/matchers/events.ts index 92855b4fd52..95ed856c7f2 100644 --- a/src/testing/matchers/events.ts +++ b/src/testing/matchers/events.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/internal'; +import type * as d from '@stencil/core/internal'; export function toHaveReceivedEvent(eventSpy: d.EventSpy) { if (!eventSpy) { diff --git a/src/testing/matchers/html.ts b/src/testing/matchers/html.ts index 4cfce08c292..9dddacc7b3b 100644 --- a/src/testing/matchers/html.ts +++ b/src/testing/matchers/html.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/internal'; +import type * as d from '@stencil/core/internal'; import { NODE_TYPES, parseHtmlToFragment, serializeNodeToHtml } from '@stencil/core/mock-doc'; export function toEqualHtml(input: string | HTMLElement | ShadowRoot, shouldEqual: string) { diff --git a/src/testing/matchers/screenshot.ts b/src/testing/matchers/screenshot.ts index 4a3cbc6fc38..671a91d5c24 100644 --- a/src/testing/matchers/screenshot.ts +++ b/src/testing/matchers/screenshot.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/internal'; +import type * as d from '@stencil/core/internal'; export function toMatchScreenshot(compare: d.ScreenshotDiff, opts: d.MatchScreenshotOptions = {}) { if (!compare) { diff --git a/src/testing/mocks.ts b/src/testing/mocks.ts index b8e432d61dd..5ce85d3830e 100644 --- a/src/testing/mocks.ts +++ b/src/testing/mocks.ts @@ -1,4 +1,4 @@ -import { BuildCtx, Cache, CompilerCtx, CompilerSystem, Config } from '@stencil/core/internal'; +import type { BuildCtx, Cache, CompilerCtx, CompilerSystem, Config } from '@stencil/core/internal'; import { BuildContext } from '../compiler/build/build-ctx'; import { Cache as CompilerCache } from '../compiler/cache'; import { createInMemoryFs } from '../compiler/sys/in-memory-fs'; diff --git a/src/testing/platform/testing-build.ts b/src/testing/platform/testing-build.ts index c9e19d84075..d0d3197a239 100644 --- a/src/testing/platform/testing-build.ts +++ b/src/testing/platform/testing-build.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/internal'; +import type * as d from '@stencil/core/internal'; export const Build: d.UserBuildConditionals = { isDev: true, diff --git a/src/testing/platform/testing-constants.ts b/src/testing/platform/testing-constants.ts index 07397c6e6fe..5db72f82235 100644 --- a/src/testing/platform/testing-constants.ts +++ b/src/testing/platform/testing-constants.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/internal'; +import type * as d from '@stencil/core/internal'; import { QueuedLoadModule } from './testing-task-queue'; export const styles: d.StyleMap = new Map(); diff --git a/src/testing/platform/testing-host-ref.ts b/src/testing/platform/testing-host-ref.ts index 0b485c03383..d354bfdfe51 100644 --- a/src/testing/platform/testing-host-ref.ts +++ b/src/testing/platform/testing-host-ref.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/internal'; +import type * as d from '@stencil/core/internal'; import { addHostEventListeners } from '@runtime'; import { hostRefs } from './testing-constants'; diff --git a/src/testing/platform/testing-platform.ts b/src/testing/platform/testing-platform.ts index 053f4c107a4..9fba1ac21ce 100644 --- a/src/testing/platform/testing-platform.ts +++ b/src/testing/platform/testing-platform.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/internal'; +import type * as d from '@stencil/core/internal'; import { cstrs, hostRefs, moduleLoaded, styles } from './testing-constants'; import { flushAll, resetTaskQueue } from './testing-task-queue'; import { win } from './testing-window'; diff --git a/src/testing/platform/testing-task-queue.ts b/src/testing/platform/testing-task-queue.ts index a3140894ade..928dca32de7 100644 --- a/src/testing/platform/testing-task-queue.ts +++ b/src/testing/platform/testing-task-queue.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/internal'; +import type * as d from '@stencil/core/internal'; import { caughtErrors, moduleLoaded, queuedLoadModules, queuedReadTasks, queuedTicks, queuedWriteTasks } from './testing-constants'; export function resetTaskQueue() { diff --git a/src/testing/puppeteer/index.ts b/src/testing/puppeteer/index.ts index cdbebb8d03d..ad3f9efd2b6 100644 --- a/src/testing/puppeteer/index.ts +++ b/src/testing/puppeteer/index.ts @@ -1,2 +1,2 @@ -export { E2EElement, E2EPage } from './puppeteer-declarations'; +export type { E2EElement, E2EPage } from './puppeteer-declarations'; export { newE2EPage } from './puppeteer-page'; diff --git a/src/testing/puppeteer/puppeteer-browser.ts b/src/testing/puppeteer/puppeteer-browser.ts index f3c7fcf9860..40238e44a2a 100644 --- a/src/testing/puppeteer/puppeteer-browser.ts +++ b/src/testing/puppeteer/puppeteer-browser.ts @@ -1,5 +1,5 @@ -import { Config, E2EProcessEnv } from '@stencil/core/internal'; -import * as puppeteer from 'puppeteer'; +import type { Config, E2EProcessEnv } from '@stencil/core/internal'; +import type * as puppeteer from 'puppeteer'; export async function startPuppeteerBrowser(config: Config) { if (!config.flags.e2e) { diff --git a/src/testing/puppeteer/puppeteer-declarations.ts b/src/testing/puppeteer/puppeteer-declarations.ts index 2094f26d2a3..1f76e975acc 100644 --- a/src/testing/puppeteer/puppeteer-declarations.ts +++ b/src/testing/puppeteer/puppeteer-declarations.ts @@ -1,5 +1,5 @@ -import { EventInitDict, EventSpy, ScreenshotDiff, ScreenshotOptions } from '@stencil/core/internal'; -import * as puppeteer from 'puppeteer'; +import type { EventInitDict, EventSpy, ScreenshotDiff, ScreenshotOptions } from '@stencil/core/internal'; +import type * as puppeteer from 'puppeteer'; export interface NewE2EPageOptions extends puppeteer.NavigationOptions { url?: string; diff --git a/src/testing/puppeteer/puppeteer-element.ts b/src/testing/puppeteer/puppeteer-element.ts index a7a6b3430a6..22d3809bd7a 100644 --- a/src/testing/puppeteer/puppeteer-element.ts +++ b/src/testing/puppeteer/puppeteer-element.ts @@ -1,6 +1,6 @@ -import { EventInitDict, HostElement, SerializedEvent } from '@stencil/core/internal'; -import * as pd from './puppeteer-declarations'; -import * as puppeteer from 'puppeteer'; +import type { EventInitDict, HostElement, SerializedEvent } from '@stencil/core/internal'; +import type * as pd from './puppeteer-declarations'; +import type * as puppeteer from 'puppeteer'; import { EventSpy, addE2EListener, waitForEvent } from './puppeteer-events'; import { MockHTMLElement, cloneAttributes, parseHtmlToFragment } from '@stencil/core/mock-doc'; diff --git a/src/testing/puppeteer/puppeteer-emulate.ts b/src/testing/puppeteer/puppeteer-emulate.ts index b0978a9b763..efb4f26542d 100644 --- a/src/testing/puppeteer/puppeteer-emulate.ts +++ b/src/testing/puppeteer/puppeteer-emulate.ts @@ -1,5 +1,5 @@ -import { E2EProcessEnv, EmulateConfig } from '@stencil/core/internal'; -import * as puppeteer from 'puppeteer'; +import type { E2EProcessEnv, EmulateConfig } from '@stencil/core/internal'; +import type * as puppeteer from 'puppeteer'; export function setScreenshotEmulateData(userEmulateConfig: EmulateConfig, env: E2EProcessEnv) { const screenshotEmulate: EmulateConfig = { diff --git a/src/testing/puppeteer/puppeteer-events.ts b/src/testing/puppeteer/puppeteer-events.ts index cb0e43d9aca..38c693dfd12 100644 --- a/src/testing/puppeteer/puppeteer-events.ts +++ b/src/testing/puppeteer/puppeteer-events.ts @@ -1,6 +1,6 @@ -import { SerializedEvent } from '@stencil/core/internal'; -import * as pd from './puppeteer-declarations'; -import * as puppeteer from 'puppeteer'; +import type { SerializedEvent } from '@stencil/core/internal'; +import type * as pd from './puppeteer-declarations'; +import type * as puppeteer from 'puppeteer'; export async function initPageEvents(page: pd.E2EPageInternal) { page._e2eEvents = new Map(); @@ -223,7 +223,7 @@ function browserContextEvents() { stencilReady(); } else { document.addEventListener('readystatechange', function (e) { - if ((e.target as Document).readyState == "complete") { + if ((e.target as Document).readyState == 'complete') { stencilReady(); } }); diff --git a/src/testing/puppeteer/puppeteer-page.ts b/src/testing/puppeteer/puppeteer-page.ts index 8c679df63ea..6f25238e580 100644 --- a/src/testing/puppeteer/puppeteer-page.ts +++ b/src/testing/puppeteer/puppeteer-page.ts @@ -1,9 +1,9 @@ -import { E2EProcessEnv, EmulateConfig, HostElement, JestEnvironmentGlobal } from '@stencil/core/internal'; -import { E2EPage, E2EPageInternal, FindSelector, NewE2EPageOptions, PageDiagnostic } from './puppeteer-declarations'; +import type { E2EProcessEnv, EmulateConfig, HostElement, JestEnvironmentGlobal } from '@stencil/core/internal'; +import type { E2EPage, E2EPageInternal, FindSelector, NewE2EPageOptions, PageDiagnostic } from './puppeteer-declarations'; import { find, findAll } from './puppeteer-element'; import { initPageEvents, waitForEvent } from './puppeteer-events'; import { initPageScreenshot } from './puppeteer-screenshot'; -import * as puppeteer from 'puppeteer'; +import type * as puppeteer from 'puppeteer'; declare const global: JestEnvironmentGlobal; @@ -240,7 +240,7 @@ async function e2eSetContent(page: E2EPageInternal, html: string, options: puppe } else { interceptedRequest.continue(); } - } + }; page.on('request', interceptedReqCallback); diff --git a/src/testing/puppeteer/puppeteer-screenshot.ts b/src/testing/puppeteer/puppeteer-screenshot.ts index e3fa1bc5393..21c2ae97524 100644 --- a/src/testing/puppeteer/puppeteer-screenshot.ts +++ b/src/testing/puppeteer/puppeteer-screenshot.ts @@ -1,7 +1,7 @@ -import { E2EProcessEnv, EmulateConfig, JestEnvironmentGlobal, ScreenshotBuildData, ScreenshotDiff, ScreenshotOptions } from '@stencil/core/internal'; +import type { E2EProcessEnv, EmulateConfig, JestEnvironmentGlobal, ScreenshotBuildData, ScreenshotDiff, ScreenshotOptions } from '@stencil/core/internal'; import { compareScreenshot } from '../../screenshot/screenshot-compare'; -import * as pd from './puppeteer-declarations'; -import * as puppeteer from 'puppeteer'; +import type * as pd from './puppeteer-declarations'; +import type * as puppeteer from 'puppeteer'; export function initPageScreenshot(page: pd.E2EPageInternal) { const env = process.env as E2EProcessEnv; diff --git a/src/testing/reset-build-conditionals.ts b/src/testing/reset-build-conditionals.ts index 0015e6d9b9c..e885289737c 100644 --- a/src/testing/reset-build-conditionals.ts +++ b/src/testing/reset-build-conditionals.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/internal'; +import type * as d from '@stencil/core/internal'; export function resetBuildConditionals(b: d.BuildConditionals) { Object.keys(b).forEach(key => { diff --git a/src/testing/spec-page.ts b/src/testing/spec-page.ts index 1acc0e84a9c..163455b6704 100644 --- a/src/testing/spec-page.ts +++ b/src/testing/spec-page.ts @@ -16,7 +16,15 @@ import { setSupportsShadowDom, } from '@stencil/core/internal/testing'; import { BUILD } from '@app-data'; -import { ComponentCompilerMeta, ComponentRuntimeMeta, ComponentTestingConstructor, HostRef, LazyBundlesRuntimeData, NewSpecPageOptions, SpecPage } from '@stencil/core/internal'; +import type { + ComponentCompilerMeta, + ComponentRuntimeMeta, + ComponentTestingConstructor, + HostRef, + LazyBundlesRuntimeData, + NewSpecPageOptions, + SpecPage, +} from '@stencil/core/internal'; import { formatLazyBundleRuntimeMeta } from '@utils'; import { getBuildFeatures } from '../compiler/app-core/app-data'; import { resetBuildConditionals } from './reset-build-conditionals'; diff --git a/src/testing/test-transpile.ts b/src/testing/test-transpile.ts index 9bb5d43bbcf..83ffe0bdd8d 100644 --- a/src/testing/test-transpile.ts +++ b/src/testing/test-transpile.ts @@ -1,5 +1,5 @@ import { transpileSync } from '@stencil/core/compiler'; -import { TranspileOptions, TranspileResults } from '@stencil/core/internal'; +import type { TranspileOptions, TranspileResults } from '@stencil/core/internal'; import { isString } from '@utils'; export function transpile(input: string, opts: TranspileOptions = {}): TranspileResults { diff --git a/src/testing/testing-logger.ts b/src/testing/testing-logger.ts index d56bf2b4f44..b1e3117b418 100644 --- a/src/testing/testing-logger.ts +++ b/src/testing/testing-logger.ts @@ -1,4 +1,4 @@ -import { Diagnostic, Logger, LogLevel, LoggerTimeSpan } from '@stencil/core/internal'; +import type { Diagnostic, Logger, LogLevel, LoggerTimeSpan } from '@stencil/core/internal'; export class TestingLogger implements Logger { private isEnabled = false; diff --git a/src/testing/testing-utils.ts b/src/testing/testing-utils.ts index 37d148d4a2b..b8b5c721336 100644 --- a/src/testing/testing-utils.ts +++ b/src/testing/testing-utils.ts @@ -1,4 +1,4 @@ -import * as d from '@stencil/core/internal'; +import type * as d from '@stencil/core/internal'; import { isOutputTargetDistLazy, isOutputTargetWww } from '../compiler/output-targets/output-utils'; import { join, relative } from 'path'; diff --git a/src/testing/testing.ts b/src/testing/testing.ts index b8174c6185a..828a4645c20 100644 --- a/src/testing/testing.ts +++ b/src/testing/testing.ts @@ -1,11 +1,11 @@ -import { CompilerBuildResults, Compiler, Config, DevServer, E2EProcessEnv, OutputTargetWww, Testing, TestingRunOptions } from '@stencil/core/internal'; +import type { CompilerBuildResults, Compiler, Config, DevServer, E2EProcessEnv, OutputTargetWww, Testing, TestingRunOptions } from '@stencil/core/internal'; import { getAppScriptUrl, getAppStyleUrl } from './testing-utils'; import { hasError } from '@utils'; import { runJest } from './jest/jest-runner'; import { runJestScreenshot } from './jest/jest-screenshot'; import { startPuppeteerBrowser } from './puppeteer/puppeteer-browser'; import { start } from '@stencil/core/dev-server'; -import * as puppeteer from 'puppeteer'; +import type * as puppeteer from 'puppeteer'; export const createTesting = async (config: Config): Promise => { config = setupTestingConfig(config); diff --git a/src/utils/format-component-runtime-meta.ts b/src/utils/format-component-runtime-meta.ts index 1f246e76f3c..b1d3d4be726 100644 --- a/src/utils/format-component-runtime-meta.ts +++ b/src/utils/format-component-runtime-meta.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { CMP_FLAGS, LISTENER_FLAGS, MEMBER_FLAGS } from './constants'; export const formatLazyBundleRuntimeMeta = (bundleId: any, cmps: d.ComponentCompilerMeta[]): d.LazyBundleRuntimeData => { diff --git a/src/utils/logger/logger-minify-js.ts b/src/utils/logger/logger-minify-js.ts index d82cf0df61d..5642aeb90fd 100644 --- a/src/utils/logger/logger-minify-js.ts +++ b/src/utils/logger/logger-minify-js.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { splitLineBreaks } from './logger-utils'; export function loadMinifyJsDiagnostics(sourceText: string, result: d.MinifyJsResult, diagnostics: d.Diagnostic[]) { diff --git a/src/utils/logger/logger-rollup.ts b/src/utils/logger/logger-rollup.ts index 5a09c4861a6..db18cc0b480 100644 --- a/src/utils/logger/logger-rollup.ts +++ b/src/utils/logger/logger-rollup.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { buildWarn } from '../message-utils'; import { isString, toTitleCase } from '../helpers'; import { splitLineBreaks } from './logger-utils'; diff --git a/src/utils/logger/logger-typescript.ts b/src/utils/logger/logger-typescript.ts index 89dc038ab73..068ec0f3c78 100644 --- a/src/utils/logger/logger-typescript.ts +++ b/src/utils/logger/logger-typescript.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; import { isIterable } from '../helpers'; import { normalizePath } from '../normalize-path'; import { splitLineBreaks } from './logger-utils'; diff --git a/src/utils/logger/logger-utils.ts b/src/utils/logger/logger-utils.ts index 773e8578793..4b62cf37a07 100644 --- a/src/utils/logger/logger-utils.ts +++ b/src/utils/logger/logger-utils.ts @@ -1,4 +1,4 @@ -import * as d from '../../declarations'; +import type * as d from '../../declarations'; export const normalizeDiagnostics = (compilerCtx: d.CompilerCtx, diagnostics: d.Diagnostic[]) => { const normalizedErrors: d.Diagnostic[] = []; @@ -107,12 +107,7 @@ export const escapeHtml = (unsafe: any) => { unsafe = unsafe.toString(); } - return unsafe - .replace(/&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"') - .replace(/'/g, '''); + return unsafe.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"').replace(/'/g, '''); }; export const MAX_ERRORS = 25; diff --git a/src/utils/message-utils.ts b/src/utils/message-utils.ts index 0f95b802a28..86315b19df3 100644 --- a/src/utils/message-utils.ts +++ b/src/utils/message-utils.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { isString } from './helpers'; export const buildError = (diagnostics?: d.Diagnostic[]) => { diff --git a/src/utils/util.ts b/src/utils/util.ts index 0a956690ca5..279bcb05098 100644 --- a/src/utils/util.ts +++ b/src/utils/util.ts @@ -1,4 +1,4 @@ -import * as d from '../declarations'; +import type * as d from '../declarations'; import { BANNER } from './constants'; import { buildError } from './message-utils'; import { dashToPascalCase, isString, toDashCase } from './helpers';