Open mattjennings opened 3 weeks ago
ah, it appears imports for workspace projects don't need to be defined as per https://docs.deno.com/runtime/fundamentals/workspaces/. That solves my initial problem at least.
Just some small documentation feedback since I missed it on the first read, I think this part
In the add/ subdirectory, we define a deno.json with a "name" field, which is important for referencing the workspace member.
would be worth changing to highlight imports are automatically setup using these too, as it was this block further down that finally clarified it to me
- By using name and version options in members' deno.json files, it's possible to refer to them using "bare specifiers" across the whole workspace. In this case, the packages are named @scope/add and @scope/subtract, where scope is the "scope" name you can choose. With these two options, it's not necessary to use long and relative file paths in import statements.
I might be totally misconfiguring things. Saw the Deno 2.0 announcement and decided to try migrating a small npm monorepo to Deno, but ran into a panic when configuring an import to another project in the workspace.
Repro:
deno
branch from https://github.com/mattjennings/game-engine-2/tree/denodeno install
examples/deno
and rundeno run dev
Output:
This is from a
file://
import inexample/deno/deno.json
Removing
file://
avoids the panic, but it still fails to find the project, so I'm probably misconfiguring something here.Let me know if there's any more info you need.