dbos-inc / dbos-transact

The TypeScript framework for backends that scale
https://docs.dbos.dev
MIT License
335 stars 22 forks source link

DBOSconfig contains undocumented parameters #414

Closed demetris-manikas closed 3 months ago

demetris-manikas commented 3 months ago

Hi. Looking at config.ts L20 and config.ts L204 I noticed the following :

One is that the dbClientMetadata variable has undocumented and not enforced expected structure. Namely

{
    entities: Array<string>
}

which apart from not being documented also leads to unneeded // eslint-disable-next-line comments in the code.

The other is that the application parameter is also declared as any although it too has an expected "structure" of object which is documented and enforced by the schema leading again to unneeded // eslint-disable-next-line comments

I have created a branch at my fork that you can preview the changes.

In that I also "fixed" the return type of (readFileSync)https://github.com/dbos-inc/dbos-transact/blob/0f40236023cf2460324a6e5b9e01bec73c4bd147/src/utils.ts#L10 to be just string and removed the related as string casts.

I can create a PR if you wish. Thanks

qianl15 commented 3 months ago

Thanks for reporting and nice fixes! Can you create a PR? The dbClientMetadata is no longer used so we can remove it completely. We'd be happy to review your contribution!

demetris-manikas commented 3 months ago

You are welcome! Following the path of reducing //eslint-disable comments I also made this. If you think it's worth it I'll make a PR for it too.

maxdml commented 3 months ago

The changes to reduce the eslint-disable look great too! Much cleaner code.