Skip to content

Commit 3b3fb17

Browse files
Backport PR #16495: Bump ws from 8.12.0 to 8.17.1 (#16588)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent be34cd3 commit 3b3fb17

4 files changed

Lines changed: 54 additions & 30 deletions

File tree

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@
104104
"watch:packages": "python scripts/watch_packages.py"
105105
},
106106
"resolutions": {
107-
"@jupyterlab/services/ws": "8.12.0",
108107
"@types/react": "^18.0.26",
109108
"react": "^18.2.0",
110109
"yjs": "^13.5.40"

packages/testing/src/jest-config.ts

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,29 @@ const esModules = [
2222

2323
module.exports = function (baseDir: string) {
2424
return {
25-
testEnvironment: '@jupyterlab/testing/lib/jest-env.js',
25+
coverageReporters: ['json', 'lcov', 'text', 'html'],
26+
coverageDirectory: path.join(baseDir, 'coverage'),
27+
moduleFileExtensions: [
28+
'ts',
29+
'tsx',
30+
'js',
31+
'jsx',
32+
'json',
33+
'node',
34+
'mjs',
35+
'cjs'
36+
],
2637
moduleNameMapper: {
2738
'\\.(css|less|sass|scss)$': 'identity-obj-proxy',
2839
'\\.(gif|ttf|eot)$': '@jupyterlab/testing/lib/jest-file-mock.js'
2940
},
41+
reporters: ['default', 'jest-junit', 'github-actions'],
42+
resolver: '@jupyterlab/testing/lib/jest-resolver.js',
43+
setupFiles: ['@jupyterlab/testing/lib/jest-shim.js'],
44+
testEnvironment: '@jupyterlab/testing/lib/jest-env.js',
45+
testPathIgnorePatterns: ['/lib/', '/node_modules/'],
46+
testRegex: '/test/.*.spec.ts[x]?$',
47+
testTimeout: 10000,
3048
transform: {
3149
'\\.svg$': '@jupyterlab/testing/lib/jest-raw-loader.js',
3250
// Extracted from https://github.com/kulshekhar/ts-jest/blob/v29.0.3/presets/index.js
@@ -38,23 +56,6 @@ module.exports = function (baseDir: string) {
3856
],
3957
'^.+\\.jsx?$': 'babel-jest'
4058
},
41-
testTimeout: 10000,
42-
setupFiles: ['@jupyterlab/testing/lib/jest-shim.js'],
43-
testPathIgnorePatterns: ['/lib/', '/node_modules/'],
44-
moduleFileExtensions: [
45-
'ts',
46-
'tsx',
47-
'js',
48-
'jsx',
49-
'json',
50-
'node',
51-
'mjs',
52-
'cjs'
53-
],
54-
transformIgnorePatterns: [`/node_modules/(?!${esModules}).+`],
55-
reporters: ['default', 'jest-junit', 'github-actions'],
56-
coverageReporters: ['json', 'lcov', 'text', 'html'],
57-
coverageDirectory: path.join(baseDir, 'coverage'),
58-
testRegex: '/test/.*.spec.ts[x]?$'
59+
transformIgnorePatterns: [`/node_modules/(?!${esModules}).+`]
5960
};
6061
};
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright (c) Jupyter Development Team.
3+
* Distributed under the terms of the Modified BSD License.
4+
*/
5+
6+
// ws workaround suggested in https://github.com/websockets/ws/issues/2171#issuecomment-1792147402
7+
// Mentioned solution license is:
8+
// Copyright (c) Microsoft Corporation. All rights reserved.
9+
// Licensed under the MIT License.
10+
11+
module.exports = (path: string, options: any) => {
12+
// Call the defaultResolver, so we leverage its cache, error handling, etc.
13+
return options.defaultResolver(path, {
14+
...options,
15+
// Use packageFilter to process parsed `package.json` before the resolution (see https://www.npmjs.com/package/resolve#resolveid-opts-cb)
16+
packageFilter: (pkg: any) => {
17+
// This is a workaround for https://github.com/websockets/ws/pull/2118
18+
if (pkg.name === 'ws') {
19+
delete pkg['exports']['.']['browser'];
20+
}
21+
return pkg;
22+
}
23+
});
24+
};

yarn.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21641,33 +21641,33 @@ __metadata:
2164121641
languageName: node
2164221642
linkType: hard
2164321643

21644-
"ws@npm:8.12.0, ws@npm:^8.11.0":
21645-
version: 8.12.0
21646-
resolution: "ws@npm:8.12.0"
21644+
"ws@npm:^7.3.1":
21645+
version: 7.5.10
21646+
resolution: "ws@npm:7.5.10"
2164721647
peerDependencies:
2164821648
bufferutil: ^4.0.1
21649-
utf-8-validate: ">=5.0.2"
21649+
utf-8-validate: ^5.0.2
2165021650
peerDependenciesMeta:
2165121651
bufferutil:
2165221652
optional: true
2165321653
utf-8-validate:
2165421654
optional: true
21655-
checksum: 818ff3f8749c172a95a114cceb8b89cedd27e43a82d65c7ad0f7882b1e96a2ee6709e3746a903c3fa88beec0c8bae9a9fcd75f20858b32a166dfb7519316a5d7
21655+
checksum: f9bb062abf54cc8f02d94ca86dcd349c3945d63851f5d07a3a61c2fcb755b15a88e943a63cf580cbdb5b74436d67ef6b67f745b8f7c0814e411379138e1863cb
2165621656
languageName: node
2165721657
linkType: hard
2165821658

21659-
"ws@npm:^7.3.1":
21660-
version: 7.5.9
21661-
resolution: "ws@npm:7.5.9"
21659+
"ws@npm:^8.11.0":
21660+
version: 8.17.1
21661+
resolution: "ws@npm:8.17.1"
2166221662
peerDependencies:
2166321663
bufferutil: ^4.0.1
21664-
utf-8-validate: ^5.0.2
21664+
utf-8-validate: ">=5.0.2"
2166521665
peerDependenciesMeta:
2166621666
bufferutil:
2166721667
optional: true
2166821668
utf-8-validate:
2166921669
optional: true
21670-
checksum: c3c100a181b731f40b7f2fddf004aa023f79d64f489706a28bc23ff88e87f6a64b3c6651fbec3a84a53960b75159574d7a7385709847a62ddb7ad6af76f49138
21670+
checksum: 442badcce1f1178ec87a0b5372ae2e9771e07c4929a3180321901f226127f252441e8689d765aa5cfba5f50ac60dd830954afc5aeae81609aefa11d3ddf5cecf
2167121671
languageName: node
2167221672
linkType: hard
2167321673

0 commit comments

Comments
 (0)