Skip to content

Commit 24da6c5

Browse files
authored
Fix browser-functional project and pipeline, lodash.pick, sanitize-html, and jsonwebtoken (#4706)
1 parent e4e90df commit 24da6c5

15 files changed

+3677
-1634
lines changed

overrides/lodash.pick/package.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "lodash.pick",
3+
"version": "0.0.1",
4+
"main": "pick.js",
5+
"peerDependencies": {
6+
"lodash": "^4.17.21"
7+
}
8+
}

overrides/lodash.pick/pick.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License.
4+
*/
5+
const { pick } = require('lodash');
6+
module.exports = pick;

package.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@
4848
"node-fetch": "2.6.7",
4949
"underscore": "1.13.1",
5050
"json-schema": "0.4.0",
51-
"jsonwebtoken": "9.0.2",
52-
"@types/jsonwebtoken": "8.3.5",
5351
"@microsoft/recognizers-text-number": "~1.3.1",
5452
"@xmldom/xmldom": "0.8.6",
5553
"**/botbuilder-azure/@azure/core-auth/@azure/core-tracing": "1.0.0-preview.9",
@@ -66,10 +64,10 @@
6664
"tar": "6.1.9",
6765
"glob-parent": "5.1.2",
6866
"babel-traverse": "npm:@babel/traverse@^7.24.7",
69-
"lodash.pick": "npm:lodash@^4.17.21"
67+
"lodash.pick": "file:overrides/lodash.pick"
7068
},
7169
"resolutionComments": {
72-
"lodash.pick": "Because we can't update nightwatch due to jsdom requires node >= 18. https://github.com/lodash/lodash/issues/5809#issuecomment-1910560681"
70+
"lodash.pick": "Remove the resolution and override project when supporting Node >=18. Because we can't update nightwatch due to jsdom requires node >= 18. https://github.com/lodash/lodash/issues/5809#issuecomment-1910560681"
7371
},
7472
"devDependencies": {
7573
"@azure/logger": "^1.0.2",

testing/browser-functional/.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
*.xml
2-
*.log
2+
*.log
3+
drivers
4+
tests_output

testing/browser-functional/browser-echo-bot/package.json

+8-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"botbuilder-core": "^4.5.1",
1616
"botbuilder-dialogs": "~4.5.1",
1717
"botframework-directlinejs": "~0.11.2",
18-
"botframework-webchat": "4.5.0",
18+
"botframework-webchat": "~4.16.0",
1919
"core-js": "^3.1.4"
2020
},
2121
"devDependencies": {
@@ -26,9 +26,12 @@
2626
"@babel/preset-typescript": "^7.23.2",
2727
"@babel/runtime": "^7.23.2",
2828
"babel-loader": "^8.0.6",
29+
"browserify": "^17.0.0",
2930
"clean-webpack-plugin": "^4.0.0",
3031
"copy-webpack-plugin": "^11.0.0",
3132
"css-loader": "^3.0.0",
33+
"react": "~16.8.6",
34+
"react-dom": "~16.8.6",
3235
"regenerator-runtime": "^0.13.2",
3336
"stream-browserify": "^3.0.0",
3437
"style-loader": "^0.23.1",
@@ -37,9 +40,11 @@
3740
"webpack-dev-server": "^4.15.2"
3841
},
3942
"resolutions": {
40-
"follow-redirects": "^1.15.4"
43+
"follow-redirects": "^1.15.4",
44+
"botframework-webchat/sanitize-html": "^2.13.0"
4145
},
4246
"overrides": {
43-
"follow-redirects": "^1.15.4"
47+
"follow-redirects": "^1.15.4",
48+
"botframework-webchat/sanitize-html": "^2.13.0"
4449
}
4550
}

testing/browser-functional/browser-echo-bot/webpack.config.js

+20-15
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,23 @@
33
* Licensed under the MIT License.
44
*/
55

6-
const { join, resolve } = require('path');
6+
const { join, resolve, dirname } = require('path');
77
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
88
const CopyWebpackPlugin = require('copy-webpack-plugin');
99
const webpack = require('webpack');
1010

11+
// Returns absolute path to package.json file for a package
12+
const resolvePackageJson = (name) => require.resolve(`${name}/package.json`);
13+
14+
// Returns absolute path to directory containing package.json file for a package
15+
const resolvePackageRoot = (name) => dirname(resolvePackageJson(name));
16+
1117
module.exports = {
1218
entry: './src/app.ts',
1319
devtool: 'source-map',
1420
devServer: {
1521
static: './dist',
16-
hot: true
22+
hot: true,
1723
},
1824
mode: 'development',
1925
module: {
@@ -22,22 +28,21 @@ module.exports = {
2228
test: /\.[jt]s$/,
2329
include: [
2430
join(__dirname, 'src'),
25-
join(__dirname, 'node_modules/botbuilder-core/lib'),
31+
resolvePackageRoot('botbuilder-core'),
32+
resolvePackageRoot('botbuilder-dialogs'),
2633
],
27-
use: ['babel-loader']
34+
use: ['babel-loader'],
2835
},
2936
{
3037
test: /\.css$/,
31-
use: ['style-loader', 'css-loader']
32-
}
33-
]
38+
use: ['style-loader', 'css-loader'],
39+
},
40+
],
3441
},
3542
plugins: [
3643
new CleanWebpackPlugin(),
3744
new CopyWebpackPlugin({
38-
patterns: [
39-
{ from: resolve(__dirname, 'index.html'), to: '' }
40-
]
45+
patterns: [{ from: resolve(__dirname, 'index.html'), to: '' }],
4146
}),
4247
// Work around for Buffer is undefined:
4348
// https://github.com/webpack/changelog-v5/issues/10
@@ -57,12 +62,12 @@ module.exports = {
5762
vm: false,
5863
path: false,
5964
crypto: false,
60-
stream: require.resolve("stream-browserify"),
61-
buffer: require.resolve("buffer")
62-
}
65+
stream: require.resolve('stream-browserify'),
66+
buffer: require.resolve('buffer')
67+
},
6368
},
6469
output: {
6570
filename: 'app.js',
66-
path: resolve(__dirname, 'dist')
67-
}
71+
path: resolve(__dirname, 'dist'),
72+
},
6873
};

0 commit comments

Comments
 (0)