Repository navigation
fix: make next-sitemap a dev dependency - #208
Conversation
next-sitemap only runs as the postbuild CLI and doesn't reach the site, but as a production dependency it pulled fast-glob, micromatch and picomatch into `npm audit --omit=dev`. GHSA-fc5q-39xc-vjpf (picomatch, no patched version) thus failed the Audit job on every PR. Move it to devDependencies, add a test that keeps it there, and say so in the README's Audit section. Vercel and the Dockerfile install devDependencies for the build, so the sitemap is still generated. Closes #207 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Reviewer's GuideConfigurationMove
DocumentationExplain in the Audit section that build-only tools such as
TestsAdd a test ensuring
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #208 +/- ##
=======================================
Coverage 49.86% 49.86%
=======================================
Files 44 44
Lines 1105 1105
Branches 292 292
=======================================
Hits 551 551
Misses 479 479
Partials 75 75 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Linked issuesChecked at commit f01bc48 #207 fix: keep next-sitemap out of production audit · 4 of 4 met
|
Sourcery withdrew this approval because the latest commits introduced blocking findings.
Summary
The
Auditjob (npm audit --omit=dev --audit-level=high) fails on every PR on GHSA-fc5q-39xc-vjpf (high, ReDoS inpicomatch, no patched version). The only production path to it wasnext-sitemap@4.2.3->fast-glob->micromatch->picomatch@2.3.2.next-sitemaponly runs as thepostbuildCLI and doesn't reach the site, so this PR moves it todevDependencies, as the other build-only tools (tailwindcss,postcss,autoprefixer) already are.package.json,package-lock.json:next-sitemapmoved todevDependencies. The lockfile was regenerated with npm 12.2.3 (the npm that ships with Node 26, as in CI), so the diff only marks the packages that are now dev-only.src/test/dependencies.test.ts: checks thatnext-sitemapstays a dev dependency.README.md: theAuditsection says that build-only tools belong indevDependencies.Vercel and the
Dockerfile(npm ciin thedepsstage) install devDependencies for the build, so the sitemap androbots.txtare still generated. The runner image copies only the standalone output, which never containednext-sitemap.GitHub withdrew the advisory on 2026-11-18 at 15:38 UTC, but npm still reported it about an hour later. Once npm syncs, the advisory goes away on its own. This change also keeps the next advisory in this glob chain from blocking every PR.
Light lane: this only moves a dependency between
dependenciesanddevDependenciesand adds a test and a docs line; there's no logic. I reviewed the diff myself.Verification
npx vitest run src/test/dependencies.test.tsfailed before the move and passes after it.npm audit --omit=dev --audit-level=high:found 0 vulnerabilities(before: 4 high, exit 1).npm ls picomatch --omit=dev: empty.npx prettier --check "src/**/*.{ts,tsx,json,css}",npx tsc --noEmit,npm run lint: pass.npm run test:coverage: 10 files, 89 tests passed.npm run build: passes;next-sitemapwritesrobots.txt,sitemap.xmlandsitemap-0.xml.AuditandCI passedincluded.Declined review findings
None (light lane).
Open questions
None.
Closes #207
🤖 Generated with Claude Code
Summary by Sourcery
Move next-sitemap to development dependencies so production audits exclude its build-only dependency chain while sitemap generation remains available during builds.
Bug Fixes:
Enhancements:
Documentation:
Tests: