Skip to content

Commit

Permalink
project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
padsbanger committed Nov 4, 2015
1 parent f0f52f3 commit 3e5eadd
Show file tree
Hide file tree
Showing 6 changed files with 282 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ build/Release
# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

js/build/

styles/css/
192 changes: 192 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
'use strict';

module.exports = function(grunt) {
// Load grunt tasks automatically
require('load-grunt-tasks')(grunt);
// Time how long tasks take. Can help when optimizing build times
require('time-grunt')(grunt);

// Define the configuration for all the tasks
grunt.initConfig({

clean: ['js/build/'],

// Watches files for changes and runs tasks based on the changed files
watch: {
styles: {
files: ['styles/less/*.less', 'styles/less/**/*.less'],
tasks: ['less'],
options: {
livereload: {
port: 9000
}
},
},
directives: {
files: ['js/src/directives/*.js'],
tasks: ['concat:directives'],
options: {
livereload: {
port: 9000
}
},
},
services: {
files: ['js/src/services/*.js'],
tasks: ['concat:services'],
options: {
livereload: {
port: 9000
}
},
},
controllers: {
files: ['js/src/controllers/*.js'],
tasks: ['concat:controllers'],
options: {
livereload: {
port: 9000
}
},
},
filters: {
files: ['js/src/filters/*.js'],
tasks: ['concat:filters'],
options: {
livereload: {
port: 9000
}
},
},
html: {
files: ['*.html', 'views/**/*.html', ],
options: {
livereload: {
port: 9000
}
},
}
},

// The actual grunt server settings
connect: {
server: {
options: {
port: 1337,
hostname: '',
livereload: 9000,
open: true
}
}
},
less: {
development: {
options: {
compress: true,
paths: ['styles/less/*/']
},
files: {
'styles/css/styles.css': 'styles/less/styles.less',
}
}
},

concat: {
options: {
separator: ';',
},
libs: {
src: [
'libs/angular/angular.js',
'libs/angular-route/angular-route.js'
],
dest: 'js/build/libs.js'
},
directives: {
src: ['js/src/directives/*.js', 'js/src/directives/*/*.js'],
dest: 'js/build/directives.js'
},
controllers: {
src: ['js/src/controllers/*.js', 'js/src/controllers/*/*.js'],
dest: 'js/build/controllers.js'
},
services: {
src: ['js/src/services/*.js', 'js/src/services/*/*.js'],
dest: 'js/build/services.js'
},
filters: {
src: ['js/src/filters/*.js', 'js/src/filters/*/*.js'],
dest: 'js/build/filters.js'
},
build: {
src: [
'js/src/app.js',
'js/build/controllers.js',
'js/build/directives.js',
'js/build/filters.js',
'js/build/services.js'
],
dest: 'js/build/app.min.js'
}
},

uglify: {
build: {
files: {
'js/build/app.min.js': 'js/build/app.min.js',
'js/build/libs.min.js': 'js/build/libs.js'
}
}
},


// Test settings
karma: {
unit: {
configFile: 'karma.conf.js',
singleRun: true
}
},

mkdir: {
js: {
options: {
create: ['js/build']
}
}
},

});

grunt.registerTask('build', function() {
grunt.task.run([
'mkdir:js',
'clean',
'less',
'concat:libs',
'concat:directives',
'concat:controllers',
'concat:services',
'concat:filters',
'concat:build',
'uglify:build',
'karma:unit',
'coveralls'
]);
});

grunt.registerTask('serve', function() {
grunt.task.run([
'clean',
'mkdir:js',
'concat:libs',
'concat:directives',
'concat:controllers',
'concat:services',
'concat:filters',
'less',
'connect:server',
'watch'
]);
});
};
30 changes: 30 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html ng-app="pipboy">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=9">
<title>PipBoy</title>
<meta content="maximum-scale=1.0, user-scalable=no" name="viewport">
<link href='https://fonts.googleapis.com/css?family=Inconsolata:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="styles/css/styles.css">
</head>

<body>
<div class="container" ng-controller="mainController">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<script src="js/build/libs.js"></script>
<script src="js/src/app.js"></script>
<script src="js/build/controllers.js"></script>
<script src="js/build/directives.js"></script>
<script src="js/build/filters.js"></script>
<script src="js/build/services.js"></script>
</body>

</html>
44 changes: 44 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "pipboy",
"version": "0.0.1",
"description": "",
"main": "index.html",
"scripts": {
"test": "grunt build"
},
"repository": {
"type": "git",
"url": "git://github.com/padsbanger/pipboy.git"
},
"keywords": [
"Grunt",
"Angular.js"
],
"author": "Michal Lach",
"license": "MIT",
"devDependencies": {
"grunt-concurrent": "^1.0.0",
"grunt-cli": "^0.1.13",
"less": "^2.5.0",
"grunt-mkdir": "^0.1.2",
"grunt-contrib-concat": "^0.5.1",
"grunt-contrib-connect": "^0.10.1",
"load-grunt-tasks": "^3.1.0",
"grunt-newer": "^1.1.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-contrib-less": "^1.0.0",
"grunt-contrib-uglify": "^0.8.1",
"grunt-contrib-clean": "^0.6.0",
"time-grunt": "^1.1.0",
"grunt-karma": "^0.10.1",
"karma": "^0.12.31",
"karma-script-launcher": "^0.1.0",
"jasmine-reporters": "^2.0.5",
"karma-junit-reporter": "^0.2.2",
"grunt-contrib-copy": "^0.8.0",
"jasmine-core": "^2.2.0",
"karma-jasmine": "^0.3.5",
"matchdep": "^0.3.0",
"karma-phantomjs-launcher": "^0.1.4"
}
}
7 changes: 7 additions & 0 deletions styles/less/styles.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@import 'vars.less';

body {
font-size: 16px;
font-family: @font-family;
font-weight: bold;
}
5 changes: 5 additions & 0 deletions styles/less/vars.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@font-family: 'Inconsolata';
@nuka-cola: #12cdc6;
@violent-red: #d73336;
@terminal-green: #43ce18;
@dull: #859c8b;

0 comments on commit 3e5eadd

Please sign in to comment.