Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 89 additions & 43 deletions generators/app/index.js
Original file line number Diff line number Diff line change
@@ -1,58 +1,104 @@
'use strict';
var yeoman = require('yeoman-generator');

var Generator = require('yeoman-generator');
var chalk = require('chalk');
var yosay = require('yosay');
var string = require('underscore.string');

module.exports = yeoman.Base.extend({
prompting: function () {
this.log(['\n',
chalk.yellow(' ## ## ##### ## ## ## ## ####### ####### ##### ##### ## ##'),
chalk.yellow('### ### ####### ### ## ## ## ####### ####### ###### ####### ## ##'),
chalk.yellow('#### ### ## ## ### ## ## ## ## ## ## ## ## ## ## ##'),
chalk.yellow('#### #### ## ## #### ## #### ## ## ## ## ## ## ## ##'),
chalk.yellow('## #### ## ## ## ## ## ## #### ###### ###### #### ###### ## ## ####'),
chalk.yellow('## ## ## ## ## ## ## ## ##### ###### ###### #### ###### ## ## ##'),
chalk.yellow('## ## ## ## ## ## #### ## ### ## ## ## ## ## ## ##'),
chalk.yellow('## ## ## ## ## ### ## ## ## ## ## ## ## ## ##'),
chalk.yellow('## ## ####### ## ### ## ## ####### ####### ####### ####### ##'),
chalk.yellow('## ## ##### ## ## ## ### ####### ####### ###### ##### ##')].join('\n')
);
var remote = require('yeoman-remote');
var s = require("underscore.string");
var mkdirp = require('mkdirp');

module.exports = class extends Generator {
constructor(args, opts) {
// Calling the super constructor is important so our generator is correctly set up
super(args, opts);

// Next, add your custom code
this.option('babel'); // This method adds support for a `--babel` flag
}
async prompting() {
const self = this;

self.log(['\n',
chalk.yellow(' ## ## ##### ## ## ## ## ####### ####### ##### ##### ## ##'),
chalk.yellow('### ### ####### ### ## ## ## ####### ####### ###### ####### ## ##'),
chalk.yellow('#### ### ## ## ### ## ## ## ## ## ## ## ## ## ## ##'),
chalk.yellow('#### #### ## ## #### ## #### ## ## ## ## ## ## ## ##'),
chalk.yellow('## #### ## ## ## ## ## ## #### ###### ###### #### ###### ## ## ####'),
chalk.yellow('## ## ## ## ## ## ## ## ##### ###### ###### #### ###### ## ## ##'),
chalk.yellow('## ## ## ## ## ## #### ## ### ## ## ## ## ## ## ##'),
chalk.yellow('## ## ## ## ## ### ## ## ## ## ## ## ## ## ##'),
chalk.yellow('## ## ####### ## ### ## ## ####### ####### ####### ####### ##'),
chalk.yellow('## ## ##### ## ## ## ### ####### ####### ###### ##### ##')].join('\n')
);

// Have Yeoman greet the user.
this.log(yosay(
self.log(yosay(
'Welcome to the ' + chalk.green('MBoy Gulp') + ' v1.0 generator!'
));

this.log('I am going to generate the default Monkee-Boy gulp setup. Reference https://github.com/Monkee-Boy/gulpfile for more details.\n\nFirst a couple of quick questions.\n');
self.log('I am going to generate the default Monkee-Boy gulp setup. Reference https://github.com/Monkee-Boy/gulpfile for more details.\n\nFirst a couple of quick questions.\n');

this.remote('Monkee-Boy', 'gulpfile', function (err, remote) {
remote.directory('.', '.');
});
// remote('Monkee-Boy', 'gulpfile', function (err, remote) {
// remote.directory('.', '.');
// });

var prompts = [
{
name: 'projectName',
message: 'What would you like to call this project (typically client name)?',
default: 'Project Name'
}, {
name: 'repoUrl',
message: 'What is the git repo url for this project?',
default: '[email protected]:monkeeboy/PROJECTREPONAME.git'
}
];
// var prompts = [
// {
// name: 'projectName',
// message: 'What would you like to call this project (typically client name)?',
// default: 'Project Name'
// }, {
// name: 'repoUrl',
// message: 'What is the git repo url for this project?',
// default: '[email protected]:monkeeboy/PROJECTREPONAME.git'
// }
// ];

return this.prompt(prompts).then(function (props) {
this.props = props;
this.props.projectName = string.slugify(props.projectName);
}.bind(this));
},
self.answers = await self.prompt([{
type: 'input',
name: 'projectName',
message: 'What would you like to call this project (typically client name)?',
}, {
type: 'input',
name: 'repoUrl',
message: 'What is the git repo url for this project?',
default: '[email protected]:monkeeboy/PROJECTREPONAME.git'
}]);

writing: function () {
// this.template('package.json', 'package.json');
},
}

writing() {
const self = this;

// Copy and fill in package.json
self.fs.copyTpl(self.templatePath('package.json'), self.destinationPath('package.json'),
{
projectName: self.answers.projectName,
repoUrl: self.answers.repoUrl
}
);

install: function () {
// Copy gulpfile and gulp-related files and folders
self.fs.copy(self.templatePath('gulpfile.js'), self.destinationPath('gulpfile.js'));
self.fs.copy(self.templatePath('gulp'), self.destinationPath('gulp'));
self.fs.copy(self.templatePath('css'), self.destinationPath('css'));
self.fs.copy(self.templatePath('js'), self.destinationPath('js'));

// Have to make images because they're initially empty
mkdirp.sync(this.destinationPath('images/src'));
mkdirp.sync(this.destinationPath('images/dist'));

self.fs.copy(self.templatePath('.jshintrc'), self.destinationPath('.jshintrc'));

}

install() {
this.installDependencies({
yarn: true,
bower: false,
npm: false,
});
this.log('\nYour gulp files and structure are ready.\n' + chalk.green('May the code be with you.'));
}
});

}
8 changes: 8 additions & 0 deletions generators/app/templates/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"curly": true,
"sub": true,
"undef": true,
"eqeqeq": true,
"strict": true,
"esversion": 6
}
2 changes: 2 additions & 0 deletions generators/app/templates/css/dist/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions generators/app/templates/css/dist/style.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions generators/app/templates/css/src/_components.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* Components */

@import "_components/_header.css";
@import "_components/_content.css";
@import "_components/_footer.css";
1 change: 1 addition & 0 deletions generators/app/templates/css/src/_components/_content.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* Content */
1 change: 1 addition & 0 deletions generators/app/templates/css/src/_components/_footer.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* Footer */
1 change: 1 addition & 0 deletions generators/app/templates/css/src/_components/_header.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* Header */
1 change: 1 addition & 0 deletions generators/app/templates/css/src/_layout.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* Layout */
1 change: 1 addition & 0 deletions generators/app/templates/css/src/_typography.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* Typography */
9 changes: 9 additions & 0 deletions generators/app/templates/css/src/maps/bp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
large-desktop: 1320px
desktop: 1220px
small-desktop: 1100px
tablet: 1024px
mobile: 768px
mobile-forms: 640px
small: 600px
tiny: 430px
very-small: 360px
Loading