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-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-07-11 12:44:19 +01:00
|
|
|
# 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. Consumed at dev-serve time by vite.config
|
|
|
|
|
# and dropped from production builds.
|
|
|
|
|
STIRLING_DEV_LABEL:
|
2026-07-20 13:59:55 +02:00
|
|
|
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-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-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:
|
|
|
|
|
desc: "Start frontend dev server in 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-04-28 17:26:04 +01:00
|
|
|
- task: dev:_run
|
|
|
|
|
vars: { MODE: saas, 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"
|
|
|
|
|
deps: [install]
|
|
|
|
|
cmds:
|
|
|
|
|
- npx storybook dev -p 6006 {{.CLI_ARGS}}
|
|
|
|
|
|
|
|
|
|
storybook:build:
|
|
|
|
|
desc: "Build static Storybook"
|
|
|
|
|
deps: [install]
|
|
|
|
|
cmds:
|
|
|
|
|
- npx storybook build {{.CLI_ARGS}}
|
|
|
|
|
|
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:
|
|
|
|
|
- task: lint:eslint
|
|
|
|
|
- task: lint:dpdm
|
2026-07-15 13:11:00 +01:00
|
|
|
- task: lint:colors
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
lint:eslint:
|
|
|
|
|
desc: "Run ESLint linting"
|
|
|
|
|
deps: [install]
|
2026-04-15 15:16:57 +01:00
|
|
|
cmds:
|
|
|
|
|
- npx eslint --max-warnings=0
|
2026-06-05 15:11:26 +01:00
|
|
|
|
|
|
|
|
lint:dpdm:
|
|
|
|
|
desc: "Run circular import linting"
|
|
|
|
|
deps: [install]
|
|
|
|
|
cmds:
|
|
|
|
|
# Globs so dpdm walks the whole tree. dpdm expands the braces itself, so this is
|
2026-07-03 14:20:02 +01:00
|
|
|
# shell-agnostic. Covers the whole editor tree, including the portal layer.
|
|
|
|
|
- npx dpdm "editor/src/**/*.{ts,tsx}" --circular --no-warning --no-tree --exit-code circular:1
|
2026-04-15 15:16:57 +01:00
|
|
|
|
|
|
|
|
lint:fix:
|
|
|
|
|
desc: "Auto-fix lint issues"
|
|
|
|
|
deps: [install]
|
|
|
|
|
cmds:
|
|
|
|
|
- npx eslint --fix
|
|
|
|
|
|
|
|
|
|
format:
|
|
|
|
|
desc: "Auto-fix code formatting"
|
|
|
|
|
deps: [install]
|
|
|
|
|
cmds:
|
|
|
|
|
- npx prettier --write .
|
|
|
|
|
|
|
|
|
|
format:check:
|
|
|
|
|
desc: "Check code formatting"
|
|
|
|
|
deps: [install]
|
|
|
|
|
cmds:
|
|
|
|
|
- npx prettier --check .
|
|
|
|
|
|
|
|
|
|
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-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-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-04-15 15:16:57 +01:00
|
|
|
cmds:
|
2026-05-22 13:40:34 +01:00
|
|
|
- npx vitest run --root editor
|
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-06-10 10:49:00 +01:00
|
|
|
deps: [prepare]
|
2026-04-15 15:16:57 +01:00
|
|
|
cmds:
|
2026-06-02 14:59:10 +01:00
|
|
|
# `vitest run` makes this CI-safe (the bare `vitest` form enters watch
|
|
|
|
|
# mode). Explicit reporter list because v8 + json-summary is what the
|
|
|
|
|
# coverage-summary.py helper consumes; html/text are kept for humans.
|
|
|
|
|
#
|
|
|
|
|
# reportsDirectory is pinned to ./coverage relative to vitest's root
|
|
|
|
|
# (--root editor), so output lands at frontend/editor/coverage/. The
|
|
|
|
|
# CI upload step reads from that path. An earlier attempt with
|
|
|
|
|
# `./editor/coverage` double-nested into frontend/editor/editor/coverage;
|
|
|
|
|
# pinning future-proofs against vitest changing the default.
|
|
|
|
|
- >
|
|
|
|
|
npx vitest run --root editor --coverage
|
|
|
|
|
--coverage.provider=v8
|
|
|
|
|
--coverage.reporter=text-summary
|
|
|
|
|
--coverage.reporter=json-summary
|
|
|
|
|
--coverage.reporter=html
|
|
|
|
|
--coverage.reportsDirectory=./coverage
|
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:
|
|
|
|
|
- npx tsx editor/scripts/generate-tool-api-types.mts --spec ../SwaggerDoc.json --output editor/src/core/types/toolApiTypes.ts
|
|
|
|
|
sources:
|
|
|
|
|
- editor/scripts/generate-tool-api-types.mts
|
|
|
|
|
- ../SwaggerDoc.json
|
|
|
|
|
generates:
|
|
|
|
|
- editor/src/core/types/toolApiTypes.ts
|
|
|
|
|
|
|
|
|
|
tool-models:check:
|
|
|
|
|
desc: "Fail if committed tool API types are out of date"
|
|
|
|
|
deps: [install, ":backend:swagger"]
|
|
|
|
|
cmds:
|
|
|
|
|
- npx tsx editor/scripts/generate-tool-api-types.mts --spec ../SwaggerDoc.json --output editor/src/core/types/toolApiTypes.ts --check
|
|
|
|
|
|
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]
|