Skip to content

chore(deps): move build-only packages to devDependencies - #177

Merged
sydevs-bot merged 3 commits into
mainfrom
claude/chore-171-build-only-devdeps
Oct 14, 2026
Merged

sydevs-bot merged 3 commits into
mainfrom
claude/chore-171-build-only-devdeps

Conversation

@sydevs-bot

Copy link
Copy Markdown
Contributor

Summary

  • @photonjs/cloudflare and @vitejs/plugin-react move to devDependencies. Neither ships code.
  • pnpm audit --prod still flags sharp, now via vike-photon. See Notes — one criterion is half-met.

Change outline

The contract here is the manifest section itself: two consumers classify an advisory by the scope a package sits in.

 package.json
 "dependencies":            # the scope dependency-review and Dependabot read as runtime
-  @photonjs/cloudflare     # no importer; wrangler.toml reaches it through a build-time virtual module
   @photonjs/hono           # stays — server/entry.ts imports it as source
-  @vitejs/plugin-react     # no importer but vite.config.ts
   vike-photon              # stays — but it keeps the @photonjs/cloudflare edge alive (see Notes)
 "devDependencies":
+  @photonjs/cloudflare
+  @vitejs/plugin-react

vike-photon resolves the Cloudflare target by asking whether the user installed the package at all, checking devDependencies before dependencies — so the move does not change target detection.

vike-photon/dist/chunk-SCFVCWMW.js:1344
  isDependencyInstalledByUser('@photonjs/cloudflare')
    for (const field of ["devDependencies", "dependencies"])   # dev satisfies it

Preview

Both hosts are keyed on the branch slug, and no alias exists before the first build. Preview pending — Cloudflare posts the Worker URL as a bot comment, and package.json plus pnpm-lock.yaml are Ladle build watch paths, so the Pages preview builds too.

Test results

  • Lean gate: ✓ .claude/skills/pr-prep/check.sh --full — lint, tsc --noEmit, test:run, build (109s)
  • Targeted specs: N/A — no source file changed
  • Build: ✓ — dist/server and dist/client keep all 199 file names, byte-for-byte identical listing

Manual verification

  1. Confirm the Cloudflare Worker preview deploys and the root returns 200.
  2. Confirm the Ladle Pages preview builds, since this diff touches two of its watch paths.
  3. Confirm Dependency Review / review passes, and that the next Dependabot pass reports @photonjs/cloudflare as development scope.

Notes for reviewer

Acceptance criterion 5 is only half-met, and the remaining half needs your call. @vitejs/plugin-react carries no advisory, so it is clean. @photonjs/cloudflare still reaches pnpm audit --prod — the advisory path moved rather than disappeared:

before   .>@photonjs/cloudflare>@cloudflare/vite-plugin>miniflare>sharp
after    .>vike-photon>@photonjs/cloudflare>@cloudflare/vite-plugin>miniflare>sharp

@photonjs/cloudflare is an optional peer of vike-photon, which stays in dependencies. pnpm gives a peer edge the scope of the depender, not of the declarer, so a production dependency keeps our dev copy production-reachable. High-severity count is unchanged at 3 either way.

Three options, and I did not pick one:

  1. Move vike-photon too. pages/+config.ts is its only importer, and nothing from it reaches dist. But this widens the question to vike, vike-react and the premise that a bundled Worker loads no node_modules at runtime — a bigger ticket than chore(deps): move build-only packages to devDependencies #171, and not mine to open on your behalf.
  2. Accept it. The two consumers that matter read GitHub's dependency graph scope, not pnpm audit --prod: dependency-review.yml gates on fail-on-scopes: runtime, and the loop's Dependabot check filters scopes: ["runtime"]. Whether GitHub propagates runtime scope across an optional-peer edge the way pnpm does is the one thing I could not settle locally — this PR's own Dependency Review / review run and the next Dependabot pass answer it.
  3. pnpm.auditConfig.ignoreGhsas. Rejected: it hides the advisory instead of scoping it.

Recommendation: option 2 now, then a follow-up ticket for option 1 once this PR's CI shows how GitHub scores the edge.

The dashboard check the ticket asked for went the other way round. I cannot read Cloudflare's dashboard, so I settled it from the repo instead: vite, @tailwindcss/vite, @sentry/vite-plugin, typescript and wrangler are already devDependencies, and pnpm build cannot run without them. Cloudflare builds both previews green on main today, so its install command demonstrably installs devDependencies. The build command needs no change.

Detail

Lockfile. The diff touches only the importers: block — 12 changed lines, all specifier/version pairs moving between the two scopes. No snapshots: or packages: entry changed, so the resolved graph is identical and pnpm install --frozen-lockfile reports "Lockfile is up to date".

Neither package ships code. @photonjs/cloudflare/dist/index.js is export {}; only its ./vite subpath has content, a pure Vite plugin. Grepping a fresh build for @photonjs/cloudflare, @universal-middleware/cloudflare, @vitejs/plugin-react and react-refresh module paths finds nothing in dist/client or dist/server.

.npmrc matters here. auto-install-peers=false means an optional peer is installed only because we declare it directly. Removing the declaration rather than moving it would leave vike-photon without the Cloudflare target and break the build.

Pre-existing, not introduced here: pnpm skips devDependencies under NODE_ENV=production, which would already break pnpm build before this change. Nothing in the repo sets it.

Review passes. /code-review high — no findings, verified against package.json, pnpm-lock.yaml, vite.config.ts, wrangler.toml, server/entry.ts, .npmrc, .github/workflows/ci.yml and the shared dependency-review.yml. comment-lint — 0 changed files. /simplify had no surface: the diff contains no code. /security-review skipped — neither changed path matches securityReview.triggerPattern. Docs checked, nothing stale: no guide or .env.example states either package's scope.

Closes #171

🤖 Generated with Claude Code

https://claude.ai/code/session_01AjhWVSc9DErHBkNB7HABnX


Generated by Claude Code

@photonjs/cloudflare and @vitejs/plugin-react sat in dependencies, but
no source file reaches either. wrangler.toml's `main` resolves the
Photon Cloudflare entry through a build-time virtual module, and
vite.config.ts is the only importer of the React plugin. The wrong
scope made every advisory against the Workers toolchain arrive
classified as production, which is how GHSA-wq5f-xc86-pv6w (sharp)
surfaced in #170.

The lockfile change is importer scope only: no resolution moves, and
dist/server and dist/client keep all 199 file names.

Closes #171

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AjhWVSc9DErHBkNB7HABnX
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 10, 2026 •

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 ce03212 Commit Preview URL

Branch Preview URL
Oct 13 2026, 01:45 PM

@sydevs-bot

Copy link
Copy Markdown
Contributor Author

This draft has had no CI activity for hours and no session holds it. Comment or push to wake me.

🤖 sydevs dispatcher

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Deploying wemeditate-design with  Cloudflare Pages  Cloudflare Pages

Latest commit: ce03212
Status: ✅  Deploy successful!
Preview URL: https://3d3634b4.wm-design.pages.dev
Branch Preview URL: https://claude-chore-171-build-only.wm-design.pages.dev

View logs

@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed awaiting labels Oct 13, 2026
@sydevs-bot

sydevs-bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running
CI fix 1

recent dispatches
  • 13:39Z fix-ci · attempt 1 · session · done
  • 13:39Z fix-ci · attempt 1 · session

Written by the sydevs dispatcher. Sessions never edit this comment.

The main-merge in e7abb43 re-added `@photonjs/cloudflare` under
`importers.dependencies` while leaving the devDependencies entry this
branch added, so the lockfile listed it in both scopes. `pnpm install
--frozen-lockfile` then reported ERR_PNPM_OUTDATED_LOCKFILE against
package.json, which has it only in devDependencies — failing Lint,
Typecheck & Unit, Smoke (web) and Smoke (ladle) before any of them ran a
step of their own.

Regenerated with `pnpm install --lockfile-only`. Beyond dropping the
duplicate it refreshes that entry's stale `[email protected]` peer suffix
to the 4.149.0 main already resolves, and records two `deprecated`
strings the registry now returns for vidstack. Neither changes the
resolved graph.

`pnpm install --frozen-lockfile` passes, and the full lean gate is green.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01DAXnvaueGjeNsmTFNMmCN3
@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Oct 13, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review October 13, 2026 13:45
@sydevs-bot
sydevs-bot requested a review from Ardnived October 13, 2026 13:45
@sydevs-bot
sydevs-bot enabled auto-merge October 13, 2026 13:45
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Adversarial review skipped: 2 file(s), 18 changed line(s), under review.skipWhen. Say @sydevs-bot review to force one.

🤖 sydevs dispatcher

@sydevs-bot sydevs-bot moved this from Revising to Approved in SYDevelopers Technical Roadmap Oct 14, 2026
@sydevs-bot
sydevs-bot added this pull request to the merge queue Oct 14, 2026
Merged via the queue into main with commit 9885393 Oct 14, 2026
31 checks passed
@sydevs-bot
sydevs-bot deleted the claude/chore-171-build-only-devdeps branch October 14, 2026 16:11
@sydevs-bot sydevs-bot moved this from Approved to Done in SYDevelopers Technical Roadmap Oct 14, 2026
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): move build-only packages to devDependencies

3 participants