Commit 43711ce
fix(outdated): skip local lockfile refs (#12834)
`pnpm outdated` now skips dependencies whose lockfile ref is local (`link:`, `file:`, or `workspace:`), even when the manifest specifier is a plain semver range.
This covers workspace-linked packages such as:
```yaml
devDependencies:
private-workspace-pkg:
specifier: ^1.0.0
version: link:../private-workspace-pkg
```
In that shape the dependency is already resolved locally, so asking the registry for a latest version can fail for private workspace packages that are not published. Refs #12827.
Follow-up commits after review:
- The local-ref early return runs before any other per-dependency work, and the `isLocalRef` helper documents why local refs have no registry "latest".
- Added a test locking in the other side of the behavior: a dependency whose *current* ref is local but whose *wanted* ref is a registry version is still checked and reported (addresses CodeRabbit's suggestion).
- **pacquet parity:** pacquet's `outdated` already skips local refs — `ImporterDepVersion::ver_peer()` returns `None` for `link:`/`file:`, so `collect_outdated` drops those deps before any registry fetch. This PR adds a Rust test (`current_versions_omit_local_refs`) proving that behavior, so both stacks now cover the same scenario. No pacquet behavior change was needed; the TypeScript fix brings pnpm in line with pacquet.
---------
Co-authored-by: Zoltan Kochan <zoltankochan@gmail.com>1 parent a897ef7 commit 43711ceCopy full SHA for 43711ce
6 files changed
+166-3Lines changed: 166 additions & 3 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- .changeset
- pacquet/crates/cli
- src/cli_args/outdated
- pnpm11/deps/inspection/outdated
- src
- test
Expand file treeCollapse file tree
Open diff view settings
Collapse file
.changeset/outdated-skip-local-links.md
Copy file name to clipboard+6Lines changed: 6 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
Collapse file
+1Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file
pacquet/crates/cli/Cargo.toml
Copy file name to clipboardExpand all lines: pacquet/crates/cli/Cargo.toml+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
102 | 102 | |
103 | 103 | |
104 | 104 | |
| 105 | + |
105 | 106 | |
106 | 107 | |
107 | 108 | |
|
Collapse file
pacquet/crates/cli/src/cli_args/outdated/tests.rs
Copy file name to clipboardExpand all lines: pacquet/crates/cli/src/cli_args/outdated/tests.rs+36-2Lines changed: 36 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | | - |
3 | | - |
| 2 | + |
| 3 | + |
4 | 4 | |
5 | 5 | |
| 6 | + |
6 | 7 | |
| 8 | + |
| 9 | + |
7 | 10 | |
8 | 11 | |
9 | 12 | |
| ||
21 | 24 | |
22 | 25 | |
23 | 26 | |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
24 | 58 | |
25 | 59 | |
26 | 60 | |
|
Collapse file
pnpm11/deps/inspection/outdated/src/outdated.ts
Copy file name to clipboardExpand all lines: pnpm11/deps/inspection/outdated/src/outdated.ts+10Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
114 | 114 | |
115 | 115 | |
116 | 116 | |
| 117 | + |
117 | 118 | |
118 | 119 | |
119 | 120 | |
| ||
196 | 197 | |
197 | 198 | |
198 | 199 | |
| 200 | + |
| 201 | + |
| 202 | + |
| 203 | + |
| 204 | + |
| 205 | + |
| 206 | + |
| 207 | + |
| 208 | + |
199 | 209 | |
200 | 210 | |
201 | 211 | |
|
Collapse file
pnpm11/deps/inspection/outdated/test/outdated.spec.ts
Copy file name to clipboardExpand all lines: pnpm11/deps/inspection/outdated/test/outdated.spec.ts+112-1Lines changed: 112 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | | - |
| 1 | + |
2 | 2 | |
3 | 3 | |
4 | 4 | |
| ||
62 | 62 | |
63 | 63 | |
64 | 64 | |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | + |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | + |
| 125 | + |
| 126 | + |
| 127 | + |
| 128 | + |
| 129 | + |
| 130 | + |
| 131 | + |
| 132 | + |
| 133 | + |
| 134 | + |
| 135 | + |
| 136 | + |
| 137 | + |
| 138 | + |
| 139 | + |
| 140 | + |
| 141 | + |
| 142 | + |
| 143 | + |
| 144 | + |
| 145 | + |
| 146 | + |
| 147 | + |
| 148 | + |
| 149 | + |
| 150 | + |
| 151 | + |
| 152 | + |
| 153 | + |
| 154 | + |
| 155 | + |
| 156 | + |
| 157 | + |
| 158 | + |
| 159 | + |
| 160 | + |
| 161 | + |
| 162 | + |
| 163 | + |
| 164 | + |
| 165 | + |
| 166 | + |
| 167 | + |
| 168 | + |
| 169 | + |
| 170 | + |
| 171 | + |
| 172 | + |
| 173 | + |
| 174 | + |
| 175 | + |
65 | 176 | |
66 | 177 | |
67 | 178 | |
|
0 commit comments