-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4465 from Shopify/support-non-config-contract-mod…
…ules Add support for contract-based app modules
- Loading branch information
Showing
3 changed files
with
34 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 2 additions & 27 deletions
29
packages/app/src/cli/models/extensions/specifications/marketing_activity.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,5 @@ | ||
import {MarketingActivityExtensionSchema} from './marketing_activity_schemas/marketing_activity_schema.js' | ||
import {createExtensionSpecification} from '../specification.js' | ||
import {randomUUID} from '@shopify/cli-kit/node/crypto' | ||
import {createContractBasedModuleSpecification} from '../specification.js' | ||
|
||
const spec = createExtensionSpecification({ | ||
identifier: 'marketing_activity', | ||
schema: MarketingActivityExtensionSchema, | ||
appModuleFeatures: (_) => ['bundling'], | ||
deployConfig: async (config, _) => { | ||
return { | ||
title: config.title, | ||
description: config.description, | ||
api_path: config.api_path, | ||
tactic: config.tactic, | ||
marketing_channel: config.marketing_channel, | ||
referring_domain: config.referring_domain, | ||
is_automation: config.is_automation, | ||
use_external_editor: config.use_external_editor, | ||
preview_data: config.preview_data, | ||
fields: config.fields.map((field) => ({ | ||
...field, | ||
// NOTE: we're not using this id anywhere, generating it to satisfy the schema | ||
// decided not to remove it from the schema for now to minimize the risk of breaking changes | ||
id: randomUUID(), | ||
})), | ||
} | ||
}, | ||
}) | ||
const spec = createContractBasedModuleSpecification('marketing_activity') | ||
|
||
export default spec |