@yarnpkg/core
Advanced tools
Comparing version 3.2.0-rc.12 to 3.2.0-rc.13
@@ -191,3 +191,3 @@ "use strict"; | ||
type: SettingsType.BOOLEAN, | ||
default: !ci_info_1.isCI && process.stdout.isTTY && process.stdout.columns > 22, | ||
default: !ci_info_1.isCI, | ||
defaultText: `<dynamic>`, | ||
@@ -194,0 +194,0 @@ }, |
@@ -100,2 +100,4 @@ "use strict"; | ||
this.progressTimeout = null; | ||
this.progressStyle = null; | ||
this.progressMaxScaledSize = null; | ||
this.forgettableLines = []; | ||
@@ -111,9 +113,12 @@ formatUtils.addLogFilterSupport(this, { configuration }); | ||
this.stdout = stdout; | ||
const styleName = this.configuration.get(`progressBarStyle`) || defaultStyle; | ||
if (!Object.prototype.hasOwnProperty.call(PROGRESS_STYLES, styleName)) | ||
throw new Error(`Assertion failed: Invalid progress bar style`); | ||
this.progressStyle = PROGRESS_STYLES[styleName]; | ||
const PAD_LEFT = `➤ YN0000: ┌ `.length; | ||
const maxWidth = Math.max(0, Math.min(process.stdout.columns - PAD_LEFT, 80)); | ||
this.progressMaxScaledSize = Math.floor(this.progressStyle.size * maxWidth / 80); | ||
// Setup progress | ||
if (configuration.get(`enableProgressBars`) && !json && stdout.isTTY && stdout.columns > 22) { | ||
const styleName = configuration.get(`progressBarStyle`) || defaultStyle; | ||
if (!Object.prototype.hasOwnProperty.call(PROGRESS_STYLES, styleName)) | ||
throw new Error(`Assertion failed: Invalid progress bar style`); | ||
this.progressStyle = PROGRESS_STYLES[styleName]; | ||
const PAD_LEFT = `➤ YN0000: ┌ `.length; | ||
const maxWidth = Math.max(0, Math.min(stdout.columns - PAD_LEFT, 80)); | ||
this.progressMaxScaledSize = Math.floor(this.progressStyle.size * maxWidth / 80); | ||
} | ||
} | ||
@@ -329,2 +334,4 @@ static async start(opts, cb) { | ||
reportProgress(progressIt) { | ||
if (this.progressStyle === null) | ||
return { ...Promise.resolve(), stop: () => { } }; | ||
if (progressIt.hasProgress && progressIt.hasTitle) | ||
@@ -447,3 +454,3 @@ throw new Error(`Unimplemented: Progress bars can't have both progress and titles.`); | ||
clearProgress({ delta = 0, clear = false }) { | ||
if (!this.configuration.get(`enableProgressBars`) || this.json) | ||
if (this.progressStyle === null) | ||
return; | ||
@@ -458,3 +465,3 @@ if (this.progress.size + delta > 0) { | ||
writeProgress() { | ||
if (!this.configuration.get(`enableProgressBars`) || this.json) | ||
if (this.progressStyle === null) | ||
return; | ||
@@ -515,3 +522,3 @@ if (this.progressTimeout !== null) | ||
truncate(str, { truncate } = {}) { | ||
if (!this.configuration.get(`enableProgressBars`)) | ||
if (this.progressStyle === null) | ||
truncate = false; | ||
@@ -523,3 +530,3 @@ if (typeof truncate === `undefined`) | ||
if (truncate) | ||
str = (0, slice_ansi_1.default)(str, 0, process.stdout.columns - 1); | ||
str = (0, slice_ansi_1.default)(str, 0, this.stdout.columns - 1); | ||
return str; | ||
@@ -526,0 +533,0 @@ } |
{ | ||
"name": "@yarnpkg/core", | ||
"version": "3.2.0-rc.12", | ||
"version": "3.2.0-rc.13", | ||
"license": "BSD-2-Clause", | ||
@@ -11,8 +11,8 @@ "main": "./lib/index.js", | ||
"@types/treeify": "^1.0.0", | ||
"@yarnpkg/fslib": "^2.6.1-rc.7", | ||
"@yarnpkg/fslib": "^2.6.1-rc.8", | ||
"@yarnpkg/json-proxy": "^2.1.1", | ||
"@yarnpkg/libzip": "^2.2.3-rc.7", | ||
"@yarnpkg/parsers": "^2.5.0-rc.10", | ||
"@yarnpkg/pnp": "^3.1.1-rc.12", | ||
"@yarnpkg/shell": "^3.2.0-rc.10", | ||
"@yarnpkg/libzip": "^2.2.3-rc.8", | ||
"@yarnpkg/parsers": "^2.5.0-rc.11", | ||
"@yarnpkg/pnp": "^3.1.1-rc.13", | ||
"@yarnpkg/shell": "^3.2.0-rc.11", | ||
"camelcase": "^5.3.1", | ||
@@ -52,6 +52,6 @@ "chalk": "^3.0.0", | ||
"@types/tunnel": "^0.0.0", | ||
"@yarnpkg/cli": "^3.2.0-rc.12", | ||
"@yarnpkg/cli": "^3.2.0-rc.13", | ||
"@yarnpkg/plugin-link": "^2.2.0", | ||
"@yarnpkg/plugin-npm": "^2.7.0-rc.5", | ||
"@yarnpkg/plugin-pnp": "^3.2.0-rc.2", | ||
"@yarnpkg/plugin-npm": "^2.7.0-rc.6", | ||
"@yarnpkg/plugin-pnp": "^3.2.0-rc.3", | ||
"esbuild": "npm:esbuild-wasm@^0.11.20", | ||
@@ -58,0 +58,0 @@ "rollup": "^2.59.0", |
Sorry, the diff of this file is too big to display
746802
13219
Updated@yarnpkg/fslib@^2.6.1-rc.8
Updated@yarnpkg/libzip@^2.2.3-rc.8
Updated@yarnpkg/pnp@^3.1.1-rc.13
Updated@yarnpkg/shell@^3.2.0-rc.11