Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps updates #7362

Merged
merged 3 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 32 additions & 8 deletions node_modules/@npmcli/package-json/lib/normalize.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
const valid = require('semver/functions/valid')
const clean = require('semver/functions/clean')
const fs = require('fs/promises')
const { glob } = require('glob')
const path = require('path')
const log = require('proc-log')
const hostedGitInfo = require('hosted-git-info')

/**
* @type {import('hosted-git-info')}
*/
let _hostedGitInfo
function lazyHostedGitInfo () {
if (!_hostedGitInfo) {
_hostedGitInfo = require('hosted-git-info')
}
return _hostedGitInfo
}

/**
* @type {import('glob').glob}
*/
let _glob
function lazyLoadGlob () {
if (!_glob) {
_glob = require('glob').glob
}
return _glob
}

// used to be npm-normalize-package-bin
function normalizePackageBin (pkg, changes) {
Expand Down Expand Up @@ -206,7 +226,7 @@ const normalize = async (pkg, { strict, steps, root, changes, allowLegacyCase })
// add "install" attribute if any "*.gyp" files exist
if (steps.includes('gypfile')) {
if (!scripts.install && !scripts.preinstall && data.gypfile !== false) {
const files = await glob('*.gyp', { cwd: pkg.path })
const files = await lazyLoadGlob()('*.gyp', { cwd: pkg.path })
if (files.length) {
scripts.install = 'node-gyp rebuild'
data.scripts = scripts
Expand Down Expand Up @@ -273,7 +293,11 @@ const normalize = async (pkg, { strict, steps, root, changes, allowLegacyCase })
// populate "readme" attribute
if (steps.includes('readme') && !data.readme) {
const mdre = /\.m?a?r?k?d?o?w?n?$/i
const files = await glob('{README,README.*}', { cwd: pkg.path, nocase: true, mark: true })
const files = await lazyLoadGlob()('{README,README.*}', {
cwd: pkg.path,
nocase: true,
mark: true,
})
let readmeFile
for (const file of files) {
// don't accept directories.
Expand Down Expand Up @@ -304,7 +328,7 @@ const normalize = async (pkg, { strict, steps, root, changes, allowLegacyCase })
if (steps.includes('mans') && !data.man && data.directories?.man) {
const manDir = data.directories.man
const cwd = path.resolve(pkg.path, manDir)
const files = await glob('**/*.[0-9]', { cwd })
const files = await lazyLoadGlob()('**/*.[0-9]', { cwd })
data.man = files.map(man =>
path.relative(pkg.path, path.join(cwd, man)).split(path.sep).join('/')
)
Expand All @@ -317,7 +341,7 @@ const normalize = async (pkg, { strict, steps, root, changes, allowLegacyCase })
// expand "directories.bin"
if (steps.includes('binDir') && data.directories?.bin && !data.bin) {
const binsDir = path.resolve(pkg.path, path.join('.', path.join('/', data.directories.bin)))
const bins = await glob('**', { cwd: binsDir })
const bins = await lazyLoadGlob()('**', { cwd: binsDir })
data.bin = bins.reduce((acc, binFile) => {
if (binFile && !binFile.startsWith('.')) {
const binName = path.basename(binFile)
Expand Down Expand Up @@ -445,7 +469,7 @@ const normalize = async (pkg, { strict, steps, root, changes, allowLegacyCase })
}
}
if (data.repository.url) {
const hosted = hostedGitInfo.fromUrl(data.repository.url)
const hosted = lazyHostedGitInfo().fromUrl(data.repository.url)
let r
if (hosted) {
if (hosted.getDefaultRepresentation() === 'shortcut') {
Expand Down Expand Up @@ -505,7 +529,7 @@ const normalize = async (pkg, { strict, steps, root, changes, allowLegacyCase })
changes?.push(`Removed invalid "${deps}.${d}"`)
delete data[deps][d]
}
const hosted = hostedGitInfo.fromUrl(data[deps][d])?.toString()
const hosted = lazyHostedGitInfo().fromUrl(data[deps][d])?.toString()
if (hosted && hosted !== data[deps][d]) {
changes?.push(`Normalized git reference to "${deps}.${d}"`)
data[deps][d] = hosted.toString()
Expand Down
2 changes: 1 addition & 1 deletion node_modules/@npmcli/package-json/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@npmcli/package-json",
"version": "5.0.1",
"version": "5.0.2",
"description": "Programmatic API to update package.json",
"main": "lib/index.js",
"files": [
Expand Down
6 changes: 5 additions & 1 deletion node_modules/socks/build/common/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ function ipToBuffer(ip) {
else if (net.isIPv6(ip)) {
// Handle IPv6 addresses
const address = new ip_address_1.Address6(ip);
return Buffer.from(address.toByteArray());
return Buffer.from(address
.canonicalForm()
.split(':')
.map((segment) => segment.padStart(4, '0'))
.join(''), 'hex');
}
else {
throw new Error('Invalid IP address format');
Expand Down
2 changes: 1 addition & 1 deletion node_modules/socks/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "socks",
"private": false,
"version": "2.8.2",
"version": "2.8.3",
"description": "Fully featured SOCKS proxy client supporting SOCKSv4, SOCKSv4a, and SOCKSv5. Includes Bind and Associate functionality.",
"main": "build/index.js",
"typings": "typings/index.d.ts",
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"@npmcli/config": "^8.0.2",
"@npmcli/fs": "^3.1.0",
"@npmcli/map-workspaces": "^3.0.4",
"@npmcli/package-json": "^5.0.1",
"@npmcli/package-json": "^5.0.2",
"@npmcli/promise-spawn": "^7.0.1",
"@npmcli/redact": "^1.1.0",
"@npmcli/run-script": "^7.0.4",
Expand Down Expand Up @@ -1805,9 +1805,9 @@
}
},
"node_modules/@npmcli/package-json": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@npmcli/package-json/-/package-json-5.0.1.tgz",
"integrity": "sha512-WdwGsRP/do+94IXEgfD/oGGVn0VDS+wYM8MoXU5tJ+02Ke8ePSobMwnfcCHAfcvU/pFwZxyZYWaJdOBsqXRAbA==",
"version": "5.0.2",
"resolved": "https://registry.npmjs.org/@npmcli/package-json/-/package-json-5.0.2.tgz",
"integrity": "sha512-LmW+tueGSK+FCM3OpcKtwKKo3igpefh6HHiw23sGd8OdJ8l0GrfGfVdGOFVtJRMaXVnvI1RUdEPlB9VUln5Wbw==",
"inBundle": true,
"dependencies": {
"@npmcli/git": "^5.0.0",
Expand Down Expand Up @@ -12163,9 +12163,9 @@
}
},
"node_modules/socks": {
"version": "2.8.2",
"resolved": "https://registry.npmjs.org/socks/-/socks-2.8.2.tgz",
"integrity": "sha512-5Hvyu6Md91ooZzdrN/bSn/zlulFaRHrk2/6IY6qQNa3oVHTiG+CKxBV5PynKCGf31ar+3/hyPvlHFAYaBEOa3A==",
"version": "2.8.3",
"resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz",
"integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==",
"inBundle": true,
"dependencies": {
"ip-address": "^9.0.5",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"@npmcli/config": "^8.0.2",
"@npmcli/fs": "^3.1.0",
"@npmcli/map-workspaces": "^3.0.4",
"@npmcli/package-json": "^5.0.1",
"@npmcli/package-json": "^5.0.2",
"@npmcli/promise-spawn": "^7.0.1",
"@npmcli/redact": "^1.1.0",
"@npmcli/run-script": "^7.0.4",
Expand Down
Loading