-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
593 lines (516 loc) · 15.6 KB
/
Taskfile.yml
File metadata and controls
593 lines (516 loc) · 15.6 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
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
# Taskfile.yml for Liaison Toolkit
# Modern Python task runner for monorepo management with parallel execution
version: '3'
includes:
python: ./Taskfile-python.yml
vars:
PYTHON_VERSION: '3.11'
NODE_VERSION: '18'
tasks:
default:
desc: Show available tasks
cmds:
- task --list
silent: true
# Environment setup
setup:
desc: Initialize complete development environment
cmds:
- echo "🔧 Setting up OpenCode Workflow Kit development environment..."
- task:install-tools
- task:setup-python
- task:setup-node
- task:setup-hooks
- echo "✅ Development environment ready!"
install-tools:
desc: Install required development tools
cmds:
- echo "📦 Installing development tools..."
- task:install-uv
- task:install-bun
- task:install-task
install-uv:
desc: Install uv Python package manager
cmds:
- |
if ! command -v uv >/dev/null 2>&1; then
echo "🐍 Installing uv..."
curl -LsSf https://astral.sh/uv/install.sh | sh
else
echo "✅ uv already installed: $(uv --version)"
fi
install-bun:
desc: Install Bun JavaScript runtime
cmds:
- |
if ! command -v bun >/dev/null 2>&1; then
echo "🥟 Installing Bun..."
curl -fsSL https://bun.sh/install | bash
else
echo "✅ Bun already installed: $(bun --version)"
fi
install-task:
desc: Install Task runner (latest version)
cmds:
- echo "📦 Installing latest Task version..."
- bunx --bun task@latest --version
- echo "✅ Task installed successfully"
setup-python:
desc: Setup Python development environment
cmds:
- echo "🐍 Setting up Python environment..."
- uv sync
- uv run python -m pip install -e ./packages/opencode_config
setup-node:
desc: Setup Node.js development environment
cmds:
- echo "🟨 Setting up Node.js environment..."
- cd packages/cody-beads-integration && bun install
setup-hooks:
desc: Setup Git hooks
cmds:
- echo "🪝 Setting up Git hooks..."
- cd packages/cody-beads-integration && bunx husky install
# Building
build:
desc: Build all packages
deps: [setup]
cmds:
- echo "🏗️ Building all packages..."
- task:build-python
- task:build-node
build-python:
desc: Build Python packages
cmds:
- echo "🐍 Building OpenCode Config..."
- cd packages/opencode_config && uv run python -m build
build-node:
desc: Build Node.js packages
cmds:
- echo "🟨 Building Cody-Beads Integration..."
- cd packages/cody-beads-integration && bun run build
# Testing
test:
desc: Run all tests
deps: [build]
cmds:
- echo "🧪 Running all tests..."
- task:test-python
- task:test-node
test-python:
desc: Run Python test suite
cmds:
- echo "🐍 Testing OpenCode Config..."
- cd packages/opencode_config && uv run pytest --cov=opencode_config --cov-report=term-missing
test-node:
desc: Run Node.js test suite
cmds:
- echo "🟨 Testing Cody-Beads Integration..."
- cd packages/cody-beads-integration && bun run test:all
test:unit:
desc: Run unit tests only
deps: [build]
cmds:
- task:test-python-unit
- task:test-node-unit
test-python-unit:
desc: Run Python unit tests
cmds:
- cd packages/opencode_config && uv run pytest tests/unit/
test-node-unit:
desc: Run Node.js unit tests
cmds:
- cd packages/cody-beads-integration && bun run test:unit
test:integration:
desc: Run integration tests
deps: [build]
cmds:
- task:test-python-integration
- task:test-node-integration
test-python-integration:
desc: Run Python integration tests
cmds:
- cd packages/opencode_config && uv run pytest tests/integration/
test-node-integration:
desc: Run Node.js integration tests
cmds:
- cd packages/cody-beads-integration && bun run test:integration
# Quality assurance
qa:
desc: Run complete quality assurance checks
deps: [build]
cmds:
- echo "🔍 Running quality assurance..."
- task:lint
- task:test
- task:security
- echo "✅ All QA checks passed!"
lint:
desc: Lint all code
cmds:
- task:lint-python
- task:lint-node
lint-python:
desc: Lint Python code
cmds:
- echo "🐍 Linting Python code..."
- cd packages/opencode_config && uv run ruff check .
lint-node:
desc: Lint Node.js code
cmds:
- echo "🟨 Linting Node.js code..."
- cd packages/cody-beads-integration && bun run lint
format:
desc: Format all code
cmds:
- task:format-python
- task:format-node
format-python:
desc: Format Python code
cmds:
- echo "✨ Formatting Python code..."
- cd packages/opencode_config && uv run black .
- cd packages/opencode_config && uv run ruff format .
format-node:
desc: Format Node.js code
cmds:
- echo "✨ Formatting Node.js code..."
- cd packages/cody-beads-integration && bun run format
type-check:
desc: Type checking
cmds:
- task:type-check-python
- task:type-check-node
type-check-python:
desc: Type check Python code
cmds:
- echo "🔍 Type checking Python code..."
- cd packages/opencode_config && uv run mypy .
type-check-node:
desc: Type check Node.js code
cmds:
- echo "🔍 Type checking Node.js code..."
- cd packages/cody-beads-integration && bun run type-check
# Cleaning
clean:
desc: Clean all build artifacts
cmds:
- echo "🧹 Cleaning build artifacts..."
- task:clean-python
- task:clean-node
clean-python:
desc: Clean Python build artifacts
cmds:
- cd packages/opencode_config && rm -rf build/ dist/ *.egg-info/
- cd packages/opencode_config && find . -type d -name __pycache__ -exec rm -rf {} +
- cd packages/opencode_config && find . -type f -name "*.pyc" -delete
clean-node:
desc: Clean Node.js build artifacts
cmds:
- cd packages/cody-beads-integration && bun run clean
# Development
dev:
desc: Start development servers
deps: [setup]
cmds:
- echo "🚀 Starting development mode..."
- task:dev-python
- task:dev-node
dev-python:
desc: Start Python development server
cmds:
- echo "🐍 Starting Python development server..."
- cd packages/opencode_config && uv run python -m opencode_config.cli --dev
dev-node:
desc: Start Node.js development server
cmds:
- echo "🟨 Starting Node.js development server..."
- cd packages/cody-beads-integration && bun run dev
# Security
security:
desc: Run security checks
cmds:
- task:security-python
- task:security-node
security-python:
desc: Security scan Python packages
cmds:
- echo "🔒 Scanning Python packages..."
- cd packages/opencode_config && uv run safety check
security-node:
desc: Security scan Node.js packages
cmds:
- echo "🔒 Scanning Node.js packages..."
- cd packages/cody-beads-integration && bun run test:security
# Publishing
publish:
desc: Publish all packages
deps: [build, test]
cmds:
- echo "📦 Publishing packages..."
- task:publish-python
- task:publish-node
publish-python:
desc: Publish Python package
cmds:
- echo "🐍 Publishing to PyPI..."
- cd packages/opencode_config && uv run python -m twine upload dist/*
publish-node:
desc: Publish Node.js package
cmds:
- echo "🟨 Publishing to npm..."
- cd packages/cody-beads-integration && bun publish
# Documentation
docs:
desc: Generate documentation
cmds:
- echo "📚 Generating documentation..."
- task:docs-python
- task:docs-node
docs-python:
desc: Generate Python documentation
cmds:
- echo "🐍 Generating Python docs..."
- cd packages/opencode_config && uv run sphinx-build -b html docs/ docs/_build/
docs-node:
desc: Generate Node.js documentation
cmds:
- echo "🟨 Generating Node.js docs..."
- cd packages/cody-beads-integration && bun run docs
# Release management
release:
desc: Interactive release management
cmds:
- echo "🏷️ Interactive release management..."
- task:version-select
version-select:
desc: Select version to release
cmds:
- echo "Select release type:"
- echo "1) Patch (0.1.0 → 0.1.1)"
- echo "2) Minor (0.1.1 → 0.2.0)"
- echo "3) Major (0.2.0 → 1.0.0)"
- |
read -p "Choose [1/2/3]: " choice
task:release-{{choice}}
release-1:
desc: Create patch release
cmds:
- echo "🏷️ Creating patch release..."
- task:version-python-patch
- task:version-node-patch
- task:build
- task:test
- task:publish
release-2:
desc: Create minor release
cmds:
- echo "🏷️ Creating minor release..."
- task:version-python-minor
- task:version-node-minor
- task:build
- task:test
- task:publish
release-3:
desc: Create major release
cmds:
- echo "🏷️ Creating major release..."
- task:version-python-major
- task:version-node-major
- task:build
- task:test
- task:publish
version-python-patch:
desc: Bump Python package patch version
cmds:
- cd packages/opencode_config && uv run bump2version patch --config-file pyproject.toml
version-python-minor:
desc: Bump Python package minor version
cmds:
- cd packages/opencode_config && uv run bump2version minor --config-file pyproject.toml
version-python-major:
desc: Bump Python package major version
cmds:
- cd packages/opencode_config && uv run bump2version major --config-file pyproject.toml
version-node-patch:
desc: Bump Node.js package patch version
cmds:
- cd packages/cody-beads-integration && bunx bumpp patch --package="package.json"
version-node-minor:
desc: Bump Node.js package minor version
cmds:
- cd packages/cody-beads-integration && bunx bumpp minor --package="package.json"
version-node-major:
desc: Bump Node.js package major version
cmds:
- cd packages/cody-beads-integration && bunx bumpp major --package="package.json"
# CI/CD simulation
ci:
desc: Simulate complete CI/CD pipeline
cmds:
- echo "🔄 Simulating CI/CD pipeline..."
- task:setup
- task:lint
- task:test
- task:security
- task:build
- echo "✅ CI/CD simulation completed!"
# Health check
health:
desc: Check project health
cmds:
- echo "🏥 Running health checks..."
- task:health-tools
- task:health-python
- task:health-node
health-tools:
desc: Check development tools
cmds:
- echo "Checking development tools..."
- |
if command -v uv >/dev/null 2>&1; then
echo "✅ uv: $(uv --version)"
else
echo "❌ uv not found"
fi
if ! command -v bun >/dev/null 2>&1; then
echo "❌ ERROR: bun not found - this is a critical dependency"
exit 1
fi
echo "✅ bun: $(bun --version)"
if command -v task >/dev/null 2>&1; then
echo "✅ task: $(task --version)"
else
echo "❌ task not found"
fi
health-python:
desc: Check Python environment
cmds:
- echo "🐍 Python environment check..."
- python --version
- cd packages/opencode_config && uv run python -c "import opencode_config; print('✅ Python imports OK')" || echo "❌ Python imports failed"
health-node:
desc: Check Node.js environment
cmds:
- echo "🟨 Node.js environment check..."
- node --version
- |
if ! command -v bun >/dev/null 2>&1; then
echo "❌ ERROR: bun not found - this is a critical dependency"
exit 1
fi
- bun --version
- cd packages/cody-beads-integration && bun run type-check
# Parallel execution tasks
build-parallel:
desc: Build all packages in parallel
cmds:
- echo "🏗️ Building all packages in parallel..."
- task:build-python &
- task:build-node &
- wait
- echo "✅ Parallel build completed!"
test-parallel:
desc: Run all tests in parallel
deps: [build-parallel]
cmds:
- echo "🧪 Running all tests in parallel..."
- task:test-python &
- task:test-node &
- wait
- echo "✅ Parallel tests completed!"
qa-parallel:
desc: Run complete quality assurance checks in parallel
deps: [build-parallel]
cmds:
- echo "🔍 Running parallel quality assurance..."
- task:lint-parallel &
- task:test-parallel &
- task:security-parallel &
- wait
- echo "✅ Parallel QA checks completed!"
lint-parallel:
desc: Lint all code in parallel
cmds:
- echo "🔍 Linting all code in parallel..."
- task:lint-python &
- task:lint-node &
- wait
- echo "✅ Parallel linting completed!"
format-parallel:
desc: Format all code in parallel
cmds:
- echo "✨ Formatting all code in parallel..."
- task:format-python &
- task:format-node &
- wait
- echo "✅ Parallel formatting completed!"
type-check-parallel:
desc: Type checking in parallel
cmds:
- echo "🔍 Parallel type checking..."
- task:type-check-python &
- task:type-check-node &
- wait
- echo "✅ Parallel type checking completed!"
clean-parallel:
desc: Clean all build artifacts in parallel
cmds:
- echo "🧹 Cleaning build artifacts in parallel..."
- task:clean-python &
- task:clean-node &
- wait
- echo "✅ Parallel cleaning completed!"
security-parallel:
desc: Run security checks in parallel
cmds:
- echo "🔒 Running parallel security checks..."
- task:security-python &
- task:security-node &
- wait
- echo "✅ Parallel security checks completed!"
ci-parallel:
desc: Simulate complete CI/CD pipeline with parallel execution
cmds:
- echo "🔄 Simulating parallel CI/CD pipeline..."
- task:setup
- task:lint-parallel
- task:test-parallel
- task:security-parallel
- task:build-parallel
- echo "✅ Parallel CI/CD simulation completed!"
# Performance optimized tasks
perf-build:
desc: Performance-optimized build with parallel execution
cmds:
- echo "🚀 Performance-optimized build..."
- task:clean-parallel
- task:build-parallel
- task:lint-parallel
- task:type-check-parallel
- echo "✅ Performance build completed!"
perf-test:
desc: Performance-optimized testing
cmds:
- echo "🚀 Performance-optimized testing..."
- task:build-parallel
- task:test-parallel
- echo "✅ Performance testing completed!"
# Monitoring and collision detection
monitor-parallel:
desc: Monitor parallel execution with collision detection
cmds:
- echo "👁️ Monitoring parallel execution..."
- |
# Start monitoring in background
(while true; do
echo "Monitoring system resources..."
echo "CPU: $(ps aux | awk '{sum+=$3} END {print sum}')%"
echo "Memory: $(free -m | awk '/Mem:/ {print $3}')MB used"
echo "Processes: $(ps aux | wc -l)"
sleep 5
done) &
MONITOR_PID=$!
echo "Monitor PID: $MONITOR_PID"
trap "kill $MONITOR_PID 2>/dev/null" EXIT
wait