Skip to content

Commit 7063c32

Browse files
author
Matt Mazzola
committed
Add typescript and typings as devDependencies and use npm scripts for install, build, and test related actions to prevent need for global dependencies.
1 parent 486501f commit 7063c32

File tree

4 files changed

+37
-48
lines changed

4 files changed

+37
-48
lines changed

.travis.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
language: node_js
22
node_js:
3-
- '4.4'
4-
before_install:
5-
- npm install -g typings typescript
6-
- npm link typescript
7-
- typings install
8-
script: gulp test
3+
- node
94
after_success:
105
- ".travis/push.sh"
116
branches:

.vscode/tasks.json

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,21 @@
11
{
2-
// See https://go.microsoft.com/fwlink/?LinkId=733558
3-
// for the documentation about the tasks.json format
4-
"version": "0.1.0",
5-
"command": "gulp",
6-
"isShellCommand": true,
7-
"args": [
8-
"--no-color"
9-
],
10-
"tasks": [
11-
{
12-
"taskName": "build",
13-
"args": [],
14-
"isBuildCommand": true,
15-
"isWatching": false,
16-
"problemMatcher": [
17-
"$lessCompile",
18-
"$tsc",
19-
"$jshint"
20-
]
21-
},
22-
{
23-
"taskName": "test",
24-
"args": ["--chrome"],
25-
"isTestCommand": true
26-
}
27-
]
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "0.1.0",
5+
"command": "npm",
6+
"isShellCommand": true,
7+
"showOutput": "always",
8+
"suppressTaskName": true,
9+
"tasks": [
10+
{
11+
"taskName": "build",
12+
"args": ["run", "build"],
13+
"isBuildCommand": true
14+
},
15+
{
16+
"taskName": "test",
17+
"args": ["run", "test", "--", "--chrome"],
18+
"isTestCommand": true
19+
}
20+
]
2821
}

CONTRIBUTING.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,50 @@
22

33
## Setup
44

5-
Install Global Depenedencies if needed:
6-
```
7-
npm install -g typings gulp
8-
```
9-
105
Clone the repository:
116
```
127
git clone https://github.com/Microsoft/PowerBI-JavaScript.git powerbi-client
138
```
149

15-
Install Dependencies:
10+
Navigate to the cloned directory
11+
12+
Install local dependencies:
1613
```
1714
npm install
18-
typings install
19-
```
15+
```
2016

2117
## Build:
2218
```
23-
gulp build
19+
npm run build
2420
```
2521
Or if using VScode: `Ctrl + Shift + B`
2622

2723
## Test
28-
Run tests with PhantomJS
2924
```
30-
gulp test
25+
npm test
3126
```
27+
By default the tests run using PhantomJS
3228

3329
There are various command line arguments that can be passed to the test command to facilitate debugging:
3430

3531
Run tests with Chrome
3632
```
37-
gulp test --chrome
33+
npm test -- --chrome
3834
```
3935

4036
Enable debug level logging for karma, and remove code coverage
4137
```
42-
gulp test --debug
38+
npm test -- --debug
4339
```
4440

4541
Disable single run to remain open for debugging
4642
```
47-
gulp test --watch
43+
npm test -- --watch
4844
```
4945

5046
These are often combined and typical command for debugging tests is:
5147
```
52-
gulp test --chrome --debug --watch
48+
npm test -- --chrome --debug --watch
5349
```
5450

5551
The build and tests use webpack to compile all the source modules into one bundled module that can execute in the browser.
@@ -66,6 +62,7 @@ Run http-server from demo directory:
6662
```
6763
http-server
6864
```
65+
You can install `http-server` using `npm install -g http-server`;
6966

7067
Open the demo folder in the browser: `http://127.0.0.1:8080/`
7168
```

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
"test": "test"
1212
},
1313
"scripts": {
14+
"build": "gulp build",
1415
"version": "gulp build && git add .",
16+
"postinstall": "typings install",
1517
"prepublish": "gulp build",
16-
"test": "gulp test --chrome"
18+
"test": "gulp test"
1719
},
1820
"keywords": [
1921
"microsoft",
@@ -61,6 +63,8 @@
6163
"run-sequence": "^1.1.5",
6264
"ts-loader": "^0.8.1",
6365
"tslint": "^3.6.0",
66+
"typescript": "^1.8.10",
67+
"typings": "^1.3.2",
6468
"webpack": "^1.12.14",
6569
"webpack-stream": "^3.1.0",
6670
"yargs": "^4.4.0"

0 commit comments

Comments
 (0)