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

[create-sitecore-jss] Better wording around multiple apps installed #1888

Merged
merged 1 commit into from
Aug 14, 2024
Merged
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
18 changes: 16 additions & 2 deletions packages/create-sitecore-jss/src/common/processes/next.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,22 @@ describe('next', () => {
expect(
calls.some(
(call) =>
call.args[0] ===
`JSS application(s) ${chalk.green('my-cool-app, second-app')} are ready!`
call.args[0] === `JSS applications ${chalk.green('my-cool-app, second-app')} are ready!`
)
).to.equal(true);
});

it('displays single app name with single item wording in output', async () => {
const appNames = ['my-cool-app'];
await nextSteps(appNames, []);

const calls = log.getCalls();
calls.forEach((call) => {
console.log(call.args[0]);
});
expect(
calls.some(
(call) => call.args[0] === `JSS application ${chalk.green('my-cool-app')} is ready!`
)
).to.equal(true);
});
Expand Down
10 changes: 5 additions & 5 deletions packages/create-sitecore-jss/src/common/processes/next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import chalk from 'chalk';
* @param {string[]} nextStepsArr next steps to be performed after app is created
*/
export const nextSteps = async (appNames: string[], nextStepsArr: string[]) => {
const successMessage =
appNames.length > 1
? `JSS applications ${chalk.green(appNames.join(', '))} are ready!`
: `JSS application ${chalk.green(appNames[0])} is ready!`;
console.log(chalk.red(' -/oyhdmNNNNmdhyo/- '));
console.log(chalk.red(' :sdMMMMMMMMMMMMMMMMMMMMds: '));
console.log(chalk.red(' :yNMMMMMMMMMMMMMMMMMMMMMMMMMMNy: '));
Expand Down Expand Up @@ -37,11 +41,7 @@ export const nextSteps = async (appNames: string[], nextStepsArr: string[]) => {
console.log(chalk.white(' / // /\\ \\_\\ \\ '));
console.log(chalk.white(' \\___/___/___/'));
console.log();
console.log(
`JSS application(s) ${chalk.green(appNames.join(', '))} ${
appNames.length > 1 ? 'are' : 'is'
} ready!`
);
console.log(successMessage);
console.log();
console.log(chalk.yellow('Next steps:'));
nextStepsArr.forEach((step) => {
Expand Down
Loading