Skip to content

Commit 46a57b2

Browse files
committed
init
0 parents  commit 46a57b2

23 files changed

+1165
-0
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.idea
2+
*.xml
3+
4+
npm-debug.log
5+
node_modules
6+
7+
**/bower_components
8+
*.defs.js

.jscs.json

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"requireCurlyBraces": ["if", "else", "for", "while", "do"],
3+
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"],
4+
5+
"requireParenthesesAroundIIFE": true,
6+
"requireSpacesInFunctionExpression": {
7+
"beforeOpeningCurlyBrace": true
8+
},
9+
"requireSpacesInAnonymousFunctionExpression": {
10+
"beforeOpeningRoundBrace": true
11+
},
12+
"disallowSpacesInNamedFunctionExpression": {
13+
"beforeOpeningRoundBrace": true
14+
},
15+
"requireSpacesInFunctionDeclaration": {
16+
"beforeOpeningCurlyBrace": true
17+
},
18+
"disallowSpacesInFunctionDeclaration": {
19+
"beforeOpeningRoundBrace": true
20+
},
21+
22+
"requireBlocksOnNewline": true,
23+
"disallowEmptyBlocks": true,
24+
25+
"disallowSpacesInsideObjectBrackets": true,
26+
"disallowSpacesInsideArrayBrackets": true,
27+
"disallowSpacesInsideParentheses": true,
28+
29+
"disallowSpaceAfterObjectKeys": true,
30+
"requireCommaBeforeLineBreak": true,
31+
32+
"requireOperatorBeforeLineBreak": ["?", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
33+
34+
"requireLeftStickedOperators": [","],
35+
"disallowLeftStickedOperators": ["?"],
36+
"disallowRightStickedOperators": ["?", ":"],
37+
38+
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
39+
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
40+
"requireSpaceBeforeBinaryOperators": ["/", "+", "-", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
41+
"requireSpaceAfterBinaryOperators": ["/", "+", "-", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
42+
43+
"disallowKeywords": ["with"],
44+
45+
"disallowMultipleLineStrings": true,
46+
"validateQuoteMarks": "'",
47+
"disallowMixedSpacesAndTabs": true,
48+
"disallowTrailingWhitespace": true,
49+
50+
"disallowKeywordsOnNewLine": ["else", "catch"],
51+
"requireLineFeedAtFileEnd": true,
52+
"maximumLineLength": 120,
53+
54+
"requireCapitalizedConstructors": true,
55+
"requireDotNotation": true,
56+
57+
"excludeFiles": [
58+
"node_modules/**",
59+
"dist/**"
60+
],
61+
62+
"additionalRules": ["node_modules/jscs-trailing-comma/rules/*.js"],
63+
64+
"requireTrailingCommaInExpandedLiterals": {
65+
"inArrays": true,
66+
"inObjects": true
67+
},
68+
"disallowTrailingCommaInCollapsedLiterals": {
69+
"inArrays": true,
70+
"inObjects": true
71+
}
72+
73+
}

.jshintrc

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"devel": true,
3+
"node": true,
4+
5+
"bitwise": true,
6+
"curly": true,
7+
"eqeqeq": true,
8+
"eqnull": true,
9+
"forin": false,
10+
"immed": true,
11+
"indent": 4,
12+
"newcap": true,
13+
"noarg": true,
14+
"noempty": true,
15+
"nonew": true,
16+
"onevar": true,
17+
"strict": true,
18+
"trailing": true,
19+
"undef": true,
20+
"unused": true,
21+
"quotmark": "single",
22+
"maxcomplexity": 10,
23+
"maxerr": 50,
24+
"maxlen": 120,
25+
26+
"globals": {
27+
"angular": false
28+
}
29+
}

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
language: node_js
2+
node_js:
3+
- 0.10
4+
5+
before_script:
6+
- npm install -g grunt-cli bower
7+
- "cd test/unit/ && bower install --verbose"

Gruntfile.js

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
module.exports = function (grunt) {
2+
'use strict';
3+
4+
// load all grunt tasks automatically and only necessary ones.
5+
// Those that doesn't match the pattern have to be provided here.
6+
require('jit-grunt')(grunt, {
7+
jscs: 'grunt-jscs-checker',
8+
});
9+
10+
var mountFolder = function (connect, dir) {
11+
return connect.static(require('path').resolve(dir));
12+
};
13+
14+
// Project configuration.
15+
grunt.initConfig({
16+
pkg: grunt.file.readJSON('package.json'),
17+
defs: {
18+
options: {
19+
transformDest: function transformDest(path) {
20+
return path.replace(/\.js$/, '.defs.js');
21+
},
22+
defsOptions: {
23+
disallowDuplicated: true,
24+
disallowUnknownReferences: false,
25+
disallowVars: true,
26+
},
27+
},
28+
src: {
29+
src: [
30+
'src/<%= pkg.name %>.js',
31+
],
32+
},
33+
test: {
34+
src: [
35+
'test/unit/spec/<%= pkg.name %>.spec.js',
36+
'!test/unit/spec/<%= pkg.name %>.spec.defs.js',
37+
],
38+
},
39+
},
40+
ngAnnotate: {
41+
demo: {
42+
files: {
43+
'.tmp/<%= pkg.name %>.js': ['src/<%= pkg.name %>.defs.js'],
44+
},
45+
},
46+
},
47+
uglify: {
48+
options: {
49+
banner: '/*! <%= pkg.name %> <%= pkg.version %>, <%= grunt.template.today("dd-mm-yyyy") %> */\n',
50+
},
51+
build: {
52+
src: '.tmp/<%= pkg.name %>.js',
53+
dest: 'dist/<%= pkg.name %>.min.js',
54+
},
55+
},
56+
copy: {
57+
demo: {
58+
src: 'dist/<%= pkg.name %>.min.js',
59+
dest: 'demo/',
60+
},
61+
dev: {
62+
src: '.tmp/<%= pkg.name %>.js',
63+
dest: 'dist/<%= pkg.name %>.js',
64+
},
65+
},
66+
clean: {
67+
tmp: '.tmp',
68+
},
69+
connect: {
70+
options: {
71+
port: 9000,
72+
livereload: 35729,
73+
hostname: '0.0.0.0',
74+
open: true,
75+
},
76+
demo: {
77+
options: {
78+
middleware: function (connect) {
79+
return [
80+
mountFolder(connect, 'demo'),
81+
];
82+
},
83+
},
84+
},
85+
},
86+
watch: {
87+
livereload: {
88+
files: [
89+
'src/<%= pkg.name %>.js',
90+
'demo/*.js',
91+
'demo/*.css',
92+
'demo/*.html',
93+
'!demo/bower_components/**/*',
94+
],
95+
options: {
96+
livereload: true,
97+
},
98+
tasks: ['build'],
99+
},
100+
},
101+
jshint: {
102+
options: {
103+
jshintrc: true,
104+
},
105+
all: {
106+
src: [
107+
'Gruntfile.js',
108+
'src/<%= pkg.name %>.js',
109+
],
110+
},
111+
},
112+
jscs: {
113+
all: {
114+
src: '<%= jshint.all.src %>',
115+
options: {
116+
config: '.jscs.json',
117+
},
118+
},
119+
},
120+
'merge-conflict': {
121+
files: '<%= jshint.all.src %>',
122+
},
123+
karma: {
124+
options: {
125+
configFile: 'test/unit/config/karma.conf.js',
126+
},
127+
unit: {},
128+
live: {
129+
port: 8081,
130+
singleRun: false,
131+
background: true,
132+
},
133+
},
134+
});
135+
136+
137+
grunt.registerTask('lint', [
138+
'jshint',
139+
'jscs',
140+
'merge-conflict',
141+
]);
142+
143+
grunt.registerTask('build', [
144+
'lint',
145+
'defs',
146+
'ngAnnotate',
147+
'copy:dev',
148+
'uglify',
149+
'copy:demo',
150+
'clean:tmp',
151+
]);
152+
153+
grunt.registerTask('demo', [
154+
'build',
155+
'connect:demo',
156+
'watch',
157+
]);
158+
159+
grunt.registerTask('serve', [
160+
'build',
161+
'watch',
162+
]);
163+
164+
grunt.registerTask('test', [
165+
'lint',
166+
'defs',
167+
'karma:unit',
168+
]);
169+
170+
grunt.registerTask('default', [
171+
'serve',
172+
]);
173+
};

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014 Laboratorium EE
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)