From cb06c5d3cead807b9659685cb70523f345810fb7 Mon Sep 17 00:00:00 2001 From: Ryan Bahan Date: Fri, 6 Mar 2026 16:09:11 -0700 Subject: [PATCH 1/2] Extract path from AppConfiguration into App.configPath MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Path is not data — it's metadata about where the config file lives, not part of what the TOML file contains. This is the first step toward making AppConfiguration a trustworthy, file-shaped type. - Add `configPath: string` to App, AppInterface, AppConfigurationInterface - Remove `& {path: string}` from AppConfiguration, BasicAppConfigurationWithoutModules, LegacyAppConfiguration - Delete AppConfigurationWithoutPath (replaced by AppConfiguration) - Simplify SchemaForConfig (no more Omit<..., 'path'>) - parseConfigurationFile no longer bolts path onto return value - writeAppConfigurationFile takes explicit configPath parameter - Type guards pass objects directly (no destructuring to strip path) - Migrate ~24 callsites from app.configuration.path → app.configPath - Remove 10 workarounds (delete file.path, blocklist, Omit wrappers) Co-Authored-By: Claude Opus 4.6 (1M context) # Conflicts: # packages/app/src/cli/models/app/app.test-data.ts # packages/app/src/cli/models/app/app.test.ts # packages/app/src/cli/models/app/app.ts # packages/app/src/cli/models/app/loader.test.ts # packages/app/src/cli/models/app/loader.ts # packages/app/src/cli/services/app-context.test.ts # packages/app/src/cli/services/app/config/link.test.ts # packages/app/src/cli/services/app/config/use.test.ts # packages/app/src/cli/services/app/env/pull.test.ts # packages/app/src/cli/services/app/env/show.test.ts # packages/app/src/cli/services/context.ts # packages/app/src/cli/services/context/identifiers-extensions.test.ts # packages/app/src/cli/services/dev.ts # packages/app/src/cli/services/dev/app-events/app-event-watcher.test.ts # packages/app/src/cli/services/dev/app-events/file-watcher.test.ts # packages/app/src/cli/services/dev/select-app.test.ts # packages/app/src/cli/services/info.test.ts # packages/app/src/cli/utilities/developer-platform-client/partners-client.test.ts --- .../app/src/cli/commands/app/config/pull.ts | 5 ++- packages/app/src/cli/commands/app/env/pull.ts | 2 +- .../app/src/cli/models/app/app.test-data.ts | 8 ++-- packages/app/src/cli/models/app/app.test.ts | 2 +- packages/app/src/cli/models/app/app.ts | 17 ++++---- .../src/cli/models/app/identifiers.test.ts | 5 +-- .../app/src/cli/models/app/identifiers.ts | 2 +- .../app/src/cli/models/app/loader.test.ts | 25 ++++-------- packages/app/src/cli/models/app/loader.ts | 28 ++++++------- .../models/extensions/extension-instance.ts | 6 +-- .../cli/models/extensions/specification.ts | 6 +-- .../app_config_app_proxy.test.ts | 4 +- .../app_config_privacy_compliance_webhooks.ts | 4 +- .../app_config_webhook_subscription.test.ts | 4 +- .../app/src/cli/services/app-context.test.ts | 7 +--- .../app/config-pipeline-snapshot.test.ts | 39 ++++++++----------- .../services/app/config/link-service.test.ts | 1 - .../src/cli/services/app/config/link.test.ts | 32 +++------------ .../app/src/cli/services/app/config/link.ts | 3 +- .../app/src/cli/services/app/config/pull.ts | 9 +++-- .../src/cli/services/app/config/use.test.ts | 5 +++ .../app/src/cli/services/app/env/pull.test.ts | 3 +- .../app/src/cli/services/app/env/show.test.ts | 2 - .../app/write-app-configuration-file.test.ts | 6 +-- .../app/write-app-configuration-file.ts | 12 ++++-- packages/app/src/cli/services/context.test.ts | 3 +- packages/app/src/cli/services/context.ts | 10 ++--- .../context/breakdown-extensions.test.ts | 8 ---- .../context/identifiers-extensions.test.ts | 1 - packages/app/src/cli/services/dev.ts | 6 +-- .../dev/app-events/app-event-watcher.test.ts | 9 ++++- .../dev/app-events/file-watcher.test.ts | 6 +-- .../services/dev/app-events/file-watcher.ts | 6 +-- .../src/cli/services/dev/select-app.test.ts | 1 - .../src/cli/services/dev/update-extension.ts | 4 +- packages/app/src/cli/services/dev/urls.ts | 4 +- .../app/src/cli/services/generate.test.ts | 2 +- packages/app/src/cli/services/info.test.ts | 2 +- packages/app/src/cli/services/info.ts | 2 +- packages/app/src/cli/services/logs.ts | 2 +- .../app/src/cli/services/versions-list.ts | 2 +- .../cli/services/webhook/trigger-options.ts | 2 +- .../partners-client.test.ts | 1 - 43 files changed, 136 insertions(+), 172 deletions(-) diff --git a/packages/app/src/cli/commands/app/config/pull.ts b/packages/app/src/cli/commands/app/config/pull.ts index f5672c93bd7..a90dd514364 100644 --- a/packages/app/src/cli/commands/app/config/pull.ts +++ b/packages/app/src/cli/commands/app/config/pull.ts @@ -30,16 +30,17 @@ This command reuses the existing linked app and organization and skips all inter userProvidedConfigName: flags.config, }) - const {configuration} = await pull({ + const {configuration, configPath} = await pull({ directory: flags.path, configName: flags.config, + configPath: app.configPath, configuration: app.configuration, remoteApp, }) renderSuccess({ headline: `Pulled latest configuration for "${configuration.name}"`, - body: `Updated ${basename(configuration.path)} with the remote data.`, + body: `Updated ${basename(configPath)} with the remote data.`, }) return {app} diff --git a/packages/app/src/cli/commands/app/env/pull.ts b/packages/app/src/cli/commands/app/env/pull.ts index f68c42b6050..4e437f2a261 100644 --- a/packages/app/src/cli/commands/app/env/pull.ts +++ b/packages/app/src/cli/commands/app/env/pull.ts @@ -36,7 +36,7 @@ export default class EnvPull extends AppLinkedCommand { forceRelink: flags.reset, userProvidedConfigName: flags.config, }) - const envFile = joinPath(app.directory, flags['env-file'] ?? getDotEnvFileName(app.configuration.path)) + const envFile = joinPath(app.directory, flags['env-file'] ?? getDotEnvFileName(app.configPath)) outputResult(await pullEnv({app, remoteApp, organization, envFile})) return {app} } diff --git a/packages/app/src/cli/models/app/app.test-data.ts b/packages/app/src/cli/models/app/app.test-data.ts index d42e376b710..1b49533612f 100644 --- a/packages/app/src/cli/models/app/app.test-data.ts +++ b/packages/app/src/cli/models/app/app.test-data.ts @@ -1,7 +1,7 @@ import { App, AppSchema, - AppConfigurationWithoutPath, + AppConfiguration, AppInterface, AppLinkedInterface, CurrentAppConfiguration, @@ -82,7 +82,6 @@ import {vi} from 'vitest' import {joinPath} from '@shopify/cli-kit/node/path' export const DEFAULT_CONFIG = { - path: '/tmp/project/shopify.app.toml', application_url: 'https://myapp.com', client_id: 'api-key', name: 'my app', @@ -96,7 +95,7 @@ export const DEFAULT_CONFIG = { }, } -export function testApp(app: Partial = {}, schemaType: 'current' | 'legacy' = 'legacy'): AppInterface { +export function testApp(app: Partial = {}): AppInterface { const getConfig = () => { return DEFAULT_CONFIG as CurrentAppConfiguration } @@ -104,6 +103,7 @@ export function testApp(app: Partial = {}, schemaType: 'current' | const newApp = new App({ name: app.name ?? 'App', directory: app.directory ?? '/tmp/project', + configPath: app.configPath ?? '/tmp/project/shopify.app.toml', packageManager: app.packageManager ?? 'yarn', configuration: app.configuration ?? getConfig(), nodeDependencies: app.nodeDependencies ?? {}, @@ -188,7 +188,7 @@ export function testOrganizationApp(app: Partial = {}): Organiz return {...defaultApp, ...app} } -export const placeholderAppConfiguration: AppConfigurationWithoutPath = { +export const placeholderAppConfiguration: AppConfiguration = { client_id: '', } diff --git a/packages/app/src/cli/models/app/app.test.ts b/packages/app/src/cli/models/app/app.test.ts index 34dbbbe087d..99f4d1ab880 100644 --- a/packages/app/src/cli/models/app/app.test.ts +++ b/packages/app/src/cli/models/app/app.test.ts @@ -1,4 +1,5 @@ import { + AppConfiguration, AppSchema, CurrentAppConfiguration, getAppScopes, @@ -29,7 +30,6 @@ import {joinPath} from '@shopify/cli-kit/node/path' import {AbortError} from '@shopify/cli-kit/node/error' const CORRECT_CURRENT_APP_SCHEMA: CurrentAppConfiguration = { - path: '', name: 'app 1', client_id: '12345', extension_directories: ['extensions/*'], diff --git a/packages/app/src/cli/models/app/app.ts b/packages/app/src/cli/models/app/app.ts index 3385d52dbdf..d5e0edfeb14 100644 --- a/packages/app/src/cli/models/app/app.ts +++ b/packages/app/src/cli/models/app/app.ts @@ -84,13 +84,12 @@ export interface AppHiddenConfig { * * Try to avoid using this: generally you should be working with a more specific type. */ -export type AppConfiguration = zod.infer & {path: string} -export type AppConfigurationWithoutPath = zod.infer +export type AppConfiguration = zod.infer /** * App configuration for a normal, linked, app. Doesn't include properties that are module derived. */ -export type BasicAppConfigurationWithoutModules = zod.infer & {path: string} +export type BasicAppConfigurationWithoutModules = zod.infer /** * The build section for a normal, linked app. The options here tweak the CLI's behavior when working with the app. @@ -103,12 +102,12 @@ export type CliBuildPreferences = BasicAppConfigurationWithoutModules['build'] export type CurrentAppConfiguration = BasicAppConfigurationWithoutModules & AppConfigurationUsedByCli /** Validation schema that produces a provided app configuration type */ -export type SchemaForConfig = ZodObjectOf> +export type SchemaForConfig = ZodObjectOf export function getAppVersionedSchema( specs: ExtensionSpecification[], allowDynamicallySpecifiedConfigs = true, -): ZodObjectOf> { +): ZodObjectOf { // eslint-disable-next-line @typescript-eslint/no-explicit-any const schema = specs.reduce((schema, spec) => spec.contributeToAppConfigurationSchema(schema), AppSchema) @@ -144,7 +143,7 @@ export function appHiddenConfigPath(appDirectory: string) { * Get the field names from the configuration that aren't found in the basic built-in app configuration schema. */ export function filterNonVersionedAppFields(configuration: object): string[] { - const builtInFieldNames = Object.keys(AppSchema.shape).concat('path', 'organization_id') + const builtInFieldNames = Object.keys(AppSchema.shape).concat('organization_id') return Object.keys(configuration).filter((fieldName) => { return !builtInFieldNames.includes(fieldName) }) @@ -194,6 +193,7 @@ export interface AppConfigurationInterface< TModuleSpec extends ExtensionSpecification = ExtensionSpecification, > { directory: string + configPath: string configuration: TConfig configSchema: SchemaForConfig specifications: TModuleSpec[] @@ -284,6 +284,7 @@ export class App< name: string idEnvironmentVariableName: 'SHOPIFY_API_KEY' = 'SHOPIFY_API_KEY' as const directory: string + configPath: string packageManager: PackageManager configuration: TConfig nodeDependencies: {[key: string]: string} @@ -292,7 +293,7 @@ export class App< dotenv?: DotEnvFile errors?: AppErrors specifications: TModuleSpec[] - configSchema: ZodObjectOf> + configSchema: SchemaForConfig remoteFlags: Flag[] realExtensions: ExtensionInstance[] devApplicationURLs?: ApplicationURLs @@ -301,6 +302,7 @@ export class App< constructor({ name, directory, + configPath, packageManager, configuration, nodeDependencies, @@ -317,6 +319,7 @@ export class App< }: AppConstructor) { this.name = name this.directory = directory + this.configPath = configPath this.packageManager = packageManager this.configuration = configuration this.nodeDependencies = nodeDependencies diff --git a/packages/app/src/cli/models/app/identifiers.test.ts b/packages/app/src/cli/models/app/identifiers.test.ts index c1ddb635e06..5ad091c0ac9 100644 --- a/packages/app/src/cli/models/app/identifiers.test.ts +++ b/packages/app/src/cli/models/app/identifiers.test.ts @@ -46,11 +46,10 @@ describe('updateAppIdentifiers', () => { const app = testAppWithConfig({ app: { directory: tmpDir, + configPath: joinPath(tmpDir, 'shopify.app.staging.toml'), allExtensions: [uiExtension], }, - config: { - path: joinPath(tmpDir, 'shopify.app.staging.toml'), - }, + config: {}, }) // When diff --git a/packages/app/src/cli/models/app/identifiers.ts b/packages/app/src/cli/models/app/identifiers.ts index 387ec010084..7abbe7145c2 100644 --- a/packages/app/src/cli/models/app/identifiers.ts +++ b/packages/app/src/cli/models/app/identifiers.ts @@ -54,7 +54,7 @@ export async function updateAppIdentifiers( if (!dotenvFile) { dotenvFile = { - path: joinPath(app.directory, getDotEnvFileName(app.configuration.path)), + path: joinPath(app.directory, getDotEnvFileName(app.configPath)), variables: {}, } } diff --git a/packages/app/src/cli/models/app/loader.test.ts b/packages/app/src/cli/models/app/loader.test.ts index 253293fafae..dcde9758e94 100644 --- a/packages/app/src/cli/models/app/loader.test.ts +++ b/packages/app/src/cli/models/app/loader.test.ts @@ -13,7 +13,7 @@ import { loadHiddenConfig, } from './loader.js' import {parseHumanReadableError} from './error-parsing.js' -import {App, AppInterface, AppLinkedInterface, AppSchema, WebConfigurationSchema} from './app.js' +import {App, AppConfiguration, AppInterface, AppLinkedInterface, AppSchema, WebConfigurationSchema} from './app.js' import {DEFAULT_CONFIG, buildVersionedAppSchema, getWebhookConfig} from './app.test-data.js' import {ExtensionInstance} from '../extensions/extension-instance.js' import {configurationFileNames, blocks} from '../../constants.js' @@ -2908,8 +2908,7 @@ describe('parseConfigurationObject', () => { const abortOrReport = vi.fn() const {schema} = await buildVersionedAppSchema() - const {path, ...toParse} = configurationObject - await parseConfigurationObject(schema, 'tmp', toParse, abortOrReport) + await parseConfigurationObject(schema, 'tmp', configurationObject, abortOrReport) expect(abortOrReport).toHaveBeenCalledWith(expectedFormatted, {}, 'tmp') }) @@ -3479,7 +3478,7 @@ describe('WebhooksSchema', () => { )} in tmp:\n\n${parseHumanReadableError(err)}` const abortOrReport = vi.fn() - const {path, ...toParse} = getWebhookConfig(webhookConfigOverrides) + const toParse = getWebhookConfig(webhookConfigOverrides) const parsedConfiguration = await parseConfigurationObject(WebhooksSchema, 'tmp', toParse, abortOrReport) return {abortOrReport, expectedFormatted, parsedConfiguration} } @@ -3491,7 +3490,6 @@ describe('getAppConfigurationState', () => { `client_id="abcdef"`, { basicConfiguration: { - path: expect.stringMatching(/shopify.app.toml$/), client_id: 'abcdef', }, isLinked: true, @@ -3502,7 +3500,6 @@ describe('getAppConfigurationState', () => { something_extra="keep"`, { basicConfiguration: { - path: expect.stringMatching(/shopify.app.toml$/), client_id: 'abcdef', something_extra: 'keep', }, @@ -3513,7 +3510,6 @@ describe('getAppConfigurationState', () => { `client_id=""`, { basicConfiguration: { - path: expect.stringMatching(/shopify.app.toml$/), client_id: '', }, isLinked: false, @@ -3692,9 +3688,8 @@ describe('loadHiddenConfig', () => { await inTemporaryDirectory(async (tmpDir) => { // Given const configuration = { - path: joinPath(tmpDir, 'shopify.app.toml'), client_id: '12345', - } + } as AppConfiguration await writeFile(joinPath(tmpDir, '.gitignore'), '') // When @@ -3714,9 +3709,8 @@ describe('loadHiddenConfig', () => { await inTemporaryDirectory(async (tmpDir) => { // Given const configuration = { - path: joinPath(tmpDir, 'shopify.app.toml'), client_id: '12345', - } + } as AppConfiguration const hiddenConfigPath = joinPath(tmpDir, '.shopify', 'project.json') await mkdir(dirname(hiddenConfigPath)) await writeFile( @@ -3739,9 +3733,8 @@ describe('loadHiddenConfig', () => { await inTemporaryDirectory(async (tmpDir) => { // Given const configuration = { - path: joinPath(tmpDir, 'shopify.app.toml'), client_id: 'not-found', - } + } as AppConfiguration const hiddenConfigPath = joinPath(tmpDir, '.shopify', 'project.json') await mkdir(dirname(hiddenConfigPath)) await writeFile( @@ -3763,9 +3756,8 @@ describe('loadHiddenConfig', () => { await inTemporaryDirectory(async (tmpDir) => { // Given const configuration = { - path: joinPath(tmpDir, 'shopify.app.toml'), client_id: 'not-found', - } + } as AppConfiguration const hiddenConfigPath = joinPath(tmpDir, '.shopify', 'project.json') await mkdir(dirname(hiddenConfigPath)) await writeFile( @@ -3787,9 +3779,8 @@ describe('loadHiddenConfig', () => { await inTemporaryDirectory(async (tmpDir) => { // Given const configuration = { - path: joinPath(tmpDir, 'shopify.app.toml'), client_id: '12345', - } + } as AppConfiguration const hiddenConfigPath = joinPath(tmpDir, '.shopify', 'project.json') await mkdir(dirname(hiddenConfigPath)) await writeFile(hiddenConfigPath, 'invalid json') diff --git a/packages/app/src/cli/models/app/loader.ts b/packages/app/src/cli/models/app/loader.ts index c4c06bd9d67..1d8a4125d09 100644 --- a/packages/app/src/cli/models/app/loader.ts +++ b/packages/app/src/cli/models/app/loader.ts @@ -103,15 +103,14 @@ export async function parseConfigurationFile( filepath: string, abortOrReport: AbortOrReport = abort, preloadedContent?: JsonMapType, -): Promise & {path: string}> { +): Promise> { const fallbackOutput = {} as zod.TypeOf const configurationObject = preloadedContent ?? (await loadConfigurationFileContent(filepath, abortOrReport)) if (!configurationObject) return fallbackOutput - const configuration = parseConfigurationObject(schema, filepath, configurationObject, abortOrReport) - return {...configuration, path: filepath} + return parseConfigurationObject(schema, filepath, configurationObject, abortOrReport) } /** @@ -358,7 +357,7 @@ export async function loadOpaqueApp(options: { } export async function reloadApp(app: AppLinkedInterface): Promise { - const state = await getAppConfigurationState(app.directory, basename(app.configuration.path)) + const state = await getAppConfigurationState(app.directory, basename(app.configPath)) const loadedConfiguration = await loadAppConfigurationFromState(state, app.specifications, app.remoteFlags ?? []) const loader = new AppLoader({ @@ -423,11 +422,11 @@ class AppLoader { - return this.createExtensionInstance(specification.identifier, subscription, appConfiguration.path, directory) + return this.createExtensionInstance(specification.identifier, subscription, configPath, directory) }) return instances } private async createConfigExtensionInstances(directory: string, appConfiguration: TConfig) { + const configPath = this.loadedConfiguration.configPath const extensionInstancesWithKeys = await Promise.all( this.specifications .filter((specification) => specification.uidStrategy === 'single') .map(async (specification) => { const specConfiguration = parseConfigurationObjectAgainstSpecification( specification, - appConfiguration.path, + configPath, appConfiguration, this.abortOrReport.bind(this), ) @@ -725,7 +727,7 @@ class AppLoader this.validateConfigurationExtensionInstance( @@ -743,7 +745,7 @@ class AppLoader !extensionInstancesWithKeys.some(([_, keys]) => keys.includes(key))) .filter((key) => { - const configKeysThatAreNeverModules = [...Object.keys(AppSchema.shape), 'path', 'organization_id'] + const configKeysThatAreNeverModules = [...Object.keys(AppSchema.shape), 'organization_id'] return !configKeysThatAreNeverModules.includes(key) }) @@ -751,7 +753,7 @@ class AppLoader @@ -991,6 +992,7 @@ async function loadAppConfigurationFromState object + forward?: (obj: object, appConfiguration: AppConfiguration, options?: {flags?: Flag[]}) => object reverse?: (obj: object, options?: {flags?: Flag[]}) => object } @@ -93,7 +93,7 @@ export interface ExtensionSpecification object + transformLocalToRemote?: (localContent: object, appConfiguration: AppConfiguration) => object /** * If required, convert configuration from the platform to the format used locally in the filesystem. diff --git a/packages/app/src/cli/models/extensions/specifications/app_config_app_proxy.test.ts b/packages/app/src/cli/models/extensions/specifications/app_config_app_proxy.test.ts index 76904d4b73c..78ceb214c47 100644 --- a/packages/app/src/cli/models/extensions/specifications/app_config_app_proxy.test.ts +++ b/packages/app/src/cli/models/extensions/specifications/app_config_app_proxy.test.ts @@ -1,6 +1,6 @@ import spec, {type AppProxyConfigType} from './app_config_app_proxy.js' import {placeholderAppConfiguration} from '../../app/app.test-data.js' -import {AppConfigurationWithoutPath} from '../../app/app.js' +import {AppConfiguration} from '../../app/app.js' import {describe, expect, test} from 'vitest' describe('app_config_app_proxy', () => { @@ -41,7 +41,7 @@ describe('app_config_app_proxy', () => { // When const result = appConfigSpec.transformLocalToRemote!(object, { application_url: 'https://my-app-url.com/', - } as unknown as AppConfigurationWithoutPath) + } as unknown as AppConfiguration) // Then expect(result).toMatchObject({ diff --git a/packages/app/src/cli/models/extensions/specifications/app_config_privacy_compliance_webhooks.ts b/packages/app/src/cli/models/extensions/specifications/app_config_privacy_compliance_webhooks.ts index 0599e0ed0bd..fbeada25f8c 100644 --- a/packages/app/src/cli/models/extensions/specifications/app_config_privacy_compliance_webhooks.ts +++ b/packages/app/src/cli/models/extensions/specifications/app_config_privacy_compliance_webhooks.ts @@ -4,7 +4,7 @@ import {ComplianceTopic} from './app_config_webhook_schemas/webhook_subscription import {mergeAllWebhooks} from './transform/app_config_webhook.js' import {removeTrailingSlash} from './validation/common.js' import {CustomTransformationConfig, createConfigExtensionSpecification} from '../specification.js' -import {AppConfigurationWithoutPath, CurrentAppConfiguration} from '../../app/app.js' +import {AppConfiguration, CurrentAppConfiguration} from '../../app/app.js' import {compact, getPathValue} from '@shopify/cli-kit/common/object' const PrivacyComplianceWebhooksTransformConfig: CustomTransformationConfig = { @@ -23,7 +23,7 @@ const appPrivacyComplienceSpec = createConfigExtensionSpecification({ export default appPrivacyComplienceSpec -function transformToPrivacyComplianceWebhooksModule(content: object, appConfiguration: AppConfigurationWithoutPath) { +function transformToPrivacyComplianceWebhooksModule(content: object, appConfiguration: AppConfiguration) { const webhooks = getPathValue(content, 'webhooks') as WebhooksConfig let appUrl: string | undefined if ('application_url' in appConfiguration) { diff --git a/packages/app/src/cli/models/extensions/specifications/app_config_webhook_subscription.test.ts b/packages/app/src/cli/models/extensions/specifications/app_config_webhook_subscription.test.ts index 6310458ac75..297bf04c74e 100644 --- a/packages/app/src/cli/models/extensions/specifications/app_config_webhook_subscription.test.ts +++ b/packages/app/src/cli/models/extensions/specifications/app_config_webhook_subscription.test.ts @@ -1,5 +1,5 @@ import spec from './app_config_webhook_subscription.js' -import {AppConfigurationWithoutPath} from '../../app/app.js' +import {AppConfiguration} from '../../app/app.js' import {describe, expect, test} from 'vitest' describe('webhook_subscription', () => { @@ -45,7 +45,7 @@ describe('webhook_subscription', () => { const result = webhookSpec.transformLocalToRemote!(object, { application_url: 'https://my-app-url.com/', - } as unknown as AppConfigurationWithoutPath) + } as unknown as AppConfiguration) expect(result).toEqual({ uri: 'https://my-app-url.com/products', diff --git a/packages/app/src/cli/services/app-context.test.ts b/packages/app/src/cli/services/app-context.test.ts index 0ab95ee1d57..c75f80b9d9d 100644 --- a/packages/app/src/cli/services/app-context.test.ts +++ b/packages/app/src/cli/services/app-context.test.ts @@ -68,7 +68,6 @@ client_id="test-api-key"` configuration: { client_id: 'test-api-key', name: 'test-app', - path: normalizePath(joinPath(tmp, 'shopify.app.toml')), }, }), remoteApp: mockRemoteApp, @@ -161,14 +160,12 @@ client_id="test-api-key"` isLinked: true, basicConfiguration: { client_id: 'test-api-key', - path: normalizePath(joinPath(tmp, 'shopify.app.toml')), }, }, configuration: { client_id: 'test-api-key', name: 'test-app', application_url: 'https://test-app.com', - path: normalizePath(joinPath(tmp, 'shopify.app.toml')), embedded: false, }, }) @@ -298,9 +295,9 @@ describe('localAppContext', () => { expect(result.configuration).toEqual( expect.objectContaining({ name: 'test-app', - path: normalizePath(joinPath(tmp, 'shopify.app.toml')), }), ) + expect(result.configPath).toEqual(normalizePath(joinPath(tmp, 'shopify.app.toml'))) // Verify no network calls were made expect(appFromIdentifiers).not.toHaveBeenCalled() expect(fetchOrgFromId).not.toHaveBeenCalled() @@ -336,9 +333,9 @@ describe('localAppContext', () => { expect(result.configuration).toEqual( expect.objectContaining({ name: 'test-app-custom', - path: normalizePath(joinPath(tmp, 'shopify.app.custom.toml')), }), ) + expect(result.configPath).toEqual(normalizePath(joinPath(tmp, 'shopify.app.custom.toml'))) }) }) diff --git a/packages/app/src/cli/services/app/config-pipeline-snapshot.test.ts b/packages/app/src/cli/services/app/config-pipeline-snapshot.test.ts index 403f8c2ffa4..309876880b7 100644 --- a/packages/app/src/cli/services/app/config-pipeline-snapshot.test.ts +++ b/packages/app/src/cli/services/app/config-pipeline-snapshot.test.ts @@ -24,7 +24,6 @@ async function parseConfigAsCurrentApp(schema: zod.ZodTypeAny, filePath: string) */ const REALISTIC_CONFIG = { - path: '/tmp/project/shopify.app.toml', client_id: '12345', name: 'My Test App', application_url: 'https://myapp.example.com', @@ -90,13 +89,13 @@ describe('Config pipeline snapshots', () => { const {schema, configSpecifications: specs} = await buildVersionedAppSchema() // First write - await writeAppConfigurationFile({...REALISTIC_CONFIG, path: filePath}, schema) + await writeAppConfigurationFile(REALISTIC_CONFIG as CurrentAppConfiguration, schema, filePath) // Read back through the full parse pipeline (which fires Zod transforms) const parsedConfig = await parseConfigAsCurrentApp(getAppVersionedSchema(specs), filePath) // Second write from the parsed (transformed) config - await writeAppConfigurationFile(parsedConfig, schema) + await writeAppConfigurationFile(parsedConfig, schema, filePath) const secondWrite = await readFile(filePath) // Snapshot the round-tripped output — it differs from the first write @@ -113,14 +112,14 @@ describe('Config pipeline snapshots', () => { const {schema, configSpecifications: specs} = await buildVersionedAppSchema() // First write + read + second write (reordering happens here) - await writeAppConfigurationFile({...REALISTIC_CONFIG, path: filePath}, schema) + await writeAppConfigurationFile(REALISTIC_CONFIG as CurrentAppConfiguration, schema, filePath) const parsed1 = await parseConfigAsCurrentApp(getAppVersionedSchema(specs), filePath) - await writeAppConfigurationFile(parsed1, schema) + await writeAppConfigurationFile(parsed1, schema, filePath) const secondWrite = await readFile(filePath) // Third write from re-read — should be identical to second const parsed2 = await parseConfigAsCurrentApp(getAppVersionedSchema(specs), filePath) - await writeAppConfigurationFile(parsed2, schema) + await writeAppConfigurationFile(parsed2, schema, filePath) const thirdWrite = await readFile(filePath) expect(thirdWrite).toEqual(secondWrite) @@ -134,7 +133,6 @@ describe('Config pipeline snapshots', () => { const config = { ...REALISTIC_CONFIG, - path: filePath, webhooks: { api_version: '2024-01', subscriptions: [ @@ -160,13 +158,13 @@ describe('Config pipeline snapshots', () => { } // Snapshot the first write - await writeAppConfigurationFile(config, schema) + await writeAppConfigurationFile(config as CurrentAppConfiguration, schema, filePath) const firstWrite = await readFile(filePath) expect(firstWrite).toMatchSnapshot() // Round-trip to verify reordering behavior on the most complex fixture const parsedConfig = await parseConfigAsCurrentApp(getAppVersionedSchema(specs), filePath) - await writeAppConfigurationFile(parsedConfig, schema) + await writeAppConfigurationFile(parsedConfig, schema, filePath) const secondWrite = await readFile(filePath) expect(secondWrite).toMatchSnapshot() }) @@ -179,7 +177,6 @@ describe('Config pipeline snapshots', () => { const config = { ...REALISTIC_CONFIG, - path: filePath, webhooks: { api_version: '2024-01', subscriptions: [ @@ -192,11 +189,11 @@ describe('Config pipeline snapshots', () => { } // Write, read, write - await writeAppConfigurationFile(config, schema) + await writeAppConfigurationFile(config as CurrentAppConfiguration, schema, filePath) const firstWrite = await readFile(filePath) const parsedConfig = await parseConfigAsCurrentApp(getAppVersionedSchema(specs), filePath) - await writeAppConfigurationFile(parsedConfig, schema) + await writeAppConfigurationFile(parsedConfig, schema, filePath) const secondWrite = await readFile(filePath) expect(secondWrite).toEqual(firstWrite) @@ -209,7 +206,6 @@ describe('Config pipeline snapshots', () => { const {schema} = await buildVersionedAppSchema() const config = { - path: filePath, client_id: '12345', name: 'Minimal App', application_url: 'https://example.com', @@ -222,7 +218,7 @@ describe('Config pipeline snapshots', () => { }, } satisfies CurrentAppConfiguration - await writeAppConfigurationFile(config, schema) + await writeAppConfigurationFile(config, schema, filePath) const content = await readFile(filePath) expect(content).toMatchSnapshot() }) @@ -235,7 +231,6 @@ describe('Config pipeline snapshots', () => { const config = { ...REALISTIC_CONFIG, - path: filePath, webhooks: { api_version: '2024-01', subscriptions: [ @@ -245,11 +240,11 @@ describe('Config pipeline snapshots', () => { }, } - await writeAppConfigurationFile(config, schema) + await writeAppConfigurationFile(config as CurrentAppConfiguration, schema, filePath) const firstWrite = await readFile(filePath) const parsedConfig = await parseConfigAsCurrentApp(getAppVersionedSchema(specs), filePath) - await writeAppConfigurationFile(parsedConfig, schema) + await writeAppConfigurationFile(parsedConfig, schema, filePath) const secondWrite = await readFile(filePath) expect(firstWrite).toMatchSnapshot() @@ -264,7 +259,6 @@ describe('Config pipeline snapshots', () => { const config = { ...REALISTIC_CONFIG, - path: filePath, webhooks: { api_version: '2024-01', subscriptions: [ @@ -274,11 +268,11 @@ describe('Config pipeline snapshots', () => { }, } - await writeAppConfigurationFile(config, schema) + await writeAppConfigurationFile(config as CurrentAppConfiguration, schema, filePath) const firstWrite = await readFile(filePath) const parsedConfig = await parseConfigAsCurrentApp(getAppVersionedSchema(specs), filePath) - await writeAppConfigurationFile(parsedConfig, schema) + await writeAppConfigurationFile(parsedConfig, schema, filePath) const secondWrite = await readFile(filePath) expect(firstWrite).toMatchSnapshot() @@ -293,7 +287,6 @@ describe('Config pipeline snapshots', () => { const config = { ...REALISTIC_CONFIG, - path: filePath, webhooks: { api_version: '2024-01', subscriptions: [ @@ -306,11 +299,11 @@ describe('Config pipeline snapshots', () => { }, } - await writeAppConfigurationFile(config, schema) + await writeAppConfigurationFile(config as CurrentAppConfiguration, schema, filePath) const firstWrite = await readFile(filePath) const parsedConfig = await parseConfigAsCurrentApp(getAppVersionedSchema(specs), filePath) - await writeAppConfigurationFile(parsedConfig, schema) + await writeAppConfigurationFile(parsedConfig, schema, filePath) const secondWrite = await readFile(filePath) // After round-trip, compliance and regular topics should be split into separate subscriptions diff --git a/packages/app/src/cli/services/app/config/link-service.test.ts b/packages/app/src/cli/services/app/config/link-service.test.ts index 408bf450757..d4368acbfb0 100644 --- a/packages/app/src/cli/services/app/config/link-service.test.ts +++ b/packages/app/src/cli/services/app/config/link-service.test.ts @@ -140,7 +140,6 @@ embedded = false pos: { embedded: false, }, - path: expect.stringMatching(/\/shopify.app.toml$/), }) expect(content).toEqual(expectedContent) }) diff --git a/packages/app/src/cli/services/app/config/link.test.ts b/packages/app/src/cli/services/app/config/link.test.ts index ff5957267ec..b7fc5a99969 100644 --- a/packages/app/src/cli/services/app/config/link.test.ts +++ b/packages/app/src/cli/services/app/config/link.test.ts @@ -105,8 +105,6 @@ describe('link', () => { pos: { embedded: false, }, - path: expect.stringMatching(/\/shopify.app.default-value.toml$/), - build: undefined, }) expect(state).toEqual({ @@ -184,8 +182,6 @@ embedded = false pos: { embedded: false, }, - path: expect.stringMatching(/\/shopify.app.staging.toml$/), - build: undefined, }) expect(content).toEqual(expectedContent) }) @@ -292,7 +288,6 @@ embedded = false pos: { embedded: false, }, - path: expect.stringMatching(/\/shopify.app.toml$/), build: { include_config_on_deploy: true, }, @@ -437,7 +432,6 @@ url = "https://api-client-config.com/preferences" pos: { embedded: true, }, - path: expect.stringMatching(/\/shopify.app.toml$/), build: { include_config_on_deploy: true, }, @@ -455,8 +449,8 @@ url = "https://api-client-config.com/preferences" developerPlatformClient, } const localApp = { + configPath: 'shopify.app.development.toml', configuration: { - path: 'shopify.app.development.toml', name: 'my app', client_id: '12345', webhooks: {api_version: '2023-04'}, @@ -555,7 +549,6 @@ embedded = false pos: { embedded: false, }, - path: expect.stringMatching(/\/shopify.app.staging.toml$/), build: { automatically_update_urls_on_dev: true, dev_store_url: 'my-store.myshopify.com', @@ -576,7 +569,6 @@ embedded = false } const localApp = { configuration: { - path: 'shopify.app.toml', name: 'my app', client_id: '12345', scopes: 'write_products', @@ -647,7 +639,6 @@ embedded = false pos: { embedded: false, }, - path: expect.stringMatching(/\/shopify.app.staging.toml$/), }) expect(content).toEqual(expectedContent) }) @@ -728,8 +719,6 @@ embedded = false pos: { embedded: false, }, - path: expect.stringMatching(/\/shopify.app.toml$/), - build: undefined, }) expect(content).toEqual(expectedContent) }) @@ -795,8 +784,6 @@ embedded = false pos: { embedded: false, }, - path: expect.stringMatching(/\/shopify.app.toml$/), - build: undefined, }) expect(content).toEqual(expectedContent) }) @@ -839,8 +826,6 @@ embedded = false pos: { embedded: false, }, - path: expect.stringMatching(/\/shopify.app.toml$/), - build: undefined, }) }) }) @@ -879,8 +864,8 @@ embedded = false developerPlatformClient, } const localApp = { + configPath: 'shopify.app.foo.toml', configuration: { - path: 'shopify.app.foo.toml', name: 'my app', client_id: '12345', webhooks: {api_version: '2023-04'}, @@ -947,7 +932,6 @@ embedded = false pos: { embedded: false, }, - path: expect.stringMatching(/\/shopify.app.foo.toml$/), }) expect(content).toEqual(expectedContent) }) @@ -1007,7 +991,6 @@ embedded = false pos: { embedded: false, }, - path: expect.stringMatching(/\/shopify.app.toml$/), }) expect(content).toEqual(expectedContent) }) @@ -1074,8 +1057,6 @@ embedded = false pos: { embedded: false, }, - path: expect.stringMatching(/\/shopify.app.toml$/), - build: undefined, }) expect(content).toEqual(expectedContent) }) @@ -1202,7 +1183,6 @@ embedded = false pos: { embedded: false, }, - path: expect.stringMatching(/\/shopify.app.toml$/), }) expect(content).toEqual(expectedContent) }) @@ -1330,7 +1310,6 @@ embedded = false pos: { embedded: false, }, - path: expect.stringMatching(/\/shopify.app.toml$/), }) expect(content).toEqual(expectedContent) }) @@ -1346,7 +1325,6 @@ embedded = false } const localApp = { configuration: { - path: 'shopify.app.development.toml', name: 'my app', client_id: '12345', scopes: 'write_products', @@ -1638,8 +1616,8 @@ embedded = false configName: 'shopify.app.toml', } const localApp = { + configPath: joinPath(tmp, 'shopify.app.toml'), configuration: { - path: joinPath(tmp, 'shopify.app.toml'), name: 'my app', client_id: 'invalid_client_id_from_template', webhooks: { @@ -1717,8 +1695,8 @@ embedded = false configName: 'staging', } const localApp = { + configPath: joinPath(tmp, 'shopify.app.staging.toml'), configuration: { - path: joinPath(tmp, 'shopify.app.staging.toml'), name: 'my app', client_id: 'invalid_client_id_from_template', webhooks: { @@ -1797,8 +1775,8 @@ embedded = false apiKey: '1', } const localApp = { + configPath: joinPath(tmp, 'shopify.app.toml'), configuration: { - path: joinPath(tmp, 'shopify.app.toml'), name: 'my app', client_id: 'invalid_client_id_from_template', webhooks: { diff --git a/packages/app/src/cli/services/app/config/link.ts b/packages/app/src/cli/services/app/config/link.ts index fd5c5d0c5b9..9060c66c6c9 100644 --- a/packages/app/src/cli/services/app/config/link.ts +++ b/packages/app/src/cli/services/app/config/link.ts @@ -359,7 +359,6 @@ export async function overwriteLocalConfigFileWithRemoteAppConfiguration(options }, { client_id: remoteApp.apiKey, - path: configFilePath, ...remoteAppConfiguration, }, replaceLocalArrayStrategy, @@ -381,7 +380,7 @@ export async function overwriteLocalConfigFileWithRemoteAppConfiguration(options // Always output using the canonical schema const schema = getAppVersionedSchema(specifications) - await writeAppConfigurationFile(mergedAppConfiguration, schema) + await writeAppConfigurationFile(mergedAppConfiguration, schema, configFilePath) setCurrentConfigPreference(mergedAppConfiguration, {configFileName, directory: appDirectory}) return mergedAppConfiguration diff --git a/packages/app/src/cli/services/app/config/pull.ts b/packages/app/src/cli/services/app/config/pull.ts index 65ad966db6e..67c7155265b 100644 --- a/packages/app/src/cli/services/app/config/pull.ts +++ b/packages/app/src/cli/services/app/config/pull.ts @@ -13,11 +13,13 @@ import {basename} from '@shopify/cli-kit/node/path' interface PullOptions { directory: string configName?: string + configPath: string configuration: CurrentAppConfiguration remoteApp: OrganizationApp } interface PullOutput { + configPath: string configuration: CurrentAppConfiguration remoteApp: OrganizationApp } @@ -26,7 +28,7 @@ interface PullOutput { * Refresh an already-linked app configuration without prompting for org/app. */ export default async function pull(options: PullOptions): Promise { - const {directory, configName, configuration, remoteApp} = options + const {directory, configName, configPath, configuration, remoteApp} = options if (!configuration.client_id) { throw new AbortError( @@ -54,8 +56,7 @@ export default async function pull(options: PullOptions): Promise { const localAppOptions = await loadLocalAppOptions(linkOptions, specifications, flags, remoteApp.apiKey) - // Decide which config file to overwrite: the configuration should always have a path here. - const configFileName: AppConfigurationFileName = basename(configuration.path) as AppConfigurationFileName + const configFileName: AppConfigurationFileName = basename(configPath) as AppConfigurationFileName const mergedConfiguration = await overwriteLocalConfigFileWithRemoteAppConfiguration({ remoteApp, @@ -67,5 +68,5 @@ export default async function pull(options: PullOptions): Promise { localAppOptions, }) - return {configuration: mergedConfiguration, remoteApp} + return {configPath, configuration: mergedConfiguration, remoteApp} } diff --git a/packages/app/src/cli/services/app/config/use.test.ts b/packages/app/src/cli/services/app/config/use.test.ts index bf20c69aea6..d9c7f22dc60 100644 --- a/packages/app/src/cli/services/app/config/use.test.ts +++ b/packages/app/src/cli/services/app/config/use.test.ts @@ -83,6 +83,7 @@ describe('use', () => { const {client_id: clientId, ...configWithoutClientId} = appWithoutClientID.configuration vi.mocked(loadAppConfiguration).mockResolvedValue({ directory: tmp, + configPath: joinPath(tmp, 'shopify.app.no-id.toml'), configuration: configWithoutClientId as any, configSchema, specifications: [], @@ -151,6 +152,7 @@ describe('use', () => { const {schema: configSchema} = await buildVersionedAppSchema() vi.mocked(loadAppConfiguration).mockResolvedValue({ directory: tmp, + configPath: joinPath(tmp, 'shopify.app.staging.toml'), configuration: app.configuration, configSchema, specifications: [], @@ -192,6 +194,7 @@ describe('use', () => { const {schema: configSchema} = await buildVersionedAppSchema() vi.mocked(loadAppConfiguration).mockResolvedValue({ directory: tmp, + configPath: joinPath(tmp, 'shopify.app.local.toml'), configuration: app.configuration, configSchema, specifications: [], @@ -235,6 +238,7 @@ describe('use', () => { const {schema: configSchema} = await buildVersionedAppSchema() vi.mocked(loadAppConfiguration).mockResolvedValue({ directory, + configPath: joinPath(directory, 'shopify.app.something.toml'), configuration, configSchema, specifications: [], @@ -265,6 +269,7 @@ describe('use', () => { const {schema: configSchema} = await buildVersionedAppSchema() vi.mocked(loadAppConfiguration).mockResolvedValue({ directory, + configPath: joinPath(directory, 'shopify.app.something.toml'), configuration, configSchema, specifications: [], diff --git a/packages/app/src/cli/services/app/env/pull.test.ts b/packages/app/src/cli/services/app/env/pull.test.ts index 465d6c49684..2d9d18e49dd 100644 --- a/packages/app/src/cli/services/app/env/pull.test.ts +++ b/packages/app/src/cli/services/app/env/pull.test.ts @@ -4,7 +4,7 @@ import {testApp, testOrganizationApp} from '../../../models/app/app.test-data.js import {Organization, OrganizationApp, OrganizationSource} from '../../../models/organization.js' import {describe, expect, vi, beforeEach, test} from 'vitest' import * as file from '@shopify/cli-kit/node/fs' -import {resolvePath, joinPath} from '@shopify/cli-kit/node/path' +import {resolvePath} from '@shopify/cli-kit/node/path' import {unstyled, stringifyMessage} from '@shopify/cli-kit/node/output' const ORG1: Organization = { @@ -107,7 +107,6 @@ function mockApp(currentVersion = '2.2.2'): AppInterface { name: 'myapp', directory: '/', configuration: { - path: joinPath('/', 'shopify.app.toml'), client_id: 'test-client-id', name: 'my-app', application_url: 'https://example.com', diff --git a/packages/app/src/cli/services/app/env/show.test.ts b/packages/app/src/cli/services/app/env/show.test.ts index f2bc550707b..67225c2811f 100644 --- a/packages/app/src/cli/services/app/env/show.test.ts +++ b/packages/app/src/cli/services/app/env/show.test.ts @@ -7,7 +7,6 @@ import {OrganizationSource} from '../../../models/organization.js' import {describe, expect, vi, test} from 'vitest' import * as file from '@shopify/cli-kit/node/fs' import {stringifyMessage, unstyled} from '@shopify/cli-kit/node/output' -import {joinPath} from '@shopify/cli-kit/node/path' vi.mock('../../dev/fetch.js') vi.mock('../../../prompts/dev.js') @@ -53,7 +52,6 @@ function mockApp(currentVersion = '2.2.2'): AppInterface { name: 'myapp', directory: '/', configuration: { - path: joinPath('/', 'shopify.app.toml'), client_id: 'test-client-id', name: 'my-app', application_url: 'https://example.com', diff --git a/packages/app/src/cli/services/app/write-app-configuration-file.test.ts b/packages/app/src/cli/services/app/write-app-configuration-file.test.ts index 22217b443dd..685e53f9596 100644 --- a/packages/app/src/cli/services/app/write-app-configuration-file.test.ts +++ b/packages/app/src/cli/services/app/write-app-configuration-file.test.ts @@ -48,7 +48,7 @@ describe('writeAppConfigurationFile', () => { const {schema} = await buildVersionedAppSchema() // When - await writeAppConfigurationFile({...FULL_CONFIGURATION, path: filePath}, schema) + await writeAppConfigurationFile(FULL_CONFIGURATION, schema, filePath) // Then const content = await readFile(filePath) @@ -108,7 +108,6 @@ url = "https://example.com/prefs" await writeAppConfigurationFile( { ...FULL_CONFIGURATION, - path: filePath, build: undefined, app_preferences: undefined, pos: undefined, @@ -118,6 +117,7 @@ url = "https://example.com/prefs" }, } as CurrentAppConfiguration, schema, + filePath, ) // Then @@ -139,10 +139,10 @@ url = "https://example.com/prefs" await writeAppConfigurationFile( { ...FULL_CONFIGURATION, - path: filePath, auth: {redirect_urls: []}, } as CurrentAppConfiguration, schema, + filePath, ) // Then diff --git a/packages/app/src/cli/services/app/write-app-configuration-file.ts b/packages/app/src/cli/services/app/write-app-configuration-file.ts index 4bc3f3ac6b8..c2f82012401 100644 --- a/packages/app/src/cli/services/app/write-app-configuration-file.ts +++ b/packages/app/src/cli/services/app/write-app-configuration-file.ts @@ -6,8 +6,12 @@ import {JsonMapType} from '@shopify/cli-kit/node/toml' import {zod} from '@shopify/cli-kit/node/schema' import {outputDebug} from '@shopify/cli-kit/node/output' -export async function writeAppConfigurationFile(configuration: CurrentAppConfiguration, schema: zod.ZodTypeAny) { - outputDebug(`Writing app configuration to ${configuration.path}`) +export async function writeAppConfigurationFile( + configuration: CurrentAppConfiguration, + schema: zod.ZodTypeAny, + configPath: string, +) { + outputDebug(`Writing app configuration to ${configPath}`) // we need to condense the compliance and non-compliance webhooks again // so compliance topics and topics with the same uri are under @@ -16,7 +20,7 @@ export async function writeAppConfigurationFile(configuration: CurrentAppConfigu const sorted = rewriteConfiguration(schema, condensedWebhooksAppConfiguration) as JsonMapType - const file = new TomlFile(configuration.path, {}) + const file = new TomlFile(configPath, {}) await file.replace(sorted) await file.transformRaw(addDefaultCommentsToToml) } @@ -46,7 +50,7 @@ export const rewriteConfiguration = (schema: T, config }) // if dynamic config was enabled, its possible to have more keys in the file than the schema - const blockedKeys = ['path', 'scopes'] + const blockedKeys = ['scopes'] Object.entries(confObj) .filter(([key]) => !blockedKeys.includes(key)) diff --git a/packages/app/src/cli/services/context.test.ts b/packages/app/src/cli/services/context.test.ts index 4e929627f80..5e3a9c9ae06 100644 --- a/packages/app/src/cli/services/context.test.ts +++ b/packages/app/src/cli/services/context.test.ts @@ -80,7 +80,6 @@ const STORE1: OrganizationStore = { const state: AppConfigurationState = { basicConfiguration: { ...DEFAULT_CONFIG, - path: 'shopify.app.toml', client_id: APP2.apiKey, }, appDirectory: 'tmp', @@ -171,7 +170,7 @@ beforeEach(async () => { path: '', } as unknown as TomlFile) vi.mocked(link).mockResolvedValue({ - configuration: testAppWithConfig({config: {path: 'shopify.app.toml', client_id: APP2.apiKey}}).configuration, + configuration: testAppWithConfig({config: {client_id: APP2.apiKey}}).configuration, remoteApp: APP2, state, }) diff --git a/packages/app/src/cli/services/context.ts b/packages/app/src/cli/services/context.ts index 5e13d7e0193..dce2c07c7ec 100644 --- a/packages/app/src/cli/services/context.ts +++ b/packages/app/src/cli/services/context.ts @@ -158,7 +158,7 @@ export async function ensureDeployContext(options: DeployOptions): Promise { - const shouldIncludeConfigDeploy = await includeConfigOnDeployPrompt(options.localApp.configuration.path) + const shouldIncludeConfigDeploy = await includeConfigOnDeployPrompt(options.localApp.configPath) options.localApp.configuration.build = { ...options.localApp.configuration.build, include_config_on_deploy: shouldIncludeConfigDeploy, } - const configFile = await TomlFile.read(options.localApp.configuration.path) + const configFile = await TomlFile.read(options.localApp.configPath) await configFile.patch({build: {include_config_on_deploy: shouldIncludeConfigDeploy}}) await metadata.addPublicMetadata(() => ({cmd_deploy_confirm_include_config_used: shouldIncludeConfigDeploy})) return shouldIncludeConfigDeploy @@ -348,7 +348,7 @@ export function showReusedDevValues({organization, app, remoteApp, selectedStore appName: remoteApp.title, devStore: selectedStore.shopDomain, updateURLs, - configFile: basename(app.configuration.path), + configFile: basename(app.configPath), messages, }) } diff --git a/packages/app/src/cli/services/context/breakdown-extensions.test.ts b/packages/app/src/cli/services/context/breakdown-extensions.test.ts index 1dd07798471..a91a5d183c5 100644 --- a/packages/app/src/cli/services/context/breakdown-extensions.test.ts +++ b/packages/app/src/cli/services/context/breakdown-extensions.test.ts @@ -258,7 +258,6 @@ const API_VERSION_SPEC: AppModuleVersion = { } const APP_CONFIGURATION: CurrentAppConfiguration = { - path: 'shopify.app.development.toml', name: 'my app', client_id: '12345', webhooks: { @@ -839,7 +838,6 @@ describe('configExtensionsIdentifiersBreakdown', () => { test('returns the list of the local config versioned top level fields', async () => { // Given const configuration = { - path: 'shopify.app.development.toml', name: 'my app', client_id: '12345', application_url: 'https://myapp.com', @@ -885,7 +883,6 @@ describe('configExtensionsIdentifiersBreakdown', () => { test('when the same local config and remote app module type exists and have same values it will be returned in the existing list', async () => { // Given const configuration = { - path: 'shopify.app.development.toml', name: 'my app', client_id: '12345', application_url: 'https://myapp.com', @@ -975,7 +972,6 @@ describe('configExtensionsIdentifiersBreakdown', () => { test('when the same local config and remote app module type exists and have different values it will be returned in the update list', async () => { // Given const configuration = { - path: 'shopify.app.development.toml', name: 'my app', client_id: '12345', application_url: 'https://myapp.com', @@ -1064,7 +1060,6 @@ describe('configExtensionsIdentifiersBreakdown', () => { test('when a new local config app module type exists it will be returned in the new list', async () => { // Given const configuration = { - path: 'shopify.app.development.toml', name: 'my app', client_id: '12345', application_url: 'https://myapp.com', @@ -1121,7 +1116,6 @@ describe('configExtensionsIdentifiersBreakdown', () => { test('when a remote config app module type not exists locally it will be returned in the delete list', async () => { // Given const configuration = { - path: 'shopify.app.development.toml', name: 'my app', client_id: '12345', application_url: 'https://myapp.com', @@ -1817,7 +1811,6 @@ describe('configExtensionsIdentifiersBreakdown', () => { test('all local configuration will be returned in the new list', async () => { // Given const configuration = { - path: 'shopify.app.development.toml', name: 'my app', client_id: '12345', application_url: 'https://myapp.com', @@ -1857,7 +1850,6 @@ describe('configExtensionsIdentifiersBreakdown', () => { test('when the include_config_on_deploy is not true the configuration breakdown info is not returned', async () => { // Given const configuration = { - path: 'shopify.app.development.toml', name: 'my app', client_id: '12345', application_url: 'https://myapp.com', diff --git a/packages/app/src/cli/services/context/identifiers-extensions.test.ts b/packages/app/src/cli/services/context/identifiers-extensions.test.ts index b80801d9806..8686cc8c5df 100644 --- a/packages/app/src/cli/services/context/identifiers-extensions.test.ts +++ b/packages/app/src/cli/services/context/identifiers-extensions.test.ts @@ -107,7 +107,6 @@ const LOCAL_APP = ( name: 'my-app', directory: '/app', configuration: { - path: '/shopify.app.toml', client_id: 'test-client-id', name: 'my-app', application_url: 'https://example.com', diff --git a/packages/app/src/cli/services/dev.ts b/packages/app/src/cli/services/dev.ts index 1b859c29770..0b946cb0be3 100644 --- a/packages/app/src/cli/services/dev.ts +++ b/packages/app/src/cli/services/dev.ts @@ -114,7 +114,7 @@ async function prepareForDev(commandOptions: DevOptions): Promise { ...app.configuration.build, dev_store_url: store.shopDomain, } - const configFile = await TomlFile.read(app.configuration.path) + const configFile = await TomlFile.read(app.configPath) await configFile.patch({build: {dev_store_url: store.shopDomain}}) } @@ -226,7 +226,7 @@ export async function warnIfScopesDifferBeforeDev({ renderWarning({ headline: [`The scopes in your TOML don't match the scopes in your Partner Dashboard`], body: [ - `Scopes in ${basename(localApp.configuration.path)}:`, + `Scopes in ${basename(localApp.configPath)}:`, scopesMessage(getAppScopesArray(localApp.configuration)), '\n', 'Scopes in Partner Dashboard:', @@ -437,7 +437,7 @@ async function launchDevProcesses({ appURL: config.localApp.devApplicationURLs?.applicationUrl, appName: config.remoteApp.title, organizationName: config.commandOptions.organization.businessName, - configPath: config.localApp.configuration.path, + configPath: config.localApp.configPath, }) } diff --git a/packages/app/src/cli/services/dev/app-events/app-event-watcher.test.ts b/packages/app/src/cli/services/dev/app-events/app-event-watcher.test.ts index 3bdb24b3f91..8a483d7d8e3 100644 --- a/packages/app/src/cli/services/dev/app-events/app-event-watcher.test.ts +++ b/packages/app/src/cli/services/dev/app-events/app-event-watcher.test.ts @@ -54,7 +54,6 @@ const testAppConfiguration: CurrentAppConfiguration = { client_id: 'test-client-id', access_scopes: {scopes: ''}, extension_directories: [], - path: 'shopify.app.custom.toml', name: 'my-app', application_url: 'https://example.com', embedded: true, @@ -285,6 +284,7 @@ describe('app-event-watcher', () => { // When const app = testAppLinked({ allExtensions: initialExtensions, + configPath: 'shopify.app.custom.toml', configuration: testAppConfiguration, }) @@ -356,6 +356,7 @@ describe('app-event-watcher', () => { const buildOutputPath = joinPath(tmpDir, '.shopify', 'bundle') const app = testAppLinked({ allExtensions: [extension1], + configPath: 'shopify.app.custom.toml', configuration: testAppConfiguration, }) const generateTypesSpy = vi.spyOn(app, 'generateExtensionTypes') @@ -393,6 +394,7 @@ describe('app-event-watcher', () => { const buildOutputPath = joinPath(tmpDir, '.shopify', 'bundle') const app = testAppLinked({ allExtensions: [extension1], + configPath: 'shopify.app.custom.toml', configuration: testAppConfiguration, }) @@ -429,6 +431,7 @@ describe('app-event-watcher', () => { const buildOutputPath = joinPath(tmpDir, '.shopify', 'bundle') const app = testAppLinked({ allExtensions: [extension1, posExtension], + configPath: 'shopify.app.custom.toml', configuration: testAppConfiguration, }) @@ -461,6 +464,7 @@ describe('app-event-watcher', () => { const buildOutputPath = joinPath(tmpDir, '.shopify', 'bundle') const app = testAppLinked({ allExtensions: [extension1, extension2], + configPath: 'shopify.app.custom.toml', configuration: testAppConfiguration, }) const generateTypesSpy = vi.spyOn(app, 'generateExtensionTypes') @@ -509,6 +513,7 @@ describe('app-event-watcher', () => { const buildOutputPath = joinPath(tmpDir, '.shopify', 'bundle') const app = testAppLinked({ allExtensions: [extension1], + configPath: 'shopify.app.custom.toml', configuration: testAppConfiguration, }) const mockFileWatcher = new MockFileWatcher(app, outputOptions, [fileWatchEvent]) @@ -552,6 +557,7 @@ describe('app-event-watcher', () => { const buildOutputPath = joinPath(tmpDir, '.shopify', 'bundle') const app = testAppLinked({ allExtensions: [flowExtension], + configPath: 'shopify.app.custom.toml', configuration: testAppConfiguration, }) @@ -586,6 +592,7 @@ describe('app-event-watcher', () => { const buildOutputPath = joinPath(tmpDir, '.shopify', 'bundle') const app = testAppLinked({ allExtensions: [extension1], + configPath: 'shopify.app.custom.toml', configuration: testAppConfiguration, }) const mockFileWatcher = new MockFileWatcher(app, outputOptions, [fileWatchEvent]) diff --git a/packages/app/src/cli/services/dev/app-events/file-watcher.test.ts b/packages/app/src/cli/services/dev/app-events/file-watcher.test.ts index d28858226b7..e707e9c724a 100644 --- a/packages/app/src/cli/services/dev/app-events/file-watcher.test.ts +++ b/packages/app/src/cli/services/dev/app-events/file-watcher.test.ts @@ -210,9 +210,9 @@ const outputOptions: OutputContextOptions = {stdout: process.stdout, stderr: pro const defaultApp = testAppLinked({ allExtensions: [extension1, extension1B, extension2, posExtension, appAccessExtension, functionExtension], directory: '/', + configPath: '/shopify.app.toml', configuration: { ...DEFAULT_CONFIG, - path: '/shopify.app.toml', extension_directories: ['/extensions'], } as any, }) @@ -232,8 +232,8 @@ describe('file-watcher events', () => { const app = testAppLinked({ allExtensions: [ext1, ext2, posExtension], directory: dir, + configPath: joinPath(dir, '/shopify.app.toml'), configuration: { - path: joinPath(dir, '/shopify.app.toml'), client_id: 'test-client-id', name: 'my-app', application_url: 'https://example.com', @@ -248,7 +248,7 @@ describe('file-watcher events', () => { const watchSpy = vi.spyOn(chokidar, 'watch').mockImplementation(() => { return { - on: (_: string, listener: any) => listener('change', '/shopify.app.toml'), + on: (_: string, listener: any) => listener('change', joinPath(dir, '/shopify.app.toml')), close: () => Promise.resolve(), } as any }) diff --git a/packages/app/src/cli/services/dev/app-events/file-watcher.ts b/packages/app/src/cli/services/dev/app-events/file-watcher.ts index 56fca818a56..8d614082cdf 100644 --- a/packages/app/src/cli/services/dev/app-events/file-watcher.ts +++ b/packages/app/src/cli/services/dev/app-events/file-watcher.ts @@ -87,7 +87,7 @@ export class FileWatcher { async start(): Promise { const extensionDirectories = [...(this.app.configuration.extension_directories ?? ['extensions'])] const fullExtensionDirectories = extensionDirectories.map((directory) => joinPath(this.app.directory, directory)) - const watchPaths = [this.app.configuration.path, ...fullExtensionDirectories] + const watchPaths = [this.app.configPath, ...fullExtensionDirectories] // Get all watched files from extensions const allWatchedFiles = this.getAllWatchedFiles() @@ -230,7 +230,7 @@ export class FileWatcher { private readonly handleFileEvent = (event: string, path: string) => { const startTime = startHRTime() const normalizedPath = normalizePath(path) - const isConfigAppPath = path === this.app.configuration.path + const isConfigAppPath = path === this.app.configPath const isExtensionToml = path.endsWith('.extension.toml') outputDebug(`🌀: ${event} ${path.replace(this.app.directory, '')}\n`) @@ -266,7 +266,7 @@ export class FileWatcher { isUnknownExtension: boolean, ) { const isExtensionToml = path.endsWith('.extension.toml') - const isConfigAppPath = path === this.app.configuration.path + const isConfigAppPath = path === this.app.configPath switch (event) { case 'change': diff --git a/packages/app/src/cli/services/dev/select-app.test.ts b/packages/app/src/cli/services/dev/select-app.test.ts index 98510319dfc..5537d790472 100644 --- a/packages/app/src/cli/services/dev/select-app.test.ts +++ b/packages/app/src/cli/services/dev/select-app.test.ts @@ -12,7 +12,6 @@ vi.mock('@shopify/cli-kit/node/output') const LOCAL_APP: AppInterface = testApp({ directory: '', configuration: { - path: '/shopify.app.toml', client_id: 'test-client-id', name: 'my-app', application_url: 'https://example.com', diff --git a/packages/app/src/cli/services/dev/update-extension.ts b/packages/app/src/cli/services/dev/update-extension.ts index 4340d0e9dcc..24abd994fbd 100644 --- a/packages/app/src/cli/services/dev/update-extension.ts +++ b/packages/app/src/cli/services/dev/update-extension.ts @@ -2,7 +2,7 @@ import { ExtensionUpdateDraftMutation, ExtensionUpdateDraftMutationVariables, } from '../../api/graphql/partners/generated/update-draft.js' -import {AppConfigurationWithoutPath} from '../../models/app/app.js' +import {AppConfiguration} from '../../models/app/app.js' import {parseConfigurationFile, parseConfigurationObjectAgainstSpecification} from '../../models/app/loader.js' import {ExtensionInstance} from '../../models/extensions/extension-instance.js' import {ExtensionsArraySchema, UnifiedSchema} from '../../models/extensions/schemas.js' @@ -23,7 +23,7 @@ interface UpdateExtensionDraftOptions { registrationId: string stdout: Writable stderr: Writable - appConfiguration: AppConfigurationWithoutPath + appConfiguration: AppConfiguration bundlePath: string } diff --git a/packages/app/src/cli/services/dev/urls.ts b/packages/app/src/cli/services/dev/urls.ts index e17509c93e0..95c87b6d760 100644 --- a/packages/app/src/cli/services/dev/urls.ts +++ b/packages/app/src/cli/services/dev/urls.ts @@ -187,7 +187,7 @@ export async function updateURLs( } if (localApp && localApp.configuration.client_id === apiKey) { - const configFile = await TomlFile.read(localApp.configuration.path) + const configFile = await TomlFile.read(localApp.configPath) const patch: {[key: string]: unknown} = { application_url: urls.applicationUrl, auth: {redirect_urls: urls.redirectUrlWhitelist}, @@ -250,7 +250,7 @@ export async function shouldOrPromptUpdateURLs(options: ShouldOrPromptUpdateURLs ...localConfiguration.build, automatically_update_urls_on_dev: shouldUpdateURLs, } - const configFile = await TomlFile.read(options.localApp.configuration.path) + const configFile = await TomlFile.read(options.localApp.configPath) await configFile.patch({build: {automatically_update_urls_on_dev: shouldUpdateURLs}}) } else { setCachedAppInfo({directory: options.appDirectory, updateURLs: shouldUpdateURLs}) diff --git a/packages/app/src/cli/services/generate.test.ts b/packages/app/src/cli/services/generate.test.ts index e00dc5849d1..b84a5dfd548 100644 --- a/packages/app/src/cli/services/generate.test.ts +++ b/packages/app/src/cli/services/generate.test.ts @@ -208,7 +208,7 @@ async function mockSuccessfulCommandExecution(identifier: string, existingExtens extensionsForType: (_spec: {identifier: string; externalIdentifier: string}) => existingExtensions, allExtensions: existingExtensions, }, - config: {path: joinPath(appRoot, 'shopify.app.toml')}, + config: {}, }) const allExtensionTemplates = testRemoteExtensionTemplates diff --git a/packages/app/src/cli/services/info.test.ts b/packages/app/src/cli/services/info.test.ts index 9e87bb0c520..1a2418a218c 100644 --- a/packages/app/src/cli/services/info.test.ts +++ b/packages/app/src/cli/services/info.test.ts @@ -272,8 +272,8 @@ function mockApp({ return testAppLinked({ name: 'my app', directory, + configPath: joinPath(directory, 'shopify.app.toml'), configuration: { - path: joinPath(directory, 'shopify.app.toml'), client_id: 'test-client-id', name: 'my-app', application_url: 'https://example.com', diff --git a/packages/app/src/cli/services/info.ts b/packages/app/src/cli/services/info.ts index c6ab37a58f3..3b2718a6629 100644 --- a/packages/app/src/cli/services/info.ts +++ b/packages/app/src/cli/services/info.ts @@ -149,7 +149,7 @@ class AppInfo { this.tableSection( 'Current app configuration', [ - ['Configuration file', {filePath: basename(this.app.configuration.path) || configurationFileNames.app}], + ['Configuration file', {filePath: basename(this.app.configPath) || configurationFileNames.app}], ['App name', this.remoteApp.title ? {userInput: this.remoteApp.title} : NOT_CONFIGURED_TOKEN], ['Client ID', this.remoteApp.apiKey || NOT_CONFIGURED_TOKEN], ['Access scopes', getAppScopes(this.app.configuration)], diff --git a/packages/app/src/cli/services/logs.ts b/packages/app/src/cli/services/logs.ts index 762f253805f..9da8ac5e2b6 100644 --- a/packages/app/src/cli/services/logs.ts +++ b/packages/app/src/cli/services/logs.ts @@ -97,7 +97,7 @@ async function prepareForLogs(commandOptions: LogsOptions): Promise<{ }> { const {app, remoteApp, developerPlatformClient, primaryStore, organization} = commandOptions - const configFile = basename(app.configuration.path) + const configFile = basename(app.configPath) if (commandOptions.format === 'text') { renderAppLogsConfigInfo( remoteApp.title, diff --git a/packages/app/src/cli/services/versions-list.ts b/packages/app/src/cli/services/versions-list.ts index c14cd694cf3..6a839b3ee27 100644 --- a/packages/app/src/cli/services/versions-list.ts +++ b/packages/app/src/cli/services/versions-list.ts @@ -100,7 +100,7 @@ export default async function versionList(options: VersionListOptions) { renderCurrentlyUsedConfigInfo({ org: organization.businessName, appName: remoteApp.title, - configFile: basename(options.app.configuration.path), + configFile: basename(options.app.configPath), }) if (appVersions.length === 0) { diff --git a/packages/app/src/cli/services/webhook/trigger-options.ts b/packages/app/src/cli/services/webhook/trigger-options.ts index 10af1c04be3..fcce78cb903 100644 --- a/packages/app/src/cli/services/webhook/trigger-options.ts +++ b/packages/app/src/cli/services/webhook/trigger-options.ts @@ -43,7 +43,7 @@ export async function collectCredentials( renderCurrentlyUsedConfigInfo({ appName: remoteApp.title, - configFile: basename(app.configuration.path), + configFile: basename(app.configPath), }) const clientSecret = remoteApp.apiSecretKeys.find((elm) => elm.secret)!.secret diff --git a/packages/app/src/cli/utilities/developer-platform-client/partners-client.test.ts b/packages/app/src/cli/utilities/developer-platform-client/partners-client.test.ts index 580846d16f6..e2cce11bf64 100644 --- a/packages/app/src/cli/utilities/developer-platform-client/partners-client.test.ts +++ b/packages/app/src/cli/utilities/developer-platform-client/partners-client.test.ts @@ -24,7 +24,6 @@ beforeEach(() => { const LOCAL_APP: AppInterface = testApp({ directory: '', configuration: { - path: '/shopify.app.toml', client_id: 'test-client-id', name: 'my-app', application_url: 'https://example.com', From d965024acc3671ddb23a91a40d56ecc367dae05d Mon Sep 17 00:00:00 2001 From: Ryan Bahan Date: Fri, 6 Mar 2026 16:42:04 -0700 Subject: [PATCH 2/2] Fix lint: line length and unnecessary type assertion Co-Authored-By: Claude Opus 4.6 (1M context) --- .../app/src/cli/models/app/app.test-data.ts | 2 +- packages/app/src/cli/models/app/app.test.ts | 57 +++++++------------ packages/app/src/cli/models/app/loader.ts | 7 ++- .../src/cli/services/app/config/use.test.ts | 4 +- .../app/src/cli/services/dev/urls.test.ts | 4 +- 5 files changed, 31 insertions(+), 43 deletions(-) diff --git a/packages/app/src/cli/models/app/app.test-data.ts b/packages/app/src/cli/models/app/app.test-data.ts index 1b49533612f..e3822de62b7 100644 --- a/packages/app/src/cli/models/app/app.test-data.ts +++ b/packages/app/src/cli/models/app/app.test-data.ts @@ -137,7 +137,7 @@ export function testApp(app: Partial = {}): AppInterface { } export function testAppLinked(app: Partial = {}): AppLinkedInterface { - return testApp(app, 'current') as AppLinkedInterface + return testApp(app) as AppLinkedInterface } interface TestAppWithConfigOptions { diff --git a/packages/app/src/cli/models/app/app.test.ts b/packages/app/src/cli/models/app/app.test.ts index 99f4d1ab880..954c5a22159 100644 --- a/packages/app/src/cli/models/app/app.test.ts +++ b/packages/app/src/cli/models/app/app.test.ts @@ -1,5 +1,4 @@ import { - AppConfiguration, AppSchema, CurrentAppConfiguration, getAppScopes, @@ -574,14 +573,11 @@ describe('allExtensions', () => { test('keeps declarative webhook config when flag is enabled', async () => { const webhookExtensions = await testWebhookExtensions({complianceTopics: true}) - const app = testApp( - { - configuration: CORRECT_CURRENT_APP_SCHEMA, - allExtensions: webhookExtensions, - remoteFlags: [], - }, - 'current', - ) + const app = testApp({ + configuration: CORRECT_CURRENT_APP_SCHEMA, + allExtensions: webhookExtensions, + remoteFlags: [], + }) const webhookConfig = app.allExtensions.find((ext) => ext.handle === 'webhooks')! .configuration as unknown as WebhookTestConfig @@ -596,33 +592,27 @@ describe('allExtensions', () => { test('includes configuration extensions when include_config_on_deploy is enabled', async () => { const configExtension = await testAppAccessConfigExtension() - const app = testApp( - { - configuration: CORRECT_CURRENT_APP_SCHEMA, - allExtensions: [configExtension], - }, - 'current', - ) + const app = testApp({ + configuration: CORRECT_CURRENT_APP_SCHEMA, + allExtensions: [configExtension], + }) expect(app.allExtensions).toContain(configExtension) }) test('includes configuration extensions by default when include_config_on_deploy is undefined', async () => { const configExtension = await testAppAccessConfigExtension() - const app = testApp( - { - configuration: { - ...CORRECT_CURRENT_APP_SCHEMA, - build: { - automatically_update_urls_on_dev: true, - dev_store_url: 'https://google.com', - include_config_on_deploy: undefined, - }, + const app = testApp({ + configuration: { + ...CORRECT_CURRENT_APP_SCHEMA, + build: { + automatically_update_urls_on_dev: true, + dev_store_url: 'https://google.com', + include_config_on_deploy: undefined, }, - allExtensions: [configExtension], }, - 'current', - ) + allExtensions: [configExtension], + }) expect(app.allExtensions).toContain(configExtension) }) @@ -637,13 +627,10 @@ describe('allExtensions', () => { }, } const configExtension = await testAppAccessConfigExtension() - const app = testApp( - { - configuration, - allExtensions: [configExtension], - }, - 'current', - ) + const app = testApp({ + configuration, + allExtensions: [configExtension], + }) expect(app.allExtensions).toHaveLength(0) }) diff --git a/packages/app/src/cli/models/app/loader.ts b/packages/app/src/cli/models/app/loader.ts index 1d8a4125d09..f47089eafe0 100644 --- a/packages/app/src/cli/models/app/loader.ts +++ b/packages/app/src/cli/models/app/loader.ts @@ -422,7 +422,8 @@ class AppLoader - const configuration = (await parseConfigurationFile( + const configuration = await parseConfigurationFile( schemaForConfigurationFile, configState.configurationPath, abort, file, - )) as LoadedAppConfigFromConfigState + ) const allClientIdsByConfigName = await getAllLinkedConfigClientIds(configState.appDirectory, { [configState.configurationFileName]: configuration.client_id, }) diff --git a/packages/app/src/cli/services/app/config/use.test.ts b/packages/app/src/cli/services/app/config/use.test.ts index d9c7f22dc60..6abc700a42e 100644 --- a/packages/app/src/cli/services/app/config/use.test.ts +++ b/packages/app/src/cli/services/app/config/use.test.ts @@ -234,7 +234,7 @@ describe('use', () => { test('renders warning when warning message is specified', async () => { await inTemporaryDirectory(async (directory) => { // Given - const {configuration} = testApp({}, 'current') + const {configuration} = testApp({}) const {schema: configSchema} = await buildVersionedAppSchema() vi.mocked(loadAppConfiguration).mockResolvedValue({ directory, @@ -265,7 +265,7 @@ describe('use', () => { test('does not render success when shouldRenderSuccess is false', async () => { await inTemporaryDirectory(async (directory) => { // Given - const {configuration} = testApp({}, 'current') + const {configuration} = testApp({}) const {schema: configSchema} = await buildVersionedAppSchema() vi.mocked(loadAppConfiguration).mockResolvedValue({ directory, diff --git a/packages/app/src/cli/services/dev/urls.test.ts b/packages/app/src/cli/services/dev/urls.test.ts index 34dca162e59..17295568abc 100644 --- a/packages/app/src/cli/services/dev/urls.test.ts +++ b/packages/app/src/cli/services/dev/urls.test.ts @@ -336,7 +336,7 @@ describe('shouldOrPromptUpdateURLs', () => { currentURLs, appDirectory: '/path', apiKey: 'api-key', - localApp: testApp({configuration: {...DEFAULT_CONFIG, client_id: 'different'}}, 'current') as AppLinkedInterface, + localApp: testApp({configuration: {...DEFAULT_CONFIG, client_id: 'different'}}) as AppLinkedInterface, developerPlatformClient: testDeveloperPlatformClient(), newURLs: { applicationUrl: 'https://example.com/home', @@ -356,7 +356,7 @@ describe('shouldOrPromptUpdateURLs', () => { test('updates the config file if current config client matches remote', async () => { // Given - const localApp = testApp({configuration: {...DEFAULT_CONFIG, client_id: 'api-key'}}, 'current') + const localApp = testApp({configuration: {...DEFAULT_CONFIG, client_id: 'api-key'}}) const options = { currentURLs, appDirectory: '/path',