@zeppos/zeus-cli 1.2.2 → 1.2.4
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.
- package/bin/main.js +1 -1
- package/modules/bridge.js +1 -1
- package/modules/build.js +152 -32
- package/modules/create.js +7 -6
- package/modules/help.js +1 -1
- package/modules/run.js +14 -12
- package/package.json +2 -2
- package/private-modules/zeppos-app-utils/dist/api/index.js +1 -1
- package/private-modules/zeppos-app-utils/dist/config/device-server.js +113 -0
- package/private-modules/zeppos-app-utils/dist/config/device.js +403 -152
- package/private-modules/zeppos-app-utils/dist/modules/build.js +101 -29
- package/private-modules/zeppos-app-utils/dist/modules/config.js +1 -1
- package/private-modules/zeppos-app-utils/dist/modules/create/index.js +13 -11
- package/private-modules/zeppos-app-utils/dist/modules/create/local-app.js +10 -10
- package/private-modules/zeppos-app-utils/dist/modules/create/yeoman-app.js +1 -1
- package/private-modules/zeppos-app-utils/dist/modules/login.js +1 -1
- package/private-modules/zeppos-app-utils/dist/modules/status.js +1 -1
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/_package.json +14 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/app-side/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/app-side/index.js +13 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/app.js +10 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/app.json +59 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/assets/default/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/page/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/page/index.js +7 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/setting/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/setting/index.js +7 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/watchface/index.js +13 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/app-side/index.js +11 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/app.js +10 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/app.json +66 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gtr3/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gtr3/image/logo.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gtr3-pro/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gtr3-pro/image/logo.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gts3/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gts3/image/logo.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3/home/index.page.js +18 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3/home/index.page.json +1 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3/home/index.style.js +15 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3-pro/home/index.page.js +18 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3-pro/home/index.page.json +1 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3-pro/home/index.style.js +15 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gts3/home/index.page.js +19 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gts3/home/index.page.json +1 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gts3/home/index.style.js +15 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/i18n/en-US.po +3 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/setting/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/setting/index.js +5 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/utils/index.js +3 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/jsconfig.json +14 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/app.js +7 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/app.json +51 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bg/bg.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/0.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/1.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/2.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/3.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/4.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/5.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/6.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/7.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/8.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/9.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/sp.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/btn/back.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/btn/lv.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/btn/red.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/bg.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/bottom.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/center.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/h.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/left.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/m.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/right.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/s.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/preview.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/second/second.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/0.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/1.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/2.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/3.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/4.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/5.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/6.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/7.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/8.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/9.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/d.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/n.png +0 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/buffer.js +11 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/device-polyfill.js +3 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/global.js +17 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/js-module.js +27 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/logger.js +21 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/setTimeout.js +59 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/watchface/gtr-3-pro/index.js +1 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/watchface/round/index.js +438 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/_package.json +14 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/app.js +28 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/app.json +51 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/consume.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/beer.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/cake.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/chocolate.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/coffee.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/cookies.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/ham.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/hamburger.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/ice cream.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/pizza.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/sausage.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/multiply.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/selected.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/unselected.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/page/gt/food-list.js +113 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/page/gt/index.js +126 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/page/i18n/en-US.po +42 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/page/i18n/zh-CN.po +42 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/utils/constants.js +54 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/utils/storage.js +42 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/utils/styles-gts-3.js +141 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/utils/styles.js +142 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/app-side/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/app-side/index.js +13 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/app.js +10 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/app.json +59 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/assets/default/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/page/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/page/index.js +7 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/setting/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/setting/index.js +7 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/watchface/index.js +13 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/app-side/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/app-side/index.js +72 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/app.js +23 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/app.json +55 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/assets/common.r/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/assets/common.s/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/page/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/page/index.js +55 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/data.js +67 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/defer.js +35 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/device-polyfill.js +6 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/es6-promise.js +1149 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/event.js +42 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/message-side.js +1145 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/message.js +1151 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/utils/config/constants.js +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/utils/config/device.js +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/app-side/index.js +11 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/app.js +10 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/app.json +66 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gt.r/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gt.r/image/logo.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gt.s/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gt.s/image/logo.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gt/home/index.page.js +17 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gt/home/index.page.json +1 -0
- 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
- 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
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gt/home/index.style.js +18 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/i18n/en-US.po +3 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/setting/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/setting/index.js +5 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/utils/index.js +3 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/jsconfig.json +14 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/.prettierrc.js +6 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/app-side/index.js +48 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/app.js +25 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/app.json +70 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/assets/gt.s/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/page/home/index.page.js +155 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/page/home/index.page.json +1 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/page/home/index.style.js +93 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/page/i18n/en-US.po +9 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/setting/i18n/en-US.po +5 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/setting/index.js +145 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/data.js +67 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/defer.js +35 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/device-polyfill.js +6 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/es6-promise.js +1149 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/event.js +42 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/message-side.js +1145 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/message.js +1151 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/utils/constants.js +3 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/utils/fs.js +38 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/utils/index.js +38 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/page/index.js +2 -2
- package/private-modules/zeppos-app-utils/dist/tools/index.js +1 -1
- package/private-modules/zeppos-app-utils/dist/tools/tools.js +14 -0
- package/private-modules/zeppos-app-utils/package.json +1 -1
- package/utils/pre-check.js +11 -22
- package/utils/tools.js +14 -0
package/bin/main.js
CHANGED
|
@@ -16,7 +16,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
16
16
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
17
17
|
function step(op) {
|
|
18
18
|
if (f) throw new TypeError("Generator is already executing.");
|
|
19
|
-
while (_) try {
|
|
19
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
20
20
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
21
21
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
22
22
|
switch (op[0]) {
|
package/modules/bridge.js
CHANGED
|
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
38
|
function step(op) {
|
|
39
39
|
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
-
while (_) try {
|
|
40
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
41
41
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
42
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
43
|
switch (op[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);
|
|
@@ -37,7 +48,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
48
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
49
|
function step(op) {
|
|
39
50
|
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
-
while (_) try {
|
|
51
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
41
52
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
53
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
54
|
switch (op[0]) {
|
|
@@ -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
|
|
74
|
-
var
|
|
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,77 @@ var isV2ApiVersion = function (appJson) {
|
|
|
83
97
|
var minVersionArr = minVersion.split('.');
|
|
84
98
|
return parseInt("0".concat(minVersionArr[0]), 10) >= 2;
|
|
85
99
|
};
|
|
86
|
-
var
|
|
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, platforms, usefulScreenTypes, usefulDeviceSource, 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
|
+
platforms = Object.values((0, lodash_1.get)(appJsonContent, 'targets', {})).reduce(function (list, item) {
|
|
122
|
+
return list.concat((0, lodash_1.get)(item, 'platforms', []));
|
|
123
|
+
}, []);
|
|
124
|
+
usefulScreenTypes = (0, lodash_1.compact)(Object.keys((0, lodash_1.groupBy)(platforms, 'st')));
|
|
125
|
+
usefulDeviceSource = (0, lodash_1.compact)(Object.keys((0, lodash_1.groupBy)(platforms, 'deviceSource')));
|
|
126
|
+
targetDevices = {};
|
|
127
|
+
Object.values(deviceTargets).forEach(function (device) {
|
|
128
|
+
var _a;
|
|
129
|
+
var _b = device.apiLevelLimit || {}, min = _b.min, max = _b.max;
|
|
130
|
+
if (usefulScreenTypes.includes((0, lodash_1.get)(device, 'screen.type', '')) || (0, lodash_1.find)(device.platforms, function (o) { return usefulDeviceSource.includes("".concat(o.deviceSource)); })) {
|
|
131
|
+
if ((0, tools_1.compareVersion)(min || '1.0.0', apiLevel) >= 0 && (0, tools_1.compareVersion)(max || '99.99.99', apiLevel) < 0) {
|
|
132
|
+
Object.assign(targetDevices, (_a = {},
|
|
133
|
+
_a[device.deviceName] = device,
|
|
134
|
+
_a));
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
deviceNames = Object.keys(targetDevices);
|
|
139
|
+
if (!deviceNames.length) {
|
|
140
|
+
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.");
|
|
141
|
+
process.exit(1);
|
|
142
|
+
}
|
|
143
|
+
return [4, inquirer_1["default"].prompt([
|
|
144
|
+
{
|
|
145
|
+
name: 'device',
|
|
146
|
+
type: 'list',
|
|
147
|
+
message: 'Which device would you like to preview?',
|
|
148
|
+
choices: deviceNames
|
|
149
|
+
},
|
|
150
|
+
])];
|
|
151
|
+
case 1:
|
|
152
|
+
answers = _a.sent();
|
|
153
|
+
return [2, {
|
|
154
|
+
sources: (0, lodash_1.get)(targetDevices, "[".concat(answers.device, "].platforms"), []).reduce(function (list, item) {
|
|
155
|
+
list.push(Number(item.deviceSource));
|
|
156
|
+
return (0, lodash_1.uniq)((0, lodash_1.compact)(list));
|
|
157
|
+
}, [])
|
|
158
|
+
}];
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
var chooseBuildTargetsV2Config = function (mode, args) {
|
|
87
164
|
if (mode === void 0) { mode = 'development'; }
|
|
88
165
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
89
166
|
var jsonTargets_1, unsupportedTargets_1, targets, returnRes, _a, promptTarget_1, answers;
|
|
90
167
|
return __generator(this, function (_b) {
|
|
91
168
|
switch (_b.label) {
|
|
92
169
|
case 0:
|
|
93
|
-
|
|
94
|
-
zeppos_app_utils_1.logger.warn("This command needs to be executed in the root of the project.");
|
|
95
|
-
process.exit(1);
|
|
96
|
-
}
|
|
170
|
+
checkAppJson();
|
|
97
171
|
if (isV2ApiVersion(appJsonContent)) {
|
|
98
172
|
jsonTargets_1 = (0, lodash_1.get)(appJsonContent, 'targets', {});
|
|
99
173
|
unsupportedTargets_1 = [];
|
|
@@ -106,7 +180,8 @@ var chooseBuildPackages = function (mode, args) {
|
|
|
106
180
|
unsupportedTargets_1.push(target);
|
|
107
181
|
}
|
|
108
182
|
});
|
|
109
|
-
unsupportedTargets_1.length &&
|
|
183
|
+
unsupportedTargets_1.length &&
|
|
184
|
+
zeppos_app_utils_1.logger.warn("Unsupported targets(".concat(unsupportedTargets_1.join(', '), ") have been removed."));
|
|
110
185
|
}
|
|
111
186
|
targets = Object.keys((0, lodash_1.get)(appJsonContent, 'targets', {}));
|
|
112
187
|
returnRes = [];
|
|
@@ -139,7 +214,9 @@ var chooseBuildPackages = function (mode, args) {
|
|
|
139
214
|
name: 'target',
|
|
140
215
|
type: 'checkbox',
|
|
141
216
|
when: function (args) {
|
|
142
|
-
var arr = typeof promptTarget_1 === 'string'
|
|
217
|
+
var arr = typeof promptTarget_1 === 'string'
|
|
218
|
+
? (0, lodash_1.intersection)(targets, promptTarget_1.split(','))
|
|
219
|
+
: [];
|
|
143
220
|
var bool = !!arr.length;
|
|
144
221
|
if (bool) {
|
|
145
222
|
args.target = arr;
|
|
@@ -152,11 +229,12 @@ var chooseBuildPackages = function (mode, args) {
|
|
|
152
229
|
checked: true
|
|
153
230
|
}); }),
|
|
154
231
|
message: 'Which targets would you like to build?'
|
|
155
|
-
}
|
|
232
|
+
},
|
|
156
233
|
])];
|
|
157
234
|
case 3:
|
|
158
235
|
answers = _b.sent();
|
|
159
|
-
returnRes =
|
|
236
|
+
returnRes =
|
|
237
|
+
typeof answers.target === 'string' ? [answers.target] : answers.target;
|
|
160
238
|
_b.label = 4;
|
|
161
239
|
case 4:
|
|
162
240
|
if (!process.env._targetDeviceToBuild) {
|
|
@@ -167,18 +245,53 @@ var chooseBuildPackages = function (mode, args) {
|
|
|
167
245
|
});
|
|
168
246
|
});
|
|
169
247
|
};
|
|
248
|
+
var chooseBuildPackages = function (mode, args) {
|
|
249
|
+
if (mode === void 0) { mode = 'development'; }
|
|
250
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
251
|
+
var configVersion, result, _a, _b, _c, _d, _e, _f;
|
|
252
|
+
var _g;
|
|
253
|
+
return __generator(this, function (_h) {
|
|
254
|
+
switch (_h.label) {
|
|
255
|
+
case 0:
|
|
256
|
+
configVersion = (0, lodash_1.toLower)((0, lodash_1.get)(appJsonContent, 'configVersion'));
|
|
257
|
+
result = {};
|
|
258
|
+
if (!(configVersion === 'v3')) return [3, 3];
|
|
259
|
+
if (!(mode !== BuildMode.PROD)) return [3, 2];
|
|
260
|
+
_b = (_a = Object).assign;
|
|
261
|
+
_c = [result];
|
|
262
|
+
return [4, chooseBuildTargetsV3Config(mode, args)];
|
|
263
|
+
case 1:
|
|
264
|
+
_b.apply(_a, _c.concat([_h.sent()]));
|
|
265
|
+
_h.label = 2;
|
|
266
|
+
case 2: return [3, 5];
|
|
267
|
+
case 3:
|
|
268
|
+
_e = (_d = Object).assign;
|
|
269
|
+
_f = [result];
|
|
270
|
+
_g = {};
|
|
271
|
+
return [4, chooseBuildTargetsV2Config(mode, args)];
|
|
272
|
+
case 4:
|
|
273
|
+
_e.apply(_d, _f.concat([(_g.targets = _h.sent(),
|
|
274
|
+
_g)]));
|
|
275
|
+
_h.label = 5;
|
|
276
|
+
case 5: return [2, result];
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
};
|
|
170
281
|
exports.chooseBuildPackages = chooseBuildPackages;
|
|
171
282
|
var buildProd = function (args) { return __awaiter(void 0, void 0, void 0, function () {
|
|
172
|
-
var
|
|
173
|
-
return __generator(this, function (
|
|
174
|
-
switch (
|
|
175
|
-
case 0:
|
|
283
|
+
var _a, _b, _c, buildInfo;
|
|
284
|
+
return __generator(this, function (_d) {
|
|
285
|
+
switch (_d.label) {
|
|
286
|
+
case 0:
|
|
287
|
+
_b = (_a = Object).assign;
|
|
288
|
+
_c = [args];
|
|
289
|
+
return [4, (0, exports.chooseBuildPackages)(BuildMode.PROD, args)];
|
|
176
290
|
case 1:
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
return [4, zeppos_app_utils_1.modules.build(path.resolve('./'), BuildMode.PROD, args, packages, appId)];
|
|
291
|
+
_b.apply(_a, _c.concat([_d.sent()]));
|
|
292
|
+
return [4, zeppos_app_utils_1.modules.buildSupportV3Config(path.resolve('./'), BuildMode.PROD, __assign(__assign({}, args), { renameWithAppId: (0, lodash_1.get)(appJsonContent, 'app.appId') }))];
|
|
180
293
|
case 2:
|
|
181
|
-
buildInfo =
|
|
294
|
+
buildInfo = _d.sent();
|
|
182
295
|
if (buildInfo) {
|
|
183
296
|
(0, zeppos_app_utils_1.HM_Analytics)('ZEPP_CLI_BUILD_C', { res: '1' });
|
|
184
297
|
}
|
|
@@ -191,30 +304,37 @@ var buildProd = function (args) { return __awaiter(void 0, void 0, void 0, funct
|
|
|
191
304
|
}); };
|
|
192
305
|
exports.buildProd = buildProd;
|
|
193
306
|
var buildPreview = function (args, callback) { return __awaiter(void 0, void 0, void 0, function () {
|
|
194
|
-
var _a, curCommand, curBridgeTarget, buildMode, appType,
|
|
195
|
-
return __generator(this, function (
|
|
196
|
-
switch (
|
|
307
|
+
var _a, curCommand, curBridgeTarget, buildMode, appType, _b, _c, _d, buildInfo;
|
|
308
|
+
return __generator(this, function (_e) {
|
|
309
|
+
switch (_e.label) {
|
|
197
310
|
case 0:
|
|
198
311
|
_a = args._, curCommand = _a[0], curBridgeTarget = _a[1];
|
|
199
|
-
buildMode =
|
|
312
|
+
buildMode = curBridgeTarget && curBridgeTarget === 'simulator'
|
|
313
|
+
? BuildMode.DEV
|
|
314
|
+
: BuildMode.PREVIEW;
|
|
200
315
|
zeppos_app_utils_1.logger.info('building...');
|
|
201
316
|
appType = (0, lodash_1.get)(appJsonContent, 'app.appType');
|
|
202
|
-
|
|
203
|
-
|
|
317
|
+
_c = (_b = Object).assign;
|
|
318
|
+
_d = [args];
|
|
319
|
+
return [4, (0, exports.chooseBuildPackages)(BuildMode.PREVIEW, args)];
|
|
204
320
|
case 1:
|
|
205
|
-
|
|
206
|
-
return [4, zeppos_app_utils_1.modules.
|
|
321
|
+
_c.apply(_b, _d.concat([_e.sent()]));
|
|
322
|
+
return [4, zeppos_app_utils_1.modules.buildSupportV3Config(path.resolve('./'), buildMode, __assign(__assign({}, args), { renameWithAppId: (0, lodash_1.get)(appJsonContent, 'app.appId') }))];
|
|
207
323
|
case 2:
|
|
208
|
-
buildInfo =
|
|
324
|
+
buildInfo = _e.sent();
|
|
209
325
|
zeppos_app_utils_1.logger.info('getting package...');
|
|
210
|
-
return [4, zeppos_app_utils_1.modules
|
|
326
|
+
return [4, zeppos_app_utils_1.modules
|
|
327
|
+
.previewBuild(path.resolve('./'), args, "./dist/".concat(buildInfo), appType, curCommand)
|
|
328
|
+
.then(function (res) { return __awaiter(void 0, void 0, void 0, function () {
|
|
211
329
|
return __generator(this, function (_a) {
|
|
212
330
|
switch (_a.label) {
|
|
213
331
|
case 0:
|
|
214
332
|
if (!(res.type === 'preview')) return [3, 1];
|
|
215
333
|
zeppos_app_utils_1.logger.info('Generating preview QR code...');
|
|
216
334
|
zeppos_app_utils_1.logger.success("Please use Zepp APP to scan the following QR code to preview your ".concat(appType === AppType.WATCHFACE ? 'WatchFace' : 'application', "."));
|
|
217
|
-
zeppos_app_utils_1.logger.success("The QR code will expire on ".concat((0, dayjs_1["default"])()
|
|
335
|
+
zeppos_app_utils_1.logger.success("The QR code will expire on ".concat((0, dayjs_1["default"])()
|
|
336
|
+
.add(2, 'hour')
|
|
337
|
+
.format('YYYY-MM-DD HH:mm:ss'), "."));
|
|
218
338
|
qrcode_terminal_1["default"].generate(res.url, { small: true });
|
|
219
339
|
callback && callback(res);
|
|
220
340
|
return [3, 4];
|
|
@@ -234,7 +354,7 @@ var buildPreview = function (args, callback) { return __awaiter(void 0, void 0,
|
|
|
234
354
|
zeppos_app_utils_1.logger.error('Generating preview qrcode failed, please check your network.');
|
|
235
355
|
})];
|
|
236
356
|
case 3:
|
|
237
|
-
|
|
357
|
+
_e.sent();
|
|
238
358
|
return [2];
|
|
239
359
|
}
|
|
240
360
|
});
|
package/modules/create.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -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 (
|
|
62
|
-
switch (
|
|
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,
|
|
216
|
+
case 1: return [2, _j.sent()];
|
|
216
217
|
}
|
|
217
218
|
});
|
|
218
219
|
});
|
package/modules/help.js
CHANGED
|
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
38
|
function step(op) {
|
|
39
39
|
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
-
while (_) try {
|
|
40
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
41
41
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
42
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
43
|
switch (op[0]) {
|
package/modules/run.js
CHANGED
|
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
38
|
function step(op) {
|
|
39
39
|
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
-
while (_) try {
|
|
40
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
41
41
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
42
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
43
|
switch (op[0]) {
|
|
@@ -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,
|
|
73
|
-
var
|
|
74
|
-
return __generator(this, function (
|
|
75
|
-
switch (
|
|
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 =
|
|
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((
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
|
|
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
|
|
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.
|
|
3
|
+
"version": "1.2.4",
|
|
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": "^
|
|
24
|
+
"@zeppos/zpm": "^3.0.0",
|
|
25
25
|
"axios": "^0.27.2",
|
|
26
26
|
"chalk": "^4.1.2",
|
|
27
27
|
"chokidar": "^3.5.3",
|
|
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
25
25
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
26
|
function step(op) {
|
|
27
27
|
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
29
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
30
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
31
|
switch (op[0]) {
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
exports.__esModule = true;
|
|
29
|
+
exports.DeviceScreenType = void 0;
|
|
30
|
+
var axios_1 = __importDefault(require("axios"));
|
|
31
|
+
var os = __importStar(require("os"));
|
|
32
|
+
var path = __importStar(require("path"));
|
|
33
|
+
var fs = __importStar(require("fs"));
|
|
34
|
+
var fs_extra_1 = __importDefault(require("fs-extra"));
|
|
35
|
+
var lodash_1 = require("lodash");
|
|
36
|
+
var LOCAL_CACHE_DEVICE_PATH = path.resolve(os.homedir(), ".zepp/.zeus_device");
|
|
37
|
+
var serverPath = 'https://upload-cdn.zepp.com/zeppos/devkit/zeus/devices.json';
|
|
38
|
+
var DeviceScreenType;
|
|
39
|
+
(function (DeviceScreenType) {
|
|
40
|
+
DeviceScreenType["R"] = "r";
|
|
41
|
+
DeviceScreenType["S"] = "s";
|
|
42
|
+
DeviceScreenType["B"] = "b";
|
|
43
|
+
})(DeviceScreenType = exports.DeviceScreenType || (exports.DeviceScreenType = {}));
|
|
44
|
+
var shapeMap = {
|
|
45
|
+
square: DeviceScreenType.S,
|
|
46
|
+
round: DeviceScreenType.R,
|
|
47
|
+
bar: DeviceScreenType.B
|
|
48
|
+
};
|
|
49
|
+
var localContent = {};
|
|
50
|
+
if (fs.existsSync(LOCAL_CACHE_DEVICE_PATH)) {
|
|
51
|
+
try {
|
|
52
|
+
localContent = fs_extra_1["default"].readJsonSync(LOCAL_CACHE_DEVICE_PATH);
|
|
53
|
+
}
|
|
54
|
+
catch (_e) { }
|
|
55
|
+
}
|
|
56
|
+
var now = Date.now().valueOf();
|
|
57
|
+
if (!((0, lodash_1.get)(localContent, 'expiredTime') > now)) {
|
|
58
|
+
axios_1["default"].get(serverPath).then(function (res) {
|
|
59
|
+
if (res.status === 200) {
|
|
60
|
+
var data = res.data;
|
|
61
|
+
if (!(0, lodash_1.isEmpty)(data)) {
|
|
62
|
+
fs_extra_1["default"].writeJsonSync(LOCAL_CACHE_DEVICE_PATH, {
|
|
63
|
+
devices: data,
|
|
64
|
+
expiredTime: now + 24 * 60 * 60 * 1000
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
var deviceList = (0, lodash_1.get)(localContent, 'devices', []);
|
|
71
|
+
var deviceGroup = (0, lodash_1.groupBy)(deviceList, 'productName');
|
|
72
|
+
var deviceInfo = {};
|
|
73
|
+
Object.values(deviceGroup).forEach(function (devices) {
|
|
74
|
+
var _a;
|
|
75
|
+
var info = {
|
|
76
|
+
deviceName: '',
|
|
77
|
+
platforms: [],
|
|
78
|
+
screen: {
|
|
79
|
+
type: DeviceScreenType.R,
|
|
80
|
+
width: 0,
|
|
81
|
+
height: 0
|
|
82
|
+
},
|
|
83
|
+
apiLevelLimit: {
|
|
84
|
+
min: '1.0.0'
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
var deviceInnerName = devices.reduce(function (acc, cur) {
|
|
88
|
+
!info.deviceName && (info.deviceName = cur.productName);
|
|
89
|
+
var screenType = (0, lodash_1.get)(shapeMap, (0, lodash_1.get)(cur, 'value.shape'));
|
|
90
|
+
var _a = (0, lodash_1.get)(cur, 'value.screen.size', '').split('*'), width = _a[0], height = _a[1];
|
|
91
|
+
if (screenType) {
|
|
92
|
+
info.screen.type = screenType;
|
|
93
|
+
}
|
|
94
|
+
if (width && height) {
|
|
95
|
+
info.screen.width = Number(width);
|
|
96
|
+
info.screen.height = Number(height);
|
|
97
|
+
}
|
|
98
|
+
info.platforms.push({
|
|
99
|
+
name: cur.code,
|
|
100
|
+
deviceSource: cur.deviceSource
|
|
101
|
+
});
|
|
102
|
+
Object.assign(info.apiLevelLimit, {
|
|
103
|
+
min: (0, lodash_1.get)(cur, 'value.os.apiLevelLimitMin', '1.0.0'),
|
|
104
|
+
max: (0, lodash_1.get)(cur, 'value.os.apiLevelLimitMax', '')
|
|
105
|
+
});
|
|
106
|
+
return cur.code.length < acc.length ? cur.code : acc;
|
|
107
|
+
}, devices[0].code);
|
|
108
|
+
var lowerName = (0, lodash_1.toLower)(deviceInnerName.replace(/[^a-zA-Z]/g, ''));
|
|
109
|
+
lowerName && Object.assign(deviceInfo, (_a = {},
|
|
110
|
+
_a[lowerName] = info,
|
|
111
|
+
_a));
|
|
112
|
+
});
|
|
113
|
+
exports["default"] = deviceInfo;
|