File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/cli/src/commands/types/generate Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -381,13 +381,17 @@ export const generateTypes = async (
381381
382382 return componentSchema ;
383383 } ) ;
384+ const resolvedComponentsSchema = await Promise . all ( componentsSchema ) ;
385+
384386 const datasourcesSchema = spaceData . datasources . map ( async ( datasource ) => {
387+ const allComponentTypes = resolvedComponentsSchema . map ( schema => schema . title ) ;
388+
385389 const enumValues : string [ ] | undefined = datasource . entries
386390 ?. filter ( d => d . value )
387391 . map ( d => d . value ! ) ;
388392 const type = getDatasourceTypeTitle ( datasource . slug ) ;
389393 // Check for conflicts with existing component types
390- if ( storyblokPropertyTypes . has ( type ) ) {
394+ if ( allComponentTypes . includes ( type ) ) {
391395 console . warn ( `Warning: Datasource type "${ type } " conflicts with existing component type` ) ;
392396 }
393397 const datasourceSchema : JSONSchema = {
@@ -398,8 +402,8 @@ export const generateTypes = async (
398402 } ;
399403 return datasourceSchema ;
400404 } ) ;
401- const resolvedComponentsSchema = await Promise . all ( componentsSchema ) ;
402405 const resolvedDatasourcesSchema = await Promise . all ( datasourcesSchema ) ;
406+
403407 const contentTypeSchema : JSONSchema = {
404408 $id : `#/ContentType` ,
405409 title : 'ContentType' ,
You can’t perform that action at this time.
0 commit comments