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
108 changes: 108 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: CI

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

env:
NODE_VERSION: "22"
HUSKY: 0

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run Ultracite linter
run: pnpm lint
env:
SKIP_ENV_VALIDATION: true

format:
name: Format Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Check formatting
run: pnpm format:check
env:
SKIP_ENV_VALIDATION: true

typecheck:
name: TypeScript Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run TypeScript check
run: pnpm typecheck
env:
SKIP_ENV_VALIDATION: true

test:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run tests
run: pnpm test -- --reporter=dot
env:
SKIP_ENV_VALIDATION: true
68 changes: 0 additions & 68 deletions .husky/pre-commit

This file was deleted.

19 changes: 19 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh
# Exit on any error
set -e

echo "Running pre-push checks..."

# Run lint check
echo "→ Linting..."
pnpm lint

# Run format check
echo "→ Checking formatting..."
pnpm format:check

# Run typecheck
echo "→ Type checking..."
pnpm typecheck

echo "✅ All pre-push checks passed!"
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"lint": "ultracite check",
"lint:fix": "ultracite fix",
"format": "biome format --write",
"format:check": "biome format",
"typecheck": "tsc --noEmit",
"verify": "pnpm lint && pnpm typecheck && pnpm format",
"test": "vitest run",
Expand All @@ -23,7 +24,8 @@
"db:studio": "drizzle-kit studio",
"auth:generate": "SKIP_ENV_VALIDATION=true pnpm dlx @better-auth/cli generate --output ./src/db/schema/auth.ts",
"email:dev": "email dev --dir ./emails -p 3333",
"email:test": "tsx scripts/test-magic-link.ts"
"email:test": "tsx scripts/test-magic-link.ts",
"prepare": "husky"
},
"dependencies": {
"@hookform/resolvers": "^5.2.2",
Expand Down
4 changes: 3 additions & 1 deletion src/lib/encryption.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ export function decrypt(payload: string): string {
);
decipher.setAuthTag(Buffer.from(authTagHex, "hex"));

return decipher.update(encryptedHex, "hex", "utf8") + decipher.final("utf8");
return (
decipher.update(encryptedHex, "hex", "utf8") + decipher.final("utf8")
);
} catch (error) {
throw new DecryptionError("Failed to decrypt payload", { cause: error });
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/middleware/logging.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { RequestLog } from "@/server/services/log-service";
import { sanitizeBody, sanitizeHeaders } from "@/lib/logging-sanitization";
import { createMiddleware } from "@modelcontextprotocol/sdk/client/middleware.js";
import { sanitizeBody, sanitizeHeaders } from "@/lib/logging-sanitization";
import type { RequestLog } from "@/server/services/log-service";

export type LogCallback = (
log: Omit<RequestLog, "userId" | "serverId">
Expand Down