Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,28 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 22
# The Vault crypto core is Rust -> WASM. tsc and `next build` import the
# generated bindings (src/lib/vault/pkg, gitignored), so CI must build
# them before typechecking β€” this also verifies the crypto FFI contract.
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
with:
workspaces: crypto-core
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
# Installs @mind-studio/* from GitHub Packages via the committed .npmrc.
- run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN || secrets.GITHUB_TOKEN }}
- name: Build crypto-core WASM bindings
run: npm run wasm
# Lint + format gate (Biome). Fails on errors; warnings are the
# documented legacy baseline tracked in biome.json.
- run: npx biome ci .
- run: npx tsc --noEmit
- run: npm run test
- run: npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN || secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
15 changes: 15 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Fast confidence gate before code leaves this machine β€” mirrors CI's
# correctness checks. The slow `next build` is left to CI.
# Bypass in a pinch with `git push --no-verify`.
npm run lint || exit 1

# Typecheck needs the generated WASM bindings (src/lib/vault/pkg, built via
# `npm run wasm`). Skip when absent so contributors without the Rust toolchain
# aren't blocked β€” CI always builds WASM and typechecks for real.
if [ -f src/lib/vault/pkg/crypto_core.d.ts ]; then
npm run typecheck || exit 1
else
echo "⏭ Skipping typecheck β€” WASM bindings not built (run 'npm run wasm'). CI typechecks for real."
fi

npm run test || exit 1
66 changes: 66 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"$schema": "https://biomejs.dev/schemas/2.5.0/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": true,
"includes": [
"**",
"!**/src/lib/vault/pkg",
"!**/crypto-core",
"!**/src-tauri",
"!**/public",
"!**/scripts",
"!**/next-env.d.ts",
"!**/package-lock.json",
"!**/*.css"
]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100
},
"linter": {
"enabled": true,
"domains": {
"next": "recommended",
"react": "recommended"
},
"rules": {
"recommended": true,
"correctness": {
"useExhaustiveDependencies": "warn"
},
"suspicious": {
"noImplicitAnyLet": "warn",
"useIterableCallbackReturn": "warn",
"noArrayIndexKey": "warn"
},
"a11y": {
"useButtonType": "warn",
"noLabelWithoutControl": "warn",
"noStaticElementInteractions": "warn",
"noSvgWithoutTitle": "warn",
"noAutofocus": "warn"
}
}
},

Check notice on line 52 in biome.json

View workflow job for this annotation

GitHub Actions / build

deserialize

The use of the recommended field has been deprecated, and will removed in the next major version of Biome. Use preset instead.
"javascript": {
"formatter": {
"quoteStyle": "double"
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}
Loading
Loading