Skip to content
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e620cb1
Add feed package
Kiwow Apr 17, 2026
9b3fd46
First version of feed generation
Kiwow Apr 17, 2026
995a5bb
[autofix.ci] apply automated fixes
autofix-ci[bot] Apr 17, 2026
38fdefe
[autofix.ci] apply automated fixes (attempt 2/3)
autofix-ci[bot] Apr 17, 2026
764b2ac
[autofix.ci] apply automated fixes (attempt 3/3)
autofix-ci[bot] Apr 17, 2026
c8a0147
Remove generated files
Kiwow Apr 19, 2026
034ffd6
Don't generate files to /public
Kiwow Apr 19, 2026
021d241
Add prerendered endpoint for each feed type
Kiwow Apr 19, 2026
4ad82dc
Include link rel='alternate' on blog pages
Kiwow Apr 19, 2026
4f8a193
Get rid of unnecessary exports
Kiwow Apr 19, 2026
71390b1
Hack around the type error
Kiwow Apr 19, 2026
0feba05
Add e2e test that verifies links and file types
Kiwow Apr 19, 2026
cfdb1a5
Update locator usage
Kiwow Apr 19, 2026
74b2c73
Move header setting to nuxt config
Kiwow Apr 19, 2026
4d27065
Finish test
Kiwow Apr 19, 2026
453ceb5
Merge branch 'main' into rss
Kiwow Apr 19, 2026
1389051
Update comments
Kiwow Apr 19, 2026
9939025
Merge remote-tracking branch 'origin/main' into rss
Kiwow May 10, 2026
106d240
Simplify feed generation by not caching the object
Kiwow May 10, 2026
02dfcfa
Streamline absolute URLs
Kiwow May 10, 2026
aa540af
fix: Properly reinclude .nuxt/ route
Kiwow May 10, 2026
c5bfb69
Revert "fix: Properly reinclude .nuxt/ route"
Kiwow May 10, 2026
5a2c622
Fix comment
Kiwow May 10, 2026
f5e9f22
Capitalize A
Kiwow May 10, 2026
fca6411
fix: lint
Kiwow May 10, 2026
dfdfaef
Merge branch 'main' into rss
Kiwow May 10, 2026
607ee7c
Merge remote-tracking branch 'origin/main' into rss
Kiwow May 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions app/pages/blog/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,29 @@ useSeoMeta({
ogDescription: () => $t('blog.meta_description'),
twitterDescription: () => $t('blog.meta_description'),
})

useHead({
link: [
{
rel: 'alternate',
title: 'Blog - npmx',
type: 'application/rss+xml',
href: 'https://npmx.dev/rss.xml',
},
{
rel: 'alternate',
title: 'Blog - npmx',
type: 'application/atom+xml',
href: 'https://npmx.dev/atom.xml',
},
{
rel: 'alternate',
title: 'Blog - npmx',
type: 'application/feed+json',
href: 'https://npmx.dev/feed.json',
},
],
})
</script>

<template>
Expand Down
16 changes: 16 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,18 @@ export default defineNuxtConfig({
'/recharging': { prerender: true },
'/pds': { isr: 86400 }, // revalidate daily
'/blog/**': { prerender: true },
'/rss.xml': {
prerender: true,
headers: { 'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/rss+xml' },
},
'/atom.xml': {
prerender: true,
headers: { 'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/atom+xml' },
},
'/feed.json': {
prerender: true,
headers: { 'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/feed+json' },
},
// proxy for insights
'/_v/script.js': {
proxy: 'https://npmx.dev/_vercel/insights/script.js',
Expand Down Expand Up @@ -231,6 +243,10 @@ export default defineNuxtConfig({
esbuild: {
options: {
target: 'es2024',
// HACK: Excluding node_modules is the default. Here, we exempt
// .cache/nuxt/.nuxt/blog/posts.ts from that so that #blog/posts can be
// imported, parsed and executed as TS in server\utils\feeds.ts by esbuild
exclude: /node_modules\/(?!\.cache\/nuxt\/\.nuxt\/blog\/posts\.ts)/,
},
},
Comment thread
coderabbitai[bot] marked this conversation as resolved.
rollupConfig: {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
"devalue": "5.6.4",
"eslint-plugin-regexp": "3.1.0",
"fast-check": "4.6.0",
"feed": "5.2.0",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Confirm the feed package is only used behind prerendered routes and nowhere on a runtime path.
rg -nP "from ['\"]feed['\"]|require\(['\"]feed['\"]\)" --type=ts --type=js --type=vue
echo '---'
# Double-check no non-prerendered route imports getFeed
rg -nP -C2 "getFeed\s*\(" --type=ts

Repository: npmx-dev/npmx.dev

Length of output: 992


🏁 Script executed:

# Check where feed is imported in feeds.ts
cat -n server/utils/feeds.ts | head -20

echo '=== Checking nuxt.config.ts for prerender settings ==='
# Search for prerender configurations for the feed routes
rg -nP "atom\.xml|rss\.xml|feed\.json" nuxt.config.ts

echo '=== Current package.json state for feed ==='
# Check where feed is currently placed in package.json
rg -nP -B2 -A2 '"feed":\s*"5\.2\.0"' package.json

echo '=== Searching for any other getFeed or feed imports ==='
# Broader search for any other getFeed invocations
rg -nP "getFeed" --type=ts

Repository: npmx-dev/npmx.dev

Length of output: 1513


🏁 Script executed:

# View the prerender configuration for the feed routes in nuxt.config.ts
sed -n '193,210p' nuxt.config.ts

Repository: npmx-dev/npmx.dev

Length of output: 693


Move feed from devDependencies to dependencies for runtime safety.

feed is imported in server/utils/feeds.ts and used only by three routes (/rss.xml, /atom.xml, /feed.json), all of which have prerender: true in nuxt.config.ts. While this means the dependency is needed only at build time in a fully prerendered deploy, moving it to dependencies is recommended as a safer posture. If any of these routes ever fall back to runtime rendering—such as an ISR fallback, dev preview in production mode, or a prerender failure served on-demand—Nitro's bundled output will reference feed at runtime and it will be missing in a --prod/--production install.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` at line 136, Move the "feed" package from devDependencies to
dependencies in package.json so it is available at runtime; update package.json
by removing "feed": "5.2.0" from devDependencies and adding the same entry under
dependencies. This ensures imports in server/utils/feeds.ts (used by the
/rss.xml, /atom.xml and /feed.json routes with prerender: true) are present in
production builds and prevents runtime errors if those routes are ever rendered
on-demand.

"h3": "1.15.8",
"h3-next": "npm:h3@2.0.1-rc.16",
"knip": "6.0.5",
Expand Down
Loading
Loading