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

Commits on Jul 22, 2016

  1. Copy the full SHA
    84fcf19 View commit details
  2. Update tslint modules

    blakeembrey committed Jul 22, 2016
    Copy the full SHA
    6b771cb View commit details
  3. v1.2.0

    blakeembrey committed Jul 22, 2016
    Copy the full SHA
    db1ff88 View commit details
Showing with 9 additions and 31 deletions.
  1. +4 −3 package.json
  2. +4 −28 src/index.ts
  3. +1 −0 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": "1.1.0",
"version": "1.2.0",
"preferGlobal": true,
"description": "TypeScript execution environment and REPL for node",
"main": "dist/index.js",
@@ -51,8 +51,8 @@
"ntypescript": "^1.201507091536.1",
"proxyquire": "^1.7.2",
"semver": "^5.1.0",
"tslint": "^3.10.2",
"tslint-config-standard": "^1.0.0",
"tslint": "^3.13.0",
"tslint-config-standard": "^1.3.0",
"typescript": "^1.8.10",
"typings": "^1.0.4"
},
@@ -64,6 +64,7 @@
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
"source-map-support": "^0.4.0",
"tsconfig": "^5.0.2",
"xtend": "^4.0.0"
}
}
32 changes: 4 additions & 28 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ import mkdirp = require('mkdirp')
import crypto = require('crypto')
import { BaseError } from 'make-error'
import * as TS from 'typescript'
import { loadSync } from 'tsconfig'

const pkg = require('../package.json')
const oldHandlers: { [key: string]: any } = {}
@@ -322,32 +323,7 @@ export function register (opts?: Options): () => Register {
* Load TypeScript configuration.
*/
function readConfig (options: Options, cwd: string, ts: TSCommon) {
let project: string

if (options.project == null) {
const path = ts.findConfigFile(cwd, options.fileExists)

project = path ? resolve(path) : undefined
} else if (typeof options.project === 'string') {
const path = resolve(options.project)

if (options.fileExists(path)) {
project = path
} else {
project = join(path, 'tsconfig.json')
}
}

const result = project ? ts.readConfigFile(project, options.getFile) : {
config: {
files: [],
compilerOptions: {}
}
}

if (result.error) {
throw new TSError([formatDiagnostic(result.error, cwd, ts)])
}
const result = loadSync(cwd, options.project)

result.config.compilerOptions = extend(
{
@@ -370,13 +346,13 @@ function readConfig (options: Options, cwd: string, ts: TSCommon) {
delete result.config.compilerOptions.out
delete result.config.compilerOptions.outFile

const basePath = project ? dirname(project) : cwd
const basePath = result.path ? dirname(result.path) : cwd

if (typeof ts.parseConfigFile === 'function') {
return ts.parseConfigFile(result.config, ts.sys, basePath)
}

return ts.parseJsonConfigFileContent(result.config, ts.sys, basePath, null, project)
return ts.parseJsonConfigFileContent(result.config, ts.sys, basePath, null, result.path)
}

/**
1 change: 1 addition & 0 deletions typings.json
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
"mkdirp": "registry:npm/mkdirp#0.5.0+20160222053049",
"proxyquire": "registry:npm/proxyquire#1.0.0+20160211003958",
"source-map-support": "registry:npm/source-map-support#0.3.0+20160413183746",
"tsconfig": "npm:tsconfig",
"xtend": "registry:npm/xtend#4.0.0+20160211003958"
},
"globalDependencies": {