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

@pohy/semantic-release-chrome

v0.1.1

Published

Set of semantic-release plugins for publishing a Chrome extension release

Downloads

12

Readme

Build Status version downloads MIT License

PRs Welcome Code of Conduct

Watch on GitHub Star on GitHub Tweet

Installation

This module is distributed via npm which is bundled with node and should be installed as one of your project's devDependencies:

npm install --save-dev semantic-release-chrome

Description

This package provides a set of semantic-release plugins for you to easily publish Chrome extensions automatically. Besides creating a release on the Chrome webstore, it also writes the correct version to the manifest.json and creates a zip file containing everything inside the dist folder, so you can use the official @semantic-release/github plugin and upload the release to the GitHub releases page, so your users can easily rollback to an earlier version if a newer one introduces a bad bug.

Usage

This package export the following plugins:

verifyConditions

Verify the presence of the authentication parameters, which are set via environment variables (see Chrome webstore authentication).

verifyConditions parameters

  • extensionId: REQUIRED parameter. The extension id from the webstore. For example: If the url of your extension is https://chrome.google.com/webstore/detail/webplayer-hotkeys-shortcu/ikmkicnmahfdilneilgibeppbnolgkaf, then the last portion, ikmkicnmahfdilneilgibeppbnolgkaf, will be the extension id. You can also take this ID on the developers dashboard, under the name Item ID located inside the More info dialog. This is used so that we can confirm that the credentials are working for the extension you are trying to publish.

  • target: Valid options are:

    • local: Skips Chrome store credentials verification

prepare

Writes the correct version to the manifest.json and creates a zip file with everything inside the dist folder.

This plugin requires some parameters to be set, so be sure to check below and fill them accordingly.

prepare parameters

  • asset: REQUIRED parameter. The filename of the zip file.

  • distFolder: The folder that will be zipped. Defaults to dist.

  • manifestPath: The path of the manifest.json file inside the dist folder. Defaults to <distFolder parameter>/manifest.json.

The asset parameter is parsed with Lodash template. The following variables are available: branch, lastRelease, nextRelease and commits. Search on the plugins documentation to see the type of those objects.

Example: my-extension_v${nextRelease.version}_${branch.name}.zip will result in something like my-extension_v2.3.1_main.zip

publish

Uploads the generated zip file to the webstore and publishes a new release.

Unfortunately, due to Google's restrictions, this plugin can only publish extensions that already exists on the store, so you will have to at least make a draft release for yourself, so the plugin can create a proper release for the first time. You can create a draft release with just a minimum manifest.json with version 0.0.1 compressed in a zip file. If you decide to make the draft, make sure to fill all the required fields on the drafts page, otherwise the publish will fail with a 400 status code (Bad request).

publish parameters

  • extensionId: REQUIRED parameter. The extension id from the webstore. For example: If the url of your extension is https://chrome.google.com/webstore/detail/webplayer-hotkeys-shortcu/ikmkicnmahfdilneilgibeppbnolgkaf, then the last portion, ikmkicnmahfdilneilgibeppbnolgkaf, will be the extension id. You can also take this ID on the developers dashboard, under the name Item ID located inside the More info dialog.

  • asset: REQUIRED parameter. The zip file that will be published to the chrome webstore.

  • target: Valid options are:

    • default: The extension will be publicly available to everyone. This is the default option if left blank.
    • draft: Uploads the extension to the webstore, but skips the publishing step.
    • trustedTesters: Releases the extension as a private extension. Defaults to default.
    • local: Skips the publish step

The asset parameter is parsed with Lodash template. The following variables are available: branch, lastRelease, nextRelease and commits. Search on the plugins documentation to see the type of those objects.

Example: my-extension_v${nextRelease.version}_${branch.name}.zip will result in something like my-extension_v2.3.1_main.zip

Chrome webstore authentication

You will need to get three parameters from the Google API: a clientId, a clientSecret and a refreshToken. For more information on how to get those parameters and how to set the environment variables which are required in order for this plugin to work properly, read this guide.

Release configs

Use semantic-release-chrome as part of verifyConditions, prepare and publish.

A basic configuration file example is available below:

{
  "plugins": [
    [
      "semantic-release-chrome",
      {
        "extensionId": "mppjhhbajcciljocgbadbhbgphjfdmhj",
        "asset": "my-extension.zip"
      }
    ],
    [
      "@semantic-release/github",
      {
        "assets": ["my-extension.zip"]
      }
    ]
  ]
}

For more info about each config, see the parameters for each plugin.

For more info on the configuration file, see the configuration file documentation on the semantic-release repository.

LICENSE

MIT