@@ -109,12 +109,14 @@ const setControlValueAccessorReplacements = (
109109 * In Angular, you have to use a directive for this...
110110 * This is a workaround to replace it in the file.
111111 * @param replacements
112+ * @param outputFolder {string}
112113 * @param componentName {string}
113114 * @param upperComponentName {string}
114115 * @param directives {{name:string, ngContentName?:string}[] }
115116 */
116117const setDirectiveReplacements = (
117118 replacements ,
119+ outputFolder ,
118120 componentName ,
119121 upperComponentName ,
120122 directives
@@ -164,15 +166,26 @@ export class ${directive.name}Directive {}
164166 from : '} from "@angular/core";' ,
165167 to : 'ContentChild, TemplateRef } from "@angular/core";'
166168 } ) ;
169+
170+ const directiveExports = directives
171+ . map (
172+ ( directive ) =>
173+ `export * from './components/${ componentName } /${ directive . name } .directive';`
174+ )
175+ . join ( '\n' ) ;
176+ Replace . sync ( {
177+ files : `../../${ outputFolder } /angular/src/index.ts` ,
178+ from : `export * from './components/${ componentName } ';` ,
179+ to : `export * from './components/${ componentName } ';\n${ directiveExports } `
180+ } ) ;
167181} ;
168182
169183module . exports = ( tmp ) => {
184+ const outputFolder = `${ tmp ? 'output/tmp' : 'output' } ` ;
170185 for ( const component of components ) {
171186 const componentName = component . name ;
172187 const upperComponentName = `DB${ getComponentName ( component . name ) } ` ;
173- const file = `../../${
174- tmp ? 'output/tmp' : 'output'
175- } /angular/src/components/${ componentName } /${ componentName } .ts`;
188+ const file = `../../${ outputFolder } /angular/src/components/${ componentName } /${ componentName } .ts` ;
176189 const options = {
177190 files : file ,
178191 processor : ( input ) => changeFile ( component , input )
@@ -206,6 +219,7 @@ module.exports = (tmp) => {
206219 if ( component . config ?. angular ?. directives ?. length > 0 ) {
207220 setDirectiveReplacements (
208221 replacements ,
222+ outputFolder ,
209223 componentName ,
210224 upperComponentName ,
211225 component . config . angular . directives
0 commit comments