Simplify package install #37

Merged
merged 3 commits into from Jan 13, 2013

2 participants

@isaacs

This removes the need for a setup.js file, by simplifying the prepublish/install/test logic so that it all lives in package.json.

@isaacs

Also, this makes the test work when your package is not the top level, and gets its mocha-script binary from some parent package. Assuming it's installed locally is brittle.

@isaacs isaacs referenced this pull request in npm/npm Jan 13, 2013
Closed

Make postpublish script to be run on cwd. #3053

@paulmillr
Owner

@isaacs consider this:

  "dependencies": {
    "chokidar": "git://github.com/isaacs/chokidar.git"
  }

simply using git version of this dependency. How will your solution deal with compiling coffeescript? When I execute npm install on your version, it just clones coffee files to node_modules/chokidar which is not usable then.

Than was the whole thing about setup.js, installing git deps.

@paulmillr
Owner

I must say that my current solution ain’t working either. I get:

Error: Cannot find module '/Users/paul/Development/test/test/node_modules/chokidar/node_modules/.bin/coffee'

well, it worked in the past...any thoughts on what can be made?

@andrewrk andrewrk commented on the diff Jan 13, 2013
.npmignore
*~
*.bak
-.DS_Store
+*.diff
@andrewrk
andrewrk added a line comment Jan 13, 2013

these should be in your home folder .gitignore file. .gitignore files that are checked into a repository should only include files associated with the repository.

@andrewrk
andrewrk added a line comment Jan 13, 2013

oh. this is npmignore. still, wtf.

@paulmillr
Owner
paulmillr added a line comment Jan 13, 2013

Everyone keeps saying that. I have .gitignore in my home dir with the contents. Why i’m getting .DS_Store shit in git repos every time then?

@andrewrk
andrewrk added a line comment Jan 13, 2013

do you have this in your global git config?

[core]
  excludesfile = ~/.gitignore
@paulmillr
Owner
paulmillr added a line comment Jan 13, 2013

yay it works

thanks dude. I was tired of having this in my every repo.

@andrewrk
andrewrk added a line comment Jan 13, 2013

👍

@isaacs
isaacs added a line comment Jan 13, 2013

I have no opinions about this, myself. I just copied the relevant .gitignore rules into the .npmignore file. (Some files, such as .DS_Store and .svn and .git are always ignored by npm, no matter what.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@isaacs
{   "dependencies": {
    "chokidar": "git://github.com/isaacs/chokidar.git"
  }
}

Yes, that's not adequately solved by the current approach. The including package would have to have a script or something to build chokidar after it's installed.

Seems like something that npm should handle. There's also potential optimizations to be had around caching git remotes, and to make shrinkwrap work a bit more shrinkwrap-y with git deps, so maybe "run prepublish on install" is something that npm should just do for git targets to make them a bit more first-class.

@paulmillr
Owner

prepublish-on-install for git deps

Would be awesome to have this feature.

@paulmillr paulmillr merged commit 7af9965 into paulmillr:master Jan 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment