next-site: scaffold worker, D1 database, and deploy wiring

This commit is contained in:
Ally Founder 2026-08-15 12:11:40 -04:00
parent 9cc2a7a849
commit ef25876bfb
7 changed files with 64 additions and 1 deletions

View file

@ -12,6 +12,7 @@
},
"devDependencies": {
"@biomejs/biome": "^2.5.6",
"@cloudflare/workers-types": "^5.20260815.1",
"@shopify/flash-list": "^2.3.2",
"@types/node": "^26.1.2",
"@types/react": "^19.2.17",
@ -89,6 +90,8 @@
"@cloudflare/workerd-windows-64": ["@cloudflare/workerd-windows-64@1.20260801.1", "", { "os": "win32", "cpu": "x64" }, "sha512-2oQz+Ksu4ji6e/+ZoYX+tWQEcxAii2p7l+iR8kx48W1llMalaufAsmVxTlk+3/vrM7D3/2c0iK448e0UQTcIMg=="],
"@cloudflare/workers-types": ["@cloudflare/workers-types@5.20260815.1", "", {}, "sha512-btpW8rEgeJKcxDlBWKxzjLLUHxzUWqXZY8O+DmM6NcSHadUQN5I71z6Q/yAKCTJyGS7adBpXzlsZSFbosLnECQ=="],
"@cspotcode/source-map-support": ["@cspotcode/source-map-support@0.8.1", "", { "dependencies": { "@jridgewell/trace-mapping": "0.3.9" } }, "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw=="],
"@emnapi/core": ["@emnapi/core@2.0.0-alpha.3", "", { "dependencies": { "@emnapi/wasi-threads": "2.0.1", "tslib": "^2.4.0" } }, "sha512-AZypUeJ/yByuxyS7BlSNRDOMLMlROYtjYdIAuBmJssVz1UJDSeYxLrdizhXCFYhedC5bqd/ASy8EuNXbVVXp9g=="],

View file

@ -8,7 +8,7 @@
"generate-index": "bun node_modules/@revenge-mod/plugin-cli/src/main.ts generate-index",
"serve": "bun node_modules/@revenge-mod/plugin-cli/src/main.ts serve",
"lint": "biome check",
"lint:types": "tsc --noEmit && tsc -p cli --noEmit"
"lint:types": "tsc --noEmit && tsc -p worker --noEmit && tsc -p cli --noEmit"
},
"dependencies": {
"@revenge-mod/devtools-client": "^1.4.0",
@ -18,6 +18,7 @@
},
"devDependencies": {
"@biomejs/biome": "^2.5.6",
"@cloudflare/workers-types": "^5.20260815.1",
"@shopify/flash-list": "^2.3.2",
"@types/node": "^26.1.2",
"@types/react": "^19.2.17",

29
worker/schema.sql Normal file
View file

@ -0,0 +1,29 @@
DROP TABLE IF EXISTS plugin_overrides;
CREATE TABLE plugin_overrides (
id TEXT PRIMARY KEY,
name TEXT,
description TEXT,
tagline TEXT,
note TEXT,
category TEXT,
accent TEXT,
status TEXT,
how_it_works TEXT,
features TEXT, -- JSON array of strings
commands TEXT, -- JSON array of {cmd, desc}
limitations TEXT,
hidden INTEGER NOT NULL DEFAULT 0,
is_draft INTEGER NOT NULL DEFAULT 0,
manifest TEXT, -- only used when is_draft = 1
main_js TEXT, -- only used when is_draft = 1
updated_at TEXT NOT NULL
);
DROP TABLE IF EXISTS plugin_channels;
CREATE TABLE plugin_channels (
plugin_id TEXT NOT NULL,
channel TEXT NOT NULL, -- 'alpha' | 'beta' | 'stable'
version TEXT NOT NULL,
updated_at TEXT NOT NULL,
PRIMARY KEY (plugin_id, channel)
);

5
worker/src/env.ts Normal file
View file

@ -0,0 +1,5 @@
export interface Env {
ASSETS: Fetcher
DB: D1Database
ADMIN_TOKEN: string
}

7
worker/src/index.ts Normal file
View file

@ -0,0 +1,7 @@
import type { Env } from './env'
export default {
async fetch(request: Request, env: Env): Promise<Response> {
return env.ASSETS.fetch(request)
},
}

11
worker/tsconfig.json Normal file
View file

@ -0,0 +1,11 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Bundler",
"strict": true,
"skipLibCheck": true,
"types": ["@cloudflare/workers-types"]
},
"include": ["src"]
}

View file

@ -1,9 +1,16 @@
name = "revenge-next-plugs"
compatibility_date = "2026-08-08"
account_id = "dc5e308f1df2d6bb5082951d3f3993a5"
main = "worker/src/index.ts"
[assets]
directory = "build/dist"
binding = "ASSETS"
[[d1_databases]]
binding = "DB"
database_name = "revenge-next-plugs"
database_id = "dacf9207-d24a-4029-bb63-feea62bca6ec"
[[routes]]
pattern = "next.jarviscli.dev"