commit | 9277babd6406036142fb4381eea53d26a57cfa28 | [log] [tgz] |
---|---|---|
author | jenkins-bot <[email protected]> | Fri Nov 22 22:28:34 2024 +0000 |
committer | Gerrit Code Review <[email protected]> | Fri Nov 22 22:28:34 2024 +0000 |
tree | 0fa850b17f21934b33fec57d03ad909ef32caf67 | |
parent | 7e4a6f61760e356eccffcde3ea18eafb2d73007d [diff] | |
parent | 7a9e8fd6221515b48f45ba29d3f102eb899f1e33 [diff] |
Merge "Stop using deprecated mediawiki.Uri module"
See https://www.mediawiki.org/wiki/Extension:Popups for more information about what it does.
Popups uses an asset bundler so when developing for the extension you'll need to run a script to assemble the frontend assets.
You can find the frontend source files in src/
, the compiled sources in resources/dist/
, and other frontend assets managed by resource loader in resources/*
.
After an npm install
:
npm start
Will run the bundler in watch mode, re-assembling the files on file change. Additionally, this builds debug-friendly assets and enables Redux DevTools debugging.npm run build
Will compile the assets just once, ready for deployment. You must run this step before sending the patch or CI will fail (so that sources and built assets are in sync).npm test
To run the linting tools and the tests.tests/qunit/
tests/node-qunit/
, which you can run with npm run test:unit
nodemon
to watch sources and auto run linting and tests.npm install -g nodemon
nodemon -w src/ --exec "grunt lint:all && npm run test:unit"
npm run coverage
coverage/
folderDevelopers are likely to work with local MediaWiki instances that do not have content to test with. To reduce this pain, you can create a single page with a list of links that point to an existing and external wiki by using the following config flag:
$wgPopupsGateway = 'restbaseHTML'; $wgPopupsRestGatewayEndpoint = 'https://en.wikipedia.org/api/rest_v1/page/summary/';
Popups works with a local copy of the Mobile Content Service too:
$wgPopupsGateway = 'restbaseHTML'; $wgPopupsRestGatewayEndpoint = 'http://localhost:6927/en.wikipedia.org/v1/page/summary/';
$0.dispatchEvent(new MouseEvent("mouseover", { view: window, bubbles: true, cancelable: true, }));
npm start
enables Redux DevTools functionality. In production builds, this same functionality can be enabled by setting a debug=true
query. E.g., https://en.wikipedia.org/wiki/Popup?debug=true
.| tap-mocha-reporter dot
.The root of the repository contains a .storybook directory. This folder contains a separate NPM project using the Storybook.js UI framework. This framework provides an environment that showcases all possible permutations of popups, without the state-management constraints of having only one popup per page.
This framework requires Node 8 (because of the spread ...
operator) and is therefore separated from the main package.json until CI upgrades from Node 6. NVM can be used to manage multiple Node versions to run the Storybook app (cd .storybook && nvm use
). See the .storybook/README.md for details.
Execute npm -s run doc
.