@crossdelta/platform-sdk 0.2.24 → 0.2.26
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 +18 -30
- package/bin/cli.js +147 -370
- package/bin/integration.collection.json +5 -5
- package/bin/templates/hono-microservice/Dockerfile.hbs +16 -0
- package/bin/templates/hono-microservice/src/index.ts.hbs +18 -0
- package/bin/templates/hono-microservice/tsconfig.json.hbs +12 -0
- package/bin/templates/nest-microservice/Dockerfile.hbs +37 -0
- package/bin/templates/nest-microservice/src/main.ts.hbs +25 -0
- package/bin/templates/workspace/apps/.gitkeep +0 -0
- package/bin/templates/workspace/biome.json.hbs +60 -0
- package/bin/templates/workspace/bunfig.toml.hbs +5 -0
- package/bin/templates/workspace/docs/.gitkeep +0 -0
- package/bin/templates/workspace/editorconfig.hbs +9 -0
- package/bin/templates/workspace/gitignore.hbs +15 -0
- package/bin/templates/workspace/infra/Pulumi.dev.yaml.hbs +5 -0
- package/bin/templates/workspace/infra/Pulumi.yaml.hbs +6 -0
- package/bin/templates/workspace/infra/index.ts.hbs +56 -0
- package/bin/templates/workspace/infra/package.json.hbs +20 -0
- package/bin/templates/workspace/infra/services/example.ts.hbs +21 -0
- package/bin/templates/workspace/infra/tsconfig.json.hbs +15 -0
- package/bin/templates/workspace/npmrc.hbs +2 -0
- package/bin/templates/workspace/package.json.hbs +28 -0
- package/bin/templates/workspace/packages/.gitkeep +0 -0
- package/bin/templates/workspace/services/.gitkeep +0 -0
- package/bin/templates/workspace/turbo.json.hbs +32 -0
- package/package.json +18 -7
package/README.md
CHANGED
|
@@ -5,14 +5,17 @@
|
|
|
5
5
|
|
|
6
6
|
> 🚀 CLI toolkit for scaffolding and managing microservice platforms
|
|
7
7
|
|
|
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.
|
|
9
|
+
|
|
8
10
|
## Features
|
|
9
11
|
|
|
10
12
|
- ⚡ **Quick Scaffolding** - Generate projects with best practices baked in
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
- 🔌 **Integrations** - Add common tools like Biome, NATS, Supabase
|
|
13
|
+
- 🥟 **Bun-first** - Optimized for Bun runtime with npm/yarn/pnpm fallback
|
|
14
|
+
- 🏗️ **Turborepo Workspaces** - Monorepo setup with parallel builds and caching
|
|
15
|
+
- 🔧 **Microservice Templates** - Hono (lightweight) & NestJS (enterprise-grade)
|
|
15
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
|
|
16
19
|
|
|
17
20
|
## Installation
|
|
18
21
|
|
|
@@ -27,13 +30,17 @@ bun add -g @crossdelta/platform-sdk
|
|
|
27
30
|
|
|
28
31
|
```bash
|
|
29
32
|
# Create a new workspace with infrastructure
|
|
30
|
-
|
|
33
|
+
npx @crossdelta/platform-sdk new workspace my-platform
|
|
34
|
+
cd my-platform
|
|
31
35
|
|
|
32
36
|
# Create a Hono microservice
|
|
33
37
|
pf new hono-micro services/orders
|
|
34
38
|
|
|
35
39
|
# Create a NestJS microservice
|
|
36
40
|
pf new nest-micro services/api-gateway
|
|
41
|
+
|
|
42
|
+
# Start development
|
|
43
|
+
pf dev
|
|
37
44
|
```
|
|
38
45
|
|
|
39
46
|
## Commands
|
|
@@ -47,12 +54,12 @@ pf dev # Start with watch mode (default)
|
|
|
47
54
|
pf dev --no-watch # Start without watching for changes
|
|
48
55
|
```
|
|
49
56
|
|
|
50
|
-
**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
|
|
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
|
|
56
63
|
|
|
57
64
|
**Configuration via `package.json`:**
|
|
58
65
|
```json
|
|
@@ -110,7 +117,6 @@ pf new nest-micro services/api-gateway
|
|
|
110
117
|
- Biome linting
|
|
111
118
|
- Docker support
|
|
112
119
|
- Health checks
|
|
113
|
-
- NATS integration (optional)
|
|
114
120
|
|
|
115
121
|
## Options
|
|
116
122
|
|
|
@@ -120,24 +126,6 @@ pf new nest-micro services/api-gateway
|
|
|
120
126
|
| `-P, --package-manager <pm>` | Specify package manager (npm, yarn, pnpm, bun) |
|
|
121
127
|
| `-h, --help` | Show help |
|
|
122
128
|
|
|
123
|
-
## Integrations
|
|
124
|
-
|
|
125
|
-
When creating microservices, you can optionally add integrations:
|
|
126
|
-
|
|
127
|
-
- **Biome** - Fast linter and formatter
|
|
128
|
-
- **NATS** - Message broker integration
|
|
129
|
-
- **Supabase** - Database and auth
|
|
130
|
-
- **CloudEvents** - Event-driven architecture
|
|
131
|
-
|
|
132
|
-
## Programmatic Usage
|
|
133
|
-
|
|
134
|
-
```typescript
|
|
135
|
-
import { createWorkspaceCommand } from '@crossdelta/platform-sdk'
|
|
136
|
-
|
|
137
|
-
// Use in your own CLI
|
|
138
|
-
myProgram.addCommand(createWorkspaceCommand)
|
|
139
|
-
```
|
|
140
|
-
|
|
141
129
|
## Requirements
|
|
142
130
|
|
|
143
131
|
- Node.js >= 21.0.0
|