@crossdelta/platform-sdk 0.7.5 → 0.7.7
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.
|
@@ -206,7 +206,8 @@ Bun.serve({ port, fetch: app.fetch })
|
|
|
206
206
|
- ✅ Use `handleEvent()` for each event type
|
|
207
207
|
- ❌ Usually NO REST endpoints (except /health)
|
|
208
208
|
|
|
209
|
-
|
|
209
|
+
**⚠️ CRITICAL: Event Consumer index.ts Template - COPY THIS EXACTLY:**
|
|
210
|
+
|
|
210
211
|
```ts
|
|
211
212
|
import '@crossdelta/telemetry'
|
|
212
213
|
|
|
@@ -234,12 +235,19 @@ consumeJetStreamEvents({
|
|
|
234
235
|
})
|
|
235
236
|
```
|
|
236
237
|
|
|
237
|
-
|
|
238
|
-
-
|
|
239
|
-
-
|
|
240
|
-
-
|
|
241
|
-
-
|
|
242
|
-
-
|
|
238
|
+
**⚠️ MANDATORY CHECKLIST - Event Consumer index.ts MUST INCLUDE:**
|
|
239
|
+
- [ ] `import { consumeJetStreamEvents, ensureJetStreamStream } from '@crossdelta/cloudevents'`
|
|
240
|
+
- [ ] `await ensureJetStreamStream({ stream: 'ORDERS', subjects: ['orders.>'] })`
|
|
241
|
+
- [ ] `consumeJetStreamEvents({ stream: 'ORDERS', consumer: 'service-name', discover: './src/events/**/*.event.ts' })`
|
|
242
|
+
- [ ] Top-level await (Bun supports this natively)
|
|
243
|
+
- [ ] `ensureJetStreamStream()` called BEFORE `consumeJetStreamEvents()`
|
|
244
|
+
|
|
245
|
+
**CRITICAL ERRORS TO AVOID:**
|
|
246
|
+
- ❌ Missing `ensureJetStreamStream()` → Stream won't exist, events won't be consumed
|
|
247
|
+
- ❌ Missing `consumeJetStreamEvents()` → Service won't listen to events
|
|
248
|
+
- ❌ Wrong import order → Telemetry must be first
|
|
249
|
+
- ❌ Using `filterSubjects` in `ensureJetStreamStream()` → Use `subjects` parameter
|
|
250
|
+
- ❌ Using `subjects` in `consumeJetStreamEvents()` → Use `filterSubjects` parameter if needed
|
|
243
251
|
|
|
244
252
|
### � HTTP CloudEvent Receiver (Receives CloudEvents via HTTP POST)
|
|
245
253
|
|
|
@@ -54,3 +54,18 @@ Always generate **minimal diffs**, never full rewrites.
|
|
|
54
54
|
- Use relative paths.
|
|
55
55
|
- Keep comments minimal.
|
|
56
56
|
- Do not generate abstractions not already present.
|
|
57
|
+
|
|
58
|
+
## Service-Specific Guidelines
|
|
59
|
+
|
|
60
|
+
When working with specific service types or packages, refer to these detailed guidelines:
|
|
61
|
+
|
|
62
|
+
### Service Generation & Architecture
|
|
63
|
+
- [Service Architecture Guidelines](../docs/generators/services/architecture-guidelines.md) - General patterns for all services
|
|
64
|
+
- [Hono Microservice Guidelines](../docs/generators/services/hono-micro-guidelines.md) - Event-driven Hono patterns
|
|
65
|
+
|
|
66
|
+
### Key Packages
|
|
67
|
+
- [@crossdelta/cloudevents](../packages/cloudevents/README.md) - Event handling with NATS and CloudEvents
|
|
68
|
+
- [@crossdelta/telemetry](../packages/telemetry/README.md) - OpenTelemetry instrumentation
|
|
69
|
+
- [@crossdelta/infrastructure](../packages/infrastructure/README.md) - Pulumi/K8s configuration
|
|
70
|
+
|
|
71
|
+
**When generating services**: Always check the appropriate guidelines above to ensure correct patterns, especially for event-driven architectures.
|
|
@@ -1,8 +1 @@
|
|
|
1
1
|
// Export your event contracts and schemas here
|
|
2
|
-
// Example:
|
|
3
|
-
// export * from './events/order-created.schema'
|
|
4
|
-
// export * from './events/order-created.contract'
|
|
5
|
-
|
|
6
|
-
export * from './events/order-created'
|
|
7
|
-
export * from './events/user-updated'
|
|
8
|
-
export * from './events/order'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crossdelta/platform-sdk",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.7",
|
|
4
4
|
"description": "Your AI-powered platform engineer. Scaffold complete Turborepo workspaces, generate microservice boilerplate with natural language, and deploy to the cloud — all from one CLI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|