+5
-13
@@ -265,3 +265,3 @@ "use strict"; | ||
| getProjectVersion: () => String(projectVersion), | ||
| getScriptFileNames: () => rootFileNames, | ||
| getScriptFileNames: () => Array.from(fileContents.keys()), | ||
| getScriptVersion: (fileName) => { | ||
@@ -298,23 +298,15 @@ const version = fileVersions.get(fileName); | ||
| const updateMemoryCache = (contents, fileName) => { | ||
| let shouldIncrementProjectVersion = false; | ||
| const fileVersion = fileVersions.get(fileName) || 0; | ||
| const isFileInCache = fileVersion !== 0; | ||
| // Add to `rootFiles` when discovered for the first time. | ||
| if (!isFileInCache) { | ||
| if (fileVersion === 0) { | ||
| rootFileNames.push(fileName); | ||
| // Modifying rootFileNames means a project change | ||
| shouldIncrementProjectVersion = true; | ||
| } | ||
| const previousContents = fileContents.get(fileName); | ||
| // Avoid incrementing cache when nothing has changed. | ||
| if (previousContents !== contents) { | ||
| if (contents !== previousContents) { | ||
| fileVersions.set(fileName, fileVersion + 1); | ||
| fileContents.set(fileName, contents); | ||
| // Only bump project version when file is modified in cache, not when discovered for the first time | ||
| if (isFileInCache) { | ||
| shouldIncrementProjectVersion = true; | ||
| } | ||
| // Increment project version for every file change. | ||
| projectVersion++; | ||
| } | ||
| if (shouldIncrementProjectVersion) | ||
| projectVersion++; | ||
| }; | ||
@@ -321,0 +313,0 @@ let previousProgram = undefined; |
@@ -1,1 +0,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,CAA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AG,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","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)\nconst debug = shouldDebug ? console.log.bind(console, 'ts-node') : () => 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/**\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 extensions = ['.ts']\n\n // Enable additional extensions when JSX or `allowJs` is enabled.\n if (service.config.options.jsx) extensions.push('.tsx')\n if (service.config.options.allowJs) extensions.push('.js')\n if (service.config.options.jsx && service.config.options.allowJs) extensions.push('.jsx')\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, string>()\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) || ''\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, lineOffset: number) => SourceOutput\n let getTypeInfo: (_code: string, _fileName: string, _position: number) => TypeInfo\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<string, number>()\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: () => rootFileNames,\n getScriptVersion: (fileName: string) => {\n const version = fileVersions.get(fileName)\n return version === undefined ? '' : 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 let shouldIncrementProjectVersion = false\n const fileVersion = fileVersions.get(fileName) || 0\n const isFileInCache = fileVersion !== 0\n\n // Add to `rootFiles` when discovered for the first time.\n if (!isFileInCache) {\n rootFileNames.push(fileName)\n // Modifying rootFileNames means a project change\n shouldIncrementProjectVersion = true\n }\n\n const previousContents = fileContents.get(fileName)\n // Avoid incrementing cache when nothing has changed.\n if (previousContents !== contents) {\n fileVersions.set(fileName, fileVersion + 1)\n fileContents.set(fileName, contents)\n // Only bump project version when file is modified in cache, not when discovered for the first time\n if (isFileInCache) {\n shouldIncrementProjectVersion = true\n }\n }\n\n if (shouldIncrementProjectVersion) projectVersion++\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 debug('invariant: Is service.getProject() identical before and after getting emit output and diagnostics? (should always be true) ', programBefore === programAfter)\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 = (code: string, fileName: string): SourceOutput => {\n const result = ts.transpileModule(code, {\n fileName,\n transformers,\n compilerOptions: 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 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 [value, sourceMap] = getOutput(code, fileName, lineOffset)\n const output = updateOutput(value, fileName, sourceMap, getExtension)\n outputCache.set(fileName, 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 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"]} | ||
| {"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,MAAM,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,SAAS,CAAA;AAClF,MAAM,OAAO,GAAG,WAAW,CAAC,CAAC;IAC3B,CAAQ,GAAW,EAAE,EAAiB,EAAE,EAAE;QACxC,IAAI,CAAC,GAAG,CAAC,CAAA;QACT,OAAO,CAAC,CAAI,EAAE,EAAE;YACd,KAAK,CAAC,GAAG,E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,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;AAClC,CAAC;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","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)\nconst debug = shouldDebug ? console.log.bind(console, 'ts-node') : () => 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/**\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 extensions = ['.ts']\n\n // Enable additional extensions when JSX or `allowJs` is enabled.\n if (service.config.options.jsx) extensions.push('.tsx')\n if (service.config.options.allowJs) extensions.push('.js')\n if (service.config.options.jsx && service.config.options.allowJs) extensions.push('.jsx')\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, string>()\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) || ''\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, lineOffset: number) => SourceOutput\n let getTypeInfo: (_code: string, _fileName: string, _position: number) => TypeInfo\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<string, number>()\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(fileContents.keys()),\n getScriptVersion: (fileName: string) => {\n const version = fileVersions.get(fileName)\n return version === undefined ? '' : 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 const fileVersion = fileVersions.get(fileName) || 0\n\n // Add to `rootFiles` when discovered for the first time.\n if (fileVersion === 0) {\n rootFileNames.push(fileName)\n }\n\n const previousContents = fileContents.get(fileName)\n // Avoid incrementing cache when nothing has changed.\n if (contents !== previousContents) {\n fileVersions.set(fileName, fileVersion + 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 = (code: string, fileName: string): SourceOutput => {\n const result = ts.transpileModule(code, {\n fileName,\n transformers,\n compilerOptions: 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 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 [value, sourceMap] = getOutput(code, fileName, lineOffset)\n const output = updateOutput(value, fileName, sourceMap, getExtension)\n outputCache.set(fileName, 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 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"]} |
+39
-31
@@ -12,6 +12,7 @@ "use strict"; | ||
| const PROJECT = path_1.join(TEST_DIR, 'tsconfig.json'); | ||
| const BIN_EXEC = `node "${path_1.join(__dirname, '../dist/bin')}" --project "${PROJECT}"`; | ||
| const SCRIPT_EXEC = `node "${path_1.join(__dirname, '../dist/bin-script')}"`; | ||
| const BIN_PATH = path_1.join(__dirname, '../dist/bin'); | ||
| const BIN_SCRIPT_PATH = path_1.join(__dirname, '../dist/bin-script'); | ||
| const SOURCE_MAP_REGEXP = /\/\/# sourceMappingURL=data:application\/json;charset=utf\-8;base64,[\w\+]+=*$/; | ||
| describe('ts-node', function () { | ||
| const cmd = `node "${BIN_PATH}" --project "${PROJECT}"`; | ||
| this.timeout(10000); | ||
@@ -24,3 +25,3 @@ it('should export the correct version', function () { | ||
| it('should execute cli', function (done) { | ||
| child_process_1.exec(`${BIN_EXEC} tests/hello-world`, function (err, stdout) { | ||
| child_process_1.exec(`${cmd} tests/hello-world`, function (err, stdout) { | ||
| chai_1.expect(err).to.equal(null); | ||
@@ -41,3 +42,3 @@ chai_1.expect(stdout).to.equal('Hello, world!\n'); | ||
| it('should execute cli with absolute path', function (done) { | ||
| child_process_1.exec(`${BIN_EXEC} "${path_1.join(TEST_DIR, 'hello-world')}"`, function (err, stdout) { | ||
| child_process_1.exec(`${cmd} "${path_1.join(TEST_DIR, 'hello-world')}"`, function (err, stdout) { | ||
| chai_1.expect(err).to.equal(null); | ||
@@ -49,3 +50,3 @@ chai_1.expect(stdout).to.equal('Hello, world!\n'); | ||
| it('should print scripts', function (done) { | ||
| child_process_1.exec(`${BIN_EXEC} -pe "import { example } from './tests/complex/index';example()"`, function (err, stdout) { | ||
| child_process_1.exec(`${cmd} -pe "import { example } from './tests/complex/index';example()"`, function (err, stdout) { | ||
| chai_1.expect(err).to.equal(null); | ||
@@ -57,3 +58,3 @@ chai_1.expect(stdout).to.equal('example\n'); | ||
| it('should provide registered information globally', function (done) { | ||
| child_process_1.exec(`${BIN_EXEC} tests/env`, function (err, stdout) { | ||
| child_process_1.exec(`${cmd} tests/env`, function (err, stdout) { | ||
| chai_1.expect(err).to.equal(null); | ||
@@ -76,3 +77,3 @@ chai_1.expect(stdout).to.equal('object\n'); | ||
| child_process_1.exec([ | ||
| BIN_EXEC, | ||
| cmd, | ||
| '-O "{\\\"allowJs\\\":true}"', | ||
@@ -88,3 +89,3 @@ '-pe "import { main } from \'./tests/allow-js/run\';main()"' | ||
| child_process_1.exec([ | ||
| BIN_EXEC, | ||
| cmd, | ||
| '-O "{\\\"allowJs\\\":true}"', | ||
@@ -100,3 +101,3 @@ '-pe "import { Foo2 } from \'./tests/allow-js/with-jsx\'; Foo2.sayHi()"' | ||
| it('should eval code', function (done) { | ||
| child_process_1.exec(`${BIN_EXEC} -e "import * as m from './tests/module';console.log(m.example('test'))"`, function (err, stdout) { | ||
| child_process_1.exec(`${cmd} -e "import * as m from './tests/module';console.log(m.example('test'))"`, function (err, stdout) { | ||
| chai_1.expect(err).to.equal(null); | ||
@@ -108,3 +109,3 @@ chai_1.expect(stdout).to.equal('TEST\n'); | ||
| it('should import empty files', function (done) { | ||
| child_process_1.exec(`${BIN_EXEC} -e "import './tests/empty'"`, function (err, stdout) { | ||
| child_process_1.exec(`${cmd} -e "import './tests/empty'"`, function (err, stdout) { | ||
| chai_1.expect(err).to.equal(null); | ||
@@ -116,3 +117,3 @@ chai_1.expect(stdout).to.equal(''); | ||
| it('should throw errors', function (done) { | ||
| child_process_1.exec(`${BIN_EXEC} -e "import * as m from './tests/module';console.log(m.example(123))"`, function (err) { | ||
| child_process_1.exec(`${cmd} -e "import * as m from './tests/module';console.log(m.example(123))"`, function (err) { | ||
| if (err === null) { | ||
@@ -127,3 +128,3 @@ return done('Command was expected to fail, but it succeeded.'); | ||
| it('should be able to ignore diagnostic', function (done) { | ||
| child_process_1.exec(`${BIN_EXEC} --ignore-diagnostics 2345 -e "import * as m from './tests/module';console.log(m.example(123))"`, function (err) { | ||
| child_process_1.exec(`${cmd} --ignore-diagnostics 2345 -e "import * as m from './tests/module';console.log(m.example(123))"`, function (err) { | ||
| if (err === null) { | ||
@@ -137,3 +138,3 @@ return done('Command was expected to fail, but it succeeded.'); | ||
| it('should work with source maps', function (done) { | ||
| child_process_1.exec(`${BIN_EXEC} tests/throw`, function (err) { | ||
| child_process_1.exec(`${cmd} tests/throw`, function (err) { | ||
| if (err === null) { | ||
@@ -152,3 +153,3 @@ return done('Command was expected to fail, but it succeeded.'); | ||
| it('eval should work with source maps', function (done) { | ||
| child_process_1.exec(`${BIN_EXEC} -pe "import './tests/throw'"`, function (err) { | ||
| child_process_1.exec(`${cmd} -pe "import './tests/throw'"`, function (err) { | ||
| if (err === null) { | ||
@@ -166,3 +167,3 @@ return done('Command was expected to fail, but it succeeded.'); | ||
| it('should support transpile only mode', function (done) { | ||
| child_process_1.exec(`${BIN_EXEC} --transpile-only -pe "x"`, function (err) { | ||
| child_process_1.exec(`${cmd} --transpile-only -pe "x"`, function (err) { | ||
| if (err === null) { | ||
@@ -176,3 +177,3 @@ return done('Command was expected to fail, but it succeeded.'); | ||
| it('should throw error even in transpileOnly mode', function (done) { | ||
| child_process_1.exec(`${BIN_EXEC} --transpile-only -pe "console."`, function (err) { | ||
| child_process_1.exec(`${cmd} --transpile-only -pe "console."`, function (err) { | ||
| if (err === null) { | ||
@@ -186,3 +187,3 @@ return done('Command was expected to fail, but it succeeded.'); | ||
| it('should pipe into `ts-node` and evaluate', function (done) { | ||
| const cp = child_process_1.exec(BIN_EXEC, function (err, stdout) { | ||
| const cp = child_process_1.exec(cmd, function (err, stdout) { | ||
| chai_1.expect(err).to.equal(null); | ||
@@ -195,3 +196,3 @@ chai_1.expect(stdout).to.equal('hello\n'); | ||
| it('should pipe into `ts-node`', function (done) { | ||
| const cp = child_process_1.exec(`${BIN_EXEC} -p`, function (err, stdout) { | ||
| const cp = child_process_1.exec(`${cmd} -p`, function (err, stdout) { | ||
| chai_1.expect(err).to.equal(null); | ||
@@ -204,3 +205,3 @@ chai_1.expect(stdout).to.equal('true\n'); | ||
| it('should pipe into an eval script', function (done) { | ||
| const cp = child_process_1.exec(`${BIN_EXEC} --transpile-only -pe 'process.stdin.isTTY'`, function (err, stdout) { | ||
| const cp = child_process_1.exec(`${cmd} --transpile-only -pe 'process.stdin.isTTY'`, function (err, stdout) { | ||
| chai_1.expect(err).to.equal(null); | ||
@@ -213,3 +214,3 @@ chai_1.expect(stdout).to.equal('undefined\n'); | ||
| it('should support require flags', function (done) { | ||
| child_process_1.exec(`${BIN_EXEC} -r ./tests/hello-world -pe "console.log('success')"`, function (err, stdout) { | ||
| child_process_1.exec(`${cmd} -r ./tests/hello-world -pe "console.log('success')"`, function (err, stdout) { | ||
| chai_1.expect(err).to.equal(null); | ||
@@ -221,3 +222,3 @@ chai_1.expect(stdout).to.equal('Hello, world!\nsuccess\nundefined\n'); | ||
| it('should support require from node modules', function (done) { | ||
| child_process_1.exec(`${BIN_EXEC} -r typescript -e "console.log('success')"`, function (err, stdout) { | ||
| child_process_1.exec(`${cmd} -r typescript -e "console.log('success')"`, function (err, stdout) { | ||
| chai_1.expect(err).to.equal(null); | ||
@@ -229,3 +230,3 @@ chai_1.expect(stdout).to.equal('success\n'); | ||
| it.skip('should use source maps with react tsx', function (done) { | ||
| child_process_1.exec(`${BIN_EXEC} -r ./tests/emit-compiled.ts tests/jsx-react.tsx`, function (err, stdout) { | ||
| child_process_1.exec(`${cmd} -r ./tests/emit-compiled.ts tests/jsx-react.tsx`, function (err, stdout) { | ||
| chai_1.expect(err).to.equal(null); | ||
@@ -237,3 +238,3 @@ chai_1.expect(stdout).to.equal('todo'); | ||
| it('should allow custom typings', function (done) { | ||
| child_process_1.exec(`${BIN_EXEC} tests/custom-types`, function (err, stdout) { | ||
| child_process_1.exec(`${cmd} tests/custom-types`, function (err, stdout) { | ||
| chai_1.expect(err).to.match(/Error: Cannot find module 'does-not-exist'/); | ||
@@ -244,3 +245,3 @@ return done(); | ||
| it('should preserve `ts-node` context with child process', function (done) { | ||
| child_process_1.exec(`${BIN_EXEC} tests/child-process`, function (err, stdout) { | ||
| child_process_1.exec(`${cmd} tests/child-process`, function (err, stdout) { | ||
| chai_1.expect(err).to.equal(null); | ||
@@ -252,3 +253,3 @@ chai_1.expect(stdout).to.equal('Hello, world!\n'); | ||
| it('should import js before ts by default', function (done) { | ||
| child_process_1.exec(`${BIN_EXEC} tests/import-order/compiled`, function (err, stdout) { | ||
| child_process_1.exec(`${cmd} tests/import-order/compiled`, function (err, stdout) { | ||
| chai_1.expect(err).to.equal(null); | ||
@@ -260,3 +261,3 @@ chai_1.expect(stdout).to.equal('Hello, JavaScript!\n'); | ||
| it('should import ts before js when --prefer-ts-exts flag is present', function (done) { | ||
| child_process_1.exec(`${BIN_EXEC} --prefer-ts-exts tests/import-order/compiled`, function (err, stdout) { | ||
| child_process_1.exec(`${cmd} --prefer-ts-exts tests/import-order/compiled`, function (err, stdout) { | ||
| chai_1.expect(err).to.equal(null); | ||
@@ -268,3 +269,3 @@ chai_1.expect(stdout).to.equal('Hello, TypeScript!\n'); | ||
| it('should import ts before js when TS_NODE_PREFER_TS_EXTS env is present', function (done) { | ||
| child_process_1.exec(`${BIN_EXEC} tests/import-order/compiled`, { env: Object.assign(Object.assign({}, process.env), { TS_NODE_PREFER_TS_EXTS: 'true' }) }, function (err, stdout) { | ||
| child_process_1.exec(`${cmd} tests/import-order/compiled`, { env: Object.assign(Object.assign({}, process.env), { TS_NODE_PREFER_TS_EXTS: 'true' }) }, function (err, stdout) { | ||
| chai_1.expect(err).to.equal(null); | ||
@@ -276,3 +277,3 @@ chai_1.expect(stdout).to.equal('Hello, TypeScript!\n'); | ||
| it('should ignore .d.ts files', function (done) { | ||
| child_process_1.exec(`${BIN_EXEC} tests/import-order/importer`, function (err, stdout) { | ||
| child_process_1.exec(`${cmd} tests/import-order/importer`, function (err, stdout) { | ||
| chai_1.expect(err).to.equal(null); | ||
@@ -283,5 +284,12 @@ chai_1.expect(stdout).to.equal('Hello, World!\n'); | ||
| }); | ||
| it('issue #884', function (done) { | ||
| child_process_1.exec(`node "${BIN_PATH}" --project tests/issue-884/tsconfig.json tests/issue-884`, function (err, stdout) { | ||
| chai_1.expect(err).to.equal(null); | ||
| chai_1.expect(stdout).to.equal(''); | ||
| return done(); | ||
| }); | ||
| }); | ||
| if (semver.gte(ts.version, '2.7.0')) { | ||
| it('should support script mode', function (done) { | ||
| child_process_1.exec(`${SCRIPT_EXEC} tests/scope/a/log`, function (err, stdout) { | ||
| child_process_1.exec(`node ${BIN_SCRIPT_PATH} tests/scope/a/log`, function (err, stdout) { | ||
| chai_1.expect(err).to.equal(null); | ||
@@ -346,3 +354,3 @@ chai_1.expect(stdout).to.equal('.ts\n'); | ||
| it('should execute cli', function (done) { | ||
| child_process_1.exec(`${BIN_EXEC} --compiler-host tests/hello-world`, function (err, stdout) { | ||
| child_process_1.exec(`${cmd} --compiler-host tests/hello-world`, function (err, stdout) { | ||
| chai_1.expect(err).to.equal(null); | ||
@@ -354,3 +362,3 @@ chai_1.expect(stdout).to.equal('Hello, world!\n'); | ||
| it('should give ts error for invalid node_modules', function (done) { | ||
| child_process_1.exec(`${BIN_EXEC} --compiler-host --skip-ignore tests/from-node-modules`, function (err, stdout) { | ||
| child_process_1.exec(`${cmd} --compiler-host --skip-ignore tests/from-node-modules`, function (err, stdout) { | ||
| if (err === null) | ||
@@ -357,0 +365,0 @@ return done('Expected an error'); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":";;AAAA,+BAA6B;AAC7B,iDAAoC;AACpC,+BAA2B;AAC3B,iCAAiC;AACjC,iCAAiC;AACjC,yCAAyC;AACzC,mCAAmD;AAEnD,MAAM,QAAQ,GAAG,WAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;AAC5C,MAAM,OAAO,GAAG,WAAI,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAA;AAC/C,MAAM,QAAQ,GAAG,SAAS,WAAI,CAAC,SAAS,EAAE,aAAa,CAAC,gBAAgB,OAAO,GAAG,CAAA;AAClF,MAAM,WAAW,GAAG,SAAS,WAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,GAAG,CAAA;AAErE,MAAM,iBAAiB,GAAG,gFAAgF,CAAA;AAE1G,QAAQ,CAAC,SAAS,EAAE;IAClB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAEnB,EAAE,CAAC,mCAAmC,EAAE;QACtC,aAAM,CAAC,eAAO,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC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CAAA;YAEF,EAAE,CAAC,wBAAwB,EAAE,UAAU,IAAI;gBACzC,IAAI;oBACF,OAAO,CAAC,uBAAuB,CAAC,CAAA;iBACjC;gBAAC,OAAO,KAAK,EAAE;oBACd,aAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAA;iBAChE;gBAED,aAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAA;gBAE5C,IAAI,EAAE,CAAA;YACR,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;QACtB,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;YAClD,MAAM,OAAO,GAAG,cAAM,CAAC,EAAE,eAAe,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAA;YACjF,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,cAAc,EAAE,SAAS,CAAC,CAAA;YAEzD,aAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;QAC1C,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { expect } from 'chai'\nimport { exec } from 'child_process'\nimport { join } from 'path'\nimport semver = require('semver')\nimport ts = require('typescript')\nimport proxyquire = require('proxyquire')\nimport { register, create, VERSION } from './index'\n\nconst TEST_DIR = join(__dirname, '../tests')\nconst PROJECT = join(TEST_DIR, 'tsconfig.json')\nconst BIN_EXEC = `node \"${join(__dirname, '../dist/bin')}\" --project \"${PROJECT}\"`\nconst SCRIPT_EXEC = `node \"${join(__dirname, '../dist/bin-script')}\"`\n\nconst SOURCE_MAP_REGEXP = /\\/\\/# sourceMappingURL=data:application\\/json;charset=utf\\-8;base64,[\\w\\+]+=*$/\n\ndescribe('ts-node', function () {\n this.timeout(10000)\n\n it('should export the correct version', function () {\n expect(VERSION).to.equal(require('../package.json').version)\n })\n\n describe('cli', function () {\n this.slow(1000)\n\n it('should execute cli', function (done) {\n exec(`${BIN_EXEC} tests/hello-world`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('Hello, world!\\n')\n\n return done()\n })\n })\n\n it('should register via cli', function (done) {\n exec(`node -r ../register hello-world.ts`, {\n cwd: TEST_DIR\n }, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('Hello, world!\\n')\n\n return done()\n })\n })\n\n it('should execute cli with absolute path', function (done) {\n exec(`${BIN_EXEC} \"${join(TEST_DIR, 'hello-world')}\"`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('Hello, world!\\n')\n\n return done()\n })\n })\n\n it('should print scripts', function (done) {\n exec(`${BIN_EXEC} -pe \"import { example } from './tests/complex/index';example()\"`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('example\\n')\n\n return done()\n })\n })\n\n it('should provide registered information globally', function (done) {\n exec(`${BIN_EXEC} tests/env`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('object\\n')\n\n return done()\n })\n })\n\n it('should provide registered information on register', function (done) {\n exec(`node -r ../register env.ts`, {\n cwd: TEST_DIR\n }, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('object\\n')\n\n return done()\n })\n })\n\n if (semver.gte(ts.version, '1.8.0')) {\n it('should allow js', function (done) {\n exec(\n [\n BIN_EXEC,\n '-O \"{\\\\\\\"allowJs\\\\\\\":true}\"',\n '-pe \"import { main } from \\'./tests/allow-js/run\\';main()\"'\n ].join(' '),\n function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('hello world\\n')\n\n return done()\n }\n )\n })\n\n it('should include jsx when `allow-js` true', function (done) {\n exec(\n [\n BIN_EXEC,\n '-O \"{\\\\\\\"allowJs\\\\\\\":true}\"',\n '-pe \"import { Foo2 } from \\'./tests/allow-js/with-jsx\\'; Foo2.sayHi()\"'\n ].join(' '),\n function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('hello world\\n')\n\n return done()\n }\n )\n })\n }\n\n it('should eval code', function (done) {\n exec(\n `${BIN_EXEC} -e \"import * as m from './tests/module';console.log(m.example('test'))\"`,\n function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('TEST\\n')\n\n return done()\n }\n )\n })\n\n it('should import empty files', function (done) {\n exec(`${BIN_EXEC} -e \"import './tests/empty'\"`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('')\n\n return done()\n })\n })\n\n it('should throw errors', function (done) {\n exec(`${BIN_EXEC} -e \"import * as m from './tests/module';console.log(m.example(123))\"`, function (err) {\n if (err === null) {\n return done('Command was expected to fail, but it succeeded.')\n }\n\n expect(err.message).to.match(new RegExp(\n 'TS2345: Argument of type \\'(?:number|123)\\' ' +\n 'is not assignable to parameter of type \\'string\\'\\\\.'\n ))\n\n return done()\n })\n })\n\n it('should be able to ignore diagnostic', function (done) {\n exec(\n `${BIN_EXEC} --ignore-diagnostics 2345 -e \"import * as m from './tests/module';console.log(m.example(123))\"`,\n function (err) {\n if (err === null) {\n return done('Command was expected to fail, but it succeeded.')\n }\n\n expect(err.message).to.match(\n /TypeError: (?:(?:undefined|foo\\.toUpperCase) is not a function|.*has no method \\'toUpperCase\\')/\n )\n\n return done()\n }\n )\n })\n\n it('should work with source maps', function (done) {\n exec(`${BIN_EXEC} tests/throw`, function (err) {\n if (err === null) {\n return done('Command was expected to fail, but it succeeded.')\n }\n\n expect(err.message).to.contain([\n `${join(__dirname, '../tests/throw.ts')}:3`,\n ' bar () { throw new Error(\\'this is a demo\\') }',\n ' ^',\n 'Error: this is a demo'\n ].join('\\n'))\n\n return done()\n })\n })\n\n it('eval should work with source maps', function (done) {\n exec(`${BIN_EXEC} -pe \"import './tests/throw'\"`, function (err) {\n if (err === null) {\n return done('Command was expected to fail, but it succeeded.')\n }\n\n expect(err.message).to.contain([\n `${join(__dirname, '../tests/throw.ts')}:3`,\n ' bar () { throw new Error(\\'this is a demo\\') }',\n ' ^'\n ].join('\\n'))\n\n return done()\n })\n })\n\n it('should support transpile only mode', function (done) {\n exec(`${BIN_EXEC} --transpile-only -pe \"x\"`, function (err) {\n if (err === null) {\n return done('Command was expected to fail, but it succeeded.')\n }\n\n expect(err.message).to.contain('ReferenceError: x is not defined')\n\n return done()\n })\n })\n\n it('should throw error even in transpileOnly mode', function (done) {\n exec(`${BIN_EXEC} --transpile-only -pe \"console.\"`, function (err) {\n if (err === null) {\n return done('Command was expected to fail, but it succeeded.')\n }\n\n expect(err.message).to.contain('error TS1003: Identifier expected')\n\n return done()\n })\n })\n\n it('should pipe into `ts-node` and evaluate', function (done) {\n const cp = exec(BIN_EXEC, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('hello\\n')\n\n return done()\n })\n\n cp.stdin!.end(\"console.log('hello')\")\n })\n\n it('should pipe into `ts-node`', function (done) {\n const cp = exec(`${BIN_EXEC} -p`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('true\\n')\n\n return done()\n })\n\n cp.stdin!.end('true')\n })\n\n it('should pipe into an eval script', function (done) {\n const cp = exec(`${BIN_EXEC} --transpile-only -pe 'process.stdin.isTTY'`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('undefined\\n')\n\n return done()\n })\n\n cp.stdin!.end('true')\n })\n\n it('should support require flags', function (done) {\n exec(`${BIN_EXEC} -r ./tests/hello-world -pe \"console.log('success')\"`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('Hello, world!\\nsuccess\\nundefined\\n')\n\n return done()\n })\n })\n\n it('should support require from node modules', function (done) {\n exec(`${BIN_EXEC} -r typescript -e \"console.log('success')\"`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('success\\n')\n\n return done()\n })\n })\n\n it.skip('should use source maps with react tsx', function (done) {\n exec(`${BIN_EXEC} -r ./tests/emit-compiled.ts tests/jsx-react.tsx`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('todo')\n\n return done()\n })\n })\n\n it('should allow custom typings', function (done) {\n exec(`${BIN_EXEC} tests/custom-types`, function (err, stdout) {\n expect(err).to.match(/Error: Cannot find module 'does-not-exist'/)\n\n return done()\n })\n })\n\n it('should preserve `ts-node` context with child process', function (done) {\n exec(`${BIN_EXEC} tests/child-process`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('Hello, world!\\n')\n\n return done()\n })\n })\n\n it('should import js before ts by default', function (done) {\n exec(`${BIN_EXEC} tests/import-order/compiled`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('Hello, JavaScript!\\n')\n\n return done()\n })\n })\n\n it('should import ts before js when --prefer-ts-exts flag is present', function (done) {\n exec(`${BIN_EXEC} --prefer-ts-exts tests/import-order/compiled`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('Hello, TypeScript!\\n')\n\n return done()\n })\n })\n\n it('should import ts before js when TS_NODE_PREFER_TS_EXTS env is present', function (done) {\n exec(`${BIN_EXEC} tests/import-order/compiled`, { env: { ...process.env, TS_NODE_PREFER_TS_EXTS: 'true' } }, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('Hello, TypeScript!\\n')\n\n return done()\n })\n })\n\n it('should ignore .d.ts files', function (done) {\n exec(`${BIN_EXEC} tests/import-order/importer`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('Hello, World!\\n')\n\n return done()\n })\n })\n\n if (semver.gte(ts.version, '2.7.0')) {\n it('should support script mode', function (done) {\n exec(`${SCRIPT_EXEC} tests/scope/a/log`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('.ts\\n')\n\n return done()\n })\n })\n }\n\n describe('should read ts-node options from tsconfig.json', function () {\n const BIN_EXEC = `node \"${join(__dirname, '../dist/bin')}\" --project tests/tsconfig-options/tsconfig.json`\n\n it('should override compiler options from env', function (done) {\n exec(`${BIN_EXEC} tests/tsconfig-options/log-options.js`, {\n env: {\n ...process.env,\n TS_NODE_COMPILER_OPTIONS: '{\"typeRoots\": [\"env-typeroots\"]}'\n }\n }, function (err, stdout) {\n expect(err).to.equal(null)\n const { config } = JSON.parse(stdout)\n expect(config.options.typeRoots).to.deep.equal([join(__dirname, '../tests/tsconfig-options/env-typeroots')])\n return done()\n })\n })\n\n it('should use options from `tsconfig.json`', function (done) {\n exec(`${BIN_EXEC} tests/tsconfig-options/log-options.js`, function (err, stdout) {\n expect(err).to.equal(null)\n const { options, config } = JSON.parse(stdout)\n expect(config.options.typeRoots).to.deep.equal([join(__dirname, '../tests/tsconfig-options/tsconfig-typeroots')])\n expect(config.options.types).to.deep.equal(['tsconfig-tsnode-types'])\n expect(options.pretty).to.equal(undefined)\n expect(options.skipIgnore).to.equal(false)\n expect(options.transpileOnly).to.equal(true)\n return done()\n })\n })\n\n it('should have flags override `tsconfig.json`', function (done) {\n exec(`${BIN_EXEC} --skip-ignore --compiler-options '{\"types\": [\"flags-types\"]}' tests/tsconfig-options/log-options.js`, function (err, stdout) {\n expect(err).to.equal(null)\n const { options, config } = JSON.parse(stdout)\n expect(config.options.typeRoots).to.deep.equal([join(__dirname, '../tests/tsconfig-options/tsconfig-typeroots')])\n expect(config.options.types).to.deep.equal(['flags-types'])\n expect(options.pretty).to.equal(undefined)\n expect(options.skipIgnore).to.equal(true)\n expect(options.transpileOnly).to.equal(true)\n return done()\n })\n })\n\n it('should have `tsconfig.json` override environment', function (done) {\n exec(`${BIN_EXEC} tests/tsconfig-options/log-options.js`, {\n env: {\n ...process.env,\n TS_NODE_PRETTY: 'true',\n TS_NODE_SKIP_IGNORE: 'true'\n }\n }, function (err, stdout) {\n expect(err).to.equal(null)\n const { options, config } = JSON.parse(stdout)\n expect(config.options.typeRoots).to.deep.equal([join(__dirname, '../tests/tsconfig-options/tsconfig-typeroots')])\n expect(config.options.types).to.deep.equal(['tsconfig-tsnode-types'])\n expect(options.pretty).to.equal(true)\n expect(options.skipIgnore).to.equal(false)\n expect(options.transpileOnly).to.equal(true)\n return done()\n })\n })\n })\n\n describe('compiler host', function () {\n it('should execute cli', function (done) {\n exec(`${BIN_EXEC} --compiler-host tests/hello-world`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('Hello, world!\\n')\n\n return done()\n })\n })\n\n it('should give ts error for invalid node_modules', function (done) {\n exec(`${BIN_EXEC} --compiler-host --skip-ignore tests/from-node-modules`, function (err, stdout) {\n if (err === null) return done('Expected an error')\n\n expect(err.message).to.contain('Unable to compile file from external library')\n\n return done()\n })\n })\n })\n })\n\n describe('register', function () {\n const registered = register({\n project: PROJECT,\n compilerOptions: {\n jsx: 'preserve'\n }\n })\n\n const moduleTestPath = require.resolve('../tests/module')\n\n afterEach(() => {\n // Re-enable project after every test.\n registered.enabled(true)\n })\n\n it('should be able to require typescript', function () {\n const m = require(moduleTestPath)\n\n expect(m.example('foo')).to.equal('FOO')\n })\n\n it('should support dynamically disabling', function () {\n delete require.cache[moduleTestPath]\n\n expect(registered.enabled(false)).to.equal(false)\n expect(() => require(moduleTestPath)).to.throw(/Unexpected token/)\n\n delete require.cache[moduleTestPath]\n\n expect(registered.enabled()).to.equal(false)\n expect(() => require(moduleTestPath)).to.throw(/Unexpected token/)\n\n delete require.cache[moduleTestPath]\n\n expect(registered.enabled(true)).to.equal(true)\n expect(() => require(moduleTestPath)).to.not.throw()\n\n delete require.cache[moduleTestPath]\n\n expect(registered.enabled()).to.equal(true)\n expect(() => require(moduleTestPath)).to.not.throw()\n })\n\n if (semver.gte(ts.version, '2.7.0')) {\n it('should support compiler scopes', function () {\n const calls: string[] = []\n\n registered.enabled(false)\n\n const compilers = [\n register({ dir: join(TEST_DIR, 'scope/a'), scope: true }),\n register({ dir: join(TEST_DIR, 'scope/b'), scope: true })\n ]\n\n compilers.forEach(c => {\n const old = c.compile\n c.compile = (code, fileName, lineOffset) => {\n calls.push(fileName)\n\n return old(code, fileName, lineOffset)\n }\n })\n\n try {\n expect(require('../tests/scope/a').ext).to.equal('.ts')\n expect(require('../tests/scope/b').ext).to.equal('.ts')\n } finally {\n compilers.forEach(c => c.enabled(false))\n }\n\n expect(calls).to.deep.equal([\n join(TEST_DIR, 'scope/a/index.ts'),\n join(TEST_DIR, 'scope/b/index.ts')\n ])\n\n delete require.cache[moduleTestPath]\n\n expect(() => require(moduleTestPath)).to.throw()\n })\n }\n\n it('should compile through js and ts', function () {\n const m = require('../tests/complex')\n\n expect(m.example()).to.equal('example')\n })\n\n it('should work with proxyquire', function () {\n const m = proxyquire('../tests/complex', {\n './example': 'hello'\n })\n\n expect(m.example()).to.equal('hello')\n })\n\n it('should work with `require.cache`', function () {\n const { example1, example2 } = require('../tests/require-cache')\n\n expect(example1).to.not.equal(example2)\n })\n\n it('should use source maps', function (done) {\n try {\n require('../tests/throw')\n } catch (error) {\n expect(error.stack).to.contain([\n 'Error: this is a demo',\n ` at Foo.bar (${join(__dirname, '../tests/throw.ts')}:3:18)`\n ].join('\\n'))\n\n done()\n }\n })\n\n describe('JSX preserve', () => {\n let old = require.extensions['.tsx'] // tslint:disable-line\n let compiled: string\n\n before(function () {\n require.extensions['.tsx'] = (m: any, fileName) => { // tslint:disable-line\n const _compile = m._compile\n\n m._compile = (code: string, fileName: string) => {\n compiled = code\n return _compile.call(this, code, fileName)\n }\n\n return old(m, fileName)\n }\n })\n\n after(function () {\n require.extensions['.tsx'] = old // tslint:disable-line\n })\n\n it('should use source maps', function (done) {\n try {\n require('../tests/with-jsx.tsx')\n } catch (error) {\n expect(error.stack).to.contain('SyntaxError: Unexpected token')\n }\n\n expect(compiled).to.match(SOURCE_MAP_REGEXP)\n\n done()\n })\n })\n })\n\n describe('create', () => {\n it('should create generic compiler instances', () => {\n const service = create({ compilerOptions: { target: 'es5' }, skipProject: true })\n const output = service.compile('const x = 10', 'test.ts')\n\n expect(output).to.contain('var x = 10;')\n })\n })\n})\n"]} | ||
| {"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":";;AAAA,+BAA6B;AAC7B,iDAAoC;AACpC,+BAA2B;AAC3B,iCAAiC;AACjC,iCAAiC;AACjC,yCAAyC;AACzC,mCAAmD;AAEnD,MAAM,QAAQ,GAAG,WAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;AAC5C,MAAM,OAAO,GAAG,WAAI,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAA;AAC/C,MAAM,QAAQ,GAAG,WAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA;AAC/C,MAAM,eAAe,GAAG,WAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAA;AAE7D,MAAM,iBAAiB,GAAG,gFAAgF,CAAA;AAE1G,QAAQ,CAAC,SAAS,EAAE;IAClB,MAAM,GAAG,GAAG,SAAS,QAAQ,gBAAgB,OAAO,GAAG,CAAA;IAEvD,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAEnB,EAAE,CAAC,mCAAmC,EAAE;QACtC,aAAM,CAAC,eAAO,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAA;IAC9D,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC,KAAK,EAAE;QACd,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAEf,EAAE,CAAC,oBAAoB,EAAE,UAAU,IAAI;YACrC,oBAAI,CAAC,GAAG,GAAG,oBAAoB,EAAE,UAAU,GAAG,EAAE,MAAM;gBACpD,aAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;gBAC1B,aAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,C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AAC,uBAAuB,CAAC,CAAA;iBACjC;gBAAC,OAAO,KAAK,EAAE;oBACd,aAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAA;iBAChE;gBAED,aAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAA;gBAE5C,IAAI,EAAE,CAAA;YACR,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;QACtB,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;YAClD,MAAM,OAAO,GAAG,cAAM,CAAC,EAAE,eAAe,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAA;YACjF,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,cAAc,EAAE,SAAS,CAAC,CAAA;YAEzD,aAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;QAC1C,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { expect } from 'chai'\nimport { exec } from 'child_process'\nimport { join } from 'path'\nimport semver = require('semver')\nimport ts = require('typescript')\nimport proxyquire = require('proxyquire')\nimport { register, create, VERSION } from './index'\n\nconst TEST_DIR = join(__dirname, '../tests')\nconst PROJECT = join(TEST_DIR, 'tsconfig.json')\nconst BIN_PATH = join(__dirname, '../dist/bin')\nconst BIN_SCRIPT_PATH = join(__dirname, '../dist/bin-script')\n\nconst SOURCE_MAP_REGEXP = /\\/\\/# sourceMappingURL=data:application\\/json;charset=utf\\-8;base64,[\\w\\+]+=*$/\n\ndescribe('ts-node', function () {\n const cmd = `node \"${BIN_PATH}\" --project \"${PROJECT}\"`\n\n this.timeout(10000)\n\n it('should export the correct version', function () {\n expect(VERSION).to.equal(require('../package.json').version)\n })\n\n describe('cli', function () {\n this.slow(1000)\n\n it('should execute cli', function (done) {\n exec(`${cmd} tests/hello-world`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('Hello, world!\\n')\n\n return done()\n })\n })\n\n it('should register via cli', function (done) {\n exec(`node -r ../register hello-world.ts`, {\n cwd: TEST_DIR\n }, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('Hello, world!\\n')\n\n return done()\n })\n })\n\n it('should execute cli with absolute path', function (done) {\n exec(`${cmd} \"${join(TEST_DIR, 'hello-world')}\"`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('Hello, world!\\n')\n\n return done()\n })\n })\n\n it('should print scripts', function (done) {\n exec(`${cmd} -pe \"import { example } from './tests/complex/index';example()\"`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('example\\n')\n\n return done()\n })\n })\n\n it('should provide registered information globally', function (done) {\n exec(`${cmd} tests/env`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('object\\n')\n\n return done()\n })\n })\n\n it('should provide registered information on register', function (done) {\n exec(`node -r ../register env.ts`, {\n cwd: TEST_DIR\n }, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('object\\n')\n\n return done()\n })\n })\n\n if (semver.gte(ts.version, '1.8.0')) {\n it('should allow js', function (done) {\n exec(\n [\n cmd,\n '-O \"{\\\\\\\"allowJs\\\\\\\":true}\"',\n '-pe \"import { main } from \\'./tests/allow-js/run\\';main()\"'\n ].join(' '),\n function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('hello world\\n')\n\n return done()\n }\n )\n })\n\n it('should include jsx when `allow-js` true', function (done) {\n exec(\n [\n cmd,\n '-O \"{\\\\\\\"allowJs\\\\\\\":true}\"',\n '-pe \"import { Foo2 } from \\'./tests/allow-js/with-jsx\\'; Foo2.sayHi()\"'\n ].join(' '),\n function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('hello world\\n')\n\n return done()\n }\n )\n })\n }\n\n it('should eval code', function (done) {\n exec(\n `${cmd} -e \"import * as m from './tests/module';console.log(m.example('test'))\"`,\n function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('TEST\\n')\n\n return done()\n }\n )\n })\n\n it('should import empty files', function (done) {\n exec(`${cmd} -e \"import './tests/empty'\"`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('')\n\n return done()\n })\n })\n\n it('should throw errors', function (done) {\n exec(`${cmd} -e \"import * as m from './tests/module';console.log(m.example(123))\"`, function (err) {\n if (err === null) {\n return done('Command was expected to fail, but it succeeded.')\n }\n\n expect(err.message).to.match(new RegExp(\n 'TS2345: Argument of type \\'(?:number|123)\\' ' +\n 'is not assignable to parameter of type \\'string\\'\\\\.'\n ))\n\n return done()\n })\n })\n\n it('should be able to ignore diagnostic', function (done) {\n exec(\n `${cmd} --ignore-diagnostics 2345 -e \"import * as m from './tests/module';console.log(m.example(123))\"`,\n function (err) {\n if (err === null) {\n return done('Command was expected to fail, but it succeeded.')\n }\n\n expect(err.message).to.match(\n /TypeError: (?:(?:undefined|foo\\.toUpperCase) is not a function|.*has no method \\'toUpperCase\\')/\n )\n\n return done()\n }\n )\n })\n\n it('should work with source maps', function (done) {\n exec(`${cmd} tests/throw`, function (err) {\n if (err === null) {\n return done('Command was expected to fail, but it succeeded.')\n }\n\n expect(err.message).to.contain([\n `${join(__dirname, '../tests/throw.ts')}:3`,\n ' bar () { throw new Error(\\'this is a demo\\') }',\n ' ^',\n 'Error: this is a demo'\n ].join('\\n'))\n\n return done()\n })\n })\n\n it('eval should work with source maps', function (done) {\n exec(`${cmd} -pe \"import './tests/throw'\"`, function (err) {\n if (err === null) {\n return done('Command was expected to fail, but it succeeded.')\n }\n\n expect(err.message).to.contain([\n `${join(__dirname, '../tests/throw.ts')}:3`,\n ' bar () { throw new Error(\\'this is a demo\\') }',\n ' ^'\n ].join('\\n'))\n\n return done()\n })\n })\n\n it('should support transpile only mode', function (done) {\n exec(`${cmd} --transpile-only -pe \"x\"`, function (err) {\n if (err === null) {\n return done('Command was expected to fail, but it succeeded.')\n }\n\n expect(err.message).to.contain('ReferenceError: x is not defined')\n\n return done()\n })\n })\n\n it('should throw error even in transpileOnly mode', function (done) {\n exec(`${cmd} --transpile-only -pe \"console.\"`, function (err) {\n if (err === null) {\n return done('Command was expected to fail, but it succeeded.')\n }\n\n expect(err.message).to.contain('error TS1003: Identifier expected')\n\n return done()\n })\n })\n\n it('should pipe into `ts-node` and evaluate', function (done) {\n const cp = exec(cmd, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('hello\\n')\n\n return done()\n })\n\n cp.stdin!.end(\"console.log('hello')\")\n })\n\n it('should pipe into `ts-node`', function (done) {\n const cp = exec(`${cmd} -p`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('true\\n')\n\n return done()\n })\n\n cp.stdin!.end('true')\n })\n\n it('should pipe into an eval script', function (done) {\n const cp = exec(`${cmd} --transpile-only -pe 'process.stdin.isTTY'`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('undefined\\n')\n\n return done()\n })\n\n cp.stdin!.end('true')\n })\n\n it('should support require flags', function (done) {\n exec(`${cmd} -r ./tests/hello-world -pe \"console.log('success')\"`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('Hello, world!\\nsuccess\\nundefined\\n')\n\n return done()\n })\n })\n\n it('should support require from node modules', function (done) {\n exec(`${cmd} -r typescript -e \"console.log('success')\"`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('success\\n')\n\n return done()\n })\n })\n\n it.skip('should use source maps with react tsx', function (done) {\n exec(`${cmd} -r ./tests/emit-compiled.ts tests/jsx-react.tsx`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('todo')\n\n return done()\n })\n })\n\n it('should allow custom typings', function (done) {\n exec(`${cmd} tests/custom-types`, function (err, stdout) {\n expect(err).to.match(/Error: Cannot find module 'does-not-exist'/)\n\n return done()\n })\n })\n\n it('should preserve `ts-node` context with child process', function (done) {\n exec(`${cmd} tests/child-process`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('Hello, world!\\n')\n\n return done()\n })\n })\n\n it('should import js before ts by default', function (done) {\n exec(`${cmd} tests/import-order/compiled`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('Hello, JavaScript!\\n')\n\n return done()\n })\n })\n\n it('should import ts before js when --prefer-ts-exts flag is present', function (done) {\n exec(`${cmd} --prefer-ts-exts tests/import-order/compiled`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('Hello, TypeScript!\\n')\n\n return done()\n })\n })\n\n it('should import ts before js when TS_NODE_PREFER_TS_EXTS env is present', function (done) {\n exec(`${cmd} tests/import-order/compiled`, { env: { ...process.env, TS_NODE_PREFER_TS_EXTS: 'true' } }, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('Hello, TypeScript!\\n')\n\n return done()\n })\n })\n\n it('should ignore .d.ts files', function (done) {\n exec(`${cmd} tests/import-order/importer`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('Hello, World!\\n')\n\n return done()\n })\n })\n\n it('issue #884', function (done) {\n exec(`node \"${BIN_PATH}\" --project tests/issue-884/tsconfig.json tests/issue-884`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('')\n\n return done()\n })\n })\n\n if (semver.gte(ts.version, '2.7.0')) {\n it('should support script mode', function (done) {\n exec(`node ${BIN_SCRIPT_PATH} tests/scope/a/log`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('.ts\\n')\n\n return done()\n })\n })\n }\n\n describe('should read ts-node options from tsconfig.json', function () {\n const BIN_EXEC = `node \"${join(__dirname, '../dist/bin')}\" --project tests/tsconfig-options/tsconfig.json`\n\n it('should override compiler options from env', function (done) {\n exec(`${BIN_EXEC} tests/tsconfig-options/log-options.js`, {\n env: {\n ...process.env,\n TS_NODE_COMPILER_OPTIONS: '{\"typeRoots\": [\"env-typeroots\"]}'\n }\n }, function (err, stdout) {\n expect(err).to.equal(null)\n const { config } = JSON.parse(stdout)\n expect(config.options.typeRoots).to.deep.equal([join(__dirname, '../tests/tsconfig-options/env-typeroots')])\n return done()\n })\n })\n\n it('should use options from `tsconfig.json`', function (done) {\n exec(`${BIN_EXEC} tests/tsconfig-options/log-options.js`, function (err, stdout) {\n expect(err).to.equal(null)\n const { options, config } = JSON.parse(stdout)\n expect(config.options.typeRoots).to.deep.equal([join(__dirname, '../tests/tsconfig-options/tsconfig-typeroots')])\n expect(config.options.types).to.deep.equal(['tsconfig-tsnode-types'])\n expect(options.pretty).to.equal(undefined)\n expect(options.skipIgnore).to.equal(false)\n expect(options.transpileOnly).to.equal(true)\n return done()\n })\n })\n\n it('should have flags override `tsconfig.json`', function (done) {\n exec(`${BIN_EXEC} --skip-ignore --compiler-options '{\"types\": [\"flags-types\"]}' tests/tsconfig-options/log-options.js`, function (err, stdout) {\n expect(err).to.equal(null)\n const { options, config } = JSON.parse(stdout)\n expect(config.options.typeRoots).to.deep.equal([join(__dirname, '../tests/tsconfig-options/tsconfig-typeroots')])\n expect(config.options.types).to.deep.equal(['flags-types'])\n expect(options.pretty).to.equal(undefined)\n expect(options.skipIgnore).to.equal(true)\n expect(options.transpileOnly).to.equal(true)\n return done()\n })\n })\n\n it('should have `tsconfig.json` override environment', function (done) {\n exec(`${BIN_EXEC} tests/tsconfig-options/log-options.js`, {\n env: {\n ...process.env,\n TS_NODE_PRETTY: 'true',\n TS_NODE_SKIP_IGNORE: 'true'\n }\n }, function (err, stdout) {\n expect(err).to.equal(null)\n const { options, config } = JSON.parse(stdout)\n expect(config.options.typeRoots).to.deep.equal([join(__dirname, '../tests/tsconfig-options/tsconfig-typeroots')])\n expect(config.options.types).to.deep.equal(['tsconfig-tsnode-types'])\n expect(options.pretty).to.equal(true)\n expect(options.skipIgnore).to.equal(false)\n expect(options.transpileOnly).to.equal(true)\n return done()\n })\n })\n })\n\n describe('compiler host', function () {\n it('should execute cli', function (done) {\n exec(`${cmd} --compiler-host tests/hello-world`, function (err, stdout) {\n expect(err).to.equal(null)\n expect(stdout).to.equal('Hello, world!\\n')\n\n return done()\n })\n })\n\n it('should give ts error for invalid node_modules', function (done) {\n exec(`${cmd} --compiler-host --skip-ignore tests/from-node-modules`, function (err, stdout) {\n if (err === null) return done('Expected an error')\n\n expect(err.message).to.contain('Unable to compile file from external library')\n\n return done()\n })\n })\n })\n })\n\n describe('register', function () {\n const registered = register({\n project: PROJECT,\n compilerOptions: {\n jsx: 'preserve'\n }\n })\n\n const moduleTestPath = require.resolve('../tests/module')\n\n afterEach(() => {\n // Re-enable project after every test.\n registered.enabled(true)\n })\n\n it('should be able to require typescript', function () {\n const m = require(moduleTestPath)\n\n expect(m.example('foo')).to.equal('FOO')\n })\n\n it('should support dynamically disabling', function () {\n delete require.cache[moduleTestPath]\n\n expect(registered.enabled(false)).to.equal(false)\n expect(() => require(moduleTestPath)).to.throw(/Unexpected token/)\n\n delete require.cache[moduleTestPath]\n\n expect(registered.enabled()).to.equal(false)\n expect(() => require(moduleTestPath)).to.throw(/Unexpected token/)\n\n delete require.cache[moduleTestPath]\n\n expect(registered.enabled(true)).to.equal(true)\n expect(() => require(moduleTestPath)).to.not.throw()\n\n delete require.cache[moduleTestPath]\n\n expect(registered.enabled()).to.equal(true)\n expect(() => require(moduleTestPath)).to.not.throw()\n })\n\n if (semver.gte(ts.version, '2.7.0')) {\n it('should support compiler scopes', function () {\n const calls: string[] = []\n\n registered.enabled(false)\n\n const compilers = [\n register({ dir: join(TEST_DIR, 'scope/a'), scope: true }),\n register({ dir: join(TEST_DIR, 'scope/b'), scope: true })\n ]\n\n compilers.forEach(c => {\n const old = c.compile\n c.compile = (code, fileName, lineOffset) => {\n calls.push(fileName)\n\n return old(code, fileName, lineOffset)\n }\n })\n\n try {\n expect(require('../tests/scope/a').ext).to.equal('.ts')\n expect(require('../tests/scope/b').ext).to.equal('.ts')\n } finally {\n compilers.forEach(c => c.enabled(false))\n }\n\n expect(calls).to.deep.equal([\n join(TEST_DIR, 'scope/a/index.ts'),\n join(TEST_DIR, 'scope/b/index.ts')\n ])\n\n delete require.cache[moduleTestPath]\n\n expect(() => require(moduleTestPath)).to.throw()\n })\n }\n\n it('should compile through js and ts', function () {\n const m = require('../tests/complex')\n\n expect(m.example()).to.equal('example')\n })\n\n it('should work with proxyquire', function () {\n const m = proxyquire('../tests/complex', {\n './example': 'hello'\n })\n\n expect(m.example()).to.equal('hello')\n })\n\n it('should work with `require.cache`', function () {\n const { example1, example2 } = require('../tests/require-cache')\n\n expect(example1).to.not.equal(example2)\n })\n\n it('should use source maps', function (done) {\n try {\n require('../tests/throw')\n } catch (error) {\n expect(error.stack).to.contain([\n 'Error: this is a demo',\n ` at Foo.bar (${join(__dirname, '../tests/throw.ts')}:3:18)`\n ].join('\\n'))\n\n done()\n }\n })\n\n describe('JSX preserve', () => {\n let old = require.extensions['.tsx'] // tslint:disable-line\n let compiled: string\n\n before(function () {\n require.extensions['.tsx'] = (m: any, fileName) => { // tslint:disable-line\n const _compile = m._compile\n\n m._compile = (code: string, fileName: string) => {\n compiled = code\n return _compile.call(this, code, fileName)\n }\n\n return old(m, fileName)\n }\n })\n\n after(function () {\n require.extensions['.tsx'] = old // tslint:disable-line\n })\n\n it('should use source maps', function (done) {\n try {\n require('../tests/with-jsx.tsx')\n } catch (error) {\n expect(error.stack).to.contain('SyntaxError: Unexpected token')\n }\n\n expect(compiled).to.match(SOURCE_MAP_REGEXP)\n\n done()\n })\n })\n })\n\n describe('create', () => {\n it('should create generic compiler instances', () => {\n const service = create({ compilerOptions: { target: 'es5' }, skipProject: true })\n const output = service.compile('const x = 10', 'test.ts')\n\n expect(output).to.contain('var x = 10;')\n })\n })\n})\n"]} |
+8
-8
| { | ||
| "name": "ts-node", | ||
| "version": "8.7.0", | ||
| "version": "8.8.0", | ||
| "description": "TypeScript execution environment and REPL for node.js, with source map support", | ||
@@ -60,7 +60,7 @@ "main": "dist/index.js", | ||
| "@types/diff": "^4.0.2", | ||
| "@types/mocha": "^5.0.0", | ||
| "@types/node": "^12.7.12", | ||
| "@types/mocha": "^5.2.7", | ||
| "@types/node": "^13.9.2", | ||
| "@types/proxyquire": "^1.3.28", | ||
| "@types/react": "^16.0.2", | ||
| "@types/semver": "^6.0.0", | ||
| "@types/semver": "^7.1.0", | ||
| "@types/source-map-support": "^0.5.0", | ||
@@ -70,3 +70,3 @@ "axios": "^0.19.0", | ||
| "istanbul": "^0.4.0", | ||
| "mocha": "^6.1.4", | ||
| "mocha": "^6.2.2", | ||
| "ntypescript": "^1.201507091536.1", | ||
@@ -76,7 +76,7 @@ "proxyquire": "^2.0.0", | ||
| "rimraf": "^3.0.0", | ||
| "semver": "^6.1.0", | ||
| "tslint": "^5.11.0", | ||
| "semver": "^7.1.3", | ||
| "tslint": "^6.1.0", | ||
| "tslint-config-standard": "^9.0.0", | ||
| "typescript": "^3.7.2", | ||
| "typescript-json-schema": "0.40.0" | ||
| "typescript-json-schema": "^0.42.0" | ||
| }, | ||
@@ -83,0 +83,0 @@ "peerDependencies": { |
+1
-1
@@ -1,2 +0,2 @@ | ||
| #  | ||
| #  | ||
@@ -3,0 +3,0 @@ [![NPM version][npm-image]][npm-url] |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 3 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 20 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 3 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 20 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
1
-50%245824
-0.09%