From a72a67413706b16b19907c853a08dd5e070c6b43 Mon Sep 17 00:00:00 2001 From: Ryan Christian Date: Mon, 8 Mar 2021 22:46:49 +0000 Subject: [PATCH] fix: Correcting create command finished instructions (#1503) **What kind of change does this PR introduce?** Bugfix **Did you add tests for your changes?** No **Summary** The CLI's `create` command is supposed to output some instructions to users upon completing. However, this is broken on the latest version, and looks to have been broken years ago. Was just hidden while everyone was still using `2.2.1` for their global installs. **Does this PR introduce a breaking change?** No Co-authored-by: Ryan Christian <33403762+rschristian@users.noreply.github.com> --- .changeset/curvy-pugs-fail.md | 5 +++++ packages/cli/lib/commands/create.js | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 .changeset/curvy-pugs-fail.md diff --git a/.changeset/curvy-pugs-fail.md b/.changeset/curvy-pugs-fail.md new file mode 100644 index 000000000..10d97aa75 --- /dev/null +++ b/.changeset/curvy-pugs-fail.md @@ -0,0 +1,5 @@ +--- +'preact-cli': patch +--- + +Ensures the create command returns startup instructions to users diff --git a/packages/cli/lib/commands/create.js b/packages/cli/lib/commands/create.js index 0bee9f75e..84801bd2e 100644 --- a/packages/cli/lib/commands/create.js +++ b/packages/cli/lib/commands/create.js @@ -409,20 +409,20 @@ async function command(repo, dest, argv) { let pfx = isYarn ? 'yarn' : 'npm run'; - return ( + process.stdout.write( trim(` To get started, cd into the new directory: - ${green('cd ' + dest)} + ${green('cd ' + dest)} To start a development live-reload server: - ${green(pfx + ' dev')} + ${green(pfx + ' dev')} To create a production build (in ./build): - ${green(pfx + ' build')} + ${green(pfx + ' build')} To start a production HTTP/2 server: - ${green(pfx + ' serve')} - `) + '\n' + ${green(pfx + ' serve')} + `) + '\n\n' ); }