-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Support monorepo package self-references #8820
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🟢 Turbopack Benchmark CI successful 🟢Thanks |
✅ This change can build |
|
fragment, | ||
options, | ||
); | ||
if !(*result.is_unresolveable().await?) { |
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.
Should we continue to look for other packages with the same name or should this better fail resolving here if the self reference doesn't resolve?
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.
I think that's an uncommon case, but https://nodejs.org/api/modules.html#all-together would continue searching. So I'm inclined to continue as well
Closes PACK-3107 Packages importing themselves works fine for packages from npm, since they always live at `.../node_modules/foo` anyway and so the regular node_modules resolution covers self-references as well. This is not the case for (symlinked) monorepo workspaces, which this PR fixes. This essentially adds the `LOAD_PACKAGE_SELF` step from https://nodejs.org/api/modules.html#all-together .
Closes PACK-3107 Packages importing themselves works fine for packages from npm, since they always live at `.../node_modules/foo` anyway and so the regular node_modules resolution covers self-references as well. This is not the case for (symlinked) monorepo workspaces, which this PR fixes. This essentially adds the `LOAD_PACKAGE_SELF` step from https://nodejs.org/api/modules.html#all-together .
Closes PACK-3107 Packages importing themselves works fine for packages from npm, since they always live at `.../node_modules/foo` anyway and so the regular node_modules resolution covers self-references as well. This is not the case for (symlinked) monorepo workspaces, which this PR fixes. This essentially adds the `LOAD_PACKAGE_SELF` step from https://nodejs.org/api/modules.html#all-together .
I've simplified @timneutkens's tests from #66486 The resolver fix is in vercel/turborepo#8820 Closes #66486 Related issue: #66487 --------- Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Closes PACK-3107
Packages importing themselves works fine for packages from npm, since they always live at
.../node_modules/foo
anyway and so the regular node_modules resolution covers self-references as well.This is not the case for (symlinked) monorepo workspaces, which this PR fixes. This essentially adds the
LOAD_PACKAGE_SELF
step from https://nodejs.org/api/modules.html#all-together .I think the logic is sound, should I extract this into a separate function? Or is there a better place to put this anyway?