-
Notifications
You must be signed in to change notification settings - Fork 162
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
Store module schemas alongside app #5606
base: main
Are you sure you want to change the base?
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
We detected some changes at packages/*/src and there are no updates in the .changeset. |
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/fs.d.ts@@ -103,13 +103,13 @@ export declare function writeFile(path: string, data: string | Buffer, options?:
*/
export declare function writeFileSync(path: string, data: string): void;
/**
- * Creates a directory at the given path.
+ * Creates a directory at the given path. Directories are created recursively if needed.
*
* @param path - Path to the directory to be created.
*/
export declare function mkdir(path: string): Promise<void>;
/**
- * Synchronously creates a directory at the given path.
+ * Synchronously creates a directory at the given path. Directories are created recursively if needed.
*
* @param path - Path to the directory to be created.
*/
@@ -263,6 +263,13 @@ interface GenerateRandomDirectoryOptions {
* @returns It returns the name of the directory.
*/
export declare function generateRandomNameForSubdirectory(options: GenerateRandomDirectoryOptions): Promise<string>;
+/**
+ * Read the contents of a directory.
+ *
+ * @param path - Path to the directory.
+ * @returns A promise that resolves to an array of the names of the files in the directory.
+ */
+export declare function readdir(path: string): Promise<string[]>;
/**
* Traverse the file system and return pathnames that match the given pattern.
*
|
Coverage report
Show files with reduced coverage 🔻
Test suite run success2175 tests passing in 954 suites. Report generated by 🧪jest coverage report action from 66d18c8 |
* @param specifications - The list of extension specifications | ||
* @param directory - The app directory where .shopify folder will be created | ||
*/ | ||
export async function refreshSchemaBank( |
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.
Did you measure how long it takes for this to run? Just to be sure we are not adding a lot of delay to every command.
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.
I'm seeing between 0.3 and 2ms. I think an end state for this is to pair it with specification caching in some way. Then the overhead is less often too.
WHAT is this pull request doing?
Adds a new
refreshSchemaBank
function that stores JSON schemas from extension specifications in the.shopify/schemas
directory. This enables better IDE integration for extension configuration validation.How to test your changes?
Run this CLI against any app, and see that the
.shopify/schemas
folder is updated.