Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more hooks: install + test #792

Open
2 tasks
wilzbach opened this issue Mar 16, 2016 · 1 comment
Open
2 tasks

more hooks: install + test #792

wilzbach opened this issue Mar 16, 2016 · 1 comment

Comments

@wilzbach
Copy link
Member

Afaict it is quite common to combine multiple package managers, especially setting up web projects (e.g. bower). Therefore a common use case is to keep the package manager in sync without wasting resources.
A typical solution (e.g. by npm) is to provide a postinstall hook that is only run when a local installation finished. So as a solution to the bower problem, I imagine a hook similar too:

postInstallationCommand "bower install"

Nota bene: those hooks are run transitively - when a package as to be built as dependency they are run too.

A quick peek over npm's hooks brings me to this list:

  • {pre,post}installCommand
  • {pre,post}testCommand

The latter could be quite useful for custom unittest integration (e.g. code coverage or performance benchmarking).

It might make sense to think over the entire hook system at this point as other user report even more use cases (e.g. #743 for a "clean" hook)


FYI: npm provides these hooks:

prepublish: Run BEFORE the package is published. (Also run on local npm install without any arguments.)
publish, postpublish: Run AFTER the package is published.
preinstall: Run BEFORE the package is installed
install, postinstall: Run AFTER the package is installed.
preuninstall, uninstall: Run BEFORE the package is uninstalled.
postuninstall: Run AFTER the package is uninstalled.
preversion, version: Run BEFORE bump the package version.
postversion: Run AFTER bump the package version.
pretest, test, posttest: Run by the npm test command.
prestop, stop, poststop: Run by the npm stop command.
prestart, start, poststart: Run by the npm start command.
prerestart, restart, postrestart: Run by the npm restart command. Note: npm restart will run the stop and start scripts if no restart script is provided.
@andre2007
Copy link
Contributor

Related to this:
#1582 Pre/post run commands added

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

No branches or pull requests

2 participants