-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat(build): Bundle native application using Tauri #92
Conversation
Can we add a EDIT: Sorry just realized that neither |
@jbcpollak agree that using the cadmium icons would be good and getting all the dependencies sorted in the devcontainer is a good idea too. Also, updating readme to suit. I found I had to come here for build instructions, and like @dzervas I was looking for a package.json script to kick it off for me! Awesome work btw. Works great on my machine :) |
Hey just realised we'll need a solution for the base url as well. We're using github pages atm and pretty happy with it. |
hum, I'll look into that, been a while since I've used GitHub pages - pretty sure we can figure that out |
@av8ta - so I looked at this for a bit and I think it will be fine. I will try and setup the action to run on my fork and verify first but here's my thinking: the app URL is https://cadmium-co.github.io/CADmium/, and index.html (and all assets) are deployed to the Currently index.html has absolute paths like this:
this PR changes the URLs to relative resolution:
since we still load so pretty sure its 👍 , but I'll double check if I can get actions running on my fork |
Confirmed, you can see it working with relative paths here: https://code.joshpollak.com/CADmium/ |
generate icons with `pnpm tauri icon applications/web/public/cadmium_logo_min.svg` see: https://tauri.app/v1/guides/features/icons/
I've added icons and updated the readme. About the dependencies in the devcontainer - to install the GUI libraries takes a ton of space, and in the interest of making the devcontainer light and accessible, I'm sort of inclined not to install the dependencies. Especially in the on-create.sh where they can't be cached as a Docker layer, but even if they could be, I feel like they are best left out of that environment. It can be done though, I'm just not sure who and how many people are using the devcontainer and I don't want to be disruptive to them. Thoughts? |
Not a biggie to leave the deps out of devcontainer for now. So long as folks can develop with the devcontainer in the browser that should be fine. |
🎉 |
This uses Tauri to build a native app. Its based on Rust and having had experience with Electron, this seems way smoother. I picked the beta version (v2) because it is adding support for mobile platforms, although I haven't gotten that far yet. This is another strength because the alternative would be something bonkers like Electron for desktop and Ionic for mobile and then it would be a complete mess.
All in all, I'm pretty shocked at how easy this was.
Pre-Reqs
Notable Changes
libwebkit2gtk-4.1-dev
is not available in bullseye. Overall this change seems harmless.CADmium
to just./
. This is because the binary build couldn't resolve the paths. It doesn't affect the regular web dev environment, if it has implications for hosting I'd suggest changing the hosting, this seems to be the "right" way to setup vite.Other than that, this is all new functionality, the core code didn't change beyond the above.
Usage
pnpm tauri dev
- HRM using the vite dev serverpnpm tauri build
- build the native application and installers (deb, rpm, AppImage, Windows installers, etc)Testing
Tested
(dev, binary and install)
Untested
TODO
cadmium-native
, which is set in the Cargo.toml. I don't see how to override that in the Tauri config and I didn't know the implications of changing the package name in the main Cadmium Cargo.toml so I didn't want to touch it. I was thinking of calling thatcadmium-core
if renaming it is an option.