Howdy. So I’ll share how I got things up and running. My main workstation is a windows box, but this approach should allow you to accomplish the same regardless of your OS.
If you are not familiar with the platform that GSender is built on, there are two things primarily that result in the application executable. 1. A React JS web application 2. An electron packaged executable that provides the wrapper for the web app as well as the system calls for things like the filesystem, serial devices, etc. There is one more thing if you consider the remote browser access, which is a Node.JS server that is serving the react app.
So, the hardest thing to deal with is the package dependencies, along with the various versions of yarn, npm, etc. that are all necessary to get to the point of even being able to build.
The solution is to use a Dockerfile to stand up a container that already has the build tools like node, npm, yarn, etc. that will work for the GSender codebase.
This thread on GitHub is where the information on Docker was: Cannot compile · Issue #557 · Sienci-Labs/gsender · GitHub
So I setup up Docker, and created a docker file. Now, the docker file spelled out in the above thread, does a very specific thing, which includes copying files from the container build onto your local filesystem. When I set things up, the files were already on my local filesystem. I’m not docker expert, but using Visual Studio code and the Dev Containers extension, I was able to create a container from the following docker file and attach to it inside of VS Code. That importantly gave me a terminal.
Dockerfile:
ARG version=v1.4.9
FROM node:18-bullseye
So that creates an image that has a specific version of Node.JS on a specific version of Debian.
Once I was attached to the container in VS Code, in the terminal I then issued commands from the Docker file shared in the GitHub thread.
git clone https://github.com/Sienci-Labs/gsender.git .
(clone the gsender repo from github to cwd)
yarn prebuild-latest
script that needs to run first
yarn lint
This just warns about the code issues but afaik it doesn’t do anything else. I ran in just in case.
yarn build
Assuming you do not get an error - once yarn build finishes running you have built the react JS application and everything is ready for packaging up as an Electron app.
Now, I had some trouble at first getting the electron packaged exe to run. Keep in mind, this part of the build, I did outside of the docker container, so in other words through my local terminal in windows.
Change into directory ~/build/dist/gsender
yarn install
npm install electron
npm install electron-packager
For my machine I was successful with Node 22.16.0
Final step: Building the executable
npx electron-packager <sourcedir> <appname> --platform=<platform> --arch=<arch>
So translated to my environment:
npx electron-packager . RiftCoderGsender --platform=win32 --arch=x64
This created the folder GsenderRiftCoder-win32-x64 which inside was the electron app including RiftCoderGsender.exe
You can find the electron-packager parameter info here: packager/usage.txt at main · electron/packager · GitHub
Edit: Just FYI, I was also able to run GSender headless in the container which allowed me to access it through a web browser. Ultimately, that wasn’t useful to me because I would have to forward a COM port to docker for it to see my arudino grbl test setup. So I worked towards getting the executable and running that as if I had it installed at my CNC.