Skip to content

Commit ff02fd0

Browse files
authored
Modify styling of CLI output (#1598)
* Update styles in commands Specifically, replace all instances of chalk.blue with chalk.cyan, which is more readable in dark mode (the green color we use is basically unreadable in light mode anyway) Additionally, this changes some spacing of the service:list command to allow users to see the URL to navigate to more obviously.
1 parent fe4d46c commit ff02fd0

6 files changed

Lines changed: 22 additions & 21 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- `apollo`
66
- Add sdl download ability to `client:download-schema`
7+
- colors: use cyan instead of blue for text highlighting
78
- `apollo-codegen-flow`
89
- <First `apollo-codegen-flow` related entry goes here>
910
- `apollo-codegen-scala`

packages/apollo/src/commands/client/check.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export default class ClientCheck extends ClientCommand {
149149
}) => {
150150
const { name, locationOffset, relativePath } = operation;
151151
this.log(
152-
`${name}: ${chalk.blue(`${relativePath}:${locationOffset.line}`)}\n`
152+
`${name}: ${chalk.cyan(`${relativePath}:${locationOffset.line}`)}\n`
153153
);
154154

155155
const byErrorType = validationResults.reduce(

packages/apollo/src/commands/client/push.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ export default class ClientPush extends ClientCommand {
2727
let result = "";
2828
try {
2929
await this.runTasks(({ flags, project, config }) => {
30-
const clientBundleInfo = `${chalk.blue(
30+
const clientBundleInfo = `${chalk.cyan(
3131
(config.client && config.client.name) || flags
32-
)}${chalk.blue(
32+
)}${chalk.cyan(
3333
(config.client &&
3434
config.client.version &&
3535
`@${config.client.version}`) ||
@@ -51,9 +51,9 @@ export default class ClientPush extends ClientCommand {
5151
}
5252
},
5353
{
54-
title: `Checked operations against ${chalk.blue(
55-
config.name || ""
56-
)}@${chalk.blue(config.tag)}`,
54+
title: `Checked operations against ${chalk.cyan(
55+
config.name + "@" + config.tag
56+
)}`,
5757
task: async () => {}
5858
},
5959
{
@@ -115,7 +115,7 @@ export default class ClientPush extends ClientCommand {
115115
operation.signature
116116
];
117117

118-
result += `\nError in: ${chalk.blue(file)}\n`;
118+
result += `\nError in: ${chalk.cyan(file)}\n`;
119119
result += table(
120120
[
121121
["Status", "Operation", "Errors"],

packages/apollo/src/commands/service/__tests__/__snapshots__/list.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Fetching list of services for graph engine@master [completed]
2828
╚═══════════╧═══════════════════════════════╧═══════════════════════════╝
2929
3030
31-
3231
View full details at: https://engine-staging.apollographql.com/graph/engine/service-list
32+
3333
"
3434
`;

packages/apollo/src/commands/service/check.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,9 @@ export default class ServiceCheck extends ProjectCommand {
321321
return [
322322
{
323323
enabled: () => !!serviceName,
324-
title: `Validate graph composition for service ${chalk.blue(
324+
title: `Validate graph composition for service ${chalk.cyan(
325325
serviceName || ""
326-
)} on graph ${chalk.blue(graphName)}`,
326+
)} on graph ${chalk.cyan(graphName)}`,
327327
task: async (ctx: TasksOutput, task) => {
328328
if (!serviceName) {
329329
throw new Error(
@@ -337,7 +337,7 @@ export default class ServiceCheck extends ProjectCommand {
337337
throw new Error("No SDL found for federated service");
338338
}
339339

340-
task.output = `Attempting to compose graph with ${chalk.blue(
340+
task.output = `Attempting to compose graph with ${chalk.cyan(
341341
serviceName
342342
)} service's partial schema`;
343343

@@ -366,7 +366,7 @@ export default class ServiceCheck extends ProjectCommand {
366366
task.title = `Found ${pluralize(
367367
compositionValidationResult.errors.length,
368368
"graph composition error"
369-
)} for service ${chalk.blue(serviceName)} on graph ${chalk.blue(
369+
)} for service ${chalk.cyan(serviceName)} on graph ${chalk.cyan(
370370
graphName
371371
)}`;
372372

@@ -417,7 +417,7 @@ export default class ServiceCheck extends ProjectCommand {
417417
{
418418
title: `Validating ${
419419
serviceName ? "composed " : ""
420-
}schema against tag ${chalk.blue(tag)} on graph ${chalk.blue(
420+
}schema against tag ${chalk.cyan(tag)} on graph ${chalk.cyan(
421421
graphName
422422
)}`,
423423
// We have already performed validation per operation above if the service is federated
@@ -506,14 +506,14 @@ export default class ServiceCheck extends ProjectCommand {
506506
: null;
507507

508508
task.title = `Compared ${pluralize(
509-
chalk.blue(schemaChanges.length.toString()),
509+
chalk.cyan(schemaChanges.length.toString()),
510510
"schema change"
511511
)} against ${pluralize(
512-
chalk.blue(numberOfCheckedOperations.toString()),
512+
chalk.cyan(numberOfCheckedOperations.toString()),
513513
"operation"
514514
)}${
515515
hours
516-
? ` over the last ${chalk.blue(formatTimePeriod(hours))}`
516+
? ` over the last ${chalk.cyan(formatTimePeriod(hours))}`
517517
: ""
518518
}`;
519519
}
@@ -529,10 +529,10 @@ export default class ServiceCheck extends ProjectCommand {
529529
breakingSchemaChangeCount;
530530

531531
task.title = `Found ${pluralize(
532-
chalk.blue(breakingSchemaChangeCount.toString()),
532+
chalk.cyan(breakingSchemaChangeCount.toString()),
533533
"breaking change"
534534
)} and ${pluralize(
535-
chalk.blue(nonBreakingSchemaChangeCount.toString()),
535+
chalk.cyan(nonBreakingSchemaChangeCount.toString()),
536536
"compatible change"
537537
)}`;
538538

packages/apollo/src/commands/service/list.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function formatHumanReadable({
8181

8282
const serviceListUrlEnding = `/graph/${graphName}/service-list`;
8383
const targetUrl = `${frontendUrl}${serviceListUrlEnding}`;
84-
result += `\n\nView full details at: ${targetUrl}`;
84+
result += `\nView full details at: ${chalk.cyan(targetUrl)}\n`;
8585
}
8686
return result;
8787
}
@@ -123,7 +123,7 @@ export default class ServiceList extends ProjectCommand {
123123

124124
return [
125125
{
126-
title: `Fetching list of services for graph ${chalk.blue(
126+
title: `Fetching list of services for graph ${chalk.cyan(
127127
graphName + "@" + variant
128128
)}`,
129129
task: async (ctx: TasksOutput, task) => {
@@ -160,7 +160,7 @@ export default class ServiceList extends ProjectCommand {
160160
const { service } = taskOutput.config;
161161
if (!service || !taskOutput.config) {
162162
throw new Error(
163-
"Service mising from config. This should have been validated elsewhere"
163+
"Service missing from config. This should have been validated elsewhere"
164164
);
165165
}
166166
this.log(

0 commit comments

Comments
 (0)