forked from janhq/jan
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmise.toml
More file actions
286 lines (240 loc) · 10.1 KB
/
Copy pathmise.toml
File metadata and controls
286 lines (240 loc) · 10.1 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
[tools]
node = "20"
rust = "1.85.1"
sccache = "latest"
[env]
_.path = ['./node_modules/.bin']
RUSTC_WRAPPER="sccache"
# ============================================================================
# CORE SETUP AND CONFIGURATION TASKS
# ============================================================================
[tasks.config-yarn]
description = "Configure yarn version and settings"
run = [
"corepack enable",
"corepack prepare yarn@4.5.3 --activate",
"yarn --version",
"yarn config set -H enableImmutableInstalls false"
]
[tasks.install]
description = "Install dependencies"
depends = ["config-yarn"]
run = "yarn install"
sources = ['package.json', 'yarn.lock']
outputs = ['node_modules']
[tasks.build-tauri-plugin-api]
description = "Build Tauri plugin API"
depends = ["install"]
run = "yarn build:tauri:plugin:api"
sources = ['src-tauri/plugins/**/*']
outputs = [
'src-tauri/plugins/tauri-plugin-hardware/dist-js',
'src-tauri/plugins/tauri-plugin-llamacpp/dist-js',
]
[tasks.build-core]
description = "Build core package"
depends = ["build-tauri-plugin-api"]
run = "yarn build:core"
sources = ['core/**/*']
outputs = ['core/dist']
[tasks.build-extensions]
description = "Build extensions"
depends = ["build-core"]
run = "yarn build:extensions && yarn build:extensions-web"
sources = ['extensions/**/*']
outputs = ['pre-install/*.tgz']
[tasks.install-and-build]
description = "Install dependencies and build core and extensions (matches Makefile)"
depends = ["build-extensions"]
# ============================================================================
# DEVELOPMENT TASKS
# ============================================================================
[tasks.dev]
description = "Start development server (matches Makefile)"
depends = ["install-and-build"]
run = [
"yarn download:bin",
"yarn dev"
]
[tasks.dev-tauri]
description = "Start development server with Tauri (DEPRECATED - matches Makefile)"
depends = ["install-and-build"]
run = [
"yarn download:bin",
"yarn dev:tauri"
]
# ============================================================================
# WEB APPLICATION DEVELOPMENT TASKS
# ============================================================================
[tasks.dev-web-app]
description = "Start web application development server (matches Makefile)"
depends = ["build-core"]
run = "yarn dev:web-app"
[tasks.build-web-app]
description = "Build web application (matches Makefile)"
depends = ["build-core"]
run = "yarn build:web-app"
[tasks.serve-web-app]
description = "Serve built web application"
run = "yarn serve:web-app"
[tasks.build-serve-web-app]
description = "Build and serve web application (matches Makefile)"
depends = ["build-web-app"]
run = "yarn serve:web-app"
# ============================================================================
# BUILD TASKS
# ============================================================================
[tasks.install-rust-targets]
description = "Install required Rust targets for MacOS universal builds"
run = '''
#!/usr/bin/env bash
# Check if we're on macOS
if [[ "$OSTYPE" == "darwin"* ]]; then
echo "Detected macOS, installing universal build targets..."
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
echo "Rust targets installed successfully!"
fi
'''
[tasks.build]
description = "Build complete application (matches Makefile)"
depends = ["install-rust-targets", "install-and-build"]
run = [
"yarn download:bin",
"yarn build"
]
# ============================================================================
# QUALITY ASSURANCE TASKS
# ============================================================================
[tasks.lint]
description = "Run linting (matches Makefile)"
depends = ["build-extensions"]
run = "yarn lint"
# ============================================================================
# RUST TEST COMPONENTS
# ============================================================================
[tasks.test-rust-main]
description = "Test main src-tauri package"
run = "cargo test --manifest-path src-tauri/Cargo.toml --no-default-features --features test-tauri -- --test-threads=1"
[tasks.test-rust-hardware]
description = "Test hardware plugin"
run = "cargo test --manifest-path src-tauri/plugins/tauri-plugin-hardware/Cargo.toml"
[tasks.test-rust-llamacpp]
description = "Test llamacpp plugin"
run = "cargo test --manifest-path src-tauri/plugins/tauri-plugin-llamacpp/Cargo.toml"
[tasks.test-rust-utils]
description = "Test utils package"
run = "cargo test --manifest-path src-tauri/utils/Cargo.toml"
[tasks.test-rust]
description = "Run all Rust tests"
depends = ["test-rust-main", "test-rust-hardware", "test-rust-llamacpp", "test-rust-utils"]
# ============================================================================
# JS TEST COMPONENTS
# ============================================================================
[tasks.test-js-setup]
description = "Setup for JS tests"
run = [
"yarn download:bin",
"yarn download:lib",
"yarn copy:assets:tauri",
"yarn build:icon"
]
[tasks.test-js]
description = "Run JS tests"
depends = ["test-js-setup"]
run = "yarn test"
# ============================================================================
# COMBINED TEST TASKS
# ============================================================================
[tasks.test]
description = "Run complete test suite (matches Makefile)"
depends = ["lint", "test-js", "test-rust"]
# ============================================================================
# PARALLEL-FRIENDLY QUALITY ASSURANCE TASKS
# ============================================================================
[tasks.lint-only]
description = "Run linting only (parallel-friendly)"
depends = ["build-extensions"]
run = "yarn lint"
hide = true
[tasks.test-only]
description = "Run tests only (parallel-friendly)"
depends = ["build-extensions", "test-js", "test-rust"]
hide = true
[tasks.qa-parallel]
description = "Run linting and testing in parallel"
depends = ["lint-only", "test-only"]
# ============================================================================
# UTILITY TASKS
# ============================================================================
[tasks.clean]
description = "Clean all build artifacts and dependencies (cross-platform - matches Makefile)"
run = '''
#!/usr/bin/env bash
echo "Cleaning build artifacts and dependencies..."
# Platform detection and cleanup (matches Makefile exactly)
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
# Windows cleanup using PowerShell (matches Makefile)
powershell -Command "Get-ChildItem -Path . -Include node_modules, .next, dist, build, out, .turbo, .yarn -Recurse -Directory | Remove-Item -Recurse -Force" 2>/dev/null || true
powershell -Command "Get-ChildItem -Path . -Include package-lock.json, tsconfig.tsbuildinfo -Recurse -File | Remove-Item -Recurse -Force" 2>/dev/null || true
powershell -Command "Remove-Item -Recurse -Force ./pre-install/*.tgz" 2>/dev/null || true
powershell -Command "Remove-Item -Recurse -Force ./extensions/*/*.tgz" 2>/dev/null || true
powershell -Command "Remove-Item -Recurse -Force ./electron/pre-install/*.tgz" 2>/dev/null || true
powershell -Command "Remove-Item -Recurse -Force ./src-tauri/resources" 2>/dev/null || true
powershell -Command "Remove-Item -Recurse -Force ./src-tauri/target" 2>/dev/null || true
powershell -Command "if (Test-Path \"\$(\$env:USERPROFILE)\\jan\\extensions\\\") { Remove-Item -Path \"\$(\$env:USERPROFILE)\\jan\\extensions\" -Recurse -Force }" 2>/dev/null || true
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
# Linux cleanup (matches Makefile)
find . -name "node_modules" -type d -prune -exec rm -rf '{}' + 2>/dev/null || true
find . -name ".next" -type d -exec rm -rf '{}' + 2>/dev/null || true
find . -name "dist" -type d -exec rm -rf '{}' + 2>/dev/null || true
find . -name "build" -type d -exec rm -rf '{}' + 2>/dev/null || true
find . -name "out" -type d -exec rm -rf '{}' + 2>/dev/null || true
find . -name ".turbo" -type d -exec rm -rf '{}' + 2>/dev/null || true
find . -name ".yarn" -type d -exec rm -rf '{}' + 2>/dev/null || true
find . -name "package-lock.json" -type f -exec rm -rf '{}' + 2>/dev/null || true
rm -rf ./pre-install/*.tgz 2>/dev/null || true
rm -rf ./extensions/*/*.tgz 2>/dev/null || true
rm -rf ./electron/pre-install/*.tgz 2>/dev/null || true
rm -rf ./src-tauri/resources 2>/dev/null || true
rm -rf ./src-tauri/target 2>/dev/null || true
rm -rf ~/jan/extensions 2>/dev/null || true
rm -rf "~/.cache/jan*" 2>/dev/null || true
rm -rf "./.cache" 2>/dev/null || true
else
# macOS cleanup (matches Makefile)
find . -name "node_modules" -type d -prune -exec rm -rf '{}' + 2>/dev/null || true
find . -name ".next" -type d -exec rm -rf '{}' + 2>/dev/null || true
find . -name "dist" -type d -exec rm -rf '{}' + 2>/dev/null || true
find . -name "build" -type d -exec rm -rf '{}' + 2>/dev/null || true
find . -name "out" -type d -exec rm -rf '{}' + 2>/dev/null || true
find . -name ".turbo" -type d -exec rm -rf '{}' + 2>/dev/null || true
find . -name ".yarn" -type d -exec rm -rf '{}' + 2>/dev/null || true
find . -name "package-lock.json" -type f -exec rm -rf '{}' + 2>/dev/null || true
rm -rf ./pre-install/*.tgz 2>/dev/null || true
rm -rf ./extensions/*/*.tgz 2>/dev/null || true
rm -rf ./electron/pre-install/*.tgz 2>/dev/null || true
rm -rf ./src-tauri/resources 2>/dev/null || true
rm -rf ./src-tauri/target 2>/dev/null || true
rm -rf ~/jan/extensions 2>/dev/null || true
rm -rf ~/Library/Caches/jan* 2>/dev/null || true
fi
echo "Clean completed!"
'''
[tasks.all]
description = "Default target - shows available commands (matches Makefile)"
run = "echo 'Specify a target to run. Use: mise tasks'"
# ============================================================================
# DEVELOPMENT WORKFLOW SHORTCUTS
# ============================================================================
[tasks.setup]
description = "Complete development setup"
depends = ["install-and-build"]
alias = "init"
[tasks.ci]
description = "Run CI pipeline (lint + test sequentially)"
depends = ["test"]
[tasks.ci-parallel]
description = "Run CI pipeline (lint + test in parallel)"
depends = ["qa-parallel"]
alias = "ci-fast"