gesinn-it / QRLite

Lightweight MediaWiki extension to render QR codes.
GNU General Public License v3.0
3 stars 4 forks source link

Add npm test script for various linting etc. #12

Closed samwilson closed 1 year ago

samwilson commented 1 year ago

This follows the MediaWiki conventions for these sorts of tests.

samwilson commented 1 year ago

If you hide whitespace you can get a better idea of the actual changes here. Mostly it's line endings and indents.

samwilson commented 1 year ago

I wasn't sure how this should be added to the Makefile (and so CI).

gesinn-it-gea commented 1 year ago

make ci at the end calls composer test: https://github.com/gesinn-it/QRLite/blob/master/Makefile#L36https://github.com/gesinn-it/QRLite/blob/master/composer.json#L26

gesinn-it-gea commented 1 year ago

...and GitHub Actions CI calls make ci: https://github.com/gesinn-it/QRLite/blob/master/.github/workflows/ci.yml#L35

samwilson commented 1 year ago

I've added a separate npm-test target (is that what they're called? I'm afraid it's probably been ten years since I touched a Makefile!).

Where should the npm ci command be added though? And does the docker image even include npm?

gesinn-it-gea commented 1 year ago

I'll have a look...

gesinn-it-gea commented 1 year ago

The Docker image comes with npm 7.5.2. Just add npm ci && \ to the Dockerfile before ~L8 (composer update). Maybe package-lock.json needs to be updated.

gesinn-it-gea commented 1 year ago

Here's a more complex example of such a Dockerfile: https://github.com/SemanticMediaWiki/SemanticDrilldown/blob/master/Dockerfile

samwilson commented 1 year ago

Okay great, I think I've sorted it all out now. See what you think.

gesinn-it-gea commented 1 year ago

Many thanks for your contribution!