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-monorepo-hooks

v2.10.0

Published

Semantic release monorepo hooks

Downloads

494

Readme

semantic-release-monorepo-hooks

Workaround to handle semantic-release-monorepo multipublishing

CI npm (tag) Maintainability Test Coverage

Migration proposal

This project provided invaluable experience in understanding how lerna and semantic-release work. Along with this came the realization that the approach needed to be changed. Here's the short note on the evolution of these ideas. Thus, today we suggest using multi-semantic-release as the best alternative:

  • Much more robust and predictable.
  • Maintainable and maintained.
  • Compatible with the latest versions of semrel and its plugins.
  • Supports parallel release flow (faster).
  • Brings an automatic update of cross-packages dependencies.
  • Project is used and supported as part of QIWI in-house development infrastructure (not sure if this is a positive point :-).

Further development of this project seems futile. Anyway, we will regularly apply vulnerability patches for as long as possible. Thank you all for your feedback, PRs, downloads and stars.

Problem

  1. semantic-release does not support lerna-based repos aka monorepos out of box.
  2. semantic-release-monorepo can not release several packages at once: after the first sub-release it appends a new git version tag, so any next run finds no changes.
[Semantic release]: Found 0 commits for package *** since last release

Install

  npm i -D semantic-release
  npm i -D semantic-release-monorepo
  npm i -D semantic-release-monorepo-hooks

and plugins:

{
  "devDependencies": {
    "@semantic-release/changelog": "^3.0.1",
    "@semantic-release/commit-analyzer": "^6.1.0",
    "@semantic-release/git": "7.0.5",
    "@semantic-release/github": "5.2.1",
    "@semantic-release/npm": "5.0.5",
    "@semantic-release/release-notes-generator": "7.1.2",
    "lerna": "^3.4.3",
    "semantic-release": "15.10.6",
    "semantic-release-monorepo": "6.1.1",
    "semantic-release-monorepo-hooks": "2.6.2",
    "semantic-release-plugin-decorators": "^2.0.0"
  }
}

Configure

1. Configure .releaserc.js
  const hooks = require('semantic-release-monorepo-hooks')
  const output = hooks()
  
  module.exports = {
    branch: 'master',
    tagFormat: 'v${version}',
    prepare: [
      '@semantic-release/changelog',
      '@semantic-release/npm',
      {
        'path': '@semantic-release/git',
        'message': 'chore(' + output.package + '): release ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}'
      }
    ],
    publish: [
      '@semantic-release/npm'
    ],
    verifyConditions: [
      '@semantic-release/npm',
      '@semantic-release/git'
    ],
    monorepo: {
      analyzeCommits: [
        '@semantic-release/commit-analyzer'
      ],
      generateNotes: [
        '@semantic-release/release-notes-generator'
      ]
    }
  };
2. Configure .travis.yml
deploy:
  provider: script
  skip_cleanup: true
  script:
    - yarn lerna exec --concurrency 1 "npx --no-install semantic-release -e semantic-release-monorepo" && node -e "require('semantic-release-monorepo-hooks').hookAfterAll()"
3. Configure env vars

GH_TOKEN and GH_USER must be declared for git push. See drop_last_tag.sh for details.

hooks()

Hooks reverts some effects of previous semantic-release run and returns info map as a result:

  {
    isModified: true,
    isLastModified: false,
    isLastRun: false,
    total: 5,
    processed: 1,
    modified: 2,
    modifiedPacks: [ '@qiwi/pijma-core', '@qiwi/pijma-desktop' ],
    package: '@qiwi/pijma-core',
    tag: 'v1.5.0\n',
    run: 1
  }

Alternatives

Take a look at multi-semantic-release. With --execasync flag it produces the same effect but in a different way.

License

MIT