igniteui-cli 14.0.2 → 14.1.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (315) hide show
  1. package/bin/execute.js +11 -10
  2. package/lib/MultiTemplateComponent.js +1 -0
  3. package/lib/PromptSession.js +36 -11
  4. package/lib/TemplateManager.js +25 -1
  5. package/lib/cli.js +83 -92
  6. package/lib/commands/add.d.ts +2 -8
  7. package/lib/commands/add.js +8 -6
  8. package/lib/commands/build.d.ts +2 -9
  9. package/lib/commands/build.js +44 -9
  10. package/lib/commands/config.d.ts +2 -8
  11. package/lib/commands/config.js +34 -28
  12. package/lib/commands/doc.d.ts +2 -4
  13. package/lib/commands/doc.js +38 -15
  14. package/lib/commands/generate.d.ts +2 -8
  15. package/lib/commands/generate.js +106 -73
  16. package/lib/commands/index.d.ts +12 -0
  17. package/lib/commands/index.js +44 -0
  18. package/lib/commands/list.d.ts +2 -6
  19. package/lib/commands/list.js +4 -5
  20. package/lib/commands/new.d.ts +2 -6
  21. package/lib/commands/new.js +62 -32
  22. package/lib/commands/quickstart.d.ts +2 -14
  23. package/lib/commands/quickstart.js +33 -8
  24. package/lib/commands/start.d.ts +2 -7
  25. package/lib/commands/start.js +39 -12
  26. package/lib/commands/test.d.ts +2 -12
  27. package/lib/commands/test.js +8 -6
  28. package/lib/commands/types.d.ts +86 -0
  29. package/lib/commands/types.js +28 -0
  30. package/lib/commands/upgrade.d.ts +2 -7
  31. package/lib/commands/upgrade.js +9 -8
  32. package/lib/project-utility/GridHelper.js +1 -0
  33. package/lib/templates/AngularTemplate.js +25 -1
  34. package/lib/templates/IgniteUIForReactTemplate.js +26 -2
  35. package/lib/templates/IgniteUIForWebComponentsTemplate.js +25 -1
  36. package/lib/templates/ReactTemplate.js +26 -2
  37. package/lib/templates/jQueryTemplate.js +26 -2
  38. package/migrations/update-13_1_0/index.js +2 -1
  39. package/migrations/update-13_1_0/index.spec.js +27 -4
  40. package/migrations/update-2/index.js +2 -1
  41. package/migrations/update-2/index.spec.js +27 -4
  42. package/migrations/update-3/index.js +2 -1
  43. package/migrations/update-3/index.spec.js +36 -16
  44. package/migrations/update-3_2/index.js +2 -1
  45. package/migrations/update-3_2/index.spec.js +28 -4
  46. package/migrations/update-4_2_3/index.js +2 -1
  47. package/migrations/update-4_2_3/index.spec.js +28 -4
  48. package/migrations/update-5_0_0/index.js +4 -3
  49. package/migrations/update-5_0_0/index.spec.js +28 -4
  50. package/migrations/update-5_0_3/index.js +2 -1
  51. package/migrations/update-5_0_3/index.spec.js +28 -4
  52. package/package.json +26 -28
  53. package/scripts/install.js +1 -0
  54. package/scripts/uninstall.js +1 -0
  55. package/templates/angular/ig-ts/bar-chart/default/index.js +1 -0
  56. package/templates/angular/ig-ts/bar-chart/index.js +1 -0
  57. package/templates/angular/ig-ts/column-chart/default/index.js +1 -0
  58. package/templates/angular/ig-ts/column-chart/index.js +1 -0
  59. package/templates/angular/ig-ts/combo/combo/index.js +1 -0
  60. package/templates/angular/ig-ts/combo/index.js +1 -0
  61. package/templates/angular/ig-ts/custom-templates/editors-calculation-form/index.js +1 -0
  62. package/templates/angular/ig-ts/custom-templates/tree-grid-file-explorer/index.js +1 -0
  63. package/templates/angular/ig-ts/doughnut-chart/default/index.js +1 -0
  64. package/templates/angular/ig-ts/doughnut-chart/index.js +1 -0
  65. package/templates/angular/ig-ts/editors/index.js +25 -1
  66. package/templates/angular/ig-ts/financial-chart/default/index.js +1 -0
  67. package/templates/angular/ig-ts/financial-chart/index.js +1 -0
  68. package/templates/angular/ig-ts/funnel-chart/default/index.js +1 -0
  69. package/templates/angular/ig-ts/funnel-chart/index.js +1 -0
  70. package/templates/angular/ig-ts/grid/basic/index.js +1 -0
  71. package/templates/angular/ig-ts/grid/grid-custom/index.js +1 -0
  72. package/templates/angular/ig-ts/grid/grid-editing/index.js +1 -0
  73. package/templates/angular/ig-ts/grid/grid-export/index.js +1 -0
  74. package/templates/angular/ig-ts/grid/grid-templating/index.js +1 -0
  75. package/templates/angular/ig-ts/grid/index.js +1 -0
  76. package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid/index.js +1 -0
  77. package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid-custom/index.js +1 -0
  78. package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid-editing/index.js +1 -0
  79. package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid-export/index.js +1 -0
  80. package/templates/angular/ig-ts/hierarchical-grid/index.js +1 -0
  81. package/templates/angular/ig-ts/index.js +1 -0
  82. package/templates/angular/ig-ts/line-chart/default/index.js +1 -0
  83. package/templates/angular/ig-ts/line-chart/index.js +1 -0
  84. package/templates/angular/ig-ts/pie-chart/default/index.js +1 -0
  85. package/templates/angular/ig-ts/pie-chart/index.js +1 -0
  86. package/templates/angular/ig-ts/projects/empty/files/package.json +1 -1
  87. package/templates/angular/ig-ts/projects/empty/index.js +25 -1
  88. package/templates/angular/ig-ts/radial-chart/default/index.js +1 -0
  89. package/templates/angular/ig-ts/radial-chart/index.js +1 -0
  90. package/templates/angular/ig-ts/tree-grid/index.js +1 -0
  91. package/templates/angular/ig-ts/tree-grid/tree-grid/index.js +1 -0
  92. package/templates/angular/ig-ts/tree-grid/tree-grid-custom/index.js +1 -0
  93. package/templates/angular/ig-ts/tree-grid/tree-grid-editing/index.js +1 -0
  94. package/templates/angular/ig-ts/tree-grid/tree-grid-export/index.js +1 -0
  95. package/templates/angular/index.js +1 -0
  96. package/templates/jquery/index.js +1 -0
  97. package/templates/jquery/js/bar-chart/bar-chart/index.js +1 -0
  98. package/templates/jquery/js/bar-chart/index.js +1 -0
  99. package/templates/jquery/js/column-chart/column-chart/index.js +1 -0
  100. package/templates/jquery/js/column-chart/index.js +1 -0
  101. package/templates/jquery/js/combo/combo/index.js +1 -0
  102. package/templates/jquery/js/combo/index.js +1 -0
  103. package/templates/jquery/js/custom-templates/dashboard-knockout/index.js +1 -0
  104. package/templates/jquery/js/custom-templates/editors-calculation-form/index.js +1 -0
  105. package/templates/jquery/js/custom-templates/er-dashboard/index.js +1 -0
  106. package/templates/jquery/js/custom-templates/file-explorer/index.js +1 -0
  107. package/templates/jquery/js/doughnut-chart/doughnut-chart/index.js +1 -0
  108. package/templates/jquery/js/doughnut-chart/index.js +1 -0
  109. package/templates/jquery/js/editors/index.js +1 -0
  110. package/templates/jquery/js/financial-chart/financial-chart/index.js +1 -0
  111. package/templates/jquery/js/financial-chart/index.js +1 -0
  112. package/templates/jquery/js/funnel-chart/funnel-chart/index.js +1 -0
  113. package/templates/jquery/js/funnel-chart/index.js +1 -0
  114. package/templates/jquery/js/grid/grid/index.js +1 -0
  115. package/templates/jquery/js/grid/grid-custom/index.js +1 -0
  116. package/templates/jquery/js/grid/grid-editing/index.js +1 -0
  117. package/templates/jquery/js/grid/grid-export/index.js +1 -0
  118. package/templates/jquery/js/grid/grid-templating/index.js +1 -0
  119. package/templates/jquery/js/grid/index.js +1 -0
  120. package/templates/jquery/js/hierarchical-grid/hierarchical-grid/index.js +1 -0
  121. package/templates/jquery/js/hierarchical-grid/hierarchical-grid-custom/index.js +1 -0
  122. package/templates/jquery/js/hierarchical-grid/hierarchical-grid-editing/index.js +1 -0
  123. package/templates/jquery/js/hierarchical-grid/hierarchical-grid-export/index.js +1 -0
  124. package/templates/jquery/js/hierarchical-grid/index.js +1 -0
  125. package/templates/jquery/js/index.js +1 -0
  126. package/templates/jquery/js/line-chart/index.js +1 -0
  127. package/templates/jquery/js/line-chart/line-chart/index.js +1 -0
  128. package/templates/jquery/js/pie-chart/index.js +1 -0
  129. package/templates/jquery/js/pie-chart/pie-chart/index.js +1 -0
  130. package/templates/jquery/js/projects/empty/index.js +26 -2
  131. package/templates/jquery/js/radial-chart/index.js +1 -0
  132. package/templates/jquery/js/radial-chart/radial-chart/index.js +1 -0
  133. package/templates/jquery/js/scatter-chart/index.js +1 -0
  134. package/templates/jquery/js/scatter-chart/scatter-chart/index.js +1 -0
  135. package/templates/jquery/js/tree-grid/index.js +1 -0
  136. package/templates/jquery/js/tree-grid/tree-grid/index.js +1 -0
  137. package/templates/jquery/js/tree-grid/tree-grid-custom/index.js +1 -0
  138. package/templates/jquery/js/tree-grid/tree-grid-editing/index.js +1 -0
  139. package/templates/jquery/js/tree-grid/tree-grid-export/index.js +1 -0
  140. package/templates/quickstart/angular/package.json +1 -1
  141. package/templates/react/ReactTypeScriptFileUpdate.js +25 -1
  142. package/templates/react/es6/bar-chart/default/index.js +1 -0
  143. package/templates/react/es6/bar-chart/index.js +1 -0
  144. package/templates/react/es6/column-chart/default/index.js +1 -0
  145. package/templates/react/es6/column-chart/index.js +1 -0
  146. package/templates/react/es6/combo/combo/index.js +1 -0
  147. package/templates/react/es6/combo/index.js +1 -0
  148. package/templates/react/es6/doughnut-chart/doughnut-chart/index.js +1 -0
  149. package/templates/react/es6/doughnut-chart/index.js +1 -0
  150. package/templates/react/es6/editors/index.js +25 -1
  151. package/templates/react/es6/financial-chart/financial-chart/index.js +1 -0
  152. package/templates/react/es6/financial-chart/index.js +1 -0
  153. package/templates/react/es6/funnel-chart/funnel-chart/index.js +1 -0
  154. package/templates/react/es6/funnel-chart/index.js +1 -0
  155. package/templates/react/es6/grid/basic/index.js +1 -0
  156. package/templates/react/es6/grid/grid-custom/index.js +1 -0
  157. package/templates/react/es6/grid/grid-editing/index.js +1 -0
  158. package/templates/react/es6/grid/grid-export/index.js +1 -0
  159. package/templates/react/es6/grid/grid-templating/index.js +1 -0
  160. package/templates/react/es6/grid/index.js +1 -0
  161. package/templates/react/es6/hierarchical-grid/hierarchical-grid/index.js +1 -0
  162. package/templates/react/es6/hierarchical-grid/hierarchical-grid-custom/index.js +1 -0
  163. package/templates/react/es6/hierarchical-grid/hierarchical-grid-editing/index.js +1 -0
  164. package/templates/react/es6/hierarchical-grid/hierarchical-grid-export/index.js +1 -0
  165. package/templates/react/es6/hierarchical-grid/index.js +1 -0
  166. package/templates/react/es6/index.js +1 -0
  167. package/templates/react/es6/line-chart/default/index.js +1 -0
  168. package/templates/react/es6/line-chart/index.js +1 -0
  169. package/templates/react/es6/pie-chart/index.js +1 -0
  170. package/templates/react/es6/pie-chart/pie-chart/index.js +1 -0
  171. package/templates/react/es6/projects/empty/index.js +25 -1
  172. package/templates/react/es6/radial-chart/index.js +1 -0
  173. package/templates/react/es6/radial-chart/radial-chart/index.js +1 -0
  174. package/templates/react/es6/scatter-chart/index.js +1 -0
  175. package/templates/react/es6/scatter-chart/scatter-chart/index.js +1 -0
  176. package/templates/react/es6/tree-grid/index.js +1 -0
  177. package/templates/react/es6/tree-grid/tree-grid/index.js +1 -0
  178. package/templates/react/es6/tree-grid/tree-grid-custom/index.js +1 -0
  179. package/templates/react/es6/tree-grid/tree-grid-editing/index.js +1 -0
  180. package/templates/react/es6/tree-grid/tree-grid-export/index.js +1 -0
  181. package/templates/react/igr-es6/bullet-graph/default/index.js +1 -0
  182. package/templates/react/igr-es6/bullet-graph/index.js +1 -0
  183. package/templates/react/igr-es6/category-chart/default/index.js +1 -0
  184. package/templates/react/igr-es6/category-chart/index.js +1 -0
  185. package/templates/react/igr-es6/doughnut-chart/default/index.js +1 -0
  186. package/templates/react/igr-es6/doughnut-chart/index.js +1 -0
  187. package/templates/react/igr-es6/financial-chart/default/index.js +1 -0
  188. package/templates/react/igr-es6/financial-chart/index.js +1 -0
  189. package/templates/react/igr-es6/grid/basic/index.js +1 -0
  190. package/templates/react/igr-es6/grid/index.js +1 -0
  191. package/templates/react/igr-es6/index.js +1 -0
  192. package/templates/react/igr-es6/linear-gauge/default/index.js +1 -0
  193. package/templates/react/igr-es6/linear-gauge/index.js +1 -0
  194. package/templates/react/igr-es6/pie-chart/default/index.js +1 -0
  195. package/templates/react/igr-es6/pie-chart/index.js +1 -0
  196. package/templates/react/igr-es6/projects/_base/index.js +25 -1
  197. package/templates/react/igr-es6/projects/top-nav/index.js +25 -1
  198. package/templates/react/igr-es6/radial-gauge/default/index.js +1 -0
  199. package/templates/react/igr-es6/radial-gauge/index.js +1 -0
  200. package/templates/react/igr-ts/bullet-graph/default/index.js +1 -0
  201. package/templates/react/igr-ts/bullet-graph/index.js +1 -0
  202. package/templates/react/igr-ts/category-chart/default/index.js +1 -0
  203. package/templates/react/igr-ts/category-chart/index.js +1 -0
  204. package/templates/react/igr-ts/doughnut-chart/default/index.js +1 -0
  205. package/templates/react/igr-ts/doughnut-chart/index.js +1 -0
  206. package/templates/react/igr-ts/financial-chart/default/index.js +1 -0
  207. package/templates/react/igr-ts/financial-chart/index.js +1 -0
  208. package/templates/react/igr-ts/grid/basic/index.js +1 -0
  209. package/templates/react/igr-ts/grid/index.js +1 -0
  210. package/templates/react/igr-ts/index.js +1 -0
  211. package/templates/react/igr-ts/linear-gauge/default/index.js +1 -0
  212. package/templates/react/igr-ts/linear-gauge/index.js +1 -0
  213. package/templates/react/igr-ts/pie-chart/default/index.js +1 -0
  214. package/templates/react/igr-ts/pie-chart/index.js +1 -0
  215. package/templates/react/igr-ts/projects/_base/files/package.json +1 -1
  216. package/templates/react/igr-ts/projects/_base/index.js +25 -1
  217. package/templates/react/igr-ts/projects/_base_with_home/index.js +25 -1
  218. package/templates/react/igr-ts/projects/base/index.js +25 -1
  219. package/templates/react/igr-ts/projects/empty/index.js +25 -1
  220. package/templates/react/igr-ts/projects/top-nav/index.js +25 -1
  221. package/templates/react/igr-ts/radial-gauge/default/index.js +1 -0
  222. package/templates/react/igr-ts/radial-gauge/index.js +1 -0
  223. package/templates/react/index.js +1 -0
  224. package/templates/react/types/ReactRouteEntry.js +1 -0
  225. package/templates/react/types/ReactRouteLike.js +1 -0
  226. package/templates/react/types/ReactRouteTarget.js +1 -0
  227. package/templates/react/types/index.js +1 -0
  228. package/templates/webcomponents/WebComponentsTypeScriptFileUpdate.js +25 -1
  229. package/templates/webcomponents/igc-ts/accordion/default/index.js +1 -0
  230. package/templates/webcomponents/igc-ts/accordion/index.js +1 -0
  231. package/templates/webcomponents/igc-ts/avatar/default/index.js +1 -0
  232. package/templates/webcomponents/igc-ts/avatar/index.js +1 -0
  233. package/templates/webcomponents/igc-ts/badge/default/index.js +1 -0
  234. package/templates/webcomponents/igc-ts/badge/index.js +1 -0
  235. package/templates/webcomponents/igc-ts/banner/default/index.js +1 -0
  236. package/templates/webcomponents/igc-ts/banner/index.js +1 -0
  237. package/templates/webcomponents/igc-ts/button/default/index.js +1 -0
  238. package/templates/webcomponents/igc-ts/button/index.js +1 -0
  239. package/templates/webcomponents/igc-ts/button-group/default/index.js +1 -0
  240. package/templates/webcomponents/igc-ts/button-group/index.js +1 -0
  241. package/templates/webcomponents/igc-ts/calendar/default/index.js +1 -0
  242. package/templates/webcomponents/igc-ts/calendar/index.js +1 -0
  243. package/templates/webcomponents/igc-ts/card/default/index.js +1 -0
  244. package/templates/webcomponents/igc-ts/card/index.js +1 -0
  245. package/templates/webcomponents/igc-ts/checkbox/default/index.js +1 -0
  246. package/templates/webcomponents/igc-ts/checkbox/index.js +1 -0
  247. package/templates/webcomponents/igc-ts/chip/default/index.js +1 -0
  248. package/templates/webcomponents/igc-ts/chip/index.js +1 -0
  249. package/templates/webcomponents/igc-ts/circular-progress/default/index.js +1 -0
  250. package/templates/webcomponents/igc-ts/circular-progress/index.js +1 -0
  251. package/templates/webcomponents/igc-ts/custom-templates/subscription-form/index.js +1 -0
  252. package/templates/webcomponents/igc-ts/date-picker/default/index.js +1 -0
  253. package/templates/webcomponents/igc-ts/date-picker/index.js +1 -0
  254. package/templates/webcomponents/igc-ts/date-time-input/default/index.js +1 -0
  255. package/templates/webcomponents/igc-ts/date-time-input/index.js +1 -0
  256. package/templates/webcomponents/igc-ts/divider/default/index.js +1 -0
  257. package/templates/webcomponents/igc-ts/divider/index.js +1 -0
  258. package/templates/webcomponents/igc-ts/dock-manager/default/index.js +1 -0
  259. package/templates/webcomponents/igc-ts/dock-manager/index.js +1 -0
  260. package/templates/webcomponents/igc-ts/dropdown/default/index.js +1 -0
  261. package/templates/webcomponents/igc-ts/dropdown/index.js +1 -0
  262. package/templates/webcomponents/igc-ts/expansion-panel/default/index.js +1 -0
  263. package/templates/webcomponents/igc-ts/expansion-panel/index.js +1 -0
  264. package/templates/webcomponents/igc-ts/financial-chart/default/index.js +1 -0
  265. package/templates/webcomponents/igc-ts/financial-chart/index.js +1 -0
  266. package/templates/webcomponents/igc-ts/form/default/index.js +1 -0
  267. package/templates/webcomponents/igc-ts/form/index.js +1 -0
  268. package/templates/webcomponents/igc-ts/grid/default/index.js +1 -0
  269. package/templates/webcomponents/igc-ts/grid/grid-editing/index.js +1 -0
  270. package/templates/webcomponents/igc-ts/grid/grid-summaries/index.js +1 -0
  271. package/templates/webcomponents/igc-ts/grid/index.js +1 -0
  272. package/templates/webcomponents/igc-ts/icon/default/index.js +1 -0
  273. package/templates/webcomponents/igc-ts/icon/index.js +1 -0
  274. package/templates/webcomponents/igc-ts/icon-button/default/index.js +1 -0
  275. package/templates/webcomponents/igc-ts/icon-button/index.js +1 -0
  276. package/templates/webcomponents/igc-ts/index.js +1 -0
  277. package/templates/webcomponents/igc-ts/input/default/index.js +1 -0
  278. package/templates/webcomponents/igc-ts/input/index.js +1 -0
  279. package/templates/webcomponents/igc-ts/linear-gauge/default/index.js +1 -0
  280. package/templates/webcomponents/igc-ts/linear-gauge/index.js +1 -0
  281. package/templates/webcomponents/igc-ts/linear-progress/default/index.js +1 -0
  282. package/templates/webcomponents/igc-ts/linear-progress/index.js +1 -0
  283. package/templates/webcomponents/igc-ts/list/default/index.js +1 -0
  284. package/templates/webcomponents/igc-ts/list/index.js +1 -0
  285. package/templates/webcomponents/igc-ts/navbar/default/index.js +1 -0
  286. package/templates/webcomponents/igc-ts/navbar/index.js +1 -0
  287. package/templates/webcomponents/igc-ts/pie-chart/default/index.js +1 -0
  288. package/templates/webcomponents/igc-ts/pie-chart/index.js +1 -0
  289. package/templates/webcomponents/igc-ts/projects/_base/files/package.json +1 -1
  290. package/templates/webcomponents/igc-ts/projects/_base/files/tsconfig.json +1 -1
  291. package/templates/webcomponents/igc-ts/projects/_base/index.js +25 -1
  292. package/templates/webcomponents/igc-ts/projects/_base_with_home/files/package.json +1 -1
  293. package/templates/webcomponents/igc-ts/projects/_base_with_home/index.js +25 -1
  294. package/templates/webcomponents/igc-ts/projects/base/index.js +25 -1
  295. package/templates/webcomponents/igc-ts/projects/empty/index.js +25 -1
  296. package/templates/webcomponents/igc-ts/projects/side-nav/index.js +25 -1
  297. package/templates/webcomponents/igc-ts/radial-gauge/default/index.js +1 -0
  298. package/templates/webcomponents/igc-ts/radial-gauge/index.js +1 -0
  299. package/templates/webcomponents/igc-ts/radio-group/default/index.js +1 -0
  300. package/templates/webcomponents/igc-ts/radio-group/index.js +1 -0
  301. package/templates/webcomponents/igc-ts/rating/default/index.js +1 -0
  302. package/templates/webcomponents/igc-ts/rating/index.js +1 -0
  303. package/templates/webcomponents/igc-ts/ripple/default/index.js +1 -0
  304. package/templates/webcomponents/igc-ts/ripple/index.js +1 -0
  305. package/templates/webcomponents/igc-ts/slider/default/index.js +1 -0
  306. package/templates/webcomponents/igc-ts/slider/index.js +1 -0
  307. package/templates/webcomponents/igc-ts/switch/default/index.js +1 -0
  308. package/templates/webcomponents/igc-ts/switch/index.js +1 -0
  309. package/templates/webcomponents/igc-ts/tabs/default/index.js +1 -0
  310. package/templates/webcomponents/igc-ts/tabs/index.js +1 -0
  311. package/templates/webcomponents/igc-ts/text-area/default/index.js +1 -0
  312. package/templates/webcomponents/igc-ts/text-area/index.js +1 -0
  313. package/templates/webcomponents/igc-ts/tree/default/index.js +1 -0
  314. package/templates/webcomponents/igc-ts/tree/index.js +1 -0
  315. package/templates/webcomponents/index.js +1 -0
package/bin/execute.js CHANGED
@@ -1,16 +1,17 @@
1
1
  #!/usr/bin/env node
2
- var fs = require("fs");
3
- var inquirer = require('inquirer');
4
- var projectConfiguration = {};
5
- var resolve = require('resolve');
6
- var path = require('path');
2
+ const fs = require("fs");
3
+ const resolve = require("resolve");
4
+ const path = require("path");
5
+ const { hideBin } = require("yargs/helpers");
6
+
7
+ const args = hideBin(process.argv);
7
8
 
8
9
  //execute -g igniteui-cli in case there is no project installed, else resolve to the local one
9
- resolve('igniteui-cli', { basedir: process.cwd() }, function (err, res) {
10
- var cli;
10
+ resolve("igniteui-cli", { basedir: process.cwd() }, function (err, res) {
11
+ let cli;
11
12
  if (res && res.indexOf(process.cwd()) > -1) {
12
- var localVersion = require(path.join(process.cwd(), 'node_modules/igniteui-cli/package.json'))['version'];
13
- var globalVersion = require(path.join(__dirname, '../package.json'))['version'];
13
+ const localVersion = require(path.join(process.cwd(), "node_modules/igniteui-cli/package.json"))["version"];
14
+ const globalVersion = require(path.join(__dirname, "../package.json"))["version"];
14
15
  if (globalVersion !== localVersion) {
15
16
  console.log("Different igniteui-cli global and local version");
16
17
  }
@@ -18,5 +19,5 @@ resolve('igniteui-cli', { basedir: process.cwd() }, function (err, res) {
18
19
  } else {
19
20
  cli = require("../lib/cli");
20
21
  }
21
- cli.run();
22
+ cli.run(args);
22
23
  });
@@ -41,3 +41,4 @@ class MultiTemplateComponent {
41
41
  }
42
42
  }
43
43
  exports.MultiTemplateComponent = MultiTemplateComponent;
44
+ //# sourceMappingURL=MultiTemplateComponent.js.map
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
26
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
27
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,28 +31,28 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
31
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
32
  });
10
33
  };
34
+ var __importDefault = (this && this.__importDefault) || function (mod) {
35
+ return (mod && mod.__esModule) ? mod : { "default": mod };
36
+ };
11
37
  Object.defineProperty(exports, "__esModule", { value: true });
12
38
  exports.PromptSession = void 0;
13
39
  const cli_core_1 = require("@igniteui/cli-core");
14
- const inquirer = require("inquirer");
15
- const path = require("path");
16
- const add_1 = require("./commands/add");
17
- const start_1 = require("./commands/start");
18
- const upgrade_1 = require("./commands/upgrade");
40
+ const path = __importStar(require("path"));
41
+ const add_1 = __importDefault(require("./commands/add"));
42
+ const start_1 = __importDefault(require("./commands/start"));
43
+ const upgrade_1 = __importDefault(require("./commands/upgrade"));
19
44
  class PromptSession extends cli_core_1.BasePromptSession {
20
45
  constructor(templateManager) {
21
46
  super(templateManager);
22
47
  }
23
48
  static chooseTerm() {
24
49
  return __awaiter(this, void 0, void 0, function* () {
25
- const answers = yield inquirer.prompt({
50
+ const answer = yield cli_core_1.InquirerWrapper.input({
26
51
  default: null,
27
52
  message: "Enter a search term",
28
- name: "term",
29
- type: "input"
30
53
  });
31
- if (answers.term) {
32
- return answers.term;
54
+ if (answer) {
55
+ return answer;
33
56
  }
34
57
  else {
35
58
  const retProm = yield this.chooseTerm();
@@ -62,6 +85,7 @@ class PromptSession extends cli_core_1.BasePromptSession {
62
85
  name: "projectName",
63
86
  message: "Enter a name for your project:",
64
87
  default: cli_core_1.Util.getAvailableName(defaultProjName, true),
88
+ choices: null,
65
89
  validate: this.nameIsValid
66
90
  });
67
91
  const frameRes = yield this.getUserInput({
@@ -108,7 +132,7 @@ class PromptSession extends cli_core_1.BasePromptSession {
108
132
  upgradePackages() {
109
133
  return __awaiter(this, void 0, void 0, function* () {
110
134
  upgrade_1.default.templateManager = this.templateManager;
111
- yield upgrade_1.default.upgrade({ skipInstall: true });
135
+ yield upgrade_1.default.upgrade({ skipInstall: true, _: ["upgrade"], $0: "upgrade" });
112
136
  });
113
137
  }
114
138
  /**
@@ -128,3 +152,4 @@ class PromptSession extends cli_core_1.BasePromptSession {
128
152
  }
129
153
  }
130
154
  exports.PromptSession = PromptSession;
155
+ //# sourceMappingURL=PromptSession.js.map
@@ -1,9 +1,32 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.TemplateManager = void 0;
4
27
  const angular_templates_1 = require("@igniteui/angular-templates");
5
28
  const cli_core_1 = require("@igniteui/cli-core");
6
- const path = require("path");
29
+ const path = __importStar(require("path"));
7
30
  const AngularTemplate_1 = require("./templates/AngularTemplate");
8
31
  const IgniteUIForWebComponentsTemplate_1 = require("./templates/IgniteUIForWebComponentsTemplate");
9
32
  const jQueryTemplate_1 = require("./templates/jQueryTemplate");
@@ -52,3 +75,4 @@ class TemplateManager extends cli_core_1.BaseTemplateManager {
52
75
  }
53
76
  }
54
77
  exports.TemplateManager = TemplateManager;
78
+ //# sourceMappingURL=TemplateManager.js.map
package/lib/cli.js CHANGED
@@ -8,21 +8,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.run = void 0;
15
+ exports.run = run;
13
16
  const cli_core_1 = require("@igniteui/cli-core");
14
- const yargs = require("yargs");
15
- const add_1 = require("./commands/add");
16
- const build_1 = require("./commands/build");
17
- const config_1 = require("./commands/config");
18
- const doc_1 = require("./commands/doc");
19
- const generate_1 = require("./commands/generate");
20
- const list_1 = require("./commands/list");
21
- const new_1 = require("./commands/new");
22
- const quickstart_1 = require("./commands/quickstart");
23
- const start_1 = require("./commands/start");
24
- const test_1 = require("./commands/test");
25
- const upgrade_1 = require("./commands/upgrade");
17
+ const yargs_1 = __importDefault(require("yargs"));
18
+ const commands_1 = require("./commands");
26
19
  const PromptSession_1 = require("./PromptSession");
27
20
  const TemplateManager_1 = require("./TemplateManager");
28
21
  process.title = "Ignite UI CLI";
@@ -34,31 +27,32 @@ function logHelp() {
34
27
  }
35
28
  function run() {
36
29
  return __awaiter(this, arguments, void 0, function* (args = null) {
37
- // we are subscribing on process.exit to catch when help is executed
38
- process.on("exit", logHelp);
39
30
  cli_core_1.App.initialize();
40
31
  const templateManager = new TemplateManager_1.TemplateManager();
41
- new_1.default.template = templateManager;
42
- new_1.default.builder.framework.choices = templateManager.getFrameworkIds();
43
- add_1.default.templateManager = templateManager;
44
- build_1.default.templateManager = templateManager;
45
- start_1.default.templateManager = templateManager;
46
- generate_1.default.templateManager = templateManager;
47
- list_1.default.templateManager = templateManager;
48
- upgrade_1.default.templateManager = templateManager;
49
- const yargsModule = args ? yargs(args) : yargs;
50
- const argv = yargsModule
51
- .command(quickstart_1.default)
52
- .command(new_1.default)
53
- .command(add_1.default)
54
- .command(build_1.default)
55
- .command(start_1.default)
56
- .command(generate_1.default)
57
- .command(config_1.default)
58
- .command(doc_1.default)
59
- .command(test_1.default)
60
- .command(list_1.default)
61
- .command(upgrade_1.default)
32
+ commands_1.newCommand.addChoices(templateManager.getFrameworkIds());
33
+ commands_1.newCommand.templateManager = templateManager;
34
+ commands_1.add.templateManager = templateManager;
35
+ commands_1.build.templateManager = templateManager;
36
+ commands_1.start.templateManager = templateManager;
37
+ commands_1.generate.templateManager = templateManager;
38
+ commands_1.list.templateManager = templateManager;
39
+ commands_1.upgrade.templateManager = templateManager;
40
+ const yargsModule = args ? (0, yargs_1.default)(args) : yargs_1.default;
41
+ yield yargsModule
42
+ .scriptName("") // prevent the addition of the name of the executing script in the usage output
43
+ .usage("") // do not show any usage instructions before the commands list
44
+ .command(commands_1.quickstart)
45
+ .command(commands_1.newCommand)
46
+ .command(commands_1.add)
47
+ .command(commands_1.build)
48
+ .command(commands_1.start)
49
+ .command(commands_1.generate)
50
+ .command(commands_1.config)
51
+ .command(commands_1.doc)
52
+ .command(commands_1.test)
53
+ .command(commands_1.list)
54
+ .command(commands_1.upgrade)
55
+ .version(false) // disable built-in `yargs.version` to override it with our custom option
62
56
  .options({
63
57
  version: {
64
58
  alias: "v",
@@ -67,67 +61,64 @@ function run() {
67
61
  type: "boolean"
68
62
  }
69
63
  })
64
+ .options({
65
+ testMode: {
66
+ default: false,
67
+ type: "boolean",
68
+ hidden: true
69
+ }
70
+ })
71
+ .middleware((argv) => {
72
+ // invoked after parsing and before the `yargsModule.parseAsync` callback
73
+ const command = argv._[0];
74
+ if (command === commands_1.ADD_COMMAND_NAME && !commands_1.add.check(argv)) {
75
+ argv.skipExecution = true;
76
+ yargsModule.showHelp();
77
+ }
78
+ }, false // setting this to `true` is supposed to exec the middleware after parsing and before arg validation
79
+ // but in reality it also does not trigger the command's handler (╯°□°)╯︵ ┻━┻
80
+ )
70
81
  .help().alias("help", "h")
71
- .argv;
72
- // unsubscribing from process.exit. If `help` was executed we should not reach here
73
- process.removeListener("exit", logHelp);
74
- if (argv.version) {
75
- cli_core_1.Util.showVersion(__dirname + "/../ignite-ui-cli.txt");
76
- return;
77
- }
78
- const command = argv._[0];
79
- // internal testing only
80
- /* istanbul ignore next */
81
- cli_core_1.App.testMode = !!argv.testMode;
82
- switch (command) {
83
- case "new":
84
- yield new_1.default.execute(argv);
85
- break;
86
- case "quickstart":
87
- yield quickstart_1.default.execute(argv);
88
- cli_core_1.Util.log("quickstart Created");
89
- break;
90
- case "add":
91
- if (add_1.default.check(argv)) {
92
- yield add_1.default.execute(argv);
93
- }
94
- else {
95
- yargsModule.showHelp();
96
- return;
82
+ .parseAsync(args, // the args to parse to argv
83
+ {}, // docs say context to pass in to handlers, but nuh-uh, it's just garbage
84
+ (err, argv, output) => __awaiter(this, void 0, void 0, function* () {
85
+ // `argv._` are the positional arguments passed in to the script
86
+ const command = argv._[0];
87
+ if (err) {
88
+ cli_core_1.Util.error(`The ${command} command threw error - ${err.name}`, "red");
89
+ cli_core_1.Util.error(`Message: ${err.message}`, "red");
90
+ if (err.stack) {
91
+ cli_core_1.Util.error(`Stack: ${err.stack}`, "red");
97
92
  }
98
- break;
99
- case "g":
100
- case "generate":
101
- yield generate_1.default.template(argv);
102
- break;
103
- case "build":
104
- yield build_1.default.execute(argv);
105
- break;
106
- case "config":
107
- break;
108
- case "doc":
109
- yield doc_1.default.execute(argv);
110
- break;
111
- case "test":
112
- yield test_1.default.execute(argv);
113
- break;
114
- case "start":
115
- yield start_1.default.execute(argv);
116
- break;
117
- case "l":
118
- case "list":
119
- list_1.default.execute(argv);
120
- break;
121
- case "upgrade-packages":
122
- yield upgrade_1.default.execute(argv);
123
- break;
124
- default:
93
+ process.exit(1);
94
+ }
95
+ const helpRequest = argv.h || argv.help;
96
+ if (helpRequest) {
97
+ logHelp();
98
+ }
99
+ if (command === commands_1.QUICKSTART_COMMAND_NAME && !helpRequest) {
100
+ cli_core_1.Util.log("quickstart Created");
101
+ return;
102
+ }
103
+ // since we are providing a custom callback to `yargsModule.parseAsync`, we need to handle the output as well
104
+ // ref - https://yargs.js.org/docs/#api-reference-parseargs-context-parsecallback
105
+ if (output) {
106
+ cli_core_1.Util.log(output);
107
+ }
108
+ if (argv.version) {
109
+ cli_core_1.Util.showVersion(__dirname + "/../ignite-ui-cli.txt");
110
+ return;
111
+ }
112
+ // internal testing only
113
+ /* istanbul ignore next */
114
+ cli_core_1.App.testMode = !!argv.testMode;
115
+ if (!helpRequest && !commands_1.ALL_COMMANDS.has(command === null || command === void 0 ? void 0 : command.toString())) {
125
116
  cli_core_1.Util.log("Starting Step by step mode.", "green");
126
117
  cli_core_1.Util.log("For available commands, stop this execution and use --help.", "green");
127
118
  const prompts = new PromptSession_1.PromptSession(templateManager);
128
119
  prompts.start();
129
- break;
130
- }
120
+ }
121
+ }));
131
122
  });
132
123
  }
133
- exports.run = run;
124
+ //# sourceMappingURL=cli.js.map
@@ -1,9 +1,3 @@
1
- import { AddTemplateArgs, Template } from "@igniteui/cli-core";
2
- import { TemplateManager } from "../TemplateManager";
3
- declare let command: {
4
- [name: string]: any;
5
- templateManager: TemplateManager;
6
- execute: (argv: any) => Promise<void>;
7
- addTemplate: (name: string, template: Template, options?: AddTemplateArgs) => Promise<boolean>;
8
- };
1
+ import { AddCommandType } from "./types";
2
+ declare const command: AddCommandType;
9
3
  export default command;
@@ -11,11 +11,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  const cli_core_1 = require("@igniteui/cli-core");
13
13
  const PromptSession_1 = require("./../PromptSession");
14
- let command;
15
- // tslint:disable:object-literal-sort-keys
16
- command = {
14
+ const command = {
17
15
  command: "add [template] [name]",
18
- desc: "adds template by its ID",
16
+ describe: "adds template by its ID",
19
17
  templateManager: null,
20
18
  builder: {
21
19
  "template": {
@@ -43,14 +41,17 @@ command = {
43
41
  global: true
44
42
  }
45
43
  },
46
- check: argv => {
44
+ check: (argv) => {
47
45
  if ((!argv.name && argv.template) || (argv.name && !argv.template)) {
48
46
  return false;
49
47
  }
50
48
  return true;
51
49
  },
52
- execute(argv) {
50
+ handler(argv) {
53
51
  return __awaiter(this, void 0, void 0, function* () {
52
+ if (argv.skipExecution) {
53
+ return;
54
+ }
54
55
  cli_core_1.GoogleAnalytics.post({
55
56
  t: "screenview",
56
57
  cd: "Add"
@@ -157,3 +158,4 @@ command = {
157
158
  };
158
159
  // hint transpiler it's an ES6 module, exports without import won't do
159
160
  exports.default = command;
161
+ //# sourceMappingURL=add.js.map
@@ -1,10 +1,3 @@
1
- import { TemplateManager } from "../TemplateManager";
2
- declare let command: {
3
- command: string;
4
- desc: string;
5
- builder: {};
6
- templateManager: TemplateManager;
7
- execute: (argv: any) => Promise<void>;
8
- build: (argv: any) => Promise<void>;
9
- };
1
+ import { BuildCommandType } from "./types";
2
+ declare const command: BuildCommandType;
10
3
  export default command;
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
26
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
27
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -10,15 +33,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
33
  };
11
34
  Object.defineProperty(exports, "__esModule", { value: true });
12
35
  const cli_core_1 = require("@igniteui/cli-core");
13
- const fs = require("fs-extra");
14
- const path = require("path");
15
- let command;
16
- command = {
36
+ const fs = __importStar(require("fs"));
37
+ const path = __importStar(require("path"));
38
+ const command = {
17
39
  command: "build",
18
- desc: "builds the project",
19
- builder: {},
40
+ describe: "builds the project",
41
+ builder: (yargs) => {
42
+ return yargs.usage(""); // do not show any usage instructions before the commands
43
+ },
20
44
  templateManager: null,
21
- execute(argv) {
45
+ handler(argv) {
22
46
  return __awaiter(this, void 0, void 0, function* () {
23
47
  cli_core_1.GoogleAnalytics.post({
24
48
  t: "screenview",
@@ -27,7 +51,7 @@ command = {
27
51
  command.build(argv);
28
52
  });
29
53
  },
30
- build(argv) {
54
+ build() {
31
55
  return __awaiter(this, void 0, void 0, function* () {
32
56
  cli_core_1.Util.log("Build started.");
33
57
  yield cli_core_1.PackageManager.ensureIgniteUISource(true, command.templateManager);
@@ -52,9 +76,20 @@ command = {
52
76
  fs.mkdirSync("./themes");
53
77
  const source = path.join(config.project.igniteuiSource, "/css/themes/", config.project.theme.split(".")[0]);
54
78
  const destination = path.join(config.project.sourceRoot, "themes");
55
- fs.copySync(source, destination, { recursive: true });
79
+ cli_core_1.Util.ensureDirectoryExists(destination);
80
+ if (!cli_core_1.Util.isDirectory(source)) {
81
+ fs.copyFileSync(source, destination);
82
+ return;
83
+ }
84
+ const entries = fs.readdirSync(source, { withFileTypes: true });
85
+ entries.forEach((entry) => {
86
+ const sourcePath = path.join(source, entry.name);
87
+ const destinationPath = path.join(destination, entry.name);
88
+ fs.copyFileSync(sourcePath, destinationPath);
89
+ });
56
90
  }
57
91
  });
58
92
  }
59
93
  };
60
94
  exports.default = command;
95
+ //# sourceMappingURL=build.js.map
@@ -1,9 +1,3 @@
1
- declare const command: {
2
- command: string;
3
- desc: string;
4
- builder: (yargs: any) => void;
5
- getHandler(argv: any): void;
6
- setHandler(argv: any): void;
7
- addHandler(argv: any): void;
8
- };
1
+ import { ConfigCommandType } from "./types";
2
+ declare const command: ConfigCommandType;
9
3
  export default command;
@@ -2,60 +2,64 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const cli_core_1 = require("@igniteui/cli-core");
4
4
  const command = {
5
- // tslint:disable:object-literal-sort-keys
6
5
  command: "config",
7
- desc: "gets, sets or adds a configuration property",
8
- builder: yargs => {
9
- yargs.command({
6
+ describe: "gets, sets or adds a configuration property",
7
+ builder: (yargs) => {
8
+ return yargs
9
+ .command({
10
10
  command: "get <property>",
11
- desc: "Gets a configuration property",
12
- builder: {
13
- property: {
11
+ describe: "Gets a configuration property",
12
+ builder: (yargs) => {
13
+ return yargs.option("property", {
14
14
  describe: "Config property to get",
15
15
  type: "string"
16
- }
16
+ })
17
+ .usage(""); // do not show any usage instructions before the commands list
17
18
  },
18
19
  handler: command.getHandler
19
- }).command({
20
+ })
21
+ .command({
20
22
  command: "set <property> <value>",
21
- desc: "Sets a configuration property",
22
- builder: {
23
- property: {
23
+ describe: "Sets a configuration property",
24
+ builder: (yargs) => {
25
+ return yargs.option("property", {
24
26
  describe: "Config property to set",
25
27
  type: "string"
26
- },
27
- value: {
28
+ })
29
+ .option("value", {
28
30
  describe: "New value for the property",
29
31
  type: "string"
30
- }
32
+ })
33
+ .usage(""); // do not show any usage instructions before the commands list
31
34
  },
32
35
  handler: command.setHandler
33
- }).command({
36
+ })
37
+ .command({
34
38
  command: "add <property> <value>",
35
- desc: "Adds a value to an existing configuration array",
36
- builder: {
37
- property: {
39
+ describe: "Adds a value to an existing configuration array",
40
+ builder: (yargs) => {
41
+ return yargs.option("property", {
38
42
  describe: "Config property to add to",
39
43
  type: "string"
40
- },
41
- value: {
44
+ })
45
+ .option("value", {
42
46
  describe: "New value to add",
43
47
  type: "string"
44
- }
48
+ })
49
+ .usage(""); // do not show any usage instructions before the commands list
45
50
  },
46
- handler: argv => {
47
- command.addHandler(argv);
48
- }
49
- }).option("global", {
51
+ handler: command.addHandler
52
+ })
53
+ .option("global", {
50
54
  alias: "g",
51
55
  type: "boolean",
52
56
  global: true,
53
57
  describe: "Specify if the global configuration should be used"
54
58
  })
59
+ .usage("") // do not show any usage instructions before the commands list
55
60
  // at least one command is required
56
61
  .demandCommand(1, "Please select command");
57
62
  },
58
- // tslint:enable:object-literal-sort-keys
59
63
  getHandler(argv) {
60
64
  cli_core_1.GoogleAnalytics.post({
61
65
  t: "screenview",
@@ -159,6 +163,8 @@ const command = {
159
163
  });
160
164
  }
161
165
  cli_core_1.Util.log(`Property "${argv.property}" updated.`);
162
- }
166
+ },
167
+ handler(_argv) { } // part of the CommandModule interface
163
168
  };
164
169
  exports.default = command;
170
+ //# sourceMappingURL=config.js.map
@@ -1,5 +1,3 @@
1
- declare let doc: {
2
- [term: string]: any;
3
- execute: (argv: any) => Promise<void>;
4
- };
1
+ import { DocCommandType } from "./types";
2
+ declare const doc: DocCommandType;
5
3
  export default doc;