diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5ea4326b..98d2793d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -70,3 +70,37 @@ pnpm test manifest-contents Unit and E2E tests are ran together via [Vitest workspaces](https://vitest.dev/guide/#workspaces-support). If you want to manually test a change, you can modify the demo project for your test, but please don't leave those changes committed once you open a PR. + +## Templates + +Each directory inside `templates/` is it's own standalone project. Simply `cd` into the directory you're updating, install dependencies with `npm` (NOT `pnpm`), and run the relevant commands + +```sh +cd templates/vue +npm i +npm run dev +npm run build +``` + +Note that templates are hardcoded to a specific version of `wxt` from NPM, they do not use the local version. PR checks will test your changes against the templates, but if you want to manually do it, update the package.json dependency: + +```diff + "devDependencies": { + "typescript": "^5.1.6", + "vite-plugin-solid": "^2.7.0", +- "wxt": "^0.8.0" ++ "wxt": "../.." + } +``` + +Then run `npm i` again. + +### Adding Templates + +To add a template, copy the vanilla template and give it a new name. + +```sh +cp -r templates/vailla 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/templates/README.md b/templates/README.md deleted file mode 100644 index 870d15d4..00000000 --- a/templates/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# WXT Templates - -To add or change a template, open the template's folder (`template/`) in your editor directly. Then, it's a normal NPM project. - -Note that you should use `npm` instead of `pnpm` in the template directories so that it doesn't complict with the repo's PNPM workspace. Templates are standalone and should not depend on the local state of `wxt`.