@crossdelta/platform-sdk 0.21.7 → 0.21.9

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
@@ -9,13 +9,10 @@
9
9
  </p>
10
10
 
11
11
  <p align="center">
12
- <code>pf</code> scaffolds real-world platforms: backend services, event-driven messaging, infrastructure all wired together and kept in sync. <strong>AI-assisted.</strong>
12
+ <code>pf</code> scaffolds real-world platforms: backend services, event-driven messaging, infrastructure. All wired together and kept in sync. <strong>AI-assisted.</strong>
13
13
  </p>
14
14
 
15
- <p align="center">
16
- <sub>Frontend SDK coming soon — contract-based client models.</sub>
17
15
 
18
- </p>
19
16
 
20
17
  <br />
21
18
 
@@ -29,55 +26,15 @@
29
26
  <img src="https://img.shields.io/badge/License-MIT-22c55e?style=for-the-badge" alt="MIT License" />
30
27
  </p>
31
28
 
32
- <p align="center">
33
- <img src="https://img.shields.io/badge/Hono-E36002?style=flat-square&logo=hono&logoColor=white" alt="Hono" />
34
- <img src="https://img.shields.io/badge/NestJS-E0234E?style=flat-square&logo=nestjs&logoColor=white" alt="NestJS" />
35
- <img src="https://img.shields.io/badge/NATS-27AAE1?style=flat-square&logo=natsdotio&logoColor=white" alt="NATS" />
36
- <img src="https://img.shields.io/badge/Pulumi-8A3391?style=flat-square&logo=pulumi&logoColor=white" alt="Pulumi" />
37
- <img src="https://img.shields.io/badge/Turborepo-EF4444?style=flat-square&logo=turborepo&logoColor=white" alt="Turborepo" />
38
- <img src="https://img.shields.io/badge/DigitalOcean-0080FF?style=flat-square&logo=digitalocean&logoColor=white" alt="DigitalOcean" />
39
- </p>
40
-
41
- <br />
42
-
43
29
  <p align="center">
44
30
  <a href="#-quick-start">Quick Start</a> •
45
31
  <a href="#-5-minute-tutorial">Tutorial</a> •
46
32
  <a href="#-commands">Commands</a> •
47
- <a href="#-ai-assisted-generation">AI Generation</a> •
48
33
  <a href="#-deployment">Deployment</a>
49
34
  </p>
50
35
 
51
36
  ---
52
37
 
53
- <br />
54
-
55
- ## 👋 Who is this for?
56
-
57
- <table>
58
- <tr>
59
- <td width="60">🏗️</td>
60
- <td><strong>Teams building full-stack platforms</strong> — services, events, apps that actually work together</td>
61
- </tr>
62
- <tr>
63
- <td>📡</td>
64
- <td><strong>Event-driven architectures</strong> — or teams ready to start using events</td>
65
- </tr>
66
- <tr>
67
- <td>😤</td>
68
- <td><strong>Engineers tired of drift</strong> — ports, env vars, and infra configs that never match</td>
69
- </tr>
70
- <tr>
71
- <td>🚀</td>
72
- <td><strong>Startups & platform teams</strong> — who want consistency without building everything from scratch</td>
73
- </tr>
74
- </table>
75
-
76
- > **You can start without understanding all the pieces.**
77
- > The depth reveals itself as you grow.
78
-
79
- ---
80
-
81
38
  ## 🚀 Quick Start
82
39
 
83
40
  ```bash
@@ -137,7 +94,7 @@ pf cloudevents add order.created --service services/notifications
137
94
  # 3. Restart to pick up new services
138
95
  pf dev
139
96
 
140
- # 4. Publish a test event watch notifications react
97
+ # 4. Publish a test event, watch notifications react
141
98
  pf cloudevents publish order.created
142
99
  ```
143
100
 
@@ -159,34 +116,7 @@ pf cloudevents publish order.created
159
116
 
160
117
  ---
161
118
 
162
- ## 💡 What problem does pf solve?
163
-
164
- <table>
165
- <tr>
166
- <th width="300">❌ The Problem</th>
167
- <th width="300">✅ With pf</th>
168
- </tr>
169
- <tr>
170
- <td>Application code lives here, infra config lives somewhere else</td>
171
- <td>Both generated from the same source of truth</td>
172
- </tr>
173
- <tr>
174
- <td>Ports, env vars, and event wiring drift over time</td>
175
- <td>Change a service → infra stays in sync</td>
176
- </tr>
177
- <tr>
178
- <td>New devs spend days setting up local environments</td>
179
- <td>Run <code>pf dev</code> → everything starts together</td>
180
- </tr>
181
- <tr>
182
- <td>Manual event subscriptions and handler registration</td>
183
- <td>Add an event → consumers are wired automatically</td>
184
- </tr>
185
- </table>
186
-
187
- ---
188
-
189
- ## 📋 Commands
119
+ ## Commands
190
120
 
191
121
  | Command | What it does |
192
122
  |:--------|:-------------|
@@ -203,48 +133,7 @@ pf cloudevents publish order.created
203
133
  | `pf lint` | ✨ Lint and format with Biome |
204
134
  | `pf audit` | 🔒 Run security audit on dependencies |
205
135
 
206
- > `pf` proxies all commands to Turborepo (works from any subdirectory).
207
-
208
- #### Custom Command Descriptions
209
-
210
- Add descriptions to your workspace commands for better autocompletion:
211
-
212
- ```json
213
- {
214
- "pf": {
215
- "commands": {
216
- "deploy": {
217
- "command": "cd infra && pulumi up",
218
- "description": "Deploy infrastructure to production"
219
- }
220
- }
221
- }
222
- }
223
- ```
224
-
225
- Then `pf <TAB>` shows: `deploy -- Deploy infrastructure to production`
226
-
227
- #### Plugins
228
-
229
- Extend `pf` with additional commands via plugins. Plugins are loaded from workspace `package.json`:
230
-
231
- ```json
232
- {
233
- "pf": {
234
- "plugins": ["@crossdelta/cloudevents"]
235
- }
236
- }
237
- ```
238
-
239
- **Built-in plugins:**
240
- - `@crossdelta/cloudevents` - Event contracts, handlers, and NATS publishing (auto-enabled in new workspaces)
241
-
242
- **Plugin commands are namespaced:**
243
- ```bash
244
- pf cloudevents add order.created --service services/orders
245
- pf cloudevents list
246
- pf cloudevents publish order.created
247
- ```
136
+ > `pf` proxies all commands to Turborepo (works from any subdirectory). Extend via [custom commands and plugins](https://www.npmjs.com/package/@crossdelta/platform-sdk#configuration).
248
137
 
249
138
  ---
250
139
 
@@ -259,7 +148,7 @@ pf new hono-micro services/notifications --ai \
259
148
  -d "Send emails when orders are created"
260
149
  ```
261
150
 
262
- The AI generates **production-ready code** that follows your platform's conventions:
151
+ The AI generates **convention-following code** tailored to your platform:
263
152
 
264
153
  <table>
265
154
  <tr>
@@ -280,30 +169,34 @@ The AI generates **production-ready code** that follows your platform's conventi
280
169
  </tr>
281
170
  <tr>
282
171
  <td>✅</td>
283
- <td><strong>Type-safe</strong> no <code>any</code>, proper imports, strict TypeScript</td>
172
+ <td><strong>Type-safe:</strong> no <code>any</code>, proper imports, strict TypeScript</td>
284
173
  </tr>
285
174
  <tr>
286
175
  <td>✅</td>
287
- <td><strong>Lint-compliant</strong> passes Biome formatting out of the box</td>
176
+ <td><strong>Lint-compliant:</strong> passes Biome formatting out of the box</td>
288
177
  </tr>
289
178
  </table>
290
179
 
291
180
  **What makes it different:**
292
181
  - Uses your **existing contracts** when wiring events between services
293
182
  - Follows **framework-specific patterns** (Hono use-cases vs. NestJS Services)
294
- - Generates **only the code you need** no bloat, no unused abstractions
295
- - **Hot-reload friendly** `pf dev` automatically restarts when AI finishes
183
+ - Generates **only the code you need**, no bloat, no unused abstractions
184
+ - **Hot-reload friendly:** `pf dev` automatically restarts when AI finishes
296
185
 
297
- Works with OpenAI (GPT-4o) and Anthropic (Claude 3.5 Sonnet).
186
+ Works with OpenAI and Anthropic.
298
187
 
299
188
  ---
300
189
 
301
190
  ## 🚢 Deployment
302
191
 
303
192
  ```bash
304
- pf pulumi up --stack dev
193
+ pf pulumi up # deploys the current Pulumi stack
305
194
  ```
306
195
 
196
+ Each workspace ships with one Pulumi stack and pre-configured GitHub Actions. Add more stacks (e.g. `stage`, `production`) as your platform grows. `pf` and `generate-env` work with any stack name.
197
+
198
+ `pf dev` generates `.env.local` from the current stack's Pulumi config (secrets, API keys) and discovered service ports.
199
+
307
200
  **Pre-configured GitHub Actions included:**
308
201
 
309
202
  | Trigger | Action |
@@ -321,13 +214,12 @@ pf pulumi up --stack dev
321
214
  |:-------|:------------|
322
215
  | `PULUMI_ACCESS_TOKEN` | [Pulumi Cloud token](https://app.pulumi.com/account/tokens) |
323
216
  | `DIGITALOCEAN_TOKEN` | [DO API token](https://cloud.digitalocean.com/account/api/tokens) |
324
- | `GHCR_TOKEN` | GitHub Container Registry PAT |
325
217
 
326
218
  </details>
327
219
 
328
220
  ---
329
221
 
330
- ## 📋 Requirements
222
+ ## ⚙️ Requirements
331
223
 
332
224
  | Requirement | Notes |
333
225
  |:------------|:------|
@@ -495,43 +387,12 @@ Every workspace includes pre-configured NATS with JetStream for development:
495
387
  - Streams materialized from contracts with retention policies
496
388
  - Persistent storage (file-based) with explicit limits
497
389
 
498
- > **Services never create streams** in dev: `pf dev` auto-creates from contracts, in prod: Pulumi materializes.
499
-
500
- See `infra/dev/README.md` for Dev-Infra vs Platform-Infra separation.
390
+ > **Services never create streams.** In dev, `pf dev` auto-creates from contracts. In prod, Pulumi materializes.
501
391
 
502
392
  </details>
503
393
 
504
394
  ---
505
395
 
506
- ## 🧭 Philosophy
507
-
508
- <table>
509
- <tr>
510
- <td width="50%">
511
-
512
- ### ✅ What pf is
513
-
514
- - Opinionated full-stack platform toolkit
515
- - Unified dev workflow — one command to run everything
516
- - Infrastructure that stays in sync with your code
517
-
518
- </td>
519
- <td width="50%">
520
-
521
- ### ❌ What pf is not
522
-
523
- - Generic scaffolder — it makes choices for you
524
- - Multi-cloud out of the box — DigitalOcean first, extensible later
525
- - Magic — no hidden daemons, you control when things run
526
-
527
- </td>
528
- </tr>
529
- </table>
530
-
531
- > **`pf` makes architectural decisions so your team doesn't have to — without hiding how things work.**
532
-
533
- ---
534
-
535
396
  ## License
536
397
 
537
398
  MIT © [crossdelta](https://crossdelta.de)