-
Notifications
You must be signed in to change notification settings - Fork 1
/
bonnie.toml
112 lines (102 loc) · 4.15 KB
/
bonnie.toml
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
version = "0.3.2"
[scripts]
dev.cmd = [
"cd packages/tribble",
"cargo run -- -c \"%example.yml\" %%"
]
dev.args = [ "example" ]
dev.desc = "runs the cli with the provided options (this will execute in the `examples/` directory on the provided config file)"
app.cmd = "concurrently --kill-others \"bonnie app build-tailwind\" \"bonnie app export\""
app.desc = "runs `dev-old export` `app build-tailwind` and `app serve` simultaneously (needs `concurrently`)"
app.subcommands.build-tailwind.cmd = [
"cd packages/tribble-app",
"tailwindcss -i static/style.css -c tailwind.config.js -o static/tailwind.css --watch"
]
app.subcommands.build-tailwind.subcommands.--prod.cmd = [
"cd packages/tribble-app",
"NODE_ENV=production tailwindcss -i static/style.css -c tailwind.config.js -o static/tailwind.css --minify"
]
app.subcommands.export.cmd = [
"cd packages/tribble-app",
"perseus export -sw"
]
app.subcommands.export.desc = "exports the site and serves it, watching for changes"
prep-wasm.cmd = [
"rm -rf packages/tribble/.tribble",
"mkdir packages/tribble/.tribble",
# Utility files that we'll move around when we need the,
"mkdir packages/tribble/.tribble/utils",
# Working directories for Perseus
"mkdir packages/tribble/.tribble/perseus",
"mkdir packages/tribble/.tribble/perseus/mutable",
"cd packages/tribble-app/",
"perseus prep",
"cd .perseus/",
"wasm-pack build --target web --release",
"cd ../",
# Copy in utilities (bundles and CSS)
"cp .perseus/pkg/perseus_engine_bg.wasm ../tribble/.tribble/utils/bundle.wasm",
"cp .perseus/pkg/perseus_engine.js ../tribble/.tribble/utils/bundle.js",
"cp -r static/ ../tribble/.tribble/utils/static"
]
prep-wasm.desc = "builds the wasm artifacts and prepares them for the cli"
tinker.cmd = [
"cd packages/tribble-app",
"perseus tinker"
]
tinker.desc = "runs `perseus tinker` on the app"
build.cmd = [
"bonnie tinker",
"bonnie prep-wasm",
"cd packages/tribble",
# We allow extra arguments here so that we can cross-compile if necessary
"cargo build --release %%"
]
schema.cmd = [
"cd packages/tribble-app",
"cargo run --features schema"
]
schema.desc = "builds the JSON schema"
schema.subcommands.html.cmd = [
"mkdir -p docs/",
"generate-schema-doc --config footer_show_time=false --expand-buttons --minify schema.json docs/",
"mv docs/schema.html docs/index.html",
"find docs -name index.html -exec sed -i -e 's/<title>Config<\\/title>/<title>Tribble API Documentation<\\/title>/g' {} \\;"
]
schema.subcommands.html.desc = "creates an html version of the schema to be hosted (requires Python's `json-schema-for-humans` module)"
ci.subcommands.prep.cmd = [
"cargo install wasm-pack perseus-cli",
"rustup target add wasm32-unknown-unknown",
"cd packages/tribble-app",
"perseus prep"
]
ci.subcommands.prep.desc = "prepares dependencies for CI (this doesn't prepare the Wasm artifacts)"
check.cmd = [
"cargo check --all",
"cargo fmt --all -- --check",
"cargo clippy --all"
]
check.desc = "checks code for compile and formatting errors"
release.cmd = [
"git checkout stable",
"git merge main",
# We allow specifying a custom version for pre-releases
"standard-version --sign --commit-all %%",
"git push --follow-tags origin stable",
"git checkout main",
"git merge stable",
"git push origin main",
]
release.desc = "releases a new version and pushes it to GitHub (note that the bot is entirely separate to this)"
replace-versions.cmd = "find . \\( \\( -name \"*Cargo.toml\" -or -name \"*Cargo.toml.example\" -or -name \"*.md\" \\) -not -name \"CHANGELOG.md\" -not -path \"./target/*\" -not -path \"*.perseus*\" -not -path \"*.tribble*\" \\) -exec sed -i -e 's/%old_version/%new_version/g' {} \\;"
replace-versions.args = [ "old_version", "new_version" ]
publish.cmd = [
"bonnie prep-wasm",
"cd packages/tribble-app",
"cargo publish %%",
"cd ../tribble",
"sleep 10",
# We've got to allow uncommitted files to permit including `.tribble/`
"cargo publish --allow-dirty %%"
]
publish.desc = "publishes the CLI to crates.io (`bonnie release` deploys the binaries on GitHub)"