yeoman / yeoman-app

A desktop app that scaffolds projects using Yeoman
987 stars 106 forks source link

Close generator / Cancel command #15

Open ruyadorno opened 9 years ago

ruyadorno commented 9 years ago

We need a close button on the interface that would bring the user back to the initial app screen, in order for this to work we'll also need a new command to actually stop the running generator on the browser side.

stefanbuck commented 9 years ago

The generator needs to bring in this feature. See https://github.com/yeoman/generator/pull/728

stefanbuck commented 9 years ago

@SBoudrias suggestion https://github.com/yeoman/generator/pull/728#issuecomment-68065087 to run yeoman in a ChildProcess doesn't work. There are some bugs with node / atom-shell v0.20.5 itself and the ChildProcess (https://github.com/atom/atom-shell/issues/961). Unfortunately they don't know what goes wrong and I guess it's not on the high priority list. We have to find an other solution for that problem.

So from my perspective we have these options: ~~1. Add a cancel behaviour in the generator like I did (tried to do) https://github.com/yeoman/generator/pull/728

  1. Let's skip the cancel behaviour for now (maybe forever)
  2. Ship node binary with the app https://github.com/atom/atom-shell/issues/961#issuecomment-69802052
  3. Send a fix to Atom-Shell~~

Let it me know if you have any other ideas or opinions to address.

stefanbuck commented 9 years ago

Yeah, the Atom-Shell Team fixed it :smile: https://github.com/atom/atom-shell/issues/961#event-220434383. I will check it out tomorrow.

stefanbuck commented 9 years ago

@ruyadorno FYI will continue with that this week.

ruyadorno commented 9 years ago

awesome! :fireworks:

stefanbuck commented 9 years ago

The generator process is not longer part of the main process of the app. The actual generator is now running in a child process so we can simple kill them and stop the npm and bower install process.

For that, I've added two new context-generator events:

@ruyadorno Can you please add a new state (right after generator:install is emitted) which contains the cancel button. That would be awesome. My current working branch is called child-process-wip.

If you have any questions, shout!