Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(next): interface prefix for generated types #10691

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ivoilic
Copy link

@ivoilic ivoilic commented Jan 21, 2025

What?

This adds the option to set an interface prefix in the typescript section of the config. This prefix is then added to the start of all interfaces in the generated types.

Why?

Users may want to use the generated types themselves and prefixing them allows them to be distinct from other types in their app. (Ex: Users vs PayloadUsers or CMSUsers)

How?

This PR adds the new optional property to the config and then uses it inside of entityToJSONSchema where it is appended to the front of the generated interface name. Please note that this update does not append the prefix to manually defined interface names provided in the schema for greater flexibility.

@ivoilic ivoilic changed the title feat: Interface Prefix for Generated Types feat(types): Interface Prefix for Generated Types Jan 21, 2025
@ivoilic ivoilic changed the title feat(types): Interface Prefix for Generated Types feat(next): Interface Prefix for Generated Types Jan 21, 2025
@ivoilic ivoilic changed the title feat(next): Interface Prefix for Generated Types feat(next): interface prefix for generated types Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant