File tree Expand file tree Collapse file tree 4 files changed +45
-3
lines changed
packages/app/src/cli/models/extensions Expand file tree Collapse file tree 4 files changed +45
-3
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {PrivacyComplianceWebhooksSpecIdentifier} from './specifications/app_conf
1111import { WebhooksSpecIdentifier } from './specifications/app_config_webhook.js'
1212import { WebhookSubscriptionSpecIdentifier } from './specifications/app_config_webhook_subscription.js'
1313import { EventsSpecIdentifier } from './specifications/app_config_events.js'
14+ import { AdminSpecIdentifier } from './specifications/admin.js'
1415import { ExtensionBuildOptions , bundleFunctionExtension } from '../../services/build/extension.js'
1516import { bundleThemeExtension } from '../../services/extensions/bundle.js'
1617import { Identifiers } from '../app/identifiers.js'
@@ -39,7 +40,7 @@ export const CONFIG_EXTENSION_IDS: string[] = [
3940 WebhookSubscriptionSpecIdentifier ,
4041 WebhooksSpecIdentifier ,
4142 EventsSpecIdentifier ,
42- 'admin' ,
43+ AdminSpecIdentifier ,
4344]
4445
4546/**
@@ -537,6 +538,8 @@ export class ExtensionInstance<TConfiguration extends BaseConfigType = BaseConfi
537538 } else {
538539 return nonRandomUUID ( JSON . stringify ( this . configuration ) )
539540 }
541+ default :
542+ return this . specification . identifier
540543 }
541544 }
542545
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import uiExtensionSpec from './specifications/ui_extension.js'
2727import webPixelSpec from './specifications/web_pixel_extension.js'
2828import editorExtensionCollectionSpecification from './specifications/editor_extension_collection.js'
2929import channelSpecificationSpec from './specifications/channel.js'
30+ import adminSpecificationSpec from './specifications/admin.js'
3031
3132const SORTED_CONFIGURATION_SPEC_IDENTIFIERS = [
3233 BrandingSpecIdentifier ,
@@ -61,6 +62,7 @@ function loadSpecifications() {
6162 appWebhooksSpec ,
6263 appWebhookSubscriptionSpec ,
6364 appEventsSpec ,
65+ adminSpecificationSpec ,
6466 ]
6567 const moduleSpecs = [
6668 checkoutPostPurchaseSpec ,
Original file line number Diff line number Diff line change @@ -215,7 +215,7 @@ export function createExtensionSpecification<TConfiguration extends BaseConfigTy
215215 return {
216216 ...merged ,
217217 contributeToAppConfigurationSchema : ( appConfigSchema : ZodSchemaType < unknown > ) => {
218- if ( merged . uidStrategy !== 'single' ) {
218+ if ( merged . uidStrategy !== 'single' || ! merged . schema . _def . shape ) {
219219 // no change
220220 return appConfigSchema
221221 }
@@ -279,7 +279,7 @@ export function createConfigExtensionSpecification<TConfiguration extends BaseCo
279279export function createContractBasedModuleSpecification < TConfiguration extends BaseConfigType = BaseConfigType > (
280280 spec : Pick <
281281 CreateExtensionSpecType < TConfiguration > ,
282- 'identifier' | 'appModuleFeatures' | 'clientSteps' | 'buildConfig'
282+ 'identifier' | 'appModuleFeatures' | 'clientSteps' | 'buildConfig' | 'uidStrategy'
283283 > ,
284284) {
285285 return createExtensionSpecification ( {
@@ -288,6 +288,7 @@ export function createContractBasedModuleSpecification<TConfiguration extends Ba
288288 appModuleFeatures : spec . appModuleFeatures ,
289289 clientSteps : spec . clientSteps ,
290290 buildConfig : spec . buildConfig ?? { mode : 'none' } ,
291+ uidStrategy : spec . uidStrategy ,
291292 deployConfig : async ( config , directory ) => {
292293 let parsedConfig = configWithoutFirstClassFields ( config )
293294 if ( spec . appModuleFeatures ( ) . includes ( 'localization' ) ) {
Original file line number Diff line number Diff line change 1+ import { createContractBasedModuleSpecification } from '../specification.js'
2+
3+ export const AdminSpecIdentifier = 'admin'
4+
5+ const adminSpecificationSpec = createContractBasedModuleSpecification ( {
6+ identifier : 'admin' ,
7+ uidStrategy : 'single' ,
8+ buildConfig : {
9+ mode : 'copy_files' ,
10+ filePatterns : [ ] ,
11+ } ,
12+ clientSteps : [
13+ {
14+ lifecycle : 'deploy' ,
15+ steps : [
16+ {
17+ id : 'hosted_app_copy_files' ,
18+ name : 'Hosted App Copy Files' ,
19+ type : 'include_assets' ,
20+ config : {
21+ generateManifest : true ,
22+ inclusions : [
23+ {
24+ type : 'configKey' ,
25+ key : 'admin.static_root' ,
26+ } ,
27+ ] ,
28+ } ,
29+ } ,
30+ ] ,
31+ } ,
32+ ] ,
33+ appModuleFeatures : ( ) => [ ] ,
34+ } )
35+
36+ export default adminSpecificationSpec
You can’t perform that action at this time.
0 commit comments