Commit 081b94c
feat(init): add experimental warning before wizard runs (#378)
## Summary
Shows a confirm prompt when running `sentry init` warning that the
feature is experimental and may modify code. Users must explicitly agree
before the wizard proceeds. The prompt is skipped when `--yes` is passed
(non-interactive mode).
## Changes
<img width="1172" height="688" alt="Screenshot 2026-03-10 at 11 35 02"
src="https://github.com/user-attachments/assets/213e9f1c-74de-4635-bb90-42b76a9e5f55"
/>
Adds a `confirmExperimental()` helper that gates on the `--yes` flag,
and extracts a `preamble()` function from `runWizard` to bundle the TTY
check, banner, intro, experimental warning, and dry-run notice. This
also resolves the cognitive complexity lint violation that would have
been introduced by inlining the new branch.
Three new tests cover the confirm/skip/decline paths.
## Test Plan
- `bun test test/lib/init/wizard-runner.test.ts` — 22 tests pass
- `bun run lint` — clean
- Manual: `bun run cli/src/bin.ts init` shows the experimental confirm
prompt
- Manual: `bun run cli/src/bin.ts init --yes` skips it
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent db15463 commit 081b94c
File tree
2 files changed
+104
-7
lines changed- src/lib/init
- test/lib/init
2 files changed
+104
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
| |||
170 | 174 | | |
171 | 175 | | |
172 | 176 | | |
173 | | - | |
174 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
175 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
176 | 195 | | |
177 | 196 | | |
178 | 197 | | |
179 | 198 | | |
180 | 199 | | |
181 | | - | |
| 200 | + | |
182 | 201 | | |
183 | 202 | | |
184 | 203 | | |
185 | 204 | | |
186 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
187 | 213 | | |
188 | 214 | | |
189 | 215 | | |
190 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
191 | 227 | | |
192 | 228 | | |
193 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
| 128 | + | |
127 | 129 | | |
128 | 130 | | |
129 | 131 | | |
| |||
162 | 164 | | |
163 | 165 | | |
164 | 166 | | |
| 167 | + | |
165 | 168 | | |
166 | 169 | | |
167 | 170 | | |
| |||
218 | 221 | | |
219 | 222 | | |
220 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 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 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
221 | 280 | | |
222 | 281 | | |
223 | 282 | | |
| |||
243 | 302 | | |
244 | 303 | | |
245 | 304 | | |
246 | | - | |
247 | | - | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
248 | 309 | | |
249 | 310 | | |
250 | 311 | | |
| |||
0 commit comments