-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
178 lines (158 loc) · 5.54 KB
/
Taskfile.yml
File metadata and controls
178 lines (158 loc) · 5.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# Debrief v4.x Build System
#
# Prerequisites:
# - Task (https://taskfile.dev/installation/)
# - uv (curl -LsSf https://astral.sh/uv/install.sh | sh)
# - pnpm (npm install -g pnpm)
#
# Usage:
# task --list Show all available tasks
# task install Install all dependencies
# task test Run all tests
# task build Build all artifacts
# task dev Start development watch mode
# task lint Check code style
# task lint:fix Auto-fix code style issues
# task verify Run full CI checks locally before pushing
# task clean Remove build artifacts
version: '3'
vars:
PYTHON_SOURCES: "services/**/*.py shared/**/*.py"
TS_SOURCES: "apps/**/*.ts apps/**/*.tsx shared/**/*.ts shared/**/*.tsx"
tasks:
default:
desc: "Show available tasks"
cmds:
- task --list
# Precondition checks - used by install task
_check-prereqs:
internal: true
preconditions:
- sh: command -v uv
msg: "uv not found. Install: curl -LsSf https://astral.sh/uv/install.sh | sh"
- sh: command -v pnpm
msg: "pnpm not found. Install: npm install -g pnpm"
install:
desc: "Install all dependencies (Python + Node.js)"
deps: [_check-prereqs]
sources:
- uv.lock
- pnpm-lock.yaml
- pyproject.toml
- package.json
- "**/pyproject.toml"
- "**/package.json"
cmds:
- uv sync
- pnpm install
test:
desc: "Run all tests (Python + TypeScript + Playwright E2E)"
deps: [install, build]
cmds:
- uv run pytest
- pnpm --filter '!@debrief/web-shell' test
- cd apps/web-shell && node run-playwright.mjs
- pnpm --filter @debrief/spec-navigator build
- cd apps/spec-navigator && node run-playwright.mjs
knip:
desc: "Run knip — fail if any non-declared unused files are detected under apps/loader/src/main/"
deps: [install]
cmds:
# Scans apps/loader. The gate's SC (see specs/201-knip-loader-config/spec.md
# SC-001, SC-005) is specifically about files under apps/loader/src/main/;
# we pipe knip's JSON reporter through jq to assert that set is empty,
# while leaving pre-existing findings elsewhere in the loader (renderer
# barrels, unused devDeps) visible but non-blocking for now.
- |
pnpm exec knip -W apps/loader --reporter json --no-exit-code > /tmp/knip.json
MAIN_FINDINGS=$(jq '[.files[] | select(startswith("apps/loader/src/main/"))] | length' /tmp/knip.json)
if [ "$MAIN_FINDINGS" -gt 0 ]; then
echo "task knip: FAIL — $MAIN_FINDINGS file(s) under apps/loader/src/main/ flagged as unused:"
jq -r '.files[] | select(startswith("apps/loader/src/main/"))' /tmp/knip.json
echo ""
echo "Either import the file from a declared entry (see knip.json) or delete it."
exit 1
fi
echo "task knip: PASS — zero unused files under apps/loader/src/main/."
build:
desc: "Build all artifacts (Python wheels + TypeScript bundles)"
deps: [install]
cmds:
- uv build --all
- pnpm build
dev:
desc: "Start development watch mode"
deps: [install]
cmds:
- pnpm storybook
typecheck:
desc: "Run type checking (Python + TypeScript)"
deps: [install]
cmds:
- uv run pyright
- pnpm -r typecheck
lint:
desc: "Check code style (Python + TypeScript)"
deps: [install, build]
cmds:
- uv run ruff check .
- pnpm lint
- node scripts/check-eslint-drift-wiring.cjs
- bash scripts/check-no-geojson-feature.sh
- bash scripts/check-no-hand-typed-temporal-enums.sh
- bash scripts/check-adr-refs.sh
lint:fix:
desc: "Auto-fix code style issues"
deps: [install]
cmds:
- uv run ruff check --fix .
- uv run ruff format .
- pnpm lint -- --fix
verify:
desc: "Run full CI checks locally (lint + typecheck + test + knip) before pushing"
deps: [install]
cmds:
- task: lint
- task: typecheck
- task: test
- task: knip
docs:generate:
desc: "Generate Markdown docs from LinkML schemas (shared/schemas/build/md/)"
deps: [install]
cmds:
- uv run --extra docs python shared/schemas/scripts/generate.py --target docs
docs:build:
desc: "Build HTML docs site via MkDocs (shared/schemas/build/html/)"
deps: [docs:generate]
cmds:
- cd shared/schemas && uv run --extra docs mkdocs build
docs:serve:
desc: "Serve docs locally on http://localhost:8000 (auto-reloads)"
deps: [docs:generate]
cmds:
- cd shared/schemas && uv run --extra docs mkdocs serve
preview:build:
desc: "Build the preview container (code-server + Debrief extension)"
preconditions:
- sh: command -v docker
msg: "Docker not found. Install Docker to build the preview container."
cmds:
- docker build -t debrief-preview -f Dockerfile.preview .
preview:run:
desc: "Run the preview container locally (http://localhost:8080)"
preconditions:
- sh: docker image inspect debrief-preview >/dev/null 2>&1
msg: "Preview image not built. Run 'task preview:build' first."
cmds:
- docker run --rm -p 8080:8080 -e PORT=8080 debrief-preview
preview:package:
desc: "Package the VS Code extension as .vsix"
deps: [build]
cmds:
- cd apps/vscode && npx vsce package --no-dependencies
clean:
desc: "Remove build artifacts and caches"
cmds:
- rm -rf dist/ .task/ .pytest_cache/ .ruff_cache/
- rm -rf **/dist/ **/.pytest_cache/ **/__pycache__/
- rm -rf node_modules/.cache/