Created
March 25, 2021 15:16
-
-
Save vsavkin/321f9ccbf2e0a4df58620a505c7521e9 to your computer and use it in GitHub Desktop.
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
// Nx Devkit | |
export default async function (tree: Tree, options: Schema) { | |
generateFiles( | |
tree, | |
join(__dirname, 'files'), | |
join('tools/generators', options.name), | |
options | |
); | |
await formatFiles(tree); | |
} | |
// Angular Devkit | |
export default function (options: Schema): Rule { | |
const templateSource = apply(url('./files'), [ | |
template({ | |
dot: '.', | |
tmpl: '', | |
...(options as any), | |
}), | |
move(join('tools/generators', options.name)), | |
]); | |
return chain([ | |
branchAndMerge(chain([mergeWith(templateSource)])), | |
formatFiles(options), | |
]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment