Skip to content

Commit f93fc60

Browse files
Merge pull request #6290 from Shopify/dev_platform_migration_doc_links
Add documentation links to migration-related banners
2 parents 081820f + 07e9652 commit f93fc60

File tree

5 files changed

+59
-20
lines changed

5 files changed

+59
-20
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import {AbortError} from '@shopify/cli-kit/node/error'
2+
3+
export function throwUidMappingError() {
4+
const message = ['Your app has extensions which need to be assigned', {command: 'uid'}, 'identifiers.']
5+
const nextStep = [
6+
'You must first map IDs to your existing extensions by running',
7+
{command: 'shopify app deploy'},
8+
'interactively, without',
9+
{command: '--force'},
10+
', to finish the migration.',
11+
]
12+
const customSection = {
13+
title: 'Reference',
14+
body: {
15+
list: {
16+
items: [
17+
{
18+
link: {
19+
label: 'Migrating from the Partner Dashboard',
20+
url: 'https://shopify.dev/docs/apps/build/dev-dashboard/migrate-from-partners',
21+
},
22+
},
23+
],
24+
},
25+
},
26+
}
27+
throw new AbortError(message, undefined, [nextStep], [customSection])
28+
}

packages/app/src/cli/services/context/breakdown-extensions.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ import {ExtensionSpecification} from '../../models/extensions/specification.js'
2020
import {rewriteConfiguration} from '../app/write-app-configuration-file.js'
2121
import {AppConfigurationUsedByCli} from '../../models/extensions/specifications/types/app_config.js'
2222
import {removeTrailingSlash} from '../../models/extensions/specifications/validation/common.js'
23+
import {throwUidMappingError} from '../../prompts/uid-mapping-error.js'
2324
import {deepCompare, deepDifference} from '@shopify/cli-kit/common/object'
2425
import {encodeToml} from '@shopify/cli-kit/node/toml'
2526
import {zod} from '@shopify/cli-kit/node/schema'
26-
import {AbortError} from '@shopify/cli-kit/node/error'
2727

2828
export interface ConfigExtensionIdentifiersBreakdown {
2929
existingFieldNames: string[]
@@ -68,15 +68,7 @@ export async function extensionsIdentifiersDeployBreakdown(options: EnsureDeploy
6868
const unMigratedextensions = remoteExtensionsRegistrations.app.extensionRegistrations.filter((ext) => !ext.id)
6969

7070
if (unMigratedextensions.length > 0) {
71-
const message = ['Your app has extensions which need to be assigned', {command: 'uid'}, 'identifiers.']
72-
const nextSteps = [
73-
'You must first map IDs to your existing extensions by running',
74-
{command: 'shopify app deploy'},
75-
'interactively, without',
76-
{command: '--force'},
77-
'to finish the migration.',
78-
]
79-
throw new AbortError(message, nextSteps)
71+
throwUidMappingError()
8072
}
8173
}
8274

packages/app/src/cli/services/deploy.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,18 @@ describe('deploy', () => {
656656
"• Commit to source control to ensure your extension IDs aren't regenerated on the next deploy.",
657657
],
658658
},
659+
{
660+
title: 'Reference',
661+
body: [
662+
'• ',
663+
{
664+
link: {
665+
label: 'Migrating from the Partner Dashboard',
666+
url: 'https://shopify.dev/docs/apps/build/dev-dashboard/migrate-from-partners',
667+
},
668+
},
669+
],
670+
},
659671
],
660672
})
661673
})

packages/app/src/cli/services/deploy.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,21 @@ async function outputCompletionMessage({
331331
}
332332

333333
body.push("• Commit to source control to ensure your extension IDs aren't regenerated on the next deploy.")
334-
customSections = [{title: 'Next steps', body}]
334+
customSections = [
335+
{title: 'Next steps', body},
336+
{
337+
title: 'Reference',
338+
body: [
339+
'• ',
340+
{
341+
link: {
342+
label: 'Migrating from the Partner Dashboard',
343+
url: 'https://shopify.dev/docs/apps/build/dev-dashboard/migrate-from-partners',
344+
},
345+
},
346+
],
347+
},
348+
]
335349
}
336350

337351
if (release) {

packages/app/src/cli/services/dev.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import {AppConfigurationUsedByCli} from '../models/extensions/specifications/typ
3737
import {RemoteAwareExtensionSpecification} from '../models/extensions/specification.js'
3838
import {ports} from '../constants.js'
3939
import {generateCertificate} from '../utilities/mkcert.js'
40+
import {throwUidMappingError} from '../prompts/uid-mapping-error.js'
4041
import {Config} from '@oclif/core'
4142
import {AbortController} from '@shopify/cli-kit/node/abort'
4243
import {checkPortAvailability, getAvailableTCPPort} from '@shopify/cli-kit/node/tcp'
@@ -248,15 +249,7 @@ export async function blockIfMigrationIncomplete(devConfig: DevConfig) {
248249
.filter((extension) => extension.type.toLowerCase() !== 'webhook_subscription')
249250
.every((extension) => extension.id)
250251
) {
251-
const message = ['Your app has extensions which need to be assigned', {command: 'uid'}, 'identifiers.']
252-
const nextSteps = [
253-
'You must first map IDs to your existing extensions by running',
254-
{command: 'shopify app deploy'},
255-
'interactively, without',
256-
{command: '--force'},
257-
'to finish the migration.',
258-
]
259-
throw new AbortError(message, nextSteps)
252+
throwUidMappingError()
260253
}
261254
}
262255

0 commit comments

Comments
 (0)