Commit graph

18 commits

Author SHA1 Message Date
libraryupgrader bf16830b21 build: Updating npm dependencies
* webpack: 4.42.0 → 4.42.1
  * https://npmjs.com/advisories/1179
* cacache: 12.0.3 → 12.0.4
  * https://npmjs.com/advisories/1179
* mkdirp: 0.5.1 → 0.5.5
  * https://npmjs.com/advisories/1179
* postcss-sass: 0.4.2 → 0.4.4
  * https://npmjs.com/advisories/1179

Change-Id: I7d4b86c7bd6f0ce44007f2758e2b1612b69ba420
2020-04-05 14:08:32 +00:00
Stephen Niedzielski bd7bd75569 [JavaScript] Validate types
Lift the mists of confusion by checking that all JavaScript types align.
No ignores! This is the JavaScript equivalent to Phan.

This patch adds the necessary infrastructure for verifying typing and
fixes the few flaws found.

Bug: T239262
Change-Id: I2557471421196ea46cd13dfb786a52968fbfcc97
2020-03-16 09:10:08 -06:00
AronDemian cc6a7cca61 Remove unnecessary devdependency 'stylelint'
package-lock.json regenerated using the following process to ensure a clean slate:
rm -r node_modules package-lock.json  ;  npm i

Bug: T247004
Change-Id: Ie7720509ef37b178538a54854c28153ed73e375e
2020-03-13 06:50:23 +01:00
Stephen Niedzielski f4f7f3623c [dev] Run npm t on Git pre-commit hook
Execute `npm test` prior to committing. This saves back-and-forth with
Jenkins. This is the same configuration used by Popups,
MobileFrontend, MinervaNeue, NearbyPages, ContentTranslation, and
others.

Change-Id: If61ab4f28b0ccd38492d11a4cd8a92a97b2eb582
2020-03-11 07:49:48 -06:00
libraryupgrader 15041cf0ee build: Updating acorn to 6.4.1
* https://npmjs.com/advisories/1488

Change-Id: Ifed5a93c0cb894d5a15d5134bf72e0f8aab92c5a
2020-03-09 21:48:09 +00:00
libraryupgrader e9d9949048 build: Updating acorn to 7.1.1
* https://npmjs.com/advisories/1488

Change-Id: I4a6240c578be9b490cb824e24dbc252be60d9c7b
2020-03-08 19:06:33 +00:00
AronDemian b9968d9d93 build: Add 'svgo', SVG minifier script and unify SVGO rules
Adds:
- npm run svgmin
- .svgo.yaml: unified SVGO rules from Wikimedia coding conventions

Bug: T247004
Change-Id: I7017ecfebb811fa8d626747a830ad000774bbf2f
2020-03-07 19:47:58 -08:00
jenkins-bot 5b1d77fb9d Merge "Replace Grunt tasks with npm scripts in package.json" 2020-02-27 17:48:52 +00:00
Jan Drewniak 98b70067c9 Replace Grunt tasks with npm scripts in package.json
Adds the following npm scripts:
- npm run lint
- npm run lint:js
- npm run lint:styles
- npm run lint:i18n

Bug: T242781
Change-Id: I0c2cfce73a02029b9d0c4d329309aff477cb02d4
2020-02-27 16:32:12 +01:00
Nicholas Ray 7b7c948bf6 Add 'jsdoc-wmf-theme' to jsdoc
This adds the wmf theme styles to our jsdoc as can be seen on
https://doc.wikimedia.org/Parsoid/master/.

There is a caveat with this though. jsdoc-wmf-theme adds warnings for
unlinked symbols (e.g. 'return {jQuery}') [1] which causes the jsdoc doc
generation to fail since it is set to fail on warnings (we have it
configured with `pedantic: true`).

If we add the jsdoc-wmf-theme, we will need to be stricter about our
symbol usage which could be a good thing or just be tedious and
annoying.

What do you think?

[1] https://github.com/cscott/jsdoc-wmf-theme/blob/master/publish.js#L29

Bug: T239258
Change-Id: Icade62a278d7e685cbda28a8ca26a1b703e64f19
2020-02-14 10:43:46 -07:00
Nicholas Ray a79bb8dff4 build: Replace JSDuck with JSDoc
* jsdoc.json was copied from Minerva. The markdown plugin from that
config was removed since there no usages of that in Vector.

* Added latest jsdoc dependency to package.json

* Copied 'jsdoc' task from Minerva into Vector. Revised storybook output
so that multiple docs (storybook + jsdoc) could be in /docs

* Made collapsibleTabs.js JSDoc compliant (This was really the only
thing using jsduck syntax)

* Modified Gruntfile stylelinter to ignore docs folder

Bug: T239258
Change-Id: Id07d591ffe7bf0ac021109051e89b91ffdcf4c78
2020-02-14 10:29:00 -07:00
jdlrobson ea2bcd44f2 Add storybook to Vector
- Update package.json with the new dependencies.
- A script storybook.sh pulls down CSS and LESS imports from external
dependencies. This copies the approach taken in Popups and MobileFrontend.
- Icons from external repos are maintained within the repo in SVG-only form.
Using load.php modules is also possible, but will pull down other unnecessary icons
and break if any of these modules are changed. Decided that we should manually maintain
these for the time being given there are only 3 icons.
- Several LESS files now import the variables file. I think it's useful for stories
to only import the CSS they use as this encourages us to modularise our CSS. Before these
imports were not necessary as they inherit imports from index.less. This will have no impact
on the bundle size as the LESS compiler silently discards duplicate imports
- stories/utils.js provides a useful placeholder function for generalising our hook entry
points.

Bug: T242674
Change-Id: I722e84d2fb57653a2f96142dc3e5248043261746
2020-01-31 16:59:15 +08:00
libraryupgrader 24b72c8bfa build: Updating npm dependencies
* grunt-stylelint: 0.12.0 → 0.13.0
* stylelint-config-wikimedia: 0.7.0 → 0.8.0

Additional changes:
* Also sorted "composer fix" command to run phpcbf last.

Change-Id: I59abf3b90868ae225a70bc3c0ba287f2c2335c8b
2020-01-10 18:36:03 +00:00
Ed Sanders c61f6469db build: Update linters
Change-Id: I17a65638e0c7d074d4c1db282b278798e875fbe1
2019-10-31 21:43:20 +00:00
Ed Sanders 370f52e692 build: Update linters
Change-Id: I58969b531c70eba70a7fa7a8fc0ba1ad521ba9f5
2019-10-07 16:41:27 +01:00
libraryupgrader 9eacb7ea30 build: Updating eslint-utils to 1.4.2
* https://npmjs.com/advisories/1118

Additional changes:
* Added .eslintcache to .gitignore.

Change-Id: I4a30cdbb28b52a7b2f2745ba5d644778cd301fdf
2019-08-24 03:17:50 +00:00
libraryupgrader 7cc8756e6f build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 24.0.0 → 26.0.0

npm:
* lodash: 4.17.11 → 4.17.14
  * https://npmjs.com/advisories/1065
  * CVE-2019-10744
* set-value: 2.0.0 → 2.0.1
  * https://npmjs.com/advisories/1012
  * CVE-2019-10747
* union-value: 1.0.0 → 1.0.1
  * https://npmjs.com/advisories/1012
  * CVE-2019-10747
* mixin-deep: 1.3.1 → 1.3.2
  * https://npmjs.com/advisories/1013
  * CVE-2019-10746

Change-Id: If00a2166eb92474205bda4823643565eab6acb8f
2019-07-16 07:51:49 +00:00
libraryupgrader 5914274354 build: Updating npm dependencies for security issues
* Updated stylelint-config-wikimedia to 0.6.0, addressing:
  * https://npmjs.com/advisories/786

Committed package-lock.json (T179229) too.

Change-Id: I8eafeb13195b405344ea6ce3da85a4c0f1c4e2a8
2019-06-09 06:51:07 +00:00