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
2 files changed
tree: 0a8b755204dd1c1db804003b1a805f6097fc1293
  1. .babelrc
  2. .eslintrc.es5.json
  3. .eslintrc.json
  4. .gitattributes
  5. .gitignore
  6. .gitreview
  7. .istanbul.yml
  8. .phpcs.xml
  9. .stylelintrc.json
  12. Gruntfile.js
  13. Popups.php
  15. composer.json
  16. doc/
  17. extension.json
  18. i18n/
  19. images/
  20. includes/
  21. jsdoc.json
  22. package-lock.json
  23. package.json
  24. resources/
  25. src/
  26. tests/
  27. webpack.config.js


See 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:

  • On one terminal, kickstart the bundler process:
    • 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).
  • On another terminal, run tests and linting tools:
    • npm test To run the linting tools and the tests.
      • You can find the QUnit tests that depend on running MediaWiki under tests/qunit/
      • You can find the isolated QUnit tests under tests/node-qunit/, which you can run with npm run test:node
    • We recommend you install a file watcher like nodemon to watch sources and auto run linting and tests.
      • npm install -g nodemon
      • Example running linting and node unit tests:
        • nodemon -w src/ --exec "grunt lint:all && npm run test:node"
    • Get code coverage report with npm run coverage
      • Reports printed in the coverage/ folder

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 = '';

Popups works with a local copy of the Mobile Content Service too:

$wgPopupsGateway = 'restbaseHTML';
$wgPopupsRestGatewayEndpoint = 'http://localhost:6927/';