@@ -12,7 +12,6 @@ import {ExtensionInstance} from '../../models/extensions/extension-instance.js'
1212import { AbortSignal } from '@shopify/cli-kit/node/abort'
1313import { outputDebug } from '@shopify/cli-kit/node/output'
1414import { DotEnvFile } from '@shopify/cli-kit/node/dot-env'
15- import { getArrayRejectingUndefined } from '@shopify/cli-kit/common/array'
1615import { Writable } from 'stream'
1716
1817export interface ExtensionDevOptions {
@@ -36,7 +35,8 @@ export interface ExtensionDevOptions {
3635 buildDirectory ?: string
3736
3837 /**
39- * The extension to be built.
38+ * All real extensions in the app, including non-previewable ones (e.g., admin config).
39+ * Previewable extensions are filtered internally for the UI payload.
4040 */
4141 extensions : ExtensionInstance [ ]
4242
@@ -113,11 +113,6 @@ export interface ExtensionDevOptions {
113113 * The app watcher that emits events when the app is updated
114114 */
115115 appWatcher : AppEventWatcher
116-
117- /**
118- * Map of asset key to absolute directory path for app-level assets (e.g., admin static_root)
119- */
120- appAssets ?: Record < string , string >
121116}
122117
123118export async function devUIExtensions ( options : ExtensionDevOptions ) : Promise < void > {
@@ -132,14 +127,14 @@ export async function devUIExtensions(options: ExtensionDevOptions): Promise<voi
132127 const bundlePath = payloadOptions . appWatcher . buildOutputPath
133128 const payloadStoreRawPayload = await getExtensionsPayloadStoreRawPayload ( payloadOptions , bundlePath )
134129 const payloadStore = new ExtensionsPayloadStore ( payloadStoreRawPayload , payloadOptions )
135- let extensions = payloadOptions . extensions
130+ let extensions = payloadOptions . extensions . filter ( ( ext ) => ext . isPreviewable )
136131
137132 const getExtensions = ( ) => {
138133 return extensions
139134 }
140135
141136 outputDebug ( `Setting up the UI extensions HTTP server...` , payloadOptions . stdout )
142- const getAppAssets = ( ) => payloadOptions . appAssets
137+ const getAppAssets = ( ) => payloadStore . getAppAssets ( )
143138 const httpServer = setupHTTPServer ( {
144139 devOptions : payloadOptions ,
145140 payloadStore,
@@ -156,13 +151,7 @@ export async function devUIExtensions(options: ExtensionDevOptions): Promise<voi
156151 extensions = app . allExtensions . filter ( ( ext ) => ext . isPreviewable )
157152 }
158153
159- // Handle App Assets updates.
160- const appAssetsConfigs = extensionEvents . map ( ( event ) =>
161- event . extension . specification . appAssetsConfig ?.( event . extension . configuration ) ,
162- )
163- getArrayRejectingUndefined ( appAssetsConfigs ) . forEach ( ( config ) => {
164- payloadStore . updateAppAssetTimestamp ( config . assetsKey )
165- } )
154+ payloadStore . updateAdminConfigFromExtensionEvents ( extensionEvents )
166155
167156 for ( const event of extensionEvents ) {
168157 if ( ! event . extension . isPreviewable ) continue
0 commit comments