Skip to content

Commit

Permalink
Rewrite app from Backbone to Angular because I can, shutup.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanseddon committed Mar 24, 2013
1 parent b075de3 commit 5f29118
Show file tree
Hide file tree
Showing 225 changed files with 4,681 additions and 20,244 deletions.
3 changes: 3 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "app/components"
}
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true


[*]

# Change these settings to your own preference
indent_style = space
indent_size = 4

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
22 changes: 5 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
# Files #
######################
public/css/_styles.min.css
public/scripts/_scripts.min.js
public/scripts/_scripts.min.js.map
public/scripts/.DS_Store

# Folders #
######################
node_modules/*
deploy/*
logs/*
pids/*

# Not sure I can share #
########################
public/gallery/*
node_modules
dist
.tmp
.sass-cache
app/components
25 changes: 25 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"node": true,
"browser": true,
"es5": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true,
"globals": {
"angular": true,
"alert": true
}
}
242 changes: 242 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
'use strict';
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};

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

// configurable paths
var yeomanConfig = {
app: 'app',
dist: 'dist'
};

try {
yeomanConfig.app = require('./component.json').appPath || yeomanConfig.app;
} catch (e) {}

grunt.initConfig({
yeoman: yeomanConfig,
watch: {
livereload: {
files: [
'<%= yeoman.app %>/{,*/}*.html',
'{.tmp,<%= yeoman.app %>}/styles/{,*/}*.css',
'{.tmp,<%= yeoman.app %>}/scripts/{,*/}*.js',
'<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp}'
],
tasks: ['livereload']
},
jade: {
files: 'app/views/*.jade',
tasks: 'jade'
}
},
connect: {
livereload: {
options: {
port: 9000,
// Change this to '0.0.0.0' to access the server from outside.
hostname: 'localhost',
middleware: function (connect) {
return [
lrSnippet,
mountFolder(connect, '.tmp'),
mountFolder(connect, yeomanConfig.app)
];
}
}
},
test: {
options: {
port: 9000,
middleware: function (connect) {
return [
mountFolder(connect, '.tmp'),
mountFolder(connect, 'test')
];
}
}
}
},
open: {
server: {
url: 'http://localhost:<%= connect.livereload.options.port %>'
}
},
clean: {
dist: ['.tmp', '<%= yeoman.dist %>/*'],
server: '.tmp'
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'Gruntfile.js',
'<%= yeoman.app %>/scripts/{,*/}*.js'
]
},
karma: {
unit: {
configFile: 'karma.conf.js',
singleRun: true
}
},
jade: {
html: {
src: ['app/views/*.jade'],
dest: 'app/views',
options: {
client: false
}
}
},
concat: {
dist: {
files: {
'<%= yeoman.dist %>/scripts/scripts.js': [
'.tmp/scripts/{,*/}*.js',
'<%= yeoman.app %>/scripts/{,*/}*.js'
]
}
}
},
useminPrepare: {
html: '<%= yeoman.app %>/index.html',
options: {
dest: '<%= yeoman.dist %>'
}
},
usemin: {
html: ['<%= yeoman.dist %>/{,*/}*.html'],
css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
options: {
dirs: ['<%= yeoman.dist %>']
}
},
imagemin: {
dist: {
files: [{
expand: true,
cwd: '<%= yeoman.app %>/images',
src: '{,*/}*.{png,jpg,jpeg}',
dest: '<%= yeoman.dist %>/images'
}]
}
},
cssmin: {
dist: {
files: {
'<%= yeoman.dist %>/styles/main.css': [
'.tmp/styles/{,*/}*.css',
'<%= yeoman.app %>/styles/{,*/}*.css'
]
}
}
},
htmlmin: {
dist: {
options: {
/*removeCommentsFromCDATA: true,
// https://github.com/yeoman/grunt-usemin/issues/44
//collapseWhitespace: true,
collapseBooleanAttributes: true,
removeAttributeQuotes: true,
removeRedundantAttributes: true,
useShortDoctype: true,
removeEmptyAttributes: true,
removeOptionalTags: true*/
},
files: [{
expand: true,
cwd: '<%= yeoman.app %>',
src: ['*.html', 'views/*.html'],
dest: '<%= yeoman.dist %>'
}]
}
},
cdnify: {
dist: {
html: ['<%= yeoman.dist %>/*.html']
}
},
ngmin: {
dist: {
files: [{
expand: true,
cwd: '<%= yeoman.dist %>/scripts',
src: '*.js',
dest: '<%= yeoman.dist %>/scripts'
}]
}
},
uglify: {
dist: {
files: {
'<%= yeoman.dist %>/scripts/scripts.js': [
'<%= yeoman.dist %>/scripts/scripts.js'
]
},
sourceMap: '<%= yeoman.dist %>/scripts/scripts.js.map'
}
},
copy: {
dist: {
files: [{
expand: true,
dot: true,
cwd: '<%= yeoman.app %>',
dest: '<%= yeoman.dist %>',
src: [
'*.{ico,txt}',
'.htaccess',
'components/**/*',
'gallery/**/*',
'images/{,*/}*.{gif,webp}'
]
}]
}
}
});

grunt.renameTask('regarde', 'watch');
// remove when mincss task is renamed
grunt.renameTask('mincss', 'cssmin');

grunt.registerTask('server', [
'clean:server',
'livereload-start',
'connect:livereload',
'open',
'watch'
]);

grunt.registerTask('test', [
'clean:server',
'connect:test',
'karma'
]);

grunt.registerTask('build', [
'clean:dist',
'jshint',
'test',
'jade',
'useminPrepare',
'imagemin',
'cssmin',
'htmlmin',
'concat',
'copy',
'cdnify',
'usemin',
'ngmin',
'uglify'
]);

grunt.registerTask('default', ['build']);
};
Loading

0 comments on commit 5f29118

Please sign in to comment.