kanel
kanel copied to clipboard
Non-configurable result of generation
Some things make result little bit dirty and provide some functionality that can be unnecessary.
No way to disable:
- comments (indexes, defaults, primaries)
-
index.ts
at all - extra type
modelInitializer
- extra index types
type ModelId
,interface ModelIdTypeMap
type Initializer
- strange IDs with
__flavor
export type ModelId = number & { " __flavor"?: 'model_history' };
The index.ts file and the ModelId etc. types I will probably get rid of. It is there because this was extracted from some work I am doing and it is used there, but probably nobody else is.
Given you say that the flavored id types are "strange", I am curious if you know the purpose of the flavoring? If you are not familiar with the concept, you can read up on it here.
As for comments, others have asked for other changes so maybe there should be a hook that creates them. I can think about that.
I don't say if something usefull or not, but library should give choose for users, to give a solution for maximum use cases.
(for me is get a clear table columns types, and nothing more)
About flavoring, I should say that there also should a way to choose, because that policy can do not match with policy that already used in existent project (which is can be a target for this library).
This should finally be addressed :-)
There is a premajor version out that allows you to decide what you want your output to look like to quite a level of detail. There are significant breaking changes though, and the API is not final so feel free to experiment if you like. The documentation is work in progress still, you can start here: https://github.com/kristiandupont/kanel/blob/v3/docs/configuring.md