Skip to content

Commit

Permalink
Fix source-map-support bugs via a fork (#1405)
Browse files Browse the repository at this point in the history
* update

* update

* fix unrelated test breakage

* update to stable release of @cspotcode/source-map-support
  • Loading branch information
cspotcode committed Jul 21, 2021
1 parent e865076 commit 6681fcd
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 76 deletions.
125 changes: 55 additions & 70 deletions package-lock.json

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

5 changes: 2 additions & 3 deletions package.json
Expand Up @@ -122,7 +122,6 @@
"@types/react": "^16.0.2",
"@types/rimraf": "^3.0.0",
"@types/semver": "^7.1.0",
"@types/source-map-support": "^0.5.0",
"@yarnpkg/fslib": "^2.4.0",
"ava": "^3.15.0",
"axios": "^0.21.1",
Expand Down Expand Up @@ -158,15 +157,15 @@
}
},
"dependencies": {
"@cspotcode/source-map-support": "0.6.1",
"@tsconfig/node10": "^1.0.7",
"@tsconfig/node12": "^1.0.7",
"@tsconfig/node14": "^1.0.0",
"@tsconfig/node16": "^1.0.1",
"@tsconfig/node16": "^1.0.2",
"arg": "^4.1.0",
"create-require": "^1.1.0",
"diff": "^4.0.1",
"make-error": "^1.1.1",
"source-map-support": "^0.5.17",
"yn": "3.1.1"
},
"prettier": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Expand Up @@ -3,7 +3,7 @@ import { Module } from 'module';
import * as util from 'util';
import { fileURLToPath } from 'url';

import sourceMapSupport = require('source-map-support');
import sourceMapSupport = require('@cspotcode/source-map-support');
import { BaseError } from 'make-error';
import type * as _ts from 'typescript';

Expand Down
7 changes: 5 additions & 2 deletions src/test/index.spec.ts
Expand Up @@ -1248,6 +1248,9 @@ test.suite('ts-node', (test) => {
semver.gte(ts.version, '3.5.0') &&
semver.gte(process.versions.node, '14.0.0')
) {
const libAndTarget = semver.gte(process.versions.node, '16.0.0')
? 'es2021'
: 'es2020';
test('implicitly uses @tsconfig/node14 or @tsconfig/node16 compilerOptions when both TS and node versions support it', async (t) => {
// node14 and node16 configs are identical, hence the "or"
const {
Expand All @@ -1261,8 +1264,8 @@ test.suite('ts-node', (test) => {
expect(err1).to.equal(null);
t.like(JSON.parse(stdout1), {
compilerOptions: {
target: 'es2020',
lib: ['es2020'],
target: libAndTarget,
lib: [libAndTarget],
},
});
const {
Expand Down

0 comments on commit 6681fcd

Please sign in to comment.