forked from thegetty/quire
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmise.toml
More file actions
316 lines (262 loc) · 9.95 KB
/
mise.toml
File metadata and controls
316 lines (262 loc) · 9.95 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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
[env]
_.file = "{{ config_root }}/.env"
_.path = ['{{ config_root }}/node_modules/.bin']
NODE_ENV = "{{ env.NODE_ENV | default(value='development') }}"
NODE_VERSION = "22.10.0" # Match CircleCI
# PUPPETEER_EXECUTABLE_PATH = ""
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD = "true" # Use system Chrome
QUIRE_EMOJI = "📖" # Quire project emoji (change to your preferred emoji)
# Logging configuration
# QUIRE_LOG_LEVEL = "info" # trace, debug, info (default), warn, error, silent
# DEBUG = "quire:*" # Enable namespace debugging (e.g., quire:lib:pdf, quire:*)
[hooks]
enter = '''
echo "📖 Quire development environment"
echo " Node.js $(node --version) | npm $(npm --version)"
echo "Run: mise tasks to list all tasks"
'''
[settings]
activate_aggressive = true
experimental = true
# ============================================================================
# Help & Quick Reference
# ============================================================================
[tasks.help]
alias = "h"
description = "Show common development tasks"
run = """
echo '📖 Quire Development Tasks'
echo ''
echo ' Testing:'
echo ' mise test - Run all tests (CLI → 11ty → E2E → Playwright)'
echo ' mise test:cli - CLI tests only (~2s, fast feedback)'
echo ' mise test:11ty - 11ty tests only (~8s, fast feedback)'
echo ' mise e2e - E2E tests (builds publication, ~2-5 min)'
echo ' mise test:browsers - Browser tests (Playwright)'
echo ' mise clean - Clean test artifacts'
echo ''
echo ' Debugging:'
echo ' mise debug:cli - CLI tests with DEBUG=quire:*'
echo ' mise debug:e2e - E2E tests with DEBUG=quire:*'
echo ' mise debug:all - All tests with DEBUG=quire:*,Eleventy:*'
echo ''
echo ' Development:'
echo ' mise setup - Install dependencies (like CI does)'
echo ' mise lint - Lint all packages'
echo ' mise lint:fix - Auto-fix linting issues'
echo ''
echo ' CircleCI/Docker:'
echo ' mise cv - Validate CircleCI config'
echo ' mise docker:shell - Debug in CI Docker environment'
echo ' mise docker:test - Run tests in CI Docker'
echo ' mise docker:playwright - Browser tests in Playwright Docker'
echo ''
echo 'Run "mise tasks" for complete list'
"""
# ============================================================================
# Testing Tasks (mirrors CircleCI test execution order)
# ============================================================================
[tasks.test]
description = "Run all tests (CLI → 11ty → E2E → Browsers)"
run = "npm test"
[tasks."test:cli"]
description = "Run CLI unit and integration tests"
run = "npm run test --workspace packages/cli"
[tasks."test:11ty"]
description = "Run 11ty unit tests"
run = "npm run test --workspace packages/11ty"
[tasks."test:e2e"]
alias = "e2e"
description = "Run end-to-end tests (builds publication)"
run = "npm run test:e2e"
[tasks."test:browsers"]
description = "Run Playwright browser tests"
run = "npm run test:browsers"
[tasks."test:clean"]
alias = "clean"
description = "Clean all test artifacts"
run = "npm run test:clean"
[tasks."test:watch"]
description = "Run CLI tests in watch mode"
dir = "{{ config_root }}/packages/cli"
run = "npm run test:watch"
# ============================================================================
# CircleCI Tasks
# ============================================================================
[tasks."ci:validate"]
alias = "cv"
description = "Validate CircleCI configuration"
run = "circleci config validate .circleci/config.yml"
[tasks."ci:process"]
description = "Expand CircleCI config (resolve anchors/orbs)"
run = "circleci config process .circleci/config.yml"
[tasks."ci:local"]
description = "Run build_install_test job locally (Linux/Docker only)"
run = "circleci local execute --job build_install_test"
# ============================================================================
# Development Tasks
# ============================================================================
[tasks.setup]
description = "Install dependencies like CI does"
run = "npm ci --ignore-scripts --foreground-scripts"
[tasks."dev:cli"]
description = "Start CLI development with watch mode"
dir = "{{ config_root }}/packages/cli"
run = "npm run dev"
[tasks."dev:11ty"]
description = "Start 11ty development server"
dir = "{{ config_root }}/packages/11ty"
run = "npm run dev"
[tasks.lint]
description = "Lint all packages"
run = "npm run lint --workspaces"
[tasks."lint:fix"]
description = "Auto-fix linting issues"
run = "npm run lint:fix --workspaces"
# ============================================================================
# CLI Package Tasks
# ============================================================================
[tasks."cli:docs"]
description = "Generate CLI documentation"
dir = "{{ config_root }}/packages/cli"
run = "npm run docs"
[tasks."cli:man"]
description = "Generate CLI man page"
dir = "{{ config_root }}/packages/cli"
run = """
mkdir -p man
npx --yes marked-man man/quire.1.md \
--version "$(node -p 'require(\"./package.json\").version')" \
--section 1 \
--name quire \
> man/quire.1
"""
[tasks."cli:pack"]
description = "Pack CLI for testing (like CI does)"
run = "npm pack --workspace packages/cli"
[tasks."cli:install"]
description = "Install CLI globally from packed tarball"
run = """
npm pack --workspace packages/cli && \
npm install thegetty-quire-cli-*.tgz --global --ignore-scripts --foreground-scripts
"""
[tasks."cli:uninstall"]
description = "Uninstall globally installed CLI"
run = "npm uninstall --global @thegetty/quire-cli"
# ============================================================================
# Docker Tasks (reproduce CI environment)
# ============================================================================
[tasks."docker:shell"]
description = "Start interactive shell in CI Docker image"
run = """
docker run --interactive --tty --rm \
--volume $(pwd):/workspace \
--workdir /workspace \
cimg/node:22.10.0 \
bash -c 'git config --global user.email quire@getty.edu && \
git config --global user.name "Quire CI" && \
exec bash'
"""
[tasks."docker:test"]
description = "Run tests in CI Docker environment"
run = """
docker run --rm \
--volume $(pwd):/workspace \
--workdir /workspace \
cimg/node:22.10.0 \
bash -c 'git config --global user.email quire@getty.edu && \
git config --global user.name "Quire CI" && \
npm ci --ignore-scripts --foreground-scripts && \
npm test'
"""
[tasks."docker:playwright"]
description = "Run Playwright browser tests in CI Docker environment"
run = """
docker run --rm \
--volume $(pwd):/workspace \
--workdir /workspace \
mcr.microsoft.com/playwright:v1.52.0-noble \
bash -c 'git config --global user.email quire@getty.edu && \
git config --global user.name "Quire CI" && \
npm ci --ignore-scripts --foreground-scripts && \
npm run test:browsers'
"""
# ============================================================================
# Playwright Tasks
# ============================================================================
[tasks."pw:headed"]
description = "Run Playwright with visible browser"
run = "npx playwright test --headed"
[tasks."pw:debug"]
description = "Run Playwright in debug mode"
run = "npx playwright test --debug"
[tasks."pw:report"]
description = "Show Playwright test report"
run = "npx playwright show-report"
# ============================================================================
# Dependency Management
# ============================================================================
[tasks.npm]
alias = "deps"
description = "Check for npm package updates"
run = 'ncu --format group --interactive'
[tasks."npm:install"]
alias = "deps:install"
description = "Install npm package dependencies across all workspaces"
run = 'npm install --workspaces'
[tasks."npm:upgrade"]
alias = "deps:upgrade"
description = "Iteratively upgrade dependencies with testing"
usage = '''
arg "<workspace>" help="npm workspace" { choices "11ty" "cli" }
'''
confirm = """
This task will iteratively install package updates and run tests to identify breaking upgrades.
Reverts broken upgrades and updates package.json with working upgrades.
Process:
1. Runs `npm install` and `npm test` to ensure tests pass
2. Runs `ncu -u` to optimistically upgrade all dependencies
3. If tests pass, hurray!
4. If tests fail, restores package file and lock file
5. For each dependency, install upgrade and run tests
6. Prints broken upgrades with test error
7. Saves working upgrades to package.json
This will modify package.json, package-lock.json, and node_modules.
Continue?
"""
run = "ncu --doctor --upgrade"
# ============================================================================
# Git/Version Management
# ============================================================================
[tasks."git:status"]
description = "Show git status (same as what's in gitStatus context)"
run = "git status --short --branch"
[tasks."git:clean"]
description = "Clean all untracked files and build artifacts"
confirm = """
This will recursively remove all untracked files not already ignored by git.
Continue?
"""
run = "git clean -d --interactive"
# ============================================================================
# Debug Tasks
# ============================================================================
[tasks."debug:cli"]
description = "Run CLI tests with debug output"
env = { DEBUG = "quire:*" }
run = "npm run test --workspace packages/cli"
[tasks."debug:e2e"]
description = "Run E2E tests with debug output"
env = { DEBUG = "quire:*" }
run = "npm run test:e2e"
[tasks."debug:all"]
description = "Run all tests with full debug output"
env = { DEBUG = "quire:*,Eleventy:*" }
run = "npm test"
# ============================================================================
# Tools
# ============================================================================
[tools]
circleci-cli = "latest"
node = "22.10.0" # Match CircleCI exactly
"npm:npm-check-updates" = "latest"