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: do not import typescript outside of config/project loading #1433

Merged
merged 1 commit into from
Aug 18, 2021

Conversation

songkeys
Copy link
Contributor

@songkeys songkeys commented Aug 17, 2021

EDIT from @cspotcode to track related issues: Looks like this fixes a bug introduced by #1383. Should resolve #1426, #1427, #1428.


Or: to resolve typescript module correctly.

The current code still has a "hard" top-level requiring for typescript, which may cause issues when installing ts-node globally and installing typescript locally (i.e. you have to install them both globally or both locally). Since we've already resolving typescript smartly in the code using loadCompiler, why not accessing ScriptTarget from the resolved one?

Or: to resolve typescript module correctly.

The current code still has a "hard" top-level requiring for typescript, which may cause issues when installing ts-node globally and installing typescript locally (i.e. you have to install them both globally or both locally). Since we've already resolving typescript smartly in the code using `loadCompiler`, why not resolving `ScriptTarget` from the resolved one?
@codecov
Copy link

codecov bot commented Aug 17, 2021

Codecov Report

Merging #1433 (ff003eb) into main (385a469) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted Files Coverage Δ
src/index.ts 77.80% <100.00%> (-0.06%) ⬇️

@cspotcode
Copy link
Collaborator

Thanks, good catch. Looks like this fixes a bug introduced by #1383. Should resolve #1426, #1427, #1428.

@cspotcode cspotcode added this to the 10.2.1 milestone Aug 17, 2021
@cspotcode cspotcode changed the title fix: be completely independent from typescript fix: do not import typescript outside of config/project loading Aug 17, 2021
@cspotcode cspotcode merged commit 9a14af7 into TypeStrong:main Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot find module 'typescript' when using npx ts-node
2 participants