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

feat: Add TypeScript local resolving #793

Merged
merged 1 commit into from
Mar 7, 2019
Merged

feat: Add TypeScript local resolving #793

merged 1 commit into from
Mar 7, 2019

Conversation

Maecenas
Copy link
Contributor

@Maecenas Maecenas commented Mar 3, 2019

Fix and extend #765

Changing { paths: [cwd] } (BTW, is this by design?) to { paths: [cwd, __dirname] } would make ts-node able to resolve both local and global typescript dependency.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.082% when pulling 2d57c9a on Maecenas:patch-1 into c2ecc7d on TypeStrong:master.

@blakeembrey
Copy link
Member

@Maecenas This seems reasonable. I was hesitant to support this since it makes resolution a little unpredictable. What are you thoughts on doing this by default vs behind a flag?

@Maecenas
Copy link
Contributor Author

Maecenas commented Mar 7, 2019

@blakeembrey The motivation is to contribute ts-node to Homebrew. It seems ts-node is resolving typescript from local ($ npm i -D), and then global ($ npm i -g). As for Homebrew, apps are installed to a path /usr/local/Cellar and can not trace seperated local dependency.

The intuition behind this PR is to add installed path to dependencies resolving, as __dirname and after cwd yet before global path.

@blakeembrey blakeembrey merged commit 655c43b into TypeStrong:master Mar 7, 2019
@Maecenas Maecenas deleted the patch-1 branch March 7, 2019 07:59
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.

3 participants