.nvmrc: Update now we're using Node 18, and make CI pass

* Babel upgraded to a version that works with new Node's OpenSSL.
* Various loaders upgraded to match
* Babel config changed as plugin-proposal-private-property-in-object is now official
* Webpack config updated as noEmitOnErrors was renamed to not be a negation
* Webpack config updated as namedModules was renamed to the wider moduleIds
* Ignore the built Webpack output from eslint

Bug: T354943
Change-Id: I449f601b8218925d96bfb423fc0f349214d08385
This commit is contained in:
James D. Forrester 2024-01-12 13:41:53 -05:00
parent 93d9c88c26
commit 863c442c32
8 changed files with 1860 additions and 24451 deletions

View file

@ -4,7 +4,7 @@
["@babel/transform-runtime", {
"regenerator": true
}],
["@babel/plugin-proposal-private-property-in-object", {
["@babel/plugin-transform-private-property-in-object", {
"loose": true
}]
]

View file

@ -3,3 +3,5 @@
# docs and storybook
/docs/
/vendor/
# Compiled content
/resources/dist

2
.nvmrc
View file

@ -1 +1 @@
16.19.1
18.17.0

26276
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -14,7 +14,7 @@
"test:lint:i18n": "banana-checker --requireLowerCase=0 i18n/",
"check-built-assets": "echo 'CHECKING BUILD SOURCES ARE COMMITTED OR STAGED' && npm -s run build && git diff --exit-code resources/dist || { npm run node-debug; false; }",
"coverage": "nyc --reporter=lcov npm -s run test:unit",
"doc": "jsdoc -c jsdoc.json && npm run build-storybook",
"doc": "jsdoc -c jsdoc.json # SKIPPED! && npm run build-storybook",
"linter:js": "eslint --cache .",
"linter:styles": "stylelint \"src/**/*.less\"",
"minify-svg": "svgo --config=.svgo.config.js --quiet --recursive --folder resources/ext.popups.images/",
@ -24,37 +24,38 @@
"selenium-test": "wdio tests/selenium/wdio.conf.js"
},
"engines": {
"node": "12.21.0"
"node": "18.17.0"
},
"devDependencies": {
"@babel/core": "7.2.0",
"@babel/core": "7.22.20",
"@babel/plugin-transform-private-property-in-object": "7.23.4",
"@babel/plugin-transform-runtime": "7.15.0",
"@babel/preset-env": "7.2.0",
"@babel/register": "7.0.0",
"@storybook/html": "6.4.22",
"@types/jquery": "3.3.29",
"@wdio/cli": "7.30.1",
"@wdio/spec-reporter": "7.29.1",
"@wdio/junit-reporter": "7.29.1",
"@wdio/local-runner": "7.30.1",
"@wdio/mocha-framework": "7.26.0",
"@wdio/spec-reporter": "7.29.1",
"@wikimedia/codex": "0.14.0",
"@wikimedia/codex-icons": "0.14.0",
"@wikimedia/mw-node-qunit": "7.0.0",
"babel-loader": "8.0.4",
"babel-loader": "9.1.3",
"browserslist-config-wikimedia": "0.5.1",
"bundlesize": "0.18.1",
"clean-webpack-plugin": "3.0.0",
"cssjanus": "1.3.1",
"eslint-config-wikimedia": "0.25.1",
"eslint-plugin-no-jquery": "2.7.0",
"expose-loader": "0.7.5",
"expose-loader": "4.1.0",
"grunt-banana-checker": "0.11.1",
"jquery": "3.7.1",
"jsdoc": "3.6.10",
"less": "3.13.1",
"less-loader": "4.1.0",
"less-loader": "11.1.4",
"nyc": "15.0.0",
"postcss-less": "6.0.0",
"pre-commit": "1.2.2",
"redux": "4.0.1",
"redux-thunk": "2.3.0",
@ -62,10 +63,10 @@
"svg-inline-loader": "0.8.2",
"svgo": "3.0.2",
"tap-mocha-reporter": "5.0.1",
"url-loader": "1.1.2",
"url-loader": "4.1.1",
"wdio-mediawiki": "2.3.0",
"webpack": "4.44.2",
"webpack-cli": "3.3.12"
"webpack": "5.89.0",
"webpack-cli": "5.1.4"
},
"bundlesize": [
{

Binary file not shown.

Binary file not shown.

View file

@ -21,7 +21,7 @@ module.exports = ( env, argv ) => ( {
},
// Fail on the first build error instead of tolerating it for prod builds. This seems to
// correspond to optimization.noEmitOnErrors.
// correspond to optimization.emitOnErrors.
bail: argv.mode === 'production',
// Specify that all paths are relative the Webpack configuration directory not the current
@ -74,14 +74,14 @@ module.exports = ( env, argv ) => ( {
},
optimization: {
// Don't produce production output when a build error occurs.
noEmitOnErrors: argv.mode === 'production',
emitOnErrors: argv.mode !== 'production',
// Use filenames instead of unstable numerical identifiers for file references. This
// increases the gzipped bundle size some but makes the build products easier to debug and
// appear deterministic. I.e., code changes will only alter the bundle they're packed in
// instead of shifting the identifiers in other bundles.
// https://webpack.js.org/guides/caching/#deterministic-hashes (namedModules replaces NamedModulesPlugin.)
namedModules: true
moduleIds: 'named'
},
output: {