Skip to content

Commit 6681fcd

Browse files
authored
Fix source-map-support bugs via a fork (#1405)
* update * update * fix unrelated test breakage * update to stable release of @cspotcode/source-map-support
1 parent e865076 commit 6681fcd

File tree

4 files changed

+63
-76
lines changed

4 files changed

+63
-76
lines changed

package-lock.json

Lines changed: 55 additions & 70 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@
122122
"@types/react": "^16.0.2",
123123
"@types/rimraf": "^3.0.0",
124124
"@types/semver": "^7.1.0",
125-
"@types/source-map-support": "^0.5.0",
126125
"@yarnpkg/fslib": "^2.4.0",
127126
"ava": "^3.15.0",
128127
"axios": "^0.21.1",
@@ -158,15 +157,15 @@
158157
}
159158
},
160159
"dependencies": {
160+
"@cspotcode/source-map-support": "0.6.1",
161161
"@tsconfig/node10": "^1.0.7",
162162
"@tsconfig/node12": "^1.0.7",
163163
"@tsconfig/node14": "^1.0.0",
164-
"@tsconfig/node16": "^1.0.1",
164+
"@tsconfig/node16": "^1.0.2",
165165
"arg": "^4.1.0",
166166
"create-require": "^1.1.0",
167167
"diff": "^4.0.1",
168168
"make-error": "^1.1.1",
169-
"source-map-support": "^0.5.17",
170169
"yn": "3.1.1"
171170
},
172171
"prettier": {

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Module } from 'module';
33
import * as util from 'util';
44
import { fileURLToPath } from 'url';
55

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

src/test/index.spec.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,9 @@ test.suite('ts-node', (test) => {
12481248
semver.gte(ts.version, '3.5.0') &&
12491249
semver.gte(process.versions.node, '14.0.0')
12501250
) {
1251+
const libAndTarget = semver.gte(process.versions.node, '16.0.0')
1252+
? 'es2021'
1253+
: 'es2020';
12511254
test('implicitly uses @tsconfig/node14 or @tsconfig/node16 compilerOptions when both TS and node versions support it', async (t) => {
12521255
// node14 and node16 configs are identical, hence the "or"
12531256
const {
@@ -1261,8 +1264,8 @@ test.suite('ts-node', (test) => {
12611264
expect(err1).to.equal(null);
12621265
t.like(JSON.parse(stdout1), {
12631266
compilerOptions: {
1264-
target: 'es2020',
1265-
lib: ['es2020'],
1267+
target: libAndTarget,
1268+
lib: [libAndTarget],
12661269
},
12671270
});
12681271
const {

0 commit comments

Comments
 (0)