Comparing version 0.1.5 to 0.1.6
13
index.js
@@ -8,2 +8,3 @@ // Except a small part of the code, all of the code here is taken from | ||
var tsc = require('typescript'); | ||
var {getTSConfig} = require('./utils'); | ||
@@ -95,3 +96,3 @@ // Only install once if called multiple times | ||
transpiled = tsc.transpileModule(contents, { | ||
compilerOptions: getTSConfig(), | ||
compilerOptions: addSourceMapToTSConfig(), | ||
fileName: path | ||
@@ -509,10 +510,8 @@ }); | ||
function getTSConfig() { | ||
// if a global __TS_CONFIG__ is set, update the compiler options based on that | ||
var config = __TS_CONFIG__ || {}; | ||
config.module = config.module || tsc.ModuleKind.CommonJS; | ||
config.jsx = config.jsx || tsc.JsxEmit.React; | ||
function addSourceMapToTSConfig() { | ||
// if a global __TS_CONFIG__ is set, update the compiler setting to include inline SourceMap | ||
var config = getTSConfig({ __TS_CONFIG__: __TS_CONFIG__ }); | ||
config.inlineSourceMap = true; | ||
return tsc.convertCompilerOptionsFromJson(config).options; | ||
return config; | ||
} |
{ | ||
"name": "ts-jest", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"main": "index.ts", | ||
"description": "A preprocessor with sourcemap support to help use Typescript with Jest", | ||
"scripts": { | ||
"test": "jest --no-cache" | ||
"test": "node scripts/tests.js" | ||
}, | ||
@@ -38,4 +38,6 @@ "repository": { | ||
"react": "^15.3.2", | ||
"react-test-renderer": "^15.3.2" | ||
"react-test-renderer": "^15.3.2", | ||
"jest": "16.0.1", | ||
"cross-spawn": "4.0.2" | ||
} | ||
} |
const tsc = require('typescript'); | ||
const {getTSConfig} = require('./utils'); | ||
@@ -20,10 +21,2 @@ module.exports = { | ||
} | ||
}; | ||
function getTSConfig(globals) { | ||
const config = globals.__TS_CONFIG__ || {}; | ||
config.module = config.module || tsc.ModuleKind.CommonJS; | ||
config.jsx = config.jsx || tsc.JsxEmit.React; | ||
return tsc.convertCompilerOptionsFromJson(config).options; | ||
} | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
130833
15
2804
0
4
7