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(typecheck): use resolve vue-tsc and typescript path #264

Merged
merged 9 commits into from
Mar 18, 2024
Merged

fix(typecheck): use resolve vue-tsc and typescript path #264

merged 9 commits into from
Mar 18, 2024

Conversation

dargmuesli
Copy link
Member

This PR is motivated by the removal of shameless hoisting in Nuxt 🎉

It replaces the custom tryResolveModule utility with the export from @nuxt/kit. I hope it's synonymous 🙏

Also, more importantly, it reworks the resolution of vue-tsc. Background being: imagine a layer defining vue-tsc and typescript as dependency (not devDependency!) so that projects using that layer do not have to import vue-tsc themself but can lint right away.

  • First question: is that even meant to be supported 😂 or how should layer dependencies be categorized (normal, dev, peer...)?

To achieve that - I tested it with one of my projects - I was able to make vue-tsc discoverable by calling the function without cwd and with /bin/vue-tsc.js suffix instead of /package.json ⚠️

  • Second question: what am I bricking with this? Feels like that change could certainly lead to issues for other use cases, @pi0 you'll for sure be able to know and see opportunities for improvement 💡

I hope this PR is a helpful contribution. If I got something wrong, just tell me, no worries, I'm always willing to learn! ❤️

Replaces the custom `tryResolveModule` function with the export from `@nuxt/kit`.
Use resolved `vue-tsc` binary path as child process command.
src/utils/kit.ts Outdated Show resolved Hide resolved
@pi0 pi0 changed the title fix(typescript): resolve vue-tsc and typescript using @nuxt/cli fix(typecheck): use resolve vue-tsc and typescript path Mar 18, 2024
@pi0
Copy link
Member

pi0 commented Mar 18, 2024

Thanks!

@pi0 pi0 merged commit da16a3a into nuxt:main Mar 18, 2024
2 checks passed
@dargmuesli dargmuesli deleted the fix/resolve-module-kit branch March 18, 2024 17:19
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.

None yet

2 participants