Skip to content

Commit ce39c72

Browse files
authored
Tweak add command cli styles (#2041)
* Tweak add command cli styles * Update to re-enable
1 parent b4f9aeb commit ce39c72

3 files changed

Lines changed: 19 additions & 10 deletions

File tree

.changeset/curly-loops-crash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@changesets/cli": patch
3+
---
4+
5+
Enable guide line for `add` command and use box design for dependent patch bump note

packages/cli/src/commands/add/messages.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import c from "@changesets/color";
22
import type { Release, VersionType } from "@changesets/types";
3-
import { log } from "@clack/prompts";
3+
import { log, note } from "@clack/prompts";
44

55
export function printConfirmationMessage(
66
changeset: {
@@ -32,12 +32,10 @@ export function printConfirmationMessage(
3232
log.success(msg);
3333

3434
if (repoHasMultiplePackages) {
35-
log.info(
36-
`
37-
Note: All packages that depend on these whose required versions
38-
will be incompatible will also be ${c.blue("patch")} bumped
39-
when this changeset is applied.
40-
`.trim(),
35+
note(
36+
`All packages that depend on these whose required versions will be incompatible ` +
37+
`will also be ${c.blue("patch")} bumped when this changeset is applied.`,
38+
"NOTE",
4139
);
4240
}
4341
}

packages/cli/src/index.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@ updateSettings({ withGuide: false });
1111
try {
1212
cli.parse(process.argv, { run: false });
1313

14-
// Do not show intro for --help and --version, which have no command name
15-
if (cli.matchedCommand?.name != null) {
16-
intro(`🦋 changeset v${manifest.version}\n`);
14+
const commandName = cli.matchedCommand?.name;
15+
16+
// Enable clack guide for interactive commands
17+
if (commandName === "add") {
18+
updateSettings({ withGuide: true });
19+
}
20+
// Show intro when running a command, except for --help and --version (has no command name)
21+
if (commandName != null) {
22+
intro(`🦋 changeset v${manifest.version}`);
1723
}
1824

1925
await cli.runMatchedCommand();

0 commit comments

Comments
 (0)