Skip to content

Commit a477a42

Browse files
committed
Upgrade dependencies
1 parent fcdc6ac commit a477a42

11 files changed

+10736
-8855
lines changed

package-lock.json

+10,631-8,736
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+40-40
Original file line numberDiff line numberDiff line change
@@ -56,62 +56,62 @@
5656
"singleQuote": true
5757
},
5858
"devDependencies": {
59-
"@rollup/plugin-node-resolve": "^15.2.3",
60-
"@rollup/plugin-replace": "^5.0.5",
59+
"@rollup/plugin-node-resolve": "^16.0.0",
60+
"@rollup/plugin-replace": "^6.0.2",
6161
"@rollup/plugin-terser": "^0.4.4",
62-
"@wdio/cli": "^8.36.1",
63-
"@wdio/local-runner": "^8.36.1",
64-
"@wdio/mocha-framework": "^8.36.1",
65-
"@wdio/spec-reporter": "^8.36.1",
66-
"chalk": "^5.3.0",
67-
"chokidar": "^3.6.0",
68-
"chromedriver": "^124.0.3",
62+
"@wdio/cli": "^9.7.1",
63+
"@wdio/local-runner": "^9.7.1",
64+
"@wdio/mocha-framework": "^9.6.4",
65+
"@wdio/spec-reporter": "^9.6.3",
66+
"chalk": "^5.4.1",
67+
"chokidar": "^4.0.3",
68+
"chromedriver": "^132.0.1",
6969
"common-tags": "^1.8.2",
70-
"cssnano": "7.0.1",
70+
"cssnano": "7.0.6",
7171
"dom-utils": "^0.9.0",
7272
"eslint": "^8.57.0",
73-
"fs-extra": "^11.2.0",
74-
"globby": "^14.0.1",
73+
"fs-extra": "^11.3.0",
74+
"globby": "^14.0.2",
7575
"gzip-size": "^7.0.0",
7676
"he": "~1.2.0",
77-
"highlight.js": "^11.9.0",
77+
"highlight.js": "^11.11.1",
7878
"html-minifier": "^4.0.0",
79-
"husky": "^9.0.11",
80-
"image-size": "^1.1.1",
81-
"jsesc": "^3.0.2",
82-
"lint-staged": "^15.2.2",
79+
"husky": "^9.1.7",
80+
"image-size": "^1.2.0",
81+
"jsesc": "^3.1.0",
82+
"lint-staged": "^15.4.2",
8383
"markdown-it": "^14.1.0",
84-
"markdown-it-anchor": "^8.6.7",
84+
"markdown-it-anchor": "^9.2.0",
8585
"md5": "^2.3.0",
86-
"mocha": "^10.4.0",
87-
"moment-timezone": "^0.5.45",
86+
"mocha": "^11.1.0",
87+
"moment-timezone": "^0.5.46",
8888
"npm-run-all": "^4.1.5",
8989
"nunjucks": "^3.2.4",
9090
"path": "^0.12.7",
91-
"postcss": "^8.4.38",
91+
"postcss": "^8.5.1",
9292
"postcss-import": "^16.1.0",
93-
"postcss-preset-env": "^9.5.13",
93+
"postcss-preset-env": "^10.1.3",
9494
"postcss-url": "^10.1.3",
95-
"prettier": "^3.2.5",
95+
"prettier": "^3.4.2",
9696
"rev-hash": "^4.1.0",
9797
"rev-path": "^3.0.0",
98-
"rollup": "^4.17.2",
99-
"sharp": "^0.33.3",
100-
"vitest": "^1.6.0",
101-
"wait-on": "^7.2.0",
98+
"rollup": "^4.32.0",
99+
"sharp": "^0.33.5",
100+
"vitest": "^3.0.4",
101+
"wait-on": "^8.0.2",
102102
"wdio-chromedriver-service": "^8.1.1",
103-
"web-vitals": "^4.2.1",
104-
"webdriverio": "^8.36.1",
105-
"workbox-background-sync": "^7.1.0",
106-
"workbox-broadcast-update": "^7.1.0",
107-
"workbox-core": "^7.1.0",
108-
"workbox-expiration": "^7.1.0",
109-
"workbox-google-analytics": "^7.1.0",
110-
"workbox-precaching": "^7.1.0",
111-
"workbox-routing": "^7.1.0",
112-
"workbox-strategies": "^7.1.0",
113-
"workbox-streams": "^7.1.0",
114-
"workbox-window": "^7.1.0",
115-
"wrangler": "^3.64.0"
103+
"web-vitals": "^4.2.4",
104+
"webdriverio": "^9.7.1",
105+
"workbox-background-sync": "^7.3.0",
106+
"workbox-broadcast-update": "^7.3.0",
107+
"workbox-core": "^7.3.0",
108+
"workbox-expiration": "^7.3.0",
109+
"workbox-google-analytics": "^7.3.0",
110+
"workbox-precaching": "^7.3.0",
111+
"workbox-routing": "^7.3.0",
112+
"workbox-strategies": "^7.3.0",
113+
"workbox-streams": "^7.3.0",
114+
"workbox-window": "^7.3.0",
115+
"wrangler": "^3.105.1"
116116
}
117117
}

tasks/watch.js

+21-17
Original file line numberDiff line numberDiff line change
@@ -4,56 +4,60 @@ import {cssCache, jsCache} from './lib/cache.js';
44
import {buildAll} from './lib/content.js';
55
import {bundleSW} from './lib/sw.js';
66

7-
const cssWatcher = chokidar.watch('src/css/**/*.css');
7+
const watch = (arg) => {
8+
return chokidar.watch(arg, {ignoreInitial: true});
9+
};
10+
11+
const cssWatcher = watch('src/css');
812

913
cssWatcher.on('ready', () => {
10-
cssWatcher.on('all', async (...args) => {
11-
console.log('css', ...args);
14+
cssWatcher.on('all', async (event, path) => {
15+
console.log('css', event, path);
1216
cssCache.invalidate();
1317
await buildAll();
1418
await bundleSW();
1519
});
1620
});
1721

18-
const jsWatcher = chokidar.watch('src/javascript/**/*.js');
22+
const jsWatcher = watch('src/javascript');
1923

2024
jsWatcher.on('ready', () => {
21-
jsWatcher.on('all', async (...args) => {
22-
console.log('js', ...args);
25+
jsWatcher.on('all', async (event, path) => {
26+
console.log('js', event, path);
2327
jsCache.invalidate();
2428
await buildAll();
2529
await bundleSW();
2630
});
2731
});
2832

29-
const swWatcher = chokidar.watch(['src/sw/**/*.js', 'worker/**/*.js']);
33+
const swWatcher = watch(['src/sw', 'worker']);
3034

3135
swWatcher.on('ready', () => {
32-
swWatcher.on('all', async (...args) => {
33-
console.log('sw', ...args);
36+
swWatcher.on('all', async (event, path) => {
37+
console.log('sw', event, path);
3438
await bundleSW();
3539
});
3640
});
3741

38-
const staticWatcher = chokidar.watch(['src/static/*']);
42+
const staticWatcher = watch(['src/static']);
3943

4044
staticWatcher.on('ready', () => {
41-
staticWatcher.on('all', async (...args) => {
42-
console.log('static', ...args);
45+
staticWatcher.on('all', async (event, path) => {
46+
console.log('static', event, path);
4347
await fs.copy('./src/static/', 'build/', {recursive: true});
4448
});
4549
});
4650

47-
const contentWatcher = chokidar.watch([
51+
const contentWatcher = watch([
4852
'book.json',
49-
'src/templates/**/*',
50-
'src/articles/*.md',
53+
'src/templates',
54+
'src/articles',
5155
'worker/lib/experiments.js',
5256
]);
5357

5458
contentWatcher.on('ready', () => {
55-
contentWatcher.on('all', async (...args) => {
56-
console.log('content', ...args);
59+
contentWatcher.on('all', async (event, path) => {
60+
console.log('content', event, path);
5761
await buildAll();
5862
await bundleSW();
5963
});

test/vitest/worker.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -339,15 +339,15 @@ describe('worker', () => {
339339
});
340340

341341
expect(await a.text()).toMatch(
342-
/<meta http-equiv="origin-trial" content="AiFbmKao6wuKvoETvcxO14nv9K/,
342+
/<meta http-equiv="origin-trial" content="Ao1ryfd8fdqfiAsCIPw8u/,
343343
);
344344

345345
const b = await worker.fetch('/', {
346346
headers: {'Cookie': 'xid=.567'},
347347
});
348348

349349
expect(await b.text()).not.toMatch(
350-
/<meta http-equiv="origin-trial" content="AiFbmKao6wuKvoETvcxO14nv9K/,
350+
/<meta http-equiv="origin-trial" content="Ao1ryfd8fdqfiAsCIPw8u/,
351351
);
352352
});
353353
});

test/wdio/content-loading.js

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import assert from 'assert';
2+
import {clearStorage} from './utils/clearStorage.js';
23
import {initBook} from '../../tasks/lib/book.js';
34

45
let site;
@@ -12,12 +13,7 @@ describe('The content loader', async () => {
1213
articles = book.articles;
1314
pages = book.pages;
1415

15-
await browser.url('/__reset');
16-
await browser.waitUntil(async () => {
17-
return await browser.execute(() => {
18-
return window.__ready__ === true;
19-
});
20-
});
16+
await clearStorage();
2117
});
2218

2319
beforeEach(async () => {
@@ -161,7 +157,7 @@ describe('The content loader', async () => {
161157
await articleLink.click();
162158

163159
const shareButton = await $('#share');
164-
assert(await shareButton.isDisplayedInViewport());
160+
assert(await shareButton.isDisplayed({withinViewport: true}));
165161

166162
await assertIsInitialPageLoad();
167163
});

test/wdio/log.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import {strict as assert} from 'node:assert';
22
import {beaconsContain, clearBeacons, getBeacons} from './utils/beacons.js';
3+
import {clearStorage} from './utils/clearStorage.js';
4+
import {setExperimentCookie} from './utils/setExperimentCookie.js';
35
import {initBook} from '../../tasks/lib/book.js';
46

5-
import {
6-
clearExperimentCookie,
7-
setExperimentCookie,
8-
} from './utils/experiments.js';
9-
107
let articles;
118
let pages;
129

@@ -21,10 +18,10 @@ describe('log', function () {
2118

2219
beforeEach(async () => {
2320
await clearBeacons();
24-
await clearExperimentCookie();
21+
await clearStorage();
2522
});
2623

27-
describe('experiments', () => {
24+
describe.only('experiments', () => {
2825
// Unskip when running an experiment
2926
it('should load the proper experiment', async () => {
3027
await setExperimentCookie('.234');
@@ -54,7 +51,8 @@ describe('log', function () {
5451
});
5552
});
5653

57-
await browser.url('/__reset');
54+
await clearStorage();
55+
5856
await setExperimentCookie('.789');
5957
await browser.url(`/articles/?test_id=${++testID}`);
6058

test/wdio/sw.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import assert from 'assert';
22
import fs from 'fs-extra';
3+
import {clearStorage} from './utils/clearStorage.js';
34

45
describe('Service Worker', () => {
56
beforeEach(async () => {
67
restoreSWVersion();
7-
await browser.url('/__reset');
8+
await clearStorage();
9+
810
// Set the default experiment group.
911
await browser.setCookies({name: 'xid', value: '.999', path: '/'});
1012
});

test/wdio/utils/clearStorage.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* @returns {Promise}
3+
*/
4+
export async function clearStorage() {
5+
await browser.deleteCookies();
6+
await browser.url('/__reset');
7+
await browser.waitUntil(async () => {
8+
return await browser.execute(() => {
9+
return window.__ready__ === true;
10+
});
11+
});
12+
}

test/wdio/utils/experiments.js

-28
This file was deleted.
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* @param {string} value
3+
* @returns {Promise}
4+
*/
5+
export async function setExperimentCookie(value) {
6+
await browser.setCookies({
7+
name: 'xid',
8+
value: value,
9+
path: '/',
10+
expiry: Math.floor(Date.now() / 1000 + 60 * 60 * 24 * 365),
11+
secure: true,
12+
httpOnly: true,
13+
sameSite: 'strict',
14+
});
15+
}

test/wdio/worker.js

+3-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {strict as assert} from 'assert';
2+
import {clearStorage} from './utils/clearStorage.js';
23

34
describe('worker', function () {
45
describe('priority hints', function () {
@@ -40,14 +41,7 @@ describe('worker', function () {
4041
}).observe({type: 'resource', buffered: true});
4142
});
4243

43-
await browser.url('/__reset');
44-
45-
// Wait until the SW has unregistered.
46-
await browser.waitUntil(async () => {
47-
return await browser.execute(() => {
48-
return window.__ready__ === true;
49-
});
50-
});
44+
await clearStorage();
5145

5246
// Set a query param to ensure a cached version of the page isn't used.
5347
await browser.url(urlWithLCPImage + '?cache=bust');
@@ -71,14 +65,7 @@ describe('worker', function () {
7165
// to ensure that it doesn't happen.
7266
await browser.pause(2000);
7367

74-
await browser.url('/__reset');
75-
76-
// Wait until the SW has unregistered.
77-
await browser.waitUntil(async () => {
78-
return await browser.execute(() => {
79-
return window.__ready__ === true;
80-
});
81-
});
68+
await clearStorage();
8269

8370
// Set a query param to ensure a cached version of the page isn't used.
8471
await browser.url(urlWithoutLCPImage + '?cache=bust');

0 commit comments

Comments
 (0)