Repository: denoland/deno
Pull request: fix: do not purge lockfile when linking and the linked package's reqs have not changed

* https://github.com/denoland/deno_lockfile/pull/60

Changed files:
filename: Cargo.lock
patch: @@ -1631,7 +1631,7 @@ dependencies = [
  "deno_lint",
  "deno_lockfile",
  "deno_media_type",
- "deno_npm 0.39.1",
+ "deno_npm",
  "deno_npm_cache",
  "deno_npm_installer",
  "deno_package_json",
@@ -2335,7 +2335,7 @@ dependencies = [
  "deno_fs",
  "deno_media_type",
  "deno_node",
- "deno_npm 0.39.1",
+ "deno_npm",
  "deno_npm_installer",
  "deno_path_util",
  "deno_resolver",
@@ -2378,9 +2378,9 @@ dependencies = [
 
 [[package]]
 name = "deno_lockfile"
-version = "0.31.2"
+version = "0.32.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5afb20b44a44842178f41fa3b713c2b1516062590b5cca2ad792f2d6786bc74f"
+checksum = "79df4fa29c2e423822bfef1ab5e83093b48481824d5ef7a61c1de1c32c7c302a"
 dependencies = [
  "async-trait",
  "deno_semver",
@@ -2559,30 +2559,9 @@ dependencies = [
 
 [[package]]
 name = "deno_npm"
-version = "0.38.1"
+version = "0.40.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "80af8018f8ba59cb1b2da276e55b3765c5ac66181dc59c4bd724aa19cfbb3134"
-dependencies = [
- "async-trait",
- "capacity_builder",
- "deno_error",
- "deno_lockfile",
- "deno_semver",
- "futures",
- "indexmap 2.9.0",
- "log",
- "monch",
- "serde",
- "serde_json",
- "thiserror 2.0.12",
- "url",
-]
-
-[[package]]
-name = "deno_npm"
-version = "0.39.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0470f809b73b0d936ff0df40f042a5c8e3c687d1118a174f44e967e0c075364b"
+checksum = "b02b19a640f1cf89d90e8eb2e099c858d9923e196acc897387318d40c324c24e"
 dependencies = [
  "async-trait",
  "capacity_builder",
@@ -2609,7 +2588,7 @@ dependencies = [
  "boxed_error",
  "deno_cache_dir",
  "deno_error",
- "deno_npm 0.39.1",
+ "deno_npm",
  "deno_path_util",
  "deno_semver",
  "deno_unsync",
@@ -2645,7 +2624,7 @@ dependencies = [
  "deno_error",
  "deno_graph",
  "deno_lockfile",
- "deno_npm 0.39.1",
+ "deno_npm",
  "deno_npm_cache",
  "deno_package_json",
  "deno_path_util",
@@ -2824,7 +2803,7 @@ dependencies = [
  "deno_lockfile",
  "deno_maybe_sync",
  "deno_media_type",
- "deno_npm 0.39.1",
+ "deno_npm",
  "deno_package_json",
  "deno_path_util",
  "deno_permissions",
@@ -3287,7 +3266,7 @@ dependencies = [
  "deno_error",
  "deno_lib",
  "deno_media_type",
- "deno_npm 0.39.1",
+ "deno_npm",
  "deno_package_json",
  "deno_path_util",
  "deno_resolver",
@@ -3972,17 +3951,17 @@ dependencies = [
 
 [[package]]
 name = "eszip"
-version = "0.100.0"
+version = "0.101.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c16339a0280af1d85d4e14bdf411d4160b2c03e0418719183cc469d1feaad7f"
+checksum = "b9810ce37bf4fccdc4d7a00bb68ced2dfecce6cab4ee3b142e049ab406972bf4"
 dependencies = [
  "anyhow",
  "async-trait",
  "base64 0.21.7",
  "deno_ast",
  "deno_error",
  "deno_graph",
- "deno_npm 0.38.1",
+ "deno_npm",
  "deno_semver",
  "futures",
  "hashlink 0.8.4",

filename: Cargo.toml
patch: @@ -69,17 +69,17 @@ deno_doc = "=0.184.0"
 deno_error = "=0.7.0"
 deno_graph = { version = "=0.101.0", default-features = false }
 deno_lint = "=0.80.0"
-deno_lockfile = "=0.31.2"
+deno_lockfile = "=0.32.0"
 deno_media_type = { version = "=0.2.9", features = ["module_specifier"] }
 deno_native_certs = "0.3.0"
-deno_npm = "=0.39.1"
+deno_npm = "=0.40.0"
 deno_path_util = "=0.6.1"
 deno_semver = "=0.9.0"
 deno_task_shell = "=0.26.0"
 deno_terminal = "=0.2.2"
 deno_unsync = { version = "0.4.4", default-features = false }
 deno_whoami = "0.1.0"
-eszip = "=0.100.0"
+eszip = "=0.101.0"
 
 denokv_proto = "0.12.0"
 denokv_remote = "0.12.0"

filename: libs/resolver/lockfile.rs
patch: @@ -427,6 +427,9 @@ impl<TSys: LockfileSys> LockfileLock<TSys> {
           // the npm resolution when it changes
           let value = deno_lockfile::LockfileLinkContent {
             dependencies: collect_deps(pkg_json.dependencies.as_ref()),
+            optional_dependencies: collect_deps(
+              pkg_json.optional_dependencies.as_ref(),
+            ),
             peer_dependencies: collect_deps(
               pkg_json.peer_dependencies.as_ref(),
             ),
@@ -451,6 +454,7 @@ impl<TSys: LockfileSys> LockfileLock<TSys> {
           .unwrap();
           let value = deno_lockfile::LockfileLinkContent {
             dependencies: deno_json.dependencies(),
+            optional_dependencies: Default::default(),
             peer_dependencies: Default::default(),
             peer_dependencies_meta: Default::default(),
           };

filename: tests/specs/jsr/link_lockfile_changes/add/deno.json
patch: @@ -1,4 +1,7 @@
 {
   "name": "@denotest/add",
-  "exports": "./mod.ts"
+  "exports": "./mod.ts",
+  "imports": {
+    "@denotest/subtract": "jsr:@denotest/subtract"
+  }
 }

filename: tests/specs/jsr/link_lockfile_changes/lockfile2.out
patch: @@ -1,11 +1,23 @@
 {
   "version": "5",
+  "specifiers": {
+    "jsr:@denotest/subtract@*": "1.0.0"
+  },
+  "jsr": {
+    "@denotest/subtract@1.0.0": {
+      "integrity": "e178a7101c073e93d9efa6833d5cbf83bc1bc8d509b7c2a5ecbf74265e917597"
+    }
+  },
   "workspace": {
     "dependencies": [
       "jsr:@denotest/add@*"
     ],
     "links": {
-      "jsr:@denotest/add": {}
+      "jsr:@denotest/add": {
+        "dependencies": [
+          "jsr:@denotest/subtract@*"
+        ]
+      }
     }
   }
 }