Skip to content

Commit

Permalink
Fix: Make stripColor to be available again on reporter.format (yarnpk…
Browse files Browse the repository at this point in the history
…g#4518)

**Summary**
This is a bugfix for the following error which happens on master

```
❯ yarn outdated
yarn outdated v1.0.2
error An unexpected error occurred: "this.format.stripColor is not a function".
info If you think this is a bug, please open a bug report with the information provided in "/Users/danieltschinder/Documents/ResearchGate/PHP/community/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/outdated for documentation about this command.
```


chalk 2.0 removed stripColor see https://github.com/chalk/chalk/releases/tag/v2.0.0 and this wasn't respected in yarnpkg#4482

**Test plan**

Manual verification.
  • Loading branch information
danez authored and joaolucasl committed Oct 27, 2017
1 parent 5717cc8 commit 2f01936
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"request-capture-har": "^1.2.2",
"rimraf": "^2.5.0",
"semver": "^5.1.0",
"strip-ansi": "^4.0.0",
"strip-bom": "^3.0.0",
"tar-fs": "^1.15.1",
"tar-stream": "^1.5.2",
Expand Down
2 changes: 2 additions & 0 deletions src/reporters/console/console-reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import inquirer from 'inquirer';
const {inspect} = require('util');
const readline = require('readline');
const chalk = require('chalk');
const stripAnsi = require('strip-ansi');
const read = require('read');
const tty = require('tty');

Expand All @@ -40,6 +41,7 @@ export default class ConsoleReporter extends BaseReporter {
this._lastCategorySize = 0;
this._spinners = new Set();
this.format = (chalk: any);
this.format.stripColor = stripAnsi;
this.isSilent = !!opts.isSilent;
}

Expand Down
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ ansi-regex@^2.0.0, ansi-regex@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"

ansi-regex@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"

ansi-styles@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
Expand Down Expand Up @@ -4437,6 +4441,12 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1:
dependencies:
ansi-regex "^2.0.0"

strip-ansi@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f"
dependencies:
ansi-regex "^3.0.0"

strip-bom-stream@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/strip-bom-stream/-/strip-bom-stream-2.0.0.tgz#f87db5ef2613f6968aa545abfe1ec728b6a829ca"
Expand Down

0 comments on commit 2f01936

Please sign in to comment.