Skip to content

Commit

Permalink
added form gen
Browse files Browse the repository at this point in the history
  • Loading branch information
jonniespratley committed Dec 8, 2014
1 parent 7be298f commit 3e5614d
Show file tree
Hide file tree
Showing 8 changed files with 297 additions and 106 deletions.
133 changes: 74 additions & 59 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,26 @@ var LIVERELOAD_PORT = 35728;
var SERVER_PORT = 9000;
//var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT});
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
return connect.static( require( 'path' ).resolve( dir ) );
};

module.exports = function (grunt) {

//Connect proxy to route requests to localhost:8181/api
grunt.loadNpmTasks('grunt-connect-proxy');
require('json-proxy').initialize({});
grunt.loadNpmTasks( 'grunt-connect-proxy' );
require( 'json-proxy' ).initialize( {} );
// Load grunt tasks automatically
require('load-grunt-tasks')(grunt);
require( 'load-grunt-tasks' )( grunt );

// Time how long tasks take. Can help when optimizing build times
require('time-grunt')(grunt);
require( 'time-grunt' )( grunt );

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

// Project settings
yeoman: {
// configurable paths
app: require('./bower.json').appPath || 'app',
app: require( './bower.json' ).appPath || 'app',
dist: 'dist',
tmp: '.tmp'
},
Expand All @@ -54,11 +53,11 @@ module.exports = function (grunt) {
tasks: ['newer:coffee:dist']
},
coffeeTest: {
files: ['test/spec/{,**/}*.{coffee,litcoffee,coffee.md}'],
files: ['test/spec/{,**/}*.{coffee,litcoffee,coffee.md}'],
tasks: ['coffee:test', 'newer:coffee:test', 'karma:unit']
},
coffeeProtractorTest: {
files: ['test/protractor/{,**/}*.{coffee,litcoffee,coffee.md}'],
files: ['test/protractor/{,**/}*.{coffee,litcoffee,coffee.md}'],
tasks: ['coffee:test', 'newer:coffee:test', 'protractor']
},
compass: {
Expand Down Expand Up @@ -93,9 +92,10 @@ module.exports = function (grunt) {
hostname: '127.0.0.1',
livereload: 35729,
middleware: function (connect, options) {
return [require('json-proxy').initialize(proxyConfig),
mountFolder(connect, '.grunt'),
mountFolder(connect, '.tmp')
return [
require( 'json-proxy' ).initialize( proxyConfig ),
mountFolder( connect, '.grunt' ),
mountFolder( connect, '.tmp' )
];
}
},
Expand All @@ -104,9 +104,10 @@ module.exports = function (grunt) {
open: true,
base: ['.tmp', '<%= yeoman.app %>'],
middleware: function (connect, options) {
return [require('json-proxy').initialize(proxyConfig),
mountFolder(connect, '.tmp'),
mountFolder(connect, 'app')
return [
require( 'json-proxy' ).initialize( proxyConfig ),
mountFolder( connect, '.tmp' ),
mountFolder( connect, 'app' )
];
}
}
Expand All @@ -122,8 +123,9 @@ module.exports = function (grunt) {
livereload: false,
base: '<%= yeoman.dist %>',
middleware: function (connect, options) {
return [require('json-proxy').initialize(proxyConfig),
mountFolder(connect, 'dist')
return [
require( 'json-proxy' ).initialize( proxyConfig ),
mountFolder( connect, 'dist' )
];
}
}
Expand All @@ -134,9 +136,9 @@ module.exports = function (grunt) {
open: true,
middleware: function (connect, options) {
return [
mountFolder(connect, '.grunt'),
mountFolder(connect, '.tmp'),
mountFolder(connect, 'docs')
mountFolder( connect, '.grunt' ),
mountFolder( connect, '.tmp' ),
mountFolder( connect, 'docs' )
];
}
}
Expand All @@ -147,7 +149,7 @@ module.exports = function (grunt) {
jshint: {
options: {
jshintrc: '.jshintrc',
reporter: require('jshint-stylish')
reporter: require( 'jshint-stylish' )
},
all: [
//'Gruntfile.js'
Expand Down Expand Up @@ -269,9 +271,11 @@ module.exports = function (grunt) {
rev: {
dist: {
files: {
src: ['<%= yeoman.dist %>/scripts/{,*/}*.js', '<%= yeoman.dist %>/styles/{,*/}*.css',
src: [
'<%= yeoman.dist %>/scripts/{,*/}*.js', '<%= yeoman.dist %>/styles/{,*/}*.css',
//'<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
'<%= yeoman.dist %>/styles/fonts/*']
'<%= yeoman.dist %>/styles/fonts/*'
]
}
}
},
Expand Down Expand Up @@ -340,7 +344,7 @@ module.exports = function (grunt) {
removeRedundantAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true
*/
*/

},
files: [
Expand Down Expand Up @@ -406,11 +410,13 @@ module.exports = function (grunt) {
dot: true,
cwd: '<%= yeoman.app %>',
dest: '<%= yeoman.dist %>',
src: ['*.{ico,png,txt}', '.htaccess',
src: [
'*.{ico,png,txt}', '.htaccess',
//'bower_components/**/*',
'scripts/libs/*',
'images/{,*/}*.{webp}',
'fonts/*']
'fonts/*'
]
},
{
expand: true,
Expand All @@ -430,17 +436,22 @@ module.exports = function (grunt) {

// Run some tasks in parallel to speed up the build process
concurrent: {
server: ['coffee:dist',
server: [
'coffee:dist',
// 'compass:server',
'ngtemplates', 'copy:styles'],
test: ['coffee',
'ngtemplates', 'copy:styles'
],
test: [
'coffee',
// 'compass',
'copy:styles'],
'copy:styles'
],
dist: [
'coffee',
// 'compass:dist',
'ngtemplates',
'copy:styles', 'svgmin', 'htmlmin']
'copy:styles', 'svgmin', 'htmlmin'
]
},

// By default, your `index.html`'s <!-- Usemin block --> will take care of
Expand Down Expand Up @@ -534,7 +545,7 @@ module.exports = function (grunt) {
module: 'angularCmsApp',
//url: 'views',
url: function (url) {
return url.replace('app/', '');
return url.replace( 'app/', '' );
},
prefix: '',
htmlmin: {
Expand Down Expand Up @@ -569,8 +580,7 @@ module.exports = function (grunt) {
options: {
keepAlive: true, // If false, the grunt process stops when the test fails.
noColor: false, // If true, protractor will not use colors in its output.
args: {
}
args: {}
},
test: {
options: {
Expand All @@ -580,7 +590,6 @@ module.exports = function (grunt) {
}
},


//Coveralls code coverage
coveralls: {
options: {
Expand All @@ -605,39 +614,45 @@ module.exports = function (grunt) {
]
}
}
});
};

// Define the configuration for all the tasks
grunt.initConfig( GruntConfig );

grunt.registerTask('serve', function (target) {
grunt.registerTask( 'serve', function (target) {
if (target === 'dist') {
return grunt.task.run(['build', 'connect:dist:keepalive']);
return grunt.task.run( ['build', 'connect:dist:keepalive'] );
}

grunt.task.run(['clean:server', 'concurrent:server', 'autoprefixer', 'connect:livereload', 'watch']);
});
grunt.task.run( ['clean:server', 'concurrent:server', 'autoprefixer', 'connect:livereload', 'watch'] );
} );

grunt.registerTask('server', function () {
grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
grunt.task.run(['serve']);
});
grunt.registerTask( 'server', function () {
grunt.log.warn( 'The `server` task has been deprecated. Use `grunt serve` to start a server.' );
grunt.task.run( ['serve'] );
} );

grunt.registerTask('test', function (target) {
grunt.task.run(['clean:server', 'concurrent:test', 'autoprefixer', 'connect:test']);
grunt.registerTask( 'test', function (target) {
grunt.task.run( ['clean:server', 'concurrent:test', 'autoprefixer', 'connect:test'] );
if (target === 'e2e') {
return grunt.task.run(['karma', 'protractor_webdriver', 'protractor', 'coveralls']);
} else if(target === 'server'){
return grunt.task.run(['coffee:test', 'mochaTest']);
return grunt.task.run( ['karma', 'protractor_webdriver', 'protractor', 'coveralls'] );
} else if (target === 'server') {
return grunt.task.run( ['coffee:test', 'mochaTest'] );
} else {
return grunt.task.run(['karma:unit', 'coveralls']);
return grunt.task.run( ['karma:unit', 'coveralls'] );
}
});
} );

grunt.registerTask('ptor', ['coffee:test', 'protractor_webdriver', 'protractor']);
grunt.registerTask('build-docs', [ 'useminPrepare', 'autoprefixer', 'concat', 'ngmin']);
grunt.registerTask('build', ['clean:dist', 'useminPrepare', 'concurrent:dist', 'autoprefixer', 'concat', 'ngmin', 'copy:dist', /*'cdnify',*/ 'cssmin', 'uglify', 'rev', 'usemin']);
grunt.registerTask( 'ptor', ['coffee:test', 'protractor_webdriver', 'protractor'] );
grunt.registerTask( 'build-docs', ['useminPrepare', 'autoprefixer', 'concat', 'ngmin'] );
grunt.registerTask( 'build', [
'clean:dist', 'useminPrepare', 'concurrent:dist', 'autoprefixer', 'concat', 'ngmin', 'copy:dist', /*'cdnify',*/
'cssmin', 'uglify', 'rev', 'usemin'
] );

grunt.registerTask('docs', ['coffee', 'ngdocs', 'connect:docs', 'watch:ngdocs']);
grunt.registerTask('default', ['newer:jshint', 'test', 'build']);
grunt.registerTask( 'docs', ['coffee', 'ngdocs', 'connect:docs', 'watch:ngdocs'] );
grunt.registerTask( 'default', ['newer:jshint', 'test', 'build'] );

grunt.registerTask('heroku:production', 'build');
grunt.registerTask('heroku:development', 'build');
grunt.registerTask( 'heroku:production', 'build' );
grunt.registerTask( 'heroku:development', 'build' );
};
50 changes: 33 additions & 17 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,42 @@


<!-- bower:js -->


<!-- build:js scripts/plugins.js -->
<script src="bower_components/jquery/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/jquery-ui/ui/jquery-ui.js"></script>
<script src="bower_components/jquery/jquery.js"></script>
<script src="bower_components/es5-shim/es5-shim.js"></script>
<script src="bower_components/json3/lib/json3.min.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>

<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-ui-utils/ui-utils.js"></script>
<script src="bower_components/angular-strap/dist/angular-strap.min.js"></script>
<script src="bower_components/angular-strap/dist/angular-strap.tpl.min.js"></script>
<script src="bower_components/blueimp-tmpl/js/tmpl.js"></script>
<script src="bower_components/blueimp-load-image/js/load-image.js"></script>
<script src="bower_components/blueimp-load-image/js/load-image-ios.js"></script>
<script src="bower_components/blueimp-load-image/js/load-image-orientation.js"></script>
<script src="bower_components/blueimp-load-image/js/load-image-meta.js"></script>
<script src="bower_components/blueimp-load-image/js/load-image-exif.js"></script>
<script src="bower_components/blueimp-load-image/js/load-image-exif-map.js"></script>
<script src="bower_components/blueimp-canvas-to-blob/js/canvas-to-blob.js"></script>
<script src="bower_components/jquery-file-upload/js/cors/jquery.postmessage-transport.js"></script>
<script src="bower_components/jquery-file-upload/js/cors/jquery.xdr-transport.js"></script>
<script src="bower_components/jquery-file-upload/js/vendor/jquery.ui.widget.js"></script>
<script src="bower_components/jquery-file-upload/js/jquery.fileupload.js"></script>
<script src="bower_components/jquery-file-upload/js/jquery.fileupload-process.js"></script>
<script src="bower_components/jquery-file-upload/js/jquery.fileupload-validate.js"></script>
<script src="bower_components/jquery-file-upload/js/jquery.fileupload-image.js"></script>
<script src="bower_components/jquery-file-upload/js/jquery.fileupload-audio.js"></script>
<script src="bower_components/jquery-file-upload/js/jquery.fileupload-video.js"></script>
<script src="bower_components/jquery-file-upload/js/jquery.fileupload-ui.js"></script>
<script src="bower_components/jquery-file-upload/js/jquery.fileupload-jquery-ui.js"></script>
<script src="bower_components/jquery-file-upload/js/jquery.fileupload-angular.js"></script>
<script src="bower_components/jquery-file-upload/js/jquery.iframe-transport.js"></script>
<script src="bower_components/jquery-ui/ui/jquery-ui.js"></script>
<script src="bower_components/angular-animate/angular-animate.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="bower_components/angular-resource/angular-resource.js"></script>
<script src="bower_components/angular-cookies/angular-cookies.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/angular-form-gen/dist/angular-form-gen.js"></script>
<!-- endbower -->
<!-- endbuild -->
<!-- Dependent libs -->
Expand All @@ -111,16 +137,6 @@
<script src="scripts/libs/markdown.js"></script>


<!-- build:js scripts/modules.js -->
<script src="bower_components/angular-resource/angular-resource.js"></script>
<script src="bower_components/angular-cookies/angular-cookies.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="bower_components/angular-animate/angular-animate.js"></script>
<script src="bower_components/angular-strap/dist/angular-strap.min.js"></script>
<script src="bower_components/angular-strap/dist/angular-strap.tpl.min.js"></script>
<script src="bower_components/angular-ui-utils/ui-utils.js"></script>
<!-- endbuild -->

<!-- build:js({.tmp,app}) scripts/scripts.js -->
<script src="scripts/config.js"></script>
Expand Down
1 change: 1 addition & 0 deletions app/scripts/app.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ app = angular.module('angularCmsApp', [
'ngRoute'
'ngAnimate'
'mgcrea.ngStrap'
'fg'
#'cms.Templates'
])
.config ($routeProvider) ->
Expand Down
Loading

0 comments on commit 3e5614d

Please sign in to comment.