11
22import _ from 'lodash' ;
33import chalk from 'chalk' ;
4- import inquirer from 'inquirer' ;
54import spawn from 'cross-spawn' ;
65import sortOn from 'sort-on' ;
76import figures from 'figures' ;
@@ -29,7 +28,11 @@ const OFFICIAL_GENERATORS = new Set([
2928 'generator-webapp' ,
3029] ) ;
3130
32- export const install = app => inquirer . prompt ( [ {
31+ /**
32+ * @param {import('../router.js').default } app
33+ * @returns
34+ */
35+ export const install = app => app . adapter . prompt ( [ {
3336 name : 'searchTerm' ,
3437 message : 'Search npm for generators:' ,
3538} ] ) . then ( answers => searchNpm ( app , answers . searchTerm ) ) ;
@@ -72,6 +75,10 @@ async function searchNpm(app, term) {
7275 return promptInstallOptions ( app , sortOn ( packages , [ 'official' , 'name' ] ) ) ;
7376}
7477
78+ /**
79+ * @param {import('../router.js').default } app
80+ * @returns
81+ */
7582function promptInstallOptions ( app , choices ) {
7683 let introMessage = 'Sorry, no results matches your search term' ;
7784
@@ -92,7 +99,7 @@ function promptInstallOptions(app, choices) {
9299 } ] ,
93100 } ] ;
94101
95- return inquirer . prompt ( resultsPrompt ) . then ( answer => {
102+ return app . adapter . prompt ( resultsPrompt ) . then ( answer => {
96103 if ( answer . toInstall === 'home' || answer . toInstall === 'install' ) {
97104 return app . navigate ( answer . toInstall ) ;
98105 }
0 commit comments