66 ExtensionFlavorValue ,
77} from './generate/extension.js'
88import { DeveloperPlatformClient } from '../utilities/developer-platform-client.js'
9+ import { formatProjectFollowUpCommand } from '../utilities/project-command.js'
910import { AppInterface , AppLinkedInterface } from '../models/app/app.js'
1011import { Project } from '../models/project/project.js'
1112import generateExtensionPrompts , {
@@ -16,12 +17,10 @@ import metadata from '../metadata.js'
1617import { ExtensionTemplate } from '../models/app/template.js'
1718import { ExtensionSpecification , RemoteAwareExtensionSpecification } from '../models/extensions/specification.js'
1819import { OrganizationApp } from '../models/organization.js'
19- import { PackageManager } from '@shopify/cli-kit/node/node-package-manager'
2020import { isShopify } from '@shopify/cli-kit/node/context/local'
2121import { joinPath } from '@shopify/cli-kit/node/path'
2222import { RenderAlertOptions , renderSuccess } from '@shopify/cli-kit/node/ui'
2323import { AbortError } from '@shopify/cli-kit/node/error'
24- import { formatPackageManagerCommand } from '@shopify/cli-kit/node/output'
2524import { groupBy } from '@shopify/cli-kit/common/collection'
2625
2726interface GenerateOptions {
@@ -56,7 +55,7 @@ async function generate(options: GenerateOptions) {
5655 const generateExtensionOptions = buildGenerateOptions ( promptAnswers , app , options , developerPlatformClient )
5756 const generatedExtension = await generateExtensionTemplate ( generateExtensionOptions )
5857
59- renderSuccessMessage ( generatedExtension , options . project . packageManager )
58+ renderSuccessMessage ( generatedExtension , options . project )
6059}
6160
6261async function buildPromptOptions (
@@ -128,12 +127,8 @@ function buildGenerateOptions(
128127 }
129128}
130129
131- function renderSuccessMessage ( extension : GeneratedExtension , packageManager : PackageManager ) {
132- const formattedSuccessfulMessage = formatSuccessfulRunMessage (
133- extension . extensionTemplate ,
134- extension . directory ,
135- packageManager ,
136- )
130+ function renderSuccessMessage ( extension : GeneratedExtension , project : Project ) {
131+ const formattedSuccessfulMessage = formatSuccessfulRunMessage ( extension . extensionTemplate , extension . directory , project )
137132 renderSuccess ( formattedSuccessfulMessage )
138133}
139134
@@ -153,7 +148,7 @@ function validateExtensionFlavor(extensionTemplate?: ExtensionTemplate, flavor?:
153148function formatSuccessfulRunMessage (
154149 extensionTemplate : ExtensionTemplate ,
155150 extensionDirectory : string ,
156- depndencyManager : PackageManager ,
151+ project : Project ,
157152) : RenderAlertOptions {
158153 const options : RenderAlertOptions = {
159154 headline : [ 'Your extension was created in' , { filePath : extensionDirectory } , { char : '.' } ] ,
@@ -164,7 +159,7 @@ function formatSuccessfulRunMessage(
164159 if ( extensionTemplate . type !== 'function' ) {
165160 options . nextSteps ! . push ( [
166161 'To preview this extension along with the rest of the project, run' ,
167- { command : formatPackageManagerCommand ( depndencyManager , 'shopify app dev' ) } ,
162+ { command : formatProjectFollowUpCommand ( project , 'shopify app dev' ) } ,
168163 ] )
169164 }
170165
0 commit comments