Add dev-session process for consistent dev
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-sessionprocess (main file to review isdev-session.ts) - Update some tests, pass some extra parameters to the dev process.
How to test your changes?
devfor partners app should continue working as normal.devfor the app management API starts adev-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
devordeployhave been reflected in the internal flowchart.
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
/snapit
/snapit
/snapit
π«°β¨ 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"
/snapit
Random comment with /snapit in the middle
another random comment
π«°β¨ Thanks @isaacroldan! Your snapshot has been published to npm.
Test the snapshot by installing the package globally:
pnpm i -g @shopify/[email protected]
/snapit
π«°β¨ 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
shopifyin your terminal If the versions don't match, you might have multiple global instances installed. Usewhich shopifyto find out which one you are running and uninstall it.
/snapit
π«°β¨ 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
shopifyin your terminal If the versions don't match, you might have multiple global instances installed. Usewhich shopifyto find out which one you are running and uninstall it.
/snapit
/snapit
/snapit
/snapit
/snapit
/snapit
/snapit
π«°β¨ 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
shopifyin your terminal If the versions don't match, you might have multiple global instances installed. Usewhich shopifyto find out which one you are running and uninstall it.
π«°β¨ 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
shopifyin your terminal If the versions don't match, you might have multiple global instances installed. Usewhich shopifyto find out which one you are running and uninstall it.
/snapit
π«°β¨ 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
shopifyin your terminal If the versions don't match, you might have multiple global instances installed. Usewhich shopifyto find out which one you are running and uninstall it.
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
/snapit
π«°β¨ 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
shopifyin your terminal If the versions don't match, you might have multiple global instances installed. Usewhich shopifyto find out which one you are running and uninstall it.
/snapit
π«°β¨ 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
shopifyin your terminal If the versions don't match, you might have multiple global instances installed. Usewhich shopifyto find out which one you are running and uninstall it.
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
mainyou might see odd diffs, rebasemaininto 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.
*