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

[3.46] Fix an issue in shopify theme dev and shopify app dev that was affecting assets/fonts loading on local servers #2107

Merged
merged 2 commits into from
Jun 7, 2023

Conversation

karreiro
Copy link
Contributor

@karreiro karreiro commented Jun 7, 2023

Backport #2105 and #2110

@karreiro karreiro requested a review from amcaplan June 7, 2023 06:53
@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

Thanks for your contribution!

Depending on what you are working on, you may want to request a review from a Shopify team:

  • Themes: @shopify/theme-code-tools
  • UI extensions: @shopify/ui-extensions-cli
    • Checkout UI extensions: @shopify/checkout-ui-extensions-api-stewardship
  • Hydrogen: @shopify/hydrogen
  • Other: @shopify/cli-foundations

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 70.93% 4555/6422
🟡 Branches 68% 2087/3069
🟡 Functions 68.23% 1194/1750
🟡 Lines 72.4% 4352/6011

Test suite run success

1070 tests passing in 564 suites.

Report generated by 🧪jest coverage report action from 6d709d7

@karreiro karreiro changed the title [3.46] Fix an issue in shopify theme dev and shopify app dev that was affecting image loading on local servers [3.46] Fix an issue in shopify theme dev and shopify app dev that was affecting assets/fonts loading on local servers Jun 7, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

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/api.d.ts
@@ -1,5 +1,5 @@
 import { Headers } from 'form-data';
-export type API = 'admin' | 'storefront-renderer' | 'partners' | 'business-platform';
+export type API = 'admin' | 'storefront-renderer' | 'partners';
 export declare const allAPIs: API[];
 interface RequestOptions<T> {
     request: Promise<T>;
packages/cli-kit/dist/private/node/session.d.ts
@@ -29,11 +29,6 @@ interface StorefrontRendererAPIOAuthOptions {
     /** List of scopes to request permissions for. */
     scopes: StorefrontRendererScope[];
 }
-type BusinessPlatformScope = 'destinations' | string;
-interface BusinessPlatformAPIOAuthOptions {
-    /** List of scopes to request permissions for. */
-    scopes: BusinessPlatformScope[];
-}
 /**
  * It represents the authentication requirements and
  * is the input necessary to trigger the authentication
@@ -43,13 +38,11 @@ export interface OAuthApplications {
     adminApi?: AdminAPIOAuthOptions;
     storefrontRendererApi?: StorefrontRendererAPIOAuthOptions;
     partnersApi?: PartnersAPIOAuthOptions;
-    businessPlatformApi?: BusinessPlatformAPIOAuthOptions;
 }
 export interface OAuthSession {
     admin?: AdminSession;
     partners?: string;
     storefront?: string;
-    businessPlatform?: string;
 }
 /**
  * This method ensures that we have a valid session to authenticate against the given applications using the provided scopes.
packages/cli-kit/dist/public/common/version.d.ts
@@ -1 +1 @@
-export declare const CLI_KIT_VERSION = "3.46.0";
\ No newline at end of file
+export declare const CLI_KIT_VERSION = "3.46.2";
\ No newline at end of file
packages/cli-kit/dist/public/node/metadata.d.ts
@@ -27,7 +27,7 @@ export type SensitiveSchema<T> = T extends RuntimeMetadataManager<infer _TPublic
 export declare function createRuntimeMetadataContainer<TPublic extends AnyJson, TSensitive extends AnyJson = {
     [key: string]: never;
 }>(): RuntimeMetadataManager<TPublic, TSensitive>;
-type CmdFieldsFromMonorail = PickByPrefix<MonorailEventPublic, 'cmd_all_'> & PickByPrefix<MonorailEventPublic, 'cmd_app_'> & PickByPrefix<MonorailEventPublic, 'cmd_create_app_'>;
+type CmdFieldsFromMonorail = PickByPrefix<MonorailEventPublic, 'cmd_all_'> & PickByPrefix<MonorailEventPublic, 'cmd_app_'>;
 declare const coreData: RuntimeMetadataManager<CmdFieldsFromMonorail, {
     commandStartOptions: {
         startTime: number;
packages/cli-kit/dist/public/node/monorail.d.ts
@@ -2,7 +2,7 @@ import { JsonMap } from '../../private/common/json.js';
 import { DeepRequired } from '../common/ts/deep-required.js';
 export { DeepRequired };
 type Optional<T> = T | null;
-export declare const MONORAIL_COMMAND_TOPIC: "app_cli3_command/1.4";
+export declare const MONORAIL_COMMAND_TOPIC: "app_cli3_command/1.3";
 export interface Schemas {
     [MONORAIL_COMMAND_TOPIC]: {
         sensitive: {
@@ -51,7 +51,6 @@ export interface Schemas {
             cmd_dev_tunnel_type?: Optional<string>;
             cmd_dev_tunnel_custom_hash?: Optional<string>;
             cmd_dev_urls_updated?: Optional<boolean>;
-            cmd_create_app_template?: Optional<string>;
             app_extensions_any?: Optional<boolean>;
             app_extensions_breakdown?: Optional<string>;
             app_extensions_count?: Optional<number>;
packages/cli-kit/dist/public/node/session.d.ts
@@ -46,13 +46,6 @@ export declare function ensureAuthenticatedAdmin(store: string, scopes?: string[
  * @returns The access token and store.
  */
 export declare function ensureAuthenticatedThemes(store: string, password: string | undefined, scopes?: string[], forceRefresh?: boolean): Promise<AdminSession>;
-/**
- * Ensure that we have a valid session to access the Business Platform API.
- *
- * @param scopes - Optional array of extra scopes to authenticate with.
- * @returns The access token for the Business Platform API.
- */
-export declare function ensureAuthenticatedBusinessPlatform(scopes?: string[]): Promise<string>;
 /**
  * Logout from Shopify.
  *
packages/cli-kit/dist/public/node/ui.d.ts
@@ -213,7 +213,7 @@ export interface RenderSelectPromptOptions<T> extends Omit<SelectPromptProps<T>,
  *    Other
  *    (f) first
  *    (s) second
- *    (7) third (limit reached)
+ *    (7) third
  *    (8) fourth
  *    (9) seventh
  *    (10) tenth
@@ -269,7 +269,7 @@ export interface RenderAutocompleteOptions<T> extends PartialBy<Omit<Autocomplet
  *    sixteenth
  *    seventeenth
  *    eighteenth
- *    nineteenth (disabled)
+ *    nineteenth
  *    twentieth
  *    twenty-first
  *    twenty-second
packages/cli-kit/dist/private/node/session/exchange.d.ts
@@ -10,7 +10,6 @@ export interface ExchangeScopes {
     admin: string[];
     partners: string[];
     storefront: string[];
-    businessPlatform: string[];
 }
 /**
  * Given a valid authorization code, request an identity access token.
packages/cli-kit/dist/public/node/context/fqdn.d.ts
@@ -9,12 +9,6 @@ export declare const NotProvidedStoreFQDNError: AbortError;
  * @returns Fully-qualified domain of the partners service we should interact with.
  */
 export declare function partnersFqdn(): Promise<string>;
-/**
- * It returns the BusinessPlatform' API service we should interact with.
- *
- * @returns Fully-qualified domain of the partners service we should interact with.
- */
-export declare function businessPlatformFqdn(): Promise<string>;
 /**
  * It returns the Identity service we should interact with.
  *
packages/cli-kit/dist/private/node/ui/components/SelectInput.d.ts
@@ -3,13 +3,17 @@ import { DOMElement } from 'ink';
 declare module 'react' {
     function forwardRef<T, P>(render: (props: P, ref: React.Ref<T>) => JSX.Element | null): (props: P & React.RefAttributes<T>) => JSX.Element | null;
 }
+interface OnChangeOptions<T> {
+    item: Item<T> | undefined;
+    usedShortcut: boolean;
+}
 export interface SelectInputProps<T> {
     items: Item<T>[];
-    onChange?: (item: Item<T> | undefined) => void;
+    onChange: ({ item, usedShortcut }: OnChangeOptions<T>) => void;
     enableShortcuts?: boolean;
     focus?: boolean;
     emptyMessage?: string;
-    defaultValue?: T;
+    defaultValue?: Item<T>;
     highlightedTerm?: string;
     loading?: boolean;
     errorMessage?: string;
@@ -17,18 +21,12 @@ export interface SelectInputProps<T> {
     morePagesMessage?: string;
     infoMessage?: string;
     limit?: number;
-    submitWithShortcuts?: boolean;
-    onSubmit?: (item: Item<T>) => void;
 }
 export interface Item<T> {
     label: string;
     value: T;
     key?: string;
     group?: string;
-    helperText?: string;
-    disabled?: boolean;
-}
-export interface ItemWithKey<T> extends Item<T> {
-    key: string;
 }
-export declare const SelectInput: <T>(props: SelectInputProps<T> & React.RefAttributes<DOMElement>) => JSX.Element | null;
\ No newline at end of file
+export declare const SelectInput: <T>(props: SelectInputProps<T> & React.RefAttributes<DOMElement>) => JSX.Element | null;
+export {};
\ No newline at end of file
packages/cli-kit/dist/private/node/ui/components/TextAnimation.d.ts
@@ -1,9 +1,9 @@
-import React from 'react';
+import { FunctionComponent } from 'react';
 interface TextAnimationProps {
     text: string;
 }
 /**
  *  applies a rainbow animation to text.
  */
-declare const TextAnimation: React.MemoExoticComponent<({ text }: TextAnimationProps) => JSX.Element>;
+declare const TextAnimation: FunctionComponent<TextAnimationProps>;
 export { TextAnimation };
\ No newline at end of file

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

Benchmark report

We detected a significant variation of startup time in the following commands.
Note that it might be related to external factors that influence the benchmarking.
If you believe that's the case, feel free to ignore the table below.

Status Command Baseline (avg) Current (avg) Diff
🔴 app build 979 ms 1438.33 ms 46.92 %
🔴 app deploy 1060.67 ms 1611.33 ms 51.92 %
🔴 app dev 1093.67 ms 1626.33 ms 48.7 %
🔴 app env pull 988.33 ms 1521 ms 53.9 %
🔴 app env show 987.33 ms 1507.33 ms 52.67 %
🔴 app function build 982.33 ms 1434.67 ms 46.05 %
🔴 app function run 984.67 ms 1444 ms 46.65 %
🔴 app function schema 1013 ms 1552.67 ms 53.27 %
🔴 app function typegen 972.67 ms 1447 ms 48.77 %
🔴 app generate extension 1046.67 ms 1574.67 ms 50.45 %
🔴 app generate schema 1025 ms 1528.33 ms 49.11 %
🔴 app info 988.33 ms 1512 ms 52.98 %
🔴 app scaffold extension 1043 ms 1576.33 ms 51.13 %
🔴 app update-url 942 ms 1477 ms 56.79 %
🔴 theme check 798 ms 1397 ms 75.06 %
🔴 theme console 872.33 ms 1490 ms 70.81 %
🔴 theme delete 883 ms 1479 ms 67.5 %
🔴 theme dev 883.67 ms 1468 ms 66.13 %
🔴 theme help-old 792.33 ms 1386 ms 74.93 %
🔴 theme info 840 ms 1430.67 ms 70.32 %
🔴 theme init 808.67 ms 1413 ms 74.73 %
🔴 theme language-server 788.67 ms 1395.33 ms 76.92 %
🔴 theme list 885 ms 1478 ms 67.01 %
🔴 theme open 880.33 ms 1474.67 ms 67.51 %
🔴 theme package 843.67 ms 1434.33 ms 70.01 %
🔴 theme publish 877.33 ms 1483 ms 69.03 %
🔴 theme pull 873 ms 1475 ms 68.96 %
🔴 theme push 879.33 ms 1483.67 ms 68.73 %
🔴 theme serve 882 ms 1487.33 ms 68.63 %
🔴 theme share 873 ms 1461.67 ms 67.43 %
🔴 webhook trigger 939.33 ms 1491.33 ms 58.77 %

@karreiro karreiro merged commit e7f2488 into stable/3.46 Jun 7, 2023
@karreiro karreiro deleted the fix-2094-3.46 branch June 7, 2023 12:15
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