- 原生 Next.js App Router + 严格 TypeScript 实现花魁短剧 PC/H5 页面,按 src/features/{catalog,content,playback} 组织,保留完整 SEO(metadata、JSON-LD、canonical、robots、llms、sitemap、IndexNow)。
- 主域名通过 SITE_URL=https://huakuidj.com 强制覆盖后端 foreverUrlAddr(config/*.env、src/server/config.ts、src/server/seo/shared.ts、src/server/services/shared.ts),支持邮箱改为 support@huakuidj.com。
- 移除登录与账户体系:删除 /account 全部页面、登录/注册/充值弹窗、收藏点赞、评论、金币解锁及对应 BFF 接口;旧账户地址 GET/HEAD 统一 301 到首页(src/lib/routes.ts REMOVED_ACCOUNT_PATHS),保留游客会话、反馈、图片上传、观看上报与搜索联想。
- 播放页:评论位改为同类推荐 + 热播榜单,锁定集改为 App 观看遮罩与底部弹层,新增简介标签、分集图例与独立视觉皮肤(src/features/playback、src/styles/pages/playback.css)。
- 卡片:短剧/视频卡状态与时长移至信息行胶囊标签,封面角标移至左上角(src/components/catalog/Cards.tsx、src/styles/foundations/base.css)。
- 同步更新单元测试、浏览器冒烟脚本、路由清单与 README。
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
31 lines
1.5 KiB
TypeScript
31 lines
1.5 KiB
TypeScript
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
import sharp from "sharp";
|
|
import { pwaConfig } from "../src/lib/pwa/config";
|
|
import { brandAssets } from "../src/lib/brand-assets";
|
|
|
|
// Rasterize the existing Figma favicon paths unchanged; maskable icons need a
|
|
// separate opaque canvas with the entire mark inside the central safe circle.
|
|
const source = await readFile(new URL("../public" + brandAssets.iconSvg, import.meta.url));
|
|
const outputs = [
|
|
{ file: pwaConfig.icons.small, size: 192, mark: 192 },
|
|
{ file: pwaConfig.icons.large, size: 512, mark: 512 },
|
|
{ file: pwaConfig.icons.maskable, size: 512, mark: 288 },
|
|
{ file: pwaConfig.icons.apple, size: 180, mark: 144 },
|
|
];
|
|
const directory = new URL("../public/static/pwa/", import.meta.url);
|
|
await mkdir(directory, { recursive: true });
|
|
for (const { file, size, mark } of outputs) {
|
|
const image = await sharp(source, { density: 384 }).resize(mark, mark).png().toBuffer();
|
|
const bytes = await sharp({ create: {
|
|
width: size, height: size, channels: 4, background: pwaConfig.themeColor,
|
|
} }).composite([{ input: image, gravity: "centre" }]).png().toBuffer();
|
|
const path = new URL("../public" + file, import.meta.url);
|
|
if (process.argv.includes("--check")) {
|
|
const existing = await readFile(path);
|
|
if (!existing.equals(bytes)) throw new Error(`${file} is stale. Run npm run assets:pwa.`);
|
|
} else {
|
|
await writeFile(path, bytes);
|
|
}
|
|
}
|
|
console.log("PWA icons match the existing Figma favicon.");
|