@zeppos/zeus-cli 1.1.9 → 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 (200) hide show
  1. package/bin/main.js +2 -0
  2. package/modules/bridge.js +7 -8
  3. package/modules/build.js +21 -2
  4. package/modules/create.js +89 -38
  5. package/package.json +2 -2
  6. package/private-modules/zeppos-app-utils/dist/config/device.js +114 -14
  7. package/private-modules/zeppos-app-utils/dist/modules/build.js +30 -11
  8. package/private-modules/zeppos-app-utils/dist/modules/config.js +0 -1
  9. package/private-modules/zeppos-app-utils/dist/modules/create/index.js +74 -36
  10. package/private-modules/zeppos-app-utils/dist/modules/create/local-app.js +4 -4
  11. package/private-modules/zeppos-app-utils/dist/modules/login.js +1 -5
  12. package/private-modules/zeppos-app-utils/dist/modules/status.js +0 -1
  13. package/private-modules/zeppos-app-utils/dist/public/template/{_package.json → v1/_package.json} +0 -0
  14. package/private-modules/zeppos-app-utils/dist/public/template/{empty → v1/empty}/app-side/i18n/en-US.po +0 -0
  15. package/private-modules/zeppos-app-utils/dist/public/template/{empty → v1/empty}/app-side/index.js +0 -0
  16. package/private-modules/zeppos-app-utils/dist/public/template/{empty → v1/empty}/app.js +0 -0
  17. package/private-modules/zeppos-app-utils/dist/public/template/{empty → v1/empty}/app.json +0 -0
  18. package/private-modules/zeppos-app-utils/dist/public/template/{empty → v1/empty}/assets/default/icon.png +0 -0
  19. package/private-modules/zeppos-app-utils/dist/public/template/{empty → v1/empty}/page/i18n/en-US.po +0 -0
  20. package/private-modules/zeppos-app-utils/dist/public/template/{empty → v1/empty}/page/index.js +0 -0
  21. package/private-modules/zeppos-app-utils/dist/public/template/{empty → v1/empty}/setting/i18n/en-US.po +0 -0
  22. package/private-modules/zeppos-app-utils/dist/public/template/{empty → v1/empty}/setting/index.js +0 -0
  23. package/private-modules/zeppos-app-utils/dist/public/template/{empty → v1/empty}/watchface/index.js +0 -0
  24. package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/app-side/index.js +0 -0
  25. package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/app.js +0 -0
  26. package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/app.json +0 -0
  27. package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/assets/gtr3/icon.png +0 -0
  28. package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/assets/gtr3/image/logo.png +0 -0
  29. package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/assets/gtr3-pro/icon.png +0 -0
  30. package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/assets/gtr3-pro/image/logo.png +0 -0
  31. package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/assets/gts3/icon.png +0 -0
  32. package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/assets/gts3/image/logo.png +0 -0
  33. package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/page/gtr3/home/index.page.js +0 -0
  34. package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/page/gtr3/home/index.page.json +0 -0
  35. package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/page/gtr3/home/index.style.js +0 -0
  36. package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/page/gtr3-pro/home/index.page.js +0 -0
  37. package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/page/gtr3-pro/home/index.page.json +0 -0
  38. package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/page/gtr3-pro/home/index.style.js +0 -0
  39. package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/page/gts3/home/index.page.js +0 -0
  40. package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/page/gts3/home/index.page.json +0 -0
  41. package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/page/gts3/home/index.style.js +0 -0
  42. package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/page/i18n/en-US.po +0 -0
  43. package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/setting/i18n/en-US.po +0 -0
  44. package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/setting/index.js +0 -0
  45. package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/utils/index.js +0 -0
  46. package/private-modules/zeppos-app-utils/dist/public/template/{jsconfig.json → v1/jsconfig.json} +0 -0
  47. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/app.js +0 -0
  48. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/app.json +0 -0
  49. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bg/bg.png +0 -0
  50. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bigNum/0.png +0 -0
  51. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bigNum/1.png +0 -0
  52. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bigNum/2.png +0 -0
  53. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bigNum/3.png +0 -0
  54. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bigNum/4.png +0 -0
  55. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bigNum/5.png +0 -0
  56. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bigNum/6.png +0 -0
  57. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bigNum/7.png +0 -0
  58. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bigNum/8.png +0 -0
  59. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bigNum/9.png +0 -0
  60. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bigNum/sp.png +0 -0
  61. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/btn/back.png +0 -0
  62. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/btn/lv.png +0 -0
  63. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/btn/red.png +0 -0
  64. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/point/bg.png +0 -0
  65. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/point/bottom.png +0 -0
  66. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/point/center.png +0 -0
  67. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/point/h.png +0 -0
  68. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/point/left.png +0 -0
  69. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/point/m.png +0 -0
  70. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/point/right.png +0 -0
  71. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/point/s.png +0 -0
  72. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/preview.png +0 -0
  73. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/second/second.png +0 -0
  74. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/0.png +0 -0
  75. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/1.png +0 -0
  76. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/2.png +0 -0
  77. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/3.png +0 -0
  78. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/4.png +0 -0
  79. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/5.png +0 -0
  80. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/6.png +0 -0
  81. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/7.png +0 -0
  82. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/8.png +0 -0
  83. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/9.png +0 -0
  84. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/d.png +0 -0
  85. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/n.png +0 -0
  86. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_ch/1.png +0 -0
  87. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_ch/2.png +0 -0
  88. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_ch/3.png +0 -0
  89. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_ch/4.png +0 -0
  90. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_ch/5.png +0 -0
  91. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_ch/6.png +0 -0
  92. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_ch/7.png +0 -0
  93. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_en/1.png +0 -0
  94. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_en/2.png +0 -0
  95. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_en/3.png +0 -0
  96. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_en/4.png +0 -0
  97. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_en/5.png +0 -0
  98. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_en/6.png +0 -0
  99. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_en/7.png +0 -0
  100. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/shared/buffer.js +0 -0
  101. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/shared/device-polyfill.js +0 -0
  102. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/shared/global.js +0 -0
  103. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/shared/js-module.js +0 -0
  104. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/shared/logger.js +0 -0
  105. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/shared/setTimeout.js +0 -0
  106. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/watchface/gtr-3-pro/index.js +0 -0
  107. package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/watchface/round/index.js +0 -0
  108. package/private-modules/zeppos-app-utils/dist/public/template/v2/_package.json +14 -0
  109. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/app.js +28 -0
  110. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/app.json +56 -0
  111. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/consume.png +0 -0
  112. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/beer.png +0 -0
  113. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/cake.png +0 -0
  114. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/chocolate.png +0 -0
  115. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/coffee.png +0 -0
  116. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/cookies.png +0 -0
  117. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/ham.png +0 -0
  118. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/hamburger.png +0 -0
  119. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/ice cream.png +0 -0
  120. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/pizza.png +0 -0
  121. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/sausage.png +0 -0
  122. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/icon.png +0 -0
  123. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/multiply.png +0 -0
  124. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/selected.png +0 -0
  125. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/unselected.png +0 -0
  126. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/page/gts/food-list.js +113 -0
  127. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/page/gts/index.js +126 -0
  128. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/page/i18n/en-US.po +42 -0
  129. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/page/i18n/zh-CN.po +42 -0
  130. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/utils/constants.js +54 -0
  131. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/utils/storage.js +42 -0
  132. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/utils/styles-gts-3.js +141 -0
  133. package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/utils/styles.js +142 -0
  134. package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/app-side/i18n/en-US.po +2 -0
  135. package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/app-side/index.js +13 -0
  136. package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/app.js +10 -0
  137. package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/app.json +60 -0
  138. package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/assets/default/icon.png +0 -0
  139. package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/page/i18n/en-US.po +2 -0
  140. package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/page/index.js +7 -0
  141. package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/setting/i18n/en-US.po +2 -0
  142. package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/setting/index.js +7 -0
  143. package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/watchface/index.js +13 -0
  144. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/app-side/i18n/en-US.po +2 -0
  145. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/app-side/index.js +57 -0
  146. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/app.js +23 -0
  147. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/app.json +65 -0
  148. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/assets/common/icon.png +0 -0
  149. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/pages/i18n/en-US.po +2 -0
  150. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/pages/index.js +55 -0
  151. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/data.js +67 -0
  152. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/defer.js +35 -0
  153. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/device-polyfill.js +6 -0
  154. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/es6-promise.js +1149 -0
  155. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/event.js +42 -0
  156. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/message-side.js +1145 -0
  157. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/message.js +1151 -0
  158. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/utils/config/constants.js +2 -0
  159. package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/utils/config/device.js +2 -0
  160. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/app-side/index.js +11 -0
  161. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/app.js +10 -0
  162. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/app.json +101 -0
  163. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/assets/gtr/icon.png +0 -0
  164. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/assets/gtr/image/logo.png +0 -0
  165. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/assets/gts/icon.png +0 -0
  166. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/assets/gts/image/logo.png +0 -0
  167. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gtr/home/index.page.js +20 -0
  168. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gtr/home/index.page.json +1 -0
  169. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gtr/home/index.style.js +18 -0
  170. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gts/home/index.page.js +21 -0
  171. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gts/home/index.page.json +1 -0
  172. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gts/home/index.style.js +17 -0
  173. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/i18n/en-US.po +3 -0
  174. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/setting/i18n/en-US.po +2 -0
  175. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/setting/index.js +5 -0
  176. package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/utils/index.js +3 -0
  177. package/private-modules/zeppos-app-utils/dist/public/template/v2/jsconfig.json +14 -0
  178. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/.prettierrc.js +6 -0
  179. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/app-side/index.js +48 -0
  180. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/app.js +25 -0
  181. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/app.json +75 -0
  182. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/assets/gts/icon.png +0 -0
  183. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/page/home/index.page.js +155 -0
  184. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/page/home/index.page.json +1 -0
  185. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/page/home/index.style.js +93 -0
  186. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/page/i18n/en-US.po +8 -0
  187. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/setting/i18n/en-US.po +5 -0
  188. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/setting/index.js +145 -0
  189. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/data.js +67 -0
  190. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/defer.js +35 -0
  191. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/device-polyfill.js +6 -0
  192. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/es6-promise.js +1149 -0
  193. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/event.js +42 -0
  194. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/message-side.js +1145 -0
  195. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/message.js +1151 -0
  196. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/utils/constants.js +3 -0
  197. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/utils/fs.js +38 -0
  198. package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/utils/index.js +38 -0
  199. package/private-modules/zeppos-app-utils/dist/tools/index.js +0 -2
  200. package/private-modules/zeppos-app-utils/package.json +2 -2
@@ -86,23 +86,39 @@ var yeoman_app_1 = require("./yeoman-app");
86
86
  var index_1 = require("../../index");
87
87
  var AppType = index_1.config.AppType, AppSourceType = index_1.config.AppSourceType, TemplateCopyType = index_1.config.TemplateCopyType, zeppFontIcon = index_1.config.zeppFontIcon;
88
88
  var child_process_1 = require("child_process");
89
+ var projectPreInstall = function (dir) {
90
+ return new Promise(function (resolve) {
91
+ var execInstall = (0, child_process_1.spawn)('npm', ['install'], {
92
+ stdio: 'pipe',
93
+ cwd: dir
94
+ });
95
+ execInstall.stdout.pipe(process.stdout);
96
+ execInstall.on('close', function (code) {
97
+ resolve(code);
98
+ });
99
+ });
100
+ };
89
101
  var createX = function (cwdPath, args, func, beforeFiles) {
90
102
  if (beforeFiles === void 0) { beforeFiles = []; }
91
103
  return __awaiter(void 0, void 0, void 0, function () {
92
- var cmd, _a, projectName, workDir, TEMPLATE_DIR, localTemplates, localChoices, watchfaceTemplateChoices, appTemplateChoices, env, generatorMate, generatorMateKeys, answer, choosePkg;
104
+ var cmd, _a, projectName, workDir, V1_TEMPLATE_DIR, V2_TEMPLATE_DIR, localTemplates, localChoices, watchfaceTemplateChoices, appTemplateChoices, templatesInit, env, generatorMate, generatorMateKeys, choicesValueFormat, answer, choosePkg;
93
105
  return __generator(this, function (_b) {
94
106
  switch (_b.label) {
95
107
  case 0:
96
108
  cmd = args._[0], _a = args.projectName, projectName = _a === void 0 ? '' : _a;
97
109
  workDir = cwdPath;
98
- TEMPLATE_DIR = (0, path_1.resolve)(__dirname, '../../public/template');
99
- localTemplates = (0, fs_1.readdirSync)(TEMPLATE_DIR);
100
- localChoices = [];
101
- watchfaceTemplateChoices = [];
102
- appTemplateChoices = [];
103
- if (!(0, lodash_1.isEmpty)(localTemplates)) {
104
- localTemplates.forEach(function (dirName) {
105
- var dirPath = "".concat(TEMPLATE_DIR, "/").concat(dirName);
110
+ V1_TEMPLATE_DIR = (0, path_1.resolve)(__dirname, '../../public/template/v1');
111
+ V2_TEMPLATE_DIR = (0, path_1.resolve)(__dirname, '../../public/template/v2');
112
+ localTemplates = {
113
+ v1: (0, fs_1.readdirSync)(V1_TEMPLATE_DIR),
114
+ v2: (0, fs_1.readdirSync)(V2_TEMPLATE_DIR)
115
+ };
116
+ localChoices = { v1: [], v2: [] };
117
+ watchfaceTemplateChoices = { v1: [], v2: [] };
118
+ appTemplateChoices = { v1: [], v2: [] };
119
+ templatesInit = function (os, dir) {
120
+ localTemplates[os].forEach(function (dirName) {
121
+ var dirPath = "".concat(dir, "/").concat(dirName);
106
122
  var dirStat = (0, fs_1.lstatSync)(dirPath);
107
123
  if (dirStat.isDirectory()) {
108
124
  var chooseItem = {
@@ -111,27 +127,31 @@ var createX = function (cwdPath, args, func, beforeFiles) {
111
127
  type: AppSourceType.LOCAL
112
128
  };
113
129
  if (dirName === 'empty') {
114
- localChoices.unshift(Object.assign(chooseItem, {
130
+ localChoices[os].unshift(Object.assign(chooseItem, {
115
131
  copyType: TemplateCopyType.EDIT
116
132
  }));
117
- watchfaceTemplateChoices.unshift(Object.assign(chooseItem, {
133
+ watchfaceTemplateChoices[os].unshift(Object.assign(chooseItem, {
118
134
  copyType: TemplateCopyType.EDIT
119
135
  }));
120
- appTemplateChoices.unshift(Object.assign(chooseItem, {
136
+ appTemplateChoices[os].unshift(Object.assign(chooseItem, {
121
137
  copyType: TemplateCopyType.EDIT
122
138
  }));
123
139
  }
140
+ else if (['hello-world', 'calories', 'fetch-api', 'todo-list'].includes(dirName)) {
141
+ appTemplateChoices[os].push(chooseItem);
142
+ }
143
+ else if (dirName === 'timer') {
144
+ watchfaceTemplateChoices[os].push(chooseItem);
145
+ }
124
146
  else {
125
- if (dirName === 'hello-world') {
126
- appTemplateChoices.push(chooseItem);
127
- }
128
- if (dirName === 'timer') {
129
- watchfaceTemplateChoices.push(chooseItem);
130
- }
131
- localChoices.push(chooseItem);
147
+ localChoices[os].push(chooseItem);
132
148
  }
133
149
  }
134
150
  });
151
+ };
152
+ if (!(0, lodash_1.isEmpty)(localTemplates)) {
153
+ templatesInit('v1', V1_TEMPLATE_DIR);
154
+ templatesInit('v2', V2_TEMPLATE_DIR);
135
155
  }
136
156
  env = yeoman_environment_1["default"].createEnv();
137
157
  env.lookup();
@@ -140,36 +160,51 @@ var createX = function (cwdPath, args, func, beforeFiles) {
140
160
  if (generatorMateKeys.length) {
141
161
  generatorMateKeys.forEach(function (name) {
142
162
  if (/:(app|all)$/.test(name)) {
143
- localChoices.push({
163
+ localChoices['v1'].push({
164
+ name: name,
165
+ type: AppSourceType.YEOMAN
166
+ });
167
+ appTemplateChoices['v1'].push({
144
168
  name: name,
145
169
  type: AppSourceType.YEOMAN
146
170
  });
147
- appTemplateChoices.push({
171
+ watchfaceTemplateChoices['v1'].push({
148
172
  name: name,
149
173
  type: AppSourceType.YEOMAN
150
174
  });
151
- watchfaceTemplateChoices.push({
175
+ localChoices['v2'].push({
176
+ name: name,
177
+ type: AppSourceType.YEOMAN
178
+ });
179
+ appTemplateChoices['v2'].push({
180
+ name: name,
181
+ type: AppSourceType.YEOMAN
182
+ });
183
+ watchfaceTemplateChoices['v2'].push({
152
184
  name: name,
153
185
  type: AppSourceType.YEOMAN
154
186
  });
155
187
  }
156
188
  });
157
189
  }
158
- localChoices.map(function (val, index) {
159
- val.value = index;
160
- });
161
- appTemplateChoices.map(function (val, index) {
162
- val.value = index;
163
- });
164
- watchfaceTemplateChoices.map(function (val, index) {
165
- val.value = index;
166
- });
167
- return [4, func(args, { appTemplateChoices: appTemplateChoices, watchfaceTemplateChoices: watchfaceTemplateChoices })];
190
+ choicesValueFormat = function (arr) {
191
+ arr['v1'].map(function (val, index) { return (val.value = index); });
192
+ arr['v2'].map(function (val, index) { return (val.value = index); });
193
+ };
194
+ choicesValueFormat(localChoices);
195
+ choicesValueFormat(appTemplateChoices);
196
+ choicesValueFormat(watchfaceTemplateChoices);
197
+ return [4, func(args, {
198
+ appTemplateChoices: appTemplateChoices,
199
+ watchfaceTemplateChoices: watchfaceTemplateChoices
200
+ })];
168
201
  case 1:
169
202
  answer = _b.sent();
170
203
  answer.appType = answer.appType || AppType.APP;
171
204
  answer.workDir = workDir;
172
- choosePkg = answer.appType.toLowerCase() === AppType.APP ? appTemplateChoices[answer.template] : watchfaceTemplateChoices[answer.template];
205
+ choosePkg = answer.appType.toLowerCase() === AppType.APP
206
+ ? appTemplateChoices[answer.OSVersion][answer.template]
207
+ : watchfaceTemplateChoices[answer.OSVersion][answer.template];
173
208
  index_1.logger.info('fetching template...');
174
209
  return [4, (0, index_1.sleep)(100)];
175
210
  case 2:
@@ -202,12 +237,15 @@ var createX = function (cwdPath, args, func, beforeFiles) {
202
237
  });
203
238
  index_1.logger.log('\n');
204
239
  index_1.logger.success("Project created successfully by \"".concat(choosePkg.name, "\" template."));
205
- (0, child_process_1.exec)('npm install', { cwd: workDir });
240
+ index_1.logger.log('Start installing dependency packages.');
241
+ return [4, projectPreInstall(workDir)];
242
+ case 4:
243
+ _b.sent();
206
244
  index_1.logger.log(chalk_1["default"].hex('#DB8C41')(zeppFontIcon));
207
- index_1.logger.log('I\'m all done. Now you can start your application.');
245
+ index_1.logger.log("I'm all done. Now you can start your application.");
208
246
  return [2, [
209
247
  "Project created successfully by \"".concat(choosePkg.name, "\" template."),
210
- 'I\'m all done. Now you can start your application.'
248
+ "I'm all done. Now you can start your application.",
211
249
  ]];
212
250
  }
213
251
  });
@@ -59,12 +59,12 @@ var fs_1 = __importDefault(require("fs"));
59
59
  var index_1 = require("../../index");
60
60
  var TemplateCopyType = index_1.config.TemplateCopyType, AppType = index_1.config.AppType, deviceTargets = index_1.config.deviceTargets;
61
61
  var createLocalApp = function (args) { return __awaiter(void 0, void 0, void 0, function () {
62
- var workDir, templateInfo, withAppSide, withSettings, buildTargets, appType, appJsonPath, appJson, appID, defaultTarget, targets, defaultWatchFaceConfig, defaultAssetsPath_1;
62
+ var workDir, templateInfo, OSVersion, withAppSide, withSettings, buildTargets, appType, appJsonPath, appJson, appID, defaultTarget, targets, defaultWatchFaceConfig, defaultAssetsPath_1;
63
63
  return __generator(this, function (_a) {
64
- workDir = args.workDir, templateInfo = args.templateInfo, withAppSide = args.withAppSide, withSettings = args.withSettings, buildTargets = args.buildTargets, appType = args.appType;
64
+ workDir = args.workDir, templateInfo = args.templateInfo, OSVersion = args.OSVersion, withAppSide = args.withAppSide, withSettings = args.withSettings, buildTargets = args.buildTargets, appType = args.appType;
65
65
  fs_extra_1["default"].copySync(templateInfo.path, workDir);
66
- fs_extra_1["default"].copySync((0, path_1.resolve)(__dirname, '../../public/template/jsconfig.json'), "".concat(workDir, "/jsconfig.json"));
67
- fs_extra_1["default"].copySync((0, path_1.resolve)(__dirname, '../../public/template/_package.json'), "".concat(workDir, "/package.json"));
66
+ fs_extra_1["default"].copySync((0, path_1.resolve)(__dirname, "../../public/template/".concat(OSVersion, "/jsconfig.json")), "".concat(workDir, "/jsconfig.json"));
67
+ fs_extra_1["default"].copySync((0, path_1.resolve)(__dirname, "../../public/template/".concat(OSVersion, "/_package.json")), "".concat(workDir, "/package.json"));
68
68
  fs_1["default"].writeFileSync("".concat(workDir, "/global.d.ts"), '/// <reference path="node_modules/@zeppos/device-types/index.d.ts" />');
69
69
  appJsonPath = (0, path_1.resolve)(workDir, './app.json');
70
70
  appJson = fs_extra_1["default"].readJsonSync(appJsonPath);
@@ -48,7 +48,6 @@ var lodash_1 = __importDefault(require("lodash"));
48
48
  var get_port_1 = __importDefault(require("get-port"));
49
49
  var stoppable_1 = __importDefault(require("stoppable"));
50
50
  var index_1 = require("../index");
51
- var hm_analytics_1 = require("../hm-analytics");
52
51
  var _a = index_1.config.getLocalConfig(), loginConfig = _a.loginConfig, loginStorageKey = _a.loginStorageKey;
53
52
  var loginCallbackServer = function (cb) { return __awaiter(void 0, void 0, void 0, function () {
54
53
  var callbackPath, port, server;
@@ -133,15 +132,12 @@ var login = function (args) { return __awaiter(void 0, void 0, void 0, function
133
132
  index_1.logger.error('Unknown error, the default browser failed to open the login page.');
134
133
  process.exit(1);
135
134
  return [3, 5];
136
- case 5:
137
- (0, hm_analytics_1.HM_Analytics)('ZEPP_CLI_LOGIN_C');
138
- return [2, loginPromise];
135
+ case 5: return [2, loginPromise];
139
136
  }
140
137
  });
141
138
  }); };
142
139
  exports.login = login;
143
140
  var logout = function () {
144
- (0, hm_analytics_1.HM_Analytics)('ZEPP_CLI_LOGOUT_C');
145
141
  index_1.globalStorage.deleteStorage('____login');
146
142
  index_1.logger.success('Logged out');
147
143
  };
@@ -99,7 +99,6 @@ var status = function (args) { return __awaiter(void 0, void 0, void 0, function
99
99
  message3 = "simulator port: ".concat(chalk_1["default"].yellow(simulatorPort));
100
100
  index_1.logger.log(message3);
101
101
  loggerMessage.push(message3);
102
- (0, index_1.HM_Analytics)('ZEPP_CLI_STATUS_C');
103
102
  return [2, loggerMessage];
104
103
  }
105
104
  });
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "empty",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "app.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "",
10
+ "license": "ISC",
11
+ "devDependencies": {
12
+ "@zeppos/device-types": "^2.0.0"
13
+ }
14
+ }
@@ -0,0 +1,28 @@
1
+ import { log as Logger } from '@zos/utils'
2
+ import LocalStorage from './utils/storage'
3
+
4
+ const logger = Logger.getLogger('calories-app')
5
+ const fileName = 'calorie_data.txt'
6
+
7
+ App({
8
+ globalData: {
9
+ foodType: 'chocolate',
10
+ localStorage: null
11
+ },
12
+ onCreate() {
13
+ try {
14
+ this.globalData.localStorage = new LocalStorage(fileName)
15
+ const { foodType = 'chocolate' } = this.globalData.localStorage.get()
16
+ this.globalData.foodType = foodType
17
+
18
+ } catch (e) {
19
+ logger.log('--->e:', e)
20
+ }
21
+ },
22
+
23
+ onDestroy() {
24
+ this.globalData.localStorage.set({
25
+ foodType: getApp()._options.globalData.foodType
26
+ })
27
+ },
28
+ })
@@ -0,0 +1,56 @@
1
+ {
2
+ "configVersion": "v2",
3
+ "app": {
4
+ "appId": 20001,
5
+ "appName": "Calories",
6
+ "appType": "app",
7
+ "version": {
8
+ "code": 1,
9
+ "name": "1.0.0"
10
+ },
11
+ "icon": "icon.png",
12
+ "vender": "zepp",
13
+ "description": "calories application"
14
+ },
15
+ "permissions": [
16
+ "data:os.device.info",
17
+ "device:os.local_storage",
18
+ "data:user.hd.calorie"
19
+ ],
20
+ "runtime": {
21
+ "apiVersion": {
22
+ "compatible": "2.0.0",
23
+ "target": "2.0.0",
24
+ "minVersion": "2.0.0"
25
+ }
26
+ },
27
+ "targets": {
28
+ "gts": {
29
+ "module": {
30
+ "page": {
31
+ "pages": [
32
+ "page/gts/index",
33
+ "page/gts/food-list"
34
+ ]
35
+ }
36
+ },
37
+ "platforms": [
38
+ {
39
+ "name": "gts4",
40
+ "deviceSource": 7995648
41
+ },
42
+ {
43
+ "name": "gts4-w",
44
+ "deviceSource": 7995649
45
+ }
46
+ ],
47
+ "designWidth": 390
48
+ }
49
+ },
50
+ "i18n": {
51
+ "en-US": {
52
+ "appName": "Calories"
53
+ }
54
+ },
55
+ "defaultLanguage": "en-US"
56
+ }