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] Support more languages #2

Open
Kaoticz opened this issue Sep 13, 2024 · 0 comments
Open

[Feature] Support more languages #2

Kaoticz opened this issue Sep 13, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Kaoticz
Copy link
Owner

Kaoticz commented Sep 13, 2024

Json2Sharp currently supports 2 languages, C# and Python. I'd like to add support to more languages, but I lack the time to do so.
The project is structured in a way that allows new languages to be easily implemented. If you're interested in contributing, here is how you can do so:

  • Fork this repository, clone it into your machine, and create a new branch.
  • Notice there are 3 .NET projects:
    • Json2SharpApp: This is the CLI application, that you run in the terminal.
    • Json2SharpLib: This is the library that is published to NuGet, where all the parsing logic is located.
    • Json2SharpTests: These are unit tests that ensure the code behaves how it is supposed to.
  • In the library project, create a class that inherits from CodeEmitter (the actual requirement is the ICodeEmitter interface, but CodeEmitter has some methods that could prove useful to you).
  • Provide an implementation for the abstract methods. Feel free to look at the existing CodeEmitters for inspiration.
  • Head to the GetLanguageEmitter method in the Json2Sharp class and add your emitter there. Don't forget to add the appropriate options to Json2SharpOptions.
  • Go to Json2SharpTests and create unit tests for the emitter you made. Feel free to look at the existing tests for inspiration.
  • Once you got your code emission to work as intended, head to ConfigHandler and implement the options your emitters are supposed to handle.
  • Create a pull request and wait for the code review. If adjustments are suggested, then go and implement them. Once everything is ok, your changes will be accepted and merged with main 🎉
@Kaoticz Kaoticz added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Sep 13, 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 good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant