From 972263a9d4456ed5728ac231047fe283f13104bc Mon Sep 17 00:00:00 2001 From: Joscha Date: Sun, 2 Mar 2025 17:39:50 +0100 Subject: [PATCH] Update meta scripts --- README.md | 7 ++++++ meta/build-all | 32 ++++++++++++++++++++++++ meta/build-thermal-printer | 8 ++++++ meta/build-thermal-printer-ui | 11 ++++++++ meta/build-typst-plugin | 17 +++---------- meta/{clippy => check} | 6 +++++ meta/clean | 5 ++++ meta/spinch/deploy | 12 ++++++--- showbits-thermal-printer-ui/package.json | 1 + 9 files changed, 82 insertions(+), 17 deletions(-) create mode 100755 meta/build-all create mode 100755 meta/build-thermal-printer create mode 100755 meta/build-thermal-printer-ui rename meta/{clippy => check} (56%) diff --git a/README.md b/README.md index 8026d1a..3e3f757 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,13 @@ Displaying pixel-perfect images on esoteric devices. +## Developing + +After cloning the repo, run `meta/build-all` once. Some parts of the project use +files from other parts of the project (e.g. the thermal printer includes the +typst plugin wasm file in its binary). The build script produces these +intermediate artifacts. + ## Thermal printer ideas - Appointments, tasks for the day diff --git a/meta/build-all b/meta/build-all new file mode 100755 index 0000000..e61731e --- /dev/null +++ b/meta/build-all @@ -0,0 +1,32 @@ +#!/usr/bin/env fish + +set_color --bold yellow +echo "##################" +echo "## typst plugin ##" +echo "##################" +set_color normal + +./meta/build-typst-plugin +or return 1 + +echo + +set_color --bold yellow +echo "########################" +echo "## thermal printer ui ##" +echo "########################" +set_color normal + +./meta/build-thermal-printer-ui +or return 1 + +echo + +set_color --bold yellow +echo "#####################" +echo "## thermal printer ##" +echo "#####################" +set_color normal + +./meta/build-thermal-printer +or return 1 diff --git a/meta/build-thermal-printer b/meta/build-thermal-printer new file mode 100755 index 0000000..fd97363 --- /dev/null +++ b/meta/build-thermal-printer @@ -0,0 +1,8 @@ +#!/usr/bin/env fish + +pushd showbits-thermal-printer + +cargo build --release +or return 1 + +popd diff --git a/meta/build-thermal-printer-ui b/meta/build-thermal-printer-ui new file mode 100755 index 0000000..6cfd627 --- /dev/null +++ b/meta/build-thermal-printer-ui @@ -0,0 +1,11 @@ +#!/usr/bin/env fish + +pnpm install --recursive +or return 1 + +pushd showbits-thermal-printer-ui + +pnpm build +or return 1 + +popd diff --git a/meta/build-typst-plugin b/meta/build-typst-plugin index a0aa3be..ddfd9ac 100755 --- a/meta/build-typst-plugin +++ b/meta/build-typst-plugin @@ -1,22 +1,11 @@ #!/usr/bin/env fish -set_color --bold yellow -echo "#############" -echo "## Prepare ##" -echo "#############" -set_color - rustup target add wasm32-unknown-unknown +or return 1 pushd showbits-typst-plugin -echo - -set_color --bold yellow -echo "###########" -echo "## Build ##" -echo "###########" -set_color - cargo build --release --target wasm32-unknown-unknown or return 1 + +popd diff --git a/meta/clippy b/meta/check similarity index 56% rename from meta/clippy rename to meta/check index b9fcf49..ad775df 100755 --- a/meta/clippy +++ b/meta/check @@ -1,5 +1,11 @@ #!/usr/bin/env fish cargo clippy + pushd showbits-typst-plugin cargo clippy +popd + +pushd showbits-thermal-printer-ui +pnpm check +popd diff --git a/meta/clean b/meta/clean index 6ec49a6..1c66cee 100755 --- a/meta/clean +++ b/meta/clean @@ -1,5 +1,10 @@ #!/usr/bin/env fish cargo clean + pushd showbits-typst-plugin cargo clean +popd + +rm -rf node_modules +rm -rf showbits-thermal-printer-ui/node_modules diff --git a/meta/spinch/deploy b/meta/spinch/deploy index 7807f31..0cac3e3 100755 --- a/meta/spinch/deploy +++ b/meta/spinch/deploy @@ -6,7 +6,13 @@ set_color --bold yellow echo "###########" echo "## Build ##" echo "###########" -set_color +set_color normal + +./meta/build-typst-plugin +or return 1 + +./meta/build-thermal-printer-ui +or return 1 cross build --release \ --package showbits-thermal-printer \ @@ -19,7 +25,7 @@ set_color --bold yellow echo "############" echo "## Upload ##" echo "############" -set_color +set_color normal rsync -vP \ meta/spinch/showbits-thermal-printer.service \ @@ -34,7 +40,7 @@ set_color --bold yellow echo "#############" echo "## Restart ##" echo "#############" -set_color +set_color normal ssh root@spinch "\ systemctl daemon-reload \ diff --git a/showbits-thermal-printer-ui/package.json b/showbits-thermal-printer-ui/package.json index 34b9598..e052bad 100644 --- a/showbits-thermal-printer-ui/package.json +++ b/showbits-thermal-printer-ui/package.json @@ -5,6 +5,7 @@ "type": "module", "scripts": { "dev": "vite", + "check": "vue-tsc -b", "build": "vue-tsc -b && vite build", "preview": "vite preview" },