-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpackage.json
More file actions
executable file
·49 lines (49 loc) · 2.16 KB
/
Copy pathpackage.json
File metadata and controls
executable file
·49 lines (49 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
"name": "cfmc-server",
"version": "0.1.0",
"description": "CFMC-Edge — 在 Cloudflare 全球边缘网络上运行的纯 Serverless Minecraft 服务器 (Workers + Durable Objects + D1)",
"main": "src/index.js",
"type": "module",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/ZerexaNet/cfmc-server"
},
"engines": {
"node": ">=18.0.0"
},
"scripts": {
"dev": "wrangler dev",
"deploy": "npm run db:migrate && wrangler deploy",
"db:migrate": "wrangler d1 migrations apply USERS_DB --remote && wrangler d1 migrations apply WORLD_DB --remote",
"db:migrate:local": "wrangler d1 migrations apply USERS_DB --local && wrangler d1 migrations apply WORLD_DB --local",
"init:d1": "bash scripts/init-d1.sh",
"init:d1:local": "bash scripts/init-d1.sh --local",
"import:anvil": "bash scripts/import-world.sh",
"tail": "wrangler tail --format pretty",
"test": "vitest run"
},
"cloudflare": {
"bindings": {
"AUTH_JWT_SECRET": {
"description": "JWT 签名密钥 (保护玩家登录会话)。生成强随机值: `openssl rand -hex 32`"
},
"ADMIN_TOKEN": {
"description": "Web 管理面板 (`/admin`) 与管理 API (`/api/admin/*`) 的访问令牌。生成强随机值: `openssl rand -hex 32`"
}
}
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20240620.0",
"@cloudflare/vitest-pool-workers": "^0.4.0",
"typescript": "^5.4.5",
"vitest": "^1.6.0",
"wrangler": "^4.0.0"
},
"comments": {
"零依赖设计": "运行时 dependencies 为空——Workers 冷启动时间与包体积正相关, 所有功能(路由/中间件/协议编解码)均手写实现, 不引入第三方运行时依赖",
"wrangler": "仅作为开发/部署工具链 (devDependency), 不会打包进 Worker",
"deploy脚本": "deploy 先按 wrangler 标准迁移应用 D1 建表 (引用绑定名, 与库实际名称解耦 — Deploy to Cloudflare 按钮部署时用户可自定义库名) 再 wrangler deploy",
"cloudflare字段": "Deploy to Cloudflare 按钮向导会读取 cloudflare.bindings 描述, 向部署者解释每个 Secret 的用途与填法"
}
}