scottdurow / dataverse-gen

Early-bound types generator for CDS/Dataverse
MIT License
20 stars 9 forks source link

Adds an index.ts file to the generated library for easy use of all types #21

Closed nhance closed 1 year ago

nhance commented 2 years ago

With the addition of the index.ts file users can now use any type provided by this library without needing to import a specific sub-module.

For example:

import { Account } from './dataverse-gen';

vs

import { Account } from './dataverse-gen/entities/Account';

This is useful because it decreases the knowledge necessary and allows all exports to be exposed and browsed from a single file so future developers can easily understand the full scope of what is available.

scottdurow commented 2 years ago

Thanks for this - I'll get this merged into version 2 which should hopefully be in a stable beta state in the next week or so.

I was thinking about adding the ability to define an ejs script that outputs the files to create with the specific templates to use - this would actually enable this to be done without the change to the code - and also support other custom scripts. What do you think?

nhance commented 2 years ago

That sounds like an awesome idea, but I'm not sure I can see the vision in your head.

Ideally the dataverse-gen provides a black box output of all of the configured entities and etc so that when I want to use it in my app I don't have to know anything about the internal implementation.

scottdurow commented 2 years ago

Thanks @nhance - valid point. My main thinking was to support ppl who were not using dataverse-ify but instead wanted a different style of types - I'll keep it on the back burner for now!