Hashar has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/315664

Change subject: build run karma test with just "npm test"
......................................................................

build run karma test with just "npm test"

Make npm install to also invokes "bower install". One less command to
enter/remember.
Add bower as a development dependency.
Add "gulp" and "karma" scripts, so one execute the proper version via a
"npm run".  Update README in consquence namely:
* reference to "npm run <command>"
* drop karma-cli, karma provides a CLI

Introduce the "test" command that runs "gulp build" and "karma start".

Bug: T148023
Change-Id: Ib7af340856e89c006e0cf62e58c8a15abbac5ada
---
M README.md
M package.json
2 files changed, 15 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/mediawiki-storage 
refs/changes/64/315664/1

diff --git a/README.md b/README.md
index 6d525ef..2d43ff4 100644
--- a/README.md
+++ b/README.md
@@ -14,28 +14,25 @@
 git clone https://gerrit.wikimedia.org/r/analytics/mediawiki-storage
 ```
 
-We're using Bower for production dependencies, Karma as a test runner and Gulp 
as a build tool. Make sure you install the following packages globally.
-```
-npm install -g bower
-npm install -g gulp
-npm install -g karma-cli
-```
-
-Then, install the dependencies to be able to build and run mediawiki-storage 
and its tests.
+We're using Bower for production dependencies, Karma as a test runner and Gulp 
as a build tool. Then, install the dependencies to be able to build and run 
mediawiki-storage and its tests.
 ```
 cd mediawiki-storage
 npm install
-bower install
 ```
 
 Now you can run Gulp tasks to lint, build and clean the project; Where 
_command_ can be one of: `lint`, `build` or `clean`. If you omit _command_, 
Gulp defaults to executing _build_ task.
 ```
-gulp <command>
+npm run gulp <command>
 ```
 
 You can also run the tests, and let Karma test runner watch all files and 
execute all tests on changes with:
 ```
-karma start
+npm run karma start
+```
+
+Or run botth _gulp build_ and _karma start_ with:
+```
+npm test
 ```
 
 ### API documentation
diff --git a/package.json b/package.json
index 1c6afaa..bc9a51b 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,14 @@
 {
   "private": true,
   "name": "mediawiki-storage",
+  "scripts": {
+    "postinstall": "bower install",
+       "gulp": "gulp",
+       "karma": "karma",
+    "test": "npm run gulp build && npm run karma start"
+  },
   "devDependencies": {
+    "bower": "^1.7.9",
     "del": "^0.1.3",
     "gulp": "^3.8.10",
     "gulp-jshint": "^1.9.0",

-- 
To view, visit https://gerrit.wikimedia.org/r/315664
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib7af340856e89c006e0cf62e58c8a15abbac5ada
Gerrit-PatchSet: 1
Gerrit-Project: analytics/mediawiki-storage
Gerrit-Branch: master
Gerrit-Owner: Hashar <has...@free.fr>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to