Skip to content

Not sure about implementation #26

@Dollique

Description

@Dollique

I have a question about how to implement the generated types into my project.
Not sure about in what ways Strapi can be used, but here is how I use it:

  • Strapi has its own repository and prod runs on a separate server from my project
  • My Project, which is a NuxtJS app, fetches the data from Strapi

To use the generated types, the only way I know is to copy each file from the Strapi project over to my apps types/ folder.

This itself isn't an issue, but when I look at the files, I can see that they itself import other Types:

import { Category } from '../../../category/content-types/category/category';
import { Media } from '../../../../common/schemas-to-ts/Media';
import { Color } from '../../../color/content-types/color/color';
import { Category_Plain } from '../../../category/content-types/category/category';
import { Color_Plain } from '../../../color/content-types/color/color';
import { AdminPanelRelationPropertyModification } from '../../../../common/schemas-to-ts/AdminPanelRelationPropertyModification';

And obviously all the paths will have to be adjusted to my project where all the files are in the same types/ folder.

Is this the expected way to do it, or am I missing something?
Also, each re-generation would mean, I'd have to adjust the paths again or copy the code by hand (instead of the copying the files).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions