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] - Shopify Theme Console #4183

Merged
merged 9 commits into from
Aug 9, 2024
Merged

[Themes] - Shopify Theme Console #4183

merged 9 commits into from
Aug 9, 2024

Conversation

jamesmengo
Copy link
Contributor

@jamesmengo jamesmengo commented Jul 10, 2024

WHY are these changes introduced?

WHAT is this pull request doing?

Base branch for the shopify theme console TS implementation

How to test your changes?

  • There are more detailed instructions in each of the feature branches that were merged in
  1. Execute the new feature pnpm shopify theme console --dev-preview
  2. Open an instance of the ruby implementation shopify theme console

Evaluate some expressions and look for parity differences

Intentional Differences:

  • We return null rather than nil in TS land

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

Thanks for your contribution!

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

  • Themes: @shopify/advanced-edits
  • UI extensions: @shopify/ui-extensions-cli
    • Checkout UI extensions: @shopify/checkout-ui-extensions-api-stewardship
  • Hydrogen: @shopify/hydrogen
  • Other: @shopify/app-management

Copy link
Contributor

github-actions bot commented Jul 10, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
72.61% (+0.08% 🔼)
7912/10896
🟡 Branches
69.39% (+0.05% 🔼)
3885/5599
🟡 Functions
71.32% (-0.02% 🔻)
2076/2911
🟡 Lines
72.95% (+0.09% 🔼)
7477/10250
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / common.ts
87.5% 44.44%
75% (-5% 🔻)
87.5%
🟢
... / common.ts
87.5% (-1.39% 🔻)
88.89% 100% 100%
🟢
... / usePollAppLogs.ts
93.18% (-0.15% 🔻)
95.24% (-0.41% 🔻)
80% (-1.82% 🔻)
93.02%
🔴
... / app-management-client.ts
17.54% (-2.02% 🔻)
11.11%
17.39% (-2.17% 🔻)
15.38% (-2.23% 🔻)

Test suite run success

1804 tests passing in 822 suites.

Report generated by 🧪jest coverage report action from ddbe9f5

Copy link
Contributor

@karreiro karreiro left a comment

Choose a reason for hiding this comment

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

Thank you, @jamesmengo! Awesome stuff! 🔥 I've left only some minor comments :)

@jamesmengo jamesmengo force-pushed the jmeng/themeconsole branch 2 times, most recently from 3d579d1 to 4d9cf02 Compare July 22, 2024 22:23
@jamesmengo jamesmengo self-assigned this Aug 6, 2024
@jamesmengo jamesmengo added the #gsd:40767 Fortify local development experience for Liquid themes label Aug 6, 2024
@jamesmengo jamesmengo marked this pull request as ready for review August 6, 2024 22:04
@jamesmengo jamesmengo force-pushed the jmeng/themeconsole branch 2 times, most recently from 1d1b33a to 5970c7e Compare August 6, 2024 22:08

This comment has been minimized.

Copy link
Contributor

@karreiro karreiro left a comment

Choose a reason for hiding this comment

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

Thank you for this PR, @jamesmengo! Great stuff. I've left some comments, but the PR looks great, and I could not find any bugs 🚀

Besides the comments, I believe we could:

  • rename evaluater.ts to evaluator.ts
  • move repl-theme-manager.ts and password-prompt.ts to the packages/theme/src/cli/utilities/repl/ directory

What do you think?

Thanks again for this PR! :)

packages/theme/src/cli/commands/theme/console.ts Outdated Show resolved Hide resolved
packages/theme/src/cli/utilities/prompts.ts Outdated Show resolved Hide resolved
packages/theme/src/cli/utilities/repl.ts Outdated Show resolved Hide resolved
packages/theme/src/cli/utilities/repl.ts Outdated Show resolved Hide resolved
packages/theme/src/cli/utilities/repl/presenter.ts Outdated Show resolved Hide resolved
packages/theme/src/cli/utilities/repl/presenter.test.ts Outdated Show resolved Hide resolved
packages/theme/src/cli/utilities/repl/evaluater.ts Outdated Show resolved Hide resolved
packages/theme/src/cli/utilities/repl/evaluater.ts Outdated Show resolved Hide resolved
packages/theme/src/cli/utilities/repl/evaluater.ts Outdated Show resolved Hide resolved
@jamesmengo jamesmengo force-pushed the jmeng/themeconsole branch 3 times, most recently from e7e3bc6 to 1bb97b8 Compare August 7, 2024 22:30
Copy link
Contributor

github-actions bot commented Aug 8, 2024

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/http.d.ts
@@ -7,7 +7,7 @@ export { FetchError, Request } from 'node-fetch';
  * @returns A FormData object.
  */
 export declare function formData(): FormData;
-export type Response = ReturnType<typeof nodeFetch>;
+export type Response = Awaited<ReturnType<typeof nodeFetch>>;
 /**
  * An interface that abstracts way node-fetch. When Node has built-in
  * support for "fetch" in the standard library, we can drop the node-fetch
@@ -20,7 +20,7 @@ export type Response = ReturnType<typeof nodeFetch>;
  * @param init - An object containing any custom settings that you want to apply to the request.
  * @returns A promise that resolves with the response.
  */
-export declare function fetch(url: RequestInfo, init?: RequestInit): Response;
+export declare function fetch(url: RequestInfo, init?: RequestInit): Promise<Response>;
 /**
  * A fetch function to use with Shopify services. The function ensures the right
  * TLS configuragion is used based on the environment in which the service is running
@@ -30,7 +30,7 @@ export declare function fetch(url: RequestInfo, init?: RequestInit): Response;
  * @param init - An object containing any custom settings that you want to apply to the request.
  * @returns A promise that resolves with the response.
  */
-export declare function shopifyFetch(url: RequestInfo, init?: RequestInit): Response;
+export declare function shopifyFetch(url: RequestInfo, init?: RequestInit): Promise<Response>;
 /**
  * Download a file from a URL to a local path.
  *

@jamesmengo jamesmengo changed the title Shopify Theme Console [Themes] - Shopify Theme Console Aug 8, 2024
Copy link
Contributor

@karreiro karreiro left a comment

Choose a reason for hiding this comment

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

Thank you, @jamesmengo! 🔥🚀

@karreiro karreiro added this pull request to the merge queue Aug 9, 2024
Merged via the queue into main with commit 68e905c Aug 9, 2024
36 checks passed
@karreiro karreiro deleted the jmeng/themeconsole branch August 9, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#gsd:40767 Fortify local development experience for Liquid themes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants