refactor: replace uuid dep with Node.js built-in crypto.randomUUID (#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
This commit is contained in:
Peter Evans
2026-05-06 12:10:34 +01:00
committed by GitHub
parent d8c15c739f
commit aa523f9db6
5 changed files with 94 additions and 776 deletions
+1 -2
View File
@@ -41,8 +41,7 @@
"@octokit/plugin-throttling": "^9.6.1",
"@octokit/request-error": "^6.1.8",
"node-fetch-native": "^1.6.7",
"p-limit": "^6.2.0",
"uuid": "^9.0.1"
"p-limit": "^6.2.0"
},
"devDependencies": {
"@types/jest": "^29.5.14",