From f92e8afae725814b3ecafbfa664d84007f0f07b8 Mon Sep 17 00:00:00 2001
From: Carlo Alberto Degli Atti
This is a CoffeScript demo component.
diff --git a/app/components/demoComponent/demoCsComponentDirective.coffee b/app/components/demoComponent/demoCsComponentDirective.coffee
new file mode 100644
index 0000000..72d2a19
--- /dev/null
+++ b/app/components/demoComponent/demoCsComponentDirective.coffee
@@ -0,0 +1,9 @@
+try
+ module = angular.module 'healthyGulpAngularAppComponents'
+catch e
+ module = angular.module 'healthyGulpAngularAppComponents', []
+
+module.directive 'demoCsComponent', [ () ->
+ restrict: 'A',
+ templateUrl: 'components/demoComponent/demoCsComponent.html'
+ ]
diff --git a/app/components/demoComponents.js b/app/components/demoComponents.js
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/app/components/demoComponents.js
@@ -0,0 +1 @@
+
diff --git a/app/components/home.html b/app/components/home.html
index 250ae65..0df8437 100644
--- a/app/components/home.html
+++ b/app/components/home.html
@@ -3,4 +3,7 @@
+
+ diff --git a/gulpfile.js b/gulpfile.js index 0001e45..9a9a953 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -9,6 +9,7 @@ var Q = require('q'); // == PATH STRINGS ======== var paths = { + coffee_scripts: 'app/**/*.coffee', scripts: 'app/**/*.js', styles: ['./app/**/*.css', './app/**/*.scss'], images: './images/**/*', @@ -38,6 +39,14 @@ pipes.minifiedFileName = function() { }); }; +pipes.compiledAppCS = function() { + return gulp.src(paths.coffee_scripts) + .pipe(plugins.sourcemaps.init()) + .pipe(plugins.coffee({bare: true}) + .on('error', plugins.util.log)) + .pipe(plugins.sourcemaps.write()); +}; + pipes.validatedAppScripts = function() { return gulp.src(paths.scripts) .pipe(plugins.jshint()) @@ -45,15 +54,19 @@ pipes.validatedAppScripts = function() { }; pipes.builtAppScriptsDev = function() { - return pipes.validatedAppScripts() + var compiledAppCS = pipes.compiledAppCS(); + var validatedAppScripts = pipes.validatedAppScripts(); + + return es.merge(compiledAppCS, validatedAppScripts) .pipe(gulp.dest(paths.distDev)); }; pipes.builtAppScriptsProd = function() { var scriptedPartials = pipes.scriptedPartials(); + var compiledAppCS = pipes.compiledAppCS(); var validatedAppScripts = pipes.validatedAppScripts(); - return es.merge(scriptedPartials, validatedAppScripts) + return es.merge(scriptedPartials, validatedAppScripts, compiledAppCS) .pipe(pipes.orderedAppScripts()) .pipe(plugins.sourcemaps.init()) .pipe(plugins.concat('app.min.js')) @@ -97,7 +110,7 @@ pipes.scriptedPartials = function() { .pipe(plugins.htmlhint.failReporter()) .pipe(plugins.htmlmin({collapseWhitespace: true, removeComments: true})) .pipe(plugins.ngHtml2js({ - moduleName: "healthyGulpAngularApp" + moduleName: "healthyGulpAngularAppComponents" })); }; diff --git a/package.json b/package.json index 17c00d3..5d09ee8 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,13 @@ "devDependencies": { "body-parser": "^1.5.2", "bower": "^1.3.1", + "coffee-script": "~1.9", "del": "^1.1.1", "event-stream": "^3.2.2", "express": "^4.7.2", "gulp": "^3.8.10", "gulp-angular-filesort": "^1.0.4", + "gulp-coffee": "~2.3", "gulp-concat": "^2.4.3", "gulp-htmlhint": "0.0.9", "gulp-htmlmin": "^1.0.0", @@ -27,6 +29,7 @@ "gulp-sass": "^1.3.2", "gulp-sourcemaps": "^1.3.0", "gulp-uglify": "^1.1.0", + "gulp-util": "^3.0.6", "jshint-stylish": "^1.0.0", "karma": "^0.10", "karma-junit-reporter": "^0.2.2", From d6164029d57fdf65b737c0a898e34d3fdbfea8c3 Mon Sep 17 00:00:00 2001 From: Carlo Alberto Degli Atti