-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
111 lines (95 loc) · 3.55 KB
/
Taskfile.yml
File metadata and controls
111 lines (95 loc) · 3.55 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
version: "3"
silent: true
tasks:
default:
desc: Run the dev server inside Docker on http://localhost:3001.
summary: |
Build the `development` stage of the Dockerfile and run it with the
project source bind-mounted in, so file edits hot-reload as they
would running locally.
An anonymous volume covers /app/node_modules so the host's
node_modules directory (if any) doesn't shadow the install done
inside the image.
For fast iteration without the container spin-up, use `task dev:local`.
For a production-build parity check, use `task preview`.
deps:
- setup
cmds:
- docker build --target development --tag tech-weburz-dev:latest .
- docker run --rm --name tech-weburz-dev --user "$(id -u):$(id -g)" -p 3001:3001 -v "$PWD":/app -v /app/node_modules tech-weburz-dev:latest
dev:local:
desc: Run the dev server directly on the host (no Docker).
summary: |
Start the Nuxt dev server with hot-reload on http://localhost:3001,
using the host's Node and pnpm. Faster startup than `task default`
but requires `task setup` to have been run first.
cmd: pnpm run dev
setup:pnpm:
internal: true
sources:
- package.json
- pnpm-lock.yaml
cmd: pnpm install --frozen-lockfile
setup:pre-commit:
internal: true
sources:
- .pre-commit-config.yaml
generates:
- .git/hooks/pre-commit
- .git/hooks/commit-msg
cmd: pre-commit install --install-hooks
setup:
desc: Set up the local development environment.
summary: |
Install all Node dependencies and configure Git hooks for the project.
Run this once after cloning, and again whenever package.json or
.pre-commit-config.yaml changes.
cmds:
- task: setup:pnpm
- task: setup:pre-commit
build:
desc: Generate the static site (the same artifact GitHub Pages serves).
summary: |
Produce the static output under .output/public — the exact artifact the
Deploy workflow uploads to GitHub Pages.
Use this for local sanity checks before pushing to main.
cmd: pnpm run generate
preview:
desc: Serve the generated static site locally on http://localhost:3000.
summary: |
Run `task build` then serve `.output/public` on http://localhost:3000
so you can sanity-check the same artifact GitHub Pages uploads.
deps:
- build
cmd: pnpm exec nuxt preview
qa-checks:pnpm:
internal: true
cmds:
- pnpm run lint
- pnpm run typecheck
- pnpm run format:check
format:
desc: Auto-format the codebase with Prettier.
summary: |
Run Prettier in --write mode across the repository. The matching
--check pass runs as part of `task qa-checks`.
cmd: pnpm run format
qa-checks:
desc: Run all QA checks on the source code.
summary: |
Run ESLint, the Nuxt typecheck, and all pre-commit hooks against the
full repository. Run this before pushing to main.
cmds:
- task: qa-checks:pnpm
- pre-commit run --all-files
clean:
desc: Wipe build artifacts, dependencies, and dev/preview containers.
summary: |
Remove .nuxt, .output, node_modules, the Task cache, and any
`tech-weburz-dev` or `tech-weburz` containers left behind by
`task default` or `task preview` so the next `task setup` and
`task default` start fully clean.
cmds:
- rm -rf .nuxt .output .data .cache node_modules .task
- docker rm -f tech-weburz-dev 2>/dev/null || true
- docker image rm -f tech-weburz-dev:latest 2>/dev/null || true