From 000634607a57b3a8f1b8bd3c8532e012fe1f4310 Mon Sep 17 00:00:00 2001 From: Mantra <87142457+mantrakp04@users.noreply.github.com> Date: Wed, 22 Apr 2026 15:35:27 -0700 Subject: [PATCH] fix(internal-tool): continue dev startup when spacetime publish fails (#1371) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - pre-dev.mjs now warns and exits 0 when the local SpacetimeDB publish fails, instead of aborting `next dev` - Lets contributors without a running local SpacetimeDB server still start the internal-tool dev server - Updates the header comment to reflect the new behavior ## Test plan - [ ] Run `pnpm dev` in `apps/internal-tool` with no SpacetimeDB server running — dev server should still start, with a warning - [ ] Run with SpacetimeDB server running and `spacetime` CLI installed — publish still runs and dev proceeds - [ ] Run without `spacetime` CLI installed — existing warn-and-continue path still works ## Summary by CodeRabbit * **Chores** * Updated local publishing configuration to derive server settings from environment variables for improved flexibility and easier customization. --- .../scripts/spacetime-publish.mjs | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/apps/internal-tool/scripts/spacetime-publish.mjs b/apps/internal-tool/scripts/spacetime-publish.mjs index 6273f9191..50f6703fd 100644 --- a/apps/internal-tool/scripts/spacetime-publish.mjs +++ b/apps/internal-tool/scripts/spacetime-publish.mjs @@ -6,8 +6,27 @@ import { spawnSync } from "node:child_process"; const target = process.argv[2]; // "local" or "prod" +/** HTTP API for 'spacetime publish' (matches docker/dependencies/docker.compose.yaml host port ...39). */ +function localPublishServerUrl() { + if (process.env.STACK_SPACETIME_PUBLISH_URL) { + return process.env.STACK_SPACETIME_PUBLISH_URL; + } + const prefix = process.env.NEXT_PUBLIC_STACK_PORT_PREFIX ?? "81"; + return `http://127.0.0.1:${prefix}39`; +} + const configs = { - local: ["publish", "stack-auth-llm", "--server", "local", "-p", "spacetimedb", "--yes", "--no-config", "--delete-data=on-conflict"], + local: [ + "publish", + "stack-auth-llm", + "--server", + localPublishServerUrl(), + "-p", + "spacetimedb", + "--yes", + "--no-config", + "--delete-data=on-conflict", + ], prod: ["publish", "stack-auth-llm", "--server", "maincloud", "-p", "spacetimedb", "--yes", "--no-config"], };