Rewrite dev store APIs in local dev for app preview#6808
Rewrite dev store APIs in local dev for app preview#6808
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success3718 tests passing in 1438 suites. Report generated by 🧪jest coverage report action from ba17bbd |
c433e16 to
b0cb12d
Compare
|
We detected some changes at Caution DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release. |
b0cb12d to
ba17bbd
Compare
Differences in type declarationsWe 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:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/node/context/fqdn.d.ts@@ -50,4 +50,12 @@ export declare function identityFqdn(): Promise<string>;
* @param store - Store name.
* @returns Normalized store name.
*/
-export declare function normalizeStoreFqdn(store: string): string;
\ No newline at end of file
+export declare function normalizeStoreFqdn(store: string): string;
+/**
+ * Convert a store FQDN to the admin URL pattern for local development.
+ * In local mode, transforms \{store\}.my.shop.dev to admin.shop.dev/store/\{store\}.
+ *
+ * @param storeFqdn - Normalized store FQDN.
+ * @returns Store admin URL base (without protocol or path).
+ */
+export declare function storeAdminUrl(storeFqdn: string): string;
\ No newline at end of file
|

WHY are these changes introduced?
Recent changes to normalize store FQDNs in local development mode (commits ce04cc6 and 86748ac from #6735) introduced a transformation that replaces
.my.shop.devwith.dev-api.shop.dev. This breaksshopify app devin local environments because:.dev-api.shop.devdomainWHAT is this pull request doing?
This PR makes two changes to fix local development:
1. Reverts the
.dev-api.shop.devtransformation (fqdn.ts).my.shop.dev→.dev-api.shop.dev2. Transforms preview URLs for local dev (
app-url.ts){store}.my.shop.dev/admin/...toadmin.shop.dev/store/{store}/admin/...How to test your changes?
Prerequisites:
SHOPIFY_SERVICE_ENV=localdev-store.my.shop.dev)Testing:
Expected behavior:
admin.shop.dev/store/{store-name}/admin/...patternBefore these changes:
.dev-api.shop.devMeasuring impact
Checklist
SHOPIFY_SERVICE_ENV=local