refactor: replace external uuid with crypto.randomUUID()#7040
refactor: replace external uuid with crypto.randomUUID()#7040AviVahl wants to merge 1 commit intonetlify:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
💤 Files with no reviewable changes (2)
✅ Files skipped from review due to trivial changes (4)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR removes the Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/edge-bundler/node/bundler.ts (1)
1-1: Optional: prefer thenode:protocol for the builtin import.Using
node:cryptomakes it explicit that this is a Node builtin (helps bundlers and readers, avoids any chance of shadowing by a userlandcryptopackage). Same applies inpackages/build/src/plugins/ipc.jsandpackages/edge-bundler/node/server/server.test.ts.♻️ Suggested change
-import crypto from 'crypto' +import { randomUUID } from 'node:crypto'…and update the call site:
- const buildID = crypto.randomUUID() + const buildID = randomUUID()🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/edge-bundler/node/bundler.ts` at line 1, The import uses the generic builtin path ("import crypto from 'crypto'") which can be shadowed; change it to the explicit Node builtin specifier by importing from "node:crypto" instead and update any related call sites that reference the imported symbol (e.g., the top-level import statement that defines crypto and uses like crypto.randomBytes in bundler.ts and the analogous imports in the IPC plugin and server tests) so they continue to reference the same symbol name; ensure all three occurrences replace 'crypto' with 'node:crypto' while keeping the imported identifier (crypto) unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/edge-bundler/node/bundler.ts`:
- Line 1: The import uses the generic builtin path ("import crypto from
'crypto'") which can be shadowed; change it to the explicit Node builtin
specifier by importing from "node:crypto" instead and update any related call
sites that reference the imported symbol (e.g., the top-level import statement
that defines crypto and uses like crypto.randomBytes in bundler.ts and the
analogous imports in the IPC plugin and server tests) so they continue to
reference the same symbol name; ensure all three occurrences replace 'crypto'
with 'node:crypto' while keeping the imported identifier (crypto) unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 24db2caa-b0b8-4d89-97de-55ef517d97f0
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (7)
packages/build/package.jsonpackages/build/src/plugins/ipc.jspackages/edge-bundler/node/bundler.tspackages/edge-bundler/node/server/server.test.tspackages/edge-bundler/package.jsonpackages/js-client/package.jsonpackages/js-client/src/index.test.ts
💤 Files with no reviewable changes (2)
- packages/js-client/package.json
- packages/build/package.json
older versions of uuid have a security vulnerability. newer version are esm-only. replaced with node's built-in crypto.randomUUID()
ebcfb92 to
34877ab
Compare
Summary
older versions of
uuidhave a security vulnerability. newer version are esm-only.replaced with node's built-in
crypto.randomUUID()