Add release single-file packaging and E2E coverage#8
Conversation
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
There was a problem hiding this comment.
Pull request overview
Adds a “single-file” build/release variant alongside the existing Vite build, and runs the Playwright E2E suite against both outputs to ensure parity.
Changes:
- Introduce a dedicated
vite.singlefile.config.tsproducingdist-singlefile/usingvite-plugin-singlefile. - Update Playwright config + CI to run E2E tests for both
dist/anddist-singlefile/, with separate HTML report folders. - Add a release workflow that uploads both standard and single-file zip assets.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| vite.singlefile.config.ts | New Vite config for single-file output into dist-singlefile/. |
| src/rosbagUtils.ts | Switch decompressor libs to static imports (previously lazy-loaded). |
| playwright.config.ts | Serve built output via a static server; parameterize output/report folder by variant. |
| package.json | Add build:singlefile and test:e2e:singlefile; add vite-plugin-singlefile. |
| index.html | Remove Vite starter favicon link. |
| .gitignore | Ignore dist-singlefile and single-file Playwright report folder. |
| .github/workflows/test.yml | Run E2E in a matrix for standard vs single-file; upload variant-specific reports. |
| .github/workflows/release.yml | New workflow to package and upload standard + single-file release assets. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| command: 'npm run dev', | ||
| url: 'http://localhost:3000', | ||
| reuseExistingServer: !process.env.CI, | ||
| command: `${buildCommand} && python3 -m http.server 3000 --bind 127.0.0.1 --directory ${outputDir}`, |
There was a problem hiding this comment.
The Playwright webServer.command now depends on python3 being available locally. That’s true on GitHub Actions ubuntu runners, but may not hold for all contributors/environments. Consider using a Node-based static server (e.g., npx http-server/serve added to devDependencies) to avoid the extra runtime dependency.
| command: `${buildCommand} && python3 -m http.server 3000 --bind 127.0.0.1 --directory ${outputDir}`, | |
| command: `${buildCommand} && npx http-server ${outputDir} -p 3000 -a 127.0.0.1`, |
There was a problem hiding this comment.
This is a ROS project, so Linux/Mac is assumed. python3 is always available.
| cp -a dist/. "${staging_dir}/" | ||
| mv "${staging_dir}/index.html" "${staging_dir}/rosbag-analyzer.html" | ||
|
|
There was a problem hiding this comment.
The release artifact renames index.html to rosbag-analyzer.html. This changes the file users are expected to open (README currently references opening dist/index.html / index.html from releases). Consider keeping index.html in the zip (copy instead of move) or updating the user-facing docs/instructions to match the packaged filename.
There was a problem hiding this comment.
Intentional rename — makes the filename recognizable after download.
| import Bag from '@foxglove/rosbag/dist/cjs/Bag'; | ||
| import BlobReader from '@foxglove/rosbag/dist/cjs/web/BlobReader'; | ||
| import { decompress as bzip2Decompress } from 'seek-bzip'; | ||
| import lz4 from 'lz4js'; |
There was a problem hiding this comment.
Switching from dynamic imports to top-level imports for seek-bzip and lz4js pulls these decompression libraries into the initial app bundle (rosbagUtils is imported by App), increasing initial load even for users who never open a bag. If the goal is single-file bundling, consider keeping lazy import() (single-file rollup can still inline dynamic imports) so these deps load only when needed.
There was a problem hiding this comment.
Top-level imports are needed for the single-file build. Bundle size is acceptable.
- Add cross-env for Windows-compatible E2E singlefile script - Use cp -a for singlefile release packaging for robustness - Fix misleading console.log message for decompression init Co-Authored-By: Claude Opus 4.6 <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 9 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Summary
Testing