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

Allow git push as a publish mechanism #6553

Closed
joeyespo opened this issue Oct 23, 2014 · 1 comment
Closed

Allow git push as a publish mechanism #6553

joeyespo opened this issue Oct 23, 2014 · 1 comment

Comments

@joeyespo
Copy link

There's two problems while using the "create a tarball of your package as-is" method of npm publish.

  1. Publishing a package that has extra files or uncommitted changes. To be fair, this one is my own fault. However, using git push as a deploy mechanism is a welcomed habit that many have. Exposing this would keep the workflows of git users uniform, so it is indeed a "nice to have" in addition to the fact that it prevents you from publishing anything you didn't intend to.
  2. The second is in the handling of cross-platform newlines (npm publish from Windows handles CRLF incorrectly #2097). Since this is an existing problem solved rather well by git, allowing git push would eliminate the long-standing issue for all git users.
@othiym23
Copy link
Contributor

Exposing this would keep the workflows of git users uniform, so it is indeed a "nice to have" in addition to the fact that it prevents you from publishing anything you didn't intend to.

I don't understand how these concerns are related – when running npm pack (which is done prior to pushing anything to the registry in npm publish), both .gitignore and .npmignore are used to filter the contents of the packed tarball. Also, the semantics of npm pack are pretty different from something like git archive or git export, and more often than not, packagers want to include things like bundledDependencies that aren't tracked by git. Introducing a separate path for publishing these files is introduces complexity, which is especially irksome given how brittle installing via git is.

I appreciate the creativity of the suggestion, but we're not going to add this to npm. The workflow is meant to put packages on the registry, and there's enough going on with the registry that allowing git as a publishing mechanism to it is not going to get traction in the foreseeable future.

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

No branches or pull requests

2 participants