You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import {Template} from "../Template"
|
|
|
|
import {UniversalPath} from "@extollo/util"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Template that generates a new Directive class in the app/directives directory.
|
|
|
|
*/
|
|
|
|
const directive_template: Template = {
|
|
|
|
name: 'directive',
|
|
|
|
fileSuffix: '.directive.ts',
|
|
|
|
description: 'Create a new Directive class which adds functionality to the ./ex command.',
|
|
|
|
baseAppPath: ['directives'],
|
|
|
|
render(name: string, fullCanonicalName: string, targetFilePath: UniversalPath) {
|
|
|
|
return `import {Directive, OptionDefinition} from "@extollo/cli"
|
|
|
|
import {Injectable} from "@extollo/di"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ${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[]) {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export { directive_template }
|