You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.
Hi there - I stumbled on this project as I was trying to replicate some of the features in Lerna.js. As I was reading their source code, I found npm-lifecycle. Is there documentation on how to use the API? I will describe my specific problem below, but I think general API documentation would be super helpful.
My problem: I'm trying to set up a monorepo that will work with my company's build tooling, which uses a private NPM registry. As such, I need to npm pack but not npm publish each of the "packages" within the monorepo, then let the tooling handle the actual publishing. I have set up a script to (eventually) automate the npm packing of each package, but nothing I try seems to work. Since Lerna is essentially doing the same thing with lerna publish --skip-npm I figured I would see what they are doing.
However, the when I use npm-lifecycle to npm pack, the process silently fails because my packages don't have .hooks directories (Should they? Is that an expected directory in an NPM package? How do I create it?).
Some documentation on basic (or advanced) usage would really help me out. Thanks!
The text was updated successfully, but these errors were encountered:
The line you linked to isn't it silently failing, it's silently doing nothing, because there's no hook and no script for that lifecycle stage.
A lifecycle hook is an ancient and not very widely known feature of npm, dating back to even earlier than the node_modules folder itself.
The hook script in this case would be something like ./node_modules/.hooks/install. If there's an executable script there, it'll get run on any install lifecycle event in that repo.
If there's no hook file, and no script for that lifecycle event in package.json, then there's nothing to do. The early return is there to avoid doing the work to build up the environment for a child process, since that can be taxing.
Yes, more docs would be much appreciated on this module.
Hi there - I stumbled on this project as I was trying to replicate some of the features in Lerna.js. As I was reading their source code, I found
npm-lifecycle
. Is there documentation on how to use the API? I will describe my specific problem below, but I think general API documentation would be super helpful.My problem: I'm trying to set up a monorepo that will work with my company's build tooling, which uses a private NPM registry. As such, I need to
npm pack
but notnpm publish
each of the "packages" within the monorepo, then let the tooling handle the actual publishing. I have set up a script to (eventually) automate thenpm pack
ing of each package, but nothing I try seems to work. Since Lerna is essentially doing the same thing withlerna publish --skip-npm
I figured I would see what they are doing.However, the when I use
npm-lifecycle
tonpm pack
, the process silently fails because my packages don't have.hooks
directories (Should they? Is that an expected directory in an NPM package? How do I create it?).Some documentation on basic (or advanced) usage would really help me out. Thanks!
The text was updated successfully, but these errors were encountered: