Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom suffix for generated query files #701

Closed
wants to merge 1 commit into from

Conversation

CarsonF
Copy link
Collaborator

@CarsonF CarsonF commented Jul 26, 2023

Happen to call the option something else.
It doesn't apply to the other generators, so I didn't put in the common CommandOptions type.

I know I didn't connect to CLI handling either.
I don't need that since I call the function directly, but I can connect if you'd like.

@scotttrinh
Copy link
Collaborator

I still feel pretty strongly that this shouldn't be configurable, even just at the function API layer, just to keep the logic here as predictable and easy to understand as possible.

One approach I would be ok with would be to refactor the code generation itself (taking input EdgeQL, outputting strings of TypeScript) from writing them to disk and export that function as well. That way the caller will be responsible for feeding it files from the filesystem and writing the results back to disk (either as a single file or multiple files or something else entirely) and deciding things like module loading, etc.

I realize this is a much bigger lift, and it might seem like a strange hill to die on, but I do feel pretty strongly that we should have very few options to make onboarding and learning and expectations as straightforward as possible. Especially since these files aren't typically checked into source control, it's hard to keep track of something like this.


Probably the lowest effort thing you could do here would be to do this renaming yourself manually.

@CarsonF
Copy link
Collaborator Author

CarsonF commented Jul 27, 2023

From my perspective, EdgeDB is assuming a lot, and maybe over stepping, to think that all *.query.ts files are generated edgedb queries and should be git-ignored.

This was the smallest diff so I started here. I'll look into a larger refactor instead.

@CarsonF
Copy link
Collaborator Author

CarsonF commented Jul 27, 2023

Closing in favor of #706

@CarsonF CarsonF closed this Jul 27, 2023
@CarsonF CarsonF deleted the gen-queries-file-suffix branch July 27, 2023 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants