Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
908 commits
Select commit Hold shift + click to select a range
89cf0ed
EditCheck: Call updateForListener in series in #refresh
edg2s Jul 15, 2025
d9a0faa
Update VE core submodule to master (190c98920)
edg2s Jul 15, 2025
3c26502
checkModules.js: Add documentation
edg2s Jul 10, 2025
28a6ad9
EditCheckActionWidget: Add missing documentation
edg2s Jul 16, 2025
ab58e90
EditCheck Controller: Ensure #getActions always returns an array
edg2s Jul 16, 2025
e61333c
build: Use SVGO v4, move out of Grunt to be similar to other repos
jdforrester Jul 16, 2025
fa6e00b
Localisation updates from https://translatewiki.net.
translatewiki Jul 17, 2025
b502865
mw.Target: Use excludeFromTargetWidget
edg2s Jun 26, 2025
b25b452
Edit check: restrict tone check to only validated languages
kemayo Jul 17, 2025
7c81441
Localisation updates from https://translatewiki.net.
translatewiki Jul 21, 2025
d05984d
Edit check: create editcheck-tone tag for when tone is detected
edg2s Jun 6, 2025
d9b06cc
Edit check: tell the tone check model the current content language
kemayo Jul 17, 2025
db79aa2
Edit check: add a way for async text checks to apply filters after me…
kemayo Jul 17, 2025
024e019
Edit check: make tone check threshold configurable
kemayo Jul 17, 2025
47d3e01
Localisation updates from https://translatewiki.net.
translatewiki Jul 22, 2025
f516dcf
Localisation updates from https://translatewiki.net.
translatewiki Jul 23, 2025
138114c
Minimize footprint of data-ve-ignore="true"
thiemowmde Jul 15, 2025
69a913f
Localisation updates from https://translatewiki.net.
translatewiki Jul 24, 2025
d88097e
Update VE core submodule to master (810cd4b38)
jdforrester Jul 25, 2025
5c1d171
Localisation updates from https://translatewiki.net.
translatewiki Jul 25, 2025
120860e
Tone check: don't cause an error when the model fails
kemayo Jul 25, 2025
4182c79
build: Updating eslint-config-wikimedia to 0.31.0
Jul 26, 2025
cf32e1e
Edit check: skip collapsed ranges when computing modified content bra…
kemayo Jul 27, 2025
5253cf8
Localisation updates from https://translatewiki.net.
translatewiki Jul 28, 2025
4ac3236
EditCheck Controller: Reduce calls to updatePositions
edg2s Jul 16, 2025
ccffaaa
Localisation updates from https://translatewiki.net.
translatewiki Jul 29, 2025
23da63a
Set 'returntoquery' on login/signup links when building edit intro me…
MatmaRex Jul 24, 2025
7ae2bc1
Localisation updates from https://translatewiki.net.
translatewiki Jul 30, 2025
d82b9c1
Update VE core submodule to master (307c0c15a)
edg2s Jul 30, 2025
a857b59
ToneCheck: Only close the dialog on 'revise' when in pre-save mode
edg2s Jul 17, 2025
48d77ca
EditCheck: Use new ve-ce-surface-selection-rect class
edg2s Jul 15, 2025
72e5d68
Force-close edit check dialog on teardown
edg2s Jul 15, 2025
8b3c7c8
Localisation updates from https://translatewiki.net.
translatewiki Jul 31, 2025
9a60eea
build: Stop using grunt-image to minify screenshot PNGs
jdforrester Jul 30, 2025
063dd10
Edit check: adjust paddings
kemayo Jul 31, 2025
61efdde
Edit check: update paste check flow
kemayo Jul 31, 2025
3b0d01f
Edit check: the active check's gutter highlight should appear on top
kemayo Jul 28, 2025
5879cd2
Update VE core submodule to master (7fba6a44c)
edg2s Jul 31, 2025
cb6f45c
Fix placement of toolbar insert group on mobile
edg2s Jul 31, 2025
6d0147e
GutterSidebarEditCheckDialog: Guard against null bounding rects
edg2s Jul 31, 2025
b649837
Localisation updates from https://translatewiki.net.
translatewiki Aug 1, 2025
255b304
Update VE core submodule to master (21ae6b49e)
edg2s Aug 1, 2025
eb6c3f4
Localisation updates from https://translatewiki.net.
translatewiki Aug 4, 2025
7cdde3a
Localisation updates from https://translatewiki.net.
translatewiki Aug 5, 2025
47dcd64
Localisation updates from https://translatewiki.net.
translatewiki Aug 6, 2025
55cb63e
EditCheck: Add 'stale' state to checks
divec Jul 13, 2025
ff7afda
EditCheck: Suppress gutter for stale/revising checks
edg2s Jul 30, 2025
b59149a
ToneCheck: Add a "recheck" button when a user revises a paragraph
foldleft Jul 29, 2025
7802fb5
EditCheck: Use core support for gutter highlights
edg2s Jul 31, 2025
a67c014
Localisation updates from https://translatewiki.net.
translatewiki Aug 7, 2025
b58fce9
Edit check: change the name of the paste check from importCopyvio
kemayo Aug 7, 2025
42a1a4c
Replace OO.ui.msg() with more consistent ve.msg()
thiemowmde Aug 7, 2025
e0a95a6
build: Updating dependencies
Aug 8, 2025
285ffaa
Localisation updates from https://translatewiki.net.
translatewiki Aug 8, 2025
6aa4b70
build: Updating npm dependencies
Aug 10, 2025
a1d0ab1
Localisation updates from https://translatewiki.net.
translatewiki Aug 11, 2025
99277b0
Edit check: add a way to set a prompt for an action widget's choices
kemayo Jul 31, 2025
de718e7
Edit check: add prompt to copyvio
kemayo Jul 31, 2025
5137fd0
Edit check: fix convert references check
kemayo Aug 11, 2025
653c4b4
Localisation updates from https://translatewiki.net.
translatewiki Aug 12, 2025
8c65b75
Edit check: widget collapsed state wasn't being set on creation
kemayo Aug 12, 2025
029ba07
Tone check: surface wasn't being focused on revise
kemayo Aug 12, 2025
7b80a45
Source editor 2017: make preview respect appearance choices
Aug 12, 2025
3d110b9
Edit check: selectionmanager/gutter merge follow-ups
kemayo Aug 13, 2025
e72c12a
Localisation updates from https://translatewiki.net.
translatewiki Aug 13, 2025
1ae464a
Edit check: removeAction needs to emit the full action list
kemayo Aug 13, 2025
542157f
Tone check: track less state in the action flow
kemayo Aug 11, 2025
c691227
LinkCache: Skip the "missing link" microcache in certain cases
edg2s Apr 30, 2025
f995b85
Edit check: getActions should sort actions after merging lists
kemayo Aug 13, 2025
df745c0
Edit check: rely on getActions for the final result in updateForListener
kemayo Aug 13, 2025
8dcaf28
Edit check: stop deselecting checks when the selection leaves them
kemayo Aug 13, 2025
4acceaa
Tone check: stop "revise" from undoing itself immediately
kemayo Aug 13, 2025
f03b454
Localisation updates from https://translatewiki.net.
translatewiki Aug 14, 2025
0b93db0
Update VE core submodule to master (2824d0c43)
thiemowmde Aug 14, 2025
c450122
Use $veConfig for VE configs
edg2s Aug 13, 2025
8c69980
MWLanguagesPage: Remove unused code for unsupported editing of local …
edg2s Jun 4, 2025
4973586
Use LESS nesting in some more places
edg2s Jun 11, 2025
b4420bc
Introduce VisualEditorFileModule to load files from lib/ve/build/modu…
edg2s Jul 9, 2025
d61e89a
Edit check: make sure updatePositions isn't called after teardown
kemayo Aug 14, 2025
87baeed
Localisation updates from https://translatewiki.net.
translatewiki Aug 15, 2025
d485636
Edit check: link the tone check help page from editcheck-tone-shown tags
kemayo Aug 7, 2025
3461f78
Use namespaced GlobalVarConfig
SomeMWDev Aug 15, 2025
016fb21
Localisation updates from https://translatewiki.net.
translatewiki Aug 18, 2025
4a63487
Added some documentation to various dialog-related classes inside edi…
foldleft Aug 1, 2025
28bac41
selenium: Skip flaky tests
marxarelli Aug 13, 2025
904f56c
Edit check: fix check focus issues
kemayo Aug 13, 2025
1512692
Edit check: increase the padding below the decline survey
kemayo Aug 18, 2025
23baf87
Localisation updates from https://translatewiki.net.
translatewiki Aug 19, 2025
95e983b
Only show template favoriting button if the template exists
samwilson Aug 18, 2025
2c9a6c5
Localisation updates from https://translatewiki.net.
translatewiki Aug 20, 2025
db1122e
Localisation updates from https://translatewiki.net.
translatewiki Aug 21, 2025
199341e
Edit check: gutter sidebar not correctly updating for all listeners
kemayo Aug 21, 2025
e7dd4fb
Localisation updates from https://translatewiki.net.
translatewiki Aug 22, 2025
8840998
Localisation updates from https://translatewiki.net.
translatewiki Aug 25, 2025
affc6ec
Edit check: split out the gutter section widget into a proper class
kemayo Aug 21, 2025
b322bcf
Edit check: pull knowledge of "revising" out of EditCheckAction
kemayo Aug 21, 2025
5ab07d6
Edit check: allow untagging of actions, add helpers on actions for tags
kemayo Aug 22, 2025
a40dace
Tone check: when revising in mobile, show a quick-action in the gutter
kemayo Aug 21, 2025
0221712
Localisation updates from https://translatewiki.net.
translatewiki Aug 26, 2025
5ef9289
Localisation updates from https://translatewiki.net.
translatewiki Aug 27, 2025
6cb1060
Restore ext.visualEditor.track module
edg2s Aug 29, 2025
9b10dcd
Localisation updates from https://translatewiki.net.
translatewiki Sep 1, 2025
5373d67
Edit check: set up the tone check a/b test
kemayo Aug 18, 2025
449a458
Localisation updates from https://translatewiki.net.
translatewiki Sep 2, 2025
5e95c65
Tone check: Thank user for considering tone; rephrases message
foldleft Aug 27, 2025
173751c
Edit check: log to VEFU if a tone check would have been shown if not …
kemayo Aug 19, 2025
1adad30
Localisation updates from https://translatewiki.net.
translatewiki Sep 3, 2025
de6ce65
Update VE core submodule to master (4f51b5f65)
jdforrester Sep 4, 2025
451ae0f
Localisation updates from https://translatewiki.net.
translatewiki Sep 4, 2025
9ee7264
Localisation updates from https://translatewiki.net.
translatewiki Sep 5, 2025
ea71d50
DesktopArticleTarget: Fix switching editors with changes while editin…
MatmaRex Sep 4, 2025
a65c5f4
Update VE core submodule to master (a5bd08c8b)
kemayo Sep 5, 2025
ab01538
build: Updating mediawiki/mediawiki-codesniffer to 48.0.0
Sep 6, 2025
2ad4495
Use PHP8 constructor property promotion syntax for dependency injection
umherirrender Sep 6, 2025
9a33eef
Localisation updates from https://translatewiki.net.
translatewiki Sep 8, 2025
ff8e386
Edit check gutter: don't hold on to references to torn down widgets
kemayo Sep 8, 2025
c474908
Edit check: allow setting of default config for all checks
kemayo Jul 25, 2025
b9ec048
Edit check: refactor tracking of shown checks
kemayo Sep 4, 2025
7d49d12
Paste check: add editcheck-paste-shown tag
kemayo Sep 4, 2025
9f6b6cb
Fix new PHPCS exception
MatmaRex Sep 8, 2025
444c263
Fix bug where clicking radio in Paste Check breaks surface
foldleft Sep 1, 2025
61bf1b8
Only allow specific checks to become stale
edg2s Sep 5, 2025
d53d685
Use LabelToolGroup for pre-save toolbar
edg2s Jul 18, 2025
f2d053e
Change "reload page" to "refresh" in a message
amire80 Aug 15, 2025
43d3392
Correctly turn off alignToTop on mobile
edg2s Sep 9, 2025
0fb732d
Manually scroll check into view when entering pre-save
edg2s Sep 9, 2025
96ef4b9
Localisation updates from https://translatewiki.net.
translatewiki Sep 10, 2025
26ce545
MWExtensionDialog: Load all messages correctly
edg2s Sep 10, 2025
b1d4cbe
Move ooui-dialog-process-continue message to correct module
edg2s Sep 10, 2025
5264042
Move ToneCheck out of /experimental
edg2s Sep 10, 2025
aab489e
Localisation updates from https://translatewiki.net.
translatewiki Sep 11, 2025
8314498
Load/save Display title correctly
Aug 25, 2025
48ae19e
Localisation updates from https://translatewiki.net.
translatewiki Sep 12, 2025
e19213c
Remove grey background from mobile EditCheck
edg2s Sep 8, 2025
7d87115
Fix DISPLAYTITLE adding extraneous whitespace
kemayo Sep 12, 2025
24f2b3b
Localisation updates from https://translatewiki.net.
translatewiki Sep 15, 2025
0907a7c
Update PasteCheck copy
edg2s Sep 4, 2025
bfa91a6
Update VE core submodule to master (70eee46f0)
edg2s Sep 15, 2025
de2fd85
Paste check: rename for consistency
kemayo Sep 10, 2025
a84f627
Edit check dialog: reset currentOffset when reusing the dialog
kemayo Sep 15, 2025
326f71d
Paste check: log when a paste check would have been shown if enabled
kemayo Sep 9, 2025
5ef5946
Localisation updates from https://translatewiki.net.
translatewiki Sep 16, 2025
88673d6
The save shortcut should switch panels rather than immediately saving
kemayo Sep 16, 2025
cff24fc
Wikitext link annotation inspector: check that initialAnnotation exists
kemayo Sep 16, 2025
757fde0
Localisation updates from https://translatewiki.net.
translatewiki Sep 17, 2025
8e50a18
Edit check: add a config that explicitly turns a check on or off
kemayo Sep 4, 2025
b94206a
Update copy for paste check decline
edg2s Sep 16, 2025
9c7b3b9
Load TemplateData message conditionally
edg2s Sep 17, 2025
5885044
Fix casing of hook handler onRecentChange_save
umherirrender Sep 17, 2025
78f3626
Localisation updates from https://translatewiki.net.
translatewiki Sep 18, 2025
bb54c1e
Localisation updates from https://translatewiki.net.
translatewiki Sep 19, 2025
d1c08a9
Update VE core submodule to master (cfd45f5a8)
edg2s Sep 19, 2025
dee5f0f
Localisation updates from https://translatewiki.net.
translatewiki Sep 22, 2025
d925cad
Tone check: optimize finding modified ranges
kemayo Sep 19, 2025
9a1096a
Localisation updates from https://translatewiki.net.
translatewiki Sep 23, 2025
97695cf
Update VE core submodule to master (3911ba7ce)
edg2s Sep 23, 2025
5d265a9
Tone check: don't error when rate limited
kemayo Sep 18, 2025
e8c5d31
Edit check dialog: in showActions check that currentOffset isn't null
kemayo Sep 15, 2025
a0c7fcb
Add foreign-resouces.cdx.json
reedy Sep 22, 2025
9c539f5
Update VE core submodule to master (ad0ed6d09)
kemayo Sep 24, 2025
eea7100
Edit check: update some check-creation for config changes
kemayo Sep 23, 2025
0bf41a3
Paste check: set up for the A/B test
kemayo Sep 23, 2025
9b5d26d
Display title fix
Sep 23, 2025
58c94cb
Paste check: logging shouldn't check nonDefaultChecks any more
kemayo Sep 24, 2025
318028e
Localisation updates from https://translatewiki.net.
translatewiki Sep 25, 2025
9fce0e7
Add a sequence for #redirect
kemayo Sep 11, 2025
3c1e45e
Localisation updates from https://translatewiki.net.
translatewiki Sep 26, 2025
9451a31
Tone check: batch requests together
kemayo Sep 19, 2025
cade525
Add an "edit" link to categories when viewing articles
kemayo Sep 29, 2023
f0e95dd
TextMatchEditCheck visibility configs
Sep 25, 2025
344f07e
VE Diff: Add z-index to div to fix Thank button disappearing
suecarmol Sep 26, 2025
58bb7b6
Localisation updates from https://translatewiki.net.
translatewiki Sep 29, 2025
47229c6
Edit check: use initialUrl to fetch ecenable param
edg2s Sep 30, 2025
a778586
Localisation updates from https://translatewiki.net.
translatewiki Oct 2, 2025
ceed3f4
GutterSidebarEditCheckDialog: Remove commented-out code
edg2s Oct 2, 2025
7a08fd2
Paste Check copy tweaks
edg2s Sep 30, 2025
a79e20c
Update VE core submodule to master (8b1b8b872)
MatmaRex Oct 2, 2025
bc00228
SECURITY: Properly escape and parse system messages
SomeMWDev Jul 26, 2025
e2e3cc4
build: Updating tar-fs to 3.1.1
Oct 3, 2025
da5880d
Update lib/ve to HEAD of master
reedy Oct 4, 2025
3ade47c
Localisation updates from https://translatewiki.net.
translatewiki Oct 6, 2025
ed4582a
selenium: Use ECMAScript modules
pwangai Oct 1, 2025
b8effd3
Update VE core submodule to master (e6b5fa682)
jdforrester Oct 6, 2025
02afe06
EditCheck mobile: Implement compact layout
edg2s Oct 1, 2025
2a29b5d
Controller: Reduce calls to closeWindow when not needed
edg2s Oct 2, 2025
19e42cd
Paste check: Show the check immediately on mobile
edg2s Oct 2, 2025
a7e0c02
Localisation updates from https://translatewiki.net.
translatewiki Oct 8, 2025
9e81545
Localisation updates from https://translatewiki.net.
translatewiki Oct 9, 2025
d535514
Only show a category edit link in read views for users who'd be given VE
kemayo Oct 7, 2025
d28860b
Localisation updates from https://translatewiki.net.
translatewiki Oct 10, 2025
db8e23d
Edit check: Watch out for onSelect being called after teardown by deb…
kemayo Oct 9, 2025
44d5770
Edit check: Add a wrapper to automate avoiding post-teardown debounce…
kemayo Oct 9, 2025
7803190
Use more trivial phpcs:enable comments
thiemowmde Oct 10, 2025
ebfa69c
MobileArticleTarget.tryTeardown should return a promise
kemayo Oct 9, 2025
d9eb7ad
styles: Remove gradient mixins
jhsoby Oct 9, 2025
54eb6a8
Localisation updates from https://translatewiki.net.
translatewiki Oct 13, 2025
e3655cb
Suggestions mode
kemayo Aug 1, 2025
71f3cb4
TextMatchEditCheck improvements
Oct 2, 2025
7a452d1
Update VE core submodule to master (dbbcfbc5a)
edg2s Oct 13, 2025
75ab77f
Replace gray100 borders with @border-subtle (gray300)
edg2s Oct 7, 2025
8d1d46f
Update VE core submodule to master (714b3ae07)
edg2s Oct 15, 2025
46b6fc0
Test ServiceWiring.php
Dreamy-Jazz Oct 15, 2025
41d6331
Localisation updates from https://translatewiki.net.
translatewiki Oct 16, 2025
2d9ec0c
Edit check: fix some eslint warnings
kemayo Oct 16, 2025
0d8c9fb
Edit check: getAddedNodes better cope with suggestion mode
kemayo Oct 16, 2025
072701e
Edit check: add experimental image caption check
kemayo Oct 16, 2025
fbd7a7b
Localisation updates from https://translatewiki.net.
translatewiki Oct 20, 2025
b11bc66
Tone check: explicitly time out model fetches after 6 seconds
kemayo Oct 17, 2025
c6eb872
Add VisualEditorAvailabilityLookup service
Dreamy-Jazz Oct 15, 2025
a81de3a
Expand VisualEditorAvailabilityLookup service
Dreamy-Jazz Oct 15, 2025
3a7ad81
Hard deprecate soft-deprecated ApiVisualEditor methods
Dreamy-Jazz Oct 17, 2025
e97cfa1
Update VE core submodule to master (bd2578ef5)
MatmaRex Oct 21, 2025
512b733
Enforce sanitized href
edg2s Oct 3, 2025
203cf79
Use correct name for getting service in Hooks::getPreferredEditor
Dreamy-Jazz Oct 21, 2025
f8e36fa
Localisation updates from https://translatewiki.net.
translatewiki Oct 22, 2025
01d8610
Localisation updates from https://translatewiki.net.
translatewiki Oct 23, 2025
d5ce496
Update VE core submodule to master (b70ee4a11)
Oct 23, 2025
c3d6bb9
Localisation updates from https://translatewiki.net.
translatewiki Oct 24, 2025
e201ec2
Edit check: instrument when pastes happen with known sources
kemayo Oct 16, 2025
beb7364
Edit check: support checks looking for non-pure insertions
kemayo Oct 16, 2025
0246ecb
Edit check: allow listeners to return nothing
kemayo Oct 24, 2025
bb80e76
TextMatchEditCheck: Case sensitivity improvements
Oct 21, 2025
bf25a78
Localisation updates from https://translatewiki.net.
translatewiki Nov 6, 2025
827e8d6
build: Updating min-document to 2.19.1
Nov 6, 2025
d4be86f
Localisation updates from https://translatewiki.net.
translatewiki Nov 20, 2025
f0f3d80
build: Updating npm dependencies
Nov 21, 2025
95e2007
Localisation updates from https://translatewiki.net.
translatewiki Dec 4, 2025
c414ca7
Localisation updates from https://translatewiki.net.
translatewiki Dec 18, 2025
d85daca
Localisation updates from https://translatewiki.net.
translatewiki Dec 25, 2025
a81ea45
Localisation updates from https://translatewiki.net.
translatewiki Jan 8, 2026
bf73e7d
build: Updating npm dependencies
Jan 18, 2026
a9430a6
Localisation updates from https://translatewiki.net.
translatewiki Jan 22, 2026
6751698
build: Updating npm dependencies
Jan 23, 2026
e70f028
Localisation updates from https://translatewiki.net.
translatewiki Jan 29, 2026
80cf709
Localisation updates from https://translatewiki.net.
translatewiki Feb 5, 2026
9c9296d
Localisation updates from https://translatewiki.net.
translatewiki Feb 12, 2026
a1745f2
Localisation updates from https://translatewiki.net.
translatewiki Feb 26, 2026
302a429
build: Updating npm dependencies
Feb 27, 2026
320b666
Localisation updates from https://translatewiki.net.
translatewiki Mar 5, 2026
3724c15
build: Updating npm dependencies
Mar 6, 2026
ebd542f
Localisation updates from https://translatewiki.net.
translatewiki Mar 12, 2026
7d8b7e7
Localisation updates from https://translatewiki.net.
translatewiki Mar 19, 2026
f29a374
build: Updating npm dependencies
Mar 20, 2026
8d1a70c
Localisation updates from https://translatewiki.net.
translatewiki Mar 26, 2026
97c45ad
Localisation updates from https://translatewiki.net.
translatewiki Apr 2, 2026
8a74a36
Localisation updates from https://translatewiki.net.
translatewiki Apr 9, 2026
1ae4e7a
build: Updating npm dependencies
Apr 10, 2026
f6fc212
Localisation updates from https://translatewiki.net.
translatewiki Apr 16, 2026
96d79a6
build: Updating npm dependencies
Apr 17, 2026
811a97d
build: Updating fast-xml-parser to 5.7.1
Apr 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .eslint-plugin-local.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict';

module.exports = require( './lib/ve/.eslint-plugin-local' );
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ tests/selenium/log

# OS
.DS_Store
/.stylelintcache
2 changes: 1 addition & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
],
"rules": {
"no-descending-specificity": null,
"selector-class-pattern": "^(ve|mw|oo-ui|client|skin)-"
"selector-class-pattern": "^(ve|mw|oo-ui|client|skin|vector)-"
}
}
39 changes: 39 additions & 0 deletions .svgo.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* SVGO Configuration
* Compatible with v4.0.0+
* Recommended options from:
* https://www.mediawiki.org/wiki/Manual:Coding_conventions/SVG#Exemplified_safe_configuration
*/
'use strict';
module.exports = {
plugins: [
{
// Set of built-in plugins enabled by default.
name: 'preset-default',
params: {
overrides: {
cleanupIds: false,
removeDesc: false,
// If the SVG doesn't start with an XML declaration, then its MIME type will
// be detected as "text/plain" rather than "image/svg+xml" by libmagic and,
// consequently, MediaWiki's CSSMin CSS minifier. libmagic's default database
// currently requires that SVGs contain an XML declaration:
// https://github.com/threatstack/libmagic/blob/master/magic/Magdir/sgml#L5
removeXMLProcInst: false
}
}
},
'removeRasterImages',
'sortAttrs'
],
// Set whitespace according to Wikimedia Coding Conventions.
// @see https://github.com/svg/svgo/blob/main/lib/stringifier.js#L39 for available options.
js2svg: {
eol: 'lf',
finalNewline: true,
// Configure the indent to tabs (default 4 spaces) used by `--pretty` here.
indent: '\t',
pretty: true
},
multipass: true
};
45 changes: 5 additions & 40 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-image' );
grunt.loadNpmTasks( 'grunt-mocha-test' );
grunt.loadNpmTasks( 'grunt-stylelint' );
grunt.loadNpmTasks( 'grunt-tyops' );
Expand All @@ -60,41 +59,6 @@ module.exports = function ( grunt ) {
src: [ 'build/screenshots.diffs.js' ]
}
},
image: {
pngs: {
options: {
zopflipng: true,
pngout: true,
optipng: true,
advpng: true,
pngcrush: true
},
'screenshots-en': {
expand: true,
src: 'screenshots/*-en.png'
},
'screenshots-all': {
expand: true,
src: 'screenshots/*.png'
}
},
svgs: {
options: {
svgo: [
'--pretty',
'--enable=removeRasterImages',
'--enable=sortAttrs',
'--disable=cleanupIDs',
'--disable=removeDesc',
'--disable=removeTitle',
'--disable=removeViewBox',
'--disable=removeXMLProcInst'
]
},
expand: true,
src: 'images/*.svg'
}
},
tyops: {
options: {
typos: 'build/typos.json'
Expand All @@ -120,7 +84,8 @@ module.exports = function ( grunt ) {
},
stylelint: {
options: {
reportNeedlessDisables: true
reportNeedlessDisables: true,
cache: true
},
all: [
'**/*.{css,less}',
Expand Down Expand Up @@ -165,14 +130,14 @@ module.exports = function ( grunt ) {

grunt.registerTask( 'test', [ 'tyops', 'eslint', 'stylelint', 'banana' ] );
grunt.registerTask( 'test-ci', [ 'git-status' ] );
grunt.registerTask( 'screenshots', [ 'mochaTest:screenshots-en', 'image:pngs' ] );
grunt.registerTask( 'screenshots-all', [ 'mochaTest:screenshots-all', 'image:pngs' ] );
grunt.registerTask( 'screenshots', [ 'mochaTest:screenshots-en' ] );
grunt.registerTask( 'screenshots-all', [ 'mochaTest:screenshots-all' ] );
grunt.registerTask( 'default', 'test' );

if ( process.env.JENKINS_HOME ) {
grunt.renameTask( 'test', 'test-internal' );
grunt.registerTask( 'test', [ 'test-internal', 'test-ci' ] );
} else {
grunt.registerTask( 'ci', [ 'test', 'image:svgs', 'test-ci' ] );
grunt.registerTask( 'ci', [ 'test', 'test-ci' ] );
}
};
23 changes: 20 additions & 3 deletions bin/updateSubmodule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,28 @@ fi

# Generate commit summary
NEWCHANGES=$(git log ..$TARGET --oneline --no-merges --topo-order --reverse --color=never)

if [ -z "$NEWCHANGES" ]; then
echo >&2 "No new changes"
exit 1
fi

LOCALISATION_UPDATES=$(echo "$NEWCHANGES" | grep "Localisation updates from https://translatewiki.net" | awk '{print $1}' | paste -sd, - | sed -E 's/,/, /g' | sed -E 's/(([^,]+, ?){6}) /\1\n/g')
NEWCHANGES=$(echo "$NEWCHANGES" | grep -v "Localisation updates from https://translatewiki.net")
TASKS=$(git log ..$TARGET --no-merges --format=format:%B | grep "Bug: T" | sort | uniq)

# Ensure script continues if grep "fails" (returns nothing) with || : (due to -e flag in bash)

# Addede/removed i18n keys
# Added/removed i18n keys
ADDED_I18N_KEYS=$(git diff HEAD..$TARGET -- i18n/en.json | grep -E '^\+' | grep --color=never -vE '^\+\+\+' | sed -E 's/^\+\s*"([^"]+)":.*/\1/' | sed 's/^/- /' || :)
DELETED_I18N_KEYS=$(git diff HEAD..$TARGET -- i18n/en.json | grep -E '^\-' | grep --color=never -vE '^\-\-\-' | sed -E 's/^\-\s*"([^"]+)":.*/\1/' | sed 's/^/- /' || :)

# Find common keys (modified keys)
MODIFIED_KEYS=$(echo -e "$ADDED_I18N_KEYS\n$DELETED_I18N_KEYS" | sort | uniq -d)

# Remove modified keys from the added and removed lists
ADDED_I18N_KEYS=$(echo "$ADDED_I18N_KEYS" | grep -vxF -f <(echo "$MODIFIED_KEYS") | sed 's/^/- /')
DELETED_I18N_KEYS=$(echo "$DELETED_I18N_KEYS" | grep -vxF -f <(echo "$MODIFIED_KEYS") | sed 's/^/- /')
ADDED_I18N_KEYS=$(echo "$ADDED_I18N_KEYS" | grep -vxF -f <(echo "$MODIFIED_KEYS") || :)
DELETED_I18N_KEYS=$(echo "$DELETED_I18N_KEYS" | grep -vxF -f <(echo "$MODIFIED_KEYS") || :)

# Added/removed files
ADDED_FILES=$(git diff HEAD..$TARGET --name-only --diff-filter=A | grep --color=never -E "\.(js|css|less)$" | sed 's/^/- /' || :)
Expand All @@ -68,6 +78,13 @@ COMMITMSG="Update VE core submodule to $TARGETDESC
New changes:
$NEWCHANGES"

if [ -n "$LOCALISATION_UPDATES" ]; then
COMMITMSG+="

Localisation Updates:
$LOCALISATION_UPDATES"
fi

if [ -n "$ADDED_I18N_KEYS" ]; then
COMMITMSG+="

Expand Down
97 changes: 71 additions & 26 deletions build/checkModules.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
/**
* Checks that all files referenced in lib/ve/build/modules.json are either:
* - referenced by a ResourceModule's veModules in extension.json (and thus loaded dynamically), or
* - explicitly listed in scripts/styles in extension.json, or
* - ignored via the ignore list in this script.
*
* Warns about unused "ignored" entries and errors on missing files.
*/

'use strict';

const path = require( 'path' );

const extensionJson = require( '../extension.json' );
const modulesJson = require( '../lib/ve/build/modules.json' );

/**
* List of file/directory patterns to ignore.
*
* @type {string[]}
*/
const ignored = [
'node_modules/',
'lib/',
Expand All @@ -28,8 +42,20 @@ const ignored = [
'tests/dm/ve.dm.TransportServer.test.js'
];

/**
* Ignored entries which haven't been used yet.
*
* @type {Set<string>}
*/
const unusedIgnores = new Set( ignored );

/**
* Add file or files to a Set, prefixing with basePath.
*
* @param {string|string[]|Object[]} files
* @param {Set<string>} set
* @param {string} [basePath='']
*/
function addFilesToSet( files, set, basePath = '' ) {
if ( Array.isArray( files ) ) {
files.forEach( ( file ) => set.add( path.join( basePath, file.file || file ) ) );
Expand All @@ -38,6 +64,14 @@ function addFilesToSet( files, set, basePath = '' ) {
}
}

/**
* Check if the filePath matches any 'ignored' entry.
*
* If matched, the entry is removed from unusedIgnores.
*
* @param {string} filePath
* @return {boolean}
*/
function isIgnored( filePath ) {
return ignored.some( ( ignorePath ) => {
const fullIgnorePath = path.join( 'lib/ve', ignorePath );
Expand All @@ -49,6 +83,13 @@ function isIgnored( filePath ) {
} );
}

/**
* Add all scripts and styles files from a modules object to a Set.
*
* @param {Object} modules
* @param {Set<string>} set
* @param {string} [basePath]
*/
function addModulesToSet( modules, set, basePath = '' ) {
Object.values( modules ).forEach( ( module ) => {
[
Expand All @@ -68,34 +109,38 @@ function addModulesToSet( modules, set, basePath = '' ) {
} );
}

function checkFiles() {
const extensionFiles = new Set();
addModulesToSet( extensionJson.ResourceModules, extensionFiles );
addModulesToSet( { QUnitTestModule: extensionJson.QUnitTestModule }, extensionFiles );

const modulesFiles = new Set();
addModulesToSet( modulesJson, modulesFiles, 'lib/ve' );
const extensionFiles = new Set();
addModulesToSet( extensionJson.ResourceModules, extensionFiles );
addModulesToSet( { QUnitTestModule: extensionJson.QUnitTestModule }, extensionFiles );

const missingFiles = Array.from( modulesFiles ).filter( ( file ) => !extensionFiles.has( file ) && !isIgnored( file ) );

if ( unusedIgnores.size ) {
console.warn(
'Unused ignore path(s) in checkModules.js:\n\n' +
Array.from( unusedIgnores ).map( ( ignore ) => `* ${ ignore }\n` ).join( '' )
);
// Modules listed in veModules of ResourceModules are loaded automatically.
Object.values( extensionJson.ResourceModules ).forEach( ( module ) => {
if ( module.veModules ) {
module.veModules.forEach( ( veModule ) => {
addModulesToSet( { [ veModule ]: modulesJson[ veModule ] || {} }, extensionFiles, 'lib/ve' );
} );
}
} );

if ( missingFiles.length ) {
console.error(
`${ missingFiles.length } file(s) from lib/ve/modules.json are missing from extension.json:\n\n` +
missingFiles.map( ( file ) => `* ${ file }\n` ).join( '' ) +
'\nIf any of these files are not required, add them to the ignore list in build/checkModules.js.'
);
// eslint-disable-next-line n/no-process-exit
process.exit( 1 );
} else {
console.log( 'No missing files.' );
}
const modulesFiles = new Set();
addModulesToSet( modulesJson, modulesFiles, 'lib/ve' );
const missingFiles = Array.from( modulesFiles ).filter( ( file ) => !extensionFiles.has( file ) && !isIgnored( file ) );

if ( unusedIgnores.size ) {
console.warn(
'Unused ignore path(s) in checkModules.js:\n\n' +
Array.from( unusedIgnores ).map( ( ignore ) => `* ${ ignore }\n` ).join( '' )
);
}

checkFiles();
if ( missingFiles.length ) {
console.error(
`${ missingFiles.length } file(s) from lib/ve/modules.json are missing from extension.json:\n\n` +
missingFiles.map( ( file ) => `* ${ file }\n` ).join( '' ) +
'\nIf any of these files are not required, add them to the ignore list in build/checkModules.js.'
);
// eslint-disable-next-line n/no-process-exit
process.exit( 1 );
} else {
console.log( 'No missing files.' );
}
4 changes: 2 additions & 2 deletions build/screenshots-client/userGuide.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ module.exports = {
const done = arguments[ arguments.length - 1 ],
surface = ve.init.target.surface;

surface.getToolbarDialogs().once( 'opening', ( win, opening ) => {
surface.getToolbarDialogs( 'above' ).once( 'opening', ( win, opening ) => {
opening.then( () => {
setTimeout( () => {
done(
Expand All @@ -153,7 +153,7 @@ module.exports = {
specialCharactersTeardown: function () {
const done = arguments[ arguments.length - 1 ],
surface = ve.init.target.surface;
surface.getToolbarDialogs().currentWindow.close().closed.then( done );
surface.getToolbarDialogs( 'above' ).currentWindow.close().closed.then( done );
},
formula: function () {
const done = arguments[ arguments.length - 1 ],
Expand Down
25 changes: 3 additions & 22 deletions build/screenshots-client/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,9 @@ module.exports = function () {

window.seleniumUtils = {
getBoundingRect: function ( elements ) {
let boundingRect;
for ( let i = 0, l = elements.length; i < l; i++ ) {
const rect = elements[ i ].getBoundingClientRect();
if ( !boundingRect ) {
boundingRect = {
left: rect.left,
top: rect.top,
right: rect.right,
bottom: rect.bottom
};
} else {
boundingRect.left = Math.min( boundingRect.left, rect.left );
boundingRect.top = Math.min( boundingRect.top, rect.top );
boundingRect.right = Math.max( boundingRect.right, rect.right );
boundingRect.bottom = Math.max( boundingRect.bottom, rect.bottom );
}
}
if ( boundingRect ) {
boundingRect.width = boundingRect.right - boundingRect.left;
boundingRect.height = boundingRect.bottom - boundingRect.top;
}
return boundingRect;
return ve.getBoundingRect(
elements.map( ( element ) => element.getBoundingClientRect() )
);
},
collapseToolbar: function () {
ve.init.target.toolbar.items.forEach( ( group ) => {
Expand Down
Loading