Shopify / cli

Build apps, themes, and hydrogen storefronts for Shopify
https://shopify.dev
MIT License
416 stars 125 forks source link

Patch app toml files #4551

Open isaacroldan opened 1 day ago

isaacroldan commented 1 day ago

WHY are these changes introduced?

Be more specific about what we write to the toml file. Instead of taking the whole app config and overwriting the toml, the idea is to load the current toml and patch with just the new values.

WHAT is this pull request doing?

How to test your changes?

Post-release steps

Measuring impact

How do we know this change was effective? Please choose one:

Checklist

github-actions[bot] commented 1 day ago

Thanks for your contribution!

Depending on what you are working on, you may want to request a review from a Shopify team:

github-actions[bot] commented 1 day ago

Unused exports (2)

Filename exports
packages/app/src/cli/services/app/write-app-configuration-file.ts appTomlInitialComment
appTomlScopesComment
github-actions[bot] commented 1 day ago

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/private/node/analytics.d.ts ```diff @@ -20,7 +20,6 @@ interface EnvironmentData { env_cloud: string; env_package_manager: string; env_is_global: boolean; - env_auth_method: string; } export declare function getEnvironmentData(config: Interfaces.Config): Promise; export declare function getSensitiveEnvironmentData(config: Interfaces.Config): Promise<{ ```
packages/cli-kit/dist/private/node/session.d.ts ```diff @@ -62,35 +62,16 @@ export interface OAuthSession { appManagement?: string; userId: string; } -type AuthMethod = 'partners_token' | 'device_auth' | 'theme_access_token' | 'custom_app_token' | 'none'; /** * Retrieves the user ID from the current session or returns 'unknown' if not found. - * - * This function performs the following steps: - * 1. Checks for a cached user ID in memory (obtained in the current run). - * 2. Attempts to fetch it from the secure store (from a previous auth session). - * 3. Checks if a custom token was used (either as a theme password or partners token). - * 4. If a custom token is present in the environment, generates a UUID and uses it as userId. - * 5. If after all this we don't have a userId, then reports as 'unknown'. + * This function first checks for a cached user ID in memory (obtained in the current run) + * Then attempts to fetch it from the secure store. (from a previous auth session) + * If no user ID is found, it returns 'unknown'. * * @returns A Promise that resolves to the user ID as a string. */ export declare function getLastSeenUserIdAfterAuth(): Promise; export declare function setLastSeenUserIdAfterAuth(id: string): void; -/** - * Retrieves the last seen authentication method used in the current session. - * - * This function checks for the authentication method in the following order: - * 1. Returns the cached auth method if it's not 'none'. - * 2. Checks for a cached session, which implies 'device_auth' was used. - * 3. Checks for a partners token in the environment. - * 4. Checks for a theme password in the environment. - * 5. If none of the above are true, returns 'none'. - * - * @returns A Promise that resolves to the last seen authentication method as an AuthMethod type. - */ -export declare function getLastSeenAuthMethod(): Promise; -export declare function setLastSeenAuthMethod(method: AuthMethod): void; /** * This method ensures that we have a valid session to authenticate against the given applications using the provided scopes. * ```
packages/cli-kit/dist/public/node/monorail.d.ts ```diff @@ -2,7 +2,7 @@ import { JsonMap } from '../../private/common/json.js'; import { DeepRequired } from '../common/ts/deep-required.js'; export { DeepRequired }; type Optional = T | null; -export declare const MONORAIL_COMMAND_TOPIC = "app_cli3_command/1.14"; +export declare const MONORAIL_COMMAND_TOPIC = "app_cli3_command/1.13"; export interface Schemas { [MONORAIL_COMMAND_TOPIC]: { sensitive: { @@ -121,7 +121,6 @@ export interface Schemas { env_web_ide?: Optional; env_cloud?: Optional; env_is_global?: Optional; - env_auth_method?: Optional; }; }; [schemaId: string]: { ```
packages/cli-kit/dist/private/node/api/rest.d.ts ```diff @@ -6,5 +6,4 @@ export declare function restRequestUrl(session: AdminSession, apiVersion: string }, env?: NodeJS.ProcessEnv): string; export declare function restRequestHeaders(session: AdminSession): { [key: string]: string; -}; -export declare function isThemeAccessSession(session: AdminSession): boolean; \ No newline at end of file +}; \ No newline at end of file ```
packages/cli-kit/dist/public/node/context/local.d.ts ```diff @@ -125,13 +125,6 @@ export declare function codespacePortForwardingDomain(env?: NodeJS.ProcessEnv): * @returns True in case the CLI is run from a cloud environment. */ export declare function isCloudEnvironment(env?: NodeJS.ProcessEnv): boolean; -/** - * The token used to run a theme command with a custom password. - * - * @param env - Environment variables used when the cli is launched. - * @returns A string with the token. - */ -export declare function themeToken(env?: NodeJS.ProcessEnv): string | undefined; /** * Returns the cloud environment platform name and if the platform support online IDE in case the CLI is run from one of * them. Platform name 'localhost' is returned otherwise. ```