Files
breeze/scripts/build-node-apps.sh
T
waozi ef0de86e02
Cloudflare Pages / Build and verify the site (push) Successful in 3m29s
Integrate Breeze desktop, Android, and app updates
Use the verified dependency lock across native hosts and bundled apps. Preserve saved styles, local app reactivation, and offline packages while integrating the latest practice, Habits, Lumi, and figure preview updates.
2026-11-20 02:24:34 -03:00

32 lines
1.3 KiB
Bash

#!/bin/sh
# Apps the node offers build independently into build/node-apps. Complete
# small apps also ship as optional baselines, outside the root's cells/ IDs.
set -eu
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
cd "$root"
ziran=${1:-build/packages/ziran/build/bin/ziran}
# Package flags select the same development or locked graph as Make.
bundle() {
# shellcheck disable=SC2086
"$ziran" bundle --project --offline ${PACKAGE_FLAGS:-} "$@"
}
output=${2:-build/node-apps}
mkdir -p build "$output"
exec 9>build/apps-build.lock
flock 9
python3 scripts/check-package-versions.py
python3 scripts/prepare-package-assets.py --apps-controller "${APPS_BUNDLE:-build/apps-ui/apps.zx}"
for name in $(python3 -c 'import json; print(" ".join(sorted(json.load(open("apps/versions.json")).get("node_apps", {}))))'); do
assets=build/package-assets/$name/assets
mkdir -p "$assets"
# shellcheck disable=SC2086
bundle --root . --module-path "apps/$name" \
--define KRYON_HOSTED_UI \
--asset-dir "assets=$assets" \
--entry "$name:Main" -o "$output/$name.zx" "apps/$name/$name.zi"
# The compiler preserves the mtime when the bundle's bytes match.
# Mark a verified output current so Make can skip rebuilding it.
test -s "$output/$name.zx"
touch "$output/$name.zx"
done