@zohofinance/commerce 1.0.1 → 1.1.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 CHANGED
@@ -4,8 +4,6 @@ A command-line tool for developing and building themes for Zoho Commerce stores.
4
4
 
5
5
  ## Installation
6
6
 
7
- Global installs (`npm i -g`) are not recommended. Prefer `npx` so you always run the package version resolved for the current project:
8
-
9
7
  ```bash
10
8
  # From a theme (or monorepo) that depends on the CLI:
11
9
  npx @zohofinance/commerce <command>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohofinance/commerce",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "main": "ts-dist/index.js",
5
5
  "bin": {
6
6
  "zcommerce": "ts-dist/index.js"
@@ -116,7 +116,7 @@ The skill runs these checks before Stage 0. If any fail, stop and surface to the
116
116
 
117
117
  1. **Ask developer for `storeUrl`.** Do not hardcode a demo store. Record in `dev-config.json`. See `dev-server-and-urls.md`.
118
118
  2. **Confirm page URLs before any browser navigation.** Home is often `/home` not `/`. Product/collection handles vary by store. Ask once; write confirmed URLs to `dev-config.json`.
119
- 3. **Dev server.** Ask developer to start it, or start it yourself: `yarn run dev --storeUrl=<confirmed>`. Notify developer either way.
119
+ 3. **Dev server.** Ask the developer to start the local theme preview, or start it yourself with `npx @zohofinance/commerce theme dev --storeUrl=<your store url>` (value from `dev-config.json`). Notify the developer either way. Without `--storeUrl`, preview uses mock data only.
120
120
  4. **`npx @zohofinance/commerce --version` works from inside the theme folder.** If not, run `npm install @zohofinance/commerce` in the theme directory.
121
121
  5. **Figma MCP authenticated.** Otherwise: ask user to open Figma desktop with the first frame selected.
122
122
  6. **Chrome DevTools MCP available** (`.cursor/mcp.json`). See `.cursor/skills/browser-verify.md`.
@@ -228,7 +228,7 @@ The pipeline is the right tool for: building a new theme from scratch with full
228
228
 
229
229
  It is the **wrong** tool for, and should not be used for:
230
230
  - **Bug fix in an existing theme** → just open the file and fix it. No skill needed.
231
- - **One-off section change** → edit the section directly, then `cd <theme> && yarn run dev` to verify visually. No skill needed.
231
+ - **One-off section change** → edit the section directly, then `cd <theme> && npx @zohofinance/commerce theme dev --storeUrl=<your store url>` to verify visually. No skill needed.
232
232
  - **Adding a theme setting** → edit `settings/schema.json` + `theme.json` directly.
233
233
  - **A new section that doesn't fit any of the 5 pages this skill handles** → also direct edit; the lint rules in `code-quality.md` still apply, but you don't need the orchestration.
234
234
 
@@ -22,7 +22,7 @@ When the answer IS in any of those three sources — look it up. Don't ask.
22
22
  - Product: `http://localhost:3000/products/item-1`
23
23
  - Collection: `http://localhost:3000/collections/all-products`
24
24
  Write confirmed URLs to `dev-config.json`.
25
- - **Dev server not running** → ask developer to start it, or start it yourself with their `storeUrl` and notify them.
25
+ - **Dev server not running** → ask developer to start it, or start it yourself with `npx @zohofinance/commerce theme dev --storeUrl=<your store url>` (their confirmed value) and notify them.
26
26
 
27
27
  ### Section identification (page orchestrator Phase 2)
28
28
 
@@ -11,14 +11,14 @@ URL paths vary by store and dev setup. **Never assume** `/` is home or `/collect
11
11
  Before starting or requesting the dev server, ask:
12
12
 
13
13
  > What is your **storeUrl** for local dev?
14
- > Example: `https://yourstore.zohocommerce.com`
14
+ > Example: `<your store url>`
15
15
 
16
16
  Record it in scratchpad:
17
17
 
18
18
  ```json
19
19
  // .claude/scratchpad/<theme>/dev-config.json
20
20
  {
21
- "store_url": "https://yourstore.zohocommerce.com",
21
+ "store_url": "<your store url>",
22
22
  "dev_server_port": 3000,
23
23
  "page_urls": {},
24
24
  "confirmed_by_developer": false
@@ -31,11 +31,15 @@ Do not hardcode a demo store URL unless the developer confirms it.
31
31
 
32
32
  ## Step 2 — Dev server (ask or start)
33
33
 
34
+ Pass the developer's store URL into `theme dev` via `--storeUrl`. Without it, the preview uses mock data only.
35
+
36
+ Use the value from Step 1 (`dev-config.json` → `store_url`) as `<your store url>`.
37
+
34
38
  **Option A — Developer starts it (preferred if already running):**
35
39
 
36
40
  ```bash
37
41
  cd <theme_name>
38
- yarn run dev --storeUrl=<store_url_from_developer>
42
+ npx @zohofinance/commerce theme dev --storeUrl=<your store url>
39
43
  ```
40
44
 
41
45
  Ask: *"Is the dev server already running on port 3000? If not, please start it with the command above (or tell me to start it)."*
@@ -43,9 +47,14 @@ Ask: *"Is the dev server already running on port 3000? If not, please start it w
43
47
  **Option B — Agent starts it:**
44
48
 
45
49
  1. Check: `lsof -i :3000`
46
- 2. If not running, start in background from theme folder with developer's `storeUrl`
50
+ 2. If not running, start in background from the theme folder:
51
+
52
+ ```bash
53
+ npx @zohofinance/commerce theme dev --storeUrl=<your store url>
54
+ ```
55
+
47
56
  3. Wait for "Preview theme in http://localhost:3000" (up to 30s)
48
- 4. Tell the developer: *"Dev server started with storeUrl …"*
57
+ 4. Tell the developer: *"Dev server started with your storeUrl."*
49
58
 
50
59
  If the server fails to start → stop and ask the developer to fix CLI/network issues. Do not proceed to visual verify.
51
60
 
@@ -10,7 +10,7 @@ Every question, blocker, or notification from a **page orchestrator** or **secti
10
10
  |---|---|
11
11
  | `needs-developer.md` written | Surface immediately in chat with section/page name |
12
12
  | `unresolved.md` with `blocking: true` | Batch into `AskUserQuestion` before continuing |
13
- | Dev server not running | Ask developer to start OR start with confirmed `storeUrl` |
13
+ | Dev server not running | Ask developer to start OR start with `npx @zohofinance/commerce theme dev --storeUrl=<your store url>` (confirmed `store_url`) |
14
14
  | Page URLs not confirmed | Pause build; run URL confirmation flow (`dev-server-and-urls.md`) |
15
15
  | Visual verify stuck after 3 iterations | Show CRITICAL items from `visual-diff.md` |
16
16
  | Subagent aborted / timed out | Report which page/section; parent takes over or re-spawns |
@@ -29,7 +29,7 @@ Also always run:
29
29
 
30
30
  ### 1. Preconditions
31
31
  - `dev-config.json` exists with `confirmed_by_developer: true` — see `dev-server-and-urls.md`
32
- - Dev server running with developer's `storeUrl` (ask them to start, or start and notify)
32
+ - Dev server running with developer's `storeUrl`: `npx @zohofinance/commerce theme dev --storeUrl=<your store url>` (ask them to start, or start and notify; value from `dev-config.json`)
33
33
  - Chrome DevTools MCP connected
34
34
  - Figma node ID in `figma-spec.json`
35
35
  - **Do not `navigate_page` until page URLs are confirmed with the developer**
@@ -30,9 +30,9 @@ lsof -i :3000 2>/dev/null || lsof -i :9292 2>/dev/null
30
30
  **If NOT running**, start it in background:
31
31
  ```bash
32
32
  cd <theme_name>
33
- yarn run dev --storeUrl=<store_url> &
33
+ npx @zohofinance/commerce theme dev --storeUrl=<your store url> &
34
34
  ```
35
- Wait for "compiled" or "ready" in output (up to 30 seconds).
35
+ Wait for "compiled" or "ready" in output (up to 30 seconds). Use `store_url` from the inputs / `dev-config.json` for `<your store url>`. Without `--storeUrl`, the preview uses mock data only.
36
36
 
37
37
  **If already running**, skip to Step 2.
38
38
 
@@ -292,7 +292,7 @@ NEXT STEPS:
292
292
  1. Review unresolved items above
293
293
  2. /compare-section <theme_name> <section> — only if unresolved items exist
294
294
  3. /qa-theme <theme_name> — full QA after any manual fixes
295
- 4. yarn run dev --storeUrl=<url> — preview in browser
295
+ 4. npx @zohofinance/commerce theme dev --storeUrl=<your store url> — preview in browser (live store data; omit `--storeUrl` for mock only)
296
296
  ```
297
297
 
298
298
  ---
@@ -36,7 +36,7 @@ ensuring consistency between what was built and what is verified.
36
36
  **Default mode (code compare):** Extracts values from code and Figma MCP data, compares numerically. Fast and precise for CSS/Tailwind property matching.
37
37
 
38
38
  **Visual mode (`--visual`):** Launches the `visual-compare` subagent (see `.cursor/agents/visual-compare.md`). This mode:
39
- 1. Ensures the dev server is running (`yarn run dev --storeUrl=<url>`)
39
+ 1. Ensures the dev server is running (`npx @zohofinance/commerce theme dev --storeUrl=<your store url>` — from `--store-url` / `dev-config.json`; without `--storeUrl`, preview uses mock data only)
40
40
  2. Uses Claude in Chrome to navigate to the page and screenshot the rendered section (desktop + mobile)
41
41
  3. Fetches the Figma screenshot via Figma MCP (`get_screenshot`)
42
42
  4. Visually compares both screenshots and reports differences
@@ -12,7 +12,7 @@ Single source of truth for browser automation during theme development.
12
12
 
13
13
  1. **Developer confirmed `storeUrl`** — recorded in `.claude/scratchpad/<theme>/dev-config.json`
14
14
  2. **Developer confirmed page URLs** — same file, `confirmed_by_developer: true`
15
- 3. Dev server running: `yarn run dev --storeUrl=<store_url>` (developer starts OR agent starts and notifies)
15
+ 3. Dev server running: `npx @zohofinance/commerce theme dev --storeUrl=<your store url>` (developer starts OR agent starts and notifies). Use `store_url` from `dev-config.json` for `<your store url>`. Without `--storeUrl`, the preview uses mock data only.
16
16
  4. Chrome DevTools MCP connected
17
17
  5. Figma node ID known for visual compare
18
18