Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: yeoman/generator
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3a41fa08d372c6d44da03436160a888a32b6f29e
Choose a base ref
...
head repository: yeoman/generator
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dc473849edd2fa4fde5cf0cb80b60a4a8602fdc3
Choose a head ref

Commits on May 1, 2016

  1. Bump some dependencies

    SBoudrias committed May 1, 2016
    Copy the full SHA
    3272f44 View commit details
  2. Copy the full SHA
    ca55109 View commit details
  3. Move inquirer to devDeps

    SBoudrias committed May 1, 2016
    Copy the full SHA
    2d90140 View commit details

Commits on May 2, 2016

  1. Copy the full SHA
    4bdf621 View commit details
  2. 0.23.0

    SBoudrias committed May 2, 2016
    Copy the full SHA
    7d0aa14 View commit details

Commits on May 3, 2016

  1. Copy the full SHA
    f733835 View commit details
  2. 0.23.1

    SBoudrias committed May 3, 2016
    Copy the full SHA
    0644986 View commit details
  3. add node v6

    SBoudrias committed May 3, 2016
    Copy the full SHA
    f668360 View commit details
  4. Copy the full SHA
    bbc05cc View commit details
  5. Copy the full SHA
    b89eece View commit details
  6. 0.23.2

    SBoudrias committed May 3, 2016
    Copy the full SHA
    a55558a View commit details
  7. Copy the full SHA
    faa3e2c View commit details

Commits on May 4, 2016

  1. 0.23.3

    SBoudrias committed May 4, 2016
    Copy the full SHA
    425e81f View commit details

Commits on May 24, 2016

  1. Bump cross-spawn

    Fixes #934.
    LostInBrittany authored and kevva committed May 24, 2016
    Copy the full SHA
    035ce57 View commit details

Commits on Jun 16, 2016

  1. Copy the full SHA
    9ed4879 View commit details
  2. 0.23.4

    SBoudrias committed Jun 16, 2016
    Copy the full SHA
    f8dc720 View commit details

Commits on Jul 18, 2016

  1. Copy the full SHA
    b605a5c View commit details
  2. Bump dependencies

    SBoudrias committed Jul 18, 2016
    Copy the full SHA
    5cc59c1 View commit details
  3. 0.24.0

    SBoudrias committed Jul 18, 2016
    Copy the full SHA
    fc69dfe View commit details
  4. Copy the full SHA
    1c0bb5a View commit details
  5. 0.24.1

    SBoudrias committed Jul 18, 2016
    Copy the full SHA
    dc47384 View commit details
Showing with 54 additions and 622 deletions.
  1. +2 −18 .eslintrc
  2. +1 −0 .travis.yml
  3. +0 −10 lib/actions/actions.js
  4. +0 −84 lib/actions/fetch.js
  5. +1 −1 lib/actions/install.js
  6. +0 −184 lib/actions/remote.js
  7. +2 −2 lib/actions/user.js
  8. +32 −35 lib/base.js
  9. +1 −1 lib/util/prompt-suggestion.js
  10. +13 −15 package.json
  11. +0 −6 test/actions.js
  12. +1 −17 test/base.js
  13. +1 −1 test/conflicter.js
  14. +0 −62 test/fetch.js
  15. +0 −186 test/remote.js
20 changes: 2 additions & 18 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -43,21 +43,6 @@
2,
"single"
],
"space-after-keywords": [
2,
"always"
],
"space-before-function-paren": [
2,
{
"anonymous": "always",
"named": "never"
}
],
"space-in-parens": [
2,
"never"
],
"strict": [
2,
"global"
@@ -67,6 +52,7 @@
"all"
],
"eol-last": 2,
"keyword-spacing": 2,
"key-spacing": [
2,
{
@@ -89,7 +75,6 @@
],
"no-alert": 2,
"no-caller": 2,
"no-empty-label": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
"no-implied-eval": 2,
@@ -128,7 +113,6 @@
"before": false,
"after": true
}
],
"space-return-throw-case": 2
]
}
}
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -5,3 +5,4 @@ node_js:
- v0.12
- v4
- v5
- v6
10 changes: 0 additions & 10 deletions lib/actions/actions.js
Original file line number Diff line number Diff line change
@@ -6,23 +6,13 @@ var glob = require('glob');
var istextorbinary = require('istextorbinary');
var mkdirp = require('mkdirp');
var readChunk = require('read-chunk');
var xdgBasedir = require('xdg-basedir');

/**
* @mixin
* @alias actions/actions
*/
var actions = module.exports;

/**
* Stores and return the cache root for this class. The cache root is used to
* `git clone` repositories from github by `.remote()` for example.
*/

actions.cacheRoot = function cacheRoot() {
return path.join(xdgBasedir.cache, 'yeoman');
};

/**
* Make some of the file API aware of our source/destination root paths.
* `copy`, `template` (only when could be applied/required by legacy code),
84 changes: 0 additions & 84 deletions lib/actions/fetch.js

This file was deleted.

2 changes: 1 addition & 1 deletion lib/actions/install.js
Original file line number Diff line number Diff line change
@@ -124,7 +124,7 @@ install.installDependencies = function (options) {
var tplValues = _.extend({
skipInstall: false
}, this.options, {
commands: chalk.yellow.bold(msg.commands.join(' & '))
commands: chalk.yellow.bold(msg.commands.join(' && '))
});
this.log(msg.template(tplValues));
}
184 changes: 0 additions & 184 deletions lib/actions/remote.js

This file was deleted.

4 changes: 2 additions & 2 deletions lib/actions/user.js
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ user.git.name = function () {
}

if (shell.which('git')) {
name = shell.exec('git config --get user.name', { silent: true }).output.trim();
name = shell.exec('git config --get user.name', { silent: true }).stdout.trim();
nameCache[process.cwd()] = name;
}

@@ -47,7 +47,7 @@ user.git.email = function () {
}

if (shell.which('git')) {
email = shell.exec('git config --get user.email', { silent: true }).output.trim();
email = shell.exec('git config --get user.email', { silent: true }).stdout.trim();
emailCache[process.cwd()] = email;
}

67 changes: 32 additions & 35 deletions lib/base.js
Original file line number Diff line number Diff line change
@@ -192,14 +192,22 @@ util.inherits(Base, events.EventEmitter);

// Mixin the actions modules
_.extend(Base.prototype, require('./actions/actions'));
_.extend(Base.prototype, require('./actions/fetch'));
_.extend(Base.prototype, require('./actions/file'));
_.extend(Base.prototype, require('./actions/install'));
_.extend(Base.prototype, require('./actions/remote'));
_.extend(Base.prototype, deprecate.object('this.<%= name %>() is deprecated. Use require("html-wiring").<%= name %>() instead.', wiring));
_.extend(Base.prototype, require('./actions/help'));
_.extend(Base.prototype, require('./actions/spawn_command'));

// Deprecated modules and functions
_.extend(Base.prototype, deprecate.object('this.<%= name %>() is deprecated. Use require("html-wiring").<%= name %>() instead.', wiring));
var deprecatedRemote = function () {
deprecate.log('Remotes functions are deprecated. See https://github.com/yeoman/generator/issues/949 for update guide.');
};
Base.prototype.remote = deprecatedRemote;
Base.prototype.remoteDir = deprecatedRemote;
Base.prototype.fetch = deprecatedRemote;
Base.prototype.extract = deprecatedRemote;
Base.prototype.tarball = deprecatedRemote;

Base.prototype.user = require('./actions/user');
Base.prototype.invoke = deprecate(
'generator#invoke() is deprecated. Use generator#composeWith() - see http://yeoman.io/authoring/composability.html',
@@ -223,24 +231,20 @@ Base.prototype.welcome = deprecate(
* user's answers as defaults.
*
* @param {array} questions Array of question descriptor objects. See {@link https://github.com/SBoudrias/Inquirer.js/blob/master/README.md Documentation}
* @param {Function} callback Receive a question object
* @return {this}
* @return {Promise}
*/

Base.prototype.prompt = function (questions, callback) {
Base.prototype.prompt = function (questions) {
questions = promptSuggestion.prefillQuestions(this._globalConfig, questions);

this.env.adapter.prompt(questions, function (answers) {
return this.env.adapter.prompt(questions).then(function (answers) {
if (!this.options['skip-cache']) {
promptSuggestion.storeAnswers(this._globalConfig, questions, answers);
}

if (_.isFunction(callback)) {
callback(answers);
}
return answers;
}.bind(this));

return this;
};

/**
@@ -427,29 +431,22 @@ Base.prototype.run = function run(cb) {
debug('Running ' + methodName);
self.emit('method:' + methodName);

runAsync(
function () {
self.async = function () {
return this.async();
}.bind(this);

return method.apply(self, self.args);
},
// runAsync return a promise which wraps first function.
// So ensure the callback function never throw an error.
function (err) {
if (err) {
debug('An error occured while running ' + methodName, err);
if (self.listeners('error').length > 0) {
self.emit('error', err);
}
cb(err);
return;
}

completed();
}
)();
runAsync(function () {
self.async = function () {
return this.async();
}.bind(this);

return method.apply(self, self.args);
})().then(completed).catch(function (err) {
debug('An error occured while running ' + methodName, err);

// Ensure we emit the error event outside the promise context so it won't be
// swallowed when there's no listeners.
setImmediate(function () {
self.emit('error', err);
cb(err);
});
});
});
}

@@ -504,7 +501,7 @@ Base.prototype.run = function run(cb) {
this.runHooks();
});

_.invoke(this._composedWith, 'run');
_.invokeMap(this._composedWith, 'run');
return this;
};

2 changes: 1 addition & 1 deletion lib/util/prompt-suggestion.js
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ var getListDefault = function (question, defaultValue) {
* @private
*/
var storeListAnswer = function (question, answer) {
var choiceValues = _.pluck(question.choices, 'value');
var choiceValues = _.map(question.choices, 'value');
var choiceIndex = choiceValues.indexOf(answer);

// Check if answer is not equal to default value
28 changes: 13 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yeoman-generator",
"version": "0.22.6",
"version": "0.24.1",
"description": "Rails-inspired generator system that provides scaffolding for your apps",
"homepage": "http://yeoman.io",
"author": "Yeoman",
@@ -32,41 +32,38 @@
"prepublish": "gulp prepublish"
},
"dependencies": {
"async": "^1.4.2",
"async": "^2.0.0",
"chalk": "^1.0.0",
"class-extend": "^0.1.0",
"cli-table": "^0.3.1",
"cross-spawn": "^2.0.0",
"cross-spawn": "^4.0.0",
"dargs": "^4.0.0",
"dateformat": "^1.0.11",
"debug": "^2.1.0",
"detect-conflict": "^1.0.0",
"download": "^4.1.2",
"error": "^7.0.2",
"find-up": "^1.0.0",
"github-username": "^2.0.0",
"glob": "^6.0.1",
"glob": "^7.0.3",
"gruntfile-editor": "^1.0.0",
"html-wiring": "^1.0.0",
"inquirer": "^0.11.0",
"istextorbinary": "^1.0.2",
"lodash": "^3.5.0",
"istextorbinary": "^2.1.0",
"lodash": "^4.11.1",
"mem-fs-editor": "^2.0.0",
"mkdirp": "^0.5.0",
"nopt": "^3.0.0",
"path-exists": "^2.0.0",
"path-is-absolute": "^1.0.0",
"pretty-bytes": "^2.0.1",
"read-chunk": "^1.0.1",
"pretty-bytes": "^3.0.1",
"read-chunk": "^1.0.0",
"read-pkg-up": "^1.0.1",
"rimraf": "^2.2.0",
"run-async": "^2.0.0",
"shelljs": "^0.5.0",
"shelljs": "^0.7.0",
"text-table": "^0.2.0",
"through2": "^2.0.0",
"underscore.string": "^3.0.3",
"user-home": "^2.0.0",
"xdg-basedir": "^2.0.0",
"yeoman-assert": "^2.0.0",
"yeoman-environment": "^1.1.0",
"yeoman-test": "^1.0.0",
@@ -75,15 +72,16 @@
"devDependencies": {
"gulp": "^3.6.0",
"gulp-coveralls": "^0.1.0",
"gulp-eslint": "^1.0.0",
"gulp-eslint": "^2.0.0",
"gulp-exclude-gitignore": "^1.0.0",
"gulp-istanbul": "^0.10.0",
"gulp-istanbul": "^1.0.0",
"gulp-mocha": "^2.0.0",
"gulp-nsp": "^2.1.0",
"gulp-plumber": "^1.0.0",
"inquirer": "^1.0.2",
"jsdoc": "^3.3.0-beta1",
"mockery": "^1.4.0",
"nock": "^3.3.2",
"nock": "^8.0.0",
"pinkie-promise": "^2.0.0",
"proxyquire": "^1.0.0",
"sinon": "^1.9.1"
6 changes: 0 additions & 6 deletions test/actions.js
Original file line number Diff line number Diff line change
@@ -46,12 +46,6 @@ describe('generators.Base (actions/actions)', function () {
});
});

describe('#cacheRoot()', function () {
it('returns the cache root where yeoman stores all temp files', function () {
assert(/yeoman$/.test(this.dummy.cacheRoot()));
});
});

describe('#copy()', function () {
beforeEach(function (done) {
this.dummy.copy(path.join(__dirname, 'fixtures/foo.js'), 'write/to/bar.js');
18 changes: 1 addition & 17 deletions test/base.js
Original file line number Diff line number Diff line change
@@ -319,23 +319,6 @@ describe('generators.Base', function () {
this.testGen.on('error', sinon.spy());
this.testGen.run(function (err) {
assert.equal(err, error);
sinon.assert.notCalled(spy);
done();
});
});

it('stop queue processing once an error is thrown and "error" event has no listeners', function (done) {
var error = new Error();
var spy = sinon.spy();

this.TestGenerator.prototype.throwing = function () {
throw error;
};
this.TestGenerator.prototype.afterError = spy;

this.testGen.run(function (err) {
assert.equal(err, error);
sinon.assert.notCalled(spy);
done();
});
});
@@ -788,6 +771,7 @@ describe('generators.Base', function () {
// generator before the base one is ran.
setTimeout(function () {
this.dummy.run(function () {
sinon.assert.callOrder(runSpy, this.spy);
assert(this.spy.calledAfter(runSpy));
done();
}.bind(this));
2 changes: 1 addition & 1 deletion test/conflicter.js
Original file line number Diff line number Diff line change
@@ -123,7 +123,7 @@ describe('Conflicter', function () {
contents: null
}, function () {
assert.equal(
_.where(spy.firstCall.args[0][0].choices, { value: 'diff' }).length,
_.filter(spy.firstCall.args[0][0].choices, { value: 'diff' }).length,
0
);
done();
62 changes: 0 additions & 62 deletions test/fetch.js

This file was deleted.

186 changes: 0 additions & 186 deletions test/remote.js

This file was deleted.