summaryrefslogtreecommitdiff
path: root/cli/worker.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-07-03 20:54:33 -0400
committerGitHub <noreply@github.com>2024-07-04 00:54:33 +0000
commit147411e64b22fe74cb258125acab83f9182c9f81 (patch)
treea1f63dcbf0404c20534986b10f02b649df5a3ad5 /cli/worker.rs
parentdd6d19e12051fac2ea5639f621501f4710a1b8e1 (diff)
feat: npm workspace and better Deno workspace support (#24334)
Adds much better support for the unstable Deno workspaces as well as support for npm workspaces. npm workspaces is still lacking in that we only install packages into the root node_modules folder. We'll make it smarter over time in order for it to figure out when to add node_modules folders within packages. This includes a breaking change in config file resolution where we stop searching for config files on the first found package.json unless it's in a workspace. For the previous behaviour, the root deno.json needs to be updated to be a workspace by adding `"workspace": ["./path-to-pkg-json-folder-goes-here"]`. See details in https://github.com/denoland/deno_config/pull/66 Closes #24340 Closes #24159 Closes #24161 Closes #22020 Closes #18546 Closes #16106 Closes #24160
Diffstat (limited to 'cli/worker.rs')
-rw-r--r--cli/worker.rs26
1 files changed, 0 insertions, 26 deletions
diff --git a/cli/worker.rs b/cli/worker.rs
index 00a20ab4d..987d65192 100644
--- a/cli/worker.rs
+++ b/cli/worker.rs
@@ -6,7 +6,6 @@ use std::rc::Rc;
use std::sync::Arc;
use deno_ast::ModuleSpecifier;
-use deno_config::package_json::PackageJsonDeps;
use deno_core::anyhow::bail;
use deno_core::error::AnyError;
use deno_core::futures::FutureExt;
@@ -41,7 +40,6 @@ use deno_runtime::BootstrapOptions;
use deno_runtime::WorkerExecutionMode;
use deno_runtime::WorkerLogLevel;
use deno_semver::npm::NpmPackageReqReference;
-use deno_semver::package::PackageReqReference;
use deno_terminal::colors;
use tokio::select;
@@ -117,7 +115,6 @@ pub struct CliMainWorkerOptions {
pub unsafely_ignore_certificate_errors: Option<Vec<String>>,
pub unstable: bool,
pub skip_op_registration: bool,
- pub maybe_root_package_json_deps: Option<PackageJsonDeps>,
pub create_hmr_runner: Option<CreateHmrRunnerCb>,
pub create_coverage_collector: Option<CreateCoverageCollectorCb>,
}
@@ -479,29 +476,6 @@ impl CliMainWorkerFactory {
let (main_module, is_main_cjs) = if let Ok(package_ref) =
NpmPackageReqReference::from_specifier(&main_module)
{
- let package_ref = if package_ref.req().version_req.version_text() == "*" {
- // When using the wildcard version, select the same version used in the
- // package.json deps in order to prevent adding new dependency version
- shared
- .options
- .maybe_root_package_json_deps
- .as_ref()
- .and_then(|deps| {
- deps
- .values()
- .filter_map(|v| v.as_ref().ok())
- .find(|dep| dep.name == package_ref.req().name)
- .map(|dep| {
- NpmPackageReqReference::new(PackageReqReference {
- req: dep.clone(),
- sub_path: package_ref.sub_path().map(|s| s.to_string()),
- })
- })
- })
- .unwrap_or(package_ref)
- } else {
- package_ref
- };
if let Some(npm_resolver) = shared.npm_resolver.as_managed() {
npm_resolver
.add_package_reqs(&[package_ref.req().clone()])