Configure Electron Forge packaging with ASAR unpack for all demos#1387
Configure Electron Forge packaging with ASAR unpack for all demos#1387minggangw merged 3 commits intoRobotWebTools:developfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR configures Electron Forge packaging across all four electron demos (topics, turtle_tf2, manipulator, car) to enable distributable application creation. The key enhancement is the ASAR configuration that unpacks the rclnodejs module, which requires file system access to generated code and native bindings.
Changes:
- Added Electron Forge packaging infrastructure with ASAR unpack configuration for rclnodejs across all demos
- Updated dependencies to rclnodejs ^1.8.1 and upgraded Electron/build tools to latest versions
- Migrated manipulator demo from CDN-based Three.js to npm package and added GPU rendering workarounds
- Added comprehensive packaging documentation to all demo READMEs
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| electron_demo/turtle_tf2/package.json | Added Electron Forge configuration with makers for squirrel, zip, deb, and rpm; ASAR unpack for rclnodejs |
| electron_demo/turtle_tf2/README.md | Added packaging documentation section with instructions for distribution |
| electron_demo/topics/package.json | Added Electron Forge configuration with makers for squirrel, zip, deb, and rpm; ASAR unpack for rclnodejs |
| electron_demo/topics/README.md | Added packaging documentation section (with minor emoji rendering issues) |
| electron_demo/manipulator/package.json | Added Electron Forge configuration with makers for squirrel and zip only; migrated Three.js from CDN to npm |
| electron_demo/manipulator/README.md | Added packaging documentation section |
| electron_demo/manipulator/renderer.js | Added Three.js import statement to support npm-based package |
| electron_demo/manipulator/main.js | Added GPU command line switches to fix WebGL rendering issues |
| electron_demo/manipulator/index.html | Removed Three.js CDN script tag |
| electron_demo/car/package.json | Added Electron Forge configuration with makers for squirrel, zip, deb, and rpm; ASAR unpack for rclnodejs |
| electron_demo/car/README.md | Added packaging documentation section with instructions for distribution |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "makers": [ | ||
| { | ||
| "name": "@electron-forge/maker-squirrel", | ||
| "config": { | ||
| "name": "rclnodejs_manipulator_demo" | ||
| } | ||
| }, | ||
| { | ||
| "name": "@electron-forge/maker-zip", | ||
| "platforms": [ | ||
| "darwin", | ||
| "linux" | ||
| ] | ||
| } | ||
| ], |
There was a problem hiding this comment.
The makers configuration is inconsistent with the other demos (turtle_tf2, topics, car). This package.json is missing the DEB and RPM makers that are present in the other three demos. For consistency across all demos and to provide the same packaging options, consider adding the maker-deb and maker-rpm configurations here as well.
electron_demo/manipulator/README.md
Outdated
| ### 2. Create Installers (Optional) | ||
|
|
||
| To create a `.zip` file or other platform-specific installers (deb/rpm), run: | ||
|
|
||
| ```bash | ||
| npm run make | ||
| ``` | ||
|
|
||
| **Note**: Creating DEB/RPM installers requires system tools like `dpkg` and `fakeroot`. For ZIP files, you need `zip`. |
There was a problem hiding this comment.
The documentation mentions creating DEB/RPM installers, but the package.json makers configuration (lines 46-60) only includes squirrel and zip makers, unlike the other demos (turtle_tf2, topics, car) which include maker-deb and maker-rpm. Either add the DEB/RPM makers to the configuration, or update the documentation to remove the reference to "deb/rpm" installers and only mention ZIP files.
| "dependencies": { | ||
| "rclnodejs": "^1.5.1" | ||
| "rclnodejs": "^1.8.1", | ||
| "three": "^0.182.0" |
There was a problem hiding this comment.
The Three.js version (0.182.0) differs from the turtle_tf2 demo which uses 0.155.0. While both versions should work, consider using the same Three.js version across all demos for consistency, easier maintenance, and to avoid potential version-specific issues. The turtle_tf2 demo documentation at line 360 of its README specifically mentions version 0.155.0 for troubleshooting.
| "three": "^0.182.0" | |
| "three": "^0.155.0" |
This PR configures Electron Forge packaging across all four electron demos (topics, turtle_tf2, manipulator, car) to enable distributable application creation. The key enhancement is the ASAR configuration that unpacks the rclnodejs module, which requires file system access to generated code and native bindings.
Changes:
Fix: #1386