Skip to content

Commit

Permalink
Merge branch 'release/1.0.0-rc.17'
Browse files Browse the repository at this point in the history
  • Loading branch information
Gery Hirschfeld committed Jun 5, 2015
2 parents 08af7c1 + 6d9108f commit 38713a1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 23 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.0.0-rc.17 / 2015-06-05
==================

* Release 1.0.0-rc.17
* Fixed .gitignore at the app generator

1.0.0-rc.16 / 2015-06-05
==================

Expand Down
48 changes: 26 additions & 22 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,22 @@ var HirschGenerator = yeoman.generators.Base.extend({
});

prompts.push({
name: 'author',
name: 'author',
message: 'Who is the author?'
});

prompts.push({
type: 'confirm',
name: 'useTypescript',
type: 'confirm',
name: 'useTypescript',
message: 'Do you want to use TypeScript?',
default: false
});

prompts.push({
when: function (props) {
when: function (props) {
return props.useTypescript;
},
name: 'typingsPath',
name: 'typingsPath',
message: 'Where do you want to store the type definitions (path relative to root)?',
default: 'typings'
});
Expand All @@ -99,12 +99,12 @@ var HirschGenerator = yeoman.generators.Base.extend({
},

/**
* INIT
* Declare some helper functions
*/
init: function() {
* INIT
* Declare some helper functions
*/
init: function () {
var _this = this;
var copyBase = function(copyFunc) {
var copyBase = function (copyFunc) {
var rest = Array.prototype.slice.call(arguments, 1);
return function () {
var args = Array.prototype.slice.call(arguments);
Expand All @@ -119,23 +119,27 @@ var HirschGenerator = yeoman.generators.Base.extend({

var srcSegs = tgtSegs.map(function (s) {
var replaces = [
{ p: /^app$/, r: 'app-ts' },
{ p: /^app\//, r: 'app-ts/' },
{ p: /^test$/, r: 'test-ts' },
{ p: /^test\//, r: 'test-ts/' }
{p: /^app$/, r: 'app-ts'},
{p: /^app\//, r: 'app-ts/'},
{p: /^test$/, r: 'test-ts'},
{p: /^test\//, r: 'test-ts/'}
];

var copiesScripts = args.some(function(s) {
var copiesScripts = args.some(function (s) {
return /\.js$/.test(s);
});

return _this.useTypescript && copiesScripts
? replaces.reduce(function (prev, curr) { return prev.replace(curr.p, curr.r); }, s)
? replaces.reduce(function (prev, curr) {
return prev.replace(curr.p, curr.r);
}, s)
: s;
}).map(function (s) { return s.replace(/!$/, ''); });
}).map(function (s) {
return s.replace(/!$/, '');
});

// filter out globs from target path
tgtSegs = tgtSegs.filter(function(s) {
tgtSegs = tgtSegs.filter(function (s) {
return s.indexOf('*') < 0 && !/!$/.test(s);
});

Expand All @@ -144,7 +148,7 @@ var HirschGenerator = yeoman.generators.Base.extend({
console.log(srcPath + ' -> ' + tgtPath);
copyFunc.apply(null, [_this.templatePath(srcPath), _this.destinationPath(tgtPath)].concat(newRest));
};
}
};

this.copyFile = copyBase(this.fs.copy.bind(this.fs));
this.copyTpl = copyBase(this.fs.copyTpl.bind(this.fs), this.projectConfig);
Expand Down Expand Up @@ -208,7 +212,7 @@ var HirschGenerator = yeoman.generators.Base.extend({
projectfiles: function () {
this.copy('_project.config.js', 'project.config.js');
this.copy('_editorconfig', '.editorconfig');
this.copy('_gitignore', '.gitignore');
this.template('_gitignore', '.gitignore', this.projectConfig);

if (this.projectConfig.prompts.useTypescript) {
this.fs.copyTpl(this.templatePath('_tsd.json'), this.destinationPath('tsd.json'), this.projectConfig);
Expand Down Expand Up @@ -257,7 +261,7 @@ var HirschGenerator = yeoman.generators.Base.extend({
},

runNpm: function () {
this.npmInstall();
this.npmInstall();
this.bowerInstall();
},

Expand All @@ -277,7 +281,7 @@ var HirschGenerator = yeoman.generators.Base.extend({
this.emit('tsdReinstall:end');
done();
}.bind(this));
}.bind(this), { once: 'tsd reinstall', run: false });
}.bind(this), {once: 'tsd reinstall', run: false});
}
},

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "generator-hirsch",
"version": "1.0.0-rc.16",
"version": "1.0.0-rc.17",
"description": "Yeoman generator for large module-based AngularJS applications with the option to use typescript",
"license": "MIT",
"main": "app/index.js",
Expand Down

0 comments on commit 38713a1

Please sign in to comment.