-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Lerna version needs code to be on a branch #1869
Comments
Yeah, your server needs to stop stripping Just because you're avoiding certain git operations doesn't mean all git calls are skipped. |
But should lerna care about what changed? This information is not used in the above described scenario. Wouldn't it be cleaner to skip the overhead of evaluating the git files / determining what changed when this information is irrelevant? |
|
I guess so ;) Just seemed like odd behavior to me. |
Hello @evocateur, I have to try this again, because it is driving me crazy right now... First of all my previous workaround Now, I am in contact with the people managing our central build service and I was able to move the version update before the removal of the .git files. Unfortunately, I just realized this still does not allow us to use lerna for version updates as they are not checking out branches but commits, which is a good thing as this ensures there will be no changes pushed back to the branch. So once more, I would like to reopen the discussion: Why should Looking at the implementation of the command, I do not see where the lerna/commands/version/index.js Line 88 in c78a86c
I wonder whether just replacing this: lerna/commands/version/index.js Line 90 in c78a86c
with this: if ((this.pushToRemote || this.options.allowBranch || this.commitAndTag) && this.currentBranch === "HEAD") would already do the trick? (Well, I guess there is more to that, but I just do not believe that there is no getting around that, when this is clearly unused). Let me know what you think. I am willing to help with this, as I think lerna is an awesome tool that takes away some of the complexity of maintaining a multipackage repo with dynamically generated packages. I want to use lerna, but at the moment I don't see any better solution than creating a script that updates the versions of my interdependent packages, or do you have better suggestions? |
|
This brings `lerna version` more in line with `npm version` behavior. Fixes #1869
I am trying to run
lerna version
in a non-git folder. More specifically I am skipping all git related actions by runninglerna version --no-git-tag-version --no-push --exact 0.0.1-SNAPSHOT
resulting in failure, due to this check.Expected Behavior
I would expect this to be independent of git in the same way as npm is and just update the package.json versions:
[Only] if run in a git repo, it will also create a version commit and tag.
This way the
--no-git-tag-version --no-push
arguments would be obsolete in a non-git project.Current Behavior
This currently fails with
ENOGIT
.Possible Solution
Check the branch only in case the git based features are used (
allow-branch
,git-tag-version
, etc.).Steps to Reproduce (for bugs)
rm -rf **/.git
lerna version <version>
Context
I am using lerna to publish to our internal registry from a central build server. Most of the things happening on this server are out of my hands. There the code is checked out, then stripped of any potential "overhead" files (node_modules, .git and files created by the build), and
npm install
ed.This is when I set the version.
Currently I was able to work around this issue by running
lerna exec npm version 0.0.1-SNAPSHOT
.Your Environment
Centrally managed build server 🔒
lerna --version
npm --version
node --version
The text was updated successfully, but these errors were encountered: