1- import React , { useReducer } from 'react' ;
2- import { Text } from 'ink' ;
1+ import React , { useReducer , useRef } from 'react' ;
2+ import { Box , Text } from 'ink' ;
33import {
44 InitialProjectConfiguration ,
55 ProjectConfiguration ,
@@ -71,6 +71,7 @@ export default function App({ name = 'my-admin' }: Props) {
7171 ...InitialProjectConfiguration ,
7272 name,
7373 } ) ;
74+ const helpMessages = useRef ( [ ] ) ;
7475 const installDeps = useInstallDeps ( ) ;
7576 const handleSubmit = ( value : any ) => {
7677 dispatch ( { value } ) ;
@@ -86,7 +87,8 @@ export default function App({ name = 'my-admin' }: Props) {
8687 return < StepResources onSubmit = { handleSubmit } /> ;
8788 }
8889 if ( state . step === 'generate' ) {
89- generateProject ( state ) . then ( ( ) => {
90+ generateProject ( state ) . then ( messages => {
91+ helpMessages . current = messages ;
9092 dispatch ( { } ) ;
9193 } ) ;
9294 return < Text > Generating your application...</ Text > ;
@@ -102,17 +104,24 @@ export default function App({ name = 'my-admin' }: Props) {
102104 }
103105 return (
104106 < >
105- < Text >
106- Your application < Text bold > { state . name } </ Text > was successfully
107- generated.
108- </ Text >
107+ < Box marginBottom = { 1 } >
108+ < Text >
109+ Your application < Text bold > { state . name } </ Text > was
110+ successfully generated.
111+ </ Text >
112+ </ Box >
109113 < Text >
110114 To start working, run < Text bold > cd { state . name } </ Text > .
111115 </ Text >
112116 < Text >
113117 Start the app in development mode by running{ ' ' }
114118 < Text bold > npm dev</ Text > .
115119 </ Text >
120+ < Box marginBottom = { 1 } >
121+ { helpMessages . current . map ( line => (
122+ < Text key = { line } > { line } </ Text >
123+ ) ) }
124+ </ Box >
116125 </ >
117126 ) ;
118127}
0 commit comments