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

semantic-release-bundle

v1.2.0

Published

A package designed to replace package versions in JavaScript bundles

Downloads

7

Readme

semantic-release-bundle

A package designed to replace package versions in JavaScript bundles.

Version Bundle size Downloads

CodeFactor SonarCloud Codacy Scrutinizer

Dependencies Security Build Status Coverage Status

Commit activity FOSSA License Made in Ukraine

Table of Contents

Motivation

Sometimes, using a universal semantic-release plugin like @google/semantic-release-replace-plugin or @semantic-release/exec suffices to update versions in arbitrary files. However, for UI bundles, this task becomes challenging. This package provides strategies for comfortable version management, specifically tailored to JS bundles.

Requirements

Platform Status

To use library you need to have node and npm installed in your machine:

  • node >=10
  • npm >=6

Package is continuously tested on darwin, linux and win32 platforms. All active and maintenance LTS node releases are supported.

Installation

To install the library run the following command

  npm i --save-dev semantic-release-bundle

Usage

Configure the plugin in the semantic-release configuration file:

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    [
      "semantic-release-bundle",
      {
        "type": "q-manifest"
      }
    ]
  ]
}

Configuration

Customizable options include:

  • type: required, Strategy to use, 'q-manifest' or 'vite-define'
  • packageJSONPath: Specify the path to the package.json file (default is 'package.json')
  • directory: list of bundle directories (default is ['dist'])
  • updatePackageJSON: Update version in package.json file

Strategy-related options:

  • buildDirectory: For 'q-manifest', specifies the build directory ('build' by default).
  • versionKey: For 'vite-define', specifies the key in define config ('VERSION' by default).

Preconditions

Before using the package, ensure the following assumptions work for your project:

  1. package.json stores the old (unchanged) version during the verifyconditions step.
  2. Bundle (with the unchanged version) is already generated at the moment of the verifyconditions step.
  3. Version change should occur during the prepare step.

How it works

The package scans the bundle for the previous version, which is obtained from package.json. It then replaces all occurrences of the matched pattern with the new version. q-manifest

q-manifest is a strategy suitable for bundles generated by the qwik framework. Look for a sample in tests/bundles/tastoria folder. semantic-release-bundle only modifies parts that import the package.json file because it observes the q-manifest file.

If you use Vite/Rollup for bundle generation but not the qwik framework, you can generate a similar q-manifest.json file and utilize this strategy.

Contribute

Make the changes to the code and tests. Then commit to your branch. Be sure to follow the commit message conventions. Read Contributing Guidelines for details.