@@ -2,7 +2,6 @@ import { createWriteStream } from 'node:fs';
22import { pipeline } from 'node:stream/promises' ;
33
44import { Separator } from '@inquirer/core' ;
5- import chalk from 'chalk' ;
65
76import type { Manifest , Template } from '@apify/actor-templates' ;
87
@@ -66,6 +65,37 @@ export async function enhanceReadmeWithLocalSuffix(readmePath: string, manifestP
6665 }
6766}
6867
68+ export function formatCreateSuccessMessage ( params : {
69+ actorName : string ;
70+ dependenciesInstalled : boolean ;
71+ postCreate ?: string | null ;
72+ gitRepositoryInitialized ?: boolean ;
73+ installCommandSuggestion ?: string | null ;
74+ } ) {
75+ const { actorName, dependenciesInstalled, postCreate, gitRepositoryInitialized, installCommandSuggestion } = params ;
76+
77+ let message = `✅ Actor '${ actorName } ' created successfully!` ;
78+
79+ if ( dependenciesInstalled ) {
80+ message += `\n\nNext steps:\n\ncd '${ actorName } '\napify run` ;
81+ } else {
82+ const installLine = installCommandSuggestion || 'install dependencies with your package manager' ;
83+ message += `\n\nNext steps:\n\ncd '${ actorName } '\n${ installLine } \napify run` ;
84+ }
85+
86+ message += `\n\n💡 Tip: Use 'apify push' to deploy your Actor to the Apify platform\n📖 Docs: https://docs.apify.com/platform/actors/development` ;
87+
88+ if ( gitRepositoryInitialized ) {
89+ message += `\n🌱 Git repository initialized in '${ actorName } '. You can now commit and push your Actor to Git.` ;
90+ }
91+
92+ if ( postCreate ) {
93+ message += `\n\n${ postCreate } ` ;
94+ }
95+
96+ return message ;
97+ }
98+
6999/**
70100 * Inquirer does not have a native way to "go back" between prompts.
71101 */
@@ -75,7 +105,7 @@ async function executePrompts(manifest: Manifest) {
75105 while ( true ) {
76106 const templateDefinition = await promptTemplateDefinition ( manifest , programmingLanguage ) ;
77107 if ( templateDefinition ) {
78- const shouldInstall = await promptTemplateInstallation ( templateDefinition ) ;
108+ const shouldInstall = await promptTemplateInstallation ( ) ;
79109 if ( shouldInstall ) {
80110 return templateDefinition ;
81111 }
@@ -134,8 +164,7 @@ async function promptTemplateDefinition(manifest: Manifest, programmingLanguage:
134164 ] ;
135165
136166 const templateDefinition = await useSelectFromList ( {
137- message :
138- 'Choose a template for your new Actor. Detailed information about the template will be shown in the next step.' ,
167+ message : 'Choose a template for your new Actor. You can check more information at https://apify.com/templates.' ,
139168 default : choices [ 0 ] ,
140169 choices,
141170 loop : false ,
@@ -145,20 +174,15 @@ async function promptTemplateDefinition(manifest: Manifest, programmingLanguage:
145174 return templateDefinition ;
146175}
147176
148- async function promptTemplateInstallation ( templateDefinition : Template ) {
177+ async function promptTemplateInstallation ( ) {
149178 const choices : ChoicesType < boolean > = [
150- { name : `Install template ` , value : true } ,
179+ { name : `Install dependencies ` , value : true } ,
151180 new Separator ( ) ,
152181 { name : 'Go back' , value : false } ,
153182 ] ;
154183
155- const label = chalk . underline ( templateDefinition . label ) ;
156- const description = chalk . dim ( templateDefinition . description ) ;
157- const suffix = `\n ${ label } :\n ${ description } ` ;
158- const message = `Do you want to install the following template?${ suffix } ` ;
159-
160184 const answer = await useSelectFromList < boolean > ( {
161- message,
185+ message : 'Almost done! Last step is to install dependencies.' ,
162186 default : choices [ 0 ] ,
163187 choices,
164188 loop : false ,
0 commit comments