From e2350fecc6bd83af8f9d4b46eafb0981663591ca Mon Sep 17 00:00:00 2001 From: Aaron Klinker Date: Thu, 7 Sep 2023 18:35:37 -0500 Subject: [PATCH] docs: Add migration docs --- README.md | 26 +++++++++++++++++--------- docs/get-started/installation.md | 18 +++++++++++++++++- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 7c38e2d1..15518be7 100644 --- a/README.md +++ b/README.md @@ -3,18 +3,26 @@ WXT -

- -

Next-gen framework for developing web extensions.

It's like Nuxt, but for Chrome Extensions

- -![Example CLI Output](./docs/assets/cli-output.png) +

+ Next-gen framework for developing web extensions. +
+ +
+ It's like Nuxt, but for Chrome Extensions +

- GitHub Workflow Status (with event) - Documentation - Examples + Get Started + • + Installation + • + Entrypoints + • + Configuration

+![Example CLI Output](./docs/assets/cli-output.png) + ## Quick Start Bootstrap a new project: @@ -37,7 +45,7 @@ Or see the [installation guide](https://wxt.dev/get-started/installation.html) t - 🎨 Frontend framework agnostic: works with Vue, React, Svelte, etc - 🖍️ Quickly bootstrap a new project -### Todo +### Coming Soon - 📏 Bundle analysis - 🤖 Automated publishing diff --git a/docs/get-started/installation.md b/docs/get-started/installation.md index 7b6c925d..9264ca2c 100644 --- a/docs/get-started/installation.md +++ b/docs/get-started/installation.md @@ -1,6 +1,6 @@ # Installation -Bootstrap a new project or start from scratch. +Bootstrap a new project, start from scratch, or migrate an existing project. :::warning 🚧 WSL Support **_WXT does not support [Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/) yet_**. See [Issue #55](https://github.com/wxt-dev/wxt/issues/55) to track progress. @@ -104,6 +104,22 @@ Finally, add scripts to your `package.json`: } ``` +## Migrate an Existing Project + +Before starting the migration, it is recommended to run `pnpx wxt@latest init` to see what a basic project looks like. Once you have an understanding of how WXT projects are structured, you're ready to convert the project, using the initialized project as a reference. + +Migrating a project to WXT comes down to a few steps: + +1. Install WXT and remove any old build tools: `pnpm i -D wxt` +1. Refactoring/move your entrypoints to the `entrypoints` directory +1. Moving public assets to the `public` directory +1. Update the dev and build scripts to use WXT +1. Ensure project is compatible with Vite, which is used under the hood to bundle your extension + +:::info +Since projects vary greatly in setup, [start a discussion on GitHub](https://github.com/wxt-dev/wxt/discussions/new/choose) if you need help migrating your project to WXT. +::: + ## Development Once you've installed WXT, you can start the development server using the `dev` script.