From b7b5deb65ecfbd34c43ab5320055daf0e50b4a01 Mon Sep 17 00:00:00 2001 From: hazre Date: Wed, 22 Jul 2026 01:55:57 +0200 Subject: [PATCH] chore(mise): add task definitions and reorganize scripts Signed-off-by: hazre --- .github/workflows/tauri-build.yml | 2 +- mise.toml | 64 ++++++++++++++++++- .../{cef-copy-libs.sh => cef/copy-libs.sh} | 0 scripts/{cef-package.sh => cef/package.sh} | 0 .../symlink.js} | 1 + scripts/install-knope.js | 2 + scripts/normalize-imports.js | 2 + 7 files changed, 67 insertions(+), 4 deletions(-) rename scripts/{cef-copy-libs.sh => cef/copy-libs.sh} (100%) rename scripts/{cef-package.sh => cef/package.sh} (100%) mode change 100755 => 100644 rename scripts/{symlink-tauri-icons.js => icons/symlink.js} (98%) diff --git a/.github/workflows/tauri-build.yml b/.github/workflows/tauri-build.yml index 1158c3db1..9cbb5ae3a 100644 --- a/.github/workflows/tauri-build.yml +++ b/.github/workflows/tauri-build.yml @@ -280,7 +280,7 @@ jobs: - name: Build native packages if: matrix.cef shell: bash - run: bash scripts/cef-package.sh "$VERSION" + run: bash scripts/cef/package.sh "$VERSION" - name: Sign the AppImage for the updater if: ${{ matrix.cef && env.TAURI_SIGNING_PRIVATE_KEY != '' }} diff --git a/mise.toml b/mise.toml index 04d18ed87..3cfa1a944 100644 --- a/mise.toml +++ b/mise.toml @@ -1,7 +1,65 @@ +[env] +_.path = ["{{config_root}}/node_modules/.bin"] + [settings] idiomatic_version_file_enable_tools = ["pnpm", "node", "rust"] experimental = true -[tools] -cargo-binstall = "1.21.0" -"cargo:knope" = "0.23.0" +[task_config] +includes = ["scripts"] + +[tasks.dev] +description = "Start Vite dev server" +alias = "d" +run = "vite dev" +raw = true + +[tasks.build] +description = "Build frontend with Vite" +alias = "b" +run = "vite build" + +[tasks.preview] +description = "Preview the production build" +alias = "p" +run = "vite preview" + +[tasks.lint] +description = "Run all linting, typechecking, formatting, and dead code checks" +alias = "l" +run = ["tsc", "oxlint .", "oxfmt --check .", "knip"] + +[tasks.lint-fix] +description = "Fix lint issues, format, and run typecheck and dead code checks" +alias = "lf" +run = ["oxlint . --fix", "oxfmt .", "knip --fix"] + +[tasks.test] +description = "Run tests" +alias = "t" +run = "vitest" +raw = true + +[tasks.document-change] +description = "Document a change with knope" +alias = "doc" +run = "knope document-change" + +[tasks."cargo:lint"] +description = "Check Rust formatting and lint with Clippy" +alias = ["cl", "cargo-lint"] +dir = "src-tauri" +run = ["cargo fmt --check", "cargo clippy --all-targets --all-features -- -D warnings"] + +[tasks."cargo:lint-fix"] +description = "Fix Rust formatting and lint issues" +alias = ["clf", "cargo-lint-fix"] +dir = "src-tauri" +run = ["cargo fmt", "cargo clippy --fix --allow-dirty --all-targets --all-features -- -D warnings"] + +[tasks."cargo:test"] +description = "Run Rust tests" +alias = ["ct", "cargo-test"] +dir = "src-tauri" +run = "cargo test" +raw = true diff --git a/scripts/cef-copy-libs.sh b/scripts/cef/copy-libs.sh similarity index 100% rename from scripts/cef-copy-libs.sh rename to scripts/cef/copy-libs.sh diff --git a/scripts/cef-package.sh b/scripts/cef/package.sh old mode 100755 new mode 100644 similarity index 100% rename from scripts/cef-package.sh rename to scripts/cef/package.sh diff --git a/scripts/symlink-tauri-icons.js b/scripts/icons/symlink.js similarity index 98% rename from scripts/symlink-tauri-icons.js rename to scripts/icons/symlink.js index 25674f335..938763932 100644 --- a/scripts/symlink-tauri-icons.js +++ b/scripts/icons/symlink.js @@ -1,4 +1,5 @@ #!/usr/bin/env node +//MISE description="Create symlinks for Tauri icons from the source set" /* eslint-disable no-console */ import fs from 'node:fs'; diff --git a/scripts/install-knope.js b/scripts/install-knope.js index 74fd9c264..ced1f260b 100644 --- a/scripts/install-knope.js +++ b/scripts/install-knope.js @@ -1,4 +1,6 @@ #!/usr/bin/env node +//MISE hide=true +//MISE description="Install or update knope to the pinned version" import { spawnSync } from 'node:child_process'; import process from 'node:process'; import { chmodSync, existsSync, mkdirSync, realpathSync, writeFileSync } from 'node:fs'; diff --git a/scripts/normalize-imports.js b/scripts/normalize-imports.js index 77af442c3..415e36696 100644 --- a/scripts/normalize-imports.js +++ b/scripts/normalize-imports.js @@ -1,4 +1,6 @@ #!/usr/bin/env node +//MISE hide=true +//MISE description="Normalize import paths across the codebase" /* oxlint-disable no-console */ import fs from 'node:fs/promises';