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

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

jobs:
frontend:
name: Frontend CI
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json

- name: Install dependencies
run: npm ci

- name: Sync SvelteKit
run: npx svelte-kit sync

- name: Check Types
run: npm run check

- name: Lint
run: npm run lint

- name: Unit Tests
run: npm run test:unit

- name: Install Playwright Browsers
run: npx playwright install --with-deps

- name: E2E Tests
run: npm run test:e2e

- name: Build
run: npm run build

worker:
name: Worker CI
runs-on: ubuntu-latest
defaults:
run:
working-directory: worker
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: worker/package-lock.json

- name: Install dependencies
run: npm ci

- name: Build
run: npx wrangler deploy --dry-run --outdir=dist
33 changes: 29 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ This repository now contains two main pieces:
- `frontend/` — A SvelteKit (TypeScript) frontend scaffold. The home page (`src/routes/+page.svelte`) contains tiles that link to individual tools (e.g. `/handicap`).
- `worker/` — A Cloudflare Worker scaffold (TypeScript) using `Hono` for lightweight API endpoints. It exposes `/api/handicap` and `/api/health` handlers.

Quick start (local)
-
## Quick start (local)

Prereqs: Node 18+, npm, and `wrangler` for Cloudflare Workers.

1. Frontend
Expand All @@ -32,11 +32,36 @@ npm install
npx wrangler dev
```

Deploy notes
## Running Tests
The frontend includes both end-to-end tests (Playwright) and unit tests (Vitest).

```bash
cd frontend
```

### Unit Tests
```bash
npm run test:unit
```

### End-to-End Tests
```bash
# Install Playwright browsers (first time only)
npx playwright install
# Run tests
npm run test:e2e
```

### Run all tests
```bash
npm run test
```

### Deploy notes
- Frontend: build with `npm run build` in `frontend/` and deploy to Cloudflare Pages. SvelteKit supports the Cloudflare adapter for Pages/Workers.
- Worker: publish with `npx wrangler publish` (fill `account_id` in `worker/wrangler.toml`).

Next steps
### Next steps
- Wire the frontend to the Worker API endpoints health endpoint
- Implement availability tracker

6 changes: 4 additions & 2 deletions frontend/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ export default defineConfig(
globals: { ...globals.browser, ...globals.node }
},
rules: { // typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
// see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
"no-undef": 'off' }
// see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
"no-undef": 'off',
"svelte/no-navigation-without-resolve": "off"
}
},
{
files: [
Expand Down
Loading