-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
208 lines (173 loc) · 4.63 KB
/
Taskfile.yml
File metadata and controls
208 lines (173 loc) · 4.63 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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
version: '3'
# Global variables
vars:
NODE: 'npx'
PORT: 4173
tasks:
default:
desc: 'Start development mode (SvelteKit)'
cmds:
- '{{.NODE}} vite dev'
sources:
- src/**/*
watch: true
# ⚙️ Core build & dev
dev:
desc: 'Run dev server with live reload'
cmds:
- '{{.NODE}} vite dev'
watch: true
prebuild:
desc: 'Generate content index before build'
cmds:
- 'node scripts/build-content-index.mjs'
build:
desc: 'Build production bundle'
deps: [prebuild]
cmds:
- '{{.NODE}} vite build'
preview:
desc: 'Preview production build'
deps: [build]
cmds:
- '{{.NODE}} vite preview'
serve:
desc: 'Serve production build'
deps: [build]
cmds:
- '{{.NODE}} serve -s build -l {{.PORT}}'
# 🧹 Linting & formatting
lint:
desc: 'Run all linters in parallel'
cmds:
- task: lint:ts
- task: lint:css
- task: lint:json
- task: lint:yaml
lint:ts:
desc: 'Lint TypeScript & Svelte files'
cmds:
- '{{.NODE}} eslint . --ext .ts,.svelte --max-warnings=0'
lint:css:
desc: 'Lint CSS and Svelte style blocks'
cmds:
- '{{.NODE}} stylelint "src/**/*.{css,svelte}" --cache --report-needless-disables'
lint:json:
desc: 'Lint JSON files'
cmds:
- '{{.NODE}} eslint . --ext .json,.jsonc'
lint:yaml:
desc: 'Lint YAML files'
cmds:
- '{{.NODE}} eslint . --ext .yml,.yaml'
format:
desc: 'Run Prettier formatter'
cmds:
- '{{.NODE}} prettier --config config/.prettierrc --ignore-path config/.prettierignore --write .'
format:check:
desc: 'Check formatting only'
cmds:
- '{{.NODE}} prettier --config config/.prettierrc --ignore-path config/.prettierignore --check .'
# 🧪 Testing
test:
desc: 'Run all tests (unit + e2e)'
cmds:
- task: test:unit
- task: test:e2e
test:unit:
desc: 'Run unit tests with Vitest'
cmds:
- '{{.NODE}} vitest run'
test:unit:watch:
desc: 'Run unit tests in watch mode'
cmds:
- '{{.NODE}} vitest'
test:e2e:
desc: 'Run end-to-end tests with Playwright'
cmds:
- '{{.NODE}} playwright test -c config/playwright.config.ts'
test:e2e:ui:
desc: 'Run Playwright tests with UI'
cmds:
- '{{.NODE}} playwright test -c config/playwright.config.ts --ui'
# 🧠 Type & validation checks
typecheck:
desc: 'Run TypeScript & SvelteKit type checks'
cmds:
- '{{.NODE}} svelte-kit sync && {{.NODE}} svelte-check --tsconfig ./tsconfig.json --fail-on-warnings'
validate:
desc: 'Run all validation steps'
deps: [build]
cmds:
- task: lint:html
- task: validate:html
- task: validate:css
- task: validate:grammar
lint:html:
desc: 'Validate HTML files in dist'
cmds:
- '{{.NODE}} html-validate --config config/html-validate.json --formatter stylish "build/**/*.html"'
validate:html:
desc: 'Run vnu HTML validator'
cmds:
- 'java -jar node_modules/vnu-jar/build/dist/vnu.jar --errors-only --skip-non-html build'
validate:css:
desc: 'Lint and validate built CSS'
cmds:
- '{{.NODE}} stylelint "build/_app/**/*.css" --config .stylelintrc.dist.cjs --ignore-path .stylelintignore.dist'
validate:grammar:
desc: 'Run CSS grammar validation script'
cmds:
- 'node scripts/validate-css-grammar.mjs'
# 🚀 Deployment / Audit / CI
audit:seo:
desc: 'Run Lighthouse SEO audits'
cmds:
- '{{.NODE}} lhci autorun --config=config/lighthouserc.json'
audit:seo:budgets:
desc: 'Run Lighthouse budget audits'
cmds:
- '{{.NODE}} lhci autorun --config=config/lhci.budgets.json'
audit:seo:all:
desc: 'Run all SEO audits'
cmds:
- task: audit:seo
- task: audit:seo:budgets
ci:
desc: 'Run full CI pipeline'
cmds:
- task: build
- task: lint
- task: validate
- task: test:e2e
- task: audit:seo:all
qa:
desc: 'Full QA suite (types, lint, tests, validation, SEO)'
cmds:
- task: typecheck
- task: lint
- task: validate
- task: test:e2e
- task: audit:seo:all
# 🧩 Maintenance
deps:audit:
desc: 'Audit NPM dependencies'
cmds:
- 'npm audit --omit=dev || true'
deps:update:
desc: 'Check for outdated dependencies'
cmds:
- 'npx npm-check-updates'
deadcode:
desc: 'Check for unused exports/files'
cmds:
- 'npx ts-prune -p tsconfig.json'
- 'npx knip'
spellcheck:
desc: 'Run spellchecker'
cmds:
- 'npx cspell lint .'
svg:optimize:
desc: 'Optimize SVG files in static/'
cmds:
- 'npx svgo -f static -r'