bitovi / syn

Standalone Synthetic Event Library
https://www.npmjs.com/package/syn
MIT License
444 stars 258 forks source link

npm install results in git seeing local changes #101

Closed mickmcgrath13 closed 9 years ago

mickmcgrath13 commented 9 years ago

The package.json file used to have:

//...
  "scripts": {
    "test": "./node_modules/.bin/grunt test --stack",
    "prepublish": "./node_modules/.bin/grunt build"
  },
//...
  "scripts": {
    "test": "grunt test"
  },
//...

With https://github.com/bitovi/syn/pull/100, I changed it to the following to remove duplicate scripts:

//...
  "scripts": {
    "test": "grunt test",
    "prepublish": "./node_modules/.bin/grunt build"
  },
//...

npm install now does a build, and git sees modified local files. Should it do this, or should the prepublish option be removed from scripts?

matthewp commented 9 years ago

I don't understand, what does prepublish have to do with install?

mickmcgrath13 commented 9 years ago

idk. I run npm install, and a build runs if "prepublish" is there. Does scripts run on npm install?

mickmcgrath13 commented 9 years ago

https://docs.npmjs.com/misc/scripts

prepublish: Run BEFORE the package is published. (Also run on local npm install without any arguments.)

matthewp commented 9 years ago

Oh, I think it's fine that it does the build. It's something we do in several projects. The reason we created that is to make sure the build happens before publish.

mickmcgrath13 commented 9 years ago

lol @ https://github.com/npm/npm/issues/3059

..apparently "prepublish" running on npm install is kind of a big deal, and that's just the way it works.

Also, npm install --ignore-scripts does the install the way I would expect, but I would think the general case for people should be clone, and npm install... I wouldn't expect people to remember the --ignore-scripts part, and without it, they'll get local file changes.

matthewp commented 9 years ago

Yeah, we should gitignore the dist/ folder in master and only publish it in a tag by force adding.

mickmcgrath13 commented 9 years ago

https://github.com/bitovi/syn/pull/103

mickmcgrath13 commented 9 years ago

closing in lieu of https://github.com/bitovi/syn/issues/106