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

Cherry-pick fix for TS module names #20

Merged
merged 2 commits into from
May 12, 2024
Merged

Cherry-pick fix for TS module names #20

merged 2 commits into from
May 12, 2024

Conversation

dpup
Copy link
Owner

@dpup dpup commented May 12, 2024

Original PR:
grpc-ecosystem#43

f1dcbfc (2024-05-11 17:06:36 -0700)
update readme

233a149 (2024-05-11 17:05:50 -0700)
fix: invalid TS module name for proto files with dash or dot chars
Fixes grpc-ecosystem#42

The fix patches data.GetModuleName func to return a camel cased string to be used as a unique module name in TS artifacts. Here we replace manual conversion of a package name and base file name with ToCamel func of the github.com/iancoleman/strcase package. This helper package has already been included in go.mod.
ToCamel removes ., -, _ or whitespace chars from the input string and uses those as a mark to capitalize the next letter.

Code review reminders, by giving a LGTM you attest that:

  • Commits are adequately tested
  • Code is easy to understand and conforms to style guides
  • Incomplete code is marked with TODOs
  • Code is suitably instrumented with logging and metrics

anatolym and others added 2 commits May 11, 2024 17:05
Fixes grpc-ecosystem#42

The fix patches `data.GetModuleName` func to return a camel cased string to be used as a unique module name in TS artifacts. Here we replace manual conversion of a package name and base file name with `ToCamel` func of the `github.com/iancoleman/strcase` package. This helper package has already been included in go.mod.
`ToCamel` removes `.`, `-`, `_` or whitespace chars from the input string and uses those as a mark to capitalize the next letter.
@dpup dpup merged commit 53d2f39 into main May 12, 2024
2 checks passed
@dpup dpup deleted the dan/module-names branch May 12, 2024 00:12
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.

Invalid module name for proto files with dashes or dots in name
2 participants