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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mridang/semantic-release-packagist

v1.6.0

Published

Semantic Release plugin that prevents major releases unless a corresponding tag exists on a specific branch in an upstream GitHub repository.

Downloads

32

Readme

Semantic Release - Packagist

A semantic-release plugin to automatically trigger a package update on Packagist.

This plugin automates the final step of a PHP package release workflow. It updates the version in your composer.json file, and after semantic-release publishes a new Git tag, it notifies Packagist to sync the new version from your repository. This eliminates the need for manual updates or webhooks, ensuring your Packagist package is always up-to-date with your latest release.

Why?

Automating the release of a PHP package involves more than just creating a Git tag. For a new version to be accessible to the PHP community via Composer, it must be updated on Packagist. This final synchronization step is a common point of friction in an otherwise automated pipeline.

Without this plugin, developers typically face one of two issues:

  • Dependency on a GitHub App: The most common method for automation is installing the official Packagist GitHub App. However, this requires administrative permissions on the repository or organization. Some security policies or development workflows may not permit installing external applications, or you may simply prefer a more lightweight integration.
  • Incomplete Automation: Other existing semantic-release plugins for Composer may correctly update the version in your composer.json file, but they often stop there. They do not handle the final, crucial step of notifying Packagist that a new version is ready. This leaves a manual gap in the release process, forcing you to log in to Packagist and click "Update" or configure separate webhooks.
  • Missing Metadata Validation: Many tools may update your composer.json but might skip the essential step of validating its contents (e.g., via composer validate). This can lead to attempting to publish a new version that Packagist later rejects due to metadata errors, interrupting the release flow and requiring manual intervention.

This plugin provides a lightweight and direct solution by using the Packagist API. Instead of relying on a GitHub App, it authenticates with a simple username and apiToken that you provide. It bridges the gap in the release process by ensuring that after semantic-release successfully creates a new release, your Packagist package is immediately synchronized. This creates a seamless, end-to-end automated pipeline directly within your semantic-release configuration, without requiring extra permissions or external app installations.

Installation

Install using NPM by using the following command:

npm install --save-dev @mridang/semantic-release-packagist

Usage

To use this plugin, add it to your semantic-release configuration file (e.g., .releaserc.js, release.config.js, or in your package.json).

The plugin's prepare step modifies your composer.json and the composer.lock file. For this change to be included in the release commit, the plugin should be placed before @semantic-release/git and @semantic-release/github in the plugins array.

[!IMPORTANT] This plugin updates the version field in your composer.json file during the prepare step. For this change to be included in your release commit, you must configure the @semantic-release/git plugin to add composer.json and the composer.locj to its assets array.

Example Configuration (.releaserc.js):

module.exports = {
  branches: ['main', 'next'],
  plugins: [
    '@semantic-release/commit-analyzer', // Must come first to determine release type
    // The prepare step of the packagist plugin runs here to update composer.json
    [
      '@mridang/semantic-release-packagist',
      {
        username: process.env.PACKAGIST_USERNAME,
        apiToken: process.env.PACKAGIST_TOKEN, // Use an environment variable for security
      },
    ],
    '@semantic-release/release-notes-generator',
    '@semantic-release/changelog',
    '@semantic-release/github', // For creating GitHub releases and comments
    [
      '@semantic-release/git', // To commit package.json, CHANGELOG.md, etc.
      {
        assets: ['composer.json', 'CHANGELOG.md'],
        message:
          'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
      },
    ],
  ],
};

Known Issues

  • None.

Useful links

  • Semantic Release: The core automated version management and package publishing tool.

Contributing

If you have suggestions for how this app could be improved, or want to report a bug, open an issue - we'd love all and any contributions.

License

Apache License 2.0 © 2024 Mridang Agarwalla