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

Support local dev in CLI #5199

Merged
merged 1 commit into from
Jan 31, 2025
Merged

Conversation

shauns
Copy link
Contributor

@shauns shauns commented Jan 15, 2025

Introduces SHOPIFY_CLI_NEVER_USE_PARTNERS_API which is used for internal to Shopify requirements.

@shauns shauns marked this pull request as ready for review January 15, 2025 12:45
@shauns shauns requested a review from a team as a code owner January 15, 2025 12:45
Copy link
Contributor Author

shauns commented Jan 15, 2025

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

Copy link
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run "pnpm changeset add" to track your changes and include them in the next release CHANGELOG.

@shauns shauns marked this pull request as draft January 15, 2025 12:51
@shauns shauns force-pushed the shauns/01-15-support_local_dev_in_cli branch from 4cfc184 to de3dd04 Compare January 29, 2025 17:18
Copy link
Contributor

github-actions bot commented Jan 29, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
75.45% (+0% 🔼)
9011/11943
🟡 Branches
70.64% (-0.02% 🔻)
4395/6222
🟡 Functions
75.26% (+0.01% 🔼)
2364/3141
🟡 Lines
75.98% (+0.01% 🔼)
8513/11205
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / app-event-watcher.ts
95.18% (-1.2% 🔻)
86.49% (-2.7% 🔻)
95.45% 100%
🟡
... / developer-platform-client.ts
68.42% (+3.9% 🔼)
64% (-2.67% 🔻)
80%
74.19% (+3.36% 🔼)
🟢
... / fqdn.ts
84.44% (-1.6% 🔻)
84.62% (-2.88% 🔻)
87.5%
84.44% (-1.6% 🔻)

Test suite run success

2035 tests passing in 909 suites.

Report generated by 🧪jest coverage report action from a86670a

@shauns shauns force-pushed the shauns/01-15-support_local_dev_in_cli branch from de3dd04 to 2fe0c6a Compare January 31, 2025 16:16
@shauns shauns force-pushed the shauns/01-15-support_local_dev_in_cli branch from 2fe0c6a to a86670a Compare January 31, 2025 16:17
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/private/node/constants.d.ts
@@ -31,6 +31,7 @@ export declare const environmentVariables: {
     otelURL: string;
     themeKitAccessDomain: string;
     json: string;
+    neverUsePartnersApi: string;
 };
 export declare const defaultThemeKitAccessDomain = "theme-kit-access.shopifyapps.com";
 export declare const systemEnvironmentVariables: {
packages/cli-kit/dist/public/node/environment.d.ts
@@ -49,4 +49,10 @@ export declare function getIdentityTokenInformation(): {
  * @param environment - Process environment variables.
  * @returns True if the JSON output is enabled, false otherwise.
  */
-export declare function jsonOutputEnabled(environment?: NodeJS.ProcessEnv): boolean;
\ No newline at end of file
+export declare function jsonOutputEnabled(environment?: NodeJS.ProcessEnv): boolean;
+/**
+ * If true, the CLI should not use the Partners API.
+ *
+ * @returns True if the SHOPIFY_CLI_NEVER_USE_PARTNERS_API environment variable is set.
+ */
+export declare function blockPartnersAccess(): boolean;
\ No newline at end of file

@shauns shauns marked this pull request as ready for review January 31, 2025 16:20
@@ -22,6 +23,9 @@ export const NotProvidedStoreFQDNError = new AbortError(
* @returns Fully-qualified domain of the partners service we should interact with.
*/
export async function partnersFqdn(): Promise<string> {
if (blockPartnersAccess()) {
throw new BugError('Partners API is blocked by the SHOPIFY_CLI_NEVER_USE_PARTNERS_API environment variable.')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BugError because this shouldn't happen.

Copy link
Contributor

@alexanderMontague alexanderMontague left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@shauns shauns added this pull request to the merge queue Jan 31, 2025
Merged via the queue into main with commit 936d7ac Jan 31, 2025
29 checks passed
@shauns shauns deleted the shauns/01-15-support_local_dev_in_cli branch January 31, 2025 17:08
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.

2 participants