From 3874b0ddfb81f396af20359ba374eec3c0f6c54b Mon Sep 17 00:00:00 2001 From: GRACENOBLE Date: Thu, 16 Jul 2026 15:35:01 +0300 Subject: [PATCH 1/2] chore: move setup/dev scripts into scripts/ directory Consolidates setup.sh, setup.ps1, dev.sh, and dev.ps1 under a top-level scripts/ directory instead of cluttering the repo root, and updates the Makefile plus README/CONTRIBUTING references accordingly. Co-Authored-By: Claude Sonnet 5 --- CONTRIBUTING.md | 8 ++++---- Makefile | 8 ++++---- README.md | 13 +++++++------ dev.ps1 => scripts/dev.ps1 | 2 +- dev.sh => scripts/dev.sh | 2 +- setup.ps1 => scripts/setup.ps1 | 2 +- setup.sh => scripts/setup.sh | 2 +- 7 files changed, 19 insertions(+), 18 deletions(-) rename dev.ps1 => scripts/dev.ps1 (94%) rename dev.sh => scripts/dev.sh (95%) rename setup.ps1 => scripts/setup.ps1 (98%) rename setup.sh => scripts/setup.sh (99%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e2e718c..ef6d914 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -105,20 +105,20 @@ Run the setup script once after cloning. It checks prerequisites, installs depen ```bash # macOS / Linux -./setup.sh +./scripts/setup.sh # Windows -./setup.ps1 +./scripts/setup.ps1 ``` ### Starting all services ```bash # macOS / Linux — starts Postgres, backend, and web in one terminal -./dev.sh +./scripts/dev.sh # Windows — opens three separate PowerShell windows -./dev.ps1 +./scripts/dev.ps1 ``` Or start services individually: diff --git a/Makefile b/Makefile index af8f204..f02aabc 100644 --- a/Makefile +++ b/Makefile @@ -9,18 +9,18 @@ setup: ifeq ($(OS),Windows_NT) - powershell -ExecutionPolicy Bypass -File setup.ps1 + powershell -ExecutionPolicy Bypass -File scripts/setup.ps1 else - bash setup.sh + bash scripts/setup.sh endif # ── Development ──────────────────────────────────────────────────────────────── dev: ifeq ($(OS),Windows_NT) - powershell -ExecutionPolicy Bypass -File dev.ps1 + powershell -ExecutionPolicy Bypass -File scripts/dev.ps1 else - bash dev.sh + bash scripts/dev.sh endif dev-backend: diff --git a/README.md b/README.md index 5079eb1..37c5a20 100644 --- a/README.md +++ b/README.md @@ -68,12 +68,12 @@ git clone https://github.com/your-username/fullstack-template.git cd fullstack-template # First-time setup: installs deps, copies .env.example files, checks prerequisites -./setup.sh # macOS / Linux -.\setup.ps1 # Windows PowerShell +./scripts/setup.sh # macOS / Linux +.\scripts\setup.ps1 # Windows PowerShell # Start all three services (backend + web + mobile hot-reload) in parallel -./dev.sh # macOS / Linux -.\dev.ps1 # Windows PowerShell +./scripts/dev.sh # macOS / Linux +.\scripts\dev.ps1 # Windows PowerShell ``` ### Manual setup @@ -114,8 +114,9 @@ fullstack-template/ ├── TEMPLATE_STATUS.md # Readiness gap tracker ├── docs/ │ └── adr/ # Architecture Decision Records -├── dev.sh / dev.ps1 # Start all services in parallel -├── setup.sh / setup.ps1 # First-run contributor setup +├── scripts/ +│ ├── dev.sh / dev.ps1 # Start all services in parallel +│ └── setup.sh / setup.ps1 # First-run contributor setup ├── renovate.json # Automated dependency updates ├── .claude/ │ ├── agents/ # Specialized Claude subagents diff --git a/dev.ps1 b/scripts/dev.ps1 similarity index 94% rename from dev.ps1 rename to scripts/dev.ps1 index e4620a6..d09686b 100644 --- a/dev.ps1 +++ b/scripts/dev.ps1 @@ -2,7 +2,7 @@ # Usage: .\dev.ps1 # Close each terminal window manually when done. -$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition +$ScriptDir = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Definition) Write-Host "[postgres] Starting Docker Compose (Postgres)..." -ForegroundColor Blue Start-Process powershell -ArgumentList "-NoExit", "-ExecutionPolicy", "Bypass", "-Command", "Set-Location '$ScriptDir\backend'; make docker-run" ` diff --git a/dev.sh b/scripts/dev.sh similarity index 95% rename from dev.sh rename to scripts/dev.sh index 0751ccb..f8b1b56 100644 --- a/dev.sh +++ b/scripts/dev.sh @@ -10,7 +10,7 @@ GREEN='\033[1;32m' YELLOW='\033[1;33m' RESET='\033[0m' -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # Kill all background jobs when the script exits (Ctrl+C or error) trap 'echo ""; echo "Stopping all services..."; kill $(jobs -p) 2>/dev/null; wait' EXIT diff --git a/setup.ps1 b/scripts/setup.ps1 similarity index 98% rename from setup.ps1 rename to scripts/setup.ps1 index ccef726..84cc752 100644 --- a/setup.ps1 +++ b/scripts/setup.ps1 @@ -3,7 +3,7 @@ # Run once after cloning the repo. $ErrorActionPreference = "Continue" -$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition +$ScriptDir = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Definition) $Errors = 0 # Banner diff --git a/setup.sh b/scripts/setup.sh similarity index 99% rename from setup.sh rename to scripts/setup.sh index 585866a..b3d6b4e 100644 --- a/setup.sh +++ b/scripts/setup.sh @@ -12,7 +12,7 @@ RED='\033[0;31m' BOLD='\033[1m' RESET='\033[0m' -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" ERRORS=0 # ── Banner ───────────────────────────────────────────────────────────────────── From fe73bfc93e7c7ab2767976a9c5bd5030872bc8a8 Mon Sep 17 00:00:00 2001 From: GRACENOBLE Date: Fri, 17 Jul 2026 13:25:41 +0300 Subject: [PATCH 2/2] fix: address CodeRabbit review comments on scripts move - Save scripts/dev.ps1 as UTF-8 with BOM so Windows PowerShell correctly reads its non-ASCII characters (em dash, arrow) - Update remaining stale root-level usage/rerun instructions in setup.sh, setup.ps1, dev.sh, and dev.ps1 to the new scripts/ path Co-Authored-By: Claude Sonnet 5 --- scripts/dev.ps1 | 4 ++-- scripts/dev.sh | 2 +- scripts/setup.ps1 | 6 +++--- scripts/setup.sh | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/dev.ps1 b/scripts/dev.ps1 index d09686b..8cb2e3a 100644 --- a/scripts/dev.ps1 +++ b/scripts/dev.ps1 @@ -1,5 +1,5 @@ -# dev.ps1 — start all services in separate PowerShell windows (Windows equivalent of dev.sh) -# Usage: .\dev.ps1 +# dev.ps1 — start all services in separate PowerShell windows (Windows equivalent of dev.sh) +# Usage: .\scripts\dev.ps1 # Close each terminal window manually when done. $ScriptDir = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Definition) diff --git a/scripts/dev.sh b/scripts/dev.sh index f8b1b56..4370fb2 100644 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # dev.sh — start all services in parallel in a single terminal -# Usage: ./dev.sh +# Usage: ./scripts/dev.sh # Press Ctrl+C to stop everything. set -euo pipefail diff --git a/scripts/setup.ps1 b/scripts/setup.ps1 index 84cc752..f3a5190 100644 --- a/scripts/setup.ps1 +++ b/scripts/setup.ps1 @@ -1,5 +1,5 @@ # setup.ps1 -- first-run setup for new contributors (Windows / PowerShell) -# Usage: .\setup.ps1 +# Usage: .\scripts\setup.ps1 # Run once after cloning the repo. $ErrorActionPreference = "Continue" @@ -113,7 +113,7 @@ if (Test-Path $androidHome) { # Abort on failures if ($Errors -gt 0) { Write-Host "" - Write-Host "$Errors prerequisite(s) failed. Fix the issues above and re-run .\setup.ps1." -ForegroundColor Red + Write-Host "$Errors prerequisite(s) failed. Fix the issues above and re-run .\scripts\setup.ps1." -ForegroundColor Red Write-Host "" exit 1 } @@ -167,7 +167,7 @@ Write-Host " You're all set! Run these commands to start developing: " -Foreg Write-Host "============================================================" -ForegroundColor Green Write-Host "" Write-Host " Quickstart (all services in separate windows):" -ForegroundColor White -Write-Host " .\dev.ps1" -ForegroundColor Yellow +Write-Host " .\scripts\dev.ps1" -ForegroundColor Yellow Write-Host "" Write-Host " Or start each service individually:" -ForegroundColor White Write-Host " cd backend; make docker-run # Postgres" -ForegroundColor Blue diff --git a/scripts/setup.sh b/scripts/setup.sh index b3d6b4e..183f1d3 100644 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # setup.sh — first-run setup for new contributors -# Usage: ./setup.sh +# Usage: ./scripts/setup.sh # Run once after cloning the repo. set -euo pipefail @@ -101,7 +101,7 @@ fi # Abort if any hard prerequisite failed if [[ "$ERRORS" -gt 0 ]]; then echo "" - echo -e "${RED}${BOLD}$ERRORS prerequisite(s) failed. Fix the issues above and re-run ./setup.sh.${RESET}" + echo -e "${RED}${BOLD}$ERRORS prerequisite(s) failed. Fix the issues above and re-run ./scripts/setup.sh.${RESET}" echo "" exit 1 fi @@ -146,7 +146,7 @@ echo -e "${BOLD}${GREEN}║ You're all set! Run these commands to start develo echo -e "${BOLD}${GREEN}╚═══════════════════════════════════════════════════════════╝${RESET}" echo "" echo -e " ${BOLD}Quickstart (all services in one terminal):${RESET}" -echo -e " ${YELLOW}./dev.sh${RESET}" +echo -e " ${YELLOW}./scripts/dev.sh${RESET}" echo "" echo -e " ${BOLD}Or start each service individually:${RESET}" echo -e " ${BLUE}cd backend && make docker-run${RESET} # Postgres"