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

chore(web-sdk): Add simple nodejs script to generate top level exports for web-sdk #28

Closed
wants to merge 3 commits into from

Conversation

Mercurial
Copy link
Contributor

@Mercurial Mercurial commented Jan 14, 2024

A continuation to this closed PR: #27

According to this protobuf-es repo issue: bufbuild/protobuf-es#455

top-level exports is not yet implemented. The author discribes a similar syntax issue to the original PR above.

Running buf generate proto indeed generates no index.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 the build script for each package.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

npm run publish

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.

@Mercurial
Copy link
Contributor Author

P.S the I messed up the PR it thinks that doc.md is changed but its exactly the same as main branch.

@Mercurial Mercurial closed this Feb 13, 2024
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.

1 participant