@spree/cli 3.2.2 → 3.4.0

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.
@@ -1,11 +1,20 @@
1
1
  # Agent Instructions
2
2
 
3
+ `CLAUDE.md` only imports this file — edit this one.
4
+
3
5
  This is the Spree admin dashboard for this project — a Vite + React app. The
4
6
  shell (routes, chrome, resource pages) ships in `@spree/dashboard`; this
5
7
  project holds your customizations.
6
8
 
7
9
  Full docs: https://spreecommerce.org/docs/developer/dashboard/overview
8
10
 
11
+ ## Running it
12
+
13
+ `spree dev`, run from the project root (`../..`), starts this app's dev server
14
+ together with the Spree API — don't start a second copy with `pnpm dev`. The
15
+ Spree API itself is only ever run through the Spree CLI; see the project
16
+ root's `AGENTS.md`.
17
+
9
18
  ## Imports
10
19
 
11
20
  Import from `@spree/dashboard` — it re-exports the framework and the design
@@ -44,8 +53,10 @@ of what exists, not an implementation.
44
53
  - **Wrap API calls in a hook.** Components never call `adminClient` directly.
45
54
  - **Query keys are store-scoped.** Build them with `useResourceKey`; a bare
46
55
  `['brands']` key leaks one store's data into another after a store switch.
47
- - **Writes go through `useResourceMutation`**, which maps 422 responses onto
48
- form fields instead of firing a toast.
56
+ - **Writes go through `useResourceMutation`.** It shows a toast for network
57
+ and server failures but not for 422 validation errors — catch those in the
58
+ form's submit handler with `mapSpreeErrorsToForm`, which puts each message on
59
+ its field.
49
60
  - **Every visible string goes through i18next** — page titles, column labels,
50
61
  buttons, empty states, toasts. Never hardcode English in JSX or in a table
51
62
  definition. Add each new key to every locale file the project ships.
@@ -55,12 +66,15 @@ of what exists, not an implementation.
55
66
  walks every nested key and the SDK's object graph overflows the TypeScript
56
67
  compiler.
57
68
  - **A sortable or filterable column must be allowlisted for Ransack** on the
58
- model, or the request fails at runtime.
69
+ model, or the request fails at runtime. That change belongs to the Spree API
70
+ in `../../server/` — follow `../../server/AGENTS.md`.
59
71
  - **Destructive actions that fire straight from a click need a confirm** —
60
72
  `useConfirm()` with `variant: 'destructive'`.
61
73
 
62
74
  ## Checks
63
75
 
76
+ Run these with the project's package manager (`pnpm`, `npm run` or `yarn`):
77
+
64
78
  ```bash
65
79
  pnpm typecheck
66
80
  pnpm lint
@@ -0,0 +1 @@
1
+ @AGENTS.md
@@ -16,24 +16,27 @@
16
16
  "lint:fix": "biome check --fix ."
17
17
  },
18
18
  "dependencies": {
19
- "@spree/admin-sdk": "^1.0.0-rc.1",
20
- "@spree/dashboard": "^1.0.0-rc.2",
21
- "@spree/dashboard-core": "^1.0.0-rc.2",
22
- "@spree/dashboard-ui": "^1.0.0-rc.2",
23
- "@tanstack/react-query": "^5.100.9",
24
- "@tanstack/react-router": "^1.169.2",
25
- "react": "^19.2.6",
26
- "react-dom": "^19.2.6"
19
+ "@spree/admin-sdk": "^1.0.0-rc.4",
20
+ "@spree/dashboard": "^1.0.0-rc.4",
21
+ "@spree/dashboard-core": "^1.0.0-rc.4",
22
+ "@spree/dashboard-ui": "^1.0.0-rc.4",
23
+ "@tanstack/react-query": "^5.104.3",
24
+ "@tanstack/react-router": "^1.170.44",
25
+ "i18next": "^26.4.7",
26
+ "react": "^19.3.1",
27
+ "react-dom": "^19.3.1",
28
+ "react-hook-form": "^7.90.0",
29
+ "react-i18next": "^17.0.20"
27
30
  },
28
31
  "devDependencies": {
29
32
  "@biomejs/biome": "^2.4.14",
30
- "@playwright/test": "^1.59.1",
33
+ "@playwright/test": "^1.64.1",
31
34
  "@types/react": "^19.2.14",
32
35
  "@types/react-dom": "^19.2.3",
33
36
  "@vitejs/plugin-react": "^6.0.1",
34
- "typescript": "~6.0.3",
35
- "vite": "^8.0.16",
36
- "vitest": "^4.1.5"
37
+ "typescript": "~7.0.2",
38
+ "vite": "^8.3.4",
39
+ "vitest": "^5.0.5"
37
40
  },
38
41
  "packageManager": "pnpm@11.13.1"
39
42
  }