prismicio / prismic-types

Type definitions for Prismic content, models, and APIs
https://prismic.io/docs/technologies/javascript
Apache License 2.0
11 stars 4 forks source link

refactor: organize types by kind #48

Closed angeloashmore closed 2 years ago

angeloashmore commented 2 years ago

Types of changes

Description

This PR further re-organizes all types into the following categories, each with their own directory:

Within each directory, individual files contain a single concept. A kind of field, for example, is a concept.

It splits up previously grouped concepts, like Link and Link to Media fields, into their own files. See src/value/link.ts and src/value/linkToMedia.ts for an example.

This organization is modeled after @prismicio/mock (see the src directory there).

Field renames

The following types were renamed to better represent their underlying concept:

The old names are still exported as aliases, but perhaps they could be removed in šŸ’„ The Big Merge.

Checklist:

šŸˆ

angeloashmore commented 2 years ago

Adjusted src/index.ts to export all of the types directly rather than indirectly via export *.

I think I prefer the new way. What do you think, @lihbr? Keep in mind that the nested index.ts files have been removed to reduce the maintenance burden.

lihbr commented 2 years ago

I think I prefer the new version too.

Good to merge?

angeloashmore commented 2 years ago

Yup! I think itā€™s at a good point.