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

publish-browser-extension

v2.1.3

Published

Easily publish web extensions to their stores

Downloads

28,592

Readme

https://github.com/aklinker1/publish-browser-extension/assets/10101283/b0e856ca-4e26-4c7e-9ff8-c900e203cab5

Features

  • Publish to the Chrome Web Store, Firefox Addon Store, and Edge Addon Store
  • Helper script to generate secrets and configure options
  • Upload sources ZIP to the Firefox Addon Store

[!IMPORTANT]

You are responsible for uploading and submitting an extension for the first time by hand. publish-browser-extension does not provide tools for creating a new extension.

Install

npm i -D publish-browser-extension
pnpm i -D publish-browser-extension
yarn add -D publish-browser-extension

CLI Usage

To get started, run the init command. It will walk you through generating all the necessary environment variables/CLI flags, saving them to a .env.submit file:

publish-extension init

All CLI flags can be passed as environment variables instead. For example, setting the CHROME_CLIENT_ID environment variable is equivalent to passing --chrome-client-id. Just convert the flag to UPPER_SNAKE_CASE.

Then, just run the submit command, passing the ZIP files you want to submit:

publish-extension \
  --chrome-zip dist/chrome.zip \
  --firefox-zip dist/firefox.zip --firefox-sources-zip dist/sources.zip \
  --edge-zip dist/chrome.zip

publish-extesion will automatically look for a .env.submit file and load it if it exists.

JS Usage

import { publishExtension } from 'publish-browser-extension';

publishExtension({
  dryRun: true,
  chrome: {
    zip: 'dist/chrome.zip',
    extensionId: '<cws-extension-id>',
    clientId: '<gcp-client-id>',
    clientSecret: '<gcp-client-secret>',
    refreshToken: '<gcp-refresh-token>',
    publishTarget: '<default|trustedTesters>',
    skipSubmitReview: false,
  },
  firefox: {
    zip: 'dist/firefox.zip',
    sourcesZip: 'dist/sources.zip',
    extensionId: '<addons-extension-id>',
    jwtIssuer: '<addons-jwt-issuer>',
    jwtSecret: '<addons-jwt-secret>',
    channel: '<listed|unlisted>',
  },
  edge: {
    zip: 'dist/chrome.zip',
    productId: "<edge-product-id>",
    clientId: "<edge-client-id>",
    clientSecret: "<edge-client-secret>",
    accessTokenUrl: "<edge-access-token-url>",
    skipSubmitReview: false,
  },
})
  .then(results => console.log(results))
  .catch(err => console.error(err));

Contributing

Contributor Setup

  1. Install node
  2. Install pnpm
    corepack enable
  3. Install dependencies
    pnpm i
  4. Run the init command to generate a .env.submit file for testing
    pnpm publish-extension init

    [!WARNING]

    Make sure to set the Firefox channel to "unlisted", chrome's publish target to "trustedTesters", and don't submit the extension for review for Chrome or Edge. This will prevent you from accidentally releasing one of the test extensions publically.

  5. Run the dev commands to upload a test extension to the stores:
    pnpm dev:all
    pnpm dev:chrome
    pnpm dev:firefox
    pnpm dev:edge