From 02ddd7f698dbe3880e478993178a9ab23b23d022 Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Sat, 29 Nov 2014 13:47:04 -0800 Subject: [PATCH] Fixed #1816. Cleaned up logging in config.coffee. --- app/templates/core/auth.jade | 2 +- .../recover.jade => core/recover-modal.jade} | 0 app/views/{modal => core}/RecoverModal.coffee | 2 +- config.coffee | 50 +++++++++---------- 4 files changed, 26 insertions(+), 28 deletions(-) rename app/templates/{modal/recover.jade => core/recover-modal.jade} (100%) rename app/views/{modal => core}/RecoverModal.coffee (96%) diff --git a/app/templates/core/auth.jade b/app/templates/core/auth.jade index 42ed83c63..92d6c5d62 100644 --- a/app/templates/core/auth.jade +++ b/app/templates/core/auth.jade @@ -82,4 +82,4 @@ block modal-footer div.network-login .gplus-login-button#gplus-login-button div#recover-account-wrapper - a(data-toggle="coco-modal", data-target="modal/RecoverModal", data-i18n="login.recover")#link-to-recover recover account + a(data-toggle="coco-modal", data-target="core/RecoverModal", data-i18n="login.recover")#link-to-recover recover account diff --git a/app/templates/modal/recover.jade b/app/templates/core/recover-modal.jade similarity index 100% rename from app/templates/modal/recover.jade rename to app/templates/core/recover-modal.jade diff --git a/app/views/modal/RecoverModal.coffee b/app/views/core/RecoverModal.coffee similarity index 96% rename from app/views/modal/RecoverModal.coffee rename to app/views/core/RecoverModal.coffee index bd435a714..21358a634 100644 --- a/app/views/modal/RecoverModal.coffee +++ b/app/views/core/RecoverModal.coffee @@ -1,5 +1,5 @@ ModalView = require 'views/core/ModalView' -template = require 'templates/modal/recover' +template = require 'templates/core/recover-modal' forms = require 'core/forms' {genericFailure} = require 'core/errors' diff --git a/config.coffee b/config.coffee index ef8ffb25e..41dd91c5e 100644 --- a/config.coffee +++ b/config.coffee @@ -10,29 +10,6 @@ commonjsHeader = fs.readFileSync('node_modules/brunch/node_modules/commonjs-requ regJoin = (s) -> new RegExp(s.replace(/\//, '[\\\/\\\\]')) -#- Find all .coffee and .jade files in /app - -dirStack = ['./app'] -coffeeFiles = [] -jadeFiles = [] - -while dirStack.length - dir = dirStack.pop() - contents = fs.readdirSync(dir) - for file in contents - fullPath = "#{dir}/#{file}" - stat = fs.statSync(fullPath) - if stat.isDirectory() - dirStack.push(fullPath) - else - if _.str.endsWith(file, '.coffee') - coffeeFiles.push(fullPath) - else if _.str.endsWith(file, '.jade') - jadeFiles.push(fullPath) - -console.log "Got #{coffeeFiles.length} coffee files and #{jadeFiles.length} jade files." - - #- Build the config exports.config = @@ -102,6 +79,8 @@ exports.config = #- test, demo libraries 'javascripts/test-app.js': regJoin('^test/app/') 'javascripts/demo-app.js': regJoin('^test/demo/') + + #- More output files are generated at the below order: before: [ @@ -180,11 +159,31 @@ exports.config = defn = if path in needHeaders then commonjsHeader else '' return defn + +#- Find all .coffee and .jade files in /app + +dirStack = ['./app'] +coffeeFiles = [] +jadeFiles = [] + +while dirStack.length + dir = dirStack.pop() + contents = fs.readdirSync(dir) + for file in contents + fullPath = "#{dir}/#{file}" + stat = fs.statSync(fullPath) + if stat.isDirectory() + dirStack.push(fullPath) + else + if _.str.endsWith(file, '.coffee') + coffeeFiles.push(fullPath) + else if _.str.endsWith(file, '.jade') + jadeFiles.push(fullPath) + for file in coffeeFiles inputFile = file.replace('./app', 'app') outputFile = file.replace('.coffee', '.js').replace('./app', 'javascripts/app') exports.config.files.javascripts.joinTo[outputFile] = inputFile - console.log 'output file?', outputFile numBundles = 0 @@ -199,7 +198,6 @@ for file in jadeFiles possibleViewFilePath = outputFile.replace(templateFileName, viewFileName).replace('/templates/', '/views/') if exports.config.files.javascripts.joinTo[possibleViewFilePath] exports.config.files.templates.joinTo[possibleViewFilePath] = inputFile - console.log 'bundling', inputFile, 'to', possibleViewFilePath numBundles += 1 -console.log 'Bundled', numBundles, 'templates with their views.' \ No newline at end of file +console.log "Got #{coffeeFiles.length} coffee files and #{jadeFiles.length} jade files (bundled #{numBundles} of them together)." \ No newline at end of file