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: Pass tsconfig path to typescript parseJsonConfigFileContent #495
Conversation
🦋 Changeset detectedLatest commit: 629d539 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for preconstruct ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Had to alter memoize to take two arguments, but since it's only used for typescript memoization that didn't seem like much of an issue. I honestly doubt the need for the dirname in the memoization though, I don't think there's another path that will result in a different dirname/tsconfig combination. |
Codecov ReportBase: 92.14% // Head: 91.19% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #495 +/- ##
==========================================
- Coverage 92.14% 91.19% -0.96%
==========================================
Files 32 33 +1
Lines 1452 1477 +25
Branches 395 396 +1
==========================================
+ Hits 1338 1347 +9
- Misses 108 124 +16
Partials 6 6
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
I'm actually having slight second thoughts on this PR, as pointed out in #443 this problem occures if packages are below a |
Fixed my second thoughts. Paths are relative to the config file location, so instead of CWD I'm now passing the tsconfig directory instead. That should be a definite solution to the problem and removes the need to alter the memoize calls. I hope you like this simplified version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change itself seems fine but could you add some tests? I'm not sure this will actually fix the issue
I'll see what I can do. It's working, I'm using the changes using |
f6bc25a
to
f6163a2
Compare
@mitchellhamilton I added a test which breaks without the path change and passes with the change. I hope this satisfies your requirements. Also, when checking this out on Windows I get a ton of eslint errors due to line ending style, not sure if you have any advice on this. It's hugely annoying, hiding the actual style errors. |
…aseJsonConfigFIleContent" This reverts commit 9888c97.
I'm not sure about denying I don't know if preconstruct offers me the same functionality in dev mode, but this approach (with path aliases for local packages in sample tsconfig) gives me HMR on package changes as well, which makes for an extremely smooth development experience. |
I actually set git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
You're welcome, thanks for preconstruct and emotion! |
Fix #443