hosiH
Deno15mo ago
hosi

`deno install` installs workspace members' npm dependencies, but not jsr dependencies?

In a monorepo setup, does
deno install
install the dependencies of workspace members?

I couldn't find any mention of this behavior in either the
deno install
documentation or the workspace documentation, so I'm unsure if this is the expected behavior.

Consider the following monorepo structure:

.
├── deno.json
└── packages
    ├── bar
    │   └── deno.json
    └── foo
        └── deno.json


The contents of each file are as follows:

// deno.json
{
  "workspaces": ["packages/foo", "packages/bar"],
  "vendor": true,
  "nodeModulesDir": "auto"
}

// packages/foo/deno.json
{
  "imports": {
    "@std/encoding": "jsr:@std/encoding@^1.0.5"
  }
}

// packages/bar/deno.json
{
  "imports": {
    "chalk": "npm:chalk@^5.3.0"
  }
}


When I run
deno install
in the root directory, a
node_modules
folder is created there, and
chalk
is installed, but no
vendor
directory is created, and
@std/encoding
isn't installed.

Is this the expected behavior? In other words, is it by design that running
deno install
in the root directory installs npm dependencies from workspace members but does not install jsr dependencies?
Was this page helpful?