Skip to content

chore(deps): stop auto-installing the unused Next.js peer subtree - #111

Merged
Ardnived merged 1 commit into
mainfrom
claude/chore-97-no-auto-install-peers
Sep 17, 2026
Merged

Ardnived merged 1 commit into
mainfrom
claude/chore-97-no-auto-install-peers

Conversation

@Ardnived

Copy link
Copy Markdown
Contributor

Closes #97.

@payloadcms/richtext-lexical declares Next.js peers, and @payloadcms/ui depends on it with next as a required peer, so pnpm installed a whole Next subtree this Vike + Hono app never runs — nine advisories, two of them critical, for code with no entry point here. One line in .npmrc plus the regenerated lockfile.

Neither narrower mechanism reaches it. pnpm.overrides rewrites the recorded peer range and leaves [email protected] resolved, producing an internally inconsistent lockfile with an unchanged audit. peerDependencyRules.ignoreMissing only silences the warning; it does not gate autoInstallPeers. And a scoped fix has to beat two inbound paths, not one — silencing @payloadcms/next would leave @payloadcms/ui pulling next in on its own.

Measured on this branch

Before After
pnpm audit 38 — 2 critical, 9 high, 23 moderate, 4 low 3 — 0 critical, 1 high, 2 moderate
Packages in lockfile 1286 1198
Lockfile — −973 / +153 lines
pnpm lint — 0 errors (2147 warnings, unchanged)
pnpm typecheck — clean
pnpm test:run — 69 files, 642 tests, all pass
pnpm build — built in 9.9s
grep -rlE "next/dist/|__NEXT_|NextRequest" dist/server dist/client — no match
pnpm install --frozen-lockfile — clean

The three that remain are all pre-existing and unrelated to this subtree:

Two things for the reviewer

One version actually changes. @photonjs/runtime re-resolves 0.1.4 → 0.1.17, pulling in @vercel/[email protected] and [email protected]. Those three names are the only version movement in the lockfile; everything else in the diff is peer-suffix rewriting and removals.

The switch is global, so five peers nobody asked about also leave — mapbox-gl, monaco-editor, yjs, sass, @emnapi/core. Each was checked against this repo and none is used: LocationSearch.tsx imports only useSearchBoxCore / useSearchSession from @mapbox/search-js-react and never a GL map, /map embeds the atlas in an iframe, there is no .scss file in the repo, and monaco/yjs are admin-panel and collaborative-editing paths never imported here. skipLibCheck: true keeps the mapbox-gl references in @mapbox/search-js-web's .d.ts files free.

Consequence going forward: a peer this app genuinely needs must now be declared as a direct dependency. Worth a line in AGENTS.md under repo-wide conventions — left out of this PR as a separate call (#97 Open questions).

Left for review to confirm

  • On the Cloudflare preview, open the page carrying LocationSearch, type a partial address, confirm suggestions return — the one criterion that needs a deploy, with mapbox-gl now uninstalled.

Shipped by hand rather than by the loop: .npmrc is on Claude Code's protected-paths list, so the unattended routine could not write it. Six loop-WeMeditateWeb runs stalled on that prompt before this was diagnosed.

🤖 Generated with Claude Code

`@payloadcms/richtext-lexical` declares Next.js peers, and `@payloadcms/ui`
depends on it with `next` as a required peer, so pnpm installed a whole Next
subtree this Vike app never runs. Nine advisories, two of them critical, for
code with no entry point here.

Neither `pnpm.overrides` nor `peerDependencyRules.ignoreMissing` reaches it:
the first rewrites the recorded peer range and leaves the resolved version
alone, the second only silences the warning. Both inbound paths close only
under the global switch.

pnpm audit: 38 advisories (2 critical, 9 high) -> 3 (0 critical, 1 high).
Lockfile -973/+153; 88 packages leave. `@photonjs/runtime` re-resolves
0.1.4 -> 0.1.17, pulling `@vercel/[email protected]` and `[email protected]` — the
only version change in the diff.

Closes #97

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying wemeditate-design with  Cloudflare Pages  Cloudflare Pages

Latest commit: b95aa30
Status: ✅  Deploy successful!
Preview URL: https://17f1c082.wm-design.pages.dev
Branch Preview URL: https://claude-chore-97-no-auto-inst.wm-design.pages.dev

View logs

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
wemeditate-web b95aa30 Commit Preview URL

Branch Preview URL
Sep 17 2026, 01:09 AM

@Ardnived
Ardnived marked this pull request as ready for review September 17, 2026 01:16
@Ardnived
Ardnived merged commit 62f3292 into main Sep 17, 2026
10 checks passed
@Ardnived
Ardnived deleted the claude/chore-97-no-auto-install-peers branch September 17, 2026 01:16
@sydevs-bot

Copy link
Copy Markdown
Contributor

I could not request a reviewer here, so this is the step left for you.

  • request a reviewer — GitHub said: Review cannot be requested from pull request author. - https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request

🤖 sydevs dispatcher

@sydevs-bot sydevs-bot moved this from Revising to Done in SYDevelopers Technical Roadmap Sep 17, 2026
sydevs-bot added a commit that referenced this pull request Sep 18, 2026
Cloudflare Pages is red on 797d9c9, and the build log lives only in the
Cloudflare dashboard, which a routine cannot reach. The branch forked at
2af1870, three commits back, so the Pages build was still installing the
pre-#111 dependency tree: 88 extra packages and a whole unused Next.js
subtree. This merge builds against the tree main installs today.

It also brings in the two server changes this PR's memos sit on top of:
#107 drops `preview` from `getWebConfig`, which `loadSiteContext` calls,
and #113 adds `+onCreatePageContext.server.ts`, the error-page path this
PR's fork spec describes.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01B9MPJ8NWXhK85k27xRq6Ji
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

chore(deps): stop auto-installing the unused Next.js peer subtree

2 participants