diff options
author | Gar <gar+gh@danger.computer> | 2021-11-16 20:38:03 +0300 |
---|---|---|
committer | Nathan Fritz <fritzy@github.com> | 2021-11-18 22:53:26 +0300 |
commit | 08015859ca0abe47845d2970212cd344cdfc56e6 (patch) | |
tree | 01409f5aa4b4c52b0aad1b3c5d56ecc283c1842b /node_modules | |
parent | 7b4aa59b6630831f25d19c0c15a65acaf3a83327 (diff) |
deps: npmlog@6.0.0
PR-URL: https://github.com/npm/cli/pull/4049
Credit: @wraithgar
Close: #4049
Reviewed-by: @fritzy
Diffstat (limited to 'node_modules')
39 files changed, 855 insertions, 193 deletions
diff --git a/node_modules/gauge/LICENSE b/node_modules/gauge/LICENSE deleted file mode 100644 index e75605296..000000000 --- a/node_modules/gauge/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2014, Rebecca Turner <me@re-becca.org> - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/gauge/LICENSE.md b/node_modules/gauge/LICENSE.md new file mode 100644 index 000000000..5fc208ff1 --- /dev/null +++ b/node_modules/gauge/LICENSE.md @@ -0,0 +1,20 @@ +<!-- This file is automatically added by @npmcli/template-oss. Do not edit. --> + +ISC License + +Copyright npm, Inc. + +Permission to use, copy, modify, and/or distribute this +software for any purpose with or without fee is hereby +granted, provided that the above copyright notice and this +permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO +EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/gauge/base-theme.js b/node_modules/gauge/lib/base-theme.js index 0b67638e0..00bf5684c 100644 --- a/node_modules/gauge/base-theme.js +++ b/node_modules/gauge/lib/base-theme.js @@ -4,11 +4,15 @@ var progressBar = require('./progress-bar.js') module.exports = { activityIndicator: function (values, theme, width) { - if (values.spun == null) return + if (values.spun == null) { + return + } return spin(theme, values.spun) }, progressbar: function (values, theme, width) { - if (values.completed == null) return + if (values.completed == null) { + return + } return progressBar(theme, width, values.completed) - } + }, } diff --git a/node_modules/gauge/lib/demo.js b/node_modules/gauge/lib/demo.js new file mode 100644 index 000000000..88c03cd9a --- /dev/null +++ b/node_modules/gauge/lib/demo.js @@ -0,0 +1,45 @@ +var Gauge = require('./') +var gaugeDefault = require('./themes.js') +var onExit = require('signal-exit') + +var activeGauge + +onExit(function () { + activeGauge.disable() +}) + +var themes = gaugeDefault.getThemeNames() + +nextBar() +function nextBar () { + var themeName = themes.shift() + + console.log('Demoing output for ' + themeName) + + var gt = new Gauge(process.stderr, { + updateInterval: 50, + theme: themeName, + cleanupOnExit: false, + }) + activeGauge = gt + + var progress = 0 + + var cnt = 0 + var pulse = setInterval(function () { + gt.pulse('this is a thing that happened ' + (++cnt)) + }, 110) + var prog = setInterval(function () { + progress += 0.04 + gt.show(themeName + ':' + Math.round(progress * 1000), progress) + if (progress >= 1) { + clearInterval(prog) + clearInterval(pulse) + gt.disable() + if (themes.length) { + nextBar() + } + } + }, 100) + gt.show() +} diff --git a/node_modules/gauge/error.js b/node_modules/gauge/lib/error.js index d9914ba53..d9914ba53 100644 --- a/node_modules/gauge/error.js +++ b/node_modules/gauge/lib/error.js diff --git a/node_modules/gauge/has-color.js b/node_modules/gauge/lib/has-color.js index 16cba0eb4..16cba0eb4 100644 --- a/node_modules/gauge/has-color.js +++ b/node_modules/gauge/lib/has-color.js diff --git a/node_modules/gauge/index.js b/node_modules/gauge/lib/index.js index 87a4bb930..ce9ba7d63 100644 --- a/node_modules/gauge/index.js +++ b/node_modules/gauge/lib/index.js @@ -32,7 +32,7 @@ function Gauge (arg1, arg2) { this._status = { spun: 0, section: '', - subsection: '' + subsection: '', } this._paused = false // are we paused for back pressure? this._disabled = true // are all progress bar updates disabled? @@ -50,10 +50,10 @@ function Gauge (arg1, arg2) { this._theme = options.theme var theme = this._computeTheme(options.theme) var template = options.template || [ - {type: 'progressbar', length: 20}, - {type: 'activityIndicator', kerning: 1, length: 1}, - {type: 'section', kerning: 1, default: ''}, - {type: 'subsection', kerning: 1, default: ''} + { type: 'progressbar', length: 20 }, + { type: 'activityIndicator', kerning: 1, length: 1 }, + { type: 'section', kerning: 1, default: '' }, + { type: 'subsection', kerning: 1, default: '' }, ] this.setWriteTo(writeTo, options.tty) var PlumbingClass = options.Plumbing || Plumbing @@ -79,17 +79,28 @@ Gauge.prototype.isEnabled = function () { Gauge.prototype.setTemplate = function (template) { this._gauge.setTemplate(template) - if (this._showing) this._requestRedraw() + if (this._showing) { + this._requestRedraw() + } } Gauge.prototype._computeTheme = function (theme) { - if (!theme) theme = {} + if (!theme) { + theme = {} + } if (typeof theme === 'string') { theme = this._themes.getTheme(theme) - } else if (theme && (Object.keys(theme).length === 0 || theme.hasUnicode != null || theme.hasColor != null)) { + } else if ( + theme && + (Object.keys(theme).length === 0 || theme.hasUnicode != null || theme.hasColor != null) + ) { var useUnicode = theme.hasUnicode == null ? hasUnicode() : theme.hasUnicode var useColor = theme.hasColor == null ? hasColor : theme.hasColor - theme = this._themes.getDefault({hasUnicode: useUnicode, hasColor: useColor, platform: theme.platform}) + theme = this._themes.getDefault({ + hasUnicode: useUnicode, + hasColor: useColor, + platform: theme.platform, + }) } return theme } @@ -101,13 +112,17 @@ Gauge.prototype.setThemeset = function (themes) { Gauge.prototype.setTheme = function (theme) { this._gauge.setTheme(this._computeTheme(theme)) - if (this._showing) this._requestRedraw() + if (this._showing) { + this._requestRedraw() + } this._theme = theme } Gauge.prototype._requestRedraw = function () { this._needsRedraw = true - if (!this._fixedFramerate) this._doRedraw() + if (!this._fixedFramerate) { + this._doRedraw() + } } Gauge.prototype.getWidth = function () { @@ -116,25 +131,39 @@ Gauge.prototype.getWidth = function () { Gauge.prototype.setWriteTo = function (writeTo, tty) { var enabled = !this._disabled - if (enabled) this.disable() + if (enabled) { + this.disable() + } this._writeTo = writeTo this._tty = tty || (writeTo === process.stderr && process.stdout.isTTY && process.stdout) || (writeTo.isTTY && writeTo) || this._tty - if (this._gauge) this._gauge.setWidth(this.getWidth()) - if (enabled) this.enable() + if (this._gauge) { + this._gauge.setWidth(this.getWidth()) + } + if (enabled) { + this.enable() + } } Gauge.prototype.enable = function () { - if (!this._disabled) return + if (!this._disabled) { + return + } this._disabled = false - if (this._tty) this._enableEvents() - if (this._showing) this.show() + if (this._tty) { + this._enableEvents() + } + if (this._showing) { + this.show() + } } Gauge.prototype.disable = function () { - if (this._disabled) return + if (this._disabled) { + return + } if (this._showing) { this._lastUpdateAt = null this._showing = false @@ -142,7 +171,9 @@ Gauge.prototype.disable = function () { this._showing = true } this._disabled = true - if (this._tty) this._disableEvents() + if (this._tty) { + this._disableEvents() + } } Gauge.prototype._enableEvents = function () { @@ -152,19 +183,29 @@ Gauge.prototype._enableEvents = function () { this._tty.on('resize', this._$$handleSizeChange) if (this._fixedFramerate) { this.redrawTracker = setInterval(this._$$doRedraw, this._updateInterval) - if (this.redrawTracker.unref) this.redrawTracker.unref() + if (this.redrawTracker.unref) { + this.redrawTracker.unref() + } } } Gauge.prototype._disableEvents = function () { this._tty.removeListener('resize', this._$$handleSizeChange) - if (this._fixedFramerate) clearInterval(this.redrawTracker) - if (this._removeOnExit) this._removeOnExit() + if (this._fixedFramerate) { + clearInterval(this.redrawTracker) + } + if (this._removeOnExit) { + this._removeOnExit() + } } Gauge.prototype.hide = function (cb) { - if (this._disabled) return cb && process.nextTick(cb) - if (!this._showing) return cb && process.nextTick(cb) + if (this._disabled) { + return cb && process.nextTick(cb) + } + if (!this._showing) { + return cb && process.nextTick(cb) + } this._showing = false this._doRedraw() cb && setImmediate(cb) @@ -181,16 +222,24 @@ Gauge.prototype.show = function (section, completed) { this._status[key] = section[key] } } - if (completed != null) this._status.completed = completed - if (this._disabled) return + if (completed != null) { + this._status.completed = completed + } + if (this._disabled) { + return + } this._requestRedraw() } Gauge.prototype.pulse = function (subsection) { this._status.subsection = subsection || '' this._status.spun++ - if (this._disabled) return - if (!this._showing) return + if (this._disabled) { + return + } + if (!this._showing) { + return + } this._requestRedraw() } @@ -200,10 +249,14 @@ Gauge.prototype._handleSizeChange = function () { } Gauge.prototype._doRedraw = function () { - if (this._disabled || this._paused) return + if (this._disabled || this._paused) { + return + } if (!this._fixedFramerate) { var now = Date.now() - if (this._lastUpdateAt && now - this._lastUpdateAt < this._updateInterval) return + if (this._lastUpdateAt && now - this._lastUpdateAt < this._updateInterval) { + return + } this._lastUpdateAt = now } if (!this._showing && this._onScreen) { @@ -214,7 +267,9 @@ Gauge.prototype._doRedraw = function () { } return this._writeTo.write(result) } - if (!this._showing && !this._onScreen) return + if (!this._showing && !this._onScreen) { + return + } if (this._showing && !this._onScreen) { this._onScreen = true this._needsRedraw = true @@ -222,7 +277,9 @@ Gauge.prototype._doRedraw = function () { this._writeTo.write(this._gauge.hideCursor()) } } - if (!this._needsRedraw) return + if (!this._needsRedraw) { + return + } if (!this._writeTo.write(this._gauge.show(this._status))) { this._paused = true this._writeTo.on('drain', callWith(this, function () { diff --git a/node_modules/gauge/plumbing.js b/node_modules/gauge/lib/plumbing.js index 1afb4af6d..c4dc3e074 100644 --- a/node_modules/gauge/plumbing.js +++ b/node_modules/gauge/lib/plumbing.js @@ -4,7 +4,9 @@ var renderTemplate = require('./render-template.js') var validate = require('aproba') var Plumbing = module.exports = function (theme, template, width) { - if (!width) width = 80 + if (!width) { + width = 80 + } validate('OAN', [theme, template, width]) this.showing = false this.theme = theme diff --git a/node_modules/gauge/process.js b/node_modules/gauge/lib/process.js index 05e85694d..05e85694d 100644 --- a/node_modules/gauge/process.js +++ b/node_modules/gauge/lib/process.js diff --git a/node_modules/gauge/progress-bar.js b/node_modules/gauge/lib/progress-bar.js index 1780a8a54..184ff2500 100644 --- a/node_modules/gauge/progress-bar.js +++ b/node_modules/gauge/lib/progress-bar.js @@ -6,14 +6,20 @@ var stringWidth = require('string-width') module.exports = function (theme, width, completed) { validate('ONN', [theme, width, completed]) - if (completed < 0) completed = 0 - if (completed > 1) completed = 1 - if (width <= 0) return '' + if (completed < 0) { + completed = 0 + } + if (completed > 1) { + completed = 1 + } + if (width <= 0) { + return '' + } var sofar = Math.round(width * completed) var rest = width - sofar var template = [ - {type: 'complete', value: repeat(theme.complete, sofar), length: sofar}, - {type: 'remaining', value: repeat(theme.remaining, rest), length: rest} + { type: 'complete', value: repeat(theme.complete, sofar), length: sofar }, + { type: 'remaining', value: repeat(theme.remaining, rest), length: rest }, ] return renderTemplate(width, template, theme) } diff --git a/node_modules/gauge/render-template.js b/node_modules/gauge/lib/render-template.js index 9764c6e0a..d1b52c0f4 100644 --- a/node_modules/gauge/render-template.js +++ b/node_modules/gauge/lib/render-template.js @@ -28,7 +28,9 @@ function postType (item) { } function hasPreOrPost (item, values) { - if (!item.type) return + if (!item.type) { + return + } return values[preType(item)] || values[postType(item)] } @@ -39,7 +41,7 @@ function generatePreAndPost (baseItem, parentValues) { var pre = preType(item) var post = postType(item) if (values[pre]) { - template.push({value: values[pre]}) + template.push({ value: values[pre] }) values[pre] = null } item.minLength = null @@ -48,7 +50,7 @@ function generatePreAndPost (baseItem, parentValues) { template.push(item) values[item.type] = values[item.type] if (values[post]) { - template.push({value: values[post]}) + template.push({ value: values[post] }) values[post] = null } return function ($1, $2, length) { @@ -71,47 +73,73 @@ function prepareItems (width, template, values) { cloned.value = values[type] } } - if (cloned.value == null || cloned.value === '') return null + if (cloned.value == null || cloned.value === '') { + return null + } cloned.index = index cloned.first = index === 0 cloned.last = index === arr.length - 1 - if (hasPreOrPost(cloned, values)) cloned.value = generatePreAndPost(cloned, values) + if (hasPreOrPost(cloned, values)) { + cloned.value = generatePreAndPost(cloned, values) + } return cloned } - var output = template.map(cloneAndObjectify).filter(function (item) { return item != null }) + var output = template.map(cloneAndObjectify).filter(function (item) { + return item != null + }) var remainingSpace = width var variableCount = output.length function consumeSpace (length) { - if (length > remainingSpace) length = remainingSpace + if (length > remainingSpace) { + length = remainingSpace + } remainingSpace -= length } function finishSizing (item, length) { - if (item.finished) throw new error.Internal('Tried to finish template item that was already finished') - if (length === Infinity) throw new error.Internal('Length of template item cannot be infinity') - if (length != null) item.length = length + if (item.finished) { + throw new error.Internal('Tried to finish template item that was already finished') + } + if (length === Infinity) { + throw new error.Internal('Length of template item cannot be infinity') + } + if (length != null) { + item.length = length + } item.minLength = null item.maxLength = null --variableCount item.finished = true - if (item.length == null) item.length = item.getBaseLength() - if (item.length == null) throw new error.Internal('Finished template items must have a length') + if (item.length == null) { + item.length = item.getBaseLength() + } + if (item.length == null) { + throw new error.Internal('Finished template items must have a length') + } consumeSpace(item.getLength()) } output.forEach(function (item) { - if (!item.kerning) return + if (!item.kerning) { + return + } var prevPadRight = item.first ? 0 : output[item.index - 1].padRight - if (!item.first && prevPadRight < item.kerning) item.padLeft = item.kerning - prevPadRight - if (!item.last) item.padRight = item.kerning + if (!item.first && prevPadRight < item.kerning) { + item.padLeft = item.kerning - prevPadRight + } + if (!item.last) { + item.padRight = item.kerning + } }) // Finish any that have a fixed (literal or intuited) length output.forEach(function (item) { - if (item.getBaseLength() == null) return + if (item.getBaseLength() == null) { + return + } finishSizing(item) }) @@ -122,34 +150,48 @@ function prepareItems (width, template, values) { resizing = false hunkSize = Math.round(remainingSpace / variableCount) output.forEach(function (item) { - if (item.finished) return - if (!item.maxLength) return + if (item.finished) { + return + } + if (!item.maxLength) { + return + } if (item.getMaxLength() < hunkSize) { finishSizing(item, item.maxLength) resizing = true } }) } while (resizing && resized++ < output.length) - if (resizing) throw new error.Internal('Resize loop iterated too many times while determining maxLength') + if (resizing) { + throw new error.Internal('Resize loop iterated too many times while determining maxLength') + } resized = 0 do { resizing = false hunkSize = Math.round(remainingSpace / variableCount) output.forEach(function (item) { - if (item.finished) return - if (!item.minLength) return + if (item.finished) { + return + } + if (!item.minLength) { + return + } if (item.getMinLength() >= hunkSize) { finishSizing(item, item.minLength) resizing = true } }) } while (resizing && resized++ < output.length) - if (resizing) throw new error.Internal('Resize loop iterated too many times while determining minLength') + if (resizing) { + throw new error.Internal('Resize loop iterated too many times while determining minLength') + } hunkSize = Math.round(remainingSpace / variableCount) output.forEach(function (item) { - if (item.finished) return + if (item.finished) { + return + } finishSizing(item, hunkSize) }) @@ -168,7 +210,9 @@ function renderFunction (item, values, length) { function renderValue (item, values) { var length = item.getBaseLength() var value = typeof item.value === 'function' ? renderFunction(item, values, length) : item.value - if (value == null || value === '') return '' + if (value == null || value === '') { + return '' + } var alignWith = align[item.align] || align.left var leftPadding = item.padLeft ? align.left('', item.padLeft) : '' var rightPadding = item.padRight ? align.right('', item.padRight) : '' diff --git a/node_modules/gauge/set-immediate.js b/node_modules/gauge/lib/set-immediate.js index 6650a485c..6650a485c 100644 --- a/node_modules/gauge/set-immediate.js +++ b/node_modules/gauge/lib/set-immediate.js diff --git a/node_modules/gauge/set-interval.js b/node_modules/gauge/lib/set-interval.js index 576198793..576198793 100644 --- a/node_modules/gauge/set-interval.js +++ b/node_modules/gauge/lib/set-interval.js diff --git a/node_modules/gauge/spin.js b/node_modules/gauge/lib/spin.js index 34142ee31..34142ee31 100644 --- a/node_modules/gauge/spin.js +++ b/node_modules/gauge/lib/spin.js diff --git a/node_modules/gauge/template-item.js b/node_modules/gauge/lib/template-item.js index 4f02fefaa..e307e9b74 100644 --- a/node_modules/gauge/template-item.js +++ b/node_modules/gauge/lib/template-item.js @@ -4,7 +4,9 @@ var stringWidth = require('string-width') module.exports = TemplateItem function isPercent (num) { - if (typeof num !== 'string') return false + if (typeof num !== 'string') { + return false + } return num.slice(-1) === '%' } @@ -30,7 +32,9 @@ function TemplateItem (values, outputLength) { if (typeof values === 'string') { this.value = values } else { - for (var prop in values) this[prop] = values[prop] + for (var prop in values) { + this[prop] = values[prop] + } } // Realize percents if (isPercent(this.length)) { @@ -49,7 +53,12 @@ TemplateItem.prototype = {} TemplateItem.prototype.getBaseLength = function () { var length = this.length - if (length == null && typeof this.value === 'string' && this.maxLength == null && this.minLength == null) { + if ( + length == null && + typeof this.value === 'string' && + this.maxLength == null && + this.minLength == null + ) { length = stringWidth(this.value) } return length @@ -57,16 +66,22 @@ TemplateItem.prototype.getBaseLength = function () { TemplateItem.prototype.getLength = function () { var length = this.getBaseLength() - if (length == null) return null + if (length == null) { + return null + } return length + this.padLeft + this.padRight } TemplateItem.prototype.getMaxLength = function () { - if (this.maxLength == null) return null + if (this.maxLength == null) { + return null + } return this.maxLength + this.padLeft + this.padRight } TemplateItem.prototype.getMinLength = function () { - if (this.minLength == null) return null + if (this.minLength == null) { + return null + } return this.minLength + this.padLeft + this.padRight } diff --git a/node_modules/gauge/theme-set.js b/node_modules/gauge/lib/theme-set.js index c022d61cf..643d7dbb1 100644 --- a/node_modules/gauge/theme-set.js +++ b/node_modules/gauge/lib/theme-set.js @@ -1,5 +1,4 @@ 'use strict' -var objectAssign = require('object-assign') module.exports = function () { return ThemeSetProto.newThemeSet() @@ -14,7 +13,7 @@ ThemeSetProto.newTheme = function (parent, theme) { theme = parent parent = this.baseTheme } - return objectAssign({}, parent, theme) + return Object.assign({}, parent, theme) } ThemeSetProto.getThemeNames = function () { @@ -28,13 +27,15 @@ ThemeSetProto.addTheme = function (name, parent, theme) { ThemeSetProto.addToAllThemes = function (theme) { var themes = this.themes Object.keys(themes).forEach(function (name) { - objectAssign(themes[name], theme) + Object.assign(themes[name], theme) }) - objectAssign(this.baseTheme, theme) + Object.assign(this.baseTheme, theme) } ThemeSetProto.getTheme = function (name) { - if (!this.themes[name]) throw this.newMissingThemeError(name) + if (!this.themes[name]) { + throw this.newMissingThemeError(name) + } return this.themes[name] } @@ -46,17 +47,23 @@ ThemeSetProto.setDefault = function (opts, name) { var platform = opts.platform == null ? 'fallback' : opts.platform var hasUnicode = !!opts.hasUnicode var hasColor = !!opts.hasColor - if (!this.defaults[platform]) this.defaults[platform] = {true: {}, false: {}} + if (!this.defaults[platform]) { + this.defaults[platform] = { true: {}, false: {} } + } this.defaults[platform][hasUnicode][hasColor] = name } ThemeSetProto.getDefault = function (opts) { - if (!opts) opts = {} + if (!opts) { + opts = {} + } var platformName = opts.platform || process.platform var platform = this.defaults[platformName] || this.defaults.fallback var hasUnicode = !!opts.hasUnicode var hasColor = !!opts.hasColor - if (!platform) throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor) + if (!platform) { + throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor) + } if (!platform[hasUnicode][hasColor]) { if (hasUnicode && hasColor && platform[!hasUnicode][hasColor]) { hasUnicode = false @@ -76,7 +83,7 @@ ThemeSetProto.getDefault = function (opts) { if (platform[hasUnicode][hasColor]) { return this.getTheme(platform[hasUnicode][hasColor]) } else { - return this.getDefault(objectAssign({}, opts, {platform: 'fallback'})) + return this.getDefault(Object.assign({}, opts, { platform: 'fallback' })) } } @@ -88,27 +95,28 @@ ThemeSetProto.newMissingThemeError = function newMissingThemeError (name) { return err } -ThemeSetProto.newMissingDefaultThemeError = function newMissingDefaultThemeError (platformName, hasUnicode, hasColor) { - var err = new Error( - 'Could not find a gauge theme for your platform/unicode/color use combo:\n' + +ThemeSetProto.newMissingDefaultThemeError = + function newMissingDefaultThemeError (platformName, hasUnicode, hasColor) { + var err = new Error( + 'Could not find a gauge theme for your platform/unicode/color use combo:\n' + ' platform = ' + platformName + '\n' + ' hasUnicode = ' + hasUnicode + '\n' + ' hasColor = ' + hasColor) - Error.captureStackTrace.call(err, newMissingDefaultThemeError) - err.platform = platformName - err.hasUnicode = hasUnicode - err.hasColor = hasColor - err.code = 'EMISSINGTHEME' - return err -} + Error.captureStackTrace.call(err, newMissingDefaultThemeError) + err.platform = platformName + err.hasUnicode = hasUnicode + err.hasColor = hasColor + err.code = 'EMISSINGTHEME' + return err + } ThemeSetProto.newThemeSet = function () { var themeset = function (opts) { return themeset.getDefault(opts) } - return objectAssign(themeset, ThemeSetProto, { - themes: objectAssign({}, this.themes), - baseTheme: objectAssign({}, this.baseTheme), - defaults: JSON.parse(JSON.stringify(this.defaults || {})) + return Object.assign(themeset, ThemeSetProto, { + themes: Object.assign({}, this.themes), + baseTheme: Object.assign({}, this.baseTheme), + defaults: JSON.parse(JSON.stringify(this.defaults || {})), }) } diff --git a/node_modules/gauge/themes.js b/node_modules/gauge/lib/themes.js index df1184db5..1098ca0e4 100644 --- a/node_modules/gauge/themes.js +++ b/node_modules/gauge/lib/themes.js @@ -9,10 +9,10 @@ themes.addTheme('ASCII', { postProgressbar: ']', progressbarTheme: { complete: '#', - remaining: '.' + remaining: '.', }, activityIndicatorTheme: '-\\|/', - preSubsection: '>' + preSubsection: '>', }) themes.addTheme('colorASCII', themes.getTheme('ASCII'), { @@ -22,8 +22,8 @@ themes.addTheme('colorASCII', themes.getTheme('ASCII'), { postComplete: color('reset'), preRemaining: color('bgBrightBlack', 'brightBlack'), remaining: '.', - postRemaining: color('reset') - } + postRemaining: color('reset'), + }, }) themes.addTheme('brailleSpinner', { @@ -31,10 +31,10 @@ themes.addTheme('brailleSpinner', { postProgressbar: '⸩', progressbarTheme: { complete: '#', - remaining: '⠂' + remaining: '⠂', }, activityIndicatorTheme: '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏', - preSubsection: '>' + preSubsection: '>', }) themes.addTheme('colorBrailleSpinner', themes.getTheme('brailleSpinner'), { @@ -44,13 +44,13 @@ themes.addTheme('colorBrailleSpinner', themes.getTheme('brailleSpinner'), { postComplete: color('reset'), preRemaining: color('bgBrightBlack', 'brightBlack'), remaining: '⠂', - postRemaining: color('reset') - } + postRemaining: color('reset'), + }, }) themes.setDefault({}, 'ASCII') -themes.setDefault({hasColor: true}, 'colorASCII') -themes.setDefault({platform: 'darwin', hasUnicode: true}, 'brailleSpinner') -themes.setDefault({platform: 'darwin', hasUnicode: true, hasColor: true}, 'colorBrailleSpinner') -themes.setDefault({platform: 'linux', hasUnicode: true}, 'brailleSpinner') -themes.setDefault({platform: 'linux', hasUnicode: true, hasColor: true}, 'colorBrailleSpinner') +themes.setDefault({ hasColor: true }, 'colorASCII') +themes.setDefault({ platform: 'darwin', hasUnicode: true }, 'brailleSpinner') +themes.setDefault({ platform: 'darwin', hasUnicode: true, hasColor: true }, 'colorBrailleSpinner') +themes.setDefault({ platform: 'linux', hasUnicode: true }, 'brailleSpinner') +themes.setDefault({ platform: 'linux', hasUnicode: true, hasColor: true }, 'colorBrailleSpinner') diff --git a/node_modules/gauge/wide-truncate.js b/node_modules/gauge/lib/wide-truncate.js index c531bc491..5284a699a 100644 --- a/node_modules/gauge/wide-truncate.js +++ b/node_modules/gauge/lib/wide-truncate.js @@ -5,9 +5,15 @@ var stripAnsi = require('strip-ansi') module.exports = wideTruncate function wideTruncate (str, target) { - if (stringWidth(str) === 0) return str - if (target <= 0) return '' - if (stringWidth(str) <= target) return str + if (stringWidth(str) === 0) { + return str + } + if (target <= 0) { + return '' + } + if (stringWidth(str) <= target) { + return str + } // We compute the number of bytes of ansi sequences here and add // that to our initial truncation to ensure that we don't slice one diff --git a/node_modules/gauge/node_modules/ansi-regex/index.d.ts b/node_modules/gauge/node_modules/ansi-regex/index.d.ts new file mode 100644 index 000000000..2dbf6af2b --- /dev/null +++ b/node_modules/gauge/node_modules/ansi-regex/index.d.ts @@ -0,0 +1,37 @@ +declare namespace ansiRegex { + interface Options { + /** + Match only the first ANSI escape. + + @default false + */ + onlyFirst: boolean; + } +} + +/** +Regular expression for matching ANSI escape codes. + +@example +``` +import ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` +*/ +declare function ansiRegex(options?: ansiRegex.Options): RegExp; + +export = ansiRegex; diff --git a/node_modules/gauge/node_modules/ansi-regex/index.js b/node_modules/gauge/node_modules/ansi-regex/index.js new file mode 100644 index 000000000..616ff837d --- /dev/null +++ b/node_modules/gauge/node_modules/ansi-regex/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = ({onlyFirst = false} = {}) => { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, onlyFirst ? undefined : 'g'); +}; diff --git a/node_modules/gauge/node_modules/ansi-regex/license b/node_modules/gauge/node_modules/ansi-regex/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/gauge/node_modules/ansi-regex/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/gauge/node_modules/ansi-regex/package.json b/node_modules/gauge/node_modules/ansi-regex/package.json new file mode 100644 index 000000000..017f53116 --- /dev/null +++ b/node_modules/gauge/node_modules/ansi-regex/package.json @@ -0,0 +1,55 @@ +{ + "name": "ansi-regex", + "version": "5.0.1", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": "chalk/ansi-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "view-supported": "node fixtures/view-codes.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + } +} diff --git a/node_modules/gauge/node_modules/is-fullwidth-code-point/index.d.ts b/node_modules/gauge/node_modules/is-fullwidth-code-point/index.d.ts new file mode 100644 index 000000000..729d20205 --- /dev/null +++ b/node_modules/gauge/node_modules/is-fullwidth-code-point/index.d.ts @@ -0,0 +1,17 @@ +/** +Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms). + +@param codePoint - The [code point](https://en.wikipedia.org/wiki/Code_point) of a character. + +@example +``` +import isFullwidthCodePoint from 'is-fullwidth-code-point'; + +isFullwidthCodePoint('谢'.codePointAt(0)); +//=> true + +isFullwidthCodePoint('a'.codePointAt(0)); +//=> false +``` +*/ +export default function isFullwidthCodePoint(codePoint: number): boolean; diff --git a/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js b/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js new file mode 100644 index 000000000..671f97f76 --- /dev/null +++ b/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js @@ -0,0 +1,50 @@ +/* eslint-disable yoda */ +'use strict'; + +const isFullwidthCodePoint = codePoint => { + if (Number.isNaN(codePoint)) { + return false; + } + + // Code points are derived from: + // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt + if ( + codePoint >= 0x1100 && ( + codePoint <= 0x115F || // Hangul Jamo + codePoint === 0x2329 || // LEFT-POINTING ANGLE BRACKET + codePoint === 0x232A || // RIGHT-POINTING ANGLE BRACKET + // CJK Radicals Supplement .. Enclosed CJK Letters and Months + (0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F) || + // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A + (0x3250 <= codePoint && codePoint <= 0x4DBF) || + // CJK Unified Ideographs .. Yi Radicals + (0x4E00 <= codePoint && codePoint <= 0xA4C6) || + // Hangul Jamo Extended-A + (0xA960 <= codePoint && codePoint <= 0xA97C) || + // Hangul Syllables + (0xAC00 <= codePoint && codePoint <= 0xD7A3) || + // CJK Compatibility Ideographs + (0xF900 <= codePoint && codePoint <= 0xFAFF) || + // Vertical Forms + (0xFE10 <= codePoint && codePoint <= 0xFE19) || + // CJK Compatibility Forms .. Small Form Variants + (0xFE30 <= codePoint && codePoint <= 0xFE6B) || + // Halfwidth and Fullwidth Forms + (0xFF01 <= codePoint && codePoint <= 0xFF60) || + (0xFFE0 <= codePoint && codePoint <= 0xFFE6) || + // Kana Supplement + (0x1B000 <= codePoint && codePoint <= 0x1B001) || + // Enclosed Ideographic Supplement + (0x1F200 <= codePoint && codePoint <= 0x1F251) || + // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane + (0x20000 <= codePoint && codePoint <= 0x3FFFD) + ) + ) { + return true; + } + + return false; +}; + +module.exports = isFullwidthCodePoint; +module.exports.default = isFullwidthCodePoint; diff --git a/node_modules/gauge/node_modules/is-fullwidth-code-point/license b/node_modules/gauge/node_modules/is-fullwidth-code-point/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/gauge/node_modules/is-fullwidth-code-point/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/gauge/node_modules/is-fullwidth-code-point/package.json b/node_modules/gauge/node_modules/is-fullwidth-code-point/package.json new file mode 100644 index 000000000..2137e888f --- /dev/null +++ b/node_modules/gauge/node_modules/is-fullwidth-code-point/package.json @@ -0,0 +1,42 @@ +{ + "name": "is-fullwidth-code-point", + "version": "3.0.0", + "description": "Check if the character represented by a given Unicode code point is fullwidth", + "license": "MIT", + "repository": "sindresorhus/is-fullwidth-code-point", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd-check" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "fullwidth", + "full-width", + "full", + "width", + "unicode", + "character", + "string", + "codepoint", + "code", + "point", + "is", + "detect", + "check" + ], + "devDependencies": { + "ava": "^1.3.1", + "tsd-check": "^0.5.0", + "xo": "^0.24.0" + } +} diff --git a/node_modules/gauge/node_modules/string-width/index.d.ts b/node_modules/gauge/node_modules/string-width/index.d.ts new file mode 100644 index 000000000..12b530975 --- /dev/null +++ b/node_modules/gauge/node_modules/string-width/index.d.ts @@ -0,0 +1,29 @@ +declare const stringWidth: { + /** + Get the visual width of a string - the number of columns required to display it. + + Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. + + @example + ``` + import stringWidth = require('string-width'); + + stringWidth('a'); + //=> 1 + + stringWidth('古'); + //=> 2 + + stringWidth('\u001B[1m古\u001B[22m'); + //=> 2 + ``` + */ + (string: string): number; + + // TODO: remove this in the next major version, refactor the whole definition to: + // declare function stringWidth(string: string): number; + // export = stringWidth; + default: typeof stringWidth; +} + +export = stringWidth; diff --git a/node_modules/gauge/node_modules/string-width/index.js b/node_modules/gauge/node_modules/string-width/index.js new file mode 100644 index 000000000..f4d261a96 --- /dev/null +++ b/node_modules/gauge/node_modules/string-width/index.js @@ -0,0 +1,47 @@ +'use strict'; +const stripAnsi = require('strip-ansi'); +const isFullwidthCodePoint = require('is-fullwidth-code-point'); +const emojiRegex = require('emoji-regex'); + +const stringWidth = string => { + if (typeof string !== 'string' || string.length === 0) { + return 0; + } + + string = stripAnsi(string); + + if (string.length === 0) { + return 0; + } + + string = string.replace(emojiRegex(), ' '); + + let width = 0; + + for (let i = 0; i < string.length; i++) { + const code = string.codePointAt(i); + + // Ignore control characters + if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { + continue; + } + + // Ignore combining characters + if (code >= 0x300 && code <= 0x36F) { + continue; + } + + // Surrogates + if (code > 0xFFFF) { + i++; + } + + width += isFullwidthCodePoint(code) ? 2 : 1; + } + + return width; +}; + +module.exports = stringWidth; +// TODO: remove this in the next major version +module.exports.default = stringWidth; diff --git a/node_modules/gauge/node_modules/string-width/license b/node_modules/gauge/node_modules/string-width/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/gauge/node_modules/string-width/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/gauge/node_modules/string-width/package.json b/node_modules/gauge/node_modules/string-width/package.json new file mode 100644 index 000000000..28ba7b4ca --- /dev/null +++ b/node_modules/gauge/node_modules/string-width/package.json @@ -0,0 +1,56 @@ +{ + "name": "string-width", + "version": "4.2.3", + "description": "Get the visual width of a string - the number of columns required to display it", + "license": "MIT", + "repository": "sindresorhus/string-width", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "string", + "character", + "unicode", + "width", + "visual", + "column", + "columns", + "fullwidth", + "full-width", + "full", + "ansi", + "escape", + "codes", + "cli", + "command-line", + "terminal", + "console", + "cjk", + "chinese", + "japanese", + "korean", + "fixed-width" + ], + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.1", + "xo": "^0.24.0" + } +} diff --git a/node_modules/gauge/node_modules/strip-ansi/index.d.ts b/node_modules/gauge/node_modules/strip-ansi/index.d.ts new file mode 100644 index 000000000..907fccc29 --- /dev/null +++ b/node_modules/gauge/node_modules/strip-ansi/index.d.ts @@ -0,0 +1,17 @@ +/** +Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string. + +@example +``` +import stripAnsi = require('strip-ansi'); + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` +*/ +declare function stripAnsi(string: string): string; + +export = stripAnsi; diff --git a/node_modules/gauge/node_modules/strip-ansi/index.js b/node_modules/gauge/node_modules/strip-ansi/index.js new file mode 100644 index 000000000..9a593dfcd --- /dev/null +++ b/node_modules/gauge/node_modules/strip-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/node_modules/gauge/node_modules/strip-ansi/license b/node_modules/gauge/node_modules/strip-ansi/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/gauge/node_modules/strip-ansi/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/gauge/node_modules/strip-ansi/package.json b/node_modules/gauge/node_modules/strip-ansi/package.json new file mode 100644 index 000000000..1a41108d4 --- /dev/null +++ b/node_modules/gauge/node_modules/strip-ansi/package.json @@ -0,0 +1,54 @@ +{ + "name": "strip-ansi", + "version": "6.0.1", + "description": "Strip ANSI escape codes from a string", + "license": "MIT", + "repository": "chalk/strip-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.10.0", + "xo": "^0.25.3" + } +} diff --git a/node_modules/gauge/package.json b/node_modules/gauge/package.json index 5635aa179..433958760 100644 --- a/node_modules/gauge/package.json +++ b/node_modules/gauge/package.json @@ -1,66 +1,62 @@ { "name": "gauge", - "version": "3.0.1", - "description": "A terminal based horizontal guage", - "main": "index.js", + "version": "4.0.0", + "description": "A terminal based horizontal gauge", + "main": "lib", "scripts": { - "test": "standard && tap test/*.js --coverage" + "test": "tap", + "lint": "eslint '**/*.js'", + "postlint": "npm-template-check", + "lintfix": "npm run lint -- --fix", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "snap": "tap", + "posttest": "npm run lint" }, "repository": { "type": "git", - "url": "https://github.com/iarna/gauge" + "url": "https://github.com/npm/gauge" }, "keywords": [ "progressbar", "progress", "gauge" ], - "author": "Rebecca Turner <me@re-becca.org>", + "author": "GitHub Inc.", "license": "ISC", "bugs": { "url": "https://github.com/npm/gauge/issues" }, "homepage": "https://github.com/npm/gauge", "dependencies": { + "ansi-regex": "^5.0.1", "aproba": "^1.0.3 || ^2.0.0", "color-support": "^1.1.2", "console-control-strings": "^1.0.0", "has-unicode": "^2.0.1", - "object-assign": "^4.1.1", "signal-exit": "^3.0.0", - "string-width": "^1.0.1 || ^2.0.0", - "strip-ansi": "^3.0.1 || ^4.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", "wide-align": "^1.1.2" }, "devDependencies": { - "readable-stream": "^2.0.6", - "require-inject": "^1.4.0", - "standard": "^11.0.1", - "tap": "^12.0.1", - "through2": "^2.0.0" + "@npmcli/template-oss": "^2.3.0", + "readable-stream": "^3.6.0", + "tap": "^15.0.10" }, "files": [ - "base-theme.js", - "CHANGELOG.md", - "error.js", - "has-color.js", - "index.js", - "LICENSE", - "package.json", - "plumbing.js", - "process.js", - "progress-bar.js", - "README.md", - "render-template.js", - "set-immediate.js", - "set-interval.js", - "spin.js", - "template-item.js", - "theme-set.js", - "themes.js", - "wide-truncate.js" + "bin", + "lib" ], "engines": { - "node": ">=10" - } + "node": "^12.13.0 || ^14.15.0 || >=16" + }, + "tap": { + "branches": 79, + "statements": 89, + "functions": 92, + "lines": 90 + }, + "templateVersion": "2.3.0" } diff --git a/node_modules/npmlog/LICENSE b/node_modules/npmlog/LICENSE deleted file mode 100644 index 19129e315..000000000 --- a/node_modules/npmlog/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/npmlog/LICENSE.md b/node_modules/npmlog/LICENSE.md new file mode 100644 index 000000000..5fc208ff1 --- /dev/null +++ b/node_modules/npmlog/LICENSE.md @@ -0,0 +1,20 @@ +<!-- This file is automatically added by @npmcli/template-oss. Do not edit. --> + +ISC License + +Copyright npm, Inc. + +Permission to use, copy, modify, and/or distribute this +software for any purpose with or without fee is hereby +granted, provided that the above copyright notice and this +permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO +EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/npmlog/log.js b/node_modules/npmlog/lib/log.js index 85ab8a4c7..aec98d7bd 100644 --- a/node_modules/npmlog/log.js +++ b/node_modules/npmlog/lib/log.js @@ -30,11 +30,11 @@ log.useColor = function () { log.enableColor = function () { colorEnabled = true - this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled}) + this.gauge.setTheme({ hasColor: colorEnabled, hasUnicode: unicodeEnabled }) } log.disableColor = function () { colorEnabled = false - this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled}) + this.gauge.setTheme({ hasColor: colorEnabled, hasUnicode: unicodeEnabled }) } // default level @@ -42,13 +42,13 @@ log.level = 'info' log.gauge = new Gauge(stream, { enabled: false, // no progress bars unless asked - theme: {hasColor: log.useColor()}, + theme: { hasColor: log.useColor() }, template: [ - {type: 'progressbar', length: 20}, - {type: 'activityIndicator', kerning: 1, length: 1}, - {type: 'section', default: ''}, + { type: 'progressbar', length: 20 }, + { type: 'activityIndicator', kerning: 1, length: 1 }, + { type: 'section', default: '' }, ':', - {type: 'logline', kerning: 1, default: ''}, + { type: 'logline', kerning: 1, default: '' }, ], }) @@ -62,12 +62,12 @@ var unicodeEnabled log.enableUnicode = function () { unicodeEnabled = true - this.gauge.setTheme({hasColor: this.useColor(), hasUnicode: unicodeEnabled}) + this.gauge.setTheme({ hasColor: this.useColor(), hasUnicode: unicodeEnabled }) } log.disableUnicode = function () { unicodeEnabled = false - this.gauge.setTheme({hasColor: this.useColor(), hasUnicode: unicodeEnabled}) + this.gauge.setTheme({ hasColor: this.useColor(), hasUnicode: unicodeEnabled }) } log.setGaugeThemeset = function (themes) { diff --git a/node_modules/npmlog/package.json b/node_modules/npmlog/package.json index 960ea9250..36abf1e44 100644 --- a/node_modules/npmlog/package.json +++ b/node_modules/npmlog/package.json @@ -1,33 +1,46 @@ { - "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)", + "author": "GitHub Inc.", "name": "npmlog", "description": "logger for npm", - "version": "5.0.1", + "version": "6.0.0", "repository": { "type": "git", "url": "https://github.com/npm/npmlog.git" }, - "main": "log.js", + "main": "lib/log.js", "files": [ - "log.js" + "bin", + "lib" ], "scripts": { - "test": "tap test/*.js --branches=95", + "test": "tap", "npmclilint": "npmcli-lint", - "lint": "npm run npmclilint -- \"*.*js\" \"test/**/*.*js\"", + "lint": "eslint '**/*.js'", "lintfix": "npm run lint -- --fix", - "posttest": "npm run lint --", - "postsnap": "npm run lintfix --" + "posttest": "npm run lint", + "postsnap": "npm run lintfix --", + "postlint": "npm-template-check", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "snap": "tap" }, "dependencies": { "are-we-there-yet": "^2.0.0", "console-control-strings": "^1.1.0", - "gauge": "^3.0.0", + "gauge": "^4.0.0", "set-blocking": "^2.0.0" }, "devDependencies": { - "@npmcli/lint": "^1.0.1", + "@npmcli/template-oss": "^2.3.0", "tap": "^15.0.9" }, - "license": "ISC" + "license": "ISC", + "templateVersion": "2.3.0", + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16" + }, + "tap": { + "branches": 95 + } } |