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] Add push, pull, and fetchStoreThemes to Themes Package Public Exports #4518

Merged
merged 2 commits into from
Sep 30, 2024

Conversation

jamesmengo
Copy link
Contributor

@jamesmengo jamesmengo commented Sep 24, 2024

WHY are these changes introduced?

Fixes https://github.com/Shopify/develop-advanced-edits/issues/346

WHAT is this pull request doing?

  • Exports the push, pull, and fetchStoreThemes` commands via the CLI package

How to test your changes?

  1. Checkout and build this branch
  2. Create a file in a package that includes @shopify/theme, such as packages/app/src/cli/test.ts
  3. Import push, pull, and fetchStoreThemes
  4. Hover over the function definition to see the JSDoc
  5. Hover over the args inside of push and pull to see the JSDoc for the args inside flags
  6. Test the autocomplete for flags args
Google.Chrome.-.Delete.Audio.+.Video.Recordings.Descript.Help.mp4
Template
import {fetchStoreThemes, pull, push} from '@shopify/theme'

await pull({
  development: true,
})
await push({
  development: true,
  only: ['asdf'],
})
await fetchStoreThemes('fqdn', 'asdf')

Post-release steps

  • Partner comms

Measuring impact

How do we know this change was effective? Please choose one

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-inner-loop

Copy link
Contributor

github-actions bot commented Sep 24, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 72.76% 8485/11662
🟡 Branches 69.45% 4155/5983
🟡 Functions 71.55% 2201/3076
🟡 Lines 73.09% 8029/10985

Test suite run success

1928 tests passing in 872 suites.

Report generated by 🧪jest coverage report action from 967447b

@jamesmengo jamesmengo changed the base branch from main to jm/api-fetchThemes September 25, 2024 17:28
@jamesmengo jamesmengo changed the title Jm/api exports [Themes] Add push, pull, and fetchStoreThemes to Themes Package Public Exports Sep 25, 2024
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/public/common/url.d.ts
@@ -5,11 +5,4 @@
  * @returns True if the URL is valid, false otherwise.
  * @throws An error if URL's constructor throws an error other than .
  */
-export declare function isValidURL(url: string): boolean;
-/**
- * Safely parse a string into a URL.
- *
- * @param url - The string to parse into a URL.
- * @returns A URL object if the parsing is successful, undefined otherwise.
- */
-export declare function safeParseURL(url: string): URL | undefined;
\ No newline at end of file
+export declare function isValidURL(url: string): boolean;
\ No newline at end of file
packages/cli-kit/dist/public/node/node-package-manager.d.ts
@@ -293,17 +293,4 @@ export declare function addResolutionOrOverride(directory: string, dependencies:
  * @param packageJSON - Package.json file to write.
  */
 export declare function writePackageJSON(directory: string, packageJSON: PackageJson): Promise<void>;
-/**
- * Infers the package manager to be used based on the provided options and environment.
- *
- * This function determines the package manager in the following order of precedence:
- * 1. Uses the package manager specified in the options, if valid.
- * 2. Infers the package manager from the user agent string.
- * 3. Infers the package manager used for the global CLI installation.
- * 4. Defaults to 'npm' if no other method succeeds.
- *
- * @param optionsPackageManager - The package manager specified in the options (if any).
- * @returns The inferred package manager as a PackageManager type.
- */
-export declare function inferPackageManager(optionsPackageManager: string | undefined, env?: NodeJS.ProcessEnv): PackageManager;
 export {};
\ No newline at end of file

Copy link
Contributor

We detected some changes at either packages/*/src or packages/cli-kit/assets/cli-ruby/** 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.

Base automatically changed from jm/api-fetchThemes to main September 30, 2024 11:29
@karreiro
Copy link
Contributor

/snapit

Copy link
Contributor

🫰✨ Thanks @karreiro! Your snapshot has been published to npm.

Test the snapshot by intalling your package globally:

pnpm i -g @shopify/[email protected]

After installing, validate the version by running just shopify in your terminal
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

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 Sep 30, 2024
Merged via the queue into main with commit e0a977f Sep 30, 2024
36 checks passed
@karreiro karreiro deleted the jm/api-exports branch September 30, 2024 12:36
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.

3 participants