Skip to content

Commit 58a1e8c

Browse files
amcaplanclaude
andcommitted
fix: make dev store creation links clickable in CLI
- Changed getCreateDevStoreLink() to return TokenItem instead of string - Updated both app-management-client and partners-client implementations - Links now use CLI UI Kit's clickable link format Fixes #114 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 67247bf commit 58a1e8c

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ import {
5959
AppLogsSubscribeMutation,
6060
AppLogsSubscribeMutationVariables,
6161
} from '../api/graphql/app-management/generated/app-logs-subscribe.js'
62+
import {TokenItem} from '@shopify/cli-kit/node/ui'
6263
import {blockPartnersAccess} from '@shopify/cli-kit/node/environment'
6364
import {UnauthorizedHandler} from '@shopify/cli-kit/node/api/graphql'
6465

@@ -326,7 +327,7 @@ export interface DeveloperPlatformClient {
326327
devSessionCreate: (input: DevSessionCreateOptions) => Promise<DevSessionCreateMutation>
327328
devSessionUpdate: (input: DevSessionUpdateOptions) => Promise<DevSessionUpdateMutation>
328329
devSessionDelete: (input: DevSessionSharedOptions) => Promise<DevSessionDeleteMutation>
329-
getCreateDevStoreLink: (org: Organization) => Promise<string>
330+
getCreateDevStoreLink: (org: Organization) => Promise<TokenItem>
330331
}
331332

332333
const inProgressRefreshes = new WeakMap<DeveloperPlatformClient, Promise<string>>()

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ import {CLI_KIT_VERSION} from '@shopify/cli-kit/common/version'
161161
import {versionSatisfies} from '@shopify/cli-kit/node/node-package-manager'
162162
import {outputDebug} from '@shopify/cli-kit/node/output'
163163
import {developerDashboardFqdn} from '@shopify/cli-kit/node/context/fqdn'
164+
import {TokenItem} from '@shopify/cli-kit/node/ui'
164165
import {functionsRequestDoc, FunctionsRequestOptions} from '@shopify/cli-kit/node/api/functions'
165166
import {fileExists, readFile} from '@shopify/cli-kit/node/fs'
166167
import {JsonMapType} from '@shopify/cli-kit/node/toml'
@@ -1045,12 +1046,13 @@ export class AppManagementClient implements DeveloperPlatformClient {
10451046
return this.appDevRequest({query: DevSessionDelete, shopFqdn, variables: {appId: appIdNumber}})
10461047
}
10471048

1048-
async getCreateDevStoreLink(org: Organization): Promise<string> {
1049+
async getCreateDevStoreLink(org: Organization): Promise<TokenItem> {
10491050
const url = `https://${await developerDashboardFqdn()}/dashboard/${org.id}/stores`
1050-
return (
1051-
`Looks like you don't have any dev stores associated with ${org.businessName}'s Dev Dashboard.` +
1052-
` Create one now \n${url}`
1053-
)
1051+
return [
1052+
`Looks like you don't have any dev stores associated with ${org.businessName}'s Dev Dashboard. Create one now`,
1053+
'\n',
1054+
{link: {url, label: url}},
1055+
]
10541056
}
10551057

10561058
private async activeAppVersionRawResult({organizationId, apiKey}: AppApiKeyAndOrgId): Promise<ActiveAppReleaseQuery> {

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ import {generateFetchAppLogUrl, partnersRequest, partnersRequestDoc} from '@shop
162162
import {CacheOptions, GraphQLVariables, UnauthorizedHandler} from '@shopify/cli-kit/node/api/graphql'
163163
import {ensureAuthenticatedPartners} from '@shopify/cli-kit/node/session'
164164
import {partnersFqdn} from '@shopify/cli-kit/node/context/fqdn'
165+
import {TokenItem} from '@shopify/cli-kit/node/ui'
165166
import {RequestModeInput, Response, shopifyFetch} from '@shopify/cli-kit/node/http'
166167
import {CLI_KIT_VERSION} from '@shopify/cli-kit/common/version'
167168

@@ -645,12 +646,13 @@ export class PartnersClient implements DeveloperPlatformClient {
645646
return Promise.resolve()
646647
}
647648

648-
async getCreateDevStoreLink(org: Organization): Promise<string> {
649+
async getCreateDevStoreLink(org: Organization): Promise<TokenItem> {
649650
const url = `https://${await partnersFqdn()}/${org.id}/stores`
650-
return (
651-
`Looks like you don't have any dev stores associated with ${org.businessName}'s Partner Dashboard.` +
652-
` Create one now \n${url}`
653-
)
651+
return [
652+
`Looks like you don't have any dev stores associated with ${org.businessName}'s Partner Dashboard. Create one now`,
653+
'\n',
654+
{link: {url, label: url}},
655+
]
654656
}
655657

656658
private async fetchOrgAndApps(orgId: string, title?: string): Promise<OrgAndAppsResponse> {

0 commit comments

Comments
 (0)