container-superposition 0.1.9 → 0.1.11

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.
Files changed (50) hide show
  1. package/README.md +3 -0
  2. package/dist/scripts/generate-schema.d.ts +14 -0
  3. package/dist/scripts/generate-schema.d.ts.map +1 -0
  4. package/dist/scripts/generate-schema.js +406 -0
  5. package/dist/scripts/generate-schema.js.map +1 -0
  6. package/dist/tool/cli/args.d.ts.map +1 -1
  7. package/dist/tool/cli/args.js +1 -1
  8. package/dist/tool/cli/args.js.map +1 -1
  9. package/dist/tool/commands/adopt.d.ts.map +1 -1
  10. package/dist/tool/commands/adopt.js +14 -20
  11. package/dist/tool/commands/adopt.js.map +1 -1
  12. package/dist/tool/questionnaire/composer.d.ts.map +1 -1
  13. package/dist/tool/questionnaire/composer.js +186 -2
  14. package/dist/tool/questionnaire/composer.js.map +1 -1
  15. package/dist/tool/readme/readme-generator.d.ts.map +1 -1
  16. package/dist/tool/readme/readme-generator.js +1 -1
  17. package/dist/tool/readme/readme-generator.js.map +1 -1
  18. package/dist/tool/schema/project-config.d.ts +8 -1
  19. package/dist/tool/schema/project-config.d.ts.map +1 -1
  20. package/dist/tool/schema/project-config.js +180 -6
  21. package/dist/tool/schema/project-config.js.map +1 -1
  22. package/dist/tool/schema/types.d.ts +51 -1
  23. package/dist/tool/schema/types.d.ts.map +1 -1
  24. package/docs/README.md +1 -0
  25. package/docs/overlays.md +40 -0
  26. package/docs/specs/019-project-mounts/spec.md +176 -0
  27. package/docs/specs/020-superposition-yml-schema.md +83 -0
  28. package/docs/specs/021-deterministic-generated-readme/spec.md +70 -0
  29. package/docs/superposition-yml.md +481 -0
  30. package/overlays/ansible/README.md +163 -0
  31. package/overlays/ansible/devcontainer.patch.json +14 -0
  32. package/overlays/ansible/overlay.yml +18 -0
  33. package/overlays/argocd/README.md +158 -0
  34. package/overlays/argocd/devcontainer.patch.json +9 -0
  35. package/overlays/argocd/overlay.yml +17 -0
  36. package/overlays/argocd/setup.sh +29 -0
  37. package/overlays/argocd/verify.sh +14 -0
  38. package/overlays/pi/README.md +141 -0
  39. package/overlays/pi/devcontainer.patch.json +6 -0
  40. package/overlays/pi/overlay.yml +15 -0
  41. package/overlays/pi/setup.sh +28 -0
  42. package/overlays/pi/verify.sh +23 -0
  43. package/overlays/task/README.md +47 -0
  44. package/overlays/task/devcontainer.patch.json +9 -0
  45. package/overlays/task/overlay.yml +16 -0
  46. package/overlays/task/setup.sh +29 -0
  47. package/overlays/task/verify.sh +14 -0
  48. package/package.json +2 -1
  49. package/tool/schema/config.schema.json +77 -2
  50. package/tool/schema/superposition.schema.json +569 -0
@@ -83,6 +83,7 @@
83
83
  "otel-demo-nodejs",
84
84
  "otel-demo-python",
85
85
  "pandoc",
86
+ "pi",
86
87
  "playwright",
87
88
  "postgres",
88
89
  "powershell",
@@ -199,7 +200,8 @@
199
200
  "gemini-cli",
200
201
  "amp",
201
202
  "windsurf-cli",
202
- "opencode"
203
+ "opencode",
204
+ "pi"
203
205
  ]
204
206
  },
205
207
  "default": [],
@@ -272,6 +274,41 @@
272
274
  ]
273
275
  }
274
276
  },
277
+ "mounts": {
278
+ "description": "Project-level mount specs routed to devcontainer.json mounts or docker-compose volumes based on stack/target",
279
+ "oneOf": [
280
+ {
281
+ "type": "array",
282
+ "items": {
283
+ "$ref": "#/$defs/projectMountEntry"
284
+ }
285
+ },
286
+ {
287
+ "type": "object",
288
+ "description": "Named mount map form",
289
+ "additionalProperties": {
290
+ "$ref": "#/$defs/projectMountObject"
291
+ }
292
+ }
293
+ ]
294
+ },
295
+ "shell": {
296
+ "type": "object",
297
+ "description": "Shell profile customizations written via a managed shell-init hook",
298
+ "properties": {
299
+ "aliases": {
300
+ "type": "object",
301
+ "additionalProperties": { "type": "string" },
302
+ "description": "Alias name -> command map (e.g. k: kubectl)"
303
+ },
304
+ "snippets": {
305
+ "type": "array",
306
+ "items": { "type": "string" },
307
+ "description": "Raw shell snippets appended to generated shell-init"
308
+ }
309
+ },
310
+ "additionalProperties": false
311
+ },
275
312
  "customizations": {
276
313
  "type": "object",
277
314
  "properties": {
@@ -328,5 +365,43 @@
328
365
  }
329
366
  },
330
367
  "required": [],
331
- "additionalProperties": false
368
+ "additionalProperties": false,
369
+ "$defs": {
370
+ "projectMountTarget": {
371
+ "type": "string",
372
+ "enum": ["auto", "devcontainerMount", "composeVolume"]
373
+ },
374
+ "projectMountObject": {
375
+ "type": "object",
376
+ "properties": {
377
+ "value": {
378
+ "type": "string",
379
+ "description": "Raw mount spec string (escape hatch)"
380
+ },
381
+ "source": { "type": "string", "description": "Mount source path or volume name" },
382
+ "destination": { "type": "string", "description": "Container destination path" },
383
+ "type": { "type": "string", "enum": ["bind", "volume", "tmpfs"] },
384
+ "consistency": { "type": "string", "enum": ["consistent", "cached", "delegated"] },
385
+ "cached": {
386
+ "type": "boolean",
387
+ "description": "Convenience alias for consistency: cached"
388
+ },
389
+ "readOnly": { "type": "boolean" },
390
+ "target": { "$ref": "#/$defs/projectMountTarget" }
391
+ },
392
+ "additionalProperties": false,
393
+ "oneOf": [{ "required": ["value"] }, { "required": ["source", "destination"] }]
394
+ },
395
+ "projectMountEntry": {
396
+ "oneOf": [
397
+ {
398
+ "type": "string",
399
+ "description": "Raw mount spec string"
400
+ },
401
+ {
402
+ "$ref": "#/$defs/projectMountObject"
403
+ }
404
+ ]
405
+ }
406
+ }
332
407
  }
@@ -0,0 +1,569 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://raw.githubusercontent.com/veggerby/container-superposition/main/tool/schema/superposition.schema.json",
4
+ "title": "Superposition Project Configuration",
5
+ "description": "Schema for superposition.yml / .superposition.yml — the project configuration file for container-superposition. See https://github.com/veggerby/container-superposition for documentation.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "properties": {
9
+ "$schema": {
10
+ "type": "string",
11
+ "description": "JSON Schema reference URI"
12
+ },
13
+ "stack": {
14
+ "type": "string",
15
+ "enum": ["plain", "compose"],
16
+ "description": "Base devcontainer template: plain (single image) or compose (multi-service Docker Compose)"
17
+ },
18
+ "baseImage": {
19
+ "type": "string",
20
+ "enum": ["bookworm", "trixie", "alpine", "ubuntu", "custom"],
21
+ "description": "Base OS image. Use \"custom\" together with customImage to specify an arbitrary image.",
22
+ "default": "bookworm"
23
+ },
24
+ "customImage": {
25
+ "type": "string",
26
+ "description": "Fully-qualified Docker image reference. Only valid when baseImage is \"custom\".",
27
+ "examples": ["ghcr.io/myorg/my-base:latest"]
28
+ },
29
+ "containerName": {
30
+ "type": "string",
31
+ "description": "Sets the \"name\" field in devcontainer.json (displayed by VS Code)",
32
+ "examples": ["My Web API"]
33
+ },
34
+ "overlays": {
35
+ "type": "array",
36
+ "description": "Flat list of overlay IDs to include. Preferred over the legacy category arrays. Dependency resolution runs automatically.",
37
+ "items": {
38
+ "type": "string",
39
+ "enum": [
40
+ "alertmanager",
41
+ "all",
42
+ "amp",
43
+ "ansible",
44
+ "argocd",
45
+ "aws-cli",
46
+ "azure-cli",
47
+ "bun",
48
+ "claude-code",
49
+ "cloudflared",
50
+ "codex",
51
+ "comfyui",
52
+ "commitlint",
53
+ "cuda",
54
+ "devcontainer-cli",
55
+ "direnv",
56
+ "docker-in-docker",
57
+ "docker-sock",
58
+ "dotnet",
59
+ "duckdb",
60
+ "fuseki",
61
+ "gcloud",
62
+ "gemini-cli",
63
+ "git-helpers",
64
+ "go",
65
+ "grafana",
66
+ "grpc-tools",
67
+ "jaeger",
68
+ "java",
69
+ "jupyter",
70
+ "just",
71
+ "k3d",
72
+ "keycloak",
73
+ "kind",
74
+ "kubectl-helm",
75
+ "localstack",
76
+ "loki",
77
+ "mailpit",
78
+ "minio",
79
+ "mkdocs",
80
+ "mkdocs2",
81
+ "modern-cli-tools",
82
+ "mongodb",
83
+ "mysql",
84
+ "nats",
85
+ "ngrok",
86
+ "nodejs",
87
+ "ollama",
88
+ "ollama-cli",
89
+ "open-webui",
90
+ "openapi-tools",
91
+ "opencode",
92
+ "otel-collector",
93
+ "otel-demo-nodejs",
94
+ "otel-demo-python",
95
+ "pandoc",
96
+ "pgvector",
97
+ "pi",
98
+ "playwright",
99
+ "postgres",
100
+ "powershell",
101
+ "pre-commit",
102
+ "prometheus",
103
+ "promtail",
104
+ "pulumi",
105
+ "python",
106
+ "qdrant",
107
+ "rabbitmq",
108
+ "redis",
109
+ "redpanda",
110
+ "rocm",
111
+ "rust",
112
+ "skaffold",
113
+ "spec-kit",
114
+ "sqlite",
115
+ "sqlserver",
116
+ "task",
117
+ "tempo",
118
+ "terraform",
119
+ "tilt",
120
+ "windsurf-cli"
121
+ ],
122
+ "description": "Overlay identifier"
123
+ },
124
+ "uniqueItems": true
125
+ },
126
+ "preset": {
127
+ "type": "string",
128
+ "enum": [
129
+ "data-engineering",
130
+ "docs-site",
131
+ "event-sourced-service",
132
+ "frontend",
133
+ "full-observability",
134
+ "fullstack",
135
+ "k8s-dev",
136
+ "k8s-operator-dev",
137
+ "local-llm",
138
+ "microservice",
139
+ "sdd",
140
+ "vector-ai",
141
+ "web-api"
142
+ ],
143
+ "description": "ID of a preset (meta-overlay) to expand. Use cs list --presets to browse available presets."
144
+ },
145
+ "presetChoices": {
146
+ "type": "object",
147
+ "description": "Parameter values passed to the selected preset. Keys depend on the preset definition.",
148
+ "additionalProperties": {
149
+ "type": "string"
150
+ }
151
+ },
152
+ "outputPath": {
153
+ "type": "string",
154
+ "description": "Where to write the generated devcontainer files. Default: .devcontainer",
155
+ "default": "./.devcontainer",
156
+ "examples": ["./.devcontainer"]
157
+ },
158
+ "portOffset": {
159
+ "type": "integer",
160
+ "minimum": 0,
161
+ "description": "Shift all overlay-declared host ports by this integer. Useful for running multiple instances on one machine.",
162
+ "examples": [100, 200]
163
+ },
164
+ "target": {
165
+ "type": "string",
166
+ "enum": ["local", "codespaces", "gitpod", "devpod"],
167
+ "description": "Deployment target profile. Applies environment-specific patches during generation."
168
+ },
169
+ "minimal": {
170
+ "type": "boolean",
171
+ "description": "When true, overlays marked with minimal: true in their overlay.yml are excluded. Useful for CI environments."
172
+ },
173
+ "editor": {
174
+ "type": "string",
175
+ "enum": ["vscode", "jetbrains", "none"],
176
+ "description": "Editor profile: vscode (default, includes extensions/settings), jetbrains (removes VS Code config), none (removes VS Code config)",
177
+ "default": "vscode"
178
+ },
179
+ "env": {
180
+ "type": "object",
181
+ "description": "Runtime environment variables. Routed to devcontainer.json remoteEnv or docker-compose environment based on stack and target.",
182
+ "additionalProperties": {
183
+ "oneOf": [
184
+ {
185
+ "type": "string",
186
+ "description": "String shorthand — target is auto-detected based on stack (plain→remoteEnv, compose→docker-compose environment)"
187
+ },
188
+ {
189
+ "type": "object",
190
+ "description": "Long form with explicit routing target",
191
+ "required": ["value"],
192
+ "additionalProperties": false,
193
+ "properties": {
194
+ "value": {
195
+ "type": "string",
196
+ "description": "Variable value (supports ${VAR} and ${VAR:-default} syntax)"
197
+ },
198
+ "target": {
199
+ "type": "string",
200
+ "enum": ["auto", "remoteEnv", "composeEnv"],
201
+ "description": "auto (default): plain→remoteEnv, compose→docker-compose environment; remoteEnv: always devcontainer.json; composeEnv: always docker-compose (compose only)",
202
+ "default": "auto"
203
+ }
204
+ }
205
+ }
206
+ ]
207
+ }
208
+ },
209
+ "mounts": {
210
+ "oneOf": [
211
+ {
212
+ "type": "array",
213
+ "description": "List of filesystem mounts",
214
+ "items": {
215
+ "oneOf": [
216
+ {
217
+ "type": "string",
218
+ "description": "Raw mount string (escape hatch)",
219
+ "minLength": 1
220
+ },
221
+ {
222
+ "type": "object",
223
+ "description": "Structured mount using source/destination fields",
224
+ "required": ["source", "destination"],
225
+ "additionalProperties": false,
226
+ "properties": {
227
+ "source": {
228
+ "type": "string",
229
+ "description": "Mount source path or volume name"
230
+ },
231
+ "destination": {
232
+ "type": "string",
233
+ "description": "Mount destination path inside the container"
234
+ },
235
+ "type": {
236
+ "type": "string",
237
+ "enum": ["bind", "volume", "tmpfs"],
238
+ "description": "Mount type (default: bind)"
239
+ },
240
+ "consistency": {
241
+ "type": "string",
242
+ "enum": ["consistent", "cached", "delegated"],
243
+ "description": "Mount consistency mode"
244
+ },
245
+ "cached": {
246
+ "type": "boolean",
247
+ "description": "Shorthand for consistency: cached"
248
+ },
249
+ "readOnly": {
250
+ "type": "boolean",
251
+ "description": "Make the mount read-only"
252
+ },
253
+ "target": {
254
+ "type": "string",
255
+ "enum": ["auto", "devcontainerMount", "composeVolume"],
256
+ "description": "Routing target: auto (default) always routes to devcontainer.json mounts[]; composeVolume routes to docker-compose volumes (compose stack only)",
257
+ "default": "auto"
258
+ }
259
+ }
260
+ },
261
+ {
262
+ "type": "object",
263
+ "description": "Raw-value mount with optional routing target",
264
+ "required": ["value"],
265
+ "additionalProperties": false,
266
+ "properties": {
267
+ "value": {
268
+ "type": "string",
269
+ "description": "Raw mount string",
270
+ "minLength": 1
271
+ },
272
+ "target": {
273
+ "type": "string",
274
+ "enum": ["auto", "devcontainerMount", "composeVolume"],
275
+ "description": "Routing target override",
276
+ "default": "auto"
277
+ }
278
+ }
279
+ }
280
+ ]
281
+ }
282
+ },
283
+ {
284
+ "type": "object",
285
+ "description": "Named map of filesystem mounts",
286
+ "additionalProperties": {
287
+ "type": "object",
288
+ "description": "Structured mount (named form; name is not serialized back)",
289
+ "required": ["source", "destination"],
290
+ "additionalProperties": false,
291
+ "properties": {
292
+ "source": {
293
+ "type": "string"
294
+ },
295
+ "destination": {
296
+ "type": "string"
297
+ },
298
+ "type": {
299
+ "type": "string",
300
+ "enum": ["bind", "volume", "tmpfs"]
301
+ },
302
+ "consistency": {
303
+ "type": "string",
304
+ "enum": ["consistent", "cached", "delegated"]
305
+ },
306
+ "cached": {
307
+ "type": "boolean"
308
+ },
309
+ "readOnly": {
310
+ "type": "boolean"
311
+ },
312
+ "target": {
313
+ "type": "string",
314
+ "enum": ["auto", "devcontainerMount", "composeVolume"]
315
+ }
316
+ }
317
+ }
318
+ }
319
+ ]
320
+ },
321
+ "shell": {
322
+ "type": "object",
323
+ "description": "Declarative shell profile customizations (aliases and snippets). Use env for environment variables.",
324
+ "additionalProperties": false,
325
+ "properties": {
326
+ "aliases": {
327
+ "type": "object",
328
+ "description": "Shell aliases written to .devcontainer/scripts/shell-init.sh",
329
+ "additionalProperties": {
330
+ "type": "string"
331
+ },
332
+ "examples": [
333
+ {
334
+ "k": "kubectl",
335
+ "kgp": "kubectl get pods"
336
+ }
337
+ ]
338
+ },
339
+ "snippets": {
340
+ "type": "array",
341
+ "description": "Shell snippet lines appended to shell-init.sh. Guard shell-specific syntax with $BASH_VERSION / $ZSH_VERSION.",
342
+ "items": {
343
+ "type": "string"
344
+ }
345
+ }
346
+ }
347
+ },
348
+ "customizations": {
349
+ "type": "object",
350
+ "description": "Inline patches applied during generation (equivalent to .devcontainer/custom/ patches).",
351
+ "additionalProperties": false,
352
+ "properties": {
353
+ "devcontainerPatch": {
354
+ "type": "object",
355
+ "description": "Deep-merged into devcontainer.json after all overlays are applied"
356
+ },
357
+ "dockerComposePatch": {
358
+ "type": "object",
359
+ "description": "Deep-merged into docker-compose.yml after all overlays are applied (compose stack only)"
360
+ },
361
+ "envTemplate": {
362
+ "type": "object",
363
+ "description": "Key/value pairs written to .devcontainer/.env.example",
364
+ "additionalProperties": {
365
+ "type": "string"
366
+ }
367
+ },
368
+ "environment": {
369
+ "type": "object",
370
+ "description": "Alias for envTemplate (deprecated; prefer envTemplate)",
371
+ "additionalProperties": {
372
+ "type": "string"
373
+ }
374
+ },
375
+ "scripts": {
376
+ "type": "object",
377
+ "description": "Shell commands appended to postCreate / postStart hooks",
378
+ "additionalProperties": false,
379
+ "properties": {
380
+ "postCreate": {
381
+ "type": "array",
382
+ "items": {
383
+ "type": "string"
384
+ },
385
+ "description": "Commands run once after container creation (postCreateCommand)"
386
+ },
387
+ "postStart": {
388
+ "type": "array",
389
+ "items": {
390
+ "type": "string"
391
+ },
392
+ "description": "Commands run each time the container starts (postStartCommand)"
393
+ }
394
+ }
395
+ },
396
+ "files": {
397
+ "type": "array",
398
+ "description": "Extra files to write into the output directory",
399
+ "items": {
400
+ "type": "object",
401
+ "required": ["path", "content"],
402
+ "additionalProperties": false,
403
+ "properties": {
404
+ "path": {
405
+ "type": "string",
406
+ "description": "Destination path"
407
+ },
408
+ "content": {
409
+ "type": "string",
410
+ "description": "File content"
411
+ }
412
+ }
413
+ }
414
+ }
415
+ }
416
+ },
417
+ "parameters": {
418
+ "type": "object",
419
+ "description": "Overlay parameter values. Keys correspond to parameters declared in overlay.yml. Values substitute {{cs.KEY}} tokens throughout generated files.",
420
+ "additionalProperties": {
421
+ "oneOf": [
422
+ {
423
+ "type": "string"
424
+ },
425
+ {
426
+ "type": "number"
427
+ }
428
+ ],
429
+ "description": "Parameter value (strings and numbers are both accepted)"
430
+ }
431
+ },
432
+ "language": {
433
+ "type": "array",
434
+ "description": "Deprecated — use overlays: [...] instead",
435
+ "items": {
436
+ "type": "string",
437
+ "enum": [
438
+ "bun",
439
+ "dotnet",
440
+ "go",
441
+ "java",
442
+ "jupyter",
443
+ "nodejs",
444
+ "powershell",
445
+ "python",
446
+ "rust"
447
+ ]
448
+ },
449
+ "deprecated": true
450
+ },
451
+ "database": {
452
+ "type": "array",
453
+ "description": "Deprecated — use overlays: [...] instead",
454
+ "items": {
455
+ "type": "string",
456
+ "enum": [
457
+ "duckdb",
458
+ "fuseki",
459
+ "minio",
460
+ "mongodb",
461
+ "mysql",
462
+ "nats",
463
+ "pgvector",
464
+ "postgres",
465
+ "qdrant",
466
+ "rabbitmq",
467
+ "redis",
468
+ "redpanda",
469
+ "sqlite",
470
+ "sqlserver"
471
+ ]
472
+ },
473
+ "deprecated": true
474
+ },
475
+ "observability": {
476
+ "type": "array",
477
+ "description": "Deprecated — use overlays: [...] instead",
478
+ "items": {
479
+ "type": "string",
480
+ "enum": [
481
+ "alertmanager",
482
+ "grafana",
483
+ "jaeger",
484
+ "loki",
485
+ "otel-collector",
486
+ "otel-demo-nodejs",
487
+ "otel-demo-python",
488
+ "prometheus",
489
+ "promtail",
490
+ "tempo"
491
+ ]
492
+ },
493
+ "deprecated": true
494
+ },
495
+ "cloudTools": {
496
+ "type": "array",
497
+ "description": "Deprecated — use overlays: [...] instead",
498
+ "items": {
499
+ "type": "string",
500
+ "enum": [
501
+ "ansible",
502
+ "argocd",
503
+ "aws-cli",
504
+ "azure-cli",
505
+ "gcloud",
506
+ "k3d",
507
+ "kind",
508
+ "kubectl-helm",
509
+ "localstack",
510
+ "pulumi",
511
+ "terraform"
512
+ ]
513
+ },
514
+ "deprecated": true
515
+ },
516
+ "devTools": {
517
+ "type": "array",
518
+ "description": "Deprecated — use overlays: [...] instead",
519
+ "items": {
520
+ "type": "string",
521
+ "enum": [
522
+ "all",
523
+ "amp",
524
+ "claude-code",
525
+ "cloudflared",
526
+ "codex",
527
+ "comfyui",
528
+ "commitlint",
529
+ "cuda",
530
+ "devcontainer-cli",
531
+ "direnv",
532
+ "docker-in-docker",
533
+ "docker-sock",
534
+ "gemini-cli",
535
+ "git-helpers",
536
+ "grpc-tools",
537
+ "just",
538
+ "keycloak",
539
+ "mailpit",
540
+ "mkdocs",
541
+ "mkdocs2",
542
+ "modern-cli-tools",
543
+ "ngrok",
544
+ "ollama",
545
+ "ollama-cli",
546
+ "open-webui",
547
+ "openapi-tools",
548
+ "opencode",
549
+ "pandoc",
550
+ "pi",
551
+ "playwright",
552
+ "pre-commit",
553
+ "rocm",
554
+ "skaffold",
555
+ "spec-kit",
556
+ "task",
557
+ "tilt",
558
+ "windsurf-cli"
559
+ ]
560
+ },
561
+ "deprecated": true
562
+ },
563
+ "playwright": {
564
+ "type": "boolean",
565
+ "description": "Deprecated — use overlays: [playwright] instead",
566
+ "deprecated": true
567
+ }
568
+ }
569
+ }