-
Notifications
You must be signed in to change notification settings - Fork 36
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
feat: add new bump option "prefix" #101
Conversation
Could plz clarify why |
Because looks like I've added a test to be able to compare differences with |
@antongolub what do you think about this? |
Perhaps, we have an inaccuracy in describing of 'bump.inherit' behavior. Let's look on the test instead: describe("resolveNextVersion()", () => {
// prettier-ignore
const cases = [
["1.0.0", "1.0.1", undefined, "1.0.1"],
["1.0.0", "1.0.1", "override", "1.0.1"],
["*", "1.3.0", "satisfy", "*"],
["^1.0.0", "1.0.1", "satisfy", "^1.0.0"],
["^1.2.0", "1.3.0", "satisfy", "^1.2.0"],
["1.2.x", "1.2.2", "satisfy", "1.2.x"],
["~1.0.0", "1.1.0", "inherit", "~1.1.0"],
["1.2.x", "1.2.1", "inherit", "1.2.x"],
["1.2.x", "1.3.0", "inherit", "1.3.x"],
["^1.0.0", "2.0.0", "inherit", "^2.0.0"],
["*", "2.0.0", "inherit", "*"],
["~1.0", "2.0.0", "inherit", "~2.0"],
["~2.0", "2.1.0", "inherit", "~2.1"],
] If |
@antongolub did you got time to have a look at it? |
@antongolub we are also running into a similar issue where the I my test project, I ran changes that should have hit this test case (in dependencies and peerDependencies)
except that it actually inserted |
@antongolub this is very problematic. Do you prefer to add this PR or still want to find out if this is a bug. About |
@moroine, there's no bug as I can see now. And your feature is not covered by
I've landed your proposal on our experimental fork: https://github.com/qiwi/multi-semantic-release/pull/70/files |
@antongolub your changes are excellent, I've also used your descriptions 😄 What are the differences with |
The main diff: @qiwi fork replaces concurrent event-driven flow with toposort-based queues. It's definitely slower, but it's easier to debug our proprietary plugins. |
package.json
Outdated
@@ -5,7 +5,8 @@ | |||
"license": "0BSD", | |||
"engines": { | |||
"node": ">=10.18", | |||
"yarn": ">=1.0.0" | |||
"yarn": ">=1.0.0", | |||
"npm": "please-use-yarn" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm... npm v7+ works with monorepos as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but the repository is using yarn.lock
and npm
will ignore yarn.lock
and create package-lock.json
; hence this will remove the advantage of having lock file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is clear, but I've never seen this kind of restriction anywhere else) Maybe it would be enough just to add package-lock.json
to gitignore instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@antongolub I revert this change
@moroine, LGTM, I'm ready to merge. But could you check what happens if: if (scope[dependency.name]) {
scope[dependency.name] = resolveNextVersion(dependency._lastRelease?.version || '0.0.0', dependency._nextRelease?.version, bumpStrategy, prefix);
} I think it would be better if only |
@moroine, this works: const { isObject, isEqual, transform, get } = require("lodash");
//...
if (scope[dependency.name]) {
scope[dependency.name] = resolveNextVersion(
get(dependency, "_lastRelease.version", "0.0.0"),
release.version,
bumpStrategy,
prefix
);
} |
@moroine, finally merged. Thanks a lot for your improvements and for your patience! The new feature will be available in v2.13.0. |
🎉 This PR is included in version 2.13.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Use Case:
Let's say we have:
a --> b
(a
is a deps ofb
&c
)Here are the
package.json
definition ofa
&b
in the repository (we use0.0.0
to force using local versions):When publishing the new version
1.0.1
the published package.json will be: