Repository navigation
Expand file tree
/
Copy pathmise.dev.toml
More file actions
384 lines (339 loc) · 10.8 KB
/
Copy pathmise.dev.toml
File metadata and controls
384 lines (339 loc) · 10.8 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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
# Copyright 2026-present raml-dev
# SPDX-License-Identifier: AGPL-3.0-only
[tools]
pnpm = "10.32.1"
"npm:@earendil-works/pi-coding-agent" = "0.74.0"
rg = "15.1.0"
"codex" = "0.125.0"
[hooks]
postinstall = { task = "mcp:check" }
[shell_alias]
pi = "mise run --quiet pi "
# main tasks
[tasks.dev]
description = "Start the development server from the project root"
dir = "{{ config_root }}"
run_windows = "wails dev"
run = """
#!/usr/bin/env bash
case "$(uname -s)" in
Linux*) wails dev -tags webkit2_41 ;;
Darwin*) wails dev ;;
*) echo "Unsupported OS" && exit 1 ;;
esac
"""
[tasks.build]
description = "Build the app"
dir = "{{ config_root }}"
run_windows = "wails build"
run = """
#!/usr/bin/env bash
case "$(uname -s)" in
Linux*) wails build -tags webkit2_41 ;;
Darwin*) wails build ;;
*) echo "Unsupported OS" && exit 1 ;;
esac
"""
[tasks.pi]
description = "Start the pi coding agent from the project root"
dir = "{{ config_root }}"
run = "$(mise which pi)"
# utilities tasks - not meant to be run directly
[tasks."mcp:check"]
description = "Check if the MCP server and adapter are installed"
depends = ["mcp:flowbite-check", "mcp:adapter-check"]
[tasks."mcp:flowbite-check"]
description = "Check if the Flowbite MCP server is installed"
run = """
if ! ls {{config_root}}/.mcp/flowbite-svelte-mcp &> /dev/null; then
mise run mcp:flowbite-install
fi
"""
[tasks."mcp:adapter-check"]
description = "Check if the Pi MCP adapter is installed"
run = """
if ! $(mise which pi) list | grep -q "npm:pi-mcp-adapter"; then
$(mise which pi) install npm:pi-mcp-adapter
fi
"""
[tasks."mcp:flowbite-install"]
description = "Install and build the flowbite-svelte MCP server"
run = """
if [ ! -d {{config_root}}/.mcp/flowbite-svelte-mcp ]; then
git clone https://github.com/shinokada/flowbite-svelte-mcp.git {{config_root}}/.mcp/flowbite-svelte-mcp
fi
cd {{config_root}}/.mcp/flowbite-svelte-mcp && pnpm install && pnpm run copy:llm && pnpm run build
"""
[tasks.add-license]
description = "Add license headers to all files"
dir = "{{ config_root }}"
run = '''
echo "📄 Adding license headers..."
addlicense -c "raml-dev" -y "2026-present" -v -s -l AGPL-3.0-only \
-ignore=frontend/node_modules/**/* \
-ignore=frontend/dist/**/* \
-ignore=frontend/src/lib/codemirror/lang-json-vars/parser.js \
-ignore=frontend/src/lib/codemirror/lang-json-vars/parser.terms.js \
./frontend ./internal ./hack go.mod go.sum *.go
echo "✅ License headers added!"
'''
[tasks.gen-tls]
dir = "{{ config_root }}/test/self-signed-tls"
run = '''
OUTDIR="${PWD}/localhost.localdomain"
mkdir -p "${OUTDIR}"
# Generate a new private key for the Certificate Authority (CA)
openssl genrsa -out "${OUTDIR}/ca-key.pem" 2048
# Create a new CA certificate valid for 3650 days
openssl req -x509 -new -days 3650 -nodes -key "${OUTDIR}/ca-key.pem" -out "${OUTDIR}/ca.crt" -subj "/CN=self-signed-ca"
# Generate a new private key for the SSL certificate
openssl genrsa -out "${OUTDIR}/tls.key" 2048
cat > /tmp/req-dns.conf <<EOF
[req]
req_extensions = v3_req
distinguished_name = req_distinguished_name
[req_distinguished_name]
[ v3_req ]
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = localhost.localdomain
DNS.2 = *.localhost.localdomain
EOF
# Generate a Certificate Signing Request (CSR) using the new key
openssl req -new -key "${OUTDIR}/tls.key" -out "${OUTDIR}/csr.pem" -subj "/CN=localhost" -config /tmp/req-dns.conf
# Create the SSL certificate using the CA
openssl x509 -req -in "${OUTDIR}/csr.pem" -CA "${OUTDIR}/ca.crt" -CAkey "${OUTDIR}/ca-key.pem" -out "${OUTDIR}/tls.crt" -days 365 -extensions v3_req -extfile /tmp/req-dns.conf
rm /tmp/req-dns.conf
'''
[tasks.run-localhost-server]
dir = "{{ config_root }}/test/self-signed-tls"
run = """
python server.py &
SERVER_PID=$!
cleanup() { kill $SERVER_PID 2>/dev/null; }
trap cleanup EXIT
timeout 10 bash -c 'until bash -c "echo > /dev/tcp/localhost/4443" 2>/dev/null; do sleep 0.1; done'
echo "server up"
while true; do
sleep 1
done
"""
[tasks."local-dist-server"]
run = """
podman run --rm -p 8080:8000 \
-v {{config_root}}/dist:/data:ro \
-w /data python:3-alpine \
python -m http.server 8000
"""
[tasks."local-release-test"]
description = "Detect the host platform and run the matching local release simulation"
run = """
os="$(uname -s)"
case "$os" in
Linux)
mise run local-release-test:linux
;;
Darwin)
mise run local-release-test:macos
;;
MINGW*|MSYS*|CYGWIN*|Windows_NT)
mise run local-release-test:windows
;;
*)
echo "unsupported host platform: $os" >&2
exit 1
;;
esac
"""
[tasks."local-release-test:emit-json"]
description = "Write release.json and one dispatch payload from the prepared dist/assets tree"
hide = true
run = """
RELEASE_DIR="repos/raml-dev/solo/releases"
mkdir -p "dist/${RELEASE_DIR}"
assets_json="$(
for path in dist/assets/*; do
[ -f "$path" ] || continue
basename "$path"
done | LC_ALL=C sort | jq -R . | jq -s --arg base "${LOCAL_RELEASE_BASE_URL}/assets" '
map({
name: .,
url: null,
browser_download_url: ($base + "/" + .)
})
'
)"
jq -n \
--arg version "${SOLO_RELEASE_VERSION}" \
--arg base "${LOCAL_RELEASE_BASE_URL}" \
--arg published_at "${LOCAL_RELEASE_PUBLISHED_AT}" \
--argjson assets "${assets_json}" \
'{
draft: false,
prerelease: false,
html_url: ($base + "/releases/" + $version),
published_at: $published_at,
assets: $assets
}' > "dist/${RELEASE_DIR}/release.json"
jq -n \
--arg event_type "${LOCAL_RELEASE_EVENT_TYPE}" \
--arg object_key "${LOCAL_RELEASE_OBJECT_KEY}" \
--arg object_name "${LOCAL_RELEASE_OBJECT_NAME}" \
--arg source_repository "raml-dev/solo" \
--arg version "${SOLO_RELEASE_VERSION}" \
--arg api_url "${LOCAL_RELEASE_BASE_URL}/${RELEASE_DIR}/release.json" \
--arg html_url "${LOCAL_RELEASE_BASE_URL}/releases/${SOLO_RELEASE_VERSION}" \
--arg app_name "${LOCAL_RELEASE_APP_NAME:-Solo}" \
--arg description "${LOCAL_RELEASE_DESCRIPTION:-The lightweight, fast, open-source API client for modern development}" \
--arg license "${LOCAL_RELEASE_LICENSE:-AGPL-3.0-only}" \
'{
event_type: $event_type,
client_payload: (
{
release: {
version: $version,
api_url: $api_url,
html_url: $html_url
}
}
+ {
($object_key): {
name: $object_name,
source_repository: $source_repository,
app_name: $app_name,
description: $description,
license: $license
}
}
)
}' > "dist/${LOCAL_RELEASE_DISPATCH_FILE}"
"""
[tasks."local-release-test:linux"]
description = "Simulate the Linux build and package jobs, then emit the Linux repo dispatch payload"
run = """
export MISE_ENV=ci
export SOLO_BUILD_TAGS=webkit2_41
WAILS_JSON_BACKUP="$(mktemp)"
cp {{config_root}}/wails.json "$WAILS_JSON_BACKUP"
cleanup() {
mv "$WAILS_JSON_BACKUP" {{config_root}}/wails.json
}
trap cleanup EXIT
arch="$(uname -m)"
case "$arch" in
x86_64|amd64)
build_target="linux-amd64"
built_artifact="dist/solo-linux-amd64"
sibling_artifact="dist/solo-linux-arm64"
;;
aarch64|arm64)
build_target="linux-arm64"
built_artifact="dist/solo-linux-arm64"
sibling_artifact="dist/solo-linux-amd64"
;;
*)
echo "unsupported Linux architecture: $arch" >&2
exit 1
;;
esac
mise run ci:rel:prepare
mise run ci:rel:build -- "$build_target"
cp "$built_artifact" "$sibling_artifact"
mise run ci:rel:package:linux
mise run ci:rel:checksums
mkdir -p dist/assets
cp dist/solo_${SOLO_RELEASE_VERSION}_*.deb dist/assets/
cp dist/solo-${SOLO_RELEASE_VERSION}-1.*.rpm dist/assets/
cp dist/solo-${SOLO_RELEASE_VERSION}-1-*.pkg.tar.zst dist/assets/
cp dist/SHA256SUMS dist/assets/
LOCAL_RELEASE_EVENT_TYPE="linux-package-release" \
LOCAL_RELEASE_OBJECT_KEY="package" \
LOCAL_RELEASE_OBJECT_NAME="${RELEASE_PACKAGE_NAME:-solo}" \
LOCAL_RELEASE_DISPATCH_FILE="linux-packages-repos-dispatch.json" \
MISE_ENV=dev mise run local-release-test:emit-json
echo "now run 'mise run local-dist-server', then move to linux-packages-repos and run 'mise run local-publish-test'"
"""
[tasks."local-release-test:macos"]
description = "Simulate the macOS build job, then emit the Homebrew tap dispatch payload"
run = """
export MISE_ENV=ci
WAILS_JSON_BACKUP="$(mktemp)"
cp {{config_root}}/wails.json "$WAILS_JSON_BACKUP"
cleanup() {
mv "$WAILS_JSON_BACKUP" {{config_root}}/wails.json
}
trap cleanup EXIT
arch="$(uname -m)"
case "$arch" in
x86_64|amd64)
build_target="darwin-amd64"
built_artifact="dist/solo-darwin-amd64.dmg"
sibling_artifact="dist/solo-darwin-arm64.dmg"
;;
arm64|aarch64)
build_target="darwin-arm64"
built_artifact="dist/solo-darwin-arm64.dmg"
sibling_artifact="dist/solo-darwin-amd64.dmg"
;;
*)
echo "unsupported macOS architecture: $arch" >&2
exit 1
;;
esac
mise run ci:rel:prepare
mise run ci:rel:build -- "$build_target"
cp "$built_artifact" "$sibling_artifact"
mise run ci:rel:checksums
mkdir -p dist/assets
cp dist/solo-darwin-*.dmg dist/assets/
cp dist/SHA256SUMS dist/assets/
LOCAL_RELEASE_EVENT_TYPE="homebrew-cask-release" \
LOCAL_RELEASE_OBJECT_KEY="cask" \
LOCAL_RELEASE_OBJECT_NAME="${RELEASE_PACKAGE_NAME:-solo}" \
LOCAL_RELEASE_DISPATCH_FILE="homebrew-tap-dispatch.json" \
MISE_ENV=dev mise run local-release-test:emit-json
echo "now run 'mise run local-dist-server', then move to homebrew-raml-dev and run 'mise run local-publish-test'"
"""
[tasks."local-release-test:windows"]
description = "Simulate the Windows build job, then emit the Scoop bucket dispatch payload"
run = """
export MISE_ENV=ci
WAILS_JSON_BACKUP="$(mktemp)"
cp {{config_root}}/wails.json "$WAILS_JSON_BACKUP"
cleanup() {
mv "$WAILS_JSON_BACKUP" {{config_root}}/wails.json
}
trap cleanup EXIT
arch="${PROCESSOR_ARCHITECTURE:-$(uname -m)}"
case "$arch" in
AMD64|x86_64|amd64)
build_target="windows-amd64"
built_artifact="dist/solo-windows-amd64.exe"
sibling_artifact="dist/solo-windows-arm64.exe"
;;
ARM64|aarch64|arm64)
build_target="windows-arm64"
built_artifact="dist/solo-windows-arm64.exe"
sibling_artifact="dist/solo-windows-amd64.exe"
;;
*)
echo "unsupported Windows architecture: $arch" >&2
exit 1
;;
esac
mise run ci:rel:prepare
mise run ci:rel:build -- "$build_target"
cp "$built_artifact" "$sibling_artifact"
mise run ci:rel:checksums
mkdir -p dist/assets
cp dist/solo-windows-*.exe dist/assets/
cp dist/SHA256SUMS dist/assets/
LOCAL_RELEASE_EVENT_TYPE="scoop-manifest-release" \
LOCAL_RELEASE_OBJECT_KEY="manifest" \
LOCAL_RELEASE_OBJECT_NAME="${RELEASE_PACKAGE_NAME:-solo}" \
LOCAL_RELEASE_DISPATCH_FILE="scoop-bucket-dispatch.json" \
MISE_ENV=dev mise run local-release-test:emit-json
echo "now run 'mise run local-dist-server', then move to scoop-bucket and run 'mise run local-publish-test'"
"""