Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit 75e90d9

Browse files
committed
chore(website): rename some tasks and make building an explicit action
1 parent c8cb3bc commit 75e90d9

File tree

4 files changed

+25
-19
lines changed

4 files changed

+25
-19
lines changed

website/README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,58 +3,59 @@ Protractor website
33

44
Generates the documentation for the protractor website.
55

6-
##How to run
6+
## How to run
77

88
```shell
99
cd website/
1010
npm install
11+
npm run build
1112
```
1213

13-
And then copy all the files from the `build` directory to the gh-pages branch.
14+
Then copy all the files from the `build` directory to the gh-pages branch.
1415
If you want to run the website locally then run the following command:
1516

1617
```shell
17-
./node_modules/.bin/gulp liveReload
18+
npm start
1819
```
1920

2021
And point your browser to: [localhost:8080](http://localhost:8080/)
2122

22-
##How to run the tests
23+
## How to run the tests
2324

2425
The website includes 3 types of tests:
2526

2627
* minijasminenode unit tests for the dgeni modules.
2728
* karma unit tests for the angular controllers.
2829
* protractor for e2e testing.
2930

30-
###Start the server first
31+
### Start the server first
3132

3233
The following command will start a server on [localhost:8080](http://localhost:8080/).
3334
The server is used to run the protractor tests.
3435

3536
```shell
36-
npm run server
37+
npm start
3738
```
3839

39-
###Run all the tests
40+
### Run all the tests
4041

4142
```shell
4243
npm test
4344
```
4445

45-
###Run the dgeni tests
46+
### Run the dgeni tests
4647

4748
```shell
4849
./node_modules/.bin/minijasminenode docgen/spec/*
4950
```
5051

51-
###Run the karma tests
52+
### Run the karma tests
5253

5354
```shell
5455
./node_modules/karma/bin/karma start
5556
```
5657

57-
###Run the protractor tests
58+
### Run the protractor tests
5859

5960
```shell
6061
../bin/protractor

website/gulpfile.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ gulp.task('clean', function(cb) {
2727
del(paths.build, cb);
2828
});
2929

30-
// Generate the table of contents json file using Dgeni.
30+
// Generate the table of contents json file using Dgeni. This is output to
31+
// docgen/build/toc.json
3132
gulp.task('dgeni', function() {
3233
var config = path.resolve(__dirname, './docgen/dgeni-config.js');
3334
dgeni(config).generateDocs();
@@ -38,17 +39,17 @@ gulp.task('copyBowerFiles', function() {
3839
gulp.src([
3940
'bower_components/bootstrap/dist/js/bootstrap.min.js',
4041
'bower_components/lodash/dist/lodash.min.js'
41-
]).pipe(gulp.dest('js'));
42+
]).pipe(gulp.dest(paths.outputDir + '/js'));
4243
gulp.src('bower_components/bootstrap/dist/css/bootstrap.min.css')
43-
.pipe(gulp.dest('css'));
44+
.pipe(gulp.dest(paths.outputDir + '/css'));
4445
});
4546

4647
gulp.task('copyFiles', function() {
4748
// html.
4849
gulp.src('index.html')
4950
.pipe(gulp.dest(paths.outputDir));
5051
gulp.src('partials/*.html')
51-
.pipe(gulp.dest(paths.outputDir+ '/partials'));
52+
.pipe(gulp.dest(paths.outputDir + '/partials'));
5253

5354
// Degeni docs.
5455
gulp.src(['docgen/build/*.json'])
@@ -124,10 +125,10 @@ gulp.task('liveReload', [
124125
]);
125126

126127
gulp.task('default', [
127-
'copyBowerFiles',
128128
'dgeni',
129129
'less',
130130
'markdown',
131131
'js',
132-
'copyFiles'
132+
'copyFiles',
133+
'copyBowerFiles'
133134
]);

website/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<meta charset="UTF-8">
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
77
<link rel="stylesheet" href="css/protractor.css"/>
8+
<link rel="stylesheet" href="css/bootstrap.min.css"/>
89
<title>Protractor - end to end testing for AngularJS</title>
910
</head>
1011
<body ng-app="protractorApp">
@@ -78,6 +79,8 @@
7879
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
7980
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.15/angular.min.js"></script>
8081
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.15/angular-route.min.js"></script>
82+
<script src="js/bootstrap.min.js"></script>
83+
<script src="js/lodash.min.js"></script>
8184
<script src="protractorApp.js"></script>
8285
</body>
8386
</html>

website/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@
2121
"minijasminenode": "^1.1.1"
2222
},
2323
"scripts": {
24-
"install": "./node_modules/bower/bin/bower install",
25-
"postinstall": "./node_modules/.bin/gulp",
26-
"server": "gulp liveReload",
24+
"prepublish": "./node_modules/bower/bin/bower install",
25+
"clean": "./node_modules/.bin/gulp clean",
26+
"build": "./node_modules/.bin/gulp",
27+
"start": "gulp liveReload",
2728
"test": "./run-tests.js"
2829
}
2930
}

0 commit comments

Comments
 (0)