Files
SubsTracker/wrangler.toml
wangwangit 8b9e157456 feat(assets): 启用 Workers Assets 托管 public/ + ApiClient 公共库
策略说明:
- 不强行拆分 v2 的 3000+1500 行内联 HTML(独立清理 sprint)
- 仅建 public/ 给 v3 新增的客户端 JS / 独立页面用
- compatibility_date 升至 2024-09-23(assets binding 所需)

新增:
- wrangler.toml 加 [assets] directory=./public binding=ASSETS
- public/README.md 说明用途
- public/js/lib/api-client.js 统一 fetch + JSON 错误处理

后续 Task 10/11 的新 UI 通过 <script src="/js/..."> 引入,避免污染既有 HTML。

170 条测试全绿;wrangler dry-run 526 KiB / gzip 109 KiB。

Refs Task 9 of refactor/v3-product-grade plan.
2026-05-24 18:21:04 +08:00

28 lines
835 B
TOML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name = "subscription-manager"
main = "src/index.js"
compatibility_date = "2024-09-23"
compatibility_flags = ["nodejs_compat"]
[env.production]
name = "subscription-manager"
[env.staging]
name = "subscription-manager-staging"
# KV 命名空间配置(默认模板不预设固定 ID运行 npm run setup 自动生成)
# 静态资源v3 起新增):托管 public/ 目录下的 JS/CSS/HTML 给浏览器
# 使用方式:浏览器访问 /js/lib/api-client.js 等同于 public/js/lib/api-client.js
# 不命中静态资源的请求由 Worker fetch handler 处理(默认行为)
[assets]
directory = "./public"
binding = "ASSETS"
# 定时任务配置 - 每小时检查一次UTC
[triggers]
crons = ["0 * * * *"]
# 环境变量(可选,也可以在 Cloudflare Dashboard 中设置)
[vars]
ENVIRONMENT = "production"