React Router authenticate.admin helper + Resource Picker UI mock#36
Open
fazlulkabir34 wants to merge 23 commits into
Open
React Router authenticate.admin helper + Resource Picker UI mock#36fazlulkabir34 wants to merge 23 commits into
fazlulkabir34 wants to merge 23 commits into
Conversation
- Add withMockBridgeAdminAuthForReactRouter under @getverdict/mock-bridge/react-router - Wire package.json exports for ., ./auth, ./react-router, ./client - Optional peerDependencies for @shopify/shopify-app-react-router and @shopify/shopify-api - Document SHOPIFY_APP_REACT_ROUTER, BACKEND_INTEGRATION caveat, README link - tsconfig paths for Shopify package subpath typings under classic moduleResolution
…ithMockBridgeAdminAuthForReactRouter
…kage exports - Introduced withMockBridgeAdminAuthForReactRouter for enhanced admin authentication in React Router apps. - Updated package.json to remove deprecated react-router export and streamline exports. - Enhanced documentation to reflect changes in integration instructions for Shopify App React Router. - Adjusted type exports for better clarity and consistency.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Removed redundant mention of `@getverdict/mock-bridge/auth` in the Shopify App React Router section.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Feature/react router admin auth
…bevycommerce/mock-bridge into feature/react-router-admin-auth
Feature/react router admin auth
chore: update package-lock.json and tsconfig.json
…AdminAuthForReactRouter imports
- Added ResourcePicker component for selecting products, variants, and collections. - Updated App component to include ResourcePicker. - Enhanced mock bridge to handle resource picker actions. - Updated package.json and package-lock.json to include new dependencies for React and related types. - Modified README.md to reflect the new ResourcePicker functionality. - Updated tsconfig.json to include new type definitions for resource picker.
…d functions - Enhanced ResourcePickerCatalogResponse to include variants. - Updated getDefaultResourcePickerCatalog to return variants using flattenVariants. - Modified mergeResourcePickerCatalog to handle variants in the merge process. - Adjusted server logic to utilize the new variants structure.
- Removed unnecessary useCallback for toggleId in ResourcePickerModal. - Simplified onChange handlers for buttons in ResourcePickerModal. - Introduced fetchCatalog function to centralize catalog fetching logic and improve error handling. - Updated closedPickerState to include loading state. - Enhanced getFeatureStore to throw an error if a feature is not found. - Refactored flattenVariants function for better readability and performance.
Feature/react router admin auth
… improvements - Added focus management for the search input in ResourcePickerModal to improve accessibility. - Implemented keyboard navigation within the dialog to enhance user experience. - Updated the ResourcePicker state to include selectionRowById for better tracking of selected items. - Refactored fetchCatalog to handle aborting previous requests and improved error handling. - Adjusted the mock bridge to support new features and ensure robust communication with the resource picker.
Feature/resource picker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This branch brings two main upgrades to mock-bridge: first-class support for Shopify App React Router admin authentication in tests, and a fully mocked shopify.resourcePicker flow with an admin-frame modal, catalog API, and stronger bridge integration—so automated browser tests and MCP-style tooling can exercise picker UX without hitting Shopify.
What’s included
React Router admin auth — withMockBridgeAdminAuthForReactRouter (and related exports/build artifacts) so apps using authenticate.admin(request) can run against the mock bridge with clearer wiring and types.
Resource Picker — Replaces the previous stub with a mock modal UI in the admin frame, store/state for open/close/search/selection, variant-aware catalog behavior, and improvements around focus management and error handling.
Server/catalog integration — Mock catalog backed by /api/resource-picker-catalog (documented); customizable via resourcePickerCatalog on the server where applicable.
App Bridge layer — Updates to feature wiring (invokeFeature, resource-picker bridge path, loading tweaks) so the picker behaves consistently with the rest of the mock.
Docs — New guides: docs/SHOPIFY_APP_REACT_ROUTER.md, docs/RESOURCE_PICKER.md; README feature matrix updated (resource picker marked as mock UI); small related edits to backend integration and Remix docs.