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 #8118

Merged
merged 12 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 0 additions & 1 deletion DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,6 @@ graph LR;
npmcli-git-->npm-pick-manifest;
npmcli-git-->npmcli-promise-spawn["@npmcli/promise-spawn"];
npmcli-git-->proc-log;
npmcli-git-->promise-inflight;
npmcli-git-->promise-retry;
npmcli-git-->semver;
npmcli-git-->which;
Expand Down
1 change: 0 additions & 1 deletion node_modules/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@
!/proggy
!/promise-all-reject-late
!/promise-call-limit
!/promise-inflight
!/promise-retry
!/promzard
!/qrcode-terminal
Expand Down
16 changes: 5 additions & 11 deletions node_modules/@npmcli/git/lib/revs.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
const pinflight = require('promise-inflight')
const spawn = require('./spawn.js')
const { LRUCache } = require('lru-cache')
const linesToRevs = require('./lines-to-revs.js')

const revsCache = new LRUCache({
max: 100,
ttl: 5 * 60 * 1000,
})

const linesToRevs = require('./lines-to-revs.js')

module.exports = async (repo, opts = {}) => {
if (!opts.noGitRevCache) {
const cached = revsCache.get(repo)
Expand All @@ -17,12 +15,8 @@ module.exports = async (repo, opts = {}) => {
}
}

return pinflight(`ls-remote:${repo}`, () =>
spawn(['ls-remote', repo], opts)
.then(({ stdout }) => linesToRevs(stdout.trim().split('\n')))
.then(revs => {
revsCache.set(repo, revs)
return revs
})
)
const { stdout } = await spawn(['ls-remote', repo], opts)
const revs = linesToRevs(stdout.trim().split('\n'))
revsCache.set(repo, revs)
return revs
}
9 changes: 4 additions & 5 deletions node_modules/@npmcli/git/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@npmcli/git",
"version": "6.0.1",
"version": "6.0.3",
"main": "lib/index.js",
"files": [
"bin/",
Expand Down Expand Up @@ -32,8 +32,8 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^5.0.0",
"@npmcli/template-oss": "4.23.3",
"npm-package-arg": "^11.0.0",
"@npmcli/template-oss": "4.24.1",
"npm-package-arg": "^12.0.1",
"slash": "^3.0.0",
"tap": "^16.0.1"
},
Expand All @@ -43,7 +43,6 @@
"lru-cache": "^10.0.1",
"npm-pick-manifest": "^10.0.0",
"proc-log": "^5.0.0",
"promise-inflight": "^1.0.1",
"promise-retry": "^2.0.1",
"semver": "^7.3.5",
"which": "^5.0.0"
Expand All @@ -53,7 +52,7 @@
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.23.3",
"version": "4.24.1",
"publish": true
}
}
14 changes: 3 additions & 11 deletions node_modules/@npmcli/redact/lib/deep-map.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
function filterError (input) {
return {
errorType: input.name,
message: input.message,
stack: input.stack,
...(input.code ? { code: input.code } : {}),
...(input.statusCode ? { statusCode: input.statusCode } : {}),
}
}
const { serializeError } = require('./error')

const deepMap = (input, handler = v => v, path = ['$'], seen = new Set([input])) => {
// this is in an effort to maintain bole's error logging behavior
if (path.join('.') === '$' && input instanceof Error) {
return deepMap({ err: filterError(input) }, handler, path, seen)
return deepMap({ err: serializeError(input) }, handler, path, seen)
}
if (input instanceof Error) {
return deepMap(filterError(input), handler, path, seen)
return deepMap(serializeError(input), handler, path, seen)
}
if (input instanceof Buffer) {
return `[unable to log instanceof buffer]`
Expand Down
28 changes: 28 additions & 0 deletions node_modules/@npmcli/redact/lib/error.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/** takes an error object and serializes it to a plan object */
function serializeError (input) {
if (!(input instanceof Error)) {
if (typeof input === 'string') {
const error = new Error(`attempted to serialize a non-error, string String, "${input}"`)
return serializeError(error)
}
const error = new Error(`attempted to serialize a non-error, ${typeof input} ${input?.constructor?.name}`)
return serializeError(error)
}
// different error objects store status code differently
// AxiosError uses `status`, other services use `statusCode`
const statusCode = input.statusCode ?? input.status
// CAUTION: what we serialize here gets add to the size of logs
return {
errorType: input.errorType ?? input.constructor.name,
...(input.message ? { message: input.message } : {}),
...(input.stack ? { stack: input.stack } : {}),
// think of this as error code
...(input.code ? { code: input.code } : {}),
// think of this as http status code
...(statusCode ? { statusCode } : {}),
}
}

module.exports = {
serializeError,
}
25 changes: 24 additions & 1 deletion node_modules/@npmcli/redact/lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const {
redactMatchers,
} = require('./utils')

const { serializeError } = require('./error')

const { deepMap } = require('./deep-map')

const _redact = redactMatchers(
Expand All @@ -31,4 +33,25 @@ const _redact = redactMatchers(

const redact = (input) => deepMap(input, (value, path) => _redact(value, { path }))

module.exports = { redact }
/** takes an error returns new error keeping some custom properties */
function redactError (input) {
const { message, ...data } = serializeError(input)
const output = new Error(redact(message))
return Object.assign(output, redact(data))
}

/** runs a function within try / catch and throws error wrapped in redactError */
function redactThrow (func) {
if (typeof func !== 'function') {
throw new Error('redactThrow expects a function')
}
return async (...args) => {
try {
return await func(...args)
} catch (error) {
throw redactError(error)
}
}
}

module.exports = { redact, redactError, redactThrow }
2 changes: 1 addition & 1 deletion node_modules/@npmcli/redact/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@npmcli/redact",
"version": "3.0.0",
"version": "3.1.1",
"description": "Redact sensitive npm information from output",
"main": "lib/index.js",
"exports": {
Expand Down
4 changes: 2 additions & 2 deletions node_modules/@sigstore/bundle/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sigstore/bundle",
"version": "3.0.0",
"version": "3.1.0",
"description": "Sigstore bundle type",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -27,7 +27,7 @@
"provenance": true
},
"dependencies": {
"@sigstore/protobuf-specs": "^0.3.2"
"@sigstore/protobuf-specs": "^0.4.0"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,88 +1,58 @@
"use strict";
/* eslint-disable */
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc v5.29.3
// source: envelope.proto
Object.defineProperty(exports, "__esModule", { value: true });
exports.Signature = exports.Envelope = void 0;
function createBaseEnvelope() {
return { payload: Buffer.alloc(0), payloadType: "", signatures: [] };
}
exports.Envelope = {
fromJSON(object) {
return {
payload: isSet(object.payload) ? Buffer.from(bytesFromBase64(object.payload)) : Buffer.alloc(0),
payloadType: isSet(object.payloadType) ? String(object.payloadType) : "",
signatures: Array.isArray(object?.signatures) ? object.signatures.map((e) => exports.Signature.fromJSON(e)) : [],
payloadType: isSet(object.payloadType) ? globalThis.String(object.payloadType) : "",
signatures: globalThis.Array.isArray(object?.signatures)
? object.signatures.map((e) => exports.Signature.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
message.payload !== undefined &&
(obj.payload = base64FromBytes(message.payload !== undefined ? message.payload : Buffer.alloc(0)));
message.payloadType !== undefined && (obj.payloadType = message.payloadType);
if (message.signatures) {
obj.signatures = message.signatures.map((e) => e ? exports.Signature.toJSON(e) : undefined);
if (message.payload.length !== 0) {
obj.payload = base64FromBytes(message.payload);
}
if (message.payloadType !== "") {
obj.payloadType = message.payloadType;
}
else {
obj.signatures = [];
if (message.signatures?.length) {
obj.signatures = message.signatures.map((e) => exports.Signature.toJSON(e));
}
return obj;
},
};
function createBaseSignature() {
return { sig: Buffer.alloc(0), keyid: "" };
}
exports.Signature = {
fromJSON(object) {
return {
sig: isSet(object.sig) ? Buffer.from(bytesFromBase64(object.sig)) : Buffer.alloc(0),
keyid: isSet(object.keyid) ? String(object.keyid) : "",
keyid: isSet(object.keyid) ? globalThis.String(object.keyid) : "",
};
},
toJSON(message) {
const obj = {};
message.sig !== undefined && (obj.sig = base64FromBytes(message.sig !== undefined ? message.sig : Buffer.alloc(0)));
message.keyid !== undefined && (obj.keyid = message.keyid);
if (message.sig.length !== 0) {
obj.sig = base64FromBytes(message.sig);
}
if (message.keyid !== "") {
obj.keyid = message.keyid;
}
return obj;
},
};
var tsProtoGlobalThis = (() => {
if (typeof globalThis !== "undefined") {
return globalThis;
}
if (typeof self !== "undefined") {
return self;
}
if (typeof window !== "undefined") {
return window;
}
if (typeof global !== "undefined") {
return global;
}
throw "Unable to locate global object";
})();
function bytesFromBase64(b64) {
if (tsProtoGlobalThis.Buffer) {
return Uint8Array.from(tsProtoGlobalThis.Buffer.from(b64, "base64"));
}
else {
const bin = tsProtoGlobalThis.atob(b64);
const arr = new Uint8Array(bin.length);
for (let i = 0; i < bin.length; ++i) {
arr[i] = bin.charCodeAt(i);
}
return arr;
}
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
}
function base64FromBytes(arr) {
if (tsProtoGlobalThis.Buffer) {
return tsProtoGlobalThis.Buffer.from(arr).toString("base64");
}
else {
const bin = [];
arr.forEach((byte) => {
bin.push(String.fromCharCode(byte));
});
return tsProtoGlobalThis.btoa(bin.join(""));
}
return globalThis.Buffer.from(arr).toString("base64");
}
function isSet(value) {
return value !== null && value !== undefined;
Expand Down
Loading
Loading