-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmise.toml
140 lines (115 loc) · 3.67 KB
/
mise.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
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
[tools]
deno = "2.2.1"
"npm:@ast-grep/cli" = "0.32.2"
rust = { version = "1.78.0", postinstall = "rustup component add rustfmt clippy rust-analyzer" }
ruff = "0.9.1"
uv = "0.6.2"
[settings]
experimental = true
pin = true
[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 %}
"""
[tasks.sync-versions]
description = "Update all version references"
run = "deno run -A scripts/sync-versions.ts"
## Gen
[tasks."gen:rust"]
depends = ["ci:install-deps"]
description = "Generate JSON schemas from the rust code"
run = "cargo run --bin generate_schemas"
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"]
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"]
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:*"]
## Lint
[tasks."lint:rust"]
description = "Run clippy against rust code"
depends = ["ci:install-deps"]
run = ["cargo fmt --check", "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"