From 375a2a66409c5055d620198f590e5bd87f93debd Mon Sep 17 00:00:00 2001 From: Aaron Klinker Date: Fri, 14 Jul 2023 22:41:46 -0500 Subject: [PATCH] docs: Add inline JSDoc for public types --- docs/guide/auto-imports.md | 6 ++-- src/core/types/external.ts | 69 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 3 deletions(-) diff --git a/docs/guide/auto-imports.md b/docs/guide/auto-imports.md index 538c67cc..53ca9960 100644 --- a/docs/guide/auto-imports.md +++ b/docs/guide/auto-imports.md @@ -50,17 +50,17 @@ See [`unimport`'s documentation](https://github.com/unjs/unimport#configurations import { defineConfig } from 'wxt'; export default defineConfig({ - autoImport: { + imports: { // Add auto-imports for vue fuctions like createApp, ref, computed, watch, toRaw, etc... preset: ['vue'], }, }); ``` -To disable auto-imports, set `autoImport: false` +To disable auto-imports, set `imports: false` ```ts export default defineConfig({ - autoImport: false, + imports: false, }); ``` diff --git a/src/core/types/external.ts b/src/core/types/external.ts index a684e2b3..9a5f4b19 100644 --- a/src/core/types/external.ts +++ b/src/core/types/external.ts @@ -4,24 +4,93 @@ import { UnimportOptions } from 'unimport'; import { EntrypointGroup } from '.'; export interface InlineConfig { + /** + * Project root directory. + * + * @default + * process.cwd() + */ root?: string; + /** + * Directory containing all source code. Set to `"src"` to move all source code to a `src/` + * directory. + * + * @default + * "" + */ srcDir?: string; + /** + * Directory containing files that will be copied to the output directory as-is. + * + * @default + * "/publicDir" + */ publicDir?: string; + /** + * @default + * "/entrypoints" + */ entrypointsDir?: string; + /** + * Path to `"wxt.config.ts"` file or false to disable config file discovery. + * + * @default + * "wxt.config.ts" + */ configFile?: string | false; + /** + * ID of the extension for each store. Used for publishing. + */ storeIds?: { chrome?: string; firefox?: string; edge?: string; }; + /** + * Explicitly set a mode to run in. This will override the default mode for each command, and can + * be overridden by the command line `--mode` option. + */ mode?: string; + /** + * Customize auto-import options. + */ imports?: Partial; + /** + * Explicitly set a browser to target. This will override the default browser for each command, + * and can be overridden by the command line `--browser` option. + * + * @default + * "chrome" + */ browser?: TargetBrowser; + /** + * Explicitly set a manifest version to target. This will override the default manifest version + * for each command, and can be overridden by the command line `--mv2` or `--mv3` option. + */ manifestVersion?: TargetManifestVersion; + /** + * Override the logger used. + * + * @default + * consola + */ logger?: Logger; + /** + * Custom Vite options. + */ vite?: Omit; + /** + * Customize the `manifest.json` output. Can be an object, promise, or function that returns an + * object or promise. + */ manifest?: UserManifest | Promise | UserManifestFn; + /** + * Custom server options. + */ server?: WxtDevServer; + /** + * Custom runner options. Options set here can be overridden in a `web-ext.config.ts` file. + */ runner?: ExtensionRunnerConfig; }