Skip to content

Commit

Permalink
chore: upgrade webpack to v5 to support lts/hydrogen (Jigsaw-Code#1422)
Browse files Browse the repository at this point in the history
* upgrade dependencies and fix API changes

* skipLibCheck

* attempt test fixes

* fix attempt

* stream-http

* fix final thing i think
  • Loading branch information
daniellacosse authored Oct 11, 2023
1 parent 8367783 commit 3574b5f
Show file tree
Hide file tree
Showing 12 changed files with 1,913 additions and 4,080 deletions.
5,918 changes: 1,866 additions & 4,052 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@types/node-fetch": "^2.6.2",
"@typescript-eslint/eslint-plugin": "^5.14.0",
"@typescript-eslint/parser": "^5.14.0",
"@webpack-cli/serve": "^1.6.1",
"@webpack-cli/serve": "^2.0.5",
"browserslist": "^4.20.3",
"eslint": "^8.10.0",
"eslint-import-resolver-typescript": "^2.7.1",
Expand Down
3 changes: 2 additions & 1 deletion src/metrics_server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"removeComments": false,
"strict": true,
"module": "commonjs",
"outDir": "../../build/metrics_server"
"outDir": "../../build/metrics_server",
"skipLibCheck": true
},
"include": ["**/*.ts"]
}
5 changes: 4 additions & 1 deletion src/sentry_webhook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"@sentry/types": "^4.4.1",
"@types/express": "^4.17.12",
"@types/jasmine": "^5.1.0",
"jasmine": "^5.1.0"
"https-browserify": "^1.0.0",
"jasmine": "^5.1.0",
"stream-http": "^3.2.0",
"url": "^0.11.3"
}
}
9 changes: 8 additions & 1 deletion src/sentry_webhook/test.webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ exports.makeConfig = (options) => {
},
],
},
resolve: {extensions: ['.tsx', '.ts', '.js']},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
fallback: {
https: require.resolve('https-browserify'),
url: require.resolve('url/'),
http: require.resolve('stream-http'),
},
},
};
};
3 changes: 2 additions & 1 deletion src/sentry_webhook/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"removeComments": false,
"strict": true,
"module": "commonjs",
"outDir": "../../build/sentry_webhook"
"outDir": "../../build/sentry_webhook",
"skipLibCheck": true
},
"include": ["**/*.ts"]
}
15 changes: 7 additions & 8 deletions src/server_manager/base.webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,16 @@ exports.makeConfig = (options) => {
// Statically link the Roboto font, rather than link to fonts.googleapis.com
'window.polymerSkipLoadingFontRoboto': JSON.stringify(true),
}),
new CopyPlugin(
[
{from: 'index.html', to: '.'},
{from: `${CIRCLE_FLAGS_PATH}/flags`, to: 'images/flags'},
{from: 'images', to: 'images'}, // Overwrite any colliding flags.
{from: 'messages', to: 'messages'},
new CopyPlugin({
patterns: [
{from: `${CIRCLE_FLAGS_PATH}/flags`, to: 'images/flags', context: __dirname},
{from: 'images', to: 'images', context: __dirname}, // Overwrite any colliding flags.
{from: 'messages', to: 'messages', context: __dirname},
],
{context: __dirname}
),
}),
new HtmlWebpackPlugin({
template: options.template || path.resolve(__dirname, './index.html'),
filename: 'index.html',
}),
],
};
Expand Down
18 changes: 9 additions & 9 deletions src/server_manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@
"@types/puppeteer": "^5.4.2",
"@types/request": "^2.47.1",
"@types/semver": "^5.5.0",
"copy-webpack-plugin": "^5.1.1",
"css-loader": "^3.5.3",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.8.1",
"electron": "19.1.9",
"electron-builder": "^23.6.0",
"electron-icon-maker": "^0.0.4",
Expand All @@ -86,21 +86,21 @@
"gulp": "^4.0.0",
"gulp-posthtml": "^3.0.4",
"gulp-replace": "^1.0.0",
"html-webpack-plugin": "^4.2.1",
"html-webpack-plugin": "^5.5.3",
"karma": "^6.3.16",
"karma-chrome-launcher": "^3.1.0",
"karma-jasmine": "^4.0.1",
"karma-webpack": "^4.0.2",
"karma-webpack": "^5.0.0",
"node-jq": "^1.11.2",
"postcss": "^7.0.29",
"postcss-rtl": "^1.7.3",
"posthtml-postcss": "^0.2.6",
"puppeteer": "^13.6.0",
"style-loader": "^1.2.1",
"ts-loader": "^7.0.1",
"webpack": "^4.43.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.9.0",
"style-loader": "^3.3.3",
"ts-loader": "^9.5.0",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1",
"webpack-node-externals": "^3.0.0"
},
"resolutions": {
Expand Down
8 changes: 7 additions & 1 deletion src/server_manager/web_app/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

const webpack = require('webpack');
const {makeConfig} = require('../base.webpack.js');
process.env.CHROMIUM_BIN = require('puppeteer').executablePath();

Expand Down Expand Up @@ -45,7 +46,12 @@ module.exports = function (config) {
webpack: {
module: baseConfig.module,
resolve: baseConfig.resolve,
plugins: baseConfig.plugins,
plugins: [
...baseConfig.plugins,
new webpack.ProvidePlugin({
process: 'process/browser',
}),
],
mode: baseConfig.mode,
},
});
Expand Down
6 changes: 3 additions & 3 deletions src/shadowbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"@types/restify-cors-middleware": "^1.0.1",
"@types/tmp": "^0.2.1",
"tmp": "^0.2.1",
"ts-loader": "^7.0.4",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11"
"ts-loader": "^9.5.0",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4"
}
}
3 changes: 2 additions & 1 deletion src/shadowbox/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"module": "commonjs",
"rootDir": ".",
"resolveJsonModule": true,
"sourceMap": true
"sourceMap": true,
"skipLibCheck": true
},
"include": ["server/main.ts", "**/*.spec.ts", "types/**/*.d.ts"],
"exclude": ["build", "node_modules"]
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"experimentalDecorators": true,
"allowJs": true,
"resolveJsonModule": true,
"noUnusedLocals": true
"noUnusedLocals": true,
"skipLibCheck": true
}
}

0 comments on commit 3574b5f

Please sign in to comment.