mrjono1 / joi-to-typescript

Convert Joi Schemas to TypeScript interfaces
MIT License
125 stars 39 forks source link

Support new settings `interfaceFileSuffix` and `omitIndexFiles` #344

Closed cmaster11 closed 1 year ago

cmaster11 commented 1 year ago

As per readme entries:

  /**
   * If provided, appends this suffix to the generated interface filenames
   * @default ""
   */
  interfaceFileSuffix: string;
  /**
   * If true, skips the creation of index.ts files in the generated interface directories
   * @default false
   */
  omitIndexFiles: boolean

The use case for me has been:

  1. I want to generate infrastructure files in the same folder as the schemas without the risk of overwriting any existing files. I use the suffix setting to mark what has been generated dynamically and any index.ts files I have I will edit manually.
mrjono1 commented 1 year ago

looks great I'll get this released soon

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (44c4028) 98.62% compared to head (c0c4e82) 98.62%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #344 +/- ## ======================================= Coverage 98.62% 98.62% ======================================= Files 9 9 Lines 508 508 Branches 194 194 ======================================= Hits 501 501 Misses 7 7 ``` | [Files Changed](https://app.codecov.io/gh/mrjono1/joi-to-typescript/pull/344?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jono) | Coverage Δ | | |---|---|---| | [src/index.ts](https://app.codecov.io/gh/mrjono1/joi-to-typescript/pull/344?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jono#diff-c3JjL2luZGV4LnRz) | `100.00% <ø> (ø)` | | | [src/types.ts](https://app.codecov.io/gh/mrjono1/joi-to-typescript/pull/344?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jono#diff-c3JjL3R5cGVzLnRz) | `100.00% <ø> (ø)` | | | [src/convertFilesInDirectory.ts](https://app.codecov.io/gh/mrjono1/joi-to-typescript/pull/344?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jono#diff-c3JjL2NvbnZlcnRGaWxlc0luRGlyZWN0b3J5LnRz) | `100.00% <100.00%> (ø)` | | | [src/write.ts](https://app.codecov.io/gh/mrjono1/joi-to-typescript/pull/344?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jono#diff-c3JjL3dyaXRlLnRz) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

cmaster11 commented 1 year ago

looks great I'll get this released soon

Nice! :D

mrjono1 commented 1 year ago

release in progress https://github.com/mrjono1/joi-to-typescript/releases/tag/4.5.0