.npmignore isn't respected for git repos

When finished, this will fix #6400. Right now it's just a failing test case (that tries to follow all the current conventions for npm test cases). Also ensures that we don't see regressions with ordinary npm packing.