cli icon indicating copy to clipboard operation
cli copied to clipboard

Add dev-session process for consistent dev

Open isaacroldan opened this issue 1 year ago β€’ 53 comments

WHY are these changes introduced?

Introduces a new process during app dev: dev-session This process is an alternative to draftable-extension that is enabled when using the app management API

Tests for dev-session are missing, waiting for some improvements from another PR before adding them. This can be merged anyway and tests will be added later.

WHAT is this pull request doing?

  • Add dev-session process (main file to review is dev-session.ts)
  • Update some tests, pass some extra parameters to the dev process.

How to test your changes?

  • dev for partners app should continue working as normal.
  • dev for the app management API starts a dev-session (you'll see a message in the log if this happens)

Post-release steps

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
  • [ ] I've made sure that any changes to dev or deploy have been reflected in the internal flowchart.

isaacroldan avatar Jun 20 '24 10:06 isaacroldan

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

github-actions[bot] avatar Jun 20 '24 10:06 github-actions[bot]

/snapit

isaacroldan avatar Jul 01 '24 10:07 isaacroldan

/snapit

isaacroldan avatar Jul 01 '24 10:07 isaacroldan

/snapit

isaacroldan avatar Jul 01 '24 10:07 isaacroldan

🫰✨ Thanks @isaacroldan! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

"@shopify/cli": "0.0.0-snapshot-20240701102514",
"@shopify/cli-kit": "0.0.0-snapshot-20240701102514",
"@shopify/create-app": "0.0.0-snapshot-20240701102514",
"@shopify/eslint-plugin-cli": "0.0.0-snapshot-20240701102514",
"@shopify/plugin-cloudflare": "0.0.0-snapshot-20240701102514"

github-actions[bot] avatar Jul 01 '24 10:07 github-actions[bot]

/snapit

isaacroldan avatar Jul 05 '24 11:07 isaacroldan

Random comment with /snapit in the middle

isaacroldan avatar Jul 05 '24 11:07 isaacroldan

another random comment

isaacroldan avatar Jul 05 '24 11:07 isaacroldan

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

Test the snapshot by installing the package globally:

pnpm i -g @shopify/[email protected]

github-actions[bot] avatar Jul 05 '24 11:07 github-actions[bot]

/snapit

isaacroldan avatar Jul 09 '24 09:07 isaacroldan

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

Test the snapshot by intalling the CLI 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.

github-actions[bot] avatar Jul 09 '24 09:07 github-actions[bot]

/snapit

isaacroldan avatar Jul 19 '24 13:07 isaacroldan

🫰✨ Thanks @isaacroldan! 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.

github-actions[bot] avatar Jul 19 '24 13:07 github-actions[bot]

/snapit

isaacroldan avatar Jul 31 '24 10:07 isaacroldan

/snapit

isaacroldan avatar Jul 31 '24 10:07 isaacroldan

/snapit

isaacroldan avatar Jul 31 '24 10:07 isaacroldan

/snapit

isaacroldan avatar Jul 31 '24 11:07 isaacroldan

/snapit

isaacroldan avatar Jul 31 '24 11:07 isaacroldan

/snapit

isaacroldan avatar Jul 31 '24 11:07 isaacroldan

/snapit

isaacroldan avatar Jul 31 '24 11:07 isaacroldan

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

Test the snapshot by intalling your package globally:


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.

github-actions[bot] avatar Jul 31 '24 11:07 github-actions[bot]

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

Test the snapshot by intalling your package globally:


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.

github-actions[bot] avatar Jul 31 '24 11:07 github-actions[bot]

/snapit

isaacroldan avatar Jul 31 '24 11:07 isaacroldan

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

Test the snapshot by intalling your package globally:

pnpm i -g [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.

github-actions[bot] avatar Jul 31 '24 11:07 github-actions[bot]

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟑 Statements
72.77% (-0.39% πŸ”»)
8225/11302
🟑 Branches
69.51% (-0.08% πŸ”»)
4006/5763
🟑 Functions
71.52% (-0.29% πŸ”»)
2150/3006
🟑 Lines
73.13% (-0.36% πŸ”»)
7781/10640
Show new covered files 🐣
St.:grey_question:
File Statements Branches Functions Lines
πŸ”΄
... / dev-session.ts
3.85% 0% 9.09% 4.29%
Show files with reduced coverage πŸ”»
St.:grey_question:
File Statements Branches Functions Lines
πŸ”΄
... / dev.ts
9.73% (+0.21% πŸ”Ό)
1.56% (+1.56% πŸ”Ό)
15.79% (-1.86% πŸ”»)
9.62% (+0.34% πŸ”Ό)
πŸ”΄
... / app-management-client.ts
20.58% (-0.19% πŸ”»)
10.53% (-0.58% πŸ”»)
22.34%
18.83% (-0.15% πŸ”»)
🟒
... / spin.ts
97.5%
65.38% (-3.85% πŸ”»)
100% 97.44%

Test suite run success

1856 tests passing in 846 suites.

Report generated by πŸ§ͺjest coverage report action from 0fa11b260faf37ae68b904e448f75233fddccbc4

github-actions[bot] avatar Jul 31 '24 16:07 github-actions[bot]

/snapit

isaacroldan avatar Aug 09 '24 10:08 isaacroldan

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

Test the snapshot by intalling your package globally:

pnpm i -g [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.

github-actions[bot] avatar Aug 09 '24 10:08 github-actions[bot]

/snapit

isaacroldan avatar Aug 09 '24 10:08 isaacroldan

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

Test the snapshot by intalling your package globally:

pnpm i -g [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.

github-actions[bot] avatar Aug 09 '24 10:08 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
@@ -19,6 +19,11 @@ export declare function stripUpPath(path: string, strip: number): string;
  * @param callback - The callback that receives the temporary directory.
  */
 export declare function inTemporaryDirectory<T>(callback: (tmpDir: string) => T | Promise<T>): Promise<T>;
+/**
+ * Return a temporary directory
+ * @returns - The path to the temporary directory.
+ */
+export declare function tempDirectory(): string;
 /**
  * It reads a file and returns its content as a string using the
  * utf-8 encoding.

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 = Awaited<ReturnType<typeof nodeFetch>>;
+export type Response = 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 = Awaited<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): Promise<Response>;
+export declare function fetch(url: RequestInfo, init?: RequestInit): 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): Promise<Res
  * @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): Promise<Response>;
+export declare function shopifyFetch(url: RequestInfo, init?: RequestInit): Response;
 /**
  * Download a file from a URL to a local path.
  *

github-actions[bot] avatar Aug 12 '24 08:08 github-actions[bot]