Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{ "packages": { "": { "version": "1.0.0" } } } in package-lock.json isn't bumped #732

Closed
regseb opened this issue Mar 18, 2021 · 4 comments
Labels

Comments

@regseb
Copy link
Contributor

regseb commented Mar 18, 2021

Describe the bug
{ "packages": { "": { "version": "1.0.0" } } } in package-lock.json isn't bumped.

Current behavior
{ "packages": { "": { "version": "1.0.0" } } } in package-lock.json is unchanged.

Expected behavior
Bump { "packages": { "": { "version": "1.0.0" } } } in package-lock.json.

Environment

  • standard-version version(s): v9.1.1
  • Node/npm version: Node 14.16.0 / npm 7.6.1
  • OS: Ubuntu 20.04.2 LTS

Possible Solution
Search for the property and if it exists: update the value.

Additional context
This property was probably added in lockfileVersion 2 with npm v7.

Steps to reproduce this issue

git init
npm init
npm install standard-version --save-dev
git add package.json package-lock.json
git commit -m "foo"
npx standard-version
head package-lock.json
{
  "name": "testcase",
  "version": "1.0.1",
  "lockfileVersion": 2,
  "requires": true,
  "packages": {
    "": {
      "version": "1.0.0",
      "license": "ISC",
      "devDependencies": {
npm install
head package-lock.json
{
  "name": "testcase",
  "version": "1.0.1",
  "lockfileVersion": 2,
  "requires": true,
  "packages": {
    "": {
      "version": "1.0.1",
      "license": "ISC",
      "devDependencies": {
@regseb regseb added the bug label Mar 18, 2021
@MiniGod
Copy link
Contributor

MiniGod commented Mar 22, 2021

There's a PR for this: #713

@vicrep
Copy link
Contributor

vicrep commented Jul 15, 2021

Closed by #713 and released as of v9.3.1 :)

@regseb
Copy link
Contributor Author

regseb commented Sep 1, 2021

I confirm that this issue is fixed in version 9.3.1. @vicrep Thank you.

@regseb regseb closed this as completed Sep 1, 2021
@mominafiz
Copy link

@vicrep I was wondering why the package-lock.json is not bumped or excluded by standard-version. Even if updater is used in bumpFiles it doesn't do an update.

Maybe this issue was fixed and bug has re-appeared

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants