@ni/beachball-lock-update

Beachball script to update package-lock.json files in npm workspace monorepos

Usage no npm install needed!

<script type="module">
  import niBeachballLockUpdate from 'https://cdn.skypack.dev/@ni/beachball-lock-update';
</script>

README

ni | beachball lock update

Beachball lock update

NPM Version

A tool to use beachball with npm monorepos. Specifically to workaround beachball issue #525.

This package provides a beachball postbump hook implementation that bumps the versions of package references inside a package-lock.json file during beachball's publish step.

Note: This package does a simple search and replace inside the package-lock.json file. Plan to update the script if it does not leave the package-lock.json in an expected state.

Getting Started

  1. Install the package with npm i -D @ni/beachball-lock-update.

  2. Integrate beachball in your application.

    Note: This tool requires beachball >= v2.20.0 to leverage the postbump hook (this is represented in the peerDependencies of the package).

  3. In a beachball configuration file add a bostbump hook using @ni/beachball-lock-update:

     const path = require('path');
     const lockPath = path.resolve(__dirname, './package-lock.json');
     const { createPostbump } = require('@ni/beachball-lock-update');
    
     module.exports = {
         hooks: {
             postbump: createPostbump(lockPath)
         }
     };
    
  4. Enjoy!