From 86c575541e94f6d6678d8653ca68ee0785e4161e Mon Sep 17 00:00:00 2001 From: "shopify-build-cli[bot]" <145388831+shopify-build-cli[bot]@users.noreply.github.com> Date: Thu, 26 Nov 2026 16:13:30 +0000 Subject: [PATCH] Update from World Published by the World mirror. World-Commit: fdf10ea448517da112fe929df1316bad8339c5a7 --- .changeset/keep-config-in-dev-previews.md | 5 +++ packages/app/src/cli/models/app/app.test.ts | 4 +- packages/app/src/cli/models/app/app.ts | 6 --- .../app/src/cli/models/app/loader.test.ts | 16 ------- packages/app/src/cli/services/deploy.test.ts | 43 ------------------- .../dev-session/dev-session-process.test.ts | 25 +++++++++++ 6 files changed, 32 insertions(+), 67 deletions(-) create mode 100644 .changeset/keep-config-in-dev-previews.md diff --git a/.changeset/keep-config-in-dev-previews.md b/.changeset/keep-config-in-dev-previews.md new file mode 100644 index 00000000000..de0bdb9c01e --- /dev/null +++ b/.changeset/keep-config-in-dev-previews.md @@ -0,0 +1,5 @@ +--- +'@shopify/app': minor +--- + +Keep app configuration in `app dev` previews after extension changes when the TOML still has the deprecated `include_config_on_deploy = false` diff --git a/packages/app/src/cli/models/app/app.test.ts b/packages/app/src/cli/models/app/app.test.ts index 6453eb0e5a4..34d062917be 100644 --- a/packages/app/src/cli/models/app/app.test.ts +++ b/packages/app/src/cli/models/app/app.test.ts @@ -621,7 +621,7 @@ describe('allExtensions', () => { expect(app.allExtensions).toContain(configExtension) }) - test('does not include configuration extensions when include_config_on_deploy is disabled', async () => { + test('includes configuration extensions when the deprecated include_config_on_deploy is disabled', async () => { const configuration = { ...CORRECT_CURRENT_APP_SCHEMA, build: { @@ -636,7 +636,7 @@ describe('allExtensions', () => { allExtensions: [configExtension], }) - expect(app.allExtensions).toHaveLength(0) + expect(app.allExtensions).toContain(configExtension) }) }) diff --git a/packages/app/src/cli/models/app/app.ts b/packages/app/src/cli/models/app/app.ts index 0bc5d3ac71e..17afce51e22 100644 --- a/packages/app/src/cli/models/app/app.ts +++ b/packages/app/src/cli/models/app/app.ts @@ -232,7 +232,6 @@ export interface AppInterface< nonConfigExtensions: ExtensionInstance[] errors: AppErrors hiddenConfig: AppHiddenConfig - includeConfigOnDeploy: boolean | undefined readonly devApplicationURLs?: ApplicationURLs extensionsForType: (spec: {identifier: string; externalIdentifier: string}) => ExtensionInstance[] updateExtensionUUIDS: (uuids: {[key: string]: string}) => void @@ -324,7 +323,6 @@ export class App< } get allExtensions() { - if (this.includeConfigOnDeploy === false) return this.nonConfigExtensions return this.realExtensions } @@ -470,10 +468,6 @@ export class App< }) } - get includeConfigOnDeploy() { - return this.configuration.build?.include_config_on_deploy - } - private patchAppConfiguration(devApplicationURLs: ApplicationURLs) { this.devApplicationURLs = devApplicationURLs this.configuration.application_url = devApplicationURLs.applicationUrl diff --git a/packages/app/src/cli/models/app/loader.test.ts b/packages/app/src/cli/models/app/loader.test.ts index ed9c6b94e09..05e013cc2af 100644 --- a/packages/app/src/cli/models/app/loader.test.ts +++ b/packages/app/src/cli/models/app/loader.test.ts @@ -2692,22 +2692,6 @@ Learn more: https://shopify.dev/docs/apps/build/authentication-authorization/app await expect(app.preDeployValidation()).resolves.toBeUndefined() }) - test('does not validate Events subscriptions excluded from deployment', async () => { - await writeConfig( - buildAppConfiguration({ - build: {include_config_on_deploy: false}, - extra: `[access_scopes]\nuse_legacy_install_flow = true\n${eventsConfiguration}`, - }), - ) - - const app = await loadTestingApp() - - expect(app.errors.getErrors()).toEqual([]) - expect(app.realExtensions.filter((extension) => extension.type === 'events')).toHaveLength(2) - expect(app.allExtensions).toEqual([]) - await expect(app.preDeployValidation()).resolves.toBeUndefined() - }) - test('creates no events modules for an empty subscription list', async () => { await writeConfig(buildAppConfiguration({extra: '[events]\napi_version = "2024-01"\nsubscription = []'})) diff --git a/packages/app/src/cli/services/deploy.test.ts b/packages/app/src/cli/services/deploy.test.ts index 95159ee3646..63edab5de79 100644 --- a/packages/app/src/cli/services/deploy.test.ts +++ b/packages/app/src/cli/services/deploy.test.ts @@ -470,49 +470,6 @@ describe('deploy', () => { expect(bundleAndBuildExtensions).toHaveBeenCalledOnce() }) - test('doesnt push the configuration extension if include config on deploy is disabled', async () => { - // Given - const extensionNonUuidManaged = await testAppConfigExtensions() - const localApp = { - allExtensions: [extensionNonUuidManaged], - configuration: {...DEFAULT_CONFIG, build: {include_config_on_deploy: false}}, - } - const app = testAppLinked(localApp) - const commitReference = 'https://github.com/deploytest/repo/commit/d4e5ce7999242b200acde378654d62c14b211bcc' - - // When - await testDeployBundle({app, remoteApp, released: false, commitReference, developerPlatformClient}) - - // Then - expect(uploadExtensionsBundle).toHaveBeenCalledWith({ - appManifest: { - name: 'App', - handle: '', - modules: [ - { - type: 'point_of_sale_external', - handle: 'point_of_sale', - uid: 'point_of_sale', - uuid: undefined, - assets: 'point_of_sale', - target: '', - config: expect.any(Object), - }, - ], - }, - appId: 'app-id', - apiKey: 'api-key', - name: app.name, - organizationId: 'org-id', - appModules: [], - developerPlatformClient, - appModuleRegistrationIds: {}, - release: true, - commitReference, - }) - expect(bundleAndBuildExtensions).toHaveBeenCalledOnce() - }) - test('returns deployment data without a completion banner', async () => { await inTemporaryDirectory(async (directory) => { const app = testAppLinked({directory, allExtensions: []}) diff --git a/packages/app/src/cli/services/dev/processes/dev-session/dev-session-process.test.ts b/packages/app/src/cli/services/dev/processes/dev-session/dev-session-process.test.ts index d4efca19ace..18523e782c6 100644 --- a/packages/app/src/cli/services/dev/processes/dev-session/dev-session-process.test.ts +++ b/packages/app/src/cli/services/dev/processes/dev-session/dev-session-process.test.ts @@ -4,6 +4,7 @@ import {DeveloperPlatformClient} from '../../../../utilities/developer-platform- import {AppLinkedInterface} from '../../../../models/app/app.js' import {AppEventWatcher} from '../../app-events/app-event-watcher.js' import { + DEFAULT_CONFIG, testAppAccessConfigExtension, testAppLinked, testDeveloperPlatformClient, @@ -512,6 +513,30 @@ describe('pushUpdatesForDevSession', () => { }) }) + test('inherits app configuration modules on an extension-only update when include_config_on_deploy is false', async () => { + vi.mocked(readdir).mockResolvedValue([]) + const updatedExtension = await testUIExtension() + updatedExtension.deployConfig = vi.fn().mockResolvedValue({}) + const appAccess = await testAppAccessConfigExtension() + const appWithDeprecatedFlag = testAppLinked({ + configuration: {...DEFAULT_CONFIG, build: {include_config_on_deploy: false}}, + allExtensions: [updatedExtension, appAccess], + }) + + await pushUpdatesForDevSession({stderr, stdout, abortSignal: abortController.signal}, options) + await appWatcher.start({stdout, stderr, signal: abortController.signal}) + await flushPromises() + appWatcher.emit('all', { + app: appWithDeprecatedFlag, + extensionEvents: [{type: 'updated', extension: updatedExtension}], + }) + await flushPromises() + + expect(developerPlatformClient.devSessionUpdate).toHaveBeenCalledWith( + expect.objectContaining({inheritedModuleUids: [appAccess.uid]}), + ) + }) + test('writes full manifest to bundle on session update, not just create', async () => { // Given vi.mocked(readdir).mockResolvedValue([])