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

[Feature] Regex to Builder codegen #82

Open
4 tasks
mdjastrzebski opened this issue Apr 14, 2024 · 0 comments
Open
4 tasks

[Feature] Regex to Builder codegen #82

mdjastrzebski opened this issue Apr 14, 2024 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@mdjastrzebski
Copy link
Member

mdjastrzebski commented Apr 14, 2024

Is your feature request related to a problem? Please describe.
Create a generator that would take JS regex literal as an input and output a valid TS Regex Builder DSL as an output.

Describe the solution you'd like
This could be initially used in our documentation page for users to copy-paste their JS regexes and get TS Regex Builder version. Later on that could also be used in a codemod that could be run over user source file(s).

The actual regex parsing can be done using RegExp Tree library. The remaining parts would be transforming RegExp Tree into TS Regex Builder DSL.

Describe alternatives you've considered
TS Regex Builder supports gradual migration with splitting complex regex literal into smaller literals and embedding them in the DSL, however that is a manual proces, that can be tedious with really complex expressions.

Checklist

  • Implementation
  • Tests
  • Docs: page for executing the translation
  • README docs

Additional context
There is a website for Swift Regex Builder that performs the similar function.

@mdjastrzebski mdjastrzebski added enhancement New feature or request help wanted Extra attention is needed labels Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant