@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.
- package/README.md +2 -1
- package/dist/index.js +466 -317
- package/dist/templates/dashboard-starter/AGENTS.md +17 -3
- package/dist/templates/dashboard-starter/CLAUDE.md +1 -0
- package/dist/templates/dashboard-starter/package.json +15 -12
- package/dist/templates/dashboard-starter/src/routeTree.gen.ts +173 -38
- package/dist/templates/seller-dashboard-starter/AGENTS.md +32 -14
- package/dist/templates/seller-dashboard-starter/CLAUDE.md +1 -0
- package/dist/templates/seller-dashboard-starter/package.json +16 -12
- package/dist/templates/seller-dashboard-starter/src/plugins.ts +9 -8
- package/package.json +14 -13
|
@@ -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
|
|
48
|
-
|
|
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.
|
|
20
|
-
"@spree/dashboard": "^1.0.0-rc.
|
|
21
|
-
"@spree/dashboard-core": "^1.0.0-rc.
|
|
22
|
-
"@spree/dashboard-ui": "^1.0.0-rc.
|
|
23
|
-
"@tanstack/react-query": "^5.
|
|
24
|
-
"@tanstack/react-router": "^1.
|
|
25
|
-
"
|
|
26
|
-
"react
|
|
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.
|
|
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": "~
|
|
35
|
-
"vite": "^8.
|
|
36
|
-
"vitest": "^
|
|
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
|
}
|