Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved error when storeFromFqdn fails #4272

Merged
merged 3 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}
Loading