-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
Analyze images module #1306
Analyze images module #1306
Conversation
Bumps [coverallsapp/github-action](https://github.com/coverallsapp/github-action) from 2.2.0 to 2.2.1. - [Release notes](https://github.com/coverallsapp/github-action/releases) - [Commits](coverallsapp/github-action@v2.2.0...v2.2.1) --- updated-dependencies: - dependency-name: coverallsapp/github-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 20.8.1 to 20.8.3. - [Release notes](https://github.com/puppeteer/puppeteer/releases) - [Changelog](https://github.com/puppeteer/puppeteer/blob/main/release-please-config.json) - [Commits](puppeteer/puppeteer@puppeteer-v20.8.1...puppeteer-v20.8.3) --- updated-dependencies: - dependency-name: puppeteer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 20.8.3 to 20.9.0. - [Release notes](https://github.com/puppeteer/puppeteer/releases) - [Changelog](https://github.com/puppeteer/puppeteer/blob/main/release-please-config.json) - [Commits](puppeteer/puppeteer@puppeteer-v20.8.3...puppeteer-v20.9.0) --- updated-dependencies: - dependency-name: puppeteer dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Maciej Brencz <[email protected]>
Co-authored-by: Maciej Brencz <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Your fork's devel branch seems to be behind the one from this repository. |
package.json
Outdated
@@ -28,6 +28,7 @@ | |||
}, | |||
"dependencies": { | |||
"analyze-css": "^2.0.0", | |||
"analyze-image": "gmetais/analyze-image#main", |
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.
As you've mentioned in the PR description - let's either publish this package to npm (ideally) or at least pin the github dependency to a specific commit / tag.
To make CI pass please update the lock file:
|
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
@@ -28,7 +28,7 @@ | |||
}, | |||
"dependencies": { | |||
"analyze-css": "^2.0.0", | |||
"analyze-image": "gmetais/analyze-image#main", | |||
"analyze-image": "^1.0.0", |
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.
Thanks!
CI is failing with:
|
@gmetais - thanks for the PR. Before merging his one, can you try updating the dependencies of the
|
I update all dependencies (I even switched analyze-image to an ESM) on that branch: https://github.com/gmetais/analyze-image/tree/esm But I still got the 2 "deprecated" warnings, because of imagemin-svgo that was updated recently but not published on npm. Also (and unfortunately), it looks like phantomas would not be able to run Jest tests if analyze-image is loaded as an ESM module (see #1169 and nodejs/node#35889). All in all, I'm not sure updating dependencies is such a good idea 😅 |
The fun with npm packages ...
Can we at least have some dependencies updated (and hence some warnings fixed)? If not, then I'm fine with merging this PR 🙂 |
I'm kind of stuck. The reason I didn't use the latest versions for some packages was because they became ES modules at some point. I tried to import() them dynamically, but it was adding to much complexity to the code. So I rewrote entirely my analyze-image module to an ES module. It is working fine as long as I don't use Jest. Unfortunately, it triggers the So either we keep some packages not updated, either we don't test the analyze-image module. What do you prefer? (For your information, it looks like the segmentation fault will be fixed soon in NodeJS v20: nodejs/node#35889 (comment)) |
Thanks for providing more context here! Well, it seems we are kind of forced to use the outdated versions then... |
Hello Maciej,
This is a submission from an optional phantomas module called analyze-image, inspired by analyze-css and already discussed in #819. It retrieves images loaded on the page and tries to:
It also fixes the imageScaledDown metric, not working properly with
picture
elements.This is a starting point, I wish this module evolves and gains new functionalities in the future (a CLI, detect HTML syntax errors, detect images loaded on the network but not attached on the page...).
The module is not yet submitted on npm, but will be soon. Would you like to share its governance with me?
(I have the same issue in this pull request as the other day, where some changes are marked as new in the diff but are already on your devel branch. Can't understand what I do wrong.)