Skip to content

beachball not updating package-lock.json version field when publishing #525

@matthias-ccri

Description

@matthias-ccri

Hello,

I am using beachball to manage a single-package repo (not a monorepo), which it says on the beachball site: "single or monorepo". I'm using npm. I understand that the majority of monorepo users are using yarn, but npm is popular in the single repo ecosystem. Also, the best practice for npm is to use lockfiles (package-lock.json).

The issue is that package-lock.json files have a version field that corresponds to the version field of package.json, but beachball does not update this field in package-lock.json. Other tooling does, such as the npm version command.

Currently our workaround is to do some manual script wrangling with git:

# Beachball doesn't update package-lock.json files when publishing.
- npx beachball publish --yes --no-push
- npm i --package-lock-only
- git add -A
- git commit -m "applying package updates [skip ci]"
- git push --set-upstream origin main

This is a bit uglier than the happy path:

npx beachball publish --yes --message "applying package updates [skip ci]"

This related issue (#482) saw the same issue and added a postpublish hook, but it's not clear how to use it.

I do use beachball with yarn in other monorepos and it's wonderful. It would just be nice if beachball updated the lockfile. Would this be hard?

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions