[Feature Request]: Create a Lexicon Generator

Aperta
#31 6 commenti 1 reazione 1 assegnatario Vedi su GitHub

@MasterJ93 ci sta già lavorando.

Dal 26/7/2024.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

draft new feature
Summary

Create a solution for not only creating lexicons, but also converting them into Swift models and methods.

Pain points

At this time, all lexicon models and methods need to be written by hand. This can cause issues with missing out features, duplicating code, making mistakes, and sloppy implementations. Creating a lexicon generator would solve all of these problems.

The idea is to create an app and CLI tool that will do the following:

  • Create and validate the lexicon in a JSON format.
  • Take all of the AT Protocol-provided and Bluesky-provided lexicons and convert them into validated Swift models and methods.
  • Give proper syntax and clean code for each model and method, which would also conform to the ATProtoKit API Design Guidelines and the Swift API Design Guidelines.

There will be some limitations:

  • Some lexicons in Bluesky and AT Protocol are built into some places and will be treated differently. For example, all of the lexicons related to creating and managing sessions must be in ATProtocolConfiguration, and com.atproto.repo.uploadBlob is required to be in APIClientService.
  • The first version may not implement any lexicons that have the subscription value, due to their special nature and still-highly-moldable structure of the models and methods.

The app and CLI tool will simply allow you to insert the lexicon JSON files, as well as an optional configuration file of adding extra information (such as comments). The app will specifically show common errors among any JSON errors when creating or viewing a lexicon file (not available in version 1.0).

Considered Alternatives

N/A

Is this a breaking change?

No

Library Examples

The repo swift-atproto has a good understanding of what could be done in terms of the lexicon generator. However, using it as-is isn't ideal: a better one would need to be made that better fits with the design goals of ATProtoKit.

Additional Context

This will most likely be in another repository, so progress will be followed over there instead of here. When it's completed its goals, this issue will close.

Lingua principale
Swift
Stelle
226
Fork
40
Merge medio
5h 8m
PR unite (30g)
3

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MasterJ93/ATProtoKit

Tutte le issue di MasterJ93/ATProtoKit

Issue simili

Altre issue su Swift

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.