Skip to content

Commit 036d663

Browse files
ryancbahanclaude
andcommitted
Migrate point_of_sale spec to deployConfig + transformRemoteToLocal
Remove transformConfig, set deployConfig (configWithoutFirstClassFields pass-through) and transformRemoteToLocal directly. transformLocalToRemote is now undefined — TOML shape is sent directly to the server. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ff7c0de commit 036d663

File tree

2 files changed

+6
-24
lines changed

2 files changed

+6
-24
lines changed

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

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

54
describe('app_cofig_point_of_sale', () => {
6-
describe('transform', () => {
7-
test('should return the transformed object', () => {
8-
// Given
9-
const object = {
10-
pos: {
11-
embedded: true,
12-
},
13-
}
14-
const appConfigSpec = spec
15-
16-
// When
17-
const result = appConfigSpec.transformLocalToRemote!(object, placeholderAppConfiguration)
18-
19-
// Then
20-
expect(result).toMatchObject({
21-
embedded: true,
22-
})
5+
describe('transformLocalToRemote', () => {
6+
test('should be undefined since deployConfig is used instead', () => {
7+
expect(spec.transformLocalToRemote).toBeUndefined()
238
})
249
})
2510

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

@@ -12,14 +12,11 @@ const PosConfigurationSchema = BaseSchemaWithoutHandle.extend({
1212

1313
export const PosSpecIdentifier = 'point_of_sale'
1414

15-
const PosTransformConfig: TransformationConfig = {
16-
embedded: 'pos.embedded',
17-
}
18-
1915
const appPOSSpec = createConfigExtensionSpecification({
2016
identifier: PosSpecIdentifier,
2117
schema: PosConfigurationSchema,
22-
transformConfig: PosTransformConfig,
18+
deployConfig: async (config) => configWithoutFirstClassFields(config),
19+
transformRemoteToLocal: (content: object) => ({pos: {embedded: (content as {embedded: boolean}).embedded}}),
2320
})
2421

2522
export default appPOSSpec

0 commit comments

Comments
 (0)