fix(cloudflare): auto-add .wrangler/state/v3 to .gitignore on default persistDir#4258
fix(cloudflare): auto-add .wrangler/state/v3 to .gitignore on default persistDir#4258jel-massih wants to merge 1 commit into
Conversation
…istDir The guard compared a resolved absolute path against the bare relative literal ".wrangler/state/v3", so the .gitignore was never updated. Gate on whether the user customized config.persistDir instead.
|
@jel-massih is attempting to deploy a commit to the Nitro Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughThe Cloudflare dev preset now conditionally updates ChangesCloudflare Dev Preset Gitignore Gating
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/presets/cloudflare/dev.ts (1)
1-1: ⚡ Quick winUse
patheinstead ofnode:pathfor cross-platform compatibility.Per coding guidelines, prefer
pathefor path operations to ensure cross-platform compatibility. Replace thenode:pathimport and usage withpathe.♻️ Proposed refactor
-import { resolve } from "node:path"; +import { resolve } from "pathe";As per coding guidelines: "Use
pathefor cross-platform path operations instead ofnode:path"Also applies to: 49-49
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/presets/cloudflare/dev.ts` at line 1, Replace the node:path import with pathe: change any "import { resolve } from 'node:path'" to "import { resolve } from 'pathe'" and ensure all uses of the resolve function in this module (e.g., any resolve(...) calls) continue to work by importing from pathe; also update any other occurrences in this file that import from 'node:path' to use 'pathe' instead.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/presets/cloudflare/dev.ts`:
- Line 1: Replace the node:path import with pathe: change any "import { resolve
} from 'node:path'" to "import { resolve } from 'pathe'" and ensure all uses of
the resolve function in this module (e.g., any resolve(...) calls) continue to
work by importing from pathe; also update any other occurrences in this file
that import from 'node:path' to use 'pathe' instead.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2bec4f4e-9637-414a-83a2-a2b70c5cff68
📒 Files selected for processing (1)
src/presets/cloudflare/dev.ts
|
src/presets/cloudflare/dev. |
In Cloudflare dev emulation, Nitro tries to auto-append
.wrangler/state/v3to the project.gitignoreso Wrangler emulator state doesn't get committed.The guard compares a resolved absolute path against the relative literal
".wrangler/state/v3", so it never matches and the entry is never added. Switching to!config.persistDirmakes the check fire when the user is on the default location.(Also removed dead commented code but can keep that if preffered.)