@crossdelta/platform-sdk 0.3.20 β 0.3.22
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 +128 -159
- package/bin/cli.js +164 -302
- package/package.json +16 -5
- package/logo.png +0 -0
package/README.md
CHANGED
|
@@ -9,29 +9,41 @@
|
|
|
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.
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
<p align="center">
|
|
18
|
+
<strong>π Scaffold β’ π€ Generate β’ βοΈ Deploy</strong>
|
|
13
19
|
</p>
|
|
14
20
|
|
|
15
21
|
<p align="center">
|
|
16
22
|
<a href="https://www.npmjs.com/package/@crossdelta/platform-sdk"><img src="https://img.shields.io/npm/v/@crossdelta/platform-sdk.svg?style=flat-square" alt="npm version" /></a>
|
|
23
|
+
<a href="https://www.npmjs.com/package/@crossdelta/platform-sdk"><img src="https://img.shields.io/npm/dm/@crossdelta/platform-sdk?style=flat-square" alt="Downloads" /></a>
|
|
24
|
+
<img src="https://img.shields.io/bundlephobia/min/@crossdelta/platform-sdk?style=flat-square&label=size" alt="Package size" />
|
|
17
25
|
<img src="https://img.shields.io/badge/bun-%E2%9A%A1-f9f1e1?style=flat-square" alt="Bun" />
|
|
18
26
|
<img src="https://img.shields.io/badge/pulumi-ready-blueviolet?style=flat-square" alt="Pulumi" />
|
|
19
27
|
<img src="https://img.shields.io/badge/DigitalOcean-App_Platform_|_DOKS-0080FF?style=flat-square" alt="DigitalOcean" />
|
|
20
28
|
</p>
|
|
21
29
|
|
|
22
|
-
<
|
|
23
|
-
Your AI-powered platform engineer. Scaffold complete Turborepo workspaces,<br />
|
|
24
|
-
generate production-ready microservices with natural language,<br />
|
|
25
|
-
and deploy to the cloud β all from one CLI.
|
|
26
|
-
</p>
|
|
30
|
+
<br />
|
|
27
31
|
|
|
28
32
|
---
|
|
29
33
|
|
|
34
|
+
## Who is this for?
|
|
35
|
+
|
|
36
|
+
- You run **multiple microservices** and want a unified developer experience
|
|
37
|
+
- You prefer **monorepos + Infrastructure-as-Code** as your architectural baseline
|
|
38
|
+
- You're okay with **DigitalOcean as the initial cloud provider** (AWS/GCP coming soon)
|
|
39
|
+
|
|
30
40
|
> β οΈ **Cloud Provider Support:** Currently only **DigitalOcean** is supported:
|
|
31
41
|
> - **App Platform** β Managed PaaS for simple deployments
|
|
32
42
|
> - **DOKS (Kubernetes)** β Full Kubernetes control for production workloads
|
|
33
43
|
>
|
|
34
|
-
> AWS and GCP support is planned for future releases.
|
|
44
|
+
> **AWS and GCP support** is planned for future releases.
|
|
45
|
+
|
|
46
|
+
<br />
|
|
35
47
|
|
|
36
48
|
---
|
|
37
49
|
|
|
@@ -43,152 +55,156 @@
|
|
|
43
55
|
| π€ **AI-Powered Generation** | Generate services with AI using `--ai` flag (OpenAI/Anthropic) |
|
|
44
56
|
| π₯ **Bun-first DX** | Ultra-fast dev workflow with fallback to npm/yarn/pnpm |
|
|
45
57
|
| ποΈ **Turborepo Monorepo** | Parallel builds, caching, and unified dev scripts |
|
|
46
|
-
| π§ **Service Generators** |
|
|
47
|
-
| π¦ **Pulumi-Ready Infra** | Infrastructure-as-Code for DigitalOcean
|
|
58
|
+
| π§ **Service Generators** | Hono (lightweight) and NestJS (enterprise-grade) templates |
|
|
59
|
+
| π¦ **Pulumi-Ready Infra** | Infrastructure-as-Code for DigitalOcean |
|
|
48
60
|
| π **GitHub Actions CI/CD** | Pre-configured workflows for build, test, deploy, and npm publish |
|
|
49
61
|
| π **Auto `.env.local`** | Environment variables derived from `infra/services/*.ts` |
|
|
50
|
-
| π **Auto Port Assignment** | Unique ports per service
|
|
62
|
+
| π **Auto Port Assignment** | Unique ports per service |
|
|
51
63
|
| π **Smart Watch Mode** | Watches infra & services, regenerates env, reinstalls deps |
|
|
52
64
|
|
|
65
|
+
<br />
|
|
66
|
+
|
|
53
67
|
---
|
|
54
68
|
|
|
55
69
|
## π Quick Start
|
|
56
70
|
|
|
71
|
+
> π‘ **Get started in under 2 minutes**
|
|
72
|
+
|
|
57
73
|
### 1. Create a new workspace
|
|
58
74
|
|
|
59
75
|
```bash
|
|
60
|
-
# Install globally
|
|
76
|
+
# Install globally
|
|
61
77
|
npm install -g @crossdelta/platform-sdk
|
|
62
78
|
pf new workspace my-platform
|
|
63
79
|
|
|
64
|
-
# Or use bunx (no
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
|
80
|
+
# Or use directly with npx/bunx (no installation required)
|
|
81
|
+
npx @crossdelta/platform-sdk new workspace my-platform
|
|
82
|
+
bunx @crossdelta/platform-sdk new workspace my-platform
|
|
73
83
|
```
|
|
74
84
|
|
|
75
85
|
**Options:**
|
|
76
86
|
|
|
77
87
|
| Flag | Description |
|
|
78
88
|
|------|-------------|
|
|
79
|
-
| `-y, --yes` | Skip prompts
|
|
89
|
+
| `-y, --yes` | Skip prompts |
|
|
80
90
|
| `-o, --github-owner <owner>` | GitHub org/user for GHCR registry |
|
|
81
|
-
| `-s, --pulumi-stack <name>` | Pulumi stack base name
|
|
91
|
+
| `-s, --pulumi-stack <name>` | Pulumi stack base name |
|
|
82
92
|
| `--no-github` | Skip GitHub Actions workflows |
|
|
83
93
|
|
|
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
|
-
---
|
|
89
|
-
|
|
90
94
|
### 2. Generate microservices
|
|
91
95
|
|
|
96
|
+
**Manual scaffolding:**
|
|
92
97
|
```bash
|
|
93
|
-
pf new hono-micro services/orders
|
|
94
|
-
pf new nest-micro services/api-gateway
|
|
98
|
+
pf new hono-micro services/orders
|
|
99
|
+
pf new nest-micro services/api-gateway
|
|
95
100
|
```
|
|
96
101
|
|
|
97
|
-
|
|
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
|
-
|
|
102
|
+
**AI-powered generation:**
|
|
107
103
|
```bash
|
|
108
|
-
#
|
|
109
|
-
pf
|
|
110
|
-
|
|
111
|
-
# Interactive mode (prompts for description)
|
|
112
|
-
pf new hono-micro services/notifications --ai
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
First-time setup:
|
|
104
|
+
# First time: configure AI provider (OpenAI or Anthropic)
|
|
105
|
+
pf setup --ai
|
|
116
106
|
|
|
117
|
-
|
|
118
|
-
pf
|
|
107
|
+
# Generate service with AI
|
|
108
|
+
pf new hono-micro services/payments --ai \
|
|
109
|
+
-d "Handle Stripe webhooks and send payment confirmations"
|
|
119
110
|
```
|
|
120
111
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
112
|
+
**β¨ AI generates:**
|
|
113
|
+
- β
Complete service with event handlers & use cases
|
|
114
|
+
- β
Pulumi infrastructure configuration
|
|
115
|
+
- β
Test files with validation logic
|
|
116
|
+
- β
Complete README documentation
|
|
124
117
|
|
|
125
118
|
### 3. Start local development
|
|
126
119
|
|
|
127
120
|
```bash
|
|
121
|
+
cd my-platform
|
|
128
122
|
pf dev
|
|
129
123
|
```
|
|
130
124
|
|
|
131
|
-
|
|
125
|
+
This will:
|
|
126
|
+
- π Auto-generate `.env.local` from infrastructure config
|
|
127
|
+
- π Start all services in watch mode
|
|
128
|
+
- π Auto-assign unique ports per service
|
|
129
|
+
- π¦ Install dependencies when `package.json` changes
|
|
132
130
|
|
|
133
|
-
|
|
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
|
|
131
|
+
<br />
|
|
138
132
|
|
|
139
133
|
---
|
|
140
134
|
|
|
141
|
-
## π
|
|
135
|
+
## π Workspace Structure
|
|
142
136
|
|
|
143
137
|
```
|
|
144
138
|
my-platform/
|
|
145
139
|
βββ .github/
|
|
146
140
|
β βββ 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
141
|
β βββ 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
142
|
βββ 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
|
|
143
|
+
β βββ index.ts
|
|
144
|
+
β βββ services/
|
|
145
|
+
β βββ Pulumi.yaml
|
|
146
|
+
β βββ Pulumi.dev.yaml
|
|
147
|
+
βββ services/
|
|
148
|
+
βββ apps/
|
|
149
|
+
βββ packages/
|
|
150
|
+
βββ package.json
|
|
151
|
+
βββ turbo.json
|
|
152
|
+
βββ biome.json
|
|
166
153
|
```
|
|
167
154
|
|
|
155
|
+
<br />
|
|
156
|
+
|
|
168
157
|
---
|
|
169
158
|
|
|
170
159
|
## π CLI Commands
|
|
171
160
|
|
|
161
|
+
<details>
|
|
162
|
+
<summary><strong>π View Full Command Reference</strong></summary>
|
|
163
|
+
|
|
164
|
+
<br />
|
|
165
|
+
|
|
166
|
+
### Workspace Commands
|
|
167
|
+
|
|
172
168
|
| Command | Description |
|
|
173
169
|
|---------|-------------|
|
|
174
|
-
| `pf new` | Interactive
|
|
175
|
-
| `pf new workspace <name>` | Scaffold a complete platform
|
|
176
|
-
| `pf
|
|
177
|
-
| `pf
|
|
178
|
-
| `pf new hono-micro <path> --ai -d "..."` | Generate with AI assistance |
|
|
179
|
-
| `pf setup --ai` | Configure AI provider (OpenAI/Anthropic) |
|
|
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 |
|
|
170
|
+
| `pf new` | Interactive creation wizard |
|
|
171
|
+
| `pf new workspace <name>` | Scaffold a complete platform monorepo |
|
|
172
|
+
| `pf setup --ai` | Configure AI provider (OpenAI or Anthropic) |
|
|
173
|
+
| `pf dev [options]` | Start development environment with hot reload |
|
|
183
174
|
|
|
184
|
-
|
|
175
|
+
### Service Commands
|
|
176
|
+
|
|
177
|
+
| Command | Description |
|
|
178
|
+
|---------|-------------|
|
|
179
|
+
| `pf new hono-micro <path>` | Generate a Hono microservice (lightweight) |
|
|
180
|
+
| `pf new nest-micro <path>` | Generate a NestJS microservice (enterprise-grade) |
|
|
181
|
+
| `pf new hono-micro <path> --ai` | Generate service with AI (requires `pf setup --ai`) |
|
|
182
|
+
|
|
183
|
+
### Code Generation
|
|
184
|
+
|
|
185
|
+
| Command | Description |
|
|
186
|
+
|---------|-------------|
|
|
187
|
+
| `pf generate event-handler <name>` | Generate an event handler |
|
|
188
|
+
| `pf generate use-case <name>` | Generate a use case |
|
|
189
|
+
| `pf event:list` | List all available event mocks |
|
|
190
|
+
| `pf event:send <name>` | Send a test event to NATS |
|
|
191
|
+
|
|
192
|
+
### Utility Commands
|
|
193
|
+
|
|
194
|
+
| Command | Description |
|
|
195
|
+
|---------|-------------|
|
|
196
|
+
| `pf --version` | Show version information |
|
|
197
|
+
| `pf --help` | Show help for any command |
|
|
198
|
+
|
|
199
|
+
</details>
|
|
200
|
+
|
|
201
|
+
<br />
|
|
185
202
|
|
|
186
|
-
|
|
203
|
+
---
|
|
187
204
|
|
|
188
|
-
|
|
205
|
+
## π§ Configuration Example
|
|
189
206
|
|
|
190
207
|
```ts
|
|
191
|
-
// infra/services/orders.ts
|
|
192
208
|
import type { K8sServiceConfig } from '@crossdelta/infrastructure'
|
|
193
209
|
|
|
194
210
|
export const config: K8sServiceConfig = {
|
|
@@ -196,10 +212,6 @@ export const config: K8sServiceConfig = {
|
|
|
196
212
|
containerPort: 4001,
|
|
197
213
|
replicas: 1,
|
|
198
214
|
healthCheck: { port: 4001 },
|
|
199
|
-
resources: {
|
|
200
|
-
requests: { cpu: '50m', memory: '64Mi' },
|
|
201
|
-
limits: { cpu: '150m', memory: '128Mi' },
|
|
202
|
-
},
|
|
203
215
|
env: {
|
|
204
216
|
DATABASE_URL: databaseUrl,
|
|
205
217
|
NATS_URL: natsUrl,
|
|
@@ -207,93 +219,50 @@ export const config: K8sServiceConfig = {
|
|
|
207
219
|
}
|
|
208
220
|
```
|
|
209
221
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
```env
|
|
213
|
-
# .env.local
|
|
214
|
-
DATABASE_URL=postgres://...
|
|
215
|
-
NATS_URL=nats://localhost:4222
|
|
216
|
-
ORDERS_PORT=4001
|
|
217
|
-
```
|
|
222
|
+
<br />
|
|
218
223
|
|
|
219
224
|
---
|
|
220
225
|
|
|
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
|
|
226
|
+
## π’ Deployment
|
|
238
227
|
|
|
239
228
|
```bash
|
|
240
229
|
pulumi login
|
|
241
230
|
pulumi up --stack dev
|
|
242
231
|
```
|
|
243
232
|
|
|
244
|
-
|
|
233
|
+
GitHub Secrets:
|
|
245
234
|
|
|
246
|
-
|
|
235
|
+
- `PULUMI_ACCESS_TOKEN`
|
|
236
|
+
- `DIGITALOCEAN_TOKEN`
|
|
237
|
+
- `NPM_TOKEN` (optional)
|
|
247
238
|
|
|
248
|
-
|
|
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
|
|
258
|
-
|
|
259
|
-
- β You need AWS, GCP, or other cloud providers (coming soon)
|
|
260
|
-
- β You need a hosted PaaS (Render, Fly.io, Netlify)
|
|
261
|
-
- β You are not using a monorepo
|
|
262
|
-
- β You don't use Infrastructure-as-Code
|
|
239
|
+
<br />
|
|
263
240
|
|
|
264
241
|
---
|
|
265
242
|
|
|
266
243
|
## π Requirements
|
|
267
244
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
| Pulumi CLI | Latest |
|
|
273
|
-
| Docker | For local Supabase/NATS |
|
|
274
|
-
|
|
275
|
-
---
|
|
245
|
+
- Node.js β₯ 21
|
|
246
|
+
- Bun (latest)
|
|
247
|
+
- Pulumi CLI
|
|
248
|
+
- Docker (for local Supabase/NATS)
|
|
276
249
|
|
|
277
|
-
|
|
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 |
|
|
250
|
+
<br />
|
|
284
251
|
|
|
285
252
|
---
|
|
286
253
|
|
|
287
|
-
##
|
|
254
|
+
## οΏ½ Community & Support
|
|
255
|
+
|
|
256
|
+
- π [Full Documentation](https://github.com/orderboss/platform/tree/main/packages/platform-sdk/docs)
|
|
257
|
+
- π [Report Issues](https://github.com/orderboss/platform/issues)
|
|
258
|
+
- π‘ [Feature Requests](https://github.com/orderboss/platform/discussions)
|
|
259
|
+
- π¦ [npm Package](https://www.npmjs.com/package/@crossdelta/platform-sdk)
|
|
260
|
+
- β [Star on GitHub](https://github.com/orderboss/platform)
|
|
288
261
|
|
|
289
|
-
|
|
290
|
-
- [ ] AWS ECS/Fargate provider
|
|
291
|
-
- [ ] GCP Cloud Run provider
|
|
292
|
-
- [ ] Kubernetes (generic) provider
|
|
293
|
-
- [ ] `pf migrate` command for database migrations
|
|
262
|
+
<br />
|
|
294
263
|
|
|
295
264
|
---
|
|
296
265
|
|
|
297
|
-
##
|
|
266
|
+
## οΏ½π License
|
|
298
267
|
|
|
299
|
-
MIT Β©
|
|
268
|
+
MIT Β© Crossdelta
|