Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
56fced9
feat: React Router admin auth helper, package exports, peers
fazlulkabir34 Mar 24, 2026
07ea1ba
refactor: standardize string quotes and improve code consistency in w…
fazlulkabir34 Mar 24, 2026
a0408fa
feat: add withMockBridgeAdminAuthForReactRouter helper and update pac…
fazlulkabir34 Mar 24, 2026
ca4eab2
Update README.md
fazlulkabir34 Mar 24, 2026
03f3815
Update Shopify App React Router documentation
fazlulkabir34 Mar 24, 2026
ee12a94
Update tsconfig.json
fazlulkabir34 Mar 24, 2026
b3e4768
Merge pull request #2 from bevycommerce/feature/react-router-admin-auth
fazlulkabir34 Mar 24, 2026
1871614
Updated dist files
fazlulkabir34 Mar 24, 2026
3d69a35
Merge branch 'feature/react-router-admin-auth' of https://github.com/…
fazlulkabir34 Mar 24, 2026
c02fa23
Merge pull request #4 from bevycommerce/feature/react-router-admin-auth
fazlulkabir34 Mar 24, 2026
b1d7cf8
chore: update package-lock.json and tsconfig.json
fazlulkabir34 Mar 24, 2026
e86fae2
Merge pull request #6 from bevycommerce/feature/react-router-admin-auth
fazlulkabir34 Mar 24, 2026
8ca6f6e
chore: update package version to 1.3.1 and modify prepare script
fazlulkabir34 Mar 25, 2026
d726023
fix: update withMockBridgeAdminAuthForReactRouter to import web-api a…
fazlulkabir34 Mar 25, 2026
3d20587
chore: add assets directory to package.json and update withMockBridge…
fazlulkabir34 Mar 25, 2026
bef38ba
reverted to old prepare script
fazlulkabir34 Mar 25, 2026
4410639
feat: implement ResourcePicker component and integrate with mock bridge
fazlulkabir34 Mar 31, 2026
34523f4
mend
fazlulkabir34 Mar 31, 2026
60952a1
feat: add variants to ResourcePickerCatalogResponse and update relate…
fazlulkabir34 Mar 31, 2026
2f72277
refactor: streamline ResourcePicker and enhance error handling
fazlulkabir34 Apr 1, 2026
499faca
Merge pull request #8 from bevycommerce/feature/react-router-admin-auth
fazlulkabir34 Apr 1, 2026
702a56f
feat: enhance ResourcePicker with focus management and error handling…
fazlulkabir34 Apr 3, 2026
54fbf54
Merge pull request #10 from bevycommerce/feature/resource-picker
fazlulkabir34 Apr 6, 2026
af8c5f3
Merge upstream ctrlaltdylan/mock-bridge into fork main
fazlulkabir34 Aug 3, 2026
4e43b0d
docs: document the Node 20.19+/22.12+ build requirement from Vite 7
fazlulkabir34 Aug 3, 2026
8d13f35
fix: declare uuid in app-bridge's devDependencies
fazlulkabir34 Aug 3, 2026
3bb366f
Merge pull request #12 from bevycommerce/chore/sync-upstream
fazlulkabir34 Aug 3, 2026
159d9d6
Merge pull request #14 from bevycommerce/fix/app-bridge-uuid-dep
fazlulkabir34 Aug 3, 2026
6def45e
fix(app-bridge): hold a session token before the app asks for one
fazlulkabir34 Aug 3, 2026
1a484db
build: commit build output so yarn can install this package from git
fazlulkabir34 Aug 3, 2026
331b849
Merge pull request #16 from bevycommerce/feature/e2e-session-token-wa…
fazlulkabir34 Aug 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ yarn-error.log*
.pnpm-debug.log*

# Build outputs
dist/
build/
# dist/
# build/
*.tsbuildinfo

# Environment files
Expand Down
3 changes: 3 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
Shopify embedded app testing solution - test locally without real credentials.

## Quick Start
Requires Node.js `^20.19.0 || >=22.12.0` to build (Vite 7, used by admin-frame). The
published package itself runs on Node 18+, which is what `engines.node` declares.

- `npm install` - Install dependencies
- `npm run build` - Build TypeScript
- `npx ts-node src/cli/index.ts <app-url>` - Run dev server
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
| `shopify.environment` | ✅ Supported | `embedded`, `mobile`, `pos` |
| `shopify.user` | ✅ Supported | Returns mock user object |
| `shopify.scopes` | 🔶 Stub | Returns mock data |
| `shopify.resourcePicker` | 🔶 Stub | Returns empty array |
| `shopify.resourcePicker` | ✅ Mock UI | Opens a mock admin modal; catalog from [`/api/resource-picker-catalog`](docs/RESOURCE_PICKER.md) (customizable via `resourcePickerCatalog` on the server) |
| `shopify.picker` | 🔶 Stub | Returns empty selection |
| `shopify.scanner` | 🔶 Stub | Returns mock scan data |
| `shopify.pos` | 🔶 Stub | Cart API with mock data |
Expand All @@ -85,6 +85,10 @@

## 📦 Installation

> **Node.js requirements**
> - **Using the package:** Node.js **18+**. The published package ships prebuilt, so you never run the build toolchain.
> - **Building from source:** Node.js **^20.19.0 || >=22.12.0**, required by Vite 7 (the admin frame's bundler). This also applies when installing from a git ref, since `prepare` runs the full build. CI builds and publishes on Node 22.

```bash
npm install @getverdict/mock-bridge --save-dev
# or
Expand Down Expand Up @@ -307,6 +311,7 @@ export async function authenticate(token: string) {

#### Framework-Specific Examples

**Shopify App React Router** (`authenticate.admin(request)`): see the dedicated guide **[docs/SHOPIFY_APP_REACT_ROUTER.md](./docs/SHOPIFY_APP_REACT_ROUTER.md)**.
**Next.js API Routes:**

```typescript
Expand Down Expand Up @@ -565,6 +570,11 @@ const server = new MockShopifyAdminServer({
],
debug: true, // Enable debug logging

// Session token lifetime in seconds (default 60, matching real Shopify).
// Raise it for E2E runs — a test that outlives the token starts sending requests
// the app rejects, which looks like an unexplained mid-test redirect.
sessionTokenTtlSeconds: 3600,

// Admin API handling (see below)
adminApi: "mock",
});
Expand Down
5 changes: 4 additions & 1 deletion admin-frame/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ pnpm-debug.log*
lerna-debug.log*

node_modules
dist
# `dist` is committed on purpose. Consumers install this package straight from git, and yarn
# (unlike npm) does not run a git dependency's `prepare` script — so without the build output
# in the repo the mock admin UI is never built and the embedded iframe renders blank.
# dist
dist-ssr
*.local

Expand Down
1 change: 1 addition & 0 deletions admin-frame/dist/assets/index-CVLqddYM.css

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions admin-frame/dist/assets/index-CqrXvEdF.js

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions admin-frame/dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Mock Bridge</title>
<script src="https://cdn.shopify.com/shopifycloud/polaris.js"></script>
<script type="module" crossorigin src="/assets/index-CqrXvEdF.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-CVLqddYM.css">
</head>
<body>
<div id="root"></div>
</body>
</html>
1 change: 1 addition & 0 deletions admin-frame/dist/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions admin-frame/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions admin-frame/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"private": true,
"version": "0.0.0",
"type": "module",
"engines": {
"node": "^20.19.0 || >=22.12.0"
},
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
Expand Down
2 changes: 2 additions & 0 deletions admin-frame/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { EmbeddedApp } from "./components/EmbeddedApp"
import { Modal } from "./components/features/Modal"
import { Loading } from "./components/features/Loading"
import { SaveBar } from "./components/features/SaveBar"
import { ResourcePicker } from "./components/features/ResourcePicker"
import { Frame } from "./components/Frame"

function App() {
Expand All @@ -10,6 +11,7 @@ function App() {
<Loading />
<Modal />
<SaveBar />
<ResourcePicker />

<EmbeddedApp />
</Frame>
Expand Down
Loading