Skip to content
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiphe committed Feb 6, 2014
0 parents commit 12fa0d8
Show file tree
Hide file tree
Showing 47 changed files with 1,186 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bower_components/
node_modules/
npm-debug.log
test/e2e/env/all-partials.js
87 changes: 87 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"maxerr" : false,
"bitwise" : true,
"camelcase" : true,
"curly" : true,
"eqeqeq" : true,
"forin" : true,
"immed" : true,
"indent" : 2,
"latedef" : true,
"newcap" : true,
"noarg" : true,
"noempty" : true,
"nonew" : true,
"plusplus" : false,
"quotmark" : "single",
"undef" : true,
"unused" : true,
"strict" : false,
"trailing" : true,
"maxparams" : 3,
"maxdepth" : 3,
"maxstatements" : false,
"maxcomplexity" : false,
"maxlen" : 120,
"asi" : false,
"boss" : false,
"debug" : false,
"eqnull" : false,
"es5" : false,
"esnext" : false,
"evil" : false,
"expr" : false,
"funcscope" : false,
"globalstrict" : false,
"iterator" : false,
"lastsemic" : false,
"laxbreak" : false,
"laxcomma" : false,
"loopfunc" : false,
"multistr" : false,
"proto" : false,
"scripturl" : false,
"smarttabs" : false,
"shadow" : false,
"sub" : false,
"supernew" : false,
"validthis" : false,
"browser" : true,
"couch" : false,
"devel" : false,
"dojo" : false,
"jquery" : false,
"mootools" : false,
"node" : false,
"nonstandard" : false,
"prototypejs" : false,
"rhino" : false,
"worker" : false,
"wsh" : false,
"yui" : false,
"nomen" : false,
"onevar" : false,
"passfail" : false,
"white" : false,
"predef" : [
"angular",
"jasmine",
"jQuery",
"beforeEach",
"afterEach",
"describe",
"ddescribe",
"xdescribe",
"it",
"iit",
"xit",
"expect",
"spyOn",
"runs",
"waits",
"inject",
"module",
"exports",
"require"
]
}
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
language: node_js
node_js:
- "0.11"

before_install:
- npm install -g bower grunt-cli

install:
- npm install
- bower install

before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
# - ./node_modules/protractor/bin/webdriver-manager update --standalone
# - node scripts/web-server.js &
# - ./node_modules/protractor/bin/webdriver-manager start &

script:
- grunt test:travis
55 changes: 55 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* Build instructions for grunt.
*
* Structure seen in [rprtr](https://github.com/mrmrs/rprtr)
* by [aputinski](https://github.com/aputinski)
*
* @param {Object} grunt
* @return {void}
*/
module.exports = function(grunt) {
'use strict';

var Helpers = require('./tasks/helpers');
var config = Helpers.config;
var _ = grunt.util._;

config = _.extend(config, Helpers.loadConfig('./tasks/options/'));

/* Load grunt tasks from NPM packages */
require('load-grunt-tasks')(grunt);
grunt.loadTasks('tasks');

/* "Helper" Tasks */
grunt.registerTask('_test:beforeEach', ['jshint', 'ngtemplates']);
grunt.registerTask('_build:less', [
'less:dist',
'less:distmin',
'concat:bannerToDistStyle',
'concat:bannerToDistStyleMin'
]);
grunt.registerTask('_git:dist', ['gitcommit:dist', 'gittag:dist', 'gitpush:dist', 'gitpush:disttags']);

/* "Public" Tasks */

/* Watch source and test files and execute karma unit tests on change. */
grunt.registerTask('watch:start', ['karma:watch:start', 'watch:andtest']);

/* Execute all tests. */
grunt.registerTask('test', ['_test:beforeEach', 'karma:all', 'protractor']);
/* Execute e2e tests. */
grunt.registerTask('test:e2e', ['_test:beforeEach', 'protractor']);
/* Execute karma tests with Firefox and PhantomJS. */
grunt.registerTask('test:travis', ['_test:beforeEach', 'karma:travis']);

/* Build dist files. */
grunt.registerTask('build', ['ngtemplates', '_build:less', 'concat:dist', 'uglify']);

/* Distribute a new minor version. */
grunt.registerTask('dist', ['test', 'bump', 'build', '_git:dist']);

/* test and build by default. */
grunt.registerTask('default', ['test', 'build']);

grunt.initConfig(config);
};
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License

Copyright (c) 2014 Jimdo GmbH http://jimdo.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
114 changes: 114 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
Angular Directive Seed
======================

Basically a clone of [angular seed](https://github.com/angular/angular-seed)
We striped out things we don't use and added Grunt


Initialize
----------

bower install
npm install
grunt


Start demo & test environment
-----------------------------

./node_modules/protractor/bin/webdriver-manager update --standalone
./node_modules/protractor/bin/webdriver-manager start
node-dev scripts/web-server.js


Play around in demo
-------------------

[http://localhost:8000/demo/index.html](http://localhost:8000/demo/index.html)



Make it yours
-------------

#### Update bower and package infos

You want to look at name, description, homepage, author, keywords, main and repository

├ bower.json
├ package.json


#### Remove sample dist files from

├ dist/


#### Do something awesome in the source files

├ src/


#### And reflect your source files for build and test tasks!

├ tasks/
│ ├ files.js (source and sourceStyle)


#### Set your module name to ngtemplates task

├ tasks/options/ngtemplates.js


#### Write tests

├ test/


#### Adjust the demo and end to end environment to your module and directive names

├ demo/
│ ├ index.html
│ ├ app.js
├ test/
│ ├ e2e/
│ │ ├ env/
│ │ │ ├ index.html
│ │ │ ├ app.js


Grunt Tasks
-----------

* `grunt`: Execute tests and build dist
* `grunt test`: Just test
* `grunt watch:start`: Watch source and test files and run karma on change
* `grunt build`: Just build
* `grunt test:e2e`: Just test end to end
* `grunt dist`: Test, build, bump patch version, commit, add version tag and push


LICENSE
-------

> The MIT License
>
> Copyright (c) 2014 Jimdo GmbH http://jimdo.com
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in
> all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> THE SOFTWARE.
27 changes: 27 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "angular-directive-seed",
"version": "0.0.0",
"authors": [
],
"description": "A starting point for angular directives.",
"main": "dist/angular-directive-seed.js",
"keywords": [
"directive",
"angular"
],
"license": "MIT",
"private": true,
"devDependencies": {
"angular": "~1.2.8",
"angular-mocks": "~1.2.9",
"jquery": "~2.0.3",
"less": "~1.6.1"
},
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
]
}
12 changes: 12 additions & 0 deletions demo/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
angular.module('myApp', ['myModule']).directive('myApp', function() {
return {
restrict: 'E',
replace: false,
template: '<div my-directive></div>',
controller: ['$scope', function($scope) {
/* do something with $scope */
$scope.bar = 'lorem';
}]
};
});
angular.bootstrap(document, ['myApp']);
24 changes: 24 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My angular demo</title>
<link rel="stylesheet/less" type="text/css" href="style.less" />
<link rel="stylesheet/less" type="text/css" href="/src/less/style.less" />
</head>
<body>
<my-app></my-app>

<script src="/bower_components/jquery/jquery.js"></script>
<script>
/* jshint indent: false */
/* global files, $ */
$.get('/tasks/files.js', function() {
files.demoEnv.push('demo/app.js');
$.each(files.demoEnv, function(i, url) {
$('body').append($('<script>').attr('src', '/' + url));
});
});
</script>
</body>
</html>
3 changes: 3 additions & 0 deletions demo/style.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
background: #f2f2f2;
}
14 changes: 14 additions & 0 deletions dist/angular-directive-seed.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*!
* angular-directive-seed v0.0.0
* https://github.com/Jimdo/angular-directive-seed
*
* A starting point for angular directives.
*
* Copyright 2014, Jimdo, Hannes Diercks <hannes.diercks@jimdo.com>
* Released under the MIT license
*/
[my-directive] {
background: blue;
height: 50px;
width: 50px;
}
Loading

0 comments on commit 12fa0d8

Please sign in to comment.