From d516efe16818f577a58cdd363fe9c8859838e248 Mon Sep 17 00:00:00 2001 From: niapya Date: Sun, 5 Jul 2026 22:57:40 +0800 Subject: [PATCH 01/20] fix: vercel --- bun.lock | 46 ++++++++++++++++++------------------- platform/vercel/vercel.json | 4 +--- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/bun.lock b/bun.lock index b9d7dc9..01f0b21 100644 --- a/bun.lock +++ b/bun.lock @@ -14,28 +14,28 @@ }, "pkgs/rssbook": { "name": "rssbook", - "version": "1.1.0", + "version": "1.1.1", "dependencies": { - "@elysiajs/eden": "catalog:", - "@elysiajs/html": "catalog:", - "@elysiajs/openapi": "catalog:", - "@elysiajs/server-timing": "catalog:", - "@elysiajs/static": "catalog:", - "@kitajs/html": "catalog:", - "@kitajs/ts-html-plugin": "catalog:", - "@rowanmanning/feed-parser": "catalog:", - "cheerio": "catalog:", - "dayjs": "catalog:", - "domhandler": "catalog:", - "elysia": "catalog:", - "feed": "catalog:", - "ofetch": "catalog:", - "sanitize-html": "catalog:", - "unstorage": "catalog:", - "uuid": "catalog:", + "@elysiajs/eden": "^1.4.9", + "@elysiajs/html": "^1.4.2", + "@elysiajs/openapi": "^1.4.15", + "@elysiajs/server-timing": "^1.4.1", + "@elysiajs/static": "^1.4.10", + "@kitajs/html": "^4.2.13", + "@kitajs/ts-html-plugin": "^4.1.4", + "@rowanmanning/feed-parser": "^2.1.3", + "cheerio": "^1.2.0", + "dayjs": "^1.11.21", + "domhandler": "^5.0.3", + "elysia": "^1.4.29", + "feed": "^5.2.1", + "ofetch": "^1.5.1", + "sanitize-html": "^2.17.5", + "unstorage": "1.17.5", + "uuid": "^13.0.2", }, "devDependencies": { - "tsup": "catalog:", + "tsup": "^8.5.1", }, }, "pkgs/utils-feed-helper": { @@ -548,13 +548,13 @@ "yargs-parser": ["yargs-parser@22.0.0", "", {}, "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw=="], - "@rssbook/platform-cloudflare/rssbook": ["rssbook@1.0.0", "", {}, "sha512-zE5n3azCLKuF7VafydSyAj0fufwbipnT/J84BwnIpJpGNjkAl8e99Dp4ayZNI5gZfU984y/tEIHcIlyekltI7Q=="], + "@rssbook/platform-cloudflare/rssbook": ["rssbook@1.1.1", "", { "dependencies": { "@elysiajs/eden": "^1.4.9", "@elysiajs/html": "^1.4.2", "@elysiajs/openapi": "^1.4.15", "@elysiajs/server-timing": "^1.4.1", "@elysiajs/static": "^1.4.10", "@kitajs/html": "^4.2.13", "@kitajs/ts-html-plugin": "^4.1.4", "@rowanmanning/feed-parser": "^2.1.3", "cheerio": "^1.2.0", "dayjs": "^1.11.21", "domhandler": "^5.0.3", "elysia": "^1.4.29", "feed": "^5.2.1", "ofetch": "^1.5.1", "sanitize-html": "^2.17.5", "unstorage": "1.17.5", "uuid": "^13.0.2" } }, "sha512-OShBekGESzlFYGPV+ZSk7B/ws3arAy4xBwyXwhs+NS6m3PyUh7QF6294iSgWnF2wY0qcyr2CmoBkJc8Lgj5FNQ=="], - "@rssbook/platform-netlify/rssbook": ["rssbook@1.0.0", "", {}, "sha512-zE5n3azCLKuF7VafydSyAj0fufwbipnT/J84BwnIpJpGNjkAl8e99Dp4ayZNI5gZfU984y/tEIHcIlyekltI7Q=="], + "@rssbook/platform-netlify/rssbook": ["rssbook@1.1.1", "", { "dependencies": { "@elysiajs/eden": "^1.4.9", "@elysiajs/html": "^1.4.2", "@elysiajs/openapi": "^1.4.15", "@elysiajs/server-timing": "^1.4.1", "@elysiajs/static": "^1.4.10", "@kitajs/html": "^4.2.13", "@kitajs/ts-html-plugin": "^4.1.4", "@rowanmanning/feed-parser": "^2.1.3", "cheerio": "^1.2.0", "dayjs": "^1.11.21", "domhandler": "^5.0.3", "elysia": "^1.4.29", "feed": "^5.2.1", "ofetch": "^1.5.1", "sanitize-html": "^2.17.5", "unstorage": "1.17.5", "uuid": "^13.0.2" } }, "sha512-OShBekGESzlFYGPV+ZSk7B/ws3arAy4xBwyXwhs+NS6m3PyUh7QF6294iSgWnF2wY0qcyr2CmoBkJc8Lgj5FNQ=="], - "@rssbook/platform-node/rssbook": ["rssbook@1.0.0", "", {}, "sha512-zE5n3azCLKuF7VafydSyAj0fufwbipnT/J84BwnIpJpGNjkAl8e99Dp4ayZNI5gZfU984y/tEIHcIlyekltI7Q=="], + "@rssbook/platform-node/rssbook": ["rssbook@1.1.1", "", { "dependencies": { "@elysiajs/eden": "^1.4.9", "@elysiajs/html": "^1.4.2", "@elysiajs/openapi": "^1.4.15", "@elysiajs/server-timing": "^1.4.1", "@elysiajs/static": "^1.4.10", "@kitajs/html": "^4.2.13", "@kitajs/ts-html-plugin": "^4.1.4", "@rowanmanning/feed-parser": "^2.1.3", "cheerio": "^1.2.0", "dayjs": "^1.11.21", "domhandler": "^5.0.3", "elysia": "^1.4.29", "feed": "^5.2.1", "ofetch": "^1.5.1", "sanitize-html": "^2.17.5", "unstorage": "1.17.5", "uuid": "^13.0.2" } }, "sha512-OShBekGESzlFYGPV+ZSk7B/ws3arAy4xBwyXwhs+NS6m3PyUh7QF6294iSgWnF2wY0qcyr2CmoBkJc8Lgj5FNQ=="], - "@rssbook/platform-vercel/rssbook": ["rssbook@1.0.0", "", {}, "sha512-zE5n3azCLKuF7VafydSyAj0fufwbipnT/J84BwnIpJpGNjkAl8e99Dp4ayZNI5gZfU984y/tEIHcIlyekltI7Q=="], + "@rssbook/platform-vercel/rssbook": ["rssbook@1.1.1", "", { "dependencies": { "@elysiajs/eden": "^1.4.9", "@elysiajs/html": "^1.4.2", "@elysiajs/openapi": "^1.4.15", "@elysiajs/server-timing": "^1.4.1", "@elysiajs/static": "^1.4.10", "@kitajs/html": "^4.2.13", "@kitajs/ts-html-plugin": "^4.1.4", "@rowanmanning/feed-parser": "^2.1.3", "cheerio": "^1.2.0", "dayjs": "^1.11.21", "domhandler": "^5.0.3", "elysia": "^1.4.29", "feed": "^5.2.1", "ofetch": "^1.5.1", "sanitize-html": "^2.17.5", "unstorage": "1.17.5", "uuid": "^13.0.2" } }, "sha512-OShBekGESzlFYGPV+ZSk7B/ws3arAy4xBwyXwhs+NS6m3PyUh7QF6294iSgWnF2wY0qcyr2CmoBkJc8Lgj5FNQ=="], "dom-serializer/entities": ["entities@4.5.0", "", {}, "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw=="], diff --git a/platform/vercel/vercel.json b/platform/vercel/vercel.json index 869250a..2ec1ea6 100644 --- a/platform/vercel/vercel.json +++ b/platform/vercel/vercel.json @@ -1,11 +1,9 @@ { "$schema": "https://openapi.vercel.sh/vercel.json", - "bunVersion": "1.x", - "framework": "elysia", "rewrites": [ { "destination": "/index.ts", "source": "/(.*)" } ] -} +} \ No newline at end of file From f643be2c622d1ccfb538e4c0f63ac84ddbe6c0ea Mon Sep 17 00:00:00 2001 From: niapya Date: Sun, 5 Jul 2026 23:05:24 +0800 Subject: [PATCH 02/20] fix: vercel --- platform/vercel/index.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/platform/vercel/index.ts b/platform/vercel/index.ts index 01b5ac4..33144d2 100644 --- a/platform/vercel/index.ts +++ b/platform/vercel/index.ts @@ -1,11 +1,9 @@ /** * Vercel entrypoint */ - -import { Elysia } from "elysia"; import { createRSSBookApp } from "rssbook"; -export default new Elysia().use( +export default createRSSBookApp({ book: { config: {}, @@ -18,5 +16,4 @@ export default new Elysia().use( openapi: { enableFetchOnlineServer: true, }, - }), -); + }).fetch \ No newline at end of file From 609e92649269ad773303a042c2fba07c8263cd47 Mon Sep 17 00:00:00 2001 From: niapya Date: Sun, 5 Jul 2026 23:12:34 +0800 Subject: [PATCH 03/20] fix: vercel --- platform/vercel/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/vercel/index.ts b/platform/vercel/index.ts index 33144d2..72dc04e 100644 --- a/platform/vercel/index.ts +++ b/platform/vercel/index.ts @@ -16,4 +16,4 @@ export default openapi: { enableFetchOnlineServer: true, }, - }).fetch \ No newline at end of file + }) \ No newline at end of file From 929878c777244e24e32585cd87249188c83961d5 Mon Sep 17 00:00:00 2001 From: niapya Date: Sun, 5 Jul 2026 23:17:05 +0800 Subject: [PATCH 04/20] fix: test vercel --- platform/vercel/api/index.ts | 19 +++++++++++++++++++ platform/vercel/index.ts | 6 ++++-- platform/vercel/vercel.json | 6 +++--- 3 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 platform/vercel/api/index.ts diff --git a/platform/vercel/api/index.ts b/platform/vercel/api/index.ts new file mode 100644 index 0000000..253814f --- /dev/null +++ b/platform/vercel/api/index.ts @@ -0,0 +1,19 @@ +import { createRSSBookApp } from "rssbook"; + +const app = createRSSBookApp({ + book: { + config: {}, + feeds: ["https://github.blog/feed/"], + meta: { + description: "A simple RSS feed aggregator and reader.", + title: "RSSBook", + }, + }, + openapi: { + enableFetchOnlineServer: true, + }, +}); + +export default { + fetch: app.fetch, +}; diff --git a/platform/vercel/index.ts b/platform/vercel/index.ts index 72dc04e..063ace3 100644 --- a/platform/vercel/index.ts +++ b/platform/vercel/index.ts @@ -1,9 +1,10 @@ /** * Vercel entrypoint */ +import { Elysia } from "elysia"; import { createRSSBookApp } from "rssbook"; -export default +export default new Elysia().use( createRSSBookApp({ book: { config: {}, @@ -16,4 +17,5 @@ export default openapi: { enableFetchOnlineServer: true, }, - }) \ No newline at end of file + }), +); diff --git a/platform/vercel/vercel.json b/platform/vercel/vercel.json index 2ec1ea6..01b2a9c 100644 --- a/platform/vercel/vercel.json +++ b/platform/vercel/vercel.json @@ -2,8 +2,8 @@ "$schema": "https://openapi.vercel.sh/vercel.json", "rewrites": [ { - "destination": "/index.ts", - "source": "/(.*)" + "source": "/(.*)", + "destination": "/api" } ] -} \ No newline at end of file +} From baa9448647539b252bd7498a12cf7e8ae73d3515 Mon Sep 17 00:00:00 2001 From: niapya Date: Sun, 5 Jul 2026 23:24:39 +0800 Subject: [PATCH 05/20] fix: vercel --- platform/vercel/index.ts | 21 --------------------- platform/vercel/package.json | 2 +- platform/vercel/tsconfig.json | 2 +- platform/vercel/vercel.json | 4 ++++ 4 files changed, 6 insertions(+), 23 deletions(-) delete mode 100644 platform/vercel/index.ts diff --git a/platform/vercel/index.ts b/platform/vercel/index.ts deleted file mode 100644 index 063ace3..0000000 --- a/platform/vercel/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Vercel entrypoint - */ -import { Elysia } from "elysia"; -import { createRSSBookApp } from "rssbook"; - -export default new Elysia().use( - createRSSBookApp({ - book: { - config: {}, - feeds: ["https://github.blog/feed/"], - meta: { - description: "A simple RSS feed aggregator and reader.", - title: "RSSBook", - }, - }, - openapi: { - enableFetchOnlineServer: true, - }, - }), -); diff --git a/platform/vercel/package.json b/platform/vercel/package.json index 07a50e7..b4a7a63 100644 --- a/platform/vercel/package.json +++ b/platform/vercel/package.json @@ -7,7 +7,7 @@ "name": "@rssbook/platform-vercel", "private": true, "scripts": { - "build": "bun build --define process.env.NODE_ENV='\"production\"' --minify-whitespace --minify-syntax --outfile ../../dist/vercel/index.js --target bun index.ts", + "build": "bun build --define process.env.NODE_ENV='\"production\"' --minify-whitespace --minify-syntax --outfile ../../dist/vercel/index.js --target node api/index.ts", "deploy": "bunx vercel --prod", "dev": "bunx vercel dev" }, diff --git a/platform/vercel/tsconfig.json b/platform/vercel/tsconfig.json index 6427ce5..5d95cb9 100644 --- a/platform/vercel/tsconfig.json +++ b/platform/vercel/tsconfig.json @@ -7,5 +7,5 @@ "types": [] }, "extends": "../../tsconfig.base.json", - "include": ["index.ts"] + "include": ["api/**/*.ts"] } diff --git a/platform/vercel/vercel.json b/platform/vercel/vercel.json index 01b2a9c..3bd1327 100644 --- a/platform/vercel/vercel.json +++ b/platform/vercel/vercel.json @@ -1,5 +1,9 @@ { "$schema": "https://openapi.vercel.sh/vercel.json", + "framework": null, + "installCommand": "npm install", + "buildCommand": "echo \"No build required\"", + "devCommand": "vercel dev", "rewrites": [ { "source": "/(.*)", From 31d001e1fc5a1adf6a1bed45786c24f8bbe2478d Mon Sep 17 00:00:00 2001 From: niapya Date: Sun, 5 Jul 2026 23:28:14 +0800 Subject: [PATCH 06/20] fix: use bun on vercel --- platform/vercel/vercel.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/vercel/vercel.json b/platform/vercel/vercel.json index 3bd1327..a903112 100644 --- a/platform/vercel/vercel.json +++ b/platform/vercel/vercel.json @@ -1,7 +1,7 @@ { "$schema": "https://openapi.vercel.sh/vercel.json", "framework": null, - "installCommand": "npm install", + "installCommand": "bun install", "buildCommand": "echo \"No build required\"", "devCommand": "vercel dev", "rewrites": [ From b26c77b3f84d6afbc3444d7f430100e1b97a4908 Mon Sep 17 00:00:00 2001 From: niapya Date: Sun, 5 Jul 2026 23:30:50 +0800 Subject: [PATCH 07/20] fix: add output --- platform/vercel/public/favicon.ico | Bin 0 -> 73070 bytes platform/vercel/public/favicon.svg | 11 ++ platform/vercel/public/robots.txt | 6 + platform/vercel/public/xsl/atom.xsl | 185 ++++++++++++++++++++++++++++ platform/vercel/public/xsl/rss.xsl | 157 +++++++++++++++++++++++ platform/vercel/vercel.json | 1 + 6 files changed, 360 insertions(+) create mode 100644 platform/vercel/public/favicon.ico create mode 100644 platform/vercel/public/favicon.svg create mode 100644 platform/vercel/public/robots.txt create mode 100644 platform/vercel/public/xsl/atom.xsl create mode 100644 platform/vercel/public/xsl/rss.xsl diff --git a/platform/vercel/public/favicon.ico b/platform/vercel/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..3c421a5fbd2c2fdba8737872706a19a198b2e760 GIT binary patch literal 73070 zcmeI536vdGoyM!vkOTvSEif1*4JZU5C`Ld;PDfEdKwKcKS$a<=AtZ(~#BmOEqd17d zxDGHJ1eHMocyy3qnITGpgU$hT#$i;JV48^{>k!$6mY&~t>)xvSDpl|G>&%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Fmw?yN{9;90RlmQmcJ5bNHW;f0g?VX!Yvm*8gJr z8%W5ka}(A10kEZK!;M@&HX#4I#D~s)i(rhb@mxT^A^sgu&%Svh>)S88Wc~s$eLr>) z)Njs9_5aa&<2tYhvR?~c2R=W|{`@bs{mB zE#N?4?sU2JabYR|f_B)m!KKTh`mg&?y5l|o)HWUlPXe8*Y0vmY@Dg~r!Jslr2Hjy> z2Xy~?_vo${{h-dui)i$JPtE;TY&bD6_lLvt{k`$iJ-817trd<1$2TC3qs&JF-Cy1@ z`ai0w{~7}es(V-8O*^o<_wG|h^#RVB?-`xz|LN&|L}_9MbnnT06V;45M<$K)i}?0e zbKlaG43rF%43rF%43rF%43rF%43rF%43rF%43rF%43rF%43rF%43rF%43rF%43rF% z43rF%43rF%43rF%4AjHGXlWc>vqCCfb?zyldy{jwgzh2d4np@}MZI6*L7@oTv^1yQ-p!=}Jws~1_fec>Jn_vD~e`A6cmCfqHXxeXyv{9v$# zJ22s1`3-@wdtSmF7`MkyFhKcYcU!_8Z02q!e$4+4Mj^2~NOi~8Z>EOKMfyp)gD`wB ziV!L&a&MJzTLnhpL8yQsmwr;hoea0`VHe*jB-0&)3X8&nPyyKrONNIEsHLDdJgI=B zf|BkqeyotBf?~JRqf_Vr9-?6ucDBNj;YkG~6_j+__(OV=%%o7EL&lNfw(*Buc+%Yx zrcZ{)3JJq;tEFNM8u_dno + RSSBook + + + + + + + + \ No newline at end of file diff --git a/platform/vercel/public/robots.txt b/platform/vercel/public/robots.txt new file mode 100644 index 0000000..ecb18c5 --- /dev/null +++ b/platform/vercel/public/robots.txt @@ -0,0 +1,6 @@ +User-agent: * +Allow: / +Allow: /tools/ +Allow: /openapi/ +Disallow: /feeds/ +Disallow: /utils/ \ No newline at end of file diff --git a/platform/vercel/public/xsl/atom.xsl b/platform/vercel/public/xsl/atom.xsl new file mode 100644 index 0000000..7e79fc9 --- /dev/null +++ b/platform/vercel/public/xsl/atom.xsl @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + <xsl:choose> + <xsl:when test="string($feedTitle)"><xsl:value-of select="$feedTitle"/></xsl:when> + <xsl:otherwise>Atom Feed</xsl:otherwise> + </xsl:choose> + + + + +
+
+ ← Back to Home +

+ + + Atom Feed + +

+ +

+
+
+
+
+ +
+
+
+ This is styled Atom Feed. Generated by RSSBook. +
+
+ + +
+ + + + + + + + + + + + + + + +
+
+

+ + + + + + + + +

+
+ + + + + + + + + + Published: + + + + + + + By: + + + + +
+
+ +
+ + + + + + + + + +
+
+ +
+ + + + + + + + +

+
+ + + + + + + +

+
+
+
+
+
+
+
\ No newline at end of file diff --git a/platform/vercel/public/xsl/rss.xsl b/platform/vercel/public/xsl/rss.xsl new file mode 100644 index 0000000..d4d9b77 --- /dev/null +++ b/platform/vercel/public/xsl/rss.xsl @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + <xsl:choose> + <xsl:when test="string($title)"> + <xsl:value-of select="$title" /> + </xsl:when> + <xsl:otherwise>RSS Feed</xsl:otherwise> + </xsl:choose> + + + + +
+
+ ← Back to Home +

+ + + RSS Feed + +

+ +

+ +

+
+
+
+
+ +
+
+
+ This is styled RSS Feed. Generated by RSSBook. +
+
+ + +
+ + +
+
+

+ + + + + + + + + + +

+
+ + + Published: + + + + + + + By: + + + + + + + +
+
+ +
+ + + + + +
+
+ +
+ + + + + + + + +
+
+
+
+
\ No newline at end of file diff --git a/platform/vercel/vercel.json b/platform/vercel/vercel.json index a903112..0df5218 100644 --- a/platform/vercel/vercel.json +++ b/platform/vercel/vercel.json @@ -3,6 +3,7 @@ "framework": null, "installCommand": "bun install", "buildCommand": "echo \"No build required\"", + "outputDirectory": "public", "devCommand": "vercel dev", "rewrites": [ { From fac17f14b634ca33eefec999427a795594ff0698 Mon Sep 17 00:00:00 2001 From: niapya Date: Sun, 5 Jul 2026 23:41:18 +0800 Subject: [PATCH 08/20] fix: vercel --- README.EN.md | 4 +- README.md | 4 +- platform/vercel/public/favicon.ico | Bin 73070 -> 0 bytes platform/vercel/public/favicon.svg | 11 -- platform/vercel/public/robots.txt | 6 - platform/vercel/public/xsl/atom.xsl | 185 ---------------------------- platform/vercel/public/xsl/rss.xsl | 157 ----------------------- platform/vercel/vercel.json | 2 +- 8 files changed, 7 insertions(+), 362 deletions(-) delete mode 100644 platform/vercel/public/favicon.ico delete mode 100644 platform/vercel/public/favicon.svg delete mode 100644 platform/vercel/public/robots.txt delete mode 100644 platform/vercel/public/xsl/atom.xsl delete mode 100644 platform/vercel/public/xsl/rss.xsl diff --git a/README.EN.md b/README.EN.md index cedecf0..d5e39f9 100644 --- a/README.EN.md +++ b/README.EN.md @@ -201,7 +201,9 @@ A better approach is to fork this repository, modify the configuration in [Githu Vercel is a popular serverless computing platform that also provides a generous free tier. -The entry file for Vercel is in the `platform-vercel` package: `platform/vercel/index.ts`. +The entry file for Vercel is in the `platform-vercel` package: `platform/vercel/api/index.ts`. + +Vercel deployment settings are defined in `platform/vercel/vercel.json`, which sets the Framework Preset to Other. [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FHackHTU%2FRSSBook&root-directory=platform%2Fvercel) diff --git a/README.md b/README.md index 5fc4325..6f6d625 100644 --- a/README.md +++ b/README.md @@ -201,7 +201,9 @@ CloudFlare Workers 的入口文件在 `platform-cloudflare` 包中:`platform/c Vercel 是一个非常流行的 Serverless 计算平台,也提供了慷慨的免费使用额度。 -Vercel 的入口文件在 `platform-vercel` 包中:`platform/vercel/index.ts`。 +Vercel 的入口文件在 `platform-vercel` 包中:`platform/vercel/api/index.ts`。 + +Vercel 部署配置已写入 `platform/vercel/vercel.json`,会将 Framework Preset 设置为 Other。 [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FHackHTU%2FRSSBook&root-directory=platform%2Fvercel) diff --git a/platform/vercel/public/favicon.ico b/platform/vercel/public/favicon.ico deleted file mode 100644 index 3c421a5fbd2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6ys@sGvenZET+Y1D z>;>xVT&6?6vl;iDhmhZOK>hxH!2GW$^%ad^&fyzDZ%kA99|2C6Ef@7fDkTk5}}{(lcX%wAw#@AhqJokTu=zNUHL3uPUM>cD!q(E7M(=Kvo% zt3v-e;D}sJ&$*A?CnFB6wfU}+P_D_km zpymO$mijmK|7v*9xqq-`O>_4DuFmw?yN{9;90RlmQmcJ5bNHW;f0g?VX!Yvm*8gJr z8%W5ka}(A10kEZK!;M@&HX#4I#D~s)i(rhb@mxT^A^sgu&%Svh>)S88Wc~s$eLr>) z)Njs9_5aa&<2tYhvR?~c2R=W|{`@bs{mB zE#N?4?sU2JabYR|f_B)m!KKTh`mg&?y5l|o)HWUlPXe8*Y0vmY@Dg~r!Jslr2Hjy> z2Xy~?_vo${{h-dui)i$JPtE;TY&bD6_lLvt{k`$iJ-817trd<1$2TC3qs&JF-Cy1@ z`ai0w{~7}es(V-8O*^o<_wG|h^#RVB?-`xz|LN&|L}_9MbnnT06V;45M<$K)i}?0e zbKlaG43rF%43rF%43rF%43rF%43rF%43rF%43rF%43rF%43rF%43rF%43rF%43rF% z43rF%43rF%43rF%4AjHGXlWc>vqCCfb?zyldy{jwgzh2d4np@}MZI6*L7@oTv^1yQ-p!=}Jws~1_fec>Jn_vD~e`A6cmCfqHXxeXyv{9v$# zJ22s1`3-@wdtSmF7`MkyFhKcYcU!_8Z02q!e$4+4Mj^2~NOi~8Z>EOKMfyp)gD`wB ziV!L&a&MJzTLnhpL8yQsmwr;hoea0`VHe*jB-0&)3X8&nPyyKrONNIEsHLDdJgI=B zf|BkqeyotBf?~JRqf_Vr9-?6ucDBNj;YkG~6_j+__(OV=%%o7EL&lNfw(*Buc+%Yx zrcZ{)3JJq;tEFNM8u_dno - RSSBook - - - - - - - - \ No newline at end of file diff --git a/platform/vercel/public/robots.txt b/platform/vercel/public/robots.txt deleted file mode 100644 index ecb18c5..0000000 --- a/platform/vercel/public/robots.txt +++ /dev/null @@ -1,6 +0,0 @@ -User-agent: * -Allow: / -Allow: /tools/ -Allow: /openapi/ -Disallow: /feeds/ -Disallow: /utils/ \ No newline at end of file diff --git a/platform/vercel/public/xsl/atom.xsl b/platform/vercel/public/xsl/atom.xsl deleted file mode 100644 index 7e79fc9..0000000 --- a/platform/vercel/public/xsl/atom.xsl +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - <xsl:choose> - <xsl:when test="string($feedTitle)"><xsl:value-of select="$feedTitle"/></xsl:when> - <xsl:otherwise>Atom Feed</xsl:otherwise> - </xsl:choose> - - - - -
-
- ← Back to Home -

- - - Atom Feed - -

- -

-
-
-
-
- -
-
-
- This is styled Atom Feed. Generated by RSSBook. -
-
- - -
- - - - - - - - - - - - - - - -
-
-

- - - - - - - - -

-
- - - - - - - - - - Published: - - - - - - - By: - - - - -
-
- -
- - - - - - - - - -
-
- -
- - - - - - - - -

-
- - - - - - - -

-
-
-
-
-
-
-
\ No newline at end of file diff --git a/platform/vercel/public/xsl/rss.xsl b/platform/vercel/public/xsl/rss.xsl deleted file mode 100644 index d4d9b77..0000000 --- a/platform/vercel/public/xsl/rss.xsl +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - <xsl:choose> - <xsl:when test="string($title)"> - <xsl:value-of select="$title" /> - </xsl:when> - <xsl:otherwise>RSS Feed</xsl:otherwise> - </xsl:choose> - - - - -
-
- ← Back to Home -

- - - RSS Feed - -

- -

- -

-
-
-
-
- -
-
-
- This is styled RSS Feed. Generated by RSSBook. -
-
- - -
- - -
-
-

- - - - - - - - - - -

-
- - - Published: - - - - - - - By: - - - - - - - -
-
- -
- - - - - -
-
- -
- - - - - - - - -
-
-
-
-
\ No newline at end of file diff --git a/platform/vercel/vercel.json b/platform/vercel/vercel.json index 0df5218..920d931 100644 --- a/platform/vercel/vercel.json +++ b/platform/vercel/vercel.json @@ -3,7 +3,7 @@ "framework": null, "installCommand": "bun install", "buildCommand": "echo \"No build required\"", - "outputDirectory": "public", + "outputDirectory": "../../pkgs/rssbook/src/public", "devCommand": "vercel dev", "rewrites": [ { From 85b1bff777453b65ef7b458f14497c387a3032f8 Mon Sep 17 00:00:00 2001 From: niapya Date: Sun, 5 Jul 2026 23:51:40 +0800 Subject: [PATCH 09/20] fix: cloudflare --- README.EN.md | 2 +- README.md | 2 +- wrangler.jsonc | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 wrangler.jsonc diff --git a/README.EN.md b/README.EN.md index d5e39f9..a707927 100644 --- a/README.EN.md +++ b/README.EN.md @@ -193,7 +193,7 @@ The entry file for CloudFlare Workers is in the `platform-cloudflare` package: ` For production, you can directly click the button below to deploy to CloudFlare Workers, but this method does not support **custom configuration**. -[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/HackHTU/RSSBook/tree/main/platform/cloudflare) +[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/HackHTU/RSSBook) A better approach is to fork this repository, modify the configuration in [Github CodeSpace](https://github.com/codespaces/new/) or locally, then configure your own GitHub repository in Cloudflare Workers settings for deployment (or you can use GitHub Workflow). diff --git a/README.md b/README.md index 6f6d625..3cd890a 100644 --- a/README.md +++ b/README.md @@ -193,7 +193,7 @@ CloudFlare Workers 的入口文件在 `platform-cloudflare` 包中:`platform/c 在生产时,你可以直接点击下面的按钮来部署到 CloudFlare Workers,但是这种方式不支持**自定义配置**。 -[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/HackHTU/RSSBook/tree/main/platform/cloudflare) +[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/HackHTU/RSSBook) 更好的方法是自己 Fork 本仓库,在 [Github CodeSpace](https://github.com/codespaces/new/) 或本地修改配置后,然后使用在 Cloudflare Workers 的设置中绑定你自己的 GitHub 仓库进行部署(或者你可以使用 GitHub Workflow)。 diff --git a/wrangler.jsonc b/wrangler.jsonc new file mode 100644 index 0000000..c4b7933 --- /dev/null +++ b/wrangler.jsonc @@ -0,0 +1,23 @@ +{ + "$schema": "https://unpkg.com/wrangler/config-schema.json", + // Static Assets + "assets": { + "directory": "pkgs/rssbook/src/public" + }, + "compatibility_date": "2025-07-30", + "compatibility_flags": [ + "nodejs_compat", + "nodejs_compat_populate_process_env" + ], + // KV Namespace + "kv_namespaces": [ + { + "binding": "RSSBookKV", + } + ], + "main": "platform/cloudflare/index.ts", + "name": "rssbook", + "observability": { + "enabled": true + } +} \ No newline at end of file From 28b76d09593c7c7681f346198716d8b14e34fcef Mon Sep 17 00:00:00 2001 From: niapya Date: Mon, 6 Jul 2026 00:52:17 +0800 Subject: [PATCH 10/20] fix: update rssbook dependency to workspace references and clean up configuration --- bun.lock | 18 ++++++------------ pkgs/rssbook/src/index.ts | 5 +---- platform/cloudflare/package.json | 3 +-- platform/cloudflare/wrangler.jsonc | 10 ++++++---- platform/netlify/package.json | 2 +- platform/node/package.json | 2 +- platform/vercel/package.json | 2 +- wrangler.jsonc | 23 ----------------------- 8 files changed, 17 insertions(+), 48 deletions(-) delete mode 100644 wrangler.jsonc diff --git a/bun.lock b/bun.lock index 01f0b21..cc6980d 100644 --- a/bun.lock +++ b/bun.lock @@ -55,21 +55,21 @@ "name": "@rssbook/platform-cloudflare", "dependencies": { "elysia": "^1.4.29", - "rssbook": "latest", + "rssbook": "workspace:*", "unstorage": "^1.17.5", }, }, "platform/netlify": { "name": "@rssbook/platform-netlify", "dependencies": { - "rssbook": "latest", + "rssbook": "workspace:*", }, }, "platform/node": { "name": "@rssbook/platform-node", "dependencies": { "@elysiajs/node": "^1.4.5", - "rssbook": "latest", + "rssbook": "workspace:*", }, "devDependencies": { "tsx": "latest", @@ -79,7 +79,7 @@ "name": "@rssbook/platform-vercel", "dependencies": { "elysia": "^1.4.29", - "rssbook": "latest", + "rssbook": "workspace:*", }, }, }, @@ -548,16 +548,10 @@ "yargs-parser": ["yargs-parser@22.0.0", "", {}, "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw=="], - "@rssbook/platform-cloudflare/rssbook": ["rssbook@1.1.1", "", { "dependencies": { "@elysiajs/eden": "^1.4.9", "@elysiajs/html": "^1.4.2", "@elysiajs/openapi": "^1.4.15", "@elysiajs/server-timing": "^1.4.1", "@elysiajs/static": "^1.4.10", "@kitajs/html": "^4.2.13", "@kitajs/ts-html-plugin": "^4.1.4", "@rowanmanning/feed-parser": "^2.1.3", "cheerio": "^1.2.0", "dayjs": "^1.11.21", "domhandler": "^5.0.3", "elysia": "^1.4.29", "feed": "^5.2.1", "ofetch": "^1.5.1", "sanitize-html": "^2.17.5", "unstorage": "1.17.5", "uuid": "^13.0.2" } }, "sha512-OShBekGESzlFYGPV+ZSk7B/ws3arAy4xBwyXwhs+NS6m3PyUh7QF6294iSgWnF2wY0qcyr2CmoBkJc8Lgj5FNQ=="], - - "@rssbook/platform-netlify/rssbook": ["rssbook@1.1.1", "", { "dependencies": { "@elysiajs/eden": "^1.4.9", "@elysiajs/html": "^1.4.2", "@elysiajs/openapi": "^1.4.15", "@elysiajs/server-timing": "^1.4.1", "@elysiajs/static": "^1.4.10", "@kitajs/html": "^4.2.13", "@kitajs/ts-html-plugin": "^4.1.4", "@rowanmanning/feed-parser": "^2.1.3", "cheerio": "^1.2.0", "dayjs": "^1.11.21", "domhandler": "^5.0.3", "elysia": "^1.4.29", "feed": "^5.2.1", "ofetch": "^1.5.1", "sanitize-html": "^2.17.5", "unstorage": "1.17.5", "uuid": "^13.0.2" } }, "sha512-OShBekGESzlFYGPV+ZSk7B/ws3arAy4xBwyXwhs+NS6m3PyUh7QF6294iSgWnF2wY0qcyr2CmoBkJc8Lgj5FNQ=="], - - "@rssbook/platform-node/rssbook": ["rssbook@1.1.1", "", { "dependencies": { "@elysiajs/eden": "^1.4.9", "@elysiajs/html": "^1.4.2", "@elysiajs/openapi": "^1.4.15", "@elysiajs/server-timing": "^1.4.1", "@elysiajs/static": "^1.4.10", "@kitajs/html": "^4.2.13", "@kitajs/ts-html-plugin": "^4.1.4", "@rowanmanning/feed-parser": "^2.1.3", "cheerio": "^1.2.0", "dayjs": "^1.11.21", "domhandler": "^5.0.3", "elysia": "^1.4.29", "feed": "^5.2.1", "ofetch": "^1.5.1", "sanitize-html": "^2.17.5", "unstorage": "1.17.5", "uuid": "^13.0.2" } }, "sha512-OShBekGESzlFYGPV+ZSk7B/ws3arAy4xBwyXwhs+NS6m3PyUh7QF6294iSgWnF2wY0qcyr2CmoBkJc8Lgj5FNQ=="], - - "@rssbook/platform-vercel/rssbook": ["rssbook@1.1.1", "", { "dependencies": { "@elysiajs/eden": "^1.4.9", "@elysiajs/html": "^1.4.2", "@elysiajs/openapi": "^1.4.15", "@elysiajs/server-timing": "^1.4.1", "@elysiajs/static": "^1.4.10", "@kitajs/html": "^4.2.13", "@kitajs/ts-html-plugin": "^4.1.4", "@rowanmanning/feed-parser": "^2.1.3", "cheerio": "^1.2.0", "dayjs": "^1.11.21", "domhandler": "^5.0.3", "elysia": "^1.4.29", "feed": "^5.2.1", "ofetch": "^1.5.1", "sanitize-html": "^2.17.5", "unstorage": "1.17.5", "uuid": "^13.0.2" } }, "sha512-OShBekGESzlFYGPV+ZSk7B/ws3arAy4xBwyXwhs+NS6m3PyUh7QF6294iSgWnF2wY0qcyr2CmoBkJc8Lgj5FNQ=="], - "dom-serializer/entities": ["entities@4.5.0", "", {}, "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw=="], + "fdir/picomatch": ["picomatch@4.0.5", "", {}, "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A=="], + "h3/crossws": ["crossws@0.3.5", "", { "dependencies": { "uncrypto": "^0.1.3" } }, "sha512-ojKiDvcmByhwa8YYqbQI/hg7MEU0NC03+pSdEq4ZUnZR9xXpwk7E43SMNGkn+JxJGPFtNvQ48+vV2p+P1ml5PA=="], "parse5/entities": ["entities@6.0.1", "", {}, "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g=="], diff --git a/pkgs/rssbook/src/index.ts b/pkgs/rssbook/src/index.ts index d9d7d12..9ca6702 100644 --- a/pkgs/rssbook/src/index.ts +++ b/pkgs/rssbook/src/index.ts @@ -11,10 +11,7 @@ export const app = createRSSBookApp({ description: "A simple RSS feed aggregator and reader.", title: "RSSBook", }, - }, - openapi: { - enableFetchOnlineServer: true, - }, + } }); // For Bun's built-in fetch server diff --git a/platform/cloudflare/package.json b/platform/cloudflare/package.json index c797b86..fbaafa2 100644 --- a/platform/cloudflare/package.json +++ b/platform/cloudflare/package.json @@ -1,14 +1,13 @@ { "dependencies": { "elysia": "^1.4.29", - "rssbook": "latest", + "rssbook": "workspace:*", "unstorage": "^1.17.5" }, "devDependencies": {}, "name": "@rssbook/platform-cloudflare", "private": true, "scripts": { - "build": "bunx wrangler deploy --config wrangler.jsonc --dry-run --outdir ../../dist/cloudflare", "deploy": "bunx wrangler deploy --config wrangler.jsonc", "dev": "bunx wrangler dev --config wrangler.jsonc" }, diff --git a/platform/cloudflare/wrangler.jsonc b/platform/cloudflare/wrangler.jsonc index 6f357e9..77eed01 100644 --- a/platform/cloudflare/wrangler.jsonc +++ b/platform/cloudflare/wrangler.jsonc @@ -5,12 +5,14 @@ "directory": "../../pkgs/rssbook/src/public" }, "compatibility_date": "2025-07-30", - "compatibility_flags": ["nodejs_compat", "nodejs_compat_populate_process_env"], + "compatibility_flags": [ + "nodejs_compat", + "nodejs_compat_populate_process_env" + ], // KV Namespace "kv_namespaces": [ { - "binding": "RSSBookKV", - "id": "3f8938b2584a4570a80ba6b1df5e3963" + "binding": "RSSBookKV" } ], "main": "index.ts", @@ -30,4 +32,4 @@ "persist": true } } -} +} \ No newline at end of file diff --git a/platform/netlify/package.json b/platform/netlify/package.json index 4f71a1c..77331af 100644 --- a/platform/netlify/package.json +++ b/platform/netlify/package.json @@ -1,6 +1,6 @@ { "dependencies": { - "rssbook": "latest" + "rssbook": "workspace:*" }, "devDependencies": {}, "name": "@rssbook/platform-netlify", diff --git a/platform/node/package.json b/platform/node/package.json index 6e522c0..6673e3a 100644 --- a/platform/node/package.json +++ b/platform/node/package.json @@ -1,7 +1,7 @@ { "dependencies": { "@elysiajs/node": "^1.4.5", - "rssbook": "latest" + "rssbook": "workspace:*" }, "devDependencies": { "tsx": "latest" diff --git a/platform/vercel/package.json b/platform/vercel/package.json index b4a7a63..3f0f295 100644 --- a/platform/vercel/package.json +++ b/platform/vercel/package.json @@ -1,7 +1,7 @@ { "dependencies": { "elysia": "^1.4.29", - "rssbook": "latest" + "rssbook": "workspace:*" }, "devDependencies": {}, "name": "@rssbook/platform-vercel", diff --git a/wrangler.jsonc b/wrangler.jsonc deleted file mode 100644 index c4b7933..0000000 --- a/wrangler.jsonc +++ /dev/null @@ -1,23 +0,0 @@ -{ - "$schema": "https://unpkg.com/wrangler/config-schema.json", - // Static Assets - "assets": { - "directory": "pkgs/rssbook/src/public" - }, - "compatibility_date": "2025-07-30", - "compatibility_flags": [ - "nodejs_compat", - "nodejs_compat_populate_process_env" - ], - // KV Namespace - "kv_namespaces": [ - { - "binding": "RSSBookKV", - } - ], - "main": "platform/cloudflare/index.ts", - "name": "rssbook", - "observability": { - "enabled": true - } -} \ No newline at end of file From 96b20ae2f56aa636838c30b8a023023882623d54 Mon Sep 17 00:00:00 2001 From: niapya Date: Mon, 6 Jul 2026 01:17:35 +0800 Subject: [PATCH 11/20] fix: netlify --- platform/netlify/netlify.toml | 4 ++-- platform/netlify/{ => netlify/edge-functions}/index.ts | 0 platform/netlify/package.json | 4 ++-- platform/netlify/public/.gitkeep | 1 + platform/netlify/tsconfig.json | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) rename platform/netlify/{ => netlify/edge-functions}/index.ts (100%) create mode 100644 platform/netlify/public/.gitkeep diff --git a/platform/netlify/netlify.toml b/platform/netlify/netlify.toml index eb6aa95..148fa38 100644 --- a/platform/netlify/netlify.toml +++ b/platform/netlify/netlify.toml @@ -1,6 +1,6 @@ [build] - publish = "." - edge_functions = "." + publish = "platform/netlify/public" + edge_functions = "platform/netlify/netlify/edge-functions" [[edge_functions]] function = "index" diff --git a/platform/netlify/index.ts b/platform/netlify/netlify/edge-functions/index.ts similarity index 100% rename from platform/netlify/index.ts rename to platform/netlify/netlify/edge-functions/index.ts diff --git a/platform/netlify/package.json b/platform/netlify/package.json index 77331af..dedee99 100644 --- a/platform/netlify/package.json +++ b/platform/netlify/package.json @@ -6,9 +6,9 @@ "name": "@rssbook/platform-netlify", "private": true, "scripts": { - "build": "bunx netlify build --offline", + "build": "bunx netlify build --offline --filter @rssbook/platform-netlify", "deploy": "bunx netlify deploy --prod", - "dev": "bunx netlify dev" + "dev": "bunx netlify dev --filter @rssbook/platform-netlify" }, "type": "module" } diff --git a/platform/netlify/public/.gitkeep b/platform/netlify/public/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/platform/netlify/public/.gitkeep @@ -0,0 +1 @@ + diff --git a/platform/netlify/tsconfig.json b/platform/netlify/tsconfig.json index 6427ce5..c7a578b 100644 --- a/platform/netlify/tsconfig.json +++ b/platform/netlify/tsconfig.json @@ -7,5 +7,5 @@ "types": [] }, "extends": "../../tsconfig.base.json", - "include": ["index.ts"] + "include": ["netlify/edge-functions/**/*.ts"] } From cc873287f99161ac602e55da6794b146e4a2ed6e Mon Sep 17 00:00:00 2001 From: niapya Date: Mon, 6 Jul 2026 01:42:26 +0800 Subject: [PATCH 12/20] feat: improve style --- pkgs/rssbook/src/books/theme/home/components/Footer.tsx | 4 +++- pkgs/rssbook/src/books/theme/home/components/Item.tsx | 4 ++-- pkgs/rssbook/src/index.ts | 2 +- platform/cloudflare/wrangler.jsonc | 7 ++----- platform/vercel/vercel.json | 8 ++++---- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/pkgs/rssbook/src/books/theme/home/components/Footer.tsx b/pkgs/rssbook/src/books/theme/home/components/Footer.tsx index 3d35812..b4f0dfc 100644 --- a/pkgs/rssbook/src/books/theme/home/components/Footer.tsx +++ b/pkgs/rssbook/src/books/theme/home/components/Footer.tsx @@ -95,7 +95,9 @@ export function Footer({ title, description, rss, atom, json }: FooterProps) {
自豪地采用 RSSBook 制作。 diff --git a/pkgs/rssbook/src/books/theme/home/components/Item.tsx b/pkgs/rssbook/src/books/theme/home/components/Item.tsx index b5160c0..73b284e 100644 --- a/pkgs/rssbook/src/books/theme/home/components/Item.tsx +++ b/pkgs/rssbook/src/books/theme/home/components/Item.tsx @@ -90,9 +90,9 @@ export function Item({ item }: Item) { {!!item.description && ( -

+ {item.description} -

+ )} {!!item.author && item.author.length > 0 && ( diff --git a/pkgs/rssbook/src/index.ts b/pkgs/rssbook/src/index.ts index 9ca6702..88227ba 100644 --- a/pkgs/rssbook/src/index.ts +++ b/pkgs/rssbook/src/index.ts @@ -11,7 +11,7 @@ export const app = createRSSBookApp({ description: "A simple RSS feed aggregator and reader.", title: "RSSBook", }, - } + }, }); // For Bun's built-in fetch server diff --git a/platform/cloudflare/wrangler.jsonc b/platform/cloudflare/wrangler.jsonc index 77eed01..3037af9 100644 --- a/platform/cloudflare/wrangler.jsonc +++ b/platform/cloudflare/wrangler.jsonc @@ -5,10 +5,7 @@ "directory": "../../pkgs/rssbook/src/public" }, "compatibility_date": "2025-07-30", - "compatibility_flags": [ - "nodejs_compat", - "nodejs_compat_populate_process_env" - ], + "compatibility_flags": ["nodejs_compat", "nodejs_compat_populate_process_env"], // KV Namespace "kv_namespaces": [ { @@ -32,4 +29,4 @@ "persist": true } } -} \ No newline at end of file +} diff --git a/platform/vercel/vercel.json b/platform/vercel/vercel.json index 920d931..8b56d57 100644 --- a/platform/vercel/vercel.json +++ b/platform/vercel/vercel.json @@ -1,14 +1,14 @@ { "$schema": "https://openapi.vercel.sh/vercel.json", + "buildCommand": "echo \"No build required\"", + "devCommand": "vercel dev", "framework": null, "installCommand": "bun install", - "buildCommand": "echo \"No build required\"", "outputDirectory": "../../pkgs/rssbook/src/public", - "devCommand": "vercel dev", "rewrites": [ { - "source": "/(.*)", - "destination": "/api" + "destination": "/api", + "source": "/(.*)" } ] } From 489572b21726106dbde6c877fd2a2e6e79d2b1fe Mon Sep 17 00:00:00 2001 From: niapya Date: Mon, 6 Jul 2026 02:02:20 +0800 Subject: [PATCH 13/20] feat: add i18n support and reorganize theme components - Add i18n module with zh-CN and en translations - Reorganize components into layout/, content/, controls/ subdirectories - Remove barrel export file (index.ts) - Replace hardcoded Chinese text with i18n references - Update Nav and Footer logos to use RSSBook SVG - Add search/filter status card at top of Timeline - Update footer link to RSSBook GitHub repository --- .../home/components/{ => content}/Item.tsx | 12 +- .../components/{ => content}/Timeline.tsx | 53 ++++++- .../components/{ => controls}/FilterBar.tsx | 21 +-- .../home/components/{ => controls}/Status.tsx | 24 ++-- .../src/books/theme/home/components/index.ts | 7 - .../components/{ => layout}/Background.tsx | 0 .../home/components/{ => layout}/Footer.tsx | 27 ++-- .../home/components/{ => layout}/Nav.tsx | 29 ++-- pkgs/rssbook/src/books/theme/home/i18n.ts | 136 ++++++++++++++++++ pkgs/rssbook/src/books/theme/home/index.tsx | 23 ++- 10 files changed, 264 insertions(+), 68 deletions(-) rename pkgs/rssbook/src/books/theme/home/components/{ => content}/Item.tsx (96%) rename pkgs/rssbook/src/books/theme/home/components/{ => content}/Timeline.tsx (51%) rename pkgs/rssbook/src/books/theme/home/components/{ => controls}/FilterBar.tsx (93%) rename pkgs/rssbook/src/books/theme/home/components/{ => controls}/Status.tsx (86%) delete mode 100644 pkgs/rssbook/src/books/theme/home/components/index.ts rename pkgs/rssbook/src/books/theme/home/components/{ => layout}/Background.tsx (100%) rename pkgs/rssbook/src/books/theme/home/components/{ => layout}/Footer.tsx (75%) rename pkgs/rssbook/src/books/theme/home/components/{ => layout}/Nav.tsx (83%) create mode 100644 pkgs/rssbook/src/books/theme/home/i18n.ts diff --git a/pkgs/rssbook/src/books/theme/home/components/Item.tsx b/pkgs/rssbook/src/books/theme/home/components/content/Item.tsx similarity index 96% rename from pkgs/rssbook/src/books/theme/home/components/Item.tsx rename to pkgs/rssbook/src/books/theme/home/components/content/Item.tsx index 73b284e..0e7b6f7 100644 --- a/pkgs/rssbook/src/books/theme/home/components/Item.tsx +++ b/pkgs/rssbook/src/books/theme/home/components/content/Item.tsx @@ -1,11 +1,13 @@ import type { DataItem } from "@/types"; +import type { Translations } from "../../i18n"; interface Item { item: DataItem; index: number; + t: Translations; } -export function Item({ item }: Item) { +export function Item({ item, t }: Item) { const formatDate = (date: Date) => { const year = date.getFullYear(); const month = String(date.getMonth() + 1).padStart(2, "0"); @@ -53,7 +55,7 @@ export function Item({ item }: Item) { stroke-width="2" /> - {item.date ? formatDate(item.date) : "未知日期"} + {item.date ? formatDate(item.date) : t.unknownDate} · {item.date ? formatTime(item.date) : ""} @@ -162,11 +164,11 @@ export function Item({ item }: Item) { )}

- {item.enclosure.title || "媒体附件"} + {item.enclosure.title || t.mediaAttachment}

{item.enclosure.duration && (

- 时长: + {t.duration} {Math.floor(item.enclosure.duration / 60)}: {String(item.enclosure.duration % 60).padStart(2, "0")}

@@ -178,7 +180,7 @@ export function Item({ item }: Item) { rel="noopener noreferrer" target="_blank" > - 播放 + {t.play}
diff --git a/pkgs/rssbook/src/books/theme/home/components/Timeline.tsx b/pkgs/rssbook/src/books/theme/home/components/content/Timeline.tsx similarity index 51% rename from pkgs/rssbook/src/books/theme/home/components/Timeline.tsx rename to pkgs/rssbook/src/books/theme/home/components/content/Timeline.tsx index bfa99a3..48ac315 100644 --- a/pkgs/rssbook/src/books/theme/home/components/Timeline.tsx +++ b/pkgs/rssbook/src/books/theme/home/components/content/Timeline.tsx @@ -1,11 +1,18 @@ -import type { DataItem } from "@/types"; +import type { DataItem, FilterInfo } from "@/types"; +import type { Translations } from "../../i18n"; import { Item } from "./Item"; interface TimelineProps { items: DataItem[]; + filter: FilterInfo; + t: Translations; } -export function Timeline({ items }: TimelineProps) { +export function Timeline({ items, filter, t }: TimelineProps) { + const { search, category } = filter; + const hasFilter = !!search || category !== "all"; + const clearUrl = `/?limit=20&page=1`; + return (
@@ -18,6 +25,45 @@ export function Timeline({ items }: TimelineProps) {
+ {hasFilter && ( +
+
+
+ {search && ( + + + {t.searchResultsFor} 「{search}」 + + )} + {category !== "all" && ( + + {t.filteredByCategory} {category} + + )} +
+ + {t.clearAll} + +
+
+ )} + {items.map((item, index) => ( ))}
@@ -39,7 +86,7 @@ export function Timeline({ items }: TimelineProps) {

- {items.length === 0 ? "暂无内容" : "当前页内容已展示完毕"} + {items.length === 0 ? t.noContent : t.pageContentDisplayed}

diff --git a/pkgs/rssbook/src/books/theme/home/components/FilterBar.tsx b/pkgs/rssbook/src/books/theme/home/components/controls/FilterBar.tsx similarity index 93% rename from pkgs/rssbook/src/books/theme/home/components/FilterBar.tsx rename to pkgs/rssbook/src/books/theme/home/components/controls/FilterBar.tsx index 57b4575..81e23df 100644 --- a/pkgs/rssbook/src/books/theme/home/components/FilterBar.tsx +++ b/pkgs/rssbook/src/books/theme/home/components/controls/FilterBar.tsx @@ -1,16 +1,17 @@ import type { FilterInfo, PaginationInfo } from "@/types"; +import type { Translations } from "../../i18n"; interface FilterBarProps { categories: { name: string }[]; filter: FilterInfo; pagination: PaginationInfo; + t: Translations; } -export function FilterBar({ categories, filter, pagination }: FilterBarProps) { +export function FilterBar({ categories, filter, pagination, t }: FilterBarProps) { const { search, category } = filter; const { limit } = pagination; - // 预先计算所有分类的 URL(服务端渲染) const allCategoryUrl = search ? `/?search=${encodeURIComponent(search)}&limit=${limit}&page=1` : `/?limit=${limit}&page=1`; @@ -29,14 +30,14 @@ export function FilterBar({ categories, filter, pagination }: FilterBarProps) { class="mb-2 block font-medium text-sm text-stone-700 dark:text-stone-300" for="search" > - 搜索文章 + {t.searchArticles}
@@ -62,14 +63,14 @@ export function FilterBar({ categories, filter, pagination }: FilterBarProps) { class="absolute top-1.5 right-1.5 rounded-xl bg-rose-600 px-4 py-2 font-medium text-sm text-white transition-all duration-200 hover:bg-rose-700 active:scale-95 dark:bg-rose-500 dark:hover:bg-rose-600" type="submit" > - 搜索 + {t.search}
- 按分类筛选 + {t.filterByCategory}
- 全部 + {t.all} {categories.map((cat) => { @@ -107,7 +108,7 @@ export function FilterBar({ categories, filter, pagination }: FilterBarProps) { {(category !== "all" || !!search) && (
- 当前筛选:{" "} + {t.currentFilter}{" "} {category !== "all" ? category : ""} {search ? `「${search}」` : ""} @@ -117,14 +118,14 @@ export function FilterBar({ categories, filter, pagination }: FilterBarProps) { class="rounded-lg bg-stone-200/60 px-3 py-1 text-stone-600 transition-all duration-200 hover:bg-stone-300/60 dark:bg-stone-700/60 dark:text-stone-400 dark:hover:bg-stone-600/60" href={clearFilterUrl} > - 清除筛选 + {t.clearFilter}
)}
- + {t.page} {page} - + {t.total && {t.total}} / - + {t.of} {totalPages} - + {t.pages && {t.pages}}
- 上一页 + {t.previousPage} - 下一页 + {t.nextPage}
-
+
@@ -47,7 +48,7 @@ export function Footer({ title, description, rss, atom, json }: FooterProps) {

- 快速导航 + {t.quickNavigation}