Skip to content

Commit 49d3297

Browse files
authored
Upgrade to the @moq packages (#75)
1 parent e83be60 commit 49d3297

17 files changed

Lines changed: 267 additions & 474 deletions

.gitignore

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,14 @@
11
# Logs
22
logs
33
*.log
4-
npm-debug.log*
54

6-
# NPM
7-
node_modules/*
5+
# Dependencies
6+
node_modules/
87

98
# Build output
109
dist/
1110
.astro/
12-
13-
# logs
14-
npm-debug.log*
15-
yarn-debug.log*
16-
yarn-error.log*
17-
pnpm-debug.log*
18-
19-
# Just in case somebody runs the wrong command
20-
yarn.lock
21-
package-lock.json
2211
tsconfig.tsbuildinfo
23-
bun.lockb
2412

2513
# Mac shit
2614
.DS_Store

CLAUDE.md

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,35 @@ moq.dev is a web blog and demo for Media over QUIC (MoQ) protocol. It's built wi
1010

1111
```bash
1212
# Development
13-
npm run dev # Start dev server with auto-open and HTTPS
13+
just dev # Start dev server with auto-open
1414

15-
# Build & Production
16-
npm run build # Production build
17-
npm run prod # Build and preview production
15+
# Build & Deploy
16+
just build # Production build
17+
just deploy # Deploy to Cloudflare Pages (staging by default)
18+
just deploy live # Deploy to production
19+
just prod # Build and preview production locally
1820

1921
# Code Quality
20-
npm run check # Run Biome linting and TypeScript checking
21-
npm run fix # Auto-fix code issues and audit dependencies
22+
just check # Run Biome linting and TypeScript checking
23+
just fix # Auto-fix code formatting/lint issues
2224
```
2325

2426
## Architecture Overview
2527

2628
### Technology Stack
27-
- **Framework**: Astro with SSR via Node.js adapter
29+
- **Framework**: Astro (static output)
2830
- **UI Components**: Solid.js for interactive elements
2931
- **Styling**: Tailwind CSS
30-
- **Build**: Vite with WASM and mkcert plugins
32+
- **Build**: Vite
3133
- **Code Quality**: Biome for linting/formatting
3234
- **Package Manager**: bun v1.3.4
35+
- **Task Runner**: just
3336

3437
### Key Components
3538

36-
1. **MoQ Client Implementation** (`@kixelated/hang` package):
37-
- Custom web components: `<hang-publish>`, `<hang-watch>`, `<hang-support>`
38-
- WebTransport protocol for relay connections
39-
- Publishing: `src/components/publish.tsx` - Creates broadcasts with random names
40-
- Watching: `src/components/watch.tsx` - Connects to broadcasts by name
41-
42-
2. **Routing Structure**:
43-
- `/publish` - Create new broadcasts
44-
- `/watch/{name}` - View specific broadcast
45-
- `/blog/` - MDX-based blog posts
46-
- Dynamic routes use `export const prerender = false` for SSR
47-
48-
3. **Environment Configuration**:
49-
- `PUBLIC_RELAY_URL` - WebTransport URL
50-
- Separate `.env` files for dev/production
39+
**MoQ Client Implementation** (`@moq/publish` + `@moq/watch` packages):
40+
- Custom web components: `<moq-publish>`, `<moq-watch>`
41+
- UI wrapper components: `<moq-publish-ui>`, `<moq-watch-ui>`
5142

5243
### Important Patterns
5344

@@ -59,14 +50,12 @@ npm run fix # Auto-fix code issues and audit dependencies
5950

6051
### Deployment
6152

62-
- Docker multi-stage builds
63-
- Terraform infrastructure in `/infra/`
64-
- Production entry: `dist/server/entry.mjs`
53+
- Cloudflare Pages via Wrangler
54+
- `just deploy` for staging, `just deploy live` for production
6555

6656
## Development Tips
6757

68-
- WebTransport requires HTTPS even in development (handled by vite-plugin-mkcert)
6958
- Broadcasts are ephemeral - no persistence layer
70-
- The `@kixelated/hang` package handles all MoQ protocol implementation
59+
- The `@moq/publish` and `@moq/watch` packages handle all MoQ protocol implementation
7160
- For new blog posts, add MDX files to `src/pages/blog/`
7261
- Component changes in `src/components/` automatically reload with HMR

astro.config.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ export default defineConfig({
2626
fs: {
2727
allow: [
2828
".",
29-
// Allow `npm link @kixelated/hang`
30-
fs.realpathSync(path.resolve("node_modules/@kixelated/hang")),
29+
// Allow `npm link @moq/*`
30+
fs.realpathSync(path.resolve("node_modules/@moq/publish")),
31+
fs.realpathSync(path.resolve("node_modules/@moq/watch")),
3132
],
3233
},
3334
},
@@ -36,8 +37,5 @@ export default defineConfig({
3637
"@": "/src",
3738
},
3839
},
39-
optimizeDeps: {
40-
exclude: ["@kixelated/hang"],
41-
},
4240
},
4341
});

biome.json

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.0.5/schema.json",
2+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
33
"vcs": {
44
"enabled": true,
55
"clientKind": "git",
@@ -18,6 +18,14 @@
1818
"enabled": true,
1919
"rules": {
2020
"recommended": true,
21+
"suspicious": {
22+
"noUnknownAtRules": {
23+
"level": "error",
24+
"options": {
25+
"ignore": ["tailwind"]
26+
}
27+
}
28+
},
2129
"style": {
2230
"noParameterAssign": "error",
2331
"useAsConstAssertion": "error",
@@ -32,9 +40,34 @@
3240
}
3341
}
3442
},
43+
"css": {
44+
"parser": {
45+
"tailwindDirectives": true
46+
}
47+
},
3548
"javascript": {
3649
"formatter": {
3750
"quoteStyle": "double"
3851
}
52+
},
53+
"overrides": [
54+
{
55+
"includes": ["**/*.astro"],
56+
"linter": {
57+
"rules": {
58+
"style": {
59+
"useConst": "off",
60+
"useImportType": "off"
61+
},
62+
"correctness": {
63+
"noUnusedVariables": "off",
64+
"noUnusedImports": "off"
65+
}
66+
}
67+
}
68+
}
69+
],
70+
"html": {
71+
"experimentalFullSupportEnabled": true
3972
}
4073
}

0 commit comments

Comments
 (0)