@crossdelta/platform-sdk 0.3.19 → 0.3.21
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 +49 -162
- package/bin/cli.js +142 -141
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
|
-
<strong>
|
|
12
|
+
<strong>Your AI-powered platform engineer.</strong><br />
|
|
13
|
+
Scaffold complete Turborepo workspaces, generate production-ready microservices<br />
|
|
14
|
+
with natural language, and deploy to the cloud — all from one CLI.
|
|
13
15
|
</p>
|
|
14
16
|
|
|
15
17
|
<p align="center">
|
|
@@ -19,11 +21,13 @@
|
|
|
19
21
|
<img src="https://img.shields.io/badge/DigitalOcean-App_Platform_|_DOKS-0080FF?style=flat-square" alt="DigitalOcean" />
|
|
20
22
|
</p>
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 👤 Who is this for?
|
|
27
|
+
|
|
28
|
+
- You run **multiple microservices** and want a unified developer experience
|
|
29
|
+
- You prefer **monorepos + Infrastructure-as-Code** as your architectural baseline
|
|
30
|
+
- You're okay with **DigitalOcean as the initial cloud provider** (AWS/GCP coming soon)
|
|
27
31
|
|
|
28
32
|
---
|
|
29
33
|
|
|
@@ -31,7 +35,7 @@
|
|
|
31
35
|
> - **App Platform** — Managed PaaS for simple deployments
|
|
32
36
|
> - **DOKS (Kubernetes)** — Full Kubernetes control for production workloads
|
|
33
37
|
>
|
|
34
|
-
> AWS and GCP support is planned for future releases.
|
|
38
|
+
> **AWS and GCP support** is planned for future releases.
|
|
35
39
|
|
|
36
40
|
---
|
|
37
41
|
|
|
@@ -43,11 +47,11 @@
|
|
|
43
47
|
| 🤖 **AI-Powered Generation** | Generate services with AI using `--ai` flag (OpenAI/Anthropic) |
|
|
44
48
|
| 🥟 **Bun-first DX** | Ultra-fast dev workflow with fallback to npm/yarn/pnpm |
|
|
45
49
|
| 🏗️ **Turborepo Monorepo** | Parallel builds, caching, and unified dev scripts |
|
|
46
|
-
| 🔧 **Service Generators** |
|
|
47
|
-
| 📦 **Pulumi-Ready Infra** | Infrastructure-as-Code for DigitalOcean
|
|
50
|
+
| 🔧 **Service Generators** | Hono (lightweight) and NestJS (enterprise-grade) templates |
|
|
51
|
+
| 📦 **Pulumi-Ready Infra** | Infrastructure-as-Code for DigitalOcean |
|
|
48
52
|
| 🚀 **GitHub Actions CI/CD** | Pre-configured workflows for build, test, deploy, and npm publish |
|
|
49
53
|
| 🌍 **Auto `.env.local`** | Environment variables derived from `infra/services/*.ts` |
|
|
50
|
-
| 🔌 **Auto Port Assignment** | Unique ports per service
|
|
54
|
+
| 🔌 **Auto Port Assignment** | Unique ports per service |
|
|
51
55
|
| 🔁 **Smart Watch Mode** | Watches infra & services, regenerates env, reinstalls deps |
|
|
52
56
|
|
|
53
57
|
---
|
|
@@ -57,69 +61,38 @@
|
|
|
57
61
|
### 1. Create a new workspace
|
|
58
62
|
|
|
59
63
|
```bash
|
|
60
|
-
# Install globally (recommended)
|
|
61
64
|
npm install -g @crossdelta/platform-sdk
|
|
62
65
|
pf new workspace my-platform
|
|
63
66
|
|
|
64
|
-
# Or
|
|
67
|
+
# Or with bunx:
|
|
65
68
|
bunx @crossdelta/platform-sdk pf new workspace my-platform
|
|
66
69
|
```
|
|
67
70
|
|
|
68
|
-
**With options:**
|
|
69
|
-
```bash
|
|
70
|
-
pf new workspace my-platform -y # Skip prompts
|
|
71
|
-
pf new workspace my-platform -o my-github-org # Set GitHub owner
|
|
72
|
-
pf new workspace my-platform --no-github # Without CI/CD
|
|
73
|
-
```
|
|
74
|
-
|
|
75
71
|
**Options:**
|
|
76
72
|
|
|
77
73
|
| Flag | Description |
|
|
78
74
|
|------|-------------|
|
|
79
|
-
| `-y, --yes` | Skip prompts
|
|
75
|
+
| `-y, --yes` | Skip prompts |
|
|
80
76
|
| `-o, --github-owner <owner>` | GitHub org/user for GHCR registry |
|
|
81
|
-
| `-s, --pulumi-stack <name>` | Pulumi stack base name
|
|
77
|
+
| `-s, --pulumi-stack <name>` | Pulumi stack base name |
|
|
82
78
|
| `--no-github` | Skip GitHub Actions workflows |
|
|
83
79
|
|
|
84
|
-
> 💡 **Two ways to use the CLI:**
|
|
85
|
-
> - **Global install** (recommended): `npm install -g @crossdelta/platform-sdk` → use `pf` command
|
|
86
|
-
> - **Bunx** (no install): `bunx @crossdelta/platform-sdk pf <command>`
|
|
87
|
-
|
|
88
80
|
---
|
|
89
81
|
|
|
90
82
|
### 2. Generate microservices
|
|
91
83
|
|
|
92
84
|
```bash
|
|
93
|
-
pf new hono-micro services/orders
|
|
94
|
-
pf new nest-micro services/api-gateway
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
Both generators:
|
|
98
|
-
- Auto-assign unique ports
|
|
99
|
-
- Create Pulumi service config in `infra/services/`
|
|
100
|
-
- Add Dockerfile for containerized deployment
|
|
101
|
-
- Wire up health checks
|
|
102
|
-
|
|
103
|
-
#### 🤖 AI-Powered Generation
|
|
104
|
-
|
|
105
|
-
Generate services with AI assistance:
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
# One-liner with description
|
|
109
|
-
pf new hono-micro services/payments --ai -d "Handle payment webhooks and process transactions"
|
|
110
|
-
|
|
111
|
-
# Interactive mode (prompts for description)
|
|
112
|
-
pf new hono-micro services/notifications --ai
|
|
85
|
+
pf new hono-micro services/orders
|
|
86
|
+
pf new nest-micro services/api-gateway
|
|
113
87
|
```
|
|
114
88
|
|
|
115
|
-
|
|
89
|
+
With AI:
|
|
116
90
|
|
|
117
91
|
```bash
|
|
118
|
-
pf
|
|
92
|
+
pf new hono-micro services/payments --ai -d "Handle payment webhooks"
|
|
93
|
+
pf setup --ai
|
|
119
94
|
```
|
|
120
95
|
|
|
121
|
-
The AI reads your project's `copilot-instructions.md` and generates code following your conventions.
|
|
122
|
-
|
|
123
96
|
---
|
|
124
97
|
|
|
125
98
|
### 3. Start local development
|
|
@@ -128,41 +101,26 @@ The AI reads your project's `copilot-instructions.md` and generates code followi
|
|
|
128
101
|
pf dev
|
|
129
102
|
```
|
|
130
103
|
|
|
131
|
-
What happens:
|
|
132
|
-
|
|
133
|
-
1. `.env.local` is generated from all `infra/services/*.ts` configs
|
|
134
|
-
2. Services are started in parallel via Turborepo
|
|
135
|
-
3. **Watching:**
|
|
136
|
-
- `infra/services/` → regenerate env + restart
|
|
137
|
-
- `services/` and `apps/` → detect new/deleted packages and reinstall deps
|
|
138
|
-
|
|
139
104
|
---
|
|
140
105
|
|
|
141
|
-
## 📁
|
|
106
|
+
## 📁 Workspace Structure
|
|
142
107
|
|
|
143
108
|
```
|
|
144
109
|
my-platform/
|
|
145
110
|
├── .github/
|
|
146
111
|
│ ├── workflows/
|
|
147
|
-
│ │ ├── lint-and-tests.yml # PR checks
|
|
148
|
-
│ │ ├── build-and-deploy.yml # Build & deploy on push to main
|
|
149
|
-
│ │ └── publish-packages.yml # Publish npm packages
|
|
150
112
|
│ └── actions/
|
|
151
|
-
│ ├── setup-bun-install/ # Cached Bun setup
|
|
152
|
-
│ ├── generate-scope-matrix/ # Dynamic service detection
|
|
153
|
-
│ ├── check-image-tag-exists/ # Skip unchanged builds
|
|
154
|
-
│ └── ... # More reusable actions
|
|
155
113
|
├── infra/
|
|
156
|
-
│ ├── index.ts
|
|
157
|
-
│ ├── services/
|
|
158
|
-
│ ├── Pulumi.yaml
|
|
159
|
-
│ └── Pulumi.dev.yaml
|
|
160
|
-
├── services/
|
|
161
|
-
├── apps/
|
|
162
|
-
├── packages/
|
|
163
|
-
├── package.json
|
|
164
|
-
├── turbo.json
|
|
165
|
-
└── biome.json
|
|
114
|
+
│ ├── index.ts
|
|
115
|
+
│ ├── services/
|
|
116
|
+
│ ├── Pulumi.yaml
|
|
117
|
+
│ └── Pulumi.dev.yaml
|
|
118
|
+
├── services/
|
|
119
|
+
├── apps/
|
|
120
|
+
├── packages/
|
|
121
|
+
├── package.json
|
|
122
|
+
├── turbo.json
|
|
123
|
+
└── biome.json
|
|
166
124
|
```
|
|
167
125
|
|
|
168
126
|
---
|
|
@@ -171,24 +129,18 @@ my-platform/
|
|
|
171
129
|
|
|
172
130
|
| Command | Description |
|
|
173
131
|
|---------|-------------|
|
|
174
|
-
| `pf new` | Interactive
|
|
175
|
-
| `pf new workspace <name>` | Scaffold a complete platform
|
|
176
|
-
| `pf new hono-micro <path>` | Generate a
|
|
132
|
+
| `pf new` | Interactive creation |
|
|
133
|
+
| `pf new workspace <name>` | Scaffold a complete platform |
|
|
134
|
+
| `pf new hono-micro <path>` | Generate a Hono microservice |
|
|
177
135
|
| `pf new nest-micro <path>` | Generate a NestJS microservice |
|
|
178
|
-
| `pf
|
|
179
|
-
| `pf
|
|
180
|
-
| `pf dev` | Start dev environment with watch mode |
|
|
181
|
-
| `pf dev --no-watch` | Start without file watching |
|
|
182
|
-
| `pf generate <schematic> <name>` | Generate code using schematics |
|
|
136
|
+
| `pf setup --ai` | Configure AI provider |
|
|
137
|
+
| `pf dev` | Start dev environment |
|
|
183
138
|
|
|
184
139
|
---
|
|
185
140
|
|
|
186
|
-
## 🔧 Configuration
|
|
187
|
-
|
|
188
|
-
### Service Config Example
|
|
141
|
+
## 🔧 Configuration Example
|
|
189
142
|
|
|
190
143
|
```ts
|
|
191
|
-
// infra/services/orders.ts
|
|
192
144
|
import type { K8sServiceConfig } from '@crossdelta/infrastructure'
|
|
193
145
|
|
|
194
146
|
export const config: K8sServiceConfig = {
|
|
@@ -196,10 +148,6 @@ export const config: K8sServiceConfig = {
|
|
|
196
148
|
containerPort: 4001,
|
|
197
149
|
replicas: 1,
|
|
198
150
|
healthCheck: { port: 4001 },
|
|
199
|
-
resources: {
|
|
200
|
-
requests: { cpu: '50m', memory: '64Mi' },
|
|
201
|
-
limits: { cpu: '150m', memory: '128Mi' },
|
|
202
|
-
},
|
|
203
151
|
env: {
|
|
204
152
|
DATABASE_URL: databaseUrl,
|
|
205
153
|
NATS_URL: natsUrl,
|
|
@@ -207,93 +155,32 @@ export const config: K8sServiceConfig = {
|
|
|
207
155
|
}
|
|
208
156
|
```
|
|
209
157
|
|
|
210
|
-
Running `pf dev` generates:
|
|
211
|
-
|
|
212
|
-
```env
|
|
213
|
-
# .env.local
|
|
214
|
-
DATABASE_URL=postgres://...
|
|
215
|
-
NATS_URL=nats://localhost:4222
|
|
216
|
-
ORDERS_PORT=4001
|
|
217
|
-
```
|
|
218
|
-
|
|
219
158
|
---
|
|
220
159
|
|
|
221
|
-
## 🚢 Deployment
|
|
222
|
-
|
|
223
|
-
### Prerequisites
|
|
224
|
-
|
|
225
|
-
1. **Pulumi Account** – [Sign up free](https://app.pulumi.com/signup)
|
|
226
|
-
2. **DigitalOcean Account** – [Create account](https://cloud.digitalocean.com/registrations/new)
|
|
227
|
-
3. **GitHub Repository** – For CI/CD workflows
|
|
228
|
-
|
|
229
|
-
### GitHub Secrets
|
|
230
|
-
|
|
231
|
-
| Secret | Description |
|
|
232
|
-
|--------|-------------|
|
|
233
|
-
| `PULUMI_ACCESS_TOKEN` | Pulumi Cloud access token |
|
|
234
|
-
| `DIGITALOCEAN_TOKEN` | DigitalOcean API token |
|
|
235
|
-
| `NPM_TOKEN` | (optional) For private npm packages |
|
|
236
|
-
|
|
237
|
-
### Deploy
|
|
160
|
+
## 🚢 Deployment
|
|
238
161
|
|
|
239
162
|
```bash
|
|
240
163
|
pulumi login
|
|
241
164
|
pulumi up --stack dev
|
|
242
165
|
```
|
|
243
166
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
## When to use this
|
|
247
|
-
|
|
248
|
-
- ✅ **Bun-first microservice platform** with minimal boilerplate
|
|
249
|
-
- ✅ **Turborepo + Pulumi** as architectural baseline
|
|
250
|
-
- ✅ Fast **Hono/NestJS service scaffolding**
|
|
251
|
-
- ✅ **Unified dev workflow** for multiple services
|
|
252
|
-
- ✅ Deploy to **DigitalOcean App Platform**
|
|
253
|
-
- ✅ **GitHub Actions** for CI/CD
|
|
254
|
-
|
|
255
|
-
---
|
|
256
|
-
|
|
257
|
-
## ❌ When NOT to use this
|
|
167
|
+
GitHub Secrets:
|
|
258
168
|
|
|
259
|
-
-
|
|
260
|
-
-
|
|
261
|
-
-
|
|
262
|
-
- ❌ You don't use Infrastructure-as-Code
|
|
169
|
+
- `PULUMI_ACCESS_TOKEN`
|
|
170
|
+
- `DIGITALOCEAN_TOKEN`
|
|
171
|
+
- `NPM_TOKEN` (optional)
|
|
263
172
|
|
|
264
173
|
---
|
|
265
174
|
|
|
266
175
|
## 📚 Requirements
|
|
267
176
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
| Pulumi CLI | Latest |
|
|
273
|
-
| Docker | For local Supabase/NATS |
|
|
274
|
-
|
|
275
|
-
---
|
|
276
|
-
|
|
277
|
-
## 🔗 Related Packages
|
|
278
|
-
|
|
279
|
-
| Package | Description |
|
|
280
|
-
|---------|-------------|
|
|
281
|
-
| [@crossdelta/infrastructure](https://www.npmjs.com/package/@crossdelta/infrastructure) | Pulumi helpers for DigitalOcean |
|
|
282
|
-
| [@crossdelta/cloudevents](https://www.npmjs.com/package/@crossdelta/cloudevents) | CloudEvents + NATS toolkit |
|
|
283
|
-
| [@crossdelta/telemetry](https://www.npmjs.com/package/@crossdelta/telemetry) | Zero-config OpenTelemetry |
|
|
284
|
-
|
|
285
|
-
---
|
|
286
|
-
|
|
287
|
-
## 🗺️ Roadmap
|
|
288
|
-
|
|
289
|
-
- [x] AI-powered service generation (OpenAI/Anthropic)
|
|
290
|
-
- [ ] AWS ECS/Fargate provider
|
|
291
|
-
- [ ] GCP Cloud Run provider
|
|
292
|
-
- [ ] Kubernetes (generic) provider
|
|
293
|
-
- [ ] `pf migrate` command for database migrations
|
|
177
|
+
- Node.js ≥ 21
|
|
178
|
+
- Bun (latest)
|
|
179
|
+
- Pulumi CLI
|
|
180
|
+
- Docker (for local Supabase/NATS)
|
|
294
181
|
|
|
295
182
|
---
|
|
296
183
|
|
|
297
184
|
## 📄 License
|
|
298
185
|
|
|
299
|
-
MIT ©
|
|
186
|
+
MIT © Crossdelta
|