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

Fixed issue #1123 extra color for bolded text in the output #5023

Closed
wants to merge 5 commits into from
Closed
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
2 changes: 1 addition & 1 deletion __tests__/__snapshots__/integration.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ exports[`yarnrc-args 1`] = `
{\\"type\\":\\"step\\",\\"data\\":{\\"message\\":\\"Building fresh packages\\",\\"current\\":4,\\"total\\":4}}
{\\"type\\":\\"success\\",\\"data\\":\\"Saved lockfile.\\"}
{\\"type\\":\\"success\\",\\"data\\":\\"Saved 1 new dependency.\\"}
{\\"type\\":\\"tree\\",\\"data\\":{\\"type\\":\\"newDependencies\\",\\"trees\\":[{\\"name\\":\\"left-pad@1.1.3\\",\\"children\\":[],\\"hint\\":null,\\"color\\":null,\\"depth\\":0}]}}"
{\\"type\\":\\"tree\\",\\"data\\":{\\"type\\":\\"newDependencies\\",\\"trees\\":[{\\"name\\":\\"left-pad@1.2.0\\",\\"children\\":[],\\"hint\\":null,\\"color\\":null,\\"depth\\":0}]}}"
`;
51 changes: 48 additions & 3 deletions __tests__/__snapshots__/normalize-manifest.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,132 +2,161 @@

exports[`author object normalize 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;

exports[`author string 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;

exports[`authors file to contributors 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;

exports[`bin string 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"foo: No license field",
]
`;

exports[`binding.gyp scripts.install 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;

exports[`bugs string 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;

exports[`bundledDependencies alias 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;

exports[`clean version 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;

exports[`clean version with v 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;

exports[`contributors array expand 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;

exports[`dedupe all trivial dependencies 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;

exports[`dedupe dependencies 1`] = `Array []`;
exports[`dedupe dependencies 1`] = `
Array [
"../../../../../../../../package.json: No license field",
]
`;

exports[`dedupe dependencies root 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
"\\"dependencies\\" has dependency \\"foobar\\" with range \\"2.0.0\\" that collides with a dependency in \\"devDependencies\\" of the same name with version \\"1.0.0\\"",
]
`;

exports[`dedupe optionalDependencies 1`] = `Array []`;
exports[`dedupe optionalDependencies 1`] = `
Array [
"../../../../../../../../package.json: No license field",
]
`;

exports[`dedupe optionalDependencies root 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
"\\"optionalDependencies\\" has dependency \\"foobar\\" with range \\"1.0.0\\" that collides with a dependency in \\"dependencies\\" of the same name with version \\"2.0.0\\"",
]
`;

exports[`dedupe single trivial dependency 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;

exports[`engines array 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;

exports[`explode directories.bin 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;

exports[`explode directories.man 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;

exports[`extract description 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;

exports[`homepage string 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;

exports[`hosted git repository url 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;

exports[`keywords string 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;
Expand All @@ -136,75 +165,91 @@ exports[`license warnings should not be thrown with global commands 1`] = `Array

exports[`maintainers array expand 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;

exports[`man string 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;

exports[`name 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"foobar: No license field",
]
`;

exports[`readme 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;

exports[`repository string 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;

exports[`scoped bin string 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"@scope/foo: No license field",
]
`;

exports[`server scripts.start 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;

exports[`valid license 1`] = `Array []`;
exports[`valid license 1`] = `
Array [
"../../../../../../../../package.json: No license field",
]
`;

exports[`version 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"No license field",
]
`;

exports[`warn builtin module collision 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"fs: \\"fs\\" is also the name of a node core module",
"fs: No license field",
]
`;

exports[`warn empty string invalid license 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"License should be a valid SPDX license expression",
]
`;

exports[`warn invalid license 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"License should be a valid SPDX license expression",
]
`;

exports[`warn typo 1`] = `
Array [
"../../../../../../../../package.json: No license field",
"Potential typo \\"dependancies\\", did you mean \\"dependencies\\"?",
"No license field",
]
Expand Down
2 changes: 2 additions & 0 deletions __tests__/commands/__snapshots__/licenses.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

exports[`lists all licenses of the dependencies with the --json argument 1`] = `
"{\\"type\\":\\"warning\\",\\"data\\":\\"package.json: No license field\\"}
{\\"type\\":\\"warning\\",\\"data\\":\\"..\\\\\\\\..\\\\\\\\..\\\\\\\\..\\\\\\\\package.json: No license field\\"}
{\\"type\\":\\"warning\\",\\"data\\":\\"No license field\\"}
{\\"type\\":\\"tree\\",\\"data\\":{\\"type\\":\\"licenses\\",\\"trees\\":[{\\"name\\":\\"[email protected]\\",\\"children\\":[{\\"name\\":\\"License: MIT\\"},{\\"name\\":\\"URL: https://github.com/sindresorhus/is-plain-obj.git\\"}]}]}}
"
`;

exports[`should generate disclaimer on demand 1`] = `
"{\\"type\\":\\"warning\\",\\"data\\":\\"package.json: No license field\\"}
{\\"type\\":\\"warning\\",\\"data\\":\\"..\\\\\\\\..\\\\\\\\..\\\\\\\\..\\\\\\\\package.json: No license field\\"}
{\\"type\\":\\"warning\\",\\"data\\":\\"No license field\\"}
{\\"type\\":\\"warning\\",\\"data\\":\\"package.json: No license field\\"}
"
Expand Down
10 changes: 10 additions & 0 deletions __tests__/commands/__snapshots__/list.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ Array [
"error": true,
"type": "warning",
},
Object {
"data": "..\\\\..\\\\..\\\\..\\\\package.json: No license field",
"error": true,
"type": "warning",
},
Object {
"data": "No license field",
"error": true,
Expand Down Expand Up @@ -38,6 +43,11 @@ Array [
"error": true,
"type": "warning",
},
Object {
"data": "..\\\\..\\\\..\\\\..\\\\package.json: No license field",
"error": true,
"type": "warning",
},
Object {
"data": "No license field",
"error": true,
Expand Down
22 changes: 11 additions & 11 deletions __tests__/reporters/__snapshots__/console-reporter.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,17 @@ Object {
exports[`ConsoleReporter.tree 1`] = `
Object {
"stderr": "",
"stdout": "├─ dep1
├─ dep2
│ ├─ dep2.1
│ │ ├─ dep2.1.1
│ │ └─ dep2.1.2
│ └─ dep2.2
│ ├─ dep2.2.1
│ └─ dep2.2.2
└─ dep3
├─ dep3.1
└─ dep3.2",
"stdout": "├─ dep1
├─ dep2
│ ├─ dep2.1
│ │ ├─ dep2.1.1
│ │ └─ dep2.1.2
│ └─ dep2.2
│ ├─ dep2.2.1
│ └─ dep2.2.2
└─ dep3
├─ dep3.1
└─ dep3.2",
}
`;

Expand Down
Loading