Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
madebyfabian opened this issue May 19, 2023 · 3 comments
Labels
feature [Issue] New feature or request

Comments

@madebyfabian
Copy link

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:
dohomi/storyblok-generate-ts#40

@madebyfabian madebyfabian added the bug Something isn't working label May 19, 2023
@madebyfabian madebyfabian changed the title [Feature Request] CLI [Feature Request] CLI pull-components should include datasource values May 19, 2023
@ademarCardoso
Copy link
Member

Hi @madebyfabian i liked the idea, and this issue has a lot of 👍🏼 i will open a task to implement this feature in our CLI 😄

@ademarCardoso ademarCardoso added enhancement and removed bug Something isn't working labels Aug 8, 2023
@jsve
Copy link

jsve commented Aug 22, 2023

I have the same issue. In addition: this limitation (datasources not being pulled on pull-components) limits how useful the push-component functionality is. As indicated here you should be able to push the components to another space. If the components use datasources there is need for a manual step as well, which is undocumented and not ideal.

@RKcode
Copy link
Contributor

RKcode commented Apr 8, 2024

Hey @ademarCardoso,

I've opened a PR for this issue. A new CLI option to resolve the linked datasource directly in the options of an single/multiple field.

My PR doesn't really solve @jsve issue. You can still sync --type datasources before push-components, else it will still require a really small manual action if you want to have source: self instead of source: internal (datasources).

@alvarosabu alvarosabu added feature [Issue] New feature or request and removed enhancement labels Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature [Issue] New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants