slushjs / gulp-conflict

Check if files in stream conflict with those in target dir, with option to use new, keep old, show diff, etc.
MIT License
22 stars 12 forks source link

[conflict], first time user may be really confused #4

Closed borestad closed 9 years ago

borestad commented 10 years ago

Hi. Cool plugin, really like the effort.

This is me running a sample project for the first time: I've read the other issues about the Keeping/Creating issue, but for me this is still not as clear as it can be.

This basically screams YOU HAVE A CONFLICT. But i suppose this green [conflict] is from gulp, right? Is behavior possible to modify?

I also have to say that 'Create' or 'Creating' is a better name imho. At least in the context when using it together with slush

image

joakimbeng commented 10 years ago

The [conflict] is from this plugin, and is supposed to clarify which plugin the output comes from. I agree with you though, it looks like every file is conflicting :P

How about changing the plugin's output so that [conflict] is removed from each line, and a single initial [gulp-conflict] Checking for conflicts in "<destination dir>" is printed above [15:33:17] [conflict] Keeping incs in your output? What do you think?

borestad commented 10 years ago

To begin with, removing the [conflict] is a great idea.

I wonder though, if "Checking for conflicts in "" is the most user friendly message a user want when scaffolding a project?

To be honest, I don't know enough about the purpose of gulp-conflict, but when used in the context with a slushfile. Imho, I don't think that this plugin should be the one responsible for doing the actual logging. In this case I'd rather do something like

Then:

gulp.src(__dirname + '/templates/app/**') 
      .pipe(template(answers))                 
      .pipe(conflict('./'))                    // Confirms overwrites on file conflicts
      .pipe(outputLogger('./'))          // The actual output (that can be customizable)
      .pipe(gulp.dest('./'))                 
      .pipe(install())                         
      .on('finish', function () {
        done();                                
      });
  });

I believe in keeping things simple. There's also no need for logging the time when scaffolding. If anything, one can measure the total time instead.

[CREATED] .jshintrc
[CREATED] foo/bar.txt
[FAILED] .gitignore

What do you think?

joakimbeng commented 10 years ago

Interesting :+1: Sound like a good plan for the future of this module.

mshick commented 9 years ago

Would be great to see this included, maybe via that PR? I've had to explain the [conflict] thing a few times already -- very confusing.