mirror of
https://github.com/tiennm99/miti99bot-js.git
synced 2026-05-19 03:26:25 +00:00
6f0b5ff0a8
Code/config slice of plan phase 01 (operator-only steps for cluster
provisioning, secrets, and runtime smoke tests deferred to user).
- wrangler.toml: add `compatibility_flags = ["nodejs_compat_v2"]`
(compatibility_date `2025-10-01` already satisfies ≥ 2025-03-20)
- .env.deploy.example: add `MONGODB_URI` placeholder with mirror-protocol note
- scripts/check-secret-leaks.js: lint that fails build on `console.log(env.<SECRET>)`
for MONGODB_URI / TELEGRAM_BOT_TOKEN / TELEGRAM_WEBHOOK_SECRET / ADMIN_TOKEN
- package.json: install mongodb@^6.7.0 (resolved 6.21.0); wire secret-leak
check into `npm run lint`
- docs/using-mongodb.md: operational runbook (cluster spec, free-tier ceiling,
auto-pause behavior, network access permanence, rollback, rotation)
Bundle-size HARD GATE: PASS. Probe with `import { MongoClient }` measures
226 KiB gzipped (3 MiB Free cap, 92% headroom) — nodejs_compat_v2 provides
node:net/tls/crypto from runtime so transitive deps stay unbundled.
CPU-time gate and auto-pause behavior gate require real Atlas access;
deferred to operator (see docs/using-mongodb.md for procedure).
503/503 vitest tests still pass.
37 lines
1.3 KiB
JSON
37 lines
1.3 KiB
JSON
{
|
|
"name": "miti99bot",
|
|
"version": "0.1.0",
|
|
"description": "Telegram bot with plug-n-play module system, deployed to Cloudflare Workers.",
|
|
"private": true,
|
|
"type": "module",
|
|
"engines": {
|
|
"node": ">=20.6"
|
|
},
|
|
"scripts": {
|
|
"dev": "wrangler dev",
|
|
"build": "npm run build:wordle-data && npm run build:semantle-words",
|
|
"build:wordle-data": "node scripts/build-wordle-data.js",
|
|
"build:semantle-words": "node scripts/build-semantle-words.js",
|
|
"scrape:loldle-data": "node scripts/scrape-loldle-data.js",
|
|
"fetch:ddragon-data": "node scripts/fetch-ddragon-data.js",
|
|
"deploy": "npm run build && wrangler deploy && npm run db:migrate && npm run register",
|
|
"db:migrate": "node scripts/migrate.js",
|
|
"register": "node --env-file-if-exists=.env.deploy scripts/register.js",
|
|
"register:dry": "node --env-file-if-exists=.env.deploy scripts/register.js --dry-run",
|
|
"lint": "biome check . && eslint src && node scripts/check-secret-leaks.js",
|
|
"format": "biome format --write .",
|
|
"test": "vitest run"
|
|
},
|
|
"dependencies": {
|
|
"grammy": "^1.30.0",
|
|
"mongodb": "^6.21.0"
|
|
},
|
|
"devDependencies": {
|
|
"@biomejs/biome": "^1.9.0",
|
|
"eslint": "^10.2.0",
|
|
"eslint-plugin-jsdoc": "^62.9.0",
|
|
"vitest": "^4.1.4",
|
|
"wrangler": "^4.84.0"
|
|
}
|
|
}
|