@stencil/core 3.0.1-dev.1677273625.4fe628d → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/index.cjs +3 -2
- package/cli/index.cjs.map +1 -0
- package/cli/index.js +3 -2
- package/cli/index.js.map +1 -0
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +3931 -591
- package/compiler/stencil.js.map +1 -0
- package/compiler/stencil.min.js +2 -2
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/open-in-editor-api.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/dev-server/ws.js +1 -1
- package/internal/app-data/package.json +1 -1
- package/internal/client/css-shim.js +1 -1
- package/internal/client/dom.js +1 -1
- package/internal/client/index.js +1 -1
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +2 -2
- package/internal/client/patch-esm.js +1 -1
- package/internal/client/shadow-css.js +1 -1
- package/internal/hydrate/package.json +1 -1
- package/internal/package.json +1 -1
- package/internal/stencil-private.d.ts +4 -0
- package/internal/stencil-public-compiler.d.ts +16 -1
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +1 -1
- package/mock-doc/index.js +1 -1
- package/mock-doc/package.json +1 -1
- package/package.json +7 -6
- package/screenshot/package.json +1 -1
- package/sys/node/autoprefixer.js +2 -2
- package/sys/node/glob.js +1 -1
- package/sys/node/graceful-fs.js +1 -1
- package/sys/node/index.js +1 -1
- package/sys/node/node-fetch.js +1 -1
- package/sys/node/package.json +1 -1
- package/sys/node/prompts.js +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +365 -361
- package/testing/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/utils/helpers.ts","../src/utils/message-utils.ts","../src/utils/normalize-path.ts","../src/utils/util.ts","../src/utils/validation.ts","../src/declarations/stencil-public-compiler.ts","../src/cli/config-flags.ts","../src/cli/parse-flags.ts","../src/compiler/sys/environment.ts","../src/compiler/sys/logger/console-logger.ts","../src/cli/find-config.ts","../src/cli/load-compiler.ts","../src/cli/logs.ts","../src/cli/check-version.ts","../src/cli/task-prerender.ts","../src/cli/task-watch.ts","../src/compiler/output-targets/output-utils.ts","../src/cli/telemetry/helpers.ts","../src/cli/ionic-config.ts","../src/cli/telemetry/shouldTrack.ts","../src/cli/telemetry/telemetry.ts","../src/cli/task-build.ts","../src/cli/task-docs.ts","../src/cli/task-generate.ts","../src/cli/task-telemetry.ts","../src/cli/task-help.ts","../src/cli/task-info.ts","../src/cli/task-serve.ts","../src/cli/task-test.ts","../src/cli/run.ts"],"sourcesContent":["export const isDef = (v: any) => v != null;\n\n/**\n * Convert a string from PascalCase to dash-case\n *\n * @param str the string to convert\n * @returns a converted string\n */\nexport const toDashCase = (str: string): string =>\n str\n .replace(/([A-Z0-9])/g, (match) => ` ${match[0]}`)\n .trim()\n .split(' ')\n .join('-')\n .toLowerCase();\n\n/**\n * Convert a string from dash-case / kebab-case to PascalCase (or CamelCase,\n * or whatever you call it!)\n *\n * @param str a string to convert\n * @returns a converted string\n */\nexport const dashToPascalCase = (str: string): string =>\n str\n .toLowerCase()\n .split('-')\n .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))\n .join('');\n\n/**\n * Convert a string to 'camelCase'\n *\n * @param str the string to convert\n * @returns the converted string\n */\nexport const toCamelCase = (str: string) => {\n const pascalCase = dashToPascalCase(str);\n return pascalCase.charAt(0).toLowerCase() + pascalCase.slice(1);\n};\n\n/**\n * Capitalize the first letter of a string\n *\n * @param str the string to capitalize\n * @returns a capitalized string\n */\nexport const toTitleCase = (str: string): string => str.charAt(0).toUpperCase() + str.slice(1);\n\n/**\n * This is just a no-op, don't expect it to do anything.\n */\nexport const noop = (): any => {\n /* noop*/\n};\n\n/**\n * Check whether a value is a 'complex type', defined here as an object or a\n * function.\n *\n * @param o the value to check\n * @returns whether it's a complex type or not\n */\nexport const isComplexType = (o: unknown): boolean => {\n // https://jsperf.com/typeof-fn-object/5\n o = typeof o;\n return o === 'object' || o === 'function';\n};\n\n/**\n * Sort an array without mutating it in-place (as `Array.prototype.sort`\n * unfortunately does)\n *\n * @param array the array you'd like to sort\n * @param prop a function for deriving sortable values (strings or numbers)\n * from array members\n * @returns a new array of all items `x` in `array` ordered by `prop(x)`\n */\nexport const sortBy = <T>(array: T[], prop: (item: T) => string | number): T[] => {\n return array.slice().sort((a, b) => {\n const nameA = prop(a);\n const nameB = prop(b);\n if (nameA < nameB) return -1;\n if (nameA > nameB) return 1;\n return 0;\n });\n};\n\n/**\n * A polyfill of sorts for `Array.prototype.flat` which will return the result\n * of calling that method if present and, if not, return an equivalent based on\n * `Array.prototype.reduce`.\n *\n * @param array the array to flatten (one level)\n * @returns a flattened array\n */\nexport const flatOne = <T>(array: T[][]): T[] => {\n if (array.flat) {\n return array.flat(1);\n }\n return array.reduce((result, item) => {\n result.push(...item);\n return result;\n }, [] as T[]);\n};\n\n/**\n * Deduplicate an array, retaining items at the earliest position in which\n * they appear.\n *\n * So `unique([1,3,2,1,1,4])` would be `[1,3,2,4]`.\n *\n * @param array the array to deduplicate\n * @param predicate an optional function used to generate the key used to\n * determine uniqueness\n * @returns a new, deduplicated array\n */\nexport const unique = <T, K>(array: T[], predicate: (item: T) => K = (i) => i as any): T[] => {\n const set = new Set();\n return array.filter((item) => {\n const key = predicate(item);\n if (key == null) {\n return true;\n }\n if (set.has(key)) {\n return false;\n }\n set.add(key);\n return true;\n });\n};\n\n/**\n * A utility for building an object from an iterable very similar to\n * `Object.fromEntries`\n *\n * @param entries an iterable object holding entries (key-value tuples) to\n * plop into a new object\n * @returns an object containing those entries\n */\nexport const fromEntries = <V>(entries: IterableIterator<[string, V]>) => {\n const object: Record<string, V> = {};\n for (const [key, value] of entries) {\n object[key] = value;\n }\n return object;\n};\n\n/**\n * Based on a given object, create a new object which has only the specified\n * key-value pairs included in it.\n *\n * @param obj the object from which to take values\n * @param keys a set of keys to take\n * @returns an object mapping `key` to `obj[key]` if `obj[key]` is truthy for\n * every `key` in `keys`\n */\nexport const pluck = (obj: { [key: string]: any }, keys: string[]) => {\n return keys.reduce((final, key) => {\n if (obj[key]) {\n final[key] = obj[key];\n }\n return final;\n }, {} as { [key: string]: any });\n};\n\nconst isDefined = (v: any): v is NonNullable<typeof v> => v !== null && v !== undefined;\nexport const isBoolean = (v: any): v is boolean => typeof v === 'boolean';\nexport const isFunction = (v: any): v is Function => typeof v === 'function';\nexport const isNumber = (v: any): v is number => typeof v === 'number';\nexport const isObject = (val: Object): val is Object =>\n val != null && typeof val === 'object' && Array.isArray(val) === false;\nexport const isString = (v: any): v is string => typeof v === 'string';\nexport const isIterable = <T>(v: any): v is Iterable<T> => isDefined(v) && isFunction(v[Symbol.iterator]);\nexport const isPromise = <T = any>(v: any): v is Promise<T> =>\n !!v && (typeof v === 'object' || typeof v === 'function') && typeof v.then === 'function';\n","import type * as d from '../declarations';\nimport { isString } from './helpers';\n\n/**\n * Builds a template `Diagnostic` entity for a build error. The created `Diagnostic` is returned, and have little\n * detail attached to it regarding the specifics of the error - it is the responsibility of the caller of this method\n * to attach the specifics of the error message.\n *\n * The created `Diagnostic` is pushed to the `diagnostics` argument as a side effect of calling this method.\n *\n * @param diagnostics the existing diagnostics that the created template `Diagnostic` should be added to\n * @returns the created `Diagnostic`\n */\nexport const buildError = (diagnostics?: d.Diagnostic[]): d.Diagnostic => {\n const diagnostic: d.Diagnostic = {\n level: 'error',\n type: 'build',\n header: 'Build Error',\n messageText: 'build error',\n relFilePath: null,\n absFilePath: null,\n lines: [],\n };\n\n if (diagnostics) {\n diagnostics.push(diagnostic);\n }\n\n return diagnostic;\n};\n\n/**\n * Builds a template `Diagnostic` entity for a build warning. The created `Diagnostic` is returned, and have little\n * detail attached to it regarding the specifics of the warning - it is the responsibility of the caller of this method\n * to attach the specifics of the warning message.\n *\n * The created `Diagnostic` is pushed to the `diagnostics` argument as a side effect of calling this method.\n *\n * @param diagnostics the existing diagnostics that the created template `Diagnostic` should be added to\n * @returns the created `Diagnostic`\n */\nexport const buildWarn = (diagnostics: d.Diagnostic[]): d.Diagnostic => {\n const diagnostic: d.Diagnostic = {\n level: 'warn',\n type: 'build',\n header: 'Build Warn',\n messageText: 'build warn',\n relFilePath: null,\n absFilePath: null,\n lines: [],\n };\n\n diagnostics.push(diagnostic);\n\n return diagnostic;\n};\n\n/**\n * Create a diagnostic message suited for representing an error in a JSON\n * file. This includes information about the exact lines in the JSON file which\n * caused the error and the path to the file.\n *\n * @param compilerCtx the current compiler context\n * @param diagnostics a list of diagnostics used as a return param\n * @param jsonFilePath the path to the JSON file where the error occurred\n * @param msg the error message\n * @param jsonField the key for the field which caused the error, used for finding\n * the error line in the original JSON file\n * @returns a reference to the newly-created diagnostic\n */\nexport const buildJsonFileError = (\n compilerCtx: d.CompilerCtx,\n diagnostics: d.Diagnostic[],\n jsonFilePath: string,\n msg: string,\n jsonField: string\n) => {\n const err = buildError(diagnostics);\n err.messageText = msg;\n err.absFilePath = jsonFilePath;\n\n if (typeof jsonField === 'string') {\n try {\n const jsonStr = compilerCtx.fs.readFileSync(jsonFilePath);\n const lines = jsonStr.replace(/\\r/g, '\\n').split('\\n');\n\n for (let i = 0; i < lines.length; i++) {\n const txtLine = lines[i];\n const txtIndex = txtLine.indexOf(jsonField);\n\n if (txtIndex > -1) {\n const warnLine: d.PrintLine = {\n lineIndex: i,\n lineNumber: i + 1,\n text: txtLine,\n errorCharStart: txtIndex,\n errorLength: jsonField.length,\n };\n err.lineNumber = warnLine.lineNumber;\n err.columnNumber = txtIndex + 1;\n err.lines.push(warnLine);\n\n if (i >= 0) {\n const beforeWarnLine: d.PrintLine = {\n lineIndex: warnLine.lineIndex - 1,\n lineNumber: warnLine.lineNumber - 1,\n text: lines[i - 1],\n errorCharStart: -1,\n errorLength: -1,\n };\n err.lines.unshift(beforeWarnLine);\n }\n\n if (i < lines.length) {\n const afterWarnLine: d.PrintLine = {\n lineIndex: warnLine.lineIndex + 1,\n lineNumber: warnLine.lineNumber + 1,\n text: lines[i + 1],\n errorCharStart: -1,\n errorLength: -1,\n };\n err.lines.push(afterWarnLine);\n }\n\n break;\n }\n }\n } catch (e) {}\n }\n\n return err;\n};\n\n/**\n * Builds a diagnostic from an `Error`, appends it to the `diagnostics` parameter, and returns the created diagnostic\n * @param diagnostics the series of diagnostics the newly created diagnostics should be added to\n * @param err the error to derive information from in generating the diagnostic\n * @param msg an optional message to use in place of `err` to generate the diagnostic\n * @returns the generated diagnostic\n */\nexport const catchError = (diagnostics: d.Diagnostic[], err: Error | null | undefined, msg?: string): d.Diagnostic => {\n const diagnostic: d.Diagnostic = {\n level: 'error',\n type: 'build',\n header: 'Build Error',\n messageText: 'build error',\n relFilePath: null,\n absFilePath: null,\n lines: [],\n };\n\n if (isString(msg)) {\n diagnostic.messageText = msg.length ? msg : 'UNKNOWN ERROR';\n } else if (err != null) {\n if (err.stack != null) {\n diagnostic.messageText = err.stack.toString();\n } else {\n if (err.message != null) {\n diagnostic.messageText = err.message.length ? err.message : 'UNKNOWN ERROR';\n } else {\n diagnostic.messageText = err.toString();\n }\n }\n }\n\n if (diagnostics != null && !shouldIgnoreError(diagnostic.messageText)) {\n diagnostics.push(diagnostic);\n }\n\n return diagnostic;\n};\n\n/**\n * Determine if the provided diagnostics have any build errors\n * @param diagnostics the diagnostics to inspect\n * @returns true if any of the diagnostics in the list provided are errors that did not occur at runtime. false\n * otherwise.\n */\nexport const hasError = (diagnostics: d.Diagnostic[]): boolean => {\n if (diagnostics == null || diagnostics.length === 0) {\n return false;\n }\n return diagnostics.some((d) => d.level === 'error' && d.type !== 'runtime');\n};\n\n/**\n * Determine if the provided diagnostics have any warnings\n * @param diagnostics the diagnostics to inspect\n * @returns true if any of the diagnostics in the list provided are warnings. false otherwise.\n */\nexport const hasWarning = (diagnostics: d.Diagnostic[]): boolean => {\n if (diagnostics == null || diagnostics.length === 0) {\n return false;\n }\n return diagnostics.some((d) => d.level === 'warn');\n};\n\nexport const shouldIgnoreError = (msg: any) => {\n return msg === TASK_CANCELED_MSG;\n};\n\nexport const TASK_CANCELED_MSG = `task canceled`;\n","/**\n * Convert Windows backslash paths to slash paths: foo\\\\bar ➔ foo/bar\n * Forward-slash paths can be used in Windows as long as they're not\n * extended-length paths and don't contain any non-ascii characters.\n * This was created since the path methods in Node.js outputs \\\\ paths on Windows.\n * @param path the Windows-based path to convert\n * @returns the converted path\n */\nexport const normalizePath = (path: string): string => {\n if (typeof path !== 'string') {\n throw new Error(`invalid path to normalize`);\n }\n path = normalizeSlashes(path.trim());\n\n const components = pathComponents(path, getRootLength(path));\n const reducedComponents = reducePathComponents(components);\n const rootPart = reducedComponents[0];\n const secondPart = reducedComponents[1];\n const normalized = rootPart + reducedComponents.slice(1).join('/');\n\n if (normalized === '') {\n return '.';\n }\n if (\n rootPart === '' &&\n secondPart &&\n path.includes('/') &&\n !secondPart.startsWith('.') &&\n !secondPart.startsWith('@')\n ) {\n return './' + normalized;\n }\n return normalized;\n};\n\nconst normalizeSlashes = (path: string) => path.replace(backslashRegExp, '/');\n\nconst altDirectorySeparator = '\\\\';\nconst urlSchemeSeparator = '://';\nconst backslashRegExp = /\\\\/g;\n\nconst reducePathComponents = (components: readonly string[]) => {\n if (!Array.isArray(components) || components.length === 0) {\n return [];\n }\n const reduced = [components[0]];\n for (let i = 1; i < components.length; i++) {\n const component = components[i];\n if (!component) continue;\n if (component === '.') continue;\n if (component === '..') {\n if (reduced.length > 1) {\n if (reduced[reduced.length - 1] !== '..') {\n reduced.pop();\n continue;\n }\n } else if (reduced[0]) continue;\n }\n reduced.push(component);\n }\n return reduced;\n};\n\nconst getRootLength = (path: string) => {\n const rootLength = getEncodedRootLength(path);\n return rootLength < 0 ? ~rootLength : rootLength;\n};\n\nconst getEncodedRootLength = (path: string): number => {\n if (!path) return 0;\n const ch0 = path.charCodeAt(0);\n\n // POSIX or UNC\n if (ch0 === CharacterCodes.slash || ch0 === CharacterCodes.backslash) {\n if (path.charCodeAt(1) !== ch0) return 1; // POSIX: \"/\" (or non-normalized \"\\\")\n\n const p1 = path.indexOf(ch0 === CharacterCodes.slash ? '/' : altDirectorySeparator, 2);\n if (p1 < 0) return path.length; // UNC: \"//server\" or \"\\\\server\"\n\n return p1 + 1; // UNC: \"//server/\" or \"\\\\server\\\"\n }\n\n // DOS\n if (isVolumeCharacter(ch0) && path.charCodeAt(1) === CharacterCodes.colon) {\n const ch2 = path.charCodeAt(2);\n if (ch2 === CharacterCodes.slash || ch2 === CharacterCodes.backslash) return 3; // DOS: \"c:/\" or \"c:\\\"\n if (path.length === 2) return 2; // DOS: \"c:\" (but not \"c:d\")\n }\n\n // URL\n const schemeEnd = path.indexOf(urlSchemeSeparator);\n if (schemeEnd !== -1) {\n const authorityStart = schemeEnd + urlSchemeSeparator.length;\n const authorityEnd = path.indexOf('/', authorityStart);\n if (authorityEnd !== -1) {\n // URL: \"file:///\", \"file://server/\", \"file://server/path\"\n // For local \"file\" URLs, include the leading DOS volume (if present).\n // Per https://www.ietf.org/rfc/rfc1738.txt, a host of \"\" or \"localhost\" is a\n // special case interpreted as \"the machine from which the URL is being interpreted\".\n const scheme = path.slice(0, schemeEnd);\n const authority = path.slice(authorityStart, authorityEnd);\n if (\n scheme === 'file' &&\n (authority === '' || authority === 'localhost') &&\n isVolumeCharacter(path.charCodeAt(authorityEnd + 1))\n ) {\n const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2);\n if (volumeSeparatorEnd !== -1) {\n if (path.charCodeAt(volumeSeparatorEnd) === CharacterCodes.slash) {\n // URL: \"file:///c:/\", \"file://localhost/c:/\", \"file:///c%3a/\", \"file://localhost/c%3a/\"\n return ~(volumeSeparatorEnd + 1);\n }\n if (volumeSeparatorEnd === path.length) {\n // URL: \"file:///c:\", \"file://localhost/c:\", \"file:///c$3a\", \"file://localhost/c%3a\"\n // but not \"file:///c:d\" or \"file:///c%3ad\"\n return ~volumeSeparatorEnd;\n }\n }\n }\n return ~(authorityEnd + 1); // URL: \"file://server/\", \"http://server/\"\n }\n return ~path.length; // URL: \"file://server\", \"http://server\"\n }\n\n // relative\n return 0;\n};\n\nconst isVolumeCharacter = (charCode: number) =>\n (charCode >= CharacterCodes.a && charCode <= CharacterCodes.z) ||\n (charCode >= CharacterCodes.A && charCode <= CharacterCodes.Z);\n\nconst getFileUrlVolumeSeparatorEnd = (url: string, start: number) => {\n const ch0 = url.charCodeAt(start);\n if (ch0 === CharacterCodes.colon) return start + 1;\n if (ch0 === CharacterCodes.percent && url.charCodeAt(start + 1) === CharacterCodes._3) {\n const ch2 = url.charCodeAt(start + 2);\n if (ch2 === CharacterCodes.a || ch2 === CharacterCodes.A) return start + 3;\n }\n return -1;\n};\n\nconst pathComponents = (path: string, rootLength: number) => {\n const root = path.substring(0, rootLength);\n const rest = path.substring(rootLength).split('/');\n const restLen = rest.length;\n if (restLen > 0 && !rest[restLen - 1]) {\n rest.pop();\n }\n return [root, ...rest];\n};\n\n/**\n * Same as normalizePath(), expect it'll also strip any query strings\n * from the path name. So /dir/file.css?tag=cmp-a becomes /dir/file.css\n * @param p the path to normalize\n * @returns the normalized path, sans any query strings\n */\nexport const normalizeFsPath = (p: string) => normalizePath(p.split('?')[0].replace(/\\0/g, ''));\n\nexport const normalizeFsPathQuery = (importPath: string) => {\n const pathParts = importPath.split('?');\n const filePath = normalizePath(pathParts[0]);\n const ext = filePath.split('.').pop().toLowerCase();\n const params = pathParts.length > 1 ? new URLSearchParams(pathParts[1]) : null;\n const format = params ? params.get('format') : null;\n\n return {\n filePath,\n ext,\n params,\n format,\n };\n};\n\nconst enum CharacterCodes {\n a = 0x61,\n A = 0x41,\n z = 0x7a,\n Z = 0x5a,\n _3 = 0x33,\n\n backslash = 0x5c, // \\\n colon = 0x3a, // :\n dot = 0x2e, // .\n percent = 0x25, // %\n slash = 0x2f, // /\n}\n","import type * as d from '../declarations';\nimport { dashToPascalCase, isString, toDashCase } from './helpers';\nimport { buildError } from './message-utils';\n\n/**\n * A set of JSDoc tags which should be excluded from JSDoc comments\n * included in output typedefs.\n */\nconst SUPPRESSED_JSDOC_TAGS: ReadonlyArray<string> = ['virtualProp', 'slot', 'part', 'internal'];\n\n/**\n * Create a stylistically-appropriate JS variable name from a filename\n *\n * If the filename has any of the special characters \"?\", \"#\", \"&\" and \"=\" it\n * will take the string before the left-most instance of one of those\n * characters.\n *\n * @param fileName the filename which serves as starting material\n * @returns a JS variable name based on the filename\n */\nexport const createJsVarName = (fileName: string): string => {\n if (isString(fileName)) {\n fileName = fileName.split('?')[0];\n fileName = fileName.split('#')[0];\n fileName = fileName.split('&')[0];\n fileName = fileName.split('=')[0];\n fileName = toDashCase(fileName);\n fileName = fileName.replace(/[|;$%@\"<>()+,.{}_\\!\\/\\\\]/g, '-');\n fileName = dashToPascalCase(fileName);\n\n if (fileName.length > 1) {\n fileName = fileName[0].toLowerCase() + fileName.slice(1);\n } else {\n fileName = fileName.toLowerCase();\n }\n\n if (fileName.length > 0 && !isNaN(fileName[0] as any)) {\n fileName = '_' + fileName;\n }\n }\n return fileName;\n};\n\n/**\n * Determines if a given file path points to a type declaration file (ending in .d.ts) or not. This function is\n * case-insensitive in its heuristics.\n * @param filePath the path to check\n * @returns `true` if the given `filePath` points to a type declaration file, `false` otherwise\n */\nexport const isDtsFile = (filePath: string): boolean => {\n const parts = filePath.toLowerCase().split('.');\n if (parts.length > 2) {\n return parts[parts.length - 2] === 'd' && parts[parts.length - 1] === 'ts';\n }\n return false;\n};\n\n/**\n * Generate the preamble to be placed atop the main file of the build\n * @param config the Stencil configuration file\n * @returns the generated preamble\n */\nexport const generatePreamble = (config: d.Config): string => {\n const { preamble } = config;\n\n if (!preamble) {\n return '';\n }\n\n // generate the body of the JSDoc-style comment\n const preambleComment: string[] = preamble.split('\\n').map((l) => ` * ${l}`);\n\n preambleComment.unshift(`/*!`);\n preambleComment.push(` */`);\n\n return preambleComment.join('\\n');\n};\n\nconst lineBreakRegex = /\\r?\\n|\\r/g;\nexport function getTextDocs(docs: d.CompilerJsDoc | undefined | null) {\n if (docs == null) {\n return '';\n }\n return `${docs.text.replace(lineBreakRegex, ' ')}\n${docs.tags\n .filter((tag) => tag.name !== 'internal')\n .map((tag) => `@${tag.name} ${(tag.text || '').replace(lineBreakRegex, ' ')}`)\n .join('\\n')}`.trim();\n}\n\n/**\n * Adds a doc block to a string\n * @param str the string to add a doc block to\n * @param docs the compiled JS docs\n * @param indentation number of spaces to indent the block with\n * @returns the doc block\n */\nexport function addDocBlock(str: string, docs?: d.CompilerJsDoc, indentation: number = 0): string {\n if (!docs) {\n return str;\n }\n\n return [formatDocBlock(docs, indentation), str].filter(Boolean).join(`\\n`);\n}\n\n/**\n * Formats the given compiled docs to a JavaScript doc block\n * @param docs the compiled JS docs\n * @param indentation number of spaces to indent the block with\n * @returns the formatted doc block\n */\nfunction formatDocBlock(docs: d.CompilerJsDoc, indentation: number = 0): string {\n const textDocs = getDocBlockLines(docs);\n if (!textDocs.filter(Boolean).length) {\n return '';\n }\n\n const spaces = new Array(indentation + 1).join(' ');\n\n return [spaces + '/**', ...textDocs.map((line) => spaces + ` * ${line}`), spaces + ' */'].join(`\\n`);\n}\n\n/**\n * Get all lines which are part of the doc block\n *\n * @param docs the compiled JS docs\n * @returns list of lines part of the doc block\n */\nfunction getDocBlockLines(docs: d.CompilerJsDoc): string[] {\n return [\n ...docs.text.split(lineBreakRegex),\n ...docs.tags\n .filter((tag) => !SUPPRESSED_JSDOC_TAGS.includes(tag.name))\n .map((tag) => `@${tag.name} ${tag.text || ''}`.split(lineBreakRegex)),\n ]\n .flat()\n .filter(Boolean);\n}\n\n/**\n * Retrieve a project's dependencies from the current build context\n * @param buildCtx the current build context to query for a specific package\n * @returns a list of package names the project is dependent on\n */\nconst getDependencies = (buildCtx: d.BuildCtx): ReadonlyArray<string> => {\n if (buildCtx.packageJson != null && buildCtx.packageJson.dependencies != null) {\n return Object.keys(buildCtx.packageJson.dependencies).filter((pkgName) => !SKIP_DEPS.includes(pkgName));\n }\n return [];\n};\n\n/**\n * Utility to determine whether a project has a dependency on a package\n * @param buildCtx the current build context to query for a specific package\n * @param depName the name of the dependency/package\n * @returns `true` if the project has a dependency a packaged with the provided name, `false` otherwise\n */\nexport const hasDependency = (buildCtx: d.BuildCtx, depName: string): boolean => {\n return getDependencies(buildCtx).includes(depName);\n};\n\n// TODO(STENCIL-661): Remove code related to the dynamic import shim\nexport const getDynamicImportFunction = (namespace: string) => `__sc_import_${namespace.replace(/\\s|-/g, '_')}`;\n\nexport const readPackageJson = async (config: d.ValidatedConfig, compilerCtx: d.CompilerCtx, buildCtx: d.BuildCtx) => {\n try {\n const pkgJson = await compilerCtx.fs.readFile(config.packageJsonFilePath);\n\n if (pkgJson) {\n const parseResults = parsePackageJson(pkgJson, config.packageJsonFilePath);\n if (parseResults.diagnostic) {\n buildCtx.diagnostics.push(parseResults.diagnostic);\n } else {\n buildCtx.packageJson = parseResults.data;\n }\n }\n } catch (e) {\n if (!config.outputTargets.some((o) => o.type.includes('dist'))) {\n const diagnostic = buildError(buildCtx.diagnostics);\n diagnostic.header = `Missing \"package.json\"`;\n diagnostic.messageText = `Valid \"package.json\" file is required for distribution: ${config.packageJsonFilePath}`;\n }\n }\n};\n\n/**\n * A type that describes the result of parsing a `package.json` file's contents\n */\nexport type ParsePackageJsonResult = {\n diagnostic: d.Diagnostic | null;\n data: any | null;\n filePath: string;\n};\n\n/**\n * Parse a string read from a `package.json` file\n * @param pkgJsonStr the string read from a `package.json` file\n * @param pkgJsonFilePath the path to the already read `package.json` file\n * @returns the results of parsing the provided contents of the `package.json` file\n */\nexport const parsePackageJson = (pkgJsonStr: string, pkgJsonFilePath: string): ParsePackageJsonResult => {\n const parseResult: ParsePackageJsonResult = {\n diagnostic: null,\n data: null,\n filePath: pkgJsonFilePath,\n };\n\n try {\n parseResult.data = JSON.parse(pkgJsonStr);\n } catch (e) {\n parseResult.diagnostic = buildError();\n parseResult.diagnostic.absFilePath = isString(pkgJsonFilePath) ? pkgJsonFilePath : undefined;\n parseResult.diagnostic.header = `Error Parsing JSON`;\n if (e instanceof Error) {\n parseResult.diagnostic.messageText = e.message;\n }\n }\n\n return parseResult;\n};\n\nconst SKIP_DEPS = ['@stencil/core'];\n\n/**\n * Check whether a string is a member of a ReadonlyArray<string>\n *\n * We need a little helper for this because unfortunately `includes` is typed\n * on `ReadonlyArray<T>` as `(el: T): boolean` so a `string` cannot be passed\n * to `includes` on a `ReadonlyArray` 😢 thus we have a little helper function\n * where we do the type coercion just once.\n *\n * see microsoft/TypeScript#31018 for some discussion of this\n *\n * @param readOnlyArray the array we're checking\n * @param maybeMember a value which is possibly a member of the array\n * @returns whether the array contains the member or not\n */\nexport const readOnlyArrayHasStringMember = <T extends string>(\n readOnlyArray: ReadonlyArray<T>,\n maybeMember: T | string\n): maybeMember is T => readOnlyArray.includes(maybeMember as (typeof readOnlyArray)[number]);\n","/**\n * Validates that a component tag meets required naming conventions to be used for a web component\n * @param tag the tag to validate\n * @returns an error message if the tag has an invalid name, undefined if the tag name passes all checks\n */\nexport const validateComponentTag = (tag: string): string | undefined => {\n // we want to check this first since we call some String.prototype methods below\n if (typeof tag !== 'string') {\n return `Tag \"${tag}\" must be a string type`;\n }\n if (tag !== tag.trim()) {\n return `Tag can not contain white spaces`;\n }\n if (tag !== tag.toLowerCase()) {\n return `Tag can not contain upper case characters`;\n }\n if (tag.length === 0) {\n return `Received empty tag value`;\n }\n\n if (tag.indexOf(' ') > -1) {\n return `\"${tag}\" tag cannot contain a space`;\n }\n\n if (tag.indexOf(',') > -1) {\n return `\"${tag}\" tag cannot be used for multiple tags`;\n }\n\n const invalidChars = tag.replace(/\\w|-/g, '');\n if (invalidChars !== '') {\n return `\"${tag}\" tag contains invalid characters: ${invalidChars}`;\n }\n\n if (tag.indexOf('-') === -1) {\n return `\"${tag}\" tag must contain a dash (-) to work as a valid web component`;\n }\n\n if (tag.indexOf('--') > -1) {\n return `\"${tag}\" tag cannot contain multiple dashes (--) next to each other`;\n }\n\n if (tag.indexOf('-') === 0) {\n return `\"${tag}\" tag cannot start with a dash (-)`;\n }\n\n if (tag.lastIndexOf('-') === tag.length - 1) {\n return `\"${tag}\" tag cannot end with a dash (-)`;\n }\n return undefined;\n};\n","import type { ConfigFlags } from '../cli/config-flags';\nimport type { PrerenderUrlResults, PrintLine } from '../internal';\nimport type { JsonDocs } from './stencil-public-docs';\n\nexport * from './stencil-public-docs';\n\n/**\n * https://stenciljs.com/docs/config/\n */\nexport interface StencilConfig {\n /**\n * By default, Stencil will attempt to optimize small scripts by inlining them in HTML. Setting\n * this flag to `false` will prevent this optimization and keep all scripts separate from HTML.\n */\n allowInlineScripts?: boolean;\n /**\n * By setting `autoprefixCss` to `true`, Stencil will use the appropriate config to automatically\n * prefix css. For example, developers can write modern and standard css properties, such as\n * \"transform\", and Stencil will automatically add in the prefixed version, such as \"-webkit-transform\".\n * As of Stencil v2, autoprefixing CSS is no longer the default.\n * Defaults to `false`\n */\n autoprefixCss?: boolean | any;\n\n /**\n * By default, Stencil will statically analyze the application and generate a component graph of\n * how all the components are interconnected.\n *\n * From the component graph it is able to best decide how components should be grouped\n * depending on their usage with one another within the app.\n * By doing so it's able to bundle components together in order to reduce network requests.\n * However, bundles can be manually generated using the bundles config.\n *\n * The bundles config is an array of objects that represent how components are grouped together\n * in lazy-loaded bundles.\n * This config is rarely needed as Stencil handles this automatically behind the scenes.\n */\n bundles?: ConfigBundle[];\n\n /**\n * Stencil will cache build results in order to speed up rebuilds.\n * To disable this feature, set enableCache to false.\n */\n enableCache?: boolean;\n\n /**\n * Stencil is traditionally used to compile many components into an app,\n * and each component comes with its own compartmentalized styles.\n * However, it's still common to have styles which should be \"global\" across all components and the website.\n * A global CSS file is often useful to set CSS Variables.\n *\n * Additionally, the globalStyle config can be used to precompile styles with Sass, PostCss, etc.\n * Below is an example folder structure containing a webapp's global sass file, named app.css.\n */\n globalStyle?: string;\n\n /**\n * When the hashFileNames config is set to true, and it is a production build,\n * the hashedFileNameLength config is used to determine how many characters the file name's hash should be.\n */\n hashedFileNameLength?: number;\n\n /**\n * During production builds, the content of each generated file is hashed to represent the content,\n * and the hashed value is used as the filename. If the content isn't updated between builds,\n * then it receives the same filename. When the content is updated, then the filename is different.\n *\n * By doing this, deployed apps can \"forever-cache\" the build directory and take full advantage of\n * content delivery networks (CDNs) and heavily caching files for faster apps.\n */\n hashFileNames?: boolean;\n\n /**\n * The namespace config is a string representing a namespace for the app.\n * For apps that are not meant to be a library of reusable components,\n * the default of App is just fine. However, if the app is meant to be consumed\n * as a third-party library, such as Ionic, a unique namespace is required.\n */\n namespace?: string;\n\n /**\n * Stencil is able to take an app's source and compile it to numerous targets,\n * such as an app to be deployed on an http server, or as a third-party library\n * to be distributed on npm. By default, Stencil apps have an output target type of www.\n *\n * The outputTargets config is an array of objects, with types of www and dist.\n */\n outputTargets?: OutputTarget[];\n\n /**\n * The plugins config can be used to add your own rollup plugins.\n * By default, Stencil does not come with Sass or PostCss support.\n * However, either can be added using the plugin array.\n */\n plugins?: any[];\n\n /**\n * Generate js source map files for all bundles\n */\n sourceMap?: boolean;\n\n /**\n * The srcDir config specifies the directory which should contain the source typescript files\n * for each component. The standard for Stencil apps is to use src, which is the default.\n */\n srcDir?: string;\n\n /**\n * Sets whether or not Stencil should transform path aliases set in a project's\n * `tsconfig.json` from the assigned module aliases to resolved relative paths.\n *\n * This behavior is opt-in and hence this flag defaults to `false`.\n */\n transformAliasedImportPaths?: boolean;\n\n /**\n * Passes custom configuration down to the \"@rollup/plugin-commonjs\" that Stencil uses under the hood.\n * For further information: https://stenciljs.com/docs/module-bundling\n */\n commonjs?: BundlingConfig;\n\n /**\n * Passes custom configuration down to the \"@rollup/plugin-node-resolve\" that Stencil uses under the hood.\n * For further information: https://stenciljs.com/docs/module-bundling\n */\n nodeResolve?: NodeResolveConfig;\n\n /**\n * Passes custom configuration down to rollup itself, not all rollup options can be overridden.\n */\n rollupConfig?: RollupConfig;\n\n /**\n * Sets if the ES5 build should be generated or not. Stencil generates a modern build without ES5,\n * whereas this setting to `true` will also create es5 builds for both dev and prod modes. Setting\n * `buildEs5` to `prod` will only build ES5 in prod mode. Basically if the app does not need to run\n * on legacy browsers (IE11 and Edge 18 and below), it's safe to not build ES5, which will also speed\n * up build times. Defaults to `false`.\n */\n buildEs5?: boolean | 'prod';\n\n /**\n * Sets if the JS browser files are minified or not. Stencil uses `terser` under the hood.\n * Defaults to `false` in dev mode and `true` in production mode.\n */\n minifyJs?: boolean;\n\n /**\n * Sets if the CSS is minified or not.\n * Defaults to `false` in dev mode and `true` in production mode.\n */\n minifyCss?: boolean;\n\n /**\n * Forces Stencil to run in `dev` mode if the value is `true` and `production` mode\n * if it's `false`.\n *\n * Defaults to `false` (ie. production) unless the `--dev` flag is used in the CLI.\n */\n devMode?: boolean;\n\n /**\n * Object to provide a custom logger. By default a `logger` is already provided for the\n * platform the compiler is running on, such as NodeJS or a browser.\n */\n logger?: Logger;\n\n /**\n * Config to add extra runtime for DOM features that require more polyfills. Note\n * that not all DOM APIs are fully polyfilled when using the slot polyfill. These\n * are opt-in since not all users will require the additional runtime.\n */\n extras?: ConfigExtras;\n\n /**\n * The hydrated flag identifies if a component and all of its child components\n * have finished hydrating. This helps prevent any flash of unstyled content (FOUC)\n * as various components are asynchronously downloaded and rendered. By default it\n * will add the `hydrated` CSS class to the element. The `hydratedFlag` config can be used\n * to change the name of the CSS class, change it to an attribute, or change which\n * type of CSS properties and values are assigned before and after hydrating. This config\n * can also be used to not include the hydrated flag at all by setting it to `null`.\n */\n hydratedFlag?: HydratedFlag | null;\n\n /**\n * Ionic prefers to hide all components prior to hydration with a style tag appended\n * to the head of the document containing some `visibility: hidden;` css rules.\n *\n * Disabling this will remove the style tag that sets `visibility: hidden;` on all\n * unhydrated web components. This more closely follows the HTML spec, and allows\n * you to set your own fallback content.\n *\n */\n invisiblePrehydration?: boolean;\n\n /**\n * Sets the task queue used by stencil's runtime. The task queue schedules DOM read and writes\n * across the frames to efficiently render and reduce layout thrashing. By default,\n * `async` is used. It's recommended to also try each setting to decide which works\n * best for your use-case. In all cases, if your app has many CPU intensive tasks causing the\n * main thread to periodically lock-up, it's always recommended to try\n * [Web Workers](https://stenciljs.com/docs/web-workers) for those tasks.\n *\n * - `async`: DOM read and writes are scheduled in the next frame to prevent layout thrashing.\n * During intensive CPU tasks it will not reschedule rendering to happen in the next frame.\n * `async` is ideal for most apps, and if the app has many intensive tasks causing the main\n * thread to lock-up, it's recommended to try [Web Workers](https://stenciljs.com/docs/web-workers)\n * rather than the congestion async queue.\n *\n * - `congestionAsync`: DOM reads and writes are scheduled in the next frame to prevent layout\n * thrashing. When the app is heavily tasked and the queue becomes congested it will then\n * split the work across multiple frames to prevent blocking the main thread. However, it can\n * also introduce unnecessary reflows in some cases, especially during startup. `congestionAsync`\n * is ideal for apps running animations while also simultaneously executing intensive tasks\n * which may lock-up the main thread.\n *\n * - `immediate`: Makes writeTask() and readTask() callbacks to be executed synchronously. Tasks\n * are not scheduled to run in the next frame, but do note there is at least one microtask.\n * The `immediate` setting is ideal for apps that do not provide long running and smooth\n * animations. Like the async setting, if the app has intensive tasks causing the main thread\n * to lock-up, it's recommended to try [Web Workers](https://stenciljs.com/docs/web-workers).\n */\n taskQueue?: 'async' | 'immediate' | 'congestionAsync';\n\n /**\n * Provide a object of key/values accessible within the app, using the `Env` object.\n */\n env?: { [prop: string]: string | undefined };\n\n globalScript?: string;\n srcIndexHtml?: string;\n watch?: boolean;\n testing?: TestingConfig;\n maxConcurrentWorkers?: number;\n preamble?: string;\n rollupPlugins?: { before?: any[]; after?: any[] };\n\n entryComponentsHint?: string[];\n buildDist?: boolean;\n buildLogFilePath?: string;\n cacheDir?: string;\n devInspector?: boolean;\n devServer?: StencilDevServerConfig;\n enableCacheStats?: boolean;\n sys?: CompilerSystem;\n tsconfig?: string;\n validateTypes?: boolean;\n /**\n * An array of RegExp patterns that are matched against all source files before adding\n * to the watch list in watch mode. If the file path matches any of the patterns, when it\n * is updated, it will not trigger a re-run of tests.\n */\n watchIgnoredRegex?: RegExp | RegExp[];\n /**\n * Set whether unused dependencies should be excluded from the built output.\n */\n excludeUnusedDependencies?: boolean;\n stencilCoreResolvedId?: string;\n}\n\nexport interface ConfigExtras {\n /**\n * By default, the slot polyfill does not update `appendChild()` so that it appends\n * new child nodes into the correct child slot like how shadow dom works. This is an opt-in\n * polyfill for those who need it when using `element.appendChild(node)` and expecting the\n * child to be appended in the same location shadow dom would. This is not required for\n * IE11 or Edge 18, but can be enabled if the app is using `appendChild()`. Defaults to `false`.\n */\n appendChildSlotFix?: boolean;\n\n /**\n * By default, the runtime does not polyfill `cloneNode()` when cloning a component\n * that uses the slot polyfill. This is an opt-in polyfill for those who need it.\n * This is not required for IE11 or Edge 18, but can be enabled if the app is using\n * `cloneNode()` and unexpected node are being cloned due to the slot polyfill\n * simulating shadow dom. Defaults to `false`.\n */\n cloneNodeFix?: boolean;\n\n // TODO(STENCIL-659): Remove code implementing the CSS variable shim\n /**\n * Include the CSS Custom Property polyfill/shim for legacy browsers. ESM builds will\n * not include the css vars shim. Defaults to `false`\n *\n * @deprecated Since Stencil v3.0.0. IE 11, Edge <= 18, and old Safari\n * versions are no longer supported.\n */\n __deprecated__cssVarsShim?: boolean;\n\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n /**\n * Dynamic `import()` shim. This is only needed for Edge 18 and below, and\n * Firefox 67 and below. Defaults to `false`.\n * @deprecated Since Stencil v3.0.0. IE 11, Edge <= 18, and old Safari\n * versions are no longer supported.\n */\n __deprecated__dynamicImportShim?: boolean;\n\n /**\n * Experimental flag. Projects that use a Stencil library built using the `dist` output target may have trouble lazily\n * loading components when using a bundler such as Vite or Parcel. Setting this flag to `true` will change how Stencil\n * lazily loads components in a way that works with additional bundlers. Setting this flag to `true` will increase\n * the size of the compiled output. Defaults to `false`.\n */\n experimentalImportInjection?: boolean;\n\n /**\n * Dispatches component lifecycle events. Mainly used for testing. Defaults to `false`.\n */\n lifecycleDOMEvents?: boolean;\n\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n /**\n * Safari 10 supports ES modules with `<script type=\"module\">`, however, it did not implement\n * `<script nomodule>`. When set to `true`, the runtime will patch support for Safari 10\n * due to its lack of `nomodule` support.\n * Defaults to `false`.\n *\n * @deprecated Since Stencil v3.0.0, Safari 10 is no longer supported.\n */\n __deprecated__safari10?: boolean;\n\n /**\n * It is possible to assign data to the actual `<script>` element's `data-opts` property,\n * which then gets passed to Stencil's initial bootstrap. This feature is only required\n * for very special cases and rarely needed. Defaults to `false`.\n */\n scriptDataOpts?: boolean;\n\n /**\n * Experimental flag to align the behavior of invoking `textContent` on a scoped component to act more like a\n * component that uses the shadow DOM. Defaults to `false`\n */\n scopedSlotTextContentFix?: boolean;\n\n // TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field\n /**\n * If enabled `true`, the runtime will check if the shadow dom shim is required. However,\n * if it's determined that shadow dom is already natively supported by the browser then\n * it does not request the shim. When set to `false` it will avoid all shadow dom tests.\n * Defaults to `false`.\n *\n * @deprecated Since Stencil v3.0.0. IE 11, Edge <= 18, and old Safari versions\n * are no longer supported.\n */\n __deprecated__shadowDomShim?: boolean;\n\n /**\n * When a component is first attached to the DOM, this setting will wait a single tick before\n * rendering. This works around an Angular issue, where Angular attaches the elements before\n * settings their initial state, leading to double renders and unnecessary event dispatches.\n * Defaults to `false`.\n */\n initializeNextTick?: boolean;\n\n /**\n * For browsers that do not support shadow dom (IE11 and Edge 18 and below), slot is polyfilled\n * to simulate the same behavior. However, the host element's `childNodes` and `children`\n * getters are not patched to only show the child nodes and elements of the default slot.\n * Defaults to `false`.\n */\n slotChildNodesFix?: boolean;\n\n /**\n * Enables the tagNameTransform option of `defineCustomElements()`, so the component tagName\n * can be customized at runtime. Defaults to `false`.\n */\n tagNameTransform?: boolean;\n}\n\nexport interface Config extends StencilConfig {\n buildAppCore?: boolean;\n buildDocs?: boolean;\n configPath?: string;\n writeLog?: boolean;\n devServer?: DevServerConfig;\n flags?: ConfigFlags;\n fsNamespace?: string;\n logLevel?: LogLevel;\n rootDir?: string;\n packageJsonFilePath?: string;\n suppressLogs?: boolean;\n profile?: boolean;\n tsCompilerOptions?: any;\n _isValidated?: boolean;\n _isTesting?: boolean;\n}\n\n/**\n * A 'loose' type useful for wrapping an incomplete / possible malformed\n * object as we work on getting it comply with a particular Interface T.\n *\n * Example:\n *\n * ```ts\n * interface Foo {\n * bar: string\n * }\n *\n * function validateFoo(foo: Loose<Foo>): Foo {\n * let validatedFoo = {\n * ...foo,\n * bar: foo.bar || DEFAULT_BAR\n * }\n *\n * return validatedFoo\n * }\n * ```\n *\n * Use this when you need to take user input or something from some other part\n * of the world that we don't control and transform it into something\n * conforming to a given interface. For best results, pair with a validation\n * function as shown in the example.\n */\ntype Loose<T extends Object> = Record<string, any> & Partial<T>;\n\n/**\n * A Loose version of the Config interface. This is intended to let us load a partial config\n * and have type information carry though as we construct an object which is a valid `Config`.\n */\nexport type UnvalidatedConfig = Loose<Config>;\n\n/**\n * Helper type to strip optional markers from keys in a type, while preserving other type information for the key.\n * This type takes a union of keys, K, in type T to allow for the type T to be gradually updated.\n *\n * ```typescript\n * type Foo { bar?: number, baz?: string }\n * type ReqFieldFoo = RequireFields<Foo, 'bar'>; // { bar: number, baz?: string }\n * ```\n */\ntype RequireFields<T, K extends keyof T> = T & { [P in K]-?: T[P] };\n\n/**\n * Fields in {@link Config} to make required for {@link ValidatedConfig}\n */\ntype StrictConfigFields =\n | 'flags'\n | 'hydratedFlag'\n | 'logger'\n | 'outputTargets'\n | 'packageJsonFilePath'\n | 'rootDir'\n | 'sys'\n | 'testing'\n | 'transformAliasedImportPaths';\n\n/**\n * A version of {@link Config} that makes certain fields required. This type represents a valid configuration entity.\n * When a configuration is received by the user, it is a bag of unverified data. In order to make stricter guarantees\n * about the data from a type-safety perspective, this type is intended to be used throughout the codebase once\n * validations have occurred at runtime.\n */\nexport type ValidatedConfig = RequireFields<Config, StrictConfigFields>;\n\nexport interface HydratedFlag {\n /**\n * Defaults to `hydrated`.\n */\n name?: string;\n /**\n * Can be either `class` or `attribute`. Defaults to `class`.\n */\n selector?: 'class' | 'attribute';\n /**\n * The CSS property used to show and hide components. Defaults to use the CSS `visibility`\n * property. Other commonly used CSS properties would be `display` with the `initialValue`\n * setting as `none`, or `opacity` with the `initialValue` as `0`. Defaults to `visibility`\n * and the default `initialValue` is `hidden`.\n */\n property?: string;\n /**\n * This is the CSS value to give all components before it has been hydrated.\n * Defaults to `hidden`.\n */\n initialValue?: string;\n /**\n * This is the CSS value to assign once a component has finished hydrating.\n * This is the CSS value that'll allow the component to show. Defaults to `inherit`.\n */\n hydratedValue?: string;\n}\n\nexport interface StencilDevServerConfig {\n /**\n * IP address used by the dev server. The default is `0.0.0.0`, which points to all IPv4 addresses\n * on the local machine, such as `localhost`.\n */\n address?: string;\n /**\n * Base path to be used by the server. Defaults to the root pathname.\n */\n basePath?: string;\n /**\n * EXPERIMENTAL!\n * During development, node modules can be independently requested and bundled, making for\n * faster build times. This is only available using the Stencil Dev Server throughout\n * development. Production builds and builds with the `es5` flag will override\n * this setting to `false`. Default is `false`.\n */\n experimentalDevModules?: boolean;\n /**\n * If the dev server should respond with gzip compressed content. Defaults to `true`.\n */\n gzip?: boolean;\n /**\n * When set, the dev server will run via https using the SSL certificate and key you provide\n * (use `fs` if you want to read them from files).\n */\n https?: Credentials;\n /**\n * The URL the dev server should first open to. Defaults to `/`.\n */\n initialLoadUrl?: string;\n /**\n * When `true`, every request to the server will be logged within the terminal.\n * Defaults to `false`.\n */\n logRequests?: boolean;\n /**\n * By default, when dev server is started the local dev URL is opened in your default browser.\n * However, to prevent this URL to be opened change this value to `false`. Defaults to `true`.\n */\n openBrowser?: boolean;\n /**\n * Sets the server's port. Defaults to `3333`.\n */\n port?: number;\n /**\n * When files are watched and updated, by default the dev server will use `hmr` (Hot Module Replacement)\n * to update the page without a full page refresh. To have the page do a full refresh use `pageReload`.\n * To disable any reloading, use `null`. Defaults to `hmr`.\n */\n reloadStrategy?: PageReloadStrategy;\n /**\n * Local path to a NodeJs file with a dev server request listener as the default export.\n * The user's request listener is given the first chance to handle every request the dev server\n * receives, and can choose to handle it or instead pass it on to the default dev server\n * by calling `next()`.\n *\n * Below is an example of a NodeJs file the `requestListenerPath` config is using.\n * The request and response arguments are the same as Node's `http` module and `RequestListener`\n * callback. https://nodejs.org/api/http.html#http_http_createserver_options_requestlistener\n *\n * ```js\n * module.exports = function (req, res, next) {\n * if (req.url === '/ping') {\n * // custom response overriding the dev server\n * res.setHeader('Content-Type', 'text/plain');\n * res.writeHead(200);\n * res.end('pong');\n * } else {\n * // pass request on to the default dev server\n * next();\n * }\n * };\n * ```\n */\n requestListenerPath?: string;\n /**\n * The root directory to serve the files from.\n */\n root?: string;\n /**\n * If the dev server should Server-Side Render (SSR) each page, meaning it'll dynamically generate\n * server-side rendered html on each page load. The `--ssr` flag will most commonly be used with\n * the`--dev --watch --serve` flags during development. Note that this is for development purposes\n * only, and the built-in dev server should not be used for production. Defaults to `false`.\n */\n ssr?: boolean;\n /**\n * If the dev server fails to start up within the given timeout (in milliseconds), the startup will\n * be canceled. Set to zero to disable the timeout. Defaults to `15000`.\n */\n startupTimeout?: number;\n /**\n * Whether to use the dev server's websocket client or not. Defaults to `true`.\n */\n websocket?: boolean;\n /**\n * If the dev server should fork a worker for the server process or not. A singled-threaded dev server\n * is slower, however it is useful for debugging http requests and responses. Defaults to `true`.\n */\n worker?: boolean;\n}\n\nexport interface DevServerConfig extends StencilDevServerConfig {\n browserUrl?: string;\n devServerDir?: string;\n /**\n * A list of glob patterns like `subdir/*.js` to exclude from hot-module\n * reloading updates.\n */\n excludeHmr?: string[];\n historyApiFallback?: HistoryApiFallback;\n openBrowser?: boolean;\n prerenderConfig?: string;\n protocol?: 'http' | 'https';\n srcIndexHtml?: string;\n}\n\nexport interface HistoryApiFallback {\n index?: string;\n disableDotRule?: boolean;\n}\n\nexport interface DevServerEditor {\n id: string;\n name?: string;\n supported?: boolean;\n priority?: number;\n}\n\nexport type TaskCommand =\n | 'build'\n | 'docs'\n | 'generate'\n | 'g'\n | 'help'\n | 'info'\n | 'prerender'\n | 'serve'\n | 'telemetry'\n | 'test'\n | 'version';\n\nexport type PageReloadStrategy = 'hmr' | 'pageReload' | null;\n\n/**\n * The prerender config is used when prerendering a `www` output target.\n * Within `stencil.config.ts`, set the path to the prerendering\n * config file path using the `prerenderConfig` property, such as:\n *\n * ```tsx\n * import { Config } from '@stencil/core';\n * export const config: Config = {\n * outputTargets: [\n * {\n * type: 'www',\n * baseUrl: 'https://stenciljs.com/',\n * prerenderConfig: './prerender.config.ts',\n * }\n * ]\n * };\n * ```\n *\n * The `prerender.config.ts` should export a `config` object using\n * the `PrerenderConfig` interface.\n *\n * ```tsx\n * import { PrerenderConfig } from '@stencil/core';\n * export const config: PrerenderConfig = {\n * ...\n * };\n * ```\n *\n * For more info: https://stenciljs.com/docs/static-site-generation\n */\nexport interface PrerenderConfig {\n /**\n * Run after each `document` is hydrated, but before it is serialized\n * into an HTML string. Hook is passed the `document` and its `URL`.\n */\n afterHydrate?(document: Document, url: URL, results: PrerenderUrlResults): any | Promise<any>;\n /**\n * Run before each `document` is hydrated. Hook is passed the `document` it's `URL`.\n */\n beforeHydrate?(document: Document, url: URL): any | Promise<any>;\n /**\n * Runs after the template Document object has serialize into an\n * HTML formatted string. Returns an HTML string to be used as the\n * base template for all prerendered pages.\n */\n afterSerializeTemplate?(html: string): string | Promise<string>;\n /**\n * Runs before the template Document object is serialize into an\n * HTML formatted string. Returns the Document to be serialized which\n * will become the base template html for all prerendered pages.\n */\n beforeSerializeTemplate?(document: Document): Document | Promise<Document>;\n /**\n * A hook to be used to generate the canonical `<link>` tag\n * which goes in the `<head>` of every prerendered page. Returning `null`\n * will not add a canonical url tag to the page.\n */\n canonicalUrl?(url: URL): string | null;\n /**\n * While prerendering, crawl same-origin URLs found within `<a href>` elements.\n * Defaults to `true`.\n */\n crawlUrls?: boolean;\n /**\n * URLs to start the prerendering from. By default the root URL of `/` is used.\n */\n entryUrls?: string[];\n /**\n * Return `true` the given `<a>` element should be crawled or not.\n */\n filterAnchor?(attrs: { [attrName: string]: string }, base?: URL): boolean;\n /**\n * Return `true` if the given URL should be prerendered or not.\n */\n filterUrl?(url: URL, base: URL): boolean;\n /**\n * Returns the file path which the prerendered HTML content\n * should be written to.\n */\n filePath?(url: URL, filePath: string): string;\n /**\n * Returns the hydrate options to use for each individual prerendered page.\n */\n hydrateOptions?(url: URL): PrerenderHydrateOptions;\n /**\n * Returns the template file's content. The template is the base\n * HTML used for all prerendered pages.\n */\n loadTemplate?(filePath: string): string | Promise<string>;\n /**\n * Used to normalize the page's URL from a given a string and the current\n * page's base URL. Largely used when reading an anchor's `href` attribute\n * value and normalizing it into a `URL`.\n */\n normalizeUrl?(href: string, base: URL): URL;\n robotsTxt?(opts: RobotsTxtOpts): string | RobotsTxtResults;\n sitemapXml?(opts: SitemapXmpOpts): string | SitemapXmpResults;\n /**\n * Static Site Generated (SSG). Does not include Stencil's clientside\n * JavaScript, custom elements or preload modules.\n */\n staticSite?: boolean;\n /**\n * If the prerenndered URLs should have a trailing \"/\"\" or not. Defaults to `false`.\n */\n trailingSlash?: boolean;\n}\n\nexport interface HydrateDocumentOptions {\n /**\n * Build ID that will be added to `<html data-stencil-build=\"BUILD_ID\">`. By default\n * a random ID will be generated\n */\n buildId?: string;\n /**\n * Sets the `href` attribute on the `<link rel=\"canonical\">`\n * tag within the `<head>`. If the value is not defined it will\n * ensure a canonical link tag is no included in the `<head>`.\n */\n canonicalUrl?: string;\n /**\n * Include the HTML comments and attributes used by the clientside\n * JavaScript to read the structure of the HTML and rebuild each\n * component. Defaults to `true`.\n */\n clientHydrateAnnotations?: boolean;\n /**\n * Constrain `setTimeout()` to 1ms, but still async. Also\n * only allows `setInterval()` to fire once, also constrained to 1ms.\n * Defaults to `true`.\n */\n constrainTimeouts?: boolean;\n /**\n * Sets `document.cookie`\n */\n cookie?: string;\n /**\n * Sets the `dir` attribute on the top level `<html>`.\n */\n direction?: string;\n /**\n * Component tag names listed here will not be prerendered, nor will\n * hydrated on the clientside. Components listed here will be ignored\n * as custom elements and treated no differently than a `<div>`.\n */\n excludeComponents?: string[];\n /**\n * Sets the `lang` attribute on the top level `<html>`.\n */\n language?: string;\n /**\n * Maximum number of components to hydrate on one page. Defaults to `300`.\n */\n maxHydrateCount?: number;\n /**\n * Sets `document.referrer`\n */\n referrer?: string;\n /**\n * Removes every `<script>` element found in the `document`. Defaults to `false`.\n */\n removeScripts?: boolean;\n /**\n * Removes CSS not used by elements within the `document`. Defaults to `true`.\n */\n removeUnusedStyles?: boolean;\n /**\n * The url the runtime uses for the resources, such as the assets directory.\n */\n resourcesUrl?: string;\n /**\n * Prints out runtime console logs to the NodeJS process. Defaults to `false`.\n */\n runtimeLogging?: boolean;\n /**\n * Component tags listed here will only be prerendered or serverside-rendered\n * and will not be clientside hydrated. This is useful for components that\n * are not dynamic and do not need to be defined as a custom element within the\n * browser. For example, a header or footer component would be a good example that\n * may not require any clientside JavaScript.\n */\n staticComponents?: string[];\n /**\n * The amount of milliseconds to wait for a page to finish rendering until\n * a timeout error is thrown. Defaults to `15000`.\n */\n timeout?: number;\n /**\n * Sets `document.title`.\n */\n title?: string;\n /**\n * Sets `location.href`\n */\n url?: string;\n /**\n * Sets `navigator.userAgent`\n */\n userAgent?: string;\n}\n\nexport interface SerializeDocumentOptions extends HydrateDocumentOptions {\n /**\n * Runs after the `document` has been hydrated.\n */\n afterHydrate?(document: any): any | Promise<any>;\n /**\n * Sets an approximate line width the HTML should attempt to stay within.\n * Note that this is \"approximate\", in that HTML may often not be able\n * to be split at an exact line width. Additionally, new lines created\n * is where HTML naturally already has whitespace, such as before an\n * attribute or spaces between words. Defaults to `100`.\n */\n approximateLineWidth?: number;\n /**\n * Runs before the `document` has been hydrated.\n */\n beforeHydrate?(document: any): any | Promise<any>;\n /**\n * Format the HTML in a nicely indented format.\n * Defaults to `false`.\n */\n prettyHtml?: boolean;\n /**\n * Remove quotes from attribute values when possible.\n * Defaults to `true`.\n */\n removeAttributeQuotes?: boolean;\n /**\n * Remove the `=\"\"` from standardized `boolean` attributes,\n * such as `hidden` or `checked`. Defaults to `true`.\n */\n removeBooleanAttributeQuotes?: boolean;\n /**\n * Remove these standardized attributes when their value is empty:\n * `class`, `dir`, `id`, `lang`, and `name`, `title`. Defaults to `true`.\n */\n removeEmptyAttributes?: boolean;\n /**\n * Remove HTML comments. Defaults to `true`.\n */\n removeHtmlComments?: boolean;\n}\n\nexport interface HydrateFactoryOptions extends SerializeDocumentOptions {\n serializeToHtml: boolean;\n destroyWindow: boolean;\n destroyDocument: boolean;\n}\n\nexport interface PrerenderHydrateOptions extends SerializeDocumentOptions {\n /**\n * Adds `<link rel=\"modulepreload\">` for modules that will eventually be requested.\n * Defaults to `true`.\n */\n addModulePreloads?: boolean;\n /**\n * Hash the content of assets, such as images, fonts and css files,\n * and add the hashed value as `v` querystring. For example,\n * `/assets/image.png?v=abcd1234`. This allows for assets to be\n * heavily cached by setting the server's response header with\n * `Cache-Control: max-age=31536000, immutable`.\n */\n hashAssets?: 'querystring';\n /**\n * External stylesheets from `<link rel=\"stylesheet\">` are instead inlined\n * into `<style>` elements. Defaults to `false`.\n */\n inlineExternalStyleSheets?: boolean;\n /**\n * Minify CSS content within `<style>` elements. Defaults to `true`.\n */\n minifyStyleElements?: boolean;\n /**\n * Minify JavaScript content within `<script>` elements. Defaults to `true`.\n */\n minifyScriptElements?: boolean;\n /**\n * Entire `document` should be static. This is useful for specific pages that\n * should be static, rather than the entire site. If the whole site should be static,\n * use the `staticSite` property on the prerender config instead. If only certain\n * components should be static then use `staticComponents` instead.\n */\n staticDocument?: boolean;\n}\n\nexport interface RobotsTxtOpts {\n urls: string[];\n sitemapUrl: string;\n baseUrl: string;\n dir: string;\n}\n\nexport interface RobotsTxtResults {\n content: string;\n filePath: string;\n url: string;\n}\n\nexport interface SitemapXmpOpts {\n urls: string[];\n baseUrl: string;\n dir: string;\n}\n\nexport interface SitemapXmpResults {\n content: string;\n filePath: string;\n url: string;\n}\n\n/**\n * Common system used by the compiler. All file reads, writes, access, etc. will all use\n * this system. Additionally, throughout each build, the compiler will use an internal\n * in-memory file system as to prevent unnecessary fs reads and writes. At the end of each\n * build all actions the in-memory fs performed will be written to disk using this system.\n * A NodeJS based system will use APIs such as `fs` and `crypto`, and a web-based system\n * will use in-memory Maps and browser APIs. Either way, the compiler itself is unaware\n * of the actual platform it's being ran on top of.\n */\nexport interface CompilerSystem {\n name: 'node' | 'in-memory';\n version: string;\n events?: BuildEvents;\n details?: SystemDetails;\n /**\n * Add a callback which will be ran when destroy() is called.\n */\n addDestroy(cb: () => void): void;\n /**\n * Always returns a boolean, does not throw.\n */\n access(p: string): Promise<boolean>;\n /**\n * SYNC! Always returns a boolean, does not throw.\n */\n accessSync(p: string): boolean;\n applyGlobalPatch?(fromDir: string): Promise<void>;\n applyPrerenderGlobalPatch?(opts: { devServerHostUrl: string; window: any }): void;\n cacheStorage?: CacheStorage;\n checkVersion?: (logger: Logger, currentVersion: string) => Promise<() => void>;\n copy?(copyTasks: Required<CopyTask>[], srcDir: string): Promise<CopyResults>;\n /**\n * Always returns a boolean if the files were copied or not. Does not throw.\n */\n copyFile(src: string, dst: string): Promise<boolean>;\n /**\n * Used to destroy any listeners, file watchers or child processes.\n */\n destroy(): Promise<void>;\n /**\n * Does not throw.\n */\n createDir(p: string, opts?: CompilerSystemCreateDirectoryOptions): Promise<CompilerSystemCreateDirectoryResults>;\n /**\n * SYNC! Does not throw.\n */\n createDirSync(p: string, opts?: CompilerSystemCreateDirectoryOptions): CompilerSystemCreateDirectoryResults;\n homeDir(): string;\n /**\n * Used to determine if the current context of the terminal is TTY.\n */\n isTTY(): boolean;\n /**\n * Each platform as a different way to dynamically import modules.\n */\n dynamicImport?(p: string): Promise<any>;\n /**\n * Creates the worker controller for the current system.\n */\n createWorkerController?(maxConcurrentWorkers: number): WorkerMainController;\n encodeToBase64(str: string): string;\n\n // TODO(STENCIL-727): Remove this from the sys interface\n /**\n * @deprecated\n */\n ensureDependencies?(opts: {\n rootDir: string;\n logger: Logger;\n dependencies: CompilerDependency[];\n }): Promise<{ stencilPath: string; diagnostics: Diagnostic[] }>;\n // TODO(STENCIL-727): Remove this from the sys interface\n /**\n * @deprecated\n */\n ensureResources?(opts: { rootDir: string; logger: Logger; dependencies: CompilerDependency[] }): Promise<void>;\n /**\n * process.exit()\n */\n exit(exitCode: number): Promise<void>;\n /**\n * Optionally provide a fetch() function rather than using the built-in fetch().\n * First arg is a url string or Request object (RequestInfo).\n * Second arg is the RequestInit. Returns the Response object\n */\n fetch?(input: string | any, init?: any): Promise<any>;\n /**\n * Generates a sha1 digest encoded as HEX\n */\n generateContentHash?(content: string | any, length?: number): Promise<string>;\n /**\n * Generates a sha1 digest encoded as HEX from a file path\n */\n generateFileHash?(filePath: string | any, length?: number): Promise<string>;\n /**\n * Get the current directory.\n */\n getCurrentDirectory(): string;\n /**\n * The compiler's executing path.\n */\n getCompilerExecutingPath(): string;\n /**\n * The dev server's executing path.\n */\n getDevServerExecutingPath?(): string;\n getEnvironmentVar?(key: string): string;\n /**\n * Gets the absolute file path when for a dependency module.\n */\n getLocalModulePath(opts: { rootDir: string; moduleId: string; path: string }): string;\n /**\n * Gets the full url when requesting a dependency module to fetch from a CDN.\n */\n getRemoteModuleUrl(opts: { moduleId: string; path?: string; version?: string }): string;\n /**\n * Aync glob task. Only available in NodeJS compiler system.\n */\n glob?(pattern: string, options: { cwd?: string; nodir?: boolean; [key: string]: any }): Promise<string[]>;\n /**\n * The number of logical processors available to run threads on the user's computer (cpus).\n */\n hardwareConcurrency: number;\n /**\n * Tests if the path is a symbolic link or not. Always resolves a boolean. Does not throw.\n */\n isSymbolicLink(p: string): Promise<boolean>;\n lazyRequire?: LazyRequire;\n nextTick(cb: () => void): void;\n /**\n * Normalize file system path.\n */\n normalizePath(p: string): string;\n onProcessInterrupt?(cb: () => void): void;\n parseYarnLockFile?: (content: string) => {\n type: 'success' | 'merge' | 'conflict';\n object: any;\n };\n platformPath: PlatformPath;\n /**\n * All return paths are full normalized paths, not just the basenames. Always returns an array, does not throw.\n */\n readDir(p: string): Promise<string[]>;\n /**\n * SYNC! All return paths are full normalized paths, not just the basenames. Always returns an array, does not throw.\n */\n readDirSync(p: string): string[];\n /**\n * Returns undefined if file is not found. Does not throw.\n */\n readFile(p: string): Promise<string>;\n readFile(p: string, encoding: 'utf8'): Promise<string>;\n readFile(p: string, encoding: 'binary'): Promise<any>;\n /**\n * SYNC! Returns undefined if file is not found. Does not throw.\n */\n readFileSync(p: string, encoding?: string): string;\n /**\n * Does not throw.\n */\n realpath(p: string): Promise<CompilerSystemRealpathResults>;\n /**\n * SYNC! Does not throw.\n */\n realpathSync(p: string): CompilerSystemRealpathResults;\n /**\n * Remove a callback which will be ran when destroy() is called.\n */\n removeDestroy(cb: () => void): void;\n /**\n * Rename old path to new path. Does not throw.\n */\n rename(oldPath: string, newPath: string): Promise<CompilerSystemRenameResults>;\n resolveModuleId?(opts: ResolveModuleIdOptions): Promise<ResolveModuleIdResults>;\n resolvePath(p: string): string;\n /**\n * Does not throw.\n */\n removeDir(p: string, opts?: CompilerSystemRemoveDirectoryOptions): Promise<CompilerSystemRemoveDirectoryResults>;\n /**\n * SYNC! Does not throw.\n */\n removeDirSync(p: string, opts?: CompilerSystemRemoveDirectoryOptions): CompilerSystemRemoveDirectoryResults;\n /**\n * Does not throw.\n */\n removeFile(p: string): Promise<CompilerSystemRemoveFileResults>;\n /**\n * SYNC! Does not throw.\n */\n removeFileSync(p: string): CompilerSystemRemoveFileResults;\n setupCompiler?: (c: { ts: any }) => void;\n\n /**\n * Always returns an object. Does not throw. Check for \"error\" property if there's an error.\n */\n stat(p: string): Promise<CompilerFsStats>;\n /**\n * SYNC! Always returns an object. Does not throw. Check for \"error\" property if there's an error.\n */\n statSync(p: string): CompilerFsStats;\n tmpDirSync(): string;\n watchDirectory?(p: string, callback: CompilerFileWatcherCallback, recursive?: boolean): CompilerFileWatcher;\n watchFile?(p: string, callback: CompilerFileWatcherCallback): CompilerFileWatcher;\n /**\n * How many milliseconds to wait after a change before calling watch callbacks.\n */\n watchTimeout?: number;\n /**\n * Does not throw.\n */\n writeFile(p: string, content: string): Promise<CompilerSystemWriteFileResults>;\n /**\n * SYNC! Does not throw.\n */\n writeFileSync(p: string, content: string): CompilerSystemWriteFileResults;\n}\n\nexport interface TranspileOnlyResults {\n diagnostics: Diagnostic[];\n output: string;\n sourceMap: any;\n}\n\nexport interface ParsedPath {\n root: string;\n dir: string;\n base: string;\n ext: string;\n name: string;\n}\n\nexport interface PlatformPath {\n normalize(p: string): string;\n join(...paths: string[]): string;\n resolve(...pathSegments: string[]): string;\n isAbsolute(p: string): boolean;\n relative(from: string, to: string): string;\n dirname(p: string): string;\n basename(p: string, ext?: string): string;\n extname(p: string): string;\n parse(p: string): ParsedPath;\n sep: string;\n delimiter: string;\n posix: any;\n win32: any;\n}\n\nexport interface CompilerDependency {\n name: string;\n version: string;\n main: string;\n resources?: string[];\n}\n\nexport interface ResolveModuleIdOptions {\n moduleId: string;\n containingFile?: string;\n exts?: string[];\n packageFilter?: (pkg: any) => void;\n}\n\nexport interface ResolveModuleIdResults {\n moduleId: string;\n resolveId: string;\n pkgData: { name: string; version: string; [key: string]: any };\n pkgDirPath: string;\n}\n\nexport interface WorkerMainController {\n send(...args: any[]): Promise<any>;\n handler(name: string): (...args: any[]) => Promise<any>;\n destroy(): void;\n maxWorkers: number;\n}\n\nexport interface CopyResults {\n diagnostics: Diagnostic[];\n filePaths: string[];\n dirPaths: string[];\n}\n\nexport interface SystemDetails {\n cpuModel: string;\n freemem(): number;\n platform: 'darwin' | 'windows' | 'linux' | '';\n release: string;\n totalmem: number;\n}\n\nexport interface BuildOnEvents {\n on(cb: (eventName: CompilerEventName, data: any) => void): BuildOnEventRemove;\n\n on(eventName: CompilerEventFileAdd, cb: (path: string) => void): BuildOnEventRemove;\n on(eventName: CompilerEventFileDelete, cb: (path: string) => void): BuildOnEventRemove;\n on(eventName: CompilerEventFileUpdate, cb: (path: string) => void): BuildOnEventRemove;\n\n on(eventName: CompilerEventDirAdd, cb: (path: string) => void): BuildOnEventRemove;\n on(eventName: CompilerEventDirDelete, cb: (path: string) => void): BuildOnEventRemove;\n\n on(eventName: CompilerEventBuildStart, cb: (buildStart: CompilerBuildStart) => void): BuildOnEventRemove;\n on(eventName: CompilerEventBuildFinish, cb: (buildResults: CompilerBuildResults) => void): BuildOnEventRemove;\n on(eventName: CompilerEventBuildLog, cb: (buildLog: BuildLog) => void): BuildOnEventRemove;\n on(eventName: CompilerEventBuildNoChange, cb: () => void): BuildOnEventRemove;\n}\n\nexport interface BuildEmitEvents {\n emit(eventName: CompilerEventName, path: string): void;\n emit(eventName: CompilerEventFileAdd, path: string): void;\n emit(eventName: CompilerEventFileDelete, path: string): void;\n emit(eventName: CompilerEventFileUpdate, path: string): void;\n\n emit(eventName: CompilerEventDirAdd, path: string): void;\n emit(eventName: CompilerEventDirDelete, path: string): void;\n\n emit(eventName: CompilerEventBuildStart, buildStart: CompilerBuildStart): void;\n emit(eventName: CompilerEventBuildFinish, buildResults: CompilerBuildResults): void;\n emit(eventName: CompilerEventBuildNoChange, buildNoChange: BuildNoChangeResults): void;\n emit(eventName: CompilerEventBuildLog, buildLog: BuildLog): void;\n\n emit(eventName: CompilerEventFsChange, fsWatchResults: FsWatchResults): void;\n}\n\nexport interface FsWatchResults {\n dirsAdded: string[];\n dirsDeleted: string[];\n filesUpdated: string[];\n filesAdded: string[];\n filesDeleted: string[];\n}\n\nexport interface BuildLog {\n buildId: number;\n messages: string[];\n progress: number;\n}\n\nexport interface BuildNoChangeResults {\n buildId: number;\n noChange: boolean;\n}\n\nexport interface CompilerBuildResults {\n buildId: number;\n componentGraph?: BuildResultsComponentGraph;\n diagnostics: Diagnostic[];\n dirsAdded: string[];\n dirsDeleted: string[];\n duration: number;\n filesAdded: string[];\n filesChanged: string[];\n filesDeleted: string[];\n filesUpdated: string[];\n hasError: boolean;\n hasSuccessfulBuild: boolean;\n hmr?: HotModuleReplacement;\n hydrateAppFilePath?: string;\n isRebuild: boolean;\n namespace: string;\n outputs: BuildOutput[];\n rootDir: string;\n srcDir: string;\n timestamp: string;\n}\n\nexport interface BuildResultsComponentGraph {\n [scopeId: string]: string[];\n}\n\nexport interface BuildOutput {\n type: string;\n files: string[];\n}\n\nexport interface HotModuleReplacement {\n componentsUpdated?: string[];\n excludeHmr?: string[];\n externalStylesUpdated?: string[];\n imagesUpdated?: string[];\n indexHtmlUpdated?: boolean;\n inlineStylesUpdated?: HmrStyleUpdate[];\n reloadStrategy: PageReloadStrategy;\n scriptsAdded?: string[];\n scriptsDeleted?: string[];\n serviceWorkerUpdated?: boolean;\n versionId?: string;\n}\n\nexport interface HmrStyleUpdate {\n styleId: string;\n styleTag: string;\n styleText: string;\n}\n\nexport type BuildOnEventRemove = () => boolean;\n\nexport interface BuildEvents extends BuildOnEvents, BuildEmitEvents {\n unsubscribeAll(): void;\n}\n\nexport interface CompilerBuildStart {\n buildId: number;\n timestamp: string;\n}\n\nexport type CompilerFileWatcherCallback = (fileName: string, eventKind: CompilerFileWatcherEvent) => void;\n\nexport type CompilerFileWatcherEvent =\n | CompilerEventFileAdd\n | CompilerEventFileDelete\n | CompilerEventFileUpdate\n | CompilerEventDirAdd\n | CompilerEventDirDelete;\n\nexport type CompilerEventName =\n | CompilerEventFsChange\n | CompilerEventFileUpdate\n | CompilerEventFileAdd\n | CompilerEventFileDelete\n | CompilerEventDirAdd\n | CompilerEventDirDelete\n | CompilerEventBuildStart\n | CompilerEventBuildFinish\n | CompilerEventBuildNoChange\n | CompilerEventBuildLog;\n\nexport type CompilerEventFsChange = 'fsChange';\nexport type CompilerEventFileUpdate = 'fileUpdate';\nexport type CompilerEventFileAdd = 'fileAdd';\nexport type CompilerEventFileDelete = 'fileDelete';\nexport type CompilerEventDirAdd = 'dirAdd';\nexport type CompilerEventDirDelete = 'dirDelete';\nexport type CompilerEventBuildStart = 'buildStart';\nexport type CompilerEventBuildFinish = 'buildFinish';\nexport type CompilerEventBuildLog = 'buildLog';\nexport type CompilerEventBuildNoChange = 'buildNoChange';\n\nexport interface CompilerFileWatcher {\n close(): void | Promise<void>;\n}\n\nexport interface CompilerFsStats {\n /**\n * If it's a directory. `false` if there was an error.\n */\n isDirectory: boolean;\n /**\n * If it's a file. `false` if there was an error.\n */\n isFile: boolean;\n /**\n * If it's a symlink. `false` if there was an error.\n */\n isSymbolicLink: boolean;\n /**\n * The size of the file in bytes. `0` for directories or if there was an error.\n */\n size: number;\n /**\n * The timestamp indicating the last time this file was modified expressed in milliseconds since the POSIX Epoch.\n */\n mtimeMs?: number;\n /**\n * Error if there was one, otherwise `null`. `stat` and `statSync` do not throw errors but always returns this interface.\n */\n error: any;\n}\n\nexport interface CompilerSystemCreateDirectoryOptions {\n /**\n * Indicates whether parent directories should be created.\n * @default false\n */\n recursive?: boolean;\n /**\n * A file mode. If a string is passed, it is parsed as an octal integer. If not specified\n * @default 0o777.\n */\n mode?: number;\n}\n\nexport interface CompilerSystemCreateDirectoryResults {\n basename: string;\n dirname: string;\n path: string;\n newDirs: string[];\n error: any;\n}\n\nexport interface CompilerSystemRemoveDirectoryOptions {\n /**\n * Indicates whether child files and subdirectories should be removed.\n * @default false\n */\n recursive?: boolean;\n}\n\nexport interface CompilerSystemRemoveDirectoryResults {\n basename: string;\n dirname: string;\n path: string;\n removedDirs: string[];\n removedFiles: string[];\n error: any;\n}\n\nexport interface CompilerSystemRenameResults extends CompilerSystemRenamedPath {\n renamed: CompilerSystemRenamedPath[];\n oldDirs: string[];\n oldFiles: string[];\n newDirs: string[];\n newFiles: string[];\n error: any;\n}\n\nexport interface CompilerSystemRenamedPath {\n oldPath: string;\n newPath: string;\n isFile: boolean;\n isDirectory: boolean;\n}\n\nexport interface CompilerSystemRealpathResults {\n path: string;\n error: any;\n}\n\nexport interface CompilerSystemRemoveFileResults {\n basename: string;\n dirname: string;\n path: string;\n error: any;\n}\n\nexport interface CompilerSystemWriteFileResults {\n path: string;\n error: any;\n}\n\nexport interface Credentials {\n key: string;\n cert: string;\n}\n\nexport interface ConfigBundle {\n components: string[];\n}\n\nexport interface CopyTask {\n src: string;\n dest?: string;\n warn?: boolean;\n keepDirStructure?: boolean;\n}\n\nexport interface BundlingConfig {\n namedExports?: {\n [key: string]: string[];\n };\n}\n\nexport interface NodeResolveConfig {\n module?: boolean;\n jsnext?: boolean;\n main?: boolean;\n browser?: boolean;\n extensions?: string[];\n preferBuiltins?: boolean;\n jail?: string;\n only?: Array<string | RegExp>;\n modulesOnly?: boolean;\n\n /**\n * @see https://github.com/browserify/resolve#resolveid-opts-cb\n */\n customResolveOptions?: {\n basedir?: string;\n package?: string;\n extensions?: string[];\n readFile?: Function;\n isFile?: Function;\n isDirectory?: Function;\n packageFilter?: Function;\n pathFilter?: Function;\n paths?: Function | string[];\n moduleDirectory?: string | string[];\n preserveSymlinks?: boolean;\n };\n}\n\nexport interface RollupConfig {\n inputOptions?: RollupInputOptions;\n outputOptions?: RollupOutputOptions;\n}\n\nexport interface RollupInputOptions {\n context?: string;\n moduleContext?: ((id: string) => string) | { [id: string]: string };\n treeshake?: boolean;\n}\n\nexport interface RollupOutputOptions {\n globals?: { [name: string]: string } | ((name: string) => string);\n}\n\nexport interface Testing {\n run(opts: TestingRunOptions): Promise<boolean>;\n destroy(): Promise<void>;\n}\n\nexport interface TestingRunOptions {\n e2e?: boolean;\n screenshot?: boolean;\n spec?: boolean;\n updateScreenshot?: boolean;\n}\n\nexport interface JestConfig {\n /**\n * This option tells Jest that all imported modules in your tests should be mocked automatically.\n * All modules used in your tests will have a replacement implementation, keeping the API surface. Default: false\n */\n automock?: boolean;\n\n /**\n * By default, Jest runs all tests and produces all errors into the console upon completion.\n * The bail config option can be used here to have Jest stop running tests after the first failure. Default: false\n */\n bail?: boolean;\n\n /**\n * The directory where Jest should store its cached dependency information. Jest attempts to scan your dependency tree once (up-front)\n * and cache it in order to ease some of the filesystem raking that needs to happen while running tests. This config option lets you\n * customize where Jest stores that cache data on disk. Default: \"/tmp/<path>\"\n */\n cacheDirectory?: string;\n\n /**\n * Automatically clear mock calls and instances between every test. Equivalent to calling jest.clearAllMocks()\n * between each test. This does not remove any mock implementation that may have been provided. Default: false\n */\n clearMocks?: boolean;\n\n /**\n * Indicates whether the coverage information should be collected while executing the test. Because this retrofits all\n * executed files with coverage collection statements, it may significantly slow down your tests. Default: false\n */\n collectCoverage?: boolean;\n\n /**\n * An array of glob patterns indicating a set of files for which coverage information should be collected.\n * If a file matches the specified glob pattern, coverage information will be collected for it even if no tests exist\n * for this file and it's never required in the test suite. Default: undefined\n */\n collectCoverageFrom?: any[];\n\n /**\n * The directory where Jest should output its coverage files. Default: undefined\n */\n coverageDirectory?: string;\n\n /**\n * An array of regexp pattern strings that are matched against all file paths before executing the test. If the file path matches\n * any of the patterns, coverage information will be skipped. These pattern strings match against the full path.\n * Use the <rootDir> string token to include the path to your project's root directory to prevent it from accidentally\n * ignoring all of your files in different environments that may have different root directories.\n * Example: [\"<rootDir>/build/\", \"<rootDir>/node_modules/\"]. Default: [\"/node_modules/\"]\n */\n coveragePathIgnorePatterns?: any[];\n\n /**\n * A list of reporter names that Jest uses when writing coverage reports. Any istanbul reporter can be used.\n * Default: [\"json\", \"lcov\", \"text\"]\n */\n coverageReporters?: any[];\n\n /**\n * This will be used to configure minimum threshold enforcement for coverage results. Thresholds can be specified as global,\n * as a glob, and as a directory or file path. If thresholds aren't met, jest will fail. Thresholds specified as a positive\n * number are taken to be the minimum percentage required. Thresholds specified as a negative number represent the maximum\n * number of uncovered entities allowed. Default: undefined\n */\n coverageThreshold?: any;\n\n errorOnDeprecated?: boolean;\n forceCoverageMatch?: any[];\n globals?: any;\n globalSetup?: string;\n globalTeardown?: string;\n\n /**\n * An array of directory names to be searched recursively up from the requiring module's location. Setting this option will\n * override the default, if you wish to still search node_modules for packages include it along with any other\n * options: [\"node_modules\", \"bower_components\"]. Default: [\"node_modules\"]\n */\n moduleDirectories?: string[];\n\n /**\n * An array of file extensions your modules use. If you require modules without specifying a file extension,\n * these are the extensions Jest will look for. Default: ['ts', 'tsx', 'js', 'json']\n */\n moduleFileExtensions?: string[];\n\n moduleNameMapper?: any;\n modulePaths?: any[];\n modulePathIgnorePatterns?: any[];\n notify?: boolean;\n notifyMode?: string;\n preset?: string;\n prettierPath?: string;\n projects?: any;\n reporters?: any;\n resetMocks?: boolean;\n resetModules?: boolean;\n resolver?: string;\n restoreMocks?: string;\n rootDir?: string;\n roots?: any[];\n runner?: string;\n\n /**\n * The paths to modules that run some code to configure or set up the testing environment before each test.\n * Since every test runs in its own environment, these scripts will be executed in the testing environment\n * immediately before executing the test code itself. Default: []\n */\n setupFiles?: string[];\n\n setupFilesAfterEnv?: string[];\n\n snapshotSerializers?: any[];\n testEnvironment?: string;\n testEnvironmentOptions?: any;\n testMatch?: string[];\n testPathIgnorePatterns?: string[];\n testPreset?: string;\n testRegex?: string;\n testResultsProcessor?: string;\n testRunner?: string;\n testURL?: string;\n timers?: string;\n transform?: { [key: string]: string };\n transformIgnorePatterns?: any[];\n unmockedModulePathPatterns?: any[];\n verbose?: boolean;\n watchPathIgnorePatterns?: any[];\n}\n\nexport interface TestingConfig extends JestConfig {\n /**\n * The `allowableMismatchedPixels` value is used to determine an acceptable\n * number of pixels that can be mismatched before the image is considered\n * to have changes. Realistically, two screenshots representing the same\n * content may have a small number of pixels that are not identical due to\n * anti-aliasing, which is perfectly normal. If the `allowableMismatchedRatio`\n * is provided it will take precedence, otherwise `allowableMismatchedPixels`\n * will be used.\n */\n allowableMismatchedPixels?: number;\n\n /**\n * The `allowableMismatchedRatio` ranges from `0` to `1` and is used to\n * determine an acceptable ratio of pixels that can be mismatched before\n * the image is considered to have changes. Realistically, two screenshots\n * representing the same content may have a small number of pixels that\n * are not identical due to anti-aliasing, which is perfectly normal. The\n * `allowableMismatchedRatio` is the number of pixels that were mismatched,\n * divided by the total number of pixels in the screenshot. For example,\n * a ratio value of `0.06` means 6% of the pixels can be mismatched before\n * the image is considered to have changes. If the `allowableMismatchedRatio`\n * is provided it will take precedence, otherwise `allowableMismatchedPixels`\n * will be used.\n */\n allowableMismatchedRatio?: number;\n\n /**\n * Matching threshold while comparing two screenshots. Value ranges from `0` to `1`.\n * Smaller values make the comparison more sensitive. The `pixelmatchThreshold`\n * value helps to ignore anti-aliasing. Default: `0.1`\n */\n pixelmatchThreshold?: number;\n\n /**\n * Additional arguments to pass to the browser instance.\n */\n browserArgs?: string[];\n\n /**\n * Path to a Chromium or Chrome executable to run instead of the bundled Chromium.\n */\n browserExecutablePath?: string;\n\n /**\n * Url of remote Chrome instance to use instead of local Chrome.\n */\n browserWSEndpoint?: string;\n\n /**\n * Whether to run browser e2e tests in headless mode. Defaults to true.\n */\n browserHeadless?: boolean;\n\n /**\n * Slows down e2e browser operations by the specified amount of milliseconds.\n * Useful so that you can see what is going on.\n */\n browserSlowMo?: number;\n\n /**\n * By default, all E2E pages wait until the \"load\" event, this global setting can be used\n * to change the default `waitUntil` behavior.\n */\n browserWaitUntil?: 'load' | 'domcontentloaded' | 'networkidle0' | 'networkidle2';\n\n /**\n * Whether to auto-open a DevTools panel for each tab.\n * If this option is true, the headless option will be set false\n */\n browserDevtools?: boolean;\n\n /**\n * Array of browser emulations to be using during e2e tests. A full e2e\n * test is ran for each emulation.\n */\n emulate?: EmulateConfig[];\n\n /**\n * Path to the Screenshot Connector module.\n */\n screenshotConnector?: string;\n\n /**\n * Amount of time in milliseconds to wait before a screenshot is taken.\n */\n waitBeforeScreenshot?: number;\n}\n\nexport interface EmulateConfig {\n /**\n * Predefined device descriptor name, such as \"iPhone X\" or \"Nexus 10\".\n * For a complete list please see: https://github.com/puppeteer/puppeteer/blob/main/src/common/DeviceDescriptors.ts\n */\n device?: string;\n\n /**\n * User-Agent to be used. Defaults to the user-agent of the installed Puppeteer version.\n */\n userAgent?: string;\n\n viewport?: EmulateViewport;\n}\n\nexport interface EmulateViewport {\n /**\n * Page width in pixels.\n */\n width: number;\n\n /**\n * page height in pixels.\n */\n height: number;\n\n /**\n * Specify device scale factor (can be thought of as dpr). Defaults to 1.\n */\n deviceScaleFactor?: number;\n\n /**\n * Whether the meta viewport tag is taken into account. Defaults to false.\n */\n isMobile?: boolean;\n\n /**\n * Specifies if viewport supports touch events. Defaults to false\n */\n hasTouch?: boolean;\n\n /**\n * Specifies if viewport is in landscape mode. Defaults to false.\n */\n isLandscape?: boolean;\n}\n\n/**\n * This sets the log level hierarchy for our terminal logger, ranging from\n * most to least verbose.\n *\n * Ordering the levels like this lets us easily check whether we should log a\n * message at a given time. For instance, if the log level is set to `'warn'`,\n * then anything passed to the logger with level `'warn'` or `'error'` should\n * be logged, but we should _not_ log anything with level `'info'` or `'debug'`.\n *\n * If we have a current log level `currentLevel` and a message with level\n * `msgLevel` is passed to the logger, we can determine whether or not we should\n * log it by checking if the log level on the message is further up or at the\n * same level in the hierarchy than `currentLevel`, like so:\n *\n * ```ts\n * LOG_LEVELS.indexOf(msgLevel) >= LOG_LEVELS.indexOf(currentLevel)\n * ```\n *\n * NOTE: for the reasons described above, do not change the order of the entries\n * in this array without good reason!\n */\nexport const LOG_LEVELS = ['debug', 'info', 'warn', 'error'] as const;\n\nexport type LogLevel = (typeof LOG_LEVELS)[number];\n\n/**\n * Common logger to be used by the compiler, dev-server and CLI. The CLI will use a\n * NodeJS based console logging and colors, and the web will use browser based\n * logs and colors.\n */\nexport interface Logger {\n enableColors: (useColors: boolean) => void;\n setLevel: (level: LogLevel) => void;\n getLevel: () => LogLevel;\n debug: (...msg: any[]) => void;\n info: (...msg: any[]) => void;\n warn: (...msg: any[]) => void;\n error: (...msg: any[]) => void;\n createTimeSpan: (startMsg: string, debug?: boolean, appendTo?: string[]) => LoggerTimeSpan;\n printDiagnostics: (diagnostics: Diagnostic[], cwd?: string) => void;\n red: (msg: string) => string;\n green: (msg: string) => string;\n yellow: (msg: string) => string;\n blue: (msg: string) => string;\n magenta: (msg: string) => string;\n cyan: (msg: string) => string;\n gray: (msg: string) => string;\n bold: (msg: string) => string;\n dim: (msg: string) => string;\n bgRed: (msg: string) => string;\n emoji: (e: string) => string;\n setLogFilePath?: (p: string) => void;\n writeLogs?: (append: boolean) => void;\n createLineUpdater?: () => Promise<LoggerLineUpdater>;\n}\n\nexport interface LoggerLineUpdater {\n update(text: string): Promise<void>;\n stop(): Promise<void>;\n}\n\nexport interface LoggerTimeSpan {\n duration(): number;\n finish(finishedMsg: string, color?: string, bold?: boolean, newLineSuffix?: boolean): number;\n}\n\nexport interface OutputTargetDist extends OutputTargetBase {\n type: 'dist';\n\n buildDir?: string;\n dir?: string;\n\n collectionDir?: string | null;\n /**\n * When `true` this flag will transform aliased import paths defined in\n * a project's `tsconfig.json` to relative import paths in the compiled output's\n * `dist-collection` bundle if it is generated (i.e. `collectionDir` is set).\n *\n * Paths will be left in aliased format if `false` or `undefined`.\n *\n * @example\n * // tsconfig.json\n * {\n * paths: {\n * \"@utils/*\": ['/src/utils/*']\n * }\n * }\n *\n * // Source file\n * import * as dateUtils from '@utils/date-utils';\n * // Output file\n * import * as dateUtils from '../utils/date-utils';\n */\n transformAliasedImportPathsInCollection?: boolean | null;\n\n typesDir?: string;\n esmLoaderPath?: string;\n copy?: CopyTask[];\n polyfills?: boolean;\n\n empty?: boolean;\n}\n\nexport interface OutputTargetDistCollection extends OutputTargetBase {\n type: 'dist-collection';\n empty?: boolean;\n dir: string;\n collectionDir: string;\n /**\n * When `true` this flag will transform aliased import paths defined in\n * a project's `tsconfig.json` to relative import paths in the compiled output.\n *\n * Paths will be left in aliased format if `false` or `undefined`.\n *\n * @example\n * // tsconfig.json\n * {\n * paths: {\n * \"@utils/*\": ['/src/utils/*']\n * }\n * }\n *\n * // Source file\n * import * as dateUtils from '@utils/date-utils';\n * // Output file\n * import * as dateUtils from '../utils/date-utils';\n */\n transformAliasedImportPaths?: boolean | null;\n}\n\nexport interface OutputTargetDistTypes extends OutputTargetBase {\n type: 'dist-types';\n dir: string;\n typesDir: string;\n}\n\nexport interface OutputTargetDistLazy extends OutputTargetBase {\n type: 'dist-lazy';\n\n dir?: string;\n esmDir?: string;\n esmEs5Dir?: string;\n systemDir?: string;\n cjsDir?: string;\n polyfills?: boolean;\n isBrowserBuild?: boolean;\n\n esmIndexFile?: string;\n cjsIndexFile?: string;\n systemLoaderFile?: string;\n legacyLoaderFile?: string;\n empty?: boolean;\n}\n\nexport interface OutputTargetDistGlobalStyles extends OutputTargetBase {\n type: 'dist-global-styles';\n file: string;\n}\n\nexport interface OutputTargetDistLazyLoader extends OutputTargetBase {\n type: 'dist-lazy-loader';\n dir: string;\n\n esmDir: string;\n esmEs5Dir?: string;\n cjsDir: string;\n componentDts: string;\n\n empty: boolean;\n}\n\nexport interface OutputTargetHydrate extends OutputTargetBase {\n type: 'dist-hydrate-script';\n dir?: string;\n /**\n * Module IDs that should not be bundled into the script.\n * By default, all node builtin's, such as `fs` or `path`\n * will be considered \"external\" and not bundled.\n */\n external?: string[];\n empty?: boolean;\n}\n\nexport interface OutputTargetCustom extends OutputTargetBase {\n type: 'custom';\n name: string;\n validate?: (config: Config, diagnostics: Diagnostic[]) => void;\n generator: (config: Config, compilerCtx: any, buildCtx: any, docs: any) => Promise<void>;\n copy?: CopyTask[];\n}\n\n/**\n * Output target for generating [custom data](https://github.com/microsoft/vscode-custom-data) for VS Code as a JSON\n * file.\n */\nexport interface OutputTargetDocsVscode extends OutputTargetBase {\n /**\n * Designates this output target to be used for generating VS Code custom data.\n * @see OutputTargetBase#type\n */\n type: 'docs-vscode';\n /**\n * The location on disk to write the JSON file.\n */\n file: string;\n /**\n * A base URL to find the source code of the component(s) described in the JSON file.\n */\n sourceCodeBaseUrl?: string;\n}\n\nexport interface OutputTargetDocsReadme extends OutputTargetBase {\n type: 'docs-readme';\n dir?: string;\n dependencies?: boolean;\n footer?: string;\n strict?: boolean;\n}\n\nexport interface OutputTargetDocsJson extends OutputTargetBase {\n type: 'docs-json';\n\n file: string;\n typesFile?: string | null;\n strict?: boolean;\n}\n\nexport interface OutputTargetDocsCustom extends OutputTargetBase {\n type: 'docs-custom';\n\n generator: (docs: JsonDocs, config: Config) => void | Promise<void>;\n strict?: boolean;\n}\n\nexport interface OutputTargetStats extends OutputTargetBase {\n type: 'stats';\n\n file?: string;\n}\n\nexport interface OutputTargetBaseNext {\n type: string;\n dir?: string;\n}\n\n/**\n * The collection of valid export behaviors.\n * Used to generate a type for typed configs as well as output target validation\n * for the `dist-custom-elements` output target.\n *\n * Adding a value to this const array will automatically add it as a valid option on the\n * output target configuration for `customElementsExportBehavior`.\n *\n * - `default`: No additional export or definition behavior will happen.\n * - `auto-define-custom-elements`: Enables the auto-definition of a component and its children (recursively) in the custom elements registry. This\n * functionality allows consumers to bypass the explicit call to define a component, its children, its children's\n * children, etc. Users of this flag should be aware that enabling this functionality may increase bundle size.\n * - `bundle`: A `defineCustomElements` function will be exported from the distribution directory. This behavior was added to allow easy migration\n * from `dist-custom-elements-bundle` to `dist-custom-elements`.\n * - `single-export-module`: All components will be re-exported from the specified directory's root `index.js` file.\n */\nexport const CustomElementsExportBehaviorOptions = [\n 'default',\n 'auto-define-custom-elements',\n 'bundle',\n 'single-export-module',\n] as const;\n\n/**\n * This type is auto-generated based on the values in `CustomElementsExportBehaviorOptions` array.\n * This is used on the output target config for intellisense in typed configs.\n */\nexport type CustomElementsExportBehavior = (typeof CustomElementsExportBehaviorOptions)[number];\n\nexport interface OutputTargetDistCustomElements extends OutputTargetBaseNext {\n type: 'dist-custom-elements';\n empty?: boolean;\n /**\n * Triggers the following behaviors when enabled:\n * 1. All `@stencil/core/*` module references are treated as external during bundling.\n * 2. File names are not hashed.\n * 3. File minification will follow the behavior defined at the root of the Stencil config.\n */\n externalRuntime?: boolean;\n copy?: CopyTask[];\n includeGlobalScripts?: boolean;\n minify?: boolean;\n /**\n * Enables the generation of type definition files for the output target.\n */\n generateTypeDeclarations?: boolean;\n /**\n * Define the export/definition behavior for the output target's generated output.\n * This controls if/how custom elements will be defined or where components will be exported from.\n * If omitted, no auto-definition behavior or re-exporting will happen.\n */\n customElementsExportBehavior?: CustomElementsExportBehavior;\n}\n\nexport interface OutputTargetDistCustomElementsBundle extends OutputTargetBaseNext {\n type: 'dist-custom-elements-bundle';\n empty?: boolean;\n externalRuntime?: boolean;\n copy?: CopyTask[];\n includeGlobalScripts?: boolean;\n minify?: boolean;\n}\n\n/**\n * The base type for output targets. All output targets should extend this base type.\n */\nexport interface OutputTargetBase {\n /**\n * A unique string to differentiate one output target from another\n */\n type: string;\n}\n\nexport type OutputTargetBuild = OutputTargetDistCollection | OutputTargetDistLazy;\n\nexport interface OutputTargetCopy extends OutputTargetBase {\n type: 'copy';\n\n dir: string;\n copy?: CopyTask[];\n copyAssets?: 'collection' | 'dist';\n}\n\nexport interface OutputTargetWww extends OutputTargetBase {\n /**\n * Webapp output target.\n */\n type: 'www';\n\n /**\n * The directory to write the app's JavaScript and CSS build\n * files to. The default is to place this directory as a child\n * to the `dir` config. Default: `build`\n */\n buildDir?: string;\n\n /**\n * The directory to write the entire application to.\n * Note, the `buildDir` is where the app's JavaScript and CSS build\n * files are written. Default: `www`\n */\n dir?: string;\n\n /**\n * Empty the build directory of all files and directories on first build.\n * Default: `true`\n */\n empty?: boolean;\n\n /**\n * The default index html file of the app, commonly found at the\n * root of the `src` directory.\n * Default: `index.html`\n */\n indexHtml?: string;\n\n /**\n * The copy config is an array of objects that defines any files or folders that should\n * be copied over to the build directory.\n *\n * Each object in the array must include a src property which can be either an absolute path,\n * a relative path or a glob pattern. The config can also provide an optional dest property\n * which can be either an absolute path or a path relative to the build directory.\n * Also note that any files within src/assets are automatically copied to www/assets for convenience.\n *\n * In the copy config below, it will copy the entire directory from src/docs-content over to www/docs-content.\n */\n copy?: CopyTask[];\n\n /**\n * The base url of the app, it's required during prerendering to be the absolute path\n * of your app, such as: `https://my.app.com/app`.\n *\n * Default: `/`\n */\n baseUrl?: string;\n\n /**\n * By default, stencil will include all the polyfills required by legacy browsers in the ES5 build.\n * If it's `false`, stencil will not emit this polyfills anymore and it's your responsibility to provide them before\n * stencil initializes.\n */\n polyfills?: boolean;\n\n /**\n * Path to an external node module which has exports of the prerender config object.\n * ```\n * module.exports = {\n * afterHydrate(document, url) {\n * document.title = `URL: ${url.href}`;\n * }\n * }\n * ```\n */\n prerenderConfig?: string;\n\n /**\n * Service worker config for production builds. During development builds\n * service worker script will be injected to automatically unregister existing\n * service workers. When set to `false` neither a service worker registration\n * or unregistration will be added to the index.html.\n */\n serviceWorker?: ServiceWorkerConfig | null | false;\n appDir?: string;\n}\n\nexport type OutputTarget =\n | OutputTargetCopy\n | OutputTargetCustom\n | OutputTargetDist\n | OutputTargetDistCollection\n | OutputTargetDistCustomElements\n | OutputTargetDistCustomElementsBundle\n | OutputTargetDistLazy\n | OutputTargetDistGlobalStyles\n | OutputTargetDistLazyLoader\n | OutputTargetDocsJson\n | OutputTargetDocsCustom\n | OutputTargetDocsReadme\n | OutputTargetDocsVscode\n | OutputTargetWww\n | OutputTargetHydrate\n | OutputTargetStats\n | OutputTargetDistTypes;\n\nexport interface ServiceWorkerConfig {\n // https://developers.google.com/web/tools/workbox/modules/workbox-build#full_generatesw_config\n unregister?: boolean;\n\n swDest?: string;\n swSrc?: string;\n globPatterns?: string[];\n globDirectory?: string | string[];\n globIgnores?: string | string[];\n templatedUrls?: any;\n maximumFileSizeToCacheInBytes?: number;\n manifestTransforms?: any;\n modifyUrlPrefix?: any;\n dontCacheBustURLsMatching?: RegExp;\n navigateFallback?: string;\n navigateFallbackWhitelist?: RegExp[];\n navigateFallbackBlacklist?: RegExp[];\n cacheId?: string;\n skipWaiting?: boolean;\n clientsClaim?: boolean;\n directoryIndex?: string;\n runtimeCaching?: any[];\n ignoreUrlParametersMatching?: any[];\n handleFetch?: boolean;\n}\n\nexport interface LoadConfigInit {\n /**\n * User config object to merge into default config and\n * config loaded from a file path.\n */\n config?: UnvalidatedConfig;\n /**\n * Absolute path to a Stencil config file. This path cannot be\n * relative and it does not resolve config files within a directory.\n */\n configPath?: string;\n logger?: Logger;\n sys?: CompilerSystem;\n /**\n * When set to true, if the \"tsconfig.json\" file is not found\n * it'll automatically generate and save a default tsconfig\n * within the root directory.\n */\n initTsConfig?: boolean;\n}\n\n/**\n * Results from an attempt to load a config. The values on this interface\n * have not yet been validated and are not ready to be used for arbitrary\n * operations around the codebase.\n */\nexport interface LoadConfigResults {\n config: ValidatedConfig;\n diagnostics: Diagnostic[];\n tsconfig: {\n path: string;\n compilerOptions: any;\n files: string[];\n include: string[];\n exclude: string[];\n extends: string;\n };\n}\n\nexport interface Diagnostic {\n absFilePath?: string | undefined;\n code?: string;\n columnNumber?: number | undefined;\n debugText?: string;\n header?: string;\n language?: string;\n level: 'error' | 'warn' | 'info' | 'log' | 'debug';\n lineNumber?: number | undefined;\n lines: PrintLine[];\n messageText: string;\n relFilePath?: string | undefined;\n type: string;\n}\n\nexport interface CacheStorage {\n get(key: string): Promise<any>;\n set(key: string, value: any): Promise<void>;\n}\n\nexport interface WorkerOptions {\n maxConcurrentWorkers?: number;\n maxConcurrentTasksPerWorker?: number;\n logger?: Logger;\n}\n\nexport interface RollupInterface {\n rollup: {\n (config: any): Promise<any>;\n };\n plugins: {\n nodeResolve(opts: any): any;\n replace(opts: any): any;\n commonjs(opts: any): any;\n json(): any;\n };\n}\n\nexport interface ResolveModuleOptions {\n manuallyResolve?: boolean;\n packageJson?: boolean;\n}\n\nexport interface PrerenderStartOptions {\n buildId?: string;\n hydrateAppFilePath: string;\n componentGraph: BuildResultsComponentGraph;\n srcIndexHtmlPath: string;\n}\n\nexport interface PrerenderResults {\n buildId: string;\n diagnostics: Diagnostic[];\n urls: number;\n duration: number;\n average: number;\n}\n\n/**\n * Input for CSS optimization functions, including the input CSS\n * string and a few boolean options which turn on or off various\n * optimizations.\n */\nexport interface OptimizeCssInput {\n input: string;\n filePath?: string;\n autoprefixer?: boolean | null | AutoprefixerOptions;\n minify?: boolean;\n sourceMap?: boolean;\n resolveUrl?: (url: string) => Promise<string> | string;\n}\n\n/**\n * This is not a real interface describing the options which can\n * be passed to autoprefixer, for that see the docs, here:\n * https://github.com/postcss/autoprefixer#options\n *\n * Instead, this basically just serves as a label type to track\n * that arguments are being passed consistently.\n */\nexport type AutoprefixerOptions = Object;\n\n/**\n * Output from CSS optimization functions, wrapping up optimized\n * CSS and any diagnostics produced during optimization.\n */\nexport interface OptimizeCssOutput {\n output: string;\n diagnostics: Diagnostic[];\n}\n\nexport interface OptimizeJsInput {\n input: string;\n filePath?: string;\n target?: 'es5' | 'latest';\n pretty?: boolean;\n sourceMap?: boolean;\n}\n\nexport interface OptimizeJsOutput {\n output: string;\n sourceMap: any;\n diagnostics: Diagnostic[];\n}\n\nexport interface LazyRequire {\n ensure(fromDir: string, moduleIds: string[]): Promise<Diagnostic[]>;\n require(fromDir: string, moduleId: string): any;\n getModulePath(fromDir: string, moduleId: string): string;\n}\n\nexport interface FsWatcherItem {\n close(): void;\n}\n\nexport interface MakeDirectoryOptions {\n /**\n * Indicates whether parent folders should be created.\n * @default false\n */\n recursive?: boolean;\n /**\n * A file mode. If a string is passed, it is parsed as an octal integer. If not specified\n * @default 0o777.\n */\n mode?: number;\n}\n\nexport interface FsStats {\n isFile(): boolean;\n isDirectory(): boolean;\n isBlockDevice(): boolean;\n isCharacterDevice(): boolean;\n isSymbolicLink(): boolean;\n isFIFO(): boolean;\n isSocket(): boolean;\n dev: number;\n ino: number;\n mode: number;\n nlink: number;\n uid: number;\n gid: number;\n rdev: number;\n size: number;\n blksize: number;\n blocks: number;\n atime: Date;\n mtime: Date;\n ctime: Date;\n birthtime: Date;\n}\n\nexport interface Compiler {\n build(): Promise<CompilerBuildResults>;\n createWatcher(): Promise<CompilerWatcher>;\n destroy(): Promise<void>;\n sys: CompilerSystem;\n}\n\nexport interface CompilerWatcher extends BuildOnEvents {\n start: () => Promise<WatcherCloseResults>;\n close: () => Promise<WatcherCloseResults>;\n request: (data: CompilerRequest) => Promise<CompilerRequestResponse>;\n}\n\nexport interface CompilerRequest {\n path?: string;\n}\n\nexport interface WatcherCloseResults {\n exitCode: number;\n}\n\nexport interface CompilerRequestResponse {\n path: string;\n nodeModuleId: string;\n nodeModuleVersion: string;\n nodeResolvedPath: string;\n cachePath: string;\n cacheHit: boolean;\n content: string;\n status: number;\n}\n\n/**\n * Options for Stencil's string-to-string transpiler\n */\nexport interface TranspileOptions {\n /**\n * A component can be defined as a custom element by using `customelement`, or the\n * component class can be exported by using `module`. Default is `customelement`.\n */\n componentExport?: 'customelement' | 'module' | string | undefined;\n /**\n * Sets how and if component metadata should be assigned on the compiled\n * component output. The `compilerstatic` value will set the metadata to\n * a static `COMPILER_META` getter on the component class. This option\n * is useful for unit testing preprocessors. Default is `null`.\n */\n componentMetadata?: 'runtimestatic' | 'compilerstatic' | string | undefined;\n /**\n * The actual internal import path for any `@stencil/core` imports.\n * Default is `@stencil/core/internal/client`.\n */\n coreImportPath?: string;\n /**\n * The current working directory. Default is `/`.\n */\n currentDirectory?: string;\n /**\n * The filename of the code being compiled. Default is `module.tsx`.\n */\n file?: string;\n /**\n * Module format to use for the compiled code output, which can be either `esm` or `cjs`.\n * Default is `esm`.\n */\n module?: 'cjs' | 'esm' | string;\n /**\n * Sets how and if any properties, methods and events are proxied on the\n * component class. The `defineproperty` value sets the getters and setters\n * using Object.defineProperty. Default is `defineproperty`.\n */\n proxy?: 'defineproperty' | string | undefined;\n /**\n * How component styles should be associated to the component. The `static`\n * setting will assign the styles as a static getter on the component class.\n */\n style?: 'static' | string | undefined;\n /**\n * How style data should be added for imports. For example, the `queryparams` value\n * adds the component's tagname and encapsulation info as querystring parameter\n * to the style's import, such as `style.css?tag=my-tag&encapsulation=shadow`. This\n * style data can be used by bundlers to further optimize each component's css.\n * Set to `null` to not include the querystring parameters. Default is `queryparams`.\n */\n styleImportData?: 'queryparams' | string | undefined;\n /**\n * The JavaScript source target TypeScript should to transpile to. Values can be\n * `latest`, `esnext`, `es2017`, `es2015`, or `es5`. Defaults to `latest`.\n */\n target?: CompileTarget;\n /**\n * Create a source map. Using `inline` will inline the source map into the\n * code, otherwise the source map will be in the returned `map` property.\n * Default is `true`.\n */\n sourceMap?: boolean | 'inline';\n /**\n * Base directory to resolve non-relative module names. Same as the `baseUrl`\n * TypeScript compiler option: https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping\n */\n baseUrl?: string;\n /**\n * List of path mapping entries for module names to locations relative to the `baseUrl`.\n * Same as the `paths` TypeScript compiler option:\n * https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping\n */\n paths?: { [key: string]: string[] };\n /**\n * Passed in Stencil Compiler System, otherwise falls back to the internal in-memory only system.\n */\n sys?: CompilerSystem;\n /**\n * This option enables the same behavior as {@link Config.transformAliasedImportPaths}, transforming paths aliased in\n * `tsconfig.json` to relative paths.\n */\n transformAliasedImportPaths?: boolean;\n}\n\nexport type CompileTarget =\n | 'latest'\n | 'esnext'\n | 'es2020'\n | 'es2019'\n | 'es2018'\n | 'es2017'\n | 'es2015'\n | 'es5'\n | string\n | undefined;\n\nexport interface TranspileResults {\n code: string;\n data?: any[];\n diagnostics: Diagnostic[];\n imports?: { path: string }[];\n inputFileExtension: string;\n inputFilePath: string;\n map: any;\n outputFilePath: string;\n}\n\nexport interface TransformOptions {\n coreImportPath: string;\n componentExport: 'lazy' | 'module' | 'customelement' | null;\n componentMetadata: 'runtimestatic' | 'compilerstatic' | null;\n currentDirectory: string;\n file?: string;\n isolatedModules?: boolean;\n module?: 'cjs' | 'esm';\n proxy: 'defineproperty' | null;\n style: 'static' | null;\n styleImportData: 'queryparams' | null;\n target?: string;\n}\n\nexport interface CompileScriptMinifyOptions {\n target?: CompileTarget;\n pretty?: boolean;\n}\n\nexport interface DevServer extends BuildEmitEvents {\n address: string;\n basePath: string;\n browserUrl: string;\n protocol: string;\n port: number;\n root: string;\n close(): Promise<void>;\n}\n\nexport interface CliInitOptions {\n args: string[];\n logger: Logger;\n sys: CompilerSystem;\n}\n","import type { LogLevel, TaskCommand } from '@stencil/core/declarations';\n\n/**\n * All the Boolean options supported by the Stencil CLI\n */\nexport const BOOLEAN_CLI_FLAGS = [\n 'build',\n 'cache',\n 'checkVersion',\n 'ci',\n 'compare',\n 'debug',\n 'dev',\n 'devtools',\n 'docs',\n 'e2e',\n 'es5',\n 'esm',\n 'headless',\n 'help',\n 'log',\n 'open',\n 'prerender',\n 'prerenderExternal',\n 'prod',\n 'profile',\n 'serviceWorker',\n 'screenshot',\n 'serve',\n 'skipNodeCheck',\n 'spec',\n 'ssr',\n 'stats',\n 'updateScreenshot',\n 'verbose',\n 'version',\n 'watch',\n\n // JEST CLI OPTIONS\n 'all',\n 'automock',\n 'bail',\n // 'cache', Stencil already supports this argument\n 'changedFilesWithAncestor',\n // 'ci', Stencil already supports this argument\n 'clearCache',\n 'clearMocks',\n 'collectCoverage',\n 'color',\n 'colors',\n 'coverage',\n // 'debug', Stencil already supports this argument\n 'detectLeaks',\n 'detectOpenHandles',\n 'errorOnDeprecated',\n 'expand',\n 'findRelatedTests',\n 'forceExit',\n 'init',\n 'injectGlobals',\n 'json',\n 'lastCommit',\n 'listTests',\n 'logHeapUsage',\n 'noStackTrace',\n 'notify',\n 'onlyChanged',\n 'onlyFailures',\n 'passWithNoTests',\n 'resetMocks',\n 'resetModules',\n 'restoreMocks',\n 'runInBand',\n 'runTestsByPath',\n 'showConfig',\n 'silent',\n 'skipFilter',\n 'testLocationInResults',\n 'updateSnapshot',\n 'useStderr',\n // 'verbose', Stencil already supports this argument\n // 'version', Stencil already supports this argument\n // 'watch', Stencil already supports this argument\n 'watchAll',\n 'watchman',\n] as const;\n\n/**\n * All the Number options supported by the Stencil CLI\n */\nexport const NUMBER_CLI_FLAGS = [\n 'port',\n // JEST CLI ARGS\n 'maxConcurrency',\n 'testTimeout',\n] as const;\n\n/**\n * All the String options supported by the Stencil CLI\n */\nexport const STRING_CLI_FLAGS = [\n 'address',\n 'config',\n 'docsApi',\n 'docsJson',\n 'emulate',\n 'root',\n 'screenshotConnector',\n\n // JEST CLI ARGS\n 'cacheDirectory',\n 'changedSince',\n 'collectCoverageFrom',\n // 'config', Stencil already supports this argument\n 'coverageDirectory',\n 'coverageThreshold',\n 'env',\n 'filter',\n 'globalSetup',\n 'globalTeardown',\n 'globals',\n 'haste',\n 'moduleNameMapper',\n 'notifyMode',\n 'outputFile',\n 'preset',\n 'prettierPath',\n 'resolver',\n 'rootDir',\n 'runner',\n 'testEnvironment',\n 'testEnvironmentOptions',\n 'testFailureExitCode',\n 'testNamePattern',\n 'testResultsProcessor',\n 'testRunner',\n 'testSequencer',\n 'testURL',\n 'timers',\n 'transform',\n] as const;\n\nexport const STRING_ARRAY_CLI_FLAGS = [\n 'collectCoverageOnlyFrom',\n 'coveragePathIgnorePatterns',\n 'coverageReporters',\n 'moduleDirectories',\n 'moduleFileExtensions',\n 'modulePathIgnorePatterns',\n 'modulePaths',\n 'projects',\n 'reporters',\n 'roots',\n 'selectProjects',\n 'setupFiles',\n 'setupFilesAfterEnv',\n 'snapshotSerializers',\n 'testMatch',\n 'testPathIgnorePatterns',\n 'testPathPattern',\n 'testRegex',\n 'transformIgnorePatterns',\n 'unmockedModulePathPatterns',\n 'watchPathIgnorePatterns',\n] as const;\n\n/**\n * All the CLI arguments which may have string or number values\n *\n * `maxWorkers` is an argument which is used both by Stencil _and_ by Jest,\n * which means that we need to support parsing both string and number values.\n */\nexport const STRING_NUMBER_CLI_FLAGS = ['maxWorkers'] as const;\n\n/**\n * All the LogLevel-type options supported by the Stencil CLI\n *\n * This is a bit silly since there's only one such argument atm,\n * but this approach lets us make sure that we're handling all\n * our arguments in a type-safe way.\n */\nexport const LOG_LEVEL_CLI_FLAGS = ['logLevel'] as const;\n\n/**\n * A type which gives the members of a `ReadonlyArray<string>` as\n * an enum-like type which can be used for e.g. keys in a `Record`\n * (as in the `AliasMap` type below)\n */\ntype ArrayValuesAsUnion<T extends ReadonlyArray<string>> = T[number];\n\nexport type BooleanCLIFlag = ArrayValuesAsUnion<typeof BOOLEAN_CLI_FLAGS>;\nexport type StringCLIFlag = ArrayValuesAsUnion<typeof STRING_CLI_FLAGS>;\nexport type StringArrayCLIFlag = ArrayValuesAsUnion<typeof STRING_ARRAY_CLI_FLAGS>;\nexport type NumberCLIFlag = ArrayValuesAsUnion<typeof NUMBER_CLI_FLAGS>;\nexport type StringNumberCLIFlag = ArrayValuesAsUnion<typeof STRING_NUMBER_CLI_FLAGS>;\nexport type LogCLIFlag = ArrayValuesAsUnion<typeof LOG_LEVEL_CLI_FLAGS>;\n\nexport type KnownCLIFlag =\n | BooleanCLIFlag\n | StringCLIFlag\n | StringArrayCLIFlag\n | NumberCLIFlag\n | StringNumberCLIFlag\n | LogCLIFlag;\n\ntype AliasMap = Partial<Record<string, KnownCLIFlag>>;\n\n/**\n * For a small subset of CLI options we support a short alias e.g. `'h'` for `'help'`\n */\nexport const CLI_FLAG_ALIASES: AliasMap = {\n c: 'config',\n h: 'help',\n p: 'port',\n v: 'version',\n};\n\n/**\n * A regular expression which can be used to match a CLI flag for one of our\n * short aliases.\n */\nexport const CLI_FLAG_REGEX = new RegExp(`^-[chpv]{1}$`);\n\n/**\n * Given two types `K` and `T` where `K` extends `ReadonlyArray<string>`,\n * construct a type which maps the strings in `K` as keys to values of type `T`.\n *\n * Because we use types derived this way to construct an interface (`ConfigFlags`)\n * for which we want optional keys, we make all the properties optional (w/ `'?'`)\n * and possibly null.\n */\ntype ObjectFromKeys<K extends ReadonlyArray<string>, T> = {\n [key in K[number]]?: T | null;\n};\n\n/**\n * Type containing the possible Boolean configuration flags, to be included\n * in ConfigFlags, below\n */\ntype BooleanConfigFlags = ObjectFromKeys<typeof BOOLEAN_CLI_FLAGS, boolean>;\n\n/**\n * Type containing the possible String configuration flags, to be included\n * in ConfigFlags, below\n */\ntype StringConfigFlags = ObjectFromKeys<typeof STRING_CLI_FLAGS, string>;\n\n/**\n * Type containing the possible String Array configuration flags. This is\n * one of the 'constituent types' for `ConfigFlags`.\n */\ntype StringArrayConfigFlags = ObjectFromKeys<typeof STRING_ARRAY_CLI_FLAGS, string[]>;\n\n/**\n * Type containing the possible numeric configuration flags, to be included\n * in ConfigFlags, below\n */\ntype NumberConfigFlags = ObjectFromKeys<typeof NUMBER_CLI_FLAGS, number>;\n\n/**\n * Type containing the configuration flags which may be set to either string\n * or number values.\n */\ntype StringNumberConfigFlags = ObjectFromKeys<typeof STRING_NUMBER_CLI_FLAGS, string | number>;\n\n/**\n * Type containing the possible LogLevel configuration flags, to be included\n * in ConfigFlags, below\n */\ntype LogLevelFlags = ObjectFromKeys<typeof LOG_LEVEL_CLI_FLAGS, LogLevel>;\n\n/**\n * The configuration flags which can be set by the user on the command line.\n * This interface captures both known arguments (which are enumerated and then\n * parsed according to their types) and unknown arguments which the user may\n * pass at the CLI.\n *\n * Note that this interface is constructed by extending `BooleanConfigFlags`,\n * `StringConfigFlags`, etc. These types are in turn constructed from types\n * extending `ReadonlyArray<string>` which we declare in another module. This\n * allows us to record our known CLI arguments in one place, using a\n * `ReadonlyArray<string>` to get both a type-level representation of what CLI\n * options we support and a runtime list of strings which can be used to match\n * on actual flags passed by the user.\n */\nexport interface ConfigFlags\n extends BooleanConfigFlags,\n StringConfigFlags,\n StringArrayConfigFlags,\n NumberConfigFlags,\n StringNumberConfigFlags,\n LogLevelFlags {\n task: TaskCommand | null;\n args: string[];\n knownArgs: string[];\n unknownArgs: string[];\n}\n\n/**\n * Helper function for initializing a `ConfigFlags` object. Provide any overrides\n * for default values and off you go!\n *\n * @param init an object with any overrides for default values\n * @returns a complete CLI flag object\n */\nexport const createConfigFlags = (init: Partial<ConfigFlags> = {}): ConfigFlags => {\n const flags: ConfigFlags = {\n task: null,\n args: [],\n knownArgs: [],\n unknownArgs: [],\n ...init,\n };\n\n return flags;\n};\n","import { readOnlyArrayHasStringMember, toCamelCase } from '@utils';\n\nimport { LOG_LEVELS, LogLevel, TaskCommand } from '../declarations';\nimport {\n BOOLEAN_CLI_FLAGS,\n CLI_FLAG_ALIASES,\n CLI_FLAG_REGEX,\n ConfigFlags,\n createConfigFlags,\n LOG_LEVEL_CLI_FLAGS,\n NUMBER_CLI_FLAGS,\n STRING_ARRAY_CLI_FLAGS,\n STRING_CLI_FLAGS,\n STRING_NUMBER_CLI_FLAGS,\n} from './config-flags';\n\n/**\n * Parse command line arguments into a structured `ConfigFlags` object\n *\n * @param args an array of CLI flags\n * @returns a structured ConfigFlags object\n */\nexport const parseFlags = (args: string[]): ConfigFlags => {\n const flags: ConfigFlags = createConfigFlags();\n\n // cmd line has more priority over npm scripts cmd\n flags.args = Array.isArray(args) ? args.slice() : [];\n if (flags.args.length > 0 && flags.args[0] && !flags.args[0].startsWith('-')) {\n flags.task = flags.args[0] as TaskCommand;\n // if the first argument was a \"task\" (like `build`, `test`, etc) then\n // we go on to parse the _rest_ of the CLI args\n parseArgs(flags, args.slice(1));\n } else {\n // we didn't find a leading flag, so we should just parse them all\n parseArgs(flags, flags.args);\n }\n\n if (flags.task != null) {\n const i = flags.args.indexOf(flags.task);\n if (i > -1) {\n flags.args.splice(i, 1);\n }\n }\n\n // to find unknown / unrecognized arguments we filter `args`, including only\n // arguments whose normalized form is not found in `knownArgs`. `knownArgs`\n // is populated during the call to `parseArgs` above. For arguments like\n // `--foobar` the string `\"--foobar\"` will be added, while for more\n // complicated arguments like `--bizBoz=bop` or `--bizBoz bop` just the\n // string `\"--bizBoz\"` will be added.\n flags.unknownArgs = flags.args.filter((arg: string) => !flags.knownArgs.includes(parseEqualsArg(arg)[0]));\n\n return flags;\n};\n\n/**\n * Parse the supported command line flags which are enumerated in the\n * `config-flags` module. Handles leading dashes on arguments, aliases that are\n * defined for a small number of arguments, and parsing values for non-boolean\n * arguments (e.g. port number for the dev server).\n *\n * This parses the following grammar:\n *\n * CLIArguments → \"\"\n * | CLITerm ( \" \" CLITerm )* ;\n * CLITerm → EqualsArg\n * | AliasEqualsArg\n * | AliasArg\n * | NegativeDashArg\n * | NegativeArg\n * | SimpleArg ;\n * EqualsArg → \"--\" ArgName \"=\" CLIValue ;\n * AliasEqualsArg → \"-\" AliasName \"=\" CLIValue ;\n * AliasArg → \"-\" AliasName ( \" \" CLIValue )? ;\n * NegativeDashArg → \"--no-\" ArgName ;\n * NegativeArg → \"--no\" ArgName ;\n * SimpleArg → \"--\" ArgName ( \" \" CLIValue )? ;\n * ArgName → /^[a-zA-Z-]+$/ ;\n * AliasName → /^[a-z]{1}$/ ;\n * CLIValue → '\"' /^[a-zA-Z0-9]+$/ '\"'\n * | /^[a-zA-Z0-9]+$/ ;\n *\n * There are additional constraints (not shown in the grammar for brevity's sake)\n * on the type of `CLIValue` which will be associated with a particular argument.\n * We enforce this by declaring lists of boolean, string, etc arguments and\n * checking the types of values before setting them.\n *\n * We don't need to turn the list of CLI arg tokens into any kind of\n * intermediate representation since we aren't concerned with doing anything\n * other than setting the correct values on our ConfigFlags object. So we just\n * parse the array of string arguments using a recursive-descent approach\n * (which is not very deep since our grammar is pretty simple) and make the\n * modifications we need to make to the {@link ConfigFlags} object as we go.\n *\n * @param flags a ConfigFlags object to which parsed arguments will be added\n * @param args an array of command-line arguments to parse\n */\nconst parseArgs = (flags: ConfigFlags, args: string[]) => {\n const argsCopy = args.concat();\n while (argsCopy.length > 0) {\n // there are still unprocessed args to deal with\n parseCLITerm(flags, argsCopy);\n }\n};\n\n/**\n * Given an array of CLI arguments, parse it and perform a series of side\n * effects (setting values on the provided `ConfigFlags` object).\n *\n * @param flags a {@link ConfigFlags} object which is updated as we parse the CLI\n * arguments\n * @param args a list of args to work through. This function (and some functions\n * it calls) calls `Array.prototype.shift` to get the next argument to look at,\n * so this parameter will be modified.\n */\nconst parseCLITerm = (flags: ConfigFlags, args: string[]) => {\n // pull off the first arg from the argument array\n const arg = args.shift();\n\n // array is empty, we're done!\n if (arg === undefined) return;\n\n // EqualsArg → \"--\" ArgName \"=\" CLIValue ;\n if (arg.startsWith('--') && arg.includes('=')) {\n // we're dealing with an EqualsArg, we have a special helper for that\n const [originalArg, value] = parseEqualsArg(arg);\n setCLIArg(flags, arg.split('=')[0], normalizeFlagName(originalArg), value);\n }\n\n // AliasEqualsArg → \"-\" AliasName \"=\" CLIValue ;\n else if (arg.startsWith('-') && arg.includes('=')) {\n // we're dealing with an AliasEqualsArg, we have a special helper for that\n const [originalArg, value] = parseEqualsArg(arg);\n setCLIArg(flags, arg.split('=')[0], normalizeFlagName(originalArg), value);\n }\n\n // AliasArg → \"-\" AliasName ( \" \" CLIValue )? ;\n else if (CLI_FLAG_REGEX.test(arg)) {\n // this is a short alias, like `-c` for Config\n setCLIArg(flags, arg, normalizeFlagName(arg), parseCLIValue(args));\n }\n\n // NegativeDashArg → \"--no-\" ArgName ;\n else if (arg.startsWith('--no-') && arg.length > '--no-'.length) {\n // this is a `NegativeDashArg` term, so we need to normalize the negative\n // flag name and then set an appropriate value\n const normalized = normalizeNegativeFlagName(arg);\n setCLIArg(flags, arg, normalized, '');\n }\n\n // NegativeArg → \"--no\" ArgName ;\n else if (\n arg.startsWith('--no') &&\n !readOnlyArrayHasStringMember(BOOLEAN_CLI_FLAGS, normalizeFlagName(arg)) &&\n readOnlyArrayHasStringMember(BOOLEAN_CLI_FLAGS, normalizeNegativeFlagName(arg))\n ) {\n // possibly dealing with a `NegativeArg` here. There is a little ambiguity\n // here because we have arguments that already begin with `no` like\n // `notify`, so we need to test if a normalized form of the raw argument is\n // a valid and supported boolean flag.\n setCLIArg(flags, arg, normalizeNegativeFlagName(arg), '');\n }\n\n // SimpleArg → \"--\" ArgName ( \" \" CLIValue )? ;\n else if (arg.startsWith('--') && arg.length > '--'.length) {\n setCLIArg(flags, arg, normalizeFlagName(arg), parseCLIValue(args));\n }\n\n // if we get here it is not an argument in our list of supported arguments.\n // This doesn't necessarily mean we want to report an error or anything\n // though! Instead, with unknown / unrecognized arguments we stick them into\n // the `unknownArgs` array, which is used when we pass CLI args to Jest, for\n // instance. So we just return void here.\n};\n\n/**\n * Normalize a 'negative' flag name, just to do a little pre-processing before\n * we pass it to `setCLIArg`.\n *\n * @param flagName the flag name to normalize\n * @returns a normalized flag name\n */\nconst normalizeNegativeFlagName = (flagName: string): string => {\n const trimmed = flagName.replace(/^--no[-]?/, '');\n return normalizeFlagName(trimmed.charAt(0).toLowerCase() + trimmed.slice(1));\n};\n\n/**\n * Normalize a flag name by:\n *\n * - replacing any leading dashes (`--foo` -> `foo`)\n * - converting `dash-case` to camelCase (if necessary)\n *\n * Normalizing in this context basically means converting the various\n * supported flag spelling variants to the variant defined in our lists of\n * supported arguments (e.g. BOOLEAN_CLI_FLAGS, etc). So, for instance,\n * `--log-level` should be converted to `logLevel`.\n *\n * @param flagName the flag name to normalize\n * @returns a normalized flag name\n *\n */\nconst normalizeFlagName = (flagName: string): string => {\n const trimmed = flagName.replace(/^-+/, '');\n return trimmed.includes('-') ? toCamelCase(trimmed) : trimmed;\n};\n\n/**\n * Set a value on a provided {@link ConfigFlags} object, given an argument\n * name and a raw string value. This function dispatches to other functions\n * which make sure that the string value can be properly parsed into a JS\n * runtime value of the right type (e.g. number, string, etc).\n *\n * @throws if a value cannot be parsed to the right type for a given flag\n * @param flags a {@link ConfigFlags} object\n * @param rawArg the raw argument name matched by the parser\n * @param normalizedArg an argument with leading control characters (`--`,\n * `--no-`, etc) removed\n * @param value the raw value to be set onto the config flags object\n */\nconst setCLIArg = (flags: ConfigFlags, rawArg: string, normalizedArg: string, value: CLIValueResult) => {\n normalizedArg = dereferenceAlias(normalizedArg);\n\n // We're setting a boolean!\n if (readOnlyArrayHasStringMember(BOOLEAN_CLI_FLAGS, normalizedArg)) {\n flags[normalizedArg] =\n typeof value === 'string'\n ? Boolean(value)\n : // no value was supplied, default to true\n true;\n flags.knownArgs.push(rawArg);\n }\n\n // We're setting a string!\n else if (readOnlyArrayHasStringMember(STRING_CLI_FLAGS, normalizedArg)) {\n if (typeof value === 'string') {\n flags[normalizedArg] = value;\n flags.knownArgs.push(rawArg);\n flags.knownArgs.push(value);\n } else {\n throwCLIParsingError(rawArg, 'expected a string argument but received nothing');\n }\n }\n\n // We're setting a string, but it's one where the user can pass multiple values,\n // like `--reporters=\"default\" --reporters=\"jest-junit\"`\n else if (readOnlyArrayHasStringMember(STRING_ARRAY_CLI_FLAGS, normalizedArg)) {\n if (typeof value === 'string') {\n if (!Array.isArray(flags[normalizedArg])) {\n flags[normalizedArg] = [];\n }\n\n const targetArray = flags[normalizedArg];\n // this is irritating, but TS doesn't know that the `!Array.isArray`\n // check above guarantees we have an array to work with here, and it\n // doesn't want to narrow the type of `flags[normalizedArg]`, so we need\n // to grab a reference to that array and then `Array.isArray` that. Bah!\n if (Array.isArray(targetArray)) {\n targetArray.push(value);\n flags.knownArgs.push(rawArg);\n flags.knownArgs.push(value);\n }\n } else {\n throwCLIParsingError(rawArg, 'expected a string argument but received nothing');\n }\n }\n\n // We're setting a number!\n else if (readOnlyArrayHasStringMember(NUMBER_CLI_FLAGS, normalizedArg)) {\n if (typeof value === 'string') {\n const parsed = parseInt(value, 10);\n\n if (isNaN(parsed)) {\n throwNumberParsingError(rawArg, value);\n } else {\n flags[normalizedArg] = parsed;\n flags.knownArgs.push(rawArg);\n flags.knownArgs.push(value);\n }\n } else {\n throwCLIParsingError(rawArg, 'expected a number argument but received nothing');\n }\n }\n\n // We're setting a value which could be either a string _or_ a number\n else if (readOnlyArrayHasStringMember(STRING_NUMBER_CLI_FLAGS, normalizedArg)) {\n if (typeof value === 'string') {\n if (CLI_ARG_STRING_REGEX.test(value)) {\n // if it matches the regex we treat it like a string\n flags[normalizedArg] = value;\n } else {\n const parsed = Number(value);\n\n if (isNaN(parsed)) {\n // parsing didn't go so well, we gotta get out of here\n // this is unlikely given our regex guard above\n // but hey, this is ultimately JS so let's be safe\n throwNumberParsingError(rawArg, value);\n } else {\n flags[normalizedArg] = parsed;\n }\n }\n flags.knownArgs.push(rawArg);\n flags.knownArgs.push(value);\n } else {\n throwCLIParsingError(rawArg, 'expected a string or a number but received nothing');\n }\n }\n\n // We're setting the log level, which can only be a set of specific string values\n else if (readOnlyArrayHasStringMember(LOG_LEVEL_CLI_FLAGS, normalizedArg)) {\n if (typeof value === 'string') {\n if (isLogLevel(value)) {\n flags[normalizedArg] = value;\n flags.knownArgs.push(rawArg);\n flags.knownArgs.push(value);\n } else {\n throwCLIParsingError(rawArg, `expected to receive a valid log level but received \"${String(value)}\"`);\n }\n } else {\n throwCLIParsingError(rawArg, 'expected to receive a valid log level but received nothing');\n }\n }\n};\n\n/**\n * We use this regular expression to detect CLI parameters which\n * should be parsed as string values (as opposed to numbers) for\n * the argument types for which we support both a string and a\n * number value.\n *\n * The regex tests for the presence of at least one character which is\n * _not_ a digit (`\\d`), a period (`\\.`), or one of the characters `\"e\"`,\n * `\"E\"`, `\"+\"`, or `\"-\"` (the latter four characters are necessary to\n * support the admittedly unlikely use of scientific notation, like `\"4e+0\"`\n * for `4`).\n *\n * Thus we'll match a string like `\"50%\"`, but not a string like `\"50\"` or\n * `\"5.0\"`. If it matches a given string we conclude that the string should\n * be parsed as a string literal, rather than using `Number` to convert it\n * to a number.\n */\nconst CLI_ARG_STRING_REGEX = /[^\\d\\.Ee\\+\\-]+/g;\n\nexport const Empty = Symbol('Empty');\n\n/**\n * The result of trying to parse a CLI arg. This will be a `string` if a\n * well-formed value is present, or `Empty` to indicate that nothing was matched\n * or that the input was malformed.\n */\ntype CLIValueResult = string | typeof Empty;\n\n/**\n * A little helper which tries to parse a CLI value (as opposed to a flag) off\n * of the argument array.\n *\n * We support a variety of different argument formats, but all of them start\n * with `-`, so we can check the first character to test whether the next token\n * in our array of CLI arguments is a flag name or a value.\n *\n * @param args an array of CLI args\n * @returns either a string result or an Empty sentinel\n */\nconst parseCLIValue = (args: string[]): CLIValueResult => {\n // it's possible the arguments array is empty, if so, return empty\n if (args[0] === undefined) {\n return Empty;\n }\n\n // all we're concerned with here is that it does not start with `\"-\"`,\n // which would indicate it should be parsed as a CLI flag and not a value.\n if (!args[0].startsWith('-')) {\n // It's not a flag, so we return the value and defer any specific parsing\n // until later on.\n const value = args.shift();\n if (typeof value === 'string') {\n return value;\n }\n }\n return Empty;\n};\n\n/**\n * Parse an 'equals' argument, which is a CLI argument-value pair in the\n * format `--foobar=12` (as opposed to a space-separated format like\n * `--foobar 12`).\n *\n * To parse this we split on the `=`, returning the first part as the argument\n * name and the second part as the value. We join the value on `\"=\"` in case\n * there is another `\"=\"` in the argument.\n *\n * This function is safe to call with any arg, and can therefore be used as\n * an argument 'normalizer'. If CLI argument is not an 'equals' argument then\n * the return value will be a tuple of the original argument and an empty\n * string `\"\"` for the value.\n *\n * In code terms, if you do:\n *\n * ```ts\n * const [arg, value] = parseEqualsArg(\"--myArgument\")\n * ```\n *\n * Then `arg` will be `\"--myArgument\"` and `value` will be `\"\"`, whereas if\n * you do:\n *\n *\n * ```ts\n * const [arg, value] = parseEqualsArg(\"--myArgument=myValue\")\n * ```\n *\n * Then `arg` will be `\"--myArgument\"` and `value` will be `\"myValue\"`.\n *\n * @param arg the arg in question\n * @returns a tuple containing the arg name and the value (if present)\n */\nexport const parseEqualsArg = (arg: string): [string, CLIValueResult] => {\n const [originalArg, ...splitSections] = arg.split('=');\n const value = splitSections.join('=');\n\n return [originalArg, value === '' ? Empty : value];\n};\n\n/**\n * Small helper for getting type-system-level assurance that a `string` can be\n * narrowed to a `LogLevel`\n *\n * @param maybeLogLevel the string to check\n * @returns whether this is a `LogLevel`\n */\nconst isLogLevel = (maybeLogLevel: string): maybeLogLevel is LogLevel =>\n readOnlyArrayHasStringMember(LOG_LEVELS, maybeLogLevel);\n\n/**\n * A little helper for constructing and throwing an error message with info\n * about what went wrong\n *\n * @param flag the flag which encountered the error\n * @param message a message specific to the error which was encountered\n */\nconst throwCLIParsingError = (flag: string, message: string) => {\n throw new Error(`when parsing CLI flag \"${flag}\": ${message}`);\n};\n\n/**\n * Throw a specific error for the situation where we ran into an issue parsing\n * a number.\n *\n * @param flag the flag for which we encountered the issue\n * @param value what we were trying to parse\n */\nconst throwNumberParsingError = (flag: string, value: string) => {\n throwCLIParsingError(flag, `expected a number but received \"${value}\"`);\n};\n\n/**\n * A little helper to 'dereference' a flag alias, which if you squint a little\n * you can think of like a pointer to a full flag name. Thus 'c' is like a\n * pointer to 'config', so here we're doing something like `*c`. Of course, this\n * being JS, this is just a metaphor!\n *\n * If no 'dereference' is found for the possible alias we just return the\n * passed string unmodified.\n *\n * @param maybeAlias a string which _could_ be an alias to a full flag name\n * @returns the full aliased flag name, if found, or the passed string if not\n */\nconst dereferenceAlias = (maybeAlias: string): string => {\n const possibleDereference = CLI_FLAG_ALIASES[maybeAlias];\n\n if (typeof possibleDereference === 'string') {\n return possibleDereference;\n }\n return maybeAlias;\n};\n","export const IS_NODE_ENV =\n typeof global !== 'undefined' &&\n typeof require === 'function' &&\n !!global.process &&\n typeof __filename === 'string' &&\n (!(global as any as Window).origin || typeof (global as any as Window).origin !== 'string');\n\nexport const OS_PLATFORM = IS_NODE_ENV ? process.platform : '';\n\nexport const IS_WINDOWS_ENV = OS_PLATFORM === 'win32';\n\nexport const IS_CASE_SENSITIVE_FILE_NAMES = !IS_WINDOWS_ENV;\n\nexport const IS_BROWSER_ENV =\n typeof location !== 'undefined' && typeof navigator !== 'undefined' && typeof XMLHttpRequest !== 'undefined';\n\nexport const IS_WEB_WORKER_ENV =\n IS_BROWSER_ENV && typeof self !== 'undefined' && typeof (self as any).importScripts === 'function';\n\nexport const HAS_WEB_WORKER = IS_BROWSER_ENV && typeof Worker === 'function';\n\nexport const IS_FETCH_ENV = typeof fetch === 'function';\n\nexport const requireFunc = IS_NODE_ENV ? require : () => {};\n\nexport const getCurrentDirectory: () => string = IS_NODE_ENV ? process.cwd : () => '/';\n","import type * as d from '../../../declarations';\nimport { IS_BROWSER_ENV } from '../environment';\n\n/**\n * Creates an instance of a logger\n * @returns the new logger instance\n */\nexport const createLogger = (): d.Logger => {\n let useColors = IS_BROWSER_ENV;\n let level: d.LogLevel = 'info';\n\n return {\n enableColors: (uc) => (useColors = uc),\n getLevel: () => level,\n setLevel: (l) => (level = l),\n emoji: (e) => e,\n info: console.log.bind(console),\n warn: console.warn.bind(console),\n error: console.error.bind(console),\n debug: console.debug.bind(console),\n red: (msg) => msg,\n green: (msg) => msg,\n yellow: (msg) => msg,\n blue: (msg) => msg,\n magenta: (msg) => msg,\n cyan: (msg) => msg,\n gray: (msg) => msg,\n bold: (msg) => msg,\n dim: (msg) => msg,\n bgRed: (msg) => msg,\n createTimeSpan: (_startMsg: string, _debug = false): d.LoggerTimeSpan => ({\n duration: () => 0,\n finish: () => 0,\n }),\n printDiagnostics(diagnostics: d.Diagnostic[]) {\n diagnostics.forEach((diagnostic) => logDiagnostic(diagnostic, useColors));\n },\n };\n};\n\nconst logDiagnostic = (diagnostic: d.Diagnostic, useColors: boolean) => {\n let color = BLUE;\n let prefix = 'Build';\n let msg = '';\n\n if (diagnostic.level === 'error') {\n color = RED;\n prefix = 'Error';\n } else if (diagnostic.level === 'warn') {\n color = YELLOW;\n prefix = 'Warning';\n }\n\n if (diagnostic.header) {\n prefix = diagnostic.header;\n }\n\n const filePath = diagnostic.relFilePath || diagnostic.absFilePath;\n if (filePath) {\n msg += filePath;\n\n if (typeof diagnostic.lineNumber === 'number' && diagnostic.lineNumber > 0) {\n msg += ', line ' + diagnostic.lineNumber;\n\n if (typeof diagnostic.columnNumber === 'number' && diagnostic.columnNumber > 0) {\n msg += ', column ' + diagnostic.columnNumber;\n }\n }\n msg += '\\n';\n }\n\n msg += diagnostic.messageText;\n\n if (diagnostic.lines && diagnostic.lines.length > 0) {\n diagnostic.lines.forEach((l) => {\n msg += '\\n' + l.lineNumber + ': ' + l.text;\n });\n msg += '\\n';\n }\n\n if (useColors) {\n const styledPrefix = [\n '%c' + prefix,\n `background: ${color}; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;`,\n ];\n console.log(...styledPrefix, msg);\n } else if (diagnostic.level === 'error') {\n console.error(msg);\n } else if (diagnostic.level === 'warn') {\n console.warn(msg);\n } else {\n console.log(msg);\n }\n};\n\nconst YELLOW = `#f39c12`;\nconst RED = `#c0392b`;\nconst BLUE = `#3498db`;\n","import { buildError, isString, normalizePath } from '@utils';\n\nimport type { CompilerSystem, Diagnostic } from '../declarations';\n\n/**\n * An object containing the {@link CompilerSystem} used to find the configuration file, as well as the location on disk\n * to search for a Stencil configuration\n */\nexport type FindConfigOptions = {\n sys: CompilerSystem;\n configPath: string;\n};\n\n/**\n * The results of attempting to find a Stencil configuration file on disk\n */\nexport type FindConfigResults = {\n configPath: string;\n rootDir: string;\n diagnostics: Diagnostic[];\n};\n\n/**\n * Attempt to find a Stencil configuration file on the file system\n * @param opts the options needed to find the configuration file\n * @returns the results of attempting to find a configuration file on disk\n */\nexport const findConfig = async (opts: FindConfigOptions): Promise<FindConfigResults> => {\n const sys = opts.sys;\n const cwd = sys.getCurrentDirectory();\n const rootDir = normalizePath(cwd);\n\n let configPath = opts.configPath;\n\n if (isString(configPath)) {\n if (!sys.platformPath.isAbsolute(configPath)) {\n // passed in a custom stencil config location,\n // but it's relative, so prefix the cwd\n configPath = normalizePath(sys.platformPath.join(cwd, configPath));\n } else {\n // config path already an absolute path, we're good here\n configPath = normalizePath(opts.configPath);\n }\n } else {\n // nothing was passed in, use the current working directory\n configPath = rootDir;\n }\n\n const results: FindConfigResults = {\n configPath,\n rootDir: normalizePath(cwd),\n diagnostics: [],\n };\n\n const stat = await sys.stat(configPath);\n if (stat.error) {\n const diagnostic = buildError(results.diagnostics);\n diagnostic.absFilePath = configPath;\n diagnostic.header = `Invalid config path`;\n diagnostic.messageText = `Config path \"${configPath}\" not found`;\n return results;\n }\n\n if (stat.isFile) {\n results.configPath = configPath;\n results.rootDir = sys.platformPath.dirname(configPath);\n } else if (stat.isDirectory) {\n // this is only a directory, so let's make some assumptions\n for (const configName of ['stencil.config.ts', 'stencil.config.js']) {\n const testConfigFilePath = sys.platformPath.join(configPath, configName);\n const stat = await sys.stat(testConfigFilePath);\n if (stat.isFile) {\n results.configPath = testConfigFilePath;\n results.rootDir = sys.platformPath.dirname(testConfigFilePath);\n break;\n }\n }\n }\n\n return results;\n};\n","import type { CompilerSystem } from '../declarations';\n\nexport const loadCoreCompiler = async (sys: CompilerSystem): Promise<CoreCompiler> => {\n await sys.dynamicImport(sys.getCompilerExecutingPath());\n\n return (globalThis as any).stencil;\n};\n\nexport type CoreCompiler = typeof import('@stencil/core/compiler');\n","import type { CompilerSystem, Logger, TaskCommand, ValidatedConfig } from '../declarations';\nimport type { ConfigFlags } from './config-flags';\nimport type { CoreCompiler } from './load-compiler';\n\n/**\n * Log the name of this package (`@stencil/core`) to an output stream\n *\n * The output stream is determined by the {@link Logger} instance that is provided as an argument to this function\n *\n * The name of the package may not be logged, by design, for certain `task` types and logging levels\n *\n * @param logger the logging entity to use to output the name of the package\n * @param task the current task\n */\nexport const startupLog = (logger: Logger, task: TaskCommand): void => {\n if (task === 'info' || task === 'serve' || task === 'version') {\n return;\n }\n\n logger.info(logger.cyan(`@stencil/core`));\n};\n\n/**\n * Log this package's version to an output stream\n *\n * The output stream is determined by the {@link Logger} instance that is provided as an argument to this function\n *\n * The package version may not be logged, by design, for certain `task` types and logging levels\n *\n * @param logger the logging entity to use for output\n * @param task the current task\n * @param coreCompiler the compiler instance to derive version information from\n */\nexport const startupLogVersion = (logger: Logger, task: TaskCommand, coreCompiler: CoreCompiler): void => {\n if (task === 'info' || task === 'serve' || task === 'version') {\n return;\n }\n const isDevBuild = coreCompiler.version.includes('-dev.');\n\n let startupMsg: string;\n\n if (isDevBuild) {\n startupMsg = logger.yellow('[LOCAL DEV]');\n } else {\n startupMsg = logger.cyan(`v${coreCompiler.version}`);\n }\n startupMsg += logger.emoji(' ' + coreCompiler.vermoji);\n\n logger.info(startupMsg);\n};\n\n/**\n * Log details from a {@link CompilerSystem} used by Stencil to an output stream\n *\n * The output stream is determined by the {@link Logger} instance that is provided as an argument to this function\n *\n * @param sys the `CompilerSystem` to report details on\n * @param logger the logging entity to use for output\n * @param flags user set flags for the current invocation of Stencil\n * @param coreCompiler the compiler instance being used for this invocation of Stencil\n */\nexport const loadedCompilerLog = (\n sys: CompilerSystem,\n logger: Logger,\n flags: ConfigFlags,\n coreCompiler: CoreCompiler\n): void => {\n const sysDetails = sys.details;\n const runtimeInfo = `${sys.name} ${sys.version}`;\n\n const platformInfo = sysDetails\n ? `${sysDetails.platform}, ${sysDetails.cpuModel}`\n : `Unknown Platform, Unknown CPU Model`;\n const statsInfo = sysDetails\n ? `cpus: ${sys.hardwareConcurrency}, freemem: ${Math.round(\n sysDetails.freemem() / 1000000\n )}MB, totalmem: ${Math.round(sysDetails.totalmem / 1000000)}MB`\n : 'Unknown CPU Core Count, Unknown Memory';\n\n if (logger.getLevel() === 'debug') {\n logger.debug(runtimeInfo);\n logger.debug(platformInfo);\n logger.debug(statsInfo);\n logger.debug(`compiler: ${sys.getCompilerExecutingPath()}`);\n logger.debug(`build: ${coreCompiler.buildId}`);\n } else if (flags.ci) {\n logger.info(runtimeInfo);\n logger.info(platformInfo);\n logger.info(statsInfo);\n }\n};\n\n/**\n * Log various warnings to an output stream\n *\n * The output stream is determined by the {@link Logger} instance attached to the `config` argument to this function\n *\n * @param coreCompiler the compiler instance being used for this invocation of Stencil\n * @param config a validated configuration object to be used for this run of Stencil\n */\nexport const startupCompilerLog = (coreCompiler: CoreCompiler, config: ValidatedConfig) => {\n if (config.suppressLogs === true) {\n return;\n }\n\n const { logger } = config;\n const isDebug = logger.getLevel() === 'debug';\n const isPrerelease = coreCompiler.version.includes('-');\n const isDevBuild = coreCompiler.version.includes('-dev.');\n\n if (isPrerelease && !isDevBuild) {\n logger.warn(\n logger.yellow(\n `This is a prerelease build, undocumented changes might happen at any time. Technical support is not available for prereleases, but any assistance testing is appreciated.`\n )\n );\n }\n\n if (config.devMode && !isDebug) {\n if (config.buildEs5) {\n logger.warn(\n `Generating ES5 during development is a very task expensive, initial and incremental builds will be much slower. Drop the '--es5' flag and use a modern browser for development.`\n );\n }\n\n if (!config.enableCache) {\n logger.warn(`Disabling cache during development will slow down incremental builds.`);\n }\n }\n};\n","import { isFunction } from '@utils';\n\nimport type { ValidatedConfig } from '../declarations';\n\nexport const startCheckVersion = async (config: ValidatedConfig, currentVersion: string) => {\n if (config.devMode && !config.flags.ci && !currentVersion.includes('-dev.') && isFunction(config.sys.checkVersion)) {\n return config.sys.checkVersion(config.logger, currentVersion);\n }\n return null;\n};\n\nexport const printCheckVersionResults = async (versionChecker: Promise<() => void>) => {\n if (versionChecker) {\n const checkVersionResults = await versionChecker;\n if (isFunction(checkVersionResults)) {\n checkVersionResults();\n }\n }\n};\n","import { catchError } from '@utils';\n\nimport type { BuildResultsComponentGraph, Diagnostic, ValidatedConfig } from '../declarations';\nimport type { CoreCompiler } from './load-compiler';\nimport { startupCompilerLog } from './logs';\n\nexport const taskPrerender = async (coreCompiler: CoreCompiler, config: ValidatedConfig) => {\n startupCompilerLog(coreCompiler, config);\n\n const hydrateAppFilePath = config.flags.unknownArgs[0];\n\n if (typeof hydrateAppFilePath !== 'string') {\n config.logger.error(`Missing hydrate app script path`);\n return config.sys.exit(1);\n }\n\n const srcIndexHtmlPath = config.srcIndexHtml;\n\n const diagnostics = await runPrerenderTask(coreCompiler, config, hydrateAppFilePath, null, srcIndexHtmlPath);\n config.logger.printDiagnostics(diagnostics);\n\n if (diagnostics.some((d) => d.level === 'error')) {\n return config.sys.exit(1);\n }\n};\n\nexport const runPrerenderTask = async (\n coreCompiler: CoreCompiler,\n config: ValidatedConfig,\n hydrateAppFilePath: string,\n componentGraph: BuildResultsComponentGraph,\n srcIndexHtmlPath: string\n) => {\n const diagnostics: Diagnostic[] = [];\n\n try {\n const prerenderer = await coreCompiler.createPrerenderer(config);\n const results = await prerenderer.start({\n hydrateAppFilePath,\n componentGraph,\n srcIndexHtmlPath,\n });\n\n diagnostics.push(...results.diagnostics);\n } catch (e: any) {\n catchError(diagnostics, e);\n }\n\n return diagnostics;\n};\n","import type { DevServer, ValidatedConfig } from '../declarations';\nimport { printCheckVersionResults, startCheckVersion } from './check-version';\nimport type { CoreCompiler } from './load-compiler';\nimport { startupCompilerLog } from './logs';\n\nexport const taskWatch = async (coreCompiler: CoreCompiler, config: ValidatedConfig) => {\n let devServer: DevServer = null;\n let exitCode = 0;\n\n try {\n startupCompilerLog(coreCompiler, config);\n\n const versionChecker = startCheckVersion(config, coreCompiler.version);\n\n const compiler = await coreCompiler.createCompiler(config);\n const watcher = await compiler.createWatcher();\n\n if (config.flags.serve) {\n const devServerPath = config.sys.getDevServerExecutingPath();\n const { start }: typeof import('@stencil/core/dev-server') = await config.sys.dynamicImport(devServerPath);\n devServer = await start(config.devServer, config.logger, watcher);\n }\n\n config.sys.onProcessInterrupt(() => {\n config.logger.debug(`close watch`);\n compiler && compiler.destroy();\n });\n\n const rmVersionCheckerLog = watcher.on('buildFinish', async () => {\n // log the version check one time\n rmVersionCheckerLog();\n printCheckVersionResults(versionChecker);\n });\n\n if (devServer) {\n const rmDevServerLog = watcher.on('buildFinish', () => {\n // log the dev server url one time\n rmDevServerLog();\n config.logger.info(`${config.logger.cyan(devServer.browserUrl)}\\n`);\n });\n }\n\n const closeResults = await watcher.start();\n if (closeResults.exitCode > 0) {\n exitCode = closeResults.exitCode;\n }\n } catch (e) {\n exitCode = 1;\n config.logger.error(e);\n }\n\n if (devServer) {\n await devServer.close();\n }\n\n if (exitCode > 0) {\n return config.sys.exit(exitCode);\n }\n};\n","import { flatOne, normalizePath, sortBy } from '@utils';\nimport { basename, dirname, join, relative } from 'path';\n\nimport type * as d from '../../declarations';\n\nexport const relativeImport = (pathFrom: string, pathTo: string, ext?: string, addPrefix = true) => {\n let relativePath = relative(dirname(pathFrom), dirname(pathTo));\n if (addPrefix) {\n if (relativePath === '') {\n relativePath = '.';\n } else if (relativePath[0] !== '.') {\n relativePath = './' + relativePath;\n }\n }\n return normalizePath(`${relativePath}/${basename(pathTo, ext)}`);\n};\n\nexport const getComponentsDtsSrcFilePath = (config: d.Config) => join(config.srcDir, GENERATED_DTS);\n\nexport const getComponentsDtsTypesFilePath = (outputTarget: d.OutputTargetDist | d.OutputTargetDistTypes) =>\n join(outputTarget.typesDir, GENERATED_DTS);\n\nexport const isOutputTargetDist = (o: d.OutputTarget): o is d.OutputTargetDist => o.type === DIST;\n\nexport const isOutputTargetDistCollection = (o: d.OutputTarget): o is d.OutputTargetDistCollection =>\n o.type === DIST_COLLECTION;\n\nexport const isOutputTargetDistCustomElements = (o: d.OutputTarget): o is d.OutputTargetDistCustomElements =>\n o.type === DIST_CUSTOM_ELEMENTS;\n\n// TODO(STENCIL-561): fully delete dist-custom-elements-bundle code\nexport const isOutputTargetDistCustomElementsBundle = (\n o: d.OutputTarget\n): o is d.OutputTargetDistCustomElementsBundle => o.type === DIST_CUSTOM_ELEMENTS_BUNDLE;\n\nexport const isOutputTargetCopy = (o: d.OutputTarget): o is d.OutputTargetCopy => o.type === COPY;\n\nexport const isOutputTargetDistLazy = (o: d.OutputTarget): o is d.OutputTargetDistLazy => o.type === DIST_LAZY;\n\nexport const isOutputTargetDistLazyLoader = (o: d.OutputTarget): o is d.OutputTargetDistLazyLoader =>\n o.type === DIST_LAZY_LOADER;\n\nexport const isOutputTargetDistGlobalStyles = (o: d.OutputTarget): o is d.OutputTargetDistGlobalStyles =>\n o.type === DIST_GLOBAL_STYLES;\n\nexport const isOutputTargetHydrate = (o: d.OutputTarget): o is d.OutputTargetHydrate => o.type === DIST_HYDRATE_SCRIPT;\n\nexport const isOutputTargetCustom = (o: d.OutputTarget): o is d.OutputTargetCustom => o.type === CUSTOM;\n\nexport const isOutputTargetDocs = (\n o: d.OutputTarget\n): o is d.OutputTargetDocsJson | d.OutputTargetDocsReadme | d.OutputTargetDocsVscode | d.OutputTargetDocsCustom =>\n o.type === DOCS_README || o.type === DOCS_JSON || o.type === DOCS_CUSTOM || o.type === DOCS_VSCODE;\n\nexport const isOutputTargetDocsReadme = (o: d.OutputTarget): o is d.OutputTargetDocsReadme => o.type === DOCS_README;\n\nexport const isOutputTargetDocsJson = (o: d.OutputTarget): o is d.OutputTargetDocsJson => o.type === DOCS_JSON;\n\nexport const isOutputTargetDocsCustom = (o: d.OutputTarget): o is d.OutputTargetDocsCustom => o.type === DOCS_CUSTOM;\n\nexport const isOutputTargetDocsVscode = (o: d.OutputTarget): o is d.OutputTargetDocsVscode => o.type === DOCS_VSCODE;\n\nexport const isOutputTargetWww = (o: d.OutputTarget): o is d.OutputTargetWww => o.type === WWW;\n\nexport const isOutputTargetStats = (o: d.OutputTarget): o is d.OutputTargetStats => o.type === STATS;\n\nexport const isOutputTargetDistTypes = (o: d.OutputTarget): o is d.OutputTargetDistTypes => o.type === DIST_TYPES;\n\nexport const getComponentsFromModules = (moduleFiles: d.Module[]) =>\n sortBy(flatOne(moduleFiles.map((m) => m.cmps)), (c: d.ComponentCompilerMeta) => c.tagName);\n\nexport const COPY = 'copy';\nexport const CUSTOM = 'custom';\nexport const DIST = 'dist';\nexport const DIST_COLLECTION = 'dist-collection';\nexport const DIST_CUSTOM_ELEMENTS = 'dist-custom-elements';\n// TODO(STENCIL-561): fully delete dist-custom-elements-bundle code\nexport const DIST_CUSTOM_ELEMENTS_BUNDLE = 'dist-custom-elements-bundle';\n\nexport const DIST_TYPES = 'dist-types';\nexport const DIST_HYDRATE_SCRIPT = 'dist-hydrate-script';\nexport const DIST_LAZY = 'dist-lazy';\nexport const DIST_LAZY_LOADER = 'dist-lazy-loader';\nexport const DIST_GLOBAL_STYLES = 'dist-global-styles';\nexport const DOCS_CUSTOM = 'docs-custom';\nexport const DOCS_JSON = 'docs-json';\nexport const DOCS_README = 'docs-readme';\nexport const DOCS_VSCODE = 'docs-vscode';\nexport const STATS = 'stats';\nexport const WWW = 'www';\n\n/**\n * Valid output targets to specify in a Stencil config.\n *\n * Note that there are some output targets (e.g. `DIST_TYPES`) which are\n * programmatically set as output targets by the compiler when other output\n * targets (in that case `DIST`) are set, but which are _not_ supported in a\n * Stencil config. This is enforced in the output target validation code.\n */\nexport const VALID_CONFIG_OUTPUT_TARGETS = [\n // DIST\n WWW,\n DIST,\n DIST_COLLECTION,\n DIST_CUSTOM_ELEMENTS,\n DIST_LAZY,\n DIST_HYDRATE_SCRIPT,\n\n // DOCS\n DOCS_JSON,\n DOCS_README,\n DOCS_VSCODE,\n DOCS_CUSTOM,\n\n // MISC\n COPY,\n CUSTOM,\n STATS,\n] as const;\n\n// Given a ReadonlyArray of strings we can derive a union type from them\n// by getting `typeof ARRAY[number]`, i.e. the type of all values returns\n// by number keys.\ntype ValidConfigOutputTarget = (typeof VALID_CONFIG_OUTPUT_TARGETS)[number];\n\n/**\n * Check whether a given output target is a valid one to be set in a Stencil config\n *\n * @param targetType the type which we want to check\n * @returns whether or not the targetType is a valid, configurable output target.\n */\nexport function isValidConfigOutputTarget(targetType: string): targetType is ValidConfigOutputTarget {\n // unfortunately `includes` is typed on `ReadonlyArray<T>` as `(el: T):\n // boolean` so a `string` cannot be passed to `includes` on a\n // `ReadonlyArray` 😢 thus we `as any`\n //\n // see microsoft/TypeScript#31018 for some discussion of this\n return VALID_CONFIG_OUTPUT_TARGETS.includes(targetType as any);\n}\n\nexport const GENERATED_DTS = 'components.d.ts';\n","import type * as d from '../../declarations';\nimport { ConfigFlags } from '../config-flags';\n\nexport const tryFn = async <T extends (...args: any[]) => Promise<R>, R>(fn: T, ...args: any[]): Promise<R | null> => {\n try {\n return await fn(...args);\n } catch {\n // ignore\n }\n\n return null;\n};\n\nexport const isInteractive = (sys: d.CompilerSystem, flags: ConfigFlags, object?: d.TerminalInfo): boolean => {\n const terminalInfo =\n object ||\n Object.freeze({\n tty: sys.isTTY() ? true : false,\n ci:\n ['CI', 'BUILD_ID', 'BUILD_NUMBER', 'BITBUCKET_COMMIT', 'CODEBUILD_BUILD_ARN'].filter(\n (v) => !!sys.getEnvironmentVar?.(v)\n ).length > 0 || !!flags.ci,\n });\n\n return terminalInfo.tty && !terminalInfo.ci;\n};\n\nexport const UUID_REGEX = new RegExp(/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i);\n\n// Plucked from https://github.com/ionic-team/capacitor/blob/b893a57aaaf3a16e13db9c33037a12f1a5ac92e0/cli/src/util/uuid.ts\nexport function uuidv4(): string {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0;\n const v = c == 'x' ? r : (r & 0x3) | 0x8;\n\n return v.toString(16);\n });\n}\n\n/**\n * Reads and parses a JSON file from the given `path`\n * @param sys The system where the command is invoked\n * @param path the path on the file system to read and parse\n * @returns the parsed JSON\n */\nexport async function readJson(sys: d.CompilerSystem, path: string): Promise<any> {\n const file = await sys.readFile(path);\n return !!file && JSON.parse(file);\n}\n\n/**\n * Does the command have the debug flag?\n * @param flags The configuration flags passed into the Stencil command\n * @returns true if --debug has been passed, otherwise false\n */\nexport function hasDebug(flags: ConfigFlags): boolean {\n return !!flags.debug;\n}\n\n/**\n * Does the command have the verbose and debug flags?\n * @param flags The configuration flags passed into the Stencil command\n * @returns true if both --debug and --verbose have been passed, otherwise false\n */\nexport function hasVerbose(flags: ConfigFlags): boolean {\n return !!flags.verbose && hasDebug(flags);\n}\n","import type * as d from '../declarations';\nimport { readJson, UUID_REGEX, uuidv4 } from './telemetry/helpers';\n\nexport const isTest = () => process.env.JEST_WORKER_ID !== undefined;\n\nexport const defaultConfig = (sys: d.CompilerSystem) =>\n sys.resolvePath(`${sys.homeDir()}/.ionic/${isTest() ? 'tmp-config.json' : 'config.json'}`);\n\nexport const defaultConfigDirectory = (sys: d.CompilerSystem) => sys.resolvePath(`${sys.homeDir()}/.ionic`);\n\n/**\n * Reads an Ionic configuration file from disk, parses it, and performs any necessary corrections to it if certain\n * values are deemed to be malformed\n * @param sys The system where the command is invoked\n * @returns the config read from disk that has been potentially been updated\n */\nexport async function readConfig(sys: d.CompilerSystem): Promise<d.TelemetryConfig> {\n let config: d.TelemetryConfig = await readJson(sys, defaultConfig(sys));\n\n if (!config) {\n config = {\n 'tokens.telemetry': uuidv4(),\n 'telemetry.stencil': true,\n };\n\n await writeConfig(sys, config);\n } else if (!config['tokens.telemetry'] || !UUID_REGEX.test(config['tokens.telemetry'])) {\n const newUuid = uuidv4();\n await writeConfig(sys, { ...config, 'tokens.telemetry': newUuid });\n config['tokens.telemetry'] = newUuid;\n }\n\n return config;\n}\n\n/**\n * Writes an Ionic configuration file to disk.\n * @param sys The system where the command is invoked\n * @param config The config passed into the Stencil command\n * @returns boolean If the command was successful\n */\nexport async function writeConfig(sys: d.CompilerSystem, config: d.TelemetryConfig): Promise<boolean> {\n let result = false;\n try {\n await sys.createDir(defaultConfigDirectory(sys), { recursive: true });\n await sys.writeFile(defaultConfig(sys), JSON.stringify(config, null, 2));\n result = true;\n } catch (error) {\n console.error(`Stencil Telemetry: couldn't write configuration file to ${defaultConfig(sys)} - ${error}.`);\n }\n\n return result;\n}\n\n/**\n * Update a subset of the Ionic config.\n * @param sys The system where the command is invoked\n * @param newOptions The new options to save\n * @returns boolean If the command was successful\n */\nexport async function updateConfig(sys: d.CompilerSystem, newOptions: d.TelemetryConfig): Promise<boolean> {\n const config = await readConfig(sys);\n return await writeConfig(sys, Object.assign(config, newOptions));\n}\n","import * as d from '../../declarations';\nimport { isInteractive } from './helpers';\nimport { checkTelemetry } from './telemetry';\n\n/**\n * Used to determine if tracking should occur.\n * @param config The config passed into the Stencil command\n * @param sys The system where the command is invoked\n * @param ci whether or not the process is running in a Continuous Integration (CI) environment\n * @returns true if telemetry should be sent, false otherwise\n */\nexport async function shouldTrack(config: d.ValidatedConfig, sys: d.CompilerSystem, ci?: boolean) {\n return !ci && isInteractive(sys, config.flags) && (await checkTelemetry(sys));\n}\n","import { isOutputTargetHydrate, WWW } from '../../compiler/output-targets/output-utils';\nimport { IS_BROWSER_ENV } from '../../compiler/sys/environment';\nimport type * as d from '../../declarations';\nimport { readConfig, updateConfig, writeConfig } from '../ionic-config';\nimport { CoreCompiler } from '../load-compiler';\nimport { hasDebug, hasVerbose, readJson, tryFn, uuidv4 } from './helpers';\nimport { shouldTrack } from './shouldTrack';\n\n/**\n * Used to within taskBuild to provide the component_count property.\n *\n * @param sys The system where the command is invoked\n * @param config The config passed into the Stencil command\n * @param coreCompiler The compiler used to do builds\n * @param result The results of a compiler build.\n */\nexport async function telemetryBuildFinishedAction(\n sys: d.CompilerSystem,\n config: d.ValidatedConfig,\n coreCompiler: CoreCompiler,\n result: d.CompilerBuildResults\n) {\n const tracking = await shouldTrack(config, sys, !!config.flags.ci);\n\n if (!tracking) {\n return;\n }\n\n const component_count = result.componentGraph ? Object.keys(result.componentGraph).length : undefined;\n\n const data = await prepareData(coreCompiler, config, sys, result.duration, component_count);\n\n await sendMetric(sys, config, 'stencil_cli_command', data);\n\n config.logger.debug(`${config.logger.blue('Telemetry')}: ${config.logger.gray(JSON.stringify(data))}`);\n}\n\n/**\n * A function to wrap a compiler task function around. Will send telemetry if, and only if, the machine allows.\n *\n * @param sys The system where the command is invoked\n * @param config The config passed into the Stencil command\n * @param coreCompiler The compiler used to do builds\n * @param action A Promise-based function to call in order to get the duration of any given command.\n * @returns void\n */\nexport async function telemetryAction(\n sys: d.CompilerSystem,\n config: d.ValidatedConfig,\n coreCompiler: CoreCompiler,\n action?: d.TelemetryCallback\n) {\n const tracking = await shouldTrack(config, sys, !!config.flags.ci);\n\n let duration = undefined;\n let error: any;\n\n if (action) {\n const start = new Date();\n\n try {\n await action();\n } catch (e) {\n error = e;\n }\n\n const end = new Date();\n duration = end.getTime() - start.getTime();\n }\n\n // We'll get componentCount details inside the taskBuild, so let's not send two messages.\n if (!tracking || (config.flags.task == 'build' && !config.flags.args.includes('--watch'))) {\n return;\n }\n\n const data = await prepareData(coreCompiler, config, sys, duration);\n\n await sendMetric(sys, config, 'stencil_cli_command', data);\n config.logger.debug(`${config.logger.blue('Telemetry')}: ${config.logger.gray(JSON.stringify(data))}`);\n\n if (error) {\n throw error;\n }\n}\n\n/**\n * Helper function to determine if a Stencil configuration builds an application.\n *\n * This function is a rough approximation whether an application is generated as a part of a Stencil build, based on\n * contents of the project's `stencil.config.ts` file.\n *\n * @param config the configuration used by the Stencil project\n * @returns true if we believe the project generates an application, false otherwise\n */\nexport function hasAppTarget(config: d.ValidatedConfig): boolean {\n return config.outputTargets.some(\n (target) => target.type === WWW && (!!target.serviceWorker || (!!target.baseUrl && target.baseUrl !== '/'))\n );\n}\n\nexport function isUsingYarn(sys: d.CompilerSystem) {\n return sys.getEnvironmentVar('npm_execpath')?.includes('yarn') || false;\n}\n\n/**\n * Build a list of the different types of output targets used in a Stencil configuration.\n *\n * Duplicate entries will not be returned from the list\n *\n * @param config the configuration used by the Stencil project\n * @returns a unique list of output target types found in the Stencil configuration\n */\nexport function getActiveTargets(config: d.ValidatedConfig): string[] {\n const result = config.outputTargets.map((t) => t.type);\n return Array.from(new Set(result));\n}\n\n/**\n * Prepare data for telemetry\n *\n * @param coreCompiler the core compiler\n * @param config the current Stencil config\n * @param sys the compiler system instance in use\n * @param duration_ms the duration of the action being tracked\n * @param component_count the number of components being built (optional)\n * @returns a Promise wrapping data for the telemetry endpoint\n */\nexport const prepareData = async (\n coreCompiler: CoreCompiler,\n config: d.ValidatedConfig,\n sys: d.CompilerSystem,\n duration_ms: number | undefined,\n component_count: number | undefined = undefined\n): Promise<d.TrackableData> => {\n const { typescript, rollup } = coreCompiler.versions || { typescript: 'unknown', rollup: 'unknown' };\n const { packages, packagesNoVersions } = await getInstalledPackages(sys, config);\n const targets = getActiveTargets(config);\n const yarn = isUsingYarn(sys);\n const stencil = coreCompiler.version || 'unknown';\n const system = `${sys.name} ${sys.version}`;\n const os_name = sys.details?.platform;\n const os_version = sys.details?.release;\n const cpu_model = sys.details?.cpuModel;\n const build = coreCompiler.buildId || 'unknown';\n const has_app_pwa_config = hasAppTarget(config);\n const anonymizedConfig = anonymizeConfigForTelemetry(config);\n const is_browser_env = IS_BROWSER_ENV;\n\n return {\n arguments: config.flags.args,\n build,\n component_count,\n config: anonymizedConfig,\n cpu_model,\n duration_ms,\n has_app_pwa_config,\n is_browser_env,\n os_name,\n os_version,\n packages,\n packages_no_versions: packagesNoVersions,\n rollup,\n stencil,\n system,\n system_major: getMajorVersion(system),\n targets,\n task: config.flags.task,\n typescript,\n yarn,\n };\n};\n\n// Setting a key type to `never` excludes it from a mapped type, so we\n// can get only keys which map to a string value by excluding all keys `K`\n// where `d.Config[K]` does not extend `string`.\ntype ConfigStringKeys = keyof {\n [K in keyof d.Config as Required<d.Config>[K] extends string ? K : never]: d.Config[K];\n};\n\n// props in output targets for which we retain their original values when\n// preparing a config for telemetry\n//\n// we omit the values of all other fields on output targets.\nconst OUTPUT_TARGET_KEYS_TO_KEEP: ReadonlyArray<string> = ['type'];\n\n// top-level config props that we anonymize for telemetry\nconst CONFIG_PROPS_TO_ANONYMIZE: ReadonlyArray<ConfigStringKeys> = [\n 'rootDir',\n 'fsNamespace',\n 'packageJsonFilePath',\n 'namespace',\n 'srcDir',\n 'srcIndexHtml',\n 'buildLogFilePath',\n 'cacheDir',\n 'configPath',\n 'tsconfig',\n];\n\n// Props we delete entirely from the config for telemetry\n//\n// TODO(STENCIL-469): Investigate improving anonymization for tsCompilerOptions and devServer\nconst CONFIG_PROPS_TO_DELETE: ReadonlyArray<keyof d.Config> = [\n 'commonjs',\n 'devServer',\n 'env',\n 'logger',\n 'rollupConfig',\n 'sys',\n 'testing',\n 'tsCompilerOptions',\n];\n\n/**\n * Anonymize the config for telemetry, replacing potentially revealing config props\n * with a placeholder string if they are present (this lets us still track how frequently\n * these config options are being used)\n *\n * @param config the config to anonymize\n * @returns an anonymized copy of the same config\n */\nexport const anonymizeConfigForTelemetry = (config: d.ValidatedConfig): d.Config => {\n const anonymizedConfig: d.Config = { ...config };\n\n for (const prop of CONFIG_PROPS_TO_ANONYMIZE) {\n if (anonymizedConfig[prop] !== undefined) {\n anonymizedConfig[prop] = 'omitted';\n }\n }\n\n anonymizedConfig.outputTargets = config.outputTargets.map((target) => {\n // Anonymize the outputTargets on our configuration, taking advantage of the\n // optional 2nd argument to `JSON.stringify`. If anything is not a string\n // we retain it so that any nested properties are handled, else we check\n // whether it's in our 'keep' list to decide whether to keep it or replace it\n // with `\"omitted\"`.\n const anonymizedOT = JSON.parse(\n JSON.stringify(target, (key, value) => {\n if (!(typeof value === 'string')) {\n return value;\n }\n if (OUTPUT_TARGET_KEYS_TO_KEEP.includes(key)) {\n return value;\n }\n return 'omitted';\n })\n );\n\n // this prop has to be handled separately because it is an array\n // so the replace function above will be called with all of its\n // members, giving us `[\"omitted\", \"omitted\", ...]`.\n //\n // Instead, we check for its presence and manually copy over.\n if (isOutputTargetHydrate(target) && target.external) {\n anonymizedOT['external'] = target.external.concat();\n }\n return anonymizedOT;\n });\n\n // TODO(STENCIL-469): Investigate improving anonymization for tsCompilerOptions and devServer\n for (const prop of CONFIG_PROPS_TO_DELETE) {\n delete anonymizedConfig[prop];\n }\n\n return anonymizedConfig;\n};\n\n/**\n * Reads package-lock.json, yarn.lock, and package.json files in order to cross-reference\n * the dependencies and devDependencies properties. Pulls up the current installed version\n * of each package under the @stencil, @ionic, and @capacitor scopes.\n *\n * @param sys the system instance where telemetry is invoked\n * @param config the Stencil configuration associated with the current task that triggered telemetry\n * @returns an object listing all dev and production dependencies under the aforementioned scopes\n */\nasync function getInstalledPackages(\n sys: d.CompilerSystem,\n config: d.ValidatedConfig\n): Promise<{ packages: string[]; packagesNoVersions: string[] }> {\n let packages: string[] = [];\n let packagesNoVersions: string[] = [];\n const yarn = isUsingYarn(sys);\n\n try {\n // Read package.json and package-lock.json\n const appRootDir = sys.getCurrentDirectory();\n\n const packageJson: d.PackageJsonData | null = await tryFn(\n readJson,\n sys,\n sys.resolvePath(appRootDir + '/package.json')\n );\n\n // They don't have a package.json for some reason? Eject button.\n if (!packageJson) {\n return { packages, packagesNoVersions };\n }\n\n const rawPackages: [string, string][] = Object.entries({\n ...packageJson.devDependencies,\n ...packageJson.dependencies,\n });\n\n // Collect packages only in the stencil, ionic, or capacitor org's:\n // https://www.npmjs.com/org/stencil\n const ionicPackages = rawPackages.filter(\n ([k]) => k.startsWith('@stencil/') || k.startsWith('@ionic/') || k.startsWith('@capacitor/')\n );\n\n try {\n packages = yarn ? await yarnPackages(sys, ionicPackages) : await npmPackages(sys, ionicPackages);\n } catch (e) {\n packages = ionicPackages.map(([k, v]) => `${k}@${v.replace('^', '')}`);\n }\n\n packagesNoVersions = ionicPackages.map(([k]) => `${k}`);\n\n return { packages, packagesNoVersions };\n } catch (err) {\n hasDebug(config.flags) && console.error(err);\n return { packages, packagesNoVersions };\n }\n}\n\n/**\n * Visits the npm lock file to find the exact versions that are installed\n * @param sys The system where the command is invoked\n * @param ionicPackages a list of the found packages matching `@stencil`, `@capacitor`, or `@ionic` from the package.json file.\n * @returns an array of strings of all the packages and their versions.\n */\nasync function npmPackages(sys: d.CompilerSystem, ionicPackages: [string, string][]): Promise<string[]> {\n const appRootDir = sys.getCurrentDirectory();\n const packageLockJson: any = await tryFn(readJson, sys, sys.resolvePath(appRootDir + '/package-lock.json'));\n\n return ionicPackages.map(([k, v]) => {\n let version = packageLockJson?.dependencies[k]?.version ?? packageLockJson?.devDependencies[k]?.version ?? v;\n version = version.includes('file:') ? sanitizeDeclaredVersion(v) : version;\n return `${k}@${version}`;\n });\n}\n\n/**\n * Visits the yarn lock file to find the exact versions that are installed\n * @param sys The system where the command is invoked\n * @param ionicPackages a list of the found packages matching `@stencil`, `@capacitor`, or `@ionic` from the package.json file.\n * @returns an array of strings of all the packages and their versions.\n */\nasync function yarnPackages(sys: d.CompilerSystem, ionicPackages: [string, string][]): Promise<string[]> {\n const appRootDir = sys.getCurrentDirectory();\n const yarnLock = sys.readFileSync(sys.resolvePath(appRootDir + '/yarn.lock'));\n const yarnLockYml = sys.parseYarnLockFile(yarnLock);\n\n return ionicPackages.map(([k, v]) => {\n const identifiedVersion = `${k}@${v}`;\n let version = yarnLockYml.object[identifiedVersion]?.version;\n version = version.includes('undefined') ? sanitizeDeclaredVersion(identifiedVersion) : version;\n return `${k}@${version}`;\n });\n}\n\n/**\n * This function is used for fallback purposes, where an npm or yarn lock file doesn't exist in the consumers directory.\n * This will strip away '*', '^' and '~' from the declared package versions in a package.json.\n * @param version the raw semver pattern identifier version string\n * @returns a cleaned up representation without any qualifiers\n */\nfunction sanitizeDeclaredVersion(version: string): string {\n return version.replace(/[*^~]/g, '');\n}\n\n/**\n * If telemetry is enabled, send a metric to an external data store\n *\n * @param sys the system instance where telemetry is invoked\n * @param config the Stencil configuration associated with the current task that triggered telemetry\n * @param name the name of a trackable metric. Note this name is not necessarily a scalar value to track, like\n * \"Stencil Version\". For example, \"stencil_cli_command\" is a name that is used to track all CLI command information.\n * @param value the data to send to the external data store under the provided name argument\n */\nexport async function sendMetric(\n sys: d.CompilerSystem,\n config: d.ValidatedConfig,\n name: string,\n value: d.TrackableData\n): Promise<void> {\n const session_id = await getTelemetryToken(sys);\n\n const message: d.Metric = {\n name,\n timestamp: new Date().toISOString(),\n source: 'stencil_cli',\n value,\n session_id,\n };\n\n await sendTelemetry(sys, config, message);\n}\n\n/**\n * Used to read the config file's tokens.telemetry property.\n *\n * @param sys The system where the command is invoked\n * @returns string\n */\nasync function getTelemetryToken(sys: d.CompilerSystem) {\n const config = await readConfig(sys);\n if (config['tokens.telemetry'] === undefined) {\n config['tokens.telemetry'] = uuidv4();\n await writeConfig(sys, config);\n }\n return config['tokens.telemetry'];\n}\n\n/**\n * Issues a request to the telemetry server.\n * @param sys The system where the command is invoked\n * @param config The config passed into the Stencil command\n * @param data Data to be tracked\n */\nasync function sendTelemetry(sys: d.CompilerSystem, config: d.ValidatedConfig, data: d.Metric): Promise<void> {\n try {\n const now = new Date().toISOString();\n\n const body = {\n metrics: [data],\n sent_at: now,\n };\n\n // This request is only made if telemetry is on.\n const response = await sys.fetch('https://api.ionicjs.com/events/metrics', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(body),\n });\n\n hasVerbose(config.flags) &&\n console.debug('\\nSent %O metric to events service (status: %O)', data.name, response.status, '\\n');\n\n if (response.status !== 204) {\n hasVerbose(config.flags) &&\n console.debug('\\nBad response from events service. Request body: %O', response.body.toString(), '\\n');\n }\n } catch (e) {\n hasVerbose(config.flags) && console.debug('Telemetry request failed:', e);\n }\n}\n\n/**\n * Checks if telemetry is enabled on this machine\n * @param sys The system where the command is invoked\n * @returns true if telemetry is enabled, false otherwise\n */\nexport async function checkTelemetry(sys: d.CompilerSystem): Promise<boolean> {\n const config = await readConfig(sys);\n if (config['telemetry.stencil'] === undefined) {\n config['telemetry.stencil'] = true;\n await writeConfig(sys, config);\n }\n return config['telemetry.stencil'];\n}\n\n/**\n * Writes to the config file, enabling telemetry for this machine.\n * @param sys The system where the command is invoked\n * @returns true if writing the file was successful, false otherwise\n */\nexport async function enableTelemetry(sys: d.CompilerSystem): Promise<boolean> {\n return await updateConfig(sys, { 'telemetry.stencil': true });\n}\n\n/**\n * Writes to the config file, disabling telemetry for this machine.\n * @param sys The system where the command is invoked\n * @returns true if writing the file was successful, false otherwise\n */\nexport async function disableTelemetry(sys: d.CompilerSystem): Promise<boolean> {\n return await updateConfig(sys, { 'telemetry.stencil': false });\n}\n\n/**\n * Takes in a semver string in order to return the major version.\n * @param version The fully qualified semver version\n * @returns a string of the major version\n */\nfunction getMajorVersion(version: string): string {\n const parts = version.split('.');\n return parts[0];\n}\n","import type * as d from '../declarations';\nimport { printCheckVersionResults, startCheckVersion } from './check-version';\nimport type { CoreCompiler } from './load-compiler';\nimport { startupCompilerLog } from './logs';\nimport { runPrerenderTask } from './task-prerender';\nimport { taskWatch } from './task-watch';\nimport { telemetryBuildFinishedAction } from './telemetry/telemetry';\n\nexport const taskBuild = async (coreCompiler: CoreCompiler, config: d.ValidatedConfig) => {\n if (config.flags.watch) {\n // watch build\n await taskWatch(coreCompiler, config);\n return;\n }\n\n // one-time build\n let exitCode = 0;\n\n try {\n startupCompilerLog(coreCompiler, config);\n\n const versionChecker = startCheckVersion(config, coreCompiler.version);\n\n const compiler = await coreCompiler.createCompiler(config);\n const results = await compiler.build();\n\n await telemetryBuildFinishedAction(config.sys, config, coreCompiler, results);\n\n await compiler.destroy();\n\n if (results.hasError) {\n exitCode = 1;\n } else if (config.flags.prerender) {\n const prerenderDiagnostics = await runPrerenderTask(\n coreCompiler,\n config,\n results.hydrateAppFilePath,\n results.componentGraph,\n null\n );\n config.logger.printDiagnostics(prerenderDiagnostics);\n\n if (prerenderDiagnostics.some((d) => d.level === 'error')) {\n exitCode = 1;\n }\n }\n\n await printCheckVersionResults(versionChecker);\n } catch (e) {\n exitCode = 1;\n config.logger.error(e);\n }\n\n if (exitCode > 0) {\n return config.sys.exit(exitCode);\n }\n};\n","import { isOutputTargetDocs } from '../compiler/output-targets/output-utils';\nimport type { ValidatedConfig } from '../declarations';\nimport type { CoreCompiler } from './load-compiler';\nimport { startupCompilerLog } from './logs';\n\nexport const taskDocs = async (coreCompiler: CoreCompiler, config: ValidatedConfig) => {\n config.devServer = null;\n config.outputTargets = config.outputTargets.filter(isOutputTargetDocs);\n config.devMode = true;\n\n startupCompilerLog(coreCompiler, config);\n\n const compiler = await coreCompiler.createCompiler(config);\n await compiler.build();\n\n await compiler.destroy();\n};\n","import { validateComponentTag } from '@utils';\n\nimport { IS_NODE_ENV } from '../compiler/sys/environment';\nimport type { ValidatedConfig } from '../declarations';\nimport type { CoreCompiler } from './load-compiler';\n\n/**\n * Task to generate component boilerplate and write it to disk. This task can\n * cause the program to exit with an error under various circumstances, such as\n * being called in an inappropriate place, being asked to overwrite files that\n * already exist, etc.\n *\n * @param coreCompiler the CoreCompiler we're using currently, here we're\n * mainly accessing the `path` module\n * @param config the user-supplied config, which we need here to access `.sys`.\n */\nexport const taskGenerate = async (coreCompiler: CoreCompiler, config: ValidatedConfig): Promise<void> => {\n if (!IS_NODE_ENV) {\n config.logger.error(`\"generate\" command is currently only implemented for a NodeJS environment`);\n return config.sys.exit(1);\n }\n\n const path = coreCompiler.path;\n\n if (!config.configPath) {\n config.logger.error('Please run this command in your root directory (i. e. the one containing stencil.config.ts).');\n return config.sys.exit(1);\n }\n\n const absoluteSrcDir = config.srcDir;\n\n if (!absoluteSrcDir) {\n config.logger.error(`Stencil's srcDir was not specified.`);\n return config.sys.exit(1);\n }\n\n const { prompt } = await import('prompts');\n\n const input =\n config.flags.unknownArgs.find((arg) => !arg.startsWith('-')) ||\n ((await prompt({ name: 'tagName', type: 'text', message: 'Component tag name (dash-case):' })).tagName as string);\n\n if (undefined === input) {\n // in some shells (e.g. Windows PowerShell), hitting Ctrl+C results in a TypeError printed to the console.\n // explicitly return here to avoid printing the error message.\n return;\n }\n const { dir, base: componentName } = path.parse(input);\n\n const tagError = validateComponentTag(componentName);\n if (tagError) {\n config.logger.error(tagError);\n return config.sys.exit(1);\n }\n const filesToGenerateExt = await chooseFilesToGenerate();\n if (undefined === filesToGenerateExt) {\n // in some shells (e.g. Windows PowerShell), hitting Ctrl+C results in a TypeError printed to the console.\n // explicitly return here to avoid printing the error message.\n return;\n }\n const extensionsToGenerate: GenerableExtension[] = ['tsx', ...filesToGenerateExt];\n\n const testFolder = extensionsToGenerate.some(isTest) ? 'test' : '';\n\n const outDir = path.join(absoluteSrcDir, 'components', dir, componentName);\n await config.sys.createDir(path.join(outDir, testFolder), { recursive: true });\n\n const filesToGenerate: readonly BoilerplateFile[] = extensionsToGenerate.map((extension) => ({\n extension,\n path: getFilepathForFile(coreCompiler, outDir, componentName, extension),\n }));\n await checkForOverwrite(filesToGenerate, config);\n\n const writtenFiles = await Promise.all(\n filesToGenerate.map((file) =>\n getBoilerplateAndWriteFile(config, componentName, extensionsToGenerate.includes('css'), file)\n )\n ).catch((error) => config.logger.error(error));\n\n if (!writtenFiles) {\n return config.sys.exit(1);\n }\n\n // We use `console.log` here rather than our `config.logger` because we don't want\n // our TUI messages to be prefixed with timestamps and so on.\n //\n // See STENCIL-424 for details.\n console.log();\n console.log(`${config.logger.gray('$')} stencil generate ${input}`);\n console.log();\n console.log(config.logger.bold('The following files have been generated:'));\n\n const absoluteRootDir = config.rootDir;\n writtenFiles.map((file) => console.log(` - ${path.relative(absoluteRootDir, file)}`));\n};\n\n/**\n * Show a checkbox prompt to select the files to be generated.\n *\n * @returns a read-only array of `GenerableExtension`, the extensions that the user has decided\n * to generate\n */\nconst chooseFilesToGenerate = async (): Promise<ReadonlyArray<GenerableExtension>> => {\n const { prompt } = await import('prompts');\n return (\n await prompt({\n name: 'filesToGenerate',\n type: 'multiselect',\n message: 'Which additional files do you want to generate?',\n choices: [\n { value: 'css', title: 'Stylesheet (.css)', selected: true },\n { value: 'spec.tsx', title: 'Spec Test (.spec.tsx)', selected: true },\n { value: 'e2e.ts', title: 'E2E Test (.e2e.ts)', selected: true },\n ],\n })\n ).filesToGenerate;\n};\n\n/**\n * Get a filepath for a file we want to generate!\n *\n * The filepath for a given file depends on the path, the user-supplied\n * component name, the extension, and whether we're inside of a test directory.\n *\n * @param coreCompiler the compiler we're using, here to acces the `.path` module\n * @param path path to where we're going to generate the component\n * @param componentName the user-supplied name for the generated component\n * @param extension the file extension\n * @returns the full filepath to the component (with a possible `test` directory\n * added)\n */\nconst getFilepathForFile = (\n coreCompiler: CoreCompiler,\n path: string,\n componentName: string,\n extension: GenerableExtension\n): string =>\n isTest(extension)\n ? coreCompiler.path.join(path, 'test', `${componentName}.${extension}`)\n : coreCompiler.path.join(path, `${componentName}.${extension}`);\n\n/**\n * Get the boilerplate for a file and write it to disk\n *\n * @param config the current config, needed for file operations\n * @param componentName the component name (user-supplied)\n * @param withCss are we generating CSS?\n * @param file the file we want to write\n * @returns a `Promise<string>` which holds the full filepath we've written to,\n * used to print out a little summary of our activity to the user.\n */\nconst getBoilerplateAndWriteFile = async (\n config: ValidatedConfig,\n componentName: string,\n withCss: boolean,\n file: BoilerplateFile\n): Promise<string> => {\n const boilerplate = getBoilerplateByExtension(componentName, file.extension, withCss);\n await config.sys.writeFile(file.path, boilerplate);\n return file.path;\n};\n\n/**\n * Check to see if any of the files we plan to write already exist and would\n * therefore be overwritten if we proceed, because we'd like to not overwrite\n * people's code!\n *\n * This function will check all the filepaths and if it finds any files log an\n * error and exit with an error code. If it doesn't find anything it will just\n * peacefully return `Promise<void>`.\n *\n * @param files the files we want to check\n * @param config the Config object, used here to get access to `sys.readFile`\n */\nconst checkForOverwrite = async (files: readonly BoilerplateFile[], config: ValidatedConfig): Promise<void> => {\n const alreadyPresent: string[] = [];\n\n await Promise.all(\n files.map(async ({ path }) => {\n if ((await config.sys.readFile(path)) !== undefined) {\n alreadyPresent.push(path);\n }\n })\n );\n\n if (alreadyPresent.length > 0) {\n config.logger.error(\n 'Generating code would overwrite the following files:',\n ...alreadyPresent.map((path) => '\\t' + path)\n );\n await config.sys.exit(1);\n }\n};\n\n/**\n * Check if an extension is for a test\n *\n * @param extension the extension we want to check\n * @returns a boolean indicating whether or not its a test\n */\nconst isTest = (extension: GenerableExtension): boolean => {\n return extension === 'e2e.ts' || extension === 'spec.tsx';\n};\n\n/**\n * Get the boilerplate for a file by its extension.\n *\n * @param tagName the name of the component we're generating\n * @param extension the file extension we want boilerplate for (.css, tsx, etc)\n * @param withCss a boolean indicating whether we're generating a CSS file\n * @returns a string container the file boilerplate for the supplied extension\n */\nexport const getBoilerplateByExtension = (tagName: string, extension: GenerableExtension, withCss: boolean): string => {\n switch (extension) {\n case 'tsx':\n return getComponentBoilerplate(tagName, withCss);\n\n case 'css':\n return getStyleUrlBoilerplate();\n\n case 'spec.tsx':\n return getSpecTestBoilerplate(tagName);\n\n case 'e2e.ts':\n return getE2eTestBoilerplate(tagName);\n\n default:\n throw new Error(`Unkown extension \"${extension}\".`);\n }\n};\n\n/**\n * Get the boilerplate for a file containing the definition of a component\n * @param tagName the name of the tag to give the component\n * @param hasStyle designates if the component has an external stylesheet or not\n * @returns the contents of a file that defines a component\n */\nconst getComponentBoilerplate = (tagName: string, hasStyle: boolean): string => {\n const decorator = [`{`];\n decorator.push(` tag: '${tagName}',`);\n if (hasStyle) {\n decorator.push(` styleUrl: '${tagName}.css',`);\n }\n decorator.push(` shadow: true,`);\n decorator.push(`}`);\n\n return `import { Component, Host, h } from '@stencil/core';\n\n@Component(${decorator.join('\\n')})\nexport class ${toPascalCase(tagName)} {\n\n render() {\n return (\n <Host>\n <slot></slot>\n </Host>\n );\n }\n\n}\n`;\n};\n\n/**\n * Get the boilerplate for style for a generated component\n * @returns a boilerplate CSS block\n */\nconst getStyleUrlBoilerplate = (): string =>\n `:host {\n display: block;\n}\n`;\n\n/**\n * Get the boilerplate for a file containing a spec (unit) test for a component\n * @param tagName the name of the tag associated with the component under test\n * @returns the contents of a file that unit tests a component\n */\nconst getSpecTestBoilerplate = (tagName: string): string =>\n `import { newSpecPage } from '@stencil/core/testing';\nimport { ${toPascalCase(tagName)} } from '../${tagName}';\n\ndescribe('${tagName}', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [${toPascalCase(tagName)}],\n html: \\`<${tagName}></${tagName}>\\`,\n });\n expect(page.root).toEqualHtml(\\`\n <${tagName}>\n <mock:shadow-root>\n <slot></slot>\n </mock:shadow-root>\n </${tagName}>\n \\`);\n });\n});\n`;\n\n/**\n * Get the boilerplate for a file containing an end-to-end (E2E) test for a component\n * @param tagName the name of the tag associated with the component under test\n * @returns the contents of a file that E2E tests a component\n */\nconst getE2eTestBoilerplate = (tagName: string): string =>\n `import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('${tagName}', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n await page.setContent('<${tagName}></${tagName}>');\n\n const element = await page.find('${tagName}');\n expect(element).toHaveClass('hydrated');\n });\n});\n`;\n\n/**\n * Convert a dash case string to pascal case.\n * @param str the string to convert\n * @returns the converted input as pascal case\n */\nconst toPascalCase = (str: string): string =>\n str.split('-').reduce((res, part) => res + part[0].toUpperCase() + part.slice(1), '');\n\n/**\n * Extensions available to generate.\n */\nexport type GenerableExtension = 'tsx' | 'css' | 'spec.tsx' | 'e2e.ts';\n\n/**\n * A little interface to wrap up the info we need to pass around for generating\n * and writing boilerplate.\n */\nexport interface BoilerplateFile {\n extension: GenerableExtension;\n /**\n * The full path to the file we want to generate.\n */\n path: string;\n}\n","import type * as d from '../declarations';\nimport { ConfigFlags } from './config-flags';\nimport { checkTelemetry, disableTelemetry, enableTelemetry } from './telemetry/telemetry';\n\n/**\n * Entrypoint for the Telemetry task\n * @param flags configuration flags provided to Stencil when a task was called (either this task or a task that invokes\n * telemetry)\n * @param sys the abstraction for interfacing with the operating system\n * @param logger a logging implementation to log the results out to the user\n */\nexport const taskTelemetry = async (flags: ConfigFlags, sys: d.CompilerSystem, logger: d.Logger): Promise<void> => {\n const prompt = logger.dim(sys.details.platform === 'windows' ? '>' : '$');\n const isEnabling = flags.args.includes('on');\n const isDisabling = flags.args.includes('off');\n const INFORMATION = `Opt in or out of telemetry. Information about the data we collect is available on our website: ${logger.bold(\n 'https://stenciljs.com/telemetry'\n )}`;\n const THANK_YOU = `Thank you for helping to make Stencil better! 💖`;\n const ENABLED_MESSAGE = `${logger.green('Enabled')}. ${THANK_YOU}\\n\\n`;\n const DISABLED_MESSAGE = `${logger.red('Disabled')}\\n\\n`;\n const hasTelemetry = await checkTelemetry(sys);\n\n if (isEnabling) {\n const result = await enableTelemetry(sys);\n result\n ? console.log(`\\n ${logger.bold('Telemetry is now ') + ENABLED_MESSAGE}`)\n : console.log(`Something went wrong when enabling Telemetry.`);\n return;\n }\n\n if (isDisabling) {\n const result = await disableTelemetry(sys);\n result\n ? console.log(`\\n ${logger.bold('Telemetry is now ') + DISABLED_MESSAGE}`)\n : console.log(`Something went wrong when disabling Telemetry.`);\n return;\n }\n\n console.log(` ${logger.bold('Telemetry:')} ${logger.dim(INFORMATION)}`);\n\n console.log(`\\n ${logger.bold('Status')}: ${hasTelemetry ? ENABLED_MESSAGE : DISABLED_MESSAGE}`);\n\n console.log(` ${prompt} ${logger.green('stencil telemetry [off|on]')}\n\n ${logger.cyan('off')} ${logger.dim('.............')} Disable sharing anonymous usage data\n ${logger.cyan('on')} ${logger.dim('..............')} Enable sharing anonymous usage data\n `);\n};\n","import type * as d from '../declarations';\nimport { ConfigFlags } from './config-flags';\nimport { taskTelemetry } from './task-telemetry';\n\n/**\n * Entrypoint for the Help task, providing Stencil usage context to the user\n * @param flags configuration flags provided to Stencil when a task was call (either this task or a task that invokes\n * telemetry)\n * @param logger a logging implementation to log the results out to the user\n * @param sys the abstraction for interfacing with the operating system\n */\nexport const taskHelp = async (flags: ConfigFlags, logger: d.Logger, sys: d.CompilerSystem): Promise<void> => {\n const prompt = logger.dim(sys.details.platform === 'windows' ? '>' : '$');\n\n console.log(`\n ${logger.bold('Build:')} ${logger.dim('Build components for development or production.')}\n\n ${prompt} ${logger.green('stencil build [--dev] [--watch] [--prerender] [--debug]')}\n\n ${logger.cyan('--dev')} ${logger.dim('.............')} Development build\n ${logger.cyan('--watch')} ${logger.dim('...........')} Rebuild when files update\n ${logger.cyan('--serve')} ${logger.dim('...........')} Start the dev-server\n ${logger.cyan('--prerender')} ${logger.dim('.......')} Prerender the application\n ${logger.cyan('--docs')} ${logger.dim('............')} Generate component readme.md docs\n ${logger.cyan('--config')} ${logger.dim('..........')} Set stencil config file\n ${logger.cyan('--stats')} ${logger.dim('...........')} Write stencil-stats.json file\n ${logger.cyan('--log')} ${logger.dim('.............')} Write stencil-build.log file\n ${logger.cyan('--debug')} ${logger.dim('...........')} Set the log level to debug\n\n\n ${logger.bold('Test:')} ${logger.dim('Run unit and end-to-end tests.')}\n\n ${prompt} ${logger.green('stencil test [--spec] [--e2e]')}\n\n ${logger.cyan('--spec')} ${logger.dim('............')} Run unit tests with Jest\n ${logger.cyan('--e2e')} ${logger.dim('.............')} Run e2e tests with Puppeteer\n\n\n ${logger.bold('Generate:')} ${logger.dim('Bootstrap components.')}\n\n ${prompt} ${logger.green('stencil generate')} or ${logger.green('stencil g')}\n\n`);\n\n await taskTelemetry(flags, sys, logger);\n\n console.log(`\n ${logger.bold('Examples:')}\n\n ${prompt} ${logger.green('stencil build --dev --watch --serve')}\n ${prompt} ${logger.green('stencil build --prerender')}\n ${prompt} ${logger.green('stencil test --spec --e2e')}\n ${prompt} ${logger.green('stencil telemetry on')}\n ${prompt} ${logger.green('stencil generate')}\n ${prompt} ${logger.green('stencil g my-component')}\n`);\n};\n","import type { CompilerSystem, Logger } from '../declarations';\nimport type { CoreCompiler } from './load-compiler';\n\nexport const taskInfo = (coreCompiler: CoreCompiler, sys: CompilerSystem, logger: Logger) => {\n const details = sys.details;\n const versions = coreCompiler.versions;\n\n console.log(``);\n console.log(`${logger.cyan(' System:')} ${sys.name} ${sys.version}`);\n console.log(`${logger.cyan(' Plaform:')} ${details.platform} (${details.release})`);\n console.log(\n `${logger.cyan(' CPU Model:')} ${details.cpuModel} (${sys.hardwareConcurrency} cpu${\n sys.hardwareConcurrency !== 1 ? 's' : ''\n })`\n );\n console.log(`${logger.cyan(' Compiler:')} ${sys.getCompilerExecutingPath()}`);\n console.log(`${logger.cyan(' Build:')} ${coreCompiler.buildId}`);\n console.log(`${logger.cyan(' Stencil:')} ${coreCompiler.version}${logger.emoji(' ' + coreCompiler.vermoji)}`);\n console.log(`${logger.cyan(' TypeScript:')} ${versions.typescript}`);\n console.log(`${logger.cyan(' Rollup:')} ${versions.rollup}`);\n console.log(`${logger.cyan(' Parse5:')} ${versions.parse5}`);\n console.log(`${logger.cyan(' Sizzle:')} ${versions.sizzle}`);\n console.log(`${logger.cyan(' Terser:')} ${versions.terser}`);\n console.log(``);\n};\n","import { isString } from '@utils';\n\nimport type { ValidatedConfig } from '../declarations';\n\nexport const taskServe = async (config: ValidatedConfig) => {\n config.suppressLogs = true;\n\n config.flags.serve = true;\n config.devServer.openBrowser = config.flags.open;\n config.devServer.reloadStrategy = null;\n config.devServer.initialLoadUrl = '/';\n config.devServer.websocket = false;\n config.maxConcurrentWorkers = 1;\n config.devServer.root = isString(config.flags.root) ? config.flags.root : config.sys.getCurrentDirectory();\n\n const devServerPath = config.sys.getDevServerExecutingPath();\n const { start }: typeof import('@stencil/core/dev-server') = await config.sys.dynamicImport(devServerPath);\n const devServer = await start(config.devServer, config.logger);\n\n console.log(`${config.logger.cyan(' Root:')} ${devServer.root}`);\n console.log(`${config.logger.cyan(' Address:')} ${devServer.address}`);\n console.log(`${config.logger.cyan(' Port:')} ${devServer.port}`);\n console.log(`${config.logger.cyan(' Server:')} ${devServer.browserUrl}`);\n console.log(``);\n\n config.sys.onProcessInterrupt(() => {\n if (devServer) {\n config.logger.debug(`dev server close: ${devServer.browserUrl}`);\n devServer.close();\n }\n });\n};\n","import { IS_NODE_ENV } from '../compiler/sys/environment';\nimport type { TestingRunOptions, ValidatedConfig } from '../declarations';\n\n/**\n * Entrypoint for any Stencil tests\n * @param config a validated Stencil configuration entity\n */\nexport const taskTest = async (config: ValidatedConfig): Promise<void> => {\n if (!IS_NODE_ENV) {\n config.logger.error(`\"test\" command is currently only implemented for a NodeJS environment`);\n return config.sys.exit(1);\n }\n\n config.buildDocs = false;\n const testingRunOpts: TestingRunOptions = {\n e2e: !!config.flags.e2e,\n screenshot: !!config.flags.screenshot,\n spec: !!config.flags.spec,\n updateScreenshot: !!config.flags.updateScreenshot,\n };\n\n // always ensure we have jest modules installed\n const ensureModuleIds = ['@types/jest', 'jest', 'jest-cli'];\n\n if (testingRunOpts.e2e) {\n // if it's an e2e test, also make sure we're got\n // puppeteer modules installed and if browserExecutablePath is provided don't download Chromium use only puppeteer-core instead\n const puppeteer = config.testing.browserExecutablePath ? 'puppeteer-core' : 'puppeteer';\n\n ensureModuleIds.push(puppeteer);\n\n if (testingRunOpts.screenshot) {\n // ensure we've got pixelmatch for screenshots\n config.logger.warn(\n config.logger.yellow(\n `EXPERIMENTAL: screenshot visual diff testing is currently under heavy development and has not reached a stable status. However, any assistance testing would be appreciated.`\n )\n );\n }\n }\n\n // ensure we've got the required modules installed\n const diagnostics = await config.sys.lazyRequire.ensure(config.rootDir, ensureModuleIds);\n if (diagnostics.length > 0) {\n config.logger.printDiagnostics(diagnostics);\n return config.sys.exit(1);\n }\n\n try {\n // let's test!\n const { createTesting } = await import('@stencil/core/testing');\n const testing = await createTesting(config);\n const passed = await testing.run(testingRunOpts);\n await testing.destroy();\n\n if (!passed) {\n return config.sys.exit(1);\n }\n } catch (e) {\n config.logger.error(e);\n return config.sys.exit(1);\n }\n};\n","import { hasError, isFunction, shouldIgnoreError } from '@utils';\n\nimport { createLogger } from '../compiler/sys/logger/console-logger';\nimport type * as d from '../declarations';\nimport { ValidatedConfig } from '../declarations';\nimport { createConfigFlags } from './config-flags';\nimport { findConfig } from './find-config';\nimport { CoreCompiler, loadCoreCompiler } from './load-compiler';\nimport { loadedCompilerLog, startupLog, startupLogVersion } from './logs';\nimport { parseFlags } from './parse-flags';\nimport { taskBuild } from './task-build';\nimport { taskDocs } from './task-docs';\nimport { taskGenerate } from './task-generate';\nimport { taskHelp } from './task-help';\nimport { taskInfo } from './task-info';\nimport { taskPrerender } from './task-prerender';\nimport { taskServe } from './task-serve';\nimport { taskTelemetry } from './task-telemetry';\nimport { taskTest } from './task-test';\nimport { telemetryAction } from './telemetry/telemetry';\n\nexport const run = async (init: d.CliInitOptions) => {\n const { args, logger, sys } = init;\n\n try {\n const flags = parseFlags(args);\n const task = flags.task;\n\n if (flags.debug || flags.verbose) {\n logger.setLevel('debug');\n }\n\n if (flags.ci) {\n logger.enableColors(false);\n }\n\n if (isFunction(sys.applyGlobalPatch)) {\n sys.applyGlobalPatch(sys.getCurrentDirectory());\n }\n\n if (!task || task === 'help' || flags.help) {\n await taskHelp(createConfigFlags({ task: 'help', args }), logger, sys);\n\n return;\n }\n\n startupLog(logger, task);\n\n const findConfigResults = await findConfig({ sys, configPath: flags.config });\n if (hasError(findConfigResults.diagnostics)) {\n logger.printDiagnostics(findConfigResults.diagnostics);\n return sys.exit(1);\n }\n\n const coreCompiler = await loadCoreCompiler(sys);\n\n if (task === 'version' || flags.version) {\n console.log(coreCompiler.version);\n return;\n }\n\n startupLogVersion(logger, task, coreCompiler);\n\n loadedCompilerLog(sys, logger, flags, coreCompiler);\n\n if (task === 'info') {\n taskInfo(coreCompiler, sys, logger);\n return;\n }\n\n const validated = await coreCompiler.loadConfig({\n config: {\n flags,\n },\n configPath: findConfigResults.configPath,\n logger,\n sys,\n });\n\n if (validated.diagnostics.length > 0) {\n logger.printDiagnostics(validated.diagnostics);\n if (hasError(validated.diagnostics)) {\n return sys.exit(1);\n }\n }\n\n if (isFunction(sys.applyGlobalPatch)) {\n sys.applyGlobalPatch(validated.config.rootDir);\n }\n\n await telemetryAction(sys, validated.config, coreCompiler, async () => {\n await runTask(coreCompiler, validated.config, task, sys);\n });\n } catch (e) {\n if (!shouldIgnoreError(e)) {\n const details = `${logger.getLevel() === 'debug' && e instanceof Error ? e.stack : ''}`;\n logger.error(`uncaught cli error: ${e}${details}`);\n return sys.exit(1);\n }\n }\n};\n\n/**\n * Run a specified task\n * @param coreCompiler an instance of a minimal, bootstrap compiler for running the specified task\n * @param config a configuration for the Stencil project to apply to the task run\n * @param task the task to run\n * @param sys the {@link CompilerSystem} for interacting with the operating system\n * @public\n */\nexport const runTask = async (\n coreCompiler: CoreCompiler,\n config: d.Config,\n task: d.TaskCommand,\n sys?: d.CompilerSystem\n): Promise<void> => {\n const logger = config.logger ?? createLogger();\n const rootDir = config.rootDir ?? '/';\n const configSys = sys ?? config.sys ?? coreCompiler.createSystem({ logger });\n const strictConfig: ValidatedConfig = {\n ...config,\n flags: createConfigFlags(config.flags ?? { task }),\n hydratedFlag: config.hydratedFlag ?? null,\n logger,\n outputTargets: config.outputTargets ?? [],\n packageJsonFilePath: configSys.platformPath.join(rootDir, 'package.json'),\n rootDir,\n sys: configSys,\n testing: config.testing ?? {},\n transformAliasedImportPaths: config.transformAliasedImportPaths ?? false,\n };\n\n switch (task) {\n case 'build':\n await taskBuild(coreCompiler, strictConfig);\n break;\n\n case 'docs':\n await taskDocs(coreCompiler, strictConfig);\n break;\n\n case 'generate':\n case 'g':\n await taskGenerate(coreCompiler, strictConfig);\n break;\n\n case 'help':\n await taskHelp(strictConfig.flags, strictConfig.logger, sys);\n break;\n\n case 'prerender':\n await taskPrerender(coreCompiler, strictConfig);\n break;\n\n case 'serve':\n await taskServe(strictConfig);\n break;\n\n case 'telemetry':\n await taskTelemetry(strictConfig.flags, sys, strictConfig.logger);\n break;\n\n case 'test':\n await taskTest(strictConfig);\n break;\n\n case 'version':\n console.log(coreCompiler.version);\n break;\n\n default:\n strictConfig.logger.error(\n `${strictConfig.logger.emoji('❌ ')}Invalid stencil command, please see the options below:`\n );\n await taskHelp(strictConfig.flags, strictConfig.logger, sys);\n return config.sys.exit(1);\n }\n};\n"],"names":["isTest"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA;;;;;;;AAOO,MAAM,gBAAgB,GAAG,CAAC,GAAW,KAC1C,GAAG;KACA,WAAW,EAAE;KACb,KAAK,CAAC,GAAG,CAAC;KACV,GAAG,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KACpE,IAAI,CAAC,EAAE,CAAC,CAAC;AAEd;;;;;;AAMO,MAAM,WAAW,GAAG,CAAC,GAAW;IACrC,MAAM,UAAU,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACzC,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC,CAAC;AAiIK,MAAM,UAAU,GAAG,CAAC,CAAM,KAAoB,OAAO,CAAC,KAAK,UAAU,CAAC;AAItE,MAAM,QAAQ,GAAG,CAAC,CAAM,KAAkB,OAAO,CAAC,KAAK,QAAQ;;ACzKtE;;;;;;;;;;AAUO,MAAM,UAAU,GAAG,CAAC,WAA4B;IACrD,MAAM,UAAU,GAAiB;QAC/B,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,aAAa;QACrB,WAAW,EAAE,aAAa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