sitespeed.io 23.4.0 → 23.5.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/.dockerignore +2 -0
- package/.github/workflows/building-docker-release.yml +7 -0
- package/CHANGELOG.md +15 -0
- package/Dockerfile +3 -3
- package/Dockerfile-slim +1 -1
- package/bin/sitespeed.js +2 -0
- package/lib/cli/cli.js +3 -2
- package/npm-shrinkwrap.json +36 -17
- package/package.json +3 -2
- package/release/feed.js +137 -77
package/.dockerignore
CHANGED
|
@@ -7,6 +7,9 @@ jobs:
|
|
|
7
7
|
docker:
|
|
8
8
|
runs-on: ubuntu-latest
|
|
9
9
|
steps:
|
|
10
|
+
-
|
|
11
|
+
name: Checkout
|
|
12
|
+
uses: actions/checkout@v2
|
|
10
13
|
-
|
|
11
14
|
name: Set up QEMU
|
|
12
15
|
uses: docker/setup-qemu-action@v1
|
|
@@ -29,6 +32,7 @@ jobs:
|
|
|
29
32
|
name: Build and push sitespeed.io
|
|
30
33
|
uses: docker/build-push-action@v2
|
|
31
34
|
with:
|
|
35
|
+
context: .
|
|
32
36
|
platforms: linux/amd64,linux/arm64
|
|
33
37
|
push: true
|
|
34
38
|
tags: sitespeedio/sitespeed.io:${{steps.tag.outputs.tag}},sitespeedio/sitespeed.io:latest
|
|
@@ -36,6 +40,7 @@ jobs:
|
|
|
36
40
|
name: Build and push sitespeed.io+1
|
|
37
41
|
uses: docker/build-push-action@v2
|
|
38
42
|
with:
|
|
43
|
+
context: .
|
|
39
44
|
platforms: linux/amd64,linux/arm64
|
|
40
45
|
file: ./docker/Dockerfile-plus1
|
|
41
46
|
build-args: version=${{steps.tag.outputs.tag}}
|
|
@@ -45,6 +50,7 @@ jobs:
|
|
|
45
50
|
name: Build and push sitespeed.io+wpt
|
|
46
51
|
uses: docker/build-push-action@v2
|
|
47
52
|
with:
|
|
53
|
+
context: .
|
|
48
54
|
platforms: linux/amd64,linux/arm64
|
|
49
55
|
file: ./docker/Dockerfile-webpagetest
|
|
50
56
|
build-args: version=${{steps.tag.outputs.tag}}
|
|
@@ -54,6 +60,7 @@ jobs:
|
|
|
54
60
|
name: Build and push sitespeed.io-slim
|
|
55
61
|
uses: docker/build-push-action@v2
|
|
56
62
|
with:
|
|
63
|
+
context: .
|
|
57
64
|
platforms: linux/amd64,linux/arm64
|
|
58
65
|
file: ./Dockerfile-slim
|
|
59
66
|
build-args: version=${{steps.tag.outputs.tag}}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# CHANGELOG - sitespeed.io (we use [semantic versioning](https://semver.org))
|
|
2
2
|
|
|
3
|
+
|
|
4
|
+
## 23.5.2 - 2022-03-22
|
|
5
|
+
### Fixed
|
|
6
|
+
* Updated to latest NodeJS and Ubuntu updates in the Docker container with some security updates[#3306](https://github.com/sitespeedio/sitespeed.io/pull/3606). Also updated the slim container with latest NodeJS.
|
|
7
|
+
* Make sure the shrinkwrap file is used when building the container [#3604](https://github.com/sitespeedio/sitespeed.io/pull/3604) and (hopefully) fix so that .dockerignore is not ignored when Github Actions build the containers.
|
|
8
|
+
|
|
9
|
+
## 23.5.0 - 2022-03-11
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
* The -slim Docker container now uses Firefox 98.
|
|
13
|
+
* Updated Grafana to latest 8.4.3 in the Docker compose file.
|
|
14
|
+
* Updated [Graphite dashboards](https://github.com/sitespeedio/grafana-bootstrap-docker/tree/main/dashboards/graphite) to use Timeseries graphs instead of old "Graph".
|
|
15
|
+
* You can use `-o` or `--open` or `--view` to open the result page after you run sitespeed.io on Mac and Linux [#3569](https://github.com/sitespeedio/sitespeed.io/pull/3596).
|
|
16
|
+
* Open the result with `-o` on Linux using xdg-open [#3597](https://github.com/sitespeedio/sitespeed.io/pull/3597).
|
|
17
|
+
|
|
3
18
|
## 23.4.0 - 2022-03-09
|
|
4
19
|
### Added
|
|
5
20
|
* Firefox 98 in the Docker container [#3592](https://github.com/sitespeedio/sitespeed.io/pull/3592).
|
package/Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
FROM sitespeedio/webbrowsers:chrome-99.0-firefox-98.0-edge-99.0
|
|
1
|
+
FROM sitespeedio/webbrowsers:chrome-99.0-firefox-98.0-edge-99.0-b
|
|
2
2
|
|
|
3
3
|
ARG TARGETPLATFORM=linux/amd64
|
|
4
4
|
|
|
@@ -26,7 +26,8 @@ RUN wpr installroot --https_cert_file /webpagereplay/certs/wpr_cert.pem --https_
|
|
|
26
26
|
RUN mkdir -p /usr/src/app
|
|
27
27
|
WORKDIR /usr/src/app
|
|
28
28
|
|
|
29
|
-
COPY package
|
|
29
|
+
COPY package.json /usr/src/app/
|
|
30
|
+
COPY npm-shrinkwrap.json /usr/src/app/
|
|
30
31
|
RUN npm install --production && npm cache clean --force
|
|
31
32
|
COPY . /usr/src/app
|
|
32
33
|
|
|
@@ -37,7 +38,6 @@ RUN mkdir -m 0750 /root/.android
|
|
|
37
38
|
ADD docker/adb/insecure_shared_adbkey /root/.android/adbkey
|
|
38
39
|
ADD docker/adb/insecure_shared_adbkey.pub /root/.android/adbkey.pub
|
|
39
40
|
|
|
40
|
-
|
|
41
41
|
# Allow all users to run commands needed by sitespeedio/throttle via sudo
|
|
42
42
|
# See https://github.com/sitespeedio/throttle/blob/main/lib/tc.js
|
|
43
43
|
RUN echo 'ALL ALL=NOPASSWD: /usr/sbin/tc, /usr/sbin/route, /usr/sbin/ip' > /etc/sudoers.d/tc
|
package/Dockerfile-slim
CHANGED
package/bin/sitespeed.js
CHANGED
|
@@ -29,6 +29,8 @@ async function run(options) {
|
|
|
29
29
|
|
|
30
30
|
if ((options.open || options.o) && os.platform() === 'darwin') {
|
|
31
31
|
execSync('open ' + result.localPath + '/index.html');
|
|
32
|
+
} else if ((options.open || options.o) && os.platform() === 'linux') {
|
|
33
|
+
execSync('xdg-open ' + result.localPath + '/index.html');
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
if (
|
package/lib/cli/cli.js
CHANGED
|
@@ -1487,8 +1487,9 @@ module.exports.parseCommandLine = function parseCommandLine() {
|
|
|
1487
1487
|
describe: 'Give your test a name.'
|
|
1488
1488
|
})
|
|
1489
1489
|
.option('open', {
|
|
1490
|
-
alias: 'o',
|
|
1491
|
-
describe:
|
|
1490
|
+
alias: ['o', 'view'],
|
|
1491
|
+
describe:
|
|
1492
|
+
'Open your test result in your default browser (Mac OS or Linux with xdg-open).'
|
|
1492
1493
|
})
|
|
1493
1494
|
.option('slug', {
|
|
1494
1495
|
describe:
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sitespeed.io",
|
|
3
|
-
"version": "23.
|
|
3
|
+
"version": "23.5.2",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "sitespeed.io",
|
|
9
|
-
"version": "23.
|
|
9
|
+
"version": "23.5.2",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@google-cloud/storage": "5.8.3",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"bluebird": "3.5.5",
|
|
60
60
|
"chai": "4.2.0",
|
|
61
61
|
"chai-as-promised": "7.1.1",
|
|
62
|
-
"changelog-parser": "2.8.
|
|
62
|
+
"changelog-parser": "2.8.1",
|
|
63
63
|
"clean-css-cli": "4.3.0",
|
|
64
64
|
"eslint": "8.0.0",
|
|
65
65
|
"eslint-config-prettier": "8.3.0",
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
"feed": "4.2.2",
|
|
68
68
|
"jsdoc": "^3.6.7",
|
|
69
69
|
"license-checker": "^16.0.0",
|
|
70
|
+
"marked": "4.0.12",
|
|
70
71
|
"mocha": "^5.0.4",
|
|
71
72
|
"prettier": "2.4.1",
|
|
72
73
|
"pug-lint": "^2.6.0",
|
|
@@ -1628,9 +1629,9 @@
|
|
|
1628
1629
|
}
|
|
1629
1630
|
},
|
|
1630
1631
|
"node_modules/changelog-parser": {
|
|
1631
|
-
"version": "2.8.
|
|
1632
|
-
"resolved": "https://registry.npmjs.org/changelog-parser/-/changelog-parser-2.8.
|
|
1633
|
-
"integrity": "sha512-
|
|
1632
|
+
"version": "2.8.1",
|
|
1633
|
+
"resolved": "https://registry.npmjs.org/changelog-parser/-/changelog-parser-2.8.1.tgz",
|
|
1634
|
+
"integrity": "sha512-tNUYFRCEeWTXmwLqoNtOEzx9wcytg72MmGQqsEs14ClYwIDln7sbQw7FJj/dulXgSlsxkemc9gpPQhZYZx1TPw==",
|
|
1634
1635
|
"dev": true,
|
|
1635
1636
|
"dependencies": {
|
|
1636
1637
|
"line-reader": "^0.2.4",
|
|
@@ -4164,6 +4165,18 @@
|
|
|
4164
4165
|
"markdown-it": "bin/markdown-it.js"
|
|
4165
4166
|
}
|
|
4166
4167
|
},
|
|
4168
|
+
"node_modules/jsdoc/node_modules/marked": {
|
|
4169
|
+
"version": "2.1.3",
|
|
4170
|
+
"resolved": "https://registry.npmjs.org/marked/-/marked-2.1.3.tgz",
|
|
4171
|
+
"integrity": "sha512-/Q+7MGzaETqifOMWYEA7HVMaZb4XbcRfaOzcSsHZEith83KGlvaSG33u0SKu89Mj5h+T8V2hM+8O45Qc5XTgwA==",
|
|
4172
|
+
"dev": true,
|
|
4173
|
+
"bin": {
|
|
4174
|
+
"marked": "bin/marked"
|
|
4175
|
+
},
|
|
4176
|
+
"engines": {
|
|
4177
|
+
"node": ">= 10"
|
|
4178
|
+
}
|
|
4179
|
+
},
|
|
4167
4180
|
"node_modules/jsdoc/node_modules/mkdirp": {
|
|
4168
4181
|
"version": "1.0.4",
|
|
4169
4182
|
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
|
|
@@ -4726,15 +4739,15 @@
|
|
|
4726
4739
|
}
|
|
4727
4740
|
},
|
|
4728
4741
|
"node_modules/marked": {
|
|
4729
|
-
"version": "
|
|
4730
|
-
"resolved": "https://registry.npmjs.org/marked/-/marked-
|
|
4731
|
-
"integrity": "sha512-
|
|
4742
|
+
"version": "4.0.12",
|
|
4743
|
+
"resolved": "https://registry.npmjs.org/marked/-/marked-4.0.12.tgz",
|
|
4744
|
+
"integrity": "sha512-hgibXWrEDNBWgGiK18j/4lkS6ihTe9sxtV4Q1OQppb/0zzyPSzoFANBa5MfsG/zgsWklmNnhm0XACZOH/0HBiQ==",
|
|
4732
4745
|
"dev": true,
|
|
4733
4746
|
"bin": {
|
|
4734
|
-
"marked": "bin/marked"
|
|
4747
|
+
"marked": "bin/marked.js"
|
|
4735
4748
|
},
|
|
4736
4749
|
"engines": {
|
|
4737
|
-
"node": ">=
|
|
4750
|
+
"node": ">= 12"
|
|
4738
4751
|
}
|
|
4739
4752
|
},
|
|
4740
4753
|
"node_modules/mdurl": {
|
|
@@ -8735,9 +8748,9 @@
|
|
|
8735
8748
|
}
|
|
8736
8749
|
},
|
|
8737
8750
|
"changelog-parser": {
|
|
8738
|
-
"version": "2.8.
|
|
8739
|
-
"resolved": "https://registry.npmjs.org/changelog-parser/-/changelog-parser-2.8.
|
|
8740
|
-
"integrity": "sha512-
|
|
8751
|
+
"version": "2.8.1",
|
|
8752
|
+
"resolved": "https://registry.npmjs.org/changelog-parser/-/changelog-parser-2.8.1.tgz",
|
|
8753
|
+
"integrity": "sha512-tNUYFRCEeWTXmwLqoNtOEzx9wcytg72MmGQqsEs14ClYwIDln7sbQw7FJj/dulXgSlsxkemc9gpPQhZYZx1TPw==",
|
|
8741
8754
|
"dev": true,
|
|
8742
8755
|
"requires": {
|
|
8743
8756
|
"line-reader": "^0.2.4",
|
|
@@ -10755,6 +10768,12 @@
|
|
|
10755
10768
|
"uc.micro": "^1.0.5"
|
|
10756
10769
|
}
|
|
10757
10770
|
},
|
|
10771
|
+
"marked": {
|
|
10772
|
+
"version": "2.1.3",
|
|
10773
|
+
"resolved": "https://registry.npmjs.org/marked/-/marked-2.1.3.tgz",
|
|
10774
|
+
"integrity": "sha512-/Q+7MGzaETqifOMWYEA7HVMaZb4XbcRfaOzcSsHZEith83KGlvaSG33u0SKu89Mj5h+T8V2hM+8O45Qc5XTgwA==",
|
|
10775
|
+
"dev": true
|
|
10776
|
+
},
|
|
10758
10777
|
"mkdirp": {
|
|
10759
10778
|
"version": "1.0.4",
|
|
10760
10779
|
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
|
|
@@ -11230,9 +11249,9 @@
|
|
|
11230
11249
|
"requires": {}
|
|
11231
11250
|
},
|
|
11232
11251
|
"marked": {
|
|
11233
|
-
"version": "
|
|
11234
|
-
"resolved": "https://registry.npmjs.org/marked/-/marked-
|
|
11235
|
-
"integrity": "sha512-
|
|
11252
|
+
"version": "4.0.12",
|
|
11253
|
+
"resolved": "https://registry.npmjs.org/marked/-/marked-4.0.12.tgz",
|
|
11254
|
+
"integrity": "sha512-hgibXWrEDNBWgGiK18j/4lkS6ihTe9sxtV4Q1OQppb/0zzyPSzoFANBa5MfsG/zgsWklmNnhm0XACZOH/0HBiQ==",
|
|
11236
11255
|
"dev": true
|
|
11237
11256
|
},
|
|
11238
11257
|
"mdurl": {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"sitespeed.io": "./bin/sitespeed.js",
|
|
5
5
|
"sitespeed.io-wpr": "./bin/browsertimeWebPageReplay.js"
|
|
6
6
|
},
|
|
7
|
-
"version": "23.
|
|
7
|
+
"version": "23.5.2",
|
|
8
8
|
"description": "Analyze the web performance of your site",
|
|
9
9
|
"keywords": [
|
|
10
10
|
"performance",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"bluebird": "3.5.5",
|
|
55
55
|
"chai": "4.2.0",
|
|
56
56
|
"chai-as-promised": "7.1.1",
|
|
57
|
-
"changelog-parser": "2.8.
|
|
57
|
+
"changelog-parser": "2.8.1",
|
|
58
58
|
"clean-css-cli": "4.3.0",
|
|
59
59
|
"eslint": "8.0.0",
|
|
60
60
|
"eslint-config-prettier": "8.3.0",
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"feed": "4.2.2",
|
|
63
63
|
"jsdoc": "^3.6.7",
|
|
64
64
|
"license-checker": "^16.0.0",
|
|
65
|
+
"marked": "4.0.12",
|
|
65
66
|
"mocha": "^5.0.4",
|
|
66
67
|
"sass": "1.34.0",
|
|
67
68
|
"prettier": "2.4.1",
|
package/release/feed.js
CHANGED
|
@@ -2,6 +2,22 @@ const Feed = require('feed').Feed;
|
|
|
2
2
|
const fs = require('fs');
|
|
3
3
|
const path = require('path');
|
|
4
4
|
const parseChangelog = require('changelog-parser');
|
|
5
|
+
const { marked } = require('marked');
|
|
6
|
+
|
|
7
|
+
const allFeeds = [];
|
|
8
|
+
|
|
9
|
+
const images = {
|
|
10
|
+
'sitespeed.io': 'https://www.sitespeed.io/img/logos/sitespeed.io.png',
|
|
11
|
+
browsertime: 'https://www.sitespeed.io/img/logos/browsertime.png',
|
|
12
|
+
'coach-core': 'https://www.sitespeed.io/img/logos/coach.png',
|
|
13
|
+
pagexray: 'https://www.sitespeed.io/img/logos/pagexray.png',
|
|
14
|
+
throttle: '',
|
|
15
|
+
coach: 'https://www.sitespeed.io/img/logos/coach.png',
|
|
16
|
+
'chrome-har': '',
|
|
17
|
+
'chrome-trace': '',
|
|
18
|
+
compare: 'https://www.sitespeed.io/img/logos/compare.png',
|
|
19
|
+
humble: ''
|
|
20
|
+
};
|
|
5
21
|
|
|
6
22
|
const getSortedFiles = dir => {
|
|
7
23
|
const files = fs.readdirSync(dir);
|
|
@@ -16,118 +32,162 @@ const getSortedFiles = dir => {
|
|
|
16
32
|
.sort((a, b) => b.time - a.time);
|
|
17
33
|
};
|
|
18
34
|
|
|
19
|
-
function
|
|
35
|
+
function getFeed(tool, time) {
|
|
36
|
+
return new Feed({
|
|
37
|
+
title: `${tool} release feed`,
|
|
38
|
+
description: `New releases and changelog feed of ${tool}`,
|
|
39
|
+
id: `${tool}-release-feed`,
|
|
40
|
+
link: 'https://www.sitespeed.io',
|
|
41
|
+
language: 'en', // optional, used only in RSS 2.0, possible values: http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
|
|
42
|
+
image: images[tool],
|
|
43
|
+
favicon: 'http://www.sitespeed.io/favicon.ico',
|
|
44
|
+
copyright: 'All rights reserved 2022, Peter Hedenskog and team',
|
|
45
|
+
updated: new Date(time),
|
|
46
|
+
feedLinks: {
|
|
47
|
+
atom:
|
|
48
|
+
tool === 'sitespeed.io'
|
|
49
|
+
? `https://www.sitespeed.io/feed/atom.xml`
|
|
50
|
+
: `https://www.sitespeed.io/feed/${tool}.atom`,
|
|
51
|
+
rss:
|
|
52
|
+
tool === 'sitespeed.io'
|
|
53
|
+
? `https://www.sitespeed.io/feed/rss.xml`
|
|
54
|
+
: `https://www.sitespeed.io/feed/${tool}.rss`
|
|
55
|
+
},
|
|
56
|
+
author: {
|
|
57
|
+
name: 'Peter Hedenskog',
|
|
58
|
+
email: 'peter@soulgalore.com',
|
|
59
|
+
link: 'https://www.peterhedenskog.com'
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function addItemToFeed(feed, item, tool) {
|
|
65
|
+
feed.addItem({
|
|
66
|
+
title: `${tool} ${item.version}`,
|
|
67
|
+
id: `https://github.com/sitespeedio/${tool}/blob/main/CHANGELOG.md#${item.version}`,
|
|
68
|
+
link: `https://github.com/sitespeedio/${tool}/blob/main/CHANGELOG.md#${item.version}`,
|
|
69
|
+
description: getResultAsHTML(item),
|
|
70
|
+
author: [
|
|
71
|
+
{
|
|
72
|
+
name: 'Sitespeed.io',
|
|
73
|
+
link: 'https://www.sitespeed.io'
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
date: new Date(item.date),
|
|
77
|
+
image: images[tool]
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function getResultAsHTML(result) {
|
|
20
82
|
let allData = '';
|
|
21
83
|
if (result.parsed) {
|
|
22
84
|
if (result.parsed.Added) {
|
|
85
|
+
allData += `<h3>Added</h3>\n`;
|
|
23
86
|
for (let added of result.parsed.Added) {
|
|
24
|
-
allData += ' ' + added;
|
|
87
|
+
allData += ' ' + marked.parse(added);
|
|
25
88
|
}
|
|
26
89
|
}
|
|
27
90
|
if (result.parsed.Fixed) {
|
|
91
|
+
allData += `<h3>Fixed</h3>\n`;
|
|
28
92
|
for (let fixed of result.parsed.Fixed) {
|
|
29
|
-
allData += ' ' + fixed;
|
|
93
|
+
allData += ' ' + marked.parse(fixed);
|
|
30
94
|
}
|
|
31
95
|
}
|
|
32
96
|
|
|
33
97
|
if (result.parsed.Changed) {
|
|
98
|
+
allData += `<h3>Changed</h3>\n`;
|
|
34
99
|
for (let changed of result.parsed.Changed) {
|
|
35
|
-
allData += ' ' + changed;
|
|
100
|
+
allData += ' ' + marked.parse(changed);
|
|
36
101
|
}
|
|
37
102
|
}
|
|
38
103
|
|
|
39
104
|
if (result.parsed['Breaking changes']) {
|
|
105
|
+
allData += `<h3>Breaking changes</h3>\n`;
|
|
40
106
|
for (let breaking of result.parsed['Breaking changes']) {
|
|
41
|
-
allData += ' ' + breaking;
|
|
107
|
+
allData += ' ' + marked.parse(breaking);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (result.parsed['Deprecated']) {
|
|
112
|
+
allData += `<h3>Deprecated</h3>\n`;
|
|
113
|
+
for (let deprecated of result.parsed['Deprecated']) {
|
|
114
|
+
allData += ' ' + marked.parse(deprecated);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (result.parsed['Removed']) {
|
|
119
|
+
allData += `<h3>Removed</h3>\n`;
|
|
120
|
+
for (let removed of result.parsed['Removed']) {
|
|
121
|
+
allData += ' ' + marked.parse(removed);
|
|
42
122
|
}
|
|
43
123
|
}
|
|
124
|
+
|
|
125
|
+
if (result.parsed['Security']) {
|
|
126
|
+
allData += `<h3>Security</h3>\n`;
|
|
127
|
+
for (let security of result.parsed['Security']) {
|
|
128
|
+
allData += ' ' + marked.parse(security);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
44
132
|
return allData;
|
|
45
133
|
}
|
|
46
134
|
}
|
|
47
135
|
|
|
136
|
+
const getContent = async tool => {
|
|
137
|
+
const content = [];
|
|
138
|
+
const changelog =
|
|
139
|
+
tool === 'sitespeed.io' ? './CHANGELOG.md' : '../' + tool + '/CHANGELOG.md';
|
|
140
|
+
const result = await parseChangelog({
|
|
141
|
+
filePath: changelog,
|
|
142
|
+
removeMarkdown: false
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
for (let i = 0; i < 10; i++) {
|
|
146
|
+
// It's not unreleased
|
|
147
|
+
if (result.versions[i] && result.versions[i].date !== null) {
|
|
148
|
+
content.push(result.versions[i]);
|
|
149
|
+
allFeeds.push({ tool, item: result.versions[i] });
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return content;
|
|
153
|
+
};
|
|
48
154
|
async function generateFeed() {
|
|
49
155
|
const versionDir = './docs/_includes/version/';
|
|
50
156
|
const sortedVersionFiles = getSortedFiles(versionDir);
|
|
51
157
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
image: 'https://www.sitespeed.io/img/logos/sitespeed.io.png',
|
|
59
|
-
favicon: 'http://www.sitespeed.io/favicon.ico',
|
|
60
|
-
copyright: 'All rights reserved 2021, Peter Hedenskog and team',
|
|
61
|
-
updated: new Date(sortedVersionFiles[0].time), // use the date from the latest updated version file
|
|
62
|
-
feedLinks: {
|
|
63
|
-
atom: 'https://www.sitespeed.io/feed/atom.xml',
|
|
64
|
-
rss: 'https://www.sitespeed.io/feed/rss.xml'
|
|
65
|
-
},
|
|
66
|
-
author: {
|
|
67
|
-
name: 'Peter Hedenskog',
|
|
68
|
-
email: 'peter@soulgalore.com',
|
|
69
|
-
link: 'https://www.peterhedenskog.com'
|
|
158
|
+
for (let tool of sortedVersionFiles) {
|
|
159
|
+
const feed = getFeed(tool.name, tool.time);
|
|
160
|
+
feed.addCategory('Web Performance');
|
|
161
|
+
const items = await getContent(tool.name);
|
|
162
|
+
for (let item of items) {
|
|
163
|
+
addItemToFeed(feed, item, tool.name);
|
|
70
164
|
}
|
|
71
|
-
});
|
|
72
165
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
console.log(`Missing data for tool ${tool.name}`);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return content;
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
const descriptions = await getContent();
|
|
94
|
-
const images = {
|
|
95
|
-
'sitespeed.io': 'https://www.sitespeed.io/img/logos/sitespeed.io.png',
|
|
96
|
-
browsertime: 'https://www.sitespeed.io/img/logos/browsertime.png',
|
|
97
|
-
'coach-core': 'https://www.sitespeed.io/img/logos/coach.png',
|
|
98
|
-
pagexray: 'https://www.sitespeed.io/img/logos/pagexray.png',
|
|
99
|
-
throttle: '',
|
|
100
|
-
coach: 'https://www.sitespeed.io/img/logos/coach.png',
|
|
101
|
-
'chrome-har': '',
|
|
102
|
-
'chrome-trace': '',
|
|
103
|
-
compare: 'https://www.sitespeed.io/img/logos/compare.png',
|
|
104
|
-
humble: ''
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
sortedVersionFiles.forEach(file => {
|
|
108
|
-
feed.addItem({
|
|
109
|
-
title: `${file.name} ${file.version}`,
|
|
110
|
-
id: `https://github.com/sitespeedio/${file.name}/blob/main/CHANGELOG.md#${file.version}`,
|
|
111
|
-
link: `https://github.com/sitespeedio/${file.name}/blob/main/CHANGELOG.md#`,
|
|
112
|
-
description: descriptions[file.name],
|
|
113
|
-
// content: content[file.name],
|
|
114
|
-
author: [
|
|
115
|
-
{
|
|
116
|
-
name: 'Sitespeed.io',
|
|
117
|
-
link: 'https://www.sitespeed.io'
|
|
118
|
-
}
|
|
119
|
-
],
|
|
120
|
-
date: new Date(file.time),
|
|
121
|
-
image: images[file.name]
|
|
122
|
-
});
|
|
166
|
+
const docPath = './docs/';
|
|
167
|
+
|
|
168
|
+
fs.writeFileSync(
|
|
169
|
+
path.join(docPath, 'feed', `${tool.name}.rss`),
|
|
170
|
+
feed.rss2()
|
|
171
|
+
);
|
|
172
|
+
fs.writeFileSync(
|
|
173
|
+
path.join(docPath, 'feed', `${tool.name}.atom`),
|
|
174
|
+
feed.atom1()
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
allFeeds.sort(function (a, b) {
|
|
179
|
+
return new Date(b.item.date) - new Date(a.item.date);
|
|
123
180
|
});
|
|
124
181
|
|
|
125
|
-
|
|
182
|
+
const allFeed = getFeed('sitespeed.io', allFeeds[0].item.date);
|
|
183
|
+
for (let item of allFeeds) {
|
|
184
|
+
addItemToFeed(allFeed, item.item, item.tool);
|
|
185
|
+
}
|
|
126
186
|
|
|
127
187
|
const docPath = './docs/';
|
|
128
188
|
|
|
129
|
-
fs.writeFileSync(path.join(docPath, 'feed',
|
|
130
|
-
fs.writeFileSync(path.join(docPath, 'feed',
|
|
189
|
+
fs.writeFileSync(path.join(docPath, 'feed', `rss.xml`), allFeed.rss2());
|
|
190
|
+
fs.writeFileSync(path.join(docPath, 'feed', `atom.xml`), allFeed.atom1());
|
|
131
191
|
}
|
|
132
192
|
|
|
133
193
|
generateFeed();
|