Skip to content

Commit 1f345db

Browse files
ryancbahanclaude
andcommitted
Migrate branding spec to deployConfig + transformRemoteToLocal
Remove transformConfig, set deployConfig (configWithoutFirstClassFields pass-through) and transformRemoteToLocal directly (app_handle → handle). transformLocalToRemote is now undefined. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 036d663 commit 1f345db

File tree

2 files changed

+8
-24
lines changed

2 files changed

+8
-24
lines changed

packages/app/src/cli/models/extensions/specifications/app_config_branding.test.ts

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,10 @@
11
import spec from './app_config_branding.js'
2-
import {placeholderAppConfiguration} from '../../app/app.test-data.js'
32
import {describe, expect, test} from 'vitest'
43

54
describe('branding', () => {
65
describe('transform', () => {
7-
test('should return the transformed object', () => {
8-
// Given
9-
const object = {
10-
name: 'my-app',
11-
handle: 'my-app-handle',
12-
}
13-
const appConfigSpec = spec
14-
15-
// When
16-
const result = appConfigSpec.transformLocalToRemote!(object, placeholderAppConfiguration)
17-
18-
// Then
19-
expect(result).toMatchObject({
20-
name: 'my-app',
21-
app_handle: 'my-app-handle',
22-
})
6+
test('transformLocalToRemote should be undefined', () => {
7+
expect(spec.transformLocalToRemote).toBeUndefined()
238
})
249
})
2510

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {TransformationConfig, createConfigExtensionSpecification} from '../specification.js'
1+
import {configWithoutFirstClassFields, createConfigExtensionSpecification} from '../specification.js'
22
import {BaseSchemaWithoutHandle} from '../schemas.js'
33
import {zod} from '@shopify/cli-kit/node/schema'
44

@@ -13,17 +13,16 @@ const BrandingSchema = BaseSchemaWithoutHandle.extend({
1313
.optional(),
1414
})
1515

16-
const BrandingTransformConfig: TransformationConfig = {
17-
name: 'name',
18-
app_handle: 'handle',
19-
}
20-
2116
export const BrandingSpecIdentifier = 'branding'
2217

2318
const appBrandingSpec = createConfigExtensionSpecification({
2419
identifier: BrandingSpecIdentifier,
2520
schema: BrandingSchema,
26-
transformConfig: BrandingTransformConfig,
21+
deployConfig: async (config) => configWithoutFirstClassFields(config),
22+
transformRemoteToLocal: (content: object) => ({
23+
name: (content as {name?: string}).name,
24+
handle: (content as {app_handle?: string}).app_handle,
25+
}),
2726
})
2827

2928
export default appBrandingSpec

0 commit comments

Comments
 (0)