-
Notifications
You must be signed in to change notification settings - Fork 309
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
web: add generators for typescript defs #2422
Conversation
f69f879
to
4f5b3ac
Compare
@@ -0,0 +1,22 @@ | |||
declare namespace OpenAPI2 { | |||
export interface webviewView { | |||
log?: 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 the main thing to look at
separately, we should strategize on how to substitute these generated types for the handwritten types in types.ts
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.
Aww, it makes all of these optional fields? Why?
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.
in proto3, fields can only be optional. there's some good discussion here:
protocolbuffers/protobuf#2497
https://capnproto.org/faq.html#how-do-i-make-a-field-required-like-in-protocol-buffers
4f5b3ac
to
f626c75
Compare
toast.yml
Outdated
output_paths: | ||
- web/src/view.d.ts | ||
command: | | ||
npx @manifoldco/swagger-to-ts pkg/webview/view.swagger.json --camelcase --output web/src/view.d.ts |
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.
If we want to continue with using yarn everywhere I think we can change this to use yarn dlx:
npx @manifoldco/swagger-to-ts pkg/webview/view.swagger.json --camelcase --output web/src/view.d.ts | |
yarn dlx @manifoldco/swagger-to-ts pkg/webview/view.swagger.json --camelcase --output web/src/view.d.ts |
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.
done
f626c75
to
6c1d647
Compare
Hello @jazzdan,
Please review the following commits I made in branch nicks/web-grpc-typescript:
4f5b3ac (2019-10-24 18:02:06 -0400)
web: add generators for typescript defs