Skip to content

Types are not generated correctly when using Component restriction based on Tags #172

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

Open
hey-cwuerzlhuber opened this issue Apr 14, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@hey-cwuerzlhuber
Copy link

hey-cwuerzlhuber commented Apr 14, 2025

Current behavior:
When using the pull-components and generate-typescript-typedefs it's not possible to get proper types for component groups, when using restriction based on tags. Types for sub Blocks will be generated with unknown, which is not the case, when using component whitelisting based on component, or based on folder.

Expected behavior:
Component groups based on Tags are correctly resolved (like folder component groups), and types are generated accordingly.

Steps to reproduce:

  1. Setup a Tag and assign it to one or multiple components in the Block Library
  2. Open a Page Content Type Block and assign a Blocks field type and check "Allow only specific components to be inserted" and selected created Tag
  3. Download component specification via the cli by running the pull-components command
  4. Generate type definitions by running the generate-typescript-typedefs command
  5. Block field will be typed with unknown[]

Related code:

Generated Code:

export interface SbContentPage {
  headline?: string
  subline?: string
  content?: unknown[]
  component: 'content_page'
  _uid: string
}
@hey-cwuerzlhuber hey-cwuerzlhuber added the bug Something isn't working label Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant