From 2e6b0fdefeb3cbb687c60c3a5acc98d14e157146 Mon Sep 17 00:00:00 2001 From: Natalie Date: Sun, 26 Apr 2026 15:11:35 -0700 Subject: [PATCH] =?UTF-8?q?feat(@projects/@magic-civilization):=20?= =?UTF-8?q?=E2=9C=A8=20add=20designs=20server=20subcommand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- .project/designs/serve.js | 2 +- run | 3 ++- scripts/run/dev.sh | 9 ++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.project/designs/serve.js b/.project/designs/serve.js index 1b694e9b..c1621c5a 100644 --- a/.project/designs/serve.js +++ b/.project/designs/serve.js @@ -3,7 +3,7 @@ const http = require("http"); const fs = require("fs"); const path = require("path"); -const PORT = 7777; +const PORT = parseInt(process.argv[2] || "7777", 10); const ROOT = __dirname; const MIME = { diff --git a/run b/run index d239543b..04a47289 100755 --- a/run +++ b/run @@ -23,7 +23,8 @@ usage() { echo -e "${YELLOW}Development${NC}" echo " play Launch the game locally" echo " editor Open Godot editor" - echo " guide Start guide dev server (port 5800)" + echo " guide Start guide dev server (port 5800) + designs [port] Serve .project/designs/ HTML sketches (default port 7777)" echo " lint Lint all (GDScript + Rust + TypeScript)" echo " lint:gd GDScript only (gdlint + gdformat --check)" echo " lint:rust Rust only (fmt --check + clippy + machete)" diff --git a/scripts/run/dev.sh b/scripts/run/dev.sh index f91e6b0e..9e2c1871 100644 --- a/scripts/run/dev.sh +++ b/scripts/run/dev.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Dev subcommands: play, editor, guide, screenshot. +# Dev subcommands: play, editor, guide, designs, screenshot. # # Previously this file was 546L conflating lint/format/test/verify/autoplay/ # dev-server into one module. It's now split: @@ -50,6 +50,13 @@ cmd_guide() { pnpm --prefix "$GUIDE_DIR" dev } +cmd_designs() { + local port="${1:-7777}" + echo -e "${BLUE}Starting design viewer (port ${port})...${NC}" + echo -e "${BLUE} http://localhost:${port}${NC}" + node "$REPO_ROOT/.project/designs/serve.js" "$port" +} + cmd_screenshot() { "$REPO_ROOT/tools/screenshot.sh" "$@" }