-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
126 lines (105 loc) · 3.72 KB
/
Copy pathTaskfile.yml
File metadata and controls
126 lines (105 loc) · 3.72 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
# https://taskfile.dev
version: '3'
vars:
PDF_DIR: ./copyright_compendium_pdfs
IMAGE_NAME: copyright-compendium
tasks:
# ── Docker ──────────────────────────────────────────────
docker:build:
desc: Build the Docker image for CompendiumUI
cmds:
- docker build -t {{.IMAGE_NAME}} ./CompendiumUI
docker:run:
desc: Run the CompendiumUI container on port 8080
deps: [docker:build]
cmds:
- docker run --rm -p 8080:80 {{.IMAGE_NAME}}
# ── Local dev ───────────────────────────────────────────
dev:
desc: Start the Vite dev server (hot-reload)
dir: CompendiumUI
cmds:
- npm install
- npm run dev
build:
desc: Build the production bundle
dir: CompendiumUI
cmds:
- npm install
- npm run build
preview:
desc: Preview the production build locally
dir: CompendiumUI
cmds:
- npm run preview
typecheck:
desc: Run TypeScript type checking
dir: CompendiumUI
cmds:
- npm install
- npm run typecheck
# ── PDF processing ─────────────────────────────────────
download-pdfs:
desc: Download Compendium PDFs from copyright.gov
cmds:
- python scripts/comp_download.py
pdf-to-text:
desc: Extract text from downloaded PDFs into .txt files
cmds:
- python scripts/pdf_to_text.py
process-pdfs:
desc: Convert PDFs to XHTML using Gemini API
cmds:
- python scripts/process_pdfs_gemini.py --directory {{.PDF_DIR}}
process-pdfs-chunked:
desc: Convert large PDFs to XHTML in chunks using Gemini API
cmds:
- python scripts/process_pdfs_chunked.py --directory {{.PDF_DIR}}
# ── Tests ─────────────────────────────────────────────
test:build:
desc: Build the Python test-runner Docker image
cmds:
- docker build -t {{.IMAGE_NAME}}-tests -f tests/Dockerfile tests
test:unit:
desc: Run CompendiumUI unit tests (Vitest)
dir: CompendiumUI
cmds:
- npm test
test:pdf:
desc: Run PDF↔HTML text comparison on all chapters (in Docker)
deps: [test:build]
cmds:
- docker run --rm -v {{.ROOT_DIR}}:/workspace -e GIT_COMMIT="$(git log -1 --format='%H %s')" {{.IMAGE_NAME}}-tests --algo --report docs/pdf-text-tests.md
test:chapter:
desc: Run PDF↔HTML QA on a specific chapter (e.g. task test:chapter -- ch200)
deps: [test:build]
cmds:
- docker run --rm -v {{.ROOT_DIR}}:/workspace {{.IMAGE_NAME}}-tests --algo --chapters {{.CLI_ARGS}}
test:llm:
desc: Run LLM-based QA checks (requires GOOGLE_API_KEY)
deps: [test:build]
cmds:
- docker run --rm -v {{.ROOT_DIR}}:/workspace -e GOOGLE_API_KEY {{.IMAGE_NAME}}-tests --llm
test:all:
desc: Run all tests (unit + PDF text comparison)
cmds:
- task: test:unit
- task: test:pdf
# ── Documentation ───────────────────────────────────
docs:serve:
desc: Serve documentation locally with mkdocs
cmds:
- mkdocs serve
docs:build:
desc: Build documentation with mkdocs
cmds:
- mkdocs build
docs:docker:build:
desc: Build the Docker image for documentation
cmds:
- docker build -f Dockerfile.docs -t {{.IMAGE_NAME}}-docs .
docs:docker:run:
desc: Run the documentation container on port 8000
deps: [docs:docker:build]
cmds:
- docker run --rm -p 8000:8000 {{.IMAGE_NAME}}-docs