Skip to content

Commit 936bb13

Browse files
author
fresa
committed
initial commit
1 parent 2f50cc1 commit 936bb13

14 files changed

+791
-0
lines changed

.bowerrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory": "bower_components"
3+
}

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.DS_Store
2+
node_modules
3+
components
4+
bower_components
5+
dist

.jshintrc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"node": true,
3+
"es5": true,
4+
"esnext": false,
5+
"bitwise": true,
6+
"camelcase": true,
7+
"curly": true,
8+
"eqeqeq": true,
9+
"immed": true,
10+
"indent": 2,
11+
"latedef": false,
12+
"newcap": true,
13+
"noarg": true,
14+
"quotmark": "single",
15+
"regexp": true,
16+
"undef": true,
17+
"unused": true,
18+
"strict": true,
19+
"trailing": true,
20+
"smarttabs": true
21+
}

.travis.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
language: node_js
2+
node_js:
3+
- "0.10"
4+
5+
before_install:
6+
- npm install -g grunt-cli karma bower
7+
- bower install
8+
9+
before_script:
10+
- export DISPLAY=:99.0
11+
- sh -e /etc/init.d/xvfb start
12+
13+
script: "grunt"

CHANGELOG.md

Whitespace-only changes.

CONTRIBUTING.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Contributing Guide
2+
3+
Contributing to this repo is fairly easy. This document shows you how to
4+
get the project, run all provided tests and generate a production ready build.
5+
6+
It also covers provided grunt tasks, that help you developing on this repo.
7+
8+
## Dependencies
9+
10+
To make sure, that the following instructions work, please install the following dependecies
11+
on you machine:
12+
13+
- Node.js
14+
- npm
15+
- Git
16+
17+
If you install node through the binary installation file, **npm** will be already there.
18+
When **npm** is installed, use it to install the needed npm packages:
19+
20+
- bower <code>npm install -g bower</code>
21+
- grunt-cli <code>npm install -g grunt-cli</code>
22+
- karma <code>npm install -g karma</code>
23+
24+
## Installation
25+
26+
To get the source of this project clone the git repository via:
27+
28+
````
29+
$ git clone https://github.com/PascalPrecht/angular-component-seed
30+
````
31+
32+
This will clone the complete source to your local machine. Navigate to the project folder
33+
and install all needed dendencies via **npm** and **bower**:
34+
35+
````
36+
$ npm install
37+
$ bower install
38+
````
39+
40+
The project is now installed and ready to be built.
41+
42+
## Building
43+
44+
This repo comes with a few **grunt tasks** which help you to automate
45+
the development process. The following grunt tasks are provided:
46+
47+
#### <code>grunt</code>
48+
49+
Running <code>grunt</code> without any parameters, will actually execute the registered
50+
default task. This task is currently nothing more then a **lint task**, to make sure
51+
that your JavaScript code is written well.
52+
53+
#### <code>grunt test</code>
54+
55+
<code>grunt test</code> executes (as you might thought) the unit tests, which are located
56+
in <code>test/unit</code>. The task uses **karma** the spectacular test runner to executes
57+
the tests with the **jasmine testing framework**.
58+
59+
#### <code>grunt build</code>
60+
61+
You only have to use this task, if you want to generate a production ready build of
62+
this project. This task will also **lint**, **test** and **minify** the
63+
source. After running this task, you'll find the following files in a generated
64+
<code>dist</code> folder:
65+
66+
````
67+
dist/angular-<component-name>-x.x.x.js
68+
dist/angular-<component-name>-x.x.x.min.js
69+
````
70+
71+
#### <code>grunt watch</code>
72+
73+
This task will watch all relevant files. When it notice a change, it'll run the
74+
**lint** and **test** task. Use this task while developing on the source
75+
to make sure, everytime you make a change you get notified if your code is incosistent
76+
or doesn't pass the tests.
77+
78+
## Contributing/Submitting changes
79+
80+
- Checkout a new branch based on <code>master</code> and name it to what you intend to do:
81+
- Example:
82+
````
83+
$ git checkout -b BRANCH_NAME
84+
````
85+
- Use one branch per fix/feature
86+
- Make your changes
87+
- Make sure to provide a spec for unit tests
88+
- Run your tests with either <code>karma start</code> or <code>grunt test</code>
89+
- When all tests pass, everything's fine
90+
- Commit your changes
91+
- Please provide a git message which explains what you've done
92+
- This repo uses [Brian's conventional-changelog task](https://github.com/btford/grunt-conventional-changelog) so please make sure your commits follow the [conventions](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit)
93+
- Commit to the forked repository
94+
- Make a pull request
95+
- Make sure you send the PR to the <code>canary</code> branch
96+
- Travis CI is watching you!
97+
98+
If you follow these instructions, your PR will land pretty safety in the main repo!

Gruntfile.js

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
module.exports = function (grunt) {
2+
'use strict';
3+
4+
require('load-grunt-tasks')(grunt);
5+
var _ = require('lodash');
6+
7+
var karmaConfig = function(configFile, customOptions) {
8+
var options = { configFile: configFile, keepalive: true };
9+
var travisOptions = process.env.TRAVIS && { browsers: ['Firefox'], reporters: 'dots' };
10+
return _.extend(options, customOptions, travisOptions);
11+
};
12+
13+
grunt.initConfig({
14+
pkg: grunt.file.readJSON('bower.json'),
15+
meta: {
16+
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
17+
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
18+
'<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
19+
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
20+
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
21+
},
22+
watch: {
23+
scripts: {
24+
files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
25+
tasks: ['jshint', 'karma:unit']
26+
}
27+
},
28+
jshint: {
29+
all: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
30+
options: {
31+
eqeqeq: true,
32+
globals: {
33+
angular: true
34+
}
35+
}
36+
},
37+
concat: {
38+
src: {
39+
src: ['src/**/*.js'],
40+
dest: 'dist/angular-component-<%= pkg.version %>.js'
41+
}
42+
},
43+
uglify: {
44+
src: {
45+
files: {
46+
'dist/angular-component-<%= pkg.version %>.min.js': '<%= concat.src.dest %>'
47+
}
48+
}
49+
},
50+
karma: {
51+
unit: {
52+
options: karmaConfig('karma.conf.js', {
53+
singleRun: true
54+
})
55+
},
56+
server: {
57+
options: karmaConfig('karma.conf.js', {
58+
singleRun: false
59+
})
60+
}
61+
},
62+
changelog: {
63+
options: {
64+
dest: 'CHANGELOG.md'
65+
}
66+
},
67+
ngmin: {
68+
src: {
69+
src: '<%= concat.src.dest %>',
70+
dest: '<%= concat.src.dest %>'
71+
}
72+
},
73+
clean: ['dist/*']
74+
});
75+
76+
grunt.registerTask('default', ['jshint', 'karma:unit']);
77+
grunt.registerTask('test', ['karma:unit']);
78+
grunt.registerTask('test-server', ['karma:server']);
79+
grunt.registerTask('build', ['clean', 'jshint', 'karma:unit', 'concat', 'ngmin', 'uglify']);
80+
};

bower.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"author": "Fredrik Sandell",
3+
"name": "angular-workers",
4+
"description": "Web workers wrapper for angular",
5+
"version": "0.1.1",
6+
"homepage": "http://github.com/FredrikSandell/angular-workers",
7+
"repository": {
8+
"type": "git",
9+
"url": "git://github.com/FredrikSandell/angular-workers"
10+
},
11+
"dependencies": {
12+
"angular": "~1.3.11"
13+
},
14+
"devDependencies": {
15+
"angular-mocks": "~1.3.11"
16+
}
17+
}

karma.conf.js

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
module.exports = function(config) {
2+
'use strict';
3+
4+
config.set({
5+
6+
// base path, that will be used to resolve files and exclude
7+
basePath: '',
8+
9+
10+
// list of files / patterns to load in the browser
11+
files: [
12+
'bower_components/angular/angular.js',
13+
'bower_components/angular-mocks/angular-mocks.js',
14+
'src/**/*.js',
15+
'test/**/*Spec.js'
16+
],
17+
18+
frameworks: ['jasmine'],
19+
20+
21+
// list of files to exclude
22+
exclude: [
23+
24+
],
25+
26+
27+
// test results reporter to use
28+
// possible values: 'dots', 'progress', 'junit'
29+
reporters: ['progress'],
30+
31+
// web server port
32+
port: 9876,
33+
34+
35+
// cli runner port
36+
runnerPort: 9100,
37+
38+
39+
// enable / disable colors in the output (reporters and logs)
40+
colors: true,
41+
42+
43+
// level of logging
44+
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
45+
logLevel: config.LOG_INFO,
46+
47+
48+
// enable / disable watching file and executing tests whenever any file changes
49+
autoWatch: true,
50+
51+
52+
// Start these browsers, currently available:
53+
// - Chrome
54+
// - ChromeCanary
55+
// - Firefox
56+
// - Opera
57+
// - Safari (only Mac)
58+
// - PhantomJS <- does not work, the browser needs web worker support and support for URL blobs.
59+
// - IE (only Windows)
60+
browsers: ['Chrome'],
61+
62+
63+
// If browser does not capture in given timeout [ms], kill it
64+
captureTimeout: 60000,
65+
66+
67+
// Continuous Integration mode
68+
// if true, it capture browsers, run tests and exit
69+
singleRun: false
70+
//singleRun: true
71+
});
72+
};

package.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "angular-workers",
3+
"version": "0.1.1",
4+
"description": "Web worker wrapper for angular",
5+
"main": "angular-workers.js",
6+
"scripts": {
7+
"test": "./node_modules/karma/bin/karma start --browsers Firefox --single-run"
8+
},
9+
"author": {
10+
"name": "Fredrik Sandell"
11+
},
12+
"license": "WTFPL",
13+
"devDependencies": {
14+
"grunt": "~0.4.2",
15+
"grunt-contrib-clean": "~0.5.0",
16+
"grunt-contrib-concat": "~0.3.x",
17+
"grunt-contrib-jshint": "~0.4.x",
18+
"grunt-contrib-uglify": "~0.2.x",
19+
"grunt-contrib-watch": "~0.5.3",
20+
"grunt-conventional-changelog": "~1.0.x",
21+
"grunt-karma": "~0.7.x",
22+
"grunt-ngmin": "~0.0.3",
23+
"jasmine-core": "^2.1.3",
24+
"karma-chrome-launcher": "^0.1.7",
25+
"karma-jasmine": "^0.3.5",
26+
"load-grunt-tasks": "~0.2.0",
27+
"lodash": "~2.4.x"
28+
}
29+
}

0 commit comments

Comments
 (0)