2026-04-15 15:16:57 +01:00
|
|
|
version: '3'
|
|
|
|
|
|
2026-05-22 13:40:34 +01:00
|
|
|
# Tasks operate from the workspace root (frontend/). Editor commands pass
|
|
|
|
|
# `editor` as the vite project root (positional after `build` / before the
|
|
|
|
|
# mode flag) or use `--project editor/...` for tsc — so the editor lives
|
|
|
|
|
# under frontend/editor/ without each task needing a cd.
|
|
|
|
|
|
2026-08-19 14:46:00 +00:00
|
|
|
vars:
|
|
|
|
|
# Dev-only browser-tab label so concurrent worktrees are distinguishable. Only
|
|
|
|
|
# the worktree folder basename (e.g. "wt1") is exposed — never the full path,
|
|
|
|
|
# hostname, or user. Dropped from production builds.
|
|
|
|
|
DEV_LABEL:
|
|
|
|
|
sh: >-
|
|
|
|
|
{{if eq OS "windows"}}powershell -NoProfile -Command '$root = git rev-parse --show-toplevel 2>$null; if (-not $root) { $root = (Get-Location).Path }; Split-Path -Leaf $root'{{else}}basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)"{{end}}
|
|
|
|
|
|
2026-04-15 15:16:57 +01:00
|
|
|
tasks:
|
|
|
|
|
install:
|
|
|
|
|
desc: "Install dependencies"
|
|
|
|
|
run: once
|
|
|
|
|
cmds:
|
|
|
|
|
- '{{ if eq .CI "true" }}npm ci{{ else }}npm install{{ end }}'
|
|
|
|
|
sources:
|
|
|
|
|
- package-lock.json
|
|
|
|
|
- package.json
|
|
|
|
|
status:
|
|
|
|
|
- test -d node_modules
|
|
|
|
|
env:
|
|
|
|
|
CI: '{{ .CI | default "false" }}'
|
|
|
|
|
|
|
|
|
|
prepare:env:
|
2026-04-28 17:26:04 +01:00
|
|
|
internal: true
|
|
|
|
|
run: when_changed
|
2026-04-15 15:16:57 +01:00
|
|
|
deps: [install]
|
2026-04-28 17:26:04 +01:00
|
|
|
vars:
|
|
|
|
|
MODE: '{{.MODE | default ""}}'
|
2026-04-15 15:16:57 +01:00
|
|
|
cmds:
|
2026-05-22 13:40:34 +01:00
|
|
|
- npx tsx editor/scripts/setup-env.mts{{if .MODE}} --{{.MODE}}{{end}}
|
2026-04-15 15:16:57 +01:00
|
|
|
sources:
|
2026-05-22 13:40:34 +01:00
|
|
|
- editor/scripts/setup-env.mts
|
2026-04-15 15:16:57 +01:00
|
|
|
generates:
|
2026-05-22 13:40:34 +01:00
|
|
|
- editor/.env.local
|
|
|
|
|
- editor/.env{{if .MODE}}.{{.MODE}}{{end}}.local
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
prepare:icons:
|
2026-04-28 17:26:04 +01:00
|
|
|
internal: true
|
2026-04-15 15:16:57 +01:00
|
|
|
run: once
|
|
|
|
|
deps: [install]
|
|
|
|
|
cmds:
|
2026-05-22 13:40:34 +01:00
|
|
|
- node editor/scripts/generate-icons.js
|
2026-04-15 15:16:57 +01:00
|
|
|
|
2026-06-18 14:49:16 +01:00
|
|
|
prepare:og:
|
|
|
|
|
internal: true
|
|
|
|
|
run: when_changed
|
|
|
|
|
desc: "Regenerate OG/social-preview metadata from the tool registry"
|
|
|
|
|
cmds:
|
|
|
|
|
- node editor/scripts/generate-og-metadata.mjs
|
|
|
|
|
sources:
|
|
|
|
|
- editor/src/core/types/toolId.ts
|
|
|
|
|
- editor/src/core/utils/urlMapping.ts
|
|
|
|
|
- editor/src/core/data/useTranslatedToolRegistry.tsx
|
|
|
|
|
- editor/public/og_images/*.png
|
|
|
|
|
generates:
|
|
|
|
|
- editor/src/core/data/ogImageMap.json
|
|
|
|
|
- editor/public/og-metadata.json
|
|
|
|
|
|
2026-04-15 15:16:57 +01:00
|
|
|
prepare:
|
|
|
|
|
desc: "Set up dev environment"
|
2026-04-28 17:26:04 +01:00
|
|
|
run: when_changed
|
|
|
|
|
vars:
|
|
|
|
|
MODE: '{{.MODE | default ""}}'
|
|
|
|
|
deps:
|
|
|
|
|
- task: prepare:env
|
|
|
|
|
vars: { MODE: '{{.MODE}}' }
|
|
|
|
|
- prepare:icons
|
2026-06-18 14:49:16 +01:00
|
|
|
- prepare:og
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
# ============================================================
|
|
|
|
|
# Development
|
|
|
|
|
# ============================================================
|
|
|
|
|
|
2026-04-28 17:26:04 +01:00
|
|
|
dev:_run:
|
|
|
|
|
internal: true
|
|
|
|
|
ignore_error: true
|
|
|
|
|
vars:
|
|
|
|
|
MODE: '{{.MODE}}'
|
|
|
|
|
PORT: '{{.PORT | default "5173"}}'
|
|
|
|
|
BACKEND_URL: '{{.BACKEND_URL | default "http://localhost:8080"}}'
|
|
|
|
|
OPEN: '{{.OPEN | default ""}}'
|
|
|
|
|
env:
|
|
|
|
|
BACKEND_URL: '{{.BACKEND_URL}}'
|
2026-08-19 14:46:00 +00:00
|
|
|
STIRLING_DEV_LABEL: '{{.DEV_LABEL}}'
|
2026-04-28 17:26:04 +01:00
|
|
|
cmds:
|
2026-05-22 13:40:34 +01:00
|
|
|
- npx vite editor --mode {{.MODE}} --port {{.PORT}}{{if .OPEN}} --open{{end}}
|
2026-04-28 17:26:04 +01:00
|
|
|
|
2026-08-19 14:46:00 +00:00
|
|
|
# Separate from dev:_run rather than a flag on it: Task sets an `env:` key even
|
|
|
|
|
# when its value resolves to empty, and Vite treats an empty process.env VITE_* as
|
|
|
|
|
# authoritative over the committed editor/.env, so folding these in blanks Supabase
|
|
|
|
|
# config for the core, proprietary and desktop dev servers.
|
|
|
|
|
dev:_run:saas:
|
|
|
|
|
internal: true
|
|
|
|
|
ignore_error: true
|
|
|
|
|
# The backend's own env files, so both halves target one project. Paths are
|
|
|
|
|
# relative to this taskfile's dir, `frontend`.
|
|
|
|
|
dotenv: ['../app/.env.saas.local', '../app/.env.saas']
|
|
|
|
|
vars:
|
|
|
|
|
PORT: '{{.PORT | default "5173"}}'
|
|
|
|
|
BACKEND_URL: '{{.BACKEND_URL | default "http://localhost:8080"}}'
|
|
|
|
|
OPEN: '{{.OPEN | default ""}}'
|
|
|
|
|
SAAS_ENV: '{{.SAAS_ENV | default "dev"}}'
|
|
|
|
|
env:
|
|
|
|
|
BACKEND_URL: '{{.BACKEND_URL}}'
|
|
|
|
|
STIRLING_DEV_LABEL: '{{.DEV_LABEL}}'
|
|
|
|
|
SAAS_ENV: '{{.SAAS_ENV}}'
|
|
|
|
|
# A real process.env VITE_* beats a committed .env in Vite (loadEnv applies
|
|
|
|
|
# process.env last), which is what lets this override editor/.env.
|
|
|
|
|
#
|
|
|
|
|
# These must stay `sh:`, not Go templates: dotenv values are visible to Task's
|
|
|
|
|
# embedded shell but not to templates, where {{.SAAS_DEV_PROJECT_REF}} is
|
|
|
|
|
# always empty.
|
|
|
|
|
VITE_SUPABASE_URL:
|
|
|
|
|
sh: |
|
|
|
|
|
case "${SAAS_ENV:-dev}" in
|
|
|
|
|
staging) ref="${SAAS_STAGING_PROJECT_REF:?set it in app/.env.saas.local}" ;;
|
2026-08-27 10:32:32 +00:00
|
|
|
*) ref="${SAAS_DEV_PROJECT_REF:?set it in app/.env.saas.local, or pass SAAS_ENV=staging}" ;;
|
2026-08-19 14:46:00 +00:00
|
|
|
esac
|
|
|
|
|
echo "https://${ref}.supabase.co"
|
|
|
|
|
VITE_SUPABASE_PUBLISHABLE_DEFAULT_KEY:
|
|
|
|
|
sh: |
|
|
|
|
|
case "${SAAS_ENV:-dev}" in
|
|
|
|
|
staging) echo "${SAAS_STAGING_PUBLISHABLE_KEY:?set it in app/.env.saas.local}" ;;
|
2026-08-27 10:32:32 +00:00
|
|
|
*) echo "${SAAS_DEV_PUBLISHABLE_KEY:?set it in app/.env.saas.local, or pass SAAS_ENV=staging}" ;;
|
2026-08-19 14:46:00 +00:00
|
|
|
esac
|
|
|
|
|
cmds:
|
2026-08-27 10:32:32 +00:00
|
|
|
- 'echo ">> frontend {{.SAAS_ENV}}: Supabase $VITE_SUPABASE_URL, backend $BACKEND_URL"'
|
2026-08-19 14:46:00 +00:00
|
|
|
- npx vite editor --mode saas --port {{.PORT}}{{if .OPEN}} --open{{end}}
|
|
|
|
|
|
2026-04-15 15:16:57 +01:00
|
|
|
dev:
|
|
|
|
|
desc: "Start frontend dev server"
|
|
|
|
|
cmds:
|
2026-04-28 17:26:04 +01:00
|
|
|
- task: dev:proprietary
|
|
|
|
|
vars: { PORT: '{{.PORT}}', BACKEND_URL: '{{.BACKEND_URL}}', OPEN: '{{.OPEN}}' }
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
dev:core:
|
|
|
|
|
desc: "Start frontend dev server in core mode"
|
|
|
|
|
deps: [prepare]
|
|
|
|
|
cmds:
|
2026-04-28 17:26:04 +01:00
|
|
|
- task: dev:_run
|
|
|
|
|
vars: { MODE: core, PORT: '{{.PORT}}', BACKEND_URL: '{{.BACKEND_URL}}', OPEN: '{{.OPEN}}' }
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
dev:proprietary:
|
|
|
|
|
desc: "Start frontend dev server in proprietary mode"
|
|
|
|
|
deps: [prepare]
|
|
|
|
|
cmds:
|
2026-04-28 17:26:04 +01:00
|
|
|
- task: dev:_run
|
|
|
|
|
vars: { MODE: proprietary, PORT: '{{.PORT}}', BACKEND_URL: '{{.BACKEND_URL}}', OPEN: '{{.OPEN}}' }
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
dev:saas:
|
2026-08-19 14:46:00 +00:00
|
|
|
desc: "Start frontend dev server in SaaS mode (SAAS_ENV=dev|staging|prod)"
|
2026-04-28 17:26:04 +01:00
|
|
|
deps:
|
|
|
|
|
- task: prepare
|
|
|
|
|
vars: { MODE: saas }
|
2026-08-19 14:46:00 +00:00
|
|
|
vars:
|
|
|
|
|
SAAS_ENV: '{{.SAAS_ENV | default "dev"}}'
|
|
|
|
|
# prod routes to the plain runner, which sets no VITE_SUPABASE_* and so leaves
|
|
|
|
|
# the committed editor/.env alone.
|
|
|
|
|
RUNNER: '{{if eq .SAAS_ENV "prod"}}dev:_run{{else}}dev:_run:saas{{end}}'
|
2026-04-15 15:16:57 +01:00
|
|
|
cmds:
|
2026-08-19 14:46:00 +00:00
|
|
|
- task: '{{.RUNNER}}'
|
|
|
|
|
vars:
|
|
|
|
|
MODE: saas
|
|
|
|
|
PORT: '{{.PORT}}'
|
|
|
|
|
BACKEND_URL: '{{.BACKEND_URL}}'
|
|
|
|
|
OPEN: '{{.OPEN}}'
|
|
|
|
|
SAAS_ENV: '{{.SAAS_ENV}}'
|
2026-04-15 15:16:57 +01:00
|
|
|
|
2026-08-27 10:32:32 +00:00
|
|
|
staging:saas:
|
|
|
|
|
desc: "Start frontend dev server against the shared v3 staging project"
|
|
|
|
|
cmds:
|
|
|
|
|
- task: dev:saas
|
|
|
|
|
vars:
|
|
|
|
|
SAAS_ENV: staging
|
|
|
|
|
PORT: '{{.PORT}}'
|
|
|
|
|
BACKEND_URL: '{{.BACKEND_URL}}'
|
|
|
|
|
OPEN: '{{.OPEN}}'
|
|
|
|
|
|
2026-04-15 15:16:57 +01:00
|
|
|
dev:desktop:
|
|
|
|
|
desc: "Start frontend dev server in desktop mode"
|
2026-04-28 17:26:04 +01:00
|
|
|
deps:
|
|
|
|
|
- task: prepare
|
|
|
|
|
vars: { MODE: desktop }
|
2026-04-15 15:16:57 +01:00
|
|
|
cmds:
|
2026-04-28 17:26:04 +01:00
|
|
|
- task: dev:_run
|
|
|
|
|
vars: { MODE: desktop, PORT: '{{.PORT}}', BACKEND_URL: '{{.BACKEND_URL}}', OPEN: '{{.OPEN}}' }
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
dev:prototypes:
|
|
|
|
|
desc: "Start frontend dev server in prototypes mode"
|
|
|
|
|
deps: [prepare]
|
|
|
|
|
cmds:
|
2026-04-28 17:26:04 +01:00
|
|
|
- task: dev:_run
|
|
|
|
|
vars: { MODE: prototypes, PORT: '{{.PORT}}', BACKEND_URL: '{{.BACKEND_URL}}', OPEN: '{{.OPEN}}' }
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
# ============================================================
|
|
|
|
|
# Build
|
|
|
|
|
# ============================================================
|
|
|
|
|
|
|
|
|
|
build:
|
|
|
|
|
desc: "Production build (default mode)"
|
|
|
|
|
deps: [prepare]
|
|
|
|
|
cmds:
|
2026-05-22 13:40:34 +01:00
|
|
|
- npx vite build editor
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
build:core:
|
|
|
|
|
desc: "Build for core mode"
|
|
|
|
|
deps: [prepare]
|
|
|
|
|
cmds:
|
2026-05-22 13:40:34 +01:00
|
|
|
- npx vite build editor --mode core
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
build:proprietary:
|
|
|
|
|
desc: "Build for proprietary mode"
|
|
|
|
|
deps: [prepare]
|
2026-06-22 17:22:36 +01:00
|
|
|
vars:
|
|
|
|
|
PREVIEW: '{{.PREVIEW | default ""}}'
|
2026-04-15 15:16:57 +01:00
|
|
|
cmds:
|
2026-06-22 17:22:36 +01:00
|
|
|
- '{{if .PREVIEW}}VITE_BUILD_FOR_PREVIEW=1 {{end}}npx vite build editor --mode proprietary'
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
build:saas:
|
|
|
|
|
desc: "Build for SaaS mode"
|
2026-04-28 17:26:04 +01:00
|
|
|
deps:
|
|
|
|
|
- task: prepare
|
|
|
|
|
vars: { MODE: saas }
|
2026-04-15 15:16:57 +01:00
|
|
|
cmds:
|
2026-05-22 13:40:34 +01:00
|
|
|
- npx vite build editor --mode saas
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
build:desktop:
|
|
|
|
|
desc: "Build for desktop mode"
|
2026-04-28 17:26:04 +01:00
|
|
|
deps:
|
|
|
|
|
- task: prepare
|
|
|
|
|
vars: { MODE: desktop }
|
2026-04-15 15:16:57 +01:00
|
|
|
cmds:
|
2026-05-22 13:40:34 +01:00
|
|
|
- npx vite build editor --mode desktop
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
build:prototypes:
|
|
|
|
|
desc: "Build for prototypes mode"
|
|
|
|
|
deps: [prepare]
|
|
|
|
|
cmds:
|
2026-05-22 13:40:34 +01:00
|
|
|
- npx vite build editor --mode prototypes
|
2026-04-15 15:16:57 +01:00
|
|
|
|
2026-06-02 17:08:24 +01:00
|
|
|
|
|
|
|
|
storybook:
|
|
|
|
|
desc: "Start Storybook dev server"
|
2026-07-30 09:13:41 +01:00
|
|
|
deps: [prepare]
|
2026-06-02 17:08:24 +01:00
|
|
|
cmds:
|
|
|
|
|
- npx storybook dev -p 6006 {{.CLI_ARGS}}
|
|
|
|
|
|
|
|
|
|
storybook:build:
|
|
|
|
|
desc: "Build static Storybook"
|
2026-07-30 09:13:41 +01:00
|
|
|
deps: [prepare]
|
2026-06-02 17:08:24 +01:00
|
|
|
cmds:
|
|
|
|
|
- npx storybook build {{.CLI_ARGS}}
|
|
|
|
|
|
2026-07-28 17:06:06 +01:00
|
|
|
storybook:browser:
|
|
|
|
|
internal: true
|
|
|
|
|
desc: "Install the Chromium build the story scan runs in"
|
|
|
|
|
run: once
|
|
|
|
|
deps: [install]
|
|
|
|
|
cmds:
|
|
|
|
|
- npx playwright install chromium
|
|
|
|
|
|
|
|
|
|
storybook:test:
|
2026-07-29 12:28:24 +01:00
|
|
|
desc: "Scan every story in real Chromium: it must render and pass axe"
|
2026-07-30 09:13:41 +01:00
|
|
|
deps: [prepare, storybook:browser]
|
2026-07-28 17:06:06 +01:00
|
|
|
cmds:
|
|
|
|
|
# Runs each story as a browser test. Pass a filter through, e.g.
|
|
|
|
|
# task frontend:storybook:test -- Button
|
|
|
|
|
- npx vitest run --config .storybook/vitest.config.ts {{.CLI_ARGS}}
|
|
|
|
|
|
2026-08-14 14:02:16 +01:00
|
|
|
storybook:a11y:light:
|
|
|
|
|
desc: "a11y gate over every story in light mode"
|
2026-07-30 09:13:41 +01:00
|
|
|
deps: [prepare, storybook:browser]
|
2026-07-29 12:28:24 +01:00
|
|
|
cmds:
|
2026-08-14 14:02:16 +01:00
|
|
|
- node .storybook/a11y-scan.mjs {{.CLI_ARGS}}
|
2026-07-29 12:28:24 +01:00
|
|
|
- node .storybook/a11y-check.mjs --in .a11y-scan --manifest .a11y-scan/manifest.txt
|
2026-08-14 14:02:16 +01:00
|
|
|
|
|
|
|
|
storybook:a11y:dark:
|
|
|
|
|
desc: "a11y gate over every story in dark mode"
|
|
|
|
|
deps: [prepare, storybook:browser]
|
|
|
|
|
cmds:
|
|
|
|
|
- SCAN_THEME=dark node .storybook/a11y-scan.mjs {{.CLI_ARGS}}
|
2026-08-10 12:06:18 +01:00
|
|
|
- node .storybook/a11y-check.mjs --in .a11y-scan --manifest .a11y-scan/manifest.txt --baseline .storybook/a11y-baseline.dark.json
|
2026-07-29 12:28:24 +01:00
|
|
|
|
2026-08-14 14:02:16 +01:00
|
|
|
storybook:a11y:
|
|
|
|
|
desc: "a11y gate over every story, light and dark"
|
|
|
|
|
cmds:
|
|
|
|
|
- task: storybook:a11y:light
|
|
|
|
|
- task: storybook:a11y:dark
|
|
|
|
|
|
2026-07-29 12:28:24 +01:00
|
|
|
storybook:a11y:changed:
|
2026-07-29 15:18:55 +01:00
|
|
|
desc: "a11y gate over the stories this branch affects (default base origin/main)"
|
2026-07-29 12:28:24 +01:00
|
|
|
summary: |
|
2026-07-29 15:18:55 +01:00
|
|
|
Scans the stories a branch affects, which is what pull requests run — a
|
|
|
|
|
full scan takes ~30 minutes, far too long to sit in front of every merge.
|
|
|
|
|
A story is affected if its file changed, or if a same-named sibling
|
|
|
|
|
source file changed (editing Button.tsx or Button.css re-scans
|
|
|
|
|
Button.stories.tsx — the story renders the live component, so a component
|
|
|
|
|
edit changes what the story shows without touching the story file).
|
|
|
|
|
Changes that ripple further than a component's own stories are covered by
|
|
|
|
|
the nightly full sweep.
|
2026-07-29 12:28:24 +01:00
|
|
|
|
|
|
|
|
Pass a base ref through CLI_ARGS, e.g.
|
|
|
|
|
task frontend:storybook:a11y:changed -- origin/release
|
|
|
|
|
vars:
|
|
|
|
|
BASE: '{{.CLI_ARGS | default "origin/main"}}'
|
|
|
|
|
CHANGED:
|
2026-07-29 15:18:55 +01:00
|
|
|
sh: node .storybook/a11y-changed.mjs {{.CLI_ARGS | default "origin/main"}}
|
2026-07-29 12:28:24 +01:00
|
|
|
cmds:
|
|
|
|
|
- cmd: |
|
2026-07-30 09:13:41 +01:00
|
|
|
if [ -z '{{.CHANGED}}' ]; then
|
2026-07-29 15:18:55 +01:00
|
|
|
echo "a11y: no story files affected vs {{.BASE}} — nothing to check"
|
2026-07-29 12:28:24 +01:00
|
|
|
exit 0
|
|
|
|
|
fi
|
2026-08-14 14:02:16 +01:00
|
|
|
rc=0
|
|
|
|
|
task frontend:storybook:a11y:light -- {{.CHANGED}} || rc=1
|
|
|
|
|
task frontend:storybook:a11y:dark -- {{.CHANGED}} || rc=1
|
|
|
|
|
exit $rc
|
2026-07-29 12:28:24 +01:00
|
|
|
|
|
|
|
|
storybook:a11y:record:
|
2026-08-10 12:06:18 +01:00
|
|
|
desc: "Re-record both a11y baselines (run after intentionally fixing/adding violations)"
|
2026-07-30 09:13:41 +01:00
|
|
|
deps: [prepare, storybook:browser]
|
2026-07-29 12:28:24 +01:00
|
|
|
cmds:
|
2026-07-29 15:18:55 +01:00
|
|
|
- node .storybook/a11y-scan.mjs
|
2026-07-29 12:28:24 +01:00
|
|
|
- node .storybook/a11y-check.mjs --in .a11y-scan --manifest .a11y-scan/manifest.txt --record
|
2026-08-10 12:06:18 +01:00
|
|
|
- SCAN_THEME=dark node .storybook/a11y-scan.mjs
|
|
|
|
|
- node .storybook/a11y-check.mjs --in .a11y-scan --manifest .a11y-scan/manifest.txt --record --baseline .storybook/a11y-baseline.dark.json
|
2026-07-29 12:28:24 +01:00
|
|
|
|
2026-04-15 15:16:57 +01:00
|
|
|
# ============================================================
|
|
|
|
|
# Code quality
|
|
|
|
|
# ============================================================
|
|
|
|
|
|
|
|
|
|
lint:
|
|
|
|
|
desc: "Run linting"
|
|
|
|
|
deps: [install]
|
2026-06-05 15:11:26 +01:00
|
|
|
cmds:
|
2026-08-07 17:02:11 +01:00
|
|
|
- task: lint:oxlint
|
2026-07-15 13:11:00 +01:00
|
|
|
- task: lint:colors
|
2026-07-31 17:46:31 +01:00
|
|
|
- task: lint:css
|
|
|
|
|
|
|
|
|
|
lint:css:
|
|
|
|
|
desc: "Lint stylesheets for duplicate selectors"
|
|
|
|
|
deps: [install]
|
|
|
|
|
cmds:
|
|
|
|
|
# Covers the whole editor tree, including the portal/processor layer and
|
|
|
|
|
# public/css. Vendored CSS and build output are excluded via ignoreFiles
|
|
|
|
|
# in stylelint.config.mjs.
|
|
|
|
|
- npx stylelint "editor/**/*.css"
|
2026-07-15 13:11:00 +01:00
|
|
|
|
|
|
|
|
lint:colors:
|
2026-07-23 09:05:56 +00:00
|
|
|
desc: "Enforce theme tokens — no hardcoded colours or raw primitives in components"
|
|
|
|
|
aliases: [lint:colours]
|
2026-07-15 13:11:00 +01:00
|
|
|
deps: [install]
|
|
|
|
|
cmds:
|
|
|
|
|
- node editor/scripts/lint/theme-lint.mjs
|
2026-07-23 09:05:56 +00:00
|
|
|
- node editor/scripts/lint/theme-lint.mjs css-colors
|
|
|
|
|
- node editor/scripts/lint/theme-lint.mjs code-colors
|
|
|
|
|
- node editor/scripts/lint/theme-lint.mjs no-primitives
|
2026-07-15 13:11:00 +01:00
|
|
|
|
|
|
|
|
contrast:
|
|
|
|
|
desc: "Report low-contrast theme token pairs (warning only, never blocks)"
|
|
|
|
|
deps: [install]
|
|
|
|
|
cmds:
|
|
|
|
|
- node editor/scripts/lint/theme-lint.mjs contrast
|
2026-06-05 15:11:26 +01:00
|
|
|
|
2026-08-07 17:02:11 +01:00
|
|
|
lint:oxlint:
|
|
|
|
|
desc: "Run oxlint linting"
|
2026-06-05 15:11:26 +01:00
|
|
|
deps: [install]
|
2026-04-15 15:16:57 +01:00
|
|
|
cmds:
|
2026-08-07 17:02:11 +01:00
|
|
|
- npx oxlint --config oxlint.config.ts --max-warnings=0
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
lint:fix:
|
|
|
|
|
desc: "Auto-fix lint issues"
|
|
|
|
|
deps: [install]
|
|
|
|
|
cmds:
|
2026-08-07 17:02:11 +01:00
|
|
|
- npx oxlint --config oxlint.config.ts --fix
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
format:
|
|
|
|
|
desc: "Auto-fix code formatting"
|
|
|
|
|
deps: [install]
|
|
|
|
|
cmds:
|
2026-08-24 10:34:12 +00:00
|
|
|
- npx oxfmt --write .
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
format:check:
|
|
|
|
|
desc: "Check code formatting"
|
|
|
|
|
deps: [install]
|
|
|
|
|
cmds:
|
2026-08-24 10:34:12 +00:00
|
|
|
- npx oxfmt --check .
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
fix:
|
|
|
|
|
desc: "Auto-fix lint and format"
|
|
|
|
|
cmds:
|
|
|
|
|
- task: format
|
|
|
|
|
- task: lint:fix
|
|
|
|
|
|
|
|
|
|
typecheck:
|
|
|
|
|
desc: "Typecheck default build of the app"
|
|
|
|
|
cmds:
|
|
|
|
|
- task: typecheck:proprietary
|
|
|
|
|
|
2026-06-26 16:05:07 +01:00
|
|
|
typecheck:_run:
|
|
|
|
|
internal: true
|
|
|
|
|
cmds:
|
2026-07-15 13:21:34 +01:00
|
|
|
- 'npx tsc --noEmit --project {{.PROJECT}}'
|
2026-06-26 16:05:07 +01:00
|
|
|
|
2026-04-15 15:16:57 +01:00
|
|
|
typecheck:core:
|
|
|
|
|
desc: "Typecheck core build variant"
|
|
|
|
|
deps: [prepare]
|
|
|
|
|
cmds:
|
2026-06-26 16:05:07 +01:00
|
|
|
- task: typecheck:_run
|
|
|
|
|
vars: { PROJECT: editor/src/core/tsconfig.json }
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
typecheck:proprietary:
|
|
|
|
|
desc: "Typecheck proprietary build variant"
|
|
|
|
|
deps: [prepare]
|
|
|
|
|
cmds:
|
2026-06-26 16:05:07 +01:00
|
|
|
- task: typecheck:_run
|
|
|
|
|
vars: { PROJECT: editor/src/proprietary/tsconfig.json }
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
typecheck:saas:
|
|
|
|
|
desc: "Typecheck SaaS build variant"
|
2026-04-28 17:26:04 +01:00
|
|
|
deps:
|
|
|
|
|
- task: prepare
|
|
|
|
|
vars: { MODE: saas }
|
2026-04-15 15:16:57 +01:00
|
|
|
cmds:
|
2026-06-26 16:05:07 +01:00
|
|
|
- task: typecheck:_run
|
|
|
|
|
vars: { PROJECT: editor/src/saas/tsconfig.json }
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
typecheck:desktop:
|
|
|
|
|
desc: "Typecheck desktop build variant"
|
2026-04-28 17:26:04 +01:00
|
|
|
deps:
|
|
|
|
|
- task: prepare
|
|
|
|
|
vars: { MODE: desktop }
|
2026-04-15 15:16:57 +01:00
|
|
|
cmds:
|
2026-06-26 16:05:07 +01:00
|
|
|
- task: typecheck:_run
|
|
|
|
|
vars: { PROJECT: editor/src/desktop/tsconfig.json }
|
2026-04-15 15:16:57 +01:00
|
|
|
|
2026-06-17 11:12:05 +01:00
|
|
|
typecheck:cloud:
|
|
|
|
|
desc: "Typecheck cloud shared layer (standalone)"
|
|
|
|
|
deps: [prepare]
|
|
|
|
|
cmds:
|
2026-06-26 16:05:07 +01:00
|
|
|
- task: typecheck:_run
|
|
|
|
|
vars: { PROJECT: editor/src/cloud/tsconfig.json }
|
2026-06-17 11:12:05 +01:00
|
|
|
|
2026-04-15 15:16:57 +01:00
|
|
|
typecheck:scripts:
|
|
|
|
|
desc: "Typecheck scripts"
|
|
|
|
|
deps: [prepare]
|
|
|
|
|
cmds:
|
2026-06-26 16:05:07 +01:00
|
|
|
- task: typecheck:_run
|
|
|
|
|
vars: { PROJECT: editor/scripts/tsconfig.json }
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
typecheck:prototypes:
|
|
|
|
|
desc: "Typecheck prototypes build variant"
|
|
|
|
|
deps: [prepare]
|
|
|
|
|
cmds:
|
2026-06-26 16:05:07 +01:00
|
|
|
- task: typecheck:_run
|
|
|
|
|
vars: { PROJECT: editor/src/prototypes/tsconfig.json }
|
2026-04-15 15:16:57 +01:00
|
|
|
|
2026-06-02 17:08:24 +01:00
|
|
|
typecheck:portal:
|
|
|
|
|
desc: "Typecheck developer portal build variant"
|
|
|
|
|
deps: [install]
|
|
|
|
|
cmds:
|
2026-06-26 16:05:07 +01:00
|
|
|
- task: typecheck:_run
|
2026-07-03 14:20:02 +01:00
|
|
|
vars: { PROJECT: editor/src/portal/tsconfig.json }
|
2026-06-02 17:08:24 +01:00
|
|
|
|
2026-07-31 14:20:07 +01:00
|
|
|
typecheck:storybook:
|
|
|
|
|
desc: "Typecheck Storybook config and stories"
|
|
|
|
|
deps: [prepare]
|
|
|
|
|
cmds:
|
|
|
|
|
- task: typecheck:_run
|
|
|
|
|
vars: { PROJECT: .storybook/tsconfig.json }
|
|
|
|
|
|
2026-04-15 15:16:57 +01:00
|
|
|
typecheck:all:
|
|
|
|
|
desc: "Typecheck all build variants"
|
|
|
|
|
cmds:
|
|
|
|
|
- task: typecheck:core
|
|
|
|
|
- task: typecheck:proprietary
|
|
|
|
|
- task: typecheck:saas
|
|
|
|
|
- task: typecheck:desktop
|
2026-06-17 11:12:05 +01:00
|
|
|
- task: typecheck:cloud
|
2026-04-15 15:16:57 +01:00
|
|
|
- task: typecheck:scripts
|
2026-05-01 10:19:38 +01:00
|
|
|
- task: typecheck:prototypes
|
2026-06-02 17:08:24 +01:00
|
|
|
- task: typecheck:portal
|
2026-07-31 14:20:07 +01:00
|
|
|
- task: typecheck:storybook
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
# ============================================================
|
|
|
|
|
# Quality Gate
|
|
|
|
|
# ============================================================
|
|
|
|
|
|
|
|
|
|
check:
|
|
|
|
|
desc: "Quick quality gate for local development"
|
|
|
|
|
cmds:
|
|
|
|
|
- task: typecheck
|
|
|
|
|
- task: lint
|
|
|
|
|
- task: format:check
|
|
|
|
|
- task: test
|
|
|
|
|
|
2026-06-18 14:49:16 +01:00
|
|
|
og:check:
|
|
|
|
|
desc: "Fail if committed OG/social-preview metadata is out of date"
|
|
|
|
|
cmds:
|
|
|
|
|
- node editor/scripts/generate-og-metadata.mjs --check
|
|
|
|
|
|
2026-04-15 15:16:57 +01:00
|
|
|
check:all:
|
|
|
|
|
desc: "Full CI quality gate"
|
|
|
|
|
cmds:
|
2026-06-18 14:49:16 +01:00
|
|
|
# Runs first, before prepare regenerates: guards the committed og-metadata.json /
|
|
|
|
|
# ogImageMap.json that the Cloudflare Pages (plain `vite build`) deploy relies on.
|
|
|
|
|
- task: og:check
|
2026-04-15 15:16:57 +01:00
|
|
|
- task: typecheck:all
|
|
|
|
|
- task: lint
|
|
|
|
|
- task: format:check
|
|
|
|
|
- task: build
|
|
|
|
|
- task: test
|
2026-06-02 17:08:24 +01:00
|
|
|
- task: storybook:build
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
# ============================================================
|
|
|
|
|
# Test
|
|
|
|
|
# ============================================================
|
|
|
|
|
|
|
|
|
|
test:
|
|
|
|
|
desc: "Run tests"
|
2026-06-26 14:21:53 +01:00
|
|
|
cmds:
|
|
|
|
|
- task: test:editor
|
|
|
|
|
|
|
|
|
|
test:editor:
|
|
|
|
|
desc: "Run editor tests"
|
2026-06-10 10:49:00 +01:00
|
|
|
deps: [prepare]
|
2026-08-11 13:50:48 +01:00
|
|
|
vars:
|
|
|
|
|
COVERAGE: '{{.COVERAGE | default .CI | default "false"}}'
|
2026-04-15 15:16:57 +01:00
|
|
|
cmds:
|
2026-08-11 13:50:48 +01:00
|
|
|
- >
|
|
|
|
|
npx vitest run --root editor
|
|
|
|
|
{{if eq .COVERAGE "true"}}--coverage
|
|
|
|
|
--coverage.provider=v8
|
|
|
|
|
--coverage.reporter=text-summary
|
|
|
|
|
--coverage.reporter=json-summary
|
|
|
|
|
--coverage.reporter=html
|
|
|
|
|
--coverage.reportsDirectory=./coverage{{end}}
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
test:watch:
|
|
|
|
|
desc: "Run tests in watch mode"
|
2026-06-10 10:49:00 +01:00
|
|
|
deps: [prepare]
|
2026-04-15 15:16:57 +01:00
|
|
|
cmds:
|
2026-05-22 13:40:34 +01:00
|
|
|
- npx vitest --watch --root editor
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
test:coverage:
|
2026-06-02 14:59:10 +01:00
|
|
|
desc: "Run tests with coverage (one-shot; CI-friendly)."
|
2026-04-15 15:16:57 +01:00
|
|
|
cmds:
|
2026-08-11 13:50:48 +01:00
|
|
|
- task: test:editor
|
|
|
|
|
vars: { COVERAGE: "true" }
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
# ============================================================
|
|
|
|
|
# Code Generation
|
|
|
|
|
# ============================================================
|
|
|
|
|
|
2026-07-07 08:47:07 +01:00
|
|
|
tool-models:
|
|
|
|
|
desc: "Generate tool API types from the Java OpenAPI spec"
|
|
|
|
|
deps: [install, ":backend:swagger"]
|
|
|
|
|
cmds:
|
2026-08-03 15:13:43 +01:00
|
|
|
- npx tsx editor/scripts/generate-tool-api-types.mts --spec ../SwaggerDoc.json --output editor/src/core/types/toolApiTypes.ts --io-output editor/src/core/types/toolIO.ts
|
2026-08-24 10:34:12 +00:00
|
|
|
- task: format
|
2026-07-07 08:47:07 +01:00
|
|
|
sources:
|
|
|
|
|
- editor/scripts/generate-tool-api-types.mts
|
|
|
|
|
- ../SwaggerDoc.json
|
|
|
|
|
generates:
|
|
|
|
|
- editor/src/core/types/toolApiTypes.ts
|
2026-08-03 15:13:43 +01:00
|
|
|
- editor/src/core/types/toolIO.ts
|
2026-07-07 08:47:07 +01:00
|
|
|
|
|
|
|
|
tool-models:check:
|
|
|
|
|
desc: "Fail if committed tool API types are out of date"
|
|
|
|
|
cmds:
|
2026-08-24 10:34:12 +00:00
|
|
|
- task: tool-models
|
|
|
|
|
- git diff --exit-code -- editor/src/core/types/toolApiTypes.ts editor/src/core/types/toolIO.ts
|
2026-07-07 08:47:07 +01:00
|
|
|
|
2026-04-15 15:16:57 +01:00
|
|
|
licenses:generate:
|
|
|
|
|
desc: "Generate frontend license report"
|
|
|
|
|
deps: [install]
|
|
|
|
|
cmds:
|
2026-05-22 13:40:34 +01:00
|
|
|
- node editor/scripts/generate-licenses.js
|
2026-06-17 17:18:50 +01:00
|
|
|
|
|
|
|
|
# ============================================================
|
|
|
|
|
# Clean
|
|
|
|
|
# ============================================================
|
|
|
|
|
|
|
|
|
|
clean:
|
|
|
|
|
desc: "Clean build artifacts and caches"
|
|
|
|
|
cmds:
|
2026-07-03 14:20:02 +01:00
|
|
|
- cmd: powershell rm -Recurse -Force -ErrorAction SilentlyContinue node_modules/.vite, editor/dist, dist
|
2026-06-17 17:18:50 +01:00
|
|
|
platforms: [windows]
|
2026-07-03 14:20:02 +01:00
|
|
|
- cmd: rm -rf node_modules/.vite editor/dist dist
|
2026-06-17 17:18:50 +01:00
|
|
|
platforms: [linux, darwin]
|