Skip to content

Commit a020b29

Browse files
Rename app preview to dev preview everywhere
1 parent ffc6646 commit a020b29

File tree

13 files changed

+46
-46
lines changed

13 files changed

+46
-46
lines changed

docs-shopify.dev/commands/app-dev-clean.doc.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
33

44
const data: ReferenceEntityTemplateSchema = {
55
name: 'app dev clean',
6-
description: `Stop the app preview that was started with \`shopify app dev\`.
6+
description: `Stop the dev preview that was started with \`shopify app dev\`.
77
88
It restores the app's active version to the selected development store.
99
`,
10-
overviewPreviewDescription: `Cleans up the app preview from the selected store.`,
10+
overviewPreviewDescription: `Cleans up the dev preview from the selected store.`,
1111
type: 'command',
1212
isVisualComponent: false,
1313
defaultExample: {

docs-shopify.dev/generated/generated_docs_data.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,8 @@
515515
},
516516
{
517517
"name": "app dev clean",
518-
"description": "Stop the app preview that was started with `shopify app dev`.\n\n It restores the app's active version to the selected development store.\n ",
519-
"overviewPreviewDescription": "Cleans up the app preview from the selected store.",
518+
"description": "Stop the dev preview that was started with `shopify app dev`.\n\n It restores the app's active version to the selected development store.\n ",
519+
"overviewPreviewDescription": "Cleans up the dev preview from the selected store.",
520520
"type": "command",
521521
"isVisualComponent": false,
522522
"defaultExample": {

packages/app/src/cli/commands/app/dev/clean.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import {Flags} from '@oclif/core'
88
import {normalizeStoreFqdn} from '@shopify/cli-kit/node/context/fqdn'
99

1010
export default class DevClean extends AppLinkedCommand {
11-
static summary = 'Cleans up the app preview from the selected store.'
11+
static summary = 'Cleans up the dev preview from the selected store.'
1212

13-
static descriptionWithMarkdown = `Stop the app preview that was started with \`shopify app dev\`.
13+
static descriptionWithMarkdown = `Stop the dev preview that was started with \`shopify app dev\`.
1414
1515
It restores the app's active version to the selected development store.
1616
`

packages/app/src/cli/services/dev-clean.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const mockOptions = {
1818
}
1919

2020
describe('devClean', () => {
21-
test('successfully stops app preview and renders success message', async () => {
21+
test('successfully stops dev preview and renders success message', async () => {
2222
// Given
2323
mockOptions.appContextResult.developerPlatformClient = customDevPlatformClient()
2424

@@ -27,9 +27,9 @@ describe('devClean', () => {
2727

2828
// Then
2929
expect(renderSuccess).toHaveBeenCalledWith({
30-
headline: 'App preview stopped.',
30+
headline: 'Dev preview stopped.',
3131
body: [
32-
`The app preview has been stopped on ${mockStore.shopDomain} and the app's active version has been restored.`,
32+
`The dev preview has been stopped on ${mockStore.shopDomain} and the app's active version has been restored.`,
3333
'You can start it again with',
3434
{command: 'shopify app dev'},
3535
],
@@ -38,19 +38,19 @@ describe('devClean', () => {
3838

3939
test('throws AbortError when devSessionDelete returns user errors', async () => {
4040
// Given
41-
const errorMessage = 'Failed to stop app preview'
41+
const errorMessage = 'Failed to stop dev preview'
4242
mockOptions.appContextResult.developerPlatformClient = customDevPlatformClient(errorMessage)
4343

4444
// When/Then
45-
await expect(devClean(mockOptions)).rejects.toThrow(`Failed to stop the app preview: ${errorMessage}`)
45+
await expect(devClean(mockOptions)).rejects.toThrow(`Failed to stop the dev preview: ${errorMessage}`)
4646
})
4747

4848
test('throws AbortError when devSessions are not supported', async () => {
4949
// Given
5050
mockOptions.appContextResult.developerPlatformClient = customDevPlatformClient(undefined, false)
5151

5252
// When/Then
53-
await expect(devClean(mockOptions)).rejects.toThrow('App preview is not supported for this app.')
53+
await expect(devClean(mockOptions)).rejects.toThrow('Dev preview is not supported for this app.')
5454
})
5555
})
5656

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ export async function devClean(options: DevCleanOptions) {
1414

1515
if (!client.supportsDevSessions) {
1616
throw new AbortError(
17-
`App preview is not supported for this app. It's valid only for apps created on the Next-Gen Dev Platform.`,
17+
`Dev preview is not supported for this app. It's valid only for apps created on the Next-Gen Dev Platform.`,
1818
)
1919
}
2020

2121
const result = await client.devSessionDelete({shopFqdn: options.store.shopDomain, appId: remoteApp.id})
2222

2323
if (result.devSessionDelete?.userErrors.length) {
2424
const errors = result.devSessionDelete.userErrors.map((error) => error.message).join('\n')
25-
throw new AbortError(`Failed to stop the app preview: ${errors}`)
25+
throw new AbortError(`Failed to stop the dev preview: ${errors}`)
2626
}
2727

2828
renderSuccess({
29-
headline: 'App preview stopped.',
29+
headline: 'Dev preview stopped.',
3030
body: [
31-
`The app preview has been stopped on ${options.store.shopDomain} and the app's active version has been restored.`,
31+
`The dev preview has been stopped on ${options.store.shopDomain} and the app's active version has been restored.`,
3232
'You can start it again with',
3333
{command: 'shopify app dev'},
3434
],

packages/app/src/cli/services/dev/processes/dev-session/dev-session-process.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ describe('pushUpdatesForDevSession', () => {
129129
await flushPromises()
130130

131131
// Then
132-
expect(stdout.write).toHaveBeenCalledWith(expect.stringContaining('Updated app preview on test.myshopify.com'))
132+
expect(stdout.write).toHaveBeenCalledWith(expect.stringContaining('Updated dev preview on test.myshopify.com'))
133133
expect(spyContext).toHaveBeenCalledWith({outputPrefix: 'test-ui-extension', stripAnsi: false}, expect.anything())
134134

135135
// In theory this shouldn't be necessary, but vitest doesn't restore spies automatically.
@@ -160,7 +160,7 @@ describe('pushUpdatesForDevSession', () => {
160160

161161
// Then
162162
expect(stdout.write).toHaveBeenCalledWith(
163-
expect.stringContaining('Change detected, but app preview is not ready yet.'),
163+
expect.stringContaining('Change detected, but dev preview is not ready yet.'),
164164
)
165165
expect(developerPlatformClient.devSessionCreate).not.toHaveBeenCalled()
166166
expect(developerPlatformClient.devSessionUpdate).not.toHaveBeenCalled()
@@ -198,7 +198,7 @@ describe('pushUpdatesForDevSession', () => {
198198
await flushPromises()
199199

200200
// Then
201-
expect(stdout.write).toHaveBeenCalledWith(expect.stringContaining('Updated app preview on test.myshopify.com'))
201+
expect(stdout.write).toHaveBeenCalledWith(expect.stringContaining('Updated dev preview on test.myshopify.com'))
202202
expect(stdout.write).toHaveBeenCalledWith(
203203
expect.stringContaining('Access scopes auto-granted: read_products, write_products'),
204204
)
@@ -281,13 +281,13 @@ describe('pushUpdatesForDevSession', () => {
281281
// When
282282
await pushUpdatesForDevSession({stderr, stdout, abortSignal: abortController.signal}, options)
283283

284-
expect(stdout.write).toHaveBeenCalledWith(expect.stringContaining(`Preparing app preview on ${options.storeFqdn}`))
284+
expect(stdout.write).toHaveBeenCalledWith(expect.stringContaining(`Preparing dev preview on ${options.storeFqdn}`))
285285

286286
const statusSpy = vi.spyOn(devSessionStatusManager, 'setMessage')
287287

288288
// Then - Initial loading state
289289
expect(devSessionStatusManager.status.statusMessage).toEqual({
290-
message: 'Preparing app preview',
290+
message: 'Preparing dev preview',
291291
type: 'loading',
292292
})
293293

@@ -352,7 +352,7 @@ describe('pushUpdatesForDevSession', () => {
352352

353353
// Then
354354
expect(devSessionStatusManager.status.statusMessage).toEqual({
355-
message: 'Error updating app preview',
355+
message: 'Error updating dev preview',
356356
type: 'error',
357357
})
358358
})
@@ -558,7 +558,7 @@ describe('pushUpdatesForDevSession', () => {
558558
// Verify the update was attempted and failed
559559
expect(developerPlatformClient.devSessionUpdate).toHaveBeenCalledTimes(1)
560560
expect(stdout.write).toHaveBeenCalledWith(expect.stringContaining('Simulated failure'))
561-
expect(devSessionStatusManager.status.statusMessage?.message).toBe('Error updating app preview')
561+
expect(devSessionStatusManager.status.statusMessage?.message).toBe('Error updating dev preview')
562562

563563
// Second event (should include retry of first failed event)
564564
appWatcher.emit('all', {app, extensionEvents: [{type: 'updated', extension: extension2}]})
@@ -578,7 +578,7 @@ describe('pushUpdatesForDevSession', () => {
578578
expect(secondCallPayload.manifest.modules.length).toBe(2)
579579

580580
// Verify success status was set
581-
expect(stdout.write).toHaveBeenCalledWith(expect.stringContaining('Updated app preview on test.myshopify.com'))
581+
expect(stdout.write).toHaveBeenCalledWith(expect.stringContaining('Updated dev preview on test.myshopify.com'))
582582
expect(devSessionStatusManager.status.statusMessage?.message).toBe('Updated')
583583
})
584584
})

packages/app/src/cli/services/dev/processes/dev-session/dev-session-status-manager.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ describe('DevSessionStatusManager', () => {
120120
expect(listener).toHaveBeenCalledWith(
121121
expect.objectContaining({
122122
statusMessage: {
123-
message: 'Preparing app preview',
123+
message: 'Preparing dev preview',
124124
type: 'loading',
125125
},
126126
}),

packages/app/src/cli/services/dev/processes/dev-session/dev-session-status-manager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ export type DevSessionStatusMessageType = 'error' | 'success' | 'loading'
66
const DevSessionStaticMessages = {
77
BUILD_ERROR: {message: 'Build error. Please review your code and try again', type: 'error'},
88
READY: {message: 'Ready, watching for changes in your app', type: 'success'},
9-
LOADING: {message: 'Preparing app preview', type: 'loading'},
9+
LOADING: {message: 'Preparing dev preview', type: 'loading'},
1010
UPDATED: {message: 'Updated', type: 'success'},
1111
VALIDATION_ERROR: {message: 'Validation error in your app configuration', type: 'error'},
12-
REMOTE_ERROR: {message: 'Error updating app preview', type: 'error'},
13-
CHANGE_DETECTED: {message: 'Change detected, updating app preview', type: 'loading'},
12+
REMOTE_ERROR: {message: 'Error updating dev preview', type: 'error'},
13+
CHANGE_DETECTED: {message: 'Change detected, updating dev preview', type: 'loading'},
1414
} as const
1515

1616
export interface DevSessionStatus {

packages/app/src/cli/services/dev/processes/dev-session/dev-session.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class DevSession {
5252
}
5353

5454
private async start() {
55-
await this.logger.info(`Preparing app preview on ${this.options.storeFqdn}`)
55+
await this.logger.info(`Preparing dev preview on ${this.options.storeFqdn}`)
5656
this.statusManager.setMessage('LOADING')
5757

5858
this.appWatcher
@@ -148,7 +148,7 @@ export class DevSession {
148148
const errors = this.parseBuildErrors(event)
149149
if (errors.length) {
150150
await this.logger.logMultipleErrors(errors)
151-
throw new AbortError('App preview aborted, build errors detected in extensions')
151+
throw new AbortError('Dev preview aborted, build errors detected in extensions')
152152
}
153153
const result = await this.bundleExtensionsAndUpload(event)
154154
await this.handleDevSessionResult(result, event)
@@ -166,7 +166,7 @@ export class DevSession {
166166
*/
167167
private async validateAppEvent(event: AppEvent): Promise<boolean> {
168168
if (!this.statusManager.status.isReady) {
169-
await this.logger.warning('Change detected, but app preview is not ready yet.')
169+
await this.logger.warning('Change detected, but dev preview is not ready yet.')
170170
return false
171171
}
172172

@@ -209,7 +209,7 @@ export class DevSession {
209209
*/
210210
private async handleDevSessionResult(result: DevSessionResult, event?: AppEvent) {
211211
if (result.status === 'updated') {
212-
await this.logger.success(`✅ Updated app preview on ${this.options.storeFqdn}`)
212+
await this.logger.success(`✅ Updated dev preview on ${this.options.storeFqdn}`)
213213
await this.logger.logExtensionUpdateMessages(event)
214214
await this.setUpdatedStatusMessage()
215215
} else if (result.status === 'created') {
@@ -218,7 +218,7 @@ export class DevSession {
218218
await this.logger.logExtensionUpdateMessages(event)
219219
this.statusManager.setMessage('READY')
220220
} else if (result.status === 'aborted') {
221-
await this.logger.debug('❌ App preview update aborted (new change detected or error during update)')
221+
await this.logger.debug('❌ Dev preview update aborted (new change detected or error during update)')
222222
} else if (result.status === 'remote-error' || result.status === 'unknown-error') {
223223
await this.logger.logUserErrors(result.error, event?.app.allExtensions ?? [])
224224
if (result.error instanceof Error && result.error.cause === 'validation-error') {
@@ -232,7 +232,7 @@ export class DevSession {
232232
// If we failed to create a session, exit the process. Don't throw an error in tests as it can't be caught due to the
233233
// async nature of the process.
234234
if (!this.statusManager.status.isReady && !isUnitTest()) {
235-
throw new AbortError('Failed to start app preview.')
235+
throw new AbortError('Failed to start dev preview.')
236236
}
237237
}
238238

packages/app/src/cli/services/dev/ui/components/DevSessionUI.test.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ describe('DevSessionUI', () => {
198198
renderInstance.unmount()
199199
})
200200

201-
test('shows shutting down message when aborted before app preview is ready', async () => {
201+
test('shows shutting down message when aborted before dev preview is ready', async () => {
202202
// Given
203203
const abortController = new AbortController()
204204
devSessionStatusManager.updateStatus({isReady: false})
@@ -222,7 +222,7 @@ describe('DevSessionUI', () => {
222222
renderInstance.unmount()
223223
})
224224

225-
test('shows persistent dev info when aborting and app preview is ready', async () => {
225+
test('shows persistent dev info when aborting and dev preview is ready', async () => {
226226
// Given
227227
const abortController = new AbortController()
228228

@@ -251,7 +251,7 @@ describe('DevSessionUI', () => {
251251
expect(finalOutput).toContain('A preview of your development changes is still available')
252252
expect(finalOutput).toContain('mystore.myshopify.com')
253253
expect(finalOutput).toContain('shopify app dev clean')
254-
expect(finalOutput).toContain('Learn more about app previews')
254+
expect(finalOutput).toContain('Learn more about dev previews')
255255

256256
// unmount so that polling is cleared after every test
257257
renderInstance.unmount()
@@ -300,7 +300,7 @@ describe('DevSessionUI', () => {
300300
expect(output).toContain('A preview of your development changes is still available')
301301
expect(output).toContain('mystore.myshopify.com')
302302
expect(output).toContain('shopify app dev clean')
303-
expect(output).toContain('Learn more about app previews')
303+
expect(output).toContain('Learn more about dev previews')
304304

305305
// Tab interface should be present
306306
expect(output).toContain('(d) Dev status')
@@ -331,7 +331,7 @@ describe('DevSessionUI', () => {
331331
expect(finalOutput).toContain('A preview of your development changes is still available')
332332
expect(finalOutput).toContain('mystore.myshopify.com')
333333
expect(finalOutput).toContain('shopify app dev clean')
334-
expect(finalOutput).toContain('Learn more about app previews')
334+
expect(finalOutput).toContain('Learn more about dev previews')
335335

336336
// Error message should be shown
337337
expect(finalOutput).toContain('something went wrong')

0 commit comments

Comments
 (0)