@zeppos/zeus-cli 1.1.8 → 1.2.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 (229) hide show
  1. package/bin/{cli.js → main.js} +11 -7
  2. package/bin/post-command.js +3 -5
  3. package/index.js +0 -3
  4. package/modules/bridge.js +18 -21
  5. package/modules/build.js +86 -215
  6. package/modules/create.js +244 -0
  7. package/modules/help.js +16 -16
  8. package/modules/run.js +23 -83
  9. package/package.json +41 -51
  10. package/{api → private-modules/zeppos-app-utils/dist/api}/index.js +64 -98
  11. package/private-modules/zeppos-app-utils/dist/config/device.js +247 -0
  12. package/private-modules/zeppos-app-utils/dist/config/index.js +18 -0
  13. package/private-modules/zeppos-app-utils/dist/config/project.js +104 -0
  14. package/{utils → private-modules/zeppos-app-utils/dist}/hm-analytics.js +6 -6
  15. package/private-modules/zeppos-app-utils/dist/index.js +38 -0
  16. package/private-modules/zeppos-app-utils/dist/logger/index.js +54 -0
  17. package/private-modules/zeppos-app-utils/dist/logger/my-logger.js +69 -0
  18. package/private-modules/zeppos-app-utils/dist/modules/build.js +334 -0
  19. package/{modules → private-modules/zeppos-app-utils/dist/modules}/config.js +31 -57
  20. package/private-modules/zeppos-app-utils/dist/modules/create/index.js +254 -0
  21. package/{modules → private-modules/zeppos-app-utils/dist/modules}/create/local-app.js +10 -10
  22. package/{modules → private-modules/zeppos-app-utils/dist/modules}/create/yeoman-app.js +2 -2
  23. package/private-modules/zeppos-app-utils/dist/modules/index.js +21 -0
  24. package/{modules → private-modules/zeppos-app-utils/dist/modules}/login.js +17 -45
  25. package/{modules → private-modules/zeppos-app-utils/dist/modules}/status.js +32 -42
  26. package/{public → private-modules/zeppos-app-utils/dist/public}/scripts/png2vglite.py +0 -0
  27. package/{public → private-modules/zeppos-app-utils/dist/public}/scripts/requirements.txt +0 -0
  28. package/{public/template/package.json → private-modules/zeppos-app-utils/dist/public/template/v1/_package.json} +0 -0
  29. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/empty/app-side/i18n/en-US.po +0 -0
  30. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/empty/app-side/index.js +0 -0
  31. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/empty/app.js +0 -0
  32. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/empty/app.json +1 -1
  33. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/empty/assets/default/icon.png +0 -0
  34. package/{public/template/empty/pages → private-modules/zeppos-app-utils/dist/public/template/v1/empty/page}/i18n/en-US.po +0 -0
  35. package/{public/template/empty/pages → private-modules/zeppos-app-utils/dist/public/template/v1/empty/page}/index.js +0 -0
  36. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/empty/setting/i18n/en-US.po +0 -0
  37. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/empty/setting/index.js +0 -0
  38. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/empty/watchface/index.js +0 -0
  39. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/app-side/index.js +0 -0
  40. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/app.js +0 -0
  41. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/app.json +0 -0
  42. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/assets/gtr3/icon.png +0 -0
  43. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/assets/gtr3/image/logo.png +0 -0
  44. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/assets/gtr3-pro/icon.png +0 -0
  45. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/assets/gtr3-pro/image/logo.png +0 -0
  46. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/assets/gts3/icon.png +0 -0
  47. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/assets/gts3/image/logo.png +0 -0
  48. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/page/gtr3/home/index.page.js +0 -0
  49. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/page/gtr3/home/index.page.json +0 -0
  50. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/page/gtr3/home/index.style.js +0 -0
  51. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/page/gtr3-pro/home/index.page.js +0 -0
  52. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/page/gtr3-pro/home/index.page.json +0 -0
  53. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/page/gtr3-pro/home/index.style.js +0 -0
  54. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/page/gts3/home/index.page.js +0 -0
  55. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/page/gts3/home/index.page.json +0 -0
  56. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/page/gts3/home/index.style.js +0 -0
  57. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/page/i18n/en-US.po +0 -0
  58. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/setting/i18n/en-US.po +0 -0
  59. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/setting/index.js +0 -0
  60. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/utils/index.js +0 -0
  61. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/jsconfig.json +0 -0
  62. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/app.js +0 -0
  63. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/app.json +0 -0
  64. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bg/bg.png +0 -0
  65. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bigNum/0.png +0 -0
  66. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bigNum/1.png +0 -0
  67. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bigNum/2.png +0 -0
  68. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bigNum/3.png +0 -0
  69. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bigNum/4.png +0 -0
  70. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bigNum/5.png +0 -0
  71. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bigNum/6.png +0 -0
  72. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bigNum/7.png +0 -0
  73. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bigNum/8.png +0 -0
  74. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bigNum/9.png +0 -0
  75. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bigNum/sp.png +0 -0
  76. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/btn/back.png +0 -0
  77. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/btn/lv.png +0 -0
  78. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/btn/red.png +0 -0
  79. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/point/bg.png +0 -0
  80. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/point/bottom.png +0 -0
  81. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/point/center.png +0 -0
  82. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/point/h.png +0 -0
  83. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/point/left.png +0 -0
  84. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/point/m.png +0 -0
  85. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/point/right.png +0 -0
  86. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/point/s.png +0 -0
  87. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/preview.png +0 -0
  88. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/second/second.png +0 -0
  89. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/0.png +0 -0
  90. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/1.png +0 -0
  91. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/2.png +0 -0
  92. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/3.png +0 -0
  93. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/4.png +0 -0
  94. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/5.png +0 -0
  95. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/6.png +0 -0
  96. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/7.png +0 -0
  97. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/8.png +0 -0
  98. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/9.png +0 -0
  99. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/d.png +0 -0
  100. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/n.png +0 -0
  101. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_ch/1.png +0 -0
  102. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_ch/2.png +0 -0
  103. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_ch/3.png +0 -0
  104. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_ch/4.png +0 -0
  105. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_ch/5.png +0 -0
  106. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_ch/6.png +0 -0
  107. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_ch/7.png +0 -0
  108. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_en/1.png +0 -0
  109. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_en/2.png +0 -0
  110. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_en/3.png +0 -0
  111. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_en/4.png +0 -0
  112. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_en/5.png +0 -0
  113. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_en/6.png +0 -0
  114. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_en/7.png +0 -0
  115. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/shared/buffer.js +0 -0
  116. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/shared/device-polyfill.js +0 -0
  117. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/shared/global.js +0 -0
  118. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/shared/js-module.js +0 -0
  119. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/shared/logger.js +0 -0
  120. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/shared/setTimeout.js +0 -0
  121. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/watchface/gtr-3-pro/index.js +0 -0
  122. package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/watchface/round/index.js +0 -0
  123. package/private-modules/zeppos-app-utils/dist/public/template/v2/_package.json +14 -0
  124. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/app.js +28 -0
  125. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/app.json +56 -0
  126. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/consume.png +0 -0
  127. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/beer.png +0 -0
  128. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/cake.png +0 -0
  129. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/chocolate.png +0 -0
  130. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/coffee.png +0 -0
  131. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/cookies.png +0 -0
  132. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/ham.png +0 -0
  133. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/hamburger.png +0 -0
  134. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/ice cream.png +0 -0
  135. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/pizza.png +0 -0
  136. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/sausage.png +0 -0
  137. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/icon.png +0 -0
  138. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/multiply.png +0 -0
  139. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/selected.png +0 -0
  140. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/unselected.png +0 -0
  141. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/page/gts/food-list.js +113 -0
  142. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/page/gts/index.js +126 -0
  143. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/page/i18n/en-US.po +42 -0
  144. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/page/i18n/zh-CN.po +42 -0
  145. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/utils/constants.js +54 -0
  146. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/utils/storage.js +42 -0
  147. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/utils/styles-gts-3.js +141 -0
  148. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/utils/styles.js +142 -0
  149. package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/app-side/i18n/en-US.po +2 -0
  150. package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/app-side/index.js +13 -0
  151. package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/app.js +10 -0
  152. package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/app.json +60 -0
  153. package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/assets/default/icon.png +0 -0
  154. package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/page/i18n/en-US.po +2 -0
  155. package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/page/index.js +7 -0
  156. package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/setting/i18n/en-US.po +2 -0
  157. package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/setting/index.js +7 -0
  158. package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/watchface/index.js +13 -0
  159. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/app-side/i18n/en-US.po +2 -0
  160. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/app-side/index.js +57 -0
  161. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/app.js +23 -0
  162. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/app.json +65 -0
  163. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/assets/common/icon.png +0 -0
  164. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/pages/i18n/en-US.po +2 -0
  165. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/pages/index.js +55 -0
  166. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/data.js +67 -0
  167. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/defer.js +35 -0
  168. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/device-polyfill.js +6 -0
  169. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/es6-promise.js +1149 -0
  170. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/event.js +42 -0
  171. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/message-side.js +1145 -0
  172. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/message.js +1151 -0
  173. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/utils/config/constants.js +2 -0
  174. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/utils/config/device.js +2 -0
  175. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/app-side/index.js +11 -0
  176. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/app.js +10 -0
  177. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/app.json +101 -0
  178. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/assets/gtr/icon.png +0 -0
  179. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/assets/gtr/image/logo.png +0 -0
  180. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/assets/gts/icon.png +0 -0
  181. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/assets/gts/image/logo.png +0 -0
  182. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gtr/home/index.page.js +20 -0
  183. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gtr/home/index.page.json +1 -0
  184. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gtr/home/index.style.js +18 -0
  185. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gts/home/index.page.js +21 -0
  186. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gts/home/index.page.json +1 -0
  187. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gts/home/index.style.js +17 -0
  188. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/i18n/en-US.po +3 -0
  189. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/setting/i18n/en-US.po +2 -0
  190. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/setting/index.js +5 -0
  191. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/utils/index.js +3 -0
  192. package/private-modules/zeppos-app-utils/dist/public/template/v2/jsconfig.json +14 -0
  193. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/.prettierrc.js +6 -0
  194. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/app-side/index.js +48 -0
  195. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/app.js +25 -0
  196. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/app.json +75 -0
  197. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/assets/gts/icon.png +0 -0
  198. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/page/home/index.page.js +155 -0
  199. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/page/home/index.page.json +1 -0
  200. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/page/home/index.style.js +93 -0
  201. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/page/i18n/en-US.po +8 -0
  202. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/setting/i18n/en-US.po +5 -0
  203. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/setting/index.js +145 -0
  204. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/data.js +67 -0
  205. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/defer.js +35 -0
  206. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/device-polyfill.js +6 -0
  207. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/es6-promise.js +1149 -0
  208. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/event.js +42 -0
  209. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/message-side.js +1145 -0
  210. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/message.js +1151 -0
  211. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/utils/constants.js +3 -0
  212. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/utils/fs.js +38 -0
  213. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/utils/index.js +38 -0
  214. package/private-modules/zeppos-app-utils/dist/simulator.js +58 -0
  215. package/{modules/storage.js → private-modules/zeppos-app-utils/dist/storage/index.js} +2 -1
  216. package/private-modules/zeppos-app-utils/dist/tools/index.js +133 -0
  217. package/private-modules/zeppos-app-utils/dist/websocket.js +165 -0
  218. package/private-modules/zeppos-app-utils/package.json +51 -0
  219. package/utils/pre-check.js +9 -35
  220. package/config/device.js +0 -122
  221. package/config/project.js +0 -48
  222. package/font-icon.js +0 -27
  223. package/modules/create/index.js +0 -358
  224. package/modules/simulator.js +0 -82
  225. package/modules/websocket.js +0 -112
  226. package/utils/common.js +0 -138
  227. package/utils/logger.js +0 -31
  228. package/utils/md5.js +0 -11
  229. package/utils/sleep.js +0 -8
package/config/device.js DELETED
@@ -1,122 +0,0 @@
1
- "use strict";
2
- var _a, _b;
3
- exports.__esModule = true;
4
- exports.deviceInternalCodeName = exports.deviceTargets = exports.DeviceScreenType = exports.DeviceSource = exports.DevicePlatformName = exports.DeviceTarget = void 0;
5
- var DeviceTarget;
6
- (function (DeviceTarget) {
7
- DeviceTarget["MADRID"] = "madrid";
8
- DeviceTarget["VERONA"] = "verona";
9
- DeviceTarget["ZURICH"] = "zurich";
10
- DeviceTarget["TEIDE"] = "teide";
11
- })(DeviceTarget = exports.DeviceTarget || (exports.DeviceTarget = {}));
12
- var DevicePlatformName;
13
- (function (DevicePlatformName) {
14
- DevicePlatformName["MADRID"] = "gtr3-pro";
15
- DevicePlatformName["MADRIDW"] = "gtr3-pro-w";
16
- DevicePlatformName["VERONA"] = "gtr3";
17
- DevicePlatformName["VERONAW"] = "gtr3-w";
18
- DevicePlatformName["ZURICH"] = "gts3";
19
- DevicePlatformName["ZURICHW"] = "gts3-w";
20
- DevicePlatformName["TEIDE"] = "t-rex2";
21
- DevicePlatformName["TEIDEW"] = "t-rex2-w";
22
- })(DevicePlatformName = exports.DevicePlatformName || (exports.DevicePlatformName = {}));
23
- var DeviceSource;
24
- (function (DeviceSource) {
25
- DeviceSource[DeviceSource["MADRID"] = 229] = "MADRID";
26
- DeviceSource[DeviceSource["MADRIDW"] = 230] = "MADRIDW";
27
- DeviceSource[DeviceSource["VERONA"] = 226] = "VERONA";
28
- DeviceSource[DeviceSource["VERONAW"] = 227] = "VERONAW";
29
- DeviceSource[DeviceSource["ZURICH"] = 224] = "ZURICH";
30
- DeviceSource[DeviceSource["ZURICHW"] = 225] = "ZURICHW";
31
- DeviceSource[DeviceSource["TEIDE"] = 418] = "TEIDE";
32
- DeviceSource[DeviceSource["TEIDEW"] = 419] = "TEIDEW";
33
- })(DeviceSource = exports.DeviceSource || (exports.DeviceSource = {}));
34
- var DeviceScreenType;
35
- (function (DeviceScreenType) {
36
- DeviceScreenType["R"] = "r";
37
- DeviceScreenType["S"] = "s";
38
- })(DeviceScreenType = exports.DeviceScreenType || (exports.DeviceScreenType = {}));
39
- exports.deviceTargets = (_a = {},
40
- _a[DeviceTarget.MADRID] = {
41
- deviceName: 'GTR3 Pro',
42
- platforms: [
43
- {
44
- name: DevicePlatformName.MADRID,
45
- deviceSource: DeviceSource.MADRID
46
- },
47
- {
48
- name: DevicePlatformName.MADRIDW,
49
- deviceSource: DeviceSource.MADRIDW
50
- }
51
- ],
52
- screen: {
53
- type: DeviceScreenType.R,
54
- width: 480,
55
- height: 480
56
- }
57
- },
58
- _a[DeviceTarget.VERONA] = {
59
- deviceName: 'GTR3',
60
- platforms: [
61
- {
62
- name: DevicePlatformName.VERONA,
63
- deviceSource: DeviceSource.VERONA
64
- },
65
- {
66
- name: DevicePlatformName.VERONAW,
67
- deviceSource: DeviceSource.VERONAW
68
- }
69
- ],
70
- screen: {
71
- type: DeviceScreenType.R,
72
- width: 454,
73
- height: 454
74
- }
75
- },
76
- _a[DeviceTarget.ZURICH] = {
77
- deviceName: 'GTS3',
78
- platforms: [
79
- {
80
- name: DevicePlatformName.ZURICH,
81
- deviceSource: DeviceSource.ZURICH
82
- },
83
- {
84
- name: DevicePlatformName.ZURICHW,
85
- deviceSource: DeviceSource.ZURICHW
86
- }
87
- ],
88
- screen: {
89
- type: DeviceScreenType.S,
90
- width: 390,
91
- height: 450
92
- }
93
- },
94
- _a[DeviceTarget.TEIDE] = {
95
- deviceName: 'T-Rex2',
96
- platforms: [
97
- {
98
- name: DevicePlatformName.TEIDE,
99
- deviceSource: DeviceSource.TEIDE
100
- },
101
- {
102
- name: DevicePlatformName.TEIDEW,
103
- deviceSource: DeviceSource.TEIDEW
104
- }
105
- ],
106
- screen: {
107
- type: DeviceScreenType.R,
108
- width: 454,
109
- height: 454
110
- }
111
- },
112
- _a);
113
- exports.deviceInternalCodeName = (_b = {},
114
- _b[DeviceSource.MADRID] = DeviceTarget.MADRID,
115
- _b[DeviceSource.MADRIDW] = DeviceTarget.MADRID,
116
- _b[DeviceSource.VERONA] = DeviceTarget.VERONA,
117
- _b[DeviceSource.VERONAW] = DeviceTarget.VERONA,
118
- _b[DeviceSource.ZURICH] = DeviceTarget.ZURICH,
119
- _b[DeviceSource.ZURICHW] = DeviceTarget.ZURICH,
120
- _b[DeviceSource.TEIDE] = DeviceTarget.TEIDE,
121
- _b[DeviceSource.TEIDEW] = DeviceTarget.TEIDE,
122
- _b);
package/config/project.js DELETED
@@ -1,48 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- exports.__esModule = true;
6
- exports.simulatorStorageKey = exports.analyticsKey = exports.loginStorageKey = exports.loginConfig = exports.analyticsHost = exports.gitignoreDefaultItem = exports.ACCOUNT_ENV_KEY = exports.TemplateCopyType = exports.AppSourceType = exports.AppType = void 0;
7
- var lodash_1 = __importDefault(require("lodash"));
8
- var AppType;
9
- (function (AppType) {
10
- AppType["APP"] = "app";
11
- AppType["WATCHFACE"] = "watchface";
12
- })(AppType = exports.AppType || (exports.AppType = {}));
13
- var AppSourceType;
14
- (function (AppSourceType) {
15
- AppSourceType["LOCAL"] = "local";
16
- AppSourceType["YEOMAN"] = "yeoman";
17
- })(AppSourceType = exports.AppSourceType || (exports.AppSourceType = {}));
18
- var TemplateCopyType;
19
- (function (TemplateCopyType) {
20
- TemplateCopyType["CLONE"] = "clone";
21
- TemplateCopyType["EDIT"] = "edit";
22
- })(TemplateCopyType = exports.TemplateCopyType || (exports.TemplateCopyType = {}));
23
- exports.ACCOUNT_ENV_KEY = 'account_env';
24
- exports.gitignoreDefaultItem = ['.DS_Store', 'node_modules/**', 'dist/*', 'npm-debug.log', 'yarn-debug.log*', 'yarn-error.log*', 'yarn.lock',
25
- 'package-lock.json', 'selenium-debug.log', '.idea', '.vscode', '*.suo', '*.ntvs*', '*.njsproj', '*.sln'];
26
- var curLoginURL = process.env.ACCOUNT_ENV !== 'test' ? 'https://user.zepp.com/universalLogin/index.html#/login' : 'https://user-testing.zepp.com/universalLogin/index.html#/login';
27
- exports.analyticsHost = process.env.ACCOUNT_ENV !== 'test' ? 'https://api-analytics.huami.com' : 'https://api-analytics-test.huami.com';
28
- var loginUrl = new URL(curLoginURL);
29
- var accountPrefix = "____".concat(lodash_1["default"].replace(loginUrl.host, /\./g, '_'), "__");
30
- exports.loginConfig = {
31
- LOGIN_URL: curLoginURL,
32
- PROJECT_NAME: 'zeppos_zeus_cli',
33
- PLATFORM_APP: 'com.huami.webapp'
34
- };
35
- exports.loginStorageKey = {
36
- accountToken: "".concat(accountPrefix, "token"),
37
- account: "".concat(accountPrefix, "account"),
38
- userid: "".concat(accountPrefix, "userid"),
39
- cname: "".concat(accountPrefix, "cname")
40
- };
41
- exports.analyticsKey = {
42
- id: "".concat(accountPrefix, "analyticsId")
43
- };
44
- exports.simulatorStorageKey = {
45
- simulatorHost: 'simulator_host',
46
- simulatorPort: 'simulator_port',
47
- simulatorConnectStatus: "____simulator_connect_status"
48
- };
package/font-icon.js DELETED
@@ -1,27 +0,0 @@
1
- "use strict";
2
- exports.__esModule = true;
3
- exports.updateVersion = void 0;
4
- var fontIcon = [
5
- '',
6
- ' ********* ******* ******* ******* ',
7
- ' //////**/ /**///// /**////** /**////**',
8
- ' **/ /** /** /** /** /**',
9
- ' **/ >***** /******* /******* ',
10
- ' **/ /**/// /**//// /**//// ',
11
- ' **/ /** /** /** ',
12
- ' ******** /******* /** /** ',
13
- ' //////// //////// // // ',
14
- '',
15
- ].join('\n');
16
- exports.updateVersion = [
17
- '',
18
- '╭──────────────────────────────────────────────────────╮',
19
- '│ │',
20
- '│ New version available! │',
21
- '│ Changelog: https://api.huami.com/t/zeus-cli-doc │',
22
- '│ Run `npm install @zeppos/zeus-cli -g` to update! │',
23
- '│ │',
24
- '╰──────────────────────────────────────────────────────╯',
25
- '',
26
- ].join('\n');
27
- exports["default"] = fontIcon;
@@ -1,358 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- var desc = Object.getOwnPropertyDescriptor(m, k);
16
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
- desc = { enumerable: true, get: function() { return m[k]; } };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
- Object.defineProperty(o, "default", { enumerable: true, value: v });
26
- }) : function(o, v) {
27
- o["default"] = v;
28
- });
29
- var __importStar = (this && this.__importStar) || function (mod) {
30
- if (mod && mod.__esModule) return mod;
31
- var result = {};
32
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
- __setModuleDefault(result, mod);
34
- return result;
35
- };
36
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
- return new (P || (P = Promise))(function (resolve, reject) {
39
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
- step((generator = generator.apply(thisArg, _arguments || [])).next());
43
- });
44
- };
45
- var __generator = (this && this.__generator) || function (thisArg, body) {
46
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
47
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
48
- function verb(n) { return function (v) { return step([n, v]); }; }
49
- function step(op) {
50
- if (f) throw new TypeError("Generator is already executing.");
51
- while (_) try {
52
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
53
- if (y = 0, t) op = [op[0] & 2, t.value];
54
- switch (op[0]) {
55
- case 0: case 1: t = op; break;
56
- case 4: _.label++; return { value: op[1], done: false };
57
- case 5: _.label++; y = op[1]; op = [0]; continue;
58
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
59
- default:
60
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
61
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
62
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
63
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
64
- if (t[2]) _.ops.pop();
65
- _.trys.pop(); continue;
66
- }
67
- op = body.call(thisArg, _);
68
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
69
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
70
- }
71
- };
72
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
73
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
74
- if (ar || !(i in from)) {
75
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
76
- ar[i] = from[i];
77
- }
78
- }
79
- return to.concat(ar || Array.prototype.slice.call(from));
80
- };
81
- var __importDefault = (this && this.__importDefault) || function (mod) {
82
- return (mod && mod.__esModule) ? mod : { "default": mod };
83
- };
84
- exports.__esModule = true;
85
- exports.create = void 0;
86
- var lodash_1 = require("lodash");
87
- var chalk_1 = __importDefault(require("chalk"));
88
- var inquirer_1 = __importDefault(require("inquirer"));
89
- var rd = __importStar(require("rd"));
90
- var fs_extra_1 = __importDefault(require("fs-extra"));
91
- var path_1 = require("path");
92
- var fs_1 = require("fs");
93
- var yeoman_environment_1 = __importDefault(require("yeoman-environment"));
94
- var shell = require('shelljs');
95
- var local_app_1 = require("./local-app");
96
- var yeoman_app_1 = require("./yeoman-app");
97
- var project_1 = require("../../config/project");
98
- var device_1 = require("../../config/device");
99
- var font_icon_1 = __importDefault(require("../../font-icon"));
100
- var logger = __importStar(require("../../utils/logger"));
101
- var sleep_1 = require("../../utils/sleep");
102
- var hm_analytics_1 = require("../../utils/hm-analytics");
103
- var TEMPLATE_DIR = (0, path_1.resolve)(__dirname, '../../public/template');
104
- var create = function (args) { return __awaiter(void 0, void 0, void 0, function () {
105
- var cmd, _a, projectName, _b, promptAppType, _c, promptTemplate, _d, promptWithAppSide, _e, promptWithSettings, _f, promptBuildTargets, cwdPath, beforeFiles, workDir, localTemplates, localChoices, watchfaceTemplateChoices, appTemplateChoices, env, generatorMate, generatorMateKeys, answer, choosePkg;
106
- return __generator(this, function (_g) {
107
- switch (_g.label) {
108
- case 0:
109
- cmd = args._[0], _a = args.projectName, projectName = _a === void 0 ? '' : _a, _b = args.appType, promptAppType = _b === void 0 ? '' : _b, _c = args.template, promptTemplate = _c === void 0 ? '' : _c, _d = args.withAppSide, promptWithAppSide = _d === void 0 ? false : _d, _e = args.withSettings, promptWithSettings = _e === void 0 ? false : _e, _f = args.buildTargets, promptBuildTargets = _f === void 0 ? [] : _f;
110
- cwdPath = (0, path_1.resolve)('./');
111
- beforeFiles = [];
112
- workDir = cwdPath;
113
- if (cmd === 'create') {
114
- if (projectName) {
115
- workDir = (0, path_1.resolve)(cwdPath, projectName);
116
- if ((0, fs_1.existsSync)(workDir)) {
117
- logger.error("\"".concat(workDir, "/\" already exists."));
118
- process.exit(1);
119
- }
120
- }
121
- else {
122
- logger.error('There was a missing parameter: projectName.');
123
- process.exit(1);
124
- }
125
- (0, hm_analytics_1.HM_Analytics)('ZEPP_CLI_CREATE_C');
126
- }
127
- else {
128
- (0, hm_analytics_1.HM_Analytics)('ZEPP_CLI_INIT_C');
129
- }
130
- if ((0, fs_1.existsSync)(workDir)) {
131
- rd.eachFileSync(workDir, function (file) {
132
- beforeFiles.push(file);
133
- });
134
- }
135
- localTemplates = (0, fs_1.readdirSync)(TEMPLATE_DIR);
136
- localChoices = [];
137
- watchfaceTemplateChoices = [];
138
- appTemplateChoices = [];
139
- if (!(0, lodash_1.isEmpty)(localTemplates)) {
140
- localTemplates.forEach(function (dirName) {
141
- var dirPath = "".concat(TEMPLATE_DIR, "/").concat(dirName);
142
- var dirStat = (0, fs_1.lstatSync)(dirPath);
143
- if (dirStat.isDirectory()) {
144
- var chooseItem = {
145
- name: (0, lodash_1.startCase)(dirName),
146
- path: dirPath,
147
- type: project_1.AppSourceType.LOCAL
148
- };
149
- if (dirName === 'empty') {
150
- localChoices.unshift(Object.assign(chooseItem, {
151
- copyType: project_1.TemplateCopyType.EDIT
152
- }));
153
- watchfaceTemplateChoices.unshift(Object.assign(chooseItem, {
154
- copyType: project_1.TemplateCopyType.EDIT
155
- }));
156
- appTemplateChoices.unshift(Object.assign(chooseItem, {
157
- copyType: project_1.TemplateCopyType.EDIT
158
- }));
159
- }
160
- else {
161
- if (dirName === 'hello-world') {
162
- appTemplateChoices.push(chooseItem);
163
- }
164
- if (dirName === 'timer') {
165
- watchfaceTemplateChoices.push(chooseItem);
166
- }
167
- localChoices.push(chooseItem);
168
- }
169
- }
170
- });
171
- }
172
- env = yeoman_environment_1["default"].createEnv();
173
- env.lookup();
174
- generatorMate = env.getGeneratorsMeta();
175
- generatorMateKeys = Object.keys(generatorMate);
176
- if (generatorMateKeys.length) {
177
- if (localChoices.length) {
178
- localChoices.push(new inquirer_1["default"].Separator());
179
- }
180
- generatorMateKeys.forEach(function (name) {
181
- if (/:(app|all)$/.test(name)) {
182
- localChoices.push({
183
- name: name,
184
- type: project_1.AppSourceType.YEOMAN
185
- });
186
- appTemplateChoices.push({
187
- name: name,
188
- type: project_1.AppSourceType.YEOMAN
189
- });
190
- watchfaceTemplateChoices.push({
191
- name: name,
192
- type: project_1.AppSourceType.YEOMAN
193
- });
194
- }
195
- });
196
- }
197
- localChoices.map(function (val, index) {
198
- val.value = index;
199
- });
200
- appTemplateChoices.map(function (val, index) {
201
- val.value = index;
202
- });
203
- watchfaceTemplateChoices.map(function (val, index) {
204
- val.value = index;
205
- });
206
- return [4, inquirer_1["default"].prompt([
207
- {
208
- name: 'appType',
209
- type: 'list',
210
- when: function (args) {
211
- var bool = !promptAppType || !Object.values(project_1.AppType).includes(promptAppType);
212
- if (!bool) {
213
- args.appType = promptAppType.toUpperCase();
214
- }
215
- return bool;
216
- },
217
- message: 'What type of application do you want to create?',
218
- choices: Object.keys(project_1.AppType)
219
- },
220
- {
221
- name: 'template',
222
- type: 'list',
223
- when: function (args) {
224
- var isApp = args.appType.toLowerCase() === project_1.AppType.APP;
225
- var objMap = appTemplateChoices.find(function (val) {
226
- var name = val.name === 'Hello World' ? 'Hello_World' : val.name;
227
- return name === promptTemplate;
228
- });
229
- if (isApp && objMap) {
230
- args.template = objMap.value;
231
- }
232
- return isApp && !objMap;
233
- },
234
- message: 'Which app template do you want to use?',
235
- choices: __spreadArray([
236
- new inquirer_1["default"].Separator(),
237
- new inquirer_1["default"].Separator('Choose a app template')
238
- ], appTemplateChoices, true)
239
- },
240
- {
241
- name: 'template',
242
- type: 'list',
243
- when: function (args) {
244
- var isWatchFace = args.appType.toLowerCase() === project_1.AppType.WATCHFACE;
245
- var objMap = watchfaceTemplateChoices.find(function (val) { return val.name === promptTemplate; });
246
- if (isWatchFace && objMap) {
247
- args.template = objMap.value;
248
- }
249
- return isWatchFace && !objMap;
250
- },
251
- message: 'Which watchface template do you want to use?',
252
- choices: __spreadArray([
253
- new inquirer_1["default"].Separator(),
254
- new inquirer_1["default"].Separator('Choose a watchface template')
255
- ], watchfaceTemplateChoices, true)
256
- },
257
- {
258
- name: 'withAppSide',
259
- type: 'confirm',
260
- when: function (args) {
261
- var isApp = args.appType.toLowerCase() === project_1.AppType.APP;
262
- var isEmpty = args.template === 0;
263
- if (isApp && isEmpty && promptWithAppSide) {
264
- args.withAppSide = promptWithAppSide === 'no' ? false : true;
265
- return false;
266
- }
267
- return isApp && isEmpty;
268
- },
269
- message: 'Should this application contain a app-side component?'
270
- },
271
- {
272
- name: 'withSettings',
273
- type: 'confirm',
274
- when: function (args) {
275
- var withAppSide = args.withAppSide;
276
- if (withAppSide && promptWithSettings) {
277
- args.withSettings = promptWithSettings === 'no' ? false : true;
278
- return false;
279
- }
280
- return withAppSide;
281
- },
282
- message: 'Should this application contain a settings component?'
283
- },
284
- {
285
- name: 'buildTargets',
286
- type: 'checkbox',
287
- when: function (args) {
288
- var bool = args.template === 0;
289
- var tarArr = typeof promptBuildTargets === 'string' ? (0, lodash_1.intersection)(Object.keys(device_1.deviceTargets), promptBuildTargets.split(',')) : [];
290
- if (bool && tarArr.length) {
291
- args.buildTargets = tarArr;
292
- return false;
293
- }
294
- return bool;
295
- },
296
- choices: Object.keys(device_1.deviceTargets).map(function (platform) { return ({
297
- name: device_1.deviceTargets[platform].deviceName,
298
- value: platform,
299
- checked: platform === Object.keys(device_1.deviceTargets)[0]
300
- }); }),
301
- "default": Object.keys(device_1.deviceTargets)[0],
302
- message: 'Which platforms of this application should be built?'
303
- },
304
- ])];
305
- case 1:
306
- answer = _g.sent();
307
- answer.appType = answer.appType || project_1.AppType.APP;
308
- answer.workDir = workDir;
309
- choosePkg = answer.appType.toLowerCase() === project_1.AppType.APP ? appTemplateChoices[answer.template] : watchfaceTemplateChoices[answer.template];
310
- logger.info('fetching template...');
311
- return [4, (0, sleep_1.sleep)(100)];
312
- case 2:
313
- _g.sent();
314
- if (choosePkg.type === project_1.AppSourceType.YEOMAN) {
315
- logger.info("".concat((0, lodash_1.upperFirst)(cmd), " application using yeoman template \"").concat(choosePkg.name, "\"."));
316
- (0, yeoman_app_1.createYeomanApp)(__assign(__assign({}, answer), { env: env, templateInfo: generatorMate[choosePkg.name] }));
317
- }
318
- else {
319
- logger.info("".concat((0, lodash_1.upperFirst)(cmd), " application using local template \"").concat(choosePkg.name, "\"."));
320
- (0, local_app_1.createLocalApp)(__assign(__assign({}, answer), { templateInfo: choosePkg }));
321
- }
322
- logger.log('\n');
323
- return [4, (0, sleep_1.sleep)(50)];
324
- case 3:
325
- _g.sent();
326
- rd.eachFileSync(workDir, function (file) {
327
- if ((0, lodash_1.endsWith)(file, '.DS_Store')) {
328
- fs_extra_1["default"].remove(file);
329
- }
330
- else {
331
- var shortFile = file.replace(cwdPath, '');
332
- if (beforeFiles.includes(file)) {
333
- logger.log(chalk_1["default"].yellow(" ".concat(chalk_1["default"].bold('replace'), " ")), shortFile);
334
- }
335
- else {
336
- logger.log(chalk_1["default"].green(" ".concat(chalk_1["default"].bold('create'), " ")), shortFile);
337
- }
338
- }
339
- });
340
- logger.log('\n');
341
- logger.success("project created successfully by \"".concat(choosePkg.name, "\" template.\n"));
342
- if (cmd === 'create') {
343
- shell.cd("".concat(projectName));
344
- }
345
- shell.exec('npm install');
346
- return [4, (0, sleep_1.sleep)(300)];
347
- case 4:
348
- _g.sent();
349
- logger.log(chalk_1["default"].hex('#DB8C41')(font_icon_1["default"]));
350
- return [4, (0, sleep_1.sleep)(800)];
351
- case 5:
352
- _g.sent();
353
- logger.log('I\'m all done. Now you can start your application.');
354
- return [2];
355
- }
356
- });
357
- }); };
358
- exports.create = create;
@@ -1,82 +0,0 @@
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
- };
25
- exports.__esModule = true;
26
- exports.Simulator = void 0;
27
- var socket_io_client_1 = require("socket.io-client");
28
- var logger = __importStar(require("../utils/logger"));
29
- var storage_1 = require("./storage");
30
- var project_1 = require("../config/project");
31
- var Simulator = (function () {
32
- function Simulator(url, options) {
33
- this.previewId = 1;
34
- this.previewMethod = 'ide.simulator.preview';
35
- logger.info('connecting to simulator');
36
- this.socket = (0, socket_io_client_1.io)(url, options || {});
37
- this.socket.on('connect', function () {
38
- var _a;
39
- storage_1.globalStorage.set((_a = {}, _a[project_1.simulatorStorageKey.simulatorConnectStatus] = 'connected', _a));
40
- logger.success('simulator connected');
41
- });
42
- this.socket.on('disconnect', function () {
43
- var _a;
44
- storage_1.globalStorage.set((_a = {}, _a[project_1.simulatorStorageKey.simulatorConnectStatus] = 'disconnected', _a));
45
- logger.error('simulator disconnected, please restart the simulator');
46
- });
47
- }
48
- Simulator.prototype.sendMessage = function (message) {
49
- this.socket.send(message);
50
- };
51
- Simulator.prototype.emit = function (space, jsonData) {
52
- this.socket.emit(space, jsonData);
53
- };
54
- Simulator.prototype.upload = function (data, projectName, target, appid, devices) {
55
- var dataArr = this.uint8ToArray(new Uint8Array(data));
56
- var message = this.encodeMessage({
57
- target: target,
58
- projectName: projectName,
59
- appid: appid,
60
- size: data.byteLength,
61
- data: dataArr,
62
- devices: devices
63
- });
64
- this.sendMessage(message);
65
- };
66
- Simulator.prototype.encodeMessage = function (params) {
67
- return JSON.stringify({
68
- jsonrpc: '2.0',
69
- method: this.previewMethod,
70
- params: params,
71
- id: this.previewId
72
- });
73
- };
74
- Simulator.prototype.decodeMessage = function (data) {
75
- return JSON.parse(data);
76
- };
77
- Simulator.prototype.uint8ToArray = function (source) {
78
- return Array.prototype.slice.call(source);
79
- };
80
- return Simulator;
81
- }());
82
- exports.Simulator = Simulator;