Commit 950a2d5
authored
* fix(npm): use PowerShell Expand-Archive on Windows
Windows lacks the unzip command, so the postinstall extraction silently
failed and stacklit.exe never landed in npm/bin/. Switch to
Expand-Archive (ships with Windows 10+) for .zip on win32, surface
extraction output via stdio inherit, and fail loudly when the binary is
missing after extraction.
Closes #32
* docs: align config docs with .stacklitrc.json
The README and USAGE guide showed a TOML schema, but the loader in
internal/config reads .stacklitrc.json. Update both docs to JSON so the
example matches the file the tool actually loads.
Closes #34
* fix(npm): harden Windows install against quoting and silent failures
Address PR review feedback from Copilot:
- Use execFileSync instead of execSync for all extraction commands so
paths are passed as args, never interpolated into a shell string. The
original PowerShell command wrapped paths in single quotes inside a
double-quoted string, so a single quote in __dirname (e.g.
C:\\Users\\O'Connor\\...) would have broken parsing or altered the
command.
- On Windows, hand the archive and bin paths to PowerShell via env vars
($env:STACKLIT_ARCHIVE / $env:STACKLIT_BINDIR) and use -LiteralPath
so the script body has no string interpolation at all.
- Move archive.tmp cleanup into a finally so a failed extraction doesn't
leave the temp file behind.
- Set process.exitCode = 1 in the top-level catch so npm postinstall
reports a non-zero status when extraction fails or the binary is
missing afterward. Download failures still return silently, matching
the existing 'let the bin script show a helpful error' behavior.
* chore: revert unintended stacklit.json regeneration
The post-commit hook regenerated stacklit.json (new merkle hash and
timestamp) when committing the npm fix. That regeneration is unrelated
to this PR's scope, so revert it to keep the diff focused on
npm/install.js.
3 files changed
Lines changed: 73 additions & 42 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
271 | 271 | | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
280 | 282 | | |
281 | 283 | | |
282 | 284 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
175 | 169 | | |
176 | 170 | | |
| 171 | + | |
| 172 | + | |
177 | 173 | | |
178 | 174 | | |
179 | 175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
| 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 | + | |
90 | 123 | | |
91 | 124 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | 125 | | |
96 | 126 | | |
97 | 127 | | |
98 | 128 | | |
99 | 129 | | |
100 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
101 | 134 | | |
0 commit comments