|author||Stephen Niedzielski <email@example.com>||Tue Mar 20 08:26:16 2018 -0500|
|committer||Stephen Niedzielski <firstname.lastname@example.org>||Tue Mar 20 09:22:43 2018 -0500|
Fix: pin package versions to patch revision CI doesn't use a version of NPM that reads package-lock files which seems to break some build product diff checks. Bug: T165036 Change-Id: I29383c1a5c1f7f102fe458ac778adc3bf264c9fd
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
npm startWill run the bundler in watch mode, re-assembling the files on file change.
npm run buildWill 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 testTo run the linting tools and the tests.
tests/node-qunit/, which you can run with
npm run test:node
nodemonto watch sources and auto run linting and tests.
npm install -g nodemon
nodemon -w src/ --exec "grunt lint:all && npm run test:node"
npm run coverage
Developers 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/';