The upcoming Multiblocks project will make use of a Pinia store, which
is already shipped in MediaWiki via ResourceLoader. In order to continue
to test Vue components that make use of a store, we need the Pinia
testing utilities.
The 'pinia' package is locked to the same version that's in RL, 2.0.16,
while '@pinia/testing' is locked at 0.0.12, the same version used by
some extensions such as GrowthExperiments.
Bug: T251790
Change-Id: Ia88d987bf7e5afa1a17d63b4ebc96448ccec2f6c
This brings Jest to MW Core so that Vue components can more easily be
tested. Packages ending with 'icons.json' are auto-mapped to the
@wikimedia/codex-icons package, establishing a new convention.
Jest is needed for testing Vue, but can be used for general JS testing
as well. Documentation to come at https://www.mediawiki.org/wiki/Jest
Usage: to run the tests, run "npx jest" or "npm run jest" in the root
folder. This could be aliased to a "test:unit" script in package.json
if desired.
In order to make a Vue component testable, it is required to follow the
`module.exports = exports` pattern. See:
https://nodejs.org/api/modules.html#exports-shortcut
A default jest.setup.js is added that mocks Core's mw global object, as
well as providing the $i18n Vue plugin. This is based on
Extension:GrowthExperiments (GPL-3.0-or-later). See https://w.wiki/B9vM
An initial test for mediawiki.special.block is added, exemplifying how
to mock calls to mw.config.get().
NOTE: The "overrides" added to package.json is a temporary measure to
get around a current issue with caniuse-lite and the stylelint plugin
that relies on it. See:
https://github.com/RJWadley/stylelint-no-unsupported-browser-features/issues/299
Bug: T251790
Change-Id: I1af15e038d17b0f1c645fc5debf9db5846f6215c
* Use the new default set of plugins
* Remove prefixMap since that is now handled by the theme
* Remove linkMap items provided by the theme
* Replace the JSDoc-specific package.json with a maintitle
and README h1
* Add node_modules/jsdoc-class-hierarchy as a dependency.
This plugin isn't currently used in core, but it is part
of the default plugin set.
Bug: T368081
Change-Id: Ib2b16b2f4c5f11ff29cc6dc5d67df43bc59c9752
Move open search description endpoint from /w/opensource_desc.php
to /w/rest.php/v1/search.
Bug: T363984
Change-Id: Idb5b0d21adc6152ef77e6d17846b6acc6a904e01
In theory we shouldn't need to do this, because eslint-config-wikimedia
already provides eslint-plugin-vue. However, eslint-plugin-mediawiki
also pulls in eslint-plugin-vue but at an older version, and this causes
nonsensical vue/dot-location errors to be raised at the end of the
`<script>` block in each .vue file.
This is a temporary fix to make it possible to introduce .vue files in
MW core without having to disable the vue/dot-location at the end of
each file. Once this is fixed permanently upstream (see
https://github.com/wikimedia/eslint-plugin-mediawiki/pull/95), this
change can be undone.
Change-Id: Ibd616750f046a3a66b5d7f2665696ed9175a4090
Mozilla has stopped shipping the `Firefox.app/Contents/MacOS/firefox-bin`
entrypoint for macOS, instead favouring `Firefox.app/Contents/MacOS/firefox`.
This broke the launcher and requires a minor patch.
Pending an upstream release, use our fork for now. We can transition
this to a simpler setup without Karma (i.e. launch browser directly),
but for now we can patch it in this way.
Change-Id: If99f030b1b23be6b906a15bfdb72590fc249cb0c
The latest update of 'svgo' dependency includes three optimizations on
converting path commands, which
- improves closing paths and how we determine if to use absolute or
relative commands.
- round arc or convert to lines based on the geometric sagitta
- convert cubic Bézier curves to quadratic Bézier curves where possible
Also unifiying npm command to qua standard notation `minify:svg`.
Bug: T354875
Change-Id: Iaa9857ad95a1247fa0751f3953d324ea5c83b92c
This reverts commit 890558f1fa.
This restores Id584208d9b67d877606a0add1d71c9b1784cdb1b with some fixes.
Bug: T323786
Bug: T352742
Change-Id: Ib31c451ddd75b06c95a544c8a3d2a64b32264126
This is only enabled in development mode for now.
It's intended as a baseline for further development,
the feature is not ready for production.
Bug: T323786
Change-Id: Id584208d9b67d877606a0add1d71c9b1784cdb1b
Co-authored-by: Atieno <pnjira@wikimedia.org>
jsduck is preventing us from using ES6 syntax and has not
been supported for some time. It is also difficult to setup
locally due its use of Ruby.
Introduce jsdoc and remove jsduck per T138401#9335987
Link to static copy of jsduck explaining the state
This does the bare minimum - the docs are built to the folder
docs/js/index.html and only one module is ported over to allow
us to provide feedback on the end result.
Bug: T138401
Change-Id: I1a351ac5aec731bb79a877023ac10988ec3ec786
Mostly this has a bunch of whitespace changes from the
template-curly-spacing and brace-style rules being set
to align with other spacing rules.
Change-Id: I4609c52a4ef426ad1f35fb4bfe447bb08323a8e8
Mostly this fixes security warnings from dependencies, but also adds
the createProtect() and editProtect() methods.
Change-Id: Ic033d6d69decc0122fcd9c309ebe98cbc90514c7