-
-
Notifications
You must be signed in to change notification settings - Fork 141
feat: add typescript typegen endpoint #269
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
Conversation
fastify.get<{ | ||
Headers: { pg: string } | ||
Querystring: { | ||
excluded_schemas?: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is for auth
, storage
, graphql
, realtime
etc. - we should only generate for user's schemas
output = prettier.format(output, { | ||
parser: 'typescript', | ||
}) | ||
return output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Content-Type: text/plain; charset=utf-8
by default
(function_) => `${JSON.stringify(function_.name)}: { | ||
Args: ${(() => { | ||
if (function_.argument_types === '') { | ||
return 'Record<PropertyKey, never>' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for functions w/o args
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great @soedirgo
Perhaps just move the templating logic out of the "routes" file 👍
Done! |
🎉 This PR is included in version 0.37.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
e.g. for current test fixtures:
postgres-meta/test/db/00-init.sql
Lines 1 to 53 in 38c325f
postgres-meta/test/db/01-memes.sql
Lines 1 to 34 in 38c325f
Generated types: