Skip to content
This repository has been archived by the owner on Oct 12, 2021. It is now read-only.

Add auto-generated Typescript files #93

Merged
merged 8 commits into from
Jan 5, 2021
Merged

Add auto-generated Typescript files #93

merged 8 commits into from
Jan 5, 2021

Conversation

ashleyvega
Copy link
Contributor

This PR uses https://github.com/improbable-eng/ts-protoc-gen to generate:

  • TypeScript Definitions for CommonJS modules (--ts_out="$out_dir")
  • gRPC Service Stubs for use with grpc-node (--ts_out="service=grpc-node:$out_dir")
  • gRPC Service Stubs for use with grpc-web (--ts_out="service=grpc-web:$out_dir")

Closes #90.

@edd
Copy link
Member

edd commented Jan 5, 2021

@ashleyvega the missing piece here is a typescript index file. I've hand coded one but it should be generated in the same way as index.js is - I'm going to push commit with the static version, and the relevant package.json change - please could you update the .sh script?

edd and others added 6 commits January 5, 2021 18:48
To make dependent packages recognise the types, we need to add
a declaration that there are indeed types to look for. This commit
adds an `index.d.ts` file in the root that contains references to the
.d.ts files generated in a previous commit in this branch. It also adds
a reference to that file in `package.json`, which is The Correct Way,
even though `index.d.ts` should be sufficient.

However! This requires a follow up commit that generates the
`index.d.ts` file in the build script, rather than leaving it hardcoded.
The current file is good for now, but should be removed and generated at
build.

- Add `types` field in `package.json`
- Add hardcoded `index.d.ts`
- Remove .d.ts extension from all imports
- Fix paths in two imports
@edd edd merged commit 44b6550 into develop Jan 5, 2021
@ashleyvega ashleyvega deleted the autogen-ts branch January 5, 2021 21:44
@ashleyvega ashleyvega mentioned this pull request Jan 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

autogenerate typescript definitions
2 participants