Commit 653bc3d
committed
feat(reporter): emit pnpm:lifecycle and pnpm:ignored-scripts
Match upstream's NDJSON wire format for the build phase so
@pnpm/cli.default-reporter parses pacquet's lifecycle output the same
way it parses pnpm's.
- Add `LogEvent::Lifecycle(LifecycleLog)` with the three upstream
message shapes (Script, Stdio, Exit) as a `#[serde(untagged)]`
union, mirroring `core/core-loggers/src/lifecycleLogger.ts`.
- Add `LogEvent::IgnoredScripts(IgnoredScriptsLog)` carrying
`packageNames` (camelCase), mirroring `ignoredScriptsLogger.ts`.
- `pacquet-executor` depends on `pacquet-reporter`. `run_postinstall_hooks`
/ `run_lifecycle_hook` are now generic over `R: Reporter`. The hook
switches from `Stdio::inherit()` to `Stdio::piped()` and reads each
stream on its own thread, emitting one `Stdio` event per line. A
`Script` event fires before spawn, `Exit` fires after wait — same
ordering as `runLifecycleHook.ts:102/165`.
- `BuildModules::run::<R>` collects sorted (peer-stripped) keys of
packages that hit the "not in allowBuilds" branch and returns them
as `Vec<String>`. Explicit `false` is silently skipped, matching
upstream's switch in `building/during-install/src/index.ts:88-101`.
- `InstallFrozenLockfile::run` emits one `pnpm:ignored-scripts` event
with the returned list (always, even when empty) — mirrors the
unconditional emit at `installing/deps-installer/src/install/index.ts:414`.
Tests:
- Wire-shape tests for both new variants pin the JSON output.
- Recording-fake tests for `run_postinstall_hooks` cover Script→Stdio→Exit
ordering and non-zero exit propagation.
- Recording-fake tests for `BuildModules::run` cover the ignored-builds
return value (sorted, peer-stripped, excludes explicit-deny).
- Updated `install_emits_pnpm_event_sequence` to expect the new
`IgnoredScripts` event between `Stats` and `ImportingDone`.
Addresses items pnpm#6 and pnpm#8 from pnpm#397.
Upstream refs at `pnpm/pnpm@80037699fb`:
- core/core-loggers/src/lifecycleLogger.ts
- core/core-loggers/src/ignoredScriptsLogger.ts
- exec/lifecycle/src/runLifecycleHook.ts
- building/during-install/src/index.ts
- installing/deps-installer/src/install/index.ts1 parent 5f56842 commit 653bc3d
11 files changed
Lines changed: 747 additions & 53 deletions
File tree
- crates
- executor
- src
- lifecycle
- package-manager/src
- build_modules
- build_sequence
- install
- reporter/src
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
3 | 6 | | |
4 | 7 | | |
5 | 8 | | |
6 | 9 | | |
| 10 | + | |
7 | 11 | | |
8 | 12 | | |
| 13 | + | |
9 | 14 | | |
10 | 15 | | |
11 | 16 | | |
| |||
71 | 76 | | |
72 | 77 | | |
73 | 78 | | |
74 | | - | |
| 79 | + | |
75 | 80 | | |
76 | 81 | | |
77 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
78 | 85 | | |
79 | 86 | | |
80 | 87 | | |
| |||
97 | 104 | | |
98 | 105 | | |
99 | 106 | | |
100 | | - | |
| 107 | + | |
101 | 108 | | |
102 | 109 | | |
103 | 110 | | |
| |||
111 | 118 | | |
112 | 119 | | |
113 | 120 | | |
114 | | - | |
| 121 | + | |
115 | 122 | | |
116 | 123 | | |
117 | 124 | | |
118 | 125 | | |
119 | | - | |
| 126 | + | |
120 | 127 | | |
121 | 128 | | |
122 | 129 | | |
123 | 130 | | |
124 | 131 | | |
125 | 132 | | |
126 | | - | |
| 133 | + | |
127 | 134 | | |
128 | 135 | | |
129 | | - | |
130 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
131 | 142 | | |
132 | 143 | | |
133 | 144 | | |
| |||
140 | 151 | | |
141 | 152 | | |
142 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
143 | 169 | | |
144 | 170 | | |
145 | 171 | | |
| |||
149 | 175 | | |
150 | 176 | | |
151 | 177 | | |
152 | | - | |
153 | | - | |
| 178 | + | |
| 179 | + | |
154 | 180 | | |
155 | 181 | | |
156 | 182 | | |
157 | 183 | | |
158 | 184 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
168 | 221 | | |
| 222 | + | |
| 223 | + | |
169 | 224 | | |
170 | | - | |
171 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
172 | 228 | | |
173 | 229 | | |
174 | 230 | | |
| |||
182 | 238 | | |
183 | 239 | | |
184 | 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 | + | |
| 277 | + | |
| 278 | + | |
185 | 279 | | |
186 | 280 | | |
187 | 281 | | |
| |||
199 | 293 | | |
200 | 294 | | |
201 | 295 | | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
0 commit comments