-
Notifications
You must be signed in to change notification settings - Fork 154
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
Add prompt before applying migration #5390
base: zl/migrate_scopes_to_required_scopes
Are you sure you want to change the base?
Add prompt before applying migration #5390
Conversation
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
54472ee
to
0b02232
Compare
809e890
to
fa871de
Compare
0b02232
to
3f89a13
Compare
fa871de
to
60fb77f
Compare
60fb77f
to
bcfaf04
Compare
Differences in type declarationsWe 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 declarationsWe found no new type declarations in this PR Existing type declarationspackages/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 themeCreate(params: ThemeParams, session: AdminSession): Promise<Theme | undefined>;
+export declare function createTheme(params: ThemeParams, session: AdminSession): Promise<Theme | undefined>;
export declare function fetchThemeAssets(id: number, filenames: Key[], session: AdminSession): Promise<ThemeAsset[]>;
export declare function deleteThemeAssets(id: number, filenames: Key[], session: AdminSession): Promise<Result[]>;
export declare function bulkUploadThemeAssets(id: number, assets: AssetParams[], session: AdminSession): Promise<Result[]>;
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the addition of prompting, but IMO let's try to get prompting content and config transformation rules behind the same constrained interface.
@@ -73,6 +73,7 @@ export interface ExtensionSpecification<TConfiguration extends BaseConfigType = | |||
hasExtensionPointTarget?(config: TConfiguration, target: string): boolean | |||
appModuleFeatures: (config?: TConfiguration) => ExtensionFeature[] | |||
migratePendingSchemaChanges?: (extension: ExtensionInstance<TConfiguration>) => Promise<void> | |||
pendingSchemaChanges?: (extension: ExtensionInstance<TConfiguration>) => string[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a continuation of my feedback on the first PR, I suspect we can simplify this interface further.
If migratePendingSchemaChanges
is updated to be a more constrained interface, we can probably leverage the same interface to do the prompting.
I originally suggested something like (config: TConfig) => TConfig
as the interface, which would allow arbitrary re-mapping of configs to be defined by specifications.
This could be further abstracted in a way that would also allow you to handle prompting. For example, suppose this is the interface:
// Return an array of ConfigTransformations, which the platform can evaluate
configTransformations: () => ConfigTransformation[]
// Define another interface for a config transformation, which can also include prompts
export interface ConfigTransformation {
// The usual transform function suggested previously
transformer: (config: TConfig) => TConfig
// Not actually sure if this is right, but hopefully it conveys the idea.
promptMessage: String
}
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:
Checklist