Closed jbcpollak closed 4 weeks ago
Awesome!
Do you know if tauri apps can accept input from stdin?
Can we add a build:tauri
command to the root package.json
?
I imagine we don't want to build tauri by default (same for dev
)
EDIT: Sorry just realized that neither build
nor dev
build tauri, only pnpm tauri build
do that
@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 :)
@dzervas @av8ta - thanks for the feedback, I'll work on those things!
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
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.
@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 CADmium/
directory on the server.
Currently index.html has absolute paths like this:
<link rel="apple-touch-icon" sizes="180x180" href="/CADmium/assets/apple-touch-icon-DDWPlyIz.png">
this PR changes the URLs to relative resolution:
<link rel="apple-touch-icon" sizes="180x180" href="./assets/apple-touch-icon-DDWPlyIz.png">
since we still load .../CADmium/index.html
relative resolution will be .../CADmium/./<whatever>
.
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/
Also MacOS works fine:
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.