Skip to content

Commit 3c20971

Browse files
committed
feat(grunt): use Angular UI Publisher
Merge branch 'douglasduteil-ft-component-publisher' Closes angular-ui#153
2 parents 1c5c5e1 + 2c6fcab commit 3c20971

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+510
-307
lines changed

.gitignore

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
bower_components/
22
node_modules/
3-
.rcs
4-
*.swp
3+
out/
4+
dist/
5+
6+
# don't track generated/copied html demo files
7+
demo/*.html

.jshintrc

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"boss": true,
3+
"browser": true,
4+
"eqnull": true,
5+
"expr": true,
6+
"globalstrict": true,
7+
"immed": true,
8+
"laxbreak": true,
9+
"loopfunc": true,
10+
"newcap": true,
11+
"noarg": true,
12+
"noempty": true,
13+
"nonew": true,
14+
"quotmark": true,
15+
"smarttabs": true,
16+
"sub": true,
17+
"trailing": true,
18+
"undef": true,
19+
"unused": true,
20+
"globals": {
21+
"angular": false
22+
}
23+
}

.travis.yml

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
---
22
language: node_js
33
node_js:
4-
- '0.8'
4+
- '0.10'
55
before_install:
66
- export DISPLAY=:99.0
77
- sh -e /etc/init.d/xvfb start
8-
- npm install -g bower grunt-cli
9-
- npm install
10-
- bower install
11-
before_script: bower_components/angular-ui-docs/.travis/before_script.sh
12-
after_success: bower_components/angular-ui-docs/.travis/after_success.sh
8+
- npm install -qg bower grunt-cli
9+
- npm install -q
10+
- bower install --force
11+
- bower install --force
12+
after_success:
13+
- "./node_modules/angular-ui-publisher/travis/authentication.sh || exit 0"
14+
- "grunt dist build:gh-pages publish:gh-pages build:bower publish:bower build:subbower publish:subbower"
1315
script: grunt
1416
env:
1517
global:

README.md

+58-27
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,87 @@
1-
# AngularUI - The companion suite for AngularJS
1+
# UI.Utils [![Build Status](https://travis-ci.org/angular-ui/ui-utils.png?branch=master)](https://travis-ci.org/angular-ui/ui-utils)
22

3-
***
3+
The companion suite for AngularJS
44

5-
[![Build Status](https://travis-ci.org/angular-ui/ui-utils.png?branch=master)](https://travis-ci.org/angular-ui/ui-utils)
5+
## Requirements
6+
7+
- AngularJS
68

79
## Usage
810

9-
### Requirements
1011

11-
* **AngularJS v1.0.0+** is currently required.
12-
* **jQuery*** Until the refactor is complete, some directives still require jQuery
12+
You can get it from [Bower](http://bower.io/)
13+
14+
```sh
15+
# All the modules
16+
bower install angular-ui-utils\#bower
17+
18+
# A specific module
19+
# bower install angular-ui-utils\#bower-<moduleName>
20+
bower install angular-ui-utils\#bower-event
21+
bower install angular-ui-utils\#bower-keypress
22+
...
23+
24+
# A specific version
25+
bower install angular-ui-utils\#v0.0.4
26+
# A specific module version
27+
bower install angular-ui-utils\#event-0.0.4
28+
bower install angular-ui-utils\#keypress-0.0.4
29+
...
30+
31+
# If you want the sources with it
32+
bower install angular-ui-utils
33+
# or for a specific source version
34+
bower install angular-ui-utils\#src0.0.4
35+
```
36+
37+
This will copy the UI.Utils files into a `bower_components` folder, along with its dependencies. Load the script files in your application:
38+
39+
```html
40+
<script type="text/javascript" src="bower_components/angular/angular.js"></script>
41+
<!-- for all the modules -->
42+
<script type="text/javascript" src="bower_components/angular-ui-utils/ui-utils.js"></script>
1343

14-
## Installation
44+
<!-- or just specific one-->
45+
<script type="text/javascript" src="bower_components/angular-ui-event/event.js"></script>
46+
<script type="text/javascript" src="bower_components/angular-ui-keypress/keypress.js"></script>
47+
<!-- ... -->
48+
```
1549

1650
Add the specific modules to your dependencies, or add the entire lib by depending on `ui.utils`
1751

1852
```javascript
1953
angular.module('myApp', ['ui.keypress', 'ui.event', ...])
2054
// or if ALL modules are loaded along with modules/utils.js
21-
angular.module('myApp', ['ui.utils'])
55+
var myAppModule = angular.module('MyApp', ['ui.utils']);
2256
```
2357

2458
Each directive and filter is now it's own module and will have a relevant README.md in their respective folders
2559

2660
## Development
2761

28-
At this time, we do not have a build script. You must include all `.js` files you wish to work on.
29-
We will likely be adding a `Gruntfile.js` in the near future for this
62+
We use Karma and jshint to ensure the quality of the code. The easiest way to run these checks is to use grunt:
3063

31-
### Requirements
64+
```sh
65+
npm install -g grunt-cli
66+
npm install && bower install
67+
grunt
68+
```
3269

33-
0. Install [Node.js](http://nodejs.org/) and NPM (should come with)
70+
The karma task will try to open Firefox and Chrome as browser in which to run the tests. Make sure this is available or change the configuration in `test\karma.conf.js`
3471

35-
1. Install global dependencies `grunt-cli`, `bower`, and `karma`:
3672

37-
```bash
38-
$ npm install -g karma grunt-cli bower
39-
```
73+
### Grunt Serve
4074

41-
2. Install local dependencies:
75+
We have one task to serve them all !
4276

43-
```bash
44-
$ npm install
45-
$ bower install
46-
```
77+
```sh
78+
grunt serve
79+
```
4780

48-
### Running Tests
81+
It's equal to run separately:
4982

50-
Make sure all tests pass in order for your Pull Request to be accepted
83+
* `grunt connect:server` : giving you a development server at [http://127.0.0.1:8000/](http://127.0.0.1:8000/).
5184

52-
You can choose what browsers to test in: `Chrome,ChromeCanary,Firefox,PhantomJS`
85+
* `grunt karma:server` : giving you a Karma server to run tests (at [http://localhost:9876/](http://localhost:9876/) by default). You can force a test on this server with `grunt karma:unit:run`.
5386

54-
```bash
55-
$ karma start --browsers=Chrome,Firefox test/karma.conf.js --single-run=true
56-
```
87+
* `grunt watch` : will automatically test your code and build your demo. You can demo generation with `grunt build:gh-pages`.

bower.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
},
1111
"devDependencies": {
1212
"angular-mocks": "~1.0.5",
13-
"jquery": ">=1.6",
14-
"angular-ui-docs": "angular-ui/angular-ui-docs"
13+
"jquery": ">=1.6"
1514
}
1615
}

demo/demo.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1+
'use strict';
12

23
angular.module('doc.ui-utils', ['ui.utils', 'prettifyDirective' ]);
34

45
angular.module('ui.scroll')
56
.factory('datasource', [
6-
'$log', '$timeout', '$rootScope', function(console, $timeout, $rootScope) {
7+
'$log', '$timeout', function(console, $timeout) {
78
var get = function(index, count, success) {
89
return $timeout(function() {
910
var i, result, _i, _ref;
1011
result = [];
1112
for (i = _i = index, _ref = index + count - 1; index <= _ref ? _i <= _ref : _i >= _ref; i = index <= _ref ? ++_i : --_i) {
12-
result.push("item #" + i);
13+
result.push('item #' + i);
1314
}
1415
return success(result);
1516
}, 100);

0 commit comments

Comments
 (0)