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

Workspaces documentation is not very clear on how a project "discovers" its sibling projects #1297

Open
dmint789 opened this issue Dec 29, 2024 · 3 comments

Comments

@dmint789
Copy link

I followed the documentation for Deno workspaces here, but found that it's not very clear on how a Deno project "sees" its sibling projects to be able to import them. From my understanding, if I run a project A in a workspace that also has project B, which A imports, Deno will first look in the parent directory of the project A directory, see if there is a root deno.json file there with a workspace property, then check the projects that workspace contains, and then, seeing that there is project B specified in the workspace array, will check if project B has a deno.json file, and then will import it successfully. This means that if we are to create a Docker container for project A, we must also copy project B and the root deno.json file to it. However, these are all just my assumptions, and it would be good if all of this was clearer from the documentation.

@marvinhagemeister
Copy link
Contributor

All your assumptions are correct. A workspace is defined by the root deno.json having a workspace property.

@dmint789
Copy link
Author

@marvinhagemeister do you think the documentation could be made a bit clearer to reflect this?

@dmint789
Copy link
Author

@marvinhagemeister I also have another question: is it best to keep all projects in a single Deno workspace in the same Docker container? I'm now thinking that might be best, given how interconnected things become and that the alternative requires copying the shared project(s) and the root deno.json into each container separately.

@marvinhagemeister marvinhagemeister transferred this issue from denoland/deno Dec 29, 2024
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

No branches or pull requests

2 participants