-
Notifications
You must be signed in to change notification settings - Fork 221
/
Taskfile.yaml
89 lines (81 loc) · 2.97 KB
/
Taskfile.yaml
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
# yaml-language-server: $schema=https://json.schemastore.org/taskfile.json
version: "3"
tasks:
build:
desc:
Build the web products for distribution - Website, Book, and Playground.
cmds:
- cd website && hugo --minify
- cd book && mdbook build
- mkdir -p website/public
# Copy the book into the website path, using rsync so it only copies new files
- rsync -ai --checksum --delete --no-times book/book/ website/public/book/
# (we don't use `build-playground-dependencies`, since that uses the dev profile)
- cd playground && npm ci && npm run build
# We place the playground app in a nested path, because we want to use
# prql-lang.org/playground with an iframe containing the playground.
# Possibly there's a more elegant way of doing this...
- rsync -ai --checksum --delete --no-times playground/dist/
website/public/playground/playground/
run-website:
desc: Build & serve the static website for interactive development.
dir: website
cmds:
- hugo server --bind 0.0.0.0
run-book:
desc: Build & serve the book for interactive development.
dir: book
cmds:
- mdbook serve --port=3000 -n 0.0.0.0
run-playground:
desc: Build & serve the playground for interactive development.
dir: playground
env:
PROFILE: dev
cmds:
- task: build-playground-dependencies
- npm run dev
fmt:
# (Duplicates `pre-commit` checks, but some developers prefer to use this directly.)
cmds:
- cmd: |
prettier --write . \
--config=../.prettierrc.yaml \
--ignore-path=../.prettierignore \
--ignore-unknown \
--log-level=warn
build-playground-dependencies:
# Check if npm dependencies for the playground need to be updated
# Use task's sources/generates to see if package.json,
# or anything in crates or bindings was updated after the
# node_modules was rebuilt
desc: Install deps, checking whether a dependency recently changed
dir: playground
env:
PROFILE: dev
cmds:
- npm ci
# Note that now we have `PROFILE: dev`, the build is much much faster, and
# we could remove this sources check if it became inconvenient.
sources:
- package.json
- package-lock.json
- ../../prqlc/**/*.rs
- ../../prqlc/bindings/**/*.rs
# These tasks have been factored out in favor of the remaining tasks
# run-web:
# desc: Build & serve the website & playground.
# summary:
# Note that this only live-reloads the static website; and requires
# rerunning to pick up playground & book changes.
# dir: web/website
# cmds:
# - task: build
# # Then start web server with rendering to disk, so it picks up the playground files.
# - hugo server --renderToDisk
# run-playground-cached:
# desc: Build & serve the playground, without rebuilding rust code.
# dir: web/playground
# cmds:
# - task: install-playground-dependencies
# - npm start