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;AAED;;GAEG;AACH,SAAS,iBAAiB,CAAE,WAAsC,EAAE,MAAgB;IAClF,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AAC/D,CAAC;AAED;;;;GAIG;AACH,SAAS,kBAAkB,CAAE,EAAc,EAAE,UAA0B,EAAE,QAAgB;IACvF,IAAI,OAAO,GAAa,UAAU,CAAA;IAElC,KAAK,EAAE,OAAO,IAAI,EAAE;QAClB,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE;YACnD,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,EAAE,CAAA;YAClC,IAAI,KAAK,GAAG,QAAQ;gBAAE,MAAK;YAE3B,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE,CAAA;YAC1B,IAAI,QAAQ,IAAI,GAAG,EAAE;gBACnB,OAAO,GAAG,KAAK,CAAA;gBACf,SAAS,KAAK,CAAA;aACf;SACF;QAED,OAAO,OAAO,CAAA;KACf;AACH,CAAC;AAED,IAAI,iBAAgD,CAAA;AACpD,SAAS,aAAa,CAAE,QAAgB;IACtC,IAAI,CAAC,iBAAiB,EAAE;QACtB,2BAA2B;QAC3B,iBAAiB,GAAG,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,qBAAqB,IAAI,OAAO,CAAC,gCAAgC,CAAC,CAAC,qBAAqB,CAAA;KAC5I;IACD,OAAO,iBAAiB,CAAC,QAAQ,CAAC,CAAA;AACpC,CAAC","sourcesContent":["import { relative, basename, extname, resolve, dirname, join, isAbsolute } from 'path'\nimport sourceMapSupport = require('source-map-support')\nimport * as ynModule from 'yn'\nimport { BaseError } from 'make-error'\nimport * as util from 'util'\nimport { fileURLToPath } from 'url'\nimport type * as _ts from 'typescript'\nimport * as Module from 'module'\n\n/**\n * Does this version of node obey the package.json \"type\" field\n * and throw ERR_REQUIRE_ESM when attempting to require() an ESM modules.\n */\nconst engineSupportsPackageTypeField = parseInt(process.versions.node.split('.')[0], 10) >= 12\n\n// Loaded conditionally so we don't need to support older node versions\nlet assertScriptCanLoadAsCJSImpl: ((filename: string) => void) | undefined\n\n/**\n * Assert that script can be loaded as CommonJS when we attempt to require it.\n * If it should be loaded as ESM, throw ERR_REQUIRE_ESM like node does.\n */\nfunction assertScriptCanLoadAsCJS (filename: string) {\n if (!engineSupportsPackageTypeField) return\n if (!assertScriptCanLoadAsCJSImpl) assertScriptCanLoadAsCJSImpl = require('../dist-raw/node-cjs-loader-utils').assertScriptCanLoadAsCJSImpl\n assertScriptCanLoadAsCJSImpl!(filename)\n}\n\n/**\n * Registered `ts-node` instance information.\n */\nexport const REGISTER_INSTANCE = Symbol.for('ts-node.register.instance')\n\n/**\n * Expose `REGISTER_INSTANCE` information on node.js `process`.\n */\ndeclare global {\n namespace NodeJS {\n interface Process {\n [REGISTER_INSTANCE]?: Register\n }\n }\n}\n\n/**\n * @internal\n */\nexport const INSPECT_CUSTOM = util.inspect.custom || 'inspect'\n\n/**\n * Wrapper around yn module that returns `undefined` instead of `null`.\n * This is implemented by yn v4, but we're staying on v3 to avoid v4's node 10 requirement.\n */\nfunction yn (value: string | undefined) {\n return ynModule(value) ?? undefined\n}\n\n/**\n * Debugging `ts-node`.\n */\nconst shouldDebug = yn(process.env.TS_NODE_DEBUG)\n/** @internal */\nexport const debug = shouldDebug ?\n (...args: any) => console.log(`[ts-node ${new Date().toISOString()}]`, ...args)\n : () => undefined\nconst debugFn = shouldDebug ?\n <T, U>(key: string, fn: (arg: T) => U) => {\n let i = 0\n return (x: T) => {\n debug(key, x, ++i)\n return fn(x)\n }\n } :\n <T, U>(_: string, fn: (arg: T) => U) => fn\n\n/**\n * Common TypeScript interfaces between versions.\n */\nexport interface TSCommon {\n version: typeof _ts.version\n sys: typeof _ts.sys\n ScriptSnapshot: typeof _ts.ScriptSnapshot\n displayPartsToString: typeof _ts.displayPartsToString\n createLanguageService: typeof _ts.createLanguageService\n getDefaultLibFilePath: typeof _ts.getDefaultLibFilePath\n getPreEmitDiagnostics: typeof _ts.getPreEmitDiagnostics\n flattenDiagnosticMessageText: typeof _ts.flattenDiagnosticMessageText\n transpileModule: typeof _ts.transpileModule\n ModuleKind: typeof _ts.ModuleKind\n ScriptTarget: typeof _ts.ScriptTarget\n findConfigFile: typeof _ts.findConfigFile\n readConfigFile: typeof _ts.readConfigFile\n parseJsonConfigFileContent: typeof _ts.parseJsonConfigFileContent\n formatDiagnostics: typeof _ts.formatDiagnostics\n formatDiagnosticsWithColorAndContext: typeof _ts.formatDiagnosticsWithColorAndContext\n}\n\n/**\n * Compiler APIs we use that are marked internal and not included in TypeScript's public API declarations\n */\ninterface TSInternal {\n // https://github.com/microsoft/TypeScript/blob/4a34294908bed6701dcba2456ca7ac5eafe0ddff/src/compiler/core.ts#L1906-L1909\n createGetCanonicalFileName (useCaseSensitiveFileNames: boolean): TSInternal.GetCanonicalFileName\n}\nnamespace TSInternal {\n // https://github.com/microsoft/TypeScript/blob/4a34294908bed6701dcba2456ca7ac5eafe0ddff/src/compiler/core.ts#L1906\n export type GetCanonicalFileName = (fileName: string) => string\n}\n\n/**\n * Export the current version.\n */\nexport const VERSION = require('../package.json').version\n\n/**\n * Options for creating a new TypeScript compiler instance.\n */\nexport interface CreateOptions {\n /**\n * Specify working directory for config resolution.\n *\n * @default process.cwd()\n */\n dir?: string\n /**\n * Emit output files into `.ts-node` directory.\n *\n * @default false\n */\n emit?: boolean\n /**\n * Scope compiler to files within `cwd`.\n *\n * @default false\n */\n scope?: boolean\n /**\n * Use pretty diagnostic formatter.\n *\n * @default false\n */\n pretty?: boolean\n /**\n * Use TypeScript's faster `transpileModule`.\n *\n * @default false\n */\n transpileOnly?: boolean\n /**\n * **DEPRECATED** Specify type-check is enabled (e.g. `transpileOnly == false`).\n *\n * @default true\n */\n typeCheck?: boolean\n /**\n * Use TypeScript's compiler host API.\n *\n * @default false\n */\n compilerHost?: boolean\n /**\n * Logs TypeScript errors to stderr instead of throwing exceptions.\n *\n * @default false\n */\n logError?: boolean\n /**\n * Load files from `tsconfig.json` on startup.\n *\n * @default false\n */\n files?: boolean\n /**\n * Specify a custom TypeScript compiler.\n *\n * @default \"typescript\"\n */\n compiler?: string\n /**\n * Override the path patterns to skip compilation.\n *\n * @default /node_modules/\n * @docsDefault \"/node_modules/\"\n */\n ignore?: string[]\n /**\n * Path to TypeScript JSON project file.\n */\n project?: string\n /**\n * Skip project config resolution and loading.\n *\n * @default false\n */\n skipProject?: boolean\n /**\n * Skip ignore check.\n *\n * @default false\n */\n skipIgnore?: boolean\n /**\n * JSON object to merge with compiler options.\n *\n * @allOf [{\"$ref\": \"https://schemastore.azurewebsites.net/schemas/json/tsconfig.json#definitions/compilerOptionsDefinition/properties/compilerOptions\"}]\n */\n compilerOptions?: object\n /**\n * Ignore TypeScript warnings by diagnostic code.\n */\n ignoreDiagnostics?: Array<number | string>\n /**\n * Modules to require, like node's `--require` flag.\n *\n * If specified in tsconfig.json, the modules will be resolved relative to the tsconfig.json file.\n *\n * If specified programmatically, each input string should be pre-resolved to an absolute path for\n * best results.\n */\n require?: Array<string>\n readFile?: (path: string) => string | undefined\n fileExists?: (path: string) => boolean\n transformers?: _ts.CustomTransformers | ((p: _ts.Program) => _ts.CustomTransformers)\n /**\n * True if require() hooks should interop with experimental ESM loader.\n * Enabled explicitly via a flag since it is a breaking change.\n * @internal\n */\n experimentalEsmLoader?: boolean\n}\n\n/**\n * Options for registering a TypeScript compiler instance globally.\n */\nexport interface RegisterOptions extends CreateOptions {\n /**\n * Re-order file extensions so that TypeScript imports are preferred.\n *\n * @default false\n */\n preferTsExts?: boolean\n}\n\n/**\n * Must be an interface to support `typescript-json-schema`.\n */\nexport interface TsConfigOptions extends Omit<RegisterOptions,\n | 'transformers'\n | 'readFile'\n | 'fileExists'\n | 'skipProject'\n | 'project'\n | 'dir'\n > {}\n\n/**\n * Like `Object.assign`, but ignores `undefined` properties.\n */\nfunction assign<T extends object> (initialValue: T, ...sources: Array<T>): T {\n for (const source of sources) {\n for (const key of Object.keys(source)) {\n const value = (source as any)[key]\n if (value !== undefined) (initialValue as any)[key] = value\n }\n }\n return initialValue\n}\n\n/**\n * Information retrieved from type info check.\n */\nexport interface TypeInfo {\n name: string\n comment: string\n}\n\n/**\n * Default register options, including values specified via environment\n * variables.\n */\nexport const DEFAULTS: RegisterOptions = {\n dir: process.env.TS_NODE_DIR,\n emit: yn(process.env.TS_NODE_EMIT),\n scope: yn(process.env.TS_NODE_SCOPE),\n files: yn(process.env.TS_NODE_FILES),\n pretty: yn(process.env.TS_NODE_PRETTY),\n compiler: process.env.TS_NODE_COMPILER,\n compilerOptions: parse(process.env.TS_NODE_COMPILER_OPTIONS),\n ignore: split(process.env.TS_NODE_IGNORE),\n project: process.env.TS_NODE_PROJECT,\n skipProject: yn(process.env.TS_NODE_SKIP_PROJECT),\n skipIgnore: yn(process.env.TS_NODE_SKIP_IGNORE),\n preferTsExts: yn(process.env.TS_NODE_PREFER_TS_EXTS),\n ignoreDiagnostics: split(process.env.TS_NODE_IGNORE_DIAGNOSTICS),\n transpileOnly: yn(process.env.TS_NODE_TRANSPILE_ONLY),\n typeCheck: yn(process.env.TS_NODE_TYPE_CHECK),\n compilerHost: yn(process.env.TS_NODE_COMPILER_HOST),\n logError: yn(process.env.TS_NODE_LOG_ERROR),\n experimentalEsmLoader: false\n}\n\n/**\n * Default TypeScript compiler options required by `ts-node`.\n */\nconst TS_NODE_COMPILER_OPTIONS = {\n sourceMap: true,\n inlineSourceMap: false,\n inlineSources: true,\n declaration: false,\n noEmit: false,\n outDir: '.ts-node'\n}\n\n/**\n * Split a string array of values.\n */\nexport function split (value: string | undefined) {\n return typeof value === 'string' ? value.split(/ *, */g) : undefined\n}\n\n/**\n * Parse a string as JSON.\n */\nexport function parse (value: string | undefined): object | undefined {\n return typeof value === 'string' ? JSON.parse(value) : undefined\n}\n\n/**\n * Replace backslashes with forward slashes.\n */\nexport function normalizeSlashes (value: string): string {\n return value.replace(/\\\\/g, '/')\n}\n\n/**\n * TypeScript diagnostics error.\n */\nexport class TSError extends BaseError {\n name = 'TSError'\n\n constructor (public diagnosticText: string, public diagnosticCodes: number[]) {\n super(`⨯ Unable to compile TypeScript:\\n${diagnosticText}`)\n }\n\n /**\n * @internal\n */\n [INSPECT_CUSTOM] () {\n return this.diagnosticText\n }\n}\n\n/**\n * Return type for registering `ts-node`.\n */\nexport interface Register {\n ts: TSCommon\n config: _ts.ParsedCommandLine\n options: RegisterOptions\n enabled (enabled?: boolean): boolean\n ignored (fileName: string): boolean\n compile (code: string, fileName: string, lineOffset?: number): string\n getTypeInfo (code: string, fileName: string, position: number): TypeInfo\n}\n\n/**\n * Cached fs operation wrapper.\n */\nfunction cachedLookup<T> (fn: (arg: string) => T): (arg: string) => T {\n const cache = new Map<string, T>()\n\n return (arg: string): T => {\n if (!cache.has(arg)) {\n cache.set(arg, fn(arg))\n }\n\n return cache.get(arg)!\n }\n}\n\n/** @internal */\nexport function getExtensions (config: _ts.ParsedCommandLine) {\n const tsExtensions = ['.ts']\n const jsExtensions = []\n\n // Enable additional extensions when JSX or `allowJs` is enabled.\n if (config.options.jsx) tsExtensions.push('.tsx')\n if (config.options.allowJs) jsExtensions.push('.js')\n if (config.options.jsx && config.options.allowJs) jsExtensions.push('.jsx')\n return { tsExtensions, jsExtensions }\n}\n\n/**\n * Register TypeScript compiler instance onto node.js\n */\nexport function register (opts: RegisterOptions = {}): Register {\n const originalJsHandler = require.extensions['.js'] // tslint:disable-line\n const service = create(opts)\n const { tsExtensions, jsExtensions } = getExtensions(service.config)\n const extensions = [...tsExtensions, ...jsExtensions]\n\n // Expose registered instance globally.\n process[REGISTER_INSTANCE] = service\n\n // Register the extensions.\n registerExtensions(service.options.preferTsExts, extensions, service, originalJsHandler)\n\n // Require specified modules before start-up.\n ;(Module as any)._preloadModules(service.options.require)\n\n return service\n}\n\n/**\n * Create TypeScript compiler instance.\n */\nexport function create (rawOptions: CreateOptions = {}): Register {\n const dir = rawOptions.dir ?? DEFAULTS.dir\n const compilerName = rawOptions.compiler ?? DEFAULTS.compiler\n const cwd = dir ? resolve(dir) : process.cwd()\n\n /**\n * Load the typescript compiler. It is required to load the tsconfig but might\n * be changed by the tsconfig, so we sometimes have to do this twice.\n */\n function loadCompiler (name: string | undefined) {\n const compiler = require.resolve(name || 'typescript', { paths: [cwd, __dirname] })\n const ts: typeof _ts = require(compiler)\n return { compiler, ts }\n }\n\n // Compute minimum options to read the config file.\n let { compiler, ts } = loadCompiler(compilerName)\n\n // Read config file and merge new options between env and CLI options.\n const { config, options: tsconfigOptions } = readConfig(cwd, ts, rawOptions)\n const options = assign<RegisterOptions>({}, DEFAULTS, tsconfigOptions || {}, rawOptions)\n options.require = [\n ...tsconfigOptions.require || [],\n ...rawOptions.require || []\n ]\n\n // If `compiler` option changed based on tsconfig, re-load the compiler.\n if (options.compiler !== compilerName) {\n ({ compiler, ts } = loadCompiler(options.compiler))\n }\n\n const readFile = options.readFile || ts.sys.readFile\n const fileExists = options.fileExists || ts.sys.fileExists\n const transpileOnly = options.transpileOnly === true || options.typeCheck === false\n const transformers = options.transformers || undefined\n const ignoreDiagnostics = [\n 6059, // \"'rootDir' is expected to contain all source files.\"\n 18002, // \"The 'files' list in config file is empty.\"\n 18003, // \"No inputs were found in config file.\"\n ...(options.ignoreDiagnostics || [])\n ].map(Number)\n\n const configDiagnosticList = filterDiagnostics(config.errors, ignoreDiagnostics)\n const outputCache = new Map<string, {\n content: string\n }>()\n\n const isScoped = options.scope ? (relname: string) => relname.charAt(0) !== '.' : () => true\n const shouldIgnore = createIgnore(options.skipIgnore ? [] : (\n options.ignore || ['(?:^|/)node_modules/']\n ).map(str => new RegExp(str)))\n\n const diagnosticHost: _ts.FormatDiagnosticsHost = {\n getNewLine: () => ts.sys.newLine,\n getCurrentDirectory: () => cwd,\n getCanonicalFileName: ts.sys.useCaseSensitiveFileNames ? x => x : x => x.toLowerCase()\n }\n\n // Install source map support and read from memory cache.\n sourceMapSupport.install({\n environment: 'node',\n retrieveFile (pathOrUrl: string) {\n let path = pathOrUrl\n // If it's a file URL, convert to local path\n // Note: fileURLToPath does not exist on early node v10\n // I could not find a way to handle non-URLs except to swallow an error\n if (options.experimentalEsmLoader && path.startsWith('file://')) {\n try {\n path = fileURLToPath(path)\n } catch (e) {/* swallow error */}\n }\n path = normalizeSlashes(path)\n return outputCache.get(path)?.content || ''\n }\n })\n\n const formatDiagnostics = process.stdout.isTTY || options.pretty\n ? (ts.formatDiagnosticsWithColorAndContext || ts.formatDiagnostics)\n : ts.formatDiagnostics\n\n function createTSError (diagnostics: ReadonlyArray<_ts.Diagnostic>) {\n const diagnosticText = formatDiagnostics(diagnostics, diagnosticHost)\n const diagnosticCodes = diagnostics.map(x => x.code)\n return new TSError(diagnosticText, diagnosticCodes)\n }\n\n function reportTSError (configDiagnosticList: _ts.Diagnostic[]) {\n const error = createTSError(configDiagnosticList)\n if (options.logError) {\n // Print error in red color and continue execution.\n console.error('\\x1b[31m%s\\x1b[0m', error)\n } else {\n // Throw error and exit the script.\n throw error\n }\n }\n\n // Render the configuration errors.\n if (configDiagnosticList.length) reportTSError(configDiagnosticList)\n\n /**\n * Get the extension for a transpiled file.\n */\n const getExtension = config.options.jsx === ts.JsxEmit.Preserve ?\n ((path: string) => /\\.[tj]sx$/.test(path) ? '.jsx' : '.js') :\n ((_: string) => '.js')\n\n /**\n * Create the basic required function using transpile mode.\n */\n let getOutput: (code: string, fileName: string) => SourceOutput\n let getTypeInfo: (_code: string, _fileName: string, _position: number) => TypeInfo\n\n const getCanonicalFileName = (ts as unknown as TSInternal).createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)\n\n // In a factory because these are shared across both CompilerHost and LanguageService codepaths\n function createResolverFunctions (serviceHost: _ts.ModuleResolutionHost) {\n const moduleResolutionCache = ts.createModuleResolutionCache(cwd, getCanonicalFileName, config.options)\n const knownInternalFilenames = new Set<string>()\n /** \"Buckets\" (module directories) whose contents should be marked \"internal\" */\n const internalBuckets = new Set<string>()\n\n // Get bucket for a source filename. Bucket is the containing `./node_modules/*/` directory\n // For '/project/node_modules/foo/node_modules/bar/lib/index.js' bucket is '/project/node_modules/foo/node_modules/bar/'\n // For '/project/node_modules/foo/node_modules/@scope/bar/lib/index.js' bucket is '/project/node_modules/foo/node_modules/@scope/bar/'\n const moduleBucketRe = /.*\\/node_modules\\/(?:@[^\\/]+\\/)?[^\\/]+\\//\n function getModuleBucket (filename: string) {\n const find = moduleBucketRe.exec(filename)\n if (find) return find[0]\n return ''\n }\n\n // Mark that this file and all siblings in its bucket should be \"internal\"\n function markBucketOfFilenameInternal (filename: string) {\n internalBuckets.add(getModuleBucket(filename))\n }\n\n function isFileInInternalBucket (filename: string) {\n return internalBuckets.has(getModuleBucket(filename))\n }\n\n function isFileKnownToBeInternal (filename: string) {\n return knownInternalFilenames.has(filename)\n }\n\n /**\n * If we need to emit JS for a file, force TS to consider it non-external\n */\n const fixupResolvedModule = (resolvedModule: _ts.ResolvedModule | _ts.ResolvedTypeReferenceDirective) => {\n const { resolvedFileName } = resolvedModule\n if (resolvedFileName === undefined) return\n // .ts is always switched to internal\n // .js is switched on-demand\n if (\n resolvedModule.isExternalLibraryImport && (\n (resolvedFileName.endsWith('.ts') && !resolvedFileName.endsWith('.d.ts')) ||\n isFileKnownToBeInternal(resolvedFileName) ||\n isFileInInternalBucket(resolvedFileName)\n )\n ) {\n resolvedModule.isExternalLibraryImport = false\n }\n if (!resolvedModule.isExternalLibraryImport) {\n knownInternalFilenames.add(resolvedFileName)\n }\n }\n /*\n * NOTE:\n * Older ts versions do not pass `redirectedReference` nor `options`.\n * We must pass `redirectedReference` to newer ts versions, but cannot rely on `options`, hence the weird argument name\n */\n const resolveModuleNames: _ts.LanguageServiceHost['resolveModuleNames'] = (moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: _ts.ResolvedProjectReference | undefined, optionsOnlyWithNewerTsVersions: _ts.CompilerOptions): (_ts.ResolvedModule | undefined)[] => {\n return moduleNames.map(moduleName => {\n const { resolvedModule } = ts.resolveModuleName(moduleName, containingFile, config.options, serviceHost, moduleResolutionCache, redirectedReference)\n if (resolvedModule) {\n fixupResolvedModule(resolvedModule)\n }\n return resolvedModule\n })\n }\n\n // language service never calls this, but TS docs recommend that we implement it\n const getResolvedModuleWithFailedLookupLocationsFromCache: _ts.LanguageServiceHost['getResolvedModuleWithFailedLookupLocationsFromCache'] = (moduleName, containingFile): _ts.ResolvedModuleWithFailedLookupLocations | undefined => {\n const ret = ts.resolveModuleNameFromCache(moduleName, containingFile, moduleResolutionCache)\n if (ret && ret.resolvedModule) {\n fixupResolvedModule(ret.resolvedModule)\n }\n return ret\n }\n\n const resolveTypeReferenceDirectives: _ts.LanguageServiceHost['resolveTypeReferenceDirectives'] = (typeDirectiveNames: string[], containingFile: string, redirectedReference: _ts.ResolvedProjectReference | undefined, options: _ts.CompilerOptions): (_ts.ResolvedTypeReferenceDirective | undefined)[] => {\n // Note: seems to be called with empty typeDirectiveNames array for all files.\n return typeDirectiveNames.map(typeDirectiveName => {\n const { resolvedTypeReferenceDirective } = ts.resolveTypeReferenceDirective(typeDirectiveName, containingFile, config.options, serviceHost, redirectedReference)\n if (resolvedTypeReferenceDirective) {\n fixupResolvedModule(resolvedTypeReferenceDirective)\n }\n return resolvedTypeReferenceDirective\n })\n }\n\n return {\n resolveModuleNames,\n getResolvedModuleWithFailedLookupLocationsFromCache,\n resolveTypeReferenceDirectives,\n isFileKnownToBeInternal,\n markBucketOfFilenameInternal\n }\n }\n\n // Use full language services when the fast option is disabled.\n if (!transpileOnly) {\n const fileContents = new Map<string, string>()\n const rootFileNames = new Set(config.fileNames)\n const cachedReadFile = cachedLookup(debugFn('readFile', readFile))\n\n // Use language services by default (TODO: invert next major version).\n if (!options.compilerHost) {\n let projectVersion = 1\n const fileVersions = new Map(Array.from(rootFileNames).map(fileName => [fileName, 0]))\n\n const getCustomTransformers = () => {\n if (typeof transformers === 'function') {\n const program = service.getProgram()\n return program ? transformers(program) : undefined\n }\n\n return transformers\n }\n\n // Create the compiler host for type checking.\n const serviceHost: _ts.LanguageServiceHost & Required<Pick<_ts.LanguageServiceHost, 'fileExists' | 'readFile'>> = {\n getProjectVersion: () => String(projectVersion),\n getScriptFileNames: () => Array.from(rootFileNames),\n getScriptVersion: (fileName: string) => {\n const version = fileVersions.get(fileName)\n return version ? version.toString() : ''\n },\n getScriptSnapshot (fileName: string) {\n // TODO ordering of this with getScriptVersion? Should they sync up?\n let contents = fileContents.get(fileName)\n\n // Read contents into TypeScript memory cache.\n if (contents === undefined) {\n contents = cachedReadFile(fileName)\n if (contents === undefined) return\n\n fileVersions.set(fileName, 1)\n fileContents.set(fileName, contents)\n projectVersion++\n }\n\n return ts.ScriptSnapshot.fromString(contents)\n },\n readFile: cachedReadFile,\n readDirectory: ts.sys.readDirectory,\n getDirectories: cachedLookup(debugFn('getDirectories', ts.sys.getDirectories)),\n fileExists: cachedLookup(debugFn('fileExists', fileExists)),\n directoryExists: cachedLookup(debugFn('directoryExists', ts.sys.directoryExists)),\n realpath: ts.sys.realpath ? cachedLookup(debugFn('realpath', ts.sys.realpath)) : undefined,\n getNewLine: () => ts.sys.newLine,\n useCaseSensitiveFileNames: () => ts.sys.useCaseSensitiveFileNames,\n getCurrentDirectory: () => cwd,\n getCompilationSettings: () => config.options,\n getDefaultLibFileName: () => ts.getDefaultLibFilePath(config.options),\n getCustomTransformers: getCustomTransformers\n }\n const { resolveModuleNames, getResolvedModuleWithFailedLookupLocationsFromCache, resolveTypeReferenceDirectives, isFileKnownToBeInternal, markBucketOfFilenameInternal } = createResolverFunctions(serviceHost)\n serviceHost.resolveModuleNames = resolveModuleNames\n serviceHost.getResolvedModuleWithFailedLookupLocationsFromCache = getResolvedModuleWithFailedLookupLocationsFromCache\n serviceHost.resolveTypeReferenceDirectives = resolveTypeReferenceDirectives\n\n const registry = ts.createDocumentRegistry(ts.sys.useCaseSensitiveFileNames, cwd)\n const service = ts.createLanguageService(serviceHost, registry)\n\n const updateMemoryCache = (contents: string, fileName: string) => {\n // Add to `rootFiles` as necessary, either to make TS include a file it has not seen,\n // or to trigger a re-classification of files from external to internal.\n if (!rootFileNames.has(fileName) && !isFileKnownToBeInternal(fileName)) {\n markBucketOfFilenameInternal(fileName)\n rootFileNames.add(fileName)\n // Increment project version for every change to rootFileNames.\n projectVersion++\n }\n\n const previousVersion = fileVersions.get(fileName) || 0\n const previousContents = fileContents.get(fileName)\n // Avoid incrementing cache when nothing has changed.\n if (contents !== previousContents) {\n fileVersions.set(fileName, previousVersion + 1)\n fileContents.set(fileName, contents)\n // Increment project version for every file change.\n projectVersion++\n }\n }\n\n let previousProgram: _ts.Program | undefined = undefined\n\n getOutput = (code: string, fileName: string) => {\n updateMemoryCache(code, fileName)\n\n const programBefore = service.getProgram()\n if (programBefore !== previousProgram) {\n debug(`compiler rebuilt Program instance when getting output for ${fileName}`)\n }\n\n const output = service.getEmitOutput(fileName)\n\n // Get the relevant diagnostics - this is 3x faster than `getPreEmitDiagnostics`.\n const diagnostics = service.getSemanticDiagnostics(fileName)\n .concat(service.getSyntacticDiagnostics(fileName))\n\n const programAfter = service.getProgram()\n\n debug(\n 'invariant: Is service.getProject() identical before and after getting emit output and diagnostics? (should always be true) ',\n programBefore === programAfter\n )\n\n previousProgram = programAfter\n\n const diagnosticList = filterDiagnostics(diagnostics, ignoreDiagnostics)\n if (diagnosticList.length) reportTSError(diagnosticList)\n\n if (output.emitSkipped) {\n throw new TypeError(`${relative(cwd, fileName)}: Emit skipped`)\n }\n\n // Throw an error when requiring `.d.ts` files.\n if (output.outputFiles.length === 0) {\n throw new TypeError(\n `Unable to require file: ${relative(cwd, fileName)}\\n` +\n 'This is usually the result of a faulty configuration or import. ' +\n 'Make sure there is a `.js`, `.json` or other executable extension with ' +\n 'loader attached before `ts-node` available.'\n )\n }\n\n return [output.outputFiles[1].text, output.outputFiles[0].text]\n }\n\n getTypeInfo = (code: string, fileName: string, position: number) => {\n updateMemoryCache(code, fileName)\n\n const info = service.getQuickInfoAtPosition(fileName, position)\n const name = ts.displayPartsToString(info ? info.displayParts : [])\n const comment = ts.displayPartsToString(info ? info.documentation : [])\n\n return { name, comment }\n }\n } else {\n const sys: _ts.System & _ts.FormatDiagnosticsHost = {\n ...ts.sys,\n ...diagnosticHost,\n readFile: (fileName: string) => {\n const cacheContents = fileContents.get(fileName)\n if (cacheContents !== undefined) return cacheContents\n const contents = cachedReadFile(fileName)\n if (contents) fileContents.set(fileName, contents)\n return contents\n },\n readDirectory: ts.sys.readDirectory,\n getDirectories: cachedLookup(debugFn('getDirectories', ts.sys.getDirectories)),\n fileExists: cachedLookup(debugFn('fileExists', fileExists)),\n directoryExists: cachedLookup(debugFn('directoryExists', ts.sys.directoryExists)),\n resolvePath: cachedLookup(debugFn('resolvePath', ts.sys.resolvePath)),\n realpath: ts.sys.realpath ? cachedLookup(debugFn('realpath', ts.sys.realpath)) : undefined\n }\n\n const host: _ts.CompilerHost = ts.createIncrementalCompilerHost\n ? ts.createIncrementalCompilerHost(config.options, sys)\n : {\n ...sys,\n getSourceFile: (fileName, languageVersion) => {\n const contents = sys.readFile(fileName)\n if (contents === undefined) return\n return ts.createSourceFile(fileName, contents, languageVersion)\n },\n getDefaultLibLocation: () => normalizeSlashes(dirname(compiler)),\n getDefaultLibFileName: () => normalizeSlashes(join(dirname(compiler), ts.getDefaultLibFileName(config.options))),\n useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames\n }\n const { resolveModuleNames, resolveTypeReferenceDirectives, isFileKnownToBeInternal, markBucketOfFilenameInternal } = createResolverFunctions(host)\n host.resolveModuleNames = resolveModuleNames\n host.resolveTypeReferenceDirectives = resolveTypeReferenceDirectives\n\n // Fallback for older TypeScript releases without incremental API.\n let builderProgram = ts.createIncrementalProgram\n ? ts.createIncrementalProgram({\n rootNames: Array.from(rootFileNames),\n options: config.options,\n host: host,\n configFileParsingDiagnostics: config.errors,\n projectReferences: config.projectReferences\n })\n : ts.createEmitAndSemanticDiagnosticsBuilderProgram(\n Array.from(rootFileNames),\n config.options,\n host,\n undefined,\n config.errors,\n config.projectReferences\n )\n\n // Read and cache custom transformers.\n const customTransformers = typeof transformers === 'function'\n ? transformers(builderProgram.getProgram())\n : transformers\n\n // Set the file contents into cache manually.\n const updateMemoryCache = (contents: string, fileName: string) => {\n const previousContents = fileContents.get(fileName)\n const contentsChanged = previousContents !== contents\n if (contentsChanged) {\n fileContents.set(fileName, contents)\n }\n\n // Add to `rootFiles` when discovered by compiler for the first time.\n let addedToRootFileNames = false\n if (!rootFileNames.has(fileName) && !isFileKnownToBeInternal(fileName)) {\n markBucketOfFilenameInternal(fileName)\n rootFileNames.add(fileName)\n addedToRootFileNames = true\n }\n\n // Update program when file changes.\n if (addedToRootFileNames || contentsChanged) {\n builderProgram = ts.createEmitAndSemanticDiagnosticsBuilderProgram(\n Array.from(rootFileNames),\n config.options,\n host,\n builderProgram,\n config.errors,\n config.projectReferences\n )\n }\n }\n\n getOutput = (code: string, fileName: string) => {\n const output: [string, string] = ['', '']\n\n updateMemoryCache(code, fileName)\n\n const sourceFile = builderProgram.getSourceFile(fileName)\n if (!sourceFile) throw new TypeError(`Unable to read file: ${fileName}`)\n\n const program = builderProgram.getProgram()\n const diagnostics = ts.getPreEmitDiagnostics(program, sourceFile)\n const diagnosticList = filterDiagnostics(diagnostics, ignoreDiagnostics)\n if (diagnosticList.length) reportTSError(diagnosticList)\n\n const result = builderProgram.emit(sourceFile, (path, file, writeByteOrderMark) => {\n if (path.endsWith('.map')) {\n output[1] = file\n } else {\n output[0] = file\n }\n\n if (options.emit) sys.writeFile(path, file, writeByteOrderMark)\n }, undefined, undefined, customTransformers)\n\n if (result.emitSkipped) {\n throw new TypeError(`${relative(cwd, fileName)}: Emit skipped`)\n }\n\n // Throw an error when requiring files that cannot be compiled.\n if (output[0] === '') {\n if (program.isSourceFileFromExternalLibrary(sourceFile)) {\n throw new TypeError(`Unable to compile file from external library: ${relative(cwd, fileName)}`)\n }\n\n throw new TypeError(\n `Unable to require file: ${relative(cwd, fileName)}\\n` +\n 'This is usually the result of a faulty configuration or import. ' +\n 'Make sure there is a `.js`, `.json` or other executable extension with ' +\n 'loader attached before `ts-node` available.'\n )\n }\n\n return output\n }\n\n getTypeInfo = (code: string, fileName: string, position: number) => {\n updateMemoryCache(code, fileName)\n\n const sourceFile = builderProgram.getSourceFile(fileName)\n if (!sourceFile) throw new TypeError(`Unable to read file: ${fileName}`)\n\n const node = getTokenAtPosition(ts, sourceFile, position)\n const checker = builderProgram.getProgram().getTypeChecker()\n const symbol = checker.getSymbolAtLocation(node)\n\n if (!symbol) return { name: '', comment: '' }\n\n const type = checker.getTypeOfSymbolAtLocation(symbol, node)\n const signatures = [...type.getConstructSignatures(), ...type.getCallSignatures()]\n\n return {\n name: signatures.length ? signatures.map(x => checker.signatureToString(x)).join('\\n') : checker.typeToString(type),\n comment: ts.displayPartsToString(symbol ? symbol.getDocumentationComment(checker) : [])\n }\n }\n\n // Write `.tsbuildinfo` when `--build` is enabled.\n if (options.emit && config.options.incremental) {\n process.on('exit', () => {\n // Emits `.tsbuildinfo` to filesystem.\n (builderProgram.getProgram() as any).emitBuildInfo()\n })\n }\n }\n } else {\n if (typeof transformers === 'function') {\n throw new TypeError('Transformers function is unavailable in \"--transpile-only\"')\n }\n\n getOutput = (code: string, fileName: string): SourceOutput => {\n const result = ts.transpileModule(code, {\n fileName,\n compilerOptions: config.options,\n reportDiagnostics: true,\n transformers: transformers\n })\n\n const diagnosticList = filterDiagnostics(result.diagnostics || [], ignoreDiagnostics)\n if (diagnosticList.length) reportTSError(diagnosticList)\n\n return [result.outputText, result.sourceMapText as string]\n }\n\n getTypeInfo = () => {\n throw new TypeError('Type information is unavailable in \"--transpile-only\"')\n }\n }\n\n // Create a simple TypeScript compiler proxy.\n function compile (code: string, fileName: string, lineOffset = 0) {\n const normalizedFileName = normalizeSlashes(fileName)\n const [value, sourceMap] = getOutput(code, normalizedFileName)\n const output = updateOutput(value, normalizedFileName, sourceMap, getExtension)\n outputCache.set(normalizedFileName, { content: output })\n return output\n }\n\n let active = true\n const enabled = (enabled?: boolean) => enabled === undefined ? active : (active = !!enabled)\n const extensions = getExtensions(config)\n const ignored = (fileName: string) => {\n if (!active) return true\n const ext = extname(fileName)\n if (extensions.tsExtensions.includes(ext) || extensions.jsExtensions.includes(ext)) {\n const relname = relative(cwd, fileName)\n return !isScoped(relname) || shouldIgnore(relname)\n }\n return true\n }\n\n return { ts, config, compile, getTypeInfo, ignored, enabled, options }\n}\n\n/**\n * Check if the filename should be ignored.\n */\nfunction createIgnore (ignore: RegExp[]) {\n return (relname: string) => {\n const path = normalizeSlashes(relname)\n\n return ignore.some(x => x.test(path))\n }\n}\n\n/**\n * \"Refreshes\" an extension on `require.extensions`.\n *\n * @param {string} ext\n */\nfunction reorderRequireExtension (ext: string) {\n const old = require.extensions[ext] // tslint:disable-line\n delete require.extensions[ext] // tslint:disable-line\n require.extensions[ext] = old // tslint:disable-line\n}\n\n/**\n * Register the extensions to support when importing files.\n */\nfunction registerExtensions (\n preferTsExts: boolean | null | undefined,\n extensions: string[],\n register: Register,\n originalJsHandler: (m: NodeModule, filename: string) => any\n) {\n // Register new extensions.\n for (const ext of extensions) {\n registerExtension(ext, register, originalJsHandler)\n }\n\n if (preferTsExts) {\n // tslint:disable-next-line\n const preferredExtensions = new Set([...extensions, ...Object.keys(require.extensions)])\n\n for (const ext of preferredExtensions) reorderRequireExtension(ext)\n }\n}\n\n/**\n * Register the extension for node.\n */\nfunction registerExtension (\n ext: string,\n register: Register,\n originalHandler: (m: NodeModule, filename: string) => any\n) {\n const old = require.extensions[ext] || originalHandler // tslint:disable-line\n\n require.extensions[ext] = function (m: any, filename) { // tslint:disable-line\n if (register.ignored(filename)) return old(m, filename)\n\n if (register.options.experimentalEsmLoader) {\n assertScriptCanLoadAsCJS(filename)\n }\n\n const _compile = m._compile\n\n m._compile = function (code: string, fileName: string) {\n debug('module._compile', fileName)\n\n return _compile.call(this, register.compile(code, fileName), fileName)\n }\n\n return old(m, filename)\n }\n}\n\n/**\n * Do post-processing on config options to support `ts-node`.\n */\nfunction fixConfig (ts: TSCommon, config: _ts.ParsedCommandLine) {\n // Delete options that *should not* be passed through.\n delete config.options.out\n delete config.options.outFile\n delete config.options.composite\n delete config.options.declarationDir\n delete config.options.declarationMap\n delete config.options.emitDeclarationOnly\n\n // Target ES5 output by default (instead of ES3).\n if (config.options.target === undefined) {\n config.options.target = ts.ScriptTarget.ES5\n }\n\n // Target CommonJS modules by default (instead of magically switching to ES6 when the target is ES6).\n if (config.options.module === undefined) {\n config.options.module = ts.ModuleKind.CommonJS\n }\n\n return config\n}\n\n/**\n * Load TypeScript configuration. Returns the parsed TypeScript config and\n * any `ts-node` options specified in the config file.\n */\nfunction readConfig (\n cwd: string,\n ts: TSCommon,\n rawOptions: CreateOptions\n): {\n // Parsed TypeScript configuration.\n config: _ts.ParsedCommandLine\n // Options pulled from `tsconfig.json`.\n options: TsConfigOptions\n} {\n let config: any = { compilerOptions: {} }\n let basePath = cwd\n let configFileName: string | undefined = undefined\n\n const {\n fileExists = ts.sys.fileExists,\n readFile = ts.sys.readFile,\n skipProject = DEFAULTS.skipProject,\n project = DEFAULTS.project\n } = rawOptions\n\n // Read project configuration when available.\n if (!skipProject) {\n configFileName = project\n ? resolve(cwd, project)\n : ts.findConfigFile(cwd, fileExists)\n\n if (configFileName) {\n const result = ts.readConfigFile(configFileName, readFile)\n\n // Return diagnostics.\n if (result.error) {\n return {\n config: { errors: [result.error], fileNames: [], options: {} },\n options: {}\n }\n }\n\n config = result.config\n basePath = dirname(configFileName)\n }\n }\n\n // Fix ts-node options that come from tsconfig.json\n const tsconfigOptions: TsConfigOptions = Object.assign({}, config['ts-node'])\n\n // Remove resolution of \"files\".\n const files = rawOptions.files ?? tsconfigOptions.files ?? DEFAULTS.files\n if (!files) {\n config.files = []\n config.include = []\n }\n\n // Override default configuration options `ts-node` requires.\n config.compilerOptions = Object.assign(\n {},\n config.compilerOptions,\n DEFAULTS.compilerOptions,\n tsconfigOptions.compilerOptions,\n rawOptions.compilerOptions,\n TS_NODE_COMPILER_OPTIONS\n )\n\n const fixedConfig = fixConfig(ts, ts.parseJsonConfigFileContent(config, {\n fileExists,\n readFile,\n readDirectory: ts.sys.readDirectory,\n useCaseSensitiveFileNames: ts.sys.useCaseSensitiveFileNames\n }, basePath, undefined, configFileName))\n\n if (tsconfigOptions.require) {\n // Modules are found relative to the tsconfig file, not the `dir` option\n const tsconfigRelativeRequire = createRequire(configFileName!)\n tsconfigOptions.require = tsconfigOptions.require.map((path: string) => {\n return tsconfigRelativeRequire.resolve(path)\n })\n }\n\n return { config: fixedConfig, options: tsconfigOptions }\n}\n\n/**\n * Internal source output.\n */\ntype SourceOutput = [string, string]\n\n/**\n * Update the output remapping the source map.\n */\nfunction updateOutput (outputText: string, fileName: string, sourceMap: string, getExtension: (fileName: string) => string) {\n const base64Map = Buffer.from(updateSourceMap(sourceMap, fileName), 'utf8').toString('base64')\n const sourceMapContent = `data:application/json;charset=utf-8;base64,${base64Map}`\n const sourceMapLength = `${basename(fileName)}.map`.length + (getExtension(fileName).length - extname(fileName).length)\n\n return outputText.slice(0, -sourceMapLength) + sourceMapContent\n}\n\n/**\n * Update the source map contents for improved output.\n */\nfunction updateSourceMap (sourceMapText: string, fileName: string) {\n const sourceMap = JSON.parse(sourceMapText)\n sourceMap.file = fileName\n sourceMap.sources = [fileName]\n delete sourceMap.sourceRoot\n return JSON.stringify(sourceMap)\n}\n\n/**\n * Filter diagnostics.\n */\nfunction filterDiagnostics (diagnostics: readonly _ts.Diagnostic[], ignore: number[]) {\n return diagnostics.filter(x => ignore.indexOf(x.code) === -1)\n}\n\n/**\n * Get token at file position.\n *\n * Reference: https://github.com/microsoft/TypeScript/blob/fcd9334f57d85b73dd66ad2d21c02e84822f4841/src/services/utilities.ts#L705-L731\n */\nfunction getTokenAtPosition (ts: typeof _ts, sourceFile: _ts.SourceFile, position: number): _ts.Node {\n let current: _ts.Node = sourceFile\n\n outer: while (true) {\n for (const child of current.getChildren(sourceFile)) {\n const start = child.getFullStart()\n if (start > position) break\n\n const end = child.getEnd()\n if (position <= end) {\n current = child\n continue outer\n }\n }\n\n return current\n }\n}\n\nlet nodeCreateRequire: (path: string) => NodeRequire\nfunction createRequire (filename: string) {\n if (!nodeCreateRequire) {\n // tslint:disable-next-line\n nodeCreateRequire = Module.createRequire || Module.createRequireFromPath || require('../dist-raw/node-createrequire').createRequireFromPath\n }\n return nodeCreateRequire(filename)\n}\n"]} |