Skip to content

Commit 24d4b52

Browse files
isaacroldanClaude Code
andcommitted
feat: fetch experience field from API instead of hardcoding it
Co-authored-by: Claude Code <claude-code@anthropic.com>
1 parent 74b0dd2 commit 24d4b52

File tree

11 files changed

+46
-44
lines changed

11 files changed

+46
-44
lines changed

packages/app/src/cli/api/graphql/app-management/generated/active-app-release-from-api-key.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export type ActiveAppReleaseFromApiKeyQuery = {
2424
handle: string
2525
config: JsonMapType
2626
target?: string | null
27-
specification: {identifier: string; externalIdentifier: string; name: string; managementExperience: string}
27+
specification: {identifier: string; externalIdentifier: string; name: string; experience: string; managementExperience: string}
2828
}[]
2929
}
3030
}

packages/app/src/cli/api/graphql/app-management/generated/active-app-release.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export type ActiveAppReleaseQuery = {
2424
handle: string
2525
config: JsonMapType
2626
target?: string | null
27-
specification: {identifier: string; externalIdentifier: string; name: string; managementExperience: string}
27+
specification: {identifier: string; externalIdentifier: string; name: string; experience: string; managementExperience: string}
2828
}[]
2929
}
3030
}
@@ -46,7 +46,7 @@ export type AppVersionInfoFragment = {
4646
handle: string
4747
config: JsonMapType
4848
target?: string | null
49-
specification: {identifier: string; externalIdentifier: string; name: string; managementExperience: string}
49+
specification: {identifier: string; externalIdentifier: string; name: string; experience: string; managementExperience: string}
5050
}[]
5151
}
5252
}
@@ -58,7 +58,7 @@ export type ReleasedAppModuleFragment = {
5858
handle: string
5959
config: JsonMapType
6060
target?: string | null
61-
specification: {identifier: string; externalIdentifier: string; name: string; managementExperience: string}
61+
specification: {identifier: string; externalIdentifier: string; name: string; experience: string; managementExperience: string}
6262
}
6363

6464
export const ReleasedAppModuleFragmentDoc = {
@@ -85,6 +85,7 @@ export const ReleasedAppModuleFragmentDoc = {
8585
{kind: 'Field', name: {kind: 'Name', value: 'identifier'}},
8686
{kind: 'Field', name: {kind: 'Name', value: 'externalIdentifier'}},
8787
{kind: 'Field', name: {kind: 'Name', value: 'name'}},
88+
{kind: 'Field', name: {kind: 'Name', value: 'experience'}},
8889
{kind: 'Field', name: {kind: 'Name', value: 'managementExperience'}},
8990
],
9091
},
@@ -186,6 +187,7 @@ export const AppVersionInfoFragmentDoc = {
186187
{kind: 'Field', name: {kind: 'Name', value: 'identifier'}},
187188
{kind: 'Field', name: {kind: 'Name', value: 'externalIdentifier'}},
188189
{kind: 'Field', name: {kind: 'Name', value: 'name'}},
190+
{kind: 'Field', name: {kind: 'Name', value: 'experience'}},
189191
{kind: 'Field', name: {kind: 'Name', value: 'managementExperience'}},
190192
],
191193
},
@@ -254,6 +256,7 @@ export const ActiveAppRelease = {
254256
{kind: 'Field', name: {kind: 'Name', value: 'identifier'}},
255257
{kind: 'Field', name: {kind: 'Name', value: 'externalIdentifier'}},
256258
{kind: 'Field', name: {kind: 'Name', value: 'name'}},
259+
{kind: 'Field', name: {kind: 'Name', value: 'experience'}},
257260
{kind: 'Field', name: {kind: 'Name', value: 'managementExperience'}},
258261
],
259262
},

packages/app/src/cli/api/graphql/app-management/generated/app-version-by-id.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export type AppVersionByIdQuery = {
1818
handle: string
1919
config: JsonMapType
2020
target?: string | null
21-
specification: {identifier: string; externalIdentifier: string; name: string; managementExperience: string}
21+
specification: {identifier: string; externalIdentifier: string; name: string; experience: string; managementExperience: string}
2222
}[]
2323
}
2424
}
@@ -32,7 +32,7 @@ export type VersionInfoFragment = {
3232
handle: string
3333
config: JsonMapType
3434
target?: string | null
35-
specification: {identifier: string; externalIdentifier: string; name: string; managementExperience: string}
35+
specification: {identifier: string; externalIdentifier: string; name: string; experience: string; managementExperience: string}
3636
}[]
3737
}
3838

packages/app/src/cli/api/graphql/app-management/generated/app-version-by-tag.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export type AppVersionByTagQuery = {
1818
handle: string
1919
config: JsonMapType
2020
target?: string | null
21-
specification: {identifier: string; externalIdentifier: string; name: string; managementExperience: string}
21+
specification: {identifier: string; externalIdentifier: string; name: string; experience: string; managementExperience: string}
2222
}[]
2323
}
2424
}
@@ -82,6 +82,7 @@ export const AppVersionByTag = {
8282
{kind: 'Field', name: {kind: 'Name', value: 'identifier'}},
8383
{kind: 'Field', name: {kind: 'Name', value: 'externalIdentifier'}},
8484
{kind: 'Field', name: {kind: 'Name', value: 'name'}},
85+
{kind: 'Field', name: {kind: 'Name', value: 'experience'}},
8586
{kind: 'Field', name: {kind: 'Name', value: 'managementExperience'}},
8687
],
8788
},

packages/app/src/cli/api/graphql/app-management/generated/create-app-version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export type CreateAppVersionMutation = {
2020
handle: string
2121
config: JsonMapType
2222
target?: string | null
23-
specification: {identifier: string; externalIdentifier: string; name: string; managementExperience: string}
23+
specification: {identifier: string; externalIdentifier: string; name: string; experience: string; managementExperience: string}
2424
}[]
2525
metadata: {versionTag?: string | null; message?: string | null}
2626
} | null

packages/app/src/cli/api/graphql/app-management/generated/specifications.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export type FetchSpecificationsQuery = {
1212
name: string
1313
identifier: string
1414
externalIdentifier: string
15+
experience: string
1516
features: string[]
1617
uidStrategy:
1718
| {__typename: 'UidStrategiesClientProvided'; appModuleLimit: number; isClientProvided: boolean}
@@ -54,6 +55,7 @@ export const FetchSpecifications = {
5455
{kind: 'Field', name: {kind: 'Name', value: 'name'}},
5556
{kind: 'Field', name: {kind: 'Name', value: 'identifier'}},
5657
{kind: 'Field', name: {kind: 'Name', value: 'externalIdentifier'}},
58+
{kind: 'Field', name: {kind: 'Name', value: 'experience'}},
5759
{kind: 'Field', name: {kind: 'Name', value: 'features'}},
5860
{
5961
kind: 'Field',

packages/app/src/cli/api/graphql/app-management/queries/active-app-release.graphql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ fragment ReleasedAppModule on AppModule {
3737
identifier
3838
externalIdentifier
3939
name
40+
experience
4041
managementExperience
4142
}
4243
}

packages/app/src/cli/api/graphql/app-management/queries/specifications.graphql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ query fetchSpecifications($organizationId: ID!) {
33
name
44
identifier
55
externalIdentifier
6+
experience
67
features
78
uidStrategy {
89
__typename

packages/app/src/cli/models/extensions/extension-instance.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@ import {BaseConfigType, MAX_EXTENSION_HANDLE_LENGTH, MAX_UID_LENGTH} from './sch
22
import {FunctionConfigType} from './specifications/function.js'
33
import {ExtensionFeature, ExtensionSpecification} from './specification.js'
44
import {SingleWebhookSubscriptionType} from './specifications/app_config_webhook_schemas/webhooks_schema.js'
5-
import {AppHomeSpecIdentifier} from './specifications/app_config_app_home.js'
6-
import {AppAccessSpecIdentifier} from './specifications/app_config_app_access.js'
7-
import {AppProxySpecIdentifier} from './specifications/app_config_app_proxy.js'
8-
import {BrandingSpecIdentifier} from './specifications/app_config_branding.js'
9-
import {PosSpecIdentifier} from './specifications/app_config_point_of_sale.js'
10-
import {PrivacyComplianceWebhooksSpecIdentifier} from './specifications/app_config_privacy_compliance_webhooks.js'
11-
import {WebhooksSpecIdentifier} from './specifications/app_config_webhook.js'
12-
import {WebhookSubscriptionSpecIdentifier} from './specifications/app_config_webhook_subscription.js'
13-
import {EventsSpecIdentifier} from './specifications/app_config_events.js'
145
import {
156
ExtensionBuildOptions,
167
buildFunctionExtension,
@@ -34,24 +25,6 @@ import {outputDebug} from '@shopify/cli-kit/node/output'
3425
import {extractJSImports, extractImportPathsRecursively} from '@shopify/cli-kit/node/import-extractor'
3526
import {uniq} from '@shopify/cli-kit/common/array'
3627

37-
// DEPRECATED. We should get the experience from the specification instead of hardcoding it based on the identifier.
38-
// This is a temporary solution to avoid breaking changes while we update the API and the specifications query.
39-
export const CONFIG_EXTENSION_IDS: string[] = [
40-
AppAccessSpecIdentifier,
41-
AppHomeSpecIdentifier,
42-
AppProxySpecIdentifier,
43-
BrandingSpecIdentifier,
44-
PosSpecIdentifier,
45-
PrivacyComplianceWebhooksSpecIdentifier,
46-
WebhookSubscriptionSpecIdentifier,
47-
WebhooksSpecIdentifier,
48-
EventsSpecIdentifier,
49-
50-
// Hardcoded identifiers that don't exist locally.
51-
'data',
52-
'admin',
53-
]
54-
5528
/**
5629
* Class that represents an instance of a local extension
5730
* Before creating this class we've validated that:

packages/app/src/cli/utilities/developer-platform-client/app-management-client.test.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ function moduleFromExtension(extension: ExtensionInstance) {
9595
identifier: extension.specification.identifier,
9696
externalIdentifier: extension.specification.externalIdentifier,
9797
name: extension.specification.externalName,
98+
experience: extension.specification.experience,
9899
managementExperience: 'cli',
99100
},
100101
}
@@ -1352,6 +1353,14 @@ describe('appExtensionRegistrations', () => {
13521353
registrationId: BrandingSpecIdentifier,
13531354
registrationTitle: 'Config Extension',
13541355
type: 'config_extension',
1356+
specification: {
1357+
identifier: BrandingSpecIdentifier,
1358+
name: 'Config Extension',
1359+
experience: 'configuration' as const,
1360+
options: {
1361+
managementExperience: 'cli' as const,
1362+
},
1363+
},
13551364
})
13561365

13571366
const extensionModule = createMockAppModuleVersion({
@@ -1451,6 +1460,14 @@ describe('appExtensionRegistrations', () => {
14511460
registrationId: id,
14521461
registrationTitle: `Config Extension ${index}`,
14531462
type: 'config_extension',
1463+
specification: {
1464+
identifier: id,
1465+
name: `Config Extension ${index}`,
1466+
experience: 'configuration' as const,
1467+
options: {
1468+
managementExperience: 'cli' as const,
1469+
},
1470+
},
14541471
}),
14551472
)
14561473

@@ -1515,6 +1532,14 @@ describe('appExtensionRegistrations', () => {
15151532
registrationId: id,
15161533
registrationTitle: `Config ${id}`,
15171534
type: 'config',
1535+
specification: {
1536+
identifier: id,
1537+
name: `Config ${id}`,
1538+
experience: 'configuration' as const,
1539+
options: {
1540+
managementExperience: 'cli' as const,
1541+
},
1542+
},
15181543
}),
15191544
),
15201545
// Regular CLI-managed extensions

0 commit comments

Comments
 (0)