We need absolutly to work with typescript for generated slice machines.
We are using nextjs project.
prismic-ts-codegen generate us just a file types.generated.ts.
It seem there is solution for automatic generation of TSX files for slice machine.
Please what we need to do ?
Hey team! We're glad to announce that Slice Machine v0.5.1 is out !!
Let's celebrate the native support of TypeScript Types in Slice Machine! And a lot of cool UX/UI improvements and bug fixes!
Big shoutout to the whole team and @haberer.lucie and @angeloashmore for their contribution with the TS integration.
Now, let's play with it and make great websites! Full changelog here.
@Phil Amazing.
I had missed something for sure.
I'm based from the last next demo project and upgraded slice machine version to 0.5.1 and and I have installed "@prismicio/types": "^0.2.3" and all last packages versions.
Content object is not recognized automatically with import { Content } from "@prismicio/client";
Any idea ?
I'm not 100% sure @ali I haven't had time to test this myself. You can check out the new docs to see if that helps. If not I'll reach out to the team for more help.
We noticed that one and turns out we overlooked the location of generated types with the tsconfig.json
You should be able to fix it by adding this option to your tsconfig.json:
"include": [
"./.slicemachine/prismicio.d.ts"
]
Then after adding that, CMD+SHIFT+P -> TypeScript: Reload Project