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

Add a --preview flag to dry-run np #391

Closed
ntwb opened this issue Apr 18, 2019 · 13 comments · Fixed by #399
Closed

Add a --preview flag to dry-run np #391

ntwb opened this issue Apr 18, 2019 · 13 comments · Fixed by #399
Labels
enhancement 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt help wanted

Comments

@ntwb
Copy link

ntwb commented Apr 18, 2019

Issuehunt badges

Description

Is the feature request related to a problem?

I'd like to be able to run np in a "dry run" mode more so than what it currently does, np already supports the --no-publish flag to prevent it being published to npmjs.com, I'd also like to prevent any changes being pushed to GitHub, hence a --no-push flag also.

This would allow me to test np completely without pushing or publishing anything remotely to either npmjs.com or github.com.

Possible solution

Follow up with a PR similar to that of ca0f193 where the --no-publish flag was added adding a new CLI option --no-push

Alternatives


IssueHunt Summary

tiagodanin tiagodanin has been rewarded.

Backers (Total: $80.00)

Submitted pull Requests


Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

@ntwb
Copy link
Author

ntwb commented Apr 18, 2019

Related: #249/#250 -no-git-tag-version is similar/close to what I'm asking above, though the PR #250 would still push to GitHub which is what I'd like to avoid.

So it would kind of work, but only because (I think) nothing would be committed as the repo would be in a dirty state rather than (what I'd like) is to explicitly not push anything to GitHub

@itaisteinherz
Copy link
Collaborator

itaisteinherz commented Apr 18, 2019

One thing you could do at the moment to achieve this is to avoid setting an upstream branch, which would make np skip pushing to the remote (however this is obviously a hack, not a solution).
Note that this is also related to #386.

@itaisteinherz
Copy link
Collaborator

Adding a dry run option does sound interesting and useful, though. We could add a --preview flag which only prints out the changes/actions np is going to make without actually doing those.

@itaisteinherz itaisteinherz changed the title Feature Request: Add a --no-push CLI flag to not push Git changes Add a --preview flag to dry-run np Apr 18, 2019
@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label May 2, 2019
@IssueHuntBot
Copy link

@IssueHunt has funded $80.00 to this issue.


@itaisteinherz
Copy link
Collaborator

itaisteinherz commented May 8, 2019

I just noticed the --dry-run flag for npm publish, which could be useful here.

@TiagoDanin
Copy link
Contributor

I just noticed the --dry-run flag for npm publish, which could be useful here.

I don't understand 🤔. Did you mean: --no-publish ?

@itaisteinherz
Copy link
Collaborator

No, this is what I meant:

Screenshot

@TiagoDanin
Copy link
Contributor

I believe not, because the NP does not show output of NPM.

@itaisteinherz
Copy link
Collaborator

I believe not, because the NP does not show output of NPM.

Maybe we could show parts of the output returned by npm publish --dry-run, or even the whole output (I'm not sure if listr will allow us to do this though).

@TiagoDanin
Copy link
Contributor

DeepinScreenshot_select-area_20190702111444

Name and version are already displayed in NP. And the output of --dry-run is immediately displayed (no waiting), listr only show one line at a time.

Another problem is that Yarn has no option --dry-run.

PS: Sorry for the delay.

@itaisteinherz
Copy link
Collaborator

@TiagoDanin Since, as you said above, the output of the command isn't really helpful and the option doesn't exist for Yarn, let's just print the publish command.

@cactysman
Copy link

cactysman commented Jul 15, 2019

Please also read through this issue about the npm publish command.

It's super important to know for sure where you are publishing to when it might be private stuff. A simple misconfiguration somewhere might lead to publishing to the NPM registry which you might not want.

@issuehunt-oss
Copy link

issuehunt-oss bot commented Feb 22, 2020

@sindresorhus has rewarded $72.00 to @tiagodanin. See it on IssueHunt

  • 💰 Total deposit: $80.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $8.00

@issuehunt-oss issuehunt-oss bot added 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt and removed 💵 Funded on Issuehunt This issue has been funded on Issuehunt labels Feb 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants