-
Notifications
You must be signed in to change notification settings - Fork 63
feat: dont underscore numbers when formatting module names #655
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
Conversation
|
I'm not sure the regex would want to handle something as complex as "allow a-Za-z0-9 but if the string starts with 0-9 then prepend |
2a66a96
to
76fd786
Compare
@c43721 yes it should handle the case of a starting number |
523e7ea
to
ada08ad
Compare
@c43721 for test, you can update the module doc name in tests/testdata/multiple/b.ts |
ada08ad
to
93dcd1c
Compare
This doesnt affect JSON output, only the rust API. This is done in favour of just operating of DocNodeDef variants instead of having a special type that mirrors all the variants Also changes NamespaceDef elements to be stored as Arc instead of Rc.
3e0a7c4
to
7adc15c
Compare
I'm just going to re-do this under a new branch. |
Fixes jsr-io/jsr#803 but I'd like to know how or if I could better test this.
I eventually got here by looking at how the identifier for the file was created:

The identifier replacing all non-characters with underscores seems to be the source so adjusting the regex to allow numbers.
Though this regex might need to account for a leading number and replace that since you can't have a module identifier prefixed by a number (must be a character)