Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shaal/vitesse-webext-drupalpod
https://github.com/shaal/vitesse-webext-drupalpod
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/shaal/vitesse-webext-drupalpod
- Owner: shaal
- License: mit
- Created: 2022-01-28T06:48:29.000Z (almost 3 years ago)
- Default Branch: drupalpod
- Last Pushed: 2024-01-29T05:31:59.000Z (10 months ago)
- Last Synced: 2024-05-22T21:29:05.566Z (6 months ago)
- Language: TypeScript
- Size: 1.04 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# WebExtension Vite Starter
A [Vite](https://vitejs.dev/) powered WebExtension ([Chrome](https://developer.chrome.com/docs/extensions/reference/), [FireFox](https://addons.mozilla.org/en-US/developers/), etc.) starter template.
Popup
Options Page
Inject Vue App into the Content Script
## Features
- β‘οΈ **Instant HMR** - use **Vite** on dev (no more refresh!)
- π₯ Vue 3 - Composition API, [`` syntax](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0040-script-setup.md) and more!
- π¬ Effortless communications - powered by [`webext-bridge`](https://github.com/antfu/webext-bridge) and [VueUse](https://github.com/antfu/vueuse) storage
- π [UnoCSS](https://github.com/unocss/unocss) - The instant on-demand Atomic CSS engine.
- π¦Ύ [TypeScript](https://www.typescriptlang.org/) - type safe
- π¦ [Components auto importing](./src/components)
- π [Icons](./src/components) - Access to icons from any iconset directly
- π₯ Content Script - Use Vue even in content script
- π WebExtension - isomorphic extension for Chrome, Firefox, and others
- π Dynamic `manifest.json` with full type support## Pre-packed
### WebExtension Libraries
- [`webextension-polyfill`](https://github.com/mozilla/webextension-polyfill) - WebExtension browser API Polyfill with types
- [`webext-bridge`](https://github.com/antfu/webext-bridge) - effortlessly communication between contexts### Vite Plugins
- [`unplugin-auto-import`](https://github.com/antfu/unplugin-auto-import) - Directly use `browser` and Vue Composition API without importing
- [`unplugin-vue-components`](https://github.com/antfu/vite-plugin-components) - components auto import
- [`unplugin-icons`](https://github.com/antfu/unplugin-icons) - icons as components
- [Iconify](https://iconify.design) - use icons from any icon sets [πIcΓ΄nes](https://icones.netlify.app/)### Vue Plugins
- [VueUse](https://github.com/antfu/vueuse) - collection of useful composition APIs
### UI Frameworks
- [UnoCSS](https://github.com/unocss/unocss) - the instant on-demand Atomic CSS engine
### Coding Style
- Use Composition API with [`<script setup>` SFC syntax](https://github.com/vuejs/rfcs/pull/227)
- [ESLint](https://eslint.org/) with [@antfu/eslint-config](https://github.com/antfu/eslint-config), single quotes, no semi### Dev tools
- [TypeScript](https://www.typescriptlang.org/)
- [pnpm](https://pnpm.js.org/) - fast, disk space efficient package manager
- [esno](https://github.com/antfu/esno) - TypeScript / ESNext node runtime powered by esbuild
- [npm-run-all](https://github.com/mysticatea/npm-run-all) - Run multiple npm-scripts in parallel or sequential
- [web-ext](https://github.com/mozilla/web-ext) - Streamlined experience for developing web extensions## Use the Template
### GitHub Template
[Create a repo from this template on GitHub](https://github.com/antfu/vitesse-webext/generate).
### Clone to local
If you prefer to do it manually with the cleaner git history
> If you don't have pnpm installed, run: npm install -g pnpm
```bash
npx degit antfu/vitesse-webext my-webext
cd my-webext
pnpm i
```## Usage
### Folders
- `src` - main source.
- `contentScript` - scripts and components to be injected as `content_script`
- `background` - scripts for background.
- `components` - auto-imported Vue components that are shared in popup and options page.
- `styles` - styles shared in popup and options page
- `assets` - assets used in Vue components
- `manifest.ts` - manifest for the extension.
- `extension` - extension package root.
- `assets` - static assets (mainly for `manifest.json`).
- `dist` - built files, also serve stub entry for Vite on development.
- `scripts` - development and bundling helper scripts.### Development
```bash
pnpm dev
```Then **load extension in browser with the `extension/` folder**.
For Firefox developers, you can run the following command instead:
```bash
pnpm start:firefox
````web-ext` auto reload the extension when `extension/` files changed.
> While Vite handles HMR automatically in the most of the case, [Extensions Reloader](https://chrome.google.com/webstore/detail/fimgfedafeadlieiabdeeaodndnlbhid) is still recommanded for cleaner hard reloading.
### Build
To build the extension, run
```bash
pnpm build
```And then pack files under `extension`, you can upload `extension.crx` or `extension.xpi` to appropriate extension store.
## Credits
[![Volta](https://user-images.githubusercontent.com/904724/195351818-9e826ea9-12a0-4b06-8274-352743cd2047.png)](https://volta.net)
This template is originally made for the [volta.net](https://volta.net) browser extension.
## Variations
This is a variant of [Vitesse](https://github.com/antfu/vitesse), check out the [full variations list](https://github.com/antfu/vitesse#variations).