np icon indicating copy to clipboard operation
np copied to clipboard

np fails to create tag and add changes to git when versioning nested package.json

Open prgcon opened this issue 6 years ago • 1 comments

Description

When trying to version an Angular library that is inside and Angular workspace (mono-repo) np fails to add changes and create a tag in git.

The first np command (on the top level package.json in step 8) succeeds but second np command (in the nested package-json in step 10) fails.

Steps to reproduce

  1. mkdir np-issue-nested-package-json
  2. cd np-issue-nested-package-json/
  3. ng new np-issue-workspace --createApplication=false
  4. cd np-issue-workspace/
  5. ng g library np-issue-library-with-package-json
  6. git add .
  7. git commit -m "Initial commit"
  8. np patch --any-branch --yolo --no-publish
  9. cd projects/np-issue-library-with-package-json/
  10. np patch --any-branch --yolo --no-publish

Expected behavior

I would have expected Step 10. to succeed when versioning the nested package.json but no tag is created. The package.json in versioned but not commited.

Here is the result of the first np command run in Step 8.

image

Here is the result of the second np command run in Step 9.

image

Environment

np - 5.1.0 Node.js - 10.16.3 npm - 6.9.0 Git - 2.17.1 OS - Ubuntu 18.04.3

prgcon avatar Sep 25 '19 14:09 prgcon

The error seems to be related with not having an upstream branch. Could you give us any more information on that?

dopecodez avatar Jul 12 '20 11:07 dopecodez