Skip to content

refactor: replace uuid dep with Node.js built-in `crypto.randomUUID…#26

Merged
NanashiTheNameless merged 1 commit into
NanashiTheNameless:mainfrom
peter-evans:main
May 6, 2026
Merged

refactor: replace uuid dep with Node.js built-in `crypto.randomUUID…#26
NanashiTheNameless merged 1 commit into
NanashiTheNameless:mainfrom
peter-evans:main

Conversation

@NanashiTheNameless

Copy link
Copy Markdown
Owner

…` (peter-evans#4377)

Replace the third-party uuid package with the native crypto.randomUUID() function available in Node.js, reducing the bundle size and external dependencies.

  • Remove uuid from dependencies in package.json
  • Replace import {v4 as uuidv4} from 'uuid' with import {randomUUID} from 'crypto' in src/create-or-update-branch.ts
  • Replace all uuidv4() calls with randomUUID() in __test__/create-or-update-branch.int.test.ts
  • Rebuild dist/index.js, removing ~680 lines of bundled uuid library code
  • Update package-lock.json to reflect removed dependency

#4377)

Replace the third-party `uuid` package with the native `crypto.randomUUID()`
function available in Node.js, reducing the bundle size and external
dependencies.

- Remove `uuid` from `dependencies` in `package.json`
- Replace `import {v4 as uuidv4} from 'uuid'` with `import {randomUUID} from 'crypto'` in `src/create-or-update-branch.ts`
- Replace all `uuidv4()` calls with `randomUUID()` in `__test__/create-or-update-branch.int.test.ts`
- Rebuild `dist/index.js`, removing ~680 lines of bundled `uuid` library code
- Update `package-lock.json` to reflect removed dependency
Copilot AI review requested due to automatic review settings May 6, 2026 14:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the third-party uuid dependency and uses Node.js’ built-in crypto.randomUUID() for generating temporary branch names and test data, reducing bundled code and external dependencies for the GitHub Action.

Changes:

  • Replace uuid usage with crypto.randomUUID() in the branch creation logic and integration tests.
  • Remove uuid from package.json and update package-lock.json accordingly.
  • Rebuild dist/index.js to eliminate bundled uuid code.

Reviewed changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/create-or-update-branch.ts Switches temporary branch name generation from uuidv4() to randomUUID().
__test__/create-or-update-branch.int.test.ts Updates integration tests to use randomUUID() instead of uuidv4() for generated content/messages.
package.json Removes uuid from runtime dependencies.
package-lock.json Updates lockfile to reflect removal of uuid and associated dependency graph changes.
dist/index.js Rebuilt bundle: replaces uuid require with crypto and removes bundled uuid implementation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@NanashiTheNameless NanashiTheNameless merged commit 49bdc8e into NanashiTheNameless:main May 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants