types-4-strapi-2
types-4-strapi-2 copied to clipboard
Multiple Plugins with content types with the same name leads to problems
Description
Let's say a strapi project uses 2 different types of plugins, e.g. nav1
and nav2
which both export some content type Navigation
Generating types for the project:
$ npx t4s --reader load-strapi --delete-old --in . --out src/generated/types/
Problem
Invalid output.
src/generated/types/
contains only one file named Navigation.ts
. Its content contains a mess (invalid Typescript code). Seems like it was concurrently written by 2 threads without proper synchronizisation.
Suggestion:
- Prefix output files with the plugin names.
- Add command line options to include / exclude plugins