Skip to content

Commit 4a59dc4

Browse files
author
Alex Kessinger
committed
New module structure
1 parent 4571cd3 commit 4a59dc4

18 files changed

+485
-90
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/bower_components/
22
/node_modules/
3+
/app/components
4+
libpeerconnection.log
35

46
.DS_Store

.jshintrc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"node": true,
33
"browser": true,
4-
"es5": true,
54
"esnext": true,
65
"bitwise": true,
7-
"curly": true,
6+
"camelcase": true,
7+
"curly": false,
88
"eqeqeq": true,
99
"immed": true,
1010
"indent": 2,
@@ -14,14 +14,14 @@
1414
"quotmark": "single",
1515
"regexp": true,
1616
"undef": true,
17-
"unused": true,
17+
"unused": false,
1818
"strict": true,
19+
"globalstrict": true,
1920
"trailing": true,
2021
"smarttabs": true,
21-
"globals": {
22-
"angular": false,
23-
"jQuery": true,
24-
"Ladda": true,
25-
"_": true
26-
}
27-
}
22+
"predef": [
23+
"angular",
24+
"jQuery",
25+
"_"
26+
]
27+
}

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
language: node_js
2+
node_js:
3+
- '0.10'
4+
- '0.8'

CONTRIBUTING.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Contributing
2+
3+
## Important notes
4+
Please don't edit files in the `dist` subdirectory as they are generated via Grunt. You'll find source code in the `src` subdirectory!
5+
6+
### Code style
7+
Regarding code style like indentation and whitespace, **follow the conventions you see used in the source already.**
8+
9+
### PhantomJS
10+
While Grunt can run the included unit tests via [PhantomJS](http://phantomjs.org/), this shouldn't be considered a substitute for the real thing. Please be sure to test the `test/*.html` unit test file(s) in _actual_ browsers.
11+
12+
## Modifying the code
13+
First, ensure that you have the latest [Node.js](http://nodejs.org/) and [npm](http://npmjs.org/) installed.
14+
15+
Test that Grunt's CLI and Bower are installed by running `grunt --version` and `bower --version`. If the commands aren't found, run `npm install -g grunt-cli bower`. For more information about installing the tools, see the [getting started with Grunt guide](http://gruntjs.com/getting-started) or [bower.io](http://bower.io/) respectively.
16+
17+
1. Fork and clone the repo.
18+
1. Run `npm install` to install all build dependencies (including Grunt).
19+
1. Run `bower install` to install the front-end dependencies.
20+
1. Run `grunt` to grunt this project.
21+
22+
Assuming that you don't see any red, you're ready to go. Just be sure to run `grunt` after making any changes, to ensure that nothing is broken.
23+
24+
## Submitting pull requests
25+
26+
1. Create a new branch, please don't work in your `master` branch directly.
27+
1. Add failing tests for the change you want to make. Run `grunt` to see the tests fail.
28+
1. Fix stuff.
29+
1. Run `grunt` to see if the tests pass. Repeat steps 2-4 until done.
30+
1. Open `test/*.html` unit test file(s) in actual browser to ensure tests pass everywhere.
31+
1. Update the documentation to reflect any changes.
32+
1. Push to your fork and submit a pull request.

Gruntfile.js

Lines changed: 156 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,193 @@
1+
// Generated on 2013-08-13 using generator-angular-component 0.2.1
12
'use strict';
23

3-
module.exports = function (grunt) {
4-
// load all grunt tasks
5-
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
4+
module.exports = function(grunt) {
65

7-
// configurable paths
8-
var adnConfig = {
9-
app: 'app',
6+
// Configurable paths
7+
var yoConfig = {
8+
livereload: 35729,
9+
src: 'src',
1010
dist: 'dist'
1111
};
12-
console.log('yo');
13-
try {
14-
adnConfig.app = require('./bower.json').appPath || adnConfig.app;
15-
} catch (e) {}
1612

13+
// Livereload setup
14+
var lrSnippet = require('connect-livereload')({port: yoConfig.livereload});
15+
var mountFolder = function (connect, dir) {
16+
return connect.static(require('path').resolve(dir));
17+
};
18+
19+
// Load all grunt tasks
20+
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
21+
22+
// Project configuration
1723
grunt.initConfig({
18-
adn: adnConfig,
24+
pkg: grunt.file.readJSON('package.json'),
25+
yo: yoConfig,
26+
meta: {
27+
banner: '/**\n' +
28+
' * <%= pkg.name %>\n' +
29+
' * @version v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
30+
' * @link <%= pkg.homepage %>\n' +
31+
' * @author <%= pkg.author.name %> <<%= pkg.author.email %>>\n' +
32+
' * @license MIT License, http://www.opensource.org/licenses/MIT\n' +
33+
' */\n'
34+
},
35+
open: {
36+
server: {
37+
path: 'http://localhost:<%= connect.options.port %>'
38+
}
39+
},
1940
clean: {
2041
dist: {
2142
files: [{
2243
dot: true,
2344
src: [
24-
'<%= adn.dist %>/*',
25-
'!<%= adn.dist %>/.git*'
45+
'.tmp',
46+
'<%= yo.dist %>/*',
47+
'!<%= yo.dist %>/.git*'
2648
]
2749
}]
50+
},
51+
server: '.tmp'
52+
},
53+
watch: {
54+
gruntfile: {
55+
files: '<%= jshint.gruntfile.src %>',
56+
tasks: ['jshint:gruntfile']
57+
},
58+
less: {
59+
files: ['<%= yo.src %>/{,*/}*.less'],
60+
tasks: ['less:dist']
61+
},
62+
app: {
63+
files: [
64+
'<%= yo.src %>/{,*/}*.html',
65+
'{.tmp,<%= yo.src %>}/{,*/}*.css',
66+
'{.tmp,<%= yo.src %>}/{,*/}*.js'
67+
],
68+
options: {
69+
livereload: yoConfig.livereload
70+
}
71+
},
72+
test: {
73+
files: '<%= jshint.test.src %>',
74+
tasks: ['jshint:test', 'qunit']
2875
}
2976
},
30-
jshint: {
77+
connect: {
3178
options: {
32-
jshintrc: '.jshintrc'
79+
port: 9000,
80+
hostname: '0.0.0.0' // Change this to '0.0.0.0' to access the server from outside.
3381
},
34-
all: [
35-
'Gruntfile.js',
36-
'<%= adn.app %>/scripts/{,*/}*.js'
37-
]
82+
livereload: {
83+
options: {
84+
middleware: function (connect) {
85+
return [
86+
lrSnippet,
87+
mountFolder(connect, '.tmp'),
88+
mountFolder(connect, yoConfig.src)
89+
];
90+
}
91+
}
92+
}
3893
},
39-
concat: {
94+
less: {
95+
options: {
96+
// dumpLineNumbers: 'all',
97+
paths: ['<%= yo.src %>']
98+
},
4099
dist: {
41100
files: {
42-
'<%= adn.dist %>/adn-angular.js': [
43-
'<%= adn.app %>/scripts/{,*/}*.js'
44-
]
101+
'<%= yo.src %>/<%= yo.name %>.css': '<%= yo.src %>/<%= yo.name %>.less'
45102
}
46103
}
47104
},
48-
uglify: {
105+
jshint: {
106+
gruntfile: {
107+
options: {
108+
jshintrc: '.jshintrc'
109+
},
110+
src: 'Gruntfile.js'
111+
},
112+
src: {
113+
options: {
114+
jshintrc: '.jshintrc'
115+
},
116+
src: ['<%= yo.src %>/*.js']
117+
},
118+
test: {
119+
options: {
120+
jshintrc: 'test/.jshintrc'
121+
},
122+
src: ['test/**/*.js']
123+
}
124+
},
125+
karma: {
126+
options: {
127+
configFile: 'karma.conf.js',
128+
browsers: ['PhantomJS']
129+
},
130+
unit: {
131+
singleRun: true
132+
},
133+
server: {
134+
autoWatch: true
135+
}
136+
},
137+
ngmin: {
138+
options: {
139+
banner: '<%= meta.banner %>'
140+
},
49141
dist: {
50-
files: {
51-
'<%= adn.dist %>/adn-angular.js': [
52-
'<%= adn.dist %>/adn-angular.js'
53-
]
54-
}
142+
src: ['<%= yo.src %>/*.js'],
143+
dest: '<%= yo.dist %>/<%= pkg.name %>.js'
55144
}
145+
// dist: {
146+
// files: {
147+
// '/.js': '/.js'
148+
// }
149+
// }
56150
},
57-
copy: {
151+
concat: {
152+
options: {
153+
banner: '<%= meta.banner %>',
154+
stripBanners: true
155+
},
58156
dist: {
59-
files: [{
60-
expand: true,
61-
dot: true,
62-
cwd: '<%= adn.app %>',
63-
dest: '<%= adn.dist %>',
64-
src: [
65-
'scripts/**/*'
66-
]
67-
}]
157+
src: ['<%= yo.src %>/<%= pkg.name %>.js'],
158+
dest: '<%= yo.dist %>/<%= pkg.name %>.js'
159+
}
160+
},
161+
uglify: {
162+
options: {
163+
banner: '<%= meta.banner %>'
164+
},
165+
dist: {
166+
src: '<%= concat.dist.dest %>',
167+
dest: '<%= yo.dist %>/<%= pkg.name %>.min.js'
68168
}
69169
}
70170
});
71171

172+
grunt.registerTask('test', [
173+
'jshint',
174+
'karma:unit'
175+
]);
176+
72177
grunt.registerTask('build', [
73178
'clean:dist',
74-
'jshint',
75-
'concat',
76-
//'copy',
77-
'uglify'
179+
//'less:dist',
180+
'ngmin:dist',
181+
'uglify:dist'
182+
]);
183+
184+
grunt.registerTask('release', [
185+
'test',
186+
'bump-only',
187+
'dist',
188+
'bump-commit'
78189
]);
79190

80191
grunt.registerTask('default', ['build']);
81-
};
192+
193+
};

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# angular-adn
2+
3+
4+
5+
## Getting Started
6+
7+
Download the [production version][min] or the [development version][max].
8+
9+
[min]: https://raw.github.com/appdotnet/jquery-angular-adn/master/dist/angular-angular-adn.min.js
10+
[max]: https://raw.github.com/appdotnet/jquery-angular-adn/master/dist/angular-angular-adn.js
11+
12+
In your web page:
13+
14+
```html
15+
<script src="angular.js"></script>
16+
<script src="dist/angular-adn.min.js"></script>
17+
```
18+
19+
## Documentation
20+
_(Coming soon)_
21+
22+
## Examples
23+
_(Coming soon)_
24+

bower.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{
2-
"name": "adn-angular",
2+
"name": "angular-adn",
33
"version": "0.0.4",
4-
"main": "dist/adn-angular.min.js",
5-
"ignore": [
6-
".jshintrc",
7-
"**/*.txt"
8-
],
94
"dependencies": {
105
"purl": "~2.3.1",
11-
"angular": "~1.0.7"
6+
"underscore": "~1.5.1",
7+
"angular-unstable": "~1.1.5",
8+
"jquery": "~2.0.3"
9+
},
10+
"devDependencies": {
11+
"angular-unstable": "latest",
12+
"angular-mocks": "~1.0.7",
13+
"jquery": "latest"
1214
}
1315
}

dist/adn-angular.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)