mirror of https://github.com/MaxLeiter/Drift
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
30 KiB
Plaintext
1 line
30 KiB
Plaintext
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";;;;AAEA,+BAA4E;AAC5E,+BAA+B;AAC/B,iCAAkC;AAClC,2BAA4B;AAC5B,iCAA8D;AAC9D,iCAWgB;AAChB,mCAAmE;AAEnE,mEAAsE;AAEtE;;GAEG;AACH,SAAgB,IAAI,CAClB,OAAiB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EACtC,iBAAsC,EAAE;;IAExC,4EAA4E;IAC5E,sGAAsG;IACtG,6DAA6D;IAC7D,oDAAoD;IACpD,cAAc,GAAG,EAAE,GAAG,cAAc,EAAE,CAAC;IACvC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE;QAC7C,cAAc,CACZ,GAAG,CAAC,OAAO,CACT,kBAAkB,EAClB,CAAC,GAAG,EAAE,EAAE,EAAE,EAAU,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,EAAE,CACpD,CACF,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;KACzB;IAED,MAAM,IAAI,GAAG;QACX,GAAG,cAAc;QACjB,GAAG,GAAG,CACJ;YACE,wBAAwB;YACxB,QAAQ,EAAE,MAAM;YAChB,eAAe,EAAE,OAAO;YACxB,SAAS,EAAE,OAAO;YAClB,WAAW,EAAE,CAAC,MAAM,CAAC;YAErB,eAAe;YACf,QAAQ,EAAE,OAAO;YACjB,WAAW,EAAE,OAAO;YACpB,cAAc,EAAE,OAAO;YACvB,WAAW,EAAE,GAAG,CAAC,KAAK;YACtB,cAAc,EAAE,OAAO;YAEvB,mBAAmB;YACnB,OAAO,EAAE,MAAM;YACf,SAAS,EAAE,OAAO;YAClB,YAAY,EAAE,MAAM;Y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KACH;AACH,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE;IAC3B,IAAI,EAAE,CAAC;CACR","sourcesContent":["#!/usr/bin/env node\n\nimport { join, resolve, dirname, parse as parsePath, relative } from 'path';\nimport { inspect } from 'util';\nimport Module = require('module');\nimport arg = require('arg');\nimport { parse, createRequire, hasOwnProperty } from './util';\nimport {\n EVAL_FILENAME,\n EvalState,\n createRepl,\n ReplService,\n setupContext,\n STDIN_FILENAME,\n EvalAwarePartialHost,\n EVAL_NAME,\n STDIN_NAME,\n REPL_FILENAME,\n} from './repl';\nimport { VERSION, TSError, register, versionGteLt } from './index';\nimport type { TSInternal } from './ts-compiler-types';\nimport { addBuiltinLibsToObject } from '../dist-raw/node-cjs-helpers';\n\n/**\n * Main `bin` functionality.\n */\nexport function main(\n argv: string[] = process.argv.slice(2),\n entrypointArgs: Record<string, any> = {}\n) {\n // HACK: technically, this function is not marked @internal so it's possible\n // that libraries in the wild are doing `require('ts-node/dist/bin').main({'--transpile-only': true})`\n // We can mark this function @internal in next major release.\n // For now, rewrite args to avoid a breaking change.\n entrypointArgs = { ...entrypointArgs };\n for (const key of Object.keys(entrypointArgs)) {\n entrypointArgs[\n key.replace(\n /([a-z])-([a-z])/g,\n (_$0, $1, $2: string) => `${$1}${$2.toUpperCase()}`\n )\n ] = entrypointArgs[key];\n }\n\n const args = {\n ...entrypointArgs,\n ...arg(\n {\n // Node.js-like options.\n '--eval': String,\n '--interactive': Boolean,\n '--print': Boolean,\n '--require': [String],\n\n // CLI options.\n '--help': Boolean,\n '--cwdMode': Boolean,\n '--scriptMode': Boolean,\n '--version': arg.COUNT,\n '--showConfig': Boolean,\n\n // Project options.\n '--cwd': String,\n '--files': Boolean,\n '--compiler': String,\n '--compilerOptions': parse,\n '--project': String,\n '--ignoreDiagnostics': [String],\n '--ignore': [String],\n '--transpileOnly': Boolean,\n '--transpiler': String,\n '--swc': Boolean,\n '--typeCheck': Boolean,\n '--compilerHost': Boolean,\n '--pretty': Boolean,\n '--skipProject': Boolean,\n '--skipIgnore': Boolean,\n '--preferTsExts': Boolean,\n '--logError': Boolean,\n '--emit': Boolean,\n '--scope': Boolean,\n '--scopeDir': String,\n '--noExperimentalReplAwait': Boolean,\n\n // Aliases.\n '-e': '--eval',\n '-i': '--interactive',\n '-p': '--print',\n '-r': '--require',\n '-h': '--help',\n '-s': '--script-mode',\n '-v': '--version',\n '-T': '--transpileOnly',\n '-H': '--compilerHost',\n '-I': '--ignore',\n '-P': '--project',\n '-C': '--compiler',\n '-D': '--ignoreDiagnostics',\n '-O': '--compilerOptions',\n '--dir': '--cwd',\n\n // Support both tsc-style camelCase and node-style hypen-case for *all* flags\n '--cwd-mode': '--cwdMode',\n '--script-mode': '--scriptMode',\n '--show-config': '--showConfig',\n '--compiler-options': '--compilerOptions',\n '--ignore-diagnostics': '--ignoreDiagnostics',\n '--transpile-only': '--transpileOnly',\n '--type-check': '--typeCheck',\n '--compiler-host': '--compilerHost',\n '--skip-project': '--skipProject',\n '--skip-ignore': '--skipIgnore',\n '--prefer-ts-exts': '--preferTsExts',\n '--log-error': '--logError',\n '--scope-dir': '--scopeDir',\n '--no-experimental-repl-await': '--noExperimentalReplAwait',\n },\n {\n argv,\n stopAtPositional: true,\n }\n ),\n };\n\n // Only setting defaults for CLI-specific flags\n // Anything passed to `register()` can be `undefined`; `create()` will apply\n // defaults.\n const {\n '--cwd': cwdArg,\n '--help': help = false,\n '--scriptMode': scriptMode,\n '--cwdMode': cwdMode,\n '--version': version = 0,\n '--showConfig': showConfig,\n '--require': argsRequire = [],\n '--eval': code = undefined,\n '--print': print = false,\n '--interactive': interactive = false,\n '--files': files,\n '--compiler': compiler,\n '--compilerOptions': compilerOptions,\n '--project': project,\n '--ignoreDiagnostics': ignoreDiagnostics,\n '--ignore': ignore,\n '--transpileOnly': transpileOnly,\n '--typeCheck': typeCheck,\n '--transpiler': transpiler,\n '--swc': swc,\n '--compilerHost': compilerHost,\n '--pretty': pretty,\n '--skipProject': skipProject,\n '--skipIgnore': skipIgnore,\n '--preferTsExts': preferTsExts,\n '--logError': logError,\n '--emit': emit,\n '--scope': scope = undefined,\n '--scopeDir': scopeDir = undefined,\n '--noExperimentalReplAwait': noExperimentalReplAwait,\n } = args;\n\n if (help) {\n console.log(`\nUsage: ts-node [options] [ -e script | script.ts ] [arguments]\n\nOptions:\n\n -e, --eval [code] Evaluate code\n -p, --print Print result of \\`--eval\\`\n -r, --require [path] Require a node module before execution\n -i, --interactive Opens the REPL even if stdin does not appear to be a terminal\n\n -h, --help Print CLI usage\n -v, --version Print module version information\n --cwdMode Use current directory instead of <script.ts> for config resolution\n --showConfig Print resolved configuration and exit\n\n -T, --transpileOnly Use TypeScript's faster \\`transpileModule\\` or a third-party transpiler\n --swc Use the swc transpiler\n -H, --compilerHost Use TypeScript's compiler host API\n -I, --ignore [pattern] Override the path patterns to skip compilation\n -P, --project [path] Path to TypeScript JSON project file\n -C, --compiler [name] Specify a custom TypeScript compiler\n --transpiler [name] Specify a third-party, non-typechecking transpiler\n -D, --ignoreDiagnostics [code] Ignore TypeScript warnings by diagnostic code\n -O, --compilerOptions [opts] JSON object to merge with compiler options\n\n --cwd Behave as if invoked within this working directory.\n --files Load \\`files\\`, \\`include\\` and \\`exclude\\` from \\`tsconfig.json\\` on startup\n --pretty Use pretty diagnostic formatter (usually enabled by default)\n --skipProject Skip reading \\`tsconfig.json\\`\n --skipIgnore Skip \\`--ignore\\` checks\n --emit Emit output files into \\`.ts-node\\` directory\n --scope Scope compiler to files within \\`scopeDir\\`. Anything outside this directory is ignored.\n --scopeDir Directory for \\`--scope\\`\n --preferTsExts Prefer importing TypeScript files over JavaScript files\n --logError Logs TypeScript errors to stderr instead of throwing exceptions\n --noExperimentalReplAwait Disable top-level await in REPL. Equivalent to node's --no-experimental-repl-await\n`);\n\n process.exit(0);\n }\n\n // Output project information.\n if (version === 1) {\n console.log(`v${VERSION}`);\n process.exit(0);\n }\n\n // Figure out which we are executing: piped stdin, --eval, REPL, and/or entrypoint\n // This is complicated because node's behavior is complicated\n // `node -e code -i ./script.js` ignores -e\n const executeEval = code != null && !(interactive && args._.length);\n const executeEntrypoint = !executeEval && args._.length > 0;\n const executeRepl =\n !executeEntrypoint &&\n (interactive || (process.stdin.isTTY && !executeEval));\n const executeStdin = !executeEval && !executeRepl && !executeEntrypoint;\n\n const cwd = cwdArg || process.cwd();\n /** Unresolved. May point to a symlink, not realpath. May be missing file extension */\n const scriptPath = executeEntrypoint ? resolve(cwd, args._[0]) : undefined;\n\n /**\n * <repl>, [stdin], and [eval] are all essentially virtual files that do not exist on disc and are backed by a REPL\n * service to handle eval-ing of code.\n */\n interface VirtualFileState {\n state: EvalState;\n repl: ReplService;\n module?: Module;\n }\n let evalStuff: VirtualFileState | undefined;\n let replStuff: VirtualFileState | undefined;\n let stdinStuff: VirtualFileState | undefined;\n let evalAwarePartialHost: EvalAwarePartialHost | undefined = undefined;\n if (executeEval) {\n const state = new EvalState(join(cwd, EVAL_FILENAME));\n evalStuff = {\n state,\n repl: createRepl({\n state,\n composeWithEvalAwarePartialHost: evalAwarePartialHost,\n ignoreDiagnosticsThatAreAnnoyingInInteractiveRepl: false,\n }),\n };\n ({ evalAwarePartialHost } = evalStuff.repl);\n // Create a local module instance based on `cwd`.\n const module = (evalStuff.module = new Module(EVAL_NAME));\n module.filename = evalStuff.state.path;\n module.paths = (Module as any)._nodeModulePaths(cwd);\n }\n if (executeStdin) {\n const state = new EvalState(join(cwd, STDIN_FILENAME));\n stdinStuff = {\n state,\n repl: createRepl({\n state,\n composeWithEvalAwarePartialHost: evalAwarePartialHost,\n ignoreDiagnosticsThatAreAnnoyingInInteractiveRepl: false,\n }),\n };\n ({ evalAwarePartialHost } = stdinStuff.repl);\n // Create a local module instance based on `cwd`.\n const module = (stdinStuff.module = new Module(STDIN_NAME));\n module.filename = stdinStuff.state.path;\n module.paths = (Module as any)._nodeModulePaths(cwd);\n }\n if (executeRepl) {\n const state = new EvalState(join(cwd, REPL_FILENAME));\n replStuff = {\n state,\n repl: createRepl({\n state,\n composeWithEvalAwarePartialHost: evalAwarePartialHost,\n }),\n };\n ({ evalAwarePartialHost } = replStuff.repl);\n }\n\n // Register the TypeScript compiler instance.\n const service = register({\n cwd,\n emit,\n files,\n pretty,\n transpileOnly: transpileOnly ?? transpiler != null ? true : undefined,\n experimentalReplAwait: noExperimentalReplAwait ? false : undefined,\n typeCheck,\n transpiler,\n swc,\n compilerHost,\n ignore,\n preferTsExts,\n logError,\n projectSearchDir: getProjectSearchDir(cwd, scriptMode, cwdMode, scriptPath),\n project,\n skipProject,\n skipIgnore,\n compiler,\n ignoreDiagnostics,\n compilerOptions,\n require: argsRequire,\n readFile: evalAwarePartialHost?.readFile ?? undefined,\n fileExists: evalAwarePartialHost?.fileExists ?? undefined,\n scope,\n scopeDir,\n });\n\n // Bind REPL service to ts-node compiler service (chicken-and-egg problem)\n replStuff?.repl.setService(service);\n evalStuff?.repl.setService(service);\n stdinStuff?.repl.setService(service);\n\n // Output project information.\n if (version === 2) {\n console.log(`ts-node v${VERSION}`);\n console.log(`node ${process.version}`);\n console.log(`compiler v${service.ts.version}`);\n process.exit(0);\n }\n if (version >= 3) {\n console.log(`ts-node v${VERSION} ${dirname(__dirname)}`);\n console.log(`node ${process.version}`);\n console.log(\n `compiler v${service.ts.version} ${service.compilerPath ?? ''}`\n );\n process.exit(0);\n }\n\n if (showConfig) {\n const ts = service.ts as any as TSInternal;\n if (typeof ts.convertToTSConfig !== 'function') {\n console.error(\n 'Error: --showConfig requires a typescript versions >=3.2 that support --showConfig'\n );\n process.exit(1);\n }\n let moduleTypes = undefined;\n if (service.options.moduleTypes) {\n // Assumption: this codepath requires CLI invocation, so moduleTypes must have come from a tsconfig, not API.\n const showRelativeTo = dirname(service.configFilePath!);\n moduleTypes = {} as Record<string, string>;\n for (const [key, value] of Object.entries(service.options.moduleTypes)) {\n moduleTypes[\n relative(\n showRelativeTo,\n resolve(service.options.optionBasePaths?.moduleTypes!, key)\n )\n ] = value;\n }\n }\n const json = {\n ['ts-node']: {\n ...service.options,\n require: service.options.require?.length\n ? service.options.require\n : undefined,\n moduleTypes,\n optionBasePaths: undefined,\n compilerOptions: undefined,\n project: service.configFilePath ?? service.options.project,\n },\n ...ts.convertToTSConfig(\n service.config,\n service.configFilePath ?? join(cwd, 'ts-node-implicit-tsconfig.json'),\n service.ts.sys\n ),\n };\n console.log(\n // Assumes that all configuration options which can possibly be specified via the CLI are JSON-compatible.\n // If, in the future, we must log functions, for example readFile and fileExists, then we can implement a JSON\n // replacer function.\n JSON.stringify(json, null, 2)\n );\n process.exit(0);\n }\n\n // Prepend `ts-node` arguments to CLI for child processes.\n process.execArgv.push(\n __filename,\n ...process.argv.slice(2, process.argv.length - args._.length)\n );\n process.argv = [process.argv[1]]\n .concat(executeEntrypoint ? ([scriptPath] as string[]) : [])\n .concat(args._.slice(executeEntrypoint ? 1 : 0));\n\n // Execute the main contents (either eval, script or piped).\n if (executeEntrypoint) {\n Module.runMain();\n } else {\n // Note: eval and repl may both run, but never with stdin.\n // If stdin runs, eval and repl will not.\n if (executeEval) {\n addBuiltinLibsToObject(global);\n evalAndExitOnTsError(\n evalStuff!.repl,\n evalStuff!.module!,\n code!,\n print,\n 'eval'\n );\n }\n\n if (executeRepl) {\n replStuff!.repl.start();\n }\n\n if (executeStdin) {\n let buffer = code || '';\n process.stdin.on('data', (chunk: Buffer) => (buffer += chunk));\n process.stdin.on('end', () => {\n evalAndExitOnTsError(\n stdinStuff!.repl,\n stdinStuff!.module!,\n buffer,\n // `echo 123 | node -p` still prints 123\n print,\n 'stdin'\n );\n });\n }\n }\n}\n\n/**\n * Get project search path from args.\n */\nfunction getProjectSearchDir(\n cwd?: string,\n scriptMode?: boolean,\n cwdMode?: boolean,\n scriptPath?: string\n) {\n // Validate `--script-mode` / `--cwd-mode` / `--cwd` usage is correct.\n if (scriptMode && cwdMode) {\n throw new TypeError('--cwd-mode cannot be combined with --script-mode');\n }\n if (scriptMode && !scriptPath) {\n throw new TypeError(\n '--script-mode must be used with a script name, e.g. `ts-node --script-mode <script.ts>`'\n );\n }\n const doScriptMode =\n scriptMode === true ? true : cwdMode === true ? false : !!scriptPath;\n if (doScriptMode) {\n // Use node's own resolution behavior to ensure we follow symlinks.\n // scriptPath may omit file extension or point to a directory with or without package.json.\n // This happens before we are registered, so we tell node's resolver to consider ts, tsx, and jsx files.\n // In extremely rare cases, is is technically possible to resolve the wrong directory,\n // because we do not yet know preferTsExts, jsx, nor allowJs.\n // See also, justification why this will not happen in real-world situations:\n // https://github.com/TypeStrong/ts-node/pull/1009#issuecomment-613017081\n const exts = ['.js', '.jsx', '.ts', '.tsx'];\n const extsTemporarilyInstalled: string[] = [];\n for (const ext of exts) {\n if (!hasOwnProperty(require.extensions, ext)) {\n extsTemporarilyInstalled.push(ext);\n require.extensions[ext] = function () {};\n }\n }\n try {\n return dirname(requireResolveNonCached(scriptPath!));\n } finally {\n for (const ext of extsTemporarilyInstalled) {\n delete require.extensions[ext];\n }\n }\n }\n\n return cwd;\n}\n\nconst guaranteedNonexistentDirectoryPrefix = resolve(__dirname, 'doesnotexist');\nlet guaranteedNonexistentDirectorySuffix = 0;\n\n/**\n * require.resolve an absolute path, tricking node into *not* caching the results.\n * Necessary so that we do not pollute require.resolve cache prior to installing require.extensions\n *\n * Is a terrible hack, because node does not expose the necessary cache invalidation APIs\n * https://stackoverflow.com/questions/59865584/how-to-invalidate-cached-require-resolve-results\n */\nfunction requireResolveNonCached(absoluteModuleSpecifier: string) {\n // node <= 12.1.x fallback: The trick below triggers a node bug on old versions.\n // On these old versions, pollute the require cache instead. This is a deliberate\n // ts-node limitation that will *rarely* manifest, and will not matter once node 12\n // is end-of-life'd on 2022-04-30\n const isSupportedNodeVersion = versionGteLt(process.versions.node, '12.2.0');\n if (!isSupportedNodeVersion) return require.resolve(absoluteModuleSpecifier);\n\n const { dir, base } = parsePath(absoluteModuleSpecifier);\n const relativeModuleSpecifier = `./${base}`;\n\n const req = createRequire(\n join(dir, 'imaginaryUncacheableRequireResolveScript')\n );\n return req.resolve(relativeModuleSpecifier, {\n paths: [\n `${guaranteedNonexistentDirectoryPrefix}${guaranteedNonexistentDirectorySuffix++}`,\n ...(req.resolve.paths(relativeModuleSpecifier) || []),\n ],\n });\n}\n\n/**\n * Evaluate an [eval] or [stdin] script\n */\nfunction evalAndExitOnTsError(\n replService: ReplService,\n module: Module,\n code: string,\n isPrinted: boolean,\n filenameAndDirname: 'eval' | 'stdin'\n) {\n let result: any;\n setupContext(global, module, filenameAndDirname);\n\n try {\n result = replService.evalCode(code);\n } catch (error) {\n if (error instanceof TSError) {\n console.error(error);\n process.exit(1);\n }\n\n throw error;\n }\n\n if (isPrinted) {\n console.log(\n typeof result === 'string'\n ? result\n : inspect(result, { colors: process.stdout.isTTY })\n );\n }\n}\n\nif (require.main === module) {\n main();\n}\n"]} |