@socketsecurity/cli-with-sentry 0.15.56 → 0.15.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +59 -32
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +3 -3
- package/dist/constants.js.map +1 -1
- package/dist/types/commands/scan/handle-reach-scan.d.mts +1 -1
- package/dist/types/commands/scan/handle-reach-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/scan-reachability.d.mts +1 -1
- package/dist/types/commands/scan/scan-reachability.d.mts.map +1 -1
- package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts.map +1 -1
- package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts +4 -1
- package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts.map +1 -1
- package/dist/types/commands/threat-feed/handle-threat-feed.d.mts +4 -1
- package/dist/types/commands/threat-feed/handle-threat-feed.d.mts.map +1 -1
- package/dist/vendor.js +21 -21
- package/external/@coana-tech/cli/cli.mjs +2 -2
- package/external/@socketsecurity/registry/external/@npmcli/package-json/index.js +9 -4
- package/external/@socketsecurity/registry/external/@socketregistry/yocto-spinner.js +115 -132
- package/external/@socketsecurity/registry/external/@yarnpkg/extensions.js +18 -0
- package/external/@socketsecurity/registry/external/browserslist.js +662 -658
- package/external/@socketsecurity/registry/external/cacache.js +5 -3
- package/external/@socketsecurity/registry/external/libnpmpack.js +9 -4
- package/external/@socketsecurity/registry/external/make-fetch-happen.js +5 -3
- package/external/@socketsecurity/registry/external/npm-package-arg.js +4 -1
- package/external/@socketsecurity/registry/external/pacote.js +9 -4
- package/external/@socketsecurity/registry/external/validate-npm-package-name.js +4 -1
- package/external/@socketsecurity/registry/manifest.json +4 -4
- package/external/blessed-contrib/lib/widget/charts/line.js +5 -5
- package/package.json +7 -7
|
@@ -196,19 +196,18 @@ function requireYoctoSpinner() {
|
|
|
196
196
|
return _stripVTControlCharacters(string)
|
|
197
197
|
}
|
|
198
198
|
class YoctoSpinner {
|
|
199
|
-
#color
|
|
200
|
-
#currentFrame = -1
|
|
201
|
-
#exitHandlerBound
|
|
202
199
|
#frames
|
|
203
|
-
#indention = ''
|
|
204
200
|
#interval
|
|
201
|
+
#currentFrame = -1
|
|
202
|
+
#timer
|
|
203
|
+
#text
|
|
204
|
+
#stream
|
|
205
|
+
#color
|
|
206
|
+
#lines = 0
|
|
207
|
+
#exitHandlerBound
|
|
205
208
|
#isInteractive
|
|
206
209
|
#lastSpinnerFrameTime = 0
|
|
207
|
-
#
|
|
208
|
-
#signal
|
|
209
|
-
#stream
|
|
210
|
-
#text
|
|
211
|
-
#timer
|
|
210
|
+
#isSpinning = false
|
|
212
211
|
constructor(options = {}) {
|
|
213
212
|
const opts = {
|
|
214
213
|
__proto__: null,
|
|
@@ -216,114 +215,82 @@ function requireYoctoSpinner() {
|
|
|
216
215
|
}
|
|
217
216
|
const spinner = opts.spinner ?? getDefaultSpinner()
|
|
218
217
|
const stream = opts.stream ?? getProcess().stderr
|
|
219
|
-
this.#color = opts.color ?? 'cyan'
|
|
220
|
-
this.#exitHandlerBound = this.#exitHandler.bind(this)
|
|
221
218
|
this.#frames = spinner.frames
|
|
222
|
-
this.#interval = spinner.interval
|
|
219
|
+
this.#interval = spinner.interval
|
|
220
|
+
this.#text = options.text ?? ''
|
|
221
|
+
this.#stream = stream ?? process.stderr
|
|
222
|
+
this.#color = options.color ?? 'cyan'
|
|
223
223
|
this.#isInteractive = !!stream.isTTY && isProcessInteractive()
|
|
224
|
-
this.#
|
|
225
|
-
this.#stream = stream
|
|
226
|
-
this.#text = opts.text ?? ''
|
|
227
|
-
}
|
|
228
|
-
#clearTimer() {
|
|
229
|
-
clearInterval(this.#timer)
|
|
230
|
-
this.#timer = undefined
|
|
224
|
+
this.#exitHandlerBound = this.#exitHandler.bind(this)
|
|
231
225
|
}
|
|
232
|
-
|
|
226
|
+
start(text) {
|
|
227
|
+
if (text) {
|
|
228
|
+
this.#text = text
|
|
229
|
+
}
|
|
233
230
|
if (this.isSpinning) {
|
|
234
|
-
this
|
|
231
|
+
return this
|
|
235
232
|
}
|
|
236
|
-
|
|
237
|
-
|
|
233
|
+
this.#isSpinning = true
|
|
234
|
+
this.#hideCursor()
|
|
235
|
+
this.#render()
|
|
236
|
+
this.#subscribeToProcessEvents()
|
|
237
|
+
|
|
238
|
+
// Only start the timer in interactive mode
|
|
238
239
|
if (this.#isInteractive) {
|
|
239
|
-
this.#
|
|
240
|
+
this.#timer = setInterval(() => {
|
|
241
|
+
this.#render()
|
|
242
|
+
}, this.#interval)
|
|
240
243
|
}
|
|
244
|
+
return this
|
|
241
245
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
let lineCount = 0
|
|
246
|
-
for (const line of lines) {
|
|
247
|
-
lineCount += Math.max(1, Math.ceil(line.length / width))
|
|
248
|
-
}
|
|
249
|
-
return lineCount
|
|
250
|
-
}
|
|
251
|
-
#render() {
|
|
252
|
-
// Ensure we only update the spinner frame at the wanted interval,
|
|
253
|
-
// even if the frame method is called more often.
|
|
254
|
-
const now = Date.now()
|
|
255
|
-
if (
|
|
256
|
-
this.#currentFrame === -1 ||
|
|
257
|
-
now - this.#lastSpinnerFrameTime >= this.#interval
|
|
258
|
-
) {
|
|
259
|
-
this.#currentFrame = (this.#currentFrame + 1) % this.#frames.length
|
|
260
|
-
this.#lastSpinnerFrameTime = now
|
|
246
|
+
stop(finalText) {
|
|
247
|
+
if (!this.isSpinning) {
|
|
248
|
+
return this
|
|
261
249
|
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
if (string) {
|
|
267
|
-
if (this.#indention.length) {
|
|
268
|
-
string = `${this.#indention}${string}`
|
|
269
|
-
}
|
|
270
|
-
if (!this.#isInteractive) {
|
|
271
|
-
string += '\n'
|
|
272
|
-
}
|
|
250
|
+
this.#isSpinning = false
|
|
251
|
+
if (this.#timer) {
|
|
252
|
+
clearInterval(this.#timer)
|
|
253
|
+
this.#timer = undefined
|
|
273
254
|
}
|
|
255
|
+
this.#showCursor()
|
|
274
256
|
this.clear()
|
|
275
|
-
this.#
|
|
276
|
-
if (
|
|
277
|
-
this.#
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
#setTimer() {
|
|
281
|
-
const timeout = setInterval(() => {
|
|
282
|
-
this.#render()
|
|
283
|
-
}, this.#interval)
|
|
284
|
-
// Guard unref usage in case yocto-spinner is somehow built to run in a browser.
|
|
285
|
-
// https://nodejs.org/api/timers.html#timeoutunref
|
|
286
|
-
timeout?.unref?.()
|
|
287
|
-
this.#timer = timeout
|
|
288
|
-
}
|
|
289
|
-
#showCursor() {
|
|
290
|
-
if (this.#isInteractive) {
|
|
291
|
-
this.#write('\u001B[?25h')
|
|
257
|
+
this.#unsubscribeFromProcessEvents()
|
|
258
|
+
if (finalText) {
|
|
259
|
+
this.#stream.write(`${finalText}\n`)
|
|
292
260
|
}
|
|
293
|
-
|
|
294
|
-
#subscribeToExitEvents() {
|
|
295
|
-
this.#signal?.addEventListener('abort', this.#exitHandlerBound)
|
|
296
|
-
process.once('SIGINT', this.#exitHandlerBound)
|
|
297
|
-
process.once('SIGTERM', this.#exitHandlerBound)
|
|
261
|
+
return this
|
|
298
262
|
}
|
|
299
263
|
#symbolStop(symbolType, text) {
|
|
300
264
|
const symbols = getLogSymbols()
|
|
301
265
|
return this.stop(`${symbols[symbolType]} ${text ?? this.#text}`)
|
|
302
266
|
}
|
|
303
|
-
|
|
304
|
-
this.#
|
|
305
|
-
process.off('SIGINT', this.#exitHandlerBound)
|
|
306
|
-
process.off('SIGTERM', this.#exitHandlerBound)
|
|
267
|
+
success(text) {
|
|
268
|
+
return this.#symbolStop('success', text)
|
|
307
269
|
}
|
|
308
|
-
|
|
309
|
-
this.#
|
|
270
|
+
error(text) {
|
|
271
|
+
return this.#symbolStop('error', text)
|
|
310
272
|
}
|
|
311
|
-
|
|
312
|
-
return this.#
|
|
273
|
+
warning(text) {
|
|
274
|
+
return this.#symbolStop('warning', text)
|
|
313
275
|
}
|
|
314
|
-
|
|
315
|
-
this.#
|
|
316
|
-
this.#render()
|
|
276
|
+
info(text) {
|
|
277
|
+
return this.#symbolStop('info', text)
|
|
317
278
|
}
|
|
318
279
|
get isSpinning() {
|
|
319
|
-
return this.#
|
|
280
|
+
return this.#isSpinning
|
|
320
281
|
}
|
|
321
282
|
get text() {
|
|
322
283
|
return this.#text
|
|
323
284
|
}
|
|
324
285
|
set text(value) {
|
|
325
|
-
|
|
326
|
-
this.#
|
|
286
|
+
this.#text = value ?? ''
|
|
287
|
+
this.#render()
|
|
288
|
+
}
|
|
289
|
+
get color() {
|
|
290
|
+
return this.#color
|
|
291
|
+
}
|
|
292
|
+
set color(value) {
|
|
293
|
+
this.#color = value
|
|
327
294
|
this.#render()
|
|
328
295
|
}
|
|
329
296
|
clear() {
|
|
@@ -331,7 +298,7 @@ function requireYoctoSpinner() {
|
|
|
331
298
|
return this
|
|
332
299
|
}
|
|
333
300
|
this.#stream.cursorTo(0)
|
|
334
|
-
for (let index = 0; index < this.#lines; index
|
|
301
|
+
for (let index = 0; index < this.#lines; index++) {
|
|
335
302
|
if (index > 0) {
|
|
336
303
|
this.#stream.moveCursor(0, -1)
|
|
337
304
|
}
|
|
@@ -340,55 +307,71 @@ function requireYoctoSpinner() {
|
|
|
340
307
|
this.#lines = 0
|
|
341
308
|
return this
|
|
342
309
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
310
|
+
#render() {
|
|
311
|
+
// Ensure we only update the spinner frame at the wanted interval,
|
|
312
|
+
// even if the frame method is called more often.
|
|
313
|
+
const now = Date.now()
|
|
314
|
+
if (
|
|
315
|
+
this.#currentFrame === -1 ||
|
|
316
|
+
now - this.#lastSpinnerFrameTime >= this.#interval
|
|
317
|
+
) {
|
|
318
|
+
this.#currentFrame = ++this.#currentFrame % this.#frames.length
|
|
319
|
+
this.#lastSpinnerFrameTime = now
|
|
320
|
+
}
|
|
321
|
+
const colors = getYoctocolors()
|
|
322
|
+
const applyColor = colors[this.#color] ?? colors.cyan
|
|
323
|
+
const frame = this.#frames[this.#currentFrame]
|
|
324
|
+
let string = `${applyColor(frame)} ${this.#text}`
|
|
325
|
+
if (!this.#isInteractive) {
|
|
326
|
+
string += '\n'
|
|
327
|
+
}
|
|
328
|
+
this.clear()
|
|
329
|
+
this.#write(string)
|
|
330
|
+
if (this.#isInteractive) {
|
|
331
|
+
this.#lines = this.#lineCount(string)
|
|
332
|
+
}
|
|
356
333
|
}
|
|
357
|
-
|
|
358
|
-
this.#
|
|
359
|
-
return this
|
|
334
|
+
#write(text) {
|
|
335
|
+
this.#stream.write(text)
|
|
360
336
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
337
|
+
#lineCount(text) {
|
|
338
|
+
const width = this.#stream.columns ?? defaultTtyColumns
|
|
339
|
+
const lines = stripVTControlCharacters(text).split('\n')
|
|
340
|
+
let lineCount = 0
|
|
341
|
+
for (const line of lines) {
|
|
342
|
+
lineCount += Math.max(1, Math.ceil(line.length / width))
|
|
367
343
|
}
|
|
368
|
-
|
|
369
|
-
this.#render()
|
|
370
|
-
this.#setTimer()
|
|
371
|
-
this.#subscribeToExitEvents()
|
|
372
|
-
return this
|
|
344
|
+
return lineCount
|
|
373
345
|
}
|
|
374
|
-
|
|
375
|
-
if (
|
|
376
|
-
|
|
346
|
+
#hideCursor() {
|
|
347
|
+
if (this.#isInteractive) {
|
|
348
|
+
this.#write('\u001B[?25l')
|
|
377
349
|
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
this.#
|
|
381
|
-
|
|
382
|
-
if (finalText) {
|
|
383
|
-
this.#write(`${this.#indention}${finalText}\n`)
|
|
350
|
+
}
|
|
351
|
+
#showCursor() {
|
|
352
|
+
if (this.#isInteractive) {
|
|
353
|
+
this.#write('\u001B[?25h')
|
|
384
354
|
}
|
|
385
|
-
return this
|
|
386
355
|
}
|
|
387
|
-
|
|
388
|
-
|
|
356
|
+
#subscribeToProcessEvents() {
|
|
357
|
+
process.once('SIGINT', this.#exitHandlerBound)
|
|
358
|
+
process.once('SIGTERM', this.#exitHandlerBound)
|
|
389
359
|
}
|
|
390
|
-
|
|
391
|
-
|
|
360
|
+
#unsubscribeFromProcessEvents() {
|
|
361
|
+
process.off('SIGINT', this.#exitHandlerBound)
|
|
362
|
+
process.off('SIGTERM', this.#exitHandlerBound)
|
|
363
|
+
}
|
|
364
|
+
#exitHandler(signal) {
|
|
365
|
+
if (this.isSpinning) {
|
|
366
|
+
this.stop()
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// SIGINT: 128 + 2
|
|
370
|
+
// SIGTERM: 128 + 15
|
|
371
|
+
const exitCode =
|
|
372
|
+
signal === 'SIGINT' ? 130 : signal === 'SIGTERM' ? 143 : 1
|
|
373
|
+
// eslint-disable-next-line n/no-process-exit
|
|
374
|
+
process.exit(exitCode)
|
|
392
375
|
}
|
|
393
376
|
}
|
|
394
377
|
yoctoSpinner = function yoctoSpinner(options) {
|
|
@@ -1378,6 +1378,24 @@ function requireLib() {
|
|
|
1378
1378
|
csstype: `^3.0.10`
|
|
1379
1379
|
}
|
|
1380
1380
|
}
|
|
1381
|
+
],
|
|
1382
|
+
// https://github.com/fastify/fastify-type-provider-typebox/issues/114
|
|
1383
|
+
// https://github.com/fastify/fastify-type-provider-typebox/pull/165
|
|
1384
|
+
[
|
|
1385
|
+
`@fastify/type-provider-typebox@^5.0.0`,
|
|
1386
|
+
{
|
|
1387
|
+
peerDependencies: {
|
|
1388
|
+
fastify: `^5.0.0`
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
],
|
|
1392
|
+
[
|
|
1393
|
+
`@fastify/type-provider-typebox@^4.0.0`,
|
|
1394
|
+
{
|
|
1395
|
+
peerDependencies: {
|
|
1396
|
+
fastify: `^4.0.0`
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1381
1399
|
]
|
|
1382
1400
|
]
|
|
1383
1401
|
return lib
|