summaryrefslogtreecommitdiff
path: root/cli/tools/registry/pm.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-06-26 17:24:10 -0400
committerGitHub <noreply@github.com>2024-06-26 21:24:10 +0000
commit0da01c0ca6b537f74be32126e567bdfc2c73ed16 (patch)
treeef29d32cffb03a975a58c16827b0691dda50a5b3 /cli/tools/registry/pm.rs
parent86e0292733d6d08bf338b68fd50863aef17b1e44 (diff)
refactor: move PackageJson to deno_config (#24348)
Diffstat (limited to 'cli/tools/registry/pm.rs')
-rw-r--r--cli/tools/registry/pm.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/tools/registry/pm.rs b/cli/tools/registry/pm.rs
index 40493c6bf..4fdc02550 100644
--- a/cli/tools/registry/pm.rs
+++ b/cli/tools/registry/pm.rs
@@ -50,7 +50,7 @@ impl DenoConfigFormat {
enum DenoOrPackageJson {
Deno(deno_config::ConfigFile, DenoConfigFormat),
- Npm(deno_node::PackageJson, Option<FmtOptionsConfig>),
+ Npm(Arc<deno_node::PackageJson>, Option<FmtOptionsConfig>),
}
impl DenoOrPackageJson {
@@ -306,8 +306,8 @@ pub async fn add(flags: Flags, add_flags: AddFlags) -> Result<(), AnyError> {
.await
.context("Failed to update configuration file")?;
- // TODO(bartlomieju): we should now cache the imports from the deno.json.
-
+ // clear the previously cached package.json from memory before reloading it
+ deno_node::PackageJsonThreadLocalCache::clear();
// make a new CliFactory to pick up the updated config file
let cli_factory = CliFactory::from_flags(flags)?;
// cache deps