browsertime 24.0.0-alpha.6 → 24.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Browsertime changelog (we do [semantic versioning](https://semver.org))
2
2
 
3
- ## 24.0.0-alpha.4 - 2025-01-20
3
+ ## 24.0.1 - 2025-01-21
4
+ ### Fixed
5
+ * If Jimp is missing when storing an image, log and write the file as PNG [#2257](https://github.com/sitespeedio/browsertime/pull/2257).
6
+
7
+ ## 24.0.0 - 2025-01-20
4
8
 
5
9
  The 24.0.0 release remove a lot of dependencies. Since we implemented Browsertime the first time, there are many things that are easy to do in modern NodeJS. Those things have now been implemented in Browsertime.
6
10
 
@@ -1,6 +1,9 @@
1
1
  import path from 'node:path';
2
2
  import { pathToFolder } from '../pathToFolder.js';
3
3
  import { loadCustomJimp } from '../../screenshot/loadCustomJimp.js';
4
+ import { getLogger } from '@sitespeed.io/log';
5
+ const log = getLogger('browsertime');
6
+
4
7
  export async function savePngWithoutResize(
5
8
  name,
6
9
  data,
@@ -38,6 +41,11 @@ export async function savePng(
38
41
  buffer,
39
42
  path.join(pathToFolder(url, options), dir)
40
43
  );
44
+ } else {
45
+ log.info(
46
+ 'Missing Jimp dependency so you can only save images as png at viewport size'
47
+ );
48
+ return savePngWithoutResize(name, data, url, storageManager, dir, options);
41
49
  }
42
50
  }
43
51
  export async function saveJpg(
@@ -63,5 +71,10 @@ export async function saveJpg(
63
71
  buffer,
64
72
  path.join(pathToFolder(url, options), dir)
65
73
  );
74
+ } else {
75
+ log.info(
76
+ 'Missing Jimp dependency so you can only save images as png at viewport size'
77
+ );
78
+ return savePngWithoutResize(name, data, url, storageManager, dir, options);
66
79
  }
67
80
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "browsertime",
3
3
  "description": "Get performance metrics from your web page using Browsertime.",
4
- "version": "24.0.0-alpha.6",
4
+ "version": "24.0.1",
5
5
  "bin": "./bin/browsertime.js",
6
6
  "type": "module",
7
7
  "types": "./types/scripting.d.ts",