11import { themeFlags } from '../../flags.js'
2- import ThemeCommand from '../../utilities/theme-command.js'
2+ import ThemeCommand , { RequiredFlags } from '../../utilities/theme-command.js'
33import { profile } from '../../services/profile.js'
4- import { ensureThemeStore } from '../../utilities/theme-store.js'
54import { findOrSelectTheme } from '../../utilities/theme-selector.js'
65import { renderTasksToStdErr } from '../../utilities/theme-ui.js'
76import { validateThemePassword } from '../../services/flags-validation.js'
8- import { ensureAuthenticatedThemes } from '@shopify/cli-kit/node/session'
97import { Flags } from '@oclif/core'
108import { globalFlags , jsonFlag } from '@shopify/cli-kit/node/cli'
119import { Task } from '@shopify/cli-kit/node/ui'
10+ import { InferredFlags } from '@oclif/core/interfaces'
11+ import { AdminSession } from '@shopify/cli-kit/node/session'
1212
13+ type ProfileFlags = InferredFlags < typeof Profile . flags >
1314export default class Profile extends ThemeCommand {
1415 static summary = 'Profile the Liquid rendering of a theme page.'
1516
@@ -41,15 +42,13 @@ export default class Profile extends ThemeCommand {
4142 ...jsonFlag ,
4243 }
4344
44- async run ( ) : Promise < void > {
45- const { flags} = await this . parse ( Profile )
45+ static multiEnvironmentsFlags : RequiredFlags = null
4646
47- validateThemePassword ( flags . password )
48-
49- const store = ensureThemeStore ( flags )
47+ async command ( flags : ProfileFlags , adminSession : AdminSession ) {
5048 const { password : themeAccessPassword } = flags
5149
52- const adminSession = await ensureAuthenticatedThemes ( store , themeAccessPassword )
50+ validateThemePassword ( themeAccessPassword )
51+
5352 let filter
5453 if ( flags . theme ) {
5554 filter = { filter : { theme : flags . theme } }
@@ -60,7 +59,7 @@ export default class Profile extends ThemeCommand {
6059
6160 const tasks : Task [ ] = [
6261 {
63- title : `Generating Liquid profile for ${ store + flags . url } ` ,
62+ title : `Generating Liquid profile for ${ adminSession . storeFqdn } ${ flags . url } ` ,
6463 task : async ( ) => {
6564 await profile (
6665 adminSession ,
0 commit comments