-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix npm warnings #16579
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
fix npm warnings #16579
Conversation
Fixes istio#16573 Signed-off-by: Aritra Dey <adey01027@gmail.com>
Why not place the override directly in packages.json? I don't like having things be different in tests vs deployment.. they should be the same. |
Yes, my first thought was to do that in package.json itself. But there is no package.json in the project — it is created by the Makefile.core.mk here Line 140 in 95c8d11
So if we need to make changes to package.json, we first need to create it and then apply the override. |
Might be worth changing... I don't like the thought of having production be different from dev. I'll defer to @craigbox here though as there are a number of plans he has for docs that I am not in the loop on. |
yes i agree it’s better to have a consistent package.json checked into the project so it don’t have differences between dev and prod. |
If we need the files to exist, then we should do it the idiomatic way. (It might be worth a quick look through the code history to see if we can figure out why it wasn't done like that from the start) |
After looking at the previous commit logs, it seems that PR #3242 removed package.json, and then they used npm install separately for each package. I think the best approach would be to add the overrides in the Dockerfile of the tools repository as well — specifically here:
This would make the behavior consistent across both dev and prod environments, addressing @dhawton's concern. |
It looks like Netlify used to use the website builder container? The principle of simplicity for future maintainers should apply - I don't think that a JQ line and temporary generated files achieves that. (An even more idiomatic answer might be hugo mod npm pack and packages.hugo.json but I think that's for a later date) |
(Daniel had a similar thought here.) |
Hmm, your point makes sense—having a package.json is a good idea. In the future, other packages might also require overrides, so I'll add those files. |
Signed-off-by: Aritra Dey <adey01027@gmail.com>
Signed-off-by: Aritra Dey <adey01027@gmail.com>
@@ -0,0 +1,38 @@ | |||
{ | |||
"name": "work", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the package.json is generated by npm init -y
, the name is still set to "work". Should we change it to "istio.io", or is it okay to keep it as is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would change it
Thanks for your effort, but I wanted to clarify that the current pipeline is already clean after PR #16574 where we added esbuild as a bundler & minifier.Their are no existing errors and warning everything is neat and clean. Suppressing or overriding warnings globally could mask future issues and is not an ideal long term solution.Let's focus on meaningful improvement that genuinely help the project. Thanks. |
I believe both issues are different. This PR attempts to address the warnings caused by deprecated glob and inflight.
which are also mentioned in issue #16573. |
In your previous comment, you claimed that your PR fixes this issue too — I think it's clear now that it doesn't. |
Sure! I'm not in favour of suppressing this warnings also overriding npm warnings especially for deprecated or unmaintained dependency - can hide known vulnerabilities (CVEs). I would also like to escalate to maintainers for the best path forward. |
sass@v1.89.1 \ | ||
typescript@v5.8.3 \ | ||
svgstore-cli@v2.0.1 \ | ||
@babel/core@v7.27.4 \ | ||
@babel/cli@v7.27.2 \ | ||
@babel/traverse@7.25.9 \ | ||
@babel/preset-env@v7.27.2 | ||
@npm install --omit=dev --save-dev \ | ||
babel-preset-minify@v0.5.2 | ||
@npm install --save \ | ||
core-js@3.42.0 | ||
typescript@v5.8.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would these not be in packages.json
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because these packages need to be installed globally, we can either include them in the Makefile as we do now, or add them to the scripts section of package.json.
@@ -140,16 +140,7 @@ netlify_install: | |||
@npm init -y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would this still be needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just kept it for now as netlify still depends on it...can be replaced by npm install
once package.json Is created
@@ -0,0 +1,38 @@ | |||
{ | |||
"name": "work", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would change it
{ | ||
"name": "work", | ||
"version": "1.0.0", | ||
"description": "| Site | Status |------|------- | istio.io | [](https://app.netlify.com/sites/istio/deploys) | preliminary.istio.io | [](https://app.netlify.com/sites/preliminary-istio/deploys) | archive.istio.io | [](https://app.netlify.com/sites/archive-istio/deploys)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...and this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Entire package.json is generated by npm init -y
.so I didn't touch it yet.
"description": "| Site | Status |------|------- | istio.io | [](https://app.netlify.com/sites/istio/deploys) | preliminary.istio.io | [](https://app.netlify.com/sites/preliminary-istio/deploys) | archive.istio.io | [](https://app.netlify.com/sites/archive-istio/deploys)", | ||
"main": "index.js", | ||
"directories": { | ||
"test": "tests" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't have any of these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#16579 (comment)
Same for this also
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apache 2.0
"core-js": "^3.42.0", | ||
"svgstore-cli": "^2.0.1" | ||
}, | ||
"devDependencies": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this a devDependency and not a dependency, do you know?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 149 in b5c0c98
@npm install --omit=dev --save-dev \ |
the
--save dev
flag install it as a devDependencies.And this dependencies are required for build only not for runtime,so often used as devDependencies.
can be put inside dependencies section,but for sure keeping it in devDependencies is preferred always
We are pinning the version of the svgstore package so it's reasonable to also pre-acknowledge the warnings at that version. I'm happy to update to something better supported if we can find something (discussed in the other PR). |
Once the esbuild PR is merged, and since we have already migrated from svgstore to svg-sprite-generator, do we still need the package.json file for the project? |
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Description
This PR resolves npm warnings caused by deprecated glob@7.2.3 and inflight@1.0.6 by overriding them.
few observations:
Before
Now (After the fix)
Fixes #16573
Reviewers