Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: TypeStrong/ts-node
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.1.2
Choose a base ref
...
head repository: TypeStrong/ts-node
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.0.0
Choose a head ref
  • 3 commits
  • 5 files changed
  • 1 contributor

Commits on Mar 21, 2017

  1. Copy the full SHA
    9caa1c5 View commit details
  2. Copy the full SHA
    67eabed View commit details
  3. 3.0.0

    blakeembrey committed Mar 21, 2017
    Copy the full SHA
    3def533 View commit details
Showing with 178 additions and 198 deletions.
  1. +0 −1 README.md
  2. +1 −1 package.json
  3. +1 −3 register.js
  4. +3 −7 src/_bin.ts
  5. +173 −186 src/index.ts
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -89,7 +89,6 @@ ts-node --compiler ntypescript --project src --ignoreWarnings 2304 hello-world.t
* **--disableWarnings, -D** Ignore all TypeScript errors (also `process.env.TS_NODE_DISABLE_WARNINGS`)
* **--compilerOptions, -O** Set compiler options using JSON (E.g. `--compilerOptions '{"target":"es6"}'`) (also `process.env.TS_NODE_COMPILER_OPTIONS`)
* **--fast, -F** Use TypeScript's `transpileModule` mode (no type checking, but faster compilation) (also `process.env.TS_NODE_FAST`)
* **--lazy, -L** Lazily defer TypeScript initialization until first `.ts` file
* **--no-cache** Skip hitting the compiled JavaScript cache (also `process.env.TS_NODE_CACHE`)
* **--cache-directory** Configure the TypeScript cache directory (also `process.env.TS_NODE_CACHE_DIRECTORY`)

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ts-node",
"version": "2.1.2",
"version": "3.0.0",
"preferGlobal": true,
"description": "TypeScript execution environment and REPL for node",
"main": "dist/index.js",
4 changes: 1 addition & 3 deletions register.js
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
require('./').register({
lazy: true
})
require('./').register()
10 changes: 3 additions & 7 deletions src/_bin.ts
Original file line number Diff line number Diff line change
@@ -13,7 +13,6 @@ interface Argv {
eval?: string
print?: string
fast?: boolean
lazy?: boolean
cache?: boolean
cacheDirectory?: string
version?: boolean
@@ -29,12 +28,11 @@ interface Argv {
}

const strings = ['eval', 'print', 'compiler', 'project', 'ignoreWarnings', 'require', 'cacheDirectory', 'ignore']
const booleans = ['help', 'fast', 'lazy', 'version', 'disableWarnings', 'cache']
const booleans = ['help', 'fast', 'version', 'disableWarnings', 'cache']

const aliases: { [key: string]: string[] } = {
help: ['h'],
fast: ['F'],
lazy: ['L'],
version: ['v'],
eval: ['e'],
print: ['p'],
@@ -127,7 +125,6 @@ Options:
-D, --disableWarnings Ignore every TypeScript warning
-P, --project [path] Path to TypeScript project (or \`false\`)
-O, --compilerOptions [opts] JSON object to merge with compiler options
-L, --lazy Lazily load TypeScript compilation on demand
-F, --fast Run TypeScript compilation in transpile mode
--ignore [regexp], --no-ignore Set the ignore check (default: \`/node_modules/\`)
--no-cache Disable the TypeScript cache
@@ -147,7 +144,6 @@ const supportsScriptOptions = parseFloat(process.version.substr(1)) >= 1
// Register the TypeScript compiler instance.
const service = register({
fast: argv.fast,
lazy: argv.lazy,
cache: argv.cache,
cacheDirectory: argv.cacheDirectory,
compiler: argv.compiler,
@@ -245,7 +241,7 @@ function _eval (input: string, context: any) {
let output: string

try {
output = service().compile(EVAL_INSTANCE.input, EVAL_PATH, -lines)
output = service.compile(EVAL_INSTANCE.input, EVAL_PATH, -lines)
} catch (err) {
undo()

@@ -299,7 +295,7 @@ function startRepl () {
}

const undo = appendEval(identifier)
const { name, comment } = service().getTypeInfo(EVAL_PATH, EVAL_INSTANCE.input.length)
const { name, comment } = service.getTypeInfo(EVAL_PATH, EVAL_INSTANCE.input.length)

undo()

Loading