yo icon indicating copy to clipboard operation
yo copied to clipboard

Better generator update workflow?

Open Swiip opened this issue 9 years ago • 4 comments

Hi Yeoman,

Don’t know about all generators but the question about updating a project with a new version of the generator originally used is recurring for us on gulp-angular and FountainJS.

At start, I was thinking that users should read and understand the generated code for being able to maintain it. But since, I changed my mind observing that even myself would love to benefit of all evolutions since the start of the project.

Until today, when users ask me for this I simply link the @sindresorhus SO: http://stackoverflow.com/questions/18480316/how-to-upgrade-existing-project-scaffolded-with-yeoman but to be honest, it’s not really satisfying. The diff of any generated file which has been changed is quite unusable.

This problem was blocking to a colleague of mine @ncuillery on a React Native project started with a Yeoman generator. This generator handles obscure generated files very difficult to track. He worked on a solution which is described here: https://medium.com/@ncuillery/easier-react-native-upgrades-with-rn-diff-5020b5c3de2d#.hm1iw1zci. Now he works on an even better solution working mostly like:

  • Run the generator in the current version (i.e. erase the user’s changes)
  • git commit
  • Run the generator in the new version
  • git commit
  • Create a diff patch between the two commits
  • Remove the 2 commits
  • Apply the generated patch

These two solutions are not tied up with React Native and could bring a really better experience to all Yeoman users. So I would like to open the discussion here to embed similar solution directly into Yeoman.

The main problem I see is that it requires Git and I don’t really know how to handle such a dependency. But what I’m sure is that Fountain users including me would be very happy to have a good diff solution to update their projects.

Swiip avatar Sep 26 '16 06:09 Swiip

I'm faced with the exact same problem, just typically for Python projects. Sadly there has been zero activity on this IMHO extremely relevant problem. 🙁

sisp avatar Mar 26 '22 10:03 sisp

This is how Copier addresses the update problem: https://copier.readthedocs.io/en/stable/updating/#how-the-update-works

sisp avatar Dec 03 '22 21:12 sisp