Commit c71cec3
authored
✨ Improve preview command with smart exclusions and dry-run (#186)
## Summary
- Fix form-data upload by using native `FormData`/`Blob` for fetch
compatibility (the `form-data` npm package doesn't stream correctly with
Node's native fetch)
- Add smart default exclusions for non-static files: `node_modules`,
`tests/`, `__tests__/`, `coverage/`, `*.config.js`, `package.json`,
`*.md`, etc.
- Add `--dry-run` flag to preview what would be uploaded without
actually uploading
- Add `--exclude/-x` flag to add custom exclusion patterns (repeatable,
use trailing `/` for directories)
- Add `--include/-i` flag to override default exclusions (e.g.,
`--include package.json`)
- Show helpful error message with examples when path argument is missing
- Skip API token validation for dry-run mode
## Test plan
- [ ] Run `vizzly preview ./dist --dry-run` to verify file listing works
- [ ] Run `vizzly preview ./dist --dry-run --verbose` to see exclusion
lists
- [ ] Run `vizzly preview ./dist --dry-run --exclude "*.css"` to test
custom exclusions
- [ ] Run `vizzly preview ./dist --dry-run --include package.json` to
test including excluded files
- [ ] Run `vizzly preview` (no path) to verify helpful error message
- [ ] Run actual upload to verify form-data fix works1 parent 8480393 commit c71cec3
File tree
5 files changed
+520
-45
lines changed- src
- api
- commands
- tests
- api
- commands
5 files changed
+520
-45
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | | - | |
337 | | - | |
| 336 | + | |
338 | 337 | | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
| 338 | + | |
| 339 | + | |
343 | 340 | | |
344 | 341 | | |
345 | 342 | | |
346 | 343 | | |
347 | | - | |
| 344 | + | |
348 | 345 | | |
349 | 346 | | |
350 | 347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
575 | | - | |
| 575 | + | |
576 | 576 | | |
577 | 577 | | |
578 | 578 | | |
579 | 579 | | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
580 | 591 | | |
581 | 592 | | |
582 | 593 | | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
583 | 607 | | |
584 | 608 | | |
585 | 609 | | |
| |||
0 commit comments