feat: migrate rice preview to Next.js
Verify mini program and deploy preview / verify-deploy (push) Successful in 3m0s

This commit is contained in:
2026-09-20 14:22:47 +08:00
parent 5a16113a6d
commit 2bf21a9f97
29 changed files with 6338 additions and 47 deletions
+6 -1
View File
@@ -1 +1,6 @@
import{readFileSync,existsSync}from'node:fs';const required=['app.js','app.json','pages/index/index.xhsml','pages/test/test.js','pages/result/result.js','assets/test-covers/rice.jpg','vendor/poster-editor.cjs','web/index.html','web/app.js'];for(const file of required)if(!existsSync(file))throw new Error(`Missing ${file}`);JSON.parse(readFileSync('app.json','utf8'));console.log(`Static checks passed (${required.length} required files).`);
import { readFileSync, existsSync } from 'node:fs';
const required = ['app.js','app.json','pages/index/index.xhsml','pages/test/test.js','pages/result/result.js','assets/test-covers/rice.jpg','vendor/poster-editor.cjs','web/package.json','web/next.config.mjs','web/app/page.jsx','web/app/api/[...path]/route.js','web/components/RiceArena.jsx','web/components/RicePosterEditor.jsx'];
for (const file of required) if (!existsSync(file)) throw new Error(`Missing ${file}`);
JSON.parse(readFileSync('app.json','utf8'));
if (!readFileSync('web/next.config.mjs','utf8').includes("output: 'standalone'")) throw new Error('Next.js standalone output is required');
console.log(`Static checks passed (${required.length} required files).`);
+8 -2
View File
@@ -9,12 +9,18 @@ required = [
"pages/result/result.js",
"assets/test-covers/rice.jpg",
"vendor/poster-editor.cjs",
"web/index.html",
"web/app.js",
"web/package.json",
"web/next.config.mjs",
"web/app/page.jsx",
"web/app/api/[...path]/route.js",
"web/components/RiceArena.jsx",
"web/components/RicePosterEditor.jsx",
]
missing = [name for name in required if not Path(name).is_file()]
if missing:
raise SystemExit("Missing required files: " + ", ".join(missing))
json.loads(Path("app.json").read_text())
if "output: 'standalone'" not in Path("web/next.config.mjs").read_text():
raise SystemExit("Next.js standalone output is required")
print(f"Static checks passed ({len(required)} required files).")