Skip to content

Commit

Permalink
build: simplify travis and npm-test config
Browse files Browse the repository at this point in the history
* Remove 'sudo: false'. This was to make Travis use a fast container,
  instead of a VM. But, this option no longer exits.
  Travis now always uses a VM, and they're relatively fast.

* Use 'cache: npm'.

  This repo has package-lock.json, which is great! (thank you).
  When package-lock.json exists, the installer deletes node_modules
  completely and rebuilds it fresh, based on the lock file.
  During local development, this is very fast because npm also has a
  cache at $HOME/.npm (which is not deleted).

  The 'cache: npm' shortcut will cache "$HOME/.npm" instead of
  "node_modules". Otherwise, this directory is copied by Travis
  from the cache but then immediately deleted by npm-install/npm-ci.

  <https://docs.travis-ci.com/user/languages/javascript-with-nodejs/#caching-with-npm>

* Make 'npm test' include lint checks.

  This project uses ESLint and it can be run manually via 'npm run lint'.
  It is also run automatically by Travis.

  Make ESLint also executed by default when developers run 'npm test'
  locally. That makes it easier to contribute by not having to learn
  about lint issues after submitting a patch, and not having to read
  .travis.yaml or package.json in detail.
  • Loading branch information
Krinkle committed Apr 11, 2020
1 parent 2c255db commit 81a23ca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
6 changes: 1 addition & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
language: node_js
sudo: false
node_js:
- 12
- 10
- 8
script: "npm test && npm run-script lint"
cache:
directories:
- node_modules
cache: npm
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
nodemw
======

[MediaWiki API](http://www.mediawiki.org/wiki/API:Main_page) client written in node.js
[MediaWiki API](https://www.mediawiki.org/wiki/API:Main_page) client written in node.js

[![NPM version](https://badge.fury.io/js/nodemw.png)](http://badge.fury.io/js/nodemw)
[![Build Status](https://api.travis-ci.org/macbre/nodemw.svg?branch=devel)](http://travis-ci.org/macbre/nodemw)
[![NPM version](https://badge.fury.io/js/nodemw.svg)](https://www.npmjs.com/package/nodemw)
[![Build Status](https://api.travis-ci.org/macbre/nodemw.svg?branch=devel)](https://travis-ci.org/macbre/nodemw)

[![Download stats](https://nodei.co/npm/nodemw.png?downloads=true&downloadRank=true)](https://nodei.co/npm/nodemw/)

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.12.2",
"author": "macbre <maciej.brencz@gmail.com> (http://macbre.net)",
"description": "MediaWiki API client written in node.js",
"main": "./lib/bot",
"main": "./lib/bot.js",
"repository": {
"type": "git",
"url": "git://github.com/macbre/nodemw.git"
Expand Down Expand Up @@ -37,7 +37,7 @@
"vows": "^0.8.2"
},
"scripts": {
"test": "vows --spec",
"test": "vows --spec && eslint .",
"lint": "eslint ."
}
}

0 comments on commit 81a23ca

Please sign in to comment.