@shopify/shop-minis-react 0.17.0 → 0.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,6 +12,9 @@
12
12
  "useBuyerAttributes": [
13
13
  "GET_BUYER_ATTRIBUTES"
14
14
  ],
15
+ "useCheckPermissions": [
16
+ "CHECK_PERMISSION"
17
+ ],
15
18
  "useCloseMini": [
16
19
  "CLOSE_MINI"
17
20
  ],
package/package.json CHANGED
@@ -1,12 +1,30 @@
1
1
  {
2
2
  "name": "@shopify/shop-minis-react",
3
3
  "license": "SEE LICENSE IN LICENSE.txt",
4
- "version": "0.17.0",
4
+ "version": "0.17.2",
5
5
  "sideEffects": false,
6
6
  "type": "module",
7
7
  "engines": {
8
8
  "node": ">=20"
9
9
  },
10
+ "scripts": {
11
+ "dev": "vite ./demo",
12
+ "build": "vite build --mode lib",
13
+ "build:watch": "vite build --mode lib --watch",
14
+ "type-check": "tsc --noEmit",
15
+ "clean": "rm -rf dist",
16
+ "prepublishOnly": "pnpm run clean && pnpm run build && node ./scripts/update-platform-version.cjs",
17
+ "lint": "eslint . --format codeframe --cache",
18
+ "lint:fix": "eslint . --format codeframe --cache --fix",
19
+ "test": "vitest",
20
+ "test:ci": "vitest run --reporter=verbose",
21
+ "test:ci:coverage": "vitest run --coverage --reporter=verbose",
22
+ "test:ui": "vitest --ui",
23
+ "test:coverage": "vitest --coverage",
24
+ "test:integration": "npx playwright test --config=playwright.integration.config.ts",
25
+ "test:integration:local": "./scripts/test-integration-local.sh",
26
+ "playwright:install": "npx playwright install"
27
+ },
10
28
  "publishConfig": {
11
29
  "access": "public",
12
30
  "@shopify:registry": "https://registry.npmjs.org/"
@@ -45,7 +63,7 @@
45
63
  "typescript": ">=5.0.0"
46
64
  },
47
65
  "dependencies": {
48
- "@shopify/shop-minis-platform": "0.15.0",
66
+ "@shopify/shop-minis-platform": "0.15.1",
49
67
  "@tailwindcss/vite": "4.1.8",
50
68
  "@tanstack/react-query": "5.86.0",
51
69
  "@types/lodash": "4.17.20",
@@ -119,22 +137,5 @@
119
137
  "type": "git",
120
138
  "url": "https://github.com/Shopify/shop-client.git",
121
139
  "directory": "packages/minis/shop-minis-react"
122
- },
123
- "scripts": {
124
- "dev": "vite ./demo",
125
- "build": "vite build --mode lib",
126
- "build:watch": "vite build --mode lib --watch",
127
- "type-check": "tsc --noEmit",
128
- "clean": "rm -rf dist",
129
- "lint": "eslint . --format codeframe --cache",
130
- "lint:fix": "eslint . --format codeframe --cache --fix",
131
- "test": "vitest",
132
- "test:ci": "vitest run --reporter=verbose",
133
- "test:ci:coverage": "vitest run --coverage --reporter=verbose",
134
- "test:ui": "vitest --ui",
135
- "test:coverage": "vitest --coverage",
136
- "test:integration": "npx playwright test --config=playwright.integration.config.ts",
137
- "test:integration:local": "./scripts/test-integration-local.sh",
138
- "playwright:install": "npx playwright install"
139
140
  }
140
- }
141
+ }
package/src/mocks.ts CHANGED
@@ -617,5 +617,11 @@ export const injectMocks = ({force}: {force?: boolean} = {}) => {
617
617
  initialUrl: '/',
618
618
  platform: 'web',
619
619
  }
620
+ // Mock minisEvents so NavigationManager and event hooks work in dev
621
+ let listenerId = 0
622
+ window.minisEvents = {
623
+ on: () => ++listenerId,
624
+ off: () => {},
625
+ }
620
626
  }
621
627
  }
package/src/test-setup.ts CHANGED
@@ -43,6 +43,16 @@ global.ResizeObserver = vi.fn().mockImplementation(() => ({
43
43
  disconnect: vi.fn(),
44
44
  }))
45
45
 
46
+ // Mock window.minisEvents (used by NavigationManager)
47
+ let _testListenerId = 0
48
+ Object.defineProperty(window, 'minisEvents', {
49
+ writable: true,
50
+ value: {
51
+ on: () => ++_testListenerId,
52
+ off: () => {},
53
+ },
54
+ })
55
+
46
56
  // Set default window size for virtuoso calculations
47
57
  Object.defineProperty(window, 'innerHeight', {
48
58
  writable: true,