Skip to content

Commit

Permalink
Merge pull request #117 from kittn/develop
Browse files Browse the repository at this point in the history
Joomla Release
  • Loading branch information
Lars authored Apr 25, 2018
2 parents 9803a2f + d7de568 commit 7ab44ce
Show file tree
Hide file tree
Showing 50 changed files with 4,485 additions and 30 deletions.
20 changes: 18 additions & 2 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const addDB = require('./modules/writing/addDB')

// Install CMS
const installWordpress = require('./modules/writing/install/wordpress')
const installJoomla = require('./modules/writing/install/joomla')
const installCraft = require('./modules/writing/install/craft')

// And Action!
Expand Down Expand Up @@ -56,6 +57,7 @@ module.exports = class extends Generator {

// Copy Sources
this.installWordpress = installWordpress.bind(this)
this.installJoomla = installJoomla.bind(this)
this.installCraft = installCraft.bind(this)

// Command Checks
Expand Down Expand Up @@ -184,6 +186,7 @@ module.exports = class extends Generator {
// Install CMS
if (!this.devMode) {
this.installWordpress().install(this)
this.installJoomla().install(this)
this.installCraft().install(this)
}
}
Expand Down Expand Up @@ -256,6 +259,15 @@ module.exports = class extends Generator {
'\n';
}

if (
this.props.projectusage.substring(0, 6) === 'joomla' &&
this.commands.wget !== true
) {
goodbye +=
chalk`{cyan - Install Joomla manually in the 'dist/' directory}` +
'\n';
}

if (this.props.projectusage === 'wordpressCB') {
goodbye +=
chalk`{cyan - Copy your ACF5 Pro Plugin on 'src/structure/plugins/'}` +
Expand Down Expand Up @@ -335,7 +347,7 @@ module.exports = class extends Generator {
) {
goodbye +=
chalk`{hex('#009dff') - Log into the backend with 'kittn' / '${
this.props.projectusage.substring(0, 5) === 'craft'
this.props.projectusage.substring(0, 5) === 'craft' || this.props.projectusage.substring(0, 6) === 'joomla'
? `superkittn`
: `kittn`
}'. After login, activate theme and create a new user}` + '\n';
Expand All @@ -346,9 +358,13 @@ module.exports = class extends Generator {
chalk`{hex('#009dff') => Backend: ${
this.props.credentialdomain
}/${
this.props.projectusage.substring(0, 5) === 'craft'
this.props.projectusage.substring(0, 5) === 'craft' || this.props.projectusage.substring(0, 6) === 'joomla'
? `admin`
: `wp-admin`
}${
this.props.projectusage.substring(0, 6) === 'joomla'
? `istrator`
: ``
}}` + '\n';
}

Expand Down
94 changes: 94 additions & 0 deletions generators/app/modules/config/joomla.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
const extend = require('deep-extend')

function addJoomlaCofig (files = {}, context) {
// If Craft
if (context.props.projectusage === 'joomla') {
extend(files.pkg, {
'dist': {
'img': 'dist/images/',
'dist': 'dist/',
'plugins': 'dist/plugins/',
'base': `dist/templates/${context.props.projectname}/`,
'markup': `dist/templates/${context.props.projectname}/`,
'templates': `dist/templates/${context.props.projectname}/`,
'assets': `dist/templates/${context.props.projectname}/assets/`,
'browserSyncDir': `dist/templates/${context.props.projectname}/`,
'css': `dist/templates/${context.props.projectname}/assets/css/`,
'js': `dist/templates/${context.props.projectname}/assets/js/`,
'fonts': `dist/templates/${context.props.projectname}/assets/fonts/`,
'cssimg': `dist/templates/${context.props.projectname}/assets/img/`,
'bitmaps': `dist/templates/${context.props.projectname}/assets/img/bitmaps/`,
'vectors': `dist/templates/${context.props.projectname}/assets/img/svgfiles/`,
'contentimage': `dist/templates/${context.props.projectname}/images/`,
'webpackassets': `templates/${context.props.projectname}/assets/`,
'webpackcssassets': `templates/${context.props.projectname}/assets/css/`,
'webpackpublic': 'dist/'
},
'files': {
'launch': [
{'src': 'favicons/**', 'dest': `templates/${context.props.projectname}/assets/img/system/`},
{'src': 'facebook-og-image.jpg', 'dest': `templates/${context.props.projectname}/assets/img/system/`},
{'src': 'twitter-og-image.jpg', 'dest': `templates/${context.props.projectname}/assets/img/system/`}
]
},
'joomlafiles': [
{ 'src': 'src/structure/templates/', 'dest': 'dist/templates/' },
{ 'src': 'src/structure/plugins/', 'dest': 'dist/plugins/' },
{ 'src': 'src/structure/modules/', 'dest': 'dist/modules/' },
{ 'src': 'src/structure/administrator/', 'dest': 'dist/administrator/' },
{ 'src': 'src/structure/components/', 'dest': 'dist/components/' },
{ 'src': 'src/structure/media/', 'dest': 'dist/media/' },
{ 'src': 'src/structure/language/', 'dest': 'dist/language/' }
],
"watchjoomla": [
"src/structure/templates/**/*",
"src/structure/modules/**/**",
"src/structure/plugins/**/**",
"src/structure/components/**/**",
"src/structure/administrator/**/**",
"src/structure/media/**/**"
],
'src': {
'structure': `src/structure/templates/${context.props.projectname}/`,
'templates': `src/structure/templates/${context.props.projectname}/_critical/`
},
'minify': {
'purgeCSS': [
`src/structure/templates/${context.props.projectname}/**/*.php`,
'src/js/**/*.vue'
]
}
})
}
if (context.props.projectusage === 'joomla') {
extend(files.pkg, {
'cssabove': {
'width': '1200',
'height': '1024',
'minify': true,
'inline': false,
'url': context.props.credentialdomain !== 'undefined' ? `http://${context.props.credentialdomain}` : 'http://',
'cssfile': context.props.projectcssfilename + '.css',
'include': [
'.plj .c-progressLoader',
'.plj .c-progressLoader--complete .c-progressLoader',
'.plj .o-area__wrapper',
'.plj .is-livepreview .o-area__wrapper',
'.plj .c-progressLoader__loader',
'.plj .c-progressLoader__loader.c-progressLoader--bar--complete'
],
'ignore': [
'@font-face'
],
'sites': [
{
'url': '',
'template': 'default'
}
]
}
})
}
}

module.exports = addJoomlaCofig
15 changes: 15 additions & 0 deletions generators/app/modules/package/dependencies/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,25 @@ function addScriptDependencies (files = {}, context) {
})
}

// Webpack Bundle analyzer
if (
context.props.projectusage === 'joomla' ||
context.props.projectusage === 'joomlaCB'
) {
extend(files.pkg, {
scripts: {
'webpack:analyze': `webpack-bundle-analyzer webpack/stats.json dist/templates/${
context.props.projectname
}/assets/`
}
})
}

// Container-Queries
if (
context.props.projectcontainerqueries === true ||
context.props.projectusage === 'craftCB' ||
context.props.projectusage === 'joomlaCB' ||
context.props.projectusage === 'wordpressCB'
) {
extend(files.pkg, {
Expand Down
2 changes: 1 addition & 1 deletion generators/app/modules/package/dependencies/starterpack.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const extend = require('deep-extend')

function addStarterpackDependencies (files = {}, context) {
if (context.props.projectusage === 'wordpressCB' || context.props.projectusage === 'craftCB') {
if (context.props.projectusage === 'wordpressCB' || context.props.projectusage === 'craftCB' || context.props.projectusage === 'joomlaCB') {
extend(files.pkg, {
dependencies: {
'anchor-scroll': '^2.0.0',
Expand Down
2 changes: 1 addition & 1 deletion generators/app/modules/package/dependencies/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function addStyleDependencies (files = {}, context) {
* @method if
* @param {object} context The global context with prompts
*/
if (context.props.projectusage === 'craftCB') {
if (context.props.projectusage === 'craftCB' || context.props.projectusage === 'joomlaCB') {
extend(files.pkg, {
scripts: {
critical: 'node nodescripts/critical.js'
Expand Down
10 changes: 10 additions & 0 deletions generators/app/modules/prompt/partials/_general.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ No whitespaces or special-chars allowed!}`
{
name: 'Create a website using Wordpress and ContentBuilder',
value: 'wordpressCB'
},
{
name: 'Create a website using Joomla',
value: 'joomla'
}
],
store: true
Expand Down Expand Up @@ -99,6 +103,7 @@ No whitespaces or special-chars allowed!}`
when: function (answers) {
return (
answers.projectusage === 'craft' ||
answers.projectusage === 'joomla' ||
answers.projectusage === 'wordpress' ||
answers.projectusage === 'html'
)
Expand Down Expand Up @@ -129,6 +134,7 @@ No whitespaces or special-chars allowed!}`
when: function (answers) {
return (
answers.projectusage === 'craft' ||
answers.projectusage === 'joomla' ||
answers.projectusage === 'wordpress' ||
answers.projectusage === 'html'
)
Expand All @@ -147,6 +153,7 @@ No whitespaces or special-chars allowed!}`
when: function (answers) {
return (
answers.projectusage === 'craft' ||
answers.projectusage === 'joomla' ||
answers.projectusage === 'wordpress' ||
answers.projectusage === 'html' ||
answers.projectusage === 'webpackApp'
Expand Down Expand Up @@ -178,6 +185,7 @@ No whitespaces or special-chars allowed!}`
when: function (answers) {
return (
answers.projectusage.substring(0, 5) === 'craft' ||
answers.projectusage.substring(0, 6) === 'joomla' ||
answers.projectusage.substring(0, 4) === 'word'
)
},
Expand All @@ -203,6 +211,7 @@ No whitespaces or special-chars allowed!}`
when: function (answers) {
return (
answers.projectusage.substring(0, 5) === 'craft' ||
answers.projectusage.substring(0, 6) === 'joomla' ||
answers.projectusage.substring(0, 4) === 'word'
)
},
Expand Down Expand Up @@ -425,6 +434,7 @@ No whitespaces or special-chars allowed!}`
return (
answers.projectusage === 'craft' ||
answers.projectusage.substring(0, 4) === 'word' ||
answers.projectusage.substring(0, 6) === 'joomla' ||
answers.projectusage === 'html'
)
},
Expand Down
2 changes: 2 additions & 0 deletions generators/app/modules/writing/configJSON.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
const addBaseConfig = require('../config/base.js')
const addHTMLConfig = require('../config/html.js')
const addCraftConfig = require('../config/craft.js')
const addJoomlaConfig = require('../config/joomla.js')
const addWordpressConfig = require('../config/wordpress.js')

const writeConfigJson = () => {
Expand All @@ -19,6 +20,7 @@ const writeConfigJson = () => {
addBaseConfig({pkg}, context)
addHTMLConfig({pkg}, context)
addCraftConfig({pkg}, context)
addJoomlaConfig({pkg}, context)
addWordpressConfig({pkg}, context)

// Write package.json
Expand Down
5 changes: 5 additions & 0 deletions generators/app/modules/writing/copySources.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const script = require('./copySrc/script.js')
const projecttype = require('./copySrc/projecttype.js')
const tools = require('./copySrc/tools.js')
const starterpackCraft = require('./copySrc/starterpackCraft.js')
const starterpackJoomla = require('./copySrc/starterpackJoomla.js')
const starterpackWordpress = require('./copySrc/starterpackWordpress.js')

const copyAction = (data, context) => {
Expand Down Expand Up @@ -103,6 +104,10 @@ const copySources = () => {
const starterpackCraftConfig = starterpackCraft(context)
processConfig(starterpackCraftConfig, context)

// Starterpack Joomla
const starterpackJoomlaConfig = starterpackJoomla(context)
processConfig(starterpackJoomlaConfig, context)

// Starterpack Wordpress
const starterpackWordpressConfig = starterpackWordpress(context)
processConfig(starterpackWordpressConfig, context)
Expand Down
79 changes: 79 additions & 0 deletions generators/app/modules/writing/copySrc/projecttype.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,71 @@ const projecttype = context => {
},
src: 'contentBuilder_stuff/databases/wordpress.sql',
dest: 'database.sql'
},
{
conditions: {
projectusage: 'joomla',
projectcredential: true
},
src: 'install.sh',
dest: 'install.sh'
},
{
conditions: {
projectusage: 'joomla'
},
src: 'gulpfile_additions/copy-joomlafiles.js',
dest: 'gulpfile/tasks/copy-joomlafiles.js'
},
{
conditions: {
projectusage: 'joomla'
},
src: 'src/skeletons/joomla/_htaccess',
dest: 'dist/.htaccess'
},
{
conditions: {
projectusage: 'joomla',
projectcredential: true
},
src: 'src/skeletons/joomla/configuration-sample.php',
dest: 'dist/configuration.php'
},
{
conditions: {
projectusage: 'joomla'
},
src: 'src/skeletons/joomla/template_additions/language/de-DE/de-DE.tpl_projectname.ini',
dest: `src/structure/templates/${context.props.projectname}/language/de-DE/de-DE.tpl_${context.props.projectname}.ini`,
},
{
conditions: {
projectusage: 'joomla'
},
src: 'src/skeletons/joomla/template_additions/language/de-DE/de-DE.tpl_projectname.sys.ini',
dest: `src/structure/templates/${context.props.projectname}/language/de-DE/de-DE.tpl_${context.props.projectname}.sys.ini`,
},
{
conditions: {
projectusage: 'joomla'
},
src: 'src/skeletons/joomla/template_additions/language/en-GB/en-GB.tpl_projectname.ini',
dest: `src/structure/templates/${context.props.projectname}/language/en-GB/en-GB.tpl_${context.props.projectname}.ini`,
},
{
conditions: {
projectusage: 'joomla'
},
src: 'src/skeletons/joomla/template_additions/language/en-GB/en-GB.tpl_projectname.sys.ini',
dest: `src/structure/templates/${context.props.projectname}/language/en-GB/en-GB.tpl_${context.props.projectname}.sys.ini`,
},
{
conditions: {
projectusage: 'joomla'
},
src: 'contentBuilder_stuff/databases/joomla.sql',
dest: 'database.sql'
}
],
folders: [
Expand Down Expand Up @@ -193,6 +258,20 @@ const projecttype = context => {
src: 'src/skeletons/wordpress/structure/templates',
dest: 'src/structure/templates/'
},
{
conditions: {
projectusage: 'joomla'
},
src: 'src/skeletons/joomla/structure/templates',
dest: `src/structure/templates/${context.props.projectname}/`
},
{
conditions: {
projectusage: 'joomla'
},
src: 'src/skeletons/joomla/structure/plugins',
dest: 'src/structure/plugins/'
},
{
orConditions: [
{
Expand Down
Loading

0 comments on commit 7ab44ce

Please sign in to comment.