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

run build not prepublish script before npm install <noargs> #9733

Closed
wants to merge 1 commit into from

Conversation

ahdinosaur
Copy link

hey. o/

everyone knows that prepublish before npm install <noargs> is a misfeature, we honestly should fix it in some upcoming release (4.0.0?).

here's a strawman for a particular implementation based on:

[0]

@dfellis: I use prepublish to actually take care of chores that need to be done
prior to publishing, such as generating a minified version for
browsers, building documentation from the source code, making the
commit for these things and tagging that commit with the new version
number.

[1]

@jussi-kalliokoski: When you think of prepublish as build, things start making sense. For
example:

  • Travis CI default setup is npm install && npm test, so basically the
    idea is that after install, your package is ready, then you test it.
  • You download the sources of a service, then to get it up and running,
    you run npm install && npm start.
  • You scp the sources of a node module from somewhere, then you go into
    the directory, you run npm install and you expect it to be ready to used
    from outside.

So basically, the idea is that npm install without arguments gives you
the same result as installing the package from the npm repositories,
where it has already been built.

also run `build` before `prepublish` script.

[semver-major]

ref: npm#3059 (comment)

> @dfellis: I use `prepublish` to actually take care of chores that need to be done
> prior to publishing, such as generating a minified version for
> browsers, building documentation from the source code, making the
> commit for these things and tagging that commit with the new version
> number.

ref: npm#3059 (comment)

> @jussi-kalliokoski: When you think of prepublish as build, things start making sense. For
> example:
>
> - Travis CI default setup is `npm install && npm test`, so basically the
>   idea is that after install, your package is ready, then you test it.
> - You download the sources of a service, then to get it up and running,
>   you run `npm install && npm start`.
> - You scp the sources of a node module from somewhere, then you go into
>   the directory, you run `npm install` and you expect it to be ready to used
>   from outside.
>
> So basically, the idea is that `npm install` without arguments gives you
> the same result as installing the package from the npm repositories,
> where it has already been built.

meow =^•.•^=
@othiym23
Copy link
Contributor

Closing in favor of #10074, which I think has a solution that will work for everyone.

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

Successfully merging this pull request may close these issues.

None yet

2 participants