From 2b34fc49282cbf5bf89de46359b51a67a5c4b8bb Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Tue, 20 Jun 2023 15:24:29 +0100 Subject: [PATCH] fix: document `open` option (#7418) Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com> --- .changeset/sour-teachers-kiss.md | 5 +++++ packages/astro/src/@types/astro.ts | 31 ++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 .changeset/sour-teachers-kiss.md diff --git a/.changeset/sour-teachers-kiss.md b/.changeset/sour-teachers-kiss.md new file mode 100644 index 000000000..3e280de08 --- /dev/null +++ b/.changeset/sour-teachers-kiss.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Correctly type the option `server.open` diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts index 59594446c..a3fcdcedd 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -335,6 +335,22 @@ type ServerConfig = { * Set custom HTTP response headers to be sent in `astro dev` and `astro preview`. */ headers?: OutgoingHttpHeaders; + + /** + * @name server.open + * @type {boolean} + * @default `false` + * @version 2.1.8 + * @description + * Control whether the dev server should open in your browser window on startup. + * + * ```js + * { + * server: { open: true } + * } + * ``` + */ + open?: boolean; }; export interface ViteUserConfig extends vite.UserConfig { @@ -878,6 +894,21 @@ export interface AstroUserConfig { * ``` */ + /** + * @name server.open + * @type {boolean} + * @default `false` + * @version 2.1.8 + * @description + * Control whether the dev server should open in your browser window on startup. + * + * ```js + * { + * server: { open: true } + * } + * ``` + */ + /** * @docs * @name server.headers