cdp-backend icon indicating copy to clipboard operation
cdp-backend copied to clipboard

Dynamically Generate TypeScript DB Models, Transcript Model, and other Constants

Open evamaxfield opened this issue 3 years ago • 15 comments

Idea / Feature

Dynamically generate TypeScript object definitions from cdp-backend Python DB models.

Use Case / User Story

As a developer I want to be able to add, remove, or update a database model in a single location rather than multiple.

Solution

Add a script to cdp-backend that when ran will generate a TypeScript package of the database models + extras that we can push to npm on new version push.

Alternatives

Stakeholders

Backend maintainers Frontend maintainers

Major Components

  • [ ] Database models TypeScript generation
  • [ ] Transcript File Model TypeScript generation
  • [ ] Database "ModelField" Python and TypeScript generation
  • [ ] Database constants TypeScript generation
  • [ ] script added as bin script to cdp-backend
  • [ ] task added to CI building and testing that attempts to generate these models on PR push / main build
  • [ ] task added to CI main building / publish job that pushes the generated TypeScript package dir to npm

Dependencies

Other Notes

evamaxfield avatar Aug 25 '21 06:08 evamaxfield