diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-09-04 16:00:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-04 14:00:44 +0000 |
commit | c6d1b0a1ccf45b7819b1e6f1efe8687b240f495a (patch) | |
tree | 6be2c0c611e4aee950402a34aaedd1c9b6bcaac3 /cli/factory.rs | |
parent | 13911eb8efb77bd14a80412072aecb664aa55fd5 (diff) |
fix(byonm): resolve npm deps of jsr deps (#25399)
This allows using npm deps of jsr deps without having to add them to the
root package.json.
Works by taking the package requirement and scanning the
`node_modules/.deno` directory for the best matching package, so it
relies on deno's node_modules structure.
Additionally to make the transition from package.json to deno.json
easier, Deno now:
1. Installs npm deps in a deno.json at the same time as installing npm
deps from a package.json.
2. Uses the alias in the import map for `node_modules/<alias>` for
better package.json compatiblity.
Diffstat (limited to 'cli/factory.rs')
-rw-r--r-- | cli/factory.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/cli/factory.rs b/cli/factory.rs index d1ccac6ce..421553058 100644 --- a/cli/factory.rs +++ b/cli/factory.rs @@ -5,7 +5,7 @@ use crate::args::CaData; use crate::args::CliOptions; use crate::args::DenoSubcommand; use crate::args::Flags; -use crate::args::PackageJsonInstallDepsProvider; +use crate::args::NpmInstallDepsProvider; use crate::args::StorageKeyResolver; use crate::args::TsConfigType; use crate::cache::Caches; @@ -386,9 +386,7 @@ impl CliFactory { cache_setting: cli_options.cache_setting(), text_only_progress_bar: self.text_only_progress_bar().clone(), maybe_node_modules_path: cli_options.node_modules_dir_path().cloned(), - package_json_deps_provider: Arc::new(PackageJsonInstallDepsProvider::from_workspace( - cli_options.workspace(), - )), + npm_install_deps_provider: Arc::new(NpmInstallDepsProvider::from_workspace(cli_options.workspace())), npm_system_info: cli_options.npm_system_info(), npmrc: cli_options.npmrc().clone(), lifecycle_scripts: cli_options.lifecycle_scripts_config(), |