Skip to content

Commit

Permalink
Documentation for defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
carloshpds committed Dec 13, 2015
1 parent 9a5ab1a commit 049177e
Showing 1 changed file with 164 additions and 15 deletions.
179 changes: 164 additions & 15 deletions dist/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ module.exports = function(){

};


/*
==========================
wiredep
==========================
*/
defaultOptions.wiredep.src = defaultOptions.tmp + '/serve/index.html'

/*
Expand Down Expand Up @@ -79,75 +85,218 @@ module.exports = function(){
modules
==========================
*/


/*
Basebuild works with modules. There is one module for each feature,
Built-in modules: {
utils : {}
build : {}
e2eTest : {}
inject : {}
proxy : {}
scripts : {}
styles : {}
unitTests : {}
watch : {}
server : {}
docs : {}
sonar : {}
}
*/
defaultOptions.modulesData = {
/*
moduleExample: {
*** Basic built-in property ***
defaultValue : 'path/script.js'
*** Common options between modules ***
uses : 'path/script.js'
notStart : true || false,
notLogOnStart : true || false,
isDefault : true || false,
isExternal : true || false
}
*/



/*
utils Module
Access to general utilities of basebuild
*/
utils : {
defaultValue : './utils.js' ,
notLogOnStart: true
},

utils : { defaultValue : './utils.js' , notLogOnStart: true },

build : { defaultValue : './build.js' },
/*
build module
Responsible for production version of the project.
*/
build: {
defaultValue : './build.js'
},

e2eTest : { defaultValue : './e2e-tests.js' },

inject : { defaultValue : './inject.js' },
/*
e2eTest module
Works in e2e tests.
*/
e2eTest: {
defaultValue : './e2e-tests.js'
},


/*
inject module
Injects scripts and stylesheets automatically in index.html.
*/
inject: {
defaultValue : './inject.js'
},


proxy : {
/*
proxy module
Proxy settings for server module (browser-sync + http-proxy)
*/
proxy: {
defaultValue : './proxy.js',

// Specifies the proxy target (server address)
target : 'http://localhost:8080',

// All Requests are tested with a regex to prevent the proxy when it's considered true
regexNext : /\.(html|css|js|png|jpg|jpeg|gif|ico|xml|rss|txt|eot|svg|ttf|woff|woff2|cur|json)(\?((r|v|rel|rev)=[\-\.\w]*)?)?$/
},

scripts : {

/*
scripts module
Works with CoffeeScript and Javascript files
*/
scripts: {
defaultValue : './scripts.js',

// Pattern for scripts only present on development phase
devScripts: [
defaultOptions.tmp + '/serve/app/**/*.dev*.js',
],

// Pattern for scripts only present on production phase
prodScripts: [
defaultOptions.tmp + '/serve/app/**/*.prod*.js'
]
},

styles : { defaultValue : './styles.js' },

unitTests : {
/*
styles module
Works with SASS (*.scss) files
*/
styles: {
defaultValue : './styles.js'
},


/*
unitTests module
Works in unit tests for scripts (CoffeeScripts and Javascript)
*/
unitTests: {
defaultValue : './unit-tests.js',

// Pattern for additional dependencies that must be injected in tests
addDeps : [],

// Karma settings for "test" task
testConfig : {

// Run the tests only one single time
singleRun : true,

browsers : ['Chrome']
},

// Karma settings for "test:auto" task
testAutoConfig : {

// Run the tests and wait for changes to run it again
singleRun : false,

browsers : ['Chrome']
}
},

watch : { defaultValue : './watch.js' },

/*
watch module
Wait for changes in files to react with some callback
*/
watch: {
defaultValue : './watch.js'
},


/*
watch module
Serves the project files
*/
server : {
defaultValue : './server.js',

// Creates routes to access files
routes : {
'/bower_components': 'bower_components'
},
},

gulp : { defaultValue : 'gulp' , notStart: true, isExternal: true},

/*
External module which will be the reference for gulp
*/
gulp: {
defaultValue : 'gulp' ,
notStart: true,
isExternal: true
},


/*
External module which will be the reference for karma
*/
karma : {
defaultValue : 'karma' ,
notStart : true,
configFile : 'karma.conf.js',
isExternal : true
},


/*
docs module
Generate documentation for source code
*/
docs: {
defaultValue : './docs.js',

// Pattern for source code files
files : [
defaultOptions.src + '/**/*.coffee',
defaultOptions.src + '/**/*.scss',
],

// Output folder
out: 'docs'
},

/*
sonar module
Sends coverage report to sonarqube
*/
sonar: {
defaultValue : './sonar.js',
login : null,
Expand All @@ -171,13 +320,13 @@ module.exports = function(){
}
}
}
}
};

// deprecated for a while
defaultOptions.modules = {};

defaultOptions.modules = {
// deprecated
}

// Common initial properties
for(key in defaultOptions.modulesData){
defaultOptions.modulesData[key].isDefault = true;
defaultOptions.modulesData[key].isEnabled = true;
Expand Down

0 comments on commit 049177e

Please sign in to comment.