See the best posts from any Bluesky account
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add mise tasks for dev environment orchestration

Single entry point: `mise run dev` does everything needed to spin up a
working dev environment — installs deps, builds the workspace packages,
brings up ClickHouse via docker compose, runs both migrations, then
starts the three Adonis processes (web with HMR, jetstream consumer,
queue worker) in parallel.

Individual tasks are also available for granular control:
- `mise run install` / `packages:build` / `build` / `lint` / `test`
- `mise run db:up` / `db:wait` / `db:migrate` / `db:down`
- `mise run dev:web` / `dev:jetstream` / `dev:queue`

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+101
+101
mise.toml
··· 1 1 [tools] 2 + node = "24" 2 3 pnpm = "10" 4 + 5 + # The web app reads its own env vars from apps/web/.env via Adonis's 6 + # env loader, so mise doesn't need to duplicate them here. These values 7 + # are only for the few shell-level commands (docker compose) that use 8 + # them from the task environment. 9 + [env] 10 + CLICKHOUSE_PASSWORD = "" 11 + APP_KEY = "mise-task-placeholder" 12 + 13 + [tasks.install] 14 + description = "Install npm workspace dependencies" 15 + run = "npm install" 16 + sources = ["package.json", "package-lock.json", "apps/web/package.json", "packages/atproto/package.json", "packages/clickhouse/package.json"] 17 + outputs = { auto = true } 18 + 19 + [tasks."packages:build"] 20 + description = "Build the shared TypeScript workspace packages" 21 + depends = ["install"] 22 + sources = ["packages/atproto/src/**/*.ts", "packages/atproto/tsconfig.json", "packages/clickhouse/src/**/*.ts", "packages/clickhouse/tsconfig.json"] 23 + outputs = { auto = true } 24 + run = [ 25 + "cd packages/atproto && npm run build", 26 + "cd packages/clickhouse && npm run build", 27 + ] 28 + 29 + [tasks."db:up"] 30 + description = "Start the ClickHouse container in the background" 31 + run = "docker compose up -d clickhouse" 32 + 33 + [tasks."db:down"] 34 + description = "Stop the ClickHouse container" 35 + run = "docker compose stop clickhouse" 36 + 37 + [tasks."db:wait"] 38 + description = "Wait for ClickHouse to respond on /ping" 39 + depends = ["db:up"] 40 + run = ''' 41 + #!/usr/bin/env bash 42 + set -euo pipefail 43 + for i in $(seq 1 30); do 44 + if curl -sf http://localhost:8123/ping > /dev/null 2>&1; then 45 + echo "ClickHouse is ready" 46 + exit 0 47 + fi 48 + printf "." 49 + sleep 1 50 + done 51 + echo >&2 52 + echo "ClickHouse did not become ready within 30 seconds" >&2 53 + exit 1 54 + ''' 55 + 56 + [tasks."db:migrate"] 57 + description = "Run SQLite + ClickHouse migrations" 58 + depends = ["install", "db:wait"] 59 + dir = "{{config_root}}/apps/web" 60 + run = [ 61 + "node ace migration:run --force", 62 + "node ace clickhouse:migrate", 63 + ] 64 + 65 + [tasks."dev:web"] 66 + description = "Run the Adonis HTTP server with hot reload" 67 + dir = "{{config_root}}/apps/web" 68 + run = "node ace serve --hmr" 69 + 70 + [tasks."dev:jetstream"] 71 + description = "Run the Jetstream consumer worker" 72 + dir = "{{config_root}}/apps/web" 73 + run = "node ace jetstream:consume" 74 + 75 + [tasks."dev:queue"] 76 + description = "Run the queue worker (backfill jobs)" 77 + dir = "{{config_root}}/apps/web" 78 + run = "node ace queue:work" 79 + 80 + [tasks.dev] 81 + description = "Spin up the full dev environment: ClickHouse, migrations, web + jetstream + queue workers" 82 + depends = ["packages:build", "db:migrate"] 83 + run = [ 84 + { tasks = ["dev:web", "dev:jetstream", "dev:queue"] }, 85 + ] 86 + 87 + [tasks.test] 88 + description = "Run the full test suite (starts ClickHouse if needed)" 89 + depends = ["install", "packages:build", "db:wait"] 90 + dir = "{{config_root}}/apps/web" 91 + run = "node ace test" 92 + 93 + [tasks.lint] 94 + description = "Run ESLint on the web app" 95 + depends = ["install"] 96 + dir = "{{config_root}}/apps/web" 97 + run = "npm run lint" 98 + 99 + [tasks.build] 100 + description = "Production build of the Adonis app and shared packages" 101 + depends = ["packages:build"] 102 + dir = "{{config_root}}/apps/web" 103 + run = "node ace build"