-
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
feat(unstable): Workspaces support #20410
Conversation
This PR looks very promising! I'm currently fighting mono-repo issues and the thing that kinda messes with it is the missing support for multiple Are there bigger blockers preventing this PR from a merge to the main branch? Would love to try it out in the near future. |
Nice work @bartlomieju! Is it still WIP? |
Yes, it's still a WIP, but we aim to land it before EOY. |
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.
It's looking good, but let's add some tests for some more error cases.
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.
LGTM. Exciting!
This commit adds unstable workspace support. This is extremely bare-bones and minimal first-pass at this. With this change `deno.json` supports specifying `workspaces` key, that accepts a list of subdirectories. Each workspace can have its own import map. It's required to specify a `"name"` and `"version"` properties in the configuration file for the workspace: ```jsonc // deno.json { "workspaces": [ "a", "b" }, "imports": { "express": "npm:express@5" } } ``` ``` jsonc // a/deno.json { "name": "a", "version": "1.0.2", "imports": { "kleur": "npm:kleur" } } ``` ```jsonc // b/deno.json { "name": "b", "version": "0.51.0", "imports": { "chalk": "npm:chalk" } } ``` `--unstable-workspaces` flag is required to use this feature: ``` $ deno run --unstable-workspaces mod.ts ``` --------- Co-authored-by: David Sherret <[email protected]>
This commit adds unstable workspace support. This is extremely bare-bones and minimal first-pass at this. With this change `deno.json` supports specifying `workspaces` key, that accepts a list of subdirectories. Each workspace can have its own import map. It's required to specify a `"name"` and `"version"` properties in the configuration file for the workspace: ```jsonc // deno.json { "workspaces": [ "a", "b" }, "imports": { "express": "npm:express@5" } } ``` ``` jsonc // a/deno.json { "name": "a", "version": "1.0.2", "imports": { "kleur": "npm:kleur" } } ``` ```jsonc // b/deno.json { "name": "b", "version": "0.51.0", "imports": { "chalk": "npm:chalk" } } ``` `--unstable-workspaces` flag is required to use this feature: ``` $ deno run --unstable-workspaces mod.ts ``` --------- Co-authored-by: David Sherret <[email protected]>
Nice @bartlomieju! I Just tested this and it's exactly what i want for a Monorepo. But the LSP does not seem to understand how to resolve the imports correctly yet and I have squiggly lines under my imports from the import_maps in vs-code. Is this something being worked on? |
@igl could you open a new issue with some reproduction code for your use case? I think this is an outright bug that needs to be squashed. |
|
This commit adds unstable workspace support. This is extremely bare-bones and
minimal first-pass at this.
With this change
deno.json
supports specifyingworkspaces
key, thataccepts a list of subdirectories. Each workspace can have its own import map.
It's required to specify a
"name"
and"version"
properties in the configurationfile for the workspace:
--unstable-workspaces
flag is required to use this feature: