2021-06-03 03:36:25 +00:00
|
|
|
import {Template} from '../Template'
|
2021-06-02 01:59:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Template that generates a new Directive class in the app/directives directory.
|
|
|
|
*/
|
2021-06-03 03:36:25 +00:00
|
|
|
const templateDirective: Template = {
|
2021-06-02 01:59:40 +00:00
|
|
|
name: 'directive',
|
|
|
|
fileSuffix: '.directive.ts',
|
|
|
|
description: 'Create a new Directive class which adds functionality to the ./ex command.',
|
|
|
|
baseAppPath: ['directives'],
|
2021-06-03 03:36:25 +00:00
|
|
|
render(name: string) {
|
|
|
|
return `import {Directive, OptionDefinition, Injectable} from '@extollo/lib'
|
2021-06-02 01:59:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* ${name} Directive
|
|
|
|
* ---------------------------------------------------
|
|
|
|
* Put some description here.
|
|
|
|
*/
|
|
|
|
@Injectable()
|
|
|
|
export class ${name}Directive extends Directive {
|
|
|
|
getKeywords(): string | string[] {
|
|
|
|
return ['${name.toLowerCase()}']
|
|
|
|
}
|
|
|
|
|
|
|
|
getDescription(): string {
|
|
|
|
return ''
|
|
|
|
}
|
|
|
|
|
|
|
|
getOptions(): OptionDefinition[] {
|
|
|
|
return []
|
|
|
|
}
|
|
|
|
|
|
|
|
async handle(argv: string[]) {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`
|
2021-06-03 03:36:25 +00:00
|
|
|
},
|
2021-06-02 01:59:40 +00:00
|
|
|
}
|
|
|
|
|
2021-06-03 03:36:25 +00:00
|
|
|
export { templateDirective }
|