-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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(plugin-typescript): automatically setup project references #2338
base: master
Are you sure you want to change the base?
Conversation
Just leaving a note here that |
02e4a84
to
fa02924
Compare
cc @SimenB since Jest (https://github.com/facebook/jest) is using project references and might find this useful and/or have some thoughts on how they could use it |
Woo! 🎉 I recently did jestjs/jest#10941 since we had messed up our references, having yarn handle it would be awesome. Sorta relates to microsoft/TypeScript#25376, but solves it from the package manager side instead of from TS |
9a750b2
to
6767f4f
Compare
You probably found it while researching, but if not - we use https://github.com/azu/monorepo-utils/tree/master/packages/%40monorepo-utils/workspaces-to-typescript-project-references at work. It properly handles comments as was mentioned above here |
6767f4f
to
6a8b099
Compare
6a8b099
to
ca1987b
Compare
ca1987b
to
e769f2b
Compare
Hi guys, what's the status of this feature? I would really love to make it work, is there any help needed? |
Not a yarn plugin, but I did something similar here: https://beemo.dev/docs/drivers/typescript#sync-project-refs Would be nice if it was supported by yarn! Here's the actual code: https://github.com/beemojs/beemo/blob/master/packages/driver-typescript/src/commands/syncProjectRefs.ts |
e769f2b
to
e2c957d
Compare
Another feature I'd love to see as part of this is the option to opt-in/opt-out from some packages. Is this maybe already possible? @merceyz? Use cases:
|
I'd assume it only sets up references if the module referenced has a |
Nope, seems to also create new ones if not existing. But I'd like to exclude even packages beyond that case. |
One thing to keep in mind is that typescript doesn't support circular references, which are quite easy to create when using workspaces. |
If its useful, I did some testing with this today. I have a couple thoughts which may be worth consideration.
FYI found some prior art here https://github.com/Dcard/yarn-plugins/tree/master/packages/tsconfig-references, although this plugin uses the "after workspace addition/removal" hooks. Probably "after all installed" makes more sense as it will update references when dependencies change, in addition to workspace addition/removal. |
Any chance this could get picked back up? It would be super helpful :) |
Moonrepo
…On Thu, 1 Feb 2024 at 23:49, Andrew McClenaghan ***@***.***> wrote:
Any chance this could get picked back up? It would be super helpful :)
—
Reply to this email directly, view it on GitHub
<#2338 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGTCZG3OTNZM5HWVDHVNT3YRQLWNAVCNFSM4VXR2H62U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJSGI2DENJVHAYQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
What's the problem this PR addresses?
Proof of concept of automatically setting up project references based on dependencies
https://www.typescriptlang.org/docs/handbook/project-references.html
How did you fix it?
Checklist