|
@@ -545,6 +545,38 @@ When making changes:
|
|
|
4. **New Protected Routes**: Add to App.tsx inside `<PrivateRoute>` wrapper
|
|
4. **New Protected Routes**: Add to App.tsx inside `<PrivateRoute>` wrapper
|
|
|
5. **New API Endpoints**: Create new Edge Functions in `supabase/functions/`
|
|
5. **New API Endpoints**: Create new Edge Functions in `supabase/functions/`
|
|
|
|
|
|
|
|
|
|
+### ⚠️ Critical: Deploying Edge Function Changes
|
|
|
|
|
+
|
|
|
|
|
+**IMPORTANT**: After modifying any Supabase Edge Function code, you MUST redeploy the function to Supabase for the changes to take effect!
|
|
|
|
|
+
|
|
|
|
|
+**Steps to deploy Edge Functions:**
|
|
|
|
|
+
|
|
|
|
|
+1. **Via CLI** (recommended for multiple functions):
|
|
|
|
|
+ ```bash
|
|
|
|
|
+ # Deploy a specific function
|
|
|
|
|
+ supabase functions deploy <function-name> --project-ref ztklqodcdjeqpsvhlpud
|
|
|
|
|
+
|
|
|
|
|
+ # Deploy multiple functions at once
|
|
|
|
|
+ supabase functions deploy oauth-woocommerce oauth-shopify api --project-ref ztklqodcdjeqpsvhlpud
|
|
|
|
|
+ ```
|
|
|
|
|
+
|
|
|
|
|
+2. **Via MCP Tool** (for Claude Code):
|
|
|
|
|
+ ```
|
|
|
|
|
+ Use mcp__supabase__deploy_edge_function with the function files
|
|
|
|
|
+ ```
|
|
|
|
|
+
|
|
|
|
|
+3. **Verify deployment**:
|
|
|
|
|
+ - Check version number increased using `mcp__supabase__list_edge_functions`
|
|
|
|
|
+ - Review logs using `mcp__supabase__get_logs(service: "edge-function")`
|
|
|
|
|
+ - Test the endpoint to ensure changes are live
|
|
|
|
|
+
|
|
|
|
|
+**Common mistake**: Forgetting to redeploy after code changes means the old version continues running in production!
|
|
|
|
|
+
|
|
|
|
|
+**Which functions to deploy:**
|
|
|
|
|
+- If you modified a function file directly (e.g., `oauth-woocommerce/index.ts`), deploy that function
|
|
|
|
|
+- If you modified a shared file (e.g., `_shared/woocommerce-client.ts`), deploy ALL functions that import it
|
|
|
|
|
+- When in doubt, check which functions import the modified file and deploy all of them
|
|
|
|
|
+
|
|
|
## Important Notes
|
|
## Important Notes
|
|
|
|
|
|
|
|
- Backend is implemented as Supabase Edge Functions (serverless)
|
|
- Backend is implemented as Supabase Edge Functions (serverless)
|