Closed seanlail closed 2 years ago
I think the issue is here https://github.com/prismicio/prismic-ts-codegen/blob/0953400db747a111fa68385a518ae190da1d929f/src/cli/loadModels.ts#L85-L86
Those arrays need to be sorted by id perhaps?
You're 100% right; the models need to be sorted before generating types.
I opened a PR with the fix and left details in the description here: #9
The fix has been published in v0.0.3
. 🎉
To upgrade, install the latest version and re-generate your types:
npm install prismic-ts-codegen@latest
npx prismic-ts-codegen
Versions
Reproduction
The only way to reproduce this is to have 2 documents in Prismic dashboard and then make a change.
Steps to reproduce
prismic-ts-codegen
prismic-ts-codegen
What is expected?
Generate type should only slightly change (based on change in step 3)
What is actually happening?
Order of the documents has changed and so the rendered output has a much larger diff than needed.
As with others, I'm happy to take a look at this.