Commit e44a2bd
chore(release): stop mutating global registry config in local-registry (#5922)
## What
`pnpm local-registry` (the local Verdaccio helper for release testing)
no longer redirects the global `npm` and `pnpm` registry config to
`localhost:4873` on startup, and no longer needs to restore it on
shutdown. The cleanup handler now just kills Verdaccio, and additionally
handles `SIGHUP` so closing the terminal window doesn't orphan the
server. `CONTRIBUTING.md` is updated to match, and the troubleshooting
table now covers recovering from the stale override left behind by older
versions of the script.
## Why
The restore path had holes that could leave a developer's machine
pointed at a dead localhost registry, making every subsequent `pnpm i`
fail:
- The Verdaccio-crash path called `process.exit(1)` without restoring
the registry.
- `SIGHUP` (closing the terminal) wasn't handled, so no cleanup ran at
all.
- A partial restore failure only printed a warning, right as the
terminal session was being torn down.
This bit for real: pnpm persists the override in its own global config
(`~/Library/Preferences/pnpm/auth.ini` on macOS) rather than `~/.npmrc`,
so an `~/.npmrc`-focused manual cleanup makes npm look healthy while
pnpm silently keeps resolving from `localhost:4873`.
The global redirect was also unnecessary: `local-release.ts` already
passes `--registry` explicitly to every publish command and writes a
scoped `.npmrc` (with the auth token) into its temp publish dir, and the
suggested `npx` / `npm install -g` smoke-test commands carry the flag
too. With the redirect gone, there is no cleanup left to get wrong — a
crash or hard kill can no longer corrupt the developer's registry
config.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent 11f31dd commit e44a2bd
2 files changed
Lines changed: 14 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | | - | |
| 273 | + | |
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | | - | |
| 313 | + | |
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | | - | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | 85 | | |
93 | 86 | | |
94 | 87 | | |
| |||
134 | 127 | | |
135 | 128 | | |
136 | 129 | | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | 130 | | |
145 | 131 | | |
146 | 132 | | |
| |||
150 | 136 | | |
151 | 137 | | |
152 | 138 | | |
153 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
154 | 143 | | |
155 | 144 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
| 145 | + | |
| 146 | + | |
169 | 147 | | |
170 | 148 | | |
171 | 149 | | |
172 | 150 | | |
173 | 151 | | |
174 | 152 | | |
| 153 | + | |
175 | 154 | | |
176 | 155 | | |
177 | 156 | | |
| |||
0 commit comments