{"action":"created","issue":{"url":"https://api.github.com/repos/npm/npm/issues/10074","labels_url":"https://api.github.com/repos/npm/npm/issues/10074/labels{/name}","comments_url":"https://api.github.com/repos/npm/npm/issues/10074/comments","events_url":"https://api.github.com/repos/npm/npm/issues/10074/events","html_url":"https://github.com/npm/npm/issues/10074","id":112707857,"number":10074,"title":"resolving prepublish-on-install","user":{"login":"othiym23","id":418097,"avatar_url":"https://avatars.githubusercontent.com/u/418097?v=3","gravatar_id":"","url":"https://api.github.com/users/othiym23","html_url":"https://github.com/othiym23","followers_url":"https://api.github.com/users/othiym23/followers","following_url":"https://api.github.com/users/othiym23/following{/other_user}","gists_url":"https://api.github.com/users/othiym23/gists{/gist_id}","starred_url":"https://api.github.com/users/othiym23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/othiym23/subscriptions","organizations_url":"https://api.github.com/users/othiym23/orgs","repos_url":"https://api.github.com/users/othiym23/repos","events_url":"https://api.github.com/users/othiym23/events{/privacy}","received_events_url":"https://api.github.com/users/othiym23/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/npm/npm/labels/feature-request","name":"feature-request","color":"ACE1AF"},{"url":"https://api.github.com/repos/npm/npm/labels/ux","name":"ux","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-22T00:53:41Z","updated_at":"2015-10-22T01:02:38Z","closed_at":null,"body":"See also: #3059, #8402, #9722, #9733, probably many others.\r\n\r\nMany, many people intensely dislike the fact that a lifecycle event named \"prepublish\" also gets run when a package is also installed for development, as this precludes the ability to have a set of validation checks that get run before publishing (and also because the name becomes confusingly inaccurate). The reasons for this behavior have been discussed, bikeshedded, and vehemently argued over elsewhere. There is a consensus that the current behavior is undesirable, and the CLI team agrees that this situation needs to be fixed. This is what we intend to do:\r\n\r\n1. Introduce a new `prepare` lifecycle event, which has the current behavior of the `prepublish` event – it runs before the package tarball is packed and uploaded to the registry during the publishing process, as well as when you run `npm install` (with no package name) after cloning a package, to prepare it for use (i.e. by transpiling source).\r\n2. Introduce a new `prepublishOnly` lifecycle event, which runs _only_ at prepublish time.\r\n3. Add a new warning when the `prepublish` hook is used that the current behavior is deprecated, and will be removed at some point in the future.\r\n4. In a year or so, make a semver-major bump to npm and make `prepublish`'s behavior match `prepublishOnly`.\r\n5. Either then or sometime after that, deprecate `prepublishOnly` and have just `prepare` and `prepublish`.\r\n\r\nThis should allow everyone to get the behavior they want, and will (eventually) result in a solution that is intuitive and unsurprising to everyone, and allows us to do so in about as gentle a way as possible for something so potentially disruptive.\r\n\r\nThoughts? Things we haven't considered? Parts 1-3 can (and will) be implemented as part of `npm@3`, probably over the next couple months, so it would be nice to get people's feedback relatively quickly."},"comment":{"url":"https://api.github.com/repos/npm/npm/issues/comments/150068059","html_url":"https://github.com/npm/npm/issues/10074#issuecomment-150068059","issue_url":"https://api.github.com/repos/npm/npm/issues/10074","id":150068059,"user":{"login":"fengmk2","id":156269,"avatar_url":"https://avatars.githubusercontent.com/u/156269?v=3","gravatar_id":"","url":"https://api.github.com/users/fengmk2","html_url":"https://github.com/fengmk2","followers_url":"https://api.github.com/users/fengmk2/followers","following_url":"https://api.github.com/users/fengmk2/following{/other_user}","gists_url":"https://api.github.com/users/fengmk2/gists{/gist_id}","starred_url":"https://api.github.com/users/fengmk2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fengmk2/subscriptions","organizations_url":"https://api.github.com/users/fengmk2/orgs","repos_url":"https://api.github.com/users/fengmk2/repos","events_url":"https://api.github.com/users/fengmk2/events{/privacy}","received_events_url":"https://api.github.com/users/fengmk2/received_events","type":"User","site_admin":false},"created_at":"2015-10-22T01:02:38Z","updated_at":"2015-10-22T01:02:38Z","body":"+1 great!"}}