Files
artcraft/script/artcraft/unix_rust_dev.sh
T
Brandon Thomas 0004726a36 ArtCraft Desktop (fresh start)
This is a fresh start for the `artcraft` repo.

The old monorepo, which included our web API gateway, job services, SRE
tools, various frontends, and more has moved to `artcraft-services`

You can find the full git history here:

https://github.com/storytold/artcraft-services

This change was motivated by the fact that the entire git history was
hundreds of gigabytes in size, which is unwieldy for anyone not in the
core team that doesn't care about support services outside of the core
artcraft app.

We wanted to keep this repo in its well-known place since we already
have users and activity here.

Please update your remotes to either `artcraft-services` or make a fresh
clone of this repo.

History can be found at the artcraft-services repo.
2026-09-11 14:19:51 -04:00

60 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# This works on Linux and MacOS to launch the Rust dev server
set -euxo pipefail
echo "Running Artcraft Rust in Dev Mode..."
echo ""
echo "You'll need to launch the frontend dev server as a second script!"
echo ""
root_dir=$(pwd)
frontend_path="${root_dir}/frontend"
rust_crate_path="${root_dir}/crates/desktop/artcraft"
sqlite_db_file="/tmp/tasks.sqlite"
# The tauri dev server integration is super annoying: It eats ctrl-c interrupts,
# it decoheres the and corrupts terminal output, and it's slow. This configuration
# allows us to start without it. Simply launch `nx` and the dev server as a separate
# process and leave tauri out of the loop
config_path="${rust_crate_path}/tauri-dev-hot-reload.conf.json"
export TAURI_FRONTEND_PATH="${frontend_path}"
export TAURI_APP_PATH="${rust_crate_path}"
echo "Create database file..."
touch "${sqlite_db_file}"
sqlx_migrate() {
echo "SQLx migrate database file..."
sqlx migrate run \
--database-url "sqlite:${sqlite_db_file}" \
--source "${root_dir}/_database/sql/artcraft_migrations"
export DATABASE_URL="sqlite:${sqlite_db_file}"
}
sqlx_offline() {
echo "SQLx offline..."
export SQLX_OFFLINE=true
}
# NB: Switch this for actively developing queries.
#sqlx_migrate
sqlx_offline
# Issue with Linux performance
# https://github.com/tauri-apps/tauri/issues/13498
export WEBKIT_DISABLE_DMABUF_RENDERER=1
export WEBKIT_DISABLE_COMPOSITING_MODE=1
echo "Build and run..."
RUSTFLAGS="-Awarnings" cargo tauri dev \
--verbose \
--no-dev-server \
--no-dev-server-wait \
--no-watch \
--config "${config_path}"