mirror of
https://github.com/vercel/commerce.git
synced 2025-06-04 23:36:58 +00:00
This commit updates the application to operate in a standalone mode by modifying essential data fetching functions used by layout components to return hardcoded dummy data, removing dependencies on a live Shopify backend for initial page rendering and layout. Key changes: - `lib/shopify/index.ts`: - `getMenu()`: Updated to return a hardcoded array of `Menu[]` items, bypassing any calls to `shopifyFetch`. Caching directives were removed as they are not applicable to static dummy data. - `getCart()`: Updated to return a hardcoded `Cart` object (or `undefined`), bypassing `shopifyFetch` and cookie-based cart ID retrieval. - `shopifyFetch()`: The core `fetch` call within this function has been commented out and replaced with a `throw new Error(...)`. This prevents any accidental live API calls and makes it clear that such calls are disabled in this standalone configuration. A `console.warn` is also added if the function is ever invoked. These changes ensure that the main layout, including the navbar and cart components, can render without external Shopify dependencies, allowing the storefront to function with dummy data as per your current project requirements. This should resolve build errors related to fetching non-existent Shopify data (like menus) in an environment not connected to a live Shopify store.