@tailor-platform/erp-kit 0.1.1 → 0.1.2
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/CHANGELOG.md +6 -0
- package/README.md +77 -50
- package/dist/cli.js +691 -571
- package/package.json +1 -1
- package/schemas/module/command.yml +1 -0
- package/schemas/module/model.yml +9 -0
- package/schemas/module/query.yml +53 -0
- package/src/cli.ts +6 -88
- package/src/commands/app/index.ts +74 -0
- package/src/commands/check.test.ts +2 -1
- package/src/commands/check.ts +1 -0
- package/src/commands/module/index.ts +85 -0
- package/src/commands/module/list.test.ts +62 -0
- package/src/commands/module/list.ts +64 -0
- package/src/commands/scaffold.test.ts +5 -0
- package/src/commands/scaffold.ts +2 -1
- package/src/commands/sync-check.test.ts +28 -0
- package/src/commands/sync-check.ts +6 -0
- package/src/integration.test.ts +6 -8
- package/src/module.ts +4 -3
- package/src/modules/primitives/docs/models/Currency.md +4 -0
- package/src/modules/primitives/docs/models/ExchangeRate.md +4 -1
- package/src/modules/primitives/docs/models/Unit.md +4 -1
- package/src/modules/primitives/docs/models/UoMCategory.md +2 -0
- package/src/modules/primitives/index.ts +2 -2
- package/src/modules/primitives/module.ts +5 -3
- package/src/modules/primitives/permissions.ts +0 -2
- package/src/modules/primitives/{command → query}/convertAmount.test.ts +2 -19
- package/src/modules/primitives/query/convertAmount.ts +122 -0
- package/src/modules/primitives/{command → query}/convertQuantity.test.ts +2 -13
- package/src/modules/primitives/{command → query}/convertQuantity.ts +4 -6
- package/src/modules/shared/defineQuery.test.ts +28 -0
- package/src/modules/shared/defineQuery.ts +16 -0
- package/src/modules/shared/internal.ts +2 -1
- package/src/modules/shared/types.ts +8 -0
- package/src/modules/user-management/docs/models/AuditEvent.md +2 -0
- package/src/modules/user-management/docs/models/Permission.md +2 -0
- package/src/modules/user-management/docs/models/Role.md +2 -0
- package/src/modules/user-management/docs/models/RolePermission.md +2 -0
- package/src/modules/user-management/docs/models/User.md +2 -0
- package/src/modules/user-management/docs/models/UserRole.md +2 -0
- package/src/schemas.ts +1 -0
- package/src/modules/primitives/command/convertAmount.ts +0 -126
- /package/src/modules/primitives/docs/{commands → queries}/ConvertAmount.md +0 -0
- /package/src/modules/primitives/docs/{commands → queries}/ConvertQuantity.md +0 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -11,18 +11,23 @@ npm install @tailor-platform/erp-kit
|
|
|
11
11
|
## Quick Start
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
# Set up your repo (agent skills
|
|
14
|
+
# Set up your repo (agent skills)
|
|
15
15
|
erp-kit init
|
|
16
16
|
|
|
17
|
-
#
|
|
18
|
-
erp-kit
|
|
19
|
-
|
|
17
|
+
# List available modules
|
|
18
|
+
erp-kit module list
|
|
19
|
+
|
|
20
|
+
# Validate module docs against schemas
|
|
21
|
+
erp-kit module check --root src/modules
|
|
20
22
|
|
|
21
23
|
# Check source ↔ doc correspondence
|
|
22
|
-
erp-kit sync-check --
|
|
24
|
+
erp-kit module sync-check --root src/modules
|
|
25
|
+
|
|
26
|
+
# Generate a new module doc from template
|
|
27
|
+
erp-kit module scaffold command inventory createOrder --root src/modules
|
|
23
28
|
|
|
24
|
-
#
|
|
25
|
-
erp-kit
|
|
29
|
+
# Validate app docs
|
|
30
|
+
erp-kit app check --root examples
|
|
26
31
|
|
|
27
32
|
# Start mock API servers
|
|
28
33
|
erp-kit mock start
|
|
@@ -33,47 +38,76 @@ erp-kit mock validate
|
|
|
33
38
|
|
|
34
39
|
## Commands
|
|
35
40
|
|
|
36
|
-
### `
|
|
41
|
+
### `module`
|
|
42
|
+
|
|
43
|
+
Module documentation management.
|
|
44
|
+
|
|
45
|
+
#### `module list`
|
|
37
46
|
|
|
38
|
-
|
|
47
|
+
Lists all available modules with command, model, and feature counts.
|
|
39
48
|
|
|
40
49
|
```bash
|
|
41
|
-
erp-kit
|
|
42
|
-
erp-kit check --app-root examples
|
|
43
|
-
erp-kit check --modules-root modules --app-root examples
|
|
50
|
+
erp-kit module list
|
|
44
51
|
```
|
|
45
52
|
|
|
46
|
-
|
|
53
|
+
#### `module check`
|
|
47
54
|
|
|
48
|
-
|
|
55
|
+
Validates module markdown documentation against YAML schemas.
|
|
49
56
|
|
|
50
57
|
```bash
|
|
51
|
-
erp-kit
|
|
52
|
-
erp-kit sync-check --app-root examples
|
|
58
|
+
erp-kit module check --root src/modules
|
|
53
59
|
```
|
|
54
60
|
|
|
55
|
-
|
|
61
|
+
#### `module sync-check`
|
|
62
|
+
|
|
63
|
+
Ensures every source file has a corresponding doc and vice versa.
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
erp-kit module sync-check --root src/modules
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
#### `module scaffold`
|
|
56
70
|
|
|
57
71
|
Generates documentation files from schema templates.
|
|
58
72
|
|
|
59
|
-
|
|
73
|
+
```bash
|
|
74
|
+
erp-kit module scaffold module inventory --root src/modules
|
|
75
|
+
erp-kit module scaffold feature inventory stock-tracking --root src/modules
|
|
76
|
+
erp-kit module scaffold command inventory createOrder --root src/modules
|
|
77
|
+
erp-kit module scaffold model inventory StockItem --root src/modules
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### `app`
|
|
81
|
+
|
|
82
|
+
App-compose documentation management.
|
|
83
|
+
|
|
84
|
+
#### `app check`
|
|
85
|
+
|
|
86
|
+
Validates app documentation against YAML schemas.
|
|
60
87
|
|
|
61
88
|
```bash
|
|
62
|
-
erp-kit
|
|
63
|
-
erp-kit scaffold --modules-root modules feature inventory stock-tracking
|
|
64
|
-
erp-kit scaffold --modules-root modules command inventory CreateOrder
|
|
65
|
-
erp-kit scaffold --modules-root modules model inventory StockItem
|
|
89
|
+
erp-kit app check --root examples
|
|
66
90
|
```
|
|
67
91
|
|
|
68
|
-
|
|
92
|
+
#### `app sync-check`
|
|
93
|
+
|
|
94
|
+
Ensures every source file has a corresponding doc and vice versa.
|
|
69
95
|
|
|
70
96
|
```bash
|
|
71
|
-
erp-kit
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
97
|
+
erp-kit app sync-check --root examples
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
#### `app scaffold`
|
|
101
|
+
|
|
102
|
+
Generates documentation files from schema templates.
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
erp-kit app scaffold requirements my-app --root examples
|
|
106
|
+
erp-kit app scaffold actors my-app admin --root examples
|
|
107
|
+
erp-kit app scaffold business-flow my-app onboarding --root examples
|
|
108
|
+
erp-kit app scaffold story my-app onboarding/admin--create-user --root examples
|
|
109
|
+
erp-kit app scaffold screen my-app supplier-list --root examples
|
|
110
|
+
erp-kit app scaffold resolver my-app create-supplier --root examples
|
|
77
111
|
```
|
|
78
112
|
|
|
79
113
|
### `mock start`
|
|
@@ -124,32 +158,31 @@ One-time setup for consumer repos. Idempotent — skips files that already exist
|
|
|
124
158
|
|
|
125
159
|
```bash
|
|
126
160
|
erp-kit init
|
|
161
|
+
|
|
162
|
+
# Overwrite existing skills
|
|
163
|
+
erp-kit init --force
|
|
127
164
|
```
|
|
128
165
|
|
|
129
166
|
This will:
|
|
130
167
|
|
|
131
168
|
1. Copy 12 agent skills to `.agents/skills/`
|
|
132
|
-
2.
|
|
169
|
+
2. Create symlink `.claude/skills` → `.agents/skills/`
|
|
133
170
|
|
|
134
171
|
## Options
|
|
135
172
|
|
|
136
|
-
| Flag
|
|
137
|
-
|
|
|
138
|
-
| `--
|
|
139
|
-
| `--
|
|
140
|
-
| `--
|
|
141
|
-
| `-
|
|
142
|
-
|
|
143
|
-
At least one of `--modules-root` or `--app-root` is required for `check`, `sync-check`, and `scaffold`.
|
|
173
|
+
| Flag | Alias | Applies to | Description |
|
|
174
|
+
| --------------------- | ----- | ------------------------------------------- | -------------------------------------------- |
|
|
175
|
+
| `--root <path>` | `-r` | `module check/sync-check/scaffold`, `app *` | Path to modules or app-compose directory |
|
|
176
|
+
| `--mocks-root <path>` | | `mock start`, `mock validate` | Path to mocks directory (default: `./mocks`) |
|
|
177
|
+
| `--port <number>` | `-p` | `mock start` | Reverse proxy port (default: `3000`) |
|
|
178
|
+
| `--force` | `-f` | `init` | Overwrite existing files (default: `false`) |
|
|
144
179
|
|
|
145
180
|
## What's Bundled
|
|
146
181
|
|
|
147
|
-
| Directory
|
|
148
|
-
|
|
|
149
|
-
| `schemas/`
|
|
150
|
-
| `
|
|
151
|
-
| `skills/` | 12 agent skills for documentation, implementation, and mocking |
|
|
152
|
-
| `rules/` | Development rules and best practices for modules and app-compose |
|
|
182
|
+
| Directory | Contents |
|
|
183
|
+
| ---------- | -------------------------------------------------------------- |
|
|
184
|
+
| `schemas/` | YAML schema definitions for all doc types |
|
|
185
|
+
| `skills/` | 12 agent skills for documentation, implementation, and mocking |
|
|
153
186
|
|
|
154
187
|
### Schemas
|
|
155
188
|
|
|
@@ -180,12 +213,6 @@ Mock workflow:
|
|
|
180
213
|
|
|
181
214
|
1. `mock-scenario` — Scaffold a new Mockoon mock scenario with CRUD routes and error scenarios
|
|
182
215
|
|
|
183
|
-
### Development Rules
|
|
184
|
-
|
|
185
|
-
- `module-development/` — Structure, commands, models, executors, testing, exports, errors
|
|
186
|
-
- `app-compose/` — App structure, frontend screens, components, auth patterns
|
|
187
|
-
- `sdk-best-practices/` — Database relations, SDK documentation references
|
|
188
|
-
|
|
189
216
|
## Programmatic Mock Server
|
|
190
217
|
|
|
191
218
|
The `createMockServer` helper starts a Mockoon server from a `mock.json` file, useful for integration tests:
|