semver icon indicating copy to clipboard operation
semver copied to clipboard

No version bump after change in package.json

Open Qwal opened this issue 2 years ago • 3 comments

https://github.com/jscutlery/semver/blob/ffb5d59353dd78358cf10242fc53925c1868a66b/packages/semver/src/executors/version/utils/get-project-dependencies.ts#L33

I think we are missing here a dependency updates. For example I would like to create a new version for the app when I update React from version 18.1.0 to 18.2.0

When running nx affected it correctly displays all the apps affected by version bump in package.json but new version is not created.

Qwal avatar Jul 05 '22 10:07 Qwal

This is a duplicate of https://github.com/jscutlery/semver/issues/477 I implemented a workaround in https://github.com/jscutlery/semver/pull/480 Just pass --allowEmptyRelease when running the version target

ianldgs avatar Jul 15 '22 10:07 ianldgs

First of all: Thx for the plugin!

Is the workaround enough though?

Just switched recently from semantic-release, which is listing all dependency updates in the changelog and I would love to see this behavior also with @jscutlery/semver.

But would you be ok with an option, for example, releaseAtLeast: 'patch'?

I don't think I could commit to making the change to look at all of the implicit dependencies.

And TBH, if people are running this library with affected, NX would in theory already be doing this lookup of the implicit dependencies for us and only calling the version target if the library was really affected, either by an explicit dependency or implicit.

Are dependencies (not talking about devDependencies) really implicit dependencies? I think they are not and actually should be listed in the changelog.

bgutschke avatar Oct 12 '22 08:10 bgutschke

Are dependencies (not talking about devDependencies) really implicit dependencies? I think they are not and actually should be listed in the changelog.

Dependencies (from package.json) are explicit when you import them via some js/ts file.

But an NX workspace comes with the following lines in nx.json:

  "implicitDependencies": {
    "package.json": {
      "dependencies": "*",
      "devDependencies": "*"
    },
    ".eslintrc.json": "*"
  },

So yes, anything listed in dependencies or devDependencies will cause every module to be affected, by default. You could remove the implicit dependency on package.json, which could be a bit risky but could simply work.

There is a discussion here about this behaviour. And I made a comment about why I think that is, but no confirmation.

ianldgs avatar Oct 12 '22 09:10 ianldgs