Contribution workflow
Install dependencies
husky via the prepare lifecycle script, which installs the pre-commit hooks.Create a feature branch
Branch off
main (or the current development branch) with a descriptive name:Commit your changes
Commits are validated by
commitlint using the Conventional Commits specification. See the commit format section below.Commit message format
TouchAI uses the Conventional Commits specification enforced by@commitlint/config-conventional.
Types
| Type | When to use |
|---|---|
feat | A new feature |
fix | A bug fix |
docs | Documentation changes only |
style | Formatting changes that do not affect logic |
refactor | Code restructuring with no feature or bug change |
perf | Performance improvements |
test | Adding or updating tests |
chore | Build process, tooling, or dependency updates |
revert | Reverting a previous commit |
Examples
Pre-commit hooks
Husky runslint-staged on every commit. The following checks run automatically on staged files:
| File pattern | Actions |
|---|---|
*.{js,ts,vue} | eslint --fix then prettier --write |
*.{json,md,html,css} | prettier --write |
src-tauri/**/*.rs | cargo fmt --manifest-path src-tauri/Cargo.toml |
Code style
TypeScript / Vue
Code style is enforced by ESLint and Prettier. The active configuration:- ESLint extends
eslint:recommended,typescript-eslint/recommended,vue/flat/recommended, andprettier/recommended - Import order is enforced by
eslint-plugin-simple-import-sort(simple-import-sort/importsandsimple-import-sort/exportsare botherror) vue/no-v-htmlis disabled to allow trusted HTML rendering
.prettierrc):
| Option | Value |
|---|---|
semi | true |
tabWidth | 4 |
singleQuote | true |
trailingComma | "es5" |
printWidth | 100 |
endOfLine | "lf" |
vueIndentScriptAndStyle | true |
| Plugin | prettier-plugin-tailwindcss |
Rust
All Rust code must be formatted withrustfmt using the project manifest:
Testing
TouchAI uses Vitest for frontend unit and integration tests.test:run is used in CI and will pass even when no test files exist (--passWithNoTests).