[utils] Replace the `uuid` dependency with `crypto.randomUUID()`
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, typescript
Research direction
Start with the single call site in packages/utils/src/fs.ts:244 and read the related fs.test.ts, especially its uuid module spy. Remove the production and development uuid dependencies from packages/utils and update the test to cover the generated temporary directory path without that spy. Run fs.test.ts and verify the dependency entries are gone from consumers' trees.
Written by the indexing model from the issue text.
Description
Carried over from https://github.com/MetaMask/utils/pull/289, which was open when @metamask/utils moved into core.
packages/utils declares uuid@^9.0.1 as a production dependency and @types/uuid@^9.0.8 as a dev dependency, for a single call site:
// packages/utils/src/fs.ts:244
const directoryPath = path.join(os.tmpdir(), projectName, uuidV4());
crypto.randomUUID() has been available since Node 14.17 and the package requires Node 22, so the dependency can go. That also drops @types/uuid and one entry from every consumer's tree.
fs.test.ts currently spies on the module (jest.spyOn(uuid, 'v4')), so the test needs reworking alongside it.
- Dominant language
- TypeScript
- Stars
- 413
- Forks
- 308
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 253
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MetaMask/core
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
category-documentation github-migration-triaged team-wallet-framework wf-documentation
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100