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

Skip dirty check on npm version step? #75

Closed
unkillbob opened this issue Aug 2, 2016 · 1 comment
Closed

Skip dirty check on npm version step? #75

unkillbob opened this issue Aug 2, 2016 · 1 comment

Comments

@unkillbob
Copy link
Contributor

Running into a tricky situation with our modules that are published to private git repos:

  1. Starting with a clean master, run np patch
  2. np does dirty checking and everything is legit, moves on
  3. As a prerequisite to running the tests we do a build of the module which changes some of the dist files
  4. When np gets to the npm version step this step fails because the tree is now dirty

This is an unfortunate side effect of a) having dist files that we only want to update as part of a publish and b) having to commit those dist files to git because we npm install out of git.

I think what we need is to be able to npm version --force which as per the docs will skip the dirty check.

I'm hesitant to set force: true in npmrc or the package.json because:

  1. we'd have to do that on every repo we want to publish
  2. force applies to more than just the version command

Any thoughts on how we could support this? I'm trying to think how we can avoid adding another flag to np but am struggling to find a better idea. I'm quite happy to contribute the solution, just wanted to gather some input on what that solution should be first 👍

@sindresorhus
Copy link
Owner

I think np should just do npm version --force by default. It already does it's own dirty checking upfront anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants