-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
npm workspace support #18546
Comments
I also encountered this problem. It would be very nice to be able to test local npm packages with deno |
I am also encountering this, it's a pretty substantial blocked for adopting Deno in my case. I did some digging and it looks like this whole chain receives the resolved symlink path which fails to detect that we are in In the case of a workspace, the symlink will resolve to a file path in the local workspace, not within node_modules. I was trying to find where the value is resolved to see if I could prevent it from resolving the symlinked path but no luck. |
It might work with |
Currently it doesn't seem to with byonm. I couldn't find where Deno decides to enable In the case of workspaces, local packages are symlinked into node_modules but if you follow the link it will be a local file. So
If The Byonm resolver looks at the latter path, which does not have I don't know if Deno uses the result of this to decide if the import should have Node.js support I also couldn't find where the path was being generated, I assume that simply avoiding following the symlink when generating the filepath is enough to fix this. |
This might resolve the issues a lot of people are complaining about in this discussion - which centers around not being able to use Supabase + Deno within a symlinked workspace |
This is also a major blocker for implementing anything in a node monorepo that is purely targeted at deno e.g. |
Adds much better support for the unstable Deno workspaces as well as support for npm workspaces. npm workspaces is still lacking in that we only install packages into the root node_modules folder. We'll make it smarter over time in order for it to figure out when to add node_modules folders within packages. This includes a breaking change in config file resolution where we stop searching for config files on the first found package.json unless it's in a workspace. For the previous behaviour, the root deno.json needs to be updated to be a workspace by adding `"workspace": ["./path-to-pkg-json-folder-goes-here"]`. See details in denoland/deno_config#66 Closes denoland#24340 Closes denoland#24159 Closes denoland#24161 Closes denoland#22020 Closes denoland#18546 Closes denoland#16106 Closes denoland#24160
Noticed that we're not able to resolve local workspace module in a monorepo setup.
Steps to reproduce:
deno run packages/a/index.js
Error:
error: npm package '@marvinh/test-b' does not exist at file:///deno-workspaces/packages/a/index.js:1:28
The text was updated successfully, but these errors were encountered: