From 53e974b276b095faf52918c4c6e988e9d2788cef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 10 Nov 2022 17:57:10 +0100 Subject: feat: remove --unstable flag requirement for npm: specifiers (#16473) This commit makes "npm:" specifiers not require "--unstable" flag. At the moment some APIs used by Node polyfills still require "--unstable" which will be addressed in follow up PRs. --- cli/npm/resolvers/mod.rs | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'cli/npm/resolvers/mod.rs') diff --git a/cli/npm/resolvers/mod.rs b/cli/npm/resolvers/mod.rs index 6cd40594b..bc6cb4060 100644 --- a/cli/npm/resolvers/mod.rs +++ b/cli/npm/resolvers/mod.rs @@ -68,7 +68,6 @@ impl NpmProcessState { #[derive(Clone)] pub struct NpmPackageResolver { - unstable: bool, no_npm: bool, inner: Arc, local_node_modules_path: Option, @@ -80,7 +79,6 @@ pub struct NpmPackageResolver { impl std::fmt::Debug for NpmPackageResolver { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("NpmPackageResolver") - .field("unstable", &self.unstable) .field("no_npm", &self.no_npm) .field("inner", &"") .field("local_node_modules_path", &self.local_node_modules_path) @@ -92,14 +90,12 @@ impl NpmPackageResolver { pub fn new( cache: NpmCache, api: RealNpmRegistryApi, - unstable: bool, no_npm: bool, local_node_modules_path: Option, ) -> Self { Self::new_with_maybe_snapshot( cache, api, - unstable, no_npm, local_node_modules_path, None, @@ -142,7 +138,6 @@ impl NpmPackageResolver { fn new_with_maybe_snapshot( cache: NpmCache, api: RealNpmRegistryApi, - unstable: bool, no_npm: bool, local_node_modules_path: Option, initial_snapshot: Option, @@ -170,7 +165,6 @@ impl NpmPackageResolver { )), }; Self { - unstable, no_npm, inner, local_node_modules_path, @@ -250,12 +244,6 @@ impl NpmPackageResolver { return Ok(()); } - if !self.unstable { - bail!( - "Unstable use of npm specifiers. The --unstable flag must be provided." - ) - } - if self.no_npm { let fmt_reqs = packages .iter() @@ -315,7 +303,6 @@ impl NpmPackageResolver { Self::new_with_maybe_snapshot( self.cache.clone(), self.api.clone(), - self.unstable, self.no_npm, self.local_node_modules_path.clone(), Some(self.snapshot()), -- cgit v1.2.3