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: v3.0.0
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.1
Choose a head ref
  • 3 commits
  • 5 files changed
  • 1 contributor

Commits on Mar 21, 2017

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0d783d9 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    89f80d7 View commit details
  3. 3.0.1

    blakeembrey committed Mar 21, 2017

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    638bb9f View commit details
Showing with 18 additions and 20 deletions.
  1. +4 −3 package.json
  2. +2 −3 src/_bin.ts
  3. +5 −7 src/index.ts
  4. +6 −6 tsconfig.json
  5. +1 −1 typings.json
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ts-node",
"version": "3.0.0",
"version": "3.0.1",
"preferGlobal": true,
"description": "TypeScript execution environment and REPL for node",
"main": "dist/index.js",
@@ -23,6 +23,9 @@
"test": "npm run build && npm run lint && npm run test-cov",
"prepublish": "typings install && npm run build"
},
"engines": {
"node": ">=4.2.0"
},
"repository": {
"type": "git",
"url": "git://github.com/TypeStrong/ts-node.git"
@@ -65,11 +68,9 @@
"make-error": "^1.1.1",
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
"pinkie": "^2.0.4",
"source-map-support": "^0.4.0",
"tsconfig": "^6.0.0",
"v8flags": "^2.0.11",
"xtend": "^4.0.0",
"yn": "^1.2.0"
}
}
5 changes: 2 additions & 3 deletions src/_bin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { join, resolve, basename } from 'path'
import { join, resolve } from 'path'
import { start, Recoverable } from 'repl'
import { inspect } from 'util'
import arrify = require('arrify')
@@ -139,7 +139,6 @@ const code = argv.eval == null ? argv.print : argv.eval
const isEvalScript = typeof argv.eval === 'string' || !!argv.print // Minimist struggles with empty strings.
const isEval = isEvalScript || stop === process.argv.length
const isPrinted = argv.print != null
const supportsScriptOptions = parseFloat(process.version.substr(1)) >= 1

// Register the TypeScript compiler instance.
const service = register({
@@ -308,7 +307,7 @@ function startRepl () {
/**
* Eval code from the REPL.
*/
function replEval (code: string, context: any, filename: string, callback: (err?: Error, result?: any) => any) {
function replEval (code: string, context: any, _filename: string, callback: (err?: Error, result?: any) => any) {
let err: any
let result: any

12 changes: 5 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@ import { relative, basename, extname, resolve, dirname, join } from 'path'
import { readdirSync, writeFileSync, readFileSync, statSync } from 'fs'
import { EOL, tmpdir, homedir } from 'os'
import sourceMapSupport = require('source-map-support')
import extend = require('xtend')
import mkdirp = require('mkdirp')
import crypto = require('crypto')
import yn = require('yn')
@@ -145,10 +144,9 @@ export function register (options: Options = {}): Register {
const fast = !!(options.fast == null ? DEFAULTS.fast : options.fast)
const project = options.project || DEFAULTS.project
const cacheDirectory = options.cacheDirectory || DEFAULTS.cacheDirectory || getTmpDir()
const compilerOptions = extend(DEFAULTS.compilerOptions, options.compilerOptions)
const compilerOptions = Object.assign({}, DEFAULTS.compilerOptions, options.compilerOptions)
const originalJsHandler = require.extensions['.js']
const cache: Cache = { contents: {}, versions: {}, sourceMaps: {} }
let result: Register

const ignore = arrify(
(
@@ -256,7 +254,7 @@ export function register (options: Options = {}): Register {
getExtension
)

let getTypeInfo = function (fileName: string, position: number): TypeInfo {
let getTypeInfo = function (_fileName: string, _position: number): TypeInfo {
throw new TypeError(`No type information available under "--fast" mode`)
}

@@ -295,12 +293,12 @@ export function register (options: Options = {}): Register {
getNewLine: () => EOL,
getCurrentDirectory: () => cwd,
getCompilationSettings: () => config.options,
getDefaultLibFileName: (options: any) => ts.getDefaultLibFilePath(config.options)
getDefaultLibFileName: () => ts.getDefaultLibFilePath(config.options)
}

const service = ts.createLanguageService(serviceHost)

getOutput = function (code: string, fileName: string, lineOffset: number = 0) {
getOutput = function (_code: string, fileName: string, lineOffset: number = 0) {
const output = service.getEmitOutput(fileName)

// Get the relevant diagnostics - this is 3x faster than `getPreEmitDiagnostics`.
@@ -408,7 +406,7 @@ function readConfig (compilerOptions: any, project: string | boolean | undefined
const result = loadSync(cwd, typeof project === 'string' ? project : undefined)

// Override default configuration options.
result.config.compilerOptions = extend(result.config.compilerOptions, compilerOptions, {
result.config.compilerOptions = Object.assign({}, result.config.compilerOptions, compilerOptions, {
sourceMap: true,
inlineSourceMap: false,
inlineSources: true,
12 changes: 6 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["es2015"],
"outDir": "dist",
"module": "commonjs",
"declaration": true,
"noImplicitAny": true,
"strictNullChecks": true,
"removeComments": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"moduleResolution": "node",
"sourceMap": true,
"inlineSources": true
},
"files": [
"src/_bin.ts",
"src/bin.ts",
"src/index.ts",
"src/index.spec.ts",
"typings/index.d.ts"
"include": [
"src/**/*",
"typings/**/*"
]
}
2 changes: 1 addition & 1 deletion typings.json
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
"yn": "registry:npm/yn#1.2.0+20161006191459"
},
"globalDependencies": {
"node": "registry:env/node#6.0.0+20161015001438"
"node": "registry:env/node#6.0.0+20170213133316"
},
"globalDevDependencies": {
"chai": "registry:dt/chai#3.4.0+20160216071402",