Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate themeCreate to GraphQL #5249

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

lucyxiang
Copy link
Contributor

WHY are these changes introduced?

Fixes #0000

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:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

@lucyxiang lucyxiang changed the title wip Migrate themeCreate to GraphQL Jan 21, 2025
Copy link
Contributor

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:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

packages/cli-kit/dist/cli/api/graphql/admin/generated/theme_create.d.ts
import * as Types from './types.js';
import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
export type ThemeCreateMutationVariables = Types.Exact<{
    name: Types.Scalars['String']['input'];
    source: Types.Scalars['URL']['input'];
}>;
export type ThemeCreateMutation = {
    themeCreate?: {
        theme?: {
            id: string;
            name: string;
            role: Types.ThemeRole;
        } | null;
        userErrors: {
            field?: string[] | null;
            message: string;
        }[];
    } | null;
};
export declare const ThemeCreate: DocumentNode<ThemeCreateMutation, ThemeCreateMutationVariables>;

Existing type declarations

packages/cli-kit/dist/public/node/themes/api.d.ts
@@ -5,7 +5,7 @@ export type ThemeParams = Partial<Pick<Theme, 'name' | 'role' | 'processing' | '
 export type AssetParams = Pick<ThemeAsset, 'key'> & Partial<Pick<ThemeAsset, 'value' | 'attachment'>>;
 export declare function fetchTheme(id: number, session: AdminSession): Promise<Theme | undefined>;
 export declare function fetchThemes(session: AdminSession): Promise<Theme[]>;
-export declare function createTheme(params: ThemeParams, session: AdminSession): Promise<Theme | undefined>;
+export declare function themeCreate(params: ThemeParams, session: AdminSession): Promise<Theme | undefined>;
 export declare function fetchThemeAssets(id: number, filenames: Key[], session: AdminSession): Promise<ThemeAsset[]>;
 export declare function deleteThemeAsset(id: number, key: Key, session: AdminSession): Promise<boolean>;
 export declare function bulkUploadThemeAssets(id: number, assets: AssetParams[], session: AdminSession): Promise<Result[]>;

Copy link
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
75.3% (-0.03% 🔻)
8893/11810
🟡 Branches
70.52% (-0.06% 🔻)
4325/6133
🟡 Functions
75.07% (-0.02% 🔻)
2337/3113
🟡 Lines
75.84% (-0.02% 🔻)
8405/11082
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / theme_create.ts
100% 100% 100% 100%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / app-event-watcher.ts
93.83% (-1.23% 🔻)
86.49% (-2.7% 🔻)
90.48% 98.61%
🟢
... / ConcurrentOutput.tsx
98.36% (-1.64% 🔻)
88% (-4% 🔻)
100%
98.33% (-1.67% 🔻)
🔴
... / api.ts
56.91% (-0.9% 🔻)
43.18% (-0.57% 🔻)
57.14% (-1.39% 🔻)
58.48% (-0.67% 🔻)

Test suite run success

2001 tests passing in 904 suites.

Report generated by 🧪jest coverage report action from 8d34862

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant