cli icon indicating copy to clipboard operation
cli copied to clipboard

[DNM] Generate and store a combined extension schema

Open shauns opened this issue 9 months ago β€’ 6 comments

As downstack, but for extensions.

This produces a good JSON schema for extensions (it only covers UI extensions & functions right now though). But, the most common LSP for TOML will struggle with this schema as it is oriented around a union/anyOf. So as-is, this is a demonstration of what may be possible, but today isn't.

shauns avatar Apr 04 '25 14:04 shauns

[!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.

shauns avatar Apr 04 '25 14:04 shauns

Unused exports (1)

Filename exports
packages/app/src/cli/models/extensions/schemas.ts MetafieldSchemaAsJson

github-actions[bot] avatar Apr 04 '25 14:04 github-actions[bot]

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/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.
  *

github-actions[bot] avatar Apr 04 '25 14:04 github-actions[bot]

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/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.
  *

github-actions[bot] avatar Apr 04 '25 14:04 github-actions[bot]

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟑 Statements 76.64% 9457/12339
🟑 Branches 71.75% 4623/6443
🟑 Functions 76.37% 2450/3208
🟑 Lines 77.17% 8943/11588

Test suite run success

2182 tests passing in 954 suites.

Report generated by πŸ§ͺjest coverage report action from 41ee0243cc8255e7d077949fc001b2f57eb3cc9f

github-actions[bot] avatar Apr 04 '25 14:04 github-actions[bot]

This PR seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. β†’ If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.

github-actions[bot] avatar May 05 '25 03:05 github-actions[bot]