storyblok-cli icon indicating copy to clipboard operation
storyblok-cli copied to clipboard

[Feature Request] CLI `pull-components` should include datasource values

Open madebyfabian opened this issue 1 year ago • 3 comments

I want to have generated types for my Storyblok components. Since Storyblok doesn't provide such option, I am using https://github.com/dohomi/storyblok-generate-ts with:

$ storyblok pull-components --space=[SPACE_ID]

This mostly works fine. But the issue is that fields which use datasources are not correctly typed. This is due to the fact that the JSON payload from the pull-components command is:

"schema": {
  "versusCategory": {
    "datasource_slug": "versuscategory",
    "...": "..."
  }
},

while it lists the name of the datasource, there is no way for me to see the possible values of it.

I think there is a possibility to get those via the HTTP API, but in my opinion this should be generated within the CLI, without the need of external API requests.

Related issue: https://github.com/dohomi/storyblok-generate-ts/issues/40

madebyfabian avatar May 19 '23 07:05 madebyfabian