@open-mercato/onboarding 0.6.7-develop.6685.1.77c0a5591b → 0.6.7-develop.6686.1.bdda5ed397

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.
Files changed (2) hide show
  1. package/AGENTS.md +8 -5
  2. package/package.json +3 -3
package/AGENTS.md CHANGED
@@ -33,16 +33,17 @@ yarn workspace @open-mercato/onboarding build
33
33
  - Steps are ordered — a step MUST NOT be accessible until its predecessor is complete
34
34
  - Step validation logic lives in `lib/` — keep API handlers thin
35
35
  - Frontend components in `frontend/` render each step's UI
36
+ - Existing `api/get/**` and `api/post/**` files are legacy compatibility routes. Treat `api/<step>/get|post/route.ts` as legacy too; never copy either HTTP-method-directory layout into new work.
36
37
 
37
38
  ## Adding a New Onboarding Step
38
39
 
39
40
  1. Create step logic in `lib/<step-name>.ts` with validation and save functions
40
- 2. Add GET endpoint in `api/<step-name>/get/route.ts` to fetch current state
41
- 3. Add POST endpoint in `api/<step-name>/post/route.ts` to save and advance
42
- 4. Create frontend component in `frontend/<step-name>/page.tsx`
41
+ 2. Create `api/<step-name>/route.ts` and export sibling `GET` and `POST` handlers from that file
42
+ 3. Declare per-method route metadata beside those handlers; use the exact public/authenticated access contract required by the step
43
+ 4. Create the frontend page under `frontend/<step-name>/page.tsx`
43
44
  5. Add translations to `i18n/<locale>.json`
44
45
  6. Register the step in the wizard step ordering configuration
45
- 7. Run `yarn generate`
46
+ 7. Run `yarn generate` and verify both methods resolve at the intended route
46
47
 
47
48
  ## Module Setup Integration
48
49
 
@@ -60,7 +61,9 @@ See `packages/core/AGENTS.md` → Module Setup for the full `setup.ts` contract.
60
61
 
61
62
  ```
62
63
  packages/onboarding/src/modules/onboarding/
63
- ├── api/ # Wizard step endpoints (GET/POST per step)
64
+ ├── api/ # New work: <step>/route.ts with sibling GET/POST handlers
65
+ │ ├── get/ # Legacy compatibility routes; do not copy
66
+ │ └── post/ # Legacy compatibility routes; do not copy
64
67
  ├── data/ # ORM entities for onboarding state
65
68
  ├── emails/ # Email templates (welcome, invitations)
66
69
  ├── frontend/ # Wizard UI components
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-mercato/onboarding",
3
- "version": "0.6.7-develop.6685.1.77c0a5591b",
3
+ "version": "0.6.7-develop.6686.1.bdda5ed397",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -70,10 +70,10 @@
70
70
  }
71
71
  },
72
72
  "peerDependencies": {
73
- "@open-mercato/shared": "0.6.7-develop.6685.1.77c0a5591b"
73
+ "@open-mercato/shared": "0.6.7-develop.6686.1.bdda5ed397"
74
74
  },
75
75
  "devDependencies": {
76
- "@open-mercato/shared": "0.6.7-develop.6685.1.77c0a5591b",
76
+ "@open-mercato/shared": "0.6.7-develop.6686.1.bdda5ed397",
77
77
  "@types/jest": "^30.0.0",
78
78
  "jest": "^30.4.2",
79
79
  "ts-jest": "^29.4.11",