rapidkit 0.32.1 → 0.33.0

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
@@ -20,6 +20,7 @@ The official RapidKit npm CLI for creating and operating workspaces and projects
20
20
  - Multi-runtime support across Python, Node.js, Java, Go, and .NET
21
21
  - Policy enforcement with `warn` / `strict` modes
22
22
  - Cache and mirror lifecycle commands for stable environments
23
+ - Contract-driven workspace infra sidecar (`infra plan|up|down|status`) for local Postgres, Redis, mail, and related dev dependencies
23
24
 
24
25
  ## Workspace-First Architecture
25
26
 
@@ -149,6 +150,7 @@ npx rapidkit doctor
149
150
  npx rapidkit doctor workspace [--fix] [--plan] [--apply]
150
151
  npx rapidkit doctor project [--fix] [--plan] [--apply]
151
152
  npx rapidkit workspace list # Display all workspaces created on this system
153
+ npx rapidkit workspace foundation ensure [--force] [--json]
152
154
  npx rapidkit workspace share [--output <file>] [--include-paths] [--no-doctor]
153
155
  npx rapidkit workspace contract init [--force] [--json]
154
156
  npx rapidkit workspace contract inspect [--json]
@@ -170,6 +172,10 @@ npx rapidkit project restore <archive> [--name <project-name>] [--force] [--dry-
170
172
  npx rapidkit project delete <name> [--permanent --confirm <name>] [--dry-run] [--json]
171
173
  npx rapidkit workspace init # Full-init alias (same behavior as root init/workspace run init at workspace root)
172
174
  npx rapidkit workspace run <init|test|build|start> [--affected] [--blast-radius] [--since <ref>] [--parallel] [--max-workers <n>] [--strict] [--json]
175
+ npx rapidkit infra plan [--workspace <path>] [--json] [--dry-run] [--verbose]
176
+ npx rapidkit infra up [--workspace <path>] [--no-plan] [--build]
177
+ npx rapidkit infra down [--workspace <path>] [--volumes]
178
+ npx rapidkit infra status [--workspace <path>] [--json] [--strict]
173
179
  ```
174
180
 
175
181
  ### Project import into workspace
@@ -313,13 +319,46 @@ and `workspace archive doctor` when you want human-readable readiness/security g
313
319
  imports the workspace. Use `--include-env` only for trusted internal handoffs when you intentionally need
314
320
  environment files inside the archive.
315
321
 
322
+ ### Workspace infrastructure (sidecar)
323
+
324
+ Use `infra` when a workspace needs local dev dependencies (PostgreSQL, Redis, Mailpit, MinIO, and
325
+ related services) without replacing the workspace's own `docker-compose.yml`.
326
+
327
+ Discovery is contract-first and runtime-agnostic:
328
+
329
+ - Installed Core module slugs from each project's `registry.json`
330
+ - Infra-related variables from each project's `.env.example`
331
+ - Optional env declarations from `.rapidkit/workspace.contract.json`
332
+ - Manual overrides in `.rapidkit/infra/overrides.json`
333
+
334
+ ```bash
335
+ cd my-workspace
336
+ npx rapidkit infra plan
337
+ npx rapidkit infra up
338
+ npx rapidkit infra status --strict
339
+ npx rapidkit infra down
340
+ ```
341
+
342
+ Artifacts are written beside the workspace (sidecar strategy):
343
+
344
+ - `.rapidkit/infra/docker-compose.yml` — generated Docker Compose stack
345
+ - `.rapidkit/reports/infra-plan.json` — machine-readable plan and discovery evidence
346
+ - `.rapidkit/infra/.env.example` — connection env preview for local `.env` files
347
+
348
+ `infra up` refreshes the plan by default. Use `--no-plan` to start from the last saved plan only.
349
+ Connection defaults prefer project `.env.example` values (for example `RAPIDKIT_DB_POSTGRES_URL`).
350
+
351
+ This command family is wrapper-owned, does not mutate Core modules, and works for polyglot workspaces
352
+ (FastAPI, NestJS, Go, Spring Boot, .NET, and imported projects) as long as projects expose
353
+ `.rapidkit/project.json` and env/override signals.
354
+
316
355
  ### Command ownership
317
356
 
318
357
  RapidKit keeps the wrapper boundary explicit so users know which layer owns each action.
319
358
 
320
359
  | Command family | Owner | Notes |
321
360
  | -------------------------------------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
322
- | `create workspace`, `workspace`, `cache`, `mirror` | RapidKit wrapper | Platform-level orchestration |
361
+ | `create workspace`, `workspace`, `cache`, `mirror`, `infra` | RapidKit wrapper | Platform-level orchestration |
323
362
  | `init` | Wrapper orchestrated | Project init in project dirs; full-init alias at workspace root |
324
363
  | `dev`, `test`, `build`, `start` | Runtime aware | Delegates to the active project/runtime when available |
325
364
  | `readiness` | Wrapper release gate | Generates release-readiness evidence (`--json` for CI, `--strict` for fail-fast) |
@@ -331,6 +370,7 @@ RapidKit keeps the wrapper boundary explicit so users know which layer owns each
331
370
  | `doctor workspace` | Workspace health | Full workspace scan with project-level details and fixes |
332
371
  | `doctor project` | Project health | Current project (or nearest parent) diagnostics with project evidence and scoped fixes |
333
372
  | `workspace run` | Workspace orchestrator | Stage execution across discovered projects with optional affected-only, blast-radius expansion, and policy-gated pre-checks |
373
+ | `infra` | Workspace sidecar | Contract-driven local infra discovery, compose generation, and Docker lifecycle (`plan`, `up`, `down`, `status`) |
334
374
 
335
375
  Use `npx rapidkit doctor` for a quick host pre-flight, `npx rapidkit doctor project` for a service-level check, and `npx rapidkit doctor workspace` for the full workspace picture.
336
376
  Use `npx rapidkit analyze --json` to generate CI-friendly workspace health evidence and save it under `.rapidkit/reports/`.
@@ -424,8 +464,11 @@ available.
424
464
  ```bash
425
465
  npx rapidkit cache <status|clear|prune|repair>
426
466
  npx rapidkit mirror <status|sync|verify|rotate>
467
+ npx rapidkit infra <plan|up|down|status>
427
468
  ```
428
469
 
470
+ See [Workspace infrastructure (sidecar)](#workspace-infrastructure-sidecar) for discovery rules and generated artifacts.
471
+
429
472
  ## Profiles
430
473
 
431
474
  - `minimal` — baseline workspace scaffolding
@@ -663,12 +706,14 @@ npm run install:local
663
706
  npx rapidkit --version
664
707
  ```
665
708
 
666
- > Packaging note: `npm run prepack` will regenerate `data/modules-embeddings.json` from the mock embeddings script before `npm pack` / `npm publish`.
709
+ > Packaging note: `npm run prepack` validates the committed `data/modules-embeddings.json`
710
+ > artifact before `npm pack` / `npm publish`. This keeps packaging deterministic and avoids
711
+ > registry or `npx` downloads during release.
667
712
  >
668
713
  > If you need to refresh the local test embeddings manually, run:
669
714
  >
670
715
  > ```bash
671
- > npm run test:prepare-embeddings
716
+ > npm run generate-embeddings
672
717
  > ```
673
718
 
674
719
  ## Troubleshooting
@@ -0,0 +1,37 @@
1
+ {
2
+ "schemaVersion": "backend-import-stack-parity-v1",
3
+ "frameworkToStack": {
4
+ "fastapi": "fastapi",
5
+ "django": "django",
6
+ "flask": "flask",
7
+ "python": "unknown",
8
+ "nestjs": "nestjs",
9
+ "express": "express",
10
+ "fastify": "unknown",
11
+ "koa": "koa",
12
+ "node": "unknown",
13
+ "gofiber": "go",
14
+ "gogin": "go",
15
+ "echo": "go",
16
+ "go": "go",
17
+ "springboot": "springboot",
18
+ "java": "unknown",
19
+ "rails": "rails",
20
+ "ruby": "unknown",
21
+ "dotnet": "dotnet",
22
+ "unknown": "unknown"
23
+ },
24
+ "runtimeToStack": {
25
+ "python": "unknown",
26
+ "node": "unknown",
27
+ "nodejs": "unknown",
28
+ "typescript": "unknown",
29
+ "go": "go",
30
+ "golang": "go",
31
+ "java": "unknown",
32
+ "ruby": "unknown",
33
+ "dotnet": "dotnet",
34
+ "csharp": "dotnet",
35
+ "unknown": "unknown"
36
+ }
37
+ }
@@ -0,0 +1,162 @@
1
+ {
2
+ "schemaVersion": "rapidkit.infra-stack.v1",
3
+ "description": "Canonical workspace infrastructure service catalog and module/env resolution rules.",
4
+ "futureProfiles": ["frontend-dev", "edge-proxy"],
5
+ "services": {
6
+ "postgres": {
7
+ "displayName": "PostgreSQL",
8
+ "category": "database",
9
+ "image": "postgres:16-alpine",
10
+ "ports": [{ "name": "sql", "host": 5432, "container": 5432 }],
11
+ "env": {
12
+ "POSTGRES_USER": "rapidkit",
13
+ "POSTGRES_PASSWORD": "rapidkit",
14
+ "POSTGRES_DB": "rapidkit"
15
+ },
16
+ "volumes": ["postgres_data:/var/lib/postgresql/data"],
17
+ "healthcheck": {
18
+ "test": ["CMD-SHELL", "pg_isready -U rapidkit -d rapidkit"],
19
+ "interval": "10s",
20
+ "timeout": "5s",
21
+ "retries": 5
22
+ },
23
+ "connectionEnv": {
24
+ "DATABASE_URL": "postgresql://rapidkit:rapidkit@localhost:5432/rapidkit",
25
+ "RAPIDKIT_DB_POSTGRES_URL": "postgresql://rapidkit:rapidkit@localhost:5432/rapidkit"
26
+ }
27
+ },
28
+ "redis": {
29
+ "displayName": "Redis",
30
+ "category": "cache",
31
+ "image": "redis:7-alpine",
32
+ "ports": [{ "name": "redis", "host": 6379, "container": 6379 }],
33
+ "command": ["redis-server", "--appendonly", "yes"],
34
+ "volumes": ["redis_data:/data"],
35
+ "healthcheck": {
36
+ "test": ["CMD", "redis-cli", "ping"],
37
+ "interval": "10s",
38
+ "timeout": "3s",
39
+ "retries": 5
40
+ },
41
+ "connectionEnv": {
42
+ "REDIS_URL": "redis://localhost:6379/0",
43
+ "CELERY_BROKER_URL": "redis://localhost:6379/0",
44
+ "CELERY_RESULT_BACKEND": "redis://localhost:6379/1"
45
+ }
46
+ },
47
+ "mongo": {
48
+ "displayName": "MongoDB",
49
+ "category": "database",
50
+ "image": "mongo:7",
51
+ "ports": [{ "name": "mongo", "host": 27017, "container": 27017 }],
52
+ "volumes": ["mongo_data:/data/db"],
53
+ "connectionEnv": {
54
+ "MONGODB_URI": "mongodb://localhost:27017/rapidkit",
55
+ "MONGO_URL": "mongodb://localhost:27017/rapidkit"
56
+ }
57
+ },
58
+ "mysql": {
59
+ "displayName": "MySQL",
60
+ "category": "database",
61
+ "image": "mysql:8.4",
62
+ "ports": [{ "name": "mysql", "host": 3306, "container": 3306 }],
63
+ "env": {
64
+ "MYSQL_ROOT_PASSWORD": "rapidkit",
65
+ "MYSQL_DATABASE": "rapidkit",
66
+ "MYSQL_USER": "rapidkit",
67
+ "MYSQL_PASSWORD": "rapidkit"
68
+ },
69
+ "healthcheck": {
70
+ "test": ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-urapidkit", "-prapidkit"],
71
+ "interval": "10s",
72
+ "timeout": "5s",
73
+ "retries": 5
74
+ },
75
+ "connectionEnv": {
76
+ "DATABASE_URL": "mysql://rapidkit:rapidkit@localhost:3306/rapidkit"
77
+ }
78
+ },
79
+ "rabbitmq": {
80
+ "displayName": "RabbitMQ",
81
+ "category": "queue",
82
+ "image": "rabbitmq:3-management-alpine",
83
+ "ports": [
84
+ { "name": "amqp", "host": 5672, "container": 5672 },
85
+ { "name": "management", "host": 15672, "container": 15672 }
86
+ ],
87
+ "healthcheck": {
88
+ "test": ["CMD", "rabbitmq-diagnostics", "-q", "ping"],
89
+ "interval": "15s",
90
+ "timeout": "10s",
91
+ "retries": 5
92
+ },
93
+ "connectionEnv": {
94
+ "CELERY_BROKER_URL": "amqp://guest:guest@localhost:5672//",
95
+ "RABBITMQ_URL": "amqp://guest:guest@localhost:5672//"
96
+ }
97
+ },
98
+ "mailpit": {
99
+ "displayName": "Mailpit (SMTP dev)",
100
+ "category": "communication",
101
+ "image": "axllent/mailpit:latest",
102
+ "ports": [
103
+ { "name": "smtp", "host": 1025, "container": 1025 },
104
+ { "name": "ui", "host": 8025, "container": 8025 }
105
+ ],
106
+ "connectionEnv": {
107
+ "SMTP_HOST": "localhost",
108
+ "SMTP_PORT": "1025",
109
+ "MAIL_URL": "smtp://localhost:1025"
110
+ }
111
+ },
112
+ "minio": {
113
+ "displayName": "MinIO (S3-compatible)",
114
+ "category": "storage",
115
+ "image": "minio/minio:latest",
116
+ "ports": [
117
+ { "name": "s3", "host": 9000, "container": 9000 },
118
+ { "name": "console", "host": 9001, "container": 9001 }
119
+ ],
120
+ "command": ["server", "/data", "--console-address", ":9001"],
121
+ "env": {
122
+ "MINIO_ROOT_USER": "rapidkit",
123
+ "MINIO_ROOT_PASSWORD": "rapidkit-dev"
124
+ },
125
+ "volumes": ["minio_data:/data"],
126
+ "connectionEnv": {
127
+ "AWS_S3_ENDPOINT": "http://localhost:9000",
128
+ "S3_ENDPOINT_URL": "http://localhost:9000"
129
+ }
130
+ }
131
+ },
132
+ "moduleMappings": {
133
+ "free/database/db_postgres": ["postgres"],
134
+ "free/database/db_mongo": ["mongo"],
135
+ "free/database/db_mysql": ["mysql"],
136
+ "free/cache/redis": ["redis"],
137
+ "free/tasks/celery": ["redis"],
138
+ "free/tasks/workflow_engine": ["postgres", "redis"],
139
+ "free/tasks/queue_platform": ["redis"],
140
+ "free/tasks/event_bus": ["redis"],
141
+ "free/communication/webhook_platform": ["postgres", "redis"],
142
+ "free/communication/email": ["mailpit"],
143
+ "free/business/storage": ["minio"],
144
+ "free/security/audit_policy": ["postgres"],
145
+ "free/business/approval_engine": ["postgres", "redis"]
146
+ },
147
+ "envVarMappings": {
148
+ "DATABASE_URL": ["postgres"],
149
+ "RAPIDKIT_DB_POSTGRES_URL": ["postgres"],
150
+ "REDIS_URL": ["redis"],
151
+ "CELERY_BROKER_URL": ["redis"],
152
+ "CELERY_RESULT_BACKEND": ["redis"],
153
+ "MONGODB_URI": ["mongo"],
154
+ "MONGO_URL": ["mongo"],
155
+ "MYSQL_URL": ["mysql"],
156
+ "RABBITMQ_URL": ["rabbitmq"],
157
+ "SMTP_HOST": ["mailpit"],
158
+ "MAIL_URL": ["mailpit"],
159
+ "AWS_S3_ENDPOINT": ["minio"],
160
+ "S3_ENDPOINT_URL": ["minio"]
161
+ }
162
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "schemaVersion": "rapidkit.module-layout.v1",
3
+ "canonicalModuleRoot": "src/modules/free",
4
+ "pathPattern": "src/modules/free/{category}/{module}",
5
+ "slugPattern": "free/{category}/{module}",
6
+ "frameworks": {
7
+ "fastapi": {
8
+ "moduleCommands": true,
9
+ "injectAnchors": [
10
+ "src/routing/__init__.py",
11
+ "src/modules/__init__.py"
12
+ ],
13
+ "moduleMarkerFiles": ["__init__.py"]
14
+ },
15
+ "nestjs": {
16
+ "moduleCommands": true,
17
+ "injectAnchors": [
18
+ "src/app.module.ts",
19
+ "src/modules/index.ts"
20
+ ],
21
+ "moduleMarkerFiles": ["index.ts", "module.ts"]
22
+ }
23
+ },
24
+ "unsupportedModuleFrameworks": ["go", "springboot", "dotnet"]
25
+ }
@@ -0,0 +1,152 @@
1
+ {
2
+ "schemaVersion": "rapidkit-runtime-command-surface-v1",
3
+ "lifecycleCommands": ["init", "dev", "start", "build", "test", "lint", "format", "help"],
4
+ "moduleMutationCommands": [
5
+ "add",
6
+ "modules",
7
+ "upgrade",
8
+ "diff",
9
+ "merge",
10
+ "reconcile",
11
+ "rollback",
12
+ "uninstall",
13
+ "checkpoint",
14
+ "snapshot",
15
+ "optimize"
16
+ ],
17
+ "globalCommands": ["create", "list", "info", "frameworks", "license"],
18
+ "universalCommands": ["version", "commands", "doctor", "project"],
19
+ "moduleSuggestionFrameworks": ["fastapi", "nestjs"],
20
+ "moduleUnsupportedFrameworks": ["go", "springboot", "dotnet"],
21
+ "scaffoldKits": [
22
+ "fastapi.standard",
23
+ "fastapi.ddd",
24
+ "nestjs.standard",
25
+ "gofiber.standard",
26
+ "gogin.standard",
27
+ "springboot.standard",
28
+ "dotnet.webapi.clean"
29
+ ],
30
+ "runtimeMatrix": {
31
+ "python": {
32
+ "tier": "first-class",
33
+ "scaffold": true,
34
+ "import": true,
35
+ "moduleCommands": true,
36
+ "doctor": "full",
37
+ "lifecycleCommands": ["init", "dev", "start", "build", "test", "lint", "format", "help"]
38
+ },
39
+ "node": {
40
+ "tier": "first-class",
41
+ "scaffold": true,
42
+ "import": true,
43
+ "moduleCommands": true,
44
+ "doctor": "full",
45
+ "lifecycleCommands": ["init", "dev", "start", "build", "test", "lint", "format", "help"]
46
+ },
47
+ "go": {
48
+ "tier": "extended",
49
+ "scaffold": true,
50
+ "import": true,
51
+ "moduleCommands": false,
52
+ "doctor": "readiness",
53
+ "lifecycleCommands": ["init", "dev", "start", "build", "test", "lint", "format", "help"]
54
+ },
55
+ "java": {
56
+ "tier": "extended",
57
+ "scaffold": true,
58
+ "import": true,
59
+ "moduleCommands": false,
60
+ "doctor": "readiness",
61
+ "lifecycleCommands": ["init", "dev", "start", "build", "test", "lint", "format", "help"]
62
+ },
63
+ "dotnet": {
64
+ "tier": "extended",
65
+ "scaffold": true,
66
+ "import": true,
67
+ "moduleCommands": false,
68
+ "doctor": "readiness",
69
+ "lifecycleCommands": ["init", "dev", "start", "build", "test", "lint", "format", "help"]
70
+ },
71
+ "php": {
72
+ "tier": "observed",
73
+ "scaffold": false,
74
+ "import": true,
75
+ "moduleCommands": false,
76
+ "doctor": "observed",
77
+ "lifecycleCommands": ["help"]
78
+ },
79
+ "ruby": {
80
+ "tier": "observed",
81
+ "scaffold": false,
82
+ "import": true,
83
+ "moduleCommands": false,
84
+ "doctor": "observed",
85
+ "lifecycleCommands": ["help"]
86
+ },
87
+ "rust": {
88
+ "tier": "observed",
89
+ "scaffold": false,
90
+ "import": true,
91
+ "moduleCommands": false,
92
+ "doctor": "observed",
93
+ "lifecycleCommands": ["help"]
94
+ },
95
+ "elixir": {
96
+ "tier": "observed",
97
+ "scaffold": false,
98
+ "import": true,
99
+ "moduleCommands": false,
100
+ "doctor": "observed",
101
+ "lifecycleCommands": ["help"]
102
+ },
103
+ "clojure": {
104
+ "tier": "observed",
105
+ "scaffold": false,
106
+ "import": true,
107
+ "moduleCommands": false,
108
+ "doctor": "observed",
109
+ "lifecycleCommands": ["help"]
110
+ },
111
+ "scala": {
112
+ "tier": "observed",
113
+ "scaffold": false,
114
+ "import": true,
115
+ "moduleCommands": false,
116
+ "doctor": "observed",
117
+ "lifecycleCommands": ["help"]
118
+ },
119
+ "kotlin": {
120
+ "tier": "observed",
121
+ "scaffold": false,
122
+ "import": true,
123
+ "moduleCommands": false,
124
+ "doctor": "observed",
125
+ "lifecycleCommands": ["help"]
126
+ },
127
+ "deno": {
128
+ "tier": "observed",
129
+ "scaffold": false,
130
+ "import": true,
131
+ "moduleCommands": false,
132
+ "doctor": "observed",
133
+ "lifecycleCommands": ["help"]
134
+ },
135
+ "bun": {
136
+ "tier": "observed",
137
+ "scaffold": false,
138
+ "import": true,
139
+ "moduleCommands": false,
140
+ "doctor": "observed",
141
+ "lifecycleCommands": ["help"]
142
+ },
143
+ "unknown": {
144
+ "tier": "observed",
145
+ "scaffold": false,
146
+ "import": true,
147
+ "moduleCommands": false,
148
+ "doctor": "observed",
149
+ "lifecycleCommands": ["help"]
150
+ }
151
+ }
152
+ }