Skip to content
Permalink
Browse files

feat(messaging): improve the console messaging when running the builds

  • Loading branch information
jyounce committed Jul 15, 2016
1 parent 3205d07 commit 5b7f0921f133a7d8a22ee2091e415fa8ec072d0e
Showing with 176 additions and 88 deletions.
  1. +1 −0 src/bootstrap.coffee
  2. +1 −1 src/helpers/bower.coffee
  3. +2 −1 src/helpers/config.coffee
  4. +5 −1 src/helpers/log.coffee
  5. +3 −1 src/tasks/build/build-angular-bootstrap.coffee
  6. +3 −1 src/tasks/build/build-angular-modules.coffee
  7. +2 −1 src/tasks/build/build-bower-json.coffee
  8. +1 −1 src/tasks/build/build-files.coffee
  9. +1 −1 src/tasks/build/build-prod-files-blueprint.coffee
  10. +1 −1 src/tasks/build/build-prod-files.coffee
  11. +2 −1 src/tasks/build/build-spa-file.coffee
  12. +2 −0 src/tasks/clean/clean-dist.coffee
  13. +3 −2 src/tasks/clean/clean-rb-client.coffee
  14. +4 −4 src/tasks/clean/cleanup-client.coffee
  15. +5 −1 src/tasks/compile/coffee.coffee
  16. +12 −8 src/tasks/compile/es6.coffee
  17. +4 −1 src/tasks/compile/less.coffee
  18. +4 −1 src/tasks/compile/sass.coffee
  19. +2 −0 src/tasks/config/set-env-config.coffee
  20. +4 −1 src/tasks/config/update-angular-mocks-config.coffee
  21. +4 −1 src/tasks/copy/copy-bower_components.coffee
  22. +5 −1 src/tasks/copy/copy-css.coffee
  23. +5 −1 src/tasks/copy/copy-html.coffee
  24. +5 −1 src/tasks/copy/copy-images.coffee
  25. +5 −1 src/tasks/copy/copy-js.coffee
  26. +5 −2 src/tasks/copy/copy-libs.coffee
  27. +2 −1 src/tasks/extra/compile-extra-coffee.coffee
  28. +2 −1 src/tasks/extra/compile-extra-es6.coffee
  29. +2 −1 src/tasks/extra/compile-extra-less.coffee
  30. +2 −1 src/tasks/extra/compile-extra-sass.coffee
  31. +2 −1 src/tasks/extra/copy-extra-files.coffee
  32. +2 −1 src/tasks/format/absolute-css-urls.coffee
  33. +7 −6 src/tasks/generate/generate-pkg.coffee
  34. +12 −5 src/tasks/manage/bower.coffee
  35. +7 −4 src/tasks/minify/cache-bust.coffee
  36. +3 −2 src/tasks/minify/concat-scripts-and-styles.coffee
  37. +3 −2 src/tasks/minify/css-file-split.coffee
  38. +2 −1 src/tasks/minify/inline-css-imports.coffee
  39. +1 −1 src/tasks/minify/minify-client.coffee
  40. +5 −3 src/tasks/minify/minify-css.coffee
  41. +6 −3 src/tasks/minify/minify-html.coffee
  42. +1 −1 src/tasks/minify/minify-images.coffee
  43. +15 −12 src/tasks/minify/minify-js.coffee
  44. +3 −2 src/tasks/minify/minify-server.coffee
  45. +2 −1 src/tasks/minify/minify-spa.coffee
  46. +3 −1 src/tasks/minify/template-cache.coffee
  47. +1 −1 src/tasks/test/client/build-client-test-files.coffee
  48. +1 −1 src/tasks/test/client/run-client-tests.coffee
  49. +1 −1 src/tasks/watch/watch.coffee
@@ -7,5 +7,6 @@ module.exports = ->
attn: ['cyan', 'bold']
error: ['red', 'bold']
info: 'cyan'
minor: 'gray'
success: ['green', 'bold']
colors
@@ -133,7 +133,7 @@ module.exports = (config) ->
force = true
if force
del.sync dir, force:true
console.log "#{loc} bower_components directory cleaned".yellow
log.task "cleaned #{loc} bower_components directory"

fse.mkdirsSync dir
fileHelp.write.json _path, bowerJson if force
@@ -1,6 +1,7 @@
module.exports = (config) ->
q = require 'q'
fse = require 'fs-extra'
log = require "#{config.req.helpers}/log"
promiseHelp = require "#{config.req.helpers}/promise"

buildFile: (build=true, msg='built') ->
@@ -10,7 +11,7 @@ module.exports = (config) ->
format = spaces: '\t'
configFile = config.generated.pkg.config
fse.writeJson configFile, config, format, (e) ->
console.log "#{msg} config.json".yellow
# log.task "#{msg} config.json", 'minor'
defer.resolve()
defer.promise

@@ -5,6 +5,10 @@ module.exports =
else
console.log JSON.stringify v, null, '\t'

task: (msg, type='attn') -> # see /src/bootstrap.coffee for types
return unless msg
console.log msg[type]

watch: (taskName, file, opts={}) ->
taskName = opts.logTaskName or taskName
console.log "#{taskName} #{file.event}: #{file.path}".yellow
@task "#{taskName} #{file.event}: #{file.path}", 'minor'
@@ -1,5 +1,6 @@
module.exports = (config, gulp) ->
q = require 'q'
log = require "#{config.req.helpers}/log"
rename = require 'gulp-rename'
template = require 'gulp-template'
promiseHelp = require "#{config.req.helpers}/promise"
@@ -22,7 +23,8 @@ module.exports = (config, gulp) ->
.pipe template data
.pipe gulp.dest dest
.on 'end', ->
# console.log 'bootstrap.coffee built'.info
_file = "#{file.split('.')[0]}.js"
log.task "built angular bootstrap file: #{_file}"
defer.resolve()
defer.promise

@@ -1,5 +1,6 @@
module.exports = (config, gulp) ->
q = require 'q'
log = require "#{config.req.helpers}/log"
rename = require 'gulp-rename'
template = require 'gulp-template'
promiseHelp = require "#{config.req.helpers}/promise"
@@ -22,7 +23,8 @@ module.exports = (config, gulp) ->
.pipe template data
.pipe gulp.dest dest
.on 'end', ->
# console.log 'app.coffee built'.yellow
_file = "#{file.split('.')[0]}.js"
log.task "built angular modules file: #{_file}"
defer.resolve()
defer.promise

@@ -1,6 +1,7 @@
module.exports = (config, gulp) ->
q = require 'q'
fse = require 'fs-extra'
log = require "#{config.req.helpers}/log"

# helpers
# =======
@@ -19,7 +20,7 @@ module.exports = (config, gulp) ->
json = getData()
jsonFile = config.generated.pkg.bower
fse.writeJson jsonFile, json, format, (e) ->
console.log 'built bower.json'.yellow
# log.task 'built bower.json', 'minor'
defer.resolve()
defer.promise

@@ -20,7 +20,7 @@ module.exports = (config, gulp) ->
format = spaces: '\t'
jsonFile = config.generated.pkg.files.files
fse.writeJson jsonFile, json, format, (e) ->
console.log 'built files.json'.yellow
# log.task 'built files.json', 'minor'
clearData() # todo, optimize this
defer.resolve()
defer.promise
@@ -19,7 +19,7 @@ module.exports = (config, gulp) ->
format = spaces: '\t'
jsonFile = config.generated.pkg.files.prodFilesBlueprint
fse.writeJson jsonFile, MinFiles, format, (e) ->
console.log 'built prod-files-blueprint.json'.yellow
# log.task 'built prod-files-blueprint.json', 'minor'
defer.resolve()
defer.promise

@@ -18,7 +18,7 @@ module.exports = (config, gulp) ->
format = spaces: '\t'
jsonFile = config.generated.pkg.files.prodFiles
fse.writeJson jsonFile, ProdFiles, format, (e) ->
console.log 'built prod-files.json'.yellow
# log.task 'built prod-files.json', 'minor'
defer.resolve()
defer.promise

@@ -5,6 +5,7 @@ module.exports = (config, gulp, taskOpts={}) ->
gulpif = require 'gulp-if'
replace = require 'gulp-replace'
template = require 'gulp-template'
log = require "#{config.req.helpers}/log"
pathHelp = require "#{config.req.helpers}/path"
moduleHelp = require "#{config.req.helpers}/module"
format = require("#{config.req.helpers}/format")()
@@ -37,7 +38,7 @@ module.exports = (config, gulp, taskOpts={}) ->
.pipe template data
.pipe gulp.dest dest
.on 'end', ->
# console.log "built #{file}".yellow
log.task "built and copied #{file} to: #{config.dist.app.client.dir}"
defer.resolve()
defer.promise

@@ -1,6 +1,7 @@
module.exports = (config, gulp, taskOpts={}) ->
q = require 'q'
del = require 'del'
log = require "#{config.req.helpers}/log"
forWatchFile = !!taskOpts.watchFile

# API
@@ -16,6 +17,7 @@ module.exports = (config, gulp, taskOpts={}) ->
runMulti: ->
defer = q.defer()
del(config.dist.dir, force:true).then (paths) ->
# log.task "cleaned #{config.dist.dir} directory", 'minor'
defer.resolve()
defer.promise

@@ -1,6 +1,7 @@
module.exports = (config, gulp, taskOpts={}) ->
q = require 'q'
del = require 'del'
log = require "#{config.req.helpers}/log"
promiseHelp = require "#{config.req.helpers}/promise"
configHelp = require("#{config.req.helpers}/config") config

@@ -10,7 +11,7 @@ module.exports = (config, gulp, taskOpts={}) ->
defer = q.defer()
src = config.dist.rb.client.dir
del(src, force:true).then (paths) ->
# console.log 'removed rb client dist dir'.yellow
# log.task 'removed rb client dist dir', 'minor'
defer.resolve()
defer.promise

@@ -30,7 +31,7 @@ module.exports = (config, gulp, taskOpts={}) ->
cleanRbClient()
rebuildConfig env
]).done ->
# console.log 'cleaned rb client dist'.yellow
# log.task 'cleaned rb client dist', 'minor'
defer.resolve()
defer.promise

@@ -36,7 +36,7 @@ module.exports = (config, gulp) ->
cleanTask 'scripts'
cleanTask 'styles'
]).done ->
console.log msg.yellow if msg
# log.task msg, 'minor' if msg
defer.resolve()
defer.promise

@@ -46,7 +46,7 @@ module.exports = (config, gulp) ->
delTask config.internal.getImportsAppOrRb 'rb'
delTask config.internal.getImportsAppOrRb 'app'
]).done ->
console.log msg.yellow if msg
# log.task msg, 'minor' if msg
defer.resolve()
defer.promise

@@ -57,14 +57,14 @@ module.exports = (config, gulp) ->
gulp.src src
.pipe gulp.dest dest
.on 'end', ->
console.log msg.yellow if msg
# log.task msg, 'minor' if msg
defer.resolve()
defer.promise

delTask = (src, msg) ->
defer = q.defer()
del(src, force:true).then (paths) ->
console.log msg.yellow if msg
# log.task msg, 'minor' if msg
defer.resolve()
defer.promise

@@ -2,6 +2,7 @@ module.exports = (config, gulp, taskOpts={}) ->
q = require 'q'
coffee = require 'gulp-coffee'
plumber = require 'gulp-plumber'
log = require "#{config.req.helpers}/log"
tasks = require("#{config.req.helpers}/tasks") config
forWatchFile = !!taskOpts.watchFile

@@ -23,7 +24,10 @@ module.exports = (config, gulp, taskOpts={}) ->
runTask taskOpts.watchFile.path, taskOpts.watchFile.rbDistDir

runMulti: (loc) ->
tasks.run.async runTask, 'scripts', 'coffee', [loc]
promise = tasks.run.async runTask, 'scripts', 'coffee', [loc]
promise.done ->
log.task "compiled coffee to: #{config.dist.app[loc].dir}"
promise

# return
# ======
@@ -1,11 +1,12 @@
module.exports = (config, gulp, taskOpts={}) ->
q = require 'q'
babel = require 'gulp-babel'
plumber = require 'gulp-plumber'
es2015 = require 'babel-preset-es2015'
tasks = require("#{config.req.helpers}/tasks") config
forWatchFile = !!taskOpts.watchFile
babelOpts = presets: [es2015]
q = require 'q'
babel = require 'gulp-babel'
plumber = require 'gulp-plumber'
es2015 = require 'babel-preset-es2015'
log = require "#{config.req.helpers}/log"
tasks = require("#{config.req.helpers}/tasks") config
forWatchFile = !!taskOpts.watchFile
babelOpts = presets: [es2015]

runTask = (src, dest) ->
defer = q.defer()
@@ -25,7 +26,10 @@ module.exports = (config, gulp, taskOpts={}) ->
runTask taskOpts.watchFile.path, taskOpts.watchFile.rbDistDir

runMulti: (loc) ->
tasks.run.async runTask, 'scripts', 'es6', [loc]
promise = tasks.run.async runTask, 'scripts', 'es6', [loc]
promise.done ->
log.task "compiled es6 to: #{config.dist.app[loc].dir}"
promise

# return
# ======
@@ -5,6 +5,7 @@ module.exports = (config, gulp, taskOpts={}) ->
gulpif = require 'gulp-if'
less = require 'gulp-less'
plumber = require 'gulp-plumber'
log = require "#{config.req.helpers}/log"
lessHelper = require("#{config.req.helpers}/Less") config, gulp
forWatchFile = !!taskOpts.watchFile
absCssUrls = require "#{config.req.tasks}/format/absolute-css-urls" if forWatchFile
@@ -89,7 +90,9 @@ module.exports = (config, gulp, taskOpts={}) ->
q.all([
runLess 'app'
runLess 'rb'
]).done -> defer.resolve()
]).done ->
log.task "compiled less to: #{config.dist.app.client.dir}"
defer.resolve()
defer.promise

# return
@@ -5,6 +5,7 @@ module.exports = (config, gulp, taskOpts={}) ->
gulpif = require 'gulp-if'
sass = require 'gulp-sass'
plumber = require 'gulp-plumber'
log = require "#{config.req.helpers}/log"
sassHelper = require("#{config.req.helpers}/Sass") config, gulp
forWatchFile = !!taskOpts.watchFile
absCssUrls = require "#{config.req.tasks}/format/absolute-css-urls" if forWatchFile
@@ -93,7 +94,9 @@ module.exports = (config, gulp, taskOpts={}) ->
q.all([
run 'app'
run 'rb'
]).done -> defer.resolve()
]).done ->
log.task "compiled sass to: #{config.dist.app.client.dir}"
defer.resolve()
defer.promise

# return
@@ -1,6 +1,7 @@
# Task is only called from the common task.
# =========================================
module.exports = (config, gulp) ->
log = require "#{config.req.helpers}/log"
promiseHelp = require "#{config.req.helpers}/promise"

# helpers
@@ -18,6 +19,7 @@ module.exports = (config, gulp) ->
mode = gulp.seq[3] if gulp.seq[3] is config.rb.tasks['prod:server'] # one off
mode = getMode mode
config.env.set mode
log.task "running #{config.env.name} build"
promiseHelp.get()

# return
@@ -2,6 +2,7 @@
# =========================================
module.exports = (config) ->
q = require 'q'
log = require "#{config.req.helpers}/log"
promiseHelp = require "#{config.req.helpers}/promise"
configHelp = require("#{config.req.helpers}/config") config

@@ -21,7 +22,9 @@ module.exports = (config) ->
-> updateConfig()
-> configHelp.buildFile true, 'rebuild'
]
tasks.reduce(q.when, q()).done -> defer.resolve()
tasks.reduce(q.when, q()).done ->
# log.task 'updated angular mocks config', 'info'
defer.resolve()
defer.promise

# return
@@ -2,6 +2,7 @@ module.exports = (config, gulp) ->
q = require 'q'
path = require 'path'
es = require 'event-stream'
log = require "#{config.req.helpers}/log"
promiseHelp = require "#{config.req.helpers}/promise"
bowerHelper = require("#{config.req.helpers}/bower") config

@@ -59,7 +60,9 @@ module.exports = (config, gulp) ->
q.all([
getComponents 'rb', rbExclude
getComponents 'app'
]).done -> defer.resolve()
]).done ->
log.task "copied bower components to: #{config.dist.app.client.dir}"
defer.resolve()
defer.promise

# return
@@ -1,5 +1,6 @@
module.exports = (config, gulp, taskOpts={}) ->
q = require 'q'
log = require "#{config.req.helpers}/log"
tasks = require("#{config.req.helpers}/tasks") config
forWatchFile = !!taskOpts.watchFile
absCssUrls = require "#{config.req.tasks}/format/absolute-css-urls" if forWatchFile
@@ -26,7 +27,10 @@ module.exports = (config, gulp, taskOpts={}) ->
defer.promise

runMulti: ->
tasks.run.async runTask, 'styles', 'css', ['client']
promise = tasks.run.async runTask, 'styles', 'css', ['client']
promise.done ->
log.task "copied css to: #{config.dist.app.client.dir}"
promise

# return
# ======

0 comments on commit 5b7f092

Please sign in to comment.
You can’t perform that action at this time.