@mtndev/cli 1.1.0 → 2.0.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 (260) hide show
  1. package/CHANGELOG.md +91 -0
  2. package/cjs/__chunks/VH7oDXx4.cjs +28 -0
  3. package/cjs/commands/aws/ec2/allow-ip/handler.cjs +261 -0
  4. package/cjs/commands/aws/ec2/allow-ip/handler.d.ts +6 -0
  5. package/cjs/commands/aws/ec2/allow-ip/index.cjs +25 -0
  6. package/cjs/commands/aws/ec2/allow-ip/index.d.ts +3 -0
  7. package/cjs/commands/aws/ec2/allow-ip/schema.cjs +33 -0
  8. package/cjs/commands/aws/ec2/allow-ip/schema.d.ts +33 -0
  9. package/cjs/commands/aws/ec2/allow-ip/utils.cjs +379 -0
  10. package/cjs/commands/aws/ec2/allow-ip/utils.d.ts +189 -0
  11. package/cjs/commands/aws/iam/admin-group.cjs +111 -0
  12. package/cjs/commands/aws/iam/admin-group.d.ts +55 -0
  13. package/cjs/commands/aws/iam/break-glass/handler.cjs +127 -0
  14. package/cjs/commands/aws/iam/break-glass/handler.d.ts +7 -0
  15. package/cjs/commands/aws/iam/break-glass/index.cjs +7 -0
  16. package/cjs/commands/aws/iam/break-glass/index.d.ts +2 -0
  17. package/cjs/commands/aws/iam/break-glass/schema.cjs +21 -0
  18. package/cjs/commands/aws/iam/break-glass/schema.d.ts +25 -0
  19. package/cjs/commands/aws/iam/check-admin/handler.cjs +89 -0
  20. package/cjs/commands/aws/iam/check-admin/handler.d.ts +5 -0
  21. package/cjs/commands/aws/iam/check-admin/index.cjs +7 -0
  22. package/cjs/commands/aws/iam/check-admin/index.d.ts +2 -0
  23. package/cjs/commands/aws/iam/check-admin/schema.cjs +19 -0
  24. package/cjs/commands/aws/iam/check-admin/schema.d.ts +19 -0
  25. package/cjs/commands/aws/iam/policies/s3-restrictions-deny-non-s3-services.json +20 -0
  26. package/cjs/commands/aws/iam/policies/sts-federation.json +11 -0
  27. package/cjs/commands/aws/iam/policies/user-admins-deny-list.json +175 -0
  28. package/cjs/commands/aws/iam/policies/user-admins-deny-regions-list.json +41 -0
  29. package/cjs/commands/aws/iam/policies/user-admins-self-service-iam.json +56 -0
  30. package/cjs/commands/aws/iam/policies/user-admins-write-list.json +117 -0
  31. package/cjs/commands/aws/iam/remove-admin/handler.cjs +120 -0
  32. package/cjs/commands/aws/iam/remove-admin/handler.d.ts +6 -0
  33. package/cjs/commands/aws/iam/remove-admin/index.cjs +7 -0
  34. package/cjs/commands/aws/iam/remove-admin/index.d.ts +2 -0
  35. package/cjs/commands/aws/iam/remove-admin/schema.cjs +22 -0
  36. package/cjs/commands/aws/iam/remove-admin/schema.d.ts +28 -0
  37. package/cjs/commands/aws/iam/setup-acl/handler.cjs +227 -0
  38. package/cjs/commands/aws/iam/setup-acl/handler.d.ts +6 -0
  39. package/cjs/commands/aws/iam/setup-acl/index.cjs +13 -0
  40. package/cjs/commands/aws/iam/setup-acl/index.d.ts +3 -0
  41. package/cjs/commands/aws/iam/setup-acl/schema.cjs +19 -0
  42. package/cjs/commands/aws/iam/setup-acl/schema.d.ts +24 -0
  43. package/cjs/commands/aws/iam/setup-acl/utils.cjs +305 -0
  44. package/cjs/commands/aws/iam/setup-acl/utils.d.ts +61 -0
  45. package/cjs/commands/aws/iam/users/handler.cjs +59 -0
  46. package/cjs/commands/aws/iam/users/handler.d.ts +5 -0
  47. package/cjs/commands/aws/iam/users/index.cjs +18 -0
  48. package/cjs/commands/aws/iam/users/index.d.ts +3 -0
  49. package/cjs/commands/aws/iam/users/schema.cjs +17 -0
  50. package/cjs/commands/aws/iam/users/schema.d.ts +18 -0
  51. package/cjs/commands/aws/iam/users/utils.cjs +454 -0
  52. package/cjs/commands/aws/iam/users/utils.d.ts +119 -0
  53. package/cjs/commands/aws/index.cjs +223 -0
  54. package/cjs/commands/aws/index.d.ts +14 -0
  55. package/cjs/commands/aws/route53/add-record/handler.cjs +264 -0
  56. package/cjs/commands/aws/route53/add-record/handler.d.ts +36 -0
  57. package/cjs/commands/aws/route53/add-record/index.cjs +26 -0
  58. package/cjs/commands/aws/route53/add-record/index.d.ts +3 -0
  59. package/cjs/commands/aws/route53/add-record/schema.cjs +43 -0
  60. package/cjs/commands/aws/route53/add-record/schema.d.ts +45 -0
  61. package/cjs/commands/aws/route53/add-record/utils.cjs +404 -0
  62. package/cjs/commands/aws/route53/add-record/utils.d.ts +216 -0
  63. package/cjs/commands/aws/route53/remove-record/handler.cjs +114 -0
  64. package/cjs/commands/aws/route53/remove-record/handler.d.ts +6 -0
  65. package/cjs/commands/aws/route53/remove-record/index.cjs +5 -0
  66. package/cjs/commands/aws/route53/remove-record/index.d.ts +2 -0
  67. package/cjs/commands/aws/route53/remove-record/schema.cjs +22 -0
  68. package/cjs/commands/aws/route53/remove-record/schema.d.ts +30 -0
  69. package/cjs/commands/aws/schema.cjs +19 -0
  70. package/cjs/commands/aws/schema.d.ts +13 -0
  71. package/cjs/commands/aws/ses/send-email/handler.cjs +73 -0
  72. package/cjs/commands/aws/ses/send-email/handler.d.ts +5 -0
  73. package/cjs/commands/aws/ses/send-email/index.cjs +9 -0
  74. package/cjs/commands/aws/ses/send-email/index.d.ts +3 -0
  75. package/cjs/commands/aws/ses/send-email/schema.cjs +24 -0
  76. package/cjs/commands/aws/ses/send-email/schema.d.ts +39 -0
  77. package/cjs/commands/aws/ses/send-email/utils.cjs +87 -0
  78. package/cjs/commands/aws/ses/send-email/utils.d.ts +47 -0
  79. package/cjs/commands/aws/ses/smtp-password.cjs +72 -0
  80. package/cjs/commands/aws/ses/smtp-password.d.ts +21 -0
  81. package/cjs/commands/aws/utils/exec-aws.cjs +145 -0
  82. package/cjs/commands/aws/utils/exec-aws.d.ts +79 -0
  83. package/cjs/commands/aws/utils/resolve-policy-path.cjs +15 -0
  84. package/cjs/commands/aws/utils/resolve-policy-path.d.ts +8 -0
  85. package/cjs/commands/aws/utils/resolve-profile.cjs +93 -0
  86. package/cjs/commands/aws/utils/resolve-profile.d.ts +28 -0
  87. package/cjs/commands/aws/utils/tty.cjs +54 -0
  88. package/cjs/commands/aws/utils/tty.d.ts +24 -0
  89. package/cjs/commands/db/create-readonly-user/handler.cjs +254 -0
  90. package/cjs/commands/db/create-readonly-user/handler.d.ts +5 -0
  91. package/cjs/commands/db/create-readonly-user/index.cjs +18 -0
  92. package/cjs/commands/db/create-readonly-user/index.d.ts +3 -0
  93. package/cjs/commands/db/create-readonly-user/mysql.cjs +102 -0
  94. package/cjs/commands/db/create-readonly-user/mysql.d.ts +33 -0
  95. package/cjs/commands/db/create-readonly-user/postgres.cjs +209 -0
  96. package/cjs/commands/db/create-readonly-user/postgres.d.ts +31 -0
  97. package/cjs/commands/db/create-readonly-user/schema.cjs +39 -0
  98. package/cjs/commands/db/create-readonly-user/schema.d.ts +55 -0
  99. package/cjs/commands/db/create-readonly-user/utils.cjs +160 -0
  100. package/cjs/commands/db/create-readonly-user/utils.d.ts +112 -0
  101. package/cjs/commands/db/index.cjs +46 -0
  102. package/cjs/commands/db/index.d.ts +6 -0
  103. package/cjs/commands/doppler/handler.cjs +95 -9
  104. package/cjs/commands/doppler/index.cjs +33 -41
  105. package/cjs/commands/doppler/index.d.ts +1 -0
  106. package/cjs/commands/doppler/schema.cjs +130 -6
  107. package/cjs/commands/doppler/schema.d.ts +233 -17
  108. package/cjs/commands/doppler/set-secret.cjs +378 -0
  109. package/cjs/commands/doppler/set-secret.d.ts +113 -0
  110. package/cjs/commands/doppler/utils/exec.cjs +106 -12
  111. package/cjs/commands/doppler/utils.cjs +412 -30
  112. package/cjs/commands/doppler/utils.d.ts +32 -8
  113. package/cjs/commands/icons/handler.cjs +82 -8
  114. package/cjs/commands/icons/index.cjs +15 -31
  115. package/cjs/commands/icons/schema.cjs +101 -13
  116. package/cjs/commands/icons/schema.d.ts +1 -1
  117. package/cjs/commands/icons/utils.cjs +131 -13
  118. package/cjs/commands/index.cjs +54 -82
  119. package/cjs/commands/schema.cjs +25 -8
  120. package/cjs/index.cjs +3 -4
  121. package/esm/commands/aws/ec2/allow-ip/handler.d.ts +6 -0
  122. package/esm/commands/aws/ec2/allow-ip/handler.js +258 -0
  123. package/esm/commands/aws/ec2/allow-ip/index.d.ts +3 -0
  124. package/esm/commands/aws/ec2/allow-ip/index.js +4 -0
  125. package/esm/commands/aws/ec2/allow-ip/schema.d.ts +33 -0
  126. package/esm/commands/aws/ec2/allow-ip/schema.js +29 -0
  127. package/esm/commands/aws/ec2/allow-ip/utils.d.ts +189 -0
  128. package/esm/commands/aws/ec2/allow-ip/utils.js +363 -0
  129. package/esm/commands/aws/iam/admin-group.d.ts +55 -0
  130. package/esm/commands/aws/iam/admin-group.js +104 -0
  131. package/esm/commands/aws/iam/break-glass/handler.d.ts +7 -0
  132. package/esm/commands/aws/iam/break-glass/handler.js +124 -0
  133. package/esm/commands/aws/iam/break-glass/index.d.ts +2 -0
  134. package/esm/commands/aws/iam/break-glass/index.js +4 -0
  135. package/esm/commands/aws/iam/break-glass/schema.d.ts +25 -0
  136. package/esm/commands/aws/iam/break-glass/schema.js +19 -0
  137. package/esm/commands/aws/iam/check-admin/handler.d.ts +5 -0
  138. package/esm/commands/aws/iam/check-admin/handler.js +86 -0
  139. package/esm/commands/aws/iam/check-admin/index.d.ts +2 -0
  140. package/esm/commands/aws/iam/check-admin/index.js +4 -0
  141. package/esm/commands/aws/iam/check-admin/schema.d.ts +19 -0
  142. package/esm/commands/aws/iam/check-admin/schema.js +17 -0
  143. package/esm/commands/aws/iam/policies/s3-restrictions-deny-non-s3-services.json +20 -0
  144. package/esm/commands/aws/iam/policies/sts-federation.json +11 -0
  145. package/esm/commands/aws/iam/policies/user-admins-deny-list.json +175 -0
  146. package/esm/commands/aws/iam/policies/user-admins-deny-regions-list.json +41 -0
  147. package/esm/commands/aws/iam/policies/user-admins-self-service-iam.json +56 -0
  148. package/esm/commands/aws/iam/policies/user-admins-write-list.json +117 -0
  149. package/esm/commands/aws/iam/remove-admin/handler.d.ts +6 -0
  150. package/esm/commands/aws/iam/remove-admin/handler.js +117 -0
  151. package/esm/commands/aws/iam/remove-admin/index.d.ts +2 -0
  152. package/esm/commands/aws/iam/remove-admin/index.js +4 -0
  153. package/esm/commands/aws/iam/remove-admin/schema.d.ts +28 -0
  154. package/esm/commands/aws/iam/remove-admin/schema.js +20 -0
  155. package/esm/commands/aws/iam/setup-acl/handler.d.ts +6 -0
  156. package/esm/commands/aws/iam/setup-acl/handler.js +224 -0
  157. package/esm/commands/aws/iam/setup-acl/index.d.ts +3 -0
  158. package/esm/commands/aws/iam/setup-acl/index.js +4 -0
  159. package/esm/commands/aws/iam/setup-acl/schema.d.ts +24 -0
  160. package/esm/commands/aws/iam/setup-acl/schema.js +18 -0
  161. package/esm/commands/aws/iam/setup-acl/utils.d.ts +61 -0
  162. package/esm/commands/aws/iam/setup-acl/utils.js +298 -0
  163. package/esm/commands/aws/iam/users/handler.d.ts +5 -0
  164. package/esm/commands/aws/iam/users/handler.js +56 -0
  165. package/esm/commands/aws/iam/users/index.d.ts +3 -0
  166. package/esm/commands/aws/iam/users/index.js +4 -0
  167. package/esm/commands/aws/iam/users/schema.d.ts +18 -0
  168. package/esm/commands/aws/iam/users/schema.js +16 -0
  169. package/esm/commands/aws/iam/users/utils.d.ts +119 -0
  170. package/esm/commands/aws/iam/users/utils.js +440 -0
  171. package/esm/commands/aws/index.d.ts +14 -0
  172. package/esm/commands/aws/index.js +142 -0
  173. package/esm/commands/aws/route53/add-record/handler.d.ts +36 -0
  174. package/esm/commands/aws/route53/add-record/handler.js +258 -0
  175. package/esm/commands/aws/route53/add-record/index.d.ts +3 -0
  176. package/esm/commands/aws/route53/add-record/index.js +4 -0
  177. package/esm/commands/aws/route53/add-record/schema.d.ts +45 -0
  178. package/esm/commands/aws/route53/add-record/schema.js +40 -0
  179. package/esm/commands/aws/route53/add-record/utils.d.ts +216 -0
  180. package/esm/commands/aws/route53/add-record/utils.js +389 -0
  181. package/esm/commands/aws/route53/remove-record/handler.d.ts +6 -0
  182. package/esm/commands/aws/route53/remove-record/handler.js +111 -0
  183. package/esm/commands/aws/route53/remove-record/index.d.ts +2 -0
  184. package/esm/commands/aws/route53/remove-record/index.js +3 -0
  185. package/esm/commands/aws/route53/remove-record/schema.d.ts +30 -0
  186. package/esm/commands/aws/route53/remove-record/schema.js +21 -0
  187. package/esm/commands/aws/schema.d.ts +13 -0
  188. package/esm/commands/aws/schema.js +16 -0
  189. package/esm/commands/aws/ses/send-email/handler.d.ts +5 -0
  190. package/esm/commands/aws/ses/send-email/handler.js +70 -0
  191. package/esm/commands/aws/ses/send-email/index.d.ts +3 -0
  192. package/esm/commands/aws/ses/send-email/index.js +4 -0
  193. package/esm/commands/aws/ses/send-email/schema.d.ts +39 -0
  194. package/esm/commands/aws/ses/send-email/schema.js +23 -0
  195. package/esm/commands/aws/ses/send-email/utils.d.ts +47 -0
  196. package/esm/commands/aws/ses/send-email/utils.js +84 -0
  197. package/esm/commands/aws/ses/smtp-password.d.ts +21 -0
  198. package/esm/commands/aws/ses/smtp-password.js +69 -0
  199. package/esm/commands/aws/utils/exec-aws.d.ts +79 -0
  200. package/esm/commands/aws/utils/exec-aws.js +137 -0
  201. package/esm/commands/aws/utils/resolve-policy-path.d.ts +8 -0
  202. package/esm/commands/aws/utils/resolve-policy-path.js +14 -0
  203. package/esm/commands/aws/utils/resolve-profile.d.ts +28 -0
  204. package/esm/commands/aws/utils/resolve-profile.js +88 -0
  205. package/esm/commands/aws/utils/tty.d.ts +24 -0
  206. package/esm/commands/aws/utils/tty.js +51 -0
  207. package/esm/commands/db/create-readonly-user/handler.d.ts +5 -0
  208. package/esm/commands/db/create-readonly-user/handler.js +251 -0
  209. package/esm/commands/db/create-readonly-user/index.d.ts +3 -0
  210. package/esm/commands/db/create-readonly-user/index.js +4 -0
  211. package/esm/commands/db/create-readonly-user/mysql.d.ts +33 -0
  212. package/esm/commands/db/create-readonly-user/mysql.js +98 -0
  213. package/esm/commands/db/create-readonly-user/postgres.d.ts +31 -0
  214. package/esm/commands/db/create-readonly-user/postgres.js +205 -0
  215. package/esm/commands/db/create-readonly-user/schema.d.ts +55 -0
  216. package/esm/commands/db/create-readonly-user/schema.js +35 -0
  217. package/esm/commands/db/create-readonly-user/utils.d.ts +112 -0
  218. package/esm/commands/db/create-readonly-user/utils.js +151 -0
  219. package/esm/commands/db/index.d.ts +6 -0
  220. package/esm/commands/db/index.js +31 -0
  221. package/esm/commands/doppler/handler.js +92 -9
  222. package/esm/commands/doppler/index.d.ts +1 -0
  223. package/esm/commands/doppler/index.js +6 -41
  224. package/esm/commands/doppler/schema.d.ts +233 -17
  225. package/esm/commands/doppler/schema.js +125 -7
  226. package/esm/commands/doppler/set-secret.d.ts +113 -0
  227. package/esm/commands/doppler/set-secret.js +370 -0
  228. package/esm/commands/doppler/utils/exec.js +100 -12
  229. package/esm/commands/doppler/utils.d.ts +32 -8
  230. package/esm/commands/doppler/utils.js +396 -30
  231. package/esm/commands/icons/handler.js +79 -8
  232. package/esm/commands/icons/index.js +4 -31
  233. package/esm/commands/icons/schema.d.ts +1 -1
  234. package/esm/commands/icons/schema.js +97 -15
  235. package/esm/commands/icons/utils.js +125 -13
  236. package/esm/commands/index.js +49 -78
  237. package/esm/commands/schema.js +22 -7
  238. package/esm/index.js +3 -4
  239. package/package.json +12 -2
  240. package/vitest.config.ts +11 -0
  241. package/cjs/__chunks/4GFJUCSP.cjs +0 -52
  242. package/cjs/__chunks/4SFWHCB3.cjs +0 -133
  243. package/cjs/__chunks/B2KFW7T7.cjs +0 -1
  244. package/cjs/__chunks/EMMC33QA.cjs +0 -401
  245. package/cjs/__chunks/INFOPAHN.cjs +0 -117
  246. package/cjs/__chunks/J36P6UNE.cjs +0 -75
  247. package/cjs/__chunks/NIMXXHJQ.cjs +0 -92
  248. package/cjs/__chunks/NSRFG4DF.cjs +0 -100
  249. package/cjs/__chunks/WNJ3ZYLI.cjs +0 -1
  250. package/cjs/__chunks/ZMDIOZPT.cjs +0 -22
  251. package/esm/__chunks/46HGXFME.js +0 -0
  252. package/esm/__chunks/6G4PXXKF.js +0 -75
  253. package/esm/__chunks/6L5RNR7G.js +0 -100
  254. package/esm/__chunks/FL7AILGH.js +0 -133
  255. package/esm/__chunks/HJSXC6HP.js +0 -117
  256. package/esm/__chunks/O262GK4B.js +0 -401
  257. package/esm/__chunks/O3CCA76Q.js +0 -22
  258. package/esm/__chunks/SJXQJ7RS.js +0 -92
  259. package/esm/__chunks/SNCKIAOR.js +0 -0
  260. package/esm/__chunks/X3R5PSWH.js +0 -52
@@ -1,100 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
-
3
-
4
-
5
- var _EMMC33QAcjs = require('./EMMC33QA.cjs');
6
-
7
-
8
-
9
- var _4GFJUCSPcjs = require('./4GFJUCSP.cjs');
10
-
11
- // src/commands/doppler/handler.js
12
- var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);
13
- var _zod = require('zod');
14
- async function dopplerCommand(options) {
15
- try {
16
- const validatedOptions = _4GFJUCSPcjs.dopplerCommandOptionsSchema.parse(options);
17
- if (validatedOptions.help || !validatedOptions.action) {
18
- console.log(
19
- _chalk2.default.bold(`
20
- Usage: @mtndev/cli doppler [options] <action>`)
21
- );
22
- console.log(_4GFJUCSPcjs.dopplerCommandMetadata.description);
23
- console.log(_chalk2.default.bold("\nOptions:"));
24
- Object.entries(_4GFJUCSPcjs.dopplerCommandOptionsSchema.shape).forEach(
25
- ([key, fieldSchema]) => {
26
- if (key === "action") return;
27
- const description = fieldSchema.description || "No description available";
28
- const optionMeta = (
29
- /** @type {any} */
30
- _4GFJUCSPcjs.dopplerCommandMetadata.options[key]
31
- );
32
- const defaultValue = _nullishCoalesce(_optionalChain([optionMeta, 'optionalAccess', _ => _.default]), () => ( false));
33
- const alias = _optionalChain([optionMeta, 'optionalAccess', _2 => _2.alias]) ? _chalk2.default.cyan(`, -${optionMeta.alias}`) : "";
34
- console.log(
35
- _chalk2.default.cyan(` --${key}`) + alias + ` ${description} (default: ${defaultValue})`
36
- );
37
- }
38
- );
39
- console.log("");
40
- return;
41
- }
42
- const { action, environment, verbose } = validatedOptions;
43
- _EMMC33QAcjs.checkDependencies.call(void 0, verbose);
44
- if (action === "download") {
45
- await _EMMC33QAcjs.downloadConfigs.call(void 0, { environment, verbose });
46
- } else if (action === "upload") {
47
- await _EMMC33QAcjs.uploadConfigs.call(void 0, { environment, verbose });
48
- }
49
- console.log(_chalk2.default.green(`
50
- \u2705 Doppler ${action} completed successfully!`));
51
- } catch (error) {
52
- if (error instanceof _zod.ZodError) {
53
- console.error(_chalk2.default.red(`
54
- \u274C Invalid command options:`));
55
- error.errors.forEach((err) => {
56
- console.error(_chalk2.default.red(` ${err.path.join(".")}: ${err.message}`));
57
- });
58
- process.exit(1);
59
- }
60
- const action = (
61
- /** @type {any} */
62
- _optionalChain([options, 'optionalAccess', _3 => _3.action]) || "operation"
63
- );
64
- const verbose = (
65
- /** @type {any} */
66
- _optionalChain([options, 'optionalAccess', _4 => _4.verbose]) || false
67
- );
68
- console.error(_chalk2.default.red(`
69
- \u274C Doppler ${action} failed:`));
70
- if (error instanceof Error) {
71
- console.error(_chalk2.default.red(` ${error.message}`));
72
- if (verbose && error.stack) {
73
- console.error(_chalk2.default.gray("\nStack trace:"));
74
- console.error(_chalk2.default.gray(error.stack));
75
- }
76
- } else {
77
- console.error(_chalk2.default.red(` ${String(error)}`));
78
- }
79
- console.error(_chalk2.default.yellow("\n\u{1F4A1} Troubleshooting tips:"));
80
- console.error(
81
- _chalk2.default.yellow(
82
- " \u2022 Ensure Doppler CLI is installed (brew install dopplerhq/cli/doppler)"
83
- )
84
- );
85
- console.error(
86
- _chalk2.default.yellow(" \u2022 Make sure you're logged in (doppler login)")
87
- );
88
- console.error(
89
- _chalk2.default.yellow(" \u2022 Verify project is configured (doppler setup)")
90
- );
91
- console.error(
92
- _chalk2.default.yellow(" \u2022 Use --verbose for detailed error information\n")
93
- );
94
- process.exit(1);
95
- }
96
- }
97
-
98
-
99
-
100
- exports.dopplerCommand = dopplerCommand;
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,22 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/commands/schema.js
2
- var _zod = require('zod');
3
- var globalOptionsSchema = _zod.z.object({
4
- verbose: _zod.z.boolean().default(false).optional().describe("Enable verbose logging for detailed output and error traces")
5
- });
6
- var globalCommandsMetadata = {
7
- name: "mtndev-cli",
8
- version: "1.0.0",
9
- description: "Omnibus CLI tool for mtndev projects",
10
- options: {
11
- verbose: {
12
- description: globalOptionsSchema.shape.verbose.description,
13
- default: false,
14
- alias: "v"
15
- }
16
- }
17
- };
18
-
19
-
20
-
21
-
22
- exports.globalOptionsSchema = globalOptionsSchema; exports.globalCommandsMetadata = globalCommandsMetadata;
File without changes
@@ -1,75 +0,0 @@
1
- // src/commands/icons/schema.js
2
- import { z } from "zod";
3
- var CHANNELS = ["dev", "staging", "test"];
4
- var ICON_TYPES = ["icon", "adaptive-icon"];
5
- var CHANNEL_TEXT_MAP = {
6
- dev: "DEV",
7
- local: "LOC",
8
- staging: "STG",
9
- test: "TST"
10
- };
11
- var ICON_SIZE_MAP = {
12
- "adaptive-icon": 250,
13
- icon: 378
14
- };
15
- var iconsCommandOptionsSchema = z.object({
16
- input: z.string().describe(
17
- "Path to the input image directory containing icon.png and adaptive-icon.png"
18
- ),
19
- channels: z.array(z.enum(["dev", "local", "staging", "test"])).optional().default(["dev", "local", "staging", "test"]).describe("Channels to generate icons for"),
20
- iconTypes: z.array(z.enum(["icon", "adaptive-icon"])).optional().default(["icon", "adaptive-icon"]).describe("Icon types to generate"),
21
- verbose: z.boolean().optional().default(false).describe("Enable verbose logging for detailed error information"),
22
- help: z.boolean().optional().default(false).describe("Display help for command")
23
- });
24
- var iconsCommandMetadata = {
25
- name: "icons",
26
- description: `Generate app channel version icons with overlay text
27
-
28
- This command generates icon variants for different app channels (dev, local, staging, test)
29
- by overlaying text on base icon images using ImageMagick.
30
-
31
- Requirements:
32
- \u2022 ImageMagick must be installed (brew install imagemagick)
33
- \u2022 Base icons (icon.png, adaptive-icon.png) must exist in the input directory
34
-
35
- Examples:
36
- $ mtn icons ./apps/my-app/assets # Generate all channel icons
37
- $ mtn icons ./assets -c dev,staging # Generate only dev and staging icons
38
- $ mtn icons ./assets -t icon # Generate only standard icons
39
- $ mtn icons ./assets -v # Verbose output`,
40
- options: {
41
- input: {
42
- description: iconsCommandOptionsSchema.shape.input.description,
43
- required: true
44
- },
45
- channels: {
46
- description: iconsCommandOptionsSchema.shape.channels.description,
47
- default: "dev,local,staging,test",
48
- alias: "c"
49
- },
50
- iconTypes: {
51
- description: iconsCommandOptionsSchema.shape.iconTypes.description,
52
- default: "icon,adaptive-icon",
53
- alias: "t"
54
- },
55
- verbose: {
56
- description: iconsCommandOptionsSchema.shape.verbose.description,
57
- default: false,
58
- alias: "v"
59
- },
60
- help: {
61
- description: iconsCommandOptionsSchema.shape.help.description,
62
- default: false,
63
- alias: "h"
64
- }
65
- }
66
- };
67
-
68
- export {
69
- CHANNELS,
70
- ICON_TYPES,
71
- CHANNEL_TEXT_MAP,
72
- ICON_SIZE_MAP,
73
- iconsCommandOptionsSchema,
74
- iconsCommandMetadata
75
- };
@@ -1,100 +0,0 @@
1
- import {
2
- checkDependencies,
3
- downloadConfigs,
4
- uploadConfigs
5
- } from "./O262GK4B.js";
6
- import {
7
- dopplerCommandMetadata,
8
- dopplerCommandOptionsSchema
9
- } from "./X3R5PSWH.js";
10
-
11
- // src/commands/doppler/handler.js
12
- import chalk from "chalk";
13
- import { ZodError } from "zod";
14
- async function dopplerCommand(options) {
15
- try {
16
- const validatedOptions = dopplerCommandOptionsSchema.parse(options);
17
- if (validatedOptions.help || !validatedOptions.action) {
18
- console.log(
19
- chalk.bold(`
20
- Usage: @mtndev/cli doppler [options] <action>`)
21
- );
22
- console.log(dopplerCommandMetadata.description);
23
- console.log(chalk.bold("\nOptions:"));
24
- Object.entries(dopplerCommandOptionsSchema.shape).forEach(
25
- ([key, fieldSchema]) => {
26
- if (key === "action") return;
27
- const description = fieldSchema.description || "No description available";
28
- const optionMeta = (
29
- /** @type {any} */
30
- dopplerCommandMetadata.options[key]
31
- );
32
- const defaultValue = optionMeta?.default ?? false;
33
- const alias = optionMeta?.alias ? chalk.cyan(`, -${optionMeta.alias}`) : "";
34
- console.log(
35
- chalk.cyan(` --${key}`) + alias + ` ${description} (default: ${defaultValue})`
36
- );
37
- }
38
- );
39
- console.log("");
40
- return;
41
- }
42
- const { action, environment, verbose } = validatedOptions;
43
- checkDependencies(verbose);
44
- if (action === "download") {
45
- await downloadConfigs({ environment, verbose });
46
- } else if (action === "upload") {
47
- await uploadConfigs({ environment, verbose });
48
- }
49
- console.log(chalk.green(`
50
- \u2705 Doppler ${action} completed successfully!`));
51
- } catch (error) {
52
- if (error instanceof ZodError) {
53
- console.error(chalk.red(`
54
- \u274C Invalid command options:`));
55
- error.errors.forEach((err) => {
56
- console.error(chalk.red(` ${err.path.join(".")}: ${err.message}`));
57
- });
58
- process.exit(1);
59
- }
60
- const action = (
61
- /** @type {any} */
62
- options?.action || "operation"
63
- );
64
- const verbose = (
65
- /** @type {any} */
66
- options?.verbose || false
67
- );
68
- console.error(chalk.red(`
69
- \u274C Doppler ${action} failed:`));
70
- if (error instanceof Error) {
71
- console.error(chalk.red(` ${error.message}`));
72
- if (verbose && error.stack) {
73
- console.error(chalk.gray("\nStack trace:"));
74
- console.error(chalk.gray(error.stack));
75
- }
76
- } else {
77
- console.error(chalk.red(` ${String(error)}`));
78
- }
79
- console.error(chalk.yellow("\n\u{1F4A1} Troubleshooting tips:"));
80
- console.error(
81
- chalk.yellow(
82
- " \u2022 Ensure Doppler CLI is installed (brew install dopplerhq/cli/doppler)"
83
- )
84
- );
85
- console.error(
86
- chalk.yellow(" \u2022 Make sure you're logged in (doppler login)")
87
- );
88
- console.error(
89
- chalk.yellow(" \u2022 Verify project is configured (doppler setup)")
90
- );
91
- console.error(
92
- chalk.yellow(" \u2022 Use --verbose for detailed error information\n")
93
- );
94
- process.exit(1);
95
- }
96
- }
97
-
98
- export {
99
- dopplerCommand
100
- };
@@ -1,133 +0,0 @@
1
- import {
2
- CHANNEL_TEXT_MAP,
3
- ICON_SIZE_MAP
4
- } from "./6G4PXXKF.js";
5
-
6
- // src/commands/icons/utils.js
7
- import { execSync } from "child_process";
8
- import { existsSync } from "fs";
9
- import { join, resolve } from "path";
10
- import chalk from "chalk";
11
- function checkDependencies(verbose = false) {
12
- if (verbose) {
13
- console.log(chalk.blue("\n\u{1F50D} Checking dependencies..."));
14
- }
15
- try {
16
- execSync("which magick", { stdio: "pipe" });
17
- if (verbose) {
18
- console.log(chalk.green(" \u2713 ImageMagick is installed"));
19
- }
20
- } catch {
21
- throw new Error(
22
- "ImageMagick is not installed. Please install it (brew install imagemagick) and try again."
23
- );
24
- }
25
- }
26
- function validateBaseIcons(baseDir, iconTypes, verbose = false) {
27
- if (verbose) {
28
- console.log(chalk.blue("\n\u{1F4C1} Validating base icons..."));
29
- }
30
- const resolvedDir = resolve(baseDir);
31
- if (!existsSync(resolvedDir)) {
32
- throw new Error(`Input directory does not exist: ${resolvedDir}`);
33
- }
34
- const missingIcons = [];
35
- for (const iconType of iconTypes) {
36
- const iconPath = join(resolvedDir, `${iconType}.png`);
37
- if (!existsSync(iconPath)) {
38
- missingIcons.push(`${iconType}.png`);
39
- } else if (verbose) {
40
- console.log(chalk.green(` \u2713 Found: ${iconType}.png`));
41
- }
42
- }
43
- if (missingIcons.length > 0) {
44
- throw new Error(
45
- `Missing base icons in ${resolvedDir}: ${missingIcons.join(", ")}`
46
- );
47
- }
48
- }
49
- function generateIcon(options) {
50
- const { baseDir, channel, iconType, verbose } = options;
51
- const resolvedDir = resolve(baseDir);
52
- const inputFile = join(resolvedDir, `${iconType}.png`);
53
- const outputFile = join(resolvedDir, `${iconType}-${channel}.png`);
54
- const size = ICON_SIZE_MAP[
55
- /** @type {keyof typeof ICON_SIZE_MAP} */
56
- iconType
57
- ] || 378;
58
- const text = CHANNEL_TEXT_MAP[
59
- /** @type {keyof typeof CHANNEL_TEXT_MAP} */
60
- channel
61
- ] || channel.toUpperCase().slice(0, 3);
62
- const command = [
63
- "magick",
64
- `"${inputFile}"`,
65
- `-pointsize ${size}`,
66
- "-fill white",
67
- "-gravity center",
68
- "-font Arial-Black",
69
- "-stroke black",
70
- "-strokewidth 5",
71
- `-draw "rotate -45 text 0,0 '${text}'"`,
72
- `"${outputFile}"`
73
- ].join(" ");
74
- if (verbose) {
75
- console.log(chalk.gray(` Command: ${command}`));
76
- }
77
- try {
78
- execSync(command, { stdio: verbose ? "inherit" : "pipe" });
79
- return outputFile;
80
- } catch (error) {
81
- throw new Error(
82
- `Failed to generate ${iconType}-${channel}.png: ${error instanceof Error ? error.message : String(error)}`
83
- );
84
- }
85
- }
86
- function generateAllIcons(options) {
87
- const { baseDir, channels, iconTypes, verbose } = options;
88
- const success = [];
89
- const failed = [];
90
- const totalIcons = channels.length * iconTypes.length;
91
- let current = 0;
92
- if (verbose) {
93
- console.log(chalk.blue(`
94
- \u{1F3A8} Generating ${totalIcons} icon(s)...`));
95
- }
96
- for (const channel of channels) {
97
- for (const iconType of iconTypes) {
98
- current++;
99
- const iconName = `${iconType}-${channel}.png`;
100
- if (verbose) {
101
- console.log(
102
- chalk.blue(`
103
- [${current}/${totalIcons}] Generating ${iconName}...`)
104
- );
105
- }
106
- try {
107
- const outputPath = generateIcon({
108
- baseDir,
109
- channel,
110
- iconType,
111
- verbose
112
- });
113
- success.push(outputPath);
114
- console.log(chalk.green(` \u2713 Generated: ${iconName}`));
115
- } catch (error) {
116
- const errorMessage = error instanceof Error ? error.message : String(error);
117
- failed.push({ icon: iconName, error: errorMessage });
118
- console.log(chalk.red(` \u2717 Failed: ${iconName}`));
119
- if (verbose) {
120
- console.log(chalk.red(` ${errorMessage}`));
121
- }
122
- }
123
- }
124
- }
125
- return { success, failed };
126
- }
127
-
128
- export {
129
- checkDependencies,
130
- validateBaseIcons,
131
- generateIcon,
132
- generateAllIcons
133
- };
@@ -1,117 +0,0 @@
1
- import {
2
- checkDependencies,
3
- generateAllIcons,
4
- validateBaseIcons
5
- } from "./FL7AILGH.js";
6
- import {
7
- iconsCommandMetadata,
8
- iconsCommandOptionsSchema
9
- } from "./6G4PXXKF.js";
10
-
11
- // src/commands/icons/handler.js
12
- import chalk from "chalk";
13
- import { ZodError } from "zod";
14
- async function iconsCommand(options) {
15
- try {
16
- const validatedOptions = iconsCommandOptionsSchema.parse(options);
17
- if (validatedOptions.help) {
18
- console.log(chalk.bold(`
19
- Usage: mtn icons <input> [options]`));
20
- console.log(chalk.gray(iconsCommandMetadata.description));
21
- console.log(chalk.bold("\nOptions:"));
22
- Object.entries(iconsCommandOptionsSchema.shape).forEach(
23
- ([key, fieldSchema]) => {
24
- if (key === "input") return;
25
- const description = fieldSchema.description || "No description available";
26
- const optionMeta = (
27
- /** @type {any} */
28
- iconsCommandMetadata.options[key]
29
- );
30
- const defaultValue = optionMeta?.default ?? false;
31
- const alias = optionMeta?.alias ? chalk.cyan(`, -${optionMeta.alias}`) : "";
32
- console.log(
33
- chalk.cyan(` --${key}`) + alias + ` ${description} (default: ${defaultValue})`
34
- );
35
- }
36
- );
37
- console.log("");
38
- return;
39
- }
40
- const { input, channels, iconTypes, verbose } = validatedOptions;
41
- if (verbose) {
42
- console.log(chalk.blue("\n\u{1F4F1} Icon Generation"));
43
- console.log(chalk.gray(` Input directory: ${input}`));
44
- console.log(chalk.gray(` Channels: ${channels.join(", ")}`));
45
- console.log(chalk.gray(` Icon types: ${iconTypes.join(", ")}`));
46
- }
47
- checkDependencies(verbose);
48
- validateBaseIcons(input, iconTypes, verbose);
49
- const result = generateAllIcons({
50
- baseDir: input,
51
- channels,
52
- iconTypes,
53
- verbose
54
- });
55
- console.log(chalk.bold("\n\u{1F4CA} Summary:"));
56
- console.log(
57
- chalk.green(
58
- ` \u2713 Successfully generated: ${result.success.length} icon(s)`
59
- )
60
- );
61
- if (result.failed.length > 0) {
62
- console.log(chalk.red(` \u2717 Failed: ${result.failed.length} icon(s)`));
63
- result.failed.forEach(({ icon, error }) => {
64
- console.log(chalk.red(` - ${icon}: ${error}`));
65
- });
66
- process.exit(1);
67
- }
68
- console.log(chalk.green(`
69
- \u2705 All icons generated successfully!`));
70
- } catch (error) {
71
- if (error instanceof ZodError) {
72
- console.error(chalk.red(`
73
- \u274C Invalid command options:`));
74
- error.errors.forEach((err) => {
75
- console.error(chalk.red(` ${err.path.join(".")}: ${err.message}`));
76
- });
77
- process.exit(1);
78
- }
79
- const verbose = (
80
- /** @type {any} */
81
- options?.verbose || false
82
- );
83
- console.error(chalk.red(`
84
- \u274C Icon generation failed:`));
85
- if (error instanceof Error) {
86
- console.error(chalk.red(` ${error.message}`));
87
- if (verbose && error.stack) {
88
- console.error(chalk.gray("\nStack trace:"));
89
- console.error(chalk.gray(error.stack));
90
- }
91
- } else {
92
- console.error(chalk.red(` ${String(error)}`));
93
- }
94
- console.error(chalk.yellow("\n\u{1F4A1} Troubleshooting tips:"));
95
- console.error(
96
- chalk.yellow(
97
- " \u2022 Ensure ImageMagick is installed (brew install imagemagick)"
98
- )
99
- );
100
- console.error(
101
- chalk.yellow(
102
- " \u2022 Make sure icon.png and adaptive-icon.png exist in the input directory"
103
- )
104
- );
105
- console.error(
106
- chalk.yellow(" \u2022 Verify the input directory path is correct")
107
- );
108
- console.error(
109
- chalk.yellow(" \u2022 Use --verbose for detailed error information\n")
110
- );
111
- process.exit(1);
112
- }
113
- }
114
-
115
- export {
116
- iconsCommand
117
- };