@crossdelta/platform-sdk 0.2.30 β†’ 0.2.31

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
@@ -1,140 +1,188 @@
1
- # @crossdelta/platform-sdk
2
1
 
3
- [![npm version](https://img.shields.io/npm/v/@crossdelta/platform-sdk.svg)](https://www.npmjs.com/package/@crossdelta/platform-sdk)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
2
+ # @crossdelta/platform-sdk
3
+ **Bun-first CLI toolkit for building event-driven microservice platforms.**
5
4
 
6
- > πŸš€ CLI toolkit for scaffolding and managing microservice platforms
5
+ Spin up a complete Turborepo workspace with [Pulumi](https://www.pulumi.com/) infrastructure, ready-to-run [Hono](https://hono.dev/) / [NestJS](https://nestjs.com/) microservices, automatic env generation, and a unified development workflow β€” all from a single CLI.
7
6
 
8
- Build event-driven microservice platforms with minimal boilerplate. This CLI scaffolds [Turborepo](https://turbo.build) workspaces with [Pulumi](https://pulumi.com) infrastructure, generates microservices (Hono or NestJS), and provides a unified dev experience across all services.
7
+ > Stop wiring Turborepo, Pulumi, ports, env files & service scripts by hand.
8
+ > Build a production-ready microservice platform in under a minute.
9
9
 
10
- ## Features
10
+ ---
11
11
 
12
- - ⚑ **Quick Scaffolding** - Generate projects with best practices baked in
13
- - πŸ₯Ÿ **[Bun](https://bun.sh)-first** - Optimized for Bun runtime with npm/yarn/pnpm fallback
14
- - πŸ—οΈ **[Turborepo](https://turbo.build) Workspaces** - Monorepo setup with parallel builds and caching
15
- - πŸ”§ **Microservice Templates** - [Hono](https://hono.dev) (lightweight) & [NestJS](https://nestjs.com) (enterprise-grade)
16
- - πŸ“¦ **[Pulumi](https://www.pulumi.com) Ready** - Infrastructure-as-Code out of the box
17
- - πŸ”Œ **Auto Port Assignment** - Unique ports per service, no manual configuration
18
- - 🌍 **Env Generation** - `.env.local` auto-generated from `infra/services/*.ts` configs
12
+ ## ✨ Features
19
13
 
20
- ## Installation
14
+ - ⚑ **Instant Scaffolding** – Create fully wired platform workspaces with best practices baked in
15
+ - πŸ₯Ÿ **Bun-first DX** – Ultra-fast dev workflow with fallback to npm/yarn/pnpm
16
+ - πŸ—οΈ **Turborepo Monorepo** – Parallel builds, caching, and unified dev scripts
17
+ - πŸ”§ **Service Generators** – [Hono](https://hono.dev/) (lightweight) and [NestJS](https://nestjs.com/) (enterprise-grade) templates
18
+ - πŸ“¦ **Pulumi-Ready Infra** – Infrastructure-as-Code via [Pulumi](https://www.pulumi.com/)
19
+ - 🌍 **Automatic `.env.local` Generation** – Derived from `infra/services/*.ts`
20
+ - πŸ”Œ **Auto Port Assignment** – Unique ports per service, zero manual config
21
+ - πŸ” **Smart Watch Mode** – Watches infra & services, regenerates env, reinstalls deps when needed
21
22
 
22
- ```bash
23
- npm install -g @crossdelta/platform-sdk
23
+ ---
24
24
 
25
- # or
26
- bun add -g @crossdelta/platform-sdk
27
- ```
25
+ ## πŸš€ Quick Start
28
26
 
29
- ## Quick Start
27
+ ### 1. Create a new workspace
30
28
 
31
29
  ```bash
32
- # Create a new workspace with infrastructure
33
30
  npx @crossdelta/platform-sdk new workspace my-platform
34
31
  cd my-platform
32
+ ```
33
+
34
+ > πŸ’‘ `pf` is the CLI binary shipped with this package.
35
+ > It automatically works through `npx` β€” no global install required.
36
+
37
+ ---
35
38
 
36
- # Create a Hono microservice
39
+ ### 2. Generate microservices
40
+
41
+ ```bash
42
+ # Hono microservice
37
43
  pf new hono-micro services/orders
38
44
 
39
- # Create a NestJS microservice
45
+ # NestJS microservice
40
46
  pf new nest-micro services/api-gateway
47
+ ```
41
48
 
42
- # Start development
49
+ ---
50
+
51
+ ### 3. Start local development
52
+
53
+ ```bash
43
54
  pf dev
44
55
  ```
45
56
 
46
- ## Commands
57
+ What happens:
47
58
 
48
- ### `pf dev`
59
+ - `.env.local` is generated from all `infra/services/*.ts` configs
60
+ - Services are started in parallel via Turborepo
61
+ - Watching:
62
+ - `infra/services/` β†’ regenerate env + restart
63
+ - `services/` and `apps/` β†’ detect new/deleted packages and reinstall deps
49
64
 
50
- Start the development environment with hot reload.
65
+ ---
66
+
67
+ ## 🧠 Example: Automatic env generation
68
+
69
+ ```ts
70
+ // infra/services/orders.ts
71
+ import type { ServiceConfig } from '@crossdelta/infrastructure'
72
+
73
+ export const orders: ServiceConfig = {
74
+ name: 'orders',
75
+ httpPort: 4001,
76
+ env: {
77
+ ORDERS_DB_URL: 'postgres://...',
78
+ NATS_URL: 'nats://localhost:4222',
79
+ },
80
+ }
81
+ ```
82
+
83
+ Running:
51
84
 
52
85
  ```bash
53
- pf dev # Start with watch mode (default)
54
- pf dev --no-watch # Start without watching for changes
86
+ pf dev
55
87
  ```
56
88
 
57
- **What it does:**
58
- 1. Generates `.env.local` from service configurations in `infra/services/*.ts`
59
- 2. Starts all services in parallel via `turbo start:dev`
60
- 3. Watches for changes:
61
- - `infra/services/` β†’ Regenerates env and restarts on config changes
62
- - `services/` & `apps/` β†’ Detects new/deleted packages and reinstalls dependencies
63
-
64
- **Configuration via `package.json`:**
65
- ```json
66
- {
67
- "pf": {
68
- "dev": {
69
- "watchDirs": ["infra/services"],
70
- "watchPackages": ["services", "apps"]
71
- }
72
- }
73
- }
89
+ Creates:
90
+
91
+ ```
92
+ .env.local
93
+ ORDERS_DB_URL=postgres://...
94
+ NATS_URL=nats://localhost:4222
95
+ ORDERS_PORT=4001
74
96
  ```
75
97
 
76
- ### `pf new workspace [name]`
98
+ And automatically reloads services on change.
77
99
 
78
- Scaffold a complete platform workspace with Pulumi infrastructure.
100
+ ---
101
+
102
+ ## πŸ›  Commands
103
+
104
+ ### `pf dev`
105
+ Start the development environment with optional watch mode.
79
106
 
80
107
  ```bash
81
- pf new workspace my-platform
82
- pf new workspace my-platform -y # Skip prompts, use defaults
108
+ pf dev # Start with watch mode
109
+ pf dev --no-watch # Disable watching
83
110
  ```
84
111
 
85
- **Creates:**
86
- ```
87
- my-platform/
88
- β”œβ”€β”€ package.json
89
- β”œβ”€β”€ biome.json
90
- └── infra/
91
- β”œβ”€β”€ index.ts # Pulumi entry point
92
- β”œβ”€β”€ tsconfig.json
93
- β”œβ”€β”€ Pulumi.yaml
94
- β”œβ”€β”€ Pulumi.dev.yaml
95
- └── services/
96
- └── example.ts # Example service config
112
+ ---
113
+
114
+ ### `pf new workspace <name>`
115
+ Scaffold a complete platform workspace with Pulumi infrastructure.
116
+
117
+ ```bash
118
+ pf new workspace my-platform
119
+ pf new workspace my-platform -y # Skip prompts
97
120
  ```
98
121
 
99
- ### `pf new hono-micro [name]`
122
+ ---
100
123
 
101
- Generate a lightweight Hono-based microservice.
124
+ ### `pf new hono-micro <path>`
125
+ Generate a lightweight Hono microservice.
102
126
 
103
127
  ```bash
104
128
  pf new hono-micro services/orders
105
129
  ```
106
130
 
107
- ### `pf new nest-micro [name]`
131
+ ---
108
132
 
109
- Generate a NestJS microservice with full enterprise setup.
133
+ ### `pf new nest-micro <path>`
134
+ Generate a NestJS microservice with enterprise-ready setup.
110
135
 
111
136
  ```bash
112
137
  pf new nest-micro services/api-gateway
113
138
  ```
114
139
 
115
- **Includes:**
116
- - TypeScript configuration
117
- - Biome linting
118
- - Docker support
119
- - Health checks
140
+ ---
141
+
142
+ ## πŸ“¦ Installation (optional)
143
+
144
+ ```bash
145
+ npm install -g @crossdelta/platform-sdk
146
+ # or
147
+ bun add -g @crossdelta/platform-sdk
148
+ ```
149
+
150
+ ---
120
151
 
121
- ## Options
152
+ ## πŸ‘ When to use this
122
153
 
123
- | Flag | Description |
124
- |------|-------------|
125
- | `-y, --yes` | Skip all prompts, use defaults |
126
- | `-P, --package-manager <pm>` | Specify package manager (npm, yarn, pnpm, bun) |
127
- | `-h, --help` | Show help |
154
+ - You want a **Bun-first microservice platform** with minimal boilerplate
155
+ - You prefer **Turborepo + Pulumi** as your architectural baseline
156
+ - You want fast **Hono/NestJS service scaffolding**
157
+ - You need a **unified dev workflow** for multiple services
158
+ - You plan to deploy to **DigitalOcean, GCP, AWS**
128
159
 
129
- ## Requirements
160
+ ---
130
161
 
131
- - Node.js >= 21.0.0
162
+ ## ❌ When NOT to use this
163
+
164
+ - You need a hosted PaaS (Render, Fly.io, Netlify, etc.)
165
+ - You are not using a monorepo
166
+ - You don’t use Infrastructure-as-Code
167
+ - You prefer fully unopinionated setups
168
+
169
+ ---
170
+
171
+ ## πŸ“š Requirements
172
+
173
+ - Node.js β‰₯ 21
132
174
  - Bun (recommended) or npm/yarn/pnpm
175
+ - Pulumi CLI (optional, required for infra)
176
+
177
+ ---
178
+
179
+ ## πŸ”— Related
133
180
 
134
- ## Related
181
+ - **[@crossdelta/infrastructure](https://www.npmjs.com/package/@crossdelta/infrastructure)** – Shared helpers & types for Pulumi + DigitalOcean
182
+ - **[@crossdelta/cloudevents](https://www.npmjs.com/package/@crossdelta/cloudevents)** – CloudEvents + NATS toolkit for event-driven microservices
135
183
 
136
- - [@crossdelta/infrastructure](https://www.npmjs.com/package/@crossdelta/infrastructure) - Infrastructure helpers for Pulumi + DigitalOcean
184
+ ---
137
185
 
138
- ## License
186
+ ## πŸ“„ License
139
187
 
140
- MIT Β© [Crossdelta](https://github.com/crossdelta)
188
+ MIT Β© Crossdelta