linefusion / indirectus

20 stars 6 forks source link
cli codegen directus extension schema type-generator

Indirectus

Overview

Just some Directus stuff.

Type Generator

So, this is my take on the code generation for Directus, releasing it to catch some early bugs that might happen.

Overview

Right now it's pretty simple and it's just going to output some types and utility functions that are compatible with the current Directus SDK, but it was designed to support custom outputs (because I use Directus in several different languages). Right now I won't expand (or document) on the templating side, because I still need to get to the final data model and make it stable to export to the template engine.

Execution

npx indirectus sdk generate --url http://localhost:8055 --token <some-static-token-with-admin-privileges>

Output

A local .directus folder will be created containing schema cache + the generated client output.

The .directus/generated/client.ts exports:

Links

Contributing

Easiest way to develop, build and test is: