Skip to content

refactor: replace uuid dep with Node.js built-in crypto.randomUUID#4377

Merged
peter-evans merged 1 commit intomainfrom
replace_uuid
May 6, 2026
Merged

refactor: replace uuid dep with Node.js built-in crypto.randomUUID#4377
peter-evans merged 1 commit intomainfrom
replace_uuid

Conversation

@peter-evans
Copy link
Copy Markdown
Owner

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

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
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Full test suite slash command (repository admin only)

/test repository=peter-evans/create-pull-request ref=replace_uuid build=true
/test repository=peter-evans/create-pull-request ref=replace_uuid build=true sign-commits=true

@peter-evans
Copy link
Copy Markdown
Owner Author

peter-evans commented May 6, 2026

/test repository=peter-evans/create-pull-request ref=replace_uuid build=true

Command run output

@peter-evans
Copy link
Copy Markdown
Owner Author

peter-evans commented May 6, 2026

/test repository=peter-evans/create-pull-request ref=replace_uuid

Command run output

@peter-evans
Copy link
Copy Markdown
Owner Author

peter-evans commented May 6, 2026

/test repository=peter-evans/create-pull-request ref=replace_uuid sign-commits=true

Command run output

@peter-evans peter-evans merged commit aa523f9 into main May 6, 2026
6 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.

1 participant