You can inspect all interfaces in the generated output of your file. From now on all your components blocks will be type safe (even if you use the custom blocks of Storyblok).
Resolve relations
If you use resolve_relations you can simply extend your required schema to support fully typed relations.
dohomi/storyblok-generate-ts
storyblok-generate-ts
This plugin uses
json-schema-to-typescript
to generate TS types based onStoryblok
components. You can install and run it as a CLI script1. Prepare the use of this script
a) Fetch your schema with Storyblok CLI
b) Install this library as devDependency
c) Create node script inside of your package.json scripts
Properties of CLI
Alternative to CLI script: create a NodeJS javascript file
Example:
3. Run your script
Example Custom Parser
Inspect your generated file
You can inspect all interfaces in the generated output of your file. From now on all your components blocks will be type safe (even if you use the custom blocks of Storyblok).
Resolve relations
If you use
resolve_relations
you can simply extend your required schema to support fully typed relations.Example:
resolve_relations: "page.author,page.categories,page.tags"
CHANGELOG
seo-metatags