You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Configure Electron Forge packaging with ASAR unpack for all demos (#1387)
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
Fix: #1386
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,7 +97,7 @@ API documentation is available [online](https://robotwebtools.github.io/rclnodej
97
97
98
98
## Electron-based Visualization
99
99
100
-
Create rich, interactive desktop applications using Electron and web technologies like Three.js. Build 3D visualizations, monitoring dashboards, and control interfaces that run on Windows, macOS, and Linux.
100
+
Create rich, interactive desktop applications using Electron and web technologies like Three.js. Demos leverage **Electron Forge** for easy packaging on Windows, macOS, and Linux.
Copy file name to clipboardExpand all lines: electron_demo/car/README.md
+50Lines changed: 50 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,6 +79,56 @@ npm run build
79
79
npm start
80
80
```
81
81
82
+
## 📦 Packaging for Distribution
83
+
84
+
You can package the application into a standalone folder using **Electron Forge**.
85
+
86
+
### 1. Build the Package
87
+
88
+
Run the following command to create a distributable executable:
89
+
90
+
```bash
91
+
npm run package
92
+
```
93
+
94
+
The output will be located in the `out/` directory.
95
+
96
+
**Technical Note on ASAR:** We enable ASAR but configure it to **unpack** the `rclnodejs` module. `rclnodejs` (v1.8.1+) requires file system access to generated code and native bindings, so we use the `asar.unpack` configuration in `package.json` to keep `rclnodejs` files accessible on disk while packing the rest of the application.
97
+
98
+
```json
99
+
"config": {
100
+
"forge": {
101
+
"packagerConfig": {
102
+
"asar": {
103
+
"unpack": "**/node_modules/rclnodejs/**"
104
+
}
105
+
}
106
+
}
107
+
}
108
+
```
109
+
110
+
### 2. Create Installers (Optional)
111
+
112
+
To create a `.zip` file or other platform-specific installers (deb/rpm), run:
113
+
114
+
```bash
115
+
npm run make
116
+
```
117
+
118
+
**Note**: Creating DEB/RPM installers requires system tools like `dpkg` and `fakeroot`. For ZIP files, you need `zip`.
119
+
120
+
### 3. Running the Standalone Application
121
+
122
+
Even as a standalone application, **ROS 2 must be installed and sourced on the target machine** because `rclnodejs` links dynamically to the ROS 2 shared libraries.
Copy file name to clipboardExpand all lines: electron_demo/manipulator/README.md
+53-1Lines changed: 53 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,9 @@ An interactive Electron application demonstrating a two-joint robotic manipulato
41
41
42
42
## 📜 Available Scripts
43
43
44
-
-**`npm start`** - Run demo (requires manual ROS2 environment setup)
44
+
-**`npm start`** - Launch the application in development mode
45
+
-**`npm run package`** - Package the application into a standalone executable folder
46
+
-**`npm run make`** - Create platform-specific installers (requires system tools like `zip`, `dpkg`)
45
47
-**`npm run rebuild`** - Rebuild native modules after dependency changes
46
48
47
49
## 🚀 Quick Start
@@ -156,6 +158,56 @@ ros2 topic hz /joint_states
156
158
ros2 topic info /joint_states
157
159
```
158
160
161
+
## 📦 Packaging for Distribution
162
+
163
+
You can package the application into a standalone folder using **Electron Forge**.
164
+
165
+
### 1. Build the Package
166
+
167
+
Run the following command to create a distributable executable:
168
+
169
+
```bash
170
+
npm run package
171
+
```
172
+
173
+
The output will be located in the `out/` directory, for example: `out/rclnodejs-manipulator-demo-linux-x64/`.
174
+
175
+
**Technical Note on ASAR:** We enable ASAR but configure it to **unpack** the `rclnodejs` module. `rclnodejs` (v1.8.1+) requires file system access to generated code and native bindings, so we use the `asar.unpack` configuration in `package.json` to keep `rclnodejs` files accessible on disk while packing the rest of the application.
176
+
177
+
```json
178
+
"config": {
179
+
"forge": {
180
+
"packagerConfig": {
181
+
"asar": {
182
+
"unpack": "**/node_modules/rclnodejs/**"
183
+
}
184
+
}
185
+
}
186
+
}
187
+
```
188
+
189
+
### 2. Create Installers (Optional)
190
+
191
+
To create a `.zip` file for distribution, run:
192
+
193
+
```bash
194
+
npm run make
195
+
```
196
+
197
+
**Note**: This will generate a ZIP archive containing the packaged application.
198
+
199
+
### 3. Running the Standalone Application
200
+
201
+
Even as a standalone application, **ROS 2 must be installed and sourced on the target machine** because `rclnodejs` links dynamically to the ROS 2 shared libraries.
Copy file name to clipboardExpand all lines: electron_demo/topics/README.md
+50Lines changed: 50 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,56 @@ The demo window will open with:
65
65
-**Message display area** showing received messages
66
66
-**Counters** for published and received messages
67
67
68
+
## 📦 Packaging for Distribution
69
+
70
+
You can package the application into a standalone folder using **Electron Forge**.
71
+
72
+
### 1. Build the Package
73
+
74
+
Run the following command to create a distributable executable:
75
+
76
+
```bash
77
+
npm run package
78
+
```
79
+
80
+
The output will be located in the `out/` directory.
81
+
82
+
**Technical Note on ASAR:** We enable ASAR but configure it to **unpack** the `rclnodejs` module. `rclnodejs` (v1.8.1+) requires file system access to generated code and native bindings, so we use the `asar.unpack` configuration in `package.json` to keep `rclnodejs` files accessible on disk while packing the rest of the application.
83
+
84
+
```json
85
+
"config": {
86
+
"forge": {
87
+
"packagerConfig": {
88
+
"asar": {
89
+
"unpack": "**/node_modules/rclnodejs/**"
90
+
}
91
+
}
92
+
}
93
+
}
94
+
```
95
+
96
+
### 2. Create Installers (Optional)
97
+
98
+
To create a `.zip` file or other platform-specific installers (deb/rpm), run:
99
+
100
+
```bash
101
+
npm run make
102
+
```
103
+
104
+
**Note**: Creating DEB/RPM installers requires system tools like `dpkg` and `fakeroot`. For ZIP files, you need `zip`.
105
+
106
+
### 3. Running the Standalone Application
107
+
108
+
Even as a standalone application, **ROS 2 must be installed and sourced on the target machine** because `rclnodejs` links dynamically to the ROS 2 shared libraries.
0 commit comments