commit | 3c3f16222661d5fd122343743f53495281c07b14 | [log] [tgz] |
---|---|---|
author | Stephen Niedzielski <stephen@niedzielski.com> | Tue Mar 20 08:26:16 2018 -0500 |
committer | Stephen Niedzielski <stephen@niedzielski.com> | Tue Mar 20 09:22:43 2018 -0500 |
tree | 0a8b755204dd1c1db804003b1a805f6097fc1293 | |
parent | 42816702eb9eca7d3f78564f10bcc8cff0de30e9 [diff] |
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 resources/*
.
After an npm install
:
npm start
Will run the bundler in watch mode, re-assembling the files on file change.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:node
nodemon
to 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
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/';