-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmise.toml
More file actions
165 lines (134 loc) · 4.17 KB
/
mise.toml
File metadata and controls
165 lines (134 loc) · 4.17 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
[tools]
deno = "2.4.2"
"npm:@ast-grep/cli" = "0.39.6"
rust = { version = "1.90.0", components="rustfmt,clippy,rust-analyzer" }
ruff = "0.14.0"
uv = "0.9.2"
python = "3.13.0"
[settings]
experimental = true
pin = true
[hooks]
postinstall = "mise run ci:install-deps"
[tasks."ci:install-deps"]
hide = true
description = "Install CI dependencies (only runs on CI)"
run = """
{% if env.CI and os() == "linux" %}
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev
{% endif %}
rustup component add rustfmt clippy rust-analyzer
"""
[tasks.sync-versions]
description = "Update all version references"
run = "deno run -A scripts/sync-versions.ts"
## Gen
[tasks."gen:rust"]
description = "Generate JSON schemas from the rust code"
run = "cargo run --bin generate_schemas"
depends_post = ["format:rust"]
sources = ["src/**/*.rs", "Cargo.toml", "Cargo.lock"]
outputs = ["schemas/*.json"]
[tasks."gen:deno"]
description = "Generate the deno client"
run = "deno run -A scripts/generate-schema/index.ts --language typescript"
depends = ["gen:rust"]
depends_post = ["format:deno"]
sources = ["schemas/*", "scripts/generate-schema.ts"]
outputs = ["src/clients/deno/schemas/*.ts"]
[tasks."gen:python"]
description = "Generate the python client"
run = "deno run -A scripts/generate-schema/index.ts --language python"
depends = ["gen:rust"]
depends_post = ["format:python"]
sources = ["schemas/*", "scripts/generate-schema.ts"]
outputs = ["src/clients/python/src/justbe_webview/schemas/*.py"]
## Debug
[tasks."print-schema"]
description = "Prints a simplified version of the schema"
usage = '''
arg "[schema]" help="The schema to print; prints all if not provided"
'''
run = "deno run -A scripts/generate-schema/debug.ts {{arg(name=\"schema\")}}"
## Publishing
[tasks."verify-publish:deno"]
description = "Verify the deno client is pulishable"
dir = "src/clients/deno"
run = "deno publish --dry-run"
[tasks.gen]
description = "Run all code gen tasks"
depends = ["gen:*"]
## Build
[tasks."build:rust"]
description = "Build the webview binary"
run = """
{% set xwin = '' %}
{% set features = '' %}
{% if get_env(name='MISE_ENV', default='') == 'windows' %}
{% set xwin = ' xwin' %}
{% endif %}
{% if get_env(name='CI', default='') != 'true' %}
{% set features = ' --features transparent,devtools' %}
{% endif %}
cargo{{xwin}} build --bin webview{{features}}
"""
sources = ["src/**/*.rs", "Cargo.toml", "Cargo.lock"]
outputs = ["target/debug/webview"]
depends = ["gen:rust"]
[tasks."build:deno"]
description = "Run code gen for deno and ensure the binary is built"
depends = ["gen:deno", "build:rust"]
[tasks."build:python"]
description = "Run code gen for python and ensure the binary is built"
depends = ["gen:python", "build:rust"]
[tasks.build]
description = "Build all targets"
depends = ["build:*"]
## Format
[tasks."format:rust"]
description = "Format rust code"
run = ["rustfmt src/**/*.rs"]
[tasks."format:deno"]
description = "Format deno code"
run = ["deno fmt src/clients/deno"]
[tasks."format:python"]
description = "Format python code"
run = ["ruff format src/clients/python"]
[tasks.format]
alias = "fmt"
description = "Format all code"
depends = ["format:*"]
## Lint
[tasks."lint:rust"]
description = "Run clippy against rust code"
run = ["rustfmt --check src/**/*.rs", "cargo clippy"]
[tasks."lint:deno"]
description = "Run deno lint"
dir = "src/clients/deno"
run = ["deno lint", "deno check ."]
[tasks."lint:ast-grep"]
description = "Run ast-grep lint"
run = """
{% set format = '' %}
{% if get_env(name='CI', default='') == 'true' %}
{% set format = ' --format=github' %}
{% endif %}
sg scan {{format}} .
"""
[tasks."lint"]
description = "Run all linting tasks"
depends = ["lint:*"]
## Example
[tasks."example:python"]
description = "Run a python example"
depends = ["build:python"]
dir = "src/clients/python"
run = "uv run -n examples/{{arg(name=\"example\")}}.py"
env = { LOG_LEVEL = "debug", WEBVIEW_BIN = "../../../target/debug/webview" }
[tasks."example:deno"]
description = "Run a deno example"
depends = ["build:deno"]
env = { LOG_LEVEL = "debug", WEBVIEW_BIN = "../../../target/debug/webview" }
run = "deno run -E -R -N --allow-run examples/{{arg(name=\"example\")}}.ts"
dir = "src/clients/deno"