Commit 6a85968
authored
feat(pacquet): port the stage command and add its -/stage endpoints to pnpr (#12922)
Port `pnpm stage` (publish, list, view, approve, reject, download) to the
Rust CLI, mirroring the TypeScript command's flags, error codes, endpoints,
and output. `stage publish` reuses the publish pipeline (PublishArgs is
split into a reusable PublishFlags, and the pipeline returns summaries
instead of printing); approve/reject drive the shared OTP / web-auth flow;
download summarizes the tarball with the same traversal protections as
the TypeScript implementation. Also fixes the staged-publish route in
pacquet-publish to POST -/stage/package/:pkg (libnpmpublish's stage route)
instead of the regular packument PUT — previously unreachable because the
CLI hardcoded stage: false.
pnpr grows the server half: POST /-/stage/package/:pkg validates and
authorizes like a direct publish and holds the document under a UUID;
list/view/tarball inspect held records; approve replays the document
through the regular validate/stage/commit flow; reject deletes it. Records
persist under a reserved .staged/ namespace on the fs and S3 backends,
with stage-id validation ahead of any path or object key.
Shared plumbing: the capped response-body reader moves from the dist-tag
command into pacquet-network, and pacquet-pack exports its en-locale path
sort for the tarball summary.
Also fixes a broken test on main (semantic conflict between
#12910 and #12914): State::init no longer persists a
scaffolded root package.json when a pnpm-workspace.yaml sits next to the
missing manifest, so a verify-deps-before-run install can't turn the
workspace root into a selectable project with the init template's failing
test script.1 parent 84e3d3b commit 6a85968Copy full SHA for 6a85968
32 files changed
+3,559-218Lines changed: 3559 additions & 218 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- .changeset
- pnpm11/releasing/commands
- src/stage
- test
- pnpm/crates
- cli
- src
- cli_args
- publish
- stage
- tests
- network/src
- package-manifest/src
- pack/src
- publish/src
- publish_packed_pkg
- pnpr/crates/pnpr
- src
- server
- staged
- tests
Expand file treeCollapse file tree
Open diff view settings
Collapse file
.changeset/stage-list-page-cap.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
+3-3Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
31 | 31 | |
32 | 32 | |
33 | 33 | |
| 34 | + |
34 | 35 | |
35 | 36 | |
36 | 37 | |
| ||
61 | 62 | |
62 | 63 | |
63 | 64 | |
| 65 | + |
64 | 66 | |
65 | 67 | |
66 | 68 | |
| ||
76 | 78 | |
77 | 79 | |
78 | 80 | |
| 81 | + |
79 | 82 | |
80 | 83 | |
81 | 84 | |
| ||
91 | 94 | |
92 | 95 | |
93 | 96 | |
94 | | - |
95 | 97 | |
96 | 98 | |
97 | 99 | |
98 | 100 | |
99 | 101 | |
100 | 102 | |
101 | 103 | |
102 | | - |
103 | 104 | |
104 | 105 | |
105 | 106 | |
106 | 107 | |
107 | | - |
108 | 108 | |
109 | 109 | |
110 | 110 | |
|
Collapse file
pnpm/crates/cli/src/cli_args.rs
Copy file name to clipboardExpand all lines: pnpm/crates/cli/src/cli_args.rs+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
55 | 55 | |
56 | 56 | |
57 | 57 | |
| 58 | + |
58 | 59 | |
59 | 60 | |
60 | 61 | |
|
Collapse file
pnpm/crates/cli/src/cli_args/cli_command.rs
Copy file name to clipboardExpand all lines: pnpm/crates/cli/src/cli_args/cli_command.rs+5-1Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
51 | 51 | |
52 | 52 | |
53 | 53 | |
| 54 | + |
54 | 55 | |
55 | 56 | |
56 | 57 | |
| ||
232 | 233 | |
233 | 234 | |
234 | 235 | |
235 | | - |
| 236 | + |
236 | 237 | |
237 | 238 | |
238 | 239 | |
| ||
287 | 288 | |
288 | 289 | |
289 | 290 | |
| 291 | + |
| 292 | + |
| 293 | + |
290 | 294 | |
291 | 295 | |
292 | 296 | |
|
Collapse file
pnpm/crates/cli/src/cli_args/dispatch.rs
Copy file name to clipboardExpand all lines: pnpm/crates/cli/src/cli_args/dispatch.rs+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
308 | 308 | |
309 | 309 | |
310 | 310 | |
| 311 | + |
311 | 312 | |
312 | 313 | |
313 | 314 | |
|
Collapse file
pnpm/crates/cli/src/cli_args/dispatch_query.rs
Copy file name to clipboardExpand all lines: pnpm/crates/cli/src/cli_args/dispatch_query.rs+41-1Lines changed: 41 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
29 | 29 | |
30 | 30 | |
31 | 31 | |
| 32 | + |
32 | 33 | |
33 | 34 | |
34 | 35 | |
| ||
224 | 225 | |
225 | 226 | |
226 | 227 | |
227 | | - |
| 228 | + |
228 | 229 | |
229 | 230 | |
230 | 231 | |
| ||
234 | 235 | |
235 | 236 | |
236 | 237 | |
| 238 | + |
| 239 | + |
| 240 | + |
| 241 | + |
| 242 | + |
| 243 | + |
| 244 | + |
| 245 | + |
| 246 | + |
| 247 | + |
| 248 | + |
| 249 | + |
| 250 | + |
| 251 | + |
| 252 | + |
| 253 | + |
| 254 | + |
| 255 | + |
| 256 | + |
| 257 | + |
| 258 | + |
| 259 | + |
| 260 | + |
| 261 | + |
| 262 | + |
| 263 | + |
| 264 | + |
| 265 | + |
| 266 | + |
| 267 | + |
| 268 | + |
| 269 | + |
| 270 | + |
| 271 | + |
| 272 | + |
| 273 | + |
| 274 | + |
| 275 | + |
| 276 | + |
237 | 277 | |
238 | 278 | |
239 | 279 | |
|
Collapse file
pnpm/crates/cli/src/cli_args/dist_tag.rs
Copy file name to clipboardExpand all lines: pnpm/crates/cli/src/cli_args/dist_tag.rs+13-41Lines changed: 13 additions & 41 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | 2 | |
3 | 3 | |
4 | | - |
5 | 4 | |
6 | 5 | |
7 | 6 | |
8 | 7 | |
9 | | - |
10 | | - |
| 8 | + |
| 9 | + |
11 | 10 | |
12 | 11 | |
13 | 12 | |
| ||
428 | 427 | |
429 | 428 | |
430 | 429 | |
431 | | - |
| 430 | + |
432 | 431 | |
433 | 432 | |
434 | 433 | |
| ||
501 | 500 | |
502 | 501 | |
503 | 502 | |
504 | | - |
505 | | - |
506 | | - |
507 | | - |
508 | | - |
509 | | - |
510 | | - |
511 | | - |
512 | | - |
513 | | - |
514 | | - |
515 | | - |
516 | | - |
517 | | - |
518 | | - |
519 | | - |
520 | | - |
521 | | - |
522 | | - |
523 | | - |
524 | | - |
525 | | - |
526 | | - |
527 | | - |
528 | | - |
529 | | - |
530 | | - |
531 | | - |
532 | | - |
533 | | - |
534 | | - |
535 | | - |
536 | | - |
537 | | - |
538 | | - |
| 503 | + |
| 504 | + |
| 505 | + |
| 506 | + |
| 507 | + |
| 508 | + |
| 509 | + |
| 510 | + |
539 | 511 | |
540 | | - |
| 512 | + |
541 | 513 | |
542 | | - |
| 514 | + |
543 | 515 | |
544 | 516 | |
545 | 517 | |
|
0 commit comments