Skip to content

Commit

Permalink
Bump undici from 5.28.4 to 5.28.5 (#33)
Browse files Browse the repository at this point in the history
Bumps [undici](https://github.com/nodejs/undici) from 5.28.4 to 5.28.5.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sean Middleditch <[email protected]>
  • Loading branch information
dependabot[bot] and seanmiddleditch authored Feb 1, 2025
1 parent 7fa4bc0 commit 3b1f8f9
Show file tree
Hide file tree
Showing 2 changed files with 142 additions and 126 deletions.
262 changes: 139 additions & 123 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14748,6 +14748,14 @@ const { isUint8Array, isArrayBuffer } = __nccwpck_require__(9830)
const { File: UndiciFile } = __nccwpck_require__(8511)
const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)

let random
try {
const crypto = __nccwpck_require__(6005)
random = (max) => crypto.randomInt(0, max)
} catch {
random = (max) => Math.floor(Math.random(max))
}

let ReadableStream = globalThis.ReadableStream

/** @type {globalThis['File']} */
Expand Down Expand Up @@ -14833,7 +14841,7 @@ function extractBody (object, keepalive = false) {
// Set source to a copy of the bytes held by object.
source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
} else if (util.isFormDataLike(object)) {
const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}`
const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`
const prefix = `--${boundary}\r\nContent-Disposition: form-data`

/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
Expand Down Expand Up @@ -29614,6 +29622,14 @@ module.exports = require("net");

/***/ }),

/***/ 6005:
/***/ ((module) => {

"use strict";
module.exports = require("node:crypto");

/***/ }),

/***/ 5673:
/***/ ((module) => {

Expand Down Expand Up @@ -31424,128 +31440,128 @@ module.exports = parseParams
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
const core = __nccwpck_require__(2186)
const process = __nccwpck_require__(7282)
const spawn = (__nccwpck_require__(2081).spawnSync)
const path = __nccwpck_require__(1017)
const fs = __nccwpck_require__(7147)
const URL = (__nccwpck_require__(7310).URL)
const { https } = __nccwpck_require__(7707)
const AdmZip = __nccwpck_require__(6761)
const HttpsProxyAgent = __nccwpck_require__(7219)

function selectPlatform(platform, version) {
if (platform) {
return [null, platform]
}

let major, minor, patch = version.split('.').map((s) => parseInt(s))
if (process.platform === 'win32') {
if (process.arch === 'arm64') {
if (major < 1 || major == 1 && minor < 12) {
return [new Error(`Windows ARM builds are only available for 1.12.0 and later`), '']
}
else {
return [null, 'winarm64']
}
}
else if (process.arch === 'x64') {
return [null, 'win']
}
else {
return [new Error(`Unsupported architecture '${process.arch}'`), '']
}
}
else if (process.platform === 'linux') {
if (process.arch === 'arm64') {
if (major < 1 || major == 1 && minor < 12) {
return [new Error(`Linux ARM builds are only available for 1.12.0 and later`), '']
}
else {
return [null, 'linux-aarch64']
}
}
else if (process.arch === 'x64') {
return [null, 'linux']
}
else {
return [new Error(`Unsupported architecture '${process.arch}'`), '']
}
}
else if (process.platform === 'darwin') {
return [null, 'mac']
}
else {
return [new Error(`Unsupported platform '${process.platform}'`), '']
}
}

try {
const version = core.getInput('version', {required: true})
const destDir = core.getInput('destination') || 'ninja-build'
const proxyServer = core.getInput('http_proxy')

const [error, platform] = selectPlatform(core.getInput('platform'), version)
if (error) throw error

const url = new URL(`https://github.com/ninja-build/ninja/releases/download/v${version}/ninja-${platform}.zip`)

if (proxyServer) {
console.log(`using proxy ${proxyServer}`)
url.agent = new HttpsProxyAgent(proxyServer)
}

console.log(`downloading ${url}`)
const request = https.get(url, {followAllRedirects: true}, result => {
const data = []

result.on('data', chunk => data.push(chunk))

result.on('end', () => {
const length = data.reduce((len, chunk) => len + chunk.length, 0)
const buffer = Buffer.alloc(length)

data.reduce((pos, chunk) => {
chunk.copy(buffer, pos)
return pos + chunk.length
}, 0)

const zip = new AdmZip(buffer)
const entry = zip.getEntries()[0]
const ninjaName = entry.entryName

const fullDestDir = path.resolve(process.cwd(), destDir)
if (!fs.existsSync(fullDestDir)) fs.mkdirSync(fullDestDir, {recursive: true})

zip.extractEntryTo(ninjaName, fullDestDir, /*maintainEntryPath*/false, /*overwrite*/true)

const fullFileDir = path.join(fullDestDir, ninjaName)
if (!fs.existsSync(fullFileDir)) throw new Error(`failed to extract to '${fullFileDir}'`)

fs.chmodSync(fullFileDir, '755')

console.log(`extracted '${ninjaName}' to '${fullFileDir}'`)

core.addPath(fullDestDir)
console.log(`added '${fullDestDir}' to PATH`)

const result = spawn(ninjaName, ['--version'], {encoding: 'utf8'})
if (result.error) throw error

const installedVersion = result.stdout.trim()

console.log(`$ ${ninjaName} --version`)
console.log(installedVersion)

if (installedVersion != version) {
throw new Error('incorrect version detected (bad PATH configuration?)')
}
})
})
request.on('error', error => { throw error })
} catch (error) {
core.setFailed(error.message)
}
const core = __nccwpck_require__(2186)
const process = __nccwpck_require__(7282)
const spawn = (__nccwpck_require__(2081).spawnSync)
const path = __nccwpck_require__(1017)
const fs = __nccwpck_require__(7147)
const URL = (__nccwpck_require__(7310).URL)
const { https } = __nccwpck_require__(7707)
const AdmZip = __nccwpck_require__(6761)
const HttpsProxyAgent = __nccwpck_require__(7219)
function selectPlatform(platform, version) {
if (platform) {
return [null, platform]
}
let major, minor, patch = version.split('.').map((s) => parseInt(s))
if (process.platform === 'win32') {
if (process.arch === 'arm64') {
if (major < 1 || major == 1 && minor < 12) {
return [new Error(`Windows ARM builds are only available for 1.12.0 and later`), '']
}
else {
return [null, 'winarm64']
}
}
else if (process.arch === 'x64') {
return [null, 'win']
}
else {
return [new Error(`Unsupported architecture '${process.arch}'`), '']
}
}
else if (process.platform === 'linux') {
if (process.arch === 'arm64') {
if (major < 1 || major == 1 && minor < 12) {
return [new Error(`Linux ARM builds are only available for 1.12.0 and later`), '']
}
else {
return [null, 'linux-aarch64']
}
}
else if (process.arch === 'x64') {
return [null, 'linux']
}
else {
return [new Error(`Unsupported architecture '${process.arch}'`), '']
}
}
else if (process.platform === 'darwin') {
return [null, 'mac']
}
else {
return [new Error(`Unsupported platform '${process.platform}'`), '']
}
}
try {
const version = core.getInput('version', {required: true})
const destDir = core.getInput('destination') || 'ninja-build'
const proxyServer = core.getInput('http_proxy')
const [error, platform] = selectPlatform(core.getInput('platform'), version)
if (error) throw error
const url = new URL(`https://github.com/ninja-build/ninja/releases/download/v${version}/ninja-${platform}.zip`)
if (proxyServer) {
console.log(`using proxy ${proxyServer}`)
url.agent = new HttpsProxyAgent(proxyServer)
}
console.log(`downloading ${url}`)
const request = https.get(url, {followAllRedirects: true}, result => {
const data = []
result.on('data', chunk => data.push(chunk))
result.on('end', () => {
const length = data.reduce((len, chunk) => len + chunk.length, 0)
const buffer = Buffer.alloc(length)
data.reduce((pos, chunk) => {
chunk.copy(buffer, pos)
return pos + chunk.length
}, 0)
const zip = new AdmZip(buffer)
const entry = zip.getEntries()[0]
const ninjaName = entry.entryName
const fullDestDir = path.resolve(process.cwd(), destDir)
if (!fs.existsSync(fullDestDir)) fs.mkdirSync(fullDestDir, {recursive: true})
zip.extractEntryTo(ninjaName, fullDestDir, /*maintainEntryPath*/false, /*overwrite*/true)
const fullFileDir = path.join(fullDestDir, ninjaName)
if (!fs.existsSync(fullFileDir)) throw new Error(`failed to extract to '${fullFileDir}'`)
fs.chmodSync(fullFileDir, '755')
console.log(`extracted '${ninjaName}' to '${fullFileDir}'`)
core.addPath(fullDestDir)
console.log(`added '${fullDestDir}' to PATH`)
const result = spawn(ninjaName, ['--version'], {encoding: 'utf8'})
if (result.error) throw error
const installedVersion = result.stdout.trim()
console.log(`$ ${ninjaName} --version`)
console.log(installedVersion)
if (installedVersion != version) {
throw new Error('incorrect version detected (bad PATH configuration?)')
}
})
})
request.on('error', error => { throw error })
} catch (error) {
core.setFailed(error.message)
}

})();

Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3b1f8f9

Please sign in to comment.