File tree Expand file tree Collapse file tree
templates/package-builder/src/yeoman Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ import * as glob from 'glob';
55const yosay = require ( 'yosay' ) ;
66const toPascalCase = require ( 'to-pascal-case' ) ;
77
8+ type YeomanPrompt = ( opt : yeoman . IPromptOptions | yeoman . IPromptOptions [ ] , callback : ( answers : any ) => void ) => void ;
9+ const optionOrPrompt : YeomanPrompt = require ( 'yeoman-option-or-prompt' ) ;
10+
811const templates = [
912 { value : 'angular-2' , name : 'Angular 2' } ,
1013 { value : 'knockout' , name : 'Knockout' } ,
@@ -14,16 +17,18 @@ const templates = [
1417
1518class MyGenerator extends yeoman . Base {
1619 private _answers : any ;
20+ private _optionOrPrompt : YeomanPrompt ;
1721
1822 constructor ( args : string | string [ ] , options : any ) {
1923 super ( args , options ) ;
24+ this . _optionOrPrompt = optionOrPrompt ;
2025 this . log ( yosay ( 'Welcome to the ASP.NET Core Single-Page App generator!' ) ) ;
2126 }
2227
2328 prompting ( ) {
2429 const done = this . async ( ) ;
2530
26- this . prompt ( [ {
31+ this . _optionOrPrompt ( [ {
2732 type : 'list' ,
2833 name : 'framework' ,
2934 message : 'Framework' ,
Original file line number Diff line number Diff line change 11{
22 "name" : " generator-aspnetcore-spa" ,
3- "version" : " 0.2.6 " ,
3+ "version" : " 0.2.7 " ,
44 "description" : " Single-Page App templates for ASP.NET Core" ,
55 "author" : " Microsoft" ,
66 "license" : " Apache-2.0" ,
1515 "node-uuid" : " ^1.4.7" ,
1616 "to-pascal-case" : " ^1.0.0" ,
1717 "yeoman-generator" : " ^0.20.2" ,
18+ "yeoman-option-or-prompt" : " ^1.0.2" ,
1819 "yosay" : " ^1.1.1"
1920 }
2021}
You can’t perform that action at this time.
0 commit comments