chore(web-sdk): Add simple nodejs script to generate top level exports for web-sdk #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A continuation to this closed PR: #27
According to this
protobuf-es
repo issue: bufbuild/protobuf-es#455top-level exports is not yet implemented. The author discribes a similar syntax issue to the original PR above.
Running
buf generate proto
indeed generates noindex.ts
(atleast on my side).Until it is supported, a quick solution is to have a simple (hacky?) NodeJS script that generates for us a
index.ts
with the exports and include it in thebuild
script for eachpackage.json
Assuming the flow to publishing the
web-sdk
packages is the folllowing:buf generate proto
cd <target lib>
npm run build
-> tsc compiles pb and connect services definition + index.ts (generated by node script)Now its ready to be published
I'm not sure how the original
index.ts
files were generated in the first place so I could be way off in this PR and its all good if thats the case.