Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
87 lines (72 loc) · 2.7 KB
/
Copy pathTaskfile.yml
File metadata and controls
87 lines (72 loc) · 2.7 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
# Every project command runs through Task: `task --list`. Arguments after `--` reach the tool.
version: '3'
env:
WRANGLER_SEND_METRICS: 'false'
ASTRO_TELEMETRY_DISABLED: '1'
tasks:
install:
desc: Install dependencies (Yarn Berry through corepack)
cmds:
- corepack yarn install
dev:
desc: Astro dev server on 127.0.0.1 (run by an agent it starts in the background; system CJK font stands in)
cmds:
- npx astro dev {{.CLI_ARGS}}
dev:stop:
desc: Stop this checkout's background dev server
cmds:
- npx astro dev stop
dev:logs:
desc: Show this checkout's background dev server logs
cmds:
- npx astro dev logs {{.CLI_ARGS}}
build:
desc: Production build into dist/<locale>/ for every locale (scripts/build.mjs; `task build -- zh-Hant en` builds some)
cmds:
- node scripts/build.mjs {{.CLI_ARGS}}
preview:
desc: Production build served as on Cloudflare Pages, Function included (wrangler pages dev) on 127.0.0.1:4400 (PORT=… to change)
deps: [build]
vars:
PORT: '{{.PORT | default "4400"}}'
cmds:
- npx wrangler pages dev dist --ip 127.0.0.1 --port {{.PORT}}
deploy:
desc: 'Maintainer only: build and upload dist/ to the Cloudflare Pages project rezics-about, which serves about.rezics.com'
deps: [build]
env:
CLOUDFLARE_ACCOUNT_ID: dcc939f004008f8e36e11456df3f0fe2
cmds:
- npx wrangler pages deploy dist --project-name rezics-about --branch main --commit-hash "$(git rev-parse HEAD)" --commit-message "$(git log -1 --format=%s)" --commit-dirty=false
check:
desc: Types (astro check), then a build and the unit and build tests
cmds:
- npx astro check
- task: build
- npx vitest run {{.CLI_ARGS}}
test:
desc: Unit tests only (no build needed)
cmds:
- npx vitest run tests/unit {{.CLI_ARGS}}
e2e:
desc: Playwright end-to-end tests on the production build (queued on a shared slot)
deps: [build]
cmds:
- scripts/slot.sh npx playwright test {{.CLI_ARGS}}
qa:
desc: Skill Phase 4 into .shots/ (shoot --crawl --nav, audit). `task qa -- /books/` shoots given pages
deps: [build]
cmds:
- scripts/slot.sh node scripts/qa.mjs {{.CLI_ARGS}}
fonts:latin:
desc: Regenerate the committed Latin font subset (Martian Mono, for code)
cmds:
- node scripts/fonts.mjs latin
worktree:new:
desc: 'Create .temp/worktrees/<id> on branch site/<id> from main, node_modules linked (task worktree:new -- <id>)'
cmds:
- scripts/worktree.sh new {{.CLI_ARGS}}
worktree:remove:
desc: 'Remove .temp/worktrees/<id>; the branch stays (task worktree:remove -- <id>)'
cmds:
- scripts/worktree.sh remove {{.CLI_ARGS}}