Skip to content

Open-source status page, incident response and uptime monitoring

refactor: Replace RSS with Feed Lib in the blog/changelog (#1147)

Washington Pires77f17e821ac0
diff --git a/apps/web/package.json b/apps/web/package.json
index 14202e4a0..b6ffa980b 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -55,6 +55,7 @@
"cobe": "0.6.3",
"date-fns": "2.30.0",
"date-fns-tz": "2.0.0",
+ "feed": "^4.2.2",
"lucide-react": "0.468.0",
"nanoid": "5.0.7",
"next": "15.1.1",
@@ -75,7 +76,6 @@
"remark-parse": "10.0.2",
"remark-rehype": "10.1.0",
"resend": "4.0.1",
- "rss": "1.2.2",
"shiki": "0.14.4",
"sonner": "1.7.1",
"stripe": "13.8.0",
@@ -92,7 +92,6 @@
"@types/node": "20.14.8",
"@types/react": "19.0.1",
"@types/react-dom": "19.0.2",
- "@types/rss": "0.0.32",
"autoprefixer": "10.4.19",
"postcss": "8.4.38",
"rehype-autolink-headings": "7.1.0",
diff --git a/apps/web/src/app/(content)/blog/feed.xml/route.ts b/apps/web/src/app/(content)/blog/feed.xml/route.ts
index cd6ae3617..bf2bce7a8 100644
--- a/apps/web/src/app/(content)/blog/feed.xml/route.ts
+++ b/apps/web/src/app/(content)/blog/feed.xml/route.ts
@@ -1,18 +1,24 @@
import { allPosts } from "content-collections";
-import RSS from "rss";
+import { Feed } from "feed";
export async function GET() {
- const feed = new RSS({
- title: "OpenStatus",
+ const feed = new Feed({
+ id: "https://www.openstatus.dev/blog",
+ title: "OpenStatus - Blog",
description: "OpenStatus blog feed",
generator: "RSS for Node and Next.js",
- feed_url: "https://www.openstatus.dev/blog/feed.xml",
- site_url: "https://www.openstatus.dev",
- managingEditor: "[email protected] (OpenStatus Team)",
- webMaster: "[email protected] (OpenStatus Team)",
+ feedLinks: {
+ rss: "https://www.openstatus.dev/blog/feed.xml",
+ },
+ link: "https://www.openstatus.dev",
+ author: {
+ name: "OpenStatus Team",
+ email: "[email protected]",
+ link: "https://openstatus.dev"
+ },
copyright: `Copyright ${new Date().getFullYear().toString()}, OpenStatus`,
language: "en-US",
- pubDate: new Date().toUTCString(),
+ updated: new Date(),
ttl: 60,
});
@@ -22,15 +28,19 @@ export async function GET() {
new Date(b.publishedAt).getTime() - new Date(a.publishedAt).getTime(),
)
.map((post) => {
- feed.item({
+ feed.addItem({
+ id: `https://www.openstatus.dev/blog/${post.slug}`,
title: post.title,
description: post.description,
- url: `https://www.openstatus.dev/blog/${post.slug}`,
- author: post.author.name,
+ link: `https://www.openstatus.dev/blog/${post.slug}`,
+ author: [{
+ name: post.author.name,
+ link: post.author.url,
+ }],
date: post.publishedAt,
});
});
- return new Response(feed.xml({ indent: true }), {
+ return new Response(feed.rss2(), {
headers: {
"Content-Type": "application/xml; charset=utf-8",
},
diff --git a/apps/web/src/app/(content)/changelog/feed.xml/route.ts b/apps/web/src/app/(content)/changelog/feed.xml/route.ts
index fd2a6fdac..04d22dc0c 100644
--- a/apps/web/src/app/(content)/changelog/feed.xml/route.ts
+++ b/apps/web/src/app/(content)/changelog/feed.xml/route.ts
@@ -1,18 +1,24 @@
import { allChangelogs } from "content-collections";
-import RSS from "rss";
+import { Feed } from "feed";
export async function GET() {
- const feed = new RSS({
- title: "OpenStatus",
+ const feed = new Feed({
+ id: "https://www.openstatus.dev/changelog",
+ title: "OpenStatus - Changelog",
description: "OpenStatus changelog feed",
generator: "RSS for Node and Next.js",
- feed_url: "https://www.openstatus.dev/blog/feed.xml",
- site_url: "https://www.openstatus.dev",
- managingEditor: "[email protected] (OpenStatus Team)",
- webMaster: "[email protected] (OpenStatus Team)",
+ feedLinks: {
+ rss: "https://www.openstatus.dev/changelog/feed.xml",
+ },
+ link: "https://www.openstatus.dev",
+ author: {
+ name: "OpenStatus Team",
+ email: "[email protected]",
+ link: "https://openstatus.dev"
+ },
copyright: `Copyright ${new Date().getFullYear().toString()}, OpenStatus`,
language: "en-US",
- pubDate: new Date().toUTCString(),
+ updated: new Date(),
ttl: 60,
});
@@ -22,15 +28,20 @@ export async function GET() {
new Date(b.publishedAt).getTime() - new Date(a.publishedAt).getTime(),
)
.map((post) => {
- feed.item({
+ feed.addItem({
+ id: `https://www.openstatus.dev/changelog/${post.slug}`,
title: post.title,
description: post.description,
- url: `https://www.openstatus.dev/changelog/${post.slug}`,
- author: "OpenStatus Team",
+ link: `https://www.openstatus.dev/changelog/${post.slug}`,
+ author: [{
+ name: "OpenStatus Team",
+ email: "[email protected]",
+ link: "https://openstatus.dev"
+ }],
date: post.publishedAt,
});
});
- return new Response(feed.xml({ indent: true }), {
+ return new Response(feed.rss2(), {
headers: {
"Content-Type": "application/xml; charset=utf-8",
},
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 884c0817e..6f949dfc4 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -274,7 +274,7 @@ importers:
'@sentry/nextjs':
specifier: 8.46.0
'@stripe/stripe-js':
specifier: 2.1.6
version: 2.1.6
@@ -301,7 +301,7 @@ importers:
'@trpc/next':
specifier: 11.0.0-rc.666
'@trpc/react-query':
specifier: 11.0.0-rc.666
@@ -338,6 +338,9 @@ importers:
date-fns-tz:
specifier: 2.0.0
version: 2.0.0([email protected])
+ feed:
+ specifier: ^4.2.2
+ version: 4.2.2
lucide-react:
specifier: 0.468.0
version: 0.468.0([email protected])
@@ -346,19 +349,19 @@ importers:
version: 5.0.7
next:
specifier: 15.1.1
next-auth:
specifier: 5.0.0-beta.25
next-plausible:
specifier: 3.12.4
next-themes:
specifier: 0.2.1
nuqs:
specifier: 2.2.3
random-word-slugs:
specifier: 0.1.7
version: 0.1.7
@@ -398,9 +401,6 @@ importers:
resend:
specifier: 4.0.1
- rss:
- specifier: 1.2.2
- version: 1.2.2
shiki:
specifier: 0.14.4
version: 0.14.4
@@ -431,7 +431,7 @@ importers:
'@content-collections/next':
specifier: 0.2.4
'@openstatus/tsconfig':
specifier: workspace:*
version: link:../../packages/tsconfig
@@ -444,9 +444,6 @@ importers:
'@types/react-dom':
specifier: 19.0.2
version: 19.0.2(@types/[email protected])
- '@types/rss':
- specifier: 0.0.32
- version: 0.0.32
autoprefixer:
specifier: 10.4.19
version: 10.4.19([email protected])
@@ -5060,9 +5057,6 @@ packages:
resolution: {integrity: sha512-BKGK0T1VgB1zD+PwQR4RRf0ais3NyvH1qjLUrHI5SEiccYaJrhLstLuoXFWJ+2Op9whGizSPUMGPJY/Qtb/A2w==}
- '@types/[email protected]':
- resolution: {integrity: sha512-2oKNqKyUY4RSdvl5eZR1n2Q9yvw3XTe3mQHsFPn9alaNBxfPnbXBtGP8R0SV8pK1PrVnLul0zx7izbm5/gF5Qw==}
-
resolution: {integrity: sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==}
@@ -6571,6 +6565,10 @@ packages:
picomatch:
optional: true
+ resolution: {integrity: sha512-u5/sxGfiMfZNtJ3OvQpXcvotFpYkL0n9u9mM2vkui2nGo8b4wvDkJ8gAkYqbA8QpGyFCv3RK0Z+Iv+9veCS9bQ==}
+ engines: {node: '>=0.4.0'}
+
resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==}
engines: {node: ^12.20 || >= 14.13}
@@ -7850,18 +7848,10 @@ packages:
resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==}
engines: {node: '>=8.6'}
- resolution: {integrity: sha512-5k547tI4Cy+Lddr/hdjNbBEWBwSl8EBc5aSdKvedav8DReADgWJzcYiktaRIw3GtGC1jjwldXtTzvqJZmtvC7w==}
- engines: {node: '>= 0.6'}
-
resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}
engines: {node: '>= 0.6'}
- resolution: {integrity: sha512-ryBDp1Z/6X90UvjUK3RksH0IBPM137T7cmg4OgD5wQBojlAiUwuok0QeELkim/72EtcYuNlmbkrcGuxj3Kl0YQ==}
- engines: {node: '>= 0.6'}
-
resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}
engines: {node: '>= 0.6'}
@@ -8091,10 +8081,6 @@ packages:
resolution: {integrity: sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ==}
hasBin: true
- resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==}
- hasBin: true
-
resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==}
hasBin: true
@@ -8990,9 +8976,6 @@ packages:
engines: {node: '>=18.0.0', npm: '>=8.0.0'}
hasBin: true
- resolution: {integrity: sha512-xUhRTgslHeCBeHAqaWSbOYTydN2f0tAzNXvzh3stjz7QDhQMzdgHf3pfgNIngeytQflrFPfy6axHilTETr6gDg==}
-
resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==}
engines: {node: '>=0.12.0'}
@@ -10190,8 +10173,9 @@ packages:
utf-8-validate:
optional: true
- resolution: {integrity: sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==}
+ resolution: {integrity: sha512-7rVi2KMfwfWFl+GpPg6m80IVMWXLRjO+PxTq7V2CDhoGak0wzYzFgUY2m4XJ47OGdXd8eLE8EmwfAmdjw7lC1g==}
+ hasBin: true
resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}
@@ -11430,11 +11414,11 @@ snapshots:
- acorn
- supports-color
dependencies:
'@content-collections/core': 0.7.3([email protected])
'@content-collections/integrations': 0.2.1(@content-collections/[email protected]([email protected]))
'@cspotcode/[email protected]':
dependencies:
@@ -12158,7 +12142,7 @@ snapshots:
'@jridgewell/[email protected]':
dependencies:
'@jridgewell/resolve-uri': 3.1.1
- '@jridgewell/sourcemap-codec': 1.4.15
+ '@jridgewell/sourcemap-codec': 1.5.0
'@lezer/[email protected]': {}
@@ -14009,7 +13993,7 @@ snapshots:
'@sentry/types': 8.9.2
'@sentry/utils': 8.9.2
dependencies:
'@opentelemetry/api': 1.9.0
'@opentelemetry/semantic-conventions': 1.28.0
@@ -14022,7 +14006,7 @@ snapshots:
'@sentry/vercel-edge': 8.46.0
'@sentry/webpack-plugin': 2.22.7([email protected])([email protected]([email protected]))
chalk: 3.0.0
resolve: 1.22.8
rollup: 3.29.5
stacktrace-parser: 0.1.10
@@ -14642,11 +14626,11 @@ snapshots:
'@trpc/server': 11.0.0-rc.666([email protected])
typescript: 5.6.2
dependencies:
'@trpc/client': 11.0.0-rc.666(@trpc/[email protected]([email protected]))([email protected])
'@trpc/server': 11.0.0-rc.666([email protected])
react: 19.0.0
react-dom: 19.0.0([email protected])
typescript: 5.6.2
@@ -14916,8 +14900,6 @@ snapshots:
'@types/[email protected]': {}
- '@types/[email protected]': {}
-
dependencies:
'@types/node': 22.10.2
@@ -15693,7 +15675,7 @@ snapshots:
dependencies:
- node-gyp-build: 4.8.1
+ node-gyp-build: 4.8.4
dependencies:
@@ -16670,6 +16652,10 @@ snapshots:
optionalDependencies:
picomatch: 4.0.2
+ dependencies:
+ xml-js: 1.6.11
+
dependencies:
node-domexception: 1.0.0
@@ -17538,7 +17524,7 @@ snapshots:
dependencies:
- '@types/node': 22.10.2
+ '@types/node': 20.14.8
merge-stream: 2.0.0
supports-color: 8.1.1
@@ -18517,14 +18503,8 @@ snapshots:
braces: 3.0.3
picomatch: 2.3.1
-
- dependencies:
- mime-db: 1.25.0
-
dependencies:
mime-db: 1.52.0
@@ -18617,15 +18597,27 @@ snapshots:
+ dependencies:
+ '@auth/core': 0.37.2
+ react: 19.0.0
+
dependencies:
'@auth/core': 0.37.2
react: 19.0.0
dependencies:
+ react: 19.0.0
+ react-dom: 19.0.0([email protected])
+
+ dependencies:
react: 19.0.0
react-dom: 19.0.0([email protected])
@@ -18661,6 +18653,32 @@ snapshots:
- '@babel/core'
- babel-plugin-macros
+ dependencies:
+ '@next/env': 15.1.1
+ '@swc/counter': 0.1.3
+ '@swc/helpers': 0.5.15
+ busboy: 1.6.0
+ caniuse-lite: 1.0.30001689
+ postcss: 8.4.31
+ react: 19.0.0
+ react-dom: 19.0.0([email protected])
+ styled-jsx: 5.1.6(@babel/[email protected])([email protected])
+ optionalDependencies:
+ '@next/swc-darwin-arm64': 15.1.1
+ '@next/swc-darwin-x64': 15.1.1
+ '@next/swc-linux-arm64-gnu': 15.1.1
+ '@next/swc-linux-arm64-musl': 15.1.1
+ '@next/swc-linux-x64-gnu': 15.1.1
+ '@next/swc-linux-x64-musl': 15.1.1
+ '@next/swc-win32-arm64-msvc': 15.1.1
+ '@next/swc-win32-x64-msvc': 15.1.1
+ '@opentelemetry/api': 1.9.0
+ sharp: 0.33.5
+ transitivePeerDependencies:
+ - '@babel/core'
+ - babel-plugin-macros
+
dependencies:
'@next/env': 15.1.1
@@ -18722,10 +18740,7 @@ snapshots:
-
- optional: true
dependencies:
@@ -18763,12 +18778,12 @@ snapshots:
dependencies:
boolbase: 1.0.0
dependencies:
mitt: 3.0.1
react: 19.0.0
optionalDependencies:
@@ -19957,11 +19972,6 @@ snapshots:
fsevents: 2.3.3
optional: true
- dependencies:
- mime-types: 2.1.13
- xml: 1.0.1
-
@@ -20321,6 +20331,13 @@ snapshots:
optionalDependencies:
'@babel/core': 7.24.5
+ dependencies:
+ client-only: 0.0.1
+ react: 19.0.0
+ optionalDependencies:
+ '@babel/core': 7.26.0
+
dependencies:
'@jridgewell/gen-mapping': 0.3.5
@@ -20652,7 +20669,7 @@ snapshots:
'@tsconfig/node14': 1.0.3
'@tsconfig/node16': 1.0.4
'@types/node': 20.14.8
- acorn: 8.11.3
+ acorn: 8.14.0
acorn-walk: 8.3.2
arg: 4.1.3
create-require: 1.1.1
@@ -21433,7 +21450,9 @@ snapshots:
bufferutil: 4.0.8
utf-8-validate: 6.0.5
+ dependencies:
+ sax: 1.4.1