From e7880fcde06cb9af37fa2ba6fe18210d69bdcfce Mon Sep 17 00:00:00 2001 From: Leo Shklovskii Date: Fri, 23 Feb 2024 12:45:58 -0500 Subject: [PATCH] docs: Lots of small typo fixes (#480) --- CHANGELOG.md | 10 +++++----- CONTRIBUTING.md | 2 +- docs/entrypoints/background.md | 2 +- docs/entrypoints/css.md | 2 +- docs/entrypoints/sidepanel.md | 2 +- docs/guide/auto-imports.md | 2 +- docs/guide/compare.md | 2 +- docs/guide/configuration.md | 2 +- docs/guide/content-script-ui.md | 2 +- docs/guide/development.md | 6 +++--- docs/guide/entrypoints.md | 6 +++--- docs/guide/esm.md | 2 +- docs/guide/installation.md | 4 ++-- docs/guide/introduction.md | 2 +- docs/guide/migrate-to-wxt.md | 2 +- docs/guide/multiple-browsers.md | 6 +++--- docs/guide/publishing.md | 2 +- docs/index.md | 2 +- e2e/utils.ts | 2 +- src/storage.ts | 8 ++++---- vitest.workspace.ts | 2 +- 21 files changed, 35 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45e468ed..013b08bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -914,7 +914,7 @@ Renamed undocumented constants for detecting the build config at runtime in [#38 ### 🏡 Chore -- Remove whitespace from genearted `.wxt` files ([#211](https://github.com/wxt-dev/wxt/pull/211)) +- Remove whitespace from generated `.wxt` files ([#211](https://github.com/wxt-dev/wxt/pull/211)) - Upgrade templates to `wxt@^0.9.0` ([#214](https://github.com/wxt-dev/wxt/pull/214)) - Update Vite dependency range to `^4.0.0 || ^5.0.0-0` ([f1e8084](https://github.com/wxt-dev/wxt/commit/f1e8084be89e512dde441b9197a99183c497f67d)) @@ -1422,8 +1422,8 @@ Renamed undocumented constants for detecting the build config at runtime in [#38 - **deps-dev:** Bump vitest from 0.34.1 to 0.34.3 ([#99](https://github.com/wxt-dev/wxt/pull/99)) - Increase E2E test timeout because GitHub Actions Window runner is slow ([2a0842b](https://github.com/wxt-dev/wxt/commit/2a0842b)) - **deps-dev:** Bump vitepress from 1.0.0-rc.4 to 1.0.0-rc.10 ([#96](https://github.com/wxt-dev/wxt/pull/96)) -- Fix test watcher restarting indefinetly ([2c7922c](https://github.com/wxt-dev/wxt/commit/2c7922c)) -- Remove explict icon config from templates ([93bfee0](https://github.com/wxt-dev/wxt/commit/93bfee0)) +- Fix test watcher restarting indefinitely ([2c7922c](https://github.com/wxt-dev/wxt/commit/2c7922c)) +- Remove explicit icon config from templates ([93bfee0](https://github.com/wxt-dev/wxt/commit/93bfee0)) - Use import aliases in Vue template ([#104](https://github.com/wxt-dev/wxt/pull/104)) #### ⚠️ Breaking Changes @@ -1483,7 +1483,7 @@ Renamed undocumented constants for detecting the build config at runtime in [#38 - Branding and logo ([#60](https://github.com/wxt-dev/wxt/pull/60)) - Simplify binary setup ([#62](https://github.com/wxt-dev/wxt/pull/62)) - Add Solid template ([#63](https://github.com/wxt-dev/wxt/pull/63)) -- Increate E2E test timeout to fix flakey test ([dfe424f](https://github.com/wxt-dev/wxt/commit/dfe424f)) +- Increase E2E test timeout to fix flakey test ([dfe424f](https://github.com/wxt-dev/wxt/commit/dfe424f)) ### 🤖 CI @@ -1759,7 +1759,7 @@ Initial release of WXT. Full support for production builds and initial toolkit f - Export and bootstrap the `/client` package ([5b07c95](https://github.com/wxt-dev/wxt/commit/5b07c95)) - Resolve entrypoints based on filesystem ([a63f061](https://github.com/wxt-dev/wxt/commit/a63f061)) - Separate output directories for each browser/manifest version ([f09ffbb](https://github.com/wxt-dev/wxt/commit/f09ffbb)) -- Build entrypoints and output `manfiest.json` ([1e7c738](https://github.com/wxt-dev/wxt/commit/1e7c738)) +- Build entrypoints and output `manifest.json` ([1e7c738](https://github.com/wxt-dev/wxt/commit/1e7c738)) - Automatically add CSS files to content scripts ([047ce04](https://github.com/wxt-dev/wxt/commit/047ce04)) - Download and bundle remote URL imports ([523c7df](https://github.com/wxt-dev/wxt/commit/523c7df)) - Generate type declarations and config for project types and auto-imports ([21debad](https://github.com/wxt-dev/wxt/commit/21debad)) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index def1c774..e5244b94 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -108,7 +108,7 @@ Then run `npm i` again. To add a template, copy the vanilla template and give it a new name. ```sh -cp -r templates/vailla templates/ +cp -r templates/vanilla templates/ ``` That's it. Once your template is merged, it will be available inside `wxt init` immediately. You don't need to release a new version of WXT to release a new template. diff --git a/docs/entrypoints/background.md b/docs/entrypoints/background.md index 79a1e4e2..b5df3dd9 100644 --- a/docs/entrypoints/background.md +++ b/docs/entrypoints/background.md @@ -16,7 +16,7 @@ For MV2, the background is added as a script to the background page. For MV3, th ## Definition :::warning -The main function of the background **_CANNOT BE ASYNC_**. Event listeners must be added syncronously on background startup. If your main function returns a promise, WXT will log an error. +The main function of the background **_CANNOT BE ASYNC_**. Event listeners must be added synchronously on background startup. If your main function returns a promise, WXT will log an error. ::: ```ts diff --git a/docs/entrypoints/css.md b/docs/entrypoints/css.md index 8747953d..e48f7047 100644 --- a/docs/entrypoints/css.md +++ b/docs/entrypoints/css.md @@ -2,7 +2,7 @@ WXT can build CSS entrypoints individually. CSS entrypoints are always unlisted. -See [Content Script CSS](/entrypoints/content-scripts#css) documentation for the recomended approach to include CSS with a content script. +See [Content Script CSS](/entrypoints/content-scripts#css) documentation for the recommended approach to include CSS with a content script. :::info If the recommended approach doesn't work for your use case, you can use any of the filename patterns below to build the styles separate from the JS and use the [`transformManifest` hook](/api/wxt/interfaces/InlineConfig#transformmanifest) to manually add your CSS file to the manifest. diff --git a/docs/entrypoints/sidepanel.md b/docs/entrypoints/sidepanel.md index 274c1cd6..8e61a07c 100644 --- a/docs/entrypoints/sidepanel.md +++ b/docs/entrypoints/sidepanel.md @@ -5,7 +5,7 @@ In Chrome, side panels use the "side_panel" API, while Firefox uses the "sidebar_action" API. :::warning -Chrome added support for sidepanels in Manifest V3, they are not available in Manfiest V2. +Chrome added support for sidepanels in Manifest V3, they are not available in Manifest V2. ::: ## Filenames diff --git a/docs/guide/auto-imports.md b/docs/guide/auto-imports.md index 3cdb4767..e0d06589 100644 --- a/docs/guide/auto-imports.md +++ b/docs/guide/auto-imports.md @@ -65,7 +65,7 @@ import { defineConfig } from 'wxt'; export default defineConfig({ imports: { - // Add auto-imports for vue fuctions like createApp, ref, computed, watch, toRaw, etc... + // Add auto-imports for vue functions like createApp, ref, computed, watch, toRaw, etc... presets: ['vue'], }, }); diff --git a/docs/guide/compare.md b/docs/guide/compare.md index 2746e464..32bd2ab5 100644 --- a/docs/guide/compare.md +++ b/docs/guide/compare.md @@ -40,7 +40,7 @@ WXT's main goal is improving the development experience (DX) of creating web ext Opening a browser automatically makes it super easy to start and stop development without having to manually load the extension in your browser. -Reloading each part of the extension individually improves your iteration speed while developing UIs. This is because reloading the entire extension on every change will close the popup and any tabs open to an extension page, like options. If you save a file associated with a UI and a content script while working on the UI, it will randomly close because it needed to reload the extension when the content script changed. This interupts your development flow and is really annoying. +Reloading each part of the extension individually improves your iteration speed while developing UIs. This is because reloading the entire extension on every change will close the popup and any tabs open to an extension page, like options. If you save a file associated with a UI and a content script while working on the UI, it will randomly close because it needed to reload the extension when the content script changed. This interrupts your development flow and is really annoying. WXT solves this problem by reloading HTML pages and content scripts individually (when possible) to keep your UIs open while you develop them. This is a MV3 feature, so if you're developing a MV2 extension, you'll get the same dev experience as Plasmo. diff --git a/docs/guide/configuration.md b/docs/guide/configuration.md index 695cf7f5..297131c9 100644 --- a/docs/guide/configuration.md +++ b/docs/guide/configuration.md @@ -1,6 +1,6 @@ # Configuration -WXT's behavior can be configured via the `wxt.config.ts` file. In this file, you can add Vite plugins, change the directory strucutre of your project, and set fields on your `manifest.json`. +WXT's behavior can be configured via the `wxt.config.ts` file. In this file, you can add Vite plugins, change the directory structure of your project, and set fields on your `manifest.json`. ## Config File diff --git a/docs/guide/content-script-ui.md b/docs/guide/content-script-ui.md index 8ff987a1..7a61f7fa 100644 --- a/docs/guide/content-script-ui.md +++ b/docs/guide/content-script-ui.md @@ -368,7 +368,7 @@ WXT provides a helper function, [`createIframeUi`](/api/wxt/client/functions/cre ``` -1. Add the page to the manifest's `web_accessible_resouces` +1. Add the page to the manifest's `web_accessible_resources` ```ts // wxt.config.ts export default defineConfig({ diff --git a/docs/guide/development.md b/docs/guide/development.md index c4621ed2..6f70586f 100644 --- a/docs/guide/development.md +++ b/docs/guide/development.md @@ -15,9 +15,9 @@ WXT's main goal is providing the best DX it possibly can. When running your exte ## Dev Mode vs Production Builds -There are some notible differences between the development and production versions of an extension. During development: +There are some notable differences between the development and production versions of an extension. During development: -1. **Content scripts are not listed in the `manifest.json`** when targetting MV3. Instead, the [`scripting`](https://developer.chrome.com/docs/extensions/reference/api/scripting) permission is used to register content scripts at runtime so they can be reloaded individually. +1. **Content scripts are not listed in the `manifest.json`** when targeting MV3. Instead, the [`scripting`](https://developer.chrome.com/docs/extensions/reference/api/scripting) permission is used to register content scripts at runtime so they can be reloaded individually. To get the list of content scripts during development, run the following in the background's console: @@ -59,7 +59,7 @@ export default defineRunnerConfig({ ### Browser Binaries -`web-ext`'s browser discovery is very limitted. By default, it only guesses at where Chrome and Firefox are installed. If you've customized your install locations, you may need to tell `web-ext` where the binaries/executables are located using the [`binaries` option](/api/wxt/interfaces/ExtensionRunnerConfig#binaries). For other Chromium based browsers, like Edge or Opera, you'll need to explicitly list them in the `binaries` option as well, otherwise they will open in Chrome by default. +`web-ext`'s browser discovery is very limited. By default, it only guesses at where Chrome and Firefox are installed. If you've customized your install locations, you may need to tell `web-ext` where the binaries/executables are located using the [`binaries` option](/api/wxt/interfaces/ExtensionRunnerConfig#binaries). For other Chromium based browsers, like Edge or Opera, you'll need to explicitly list them in the `binaries` option as well, otherwise they will open in Chrome by default. ```ts // ~/web-ext.config.ts diff --git a/docs/guide/entrypoints.md b/docs/guide/entrypoints.md index 3b9c028e..0649e0b6 100644 --- a/docs/guide/entrypoints.md +++ b/docs/guide/entrypoints.md @@ -58,7 +58,7 @@ See [`/entrypoints` folder](/entrypoints/background) documentation for a full li ## Entrypoint Options -Some entrypoints, like content scripts, actions, or the background, can recieve additional options. +Some entrypoints, like content scripts, actions, or the background, can receive additional options. In HTML files, options are listed as `meta` tags: @@ -118,7 +118,7 @@ This throws an error because WXT needs to import each entrypoint during the buil :::details Why? -When importing your entrypoint to get its definition, the file is imported in a **_node environement_**, and doesn't have access to the `window`, `chrome`, or `browser` globals a web extension ususally has access to. If WXT doesn't remove all the imports from the file, the imported modules could try and access one of these variables, throwing an error. +When importing your entrypoint to get its definition, the file is imported in a **_node environment_**, and doesn't have access to the `window`, `chrome`, or `browser` globals a web extension usually has access to. If WXT doesn't remove all the imports from the file, the imported modules could try and access one of these variables, throwing an error. ::: @@ -126,7 +126,7 @@ When importing your entrypoint to get its definition, the file is imported in a See [`wxt-dev/wxt#336`](https://github.com/wxt-dev/wxt/issues/336) to track the status of this bug. ::: -Usually, this error occurs when you try to extract options into a shared file or try to run code outside the `main` function. To fix the example from above, use litteral values when defining an entrypoint instead of importing them: +Usually, this error occurs when you try to extract options into a shared file or try to run code outside the `main` function. To fix the example from above, use literal values when defining an entrypoint instead of importing them: ```ts import { GOOGLE_MATCHES } from '~/utils/match-patterns'; // [!code --] diff --git a/docs/guide/esm.md b/docs/guide/esm.md index 5d288fad..2c8347ba 100644 --- a/docs/guide/esm.md +++ b/docs/guide/esm.md @@ -30,7 +30,7 @@ export default defineBackground({ ``` :::warning -Only MV3 support ESM background scripts/service workers. When targetting MV2, the `type` option is ignored and the background is always bundled into a single file as IIFE. +Only MV3 support ESM background scripts/service workers. When targeting MV2, the `type` option is ignored and the background is always bundled into a single file as IIFE. ::: ## Content Scripts diff --git a/docs/guide/installation.md b/docs/guide/installation.md index ccc53e42..016efa80 100644 --- a/docs/guide/installation.md +++ b/docs/guide/installation.md @@ -133,7 +133,7 @@ The dev command will build the extension for development, open the browser, and When running the dev command, WXT will make several changes to your `manifest.json` to improve your development experience: - If missing, add a background script/service worker to enable fast reloads -- Add serveral `permissions` and `host_permissions` to enable HMR and fast reloads +- Add several `permissions` and `host_permissions` to enable HMR and fast reloads - Modify the CSP to allow connections with the dev server - Remove `content_scripts` and register them at runtime so they can be easily reloaded when you save a file @@ -147,4 +147,4 @@ You're ready to build your web extension! - Learn how to [add entrypoints](./entrypoints) like the popup, options page, or content scripts - Configure your entrypoints to [use ESM](./esm) at runtime - [Configure WXT](./configuration) by creating a `wxt.config.ts` file -- Checkout [example projects](https://github.com/wxt-dev/wxt-examples) to see how to perfom common tasks with WXT +- Checkout [example projects](https://github.com/wxt-dev/wxt-examples) to see how to perform common tasks with WXT diff --git a/docs/guide/introduction.md b/docs/guide/introduction.md index b9448242..39ab318f 100644 --- a/docs/guide/introduction.md +++ b/docs/guide/introduction.md @@ -20,7 +20,7 @@ WXT is an opinionated framework. This helps keep projects consistent and easy to - **Generated manifest**: Based on your project's file structure - **Entrypoint configuration**: Configure entrypoints from the same file they're declare in - **Type-safety is a priority**: Out-of-the-box TypeScript support with improved browser API typing -- **Simple output file structure**: Ouptut file paths minimize the path at runtime +- **Simple output file structure**: Output file paths minimize the path at runtime ## Development diff --git a/docs/guide/migrate-to-wxt.md b/docs/guide/migrate-to-wxt.md index ecbdd553..64cd8f6a 100644 --- a/docs/guide/migrate-to-wxt.md +++ b/docs/guide/migrate-to-wxt.md @@ -32,7 +32,7 @@ Every project is different, so there's no one-solution-fits-all to migrating you ## Popular Tools/Frameworks -Here's specific steps for other popuplar frameworks/build tools. +Here's specific steps for other popular frameworks/build tools. ### `vite-plugin-web-extension` diff --git a/docs/guide/multiple-browsers.md b/docs/guide/multiple-browsers.md index 1bdb43a8..a8edacea 100644 --- a/docs/guide/multiple-browsers.md +++ b/docs/guide/multiple-browsers.md @@ -1,6 +1,6 @@ # Multiple Browsers -You can build an extension for any combination of browser and manifest verison. Different browsers and manifest versions support different APIs and entrypoints, so be sure to check that your extension functions as expected for each target. +You can build an extension for any combination of browser and manifest version. Different browsers and manifest versions support different APIs and entrypoints, so be sure to check that your extension functions as expected for each target. Separate build targets are written to their own output directories: @@ -45,7 +45,7 @@ wxt --mv2 wxt build --mv2 ``` -When the `-b --browser` flag is not passed, it defaults to `chrome`. So here, we're targetting MV2 for Chrome. +When the `-b --browser` flag is not passed, it defaults to `chrome`. So here, we're targeting MV2 for Chrome. ## Customizing Entrypoints @@ -116,7 +116,7 @@ Only `defineBackground` and `defineContentScript` support per-browser options ri To determine the browser or manifest version at runtime, you can use any of the below variables: - `import.meta.env.BROWSER`: A string, the target browser, usually equal to the `--browser` flag -- `import.meta.env.MANIFEST_VERSION`: A number, either `2` or `3`, depending on the manifest version targetted +- `import.meta.env.MANIFEST_VERSION`: A number, either `2` or `3`, depending on the manifest version targeted - `import.meta.env.CHROME`: A boolean equivalent to `import.meta.env.BROWSER === "chrome"` - `import.meta.env.FIREFOX`: A boolean equivalent to `import.meta.env.BROWSER === "firefox"` - `import.meta.env.EDGE`: A boolean equivalent to `import.meta.env.BROWSER === "edge"` diff --git a/docs/guide/publishing.md b/docs/guide/publishing.md index 8f76e031..332ceb9e 100644 --- a/docs/guide/publishing.md +++ b/docs/guide/publishing.md @@ -64,7 +64,7 @@ See the [Firefox Addon Store](#firefox-addon-store) section for more details abo ## GitHub Action -Here's an example of a GitHub Action to automate submiting new versions of your extension for review. Ensure that you've added all required secrets used in the workflow to the repo's settings. +Here's an example of a GitHub Action to automate submitting new versions of your extension for review. Ensure that you've added all required secrets used in the workflow to the repo's settings. ```yml # TODO diff --git a/docs/index.md b/docs/index.md index e8b2087e..4a77f988 100644 --- a/docs/index.md +++ b/docs/index.md @@ -62,7 +62,7 @@ features: linkText: See templates - icon: 📏 title: Bundle Analysis - details: Tools for analyizing the final extension bundle and minimizing your extension's size. + details: Tools for analyzing the final extension bundle and minimizing your extension's size. - icon: ⬇️ title: Bundle Remote Code details: Downloads and bundles remote code imported from URLs. diff --git a/e2e/utils.ts b/e2e/utils.ts index 8eca4867..84952ea3 100644 --- a/e2e/utils.ts +++ b/e2e/utils.ts @@ -163,7 +163,7 @@ export class TestProject { } /** - * @param path An abosolute path to a file or a path relative to the root. + * @param path An absolute path to a file or a path relative to the root. * @param ignoreContents An optional boolean that, when true, causes this function to not print * the file contents. */ diff --git a/src/storage.ts b/src/storage.ts index 8d69e598..c8fe5ce6 100644 --- a/src/storage.ts +++ b/src/storage.ts @@ -1,5 +1,5 @@ /** - * Simplfied storage APIs with support for versioned fields, snapshots, metadata, and item definitions. + * Simplified storage APIs with support for versioned fields, snapshots, metadata, and item definitions. * * See [the guide](https://wxt.dev/guide/storage.html) for more information. * @@ -32,7 +32,7 @@ function createStorage(): WxtStorage { const driverKey = key.substring(deliminatorIndex + 1); if (driverKey == null) throw Error( - `Storage key should be in the form of "area:key", but recieved "${key}"`, + `Storage key should be in the form of "area:key", but received "${key}"`, ); return { @@ -421,7 +421,7 @@ export interface WxtStorage { */ getItem(key: string, opts?: GetItemOptions): Promise; /** - * Get multiple items from storage. There is no guarentee of order in the returned array. + * Get multiple items from storage. There is no guarantee of order in the returned array. * * @example * await storage.getItems(["local:installDate", "session:someCounter"]); @@ -499,7 +499,7 @@ export interface WxtStorage { ): Promise>; /** * Restores the results of `snapshot`. If new properties have been saved since the snapshot, they are - * not overridden. Only values existing in the snapshot are overritten. + * not overridden. Only values existing in the snapshot are overridden. */ restoreSnapshot(base: string, data: any): Promise; /** diff --git a/vitest.workspace.ts b/vitest.workspace.ts index 1a82c8ee..e16a40f6 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -7,7 +7,7 @@ import path from 'node:path'; const seed = Math.round(Math.random() * Number.MAX_SAFE_INTEGER); console.info('Test seed: ' + pc.cyan(seed)); -// config.define doesn't work with workspaces, so we have to set it inisde a plugin +// config.define doesn't work with workspaces, so we have to set it inside a plugin const testSeed = (): Plugin => ({ name: 'test-seed', config(config) {