container-superposition 0.1.1

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 (327) hide show
  1. package/README.md +843 -0
  2. package/dist/scripts/init.d.ts +3 -0
  3. package/dist/scripts/init.d.ts.map +1 -0
  4. package/dist/scripts/init.js +1190 -0
  5. package/dist/scripts/init.js.map +1 -0
  6. package/dist/scripts/migrate-to-manifests.d.ts +12 -0
  7. package/dist/scripts/migrate-to-manifests.d.ts.map +1 -0
  8. package/dist/scripts/migrate-to-manifests.js +230 -0
  9. package/dist/scripts/migrate-to-manifests.js.map +1 -0
  10. package/dist/tool/questionnaire/composer.d.ts +6 -0
  11. package/dist/tool/questionnaire/composer.d.ts.map +1 -0
  12. package/dist/tool/questionnaire/composer.js +1232 -0
  13. package/dist/tool/questionnaire/composer.js.map +1 -0
  14. package/dist/tool/readme/markdown-parser.d.ts +30 -0
  15. package/dist/tool/readme/markdown-parser.d.ts.map +1 -0
  16. package/dist/tool/readme/markdown-parser.js +139 -0
  17. package/dist/tool/readme/markdown-parser.js.map +1 -0
  18. package/dist/tool/readme/readme-generator.d.ts +9 -0
  19. package/dist/tool/readme/readme-generator.d.ts.map +1 -0
  20. package/dist/tool/readme/readme-generator.js +422 -0
  21. package/dist/tool/readme/readme-generator.js.map +1 -0
  22. package/dist/tool/schema/custom-loader.d.ts +17 -0
  23. package/dist/tool/schema/custom-loader.d.ts.map +1 -0
  24. package/dist/tool/schema/custom-loader.js +149 -0
  25. package/dist/tool/schema/custom-loader.js.map +1 -0
  26. package/dist/tool/schema/overlay-loader.d.ts +47 -0
  27. package/dist/tool/schema/overlay-loader.d.ts.map +1 -0
  28. package/dist/tool/schema/overlay-loader.js +252 -0
  29. package/dist/tool/schema/overlay-loader.js.map +1 -0
  30. package/dist/tool/schema/types.d.ts +212 -0
  31. package/dist/tool/schema/types.d.ts.map +1 -0
  32. package/dist/tool/schema/types.js +5 -0
  33. package/dist/tool/schema/types.js.map +1 -0
  34. package/docs/README.md +308 -0
  35. package/docs/architecture.md +233 -0
  36. package/docs/creating-overlays.md +549 -0
  37. package/docs/custom-patches.md +540 -0
  38. package/docs/dependencies.md +279 -0
  39. package/docs/examples/custom-patches-example.md +85 -0
  40. package/docs/examples.md +576 -0
  41. package/docs/messaging-comparison.md +265 -0
  42. package/docs/messaging-quick-start.md +385 -0
  43. package/docs/observability-workflow.md +537 -0
  44. package/docs/overlay-manifest-refactoring.md +214 -0
  45. package/docs/overlay-metadata-archive.md +54 -0
  46. package/docs/overlays.md +523 -0
  47. package/docs/presets-architecture.md +498 -0
  48. package/docs/presets.md +366 -0
  49. package/docs/publishing.md +476 -0
  50. package/docs/quick-reference.md +326 -0
  51. package/docs/ux.md +170 -0
  52. package/features/README.md +85 -0
  53. package/features/cross-distro-packages/README.md +146 -0
  54. package/features/cross-distro-packages/devcontainer-feature.json +20 -0
  55. package/features/cross-distro-packages/install.sh +58 -0
  56. package/features/local-secrets-manager/devcontainer-feature.json +18 -0
  57. package/features/local-secrets-manager/install.sh +127 -0
  58. package/features/project-scaffolder/devcontainer-feature.json +24 -0
  59. package/features/project-scaffolder/install.sh +100 -0
  60. package/features/team-conventions/devcontainer-feature.json +24 -0
  61. package/features/team-conventions/install.sh +93 -0
  62. package/overlays/.registry/README.md +14 -0
  63. package/overlays/.registry/base-images.yml +26 -0
  64. package/overlays/.registry/base-templates.yml +7 -0
  65. package/overlays/README.md +155 -0
  66. package/overlays/alertmanager/.env.example +5 -0
  67. package/overlays/alertmanager/README.md +465 -0
  68. package/overlays/alertmanager/alert-rules.yml +56 -0
  69. package/overlays/alertmanager/alertmanager.yml +42 -0
  70. package/overlays/alertmanager/devcontainer.patch.json +12 -0
  71. package/overlays/alertmanager/docker-compose.yml +20 -0
  72. package/overlays/alertmanager/overlay.yml +17 -0
  73. package/overlays/alertmanager/setup.sh +53 -0
  74. package/overlays/alertmanager/verify.sh +31 -0
  75. package/overlays/aws-cli/README.md +473 -0
  76. package/overlays/aws-cli/devcontainer.patch.json +13 -0
  77. package/overlays/aws-cli/overlay.yml +13 -0
  78. package/overlays/azure-cli/README.md +551 -0
  79. package/overlays/azure-cli/devcontainer.patch.json +8 -0
  80. package/overlays/azure-cli/overlay.yml +13 -0
  81. package/overlays/bun/README.md +312 -0
  82. package/overlays/bun/devcontainer.patch.json +41 -0
  83. package/overlays/bun/overlay.yml +16 -0
  84. package/overlays/bun/setup.sh +79 -0
  85. package/overlays/bun/verify.sh +30 -0
  86. package/overlays/codex/README.md +128 -0
  87. package/overlays/codex/devcontainer.patch.json +3 -0
  88. package/overlays/codex/overlay.yml +14 -0
  89. package/overlays/codex/setup.sh +24 -0
  90. package/overlays/codex/verify.sh +30 -0
  91. package/overlays/commitlint/README.md +333 -0
  92. package/overlays/commitlint/devcontainer.patch.json +8 -0
  93. package/overlays/commitlint/overlay.yml +16 -0
  94. package/overlays/commitlint/setup.sh +234 -0
  95. package/overlays/direnv/README.md +504 -0
  96. package/overlays/direnv/devcontainer.patch.json +6 -0
  97. package/overlays/direnv/overlay.yml +13 -0
  98. package/overlays/direnv/setup.sh +139 -0
  99. package/overlays/docker-in-docker/README.md +534 -0
  100. package/overlays/docker-in-docker/devcontainer.patch.json +10 -0
  101. package/overlays/docker-in-docker/overlay.yml +13 -0
  102. package/overlays/docker-sock/README.md +256 -0
  103. package/overlays/docker-sock/devcontainer.patch.json +9 -0
  104. package/overlays/docker-sock/docker-compose.yml +8 -0
  105. package/overlays/docker-sock/overlay.yml +13 -0
  106. package/overlays/dotnet/README.md +147 -0
  107. package/overlays/dotnet/devcontainer.patch.json +51 -0
  108. package/overlays/dotnet/global-tools.txt +24 -0
  109. package/overlays/dotnet/overlay.yml +13 -0
  110. package/overlays/dotnet/setup.sh +51 -0
  111. package/overlays/dotnet/verify.sh +26 -0
  112. package/overlays/gcloud/README.md +269 -0
  113. package/overlays/gcloud/devcontainer.patch.json +14 -0
  114. package/overlays/gcloud/overlay.yml +14 -0
  115. package/overlays/gcloud/verify.sh +52 -0
  116. package/overlays/git-helpers/README.md +168 -0
  117. package/overlays/git-helpers/devcontainer.patch.json +33 -0
  118. package/overlays/git-helpers/overlay.yml +15 -0
  119. package/overlays/git-helpers/setup.sh +91 -0
  120. package/overlays/go/README.md +293 -0
  121. package/overlays/go/devcontainer.patch.json +43 -0
  122. package/overlays/go/overlay.yml +15 -0
  123. package/overlays/go/setup.sh +33 -0
  124. package/overlays/go/verify.sh +40 -0
  125. package/overlays/grafana/.env.example +9 -0
  126. package/overlays/grafana/README.md +462 -0
  127. package/overlays/grafana/dashboard-provider.yml +11 -0
  128. package/overlays/grafana/dashboards/observability-overview.json +263 -0
  129. package/overlays/grafana/devcontainer.patch.json +12 -0
  130. package/overlays/grafana/docker-compose.yml +27 -0
  131. package/overlays/grafana/grafana-datasources.yml +57 -0
  132. package/overlays/grafana/overlay.yml +21 -0
  133. package/overlays/grafana/verify.sh +34 -0
  134. package/overlays/jaeger/.env.example +7 -0
  135. package/overlays/jaeger/README.md +867 -0
  136. package/overlays/jaeger/devcontainer.patch.json +12 -0
  137. package/overlays/jaeger/docker-compose.yml +17 -0
  138. package/overlays/jaeger/overlay.yml +19 -0
  139. package/overlays/java/README.md +267 -0
  140. package/overlays/java/devcontainer.patch.json +44 -0
  141. package/overlays/java/overlay.yml +16 -0
  142. package/overlays/java/setup.sh +41 -0
  143. package/overlays/java/verify.sh +42 -0
  144. package/overlays/just/README.md +443 -0
  145. package/overlays/just/devcontainer.patch.json +3 -0
  146. package/overlays/just/overlay.yml +13 -0
  147. package/overlays/just/setup.sh +182 -0
  148. package/overlays/kubectl-helm/README.md +660 -0
  149. package/overlays/kubectl-helm/devcontainer.patch.json +10 -0
  150. package/overlays/kubectl-helm/overlay.yml +13 -0
  151. package/overlays/loki/.env.example +5 -0
  152. package/overlays/loki/README.md +1156 -0
  153. package/overlays/loki/devcontainer.patch.json +12 -0
  154. package/overlays/loki/docker-compose.yml +18 -0
  155. package/overlays/loki/loki-config.yaml +45 -0
  156. package/overlays/loki/overlay.yml +17 -0
  157. package/overlays/minio/.env.example +9 -0
  158. package/overlays/minio/README.md +639 -0
  159. package/overlays/minio/devcontainer.patch.json +30 -0
  160. package/overlays/minio/docker-compose.yml +28 -0
  161. package/overlays/minio/overlay.yml +18 -0
  162. package/overlays/minio/setup.sh +61 -0
  163. package/overlays/minio/verify.sh +64 -0
  164. package/overlays/mkdocs/README.md +309 -0
  165. package/overlays/mkdocs/devcontainer.patch.json +24 -0
  166. package/overlays/mkdocs/overlay.yml +15 -0
  167. package/overlays/modern-cli-tools/README.md +556 -0
  168. package/overlays/modern-cli-tools/devcontainer.patch.json +3 -0
  169. package/overlays/modern-cli-tools/overlay.yml +13 -0
  170. package/overlays/modern-cli-tools/setup.sh +153 -0
  171. package/overlays/mongodb/.env.example +9 -0
  172. package/overlays/mongodb/README.md +481 -0
  173. package/overlays/mongodb/devcontainer.patch.json +32 -0
  174. package/overlays/mongodb/docker-compose.yml +44 -0
  175. package/overlays/mongodb/overlay.yml +17 -0
  176. package/overlays/mongodb/verify.sh +48 -0
  177. package/overlays/mysql/.env.example +11 -0
  178. package/overlays/mysql/README.md +542 -0
  179. package/overlays/mysql/devcontainer.patch.json +34 -0
  180. package/overlays/mysql/docker-compose.yml +55 -0
  181. package/overlays/mysql/overlay.yml +16 -0
  182. package/overlays/mysql/verify.sh +48 -0
  183. package/overlays/nats/.env.example +5 -0
  184. package/overlays/nats/README.md +762 -0
  185. package/overlays/nats/devcontainer.patch.json +24 -0
  186. package/overlays/nats/docker-compose.yml +31 -0
  187. package/overlays/nats/overlay.yml +18 -0
  188. package/overlays/nats/verify.sh +50 -0
  189. package/overlays/ngrok/README.md +503 -0
  190. package/overlays/ngrok/devcontainer.patch.json +3 -0
  191. package/overlays/ngrok/overlay.yml +14 -0
  192. package/overlays/ngrok/setup.sh +125 -0
  193. package/overlays/nodejs/README.md +192 -0
  194. package/overlays/nodejs/devcontainer.patch.json +49 -0
  195. package/overlays/nodejs/global-packages.txt +16 -0
  196. package/overlays/nodejs/overlay.yml +14 -0
  197. package/overlays/nodejs/setup.sh +46 -0
  198. package/overlays/nodejs/verify.sh +32 -0
  199. package/overlays/otel-collector/.env.example +9 -0
  200. package/overlays/otel-collector/README.md +1257 -0
  201. package/overlays/otel-collector/devcontainer.patch.json +28 -0
  202. package/overlays/otel-collector/docker-compose.yml +22 -0
  203. package/overlays/otel-collector/otel-collector-config.yaml +68 -0
  204. package/overlays/otel-collector/overlay.yml +21 -0
  205. package/overlays/otel-collector/setup.sh +49 -0
  206. package/overlays/otel-demo-nodejs/.env.example +2 -0
  207. package/overlays/otel-demo-nodejs/Dockerfile-otel-demo-nodejs +17 -0
  208. package/overlays/otel-demo-nodejs/README.md +409 -0
  209. package/overlays/otel-demo-nodejs/devcontainer.patch.json +12 -0
  210. package/overlays/otel-demo-nodejs/docker-compose.yml +19 -0
  211. package/overlays/otel-demo-nodejs/overlay.yml +23 -0
  212. package/overlays/otel-demo-nodejs/package-otel-demo-nodejs.json +20 -0
  213. package/overlays/otel-demo-nodejs/server-otel-demo-nodejs.js +259 -0
  214. package/overlays/otel-demo-nodejs/tracing-otel-demo-nodejs.js +57 -0
  215. package/overlays/otel-demo-nodejs/verify.sh +31 -0
  216. package/overlays/otel-demo-python/.env.example +2 -0
  217. package/overlays/otel-demo-python/Dockerfile-otel-demo-python +16 -0
  218. package/overlays/otel-demo-python/README.md +82 -0
  219. package/overlays/otel-demo-python/app-otel-demo-python.py +208 -0
  220. package/overlays/otel-demo-python/devcontainer.patch.json +12 -0
  221. package/overlays/otel-demo-python/docker-compose.yml +19 -0
  222. package/overlays/otel-demo-python/overlay.yml +23 -0
  223. package/overlays/otel-demo-python/requirements-otel-demo-python.txt +4 -0
  224. package/overlays/otel-demo-python/verify.sh +31 -0
  225. package/overlays/playwright/README.md +629 -0
  226. package/overlays/playwright/devcontainer.patch.json +9 -0
  227. package/overlays/playwright/overlay.yml +13 -0
  228. package/overlays/postgres/.env.example +6 -0
  229. package/overlays/postgres/README.md +602 -0
  230. package/overlays/postgres/devcontainer.patch.json +21 -0
  231. package/overlays/postgres/docker-compose.yml +22 -0
  232. package/overlays/postgres/overlay.yml +15 -0
  233. package/overlays/postgres/verify.sh +45 -0
  234. package/overlays/powershell/README.md +314 -0
  235. package/overlays/powershell/devcontainer.patch.json +22 -0
  236. package/overlays/powershell/overlay.yml +13 -0
  237. package/overlays/powershell/setup.sh +29 -0
  238. package/overlays/powershell/verify.sh +38 -0
  239. package/overlays/pre-commit/README.md +263 -0
  240. package/overlays/pre-commit/devcontainer.patch.json +9 -0
  241. package/overlays/pre-commit/overlay.yml +16 -0
  242. package/overlays/pre-commit/setup.sh +129 -0
  243. package/overlays/presets/docs-site.yml +118 -0
  244. package/overlays/presets/fullstack.yml +181 -0
  245. package/overlays/presets/microservice.yml +118 -0
  246. package/overlays/presets/web-api.yml +109 -0
  247. package/overlays/prometheus/.env.example +5 -0
  248. package/overlays/prometheus/README.md +1246 -0
  249. package/overlays/prometheus/devcontainer.patch.json +12 -0
  250. package/overlays/prometheus/docker-compose.yml +22 -0
  251. package/overlays/prometheus/overlay.yml +17 -0
  252. package/overlays/prometheus/prometheus.yml +12 -0
  253. package/overlays/prometheus/verify.sh +34 -0
  254. package/overlays/promtail/.env.example +2 -0
  255. package/overlays/promtail/README.md +357 -0
  256. package/overlays/promtail/devcontainer.patch.json +5 -0
  257. package/overlays/promtail/docker-compose.yml +16 -0
  258. package/overlays/promtail/overlay.yml +17 -0
  259. package/overlays/promtail/promtail-config.yaml +60 -0
  260. package/overlays/promtail/verify.sh +31 -0
  261. package/overlays/pulumi/README.md +472 -0
  262. package/overlays/pulumi/devcontainer.patch.json +13 -0
  263. package/overlays/pulumi/overlay.yml +14 -0
  264. package/overlays/pulumi/verify.sh +31 -0
  265. package/overlays/python/README.md +919 -0
  266. package/overlays/python/devcontainer.patch.json +41 -0
  267. package/overlays/python/overlay.yml +12 -0
  268. package/overlays/python/requirements-overlay.txt +13 -0
  269. package/overlays/python/setup.sh +47 -0
  270. package/overlays/python/verify.sh +32 -0
  271. package/overlays/rabbitmq/.env.example +7 -0
  272. package/overlays/rabbitmq/README.md +680 -0
  273. package/overlays/rabbitmq/devcontainer.patch.json +28 -0
  274. package/overlays/rabbitmq/docker-compose.yml +30 -0
  275. package/overlays/rabbitmq/overlay.yml +18 -0
  276. package/overlays/rabbitmq/verify.sh +41 -0
  277. package/overlays/redis/.env.example +4 -0
  278. package/overlays/redis/README.md +776 -0
  279. package/overlays/redis/devcontainer.patch.json +21 -0
  280. package/overlays/redis/docker-compose.yml +21 -0
  281. package/overlays/redis/overlay.yml +15 -0
  282. package/overlays/redis/verify.sh +41 -0
  283. package/overlays/redpanda/.env.example +10 -0
  284. package/overlays/redpanda/README.md +703 -0
  285. package/overlays/redpanda/devcontainer.patch.json +37 -0
  286. package/overlays/redpanda/docker-compose.yml +67 -0
  287. package/overlays/redpanda/overlay.yml +21 -0
  288. package/overlays/redpanda/verify.sh +48 -0
  289. package/overlays/rust/README.md +299 -0
  290. package/overlays/rust/devcontainer.patch.json +39 -0
  291. package/overlays/rust/overlay.yml +15 -0
  292. package/overlays/rust/setup.sh +36 -0
  293. package/overlays/rust/verify.sh +51 -0
  294. package/overlays/sqlite/README.md +584 -0
  295. package/overlays/sqlite/devcontainer.patch.json +14 -0
  296. package/overlays/sqlite/overlay.yml +15 -0
  297. package/overlays/sqlite/setup.sh +27 -0
  298. package/overlays/sqlite/verify.sh +43 -0
  299. package/overlays/sqlserver/.env.example +6 -0
  300. package/overlays/sqlserver/README.md +592 -0
  301. package/overlays/sqlserver/devcontainer.patch.json +22 -0
  302. package/overlays/sqlserver/docker-compose.yml +32 -0
  303. package/overlays/sqlserver/overlay.yml +17 -0
  304. package/overlays/sqlserver/verify.sh +30 -0
  305. package/overlays/tempo/.env.example +5 -0
  306. package/overlays/tempo/README.md +273 -0
  307. package/overlays/tempo/devcontainer.patch.json +12 -0
  308. package/overlays/tempo/docker-compose.yml +20 -0
  309. package/overlays/tempo/overlay.yml +20 -0
  310. package/overlays/tempo/tempo-config.yaml +32 -0
  311. package/overlays/tempo/verify.sh +31 -0
  312. package/overlays/terraform/README.md +389 -0
  313. package/overlays/terraform/devcontainer.patch.json +15 -0
  314. package/overlays/terraform/overlay.yml +14 -0
  315. package/overlays/terraform/verify.sh +63 -0
  316. package/package.json +74 -0
  317. package/templates/README.md +285 -0
  318. package/templates/compose/.devcontainer/devcontainer.json +46 -0
  319. package/templates/compose/.devcontainer/docker-compose.yml +12 -0
  320. package/templates/compose/README.md +20 -0
  321. package/templates/plain/.devcontainer/devcontainer.json +35 -0
  322. package/templates/plain/README.md +21 -0
  323. package/tool/README.md +281 -0
  324. package/tool/schema/base-images.schema.json +43 -0
  325. package/tool/schema/base-templates.schema.json +34 -0
  326. package/tool/schema/config.schema.json +71 -0
  327. package/tool/schema/overlay-manifest.schema.json +86 -0
@@ -0,0 +1,146 @@
1
+ # Cross-Distribution Package Manager
2
+
3
+ A devcontainer feature that installs system packages with automatic distribution detection, supporting both apt (Debian/Ubuntu) and apk (Alpine Linux) package managers.
4
+
5
+ ## Features
6
+
7
+ - 🔍 **Auto-detection**: Automatically detects whether the container uses apt or apk
8
+ - 📦 **Distro-specific packages**: Specify different package names for each distribution
9
+ - 🧹 **Clean installation**: Cleans up package manager caches to minimize image size
10
+ - ⚡ **Fast**: No unnecessary updates or cache rebuilds
11
+
12
+ ## Usage
13
+
14
+ ### Basic Example
15
+
16
+ ```json
17
+ {
18
+ "features": {
19
+ "./features/cross-distro-packages": {
20
+ "apt": "build-essential python3-dev",
21
+ "apk": "build-base python3-dev"
22
+ }
23
+ }
24
+ }
25
+ ```
26
+
27
+ ### Real-World Examples
28
+
29
+ **Node.js Build Tools:**
30
+
31
+ ```json
32
+ {
33
+ "features": {
34
+ "./features/cross-distro-packages": {
35
+ "apt": "build-essential",
36
+ "apk": "build-base"
37
+ }
38
+ }
39
+ }
40
+ ```
41
+
42
+ **Python Development:**
43
+
44
+ ```json
45
+ {
46
+ "features": {
47
+ "./features/cross-distro-packages": {
48
+ "apt": "build-essential python3-dev",
49
+ "apk": "build-base python3-dev"
50
+ }
51
+ }
52
+ }
53
+ ```
54
+
55
+ **Redis CLI Tools:**
56
+
57
+ ```json
58
+ {
59
+ "features": {
60
+ "./features/cross-distro-packages": {
61
+ "apt": "redis-tools",
62
+ "apk": "redis"
63
+ }
64
+ }
65
+ }
66
+ ```
67
+
68
+ **.NET Dependencies:**
69
+
70
+ ```json
71
+ {
72
+ "features": {
73
+ "./features/cross-distro-packages": {
74
+ "apt": "xdg-utils pass sshpass build-essential netcat-traditional iputils-ping dnsutils git-lfs sqlite3",
75
+ "apk": "xdg-utils pass sshpass build-base netcat-openbsd iputils bind-tools git-lfs sqlite"
76
+ }
77
+ }
78
+ }
79
+ ```
80
+
81
+ ## Options
82
+
83
+ | Option | Type | Default | Description |
84
+ | ------ | ------ | ------- | ----------------------------------------------------------------------------- |
85
+ | `apt` | string | `""` | Space-separated list of packages for apt-based distributions (Debian, Ubuntu) |
86
+ | `apk` | string | `""` | Space-separated list of packages for apk-based distributions (Alpine Linux) |
87
+
88
+ ## Package Name Differences
89
+
90
+ Common packages that have different names across distributions:
91
+
92
+ | Debian/Ubuntu (apt) | Alpine (apk) | Purpose |
93
+ | -------------------- | ---------------- | ----------------------------- |
94
+ | `build-essential` | `build-base` | C/C++ compiler toolchain |
95
+ | `dnsutils` | `bind-tools` | DNS utilities (dig, nslookup) |
96
+ | `netcat-traditional` | `netcat-openbsd` | Network utility |
97
+ | `sqlite3` | `sqlite` | SQLite database |
98
+ | `redis-tools` | `redis` | Redis CLI tools |
99
+
100
+ ## How It Works
101
+
102
+ 1. Checks for `apk` command (Alpine Linux)
103
+ 2. Falls back to `apt-get` (Debian/Ubuntu)
104
+ 3. **Deduplicates** the package list (if multiple overlays specify the same packages)
105
+ 4. Installs the appropriate package list
106
+ 5. Cleans up package manager caches
107
+
108
+ ## Multiple Overlays
109
+
110
+ When using multiple overlays that reference this feature, packages are **automatically deduplicated** at two levels:
111
+
112
+ 1. **Composer-level merge**: The composition engine merges all cross-distro-packages declarations before writing devcontainer.json
113
+ 2. **Runtime deduplication**: The install script also deduplicates packages as a safety measure
114
+
115
+ **Example:**
116
+
117
+ ```json
118
+ // nodejs overlay adds:
119
+ "./features/cross-distro-packages": {
120
+ "apt": "build-essential"
121
+ }
122
+
123
+ // python overlay adds:
124
+ "./features/cross-distro-packages": {
125
+ "apt": "build-essential python3-dev"
126
+ }
127
+
128
+ // Final devcontainer.json (after composition):
129
+ "./features/cross-distro-packages": {
130
+ "apt": "build-essential python3-dev", // deduplicated!
131
+ "apk": "build-base python3-dev"
132
+ }
133
+ ```
134
+
135
+ You don't need to worry about conflicts when combining overlays - the system handles it automatically.
136
+
137
+ ## Notes
138
+
139
+ - Runs as root during container build
140
+ - Uses `--no-install-recommends` (apt) and `--no-cache` (apk) to minimize image size
141
+ - Automatically runs `apt-get update` before installing (apt only)
142
+ - Cleans up `/var/lib/apt/lists/*` after installation (apt only)
143
+
144
+ ## Contributing
145
+
146
+ To add support for additional package managers (e.g., yum, dnf, pacman), update the detection logic in `install.sh`.
@@ -0,0 +1,20 @@
1
+ {
2
+ "id": "cross-distro-packages",
3
+ "version": "1.0.0",
4
+ "name": "Cross-Distribution Package Manager",
5
+ "description": "Install system packages with automatic distribution detection (supports apt and apk)",
6
+ "documentationURL": "https://github.com/veggerby/container-superposition/tree/main/features/cross-distro-packages",
7
+ "options": {
8
+ "apt": {
9
+ "type": "string",
10
+ "default": "",
11
+ "description": "Space-separated list of packages for apt-based distros (Debian, Ubuntu)"
12
+ },
13
+ "apk": {
14
+ "type": "string",
15
+ "default": "",
16
+ "description": "Space-separated list of packages for apk-based distros (Alpine)"
17
+ }
18
+ },
19
+ "installsAfter": ["ghcr.io/devcontainers/features/common-utils"]
20
+ }
@@ -0,0 +1,58 @@
1
+ #!/bin/bash
2
+ # Cross-distribution package installer
3
+ # Automatically detects package manager (apt vs apk) and installs appropriate packages
4
+
5
+ set -e
6
+
7
+ APT_PACKAGES="${APT:-}"
8
+ APK_PACKAGES="${APK:-}"
9
+
10
+ # Function to deduplicate space-separated package list
11
+ deduplicate_packages() {
12
+ local packages="$1"
13
+ # Convert to array, sort, remove duplicates, join back
14
+ echo "$packages" | tr ' ' '\n' | sort -u | tr '\n' ' ' | sed 's/ $//'
15
+ }
16
+
17
+ # Exit early if no packages specified
18
+ if [ -z "$APT_PACKAGES" ] && [ -z "$APK_PACKAGES" ]; then
19
+ echo "⚠️ No packages specified for installation"
20
+ exit 0
21
+ fi
22
+
23
+ echo "📦 Installing cross-distro packages..."
24
+
25
+ # Detect package manager and install
26
+ if command -v apk > /dev/null 2>&1; then
27
+ # Alpine Linux (apk)
28
+ if [ -n "$APK_PACKAGES" ]; then
29
+ # Deduplicate package list
30
+ APK_PACKAGES=$(deduplicate_packages "$APK_PACKAGES")
31
+
32
+ echo " Detected: Alpine Linux (apk)"
33
+ echo " Installing: $APK_PACKAGES"
34
+ apk add --no-cache $APK_PACKAGES
35
+ echo "✓ Packages installed via apk"
36
+ else
37
+ echo "⚠️ No apk packages specified, skipping"
38
+ fi
39
+ elif command -v apt-get > /dev/null 2>&1; then
40
+ # Debian/Ubuntu (apt)
41
+ if [ -n "$APT_PACKAGES" ]; then
42
+ # Deduplicate package list
43
+ APT_PACKAGES=$(deduplicate_packages "$APT_PACKAGES")
44
+
45
+ echo " Detected: Debian/Ubuntu (apt)"
46
+ echo " Installing: $APT_PACKAGES"
47
+ apt-get update
48
+ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends $APT_PACKAGES
49
+ apt-get clean
50
+ rm -rf /var/lib/apt/lists/*
51
+ echo "✓ Packages installed via apt"
52
+ else
53
+ echo "⚠️ No apt packages specified, skipping"
54
+ fi
55
+ else
56
+ echo "❌ Unsupported package manager (neither apk nor apt-get found)"
57
+ exit 1
58
+ fi
@@ -0,0 +1,18 @@
1
+ {
2
+ "id": "local-secrets-manager",
3
+ "version": "1.0.0",
4
+ "name": "Local Secrets Manager",
5
+ "description": "Safe local development secrets management (never committed)",
6
+ "options": {
7
+ "autoLoadEnv": {
8
+ "type": "boolean",
9
+ "default": true,
10
+ "description": "Automatically load .env.local files"
11
+ },
12
+ "validateSecrets": {
13
+ "type": "boolean",
14
+ "default": true,
15
+ "description": "Validate required secrets are present"
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,127 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ AUTO_LOAD_ENV=${AUTOLOADENV:-"true"}
5
+ VALIDATE_SECRETS=${VALIDATESECRETS:-"true"}
6
+
7
+ echo "Installing local secrets manager..."
8
+
9
+ # Create secrets manager script
10
+ cat > /usr/local/bin/init-secrets << 'EOF'
11
+ #!/bin/bash
12
+ set -e
13
+
14
+ PROJECT_DIR="${1:-.}"
15
+
16
+ cd "$PROJECT_DIR"
17
+
18
+ echo "Initializing local secrets management..."
19
+
20
+ # Create .env.example template
21
+ cat > .env.example << 'ENVEXAMPLE'
22
+ # Database
23
+ DATABASE_URL=postgresql://user:password@localhost:5432/mydb
24
+
25
+ # API Keys (DO NOT commit actual values)
26
+ API_KEY=your_api_key_here
27
+ SECRET_KEY=your_secret_key_here
28
+
29
+ # External Services
30
+ REDIS_URL=redis://localhost:6379
31
+ SMTP_HOST=localhost
32
+ SMTP_PORT=1025
33
+
34
+ # Application
35
+ NODE_ENV=development
36
+ PORT=3000
37
+ LOG_LEVEL=debug
38
+ ENVEXAMPLE
39
+
40
+ # Create .env.local (gitignored)
41
+ if [ ! -f .env.local ]; then
42
+ cp .env.example .env.local
43
+ echo "✅ Created .env.local from template"
44
+ else
45
+ echo "⚠️ .env.local already exists, skipping"
46
+ fi
47
+
48
+ # Ensure .gitignore includes secrets files
49
+ if [ -f .gitignore ]; then
50
+ if ! grep -q ".env.local" .gitignore; then
51
+ echo "" >> .gitignore
52
+ echo "# Local development secrets" >> .gitignore
53
+ echo ".env.local" >> .gitignore
54
+ echo ".env.*.local" >> .gitignore
55
+ echo "secrets/" >> .gitignore
56
+ fi
57
+ else
58
+ cat > .gitignore << 'GITIGNORE'
59
+ # Local development secrets
60
+ .env.local
61
+ .env.*.local
62
+ secrets/
63
+
64
+ # Dependencies
65
+ node_modules/
66
+ GITIGNORE
67
+ fi
68
+
69
+ # Create scripts directory before writing validation script
70
+ mkdir -p scripts
71
+
72
+ # Create secrets validation script
73
+ cat > scripts/validate-secrets.sh << 'VALIDATE'
74
+ #!/bin/bash
75
+ set -e
76
+
77
+ if [ ! -f .env.local ]; then
78
+ echo "❌ .env.local not found!"
79
+ echo "Run 'init-secrets' to create it from .env.example"
80
+ exit 1
81
+ fi
82
+
83
+ # Check for placeholder values
84
+ if grep -q "your_.*_here" .env.local; then
85
+ echo "⚠️ Warning: .env.local contains placeholder values"
86
+ echo "Update the following before running:"
87
+ grep "your_.*_here" .env.local
88
+ exit 1
89
+ fi
90
+
91
+ echo "✅ Secrets validation passed"
92
+ VALIDATE
93
+
94
+ chmod +x scripts/validate-secrets.sh
95
+
96
+ echo "✅ Local secrets management initialized!"
97
+ echo ""
98
+ echo "Next steps:"
99
+ echo "1. Edit .env.local with your actual secrets"
100
+ echo "2. Run 'scripts/validate-secrets.sh' to check configuration"
101
+ echo "3. Never commit .env.local to git!"
102
+ EOF
103
+
104
+ chmod +x /usr/local/bin/init-secrets
105
+
106
+ # Add environment loader to bashrc
107
+ cat >> /etc/bash.bashrc << 'BASHRC'
108
+
109
+ # Auto-load .env.local if present
110
+ # Detect workspace path (supports both /workspace and /workspaces/<repo>)
111
+ if [ -n "$VSCODE_WORKSPACE_FOLDER" ]; then
112
+ WORKSPACE_PATH="$VSCODE_WORKSPACE_FOLDER"
113
+ elif [ -d "/workspaces" ]; then
114
+ WORKSPACE_PATH=$(find /workspaces -mindepth 1 -maxdepth 1 -type d | head -n 1)
115
+ elif [ -d "/workspace" ]; then
116
+ WORKSPACE_PATH="/workspace"
117
+ fi
118
+
119
+ if [ -n "$WORKSPACE_PATH" ] && [ -f "$WORKSPACE_PATH/.env.local" ]; then
120
+ set -a
121
+ source "$WORKSPACE_PATH/.env.local"
122
+ set +a
123
+ fi
124
+ BASHRC
125
+
126
+ echo "✅ Local secrets manager installed!"
127
+ echo "Run 'init-secrets' in your project directory"
@@ -0,0 +1,24 @@
1
+ {
2
+ "id": "project-scaffolder",
3
+ "version": "1.0.0",
4
+ "name": "Project Scaffolder",
5
+ "description": "Interactive project scaffolding for common frameworks and patterns",
6
+ "options": {
7
+ "template": {
8
+ "type": "string",
9
+ "enum": ["express-typescript", "nestjs-api", "nextjs-app", "react-vite", "none"],
10
+ "default": "none",
11
+ "description": "Project template to scaffold"
12
+ },
13
+ "includeTests": {
14
+ "type": "boolean",
15
+ "default": true,
16
+ "description": "Include test setup (Vitest/Jest)"
17
+ },
18
+ "includeCi": {
19
+ "type": "boolean",
20
+ "default": true,
21
+ "description": "Include GitHub Actions CI/CD"
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,100 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ TEMPLATE=${TEMPLATE:-"none"}
5
+ INCLUDE_TESTS=${INCLUDETESTS:-"true"}
6
+ INCLUDE_CI=${INCLUDECI:-"true"}
7
+
8
+ echo "Installing project scaffolder..."
9
+
10
+ # Create scaffolder script directory
11
+ mkdir -p /usr/local/bin/scaffolder
12
+
13
+ # Install scaffolder CLI
14
+ cat > /usr/local/bin/scaffold-project << 'EOF'
15
+ #!/bin/bash
16
+ set -e
17
+
18
+ TEMPLATE="$1"
19
+ PROJECT_DIR="${2:-.}"
20
+
21
+ scaffold_express_typescript() {
22
+ echo "Scaffolding Express + TypeScript API..."
23
+ cat > "$PROJECT_DIR/package.json" << 'PACKAGE'
24
+ {
25
+ "name": "express-api",
26
+ "version": "1.0.0",
27
+ "type": "module",
28
+ "scripts": {
29
+ "dev": "tsx watch src/index.ts",
30
+ "build": "tsc",
31
+ "start": "node dist/index.js",
32
+ "test": "vitest"
33
+ },
34
+ "dependencies": {
35
+ "express": "^4.18.2"
36
+ },
37
+ "devDependencies": {
38
+ "@types/express": "^4.17.21",
39
+ "@types/node": "^20.10.0",
40
+ "tsx": "^4.7.0",
41
+ "typescript": "^5.3.3",
42
+ "vitest": "^1.0.4"
43
+ }
44
+ }
45
+ PACKAGE
46
+
47
+ mkdir -p "$PROJECT_DIR/src"
48
+ cat > "$PROJECT_DIR/src/index.ts" << 'INDEX'
49
+ import express from 'express';
50
+
51
+ const app = express();
52
+ const port = process.env.PORT || 3000;
53
+
54
+ app.use(express.json());
55
+
56
+ app.get('/health', (req, res) => {
57
+ res.json({ status: 'ok' });
58
+ });
59
+
60
+ app.listen(port, () => {
61
+ console.log(`Server running on port ${port}`);
62
+ });
63
+ INDEX
64
+
65
+ cat > "$PROJECT_DIR/tsconfig.json" << 'TSCONFIG'
66
+ {
67
+ "compilerOptions": {
68
+ "target": "ES2022",
69
+ "module": "ES2022",
70
+ "moduleResolution": "node",
71
+ "outDir": "./dist",
72
+ "rootDir": "./src",
73
+ "strict": true,
74
+ "esModuleInterop": true,
75
+ "skipLibCheck": true,
76
+ "forceConsistentCasingInFileNames": true
77
+ },
78
+ "include": ["src/**/*"],
79
+ "exclude": ["node_modules"]
80
+ }
81
+ TSCONFIG
82
+
83
+ echo "✅ Express + TypeScript scaffolded successfully!"
84
+ }
85
+
86
+ case "$TEMPLATE" in
87
+ express-typescript)
88
+ scaffold_express_typescript
89
+ ;;
90
+ *)
91
+ echo "Available templates: express-typescript, nestjs-api, nextjs-app, react-vite"
92
+ echo "Usage: scaffold-project <template> [project-dir]"
93
+ ;;
94
+ esac
95
+ EOF
96
+
97
+ chmod +x /usr/local/bin/scaffold-project
98
+
99
+ echo "✅ Project scaffolder installed!"
100
+ echo "Run 'scaffold-project <template>' to create a new project"
@@ -0,0 +1,24 @@
1
+ {
2
+ "id": "team-conventions",
3
+ "version": "1.0.0",
4
+ "name": "Team Conventions",
5
+ "description": "Shared code quality and style enforcement for teams",
6
+ "options": {
7
+ "preset": {
8
+ "type": "string",
9
+ "enum": ["airbnb", "standard", "google", "custom"],
10
+ "default": "airbnb",
11
+ "description": "Linting/formatting preset"
12
+ },
13
+ "enableCommitLint": {
14
+ "type": "boolean",
15
+ "default": true,
16
+ "description": "Enable commit message linting"
17
+ },
18
+ "enablePreCommit": {
19
+ "type": "boolean",
20
+ "default": true,
21
+ "description": "Enable pre-commit hooks"
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,93 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ PRESET=${PRESET:-"airbnb"}
5
+ ENABLE_COMMIT_LINT=${ENABLECOMMITLINT:-"true"}
6
+ ENABLE_PRE_COMMIT=${ENABLEPRECOMMIT:-"true"}
7
+
8
+ echo "Installing team conventions (preset: $PRESET)..."
9
+
10
+ # Create conventions setup script
11
+ cat > /usr/local/bin/setup-team-conventions << 'EOF'
12
+ #!/bin/bash
13
+ set -e
14
+
15
+ PROJECT_DIR="${1:-.}"
16
+ PRESET="${2:-airbnb}"
17
+
18
+ cd "$PROJECT_DIR"
19
+
20
+ echo "Setting up team conventions with $PRESET preset..."
21
+
22
+ # Create .eslintrc.json
23
+ cat > .eslintrc.json << 'ESLINT'
24
+ {
25
+ "extends": ["eslint:recommended"],
26
+ "env": {
27
+ "node": true,
28
+ "es2022": true
29
+ },
30
+ "parserOptions": {
31
+ "ecmaVersion": 2022,
32
+ "sourceType": "module"
33
+ },
34
+ "rules": {
35
+ "no-console": "warn",
36
+ "no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
37
+ "semi": ["error", "always"],
38
+ "quotes": ["error", "single"]
39
+ }
40
+ }
41
+ ESLINT
42
+
43
+ # Create .prettierrc.json
44
+ cat > .prettierrc.json << 'PRETTIER'
45
+ {
46
+ "semi": true,
47
+ "trailingComma": "all",
48
+ "singleQuote": true,
49
+ "printWidth": 100,
50
+ "tabWidth": 2,
51
+ "arrowParens": "always"
52
+ }
53
+ PRETTIER
54
+
55
+ # Create .editorconfig
56
+ cat > .editorconfig << 'EDITORCONFIG'
57
+ root = true
58
+
59
+ [*]
60
+ indent_style = space
61
+ indent_size = 2
62
+ end_of_line = lf
63
+ charset = utf-8
64
+ trim_trailing_whitespace = true
65
+ insert_final_newline = true
66
+
67
+ [*.md]
68
+ trim_trailing_whitespace = false
69
+ EDITORCONFIG
70
+
71
+ # Create commitlint config
72
+ cat > commitlint.config.js << 'COMMITLINT'
73
+ module.exports = {
74
+ extends: ['@commitlint/config-conventional'],
75
+ rules: {
76
+ 'type-enum': [
77
+ 2,
78
+ 'always',
79
+ ['feat', 'fix', 'docs', 'style', 'refactor', 'test', 'chore', 'revert']
80
+ ],
81
+ 'subject-case': [2, 'never', ['upper-case']]
82
+ }
83
+ };
84
+ COMMITLINT
85
+
86
+ echo "✅ Team conventions configured!"
87
+ echo "Remember to run: npm install --save-dev eslint prettier @commitlint/cli @commitlint/config-conventional"
88
+ EOF
89
+
90
+ chmod +x /usr/local/bin/setup-team-conventions
91
+
92
+ echo "✅ Team conventions installer ready!"
93
+ echo "Run 'setup-team-conventions' in your project directory"
@@ -0,0 +1,14 @@
1
+ # Registry Files
2
+
3
+ This directory contains special metadata files that don't fit into individual overlay manifests.
4
+
5
+ ## Files
6
+
7
+ - **base-images.yml** - Available base container images (Debian, Alpine, Ubuntu, etc.)
8
+ - **base-templates.yml** - Base devcontainer templates (plain, compose)
9
+
10
+ These files are loaded during initialization to provide choices for base images and templates.
11
+
12
+ ## Note
13
+
14
+ Preset definitions are stored in `overlays/presets/*.yml`.
@@ -0,0 +1,26 @@
1
+ base_images:
2
+ - id: bookworm
3
+ name: Debian Bookworm (Recommended)
4
+ description: Stable, battle-tested base with broad compatibility
5
+ image: mcr.microsoft.com/devcontainers/base:bookworm
6
+ package_manager: apt
7
+ - id: trixie
8
+ name: Debian Trixie
9
+ description: Newer packages, testing stability
10
+ image: mcr.microsoft.com/devcontainers/base:trixie
11
+ package_manager: apt
12
+ - id: alpine
13
+ name: Alpine Linux
14
+ description: Minimal footprint (~5MB), apk package manager
15
+ image: mcr.microsoft.com/devcontainers/base:alpine
16
+ package_manager: apk
17
+ - id: ubuntu
18
+ name: Ubuntu LTS
19
+ description: Popular, familiar, extensive package ecosystem
20
+ image: mcr.microsoft.com/devcontainers/base:ubuntu
21
+ package_manager: apt
22
+ - id: custom
23
+ name: Custom Image
24
+ description: Specify your own (may conflict with overlays)
25
+ image: null
26
+ package_manager: apt
@@ -0,0 +1,7 @@
1
+ base_templates:
2
+ - id: plain
3
+ name: Plain (Image-based)
4
+ description: Minimal Debian image for simple projects
5
+ - id: compose
6
+ name: Compose (Multi-service)
7
+ description: Docker Compose infrastructure for complex applications