refactor(ent): add .generated.go naming suffix#283
refactor(ent): add .generated.go naming suffix#283stefan-ctrl wants to merge 17 commits intofeat/cpapifrom
Conversation
…ogging, panic recovery, and request timeouts from NewAppWithConfig()
…us (part of team and user management)
…to support queries like "Get all teams of the user with email XYZ in environment ABC")
… enabled features
…e database sync operator
…roverToken by environment
…equest state enum
|
Thank you for the PR. I had a closer look at ent and the ways to distinguish generated files from the rest. This is the summary of my findings: File suffix like _generated.go — Not supported by entEnt does not support customizing generated file names. The file names are hardcoded in the ent code generator (e.g., client.go, .go, _create.go, _query.go, etc.). There's no configuration option to add a suffix. However, this isn't really needed because:
Separating generated and manual files by package — Already the caseEnt already organizes this well:
So in practice, there's already a clean separation: you only ever edit files in ent/schema/ and ent/entc/. Everything else is generated and can be safely .gitignored or regenerated at any time. The same is true for gqlgen — the generated ent.graphql is separate from your manual schema.graphql, and the generated resolver scaffolding is in a predictable location. tl;drI will add an overview in the README.md to show which files are generated. Since the structure is given and maintained by ent itself, I would vote for staying close to ent best practices and not modifying the structure internally. |
add bash commands before entc generated to have .generated.go file suffixes.