-
Notifications
You must be signed in to change notification settings - Fork 21
chore(ci): faster localdev iteration #3767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -186,6 +186,10 @@ export const createAppViteConfig = (): UserConfigFn => { | |
| host: process.env.TAURI_DEV_HOST || 'localhost', | ||
| }, | ||
| cors: true, | ||
| proxy: { | ||
| // always redirect root to /app | ||
| '^/$': { target: 'http://localhost:3000', rewrite: () => '/app' }, | ||
| }, | ||
|
Comment on lines
+189
to
+192
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
FILE="js/app/packages/app/vite.base.ts"
echo "== File exists? =="
ls -la "$FILE"
echo
echo "== Relevant line range (around 160-220) =="
nl -ba "$FILE" | sed -n '160,220p'
echo
echo "== Find PORT usage in file =="
rg -n "PORT" "$FILE" || true
echo
echo "== Find proxy configuration in file =="
rg -n "proxy|rewrite|target" "$FILE"Repository: macro-inc/macro Length of output: 266 🏁 Script executed: #!/bin/bash
set -euo pipefail
FILE="js/app/packages/app/vite.base.ts"
echo "== Relevant line range (160-220) =="
cat -n "$FILE" | sed -n '160,220p'
echo
echo "== PORT usage in file =="
rg -n "PORT" "$FILE" || true
echo
echo "== proxy/rewrite/target usage in file =="
rg -n "(proxy|rewrite|target)" "$FILE"Repository: macro-inc/macro Length of output: 2457 🏁 Script executed: #!/bin/bash
set -euo pipefail
FILE="js/app/packages/app/vite.base.ts"
echo "== Lines around NO_MINIFY =="
rg -n "NO_MINIFY" "$FILE"
echo
# show a window around first occurrence
LINE=$(rg -n "NO_MINIFY" "$FILE" | head -n1 | cut -d: -f1)
START=$((LINE-20))
END=$((LINE+20))
sed -n "${START},${END}p" "$FILE" | cat -n
echo
echo "== Show proxy block context =="
# show around the proxy '^/$' line
PROXYLINE=$(rg -n "'\\^/\\$':|\\^/\\$" "$FILE" | head -n1 | cut -d: -f1)
START=$((PROXYLINE-15))
END=$((PROXYLINE+15))
sed -n "${START},${END}p" "$FILE" | cat -nRepository: macro-inc/macro Length of output: 2739 Root proxy hardcodes Suggested fix@@
- const NO_MINIFY = process.env.NO_MINIFY === 'true';
+ const NO_MINIFY = process.env.NO_MINIFY === 'true';
+ const DEV_PORT = Number(process.env.PORT || 3000);
@@
- port: Number(process.env.PORT || 3000),
+ port: DEV_PORT,
@@
- '^/$': { target: 'http://localhost:3000', rewrite: () => '/app' },
+ '^/$': { target: `http://localhost:${DEV_PORT}`, rewrite: () => '/app' },🤖 Prompt for AI Agents |
||
| watch: { | ||
| usePolling: true, | ||
| interval: 100, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -196,3 +196,32 @@ setup: | |
| destroy: | ||
| just infra/stacks/fusionauth-instance/destroy | ||
| docker compose down -v | ||
|
|
||
| dev-rebuild service: | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| container="macro-{{ service }}-1" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this always the container name or will this depend on what worktree/workspace you are in? |
||
|
|
||
| if [ "{{ service }}" = "sync_service" ]; then | ||
| echo "==> Building sync_service wasm inside container..." | ||
| docker exec "$container" worker-build --release | ||
| docker restart "$container" | ||
| else | ||
| bin=$(docker inspect "$container" | jq -r '.[0].Config.Cmd[0]' | xargs basename) | ||
|
|
||
| echo "==> Building $bin (incremental)..." | ||
| docker compose up rust-builder -d --wait 2>/dev/null || true | ||
| docker exec macro-rust-builder-1 cargo build --bin "$bin" | ||
|
|
||
| echo "==> Copying binary into $container..." | ||
| tmp=$(mktemp) | ||
| docker cp "macro-rust-builder-1:/app/target/debug/$bin" "$tmp" | ||
| docker cp "$tmp" "$container:/app/out/$bin" | ||
| rm "$tmp" | ||
|
|
||
| echo "==> Restarting $container..." | ||
| docker restart "$container" | ||
| fi | ||
|
|
||
| echo "==> Done. $container is live with the new binary." | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we make this volume external so it can be used across workspaces/worktrees to improve shared caching