diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4b932f0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,66 @@ +name: CI + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + tslint: + name: TypeScript Type Check + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + + - name: Install dependencies + run: bun install + + - name: Run TypeScript type checking + run: bun run tslint + + check: + name: Biome Check + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + + - name: Install dependencies + run: bun install + + - name: Run Biome check + run: bun run check + + test: + name: Run Tests + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + + - name: Install dependencies + run: bun install + + - name: Run tests + run: bun run test + diff --git a/package.json b/package.json index 02dbd22..6a951ca 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "build:watch": "bun build src/client/app.tsx --outdir dist --target browser --watch", "start": "bun run build && PORT=443 bun run src/index.ts", "dev:full": "concurrently \"bun run dev\" \"bun run build:watch\"", + "tslint": "tsc --noEmit", "check": "biome check src/", "check:fix": "biome check --fix src/" }, diff --git a/src/assert.ts b/src/assert.ts index 67e8739..8e1788b 100644 --- a/src/assert.ts +++ b/src/assert.ts @@ -1,15 +1,21 @@ -export const assert = { - ok(value: unknown, message?: string) { +interface Assert { + ok(value: unknown, message?: string): asserts value; + strictEqual(actual: T, expected: T, message?: string): void; + notStrictEqual(actual: T, expected: T, message?: string): void; +} + +export const assert: Assert = { + ok(value: unknown, message?: string): asserts value { if (!value) { throw new Error(message || 'Assertion failed: value is not truthy'); } }, - strictEqual(actual: T, expected: T, message?: string) { + strictEqual(actual: T, expected: T, message?: string): void { if (actual !== expected) { throw new Error(message || `Assertion failed: ${actual} !== ${expected}`); } }, - notStrictEqual(actual: T, expected: T, message?: string) { + notStrictEqual(actual: T, expected: T, message?: string): void { if (actual === expected) { throw new Error(message || `Assertion failed: ${actual} === ${expected}`); } diff --git a/src/client/components/IndexPage.tsx b/src/client/components/IndexPage.tsx index ff7b4e2..8e457d3 100644 --- a/src/client/components/IndexPage.tsx +++ b/src/client/components/IndexPage.tsx @@ -37,9 +37,9 @@ export function IndexPage({ path: _path }: { path?: string }) { textAlign: 'left', }} > - In-browser, instant, and secure. + In-browser, instant, and secure.

- + {/* CTA Button */} - - diff --git a/src/client/components/LoginPage.tsx b/src/client/components/LoginPage.tsx index e9e6fcd..e83f3dd 100644 --- a/src/client/components/LoginPage.tsx +++ b/src/client/components/LoginPage.tsx @@ -629,20 +629,6 @@ export function LoginPage({ path: _path }: { path?: string }) { lineHeight: '1.5', textShadow: '0 1px 2px rgba(0, 0, 0, 0.1)', animation: 'pulse 2s infinite', - '@keyframes pulse': { - '0%': { - transform: 'scale(1)', - boxShadow: '0 0 0 0 rgba(255, 255, 255, 0.4)', - }, - '70%': { - transform: 'scale(1.02)', - boxShadow: '0 0 0 10px rgba(255, 255, 255, 0)', - }, - '100%': { - transform: 'scale(1)', - boxShadow: '0 0 0 0 rgba(255, 255, 255, 0)', - }, - }, }} >
⚠️ Important: diff --git a/src/encryption.ts b/src/encryption.ts index 0c9359d..4b1959f 100644 --- a/src/encryption.ts +++ b/src/encryption.ts @@ -1,6 +1,7 @@ import { scryptAsync } from '@noble/hashes/scrypt'; // @ts-ignore dont want to install @types/browserify-cipher as it has incorrect definition of the func we use import * as aes from 'browserify-cipher'; +// @ts-ignore its purejs, we donthave types for it import { hexToUint8Array, uint8ArrayToHex } from './uint8array-extras'; const createCipheriv = aes.createCipheriv; diff --git a/src/spark-service.ts b/src/spark-service.ts index 6a34fc0..e1b1970 100644 --- a/src/spark-service.ts +++ b/src/spark-service.ts @@ -16,8 +16,8 @@ export async function initializeSparkWallet() { }, }); - wallet.on('transfer:claimed', (transferId: string, balance: number) => { - console.log(`Transfer ${transferId} claimed. New balance: ${balance}`); + wallet.on('transfer:claimed', (transferId: string, updatedBalance: bigint) => { + console.log(`Transfer ${transferId} claimed. New balance: ${Number(updatedBalance)}`); }); sparkWallet = wallet;