Skip to content

Commit

Permalink
Merge pull request #52 from kulshekhar/fix-for-source-map-consumer
Browse files Browse the repository at this point in the history
Fix for source map consumer
  • Loading branch information
Igmat authored Nov 4, 2016
2 parents 37c7a2e + e1f95e5 commit 4e45b38
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 51 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ jspm_packages

# Optional REPL history
.node_repl_history

# We need to include this folders, because they are mocks for integration tests
!tests/**/node_modules
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ pids
*.pid
*.seed

# nodist config for testing in different versions of node
.node-version

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![Build Status for node v7](https://travis-badges.herokuapp.com/repos/kulshekhar/ts-jest/branches/master?job=0)](https://travis-ci.org/kulshekhar/ts-jest)
[![Build Status for node v6](https://travis-badges.herokuapp.com/repos/kulshekhar/ts-jest/branches/master?job=1)](https://travis-ci.org/kulshekhar/ts-jest)
[![Build Status for node v4](https://travis-badges.herokuapp.com/repos/kulshekhar/ts-jest/branches/master?job=2)](https://travis-ci.org/kulshekhar/ts-jest)
[![Build Status for Windows](https://ci.appveyor.com/api/projects/status/gknb1pl72o0w0coc?svg=true)](https://ci.appveyor.com/project/Igmat/ts-jest)

## Table of Contents
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
Expand Down
28 changes: 28 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# appveyor file
# http://www.appveyor.com/docs/appveyor-yml

# build version format
version: "{build}"

# fix lineendings in Windows
init:
- git config --global core.autocrlf input

# what combinations to test
environment:
matrix:
- nodejs_version: 4
- nodejs_version: 6
- nodejs_version: 7

# get the latest stable version of Node 0.STABLE.latest
install:
- ps: Install-Product node $env:nodejs_version
- npm install

build: off

test_script:
- node --version
- npm --version
- cmd: npm test --no-color
20 changes: 0 additions & 20 deletions src/default-retrieve-map-handler.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { defaultRetrieveMapHandler } from './default-retrieve-map-handler';
import { defaultRetrieveFileHandler } from './default-retrieve-file-handler';
import * as sourceMapSupport from 'source-map-support';

export function install() {
var options: sourceMapSupport.Options = {};
options.retrieveFile = defaultRetrieveFileHandler;
options.retrieveSourceMap = defaultRetrieveMapHandler;
options.emptyCacheBetweenOperations = true; // left here only for sourceMapCache TODO: check this for correctness and performance with false velue
options['environment'] = 'node';

Expand Down
14 changes: 0 additions & 14 deletions src/retrieve-sourceMap-url.ts

This file was deleted.

8 changes: 1 addition & 7 deletions src/transpile-if-ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,11 @@ export function transpileIfTypescript(path, contents) {
if (path && (path.endsWith('.tsx') || path.endsWith('.ts'))) {

let transpiled = tsc.transpileModule(contents, {
compilerOptions: addSourceMapToTSConfig(),
compilerOptions: getTSConfig({ __TS_CONFIG__: global['__TS_CONFIG__'] }, true),
fileName: path
});

return transpiled.outputText;
}
return contents;
}

function addSourceMapToTSConfig() {
// if a global __TS_CONFIG__ is set, update the compiler setting to include inline SourceMap
var config = getTSConfig({ __TS_CONFIG__: global['__TS_CONFIG__'] }, true);
return config;
}
2 changes: 0 additions & 2 deletions tests/button/__mocks__/ts-jest.ts

This file was deleted.

1 change: 1 addition & 0 deletions tests/button/node_modules/ts-jest.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions tests/simple/__mocks__/ts-jest.ts

This file was deleted.

1 change: 1 addition & 0 deletions tests/simple/node_modules/ts-jest.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions tests/tsconfig-test/__mocks__/ts-jest.ts

This file was deleted.

2 changes: 0 additions & 2 deletions tests/watch-test/__mocks__/ts-jest.ts

This file was deleted.

1 change: 1 addition & 0 deletions tests/watch-test/node_modules/ts-jest.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4e45b38

Please sign in to comment.