From 6205a11edad81d21f1a508954f08ffeb981d55f9 Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Mon, 16 May 2022 14:59:23 +0800 Subject: [PATCH] set default options for dev command (#4932) --- .changeset/yellow-eagles-leave.md | 5 +++++ packages/kit/src/cli.js | 8 ++++---- packages/kit/src/core/dev/index.js | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 .changeset/yellow-eagles-leave.md diff --git a/.changeset/yellow-eagles-leave.md b/.changeset/yellow-eagles-leave.md new file mode 100644 index 000000000000..0dfa6a9bf8eb --- /dev/null +++ b/.changeset/yellow-eagles-leave.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +Set default options for dev command diff --git a/packages/kit/src/cli.js b/packages/kit/src/cli.js index 1380595200fc..686a4fab33e7 100755 --- a/packages/kit/src/cli.js +++ b/packages/kit/src/cli.js @@ -47,10 +47,10 @@ const prog = sade('svelte-kit').version('__VERSION__'); prog .command('dev') .describe('Start a development server') - .option('-p, --port', 'Port') - .option('-o, --open', 'Open a browser tab') - .option('--host', 'Host (only use this on trusted networks)') - .option('--https', 'Use self-signed HTTPS certificate') + .option('-p, --port', 'Port', 3000) + .option('-o, --open', 'Open a browser tab', false) + .option('--host', 'Host (only use this on trusted networks)', 'localhost') + .option('--https', 'Use self-signed HTTPS certificate', false) .option('-H', 'no longer supported, use --https instead') // TODO remove for 1.0 .action(async ({ port, host, https, open, H }) => { try { diff --git a/packages/kit/src/core/dev/index.js b/packages/kit/src/core/dev/index.js index 14e35c234f26..5defc0e5c314 100644 --- a/packages/kit/src/core/dev/index.js +++ b/packages/kit/src/core/dev/index.js @@ -11,7 +11,7 @@ import * as sync from '../sync/sync.js'; * @typedef {{ * cwd: string, * port: number, - * host?: string, + * host: string, * https: boolean, * config: import('types').ValidatedConfig * }} Options