@zeppos/zeus-cli 1.2.2 → 1.3.0-beta.2

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 (228) hide show
  1. package/modules/build.js +127 -24
  2. package/modules/create.js +6 -5
  3. package/modules/run.js +13 -11
  4. package/package.json +2 -2
  5. package/private-modules/zeppos-app-utils/dist/config/device.js +30 -0
  6. package/private-modules/zeppos-app-utils/dist/modules/build.js +98 -26
  7. package/private-modules/zeppos-app-utils/dist/modules/create/index.js +12 -10
  8. package/private-modules/zeppos-app-utils/dist/modules/create/local-app.js +9 -9
  9. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/_package.json +14 -0
  10. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/app-side/i18n/en-US.po +2 -0
  11. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/app-side/index.js +13 -0
  12. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/app.js +10 -0
  13. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/app.json +59 -0
  14. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/assets/default/icon.png +0 -0
  15. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/page/i18n/en-US.po +2 -0
  16. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/page/index.js +7 -0
  17. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/setting/i18n/en-US.po +2 -0
  18. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/setting/index.js +7 -0
  19. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/watchface/index.js +13 -0
  20. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/app-side/index.js +11 -0
  21. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/app.js +10 -0
  22. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/app.json +66 -0
  23. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gtr3/icon.png +0 -0
  24. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gtr3/image/logo.png +0 -0
  25. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gtr3-pro/icon.png +0 -0
  26. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gtr3-pro/image/logo.png +0 -0
  27. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gts3/icon.png +0 -0
  28. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gts3/image/logo.png +0 -0
  29. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3/home/index.page.js +18 -0
  30. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3/home/index.page.json +1 -0
  31. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3/home/index.style.js +15 -0
  32. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3-pro/home/index.page.js +18 -0
  33. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3-pro/home/index.page.json +1 -0
  34. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3-pro/home/index.style.js +15 -0
  35. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gts3/home/index.page.js +19 -0
  36. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gts3/home/index.page.json +1 -0
  37. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gts3/home/index.style.js +15 -0
  38. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/i18n/en-US.po +3 -0
  39. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/setting/i18n/en-US.po +2 -0
  40. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/setting/index.js +5 -0
  41. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/utils/index.js +3 -0
  42. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/jsconfig.json +14 -0
  43. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/app.js +7 -0
  44. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/app.json +51 -0
  45. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bg/bg.png +0 -0
  46. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/0.png +0 -0
  47. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/1.png +0 -0
  48. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/2.png +0 -0
  49. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/3.png +0 -0
  50. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/4.png +0 -0
  51. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/5.png +0 -0
  52. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/6.png +0 -0
  53. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/7.png +0 -0
  54. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/8.png +0 -0
  55. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/9.png +0 -0
  56. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/sp.png +0 -0
  57. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/btn/back.png +0 -0
  58. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/btn/lv.png +0 -0
  59. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/btn/red.png +0 -0
  60. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/bg.png +0 -0
  61. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/bottom.png +0 -0
  62. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/center.png +0 -0
  63. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/h.png +0 -0
  64. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/left.png +0 -0
  65. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/m.png +0 -0
  66. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/right.png +0 -0
  67. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/s.png +0 -0
  68. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/preview.png +0 -0
  69. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/second/second.png +0 -0
  70. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/0.png +0 -0
  71. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/1.png +0 -0
  72. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/2.png +0 -0
  73. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/3.png +0 -0
  74. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/4.png +0 -0
  75. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/5.png +0 -0
  76. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/6.png +0 -0
  77. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/7.png +0 -0
  78. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/8.png +0 -0
  79. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/9.png +0 -0
  80. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/d.png +0 -0
  81. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/n.png +0 -0
  82. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_ch/1.png +0 -0
  83. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_ch/2.png +0 -0
  84. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_ch/3.png +0 -0
  85. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_ch/4.png +0 -0
  86. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_ch/5.png +0 -0
  87. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_ch/6.png +0 -0
  88. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_ch/7.png +0 -0
  89. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_en/1.png +0 -0
  90. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_en/2.png +0 -0
  91. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_en/3.png +0 -0
  92. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_en/4.png +0 -0
  93. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_en/5.png +0 -0
  94. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_en/6.png +0 -0
  95. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_en/7.png +0 -0
  96. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/buffer.js +11 -0
  97. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/device-polyfill.js +3 -0
  98. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/global.js +17 -0
  99. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/js-module.js +27 -0
  100. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/logger.js +21 -0
  101. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/setTimeout.js +59 -0
  102. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/watchface/gtr-3-pro/index.js +1 -0
  103. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/watchface/round/index.js +438 -0
  104. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/_package.json +14 -0
  105. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/app.js +28 -0
  106. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/app.json +51 -0
  107. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/consume.png +0 -0
  108. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/beer.png +0 -0
  109. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/cake.png +0 -0
  110. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/chocolate.png +0 -0
  111. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/coffee.png +0 -0
  112. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/cookies.png +0 -0
  113. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/ham.png +0 -0
  114. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/hamburger.png +0 -0
  115. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/ice cream.png +0 -0
  116. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/pizza.png +0 -0
  117. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/sausage.png +0 -0
  118. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/icon.png +0 -0
  119. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/multiply.png +0 -0
  120. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/selected.png +0 -0
  121. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/unselected.png +0 -0
  122. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/consume.png +0 -0
  123. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/food/beer.png +0 -0
  124. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/food/cake.png +0 -0
  125. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/food/chocolate.png +0 -0
  126. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/food/coffee.png +0 -0
  127. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/food/cookies.png +0 -0
  128. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/food/ham.png +0 -0
  129. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/food/hamburger.png +0 -0
  130. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/food/ice cream.png +0 -0
  131. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/food/pizza.png +0 -0
  132. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/food/sausage.png +0 -0
  133. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/icon.png +0 -0
  134. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/multiply.png +0 -0
  135. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/selected.png +0 -0
  136. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/unselected.png +0 -0
  137. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/page/gt/food-list.js +113 -0
  138. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/page/gt/index.js +126 -0
  139. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/page/gts/food-list.js +113 -0
  140. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/page/gts/index.js +126 -0
  141. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/page/i18n/en-US.po +42 -0
  142. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/page/i18n/zh-CN.po +42 -0
  143. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/utils/constants.js +54 -0
  144. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/utils/storage.js +42 -0
  145. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/utils/styles-gts-3.js +141 -0
  146. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/utils/styles.js +142 -0
  147. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/app-side/i18n/en-US.po +2 -0
  148. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/app-side/index.js +13 -0
  149. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/app.js +10 -0
  150. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/app.json +59 -0
  151. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/assets/default/icon.png +0 -0
  152. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/page/i18n/en-US.po +2 -0
  153. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/page/index.js +7 -0
  154. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/setting/i18n/en-US.po +2 -0
  155. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/setting/index.js +7 -0
  156. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/watchface/index.js +13 -0
  157. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/app-side/i18n/en-US.po +2 -0
  158. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/app-side/index.js +72 -0
  159. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/app.js +23 -0
  160. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/app.json +55 -0
  161. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/assets/common/icon.png +0 -0
  162. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/assets/common.r/icon.png +0 -0
  163. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/assets/common.s/icon.png +0 -0
  164. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/page/i18n/en-US.po +2 -0
  165. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/page/index.js +55 -0
  166. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/pages/i18n/en-US.po +2 -0
  167. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/pages/index.js +55 -0
  168. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/data.js +67 -0
  169. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/defer.js +35 -0
  170. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/device-polyfill.js +6 -0
  171. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/es6-promise.js +1149 -0
  172. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/event.js +42 -0
  173. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/message-side.js +1145 -0
  174. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/message.js +1151 -0
  175. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/utils/config/constants.js +2 -0
  176. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/utils/config/device.js +2 -0
  177. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/app-side/index.js +11 -0
  178. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/app.js +10 -0
  179. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/app.json +66 -0
  180. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gt.r/icon.png +0 -0
  181. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gt.r/image/logo.png +0 -0
  182. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gt.s/icon.png +0 -0
  183. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gt.s/image/logo.png +0 -0
  184. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gtr/icon.png +0 -0
  185. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gtr/image/logo.png +0 -0
  186. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gts/icon.png +0 -0
  187. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gts/image/logo.png +0 -0
  188. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gt/home/index.page.js +17 -0
  189. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gt/home/index.page.json +1 -0
  190. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gt/home/index.page.r.layout.js +28 -0
  191. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gt/home/index.page.s.layout.js +28 -0
  192. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gt/home/index.style.js +18 -0
  193. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gtr/home/index.page.js +20 -0
  194. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gtr/home/index.page.json +1 -0
  195. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gtr/home/index.style.js +18 -0
  196. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gts/home/index.page.js +21 -0
  197. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gts/home/index.page.json +1 -0
  198. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gts/home/index.style.js +17 -0
  199. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/i18n/en-US.po +3 -0
  200. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/setting/i18n/en-US.po +2 -0
  201. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/setting/index.js +5 -0
  202. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/utils/index.js +3 -0
  203. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/jsconfig.json +14 -0
  204. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/.prettierrc.js +6 -0
  205. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/app-side/index.js +48 -0
  206. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/app.js +25 -0
  207. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/app.json +70 -0
  208. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/assets/gt.s/icon.png +0 -0
  209. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/assets/gts/icon.png +0 -0
  210. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/page/home/index.page.js +155 -0
  211. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/page/home/index.page.json +1 -0
  212. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/page/home/index.style.js +93 -0
  213. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/page/i18n/en-US.po +9 -0
  214. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/setting/i18n/en-US.po +5 -0
  215. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/setting/index.js +145 -0
  216. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/data.js +67 -0
  217. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/defer.js +35 -0
  218. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/device-polyfill.js +6 -0
  219. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/es6-promise.js +1149 -0
  220. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/event.js +42 -0
  221. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/message-side.js +1145 -0
  222. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/message.js +1151 -0
  223. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/utils/constants.js +3 -0
  224. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/utils/fs.js +38 -0
  225. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/utils/index.js +38 -0
  226. package/private-modules/zeppos-app-utils/package.json +1 -1
  227. package/utils/pre-check.js +10 -21
  228. package/utils/tools.js +14 -0
package/modules/build.js CHANGED
@@ -1,4 +1,15 @@
1
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
+ };
2
13
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
14
  if (k2 === undefined) k2 = k;
4
15
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -64,14 +75,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
64
75
  exports.__esModule = true;
65
76
  exports.buildPreview = exports.buildProd = exports.chooseBuildPackages = exports.BuildMode = void 0;
66
77
  var path = __importStar(require("path"));
78
+ var fs_1 = __importDefault(require("fs"));
67
79
  var fs_extra_1 = __importDefault(require("fs-extra"));
68
80
  var lodash_1 = require("lodash");
69
81
  var dayjs_1 = __importDefault(require("dayjs"));
70
82
  var qrcode_terminal_1 = __importDefault(require("qrcode-terminal"));
71
83
  var inquirer_1 = __importDefault(require("inquirer"));
72
84
  var zeppos_app_utils_1 = require("zeppos-app-utils");
73
- var AppType = zeppos_app_utils_1.config.AppType, OSV2Devices = zeppos_app_utils_1.config.OSV2Devices;
74
- var appJsonContent = fs_extra_1["default"].readJSONSync(path.resolve('./app.json'), { throws: false });
85
+ var tools_1 = require("../utils/tools");
86
+ var AppType = zeppos_app_utils_1.config.AppType, deviceTargets = zeppos_app_utils_1.config.deviceTargets, OSV2Devices = zeppos_app_utils_1.config.OSV2Devices;
87
+ var appJsonPath = path.resolve('./app.json');
88
+ var appJsonContent = fs_extra_1["default"].readJSONSync(appJsonPath, { throws: false });
75
89
  var BuildMode;
76
90
  (function (BuildMode) {
77
91
  BuildMode["DEV"] = "development";
@@ -83,17 +97,70 @@ var isV2ApiVersion = function (appJson) {
83
97
  var minVersionArr = minVersion.split('.');
84
98
  return parseInt("0".concat(minVersionArr[0]), 10) >= 2;
85
99
  };
86
- var chooseBuildPackages = function (mode, args) {
100
+ var checkAppJson = function () {
101
+ if (!appJsonContent) {
102
+ try {
103
+ fs_1["default"].accessSync(appJsonPath, fs_1["default"].constants.R_OK);
104
+ zeppos_app_utils_1.logger.warn('Syntax error, malformed JSON in app.json file.');
105
+ }
106
+ catch (err) {
107
+ zeppos_app_utils_1.logger.warn("This command needs to be executed in the root of the project.");
108
+ }
109
+ process.exit(1);
110
+ }
111
+ };
112
+ var chooseBuildTargetsV3Config = function (mode, args) {
113
+ if (mode === void 0) { mode = 'development'; }
114
+ return __awaiter(void 0, void 0, void 0, function () {
115
+ var apiLevel, targetDevices, deviceNames, answers;
116
+ return __generator(this, function (_a) {
117
+ switch (_a.label) {
118
+ case 0:
119
+ checkAppJson();
120
+ apiLevel = (0, lodash_1.get)(appJsonContent, 'runtime.apiVersion.minVersion', '1.0.0');
121
+ targetDevices = {};
122
+ Object.values(deviceTargets).forEach(function (device) {
123
+ var _a;
124
+ var _b = device.apiLevelLimit || {}, _c = _b.min, min = _c === void 0 ? '1.0.0' : _c, _d = _b.max, max = _d === void 0 ? '99.99.99' : _d;
125
+ if ((0, tools_1.compareVersion)(min, apiLevel) >= 0 && (0, tools_1.compareVersion)(max, apiLevel) <= 0) {
126
+ Object.assign(targetDevices, (_a = {},
127
+ _a[device.deviceName] = device,
128
+ _a));
129
+ }
130
+ });
131
+ deviceNames = Object.keys(targetDevices);
132
+ if (!deviceNames.length) {
133
+ zeppos_app_utils_1.logger.error("The current project's API Level version is too high and there is no available device for debugging, please check if the version is correct.");
134
+ process.exit(1);
135
+ }
136
+ return [4, inquirer_1["default"].prompt([
137
+ {
138
+ name: 'device',
139
+ type: 'list',
140
+ message: 'Which device would you like to preview?',
141
+ choices: deviceNames
142
+ }
143
+ ])];
144
+ case 1:
145
+ answers = _a.sent();
146
+ return [2, {
147
+ sources: (0, lodash_1.get)(targetDevices, "[".concat(answers.device, "].platforms"), []).reduce(function (list, item) {
148
+ list.push(Number(item.deviceSource));
149
+ return (0, lodash_1.uniq)((0, lodash_1.compact)(list));
150
+ }, [])
151
+ }];
152
+ }
153
+ });
154
+ });
155
+ };
156
+ var chooseBuildTargetsV2Config = function (mode, args) {
87
157
  if (mode === void 0) { mode = 'development'; }
88
158
  return __awaiter(void 0, void 0, void 0, function () {
89
159
  var jsonTargets_1, unsupportedTargets_1, targets, returnRes, _a, promptTarget_1, answers;
90
160
  return __generator(this, function (_b) {
91
161
  switch (_b.label) {
92
162
  case 0:
93
- if (!appJsonContent) {
94
- zeppos_app_utils_1.logger.warn("This command needs to be executed in the root of the project.");
95
- process.exit(1);
96
- }
163
+ checkAppJson();
97
164
  if (isV2ApiVersion(appJsonContent)) {
98
165
  jsonTargets_1 = (0, lodash_1.get)(appJsonContent, 'targets', {});
99
166
  unsupportedTargets_1 = [];
@@ -167,18 +234,53 @@ var chooseBuildPackages = function (mode, args) {
167
234
  });
168
235
  });
169
236
  };
237
+ var chooseBuildPackages = function (mode, args) {
238
+ if (mode === void 0) { mode = 'development'; }
239
+ return __awaiter(void 0, void 0, void 0, function () {
240
+ var configVersion, result, _a, _b, _c, _d, _e, _f;
241
+ var _g;
242
+ return __generator(this, function (_h) {
243
+ switch (_h.label) {
244
+ case 0:
245
+ configVersion = (0, lodash_1.toLower)((0, lodash_1.get)(appJsonContent, 'configVersion'));
246
+ result = {};
247
+ if (!(configVersion === 'v3')) return [3, 3];
248
+ if (!(mode !== BuildMode.PROD)) return [3, 2];
249
+ _b = (_a = Object).assign;
250
+ _c = [result];
251
+ return [4, chooseBuildTargetsV3Config(mode, args)];
252
+ case 1:
253
+ _b.apply(_a, _c.concat([_h.sent()]));
254
+ _h.label = 2;
255
+ case 2: return [3, 5];
256
+ case 3:
257
+ _e = (_d = Object).assign;
258
+ _f = [result];
259
+ _g = {};
260
+ return [4, chooseBuildTargetsV2Config(mode, args)];
261
+ case 4:
262
+ _e.apply(_d, _f.concat([(_g.targets = _h.sent(),
263
+ _g)]));
264
+ _h.label = 5;
265
+ case 5: return [2, result];
266
+ }
267
+ });
268
+ });
269
+ };
170
270
  exports.chooseBuildPackages = chooseBuildPackages;
171
271
  var buildProd = function (args) { return __awaiter(void 0, void 0, void 0, function () {
172
- var packages, appId, buildInfo;
173
- return __generator(this, function (_a) {
174
- switch (_a.label) {
175
- case 0: return [4, (0, exports.chooseBuildPackages)(BuildMode.PROD, args)];
272
+ var _a, _b, _c, buildInfo;
273
+ return __generator(this, function (_d) {
274
+ switch (_d.label) {
275
+ case 0:
276
+ _b = (_a = Object).assign;
277
+ _c = [args];
278
+ return [4, (0, exports.chooseBuildPackages)(BuildMode.PROD, args)];
176
279
  case 1:
177
- packages = _a.sent();
178
- appId = (0, lodash_1.get)(appJsonContent, 'app.appId');
179
- return [4, zeppos_app_utils_1.modules.build(path.resolve('./'), BuildMode.PROD, args, packages, appId)];
280
+ _b.apply(_a, _c.concat([_d.sent()]));
281
+ return [4, zeppos_app_utils_1.modules.buildSupportV3Config(path.resolve('./'), BuildMode.PROD, __assign(__assign({}, args), { renameWithAppId: (0, lodash_1.get)(appJsonContent, 'app.appId') }))];
180
282
  case 2:
181
- buildInfo = _a.sent();
283
+ buildInfo = _d.sent();
182
284
  if (buildInfo) {
183
285
  (0, zeppos_app_utils_1.HM_Analytics)('ZEPP_CLI_BUILD_C', { res: '1' });
184
286
  }
@@ -191,21 +293,22 @@ var buildProd = function (args) { return __awaiter(void 0, void 0, void 0, funct
191
293
  }); };
192
294
  exports.buildProd = buildProd;
193
295
  var buildPreview = function (args, callback) { return __awaiter(void 0, void 0, void 0, function () {
194
- var _a, curCommand, curBridgeTarget, buildMode, appType, appId, packages, buildInfo;
195
- return __generator(this, function (_b) {
196
- switch (_b.label) {
296
+ var _a, curCommand, curBridgeTarget, buildMode, appType, _b, _c, _d, buildInfo;
297
+ return __generator(this, function (_e) {
298
+ switch (_e.label) {
197
299
  case 0:
198
300
  _a = args._, curCommand = _a[0], curBridgeTarget = _a[1];
199
301
  buildMode = (curBridgeTarget && curBridgeTarget === 'simulator') ? BuildMode.DEV : BuildMode.PREVIEW;
200
302
  zeppos_app_utils_1.logger.info('building...');
201
303
  appType = (0, lodash_1.get)(appJsonContent, 'app.appType');
202
- appId = (0, lodash_1.get)(appJsonContent, 'app.appId');
203
- return [4, (0, exports.chooseBuildPackages)(buildMode, args)];
304
+ _c = (_b = Object).assign;
305
+ _d = [args];
306
+ return [4, (0, exports.chooseBuildPackages)(BuildMode.PREVIEW, args)];
204
307
  case 1:
205
- packages = _b.sent();
206
- return [4, zeppos_app_utils_1.modules.build(path.resolve('./'), buildMode, args, packages, appId)];
308
+ _c.apply(_b, _d.concat([_e.sent()]));
309
+ return [4, zeppos_app_utils_1.modules.buildSupportV3Config(path.resolve('./'), buildMode, __assign(__assign({}, args), { renameWithAppId: (0, lodash_1.get)(appJsonContent, 'app.appId') }))];
207
310
  case 2:
208
- buildInfo = _b.sent();
311
+ buildInfo = _e.sent();
209
312
  zeppos_app_utils_1.logger.info('getting package...');
210
313
  return [4, zeppos_app_utils_1.modules.previewBuild(path.resolve('./'), args, "./dist/".concat(buildInfo), appType, curCommand).then(function (res) { return __awaiter(void 0, void 0, void 0, function () {
211
314
  return __generator(this, function (_a) {
@@ -234,7 +337,7 @@ var buildPreview = function (args, callback) { return __awaiter(void 0, void 0,
234
337
  zeppos_app_utils_1.logger.error('Generating preview qrcode failed, please check your network.');
235
338
  })];
236
339
  case 3:
237
- _b.sent();
340
+ _e.sent();
238
341
  return [2];
239
342
  }
240
343
  });
package/modules/create.js CHANGED
@@ -57,11 +57,11 @@ var AppType = zeppos_app_utils_1.config.AppType, deviceTargets = zeppos_app_util
57
57
  var inquirerFunc = function (args, _a) {
58
58
  var appTemplateChoices = _a.appTemplateChoices, watchfaceTemplateChoices = _a.watchfaceTemplateChoices;
59
59
  return __awaiter(void 0, void 0, void 0, function () {
60
- var _b, promptAppType, _c, promptOsVersion, _d, promptTemplate, _e, promptWithAppSide, _f, promptWithSettings, _g, promptBuildTargets;
61
- return __generator(this, function (_h) {
62
- switch (_h.label) {
60
+ var _b, promptAppType, _c, promptOsVersion, _d, promptTemplate, _e, promptWithAppSide, _f, promptWithSettings, _g, promptBuildTargets, _h, configVersion;
61
+ return __generator(this, function (_j) {
62
+ switch (_j.label) {
63
63
  case 0:
64
- _b = args.appType, promptAppType = _b === void 0 ? '' : _b, _c = args.OSVersion, promptOsVersion = _c === void 0 ? '' : _c, _d = args.template, promptTemplate = _d === void 0 ? '' : _d, _e = args.withAppSide, promptWithAppSide = _e === void 0 ? false : _e, _f = args.withSettings, promptWithSettings = _f === void 0 ? false : _f, _g = args.buildTargets, promptBuildTargets = _g === void 0 ? [] : _g;
64
+ _b = args.appType, promptAppType = _b === void 0 ? '' : _b, _c = args.OSVersion, promptOsVersion = _c === void 0 ? '' : _c, _d = args.template, promptTemplate = _d === void 0 ? '' : _d, _e = args.withAppSide, promptWithAppSide = _e === void 0 ? false : _e, _f = args.withSettings, promptWithSettings = _f === void 0 ? false : _f, _g = args.buildTargets, promptBuildTargets = _g === void 0 ? [] : _g, _h = args.configVersion, configVersion = _h === void 0 ? 'v2' : _h;
65
65
  return [4, inquirer_1["default"].prompt([
66
66
  {
67
67
  name: 'appType',
@@ -180,6 +180,7 @@ var inquirerFunc = function (args, _a) {
180
180
  args.buildTargets = (0, lodash_1.intersection)(Object.keys(deviceTargets), promptBuildTargets.split(','));
181
181
  return [3, 3];
182
182
  case 1:
183
+ if (!(configVersion !== 'v3')) return [3, 3];
183
184
  choicePlatforms_1 = [];
184
185
  switch (args.OSVersion) {
185
186
  case 'v1':
@@ -212,7 +213,7 @@ var inquirerFunc = function (args, _a) {
212
213
  }
213
214
  });
214
215
  }); })];
215
- case 1: return [2, _h.sent()];
216
+ case 1: return [2, _j.sent()];
216
217
  }
217
218
  });
218
219
  });
package/modules/run.js CHANGED
@@ -69,10 +69,10 @@ var path = __importStar(require("path"));
69
69
  var zeppos_app_utils_1 = require("zeppos-app-utils");
70
70
  var DEFAULT_HOST = zeppos_app_utils_1.config.DEFAULT_HOST, DEFAULT_PORT = zeppos_app_utils_1.config.DEFAULT_PORT, simulatorStorageKey = zeppos_app_utils_1.config.simulatorStorageKey;
71
71
  var run = function (args) { return __awaiter(void 0, void 0, void 0, function () {
72
- var simulatorHost, simulatorPort, _a, promptSimulatorHost, _b, promptSimulatorPort, answer, packages, simulatorWebSocketURL, root;
73
- var _c;
74
- return __generator(this, function (_d) {
75
- switch (_d.label) {
72
+ var simulatorHost, simulatorPort, _a, promptSimulatorHost, _b, promptSimulatorPort, answer, _c, _d, _e, simulatorWebSocketURL, root;
73
+ var _f;
74
+ return __generator(this, function (_g) {
75
+ switch (_g.label) {
76
76
  case 0:
77
77
  simulatorHost = '';
78
78
  simulatorPort = '';
@@ -108,22 +108,24 @@ var run = function (args) { return __awaiter(void 0, void 0, void 0, function ()
108
108
  }
109
109
  ])];
110
110
  case 1:
111
- answer = _d.sent();
111
+ answer = _g.sent();
112
112
  if (!simulatorHost) {
113
113
  simulatorHost = answer.host || DEFAULT_HOST;
114
114
  simulatorPort = answer.port || DEFAULT_PORT;
115
- zeppos_app_utils_1.globalStorage.set((_c = {},
116
- _c[simulatorStorageKey.simulatorHost] = answer.host || DEFAULT_HOST,
117
- _c[simulatorStorageKey.simulatorPort] = answer.port || DEFAULT_PORT,
118
- _c));
115
+ zeppos_app_utils_1.globalStorage.set((_f = {},
116
+ _f[simulatorStorageKey.simulatorHost] = answer.host || DEFAULT_HOST,
117
+ _f[simulatorStorageKey.simulatorPort] = answer.port || DEFAULT_PORT,
118
+ _f));
119
119
  }
120
120
  (0, zeppos_app_utils_1.HM_Analytics)('ZEPP_CLI_DEV_C');
121
+ _d = (_c = Object).assign;
122
+ _e = [args];
121
123
  return [4, (0, build_1.chooseBuildPackages)(build_1.BuildMode.DEV, args)];
122
124
  case 2:
123
- packages = _d.sent();
125
+ _d.apply(_c, _e.concat([_g.sent()]));
124
126
  simulatorWebSocketURL = "http://".concat(simulatorHost, ":").concat(simulatorPort);
125
127
  root = path.resolve('./');
126
- zeppos_app_utils_1.modules.runX(root, args, simulatorWebSocketURL, packages);
128
+ zeppos_app_utils_1.modules.runX(root, args, simulatorWebSocketURL);
127
129
  return [2];
128
130
  }
129
131
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeppos/zeus-cli",
3
- "version": "1.2.2",
3
+ "version": "1.3.0-beta.2",
4
4
  "description": "zeus mini-program tools",
5
5
  "main": "index.ts",
6
6
  "author": "zepp",
@@ -21,7 +21,7 @@
21
21
  "qrcode-terminal": "^0.12.0",
22
22
  "vorpal": "^1.12.0",
23
23
  "yargs": "^17.5.1",
24
- "@zeppos/zpm": "^2.6.6",
24
+ "@zeppos/zpm": "^2.9.11-beta",
25
25
  "axios": "^0.27.2",
26
26
  "chalk": "^4.1.2",
27
27
  "chokidar": "^3.5.3",
@@ -81,6 +81,10 @@ exports.deviceTargets = (_a = {},
81
81
  type: DeviceScreenType.R,
82
82
  width: 480,
83
83
  height: 480
84
+ },
85
+ apiLevelLimit: {
86
+ min: '1.0.0',
87
+ max: '1.99.99'
84
88
  }
85
89
  },
86
90
  _a[DeviceTarget.VERONA] = {
@@ -99,6 +103,10 @@ exports.deviceTargets = (_a = {},
99
103
  type: DeviceScreenType.R,
100
104
  width: 454,
101
105
  height: 454
106
+ },
107
+ apiLevelLimit: {
108
+ min: '1.0.0',
109
+ max: '1.99.99'
102
110
  }
103
111
  },
104
112
  _a[DeviceTarget.ZURICH] = {
@@ -117,6 +125,10 @@ exports.deviceTargets = (_a = {},
117
125
  type: DeviceScreenType.S,
118
126
  width: 390,
119
127
  height: 450
128
+ },
129
+ apiLevelLimit: {
130
+ min: '1.0.0',
131
+ max: '1.99.99'
120
132
  }
121
133
  },
122
134
  _a[DeviceTarget.TEIDE] = {
@@ -135,6 +147,10 @@ exports.deviceTargets = (_a = {},
135
147
  type: DeviceScreenType.R,
136
148
  width: 454,
137
149
  height: 454
150
+ },
151
+ apiLevelLimit: {
152
+ min: '1.0.0',
153
+ max: '1.99.99'
138
154
  }
139
155
  },
140
156
  _a[DeviceTarget.PROVENCE] = {
@@ -153,6 +169,10 @@ exports.deviceTargets = (_a = {},
153
169
  type: DeviceScreenType.S,
154
170
  width: 336,
155
171
  height: 384
172
+ },
173
+ apiLevelLimit: {
174
+ min: '1.0.0',
175
+ max: '1.99.99'
156
176
  }
157
177
  },
158
178
  _a[DeviceTarget.BARI] = {
@@ -175,6 +195,10 @@ exports.deviceTargets = (_a = {},
175
195
  type: DeviceScreenType.S,
176
196
  width: 194,
177
197
  height: 368
198
+ },
199
+ apiLevelLimit: {
200
+ min: '1.0.0',
201
+ max: '1.99.99'
178
202
  }
179
203
  },
180
204
  _a[DeviceTarget.BERLIN] = {
@@ -193,6 +217,9 @@ exports.deviceTargets = (_a = {},
193
217
  type: DeviceScreenType.R,
194
218
  width: 466,
195
219
  height: 466
220
+ },
221
+ apiLevelLimit: {
222
+ min: '1.0.0'
196
223
  }
197
224
  },
198
225
  _a[DeviceTarget.LILLE] = {
@@ -211,6 +238,9 @@ exports.deviceTargets = (_a = {},
211
238
  type: DeviceScreenType.S,
212
239
  width: 390,
213
240
  height: 450
241
+ },
242
+ apiLevelLimit: {
243
+ min: '1.0.0'
214
244
  }
215
245
  },
216
246
  _a);
@@ -62,7 +62,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
62
62
  return (mod && mod.__esModule) ? mod : { "default": mod };
63
63
  };
64
64
  exports.__esModule = true;
65
- exports.runX = exports.previewBuild = exports.build = exports.BuildMode = void 0;
65
+ exports.runX = exports.previewBuild = exports.build = exports.buildSupportV3Config = exports.BuildMode = void 0;
66
66
  var zpm_1 = require("@zeppos/zpm");
67
67
  var rd = __importStar(require("rd"));
68
68
  var fs_1 = __importDefault(require("fs"));
@@ -105,13 +105,86 @@ var gitignoreDefaultItem = [
105
105
  '*.njsproj',
106
106
  '*.sln',
107
107
  ];
108
+ var buildSupportV3Config = function (workspace, mode, buildConfigOption) {
109
+ if (mode === void 0) { mode = BuildMode.PROD; }
110
+ if (buildConfigOption === void 0) { buildConfigOption = {}; }
111
+ return __awaiter(void 0, void 0, void 0, function () {
112
+ var _a, targets, _b, sources, buildOptions, _c, js2c, _d, js2bin, _e, png2vg, _f, prune, _g, compress, zabName_1, distDir_1, name_1, newName_1, error_1;
113
+ return __generator(this, function (_h) {
114
+ switch (_h.label) {
115
+ case 0:
116
+ _a = buildConfigOption.targets, targets = _a === void 0 ? [] : _a, _b = buildConfigOption.sources, sources = _b === void 0 ? [] : _b;
117
+ buildOptions = {
118
+ path: workspace,
119
+ buildMode: mode,
120
+ targets: targets,
121
+ sources: sources,
122
+ jsc: TransformType.Default
123
+ };
124
+ if ([BuildMode.PROD, BuildMode.PREVIEW].includes(mode)) {
125
+ _c = buildConfigOption || {}, js2c = _c.js2c, _d = _c.js2bin, js2bin = _d === void 0 ? true : _d, _e = _c.png2vg, png2vg = _e === void 0 ? true : _e, _f = _c.prune, prune = _f === void 0 ? true : _f, _g = _c.compress, compress = _g === void 0 ? true : _g;
126
+ js2c = !!(js2c === 'true' || js2c === true);
127
+ js2bin = !!(js2bin === 'true' || js2bin === true);
128
+ png2vg = !!(png2vg === 'true' || png2vg === true);
129
+ prune = !!(prune === 'true' || prune === true);
130
+ compress = !!(compress === 'true' || compress === true);
131
+ js2c && Object.assign(buildOptions, { jsc: TransformType.C });
132
+ js2bin && Object.assign(buildOptions, { jsc: TransformType.Bin });
133
+ Object.assign(buildOptions, {
134
+ png2vg: png2vg,
135
+ prune: prune,
136
+ compress: compress
137
+ });
138
+ }
139
+ _h.label = 1;
140
+ case 1:
141
+ _h.trys.push([1, 6, , 7]);
142
+ if (targets.length) {
143
+ index_1.logger.info("Start building package, targets: ".concat(targets.join(', '), "."));
144
+ }
145
+ else if (sources.length) {
146
+ index_1.logger.info("Start building package, device sources: ".concat(sources.join(', '), "."));
147
+ }
148
+ if (!(mode === BuildMode.DEV)) return [3, 3];
149
+ return [4, (0, zpm_1.startWithoutDist)(buildOptions)];
150
+ case 2: return [2, _h.sent()];
151
+ case 3: return [4, (0, zpm_1.start)(buildOptions)];
152
+ case 4:
153
+ zabName_1 = _h.sent();
154
+ if (buildConfigOption.renameWithAppId) {
155
+ distDir_1 = path.join(workspace, 'dist');
156
+ name_1 = zabName_1.replace(/[\s]/g, '_').split('.zab');
157
+ newName_1 = "".concat(buildConfigOption.renameWithAppId, "-").concat(name_1[0], ".zab");
158
+ rd.eachFileSync(distDir_1, function (file) {
159
+ var oldName = path.join(distDir_1, zabName_1);
160
+ if (file !== oldName) {
161
+ fs_extra_1["default"].removeSync(file);
162
+ }
163
+ else {
164
+ fs_1["default"].renameSync(oldName, path.join(distDir_1, newName_1));
165
+ }
166
+ });
167
+ return [2, newName_1];
168
+ }
169
+ return [2, zabName_1];
170
+ case 5: return [3, 7];
171
+ case 6:
172
+ error_1 = _h.sent();
173
+ index_1.logger.error(error_1);
174
+ return [3, 7];
175
+ case 7: return [2];
176
+ }
177
+ });
178
+ });
179
+ };
180
+ exports.buildSupportV3Config = buildSupportV3Config;
108
181
  var build = function (workspace, mode, buildConfigOption, packages, appId) {
109
182
  if (mode === void 0) { mode = BuildMode.PROD; }
110
183
  if (appId === void 0) { appId = '10000'; }
111
184
  return __awaiter(void 0, void 0, void 0, function () {
112
- var buildOptions, _a, js2c, _b, js2bin, _c, png2vg, _d, prune, curOpt, productName_1, DistDir_1, name_1, newName_1, error_1;
113
- return __generator(this, function (_e) {
114
- switch (_e.label) {
185
+ var buildOptions, _a, js2c, _b, js2bin, _c, png2vg, _d, prune, _e, compress, curOpt, productName_1, DistDir_1, name_2, newName_2, error_2;
186
+ return __generator(this, function (_f) {
187
+ switch (_f.label) {
115
188
  case 0:
116
189
  buildOptions = {
117
190
  path: workspace,
@@ -120,54 +193,56 @@ var build = function (workspace, mode, buildConfigOption, packages, appId) {
120
193
  jsc: TransformType.Default
121
194
  };
122
195
  if (mode === BuildMode.PROD || mode === BuildMode.PREVIEW) {
123
- _a = buildConfigOption || {}, js2c = _a.js2c, _b = _a.js2bin, js2bin = _b === void 0 ? true : _b, _c = _a.png2vg, png2vg = _c === void 0 ? true : _c, _d = _a.prune, prune = _d === void 0 ? true : _d;
196
+ _a = buildConfigOption || {}, js2c = _a.js2c, _b = _a.js2bin, js2bin = _b === void 0 ? true : _b, _c = _a.png2vg, png2vg = _c === void 0 ? true : _c, _d = _a.prune, prune = _d === void 0 ? true : _d, _e = _a.compress, compress = _e === void 0 ? true : _e;
124
197
  js2c = !!(js2c === 'true' || js2c === true);
125
198
  js2bin = !!(js2bin === 'true' || js2bin === true);
126
199
  png2vg = !!(png2vg === 'true' || png2vg === true);
127
200
  prune = !!(prune === 'true' || prune === true);
201
+ compress = !!(compress === 'true' || compress === true);
128
202
  js2c && Object.assign(buildOptions, { jsc: TransformType.C });
129
203
  js2bin && Object.assign(buildOptions, { jsc: TransformType.Bin });
130
204
  Object.assign(buildOptions, {
131
205
  png2vg: png2vg,
132
- prune: prune
206
+ prune: prune,
207
+ compress: compress
133
208
  });
134
209
  }
135
- _e.label = 1;
210
+ _f.label = 1;
136
211
  case 1:
137
- _e.trys.push([1, 6, , 7]);
212
+ _f.trys.push([1, 6, , 7]);
138
213
  index_1.logger.info("Start building package, targets: ".concat(packages.join(', '), "."));
139
- curOpt = (buildConfigOption ? buildConfigOption._ : [''])[0];
214
+ curOpt = (0, lodash_1.get)(buildConfigOption, '_', [])[0];
140
215
  if (!(mode !== BuildMode.DEV ||
141
216
  (mode === BuildMode.DEV && curOpt === 'install'))) return [3, 3];
142
217
  return [4, (0, zpm_1.start)(buildOptions)];
143
218
  case 2:
144
- productName_1 = _e.sent();
219
+ productName_1 = _f.sent();
145
220
  if (productName_1) {
146
221
  DistDir_1 = path.join(workspace, 'dist');
147
- name_1 = productName_1.replace(/[\s]/g, '_').split('.zab');
148
- newName_1 = "".concat(appId, "-").concat(name_1[0], ".zab");
222
+ name_2 = productName_1.replace(/[\s]/g, '_').split('.zab');
223
+ newName_2 = "".concat(appId, "-").concat(name_2[0], ".zab");
149
224
  rd.eachFileSync(DistDir_1, function (file) {
150
225
  var oldName = path.join(DistDir_1, productName_1);
151
226
  if (file !== oldName) {
152
227
  fs_extra_1["default"].removeSync(file);
153
228
  }
154
229
  else {
155
- fs_1["default"].renameSync(oldName, path.join(DistDir_1, newName_1));
230
+ fs_1["default"].renameSync(oldName, path.join(DistDir_1, newName_2));
156
231
  }
157
232
  });
158
- productName_1 = newName_1;
233
+ productName_1 = newName_2;
159
234
  }
160
235
  return [2, productName_1];
161
236
  case 3:
162
237
  if (!(mode === BuildMode.DEV)) return [3, 5];
163
238
  return [4, (0, zpm_1.startWithoutDist)(buildOptions)];
164
239
  case 4:
165
- _e.sent();
240
+ _f.sent();
166
241
  return [2, (0, zpm_1.getZpkBuf)(packages[0])];
167
242
  case 5: return [3, 7];
168
243
  case 6:
169
- error_1 = _e.sent();
170
- index_1.logger.error(error_1);
244
+ error_2 = _f.sent();
245
+ index_1.logger.error(error_2);
171
246
  return [3, 7];
172
247
  case 7: return [2];
173
248
  }
@@ -184,7 +259,7 @@ var previewBuild = function (root, args, workspace, appType, curCommand) { retur
184
259
  form.append('file', fs_1["default"].createReadStream(workspace));
185
260
  form.append('app_type', appType === index_1.config.AppType.WATCHFACE ? '1' : '2');
186
261
  form.getLength(function (err, length) { return __awaiter(void 0, void 0, void 0, function () {
187
- var protocol, code, res, error_2, _subRegionalHost, url, _a, deviceSource, appId, appName, appType_1, deviceSourceArr, targetDeviceInternalName, packageInfo, url, preview, downloadPackageReturn;
262
+ var protocol, code, res, error_3, _subRegionalHost, url, _a, deviceSource, appId, appName, appType_1, deviceSourceArr, targetDeviceInternalName, packageInfo, url, preview, downloadPackageReturn;
188
263
  return __generator(this, function (_b) {
189
264
  switch (_b.label) {
190
265
  case 0:
@@ -204,8 +279,8 @@ var previewBuild = function (root, args, workspace, appType, curCommand) { retur
204
279
  code = res.code;
205
280
  return [3, 7];
206
281
  case 3:
207
- error_2 = _b.sent();
208
- if (!((error_2 === null || error_2 === void 0 ? void 0 : error_2.message) === '401')) return [3, 5];
282
+ error_3 = _b.sent();
283
+ if (!((error_3 === null || error_3 === void 0 ? void 0 : error_3.message) === '401')) return [3, 5];
209
284
  index_1.logger.warn("Login information is invalid. Please login again, or end this service and login again with the command 'zeus login'.");
210
285
  return [4, index_1.modules.login().then(function (res) { return __awaiter(void 0, void 0, void 0, function () {
211
286
  return __generator(this, function (_a) {
@@ -219,7 +294,7 @@ var previewBuild = function (root, args, workspace, appType, curCommand) { retur
219
294
  _b.sent();
220
295
  return [3, 6];
221
296
  case 5:
222
- index_1.logger.error(error_2 === null || error_2 === void 0 ? void 0 : error_2.message);
297
+ index_1.logger.error(error_3 === null || error_3 === void 0 ? void 0 : error_3.message);
223
298
  reject('reTry');
224
299
  return [2];
225
300
  case 6: return [3, 7];
@@ -264,7 +339,7 @@ var previewBuild = function (root, args, workspace, appType, curCommand) { retur
264
339
  });
265
340
  }); };
266
341
  exports.previewBuild = previewBuild;
267
- var runX = function (root, args, url, packages, logAfterFunc) { return __awaiter(void 0, void 0, void 0, function () {
342
+ var runX = function (root, args, url, logAfterFunc) { return __awaiter(void 0, void 0, void 0, function () {
268
343
  var logger, simulator, refreshSimulator, gitignorePath, gitignore, ignored;
269
344
  return __generator(this, function (_a) {
270
345
  logger = new index_1.MyLogger();
@@ -278,10 +353,7 @@ var runX = function (root, args, url, packages, logAfterFunc) { return __awaiter
278
353
  switch (_b.label) {
279
354
  case 0:
280
355
  logger.info('rebuilding...');
281
- if (process.env._targetDeviceToBuild && !args.target) {
282
- args.target = process.env._targetDeviceToBuild;
283
- }
284
- return [4, index_1.modules.build(root, BuildMode.DEV, args, packages)];
356
+ return [4, (0, exports.buildSupportV3Config)(root, BuildMode.DEV, args)];
285
357
  case 1:
286
358
  zpkBuffer = _b.sent();
287
359
  if (zpkBuffer) {