Skip to content

Commit

Permalink
updated gruntfile
Browse files Browse the repository at this point in the history
  • Loading branch information
jonniespratley committed Dec 26, 2014
1 parent 37221ff commit a59d0da
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 46 deletions.
77 changes: 42 additions & 35 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@

/* jshint camelcase:false */
var fs = require('fs');
var express = require('express');
var cmsRouter = require('./routes/cms-router.js');
'use strict';
var fs = require('fs'),
express = require('express'),
cmsRouter = require('./routes/cms-router.js'),
config = JSON.parse(fs.readFileSync('./config/config.json')),
LIVERELOAD_PORT = 35729,
SERVER_PORT = 9000;


// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
/**
* @TODO - Externalize configuration for server and proxy, mongodb
*/

var startNodeServer = function(options, app){
var app = express();
var config = JSON.parse(fs.readFileSync('./config/config.json'));
var server = new cmsRouter.mount(config, app);
var startNodeServer = function(){
var _app = express();
var server = new cmsRouter.mount(config, _app);
};

var serverEndpoint = 'http://localhost:8181';
Expand All @@ -30,8 +25,7 @@ var proxyConfig = {
}
};

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));
Expand Down Expand Up @@ -89,10 +83,10 @@ module.exports = function (grunt) {
// The actual grunt server settings
connect: {
options: {
port: 9000,
port: SERVER_PORT,
// Change this to '0.0.0.0' to access the server from outside.
hostname: '127.0.0.1',
livereload: 35729,
livereload: LIVERELOAD_PORT,
base: ['.tmp', '<%= yeoman.app %>'],
onCreateServer: function(server, connect, options) {
grunt.util.log('onCreateServer', options);
Expand Down Expand Up @@ -124,6 +118,8 @@ module.exports = function (grunt) {
dist: {
options: {
livereload: false,
keepAlive: true,
open: true,
base: '<%= yeoman.dist %>',
middleware: function (connect, options) {
return [
Expand Down Expand Up @@ -279,7 +275,9 @@ module.exports = function (grunt) {
dist: {
files: {
src: [
'<%= yeoman.dist %>/scripts/{,*/}*.js', '<%= yeoman.dist %>/styles/{,*/}*.css',
'<%= yeoman.dist %>/scripts/{,*/}*.js',
'<%= yeoman.dist %>/libs/{,*/}*.js',
'<%= yeoman.dist %>/styles/{,*/}*.css',
//'<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
'<%= yeoman.dist %>/styles/fonts/*'
]
Expand Down Expand Up @@ -420,7 +418,7 @@ module.exports = function (grunt) {
src: [
'*.{ico,png,txt}', '.htaccess',
//'bower_components/**/*',
'scripts/libs/*',
'libs/*',
'images/{,*/}*.{webp}',
'fonts/*'
]
Expand All @@ -444,24 +442,25 @@ module.exports = function (grunt) {
// Run some tasks in parallel to speed up the build process
concurrent: {
options: {
limit: 10,
limit: 15,
logConcurrentOutput: true
},
server: [
'coffee:dist',
// 'compass:server',
'ngtemplates', 'copy:styles'
'ngtemplates',
'copy:styles'
],
test: [
'coffee',
// 'compass',
'copy:styles'
],
dist: [
'coffee',
// 'compass:dist',
'ngtemplates',
'copy:styles', 'svgmin', 'htmlmin'
'copy:styles',
'svgmin',
'htmlmin'
]
},

Expand Down Expand Up @@ -528,11 +527,9 @@ module.exports = function (grunt) {
dest: 'docs',
html5Mode: false,
startPage: '/api',
title: "AngularCMS Docs",
//imageLink: "http://my-domain.com",

titleLink: "/api",
bestMatch: true,
title: 'AngularCMS Docs',
titleLink: '/api',
bestMatch: true
},
api: {
src: [
Expand All @@ -554,7 +551,6 @@ module.exports = function (grunt) {
dest: '.tmp/scripts/templates.js',
options: {
module: 'angularCmsApp',
//url: 'views',
url: function (url) {
return url.replace('app/', '');
},
Expand Down Expand Up @@ -667,8 +663,19 @@ module.exports = function (grunt) {
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'
'clean:dist',
'useminPrepare',
'concurrent:dist',
'autoprefixer',
'concat',
'ngtemplates',
'ngmin',
'copy:dist',
'cdnify',
'cssmin',
'uglify',
'rev',
'usemin'
]);

grunt.registerTask('docs', ['coffee', 'ngdocs', 'connect:docs', 'watch:ngdocs']);
Expand Down
17 changes: 6 additions & 11 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
</script>

<!--script src="/socket.io/socket.io.js"></script--!>
<!-- bower:js -->
<!-- bower:js -->
<script src="bower_components/jquery/jquery.js"></script>
<script src="bower_components/jquery-ui/ui/jquery-ui.js"></script>
<script src="bower_components/es5-shim/es5-shim.js"></script>
Expand All @@ -107,18 +108,15 @@
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/angular-form-gen/dist/angular-form-gen.js"></script>
<!-- endbower -->
<!-- Dependent libs -->
<script src="libs/parse-1.2.17.min.js"></script>
<script src="libs/md5.js"></script>
<script src="libs/markdown.js"></script>
<!-- endbuild -->
<!-- Dependent libs -->
<script src="libs/parse-1.2.17.min.js"></script>
<script src="libs/md5.js"></script>
<script src="libs/markdown.js"></script>



<!-- build:js({.tmp,app}) scripts/scripts.js -->
<script src="scripts/config.js"></script>
<script src="scripts/app.js"></script>

<script src="scripts/templates.js"></script>
<script src="scripts/controllers/main.js"></script>
<script src="scripts/controllers/docs.js"></script>
Expand All @@ -139,23 +137,20 @@
<script src="scripts/controllers/help.js"></script>
<script src="scripts/controllers/app.js"></script>
<script src="scripts/filters/gravatar.js"></script>

<script src="scripts/directives/cms-formgroup.js"></script>
<script src="scripts/directives/cms-widgets.js"></script>
<script src="scripts/directives/cms-widget.js"></script>
<script src="scripts/directives/cms-uploader.js"></script>
<script src="scripts/directives/cms-header.js"></script>
<script src="scripts/directives/cms-gravatar.js"></script>
<script src="scripts/services/dataservice.js"></script>

<!--script src="scripts/services/cmsdataserviceprovider.js"></script-->
<script src="scripts/services/cms-dataservicefactory.js"></script>
<script src="scripts/services/cms-usersfactory.js"></script>
<script src="scripts/services/cms-authservice.js"></script>
<script src="scripts/services/cms-sessionservice.js"></script>
<script src="scripts/services/cms-socketservice.js"></script>
<script src="scripts/services/cms-notify.js"></script>

<!-- endbuild -->
</body>
</html>

0 comments on commit a59d0da

Please sign in to comment.