-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
Adapt changes of yeoman generator 1.0.0 #170
Merged
Merged
Changes from 7 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
b159a7b
Update dependencies
mischah 932533f
Get latest yeoman-generator from GitHub for now
mischah 3ca95f4
Update app
mischah a372ee5
[WIP] Adapt breaking changes of yeoman-generator 1.0
mischah f92896d
Enable ES6 for ESLint
mischah ab6885f
Reference branch `bump-version-for-updating-generator-generator`
mischah 6fdcf4e
Fix requiring the subgenerator
mischah f66b24b
Fix passing the namespace
mischah a9fc6c5
Fix generating the generator
mischah 02b7f29
Remove logging
mischah 58d66d3
Update the generated generator …
mischah 5b44b91
Test node 6 + 7 on travis
mischah cba5e01
Fix test
mischah 7635e1b
Update travis config
mischah 0990016
Dynamically get dependencies for the generated generator …
mischah 51fb745
Rename .eslintrc to make tests green again
mischah 249963f
Downgrade gulp-eslint
mischah d187e66
ES5 extending for the generated generator for now
mischah f496680
Less hacky way to read the package.json of generator-generator
mischah ca0a257
Update travis config
mischah e7abcd8
ES6ify generator-generator
mischah cf7aee5
Use ^1.0.0-rc1 of yeoman-generator
mischah 2ff0754
Change handling argument for generator name
mischah File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,29 +25,29 @@ | |
"node": ">=4.0.0" | ||
}, | ||
"dependencies": { | ||
"chalk": "^1.0.0", | ||
"deep-extend": "^0.4.0", | ||
"generator-node": "^1.7.0", | ||
"chalk": "^1.1.3", | ||
"deep-extend": "^0.4.1", | ||
"generator-node": "^1.12.1", | ||
"inquirer-npm-name": "^2.0.0", | ||
"lodash": "^4.6.1", | ||
"lodash": "^4.17.2", | ||
"mkdirp": "^0.5.1", | ||
"superb": "^1.0.0", | ||
"yeoman-generator": "^0.23.3", | ||
"yosay": "^1.0.2" | ||
"superb": "^1.3.0", | ||
"yeoman-generator": "yeoman/generator#bump-version-for-updating-generator-generator", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to change this when v1.0.0 is released. |
||
"yosay": "^1.2.1" | ||
}, | ||
"devDependencies": { | ||
"gulp": "^3.6.0", | ||
"gulp-coveralls": "^0.1.0", | ||
"gulp-eslint": "^2.0.0", | ||
"gulp-exclude-gitignore": "^1.0.0", | ||
"gulp-istanbul": "^0.10.3", | ||
"gulp-mocha": "^2.0.0", | ||
"gulp-nsp": "^2.1.0", | ||
"gulp-plumber": "^1.0.0", | ||
"mocha": "^2.2.5", | ||
"mockery": "^1.4.0", | ||
"yeoman-assert": "^2.0.0", | ||
"yeoman-test": "^1.0.0", | ||
"gulp": "^3.9.1", | ||
"gulp-coveralls": "^0.1.4", | ||
"gulp-eslint": "^3.0.1", | ||
"gulp-exclude-gitignore": "^1.1.1", | ||
"gulp-istanbul": "^1.1.1", | ||
"gulp-mocha": "^3.0.1", | ||
"gulp-nsp": "^2.4.2", | ||
"gulp-plumber": "^1.1.0", | ||
"mocha": "^3.2.0", | ||
"mockery": "^2.0.0", | ||
"yeoman-assert": "^2.2.1", | ||
"yeoman-test": "^1.6.0", | ||
"pinkie-promise": "^2.0.1" | ||
}, | ||
"license": "MIT" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
'use strict'; | ||
var path = require('path'); | ||
var generators = require('yeoman-generator'); | ||
var Generator = require('yeoman-generator'); | ||
var superb = require('superb'); | ||
|
||
module.exports = generators.Base.extend({ | ||
constructor: function () { | ||
generators.Base.apply(this, arguments); | ||
module.exports = class extends Generator { | ||
constructor(args, opts) { | ||
super(args, opts); | ||
|
||
this.argument('namespace', { | ||
type: String, | ||
required: true, | ||
description: 'Generator namespace' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Old error, but that key as always been |
||
}); | ||
}, | ||
} | ||
|
||
writing: function () { | ||
writing() { | ||
var generatorName = this.fs.readJSON(this.destinationPath('package.json')).name; | ||
|
||
this.fs.copyTpl( | ||
this.templatePath('index.js'), | ||
this.destinationPath(path.join('generators', this.namespace, 'index.js')), | ||
this.destinationPath(path.join('generators', this.options.namespace, 'index.js')), | ||
{ | ||
// Escape apostrophes from superb to not conflict with JS strings | ||
superb: superb().replace('\'', '\\\''), | ||
|
@@ -29,16 +29,16 @@ module.exports = generators.Base.extend({ | |
|
||
this.fs.copy( | ||
this.templatePath('templates/**'), | ||
this.destinationPath(path.join('generators', this.namespace, 'templates')) | ||
this.destinationPath(path.join('generators', this.options.namespace, 'templates')) | ||
); | ||
|
||
this.fs.copyTpl( | ||
this.templatePath('test.js'), | ||
this.destinationPath('test/' + this.namespace + '.js'), | ||
this.destinationPath('test/' + this.options.namespace + '.js'), | ||
{ | ||
namespace: this.namespace, | ||
namespace: this.options.namespace, | ||
generatorName: generatorName | ||
} | ||
); | ||
} | ||
}); | ||
}; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be the name of the argument you want to pass in. It's treated the same as an option now.
{namespace: 'app'}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Tried that too. Doesn’t work as well :(
Pushed that for you one minute ago.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. Missed one line. It does work.