eslint:
* Remove hardcoded glob paths that are (relatively slow) to expand
before linting could start, in favour of specifying directories
which can be iterated while linting happens.
* JSON files in i18n/ were skipped, unlike other repos.
JS code under .storybook/ was skipped.
JS code under resources/ext.popups/ was skipped.
Fix all these by doing what other repos do, which is to let
ESLint iterate the repository and tell it which directories not to
enter. This has the happy side-effect of making IDE integrations
for ESLint work correctly (as customisation in package.json has the
same problems as using Gruntfile, namely that invoking 'eslint'
directly can't be aware of this), as well as allowing things like
`eslint --fix` to be used.
```
/Popups/resources/ext.popups/index.js
4:2 error Unexpected var, use let or const instead no-var
```
nyc:
* Remove SPAWN_WRAP_SHIM_ROOT.
This was a hack for an early CI experiment that hasn't been
needed for several years.
storybook:
* Remove gitignore entries for additional npm and build output in the
storybook subdirectory, which appears to not exist anymore since
189b386a13.
Doxygen:
* Sync with cookiecutter example from
https://gerrit.wikimedia.org/g/mediawiki/tools/cookiecutter-library/+/HEAD/
- remove redundant stuff,
- enable quiet mode to hide verbose non-warning,
- include CoC.
Change-Id: If8f6b833067192aea96a87f04c7978c9af11f996
Changes of note:
- The doc and node-debug jobs are moved to ensure that all test prefixed
jobs are together in the package.json manifest.
- 2 additional scripts are added (linter:js & linter:styles) to match WVUI's NPM script naming convention.
Bug: T206462
Change-Id: Ib84f93c20f13aefb2d8f8755261b1f14e5902f16
doc.wikimedia.org is a helpful resource when iterating on a codebase.
Like MobileFrontend, generate documentation with Doxygen so that it can
be published there.
Note well that:
- The CALL_GRAPH and CALLER_GRAPH statements have been removed as they
were being set to the default value (NO)
- DOT_FONTSIZE was increased from 10 to 12
Bug: T242779
Change-Id: I41e4c6ca2b604382b036606ebcb40f11a1e8abc0
Breaking change - I was having issues getting the knobs feature
to work so it has been removed for the time being.
Bug: T236589
Depends-On: I8505d2dad69aefed5f8ed1f599b3ca1b7e79acf5
Change-Id: I42fbf37124477e2d950b4bca15acf77703cd3f5d
Storybook.js provides a framework for
viewing and working with UI components.
https://storybook.js.org/
This patch adds the Storybook.js UI library to Popups for
the purposes of viewing multiple previews at once.
This enables viewing page previews in the following states:
- with thumbnails
- without thumbnails
- with SVG thumbnails
- with narrow thumbnails
- with white background thumbnails
- in RTL languages
- in non-latin languages
- disambiguation popups
Storybook also allows users to change the image or text
of a popup through a GUI.
This patch sets up Storybook as a "mini" repo inside
the.storybook folder with a seperate package.json file
to avoid incompatibilities with the current webpack/babel
(or even Node) versions used in the Popups repo.
Storybook requires at least Node v8.3 to run.
(an .nvmrc file with 11.3.0 has been added to the .stories dir).
To start:
`cd .storybook && npm install && npm run start`.
Bug: T205989
Change-Id: I041e46c4f0cf173950015067e2dce81c023d3fdd
Replace Istanbul with nyc, Istanbul's CLI. nyc appears to have some
bugs that this patch works around:
- When all files in the project are considered, not just those
imported via tests, the coverage rates and line numbers vary between
runs. This patch disables the `all` option for now and points to the
bug:
https://github.com/istanbuljs/nyc/issues/537#issuecomment-390814662.
- Source map line numbers appear to be incorrect except when `all` is
enabled and working correctly (see previous bullet).
- `sourceMap` must be disabled to avoid ENAMETOOLONG errors when nyc
tries to include them as encoded strings. The patch disables the
setting and points to: https://github.com/istanbuljs/nyc/issues/847.
Using babel-plugin-istanbul and source-map-support appears to have
no effect (the former in tests/node-qunit/run.js and .babelrc).
- CI fails with
`Error: EACCES: permission denied, mkdir '/nonexistent'`. Specify
`SPAWN_WRAP_SHIM_ROOT` instead of constructing a subdirectory from a
nonexistent home directory.
Bug: T196952
Bug: T193519
Change-Id: Idf2e3accd4a6277cbef91c1156fcd206c9e7d882
Currently we have two docs folders:
* doc which contains human-made documentation
* docs which contains autogenerated documentation
To clean-up I moved the jsdoc target to doc/autogenerated so
we have only one documentation folder
Bug: T158236
Change-Id: I33166a84a4856e506e574e4194fa0c596b630b34
Generate code coverage reports based on the node-qunit tests with
istanbul.
Changes:
* Update README with npm run coverage
* Add .istanbul.yml to configure istanbul
* Add npm script "coverage" that runs istanbul and generates the reports
Example report: http://popups-coverage.surge.sh/lcov-report/index.html
Change-Id: I9be8c04b858a3ce6f4e29af2685b79253e3b4dca
Test entry point for CI. Just composer install && composer test
This can later on let us easily add support for PHP CodeSniffer.
Also normalized /.gitignore
Signed-off-by: Antoine Musso <hashar@free.fr>
Change-Id: I827d29abedb32e59627fcdaf0a90815fe52efd20