sitespeed.io 37.4.0 → 37.4.2

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,9 +1,17 @@
1
1
 
2
2
  # CHANGELOG - sitespeed.io (we use [semantic versioning](https://semver.org))
3
+ ## 37.4.2 - 2025-04-19
4
+ ### Fixed
5
+ * s3: If you add Expires to your object using the API, it was broken since the upgrade to v3. This fix change so we allways use a Date when setting Expires [#4503](https://github.com/sitespeedio/sitespeed.io/pull/4503).
6
+ * Make sure that HAR files included in the HTML excludes closing script tags in the body of an response [#4500](https://github.com/sitespeedio/sitespeed.io/pull/4500).
7
+
8
+ ## 37.4.1 - 2025-04-10
9
+ ### Fixed
10
+ * If testing one page fails, make sure that we still can genereate the HTML [#4495](https://github.com/sitespeedio/sitespeed.io/pull/4495).
3
11
 
4
12
  ## 37.4.0 - 2025-04-09
5
13
  ### Added
6
- * Updated Doker container with Firefox 137, Chrome 135 and Edge 135 [#4494](https://github.com/sitespeedio/sitespeed.io/pull/4494).
14
+ * Updated Docker container with Firefox 137, Chrome 135 and Edge 135 [#4494](https://github.com/sitespeedio/sitespeed.io/pull/4494).
7
15
 
8
16
  ## 37.3.2 - 2025-03-21
9
17
  ### Fixed
@@ -30,6 +30,7 @@ export function renderTemplate(templateName, locals) {
30
30
  return getTemplate(templateName)(locals);
31
31
  } catch (error) {
32
32
  log.error('Could not generate %s, %s', templateName, error.message);
33
+ return `Could not generate ${templateName} error: ${error.message}`;
33
34
  }
34
35
  }
35
36
  export function addTemplate(templateName, templateString) {
@@ -3,7 +3,7 @@
3
3
  //- specific run (the median run) in summaryPageHAR.
4
4
  //- Inline script tags breaks the output
5
5
  - dahar = h.get(pageInfo.data, 'browsertime.run.har', summaryPageHAR)
6
- - dahar = JSON.stringify(dahar.log).split('</script>').join('&lt;/script&gt;')
6
+ - dahar = JSON.stringify(dahar.log).split('</script>').join('&lt;/script&gt;').split('<script>').join('&lt;script&gt;')
7
7
 
8
8
  script(src= assetsPath + 'js/perf-cascade.min.js')
9
9
  script(type='text/javascript').
@@ -12,19 +12,35 @@ import { runWithConcurrencyLimit } from './limit.js';
12
12
 
13
13
  const log = getLogger('sitespeedio.plugin.s3');
14
14
 
15
+ const normalizeExpires = maybeSeconds => {
16
+ if (typeof maybeSeconds === 'number' && Number.isFinite(maybeSeconds)) {
17
+ const seconds = Number.parseInt(maybeSeconds, 10);
18
+ const expires = new Date(Date.now() + seconds * 1000);
19
+ log.info('Setting s3.expires to ' + expires);
20
+ return expires;
21
+ }
22
+ return maybeSeconds;
23
+ };
24
+
15
25
  async function uploadFile(file, s3Client, s3Options, prefix, baseDir) {
16
26
  const stream = await fsPromises.readFile(file);
17
27
  const contentType = getContentType(file);
18
28
  const subPath = path.relative(baseDir, file);
19
- const parameters = {
29
+ const baseParams = {
20
30
  Bucket: s3Options.bucketname,
21
31
  Key: path.join(s3Options.path || prefix, subPath),
22
32
  Body: stream,
23
33
  ContentType: contentType,
24
- ACL: s3Options.acl,
25
- ...s3Options.params
34
+ ACL: s3Options.acl
26
35
  };
27
36
 
37
+ const userParams = { ...s3Options.params };
38
+ if ('Expires' in userParams) {
39
+ userParams.Expires = normalizeExpires(userParams.Expires);
40
+ }
41
+
42
+ const parameters = { ...baseParams, ...userParams };
43
+
28
44
  try {
29
45
  await s3Client.send(new PutObjectCommand(parameters));
30
46
  log.debug(`Uploaded ${file} to S3 bucket ${s3Options.bucketname}`);
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "sitespeed.io",
3
- "version": "37.4.0",
3
+ "version": "37.4.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "sitespeed.io",
9
- "version": "37.4.0",
9
+ "version": "37.4.2",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "dependencies": {
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "sitespeed.io": "./bin/sitespeed.js",
6
6
  "sitespeed.io-wpr": "./bin/browsertimeWebPageReplay.js"
7
7
  },
8
- "version": "37.4.0",
8
+ "version": "37.4.2",
9
9
  "description": "sitespeed.io is an open-source tool for comprehensive web performance analysis, enabling you to test, monitor, and optimize your website’s speed using real browsers in various environments.",
10
10
  "keywords": [
11
11
  "performance",