Skip to content

Commit

Permalink
Skip host theme generation when theme flag is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmengo committed Jul 9, 2024
1 parent 8a04efd commit 288fb98
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {Theme} from '@shopify/cli-kit/node/themes/types'
interface PreviewThemeAppExtensionsOptions {
adminSession: AdminSession
developerPlatformClient: DeveloperPlatformClient
theme?: string
themeId?: string
themeExtensionPort?: number
}

Expand All @@ -20,15 +20,14 @@ export interface PreviewThemeAppExtensionsProcess extends BaseProcess<PreviewThe
const runThemeAppExtensionsServerNext: DevProcessFunction<PreviewThemeAppExtensionsOptions> = async (
{stdout: _stdout, stderr: _stderr, abortSignal: _abortSignal},
{
adminSession,
adminSession: _adminSession,
developerPlatformClient: _developerPlatformClient,
theme: _theme,
themeId: _themeId,
themeExtensionPort: _themeExtensionPort,
},
) => {
outputInfo('This feature is currently in development and is not ready for use or testing yet.')

await findOrCreateHostTheme(adminSession)
await initializeFSWatcher()
await startThemeAppExtensionDevelopmentServer()
}
Expand All @@ -54,14 +53,16 @@ export async function setupPreviewThemeAppExtensionsProcess({

const adminSession = await ensureAuthenticatedAdmin(storeFqdn)

const themeId = theme ? theme : (await findOrCreateHostTheme(adminSession)).id.toString()

return {
type: 'theme-app-extensions',
prefix: 'theme-extensions',
function: runThemeAppExtensionsServerNext,
options: {
adminSession,
developerPlatformClient,
theme,
themeId,
themeExtensionPort,
},
}
Expand Down

0 comments on commit 288fb98

Please sign in to comment.