@vaharoni/devops 1.0.47

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 (342) hide show
  1. package/README.md +51 -0
  2. package/dist/app-support/crypto/index.d.ts +15 -0
  3. package/dist/app-support/crypto/index.d.ts.map +1 -0
  4. package/dist/app-support/crypto/index.js +30 -0
  5. package/dist/app-support/crypto/internal-token.d.ts +20 -0
  6. package/dist/app-support/crypto/internal-token.d.ts.map +1 -0
  7. package/dist/app-support/crypto/internal-token.js +42 -0
  8. package/dist/app-support/crypto/internal-token.spec.d.ts +2 -0
  9. package/dist/app-support/crypto/internal-token.spec.d.ts.map +1 -0
  10. package/dist/app-support/crypto/internal-token.spec.js +45 -0
  11. package/dist/app-support/crypto/secret.d.ts +3 -0
  12. package/dist/app-support/crypto/secret.d.ts.map +1 -0
  13. package/dist/app-support/crypto/secret.js +12 -0
  14. package/dist/app-support/crypto/secret.spec.d.ts +2 -0
  15. package/dist/app-support/crypto/secret.spec.d.ts.map +1 -0
  16. package/dist/app-support/crypto/secret.spec.js +15 -0
  17. package/dist/app-support/discovery/dev-discovery-loader.d.ts +2 -0
  18. package/dist/app-support/discovery/dev-discovery-loader.d.ts.map +1 -0
  19. package/dist/app-support/discovery/dev-discovery-loader.js +30 -0
  20. package/dist/app-support/discovery/service-endpoint.d.ts +2 -0
  21. package/dist/app-support/discovery/service-endpoint.d.ts.map +1 -0
  22. package/dist/app-support/discovery/service-endpoint.js +10 -0
  23. package/dist/cli/affected.d.ts +11 -0
  24. package/dist/cli/affected.d.ts.map +1 -0
  25. package/dist/cli/affected.js +103 -0
  26. package/dist/cli/common.d.ts +89 -0
  27. package/dist/cli/common.d.ts.map +1 -0
  28. package/dist/cli/common.js +236 -0
  29. package/dist/cli/common.spec.d.ts +2 -0
  30. package/dist/cli/common.spec.d.ts.map +1 -0
  31. package/dist/cli/common.spec.js +64 -0
  32. package/dist/cli/console.d.ts +11 -0
  33. package/dist/cli/console.d.ts.map +1 -0
  34. package/dist/cli/console.js +35 -0
  35. package/dist/cli/constant.d.ts +11 -0
  36. package/dist/cli/constant.d.ts.map +1 -0
  37. package/dist/cli/constant.js +22 -0
  38. package/dist/cli/db.d.ts +11 -0
  39. package/dist/cli/db.d.ts.map +1 -0
  40. package/dist/cli/db.js +119 -0
  41. package/dist/cli/dml.d.ts +11 -0
  42. package/dist/cli/dml.d.ts.map +1 -0
  43. package/dist/cli/dml.js +116 -0
  44. package/dist/cli/env.d.ts +11 -0
  45. package/dist/cli/env.d.ts.map +1 -0
  46. package/dist/cli/env.js +67 -0
  47. package/dist/cli/exec.d.ts +11 -0
  48. package/dist/cli/exec.d.ts.map +1 -0
  49. package/dist/cli/exec.js +50 -0
  50. package/dist/cli/image.d.ts +11 -0
  51. package/dist/cli/image.d.ts.map +1 -0
  52. package/dist/cli/image.js +140 -0
  53. package/dist/cli/init.d.ts +11 -0
  54. package/dist/cli/init.d.ts.map +1 -0
  55. package/dist/cli/init.js +66 -0
  56. package/dist/cli/internal-curl.d.ts +11 -0
  57. package/dist/cli/internal-curl.d.ts.map +1 -0
  58. package/dist/cli/internal-curl.js +43 -0
  59. package/dist/cli/job.d.ts +11 -0
  60. package/dist/cli/job.d.ts.map +1 -0
  61. package/dist/cli/job.js +67 -0
  62. package/dist/cli/jwt.d.ts +11 -0
  63. package/dist/cli/jwt.d.ts.map +1 -0
  64. package/dist/cli/jwt.js +27 -0
  65. package/dist/cli/namespace.d.ts +11 -0
  66. package/dist/cli/namespace.d.ts.map +1 -0
  67. package/dist/cli/namespace.js +70 -0
  68. package/dist/cli/prep-build.d.ts +11 -0
  69. package/dist/cli/prep-build.d.ts.map +1 -0
  70. package/dist/cli/prep-build.js +82 -0
  71. package/dist/cli/prisma.d.ts +11 -0
  72. package/dist/cli/prisma.d.ts.map +1 -0
  73. package/dist/cli/prisma.js +25 -0
  74. package/dist/cli/redis.d.ts +11 -0
  75. package/dist/cli/redis.d.ts.map +1 -0
  76. package/dist/cli/redis.js +76 -0
  77. package/dist/cli/registry.d.ts +11 -0
  78. package/dist/cli/registry.d.ts.map +1 -0
  79. package/dist/cli/registry.js +58 -0
  80. package/dist/cli/run-many.d.ts +11 -0
  81. package/dist/cli/run-many.d.ts.map +1 -0
  82. package/dist/cli/run-many.js +50 -0
  83. package/dist/cli/run.d.ts +11 -0
  84. package/dist/cli/run.d.ts.map +1 -0
  85. package/dist/cli/run.js +37 -0
  86. package/dist/cli/template.d.ts +11 -0
  87. package/dist/cli/template.d.ts.map +1 -0
  88. package/dist/cli/template.js +123 -0
  89. package/dist/cli/test.d.ts +11 -0
  90. package/dist/cli/test.d.ts.map +1 -0
  91. package/dist/cli/test.js +28 -0
  92. package/dist/devops.d.ts +3 -0
  93. package/dist/devops.d.ts.map +1 -0
  94. package/dist/devops.js +103 -0
  95. package/dist/index.d.ts +4 -0
  96. package/dist/index.d.ts.map +1 -0
  97. package/dist/index.js +3 -0
  98. package/dist/libs/affected-entities.d.ts +15 -0
  99. package/dist/libs/affected-entities.d.ts.map +1 -0
  100. package/dist/libs/affected-entities.js +52 -0
  101. package/dist/libs/config.d.ts +6 -0
  102. package/dist/libs/config.d.ts.map +1 -0
  103. package/dist/libs/config.js +98 -0
  104. package/dist/libs/dependencies.d.ts +19 -0
  105. package/dist/libs/dependencies.d.ts.map +1 -0
  106. package/dist/libs/dependencies.js +62 -0
  107. package/dist/libs/dependencies.spec.d.ts +2 -0
  108. package/dist/libs/dependencies.spec.d.ts.map +1 -0
  109. package/dist/libs/dependencies.spec.js +21 -0
  110. package/dist/libs/digital-ocean/container-reg.d.ts +6 -0
  111. package/dist/libs/digital-ocean/container-reg.d.ts.map +1 -0
  112. package/dist/libs/digital-ocean/container-reg.js +69 -0
  113. package/dist/libs/discovery/dependencies.d.ts +19 -0
  114. package/dist/libs/discovery/dependencies.d.ts.map +1 -0
  115. package/dist/libs/discovery/dependencies.js +62 -0
  116. package/dist/libs/discovery/dependencies.spec.d.ts +2 -0
  117. package/dist/libs/discovery/dependencies.spec.d.ts.map +1 -0
  118. package/dist/libs/discovery/dependencies.spec.js +21 -0
  119. package/dist/libs/discovery/images.d.ts +5 -0
  120. package/dist/libs/discovery/images.d.ts.map +1 -0
  121. package/dist/libs/discovery/images.js +45 -0
  122. package/dist/libs/discovery/index.d.ts +5 -0
  123. package/dist/libs/discovery/index.d.ts.map +1 -0
  124. package/dist/libs/discovery/index.js +55 -0
  125. package/dist/libs/discovery/package-json-processor.d.ts +3 -0
  126. package/dist/libs/discovery/package-json-processor.d.ts.map +1 -0
  127. package/dist/libs/discovery/package-json-processor.js +34 -0
  128. package/dist/libs/discovery/process-common.d.ts +25 -0
  129. package/dist/libs/discovery/process-common.d.ts.map +1 -0
  130. package/dist/libs/discovery/process-common.js +40 -0
  131. package/dist/libs/discovery/process-package-json.d.ts +3 -0
  132. package/dist/libs/discovery/process-package-json.d.ts.map +1 -0
  133. package/dist/libs/discovery/process-package-json.js +34 -0
  134. package/dist/libs/discovery/process-pyproject-toml.d.ts +3 -0
  135. package/dist/libs/discovery/process-pyproject-toml.d.ts.map +1 -0
  136. package/dist/libs/discovery/process-pyproject-toml.js +36 -0
  137. package/dist/libs/discovery/pyproject-toml-processor.d.ts +3 -0
  138. package/dist/libs/discovery/pyproject-toml-processor.d.ts.map +1 -0
  139. package/dist/libs/discovery/pyproject-toml-processor.js +39 -0
  140. package/dist/libs/git-helpers.d.ts +8 -0
  141. package/dist/libs/git-helpers.d.ts.map +1 -0
  142. package/dist/libs/git-helpers.js +20 -0
  143. package/dist/libs/hetzner/reg-secret.d.ts +3 -0
  144. package/dist/libs/hetzner/reg-secret.d.ts.map +1 -0
  145. package/dist/libs/hetzner/reg-secret.js +39 -0
  146. package/dist/libs/k8s-constants.d.ts +12 -0
  147. package/dist/libs/k8s-constants.d.ts.map +1 -0
  148. package/dist/libs/k8s-constants.js +66 -0
  149. package/dist/libs/k8s-db.d.ts +18 -0
  150. package/dist/libs/k8s-db.d.ts.map +1 -0
  151. package/dist/libs/k8s-db.js +73 -0
  152. package/dist/libs/k8s-generate.d.ts +17 -0
  153. package/dist/libs/k8s-generate.d.ts.map +1 -0
  154. package/dist/libs/k8s-generate.js +179 -0
  155. package/dist/libs/k8s-helpers.d.ts +11 -0
  156. package/dist/libs/k8s-helpers.d.ts.map +1 -0
  157. package/dist/libs/k8s-helpers.js +42 -0
  158. package/dist/libs/k8s-image-config.d.ts +8 -0
  159. package/dist/libs/k8s-image-config.d.ts.map +1 -0
  160. package/dist/libs/k8s-image-config.js +113 -0
  161. package/dist/libs/k8s-job-waiter.d.ts +8 -0
  162. package/dist/libs/k8s-job-waiter.d.ts.map +1 -0
  163. package/dist/libs/k8s-job-waiter.js +84 -0
  164. package/dist/libs/k8s-namespace.d.ts +7 -0
  165. package/dist/libs/k8s-namespace.d.ts.map +1 -0
  166. package/dist/libs/k8s-namespace.js +27 -0
  167. package/dist/libs/k8s-redis.d.ts +6 -0
  168. package/dist/libs/k8s-redis.d.ts.map +1 -0
  169. package/dist/libs/k8s-redis.js +31 -0
  170. package/dist/libs/k8s-secrets-manager.d.ts +5 -0
  171. package/dist/libs/k8s-secrets-manager.d.ts.map +1 -0
  172. package/dist/libs/k8s-secrets-manager.js +61 -0
  173. package/dist/libs/validate-env.d.ts +56 -0
  174. package/dist/libs/validate-env.d.ts.map +1 -0
  175. package/dist/libs/validate-env.js +214 -0
  176. package/dist/libs/validate-env.spec.d.ts +2 -0
  177. package/dist/libs/validate-env.spec.d.ts.map +1 -0
  178. package/dist/libs/validate-env.spec.js +168 -0
  179. package/dist/libs/workspace-discovery.d.ts +2 -0
  180. package/dist/libs/workspace-discovery.d.ts.map +1 -0
  181. package/dist/libs/workspace-discovery.js +75 -0
  182. package/dist/test.d.ts +2 -0
  183. package/dist/test.d.ts.map +1 -0
  184. package/dist/test.js +1 -0
  185. package/dist/types/index.d.ts +925 -0
  186. package/dist/types/index.d.ts.map +1 -0
  187. package/dist/types/index.js +79 -0
  188. package/package.json +55 -0
  189. package/src/app-support/crypto/index.ts +31 -0
  190. package/src/app-support/crypto/internal-token.spec.ts +53 -0
  191. package/src/app-support/crypto/internal-token.ts +82 -0
  192. package/src/app-support/crypto/secret.spec.ts +18 -0
  193. package/src/app-support/crypto/secret.ts +13 -0
  194. package/src/app-support/discovery/dev-discovery-loader.ts +35 -0
  195. package/src/app-support/discovery/service-endpoint.ts +12 -0
  196. package/src/cli/affected.ts +116 -0
  197. package/src/cli/common.spec.ts +78 -0
  198. package/src/cli/common.ts +323 -0
  199. package/src/cli/console.ts +46 -0
  200. package/src/cli/constant.ts +25 -0
  201. package/src/cli/db.ts +133 -0
  202. package/src/cli/dml.ts +126 -0
  203. package/src/cli/env.ts +87 -0
  204. package/src/cli/exec.sh +21 -0
  205. package/src/cli/exec.ts +57 -0
  206. package/src/cli/image.ts +197 -0
  207. package/src/cli/init.ts +75 -0
  208. package/src/cli/internal-curl.ts +48 -0
  209. package/src/cli/job.ts +80 -0
  210. package/src/cli/jwt.ts +32 -0
  211. package/src/cli/namespace.ts +78 -0
  212. package/src/cli/prep-build.ts +96 -0
  213. package/src/cli/prisma.ts +33 -0
  214. package/src/cli/redis.ts +83 -0
  215. package/src/cli/registry.ts +76 -0
  216. package/src/cli/run-many.ts +61 -0
  217. package/src/cli/run.ts +46 -0
  218. package/src/cli/template.ts +169 -0
  219. package/src/cli/test.ts +30 -0
  220. package/src/devops.ts +119 -0
  221. package/src/index.ts +3 -0
  222. package/src/libs/affected-entities.ts +71 -0
  223. package/src/libs/config.ts +117 -0
  224. package/src/libs/digital-ocean/container-reg.ts +81 -0
  225. package/src/libs/discovery/dependencies.spec.ts +25 -0
  226. package/src/libs/discovery/dependencies.ts +73 -0
  227. package/src/libs/discovery/images.ts +57 -0
  228. package/src/libs/discovery/index.ts +60 -0
  229. package/src/libs/discovery/process-common.ts +55 -0
  230. package/src/libs/discovery/process-package-json.ts +47 -0
  231. package/src/libs/discovery/process-pyproject-toml.ts +43 -0
  232. package/src/libs/git-helpers.ts +32 -0
  233. package/src/libs/hetzner/reg-secret.ts +54 -0
  234. package/src/libs/k8s-constants.ts +83 -0
  235. package/src/libs/k8s-db.ts +83 -0
  236. package/src/libs/k8s-generate.ts +211 -0
  237. package/src/libs/k8s-helpers.ts +59 -0
  238. package/src/libs/k8s-image-config.ts +165 -0
  239. package/src/libs/k8s-job-waiter.ts +124 -0
  240. package/src/libs/k8s-namespace.ts +41 -0
  241. package/src/libs/k8s-redis.ts +31 -0
  242. package/src/libs/k8s-secrets-manager.ts +79 -0
  243. package/src/libs/validate-env.spec.ts +223 -0
  244. package/src/libs/validate-env.ts +266 -0
  245. package/src/target-templates/.devops/config/constants.yaml +17 -0
  246. package/src/target-templates/.devops/config/images.yaml +88 -0
  247. package/src/target-templates/.devops/docker-images/common/docker-common.sh +23 -0
  248. package/src/target-templates/.devops/docker-images/node-services/node-exec.sh +8 -0
  249. package/src/target-templates/.devops/docker-images/node-services/node-run.sh +8 -0
  250. package/src/target-templates/.devops/docker-images/node-services.Dockerfile +34 -0
  251. package/src/target-templates/.devops/docker-images/python-services/python-exec.sh +8 -0
  252. package/src/target-templates/.devops/docker-images/python-services/python-run.sh +8 -0
  253. package/src/target-templates/.devops/docker-images/python-services.Dockerfile +29 -0
  254. package/src/target-templates/.devops/env.example.yaml +23 -0
  255. package/src/target-templates/.devops/infra/hetzner/abandoned/harbor-values.yaml +30 -0
  256. package/src/target-templates/.devops/infra/hetzner/abandoned/hcloud-config.yaml +134 -0
  257. package/src/target-templates/.devops/infra/hetzner/cert-manager.yaml +25 -0
  258. package/src/target-templates/.devops/infra/hetzner/harbor-cert.yaml +13 -0
  259. package/src/target-templates/.devops/infra/hetzner/harbor-values.yaml +76 -0
  260. package/src/target-templates/.devops/infra/hetzner/hcloud-config.yaml +113 -0
  261. package/src/target-templates/.devops/infra/hetzner/ingress-nginx-annotations.yaml +49 -0
  262. package/src/target-templates/.devops/infra/hetzner/ingress-nginx-configmap.yaml +8 -0
  263. package/src/target-templates/.devops/infra/hetzner/retain-storage-class.yaml +8 -0
  264. package/src/target-templates/.devops/infra/monitoring-ingress.yaml +62 -0
  265. package/src/target-templates/.devops/infra/stackgres-ui-ingress.yaml +35 -0
  266. package/src/target-templates/.devops/infra/test.yaml +60 -0
  267. package/src/target-templates/.devops/manifests/_index.yaml +21 -0
  268. package/src/target-templates/.devops/manifests/cron-jobs.yaml.hb +55 -0
  269. package/src/target-templates/.devops/manifests/db-migrate-job.yaml.hb +42 -0
  270. package/src/target-templates/.devops/manifests/deployment-debug.yaml.hb +44 -0
  271. package/src/target-templates/.devops/manifests/deployment-process.yaml.hb +47 -0
  272. package/src/target-templates/.devops/manifests/deployment-web.yaml.hb +53 -0
  273. package/src/target-templates/.devops/manifests/ingress.yaml.hb +21 -0
  274. package/src/target-templates/.devops/manifests/prefect.yaml.hb +62 -0
  275. package/src/target-templates/.devops/manifests/service.yaml.hb +15 -0
  276. package/src/target-templates/.devops/milvus/production/milvus-values.yaml +2 -0
  277. package/src/target-templates/.devops/milvus/staging/milvus-values.yaml +2 -0
  278. package/src/target-templates/.devops/postgres/DailyOperatorRestart.yaml +54 -0
  279. package/src/target-templates/.devops/postgres/production/cluster/PodDisruptionBudget.yaml +27 -0
  280. package/src/target-templates/.devops/postgres/production/cluster/SGCluster.yaml +47 -0
  281. package/src/target-templates/.devops/postgres/production/cluster/StackGres-alerts.yaml +191 -0
  282. package/src/target-templates/.devops/postgres/production/configurations/06-SGDistributedLogs.yaml +11 -0
  283. package/src/target-templates/.devops/postgres/production/configurations/07-SGObjectStorage.yaml +18 -0
  284. package/src/target-templates/.devops/postgres/production/configurations/08-SGScript.yaml +12 -0
  285. package/src/target-templates/.devops/postgres/staging/cluster/SGCluster.yaml +42 -0
  286. package/src/target-templates/.devops/postgres/staging/configurations/07-SGObjectStorage.yaml +18 -0
  287. package/src/target-templates/.devops/postgres/staging/configurations/08-SGScript.yaml +12 -0
  288. package/src/target-templates/.devops/prefect/production/prefect-values.yaml +14 -0
  289. package/src/target-templates/.devops/prefect/staging/prefect-values.yaml +14 -0
  290. package/src/target-templates/.devops/redis/production/redis-values.yaml +20 -0
  291. package/src/target-templates/.devops/redis/staging/redis-values.yaml +8 -0
  292. package/src/target-templates/.envrc +5 -0
  293. package/src/target-templates/.github/actions/build-image@v1/action.yaml +86 -0
  294. package/src/target-templates/.github/actions/connect-to-digital-ocean@v1/action.yaml +29 -0
  295. package/src/target-templates/.github/actions/connect-to-hetzner@v1/action.yaml +31 -0
  296. package/src/target-templates/.github/actions/connect-to-infra@v1/action.yaml +46 -0
  297. package/src/target-templates/.github/actions/db-migrate@v1/action.yaml +23 -0
  298. package/src/target-templates/.github/actions/deploy-image@v1/action.yaml +33 -0
  299. package/src/target-templates/.github/actions/setup-prereq@v1/action.yaml +29 -0
  300. package/src/target-templates/.github/workflows/k8s-build.yaml +84 -0
  301. package/src/target-templates/applications/example-data-pipeline/pyproject.toml +14 -0
  302. package/src/target-templates/applications/example-data-pipeline/src/example_data_pipeline/main.py +38 -0
  303. package/src/target-templates/applications/example-node/index.ts +30 -0
  304. package/src/target-templates/applications/example-node/package.json +26 -0
  305. package/src/target-templates/applications/example-node/tsconfig.json +3 -0
  306. package/src/target-templates/applications/example-python/pyproject.toml +20 -0
  307. package/src/target-templates/applications/example-python/src/example_python/__init__.py +0 -0
  308. package/src/target-templates/applications/example-python/src/example_python/main.py +13 -0
  309. package/src/target-templates/applications/example-python/src/example_python/scripts.py +17 -0
  310. package/src/target-templates/applications/example-python/tests/__init__.py +0 -0
  311. package/src/target-templates/applications/jobs/README.md +68 -0
  312. package/src/target-templates/applications/jobs/index.ts +1 -0
  313. package/src/target-templates/applications/jobs/package.json +30 -0
  314. package/src/target-templates/applications/jobs/tsconfig.json +3 -0
  315. package/src/target-templates/config/.env.development +1 -0
  316. package/src/target-templates/config/.env.global +4 -0
  317. package/src/target-templates/config/.env.test +1 -0
  318. package/src/target-templates/db/db/__init__.py +0 -0
  319. package/src/target-templates/db/db/db_client_test.py +46 -0
  320. package/src/target-templates/db/db-client-test.ts +140 -0
  321. package/src/target-templates/db/db-client.ts +19 -0
  322. package/src/target-templates/db/env.yaml +4 -0
  323. package/src/target-templates/db/package.json +17 -0
  324. package/src/target-templates/db/prisma/schema.prisma +24 -0
  325. package/src/target-templates/db/prisma-setup-vitest.ts +27 -0
  326. package/src/target-templates/db/pyproject.toml +14 -0
  327. package/src/target-templates/db/tsconfig.json +3 -0
  328. package/src/target-templates/devops +3 -0
  329. package/src/target-templates/devopspy +3 -0
  330. package/src/target-templates/dml/package.json +7 -0
  331. package/src/target-templates/dml/tsconfig.json +3 -0
  332. package/src/target-templates/libs/example-node-lib/bun.lock +27 -0
  333. package/src/target-templates/libs/example-node-lib/index.ts +3 -0
  334. package/src/target-templates/libs/example-node-lib/package.json +12 -0
  335. package/src/target-templates/libs/example-node-lib/tsconfig.json +3 -0
  336. package/src/target-templates/libs/example-python-lib/pyproject.toml +11 -0
  337. package/src/target-templates/libs/example-python-lib/src/example_python_lib/__init__.py +2 -0
  338. package/src/target-templates/pyproject.toml +19 -0
  339. package/src/target-templates/tmp/.gitkeep +0 -0
  340. package/src/target-templates/tsconfig.json +27 -0
  341. package/src/test.ts +0 -0
  342. package/src/types/index.ts +173 -0
package/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # devops for Monorepos
2
+
3
+ Monorepos support multiple apps, allowing them to reuse functionality through shared libraries. `devops` is a tool that helps deploy and manage such setup on a kubernetes cluster using github actions.
4
+
5
+ `devops` is...
6
+ - **a generator** - it generates boilerplate code when starting a new monorepo, such as github actions and docker images
7
+ - **a CLI** - making it easy to manage your local and remote env variables, connect to your remote databases, or launch remote console
8
+ - **a builder** - identifies which folders need to reside in which docker image through dependency discovery
9
+ - **a gitops deployer** - sets up github actions to watch pushes to `staging` and `production` branches, identifies which images are affected by those commits, and determines whether to run db migrations
10
+ - **an SDK** - helps with inter-application communication, by addressing the minor differences between local and remote environments in the DNS of endpoints, and by issuing tokens so that apps can validate traffic originated from within the cluster
11
+ - **a scheduler** - leverages kubernetes to execute curl commands to your endpoints at a certain cron schedule to trigger some background processes
12
+ - **a set of instructions** - for how to install kubernetes clusters from scratch with support for multi environments, postgres, and redis
13
+
14
+ `devops` currently supports node and python. The repo that contains the python CLI can be found [here](https://github.com/vaharoni/devops-python).
15
+
16
+ # Documentation
17
+
18
+ - [Repo setup](./docs/RepoSetup.md)
19
+ - [Working with Python](./docs/WorkingWithPython.md)
20
+ - [Day to day work](./docs/DayToDay.md)
21
+ - [The devops architecture](./docs/Architecture.md)
22
+
23
+ # Limitations
24
+
25
+ Currently, the repo works with `bun` as the package manager for node and `uv` for python.
26
+
27
+ # Contributing
28
+
29
+ Run this in your local copy of the devops folder:
30
+ ```shell
31
+ bun link
32
+ ```
33
+
34
+ Run this in a local package using the project for testing:
35
+ ```shell
36
+ bun link @vaharoni/devops
37
+ bun run build
38
+ ```
39
+
40
+ When done:
41
+ ```shell
42
+ # In the local copy of this repo
43
+ bun unlink
44
+ ```
45
+
46
+ To release:
47
+ ```shell
48
+ npm version patch
49
+ git push --tags
50
+ gh release create vX.Y.Z
51
+ ```
@@ -0,0 +1,15 @@
1
+ /**
2
+ * A simple token generation/verification class that relies on the subject field of an internal JWT-like token. It can:
3
+ * - generate a short-lived (60s) token with the given subject
4
+ * - verify that a token has not expired and bears the given subject
5
+ *
6
+ * Relies on the MONOREPO_BASE_SECRET environment variable for signing and verifying the token.
7
+ */
8
+ export declare class InternalToken {
9
+ subject: string;
10
+ constructor(subject: string);
11
+ generate(): string;
12
+ verifyOrThrow(token: string): void;
13
+ verifyFromHeaderOrThrow(authorizationHeader?: string | null): void;
14
+ }
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/app-support/crypto/index.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,qBAAa,aAAa;IACL,OAAO,EAAE,MAAM;gBAAf,OAAO,EAAE,MAAM;IAElC,QAAQ;IAIR,aAAa,CAAC,KAAK,EAAE,MAAM;IAO3B,uBAAuB,CAAC,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI;CAO5D"}
@@ -0,0 +1,30 @@
1
+ import { generateInternalAuthToken, parseInternalAuthTokenOrThrow } from "./internal-token";
2
+ /**
3
+ * A simple token generation/verification class that relies on the subject field of an internal JWT-like token. It can:
4
+ * - generate a short-lived (60s) token with the given subject
5
+ * - verify that a token has not expired and bears the given subject
6
+ *
7
+ * Relies on the MONOREPO_BASE_SECRET environment variable for signing and verifying the token.
8
+ */
9
+ export class InternalToken {
10
+ subject;
11
+ constructor(subject) {
12
+ this.subject = subject;
13
+ }
14
+ generate() {
15
+ return generateInternalAuthToken({ sub: this.subject });
16
+ }
17
+ verifyOrThrow(token) {
18
+ const parsedToken = parseInternalAuthTokenOrThrow(token);
19
+ if (parsedToken.sub !== this.subject) {
20
+ throw new Error('Invalid token');
21
+ }
22
+ }
23
+ verifyFromHeaderOrThrow(authorizationHeader) {
24
+ if (!authorizationHeader) {
25
+ throw new Error('Authorization header not found');
26
+ }
27
+ const token = authorizationHeader.replace('Bearer ', '');
28
+ this.verifyOrThrow(token);
29
+ }
30
+ }
@@ -0,0 +1,20 @@
1
+ export type InternalTokenClaims<CustomClaims extends object = object> = CustomClaims & {
2
+ /** The token issuer */
3
+ iss: string;
4
+ /** Issued at */
5
+ iat: number;
6
+ /** Expires at */
7
+ exp: number;
8
+ /** The subject of the token. Should contain a string of the "service account" who bears the token. */
9
+ sub?: string;
10
+ /** The audience of the token. Should contain a string of who the token is intended for. */
11
+ aud?: string;
12
+ };
13
+ export declare function generateInternalAuthToken({ customClaims, expiresInSeconds, sub, aud, }?: {
14
+ customClaims?: Record<string, string>;
15
+ expiresInSeconds?: number;
16
+ sub?: string;
17
+ aud?: string;
18
+ }): string;
19
+ export declare function parseInternalAuthTokenOrThrow<CustomClaims extends object = object>(token: string): InternalTokenClaims<CustomClaims>;
20
+ //# sourceMappingURL=internal-token.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-token.d.ts","sourceRoot":"","sources":["../../../src/app-support/crypto/internal-token.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,mBAAmB,CAAC,YAAY,SAAS,MAAM,GAAG,MAAM,IAClE,YAAY,GAAG;IACb,uBAAuB;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,iBAAiB;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,sGAAsG;IACtG,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,2FAA2F;IAC3F,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AA4BJ,wBAAgB,yBAAyB,CAAC,EACxC,YAAiB,EACjB,gBAAqB,EACrB,GAAG,EACH,GAAG,GACJ,GAAE;IACD,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACT,UAUL;AAED,wBAAgB,6BAA6B,CAAC,YAAY,SAAS,MAAM,GAAG,MAAM,EAChF,KAAK,EAAE,MAAM,GACZ,mBAAmB,CAAC,YAAY,CAAC,CAcnC"}
@@ -0,0 +1,42 @@
1
+ import { getConst } from '../../libs/config';
2
+ import { sign, verify } from './secret';
3
+ class InternalTokenError extends Error {
4
+ constructor(message) {
5
+ super(message);
6
+ this.name = 'InternalTokenError';
7
+ Object.setPrototypeOf(this, new.target.prototype);
8
+ }
9
+ }
10
+ function defaultClaims({ expiresInSeconds, sub, aud, }) {
11
+ return {
12
+ iss: `${getConst('project-name')}-internal`,
13
+ iat: Math.floor(Date.now() / 1000),
14
+ exp: Math.floor(Date.now() / 1000) + expiresInSeconds,
15
+ sub,
16
+ aud,
17
+ };
18
+ }
19
+ export function generateInternalAuthToken({ customClaims = {}, expiresInSeconds = 60, sub, aud, } = {}) {
20
+ const data = {
21
+ ...customClaims,
22
+ // This should be after the customClaims so that custom claims cannot override the default claims
23
+ ...defaultClaims({ expiresInSeconds, sub, aud }),
24
+ };
25
+ const str = JSON.stringify(data);
26
+ const encodedData = Buffer.from(str).toString('base64');
27
+ const signature = sign(encodedData);
28
+ return `${encodedData}.${signature}`;
29
+ }
30
+ export function parseInternalAuthTokenOrThrow(token) {
31
+ const [encodedData, signature] = token.split('.');
32
+ const isSignatureOk = verify(encodedData, signature);
33
+ if (!isSignatureOk) {
34
+ throw new InternalTokenError('Invalid token');
35
+ }
36
+ const dataStr = Buffer.from(encodedData, 'base64').toString('utf-8');
37
+ const data = JSON.parse(dataStr);
38
+ if (data.exp < Math.floor(Date.now() / 1000)) {
39
+ throw new InternalTokenError('Token expired');
40
+ }
41
+ return data;
42
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=internal-token.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-token.spec.d.ts","sourceRoot":"","sources":["../../../src/app-support/crypto/internal-token.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,45 @@
1
+ import { beforeEach, describe, expect, it, vi } from 'vitest';
2
+ import { generateInternalAuthToken, parseInternalAuthTokenOrThrow } from './internal-token';
3
+ vi.mock('../../libs/config', () => ({
4
+ getConst: () => 'test',
5
+ }));
6
+ describe('generate and verify internal token', () => {
7
+ beforeEach(() => {
8
+ process.env.MONOREPO_BASE_SECRET = '1234567890abcdef';
9
+ });
10
+ it('works for default tokens', () => {
11
+ const token = generateInternalAuthToken();
12
+ const parsedPayload = parseInternalAuthTokenOrThrow(token);
13
+ expect(parsedPayload.iss).toEqual('test-internal');
14
+ expect(parsedPayload.exp - parsedPayload.iat).toEqual(60);
15
+ });
16
+ it('works for custom tokens', () => {
17
+ const payload = { hello: 'world' };
18
+ const token = generateInternalAuthToken({
19
+ customClaims: payload,
20
+ expiresInSeconds: 30,
21
+ aud: 'aud',
22
+ sub: 'sub',
23
+ });
24
+ const parsedPayload = parseInternalAuthTokenOrThrow(token);
25
+ expect(parsedPayload.iss).toEqual('test-internal');
26
+ expect(parsedPayload.exp - parsedPayload.iat).toEqual(30);
27
+ expect(parsedPayload.hello).toEqual('world');
28
+ expect(parsedPayload.aud).toEqual('aud');
29
+ expect(parsedPayload.sub).toEqual('sub');
30
+ });
31
+ it('throws for expired tokens', () => {
32
+ const invalidToken = generateInternalAuthToken({
33
+ expiresInSeconds: -1,
34
+ });
35
+ expect(() => parseInternalAuthTokenOrThrow(invalidToken)).toThrowError('Token expired');
36
+ });
37
+ it('throws for invalid signature', () => {
38
+ const payload = { hello: 'world' };
39
+ const token = generateInternalAuthToken({
40
+ customClaims: payload,
41
+ });
42
+ const invalidToken = token.replace(/.$/, 'x');
43
+ expect(() => parseInternalAuthTokenOrThrow(invalidToken)).toThrowError('Invalid token');
44
+ });
45
+ });
@@ -0,0 +1,3 @@
1
+ export declare function sign(data: string): string;
2
+ export declare function verify(data: string, signature: string): boolean;
3
+ //# sourceMappingURL=secret.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secret.d.ts","sourceRoot":"","sources":["../../../src/app-support/crypto/secret.ts"],"names":[],"mappings":"AAEA,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,UAKhC;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,WAGrD"}
@@ -0,0 +1,12 @@
1
+ import { createHmac } from 'crypto';
2
+ export function sign(data) {
3
+ const keyStr = process.env.MONOREPO_BASE_SECRET;
4
+ if (!keyStr)
5
+ throw new Error('Secret not set');
6
+ const key = Buffer.from(keyStr, 'hex');
7
+ return createHmac('sha256', key).update(data).digest('hex');
8
+ }
9
+ export function verify(data, signature) {
10
+ const generatedSignature = sign(data);
11
+ return generatedSignature === signature;
12
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=secret.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secret.spec.d.ts","sourceRoot":"","sources":["../../../src/app-support/crypto/secret.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import { beforeEach, describe, expect, it } from 'vitest';
2
+ import { sign, verify } from './secret';
3
+ describe('sign and verify', () => {
4
+ beforeEach(() => {
5
+ process.env.MONOREPO_BASE_SECRET = '1234567890abcdef';
6
+ });
7
+ it('verify should return true for correct signature', async () => {
8
+ const sig = sign('data');
9
+ expect(verify('data', sig)).toEqual(true);
10
+ });
11
+ it('verify should return false for correct signature', async () => {
12
+ const sig = sign('data');
13
+ expect(verify('data2', sig)).toEqual(false);
14
+ });
15
+ });
@@ -0,0 +1,2 @@
1
+ export declare function getPortForServiceName(serviceName: string): number;
2
+ //# sourceMappingURL=dev-discovery-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-discovery-loader.d.ts","sourceRoot":"","sources":["../../../src/app-support/discovery/dev-discovery-loader.ts"],"names":[],"mappings":"AAgCA,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,UAExD"}
@@ -0,0 +1,30 @@
1
+ import { workspaces } from "../../libs/discovery";
2
+ let _portLookupByServiceName = null;
3
+ function getPortLookup() {
4
+ if (_portLookupByServiceName)
5
+ return _portLookupByServiceName;
6
+ if (process.env["IS_KUBERNETES"] === "true") {
7
+ throw new Error("getPortLookup() should only be used in local development. In production, the service name is sufficient.");
8
+ }
9
+ _portLookupByServiceName = {};
10
+ Object.values(workspaces()).forEach((workspace) => {
11
+ workspace.packageDataEntries.forEach((pkg) => {
12
+ const serviceName = pkg.deployment?.service_name;
13
+ const port = pkg.deployment?.port;
14
+ if (!serviceName || !port)
15
+ return;
16
+ const existing = _portLookupByServiceName[serviceName];
17
+ if (!existing) {
18
+ _portLookupByServiceName[serviceName] = port;
19
+ }
20
+ else if (existing !== port) {
21
+ console.error(`Service name ${serviceName} has conflicting ports: ${existing} and ${port}`);
22
+ process.exit(1);
23
+ }
24
+ });
25
+ });
26
+ return _portLookupByServiceName;
27
+ }
28
+ export function getPortForServiceName(serviceName) {
29
+ return getPortLookup()[serviceName];
30
+ }
@@ -0,0 +1,2 @@
1
+ export declare function getServiceEndpoint(serviceName: string): string;
2
+ //# sourceMappingURL=service-endpoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service-endpoint.d.ts","sourceRoot":"","sources":["../../../src/app-support/discovery/service-endpoint.ts"],"names":[],"mappings":"AAEA,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAS9D"}
@@ -0,0 +1,10 @@
1
+ import { getPortForServiceName } from "./dev-discovery-loader";
2
+ export function getServiceEndpoint(serviceName) {
3
+ if (process.env["IS_KUBERNETES"] === "true") {
4
+ return `http://${serviceName}`;
5
+ }
6
+ const servicePort = getPortForServiceName(serviceName);
7
+ if (!servicePort)
8
+ throw new Error(`Port not found for service ${serviceName}`);
9
+ return `http://127.0.0.1:${servicePort}`;
10
+ }
@@ -0,0 +1,11 @@
1
+ import { CLICommandParser } from "./common";
2
+ declare function run(cmdObj: CLICommandParser): Promise<void>;
3
+ declare const _default: {
4
+ affected: {
5
+ oneLiner: string;
6
+ keyExamples: string;
7
+ run: typeof run;
8
+ };
9
+ };
10
+ export default _default;
11
+ //# sourceMappingURL=affected.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"affected.d.ts","sourceRoot":"","sources":["../../src/cli/affected.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,gBAAgB,EAAmC,MAAM,UAAU,CAAC;AAoD7E,iBAAe,GAAG,CAAC,MAAM,EAAE,gBAAgB,iBAoD1C;;;;;;;;AAED,wBAEE"}
@@ -0,0 +1,103 @@
1
+ import { findImagesAffected, findImagesWithAffectedWorkspace, isImageAffected, isWorkspaceAffected, } from "../libs/affected-entities";
2
+ import { getImageData } from "../libs/config";
3
+ import { CLICommandParser, printUsageAndExit, StrongParams } from "./common";
4
+ const oneLiner = "Command to check whether an image or a workspace is affected by certain commit(s)";
5
+ const keyExamples = `
6
+ $ devops affected list-images
7
+ $ devops affected workspace db --base <sha1> --head <sha2>
8
+ $ devops affected image main-node --from-live-version
9
+ $ devops affected find-migrator --from-live-version
10
+ `;
11
+ const usage = `
12
+ ${oneLiner}
13
+
14
+ GENERAL USAGE
15
+ List
16
+ devops affected list-images --base [SHA1] --head [SHA2]
17
+ devops affected list-images --from-live-version
18
+
19
+ These return a list of all images affected by the given commits.
20
+
21
+ Checkers
22
+ devops affected workspace <workspace> --base [SHA1] --head [SHA2]
23
+
24
+ devops affected image <image> --base [SHA1] --head [SHA2]
25
+ devops affected image <image> --from-live-version
26
+
27
+ These return "true" or "false".
28
+
29
+ Finders
30
+ devops affected find-migrator --base [SHA1] --head [SHA2]
31
+ devops affected find-migrator --from-live-version
32
+
33
+ When --base and --head are used, it checks whether the db project is affected. If it is, it returns the name of one random
34
+ affected image.
35
+ When --from-live-version is used, it iterates on the live version of each image that depends on db, and returns the first image that is
36
+ affected by a db project change since that commit.
37
+
38
+ If the db project is unaffected, returns an empty string.
39
+
40
+ Options
41
+ Which commits are regarded for the affected calculation can be changed using:
42
+ --base Base of the current branch (HEAD^ by default)
43
+ --head Latest commit of the current branch (HEAD by default)
44
+ --from-live-version Use the live version of the image/workspace as the base (see devops image version get)
45
+
46
+ If --from-live-version is present, --base and --head are ignored.
47
+
48
+ EXAMPLES
49
+ ${keyExamples.trim()}
50
+ `;
51
+ async function run(cmdObj) {
52
+ const options = cmdObj.parseOptions({
53
+ params: ["--base", "--head"],
54
+ booleans: ["--from-live-version"],
55
+ });
56
+ if (cmdObj.help || options.args.length < 1)
57
+ printUsageAndExit(usage);
58
+ const baseSha = options.options["--base"]?.toString();
59
+ const headSha = options.options["--head"]?.toString();
60
+ const fromLiveVersion = Boolean(options.options["--from-live-version"]);
61
+ const commonOpts = {
62
+ baseSha,
63
+ headSha,
64
+ fromLiveVersion,
65
+ monorepoEnv: cmdObj.env,
66
+ };
67
+ const [cmd, imageOrWorkspace] = options.args;
68
+ const params = new StrongParams(usage, { imageOrWorkspace });
69
+ switch (cmd) {
70
+ case "list-images": {
71
+ console.log(findImagesAffected(commonOpts).join("\n"));
72
+ break;
73
+ }
74
+ case "workspace": {
75
+ // prettier-ignore
76
+ const affected = isWorkspaceAffected(params.required("imageOrWorkspace"), commonOpts);
77
+ console.log(affected ? "true" : "false");
78
+ break;
79
+ }
80
+ case "image": {
81
+ const affected = isImageAffected(params.required("imageOrWorkspace"), commonOpts);
82
+ console.log(affected ? "true" : "false");
83
+ break;
84
+ }
85
+ case "find-migrator": {
86
+ const migrator = findImagesWithAffectedWorkspace("db", commonOpts);
87
+ if (!migrator.length)
88
+ break;
89
+ const firstMigrator = migrator.find(imageName => getImageData(imageName)["can-db-migrate"]);
90
+ if (!firstMigrator) {
91
+ console.error(`The db project was changed and affects the following images: ${migrator.join(", ")}. However, no image in the list has can-db-migrate=true in .devops/config/images.yaml.`);
92
+ process.exit(1);
93
+ }
94
+ console.log(firstMigrator);
95
+ break;
96
+ }
97
+ default:
98
+ printUsageAndExit(usage);
99
+ }
100
+ }
101
+ export default {
102
+ affected: { oneLiner, keyExamples, run },
103
+ };
@@ -0,0 +1,89 @@
1
+ type ParsedArgs = {
2
+ args: string[];
3
+ argsStr: string;
4
+ options: {
5
+ [key: string]: string | boolean;
6
+ };
7
+ passthrough?: string[];
8
+ };
9
+ export declare class CLICommandParser {
10
+ command: string;
11
+ args: string[];
12
+ env: string;
13
+ envForced: boolean;
14
+ help: boolean;
15
+ skipEnvCheck: boolean;
16
+ constructor(cmdArray: string[]);
17
+ executorFromEnv(commandStr: string, options?: Omit<CommandExecutorOptions, "env">): CommandExecutor;
18
+ parseOptions({ params, booleans, passthroughArgs, }?: {
19
+ /** Param is used like so: --param value */
20
+ params?: string[];
21
+ /** Boolean flag is used like so: --flag */
22
+ booleans?: string[];
23
+ /** Pass through args are used like so: -- arg1 arg2 */
24
+ passthroughArgs?: boolean;
25
+ }): ParsedArgs;
26
+ _validateEnv(env: string): boolean;
27
+ _separateOptions(args: string[], { params, booleans, passthroughArgs, }?: {
28
+ params?: string[];
29
+ booleans?: string[];
30
+ passthroughArgs?: boolean;
31
+ }): ParsedArgs;
32
+ }
33
+ type CommandExecutorOptions = {
34
+ env?: string;
35
+ quiet?: boolean;
36
+ checkEnvYaml?: boolean;
37
+ redactedCommand?: string;
38
+ };
39
+ export declare class CommandExecutor {
40
+ commandStr: string;
41
+ env?: string;
42
+ quiet: boolean;
43
+ redactedCommand?: string;
44
+ checkEnvYaml: boolean;
45
+ constructor(commandStr: string, { env, quiet, redactedCommand, checkEnvYaml, }?: CommandExecutorOptions);
46
+ /** Non-interactive use only. stdout is returned. */
47
+ exec(options?: {
48
+ onlyStatusCode?: false;
49
+ asObject?: false;
50
+ env?: object;
51
+ }): string;
52
+ exec(options: {
53
+ onlyStatusCode?: false;
54
+ asObject: true;
55
+ env?: object;
56
+ }): {
57
+ statusCode: number;
58
+ stdout: string;
59
+ stderr: string;
60
+ };
61
+ exec(options: {
62
+ onlyStatusCode: true;
63
+ asObject?: boolean;
64
+ env?: object;
65
+ }): number;
66
+ /** Should be used for CLI commands intended to be used locally. Provides interactivity. Unlike exec(), stdout is not returned. */
67
+ spawn({ env }?: {
68
+ env?: {} | undefined;
69
+ }): Promise<unknown>;
70
+ _prepareFullCommand(): string;
71
+ _getProcessEnv(envOverride?: {}): {
72
+ MONOREPO_ENV: string | undefined;
73
+ TZ?: string;
74
+ NODE_ENV?: string;
75
+ };
76
+ _envInjectorPrefix(): string;
77
+ _checkEnvYamlFiles(): void;
78
+ }
79
+ export declare function dotEnvFilesForEnv(env?: string): string[];
80
+ export declare function printUsageAndExit(text: string): never;
81
+ export declare class StrongParams {
82
+ private usage;
83
+ private args;
84
+ constructor(usage: string, args: Record<string, string | undefined>);
85
+ required(key: string): string;
86
+ optional(key: string): string | undefined;
87
+ }
88
+ export {};
89
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/cli/common.ts"],"names":[],"mappings":"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"}