Skip to content

Commit

Permalink
Merge pull request #4272 from Shopify/1805-unactionable-error
Browse files Browse the repository at this point in the history
Improved error when storeFromFqdn fails
  • Loading branch information
shauns committed Aug 6, 2024
2 parents 11e060f + b07f196 commit 92edac9
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 25 deletions.
6 changes: 6 additions & 0 deletions .changeset/gold-waves-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@shopify/cli-kit': patch
'@shopify/app': patch
---

Small UI fix when using an invalid shop
32 changes: 16 additions & 16 deletions packages/app/src/cli/services/context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -656,11 +656,11 @@ api_version = "2023-04"
},
},
'\n',
'You can pass',
'You can pass ',
{
command: '--reset',
},
'to your command to reset your app configuration.',
' to your command to reset your app configuration.',
],
headline: 'Using shopify.app.toml:',
})
Expand Down Expand Up @@ -765,11 +765,11 @@ api_version = "2023-04"
},
},
'\n',
'You can pass',
'You can pass ',
{
command: '--reset',
},
'to your command to reset your app configuration.',
' to your command to reset your app configuration.',
],
headline: 'Using these settings:',
})
Expand Down Expand Up @@ -1268,11 +1268,11 @@ describe('ensureDeployContext', () => {
},
},
'\n',
'You can pass',
'You can pass ',
{
command: '--reset',
},
'to your command to reset your app configuration.',
' to your command to reset your app configuration.',
],
headline: 'Using shopify.app.toml:',
})
Expand Down Expand Up @@ -1315,11 +1315,11 @@ describe('ensureDeployContext', () => {
},
},
'\n',
'You can pass',
'You can pass ',
{
command: '--reset',
},
'to your command to reset your app configuration.',
' to your command to reset your app configuration.',
],
headline: 'Using shopify.app.toml:',
})
Expand Down Expand Up @@ -1367,11 +1367,11 @@ describe('ensureDeployContext', () => {
},
},
'\n',
'You can pass',
'You can pass ',
{
command: '--reset',
},
'to your command to reset your app configuration.',
' to your command to reset your app configuration.',
],
headline: 'Using shopify.app.toml:',
})
Expand Down Expand Up @@ -1419,11 +1419,11 @@ describe('ensureDeployContext', () => {
},
},
'\n',
'You can pass',
'You can pass ',
{
command: '--reset',
},
'to your command to reset your app configuration.',
' to your command to reset your app configuration.',
],
headline: 'Using shopify.app.toml:',
})
Expand Down Expand Up @@ -1465,11 +1465,11 @@ describe('ensureDeployContext', () => {
},
},
'\n',
'You can pass',
'You can pass ',
{
command: '--reset',
},
'to your command to reset your app configuration.',
' to your command to reset your app configuration.',
],
headline: 'Using shopify.app.toml:',
})
Expand Down Expand Up @@ -1509,11 +1509,11 @@ describe('ensureDeployContext', () => {
},
},
'\n',
'You can pass',
'You can pass ',
{
command: '--reset',
},
'to your command to reset your app configuration.',
' to your command to reset your app configuration.',
],
headline: 'Using shopify.app.toml:',
})
Expand Down
15 changes: 7 additions & 8 deletions packages/app/src/cli/services/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
} from '../api/graphql/development_preview.js'
import {DeveloperPlatformClient, selectDeveloperPlatformClient} from '../utilities/developer-platform-client.js'
import {tryParseInt} from '@shopify/cli-kit/common/string'
import {TokenItem, renderConfirmationPrompt, renderInfo} from '@shopify/cli-kit/node/ui'
import {Token, TokenItem, renderConfirmationPrompt, renderInfo} from '@shopify/cli-kit/node/ui'
import {partnersFqdn} from '@shopify/cli-kit/node/context/fqdn'
import {AbortError} from '@shopify/cli-kit/node/error'
import {outputContent} from '@shopify/cli-kit/node/output'
Expand Down Expand Up @@ -266,7 +266,11 @@ export async function ensureDevContext(options: DevContextOptions): Promise<DevC
return result
}

const resetHelpMessage = ['You can pass', {command: '--reset'}, 'to your command to reset your app configuration.']
const resetHelpMessage: Token[] = [
'You can pass ',
{command: '--reset'},
' to your command to reset your app configuration.',
]

interface AppFromIdOptions {
apiKey: string
Expand Down Expand Up @@ -867,12 +871,7 @@ interface CurrentlyUsedConfigInfoOptions {
configFile?: string
appDotEnv?: string
includeConfigOnDeploy?: boolean
resetMessage?: (
| string
| {
command: string
}
)[]
resetMessage?: Token[]
}

export function renderCurrentlyUsedConfigInfo({
Expand Down
3 changes: 2 additions & 1 deletion packages/cli-kit/src/public/node/ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {FatalError} from '../../private/node/ui/components/FatalError.js'
import ScalarDict from '../../private/node/ui/components/Table/ScalarDict.js'
import {Table, TableColumn, TableProps} from '../../private/node/ui/components/Table/Table.js'
import {
Token,
tokenItemToString,
InlineToken,
LinkToken,
Expand Down Expand Up @@ -718,4 +719,4 @@ This usually happens when running a command non-interactively, for example in a

export type Key = InkKey
export type InfoMessage = InfoMessageProps['message']
export {Task, TokenItem, InlineToken, LinkToken, TableColumn, InfoTableSection, ListToken, render, handleCtrlC}
export {Token, Task, TokenItem, InlineToken, LinkToken, TableColumn, InfoTableSection, ListToken, render, handleCtrlC}

0 comments on commit 92edac9

Please sign in to comment.