@crossdelta/platform-sdk 0.5.6 → 0.5.8
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 +70 -51
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
12
|
<strong>Your AI-powered platform engineer.</strong><br />
|
|
13
|
-
Scaffold complete Turborepo workspaces, generate
|
|
13
|
+
Scaffold complete <a href="https://turbo.build/repo">Turborepo</a> workspaces, generate microservice boilerplate<br />
|
|
14
14
|
with natural language, and deploy to the cloud — all from one CLI.
|
|
15
15
|
</p>
|
|
16
16
|
|
|
@@ -29,25 +29,56 @@
|
|
|
29
29
|
<br />
|
|
30
30
|
|
|
31
31
|
---
|
|
32
|
+
## 🚀 Quick Start
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
```bash
|
|
35
|
+
# Create workspace
|
|
36
|
+
bunx @crossdelta/platform-sdk new workspace my-platform -y
|
|
37
|
+
cd my-platform
|
|
38
|
+
|
|
39
|
+
# Generate service with AI
|
|
40
|
+
# (first time: you'll be prompted to configure an AI provider)
|
|
41
|
+
bunx @crossdelta/platform-sdk new hono-micro services/orders --ai \
|
|
42
|
+
-d "Handle order creation and payment processing"
|
|
43
|
+
|
|
44
|
+
# Start all services
|
|
45
|
+
bun dev
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**In under a minute you have a running, event-driven microservice platform with infra parity between local and production.**
|
|
49
|
+
|
|
50
|
+
You get: [Turborepo](https://turbo.build/repo) monorepo + [NATS](https://nats.io) + event-driven microservices + [Pulumi](https://www.pulumi.com) infra + auto-generated `.env.local` + **AI-generated services** — all wired automatically.
|
|
34
51
|
|
|
35
|
-
|
|
52
|
+
<details>
|
|
53
|
+
<summary><strong>💡 Prefer shorter commands? Install globally (Bun/npm/yarn/pnpm)</strong></summary>
|
|
36
54
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
- **Environment hell** — `.env` files manually maintained, ports collide, services don't talk
|
|
41
|
-
- **Slow onboarding** — new developers spend days setting up the platform
|
|
55
|
+
```bash
|
|
56
|
+
# With Bun (recommended)
|
|
57
|
+
bun add -g @crossdelta/platform-sdk
|
|
42
58
|
|
|
43
|
-
|
|
59
|
+
# With npm/yarn/pnpm
|
|
60
|
+
npm install -g @crossdelta/platform-sdk
|
|
44
61
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
62
|
+
# Then use short commands
|
|
63
|
+
pf new workspace my-platform
|
|
64
|
+
pf new hono-micro services/orders --ai -d "..."
|
|
65
|
+
```
|
|
49
66
|
|
|
50
|
-
|
|
67
|
+
</details>
|
|
68
|
+
|
|
69
|
+
<br />
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 🎯 Why This Exists
|
|
74
|
+
|
|
75
|
+
Platform engineering problems `pf` solves:
|
|
76
|
+
|
|
77
|
+
- **Infrastructure drift** — Infra configs live in separate repos, diverge from code
|
|
78
|
+
- **Manual wiring** — Ports, env vars, service discovery configured by hand
|
|
79
|
+
- **Slow onboarding** — New devs spend days setting up local environment
|
|
80
|
+
|
|
81
|
+
**`pf` is lockstep infra + code:** Services auto-generate `infra/services/*.ts`, ports/env derived automatically, event handlers type-safe and auto-discovered.
|
|
51
82
|
|
|
52
83
|
<br />
|
|
53
84
|
|
|
@@ -58,18 +89,24 @@ Built for teams using **Turborepo + Pulumi + NATS + Bun**.
|
|
|
58
89
|
### ✅ `pf` is:
|
|
59
90
|
|
|
60
91
|
- **Opinionated CLI** for event-driven microservice platforms
|
|
61
|
-
- **Turborepo scaffolder** with Pulumi IaC and NATS messaging built-in
|
|
92
|
+
- **[Turborepo](https://turbo.build/repo) scaffolder** with [Pulumi](https://www.pulumi.com) IaC and [NATS](https://nats.io) messaging built-in
|
|
62
93
|
- **AI-assisted code generator** that creates service boilerplate from descriptions
|
|
63
94
|
- **Unified dev workflow** — one command to run all services (`bun dev`)
|
|
64
|
-
- **DigitalOcean-first** deployment target (App Platform + DOKS)
|
|
95
|
+
- **[DigitalOcean](https://www.digitalocean.com)-first** deployment target (App Platform + DOKS)
|
|
65
96
|
|
|
66
97
|
### ❌ `pf` is not:
|
|
67
98
|
|
|
68
99
|
- **Generic microservice generator** — makes architectural choices for you
|
|
69
|
-
- **
|
|
100
|
+
- **Multi-cloud** (not yet) — DigitalOcean first, extensible provider architecture
|
|
70
101
|
- **Runtime manager** — scaffolds code, you deploy with Pulumi
|
|
71
102
|
- **Kubernetes replacement** — generates K8s configs via Pulumi
|
|
72
103
|
|
|
104
|
+
### 🔥 Why `pf` vs other tools?
|
|
105
|
+
|
|
106
|
+
- **🔗 Lockstep infra + code** — `infra/services/*.ts` auto-generated from service metadata, ports/env derived automatically
|
|
107
|
+
- **⚡ Event-driven by default** — [NATS](https://nats.io) + JetStream built-in with auto-discovered handlers (`*.event.ts`) and Zod-validated payloads
|
|
108
|
+
- **🤖 Automation through conventions** — New service = infra config + env vars + port assignment happens automatically
|
|
109
|
+
|
|
73
110
|
<br />
|
|
74
111
|
|
|
75
112
|
---
|
|
@@ -140,39 +177,20 @@ These principles guide every decision in `pf`:
|
|
|
140
177
|
- **🌊 DigitalOcean-first, cloud-agnostic later** — Start simple with DO, expand to AWS/GCP when needed
|
|
141
178
|
- **🤖 AI-augmented development** — Use AI to generate complete services, not just snippets
|
|
142
179
|
- **📏 Convention over configuration** — Strong opinions enable automation
|
|
180
|
+
|
|
143
181
|
<br />
|
|
144
182
|
|
|
145
183
|
---
|
|
146
184
|
|
|
147
|
-
##
|
|
185
|
+
## 👥 Who Is This For?
|
|
148
186
|
|
|
149
|
-
|
|
187
|
+
`pf` is designed for **small to mid-sized teams building event-driven systems** who want strong conventions, infra parity, and fast onboarding — without maintaining their own internal platform.
|
|
150
188
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
```bash
|
|
154
|
-
# Recommended: Use with bunx (no installation, fast)
|
|
155
|
-
bunx @crossdelta/platform-sdk new workspace my-platform
|
|
156
|
-
|
|
157
|
-
# Alternative: Install globally
|
|
158
|
-
npm install -g @crossdelta/platform-sdk
|
|
159
|
-
pf new workspace my-platform
|
|
160
|
-
|
|
161
|
-
# With bun (fastest)
|
|
162
|
-
bun add -g @crossdelta/platform-sdk
|
|
163
|
-
pf new workspace my-platform
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
**Options:**
|
|
189
|
+
---
|
|
167
190
|
|
|
168
|
-
|
|
169
|
-
|------|-------------|
|
|
170
|
-
| `-y, --yes` | Skip prompts |
|
|
171
|
-
| `-o, --github-owner <owner>` | GitHub org/user for GHCR registry |
|
|
172
|
-
| `-s, --pulumi-stack <name>` | Pulumi stack base name |
|
|
173
|
-
| `--no-github` | Skip GitHub Actions workflows |
|
|
191
|
+
## 📘 Workflows
|
|
174
192
|
|
|
175
|
-
###
|
|
193
|
+
### Generate microservices
|
|
176
194
|
|
|
177
195
|
**Manual scaffolding:**
|
|
178
196
|
```bash
|
|
@@ -196,7 +214,9 @@ pf new hono-micro services/payments --ai \
|
|
|
196
214
|
- ✅ Test files with validation logic
|
|
197
215
|
- ✅ Complete README documentation
|
|
198
216
|
|
|
199
|
-
|
|
217
|
+
> **Note:** AI-generated code is a starting point. Always review and test before deploying to production. `pf` never deploys or provisions infrastructure automatically — deployment always happens explicitly via Pulumi.
|
|
218
|
+
|
|
219
|
+
### Start local development
|
|
200
220
|
|
|
201
221
|
```bash
|
|
202
222
|
cd my-platform
|
|
@@ -521,7 +541,6 @@ export default handleEvent(
|
|
|
521
541
|
| `pf new` | Interactive creation wizard |
|
|
522
542
|
| `pf new workspace <name>` | Scaffold a complete platform monorepo |
|
|
523
543
|
| `pf setup --ai` | Configure AI provider (OpenAI or Anthropic) |
|
|
524
|
-
| `pf dev` | Start development mode with auto-reload |
|
|
525
544
|
|
|
526
545
|
### Service Commands
|
|
527
546
|
|
|
@@ -605,9 +624,9 @@ Configure these secrets in your repository settings (`Settings` → `Secrets and
|
|
|
605
624
|
| `GHCR_TOKEN` | GitHub Container Registry PAT | Docker image publishing |
|
|
606
625
|
|
|
607
626
|
**Get tokens:**
|
|
608
|
-
- **Pulumi:** https://app.pulumi.com/account/tokens
|
|
609
|
-
- **DigitalOcean:** https://cloud.digitalocean.com/account/api/tokens
|
|
610
|
-
- **npm:** https://www.npmjs.com/settings/~/tokens
|
|
627
|
+
- **Pulumi:** [Create access token](https://app.pulumi.com/account/tokens)
|
|
628
|
+
- **DigitalOcean:** [Generate API token](https://cloud.digitalocean.com/account/api/tokens)
|
|
629
|
+
- **npm:** [Create access token](https://www.npmjs.com/settings/~/tokens)
|
|
611
630
|
|
|
612
631
|
<br />
|
|
613
632
|
|
|
@@ -615,10 +634,10 @@ Configure these secrets in your repository settings (`Settings` → `Secrets and
|
|
|
615
634
|
|
|
616
635
|
## 📚 Requirements
|
|
617
636
|
|
|
618
|
-
-
|
|
619
|
-
-
|
|
620
|
-
- Pulumi CLI
|
|
621
|
-
- Docker
|
|
637
|
+
- **[Bun](https://bun.sh)** (latest) — recommended for best performance
|
|
638
|
+
- **Node.js** ≥ 21 — supported as fallback (npm/yarn/pnpm)
|
|
639
|
+
- **[Pulumi CLI](https://www.pulumi.com/docs/install/)** — for infrastructure deployment
|
|
640
|
+
- **[Docker](https://www.docker.com/)** — required for local NATS. Without Docker, you can still scaffold/build
|
|
622
641
|
|
|
623
642
|
|
|
624
643
|
---
|