@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
@@ -0,0 +1,13 @@
1
+ import { gettext } from 'i18n'
2
+
3
+ AppSideService({
4
+ onInit() {
5
+ console.log(gettext('example'))
6
+ },
7
+
8
+ onRun() {
9
+ },
10
+
11
+ onDestroy() {
12
+ }
13
+ })
@@ -0,0 +1,10 @@
1
+ App({
2
+ globalData: {},
3
+ onCreate(options) {
4
+ console.log('app on create invoke')
5
+ },
6
+
7
+ onDestroy(options) {
8
+ console.log('app on destroy invoke')
9
+ }
10
+ })
@@ -0,0 +1,60 @@
1
+ {
2
+ "configVersion": "v2",
3
+ "app": {
4
+ "appId": 20000,
5
+ "appName": "Empty",
6
+ "appType": "app",
7
+ "version": {
8
+ "code": 1,
9
+ "name": "1.0.0"
10
+ },
11
+ "icon": "icon.png",
12
+ "vender": "zepp",
13
+ "description": "empty 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
+ "default": {
29
+ "module": {
30
+ "page": {
31
+ "pages": [
32
+ "page/index"
33
+ ]
34
+ },
35
+ "app-side": {
36
+ "path": "app-side/index"
37
+ },
38
+ "setting": {
39
+ "path": "setting/index"
40
+ }
41
+ },
42
+ "platforms": [{
43
+ "name": "gtr3-pro",
44
+ "deviceSource": 229
45
+ },
46
+ {
47
+ "name": "gtr3-pro-w",
48
+ "deviceSource": 230
49
+ }
50
+ ],
51
+ "designWidth": 480
52
+ }
53
+ },
54
+ "i18n": {
55
+ "en-US": {
56
+ "appName": "Empty"
57
+ }
58
+ },
59
+ "defaultLanguage": "en-US"
60
+ }
@@ -0,0 +1,2 @@
1
+ msgid "example"
2
+ msgstr "This is an example in device"
@@ -0,0 +1,7 @@
1
+ import { gettext } from 'i18n'
2
+
3
+ Page({
4
+ build() {
5
+ console.log(gettext('example'))
6
+ }
7
+ })
@@ -0,0 +1,2 @@
1
+ msgid "example"
2
+ msgstr "This is an example in app-side"
@@ -0,0 +1,7 @@
1
+ import { gettext } from 'i18n'
2
+
3
+ AppSettingsPage({
4
+ build() {
5
+ console.log(gettext('example'))
6
+ }
7
+ })
@@ -0,0 +1,13 @@
1
+ WatchFace({
2
+ onInit() {
3
+ console.log('index page.js on init invoke')
4
+ },
5
+
6
+ build() {
7
+ console.log('index page.js on build invoke')
8
+ },
9
+
10
+ onDestroy() {
11
+ console.log('index page.js on destroy invoke')
12
+ },
13
+ })
@@ -0,0 +1,2 @@
1
+ msgid "example"
2
+ msgstr "This is an example in app-side"
@@ -0,0 +1,57 @@
1
+ import { MessageBuilder } from '../shared/message-side'
2
+
3
+ const messageBuilder = new MessageBuilder()
4
+
5
+ // Simulating an asynchronous network request using Promise
6
+ const mockAPI = async () => {
7
+ return new Promise((resolve, reject) => {
8
+ setTimeout(() => {
9
+ resolve({
10
+ body: {
11
+ data: {
12
+ text: 'HELLO ZEPPOS'
13
+ }
14
+ }
15
+ })
16
+ }, 1000)
17
+ })
18
+ }
19
+
20
+ const fetchData = async (ctx) => {
21
+ try {
22
+ // Requesting network data using the fetch API
23
+ // The sample program is for simulation only and does not request real network data, so it is commented here
24
+ // const { body: { data = {} } = {} } = await fetch('https://xxx.com/api/xxx')
25
+
26
+ // A network request is simulated here
27
+ const { body: { data = {} } = {} } = await mockAPI()
28
+
29
+ ctx.response({
30
+ data: { result: data },
31
+ })
32
+
33
+ } catch (error) {
34
+ ctx.response({
35
+ data: { result: 'ERROR' },
36
+ })
37
+ }
38
+ }
39
+
40
+ AppSideService({
41
+ onInit() {
42
+ messageBuilder.listen(() => {})
43
+
44
+ messageBuilder.on('request', (ctx) => {
45
+ const jsonRpc = messageBuilder.buf2Json(ctx.request.payload)
46
+ if (jsonRpc.method === 'GET_DATA') {
47
+ return fetchData(ctx)
48
+ }
49
+ })
50
+ },
51
+
52
+ onRun() {
53
+ },
54
+
55
+ onDestroy() {
56
+ }
57
+ })
@@ -0,0 +1,23 @@
1
+ import './shared/device-polyfill'
2
+ import { MessageBuilder } from './shared/message'
3
+ import { getPackageInfo } from '@zos/app'
4
+ import * as ble from '@zos/ble'
5
+
6
+
7
+ App({
8
+ globalData: {
9
+ messageBuilder: null,
10
+ },
11
+ onCreate(options) {
12
+ console.log('app on create invoke')
13
+ const { appId } = getPackageInfo()
14
+ const messageBuilder = new MessageBuilder({ appId, appDevicePort: 20, appSidePort: 0, ble })
15
+ this.globalData.messageBuilder = messageBuilder
16
+ messageBuilder.connect()
17
+ },
18
+
19
+ onDestroy(options) {
20
+ console.log('app on destroy invoke')
21
+ this.globalData.messageBuilder && this.globalData.messageBuilder.disConnect()
22
+ }
23
+ })
@@ -0,0 +1,65 @@
1
+ {
2
+ "configVersion": "v2",
3
+ "app": {
4
+ "appId": 20001,
5
+ "appName": "Fetch API",
6
+ "appType": "app",
7
+ "version": {
8
+ "code": 1,
9
+ "name": "1.0.1"
10
+ },
11
+ "icon": "icon.png",
12
+ "vender": "zepp",
13
+ "description": "A sample application to demonstrate the fetch API"
14
+ },
15
+ "permissions": [
16
+ "data:os.device.info",
17
+ "device:os.local_storage"
18
+ ],
19
+ "runtime": {
20
+ "apiVersion": {
21
+ "compatible": "2.0.0",
22
+ "target": "2.0.0",
23
+ "minVersion": "2.0.0"
24
+ }
25
+ },
26
+ "targets": {
27
+ "common": {
28
+ "module": {
29
+ "page": {
30
+ "pages": [
31
+ "pages/index"
32
+ ]
33
+ },
34
+ "app-side": {
35
+ "path": "app-side/index"
36
+ }
37
+ },
38
+ "platforms": [
39
+ {
40
+ "name": "gtr4",
41
+ "deviceSource": 7930112
42
+ },
43
+ {
44
+ "name": "gtr4-w",
45
+ "deviceSource": 7930113
46
+ },
47
+ {
48
+ "name": "gts4",
49
+ "deviceSource": 7995648
50
+ },
51
+ {
52
+ "name": "gts4-w",
53
+ "deviceSource": 7995649
54
+ }
55
+ ],
56
+ "designWidth": 480
57
+ }
58
+ },
59
+ "i18n": {
60
+ "en-US": {
61
+ "appName": "Fetch API"
62
+ }
63
+ },
64
+ "defaultLanguage": "en-US"
65
+ }
@@ -0,0 +1,2 @@
1
+ msgid "example"
2
+ msgstr "This is an example in device"
@@ -0,0 +1,55 @@
1
+ import * as hmUI from '@zos/ui'
2
+ import { log as Logger, px } from '@zos/utils'
3
+ import {
4
+ DEFAULT_COLOR,
5
+ DEFAULT_COLOR_TRANSPARENT,
6
+ } from "../utils/config/constants"
7
+ import { DEVICE_WIDTH } from "../utils/config/device"
8
+
9
+ const logger = Logger.getLogger("fetch_api")
10
+ const { messageBuilder } = getApp()._options.globalData
11
+
12
+ Page({
13
+ state: {},
14
+ build() {
15
+ hmUI.createWidget(hmUI.widget.BUTTON, {
16
+ x: (DEVICE_WIDTH - px(400)) / 2,
17
+ y: px(260),
18
+ w: px(400),
19
+ h: px(100),
20
+ text_size: px(36),
21
+ radius: px(12),
22
+ normal_color: DEFAULT_COLOR,
23
+ press_color: DEFAULT_COLOR_TRANSPARENT,
24
+ text: "Fetch Data",
25
+ click_func: (button_widget) => {
26
+ logger.log("click button")
27
+ this.fetchData()
28
+ },
29
+ })
30
+ },
31
+ fetchData() {
32
+ messageBuilder.request({
33
+ method: "GET_DATA",
34
+ })
35
+ .then(data => {
36
+ logger.log('receive data')
37
+ const { result = {} } = data
38
+ const { text } = result
39
+
40
+ hmUI.createWidget(hmUI.widget.TEXT, {
41
+ x: px(96),
42
+ y: px(100),
43
+ w: px(288),
44
+ h: px(46),
45
+ color: 0xffffff,
46
+ text_size: px(36),
47
+ align_h: hmUI.align.CENTER_H,
48
+ align_v: hmUI.align.CENTER_V,
49
+ text_style: hmUI.text_style.NONE,
50
+ text
51
+ })
52
+ }).catch(res => {
53
+ })
54
+ },
55
+ })
@@ -0,0 +1,67 @@
1
+ export function json2buf(json) {
2
+ return str2buf(json2str(json))
3
+ }
4
+
5
+ export function json2bin(json) {
6
+ return str2bin(json2str(json))
7
+ }
8
+
9
+ export function len(binOrBuf) {
10
+ return binOrBuf.byteLength
11
+ }
12
+
13
+ export function buf2json(buf) {
14
+ return str2json(buf2str(buf))
15
+ }
16
+
17
+ export function str2json(str) {
18
+ return JSON.parse(str)
19
+ }
20
+
21
+ export function json2str(json) {
22
+ return JSON.stringify(json)
23
+ }
24
+
25
+ export function str2buf(str) {
26
+ return Buffer.from(str, 'utf-8')
27
+ }
28
+
29
+ export function buf2str(buf) {
30
+ return buf.toString('utf-8')
31
+ }
32
+
33
+ export function bin2buf(bin) {
34
+ return Buffer.from(bin)
35
+ }
36
+
37
+ export function buf2bin(buf) {
38
+ return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength)
39
+ }
40
+
41
+ export function buf2hex(buf) {
42
+ return buf.toString('hex')
43
+ }
44
+
45
+ export function bin2hex(bin) {
46
+ return buf2hex(bin2buf(bin))
47
+ }
48
+
49
+ export function bin2json(bin) {
50
+ return buf2json(bin2buf(bin))
51
+ }
52
+
53
+ export function bin2str(bin) {
54
+ return buf2str(bin2buf(bin))
55
+ }
56
+
57
+ export function str2bin(str) {
58
+ return buf2bin(str2buf(str))
59
+ }
60
+
61
+ export function allocOfBin(size = 0) {
62
+ return Buffer.alloc(size).buffer
63
+ }
64
+
65
+ export function allocOfBuf(size = 0) {
66
+ return Buffer.alloc(size)
67
+ }
@@ -0,0 +1,35 @@
1
+ export function Deferred() {
2
+ const defer = {}
3
+
4
+ defer.promise = new Promise(function (resolve, reject) {
5
+ defer.resolve = resolve
6
+ defer.reject = reject
7
+ })
8
+
9
+ return defer
10
+ }
11
+
12
+ export function delay(ms) {
13
+ const defer = Deferred()
14
+
15
+ setTimeout(defer.resolve, ms)
16
+
17
+ return defer.promise
18
+ }
19
+
20
+ export function timeout(ms, cb) {
21
+ const defer = Deferred()
22
+ ms = ms || 1000
23
+
24
+ const wait = setTimeout(() => {
25
+ clearTimeout(wait)
26
+
27
+ if (cb) {
28
+ cb && cb(defer.resolve, defer.reject)
29
+ } else {
30
+ defer.reject('Timed out in ' + ms + 'ms.')
31
+ }
32
+ }, ms)
33
+
34
+ return defer.promise
35
+ }
@@ -0,0 +1,6 @@
1
+ import './es6-promise'
2
+ ES6Promise.polyfill()
3
+
4
+ Promise._setScheduler(function (flush) {
5
+ flush && flush()
6
+ })