-
Notifications
You must be signed in to change notification settings - Fork 44
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
Should GuardDog Stop Reporting Usage of "prepare" Scripts for NPM Packages? #308
Comments
I'll try to find some time validating this with a Proof of Concept |
In the doc it reads:
And dependencies can be specified as git repo, that means that the prepare will run then. Can we validate this? |
However it does not run indeed when doing
When installing the package using a git URL, the prepare script does not seem to be executed:
However, it seems that NPM detected that the package comes from GitHub and used a special format.
In the documentation, "Git URLs" and "GitHub URLs" are different types of dependencies:
So maybe My guess is that when you do Some additional notes:
|
Well, I may have a deeper look at exactly when will NPM scripts be executed, but I still think we should stop reporting NPM packages that have a |
Actually, reading https://docs.npmjs.com/cli/v10/using-npm/scripts#life-cycle-operation-order again, I have the impression that doing I am not sure how to test this, I am trying to find a package on NPM which |
Well, at least in Yarn it seems quite clear that doing |
@cedricvanrompay-datadog Based on the evidence you mention, I too consider then that we can stop reporting prepare scripts.
After reading the yarn lifecycle is clear to me that it does not executes nor support |
GuardDog flags NPM packages having a
prepare
script (see source) but it seems that these scripts only get executed if youcd
in the repository of the script and runnpm install
(without any arguments):This script is for preparing your environment before doing development work on the package.
Said differently, if you do
npm install foo
and packagefoo
has a prepare script it seems that the script will not be run.Should we remove this script from the list that get reported by GuardDog?
The text was updated successfully, but these errors were encountered: