npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

svelte-extension-starter

v2.0.0

Published

> *Note: This Svelte Chrome Extension Starter Template makes building extensions with Manifest V3 and Svelte a breeze!*

Downloads

3

Readme

Svelte Chrome Extension Starter Template with Manifest V3 🚀

Note: This Svelte Chrome Extension Starter Template makes building extensions with Manifest V3 and Svelte a breeze!

Introduction

Hey there! I'm Rahit, and I've been working with Svelte to develop web apps for quite some time now. Recently, I encountered the challenge of building a Chrome extension using Svelte, only to discover that it can be quite tricky with the default Svelte or SvelteKit configuration.

After conducting several experiments and tinkering around, I've managed to create my very own working solution. This template is fully compatible with Manifest V3 and seamlessly integrates Svelte, making the process of building Chrome extensions a breeze.

Key Features

Here's what you can expect from this starter project:

  • Out-of-the-box configuration for background script, content script, popup, and new tab pages.
  • TypeScript, Tailwind CSS, and PostCSS are pre-configured, allowing you to jump right into development.
  • A starter manifest file is included, providing a foundation for customizing your extension.
  • An esbuild config file is provided, enabling the creation of self-contained Svelte components without the need for separate HTML files.

Getting Started

Follow these steps to get started with your Svelte Chrome extension:

  1. Clone this repository to your local machine.
  2. Run pnpm i to install the project dependencies.

Next, you'll need to make some edits to the following files:

  • Background script/Service Worker: src/background/background.ts
  • Content script: src/content/Content.svelte
  • New Tab: src/content/NewTab.svelte
  • Popup: src/content/Popup.svelte
  • Manifest: public/manifest.json (Update the manifest with the necessary information for your extension)

Building the Extension

To build your project, follow these steps:

  1. Run pnpm run build to compile the project.
  2. The final build will be located in the /build directory.
  3. During development, while in Chrome's developer mode, select the build folder when installing the extension.

Local Testing

For local testing and debugging purposes, use the following steps:

  1. Run pnpm run build --watch to continuously build the project whenever any file changes occur.
  2. If you make changes to the manifest, remember to reload your Chrome extension.
  3. Alternatively, you can run pnpm run dev to start a local server.
  4. Access /popup.html, /content.html, or /newtab.html in your browser to view the rendered content.
  5. Please note that Chrome APIs will not work when using the development server.

Additional Notes

Here are a few additional details and customization options to consider:

  • By default, the content script injects HTML inside a Shadow DOM, just before the head. Modify the content.ts file to change this behavior.
  • If you prefer not to use the Shadow DOM, set useShadowDom to false.

That's it! You're all set to build your awesome Chrome extension using Svelte and Manifest V3. Happy coding! 🎉