Skip to content

Commit 461ef4c

Browse files
committed
add format
1 parent cf264c9 commit 461ef4c

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

packages/cli/commands/add/index.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ import {
1313
getCommunityAddon
1414
} from '@sveltejs/addons';
1515
import type { AgentName } from 'package-manager-detector';
16-
import type { AddonWithoutExplicitArgs, OptionValues, PackageManager } from '@sveltejs/cli-core';
16+
import {
17+
colors,
18+
type AddonWithoutExplicitArgs,
19+
type OptionValues,
20+
type PackageManager
21+
} from '@sveltejs/cli-core';
1722
import * as common from '../../utils/common.ts';
1823
import { createWorkspace } from './workspace.ts';
1924
import { formatFiles, getHighlighter } from './utils.ts';
@@ -92,7 +97,10 @@ export const add = new Command('add')
9297
const selectedAddons = transformAliases(specifiedAddons);
9398
common.runCommand(async () => {
9499
const { nextSteps } = await runAddCommand(options, selectedAddons);
95-
if (nextSteps) p.note(nextSteps, 'Next steps');
100+
if (nextSteps)
101+
p.note(nextSteps, 'Next steps', {
102+
format: (line) => colors.white(line)
103+
});
96104
});
97105
});
98106

@@ -356,7 +364,9 @@ export async function runAddCommand(
356364
.map(({ name, message }) => pc.yellow(`${name} (${message})`))
357365
.join('\n- ');
358366

359-
p.note(`- ${message}`, 'Preconditions not met');
367+
p.note(`- ${message}`, 'Preconditions not met', {
368+
format: (line) => colors.white(line)
369+
});
360370

361371
const force = await p.confirm({
362372
message: 'Preconditions failed. Do you wish to continue?',

packages/cli/commands/create.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
installOption,
2323
packageManagerPrompt
2424
} from '../utils/package-manager.ts';
25+
import { colors } from '@sveltejs/cli-core';
2526

2627
const langs = ['ts', 'jsdoc'] as const;
2728
const langMap: Record<string, LanguageType | undefined> = {
@@ -93,8 +94,13 @@ export const create = new Command('create')
9394
`Stuck? Visit us at ${pc.cyan('https://svelte.dev/chat')}`
9495
];
9596

96-
p.note(steps.join('\n'), 'Project next steps');
97-
if (addOnNextSteps) p.note(addOnNextSteps, 'Add-on next steps');
97+
p.note(steps.join('\n'), 'Project next steps', {
98+
format: (line) => colors.white(line)
99+
});
100+
if (addOnNextSteps)
101+
p.note(addOnNextSteps, 'Add-on next steps', {
102+
format: (line) => colors.white(line)
103+
});
98104
});
99105
});
100106

packages/migrate/utils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,5 +440,7 @@ export function migration_succeeded(next_steps) {
440440
messages.push(`${i + 1}: ${step}`);
441441
});
442442

443-
p.note(messages.join('\n'), 'Recommended next steps:');
443+
p.note(messages.join('\n'), 'Recommended next steps:', {
444+
format: (line) => pc.white(line)
445+
});
444446
}

0 commit comments

Comments
 (0)