-
I am working in a large Angular project and would like to take some process off the shoulders of our employees by doing jobs before and after common npm scripts. Let's say someone installs our project the first time, we will display a little welcome message and setting up the environment for the installation, like running Now we would like to do the same for the update process. Normally some experienced user would do that and update dependencies but it would help to for example remind that user that before running From the discussion (issue) in the old repo here it definitely makes sense to me why it has been deactivated but I would like to find a solution that will make everyone happy. Even if we say we move to Makefile (which we already use for building the project) with the update process, I would like to exit the |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Yeah, would be pretty easy to add |
Beta Was this translation helpful? Give feedback.
-
Hi @muuvmuuv 😊 Thanks for the idea! We discussed it briefly during our last OpenRFC meeting and the consensus is that this is a good idea. Since it's such a small change it doesn't warrant a full RFC so instead I opened up an issue over Arborist: npm/arborist#172 so that we can track it. 😄 |
Beta Was this translation helpful? Give feedback.
-
So, looking at this a bit closer, the feedback in that old issue does kind of still make sense. I'm fine with adding If you do this, for example:
vs this:
or this:
the outcome is the same in all three cases. We will replace If you have something that you want to run whenever deps are updated, you probably want to have it run in all three cases, but only the second and third will go through the "update" path. There is no script for "run at the root level before updating a dependency", and adding one presents some challenges. The practical challenge is that deps are resolved in one place, and reified in another, and only at the reification step do we bother to calculate the difference from the actual and ideal dep trees. Fair enough, we could run the script there. However, should this script be run only for top-level deps, or for all deps within the tree? Say for example, you install You run Also there's a question of whether we run it one time at the top level to say "deps are being mutated", or once for each dep being mutated. Now let's say the root dep is Let's say you're starting from an empty node_modules folder and no package-lock.json file. You run Running for every change is pretty onerous. But if we just run it one time, you don't have much ability to know why it's being run, which limits the utility somewhat. I think this is worth writing up a proper RFC about, just so that we can be sure to go through these issues and reduce the chance that we are tied to supporting (yet another, lol) regrettable approach. |
Beta Was this translation helpful? Give feedback.
-
I can't find any reference to preupdate and postupdate, aside from this discussion. Is this still planned? |
Beta Was this translation helpful? Give feedback.
Hi @muuvmuuv 😊 Thanks for the idea!
We discussed it briefly during our last OpenRFC meeting and the consensus is that this is a good idea. Since it's such a small change it doesn't warrant a full RFC so instead I opened up an issue over Arborist: npm/arborist#172 so that we can track it. 😄