Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

git clone + npm install produces dirty checkout #548

Closed
ryan-roemer opened this issue Jan 21, 2016 · 4 comments
Closed

git clone + npm install produces dirty checkout #548

ryan-roemer opened this issue Jan 21, 2016 · 4 comments
Labels

Comments

@ryan-roemer
Copy link
Member

With commit 90f353b we now have a prepublish command that mutates package.json.

Unfortunately, there's a wontfix bug with NPM wherein npm install also runs preublish. This manifests with a situation where a fresh git clone + install (or any install) yields a dirty checkout:

$ git clone git@github.com:FormidableLabs/radium.git

$ cd radium

$ npm install
# ... SNIPPED ...
> radium@0.16.2 deps-fix /Users/rroemer/Desktop/TEMP_RADUM/radium
> babel-node ./npm-scripts/move-babel-to-dependencies.js
# ... SNIPPED ...

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   package.json

no changes added to commit (use "git add" and/or "git commit -a")

There is some new discussion of changed behavior / a new hook to address this situation in npm v4 when that's released.

@zachhale
Copy link

Yuck, that looks super annoying.

@ianobermiller
Copy link
Contributor

Oh right, forgot about that "feature" they are going to finally fix it in npm@4, but that doesn't really help us now. Ideas?

For now, I think making modification of Radium slightly less annoying is worth not having babel in published dependencies.

@ryan-roemer
Copy link
Member Author

@ianobermiller -- This is a bit of a potentially inconvenient switch but if you went instead of a prepublish workflow doing a:

preversion
version
postversion

workflow, preversion doesn't have the bug that prepublish does.

but, you'd have to publish with npm version

@ianobermiller
Copy link
Contributor

Fixed in 92046c8.

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

No branches or pull requests

3 participants