@spree/docs 0.1.30 → 0.1.32
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.
|
@@ -13,12 +13,18 @@ Spree is a big monorepo. For a faster clone, use a **partial clone** which downl
|
|
|
13
13
|
git clone --filter=blob:none https://github.com/spree/spree.git
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
+
## Prerequisites
|
|
17
|
+
|
|
18
|
+
You need **Node.js 20+** to run the workspace scripts (including `pnpm server:setup`, which both backend and TypeScript contributors use). Install it via [nvm](https://github.com/nvm-sh/nvm), [mise](https://mise.jdx.dev), [fnm](https://github.com/Schniz/fnm), or your package manager (`brew install node` on macOS).
|
|
19
|
+
|
|
20
|
+
`pnpm` is provisioned automatically via [Corepack](https://nodejs.org/api/corepack.html) (bundled with Node) — the repository pins its version in `package.json`, and the first `pnpm` command will fetch the matching release. If Corepack is disabled in your environment, run `corepack enable` once.
|
|
21
|
+
|
|
16
22
|
## Spree codebase
|
|
17
23
|
|
|
18
24
|
Spree is a monorepo with three main areas:
|
|
19
25
|
|
|
20
26
|
- **`spree/`** — Ruby gems (core, api, admin, emails) distributed as separate packages via RubyGems
|
|
21
|
-
- **`packages/`** — TypeScript packages (
|
|
27
|
+
- **`packages/`** — TypeScript packages (SDKs, CLI, project scaffolding, docs)
|
|
22
28
|
- **`server/`** — A Rails application cloned from [spree-starter](https://github.com/spree/spree-starter) that mounts the Spree gems (not checked in — run `pnpm server:setup` to create it)
|
|
23
29
|
|
|
24
30
|
## Backend Development (Ruby)
|
|
@@ -42,15 +48,7 @@ All Spree models, controllers and other Ruby classes are namespaced by the `Spre
|
|
|
42
48
|
|
|
43
49
|
The server app is not checked into the monorepo. It's cloned from [spree-starter](https://github.com/spree/spree-starter) on first setup, with `SPREE_PATH=..` automatically configured so it uses your local Spree gems.
|
|
44
50
|
|
|
45
|
-
**Step 1:
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
docker compose up -d # starts Postgres, Redis, Meilisearch
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Or install PostgreSQL and Redis locally if you prefer.
|
|
52
|
-
|
|
53
|
-
**Step 2: Clone the server app**
|
|
51
|
+
**Step 1: Clone the server app**
|
|
54
52
|
|
|
55
53
|
```bash
|
|
56
54
|
pnpm server:setup
|
|
@@ -58,19 +56,34 @@ pnpm server:setup
|
|
|
58
56
|
|
|
59
57
|
This clones [spree-starter](https://github.com/spree/spree-starter) into `server/` and sets `SPREE_PATH=..` in `server/.env` so it uses your local Spree gems.
|
|
60
58
|
|
|
61
|
-
**Step
|
|
59
|
+
**Step 2: Configure and run**
|
|
62
60
|
|
|
63
61
|
```bash
|
|
64
62
|
cd server
|
|
65
63
|
# Edit .env if needed (e.g. DATABASE_USERNAME, DATABASE_HOST, DATABASE_PORT)
|
|
66
|
-
bin/setup # installs Ruby (via mise),
|
|
64
|
+
bin/setup # installs Ruby (via mise), Postgres/Redis/Meilisearch (via brew), gems, prepares database
|
|
67
65
|
bin/dev # starts Rails + Sidekiq + CSS watchers via overmind
|
|
68
66
|
```
|
|
69
67
|
|
|
68
|
+
`bin/setup` installs system services natively (PostgreSQL, Redis, Meilisearch) via `brew bundle` on macOS or `apt-get` on Linux. If you'd rather run those services in Docker, start them from the repo root before running `bin/setup`:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
docker compose up -d postgres redis meilisearch
|
|
72
|
+
```
|
|
73
|
+
|
|
70
74
|
Use `bin/setup --reset` to drop and recreate the database.
|
|
71
75
|
|
|
72
76
|
The app runs at [http://localhost:3000](http://localhost:3000). Admin Panel is at [http://localhost:3000/admin](http://localhost:3000/admin).
|
|
73
77
|
|
|
78
|
+
**Step 3 (optional): Load sample data**
|
|
79
|
+
|
|
80
|
+
To populate your store with sample products, customers, orders, and configuration:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
pnpm server:load_sample_data # from repo root
|
|
84
|
+
# or, from server/: bin/rails spree:load_sample_data
|
|
85
|
+
```
|
|
86
|
+
|
|
74
87
|
### Running engine tests
|
|
75
88
|
|
|
76
89
|
Each engine has its own test suite. First install the shared dependencies at the `spree/` level, then navigate into the specific engine to set up and run its tests:
|
|
@@ -180,7 +193,12 @@ pnpm dev
|
|
|
180
193
|
|
|
181
194
|
| Package | Path | Description |
|
|
182
195
|
|---|---|---|
|
|
183
|
-
| `@spree/sdk` | `packages/sdk` | TypeScript SDK for the Spree
|
|
196
|
+
| `@spree/sdk` | `packages/sdk` | TypeScript SDK for the Spree Store API |
|
|
197
|
+
| `@spree/cli` | `packages/cli` | CLI for managing Spree Commerce projects |
|
|
198
|
+
| `create-spree-app` | `packages/create-spree-app` | Project scaffolding (`npm create spree-app`) |
|
|
199
|
+
| `@spree/docs` | `packages/docs` | Developer documentation for AI agents and local reference |
|
|
200
|
+
|
|
201
|
+
Internal packages (`@spree/admin-sdk`, `@spree/sdk-core`) are also part of the workspace but are not published to npm.
|
|
184
202
|
|
|
185
203
|
### Common commands
|
|
186
204
|
|
|
@@ -189,7 +207,7 @@ Run from the repository root — [Turborepo](https://turbo.build/) orchestrates
|
|
|
189
207
|
| Command | Description |
|
|
190
208
|
|---|---|
|
|
191
209
|
| `pnpm dev` | Start Docker backend + watch mode for all packages |
|
|
192
|
-
| `pnpm build` | Build all packages (
|
|
210
|
+
| `pnpm build` | Build all packages (Turbo resolves dependency order) |
|
|
193
211
|
| `pnpm test` | Run tests in all packages |
|
|
194
212
|
| `pnpm lint` | Lint all packages |
|
|
195
213
|
| `pnpm typecheck` | Type-check all packages |
|
|
@@ -226,9 +244,10 @@ pnpm --filter @spree/sdk generate:zod
|
|
|
226
244
|
|
|
227
245
|
### Releasing packages
|
|
228
246
|
|
|
229
|
-
|
|
247
|
+
Published packages use [Changesets](https://github.com/changesets/changesets) for version management. Each package owns its own `.changeset/` folder, so changesets must be created from inside the package directory:
|
|
230
248
|
|
|
231
249
|
```bash
|
|
250
|
+
cd packages/sdk # or packages/cli, packages/create-spree-app
|
|
232
251
|
pnpm changeset
|
|
233
252
|
```
|
|
234
253
|
|
|
@@ -238,7 +257,7 @@ This creates a changeset file describing your changes. Commit it with your PR. W
|
|
|
238
257
|
|
|
239
258
|
Consistent code style is enforced via automated linters. Please make sure your changes pass linting before submitting a PR.
|
|
240
259
|
|
|
241
|
-
**Ruby:** We use [RuboCop](https://rubocop.org/) for Ruby code.
|
|
260
|
+
**Ruby:** We use [RuboCop](https://rubocop.org/) for Ruby code. The configuration lives in `server/.rubocop.yml` and is shipped with [spree-starter](https://github.com/spree/spree-starter), so it's only available after running `pnpm server:setup`. Run it from the `server/` directory:
|
|
242
261
|
|
|
243
262
|
```bash
|
|
244
263
|
cd server
|
|
@@ -276,20 +295,6 @@ A few tips:
|
|
|
276
295
|
- Keep the first line under 72 characters
|
|
277
296
|
- If your change references a GitHub issue, include `Fixes #<number>` in the commit message or PR description to auto-close it on merge
|
|
278
297
|
|
|
279
|
-
### Using AI tools for development
|
|
280
|
-
|
|
281
|
-
Spree comes with an [AGENTS.md](https://github.com/spree/spree/blob/main/AGENTS.md) file that instructs coding agents like Claude Code or Codex to help you with your development.
|
|
282
|
-
|
|
283
|
-
We also have an MCP server built on top of our Documentation website to help you with your development.
|
|
284
|
-
|
|
285
|
-
Add this URL to your AI tools:
|
|
286
|
-
|
|
287
|
-
```
|
|
288
|
-
https://spreecommerce.org/docs/mcp
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
In Claude Code you need to go to [Connectors](https://claude.ai/settings/connectors) settings and add the URL.
|
|
292
|
-
|
|
293
298
|
## Submitting Changes
|
|
294
299
|
|
|
295
300
|
We use [GitHub Actions](https://github.com/spree/spree/actions) to run CI.
|
|
@@ -314,7 +319,7 @@ To help us review your PR quickly:
|
|
|
314
319
|
- **Describe your changes.** Explain what you changed and why. Include screenshots for UI changes.
|
|
315
320
|
- **Add tests.** All new features and bug fixes should include appropriate test coverage.
|
|
316
321
|
- **Update documentation.** If your change affects user-facing behavior, update the relevant docs.
|
|
317
|
-
- **Include a changeset**
|
|
322
|
+
- **Include a changeset** if your change affects a published TypeScript package (`@spree/sdk`, `@spree/cli`, or `create-spree-app`). Run `pnpm changeset` from inside that package's directory — each package owns its own `.changeset/` folder.
|
|
318
323
|
- **Ensure CI passes.** PRs with failing CI will not be reviewed.
|
|
319
324
|
|
|
320
325
|
## Reporting Bugs
|
|
@@ -329,8 +334,24 @@ When reporting a bug, please include:
|
|
|
329
334
|
- **Relevant logs or stack traces** (formatted with triple backticks)
|
|
330
335
|
- **Your environment** (Ruby version, database, OS)
|
|
331
336
|
|
|
337
|
+
We have an [issue template](https://github.com/spree/spree/blob/main/.github/ISSUE_TEMPLATE.md) that will guide you through this.
|
|
338
|
+
|
|
332
339
|
Issues that are open for 14 days without actionable information or activity will be marked as stale and then closed. They can be re-opened if the requested information is provided.
|
|
333
340
|
|
|
341
|
+
## Using AI Tools for Development
|
|
342
|
+
|
|
343
|
+
Spree comes with an [AGENTS.md](https://github.com/spree/spree/blob/main/AGENTS.md) file that instructs coding agents like Claude Code or Codex to help you with your development.
|
|
344
|
+
|
|
345
|
+
We also have an MCP server built on top of our Documentation website to help you with your development.
|
|
346
|
+
|
|
347
|
+
Add this URL to your AI tools:
|
|
348
|
+
|
|
349
|
+
```
|
|
350
|
+
https://spreecommerce.org/docs/mcp
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
In Claude Code you need to go to [Connectors](https://claude.ai/settings/connectors) settings and add the URL.
|
|
354
|
+
|
|
334
355
|
## That's a wrap!
|
|
335
356
|
|
|
336
357
|
Thank you for participating in Open Source and improving Spree - you're awesome!
|