Compare commits

...
9 Commits
Author SHA1 Message Date
Gaël MétaisandGitHub 4b5a007194 Merge pull request #396 from YellowLabTools/fix-screenshot
Fix for Unhandled Promise Rejection
2023-11-07 20:01:55 +02:00
Gaël Métais b0162453e1 v3.0.1 2023-11-07 19:59:50 +02:00
Gaël Métais a1f09ffedc Fix screenshotHandler and re-introduce some unwillingly deleted improvements 2023-11-07 19:59:13 +02:00
Gaël MétaisandGitHub 73c5b3383e Merge pull request #391 for YLT v3.0
YLT v3.0 is coming soon!
2023-10-12 00:30:16 +02:00
Gaël MétaisandGitHub 5f09fb3bde Merge branch 'develop' into webp-avif 2023-10-06 16:43:32 +02:00
Gaël Métais 0610fd6fbb Update Phantomas and increase min NodeJS version 2023-10-06 16:18:23 +02:00
Gaël MétaisandGitHub 22a8a206ab Merge pull request #388 from YellowLabTools/revert-387-webp-avif
Revert "Introduce a new "Old Image Formats" rule"
2023-08-12 04:08:02 +02:00
Gaël MétaisandGitHub 773249ca4f Revert "Introduce a new "Old Image Formats" rule" 2023-08-12 04:07:03 +02:00
Gaël MétaisandGitHub 599d02ea0e Merge pull request #387 from YellowLabTools/webp-avif
Introduce a new "Old Image Formats" rule
2023-07-30 22:47:10 +02:00
7 changed files with 20 additions and 12 deletions
-1
View File
@@ -51,7 +51,6 @@ var yellowLabTools = function(url, options) {
// Remove uneeded temp screenshot path
delete data.params.options.screenshot;
return ScreenshotHandler.deleteTmpFile(screenshotTmpPath);
})
.catch(function(err) {
+1 -1
View File
@@ -729,7 +729,7 @@ var policies = {
"totalWeight": {
"tool": "redownload",
"label": "Total weight",
"message": "<p>The weight is of course very important if you want the page to load fast. Try to stay under 1.5MB.</p>",
"message": "<p>The weight is of course very important if you want the page to load fast. Try to stay under 1MB, which is already very long to download over a slow connection.</p>",
"isOkThreshold": 1572864,
"isBadThreshold": 3145728,
"isAbnormalThreshold": 5242880,
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "yellowlabtools",
"version": "3.0.0",
"version": "3.0.1",
"description": "A tool that audits a webpage for performance and front-end quality issues",
"license": "GPL-2.0",
"author": {
@@ -16,7 +16,7 @@
"yellowlabtools": "./bin/cli.js"
},
"engines": {
"node": ">= 16.0"
"node": ">= 18.0"
},
"main": "./lib/index.js",
"dependencies": {
@@ -40,10 +40,10 @@
"md5": "2.3.0",
"meow": "5.0.0",
"parse-color": "1.0.0",
"phantomas": "gmetais/phantomas#gmetais-analyze-images",
"phantomas": "2.10.0",
"q": "1.5.1",
"request": "2.88.2",
"sharp": "0.32.3",
"sharp": "0.32.6",
"ttf2woff2": "5.0.0",
"uglify-js": "3.17.4",
"woff-tools": "0.1.0"
+5 -5
View File
@@ -10,11 +10,11 @@ describe('contentTypeChecker', function() {
var svgImageContent = fs.readFileSync(path.resolve(__dirname, '../www/svg-image.svg'));
var cssFileContent = fs.readFileSync(path.resolve(__dirname, '../www/unminified-stylesheet.css'));
it('detect the right content type', async function() {
(await contentTypeChecker.findContentType(jpgImageContent)).mimes.should.deep.equal(['image/jpeg']);
(await contentTypeChecker.findContentType(pngImageContent)).mimes.should.deep.equal(['image/png']);
(await contentTypeChecker.findContentType(svgImageContent)).mimes.should.deep.equal(['image/svg+xml']);
should.equal(await contentTypeChecker.findContentType(cssFileContent), null);
it('detect the right content type', function() {
contentTypeChecker.findContentType(jpgImageContent).mimes.should.deep.equal(['image/jpeg']);
contentTypeChecker.findContentType(pngImageContent).mimes.should.deep.equal(['image/png']);
contentTypeChecker.findContentType(svgImageContent).mimes.should.deep.equal(['image/svg+xml']);
should.equal(contentTypeChecker.findContentType(cssFileContent), null);
});
});
+10 -1
View File
@@ -160,9 +160,18 @@ describe('redownload', function() {
redownload.redownloadEntry(entry)
.then(function(newEntry) {
newEntry.weightCheck.bodySize.should.equal(4193);
newEntry.weightCheck.bodyBuffer.should.deep.equal(fileContent);
done();
// Opening the image in jimp to check if the format is good
var Jimp = require('jimp');
Jimp.read(newEntry.weightCheck.bodyBuffer, function(err, image) {
image.bitmap.width.should.equal(620);
image.bitmap.height.should.equal(104);
done(err);
});
})
.fail(function(err) {
Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB