Bump Node dependencies and fix deprecations and linting failures

Bumps the following, which will be needed by subsequent patches:

* stylelint-config-wikimedia = 0.16.1
* webpack = 5.89.0
* webpack-cli = 5.1.4
* @babel/preset-env = 7.3.0

Change-Id: Icd44ad126f11365ee1215672cee66868e79c8978
This commit is contained in:
MusikAnimal 2023-12-06 00:41:18 -05:00
parent 64e7054717
commit 75fa1ec8c7
8 changed files with 1991 additions and 7848 deletions

9782
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -21,7 +21,7 @@
"devDependencies": { "devDependencies": {
"@babel/core": "7.22.20", "@babel/core": "7.22.20",
"@babel/plugin-transform-runtime": "7.22.15", "@babel/plugin-transform-runtime": "7.22.15",
"@babel/preset-env": "7.2.0", "@babel/preset-env": "7.3.0",
"@codemirror/commands": "6.2.5", "@codemirror/commands": "6.2.5",
"@codemirror/search": "6.5.4", "@codemirror/search": "6.5.4",
"@codemirror/state": "6.2.1", "@codemirror/state": "6.2.1",
@ -36,15 +36,15 @@
"bundlesize": "0.18.1", "bundlesize": "0.18.1",
"clean-webpack-plugin": "3.0.0", "clean-webpack-plugin": "3.0.0",
"dotenv": "8.2.0", "dotenv": "8.2.0",
"eslint-config-wikimedia": "0.25.1", "eslint-config-wikimedia": "0.26.0",
"grunt-banana-checker": "0.11.0", "grunt-banana-checker": "0.11.0",
"jest": "29.7.0", "jest": "29.7.0",
"jest-environment-jsdom": "29.7.0", "jest-environment-jsdom": "29.7.0",
"jquery": "3.7.1", "jquery": "3.7.1",
"stylelint-config-wikimedia": "0.16.1", "stylelint-config-wikimedia": "0.16.1",
"wdio-mediawiki": "2.3.0", "wdio-mediawiki": "2.3.0",
"webpack": "4.47.0", "webpack": "5.89.0",
"webpack-cli": "3.3.12" "webpack-cli": "5.1.4"
}, },
"bundlesize": [ "bundlesize": [
{ {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -108,6 +108,7 @@ function init() {
codeMirror.setSize( '100%', $textbox1.parent().height() ); codeMirror.setSize( '100%', $textbox1.parent().height() );
} else { } else {
// RL module jquery.ui // RL module jquery.ui
// eslint-disable-next-line es-x/no-resizable-and-growable-arraybuffers
$codeMirror.resizable( { $codeMirror.resizable( {
handles: 'se', handles: 'se',
resize: function () { resize: function () {

View file

@ -1011,14 +1011,18 @@
CodeMirror.defineMode( 'mw-tag-pre', function ( /* config, parserConfig */ ) { CodeMirror.defineMode( 'mw-tag-pre', function ( /* config, parserConfig */ ) {
return { return {
startState: function () { return {}; }, startState: function () {
return {};
},
token: eatNowiki( 'mw-tag-pre', 'line-cm-mw-tag-pre' ) token: eatNowiki( 'mw-tag-pre', 'line-cm-mw-tag-pre' )
}; };
} ); } );
CodeMirror.defineMode( 'mw-tag-nowiki', function ( /* config, parserConfig */ ) { CodeMirror.defineMode( 'mw-tag-nowiki', function ( /* config, parserConfig */ ) {
return { return {
startState: function () { return {}; }, startState: function () {
return {};
},
token: eatNowiki( 'mw-tag-nowiki', 'line-cm-mw-tag-nowiki' ) token: eatNowiki( 'mw-tag-nowiki', 'line-cm-mw-tag-nowiki' )
}; };
} ); } );

View file

@ -16,9 +16,18 @@ class EditPage extends Page {
await super.openTitle( title, queryParams ); await super.openTitle( title, queryParams );
} }
get wikiEditorToolbar() { return $( '#wikiEditor-ui-toolbar' ); } get wikiEditorToolbar() {
get legacyTextInput() { return $( '#wpTextbox1' ); } return $( '#wikiEditor-ui-toolbar' );
get legacyCodeMirrorButton() { return $( '#mw-editbutton-codemirror' ); } }
get legacyTextInput() {
return $( '#wpTextbox1' );
}
get legacyCodeMirrorButton() {
return $( '#mw-editbutton-codemirror' );
}
async clickText() { async clickText() {
if ( await this.visualEditorSave.isDisplayed() ) { if ( await this.visualEditorSave.isDisplayed() ) {
await this.visualEditorSurface.click(); await this.visualEditorSurface.click();
@ -30,8 +39,13 @@ class EditPage extends Page {
} }
} }
get visualEditorSave() { return $( '.ve-ui-toolbar-saveButton' ); } get visualEditorSave() {
get visualEditorSurface() { return $( '.ve-ui-surface-source' ); } return $( '.ve-ui-toolbar-saveButton' );
}
get visualEditorSurface() {
return $( '.ve-ui-surface-source' );
}
async cursorToPosition( index ) { async cursorToPosition( index ) {
await this.clickText(); await this.clickText();
@ -44,7 +58,9 @@ class EditPage extends Page {
await browser.keys( keys ); await browser.keys( keys );
} }
get highlightedBrackets() { return $$( '.CodeMirror-line .cm-mw-matchingbracket' ); } get highlightedBrackets() {
return $$( '.CodeMirror-line .cm-mw-matchingbracket' );
}
async getHighlightedMatchingBrackets() { async getHighlightedMatchingBrackets() {
await this.highlightedBrackets[ 0 ].waitForDisplayed(); await this.highlightedBrackets[ 0 ].waitForDisplayed();

View file

@ -18,7 +18,7 @@ module.exports = ( env, argv ) => ( {
}, },
// Fail on the first build error instead of tolerating it for prod builds. This seems to // 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', bail: argv.mode === 'production',
// Specify that all paths are relative the Webpack configuration directory not the current // Specify that all paths are relative the Webpack configuration directory not the current
@ -44,7 +44,7 @@ module.exports = ( env, argv ) => ( {
optimization: { optimization: {
// Don't produce production output when a build error occurs. // 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 // 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 // increases the gzipped bundle size some but makes the build products easier to debug and
@ -65,9 +65,9 @@ module.exports = ( env, argv ) => ( {
// Rename source map extensions. Per T173491 files with a .map extension cannot be served // Rename source map extensions. Per T173491 files with a .map extension cannot be served
// from prod. // from prod.
sourceMapFilename: `[file]${srcMapExt}`, sourceMapFilename: `[file]${ srcMapExt }`,
devtoolModuleFilenameTemplate: `${PUBLIC_PATH}/[resource-path]` devtoolModuleFilenameTemplate: `${ PUBLIC_PATH }/[resource-path]`
}, },
// Accurate source maps at the expense of build time. The source map is intentionally exposed // Accurate source maps at the expense of build time. The source map is intentionally exposed