@crossdelta/platform-sdk 0.18.3 → 0.18.4
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 +40 -0
- package/bin/cli.js +158 -149
- package/bin/docs/generators/service.md +9 -0
- package/bin/templates/workspace/infra/package.json.hbs +1 -1
- package/bin/templates/workspace/packages/contracts/README.md.hbs +2 -2
- package/bin/templates/workspace/packages/contracts/package.json.hbs +1 -1
- package/package.json +1 -1
|
@@ -494,11 +494,20 @@ packages/contracts/src/events/
|
|
|
494
494
|
| `customer.created` | `CustomerCreatedSchema` | `CustomerCreatedData` | `customer-created.handler.ts` | `CustomersCreatedContract` | `customers/` | `CUSTOMERS` |
|
|
495
495
|
| `order.created` | `OrderCreatedSchema` | `OrderCreatedData` | `order-created.handler.ts` | `OrdersCreatedContract` | `orders/` | `ORDERS` |
|
|
496
496
|
| `domain.created` | `DomainCreatedSchema` | `DomainCreatedData` | `domain-created.handler.ts` | `DomainsCreatedContract` | `domains/` | `DOMAINS` |
|
|
497
|
+
| `max.updated` | `MaxUpdatedSchema` | `MaxUpdatedData` | `max-updated.handler.ts` | `MaxesUpdatedContract` | `maxes/` | `MAXES` |
|
|
498
|
+
|
|
499
|
+
**🚨 CRITICAL: Pluralization Rules (MUST follow English grammar)**
|
|
500
|
+
```
|
|
501
|
+
word ending in consonant + y → ies (policy → policies)
|
|
502
|
+
word ending in s, sh, ch, x → es (max → maxes, batch → batches)
|
|
503
|
+
all other words → s (order → orders)
|
|
504
|
+
```
|
|
497
505
|
|
|
498
506
|
**Naming Patterns:**
|
|
499
507
|
- Schema/Type: `{SingularDomain}{Action}Schema/Data` - describes one object
|
|
500
508
|
- Handler: `{singular-domain}-{action}.handler.ts` - matches event type in kebab-case
|
|
501
509
|
- Contract: `{PluralDomain}{Action}Contract` - matches folder and stream names
|
|
510
|
+
- **Folder: ALWAYS PLURAL** - `max.updated` → `maxes/updated.ts` (NOT `max/`)
|
|
502
511
|
|
|
503
512
|
```typescript
|
|
504
513
|
// ✅ CORRECT
|
|
@@ -13,10 +13,10 @@ src/
|
|
|
13
13
|
├── events/ # Event contracts grouped by domain
|
|
14
14
|
│ ├── orders/ # Orders domain
|
|
15
15
|
│ │ ├── created.ts # order.created event
|
|
16
|
-
│ │ ├── updated.ts #
|
|
16
|
+
│ │ ├── updated.ts # order.updated event
|
|
17
17
|
│ │ └── index.ts # Re-exports
|
|
18
18
|
│ ├── customers/ # Customers domain
|
|
19
|
-
│ │ ├── updated.ts #
|
|
19
|
+
│ │ ├── updated.ts # customer.updated event
|
|
20
20
|
│ │ └── index.ts # Re-exports
|
|
21
21
|
│ └── index.ts # Re-exports all domains
|
|
22
22
|
├── stream-policies.ts # NATS JetStream retention policies
|