You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any good reason to commit generated code for types to version control? In the documentation I wrote that those files should be committed, but now I can't remember what my reasoning was.
If the types code isn't committed, I think that would alleviate confusion when a new version of Counterfact generates types differently from the previous version.
Counterfact creates a .gitignore file for the .cache directory and that seems to work fine. I can't think of a reason we shouldn't add the types directories to that file.
The text was updated successfully, but these errors were encountered:
I would think just committing the components and paths would be enough. Types are ephemeral since they are regenerated anyway.
pmcelhaney
changed the title
Add types directories to .gitignore
Better explanation of why generated code should be committed to version control
Apr 16, 2024
Okay, I remember the problem with not committing types. The moment you pull down the repo it's "broken" because there are references to type files that aren't there. In theory, you could run Counterfact and regenerate them in seconds. And the OpenAPI file might be outside of the repo, so there's no guarantee that running Counterfact again will produce exactly the same code.
I've changed the title of this issue to add more clarity in the documentation rather than change the code.
Is there any good reason to commit generated code for types to version control? In the documentation I wrote that those files should be committed, but now I can't remember what my reasoning was.
If the types code isn't committed, I think that would alleviate confusion when a new version of Counterfact generates types differently from the previous version.
Counterfact creates a
.gitignore
file for the.cache
directory and that seems to work fine. I can't think of a reason we shouldn't add the types directories to that file.The text was updated successfully, but these errors were encountered: