yo
yo copied to clipboard
Better generator update workflow?
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.
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. 🙁
This is how Copier addresses the update problem: https://copier.readthedocs.io/en/stable/updating/#how-the-update-works