feat(@projects/@magic-civilization): ✨ add designs server subcommand
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
fd41d9ca27
commit
2e6b0fdefe
3 changed files with 11 additions and 3 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
3
run
3
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)"
|
||||
|
|
|
|||
|
|
@ -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" "$@"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue