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
66 changes: 66 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
},
Expand Down
14 changes: 10 additions & 4 deletions src/assert.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
export const assert = {
ok(value: unknown, message?: string) {
interface Assert {
ok(value: unknown, message?: string): asserts value;
strictEqual<T>(actual: T, expected: T, message?: string): void;
notStrictEqual<T>(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<T>(actual: T, expected: T, message?: string) {
strictEqual<T>(actual: T, expected: T, message?: string): void {
if (actual !== expected) {
throw new Error(message || `Assertion failed: ${actual} !== ${expected}`);
}
},
notStrictEqual<T>(actual: T, expected: T, message?: string) {
notStrictEqual<T>(actual: T, expected: T, message?: string): void {
if (actual === expected) {
throw new Error(message || `Assertion failed: ${actual} === ${expected}`);
}
Expand Down
6 changes: 2 additions & 4 deletions src/client/components/IndexPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ export function IndexPage({ path: _path }: { path?: string }) {
textAlign: 'left',
}}
>
In-browser, instant, and secure.
In-browser, instant, and secure.
</p>

{/* CTA Button */}
<button
type="button"
Expand Down Expand Up @@ -71,8 +71,6 @@ export function IndexPage({ path: _path }: { path?: string }) {
>
Get Started Here
</button>


</div>
</div>

Expand Down
25 changes: 0 additions & 25 deletions src/client/components/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)',
},
},
}}
>
<div
Expand All @@ -651,17 +637,6 @@ export function LoginPage({ path: _path }: { path?: string }) {
fontWeight: '600',
animation: 'shake 1.5s infinite',
display: 'inline-block',
'@keyframes shake': {
'0%, 100%': {
transform: 'translateX(0)',
},
'10%, 30%, 50%, 70%, 90%': {
transform: 'translateX(-2px)',
},
'20%, 40%, 60%, 80%': {
transform: 'translateX(2px)',
},
},
}}
>
⚠️ Important:
Expand Down
1 change: 1 addition & 0 deletions src/encryption.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/spark-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down