rudus/justfile

40 lines
1006 B
Makefile
Raw Normal View History

2025-07-02 19:43:44 +00:00
# build optimized wasm
build: && clean-wasm-pack
2025-06-30 22:59:59 +00:00
# build with wasm-pack
wasm-pack build --target web
2025-06-30 22:59:59 +00:00
2025-07-02 19:43:44 +00:00
# build dev wasm
dev: && clean-wasm-pack
2025-06-30 22:59:59 +00:00
wasm-pack build --dev --target web
2025-07-02 19:43:44 +00:00
# clean up after wasm-pack
2025-06-30 22:59:59 +00:00
clean-wasm-pack:
# delete cruft from wasm-pack
rm pkg/.gitignore pkg/package.json pkg/README.md
2025-06-30 16:48:50 +00:00
rm -rf pkg/snippets
2025-06-30 22:59:59 +00:00
# fix imports of rudus.js
cp pkg/rudus.js pkg/rudus.js.backup
echo 'import { io } from "./worker.js"' > pkg/rudus.js
cat pkg/rudus.js.backup | tail -n+2>> pkg/rudus.js
rm pkg/rudus.js.backup
2025-07-02 19:34:36 +00:00
from_branch := `git branch --show-current`
git_status := `git status -s`
2025-07-02 19:04:54 +00:00
2025-07-02 19:43:44 +00:00
# publish this branch into release
2025-07-02 19:04:54 +00:00
release:
2025-07-02 19:34:36 +00:00
echo {{ if git_status == "" {"git status ok"} else {error("please commit changes first")} }}
2025-07-02 19:19:54 +00:00
just wasm
2025-07-02 19:37:56 +00:00
-git commit -am "release build"
2025-07-02 19:19:54 +00:00
git checkout release
2025-07-02 19:34:36 +00:00
git merge {{from_branch}}
2025-07-02 19:19:54 +00:00
git push
2025-07-02 19:34:36 +00:00
git checkout {{from_branch}}
2025-06-30 22:59:59 +00:00
2025-07-02 19:43:44 +00:00
# serve the pkg directory
2025-06-30 22:59:59 +00:00
serve:
2025-07-02 19:43:44 +00:00
live-server pkg
default:
@just --list