Repository navigation
chore(utils): replace uuid dependency with crypto.randomUUID - #10758
Open
avantikonde wants to merge 1 commit into
Open
avantikonde wants to merge 1 commit into
avantikonde wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
@metamask/utilswas declaringuuidas a production dependency solely for generating temporary test directory paths increateSandbox()insrc/fs.ts.uuidV4()with Node's built-incrypto.randomUUID(), which has been standard since Node 14.17 and is natively supported in the required Node version range (^22.14.0 || ^24).uuidfrompackages/utils/package.jsondependencies, removing an unnecessary package from consumer dependency trees.packages/utils/src/fs.test.tsto mockcrypto.randomUUIDusingjest.spyOnso test sandbox paths remain deterministic.oxlintsuppressions and updatedpackages/utils/CHANGELOG.md.References
Fixes #10210
Checklist
Note
Low Risk
Small dependency swap in Node-only test sandbox path generation; supported Node engines already require versions with
crypto.randomUUID().Overview
Removes the
uuidproduction dependency from@metamask/utilsand uses Node’s built-incrypto.randomUUID()whencreateSandbox()builds unique temp directory names infs.ts.Tests in
fs.test.tsnow stubcrypto.randomUUIDwithjest.spyOninstead of mocking theuuidpackage. The package changelog documents the removal,package.json/yarn.lockno longer listuuid, and relatedoxlintsuppression counts were trimmed.Reviewed by Cursor Bugbot for commit 76aa19e. Bugbot is set up for automated code reviews on this repo. Configure here.