-
-
Notifications
You must be signed in to change notification settings - Fork 299
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
File collision menu, tests for individual generators, mocha:generator and better looking output #63
Conversation
\o/*9999 I've been testing this out today, and it's awesome! |
wow wow wow! |
@@ -70,10 +73,19 @@ actions.destinationRoot = function destinationRoot(root) { | |||
// - the destination path to be relative to application Gruntfile's directory | |||
// (most likely cwd) | |||
actions.copy = function copy(source, destination, options) { | |||
var self = this; |
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.
Can you use .bind(this) instead?
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.
alright 75b69eb9bc03d46edc527fbb72fad57150aadb41
Reviewed this PR, and it looks very good too me. A lot of awesome improvements. And the new collision handling is just marvelous! |
This is amazing work, @mklabs. Loving the new additions and cannot wait to land the collision handling. |
@addyosmani This looks good to me. Can we get this merged? |
@sindresorhus Happy to merge. @mklabs do you think you'll have time to rebase today? |
Yes doing it right now. |
Awesome. Looking forward to it :) |
* mv *.js lib/ * added file collision menu, checks every file system write, * checking existing file, if it's identical. If it's not, shows up the file collision menu (Y to overwrite, n to skip, d to compute file diff, a to overwrite all, q to quit) * Added tests for individual generators. Generators making use of prompts are not tested yet (it requires us pulling in the Runnable helper from yeoman) * Auto-generation of tests with the generator generator * Addition of mocha:generator, invoked by the generator one. Stubs * out a new mocha test suite. Arguments can be used to setup file assertions automatically. * Set arguments required state based on provided defaults. * Make sure to update the `this.options` hash in generator when * using `this.option()`, setting up default value appropriately. * add support/ directory, scripts to generate mocha specs for a given generator. To use `./support/test <generator>` with <generator> being the name of the generator. What it does, it goes into a temporary dir, trigger the given generator, redirect the output and parse out the created files, figures out the appropriate `yeoman init mocha:generator ...` command. * fix fallbacks behavior * move actions.js file into their own dir, automate the include * detect image types, and setup noProcess accordingly
* use prompt directly, mainly to bypass the Are you sure? check on conflicts. * added log API for each status (identical, force, skip, ..) * shared to hook with any local generator (which might require another instance of logger). process.logging is used following logref spec: https://github.com/mikeal/logref * sort namespaces with help output * readme update
* move back to one describe / it * remove bash script, redone as much as possible as node script * all tests regenerated
Rebased, forced push. Should be ok now. |
Landed. Awesome work on this Mickael. It really improves the use of generators! |
A lot of stuff in there. The most relevant points being the file menu collision check on every file writes, and the reworked log output.
checking existing file, if it's identical. If it's not, shows up the
file collision menu (Y to overwrite, n to skip, d to compute file diff,
a to overwrite all, q to quit)
this.options
hash in generator whenusing
this.option()
, setting up default value appropriately.out a new mocha test suite. Arguments can be used to setup file
assertions automatically.
prompts are not tested yet (it requires us pulling in the Runnable
helper from yeoman).
npm test
is happy with 200+ tests.generator. To use
./support/test <generator>
with<generator>
beingthe name of the generator. What it does: it goes into a temporary dir,
trigger the given generator, redirect the output and parse out the
created files, figures out the appropriate
yeoman init mocha:generator ...
command.Once again, most of the inspiration is coming from Rails generators.
New output:
Collision example:
thx to @sindresorhus for the screenshots! (and feedbacks)
Should close #38 #48 #58