This repository has been archived by the owner on Jan 24, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I now have the bundle, client library and the component mechanisms wo…
…rking and usable
- Loading branch information
Westrate, Benjamin
authored and
Westrate, Benjamin
committed
May 25, 2016
1 parent
15c64e5
commit 24951a2
Showing
13 changed files
with
187 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,42 @@ | ||
var shell = require( 'shelljs' ); | ||
var rc = require( 'rc' ); | ||
var inquirer = require( 'inquirer' ); | ||
var fs = require( 'fs' ); | ||
|
||
var getTemplates = require( '../utils/getTemplates' ); | ||
var utils = require( '../utils' ); | ||
var makeClientLib = require( './create-clientlib' ); | ||
|
||
module.exports = function( programs ){ | ||
module.exports = function( program ){ | ||
|
||
var templates = getTemplates(); | ||
//make sure we are in the project iron build folder | ||
utils.pathToProjectRoot(); | ||
var givenBundleName = false; | ||
|
||
// TODO : build out a new bundle | ||
if( program.clientlib !== true && program.clientlib !== false ){ | ||
givenBundleName = program.clientlib; | ||
} | ||
|
||
var ironRc = rc( 'iron' ); | ||
var templates = utils.get.templates(); | ||
var bundlePath = ''; | ||
var bundleInfo = { | ||
bundle_name : givenBundleName ? givenBundleName : program.bundle | ||
}; | ||
|
||
console.log(templates); | ||
shell.mkdir( 'aem-bundles/' + bundleInfo.bundle_name ); | ||
shell.mkdir( 'aem-bundles/' + bundleInfo.bundle_name + '/styles' ); | ||
shell.cd( 'aem-bundles/' + bundleInfo.bundle_name ); | ||
|
||
bundlePath = shell.pwd().stdout; | ||
|
||
bundleInfo.bundle_name = bundleInfo.bundle_name | ||
bundleInfo.clientLibPath = '../' + ironRc.clinetlib_root + '/' + bundleInfo.bundle_name; | ||
bundleInfo.components = [ ]; | ||
|
||
utils.templateRenderer( bundlePath + '/' + bundleInfo.bundle_name + '.js', templates.bundles.mainJs.value, bundleInfo ) | ||
utils.templateRenderer( bundlePath + '/styles/' + bundleInfo.bundle_name + '.scss', templates.bundles.mainScss.value, bundleInfo ) | ||
utils.templateRenderer( bundlePath + '/config.json', templates.bundles.bundleConfig.value, bundleInfo ) | ||
utils.templateRenderer( bundlePath + '/' + bundleInfo.bundle_name + '.components.js', templates.bundles.componentReferance.value, bundleInfo ) | ||
utils.templateRenderer( bundlePath + '/styles/' + bundleInfo.bundle_name + '.components.scss', templates.bundles.componentReferanceCss.value, bundleInfo ) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,41 @@ | ||
var shell = require( 'shelljs' ); | ||
var rc = require( 'rc' ); | ||
var inquirer = require( 'inquirer' ); | ||
var fs = require( 'fs' ); | ||
|
||
var utils = require( '../utils' ); | ||
var makeClientLib = require( './create-clientlib' ); | ||
|
||
module.exports = function( program ){ | ||
|
||
module.exports = function(){ | ||
//make sure we are in the project iron build folder | ||
utils.pathToProjectRoot(); | ||
|
||
|
||
shell.cd( '..' ); | ||
|
||
var givenLibName = false; | ||
|
||
if( program.bundle !== true && program.bundle !== false ){ | ||
givenLibName = program.bundle; | ||
} | ||
|
||
var ironRc = rc( 'iron' ); | ||
var templates = utils.get.templates(); | ||
var libPath = ''; | ||
var libInfo = { | ||
clientlib_name : givenLibName ? givenLibName : program.clinetlib | ||
}; | ||
|
||
libInfo.clientlib_category = ironRc.clientlib_base_category + '.' + libInfo.clientlib_name, | ||
libInfo.clientlib_path = './' + ironRc.clinetlib_root + '/' + libInfo.clientlib_name | ||
|
||
shell.mkdir( libInfo.clientlib_path ); | ||
shell.mkdir( libInfo.clientlib_path + '/js'); | ||
shell.mkdir( libInfo.clientlib_path + '/css'); | ||
shell.cd( libInfo.clientlib_path ); | ||
|
||
utils.templateRenderer( 'css.txt', templates.clientlibs.css.value, libInfo ); | ||
utils.templateRenderer( 'js.txt', templates.clientlibs.js.value, libInfo ); | ||
utils.templateRenderer( '.content.xml', templates.clientlibs.content.value, libInfo ); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,30 @@ | ||
var shell = require( 'shelljs' ); | ||
var rc = require( 'rc' ); | ||
var inquirer = require( 'inquirer' ); | ||
var fs = require( 'fs' ); | ||
|
||
var utils = require( '../utils' ); | ||
var makeClientLib = require( './create-clientlib' ); | ||
|
||
module.exports = function( program ){ | ||
|
||
module.exports = function(){ | ||
//make sure we are in the project iron build folder | ||
utils.pathToProjectRoot(); | ||
|
||
console.log("Yo Broseph"); | ||
var ironRc = rc( 'iron' ); | ||
var templates = utils.get.templates(); | ||
var componentPath = ''; | ||
var componentInfo = { | ||
component_name : program.component | ||
}; | ||
|
||
shell.mkdir( 'components/' + componentInfo.component_name ); | ||
shell.mkdir( 'components/' + componentInfo.component_name + '/styles' ); | ||
shell.cd( 'components/' + componentInfo.component_name ); | ||
|
||
componentPath = shell.pwd().stdout; | ||
|
||
utils.templateRenderer( componentPath + '/' + componentInfo.component_name + '.js', templates.components.mainJS.value, componentInfo ) | ||
utils.templateRenderer( componentPath + '/styles/' + componentInfo.component_name + '.scss', templates.components.mainSCSS.value, componentInfo ) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"clientLibPath": "{{clientLibPath}}", | ||
"autoGenerate" : { | ||
"js" : true, | ||
"styles" : true | ||
}, | ||
"useGlobalComponents" : true, | ||
"components" : [ | ||
{{#each components}} | ||
"{{this}}", | ||
{{/each}} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
/** | ||
* This is the main file for {{clientlib_name}} | ||
* This is the main file for {{bundle_name}} | ||
*/ | ||
|
||
var components = require( './{{clientlib_name}}.components' ); | ||
var components = require( './{{bundle_name}}.components' ); | ||
var globalComponent = require( '../../components/global' ); | ||
|
||
globalComponent.init( components ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/** | ||
* Main css for {{clientlib_name}} | ||
* Main css for {{bundle_name}} | ||
*/ | ||
|
||
@import "{{clientlib_name}}.components"; | ||
@import "{{bundle_name}}.components"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
componentLinker : require( './component-linker' ), | ||
get : { | ||
clinetlibs : require( './getClientLibs' ), | ||
templates : require( './getTemplates' ) | ||
}, | ||
manageRC : require( './manageRC' ), | ||
pathToProjectRoot : require( './pathToProjectRoot' ), | ||
pomBuilder : require( './pom-builder' ), | ||
templateRenderer : require( './template-renderer' ) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"clientLibPath": "../project-name/src/main/content/jcr_root/etc/clientlibs/project-name/commons", | ||
"autoGenerate" : { | ||
"js" : true, | ||
"styles" : true | ||
}, | ||
"useGlobalComponents" : true, | ||
"components" : [ | ||
|
||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"name" : "GGP", | ||
"aem_clientlibs_base_path" : "ggp-ui/src/main/content/jcr_root/etc/clientlibs/ggp", | ||
"name" : "project-name", | ||
"clinetlib_root" : "project-name/src/main/content/jcr_root/etc/clientlibs/project-name", | ||
"clientlib_base_category" : "projectName", | ||
"default_components" : [], | ||
"iron_build_root" : "ggp-ui-build" | ||
} |