You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
57KB

  1. {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,+BAA0E;AAC1E,uDAAuD;AACvD,+BAA8B;AAC9B,2CAAsC;AACtC,6BAA4B;AAG5B;;GAEG;AACU,QAAA,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAA;AAaxE;;GAEG;AACU,QAAA,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,SAAS,CAAA;AAE9D;;;GAGG;AACH,SAAS,EAAE,CAAE,KAAyB;;IACpC,YAAO,QAAQ,CAAC,KAAK,CAAC,uCAAI,SAAS,EAAA;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,WAAW,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;AACjD,gBAAgB;AACH,QAAA,KAAK,GAAG,WAAW,CAAC,CAAC;IAChC,CAAC,GAAG,IAAS,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC/E,CAAC,CAAC,GAAG,EAAE,CAAC,SAAS,CAAA;AACnB,MAAM,OAAO,GAAG,WAAW,CAAC,CAAC;IAC3B,CAAO,GAAW,EAAE,EAAiB,EAAE,EAAE;QACvC,IAAI,CAAC,GAAG,CAAC,CAAA;QACT,OAAO,CAAC,CAAI,EAAE,EAAE;YACd,aAAK,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;YAClB,OAAO,EAAE,CAAC,CAAC,CAAC,CAAA;QACd,CAAC,CAAA;IACH,CAAC,CAAC,CAAC;IACH,CAAO,CAAS,EAAE,EAAiB,EAAE,EAAE,CAAC,EAAE,CAAA;AAwB5C;;GAEG;AACU,QAAA,OAAO,GAAG,OAAO,CAAC,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,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","sourcesContent":["import { relative, basename, extname, resolve, dirname, join } from 'path'\nimport sourceMapSupport = require('source-map-support')\nimport * as ynModule from 'yn'\nimport { BaseError } from 'make-error'\nimport * as util from 'util'\nimport * as _ts from 'typescript'\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 * 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 readFile?: (path: string) => string | undefined\n fileExists?: (path: string) => boolean\n transformers?: _ts.CustomTransformers | ((p: _ts.Program) => _ts.CustomTransformers)\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}\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 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<CreateOptions>({}, DEFAULTS, tsconfigOptions || {}, rawOptions)\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 (path: string) {\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 getOutputTranspileOnly = (code: string, fileName: string, overrideCompilerOptions?: Partial<_ts.CompilerOptions>): SourceOutput => {\n const result = ts.transpileModule(code, {\n fileName,\n compilerOptions: overrideCompilerOptions ? { ...config.options, ...overrideCompilerOptions } : config.options,\n reportDiagnostics: true\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 // Use full language services when the fast option is disabled.\n if (!transpileOnly) {\n const fileContents = new Map<string, string>()\n const rootFileNames = config.fileNames.slice()\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(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 = {\n getProjectVersion: () => String(projectVersion),\n getScriptFileNames: () => Array.from(fileVersions.keys()),\n getScriptVersion: (fileName: string) => {\n const version = fileVersions.get(fileName)\n return version ? version.toString() : ''\n },\n getScriptSnapshot (fileName: string) {\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 }\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 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\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` when discovered for the first time.\n if (!fileVersions.has(fileName)) {\n rootFileNames.push(fileName)\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 = {\n ...ts.sys,\n ...diagnosticHost,\n readFile: (fileName: string) => {\n const cacheContents = fileContents.get(fileName)\n if (cacheContents !== undefined) return cacheContents\n return cachedReadFile(fileName)\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\n // Fallback for older TypeScript releases without incremental API.\n let builderProgram = ts.createIncrementalProgram\n ? ts.createIncrementalProgram({\n rootNames: rootFileNames.slice(),\n options: config.options,\n host: host,\n configFileParsingDiagnostics: config.errors,\n projectReferences: config.projectReferences\n })\n : ts.createEmitAndSemanticDiagnosticsBuilderProgram(\n rootFileNames.slice(),\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 sourceFile = builderProgram.getSourceFile(fileName)\n\n fileContents.set(fileName, contents)\n\n // Add to `rootFiles` when discovered by compiler for the first time.\n if (sourceFile === undefined) {\n rootFileNames.push(fileName)\n }\n\n // Update program when file changes.\n if (sourceFile === undefined || sourceFile.text !== contents) {\n builderProgram = ts.createEmitAndSemanticDiagnosticsBuilderProgram(\n rootFileNames.slice(),\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 = getOutputTranspileOnly\n\n getTypeInfo = () => {\n throw new TypeError('Type information is unavailable in \"--transpile-only\"')\n }\n }\n\n const cannotCompileViaBothCodepathsErrorMessage = 'Cannot compile the same file via both `require()` and ESM hooks codepaths. ' +\n 'This breaks source-map-support, which cannot tell the difference between the two sourcemaps. ' +\n 'To avoid this problem, load each .ts file as only ESM or only CommonJS.'\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 ignored = (fileName: string) => {\n if (!active) return true\n const relname = relative(cwd, fileName)\n if (!config.options.allowJs) {\n const ext = extname(fileName)\n if (ext === '.js' || ext === '.jsx') return true\n }\n return !isScoped(relname) || shouldIgnore(relname)\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 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 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"]}