erikvullings / strapi-to-typescript

Convert the strapi models to typescript.
MIT License
153 stars 32 forks source link

component with the same name not created #43

Open haegemonia76 opened 3 years ago

haegemonia76 commented 3 years ago

I have two components who do have the same name but not in the same category. Unfortunately, none of them are created, thus replaced by "any" inside my dynamiczone interface.

Is it possible to tackle this with one of the functions available in the stsconfig or is that currently impossible?

// .stsconfig
module.exports = {
  input: [
    './api',
    './node_modules/strapi-plugin-users-permissions',
    './node_modules/strapi-plugin-upload',
    './node_modules/strapi-plugin-i18n',
  ],
  components: './Strapi/components',
  output: './sts/',
  enum: true,
  nested: false,
  fieldType: (fieldType, fieldName) => {
    if (fieldName === 'id') return number;
    if (fieldType === 'datetime' || fieldType === 'date') return string;
  }
}
aperron commented 3 years ago

Hello, sorry but i no longer actively use Strapi. If you find a bug please follow this instruction or, better, create a pull request to fix it and I will integrate it asap .