Skip to content

Commit bb235b2

Browse files
authoredDec 7, 2022
fix: improve CLI shortcuts help display (#11247)
1 parent 4efb188 commit bb235b2

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed
 

‎packages/vite/src/node/logger.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,10 @@ export function printServerUrls(
153153
info(` ${colors.green('➜')} ${colors.bold('Network')}: ${colorUrl(url)}`)
154154
}
155155
if (urls.network.length === 0 && optionsHost === undefined) {
156-
const note = `use ${colors.reset(colors.bold('--host'))} to expose`
157156
info(
158-
colors.dim(` ${colors.green('➜')} ${colors.bold('Network')}: ${note}`),
157+
colors.dim(` ${colors.green('➜')} ${colors.bold('Network')}: use `) +
158+
colors.bold('--host') +
159+
colors.dim(' to expose'),
159160
)
160161
}
161162
}

‎packages/vite/src/node/server/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ export interface ViteDevServer {
306306
* @internal
307307
* Actually BindShortcutsOptions | undefined but api-extractor checks for
308308
* export before trimming internal types :(
309-
* And I don't want to complexity prePatchTypes for that
309+
* And I don't want to add complexity to prePatchTypes for that
310310
*/
311311
_shortcutsOptions: any | undefined
312312
}

‎packages/vite/src/node/shortcuts.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,16 @@ export function bindShortcuts(
5050

5151
if (input === 'h') {
5252
server.config.logger.info(
53-
shortcuts
54-
.map(
53+
[
54+
'',
55+
colors.bold(' Shortcuts'),
56+
...shortcuts.map(
5557
(shortcut) =>
5658
colors.dim(' press ') +
5759
colors.bold(shortcut.key) +
5860
colors.dim(` to ${shortcut.description}`),
59-
)
60-
.join('\n'),
61+
),
62+
].join('\n'),
6163
)
6264
}
6365

0 commit comments

Comments
 (0)
Please sign in to comment.