File tree 1 file changed +2
-13
lines changed
1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -92,18 +92,6 @@ const makeBeforeEach = (beforeEachPrefixer: FilePrefixer) => {
92
92
const makeArray = ( templateResult : TemplateResult ) =>
93
93
Array . isArray ( templateResult ) ? templateResult : [ templateResult ] ;
94
94
95
- // copied from csf-tools, as it's not exported
96
- function parseTags ( prop : t . Node ) {
97
- if ( ! t . isArrayExpression ( prop ) ) {
98
- throw new Error ( 'CSF: Expected tags array' ) ;
99
- }
100
-
101
- return prop . elements . map ( ( e ) => {
102
- if ( t . isStringLiteral ( e ) ) return e . value ;
103
- throw new Error ( `CSF: Expected tag to be string literal` ) ;
104
- } ) as string [ ] ;
105
- }
106
-
107
95
export const transformCsf = (
108
96
code : string ,
109
97
{
@@ -128,7 +116,8 @@ export const transformCsf = (
128
116
if ( annotations ?. play ) {
129
117
acc [ key ] . play = annotations . play ;
130
118
}
131
- acc [ key ] . tags = annotations . tags ? parseTags ( annotations . tags ) : csf . meta . tags || [ ] ;
119
+
120
+ acc [ key ] . tags = csf . _stories [ key ] . tags || csf . meta . tags || [ ] ;
132
121
return acc ;
133
122
} , { } as Record < string , { play ?: t . Node ; tags ?: string [ ] } > ) ;
134
123
You can’t perform that action at this time.
0 commit comments