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: 52bbb3d20e9ddd1ad7649c03f602b434b6b0392d
Choose a base ref
...
head repository: yeoman/generator
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 138ed98b818a0f6fc7c0288f4067e1e7d54bf01f
Choose a head ref
Loading
Showing with 1,076 additions and 7,669 deletions.
  1. +118 −0 .eslintrc
  2. +0 −27 .jscsrc
  3. +0 −1 .jshintignore
  4. +0 −16 .jshintrc
  5. +16 −3 .travis.yml
  6. +69 −0 deploy.sh
  7. +11 −22 gulpfile.js
  8. +0 −72 index.js
  9. +13 −2 jsdoc.json
  10. +0 −212 lib/actions/actions.js
  11. +0 −84 lib/actions/fetch.js
  12. +0 −72 lib/actions/file.js
  13. +11 −23 lib/actions/help.js
  14. +63 −32 lib/actions/install.js
  15. +0 −38 lib/actions/invoke.js
  16. +0 −184 lib/actions/remote.js
  17. +2 −2 lib/actions/user.js
  18. +166 −274 lib/{base.js → index.js}
  19. +0 −22 lib/named-base.js
  20. +0 −77 lib/test/adapter.js
  21. +0 −200 lib/test/helpers.js
  22. +0 −210 lib/test/run-context.js
  23. +8 −3 lib/util/conflicter.js
  24. +10 −0 lib/util/deprecate.js
  25. +19 −10 lib/util/prompt-suggestion.js
  26. +1 −13 lib/util/storage.js
  27. +35 −39 package.json
  28. +97 −2 readme.md
  29. +0 −12 test/.jshintrc
  30. +0 −318 test/actions.js
  31. +245 −184 test/base.js
  32. +4 −4 test/conflicter.js
  33. +16 −1 test/deprecate.js
  34. +0 −62 test/fetch.js
  35. +0 −12 test/fixtures/custom-generator-extend/package.json
  36. +0 −8 test/fixtures/custom-generator-extend/support/index.js
  37. +0 −16 test/fixtures/custom-generator-extend/support/scaffold/main.js
  38. +0 −26 test/fixtures/custom-generator-simple/main.js
  39. +0 −12 test/fixtures/custom-generator-simple/package.json
  40. +0 −1 test/fixtures/custom-template-setting.xml
  41. +0 −1 test/fixtures/dir-fixtures/foo-process.js
  42. +0 −1 test/fixtures/dir-fixtures/foo-template.js
  43. +0 −1 test/fixtures/dir-fixtures/foo.js
  44. +0 −1 test/fixtures/dummy-package/index.js
  45. +0 −3 test/fixtures/dummy-package/package.json
  46. +0 −1 test/fixtures/foo-process.js
  47. +4 −4 test/fixtures/{mocha-generator → generator-mocha}/main.js
  48. +1 −1 test/fixtures/{mocha-generator-base → generator-mocha}/package.json
  49. +0 −14 test/fixtures/help.txt
  50. +0 −4,330 test/fixtures/lodash-copy.js
  51. +0 −7 test/fixtures/lookup-project/package.json
  52. +0 −6 test/fixtures/lookup-project/subdir/package.json
  53. +0 −18 test/fixtures/mocha-generator-base/main.js
  54. +0 −12 test/fixtures/mocha-generator/package.json
  55. +3 −3 test/fixtures/options-generator/main.js
  56. +0 −1 test/fixtures/template-setting.xml
  57. +0 −1 test/fixtures/template.jst
  58. +0 −1 test/fixtures/testFile
  59. +0 −1 test/fixtures/testFile2
  60. BIN test/fixtures/testRemoteFile.tar.gz
  61. +5 −56 test/generators.js
  62. +0 −168 test/helpers.js
  63. +71 −14 test/install.js
  64. +0 −78 test/invoke.js
  65. +79 −0 test/prompt-suggestion.js
  66. +0 −181 test/remote.js
  67. +0 −438 test/run-context.js
  68. +0 −3 test/spawn_command.js
  69. +6 −6 test/storage.js
  70. +3 −3 test/user.js
  71. +0 −19 test/wiring.js
118 changes: 118 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"extends": "eslint:recommended",
"env": {
"node": true,
"mocha": true
},
"rules": {
"array-bracket-spacing": [
2,
"never"
],
"brace-style": [
2,
"1tbs"
],
"consistent-return": 0,
"indent": [
2,
2,
{
"SwitchCase": 1
}
],
"no-multiple-empty-lines": [
2,
{
"max": 2
}
],
"no-use-before-define": [
2,
"nofunc"
],
"one-var": [
2,
"never"
],
"quote-props": [
2,
"as-needed"
],
"quotes": [
2,
"single"
],
"strict": [
2,
"global"
],
"curly": [
2,
"all"
],
"eol-last": 2,
"keyword-spacing": 2,
"key-spacing": [
2,
{
"beforeColon": false,
"afterColon": true
}
],
"no-eval": 2,
"no-with": 2,
"space-infix-ops": 2,
"dot-notation": [
2,
{
"allowKeywords": true
}
],
"eqeqeq": [
2,
"allow-null"
],
"no-alert": 2,
"no-caller": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
"no-implied-eval": 2,
"no-iterator": 2,
"no-label-var": 2,
"no-labels": 2,
"no-lone-blocks": 2,
"no-loop-func": 2,
"no-multi-spaces": 2,
"no-multi-str": 2,
"no-native-reassign": 2,
"no-new-func": 2,
"no-new-wrappers": 2,
"no-octal-escape": 2,
"no-proto": 2,
"no-return-assign": 2,
"no-script-url": 2,
"no-sequences": 2,
"no-unused-expressions": 2,
"yoda": 2,
"no-undef-init": 2,
"camelcase": 2,
"comma-spacing": 2,
"new-cap": 2,
"new-parens": 2,
"no-array-constructor": 2,
"no-extra-parens": 2,
"no-console": 0,
"no-new-object": 2,
"no-spaced-func": 2,
"no-trailing-spaces": 2,
"semi": 2,
"semi-spacing": [
2,
{
"before": false,
"after": true
}
]
}
}
27 changes: 0 additions & 27 deletions .jscsrc

This file was deleted.

1 change: 0 additions & 1 deletion .jshintignore

This file was deleted.

16 changes: 0 additions & 16 deletions .jshintrc

This file was deleted.

19 changes: 16 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
sudo: false
language: node_js
node_js:
- '0.10'
- '0.12'
- 'stable'
- 0.12
- 4
- 6
- node
after_success: "./deploy.sh"
env:
global:
- COMMIT_AUTHOR_EMAIL: yeoman@yeoman.io
- COMMIT_AUTHOR_NAME: yeoman
- SOURCE_BRANCH: master
- TARGET_BRANCH: gh-pages
- DOCS_DIR: "../yeoman-generator-doc"
- GH_OWNER: yeoman
- GH_PROJECT_NAME: generator
- DEPLOY_ON_NODE_VERSION: v6
- secure: Hv7gACQoYGtesz1NTJYRHjGCimEJEjj4bQP2iTpDUUbfAiYe/4QPemoyDEFjRxbu5m2uoYwMk0AQrW7DnQhNAhl7u24jYnRgQyd/2GOx3xZgjwnao27gsrTHss4IyXEaS2h3kRuIVSD+xibz/lwZm+erHOQ9VOwvCQkOKnILXW8=
69 changes: 69 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/bash

# Exit with nonzero exit code if anything fails
set -e

REPO=`git config remote.origin.url`
SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:}
SHA=`git rev-parse --verify HEAD`

# Only build and deploy docs on a specific node version
if [[ $TRAVIS_NODE_VERSION != $DEPLOY_ON_NODE_VERSION ]]; then
echo "Current Node.js versions doesn’t match. Skipping generating and deploying the docs."
exit 0
fi

# Only build and deploy docs when the current build is for a Git tag.
if [[ $TRAVIS_TAG == "" ]]; then
echo "Not a build for a Git tag. Skipping generating and deploying the docs."
exit 0
fi

# Create $DOCS_DIR
mkdir $DOCS_DIR
echo -e "Created directory $DOCS_DIR\n"

# Change directory to $DOCS_DIR
cd $DOCS_DIR
echo "Changed directory to: "
pwd
echo -e ""

# Clone the existing gh-pages into $DOCS_DIR
git clone $REPO .
echo -e "Cloned $REPO\n"
git checkout $TARGET_BRANCH

# Clean out existing contents
rm -rf **
echo -e "Cleaned out existing contents of $DOCS_DIR\n"

# Generate docs in $TRAVIS_BUILD_DIR
cd $TRAVIS_BUILD_DIR
npm run doc
echo -e "Generated docs\n"

# Change directory to $DOCS_DIR
cd $DOCS_DIR

# Exit if there are no changes to the generated content
if [ -z "$(git status --porcelain)" ]; then
echo "No changes to the output on this run; exiting."
exit 0
fi

# Git setup
git config user.name $COMMIT_AUTHOR_NAME
git config user.email $COMMIT_AUTHOR_EMAIL

# Commit the new of the new version
git add --all .
git commit -m "Deploy docs to GitHub Pages ($TRAVIS_TAG)"
echo -e "Comitted docs to $TARGET_BRANCH\n"

# Now that we're all set up, we can push.
# Info: Any command that using GH_OAUTH_TOKEN must pipe the output to /dev/null
# to not expose your oauth token
git push https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} HEAD:$TARGET_BRANCH > /dev/null 2>&1
echo -e "Pushed changes to $TARGET_BRANCH\n"
echo "We are done ✌(-‿-)✌"
33 changes: 11 additions & 22 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,33 @@
'use strict';
var path = require('path');
var gulp = require('gulp');
var eslint = require('gulp-eslint');
var excludeGitignore = require('gulp-exclude-gitignore');
var mocha = require('gulp-mocha');
var jshint = require('gulp-jshint');
var jscs = require('gulp-jscs');
var istanbul = require('gulp-istanbul');
var nsp = require('gulp-nsp');
var plumber = require('gulp-plumber');
var coveralls = require('gulp-coveralls');

var handleErr = function (err) {
console.log(err.message);
process.exit(1);
};

gulp.task('static', function () {
return gulp.src([
'**/*.js',
'!test/fixtures/**'
])
'**/*.js',
'!test/fixtures/**'
])
.pipe(excludeGitignore())
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'))
.pipe(jscs())
.pipe(jscs.reporter())
.pipe(jscs.reporter('fail'))
.on('error', handleErr);
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});

gulp.task('nsp', function (cb) {
nsp('package.json', cb);
nsp({package: path.resolve('package.json')}, cb);
});

gulp.task('pre-test', function () {
return gulp.src([
'index.js',
'lib/**/*.js'
])
'lib/**/*.js'
])
.pipe(istanbul({includeUntested: true}))
.pipe(istanbul.hookRequire());
});
@@ -48,7 +37,7 @@ gulp.task('test', ['pre-test'], function (cb) {

gulp.src('test/*.js')
.pipe(plumber())
.pipe(mocha({reporter: 'spec'}))
.pipe(mocha({reporter: 'spec', timeout: 3000}))
.on('error', function (err) {
mochaErr = err;
})
72 changes: 0 additions & 72 deletions index.js

This file was deleted.

Loading