moved generated,spacetime into it's own package + many other things

This commit is contained in:
Sebastian Moser
2026-05-17 14:23:34 +02:00
parent 2907d7e236
commit d1ddb405c8
49 changed files with 610 additions and 499 deletions

90
md
View File

@@ -5,12 +5,28 @@ MIZE_SRC="/home/me/work/mize" # hardcoded for now
RSYNC_EXCLUDES="--exclude=node_modules --exclude=target --exclude=mize_config.toml --exclude=rust_dist --exclude=deno_dist --exclude=dist --exclude=result --exclude=pkg"
function main {
if [[ "$1" == "gen" ]]; then
generate_sources
fi
if [[ "$1" == "dsp" ]]; then
deploy_spacetime
fi
if [[ "$1" == "dlu" ]]; then
deploy_lush
fi
if [[ "$1" == "dma" ]]; then
deploy_main_website
deploy_main
fi
if [[ "$1" == "dmac" ]]; then
deploy_mac
fi
if [[ "$1" == "dpw" ]]; then
deploy_ppc_website
fi
if [[ "$1" == "dmo" ]]; then
@@ -18,6 +34,68 @@ function main {
fi
}
function deploy_spacetime {
spacetime publish -p $MIZE_SRC/packages/spacetime
}
function generate_sources {
echo "mize: Generating sources..."
mkdir -p $MIZE_SRC/packages/generated/src/spacetime
# Generate Cargo.toml and lib.rs
cat << 'EOF' > $MIZE_SRC/packages/generated/Cargo.toml
[package]
name = "generated"
version = "0.1.0"
edition = "2021"
[lib]
name = "generated"
path = "src/lib.rs"
[dependencies]
spacetimedb-sdk = "2.1.0"
EOF
echo -e 'pub mod spacetime;\n' > $MIZE_SRC/packages/generated/src/lib.rs
# Generate spacetime client bindings
spacetime generate -p $MIZE_SRC/packages/spacetime -o $MIZE_SRC/packages/generated/src/spacetime --lang rust
}
function deploy_main {
cargo build --manifest-path $MIZE_SRC/packages/mize/Cargo.toml --release
cargo build --manifest-path $MIZE_SRC/packages/ppc/Cargo.toml --release --features desktop
cp $MIZE_SRC/target/release/mize ~/here/mize/
cp $MIZE_SRC/target/release/libppc_part.so ~/here/mize/
cp $MIZE_SRC/md ~/here/mize/
cp $MIZE_SRC/target/release/ppc ~/here/mize/
systemctl --user restart mize
}
function deploy_mac {
echo "c2vi: Deploying to mac..."
# Copy files to mac
rsync -r -u -v -a --delete --include=".git/" --include=".git/**" --mkpath $RSYNC_EXCLUDES $MIZE_SRC mac:here
# compile
ssh mac << EOF
if ! tmux has-session -t ppc-deploy 2>/dev/null; then
echo "Created new tmux session...."
tmux new-session -d -s ppc-deploy "nix develop git+file:///home/me/here/mize#buildShell"
tmux send-keys -t ppc-deploy "cargo build --manifest-path /home/me/here/mize/packages/mize/Cargo.toml" Enter
tmux send-keys -t ppc-deploy "cargo build --features desktop --manifest-path /home/me/here/mize/packages/ppc/Cargo.toml" Enter
tmux send-keys -t ppc-deploy "systemctl --user restart mize" Enter
else
echo "using existing session..."
tmux send-keys -t ppc-deploy "cargo build --manifest-path /home/me/here/mize/packages/mize/Cargo.toml" Enter
tmux send-keys -t ppc-deploy "cargo build --features desktop --manifest-path /home/me/here/mize/packages/ppc/Cargo.toml" Enter
tmux send-keys -t ppc-deploy "systemctl --user restart mize" Enter
fi
EOF
}
function deploy_lush {
echo "c2vi: Deploying to lush..."
@@ -30,19 +108,21 @@ function deploy_lush {
if ! tmux has-session -t ppc-deploy 2>/dev/null; then
echo "Created new tmux session...."
tmux new-session -d -s ppc-deploy "nix develop git+file:///home/me/here/mize#buildShell"
tmux send-keys -t ppc-deploy "cargo build --featuers desktop --manifest-path /home/me/here/mize/packages/mize/Cargo.toml" Enter
tmux send-keys -t ppc-deploy "cargo build --manifest-path /home/me/here/mize/packages/mize/Cargo.toml" Enter
tmux send-keys -t ppc-deploy "cargo build --features desktop --manifest-path /home/me/here/mize/packages/ppc/Cargo.toml" Enter
tmux send-keys -t ppc-deploy "systemctl --user restart mize" Enter
else
echo "using existing session..."
tmux send-keys -t ppc-deploy "cargo build --features desktop --manifest-path /home/me/here/mize/packages/mize/Cargo.toml" Enter
tmux send-keys -t ppc-deploy "cargo build --manifest-path /home/me/here/mize/packages/mize/Cargo.toml" Enter
tmux send-keys -t ppc-deploy "cargo build --features desktop --manifest-path /home/me/here/mize/packages/ppc/Cargo.toml" Enter
tmux send-keys -t ppc-deploy "systemctl --user restart mize" Enter
fi
EOF
}
function deploy_main_website {
echo "c2vi: Deploying website to fes"
function deploy_ppc_website {
echo "c2vi: Deploying ppc website to fes"
# compile
cargo build --release --no-default-features --features server --manifest-path $MIZE_SRC/packages/ppc/Cargo.toml