* add mcp for web * update /jan/v1 endpoint to /v1 * update mise and makefile * update yarn lock * use mcp oauth properly
292 lines
10 KiB
TOML
292 lines
10 KiB
TOML
[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"
|
|
]
|
|
|
|
[tasks.build-and-publish]
|
|
description = "Build and publish the application (matches Makefile)"
|
|
depends = ["install-and-build"]
|
|
run = "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"
|