Last active
February 9, 2021 17:37
-
-
Save radekwarisch/f9abb184117daf710a8eb4e433663581 to your computer and use it in GitHub Desktop.
Schematic execute file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
schematicPipe, | |
chainifyGatherOptions, | |
copyTemplatesAnd, | |
mergeFilesAnd | |
} from './schematicUtils'; | |
import {gatherOptions} from './gatherOptions'; | |
import { | |
maybeExcludeTemplates, | |
overwriteEJSExtension | |
} from './copyTeplatePlugins'; | |
import { | |
lintFiles, | |
injectIntoParentComponent | |
} from './mergeFilesPlugins'; | |
export type ComponentSchemaType = { | |
name: string; | |
props?: string; | |
styles?: string; | |
tests?: boolean; | |
storybook?: boolean; | |
['parent-component-name']?: string; | |
}; | |
export const schematicComponent = (options: ComponentSchemaType) => | |
schematicPipe( | |
compose(chainifyGatherOptions, gatherOptions)(options), | |
copyTemplatesAnd([ | |
maybeExcludeTemplates, | |
overwriteEJSExtension | |
]), | |
mergeFilesAnd([ | |
lintFiles, | |
injectIntoParentComponent | |
]) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment