Skip to content

Commit da276cb

Browse files
authored
refactor: replace external uuid with crypto.randomUUID() (#666)
- fixes a security vulnerability alert coming from the `uuid` package - also removed a local `package-lock.json` that `@netlify/types` had. this is a monorepo, so that package is locked via the root `package-lock.json`
1 parent c81cf89 commit da276cb

4 files changed

Lines changed: 2 additions & 2125 deletions

File tree

package-lock.json

Lines changed: 0 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/dev-utils/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
"parse-gitignore": "^2.0.0",
6969
"semver": "^7.7.2",
7070
"tmp-promise": "^3.0.3",
71-
"uuid": "^13.0.0",
7271
"write-file-atomic": "^5.0.1"
7372
}
7473
}

packages/dev-utils/src/lib/global-config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import crypto from 'node:crypto'
12
import fs from 'node:fs/promises'
23
import fss from 'node:fs'
34
import path from 'node:path'
45
import * as dot from 'dot-prop'
56

6-
import { v4 as uuidv4 } from 'uuid'
77
import { sync as writeFileAtomicSync } from 'write-file-atomic'
88

99
import { getLegacyPathInHome, getPathInHome } from './paths.js'
@@ -70,7 +70,7 @@ const globalConfigDefaults = {
7070
/* disable stats from being sent to Netlify */
7171
telemetryDisabled: false,
7272
/* cliId */
73-
cliId: uuidv4(),
73+
cliId: crypto.randomUUID(),
7474
}
7575

7676
// Memoise config result so that we only load it once

0 commit comments

Comments
 (0)