Skip to content
This repository has been archived by the owner on Jan 25, 2021. It is now read-only.

Commit

Permalink
Merged develop
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagoporto committed Nov 6, 2016
2 parents cf3c31b + 07be52c commit ad1e42b
Show file tree
Hide file tree
Showing 52 changed files with 501 additions and 460 deletions.
5 changes: 1 addition & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@

"globals": {
// additional predefined global variables
"angular": true,
"ga": true,
"outdatedBrowser": true
},

"plugins": [
Expand Down Expand Up @@ -224,7 +221,7 @@
"quotes": ["error", "single", {"avoidEscape": true, "allowTemplateLiterals": true}], // specify whether double or single quotes should be used
"semi-spacing": ["error", {"before": false, "after": true}], // enforce spacing before and after semicolons
"semi": ["error", "always", { "omitLastInOneLineBlock": true}], // require or disallow use of semicolons instead of ASI
"sort-vars": ["warn", { "ignoreCase": true }], // sort variables within the same declaration block (off by default)
"sort-vars": "off", // sort variables within the same declaration block (off by default)
"space-before-blocks": ["error", "always"], // require or disallow space before blocks (off by default)
"space-before-function-paren": ["error", "never"], // require or disallow space before function opening parenthesis (off by default)
"space-in-parens": ["warn", "never"], // require or disallow spaces inside parentheses (off by default)
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [0.6.0beta] - 2016-11-06
### Added
- Config to clean paths
- Option to `.travis.yml` file
- Option to `.npmignore` file
- Set `package.json` repository
- Set `bower.json` keywords, author, repository and ignore files

### Fixed
- Title in handlebars
- Set dynamically outdatedBrowser in `.eslintrc`

### Changed
- karma-chrome-launcher to karma-phantomjs-launcher
- Turned off `sort-vars` in eslint

### Removed
- Background from <body> in `styl` files

## [0.5.0beta] - 2016-10-16
### Fixed
- Set Author url in `package.json`
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
<small>Generator Dependencies</small>

[![Dependencies Status](https://david-dm.org/tiagoporto/generator-swill-boilerplate.svg)](https://david-dm.org/tiagoporto/generator-swill-boilerplate)
[![devDependencies Status](https://david-dm.org/tiagoporto/generator-swill-boilerplate/dev-status.svg)](https://david-dm.org/tiagoporto/generator-swill-boilerplate#info=devDependencies)
[![devDependencies Status](https://david-dm.org/tiagoporto/generator-swill-boilerplate/dev-status.svg)](https://david-dm.org/tiagoporto/generator-swill-boilerplate?type=dev)

<small>Swill Boilerplate Dependencies</small>

[![boilerplate devDependencies Status](https://david-dm.org/tiagoporto/swillboilerplate.rocks/dev-status.svg)](https://david-dm.org/tiagoporto/swillboilerplate.rocks#info=devDependencies)
[![boilerplate devDependencies Status](https://david-dm.org/tiagoporto/swillboilerplate.rocks/dev-status.svg)](https://david-dm.org/tiagoporto/swillboilerplate.rocks?type=dev)


<p align="center">
Expand Down
33 changes: 29 additions & 4 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ module.exports = yeoman.Base.extend({
this.prompts = props;
this.props = {};

this.props.githubUser = (props.githubUser) ? props.githubUser : '{Github User}';

this.props.project = {
name: (props.projectName) ? _s.clean(props.projectName) : '{Project Name}',
cleanName: (props.projectName) ? _s.clean(props.projectName) : 'project-name',
Expand All @@ -220,7 +222,8 @@ module.exports = yeoman.Base.extend({
joinedKeywords: props.keywords && props.keywords.join()
};

this.props.githubUser = (props.githubUser) ? props.githubUser : '{Github User}';
this.props.project.repository = 'https://github.com/' + this.props.githubUser + '/' + this.props.project.sanitizeName + '.git';


this.props.author = {
name: _s.clean(props.authorName),
Expand Down Expand Up @@ -280,7 +283,9 @@ module.exports = yeoman.Base.extend({
firefox: props.files.indexOf('manifestWebapp') >= 0
},
robots: props.files.indexOf('robots') >= 0,
humans: props.files.indexOf('humans') >= 0
humans: props.files.indexOf('humans') >= 0,
travis: props.files.indexOf('travis') >= 0,
npmignore: props.files.indexOf('npmignore') >= 0
};
}.bind(this));
},
Expand All @@ -302,6 +307,7 @@ module.exports = yeoman.Base.extend({
packageJson.keywords = this.props.project.keywords;
packageJson.author.name = this.props.author.name;
packageJson.author.url = this.props.author.homepage;
packageJson.repository.url = this.props.project.repository;

(this.props.preprocessor.name === 'sass') && (packageJson.devDependencies['gulp-sass'] = '2.3.2');
(this.props.preprocessor.name === 'stylus') && (packageJson.devDependencies['gulp-stylus'] = '2.5.0');
Expand Down Expand Up @@ -510,6 +516,22 @@ module.exports = yeoman.Base.extend({
);
}

if (this.props.include.travis) {
this.fs.copy(
this.templatePath('travis.yml'),
this.destinationPath('.travis.yml')
);
}

if (this.props.include.npmignore) {
this.fs.copyTpl(
this.templatePath('npmignore'),
this.destinationPath('.npmignore'), {
folder: this.props.folder
}
);
}

if (this.props.include.crossdomain) {
this.fs.copy(
this.templatePath('public/crossdomain.xml'),
Expand Down Expand Up @@ -551,8 +573,11 @@ module.exports = yeoman.Base.extend({
bowerJson.name = this.props.project.sanitizeName;
bowerJson.description = this.props.project.description;
bowerJson.homepage = this.props.project.homepage;
bowerJson.author.name = this.props.author.name;
bowerJson.author.homepage = this.props.author.homepage;
bowerJson.keywords = this.props.project.keywords;
bowerJson.authors[0].name = this.props.author.name;
bowerJson.authors[0].homepage = this.props.author.homepage;
bowerJson.repository.url = this.props.project.repository;
bowerJson.ignore.push('!' + this.props.folder.dest + '/**/*');

this.fs.writeJSON(this.destinationPath('bower.json'), bowerJson);
}
Expand Down
12 changes: 10 additions & 2 deletions app/optional-files.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,21 @@
"value": "404",
"checked": false
}, {
"name": ".htaccess (Apache Server Configs)",
"value": "htaccess",
"name": ".travis.yml (Travis CI)",
"value": "travis",
"checked": false
}, {
"name": ".npmignore",
"value": "npmignore",
"checked": false
}, {
"name": "bower.json",
"value": "bower",
"checked": false
}, {
"name": ".htaccess (Apache Server Configs)",
"value": "htaccess",
"checked": false
}, {
"name": "crossdomain.xml (Cross-domain policy)",
"value": "crossdomain",
Expand Down
3 changes: 2 additions & 1 deletion app/templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
* [Dependencies](#dependencies)
* [Installation](#installation)
* [Running](#running)
* [Contributing](#contributing)
* [Credits](#credits)
* [License](license)
* [License](#license)

## Features

Expand Down
31 changes: 13 additions & 18 deletions app/templates/_bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,26 @@
"name": "",
"description": "",
"homepage": "",
"author": {
"name": "",
"homepage": ""
},
"keywords": [
],
"authors": [
{
"name": "",
"homepage": ""
}
],
"repository": {
"type": "git",
"url": ""
},
"keywords": [
],
"main": "",
"moduleType": [
"amd",
"es6",
"globals",
"node"
],
"license": "MIT",
"main": [""],
"ignore": [
"**/*",
"!CHANGELOG.md",
"!LICENSE.md",
"!dist/**/*",
"!LICENSE",
"!README.md"
],
"dependencies": { },
"devDependencies": { }
"dependencies": {},
"devDependencies": {},
"license": ""
}
3 changes: 2 additions & 1 deletion app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"url": ""
},
"scripts": {},
"main": "",
"files": [],
"dependencies": {},
"devDependencies": {
Expand Down Expand Up @@ -50,7 +51,7 @@
"gulp.spritesmith": "6.2.1",
"jasmine-core": "2.5.2",
"karma": "1.3.0",
"karma-chrome-launcher": "2.0.0",
"karma-phantomjs-launcher": "1.0.2",
"karma-coverage": "1.1.1",
"karma-jasmine": "1.0.2",
"merge-stream": "1.0.0",
Expand Down
6 changes: 6 additions & 0 deletions app/templates/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
"styles": {
"src": "<%= folder.styles.src %>/",
"dest": "<%= folder.styles.dest %>/"
},

"clean": {
"ignore": [
"!<%= folder.dest %>/<%= folder.images.dest %>/{copyright,logos}{,**/*{,**/*}}"
]
}
},

Expand Down
7 changes: 3 additions & 4 deletions app/templates/eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@

"globals": {
// additional predefined global variables
"angular": true,
"ga": true,
"outdatedBrowser": true
"ga": true<% if (use.outdatedBrowser) { %>,
"outdatedBrowser": true<% } %>
},

"plugins": [
Expand Down Expand Up @@ -224,7 +223,7 @@
"quotes": ["error", "single", {"avoidEscape": true, "allowTemplateLiterals": true}], // specify whether double or single quotes should be used
"semi-spacing": ["error", {"before": false, "after": true}], // enforce spacing before and after semicolons
"semi": ["error", "always", { "omitLastInOneLineBlock": true}], // require or disallow use of semicolons instead of ASI
"sort-vars": ["warn", { "ignoreCase": true }], // sort variables within the same declaration block (off by default)
"sort-vars": "off", // sort variables within the same declaration block (off by default)
"space-before-blocks": ["error", "always"], // require or disallow space before blocks (off by default)
"space-before-function-paren": ["error", "never"], // require or disallow space before function opening parenthesis (off by default)
"space-in-parens": ["warn", "never"], // require or disallow spaces inside parentheses (off by default)
Expand Down
10 changes: 5 additions & 5 deletions app/templates/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,15 +373,15 @@ gulp.task('combine-assets', function() {

// Clean Directories
gulp.task('clean', function(cb) {
return del([
var cleanPaths = [
basePaths.build,
paths.styles.dest,
paths.scripts.dest,
paths.styles.src + 'helpers/{_bitmap-sprite,_vetor-sprite}.{styl,scss}',
paths.images.dest + '**/*',
// Add here the folders that will not be deleted in app/img
'!' + paths.images.dest + '{copyright,logos}{,**/*{,**/*}}'
], cb);
paths.images.dest + '**/*'
];

return del(cleanPaths.concat(basePaths.clean.ignore), cb);
});

// ***************************** Main Tasks ******************************* //
Expand Down
17 changes: 4 additions & 13 deletions app/templates/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,17 @@ module.exports = function(config) {

// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Chrome'],

customLaunchers: {
/*eslint-disable */
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},
browsers: ['PhantomJS'],

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false
};

if(process.env.TRAVIS){
configuration.browsers = ['Chrome_travis_ci'],
if (process.env.TRAVIS) {
configuration.coverageReporter = {
type : 'lcov',
dir : 'coverage/'
type: 'lcov',
dir: 'coverage/'
},
configuration.singleRun = true;
}
Expand Down
8 changes: 4 additions & 4 deletions app/templates/npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
.eslintrc
.gitattributes
.travis.yml
.yo-rc.json

bower.json
config.json
gulpfile.js
karma.conf.js
yarn.lock

.publish/
build/
coverage/
dist/bower_components/
<%= folder.build %>/
spec/
src/
tasks/
<%= folder.src %>/
2 changes: 1 addition & 1 deletion app/templates/src/handlebars/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
keywords=""
lang=""
}}
<h1>Not found <span>:(</span></h1>
<h1>Page Not Found <span>:(</span></h1>
<p>Sorry, but the page you were trying to view does not exist.</p>
<p>It looks like this was the result of either:</p>
{{/header}}
6 changes: 3 additions & 3 deletions app/templates/src/handlebars/includes/header.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
<!-- Add to homescreen for Safari on iOS -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="{{title}}">
<meta name="apple-mobile-web-app-title" content="{{#if title}}{{title}}{{else}}{-}{{/if}}">
<link rel="apple-touch-icon" href="apple-touch-icon.png">

<!-- Tile icon for Win8 -->
<meta name="application-name" content="{{title}}"/>
<meta name="application-name" content="{{#if title}}{{title}}{{else}}{-}{{/if}}"/>
<meta name="msapplication-TileColor" content="{-}"/>
<meta name="msapplication-square70x70logo" content="img/touch/tile.png"/>
<meta name="msapplication-square150x150logo" content="img/touch/tile.png"/>
Expand All @@ -53,6 +53,6 @@
<div id="outdated"></div>
<!-- ============================================ --><% } %>

{{> @partial-block }}
{{> @partial-block }}

{{> footer}}
9 changes: 5 additions & 4 deletions app/templates/src/header-comments.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*! <%= project.name %> v0.1.0
* <%= project.homepage %>
* Copyright (c) initialyear-atualyear <%= author.name %> (<%= author.homepage %>)
* Released under the MIT license
/*!
* <%= project.name %> v0.1.0
* <%= project.homepage %>
* Copyright (c) initialyear-atualyear <%= author.name %> (<%= author.homepage %>)
* Released under the MIT license
*/
Loading

0 comments on commit ad1e42b

Please sign in to comment.