Merge branch 'rewrite'

This commit is contained in:
Maze Winther
2026-06-21 15:09:34 +02:00
13 changed files with 148 additions and 1758 deletions
+24
View File
@@ -0,0 +1,24 @@
$schema: 'https://moonrepo.dev/schemas/project.json'
language: 'typescript'
layer: 'application'
tasks:
dev:
command: 'bun run dev'
options:
runInCI: false # dev server — skipped in CI, never cached
build:
command: 'bun run build'
inputs:
- 'src/**/*'
- 'wrangler.jsonc'
- 'package.json'
outputs:
- 'dist'
deploy:
command: 'bun run deploy'
deps:
- '~:build'
+17
View File
@@ -0,0 +1,17 @@
{
"name": "@opencut/api",
"private": true,
"version": "0.0.1",
"scripts": {
"dev": "wrangler dev",
"deploy": "wrangler deploy",
"build": "wrangler deploy --dry-run"
},
"dependencies": {
"elysia": "latest"
},
"devDependencies": {
"@cloudflare/workers-types": "latest",
"wrangler": "latest"
}
}
+15
View File
@@ -0,0 +1,15 @@
import { Elysia, t } from "elysia";
import { CloudflareAdapter } from "elysia/adapter/cloudflare-worker";
export default new Elysia({ adapter: CloudflareAdapter })
.get("/", () => ({ status: "ok" }))
.get("/health", () => ({ healthy: true, timestamp: new Date().toISOString() }))
.post(
"/echo",
({ body }) => body,
{
body: t.Object({ message: t.String() }),
}
)
// .compile() is required — it triggers AoT compilation at startup
.compile();
+7
View File
@@ -0,0 +1,7 @@
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "opencut-api",
"main": "src/index.ts",
// Minimum date required for CloudflareAdapter AoT support
"compatibility_date": "2025-06-01"
}
+32
View File
@@ -0,0 +1,32 @@
$schema: 'https://moonrepo.dev/schemas/project.json'
language: 'typescript'
layer: 'application'
tasks:
dev:
command: 'bun run dev'
options:
runInCI: false # dev server — skipped in CI, never cached
build:
command: 'bun run build'
inputs:
- 'src/**/*'
- 'public/**/*'
- 'vite.config.ts'
- 'tsconfig.json'
- 'package.json'
outputs:
- 'dist'
test:
command: 'bun run test'
inputs:
- 'src/**/*'
- 'tsconfig.json'
deploy:
command: 'bun run deploy'
deps:
- '~:build'