Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .figma/make/dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail

# Start the Vite dev server with HMR.

cd "$(dirname "$0")/../.."

# Load environment variables
source .figma/make/env

exec npm run app:dev
15 changes: 15 additions & 0 deletions .figma/make/env
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail

# Environment variables for the project.
# SDS reads FIGMA_ACCESS_TOKEN and FIGMA_FILE_KEY from a local .env file
# (see .env-rename). Vite's dev server runs on port 8000 by default
# (configured in vite.config.ts).

# Dev server
export VITE_PORT="${VITE_PORT:-8000}"
export VITE_HOST="${VITE_HOST:-localhost}"

# Figma Make integration
PORT=8000
FIGMA_MAKE_URL=http://localhost:8000
10 changes: 10 additions & 0 deletions .figma/make/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -euo pipefail

# Install project dependencies.

cd "$(dirname "$0")/../.."

npm install

echo "Project dependencies installed."
24 changes: 24 additions & 0 deletions .figma/make/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -euo pipefail

# Initial setup: install system-level dependencies needed to build/run the project.

# Require Node.js >= 18
if ! command -v node &>/dev/null; then
echo "Error: Node.js is not installed. Install Node.js 18+ and re-run." >&2
exit 1
fi

NODE_MAJOR=$(node -e "process.stdout.write(String(process.versions.node.split('.')[0]))")
if [ "$NODE_MAJOR" -lt 18 ]; then
echo "Error: Node.js 18+ is required (found v$(node -v))." >&2
exit 1
fi

# Require npm
if ! command -v npm &>/dev/null; then
echo "Error: npm is not installed." >&2
exit 1
fi

echo "System dependencies OK (Node $(node -v), npm $(npm -v))."
53 changes: 53 additions & 0 deletions .figma/make/verify
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env bash
set -uo pipefail

# Verify the project is correctly configured and can build.

cd "$(dirname "$0")/../.."

# Load environment variables
source .figma/make/env

ERRORS=0

# Check node_modules exist
if [ ! -d "node_modules" ]; then
echo "FAIL: node_modules missing. Run .figma/make/install first." >&2
ERRORS=$((ERRORS + 1))
fi

# TypeScript compilation check
echo "Checking TypeScript..."
if npx tsc --noEmit 2>/dev/null; then
echo " OK: TypeScript compiles cleanly."
else
echo " FAIL: TypeScript errors detected." >&2
ERRORS=$((ERRORS + 1))
fi

# Lint check
echo "Checking ESLint..."
if npm run app:lint --silent 2>/dev/null; then
echo " OK: No lint errors."
else
echo " FAIL: Lint errors detected." >&2
ERRORS=$((ERRORS + 1))
fi

# Production build check
echo "Checking production build..."
if npm run app:build --silent 2>/dev/null; then
echo " OK: Production build succeeded."
else
echo " FAIL: Production build failed." >&2
ERRORS=$((ERRORS + 1))
fi

if [ "$ERRORS" -gt 0 ]; then
echo ""
echo "$ERRORS verification(s) failed."
exit 1
fi

echo ""
echo "All verifications passed."