Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix source-map-support bugs via a fork #1405

Merged
merged 4 commits into from Jul 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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