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

[Themes] Theme Dev - Display theme asset upload errors in overlay #4899

Draft
wants to merge 12 commits into
base: jm/strict_push
Choose a base branch
from

Conversation

jamesmengo
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

Copy link
Contributor Author

jamesmengo commented Nov 20, 2024

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.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Contributor

github-actions bot commented Nov 20, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
74.56% (+0.01% 🔼)
8554/11473
🟡 Branches
70.34% (+0.02% 🔼)
4172/5931
🟡 Functions
74.11% (+0.01% 🔼)
2247/3032
🟡 Lines
75.1% (+0.01% 🔼)
8090/10772

Test suite run success

1951 tests passing in 887 suites.

Report generated by 🧪jest coverage report action from 8211225

@jamesmengo jamesmengo changed the title --wip-- [skip ci] [Themes] Add error overlay for failed file uploads Nov 21, 2024
@jamesmengo jamesmengo changed the title [Themes] Add error overlay for failed file uploads [Themes] Theme Dev - Display theme asset upload errors in overlay Nov 21, 2024
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

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/node/git.d.ts
@@ -97,6 +97,13 @@ export declare class OutsideGitDirectoryError extends AbortError {
  * @param directory - The directory to check.
  */
 export declare function ensureInsideGitDirectory(directory?: string): Promise<void>;
+/**
+ * Returns true if the given directory is inside a .git directory tree.
+ *
+ * @param directory - The directory to check.
+ * @returns True if the directory is inside a .git directory tree.
+ */
+export declare function insideGitDirectory(directory?: string): Promise<boolean>;
 export declare class GitDirectoryNotCleanError extends AbortError {
 }
 /**
packages/cli-kit/dist/public/node/themes/types.d.ts
@@ -15,6 +15,7 @@ type ThemeFSEvent = {
     type: 'add' | 'change';
     payload: {
         fileKey: Key;
+        uploadErrors: Map<Key, string[]>;
         onContent: (fn: (content: string) => void) => void;
         onSync: (fn: () => void) => void;
     };
@@ -93,6 +94,14 @@ export interface ThemeFileSystem extends VirtualFileSystem {
     applyIgnoreFilters: <T extends {
         key: string;
     }>(files: T[]) => T[];
+    /**
+     * Map of file keys to errors.
+     */
+    uploadErrors: Map<string, string[]>;
+    /**
+     * Emits an event to the event emitter.
+     */
+    emitEvent: <T extends ThemeFSEventName>(eventName: T, payload: ThemeFSEventPayload<T>) => void;
 }
 /**
  * Represents a theme on the file system.

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