数据链路 - scripts/fetch-reading.mjs:调腾讯官方 Agent Gateway (POST https://i.weread.qq.com/api/agent/gateway,Bearer wrk-...), /shelf/sync 拿书架,再对前 N 本调 /book/getprogress 拿进度, 写出 src/data/reading.json - src/lib/reading.ts:读 JSON + 按 YYYY-MM-DD 格式化(官方硬性要求), 文件缺失返回 null 让页面走空态而不是构建报错 - src/components/bookshelf-content.astro:只渲染,页面本身不发请求 接口实测得到的几个结论(都写进脚本注释和 README 了) - skill_version 必填,业务参数平铺顶层 - /shelf/sync 一次给全封面/书名/作者/分类/最近阅读时间/deepLink, 只有进度要额外请求,所以请求数 = 1 + N - progress 是 0-100 整数,只有 100 算读完 - recordReadingTime 恒为 0,所以卡片不做「累计时长」 - deepLink 实测是普通 https,浏览器能直接打开 失败兜底(这次最关键的一条) - pnpm reading:失败 exit 1,明确报错 - pnpm build:串的是 `fetch-reading.mjs --soft`,Key 失效/断网/接口挂了 都保留上一次的 reading.json 并 exit 0,不会阻塞部署 - 实测:错误 Key 时 pnpm reading exit 1;pnpm build 完整跑通 exit 0 且 reading.json 未被改动;不设 Key 也 exit 0 - process.loadEnvFile 不覆盖已存在的环境变量,所以 CI 设的 Key 优先于 .env Key 安全 - 只写进 .env(gitignore,权限 600),已确认 git status 里没有它 - deploy.sh 是本地构建再 rsync,凭据不会上传服务器 - .env.example 补了占位和申请地址 书架页改版 - 移除漫画/论文两个分类:删掉 tab 切换、两个视图、对应筛选和 JS, 956 行 -> 620 行;sidebar 的 tab 按钮改成 #reading / #books 页内锚点 - 新增「最近在读」区块置顶(Collection · 01),书籍顺延为 02 - 卡片:封面(hot-link 腾讯 CDN,referrerpolicy=no-referrer)+ 书名 + 作者 · 分类 + 进度条 + 最近阅读日期,整卡跳 weread.qq.com - 读完标「已读完」,0% 标「还没开始」 - 过滤私密阅读(secret=1)和从没打开过的书;有声书不处理 静态验证(dist/bookshelf/index.html) - 8 张在读卡片,链接均指向 weread.qq.com/book-detail - 8 条进度条宽度 30/0/77/100/28/13/97/0,与脚本输出一致 - 8 张封面全部 hot-link,无本地副本 - 漫画/论文/comics/papers/data-type-btn/switchType 均已从产物消失 - 其他页面(首页/时间线/关于/文章页)不含该区块,未受影响
111 lines
3.6 KiB
JSON
111 lines
3.6 KiB
JSON
{
|
|
"name": "tianxuetao-blog",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"scripts": {
|
|
"dev": "astro dev",
|
|
"start": "astro dev",
|
|
"build": "node scripts/fetch-reading.mjs --soft && astro build && pagefind --site dist",
|
|
"preview": "astro preview",
|
|
"check": "astro check",
|
|
"new-post": "node scripts/new-post.mjs",
|
|
"new-thought": "node scripts/new-thought.mjs",
|
|
"reading": "node scripts/fetch-reading.mjs"
|
|
},
|
|
"dependencies": {
|
|
"@astrojs/mdx": "^5.0.6",
|
|
"@astrojs/react": "^4.4.2",
|
|
"@astrojs/rss": "^4.0.12",
|
|
"@astrojs/sitemap": "^3.5.1",
|
|
"@aws-sdk/client-s3": "^3.1037.0",
|
|
"@expressive-code/core": "^0.41.5",
|
|
"@expressive-code/plugin-collapsible-sections": "^0.41.5",
|
|
"@expressive-code/plugin-line-numbers": "^0.41.5",
|
|
"@hookform/resolvers": "^3.10.0",
|
|
"@radix-ui/react-accordion": "1.2.2",
|
|
"@radix-ui/react-alert-dialog": "1.1.4",
|
|
"@radix-ui/react-aspect-ratio": "1.1.1",
|
|
"@radix-ui/react-avatar": "1.1.2",
|
|
"@radix-ui/react-checkbox": "1.1.3",
|
|
"@radix-ui/react-collapsible": "1.1.2",
|
|
"@radix-ui/react-context-menu": "2.2.4",
|
|
"@radix-ui/react-dialog": "1.1.4",
|
|
"@radix-ui/react-dropdown-menu": "2.1.4",
|
|
"@radix-ui/react-hover-card": "1.1.4",
|
|
"@radix-ui/react-label": "2.1.1",
|
|
"@radix-ui/react-menubar": "1.1.4",
|
|
"@radix-ui/react-navigation-menu": "1.2.3",
|
|
"@radix-ui/react-popover": "1.1.4",
|
|
"@radix-ui/react-progress": "1.1.1",
|
|
"@radix-ui/react-radio-group": "1.2.2",
|
|
"@radix-ui/react-scroll-area": "1.2.2",
|
|
"@radix-ui/react-select": "2.1.4",
|
|
"@radix-ui/react-separator": "1.1.1",
|
|
"@radix-ui/react-slider": "1.2.2",
|
|
"@radix-ui/react-slot": "1.1.1",
|
|
"@radix-ui/react-switch": "1.1.2",
|
|
"@radix-ui/react-tabs": "1.1.2",
|
|
"@radix-ui/react-toast": "1.2.4",
|
|
"@radix-ui/react-toggle": "1.1.1",
|
|
"@radix-ui/react-toggle-group": "1.1.1",
|
|
"@radix-ui/react-tooltip": "1.1.6",
|
|
"@swup/astro": "^1.7.0",
|
|
"@tabler/icons-react": "^3.40.0",
|
|
"astro-expressive-code": "^0.41.5",
|
|
"autoprefixer": "^10.4.20",
|
|
"bcryptjs": "^3.0.2",
|
|
"class-variance-authority": "^0.7.1",
|
|
"clsx": "^2.1.1",
|
|
"cmdk": "1.0.4",
|
|
"crypto-js": "^4.2.0",
|
|
"date-fns": "4.1.0",
|
|
"embla-carousel-react": "8.5.1",
|
|
"gray-matter": "^4.0.3",
|
|
"hastscript": "^9.0.1",
|
|
"input-otp": "1.4.1",
|
|
"katex": "^0.16.22",
|
|
"lucide-react": "^0.454.0",
|
|
"markdown-it": "^14.1.0",
|
|
"mdast-util-to-string": "^4.0.0",
|
|
"pagefind": "^1.4.0",
|
|
"react": "19.2.0",
|
|
"react-day-picker": "9.8.0",
|
|
"react-dom": "19.2.0",
|
|
"react-hook-form": "^7.60.0",
|
|
"react-resizable-panels": "^2.1.7",
|
|
"reading-time": "^1.5.0",
|
|
"recharts": "2.15.4",
|
|
"rehype-autolink-headings": "^7.1.0",
|
|
"rehype-components": "^0.3.0",
|
|
"rehype-katex": "^7.0.1",
|
|
"rehype-slug": "^6.0.0",
|
|
"remark-directive": "^3.0.1",
|
|
"remark-github-admonitions-to-directives": "^1.0.5",
|
|
"remark-math": "^6.0.0",
|
|
"remark-sectionize": "^2.1.0",
|
|
"sanitize-html": "^2.17.0",
|
|
"sonner": "^1.7.4",
|
|
"tailwind-merge": "^2.5.5",
|
|
"tailwindcss-animate": "^1.0.7",
|
|
"unist-util-visit": "^5.0.0",
|
|
"vaul": "^1.1.2",
|
|
"zod": "3.25.76"
|
|
},
|
|
"devDependencies": {
|
|
"@astrojs/check": "^0.9.6",
|
|
"@tailwindcss/postcss": "^4.1.9",
|
|
"@tailwindcss/typography": "^0.5.19",
|
|
"@types/crypto-js": "^4.2.2",
|
|
"@types/markdown-it": "^14.1.2",
|
|
"@types/node": "^22",
|
|
"@types/react": "^19",
|
|
"@types/react-dom": "^19",
|
|
"@types/sanitize-html": "^2.16.0",
|
|
"astro": "^5.16.5",
|
|
"postcss": "^8.5",
|
|
"tailwindcss": "^4.1.9",
|
|
"tw-animate-css": "1.3.3",
|
|
"typescript": "^5"
|
|
}
|
|
}
|