@zeppos/zeus-cli 1.1.8 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/{cli.js → main.js} +11 -7
- package/bin/post-command.js +3 -5
- package/index.js +0 -3
- package/modules/bridge.js +18 -21
- package/modules/build.js +86 -215
- package/modules/create.js +244 -0
- package/modules/help.js +16 -16
- package/modules/run.js +23 -83
- package/package.json +41 -51
- package/{api → private-modules/zeppos-app-utils/dist/api}/index.js +64 -98
- package/private-modules/zeppos-app-utils/dist/config/device.js +247 -0
- package/private-modules/zeppos-app-utils/dist/config/index.js +18 -0
- package/private-modules/zeppos-app-utils/dist/config/project.js +104 -0
- package/{utils → private-modules/zeppos-app-utils/dist}/hm-analytics.js +6 -6
- package/private-modules/zeppos-app-utils/dist/index.js +38 -0
- package/private-modules/zeppos-app-utils/dist/logger/index.js +54 -0
- package/private-modules/zeppos-app-utils/dist/logger/my-logger.js +69 -0
- package/private-modules/zeppos-app-utils/dist/modules/build.js +334 -0
- package/{modules → private-modules/zeppos-app-utils/dist/modules}/config.js +31 -57
- package/private-modules/zeppos-app-utils/dist/modules/create/index.js +254 -0
- package/{modules → private-modules/zeppos-app-utils/dist/modules}/create/local-app.js +10 -10
- package/{modules → private-modules/zeppos-app-utils/dist/modules}/create/yeoman-app.js +2 -2
- package/private-modules/zeppos-app-utils/dist/modules/index.js +21 -0
- package/{modules → private-modules/zeppos-app-utils/dist/modules}/login.js +17 -45
- package/{modules → private-modules/zeppos-app-utils/dist/modules}/status.js +32 -42
- package/{public → private-modules/zeppos-app-utils/dist/public}/scripts/png2vglite.py +0 -0
- package/{public → private-modules/zeppos-app-utils/dist/public}/scripts/requirements.txt +0 -0
- package/{public/template/package.json → private-modules/zeppos-app-utils/dist/public/template/v1/_package.json} +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/empty/app-side/i18n/en-US.po +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/empty/app-side/index.js +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/empty/app.js +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/empty/app.json +1 -1
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/empty/assets/default/icon.png +0 -0
- package/{public/template/empty/pages → private-modules/zeppos-app-utils/dist/public/template/v1/empty/page}/i18n/en-US.po +0 -0
- package/{public/template/empty/pages → private-modules/zeppos-app-utils/dist/public/template/v1/empty/page}/index.js +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/empty/setting/i18n/en-US.po +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/empty/setting/index.js +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/empty/watchface/index.js +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/app-side/index.js +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/app.js +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/app.json +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/assets/gtr3/icon.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/assets/gtr3/image/logo.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/assets/gtr3-pro/icon.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/assets/gtr3-pro/image/logo.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/assets/gts3/icon.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/assets/gts3/image/logo.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/page/gtr3/home/index.page.js +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/page/gtr3/home/index.page.json +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/page/gtr3/home/index.style.js +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/page/gtr3-pro/home/index.page.js +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/page/gtr3-pro/home/index.page.json +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/page/gtr3-pro/home/index.style.js +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/page/gts3/home/index.page.js +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/page/gts3/home/index.page.json +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/page/gts3/home/index.style.js +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/page/i18n/en-US.po +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/setting/i18n/en-US.po +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/setting/index.js +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/hello-world/utils/index.js +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/jsconfig.json +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/app.js +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/app.json +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bg/bg.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bigNum/0.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bigNum/1.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bigNum/2.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bigNum/3.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bigNum/4.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bigNum/5.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bigNum/6.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bigNum/7.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bigNum/8.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bigNum/9.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/bigNum/sp.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/btn/back.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/btn/lv.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/btn/red.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/point/bg.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/point/bottom.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/point/center.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/point/h.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/point/left.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/point/m.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/point/right.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/point/s.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/preview.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/second/second.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/0.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/1.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/2.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/3.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/4.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/5.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/6.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/7.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/8.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/9.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/d.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/smallNum/n.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_ch/1.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_ch/2.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_ch/3.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_ch/4.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_ch/5.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_ch/6.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_ch/7.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_en/1.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_en/2.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_en/3.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_en/4.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_en/5.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_en/6.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/assets/gtr-3-pro/images/week_en/7.png +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/shared/buffer.js +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/shared/device-polyfill.js +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/shared/global.js +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/shared/js-module.js +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/shared/logger.js +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/shared/setTimeout.js +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/watchface/gtr-3-pro/index.js +0 -0
- package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/timer/watchface/round/index.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/_package.json +14 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/app.js +28 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/app.json +56 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/consume.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/beer.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/cake.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/chocolate.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/coffee.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/cookies.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/ham.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/hamburger.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/ice cream.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/pizza.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/sausage.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/multiply.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/selected.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/unselected.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/page/gts/food-list.js +113 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/page/gts/index.js +126 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/page/i18n/en-US.po +42 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/page/i18n/zh-CN.po +42 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/utils/constants.js +54 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/utils/storage.js +42 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/utils/styles-gts-3.js +141 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/utils/styles.js +142 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/app-side/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/app-side/index.js +13 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/app.js +10 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/app.json +60 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/assets/default/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/page/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/page/index.js +7 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/setting/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/setting/index.js +7 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/watchface/index.js +13 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/app-side/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/app-side/index.js +57 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/app.js +23 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/app.json +65 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/assets/common/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/pages/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/pages/index.js +55 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/data.js +67 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/defer.js +35 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/device-polyfill.js +6 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/es6-promise.js +1149 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/event.js +42 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/message-side.js +1145 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/message.js +1151 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/utils/config/constants.js +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/utils/config/device.js +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/app-side/index.js +11 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/app.js +10 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/app.json +101 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/assets/gtr/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/assets/gtr/image/logo.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/assets/gts/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/assets/gts/image/logo.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gtr/home/index.page.js +20 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gtr/home/index.page.json +1 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gtr/home/index.style.js +18 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gts/home/index.page.js +21 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gts/home/index.page.json +1 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gts/home/index.style.js +17 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/i18n/en-US.po +3 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/setting/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/setting/index.js +5 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/utils/index.js +3 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/jsconfig.json +14 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/.prettierrc.js +6 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/app-side/index.js +48 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/app.js +25 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/app.json +75 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/assets/gts/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/page/home/index.page.js +155 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/page/home/index.page.json +1 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/page/home/index.style.js +93 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/page/i18n/en-US.po +8 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/setting/i18n/en-US.po +5 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/setting/index.js +145 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/data.js +67 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/defer.js +35 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/device-polyfill.js +6 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/es6-promise.js +1149 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/event.js +42 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/message-side.js +1145 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/message.js +1151 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/utils/constants.js +3 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/utils/fs.js +38 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/utils/index.js +38 -0
- package/private-modules/zeppos-app-utils/dist/simulator.js +58 -0
- package/{modules/storage.js → private-modules/zeppos-app-utils/dist/storage/index.js} +2 -1
- package/private-modules/zeppos-app-utils/dist/tools/index.js +133 -0
- package/private-modules/zeppos-app-utils/dist/websocket.js +165 -0
- package/private-modules/zeppos-app-utils/package.json +51 -0
- package/utils/pre-check.js +9 -35
- package/config/device.js +0 -122
- package/config/project.js +0 -48
- package/font-icon.js +0 -27
- package/modules/create/index.js +0 -358
- package/modules/simulator.js +0 -82
- package/modules/websocket.js +0 -112
- package/utils/common.js +0 -138
- package/utils/logger.js +0 -31
- package/utils/md5.js +0 -11
- package/utils/sleep.js +0 -8
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
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
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
39
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
40
|
+
if (ar || !(i in from)) {
|
|
41
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
42
|
+
ar[i] = from[i];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
46
|
+
};
|
|
47
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
+
};
|
|
50
|
+
exports.__esModule = true;
|
|
51
|
+
exports.create = void 0;
|
|
52
|
+
var lodash_1 = require("lodash");
|
|
53
|
+
var inquirer_1 = __importDefault(require("inquirer"));
|
|
54
|
+
var path_1 = require("path");
|
|
55
|
+
var zeppos_app_utils_1 = require("zeppos-app-utils");
|
|
56
|
+
var AppType = zeppos_app_utils_1.config.AppType, deviceTargets = zeppos_app_utils_1.config.deviceTargets, OSV2DeviceTargetNames = zeppos_app_utils_1.config.OSV2DeviceTargetNames;
|
|
57
|
+
var inquirerFunc = function (args, _a) {
|
|
58
|
+
var appTemplateChoices = _a.appTemplateChoices, watchfaceTemplateChoices = _a.watchfaceTemplateChoices;
|
|
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) {
|
|
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;
|
|
65
|
+
return [4, inquirer_1["default"].prompt([
|
|
66
|
+
{
|
|
67
|
+
name: 'appType',
|
|
68
|
+
type: 'list',
|
|
69
|
+
when: function (args) {
|
|
70
|
+
var bool = !promptAppType || !Object.values(AppType).includes(promptAppType);
|
|
71
|
+
if (!bool) {
|
|
72
|
+
args.appType = promptAppType.toUpperCase();
|
|
73
|
+
}
|
|
74
|
+
return bool;
|
|
75
|
+
},
|
|
76
|
+
message: 'What type of application do you want to create?',
|
|
77
|
+
choices: Object.keys(AppType)
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'OSVersion',
|
|
81
|
+
type: 'list',
|
|
82
|
+
when: function (args) {
|
|
83
|
+
var bool = !promptOsVersion || !['v1', 'v2'].includes(promptOsVersion);
|
|
84
|
+
if (!bool) {
|
|
85
|
+
args.OSVersion = promptOsVersion;
|
|
86
|
+
}
|
|
87
|
+
return bool;
|
|
88
|
+
},
|
|
89
|
+
message: 'Which OS version API to develop with?',
|
|
90
|
+
choices: [
|
|
91
|
+
new inquirer_1["default"].Separator(),
|
|
92
|
+
new inquirer_1["default"].Separator('Device Basic Information:https://docs.zepp.com/docs/reference/related-resources/device-list/'),
|
|
93
|
+
new inquirer_1["default"].Separator(),
|
|
94
|
+
{
|
|
95
|
+
name: 'OS 1.0 API (Build products can run on OS 2.0, OS 1.0 devices)',
|
|
96
|
+
value: 'v1'
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: 'OS 2.0 API (Build products can only run on OS 2.0 devices)',
|
|
100
|
+
value: 'v2'
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: 'template',
|
|
106
|
+
type: 'list',
|
|
107
|
+
when: function (args) {
|
|
108
|
+
var isApp = args.appType.toLowerCase() === AppType.APP;
|
|
109
|
+
var objMap = appTemplateChoices[args.OSVersion].find(function (val) {
|
|
110
|
+
var name = val.name === 'Hello World' ? 'Hello_World' : val.name;
|
|
111
|
+
return name === promptTemplate;
|
|
112
|
+
});
|
|
113
|
+
if (isApp && objMap) {
|
|
114
|
+
args.template = objMap.value;
|
|
115
|
+
}
|
|
116
|
+
return isApp && !objMap;
|
|
117
|
+
},
|
|
118
|
+
message: 'Which app template do you want to use?',
|
|
119
|
+
choices: function (args) {
|
|
120
|
+
var val = appTemplateChoices[args.OSVersion] || [];
|
|
121
|
+
return __spreadArray([
|
|
122
|
+
new inquirer_1["default"].Separator(),
|
|
123
|
+
new inquirer_1["default"].Separator('Choose a app template')
|
|
124
|
+
], val, true);
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: 'template',
|
|
129
|
+
type: 'list',
|
|
130
|
+
when: function (args) {
|
|
131
|
+
var isWatchFace = args.appType.toLowerCase() === AppType.WATCHFACE;
|
|
132
|
+
var objMap = watchfaceTemplateChoices[args.OSVersion].find(function (val) { return val.name === promptTemplate; });
|
|
133
|
+
if (isWatchFace && objMap) {
|
|
134
|
+
args.template = objMap.value;
|
|
135
|
+
}
|
|
136
|
+
return isWatchFace && !objMap;
|
|
137
|
+
},
|
|
138
|
+
message: 'Which watchface template do you want to use?',
|
|
139
|
+
choices: function (args) {
|
|
140
|
+
var val = watchfaceTemplateChoices[args.OSVersion] || [];
|
|
141
|
+
return __spreadArray([
|
|
142
|
+
new inquirer_1["default"].Separator(),
|
|
143
|
+
new inquirer_1["default"].Separator('Choose a watchface template')
|
|
144
|
+
], val, true);
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: 'withAppSide',
|
|
149
|
+
type: 'confirm',
|
|
150
|
+
when: function (args) {
|
|
151
|
+
var isApp = args.appType.toLowerCase() === AppType.APP;
|
|
152
|
+
var isEmpty = args.template === 0;
|
|
153
|
+
if (isApp && isEmpty && promptWithAppSide) {
|
|
154
|
+
args.withAppSide = promptWithAppSide === 'no' ? false : true;
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
return isApp && isEmpty;
|
|
158
|
+
},
|
|
159
|
+
message: 'Should this application contain a app-side component?'
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: 'withSettings',
|
|
163
|
+
type: 'confirm',
|
|
164
|
+
when: function (args) {
|
|
165
|
+
var withAppSide = args.withAppSide;
|
|
166
|
+
if (withAppSide && promptWithSettings) {
|
|
167
|
+
args.withSettings = promptWithSettings === 'no' ? false : true;
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
return withAppSide;
|
|
171
|
+
},
|
|
172
|
+
message: 'Should this application contain a settings component?'
|
|
173
|
+
}
|
|
174
|
+
]).then(function (args) { return __awaiter(void 0, void 0, void 0, function () {
|
|
175
|
+
var choicePlatforms_1, answer;
|
|
176
|
+
return __generator(this, function (_a) {
|
|
177
|
+
switch (_a.label) {
|
|
178
|
+
case 0:
|
|
179
|
+
if (!(typeof promptBuildTargets === 'string')) return [3, 1];
|
|
180
|
+
args.buildTargets = (0, lodash_1.intersection)(Object.keys(deviceTargets), promptBuildTargets.split(','));
|
|
181
|
+
return [3, 3];
|
|
182
|
+
case 1:
|
|
183
|
+
choicePlatforms_1 = [];
|
|
184
|
+
switch (args.OSVersion) {
|
|
185
|
+
case 'v1':
|
|
186
|
+
choicePlatforms_1 = Object.keys(deviceTargets);
|
|
187
|
+
break;
|
|
188
|
+
case 'v2':
|
|
189
|
+
choicePlatforms_1 = OSV2DeviceTargetNames;
|
|
190
|
+
break;
|
|
191
|
+
default:
|
|
192
|
+
break;
|
|
193
|
+
}
|
|
194
|
+
if (!choicePlatforms_1.length) return [3, 3];
|
|
195
|
+
return [4, inquirer_1["default"].prompt({
|
|
196
|
+
name: 'buildTargets',
|
|
197
|
+
type: 'checkbox',
|
|
198
|
+
when: function () { return args.template === 0; },
|
|
199
|
+
choices: choicePlatforms_1.map(function (platform) { return ({
|
|
200
|
+
name: deviceTargets[platform].deviceName,
|
|
201
|
+
value: platform,
|
|
202
|
+
checked: platform === choicePlatforms_1[0]
|
|
203
|
+
}); }),
|
|
204
|
+
"default": choicePlatforms_1[0],
|
|
205
|
+
message: 'Which platforms of this application should be built?'
|
|
206
|
+
})];
|
|
207
|
+
case 2:
|
|
208
|
+
answer = _a.sent();
|
|
209
|
+
Object.assign(args, answer);
|
|
210
|
+
_a.label = 3;
|
|
211
|
+
case 3: return [2, args];
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
}); })];
|
|
215
|
+
case 1: return [2, _h.sent()];
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
});
|
|
219
|
+
};
|
|
220
|
+
var create = function (args) { return __awaiter(void 0, void 0, void 0, function () {
|
|
221
|
+
var cmd, _a, projectName, beforeFiles, cwdPath;
|
|
222
|
+
return __generator(this, function (_b) {
|
|
223
|
+
switch (_b.label) {
|
|
224
|
+
case 0:
|
|
225
|
+
cmd = args._[0], _a = args.projectName, projectName = _a === void 0 ? '' : _a;
|
|
226
|
+
beforeFiles = [];
|
|
227
|
+
cwdPath = (0, path_1.resolve)('./');
|
|
228
|
+
return [4, (0, zeppos_app_utils_1.checkCreateName)(cmd, cwdPath, projectName, 'CLI').then(function (res) {
|
|
229
|
+
beforeFiles = res.beforeFiles;
|
|
230
|
+
})["catch"](function (res) {
|
|
231
|
+
zeppos_app_utils_1.logger.error(res.message);
|
|
232
|
+
process.exit(1);
|
|
233
|
+
})];
|
|
234
|
+
case 1:
|
|
235
|
+
_b.sent();
|
|
236
|
+
if (cmd === 'create') {
|
|
237
|
+
cwdPath = (0, path_1.resolve)(cwdPath, projectName);
|
|
238
|
+
}
|
|
239
|
+
return [4, zeppos_app_utils_1.modules.createX(cwdPath, args, inquirerFunc, beforeFiles).then(function () { })];
|
|
240
|
+
case 2: return [2, _b.sent()];
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
}); };
|
|
244
|
+
exports.create = create;
|
package/modules/help.js
CHANGED
|
@@ -65,27 +65,27 @@ exports.__esModule = true;
|
|
|
65
65
|
exports.help = void 0;
|
|
66
66
|
var fs_extra_1 = __importDefault(require("fs-extra"));
|
|
67
67
|
var path = __importStar(require("path"));
|
|
68
|
-
var
|
|
68
|
+
var zeppos_app_utils_1 = require("zeppos-app-utils");
|
|
69
69
|
var help = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
70
70
|
var pkg, cmd;
|
|
71
71
|
return __generator(this, function (_a) {
|
|
72
72
|
pkg = fs_extra_1["default"].readJSONSync(path.resolve(__dirname, '../package.json'));
|
|
73
73
|
cmd = process.env.CMD_NAME;
|
|
74
|
-
logger.log("Usage: ".concat(cmd, " <command> [args?]"));
|
|
75
|
-
logger.log('');
|
|
76
|
-
logger.log("".concat(cmd, " init init a new project in current directory"));
|
|
77
|
-
logger.log("".concat(cmd, " create <foo> add the <foo> project to current directory"));
|
|
78
|
-
logger.log("".concat(cmd, " login login to your account"));
|
|
79
|
-
logger.log("".concat(cmd, " logout Sign out of your account"));
|
|
80
|
-
logger.log("".concat(cmd, " dev run this project in development mode"));
|
|
81
|
-
logger.log("".concat(cmd, " preview preview this project in your device"));
|
|
82
|
-
logger.log("".concat(cmd, " build build this project for production"));
|
|
83
|
-
logger.log("".concat(cmd, " config <term> set or get the config value"));
|
|
84
|
-
logger.log("".concat(cmd, " status view information such as login and emulator connection status"));
|
|
85
|
-
logger.log("".concat(cmd, " bridge connect the online App or Simulator for development and debugging"));
|
|
86
|
-
logger.log('');
|
|
87
|
-
logger.log('');
|
|
88
|
-
logger.log("".concat(cmd, "@").concat(pkg.version, " ").concat(path.resolve(__dirname, '../')));
|
|
74
|
+
zeppos_app_utils_1.logger.log("Usage: ".concat(cmd, " <command> [args?]"));
|
|
75
|
+
zeppos_app_utils_1.logger.log('');
|
|
76
|
+
zeppos_app_utils_1.logger.log("".concat(cmd, " init init a new project in current directory"));
|
|
77
|
+
zeppos_app_utils_1.logger.log("".concat(cmd, " create <foo> add the <foo> project to current directory"));
|
|
78
|
+
zeppos_app_utils_1.logger.log("".concat(cmd, " login login to your account"));
|
|
79
|
+
zeppos_app_utils_1.logger.log("".concat(cmd, " logout Sign out of your account"));
|
|
80
|
+
zeppos_app_utils_1.logger.log("".concat(cmd, " dev run this project in development mode"));
|
|
81
|
+
zeppos_app_utils_1.logger.log("".concat(cmd, " preview preview this project in your device"));
|
|
82
|
+
zeppos_app_utils_1.logger.log("".concat(cmd, " build build this project for production"));
|
|
83
|
+
zeppos_app_utils_1.logger.log("".concat(cmd, " config <term> set or get the config value"));
|
|
84
|
+
zeppos_app_utils_1.logger.log("".concat(cmd, " status view information such as login and emulator connection status"));
|
|
85
|
+
zeppos_app_utils_1.logger.log("".concat(cmd, " bridge connect the online App or Simulator for development and debugging"));
|
|
86
|
+
zeppos_app_utils_1.logger.log('');
|
|
87
|
+
zeppos_app_utils_1.logger.log('');
|
|
88
|
+
zeppos_app_utils_1.logger.log("".concat(cmd, "@").concat(pkg.version, " ").concat(path.resolve(__dirname, '../')));
|
|
89
89
|
return [2];
|
|
90
90
|
});
|
|
91
91
|
}); };
|
package/modules/run.js
CHANGED
|
@@ -62,34 +62,24 @@ 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.run =
|
|
66
|
-
var lodash_1 = __importDefault(require("lodash"));
|
|
67
|
-
var chalk_1 = __importDefault(require("chalk"));
|
|
68
|
-
var path = __importStar(require("path"));
|
|
65
|
+
exports.run = void 0;
|
|
69
66
|
var inquirer_1 = __importDefault(require("inquirer"));
|
|
70
|
-
var chokidar_1 = __importDefault(require("chokidar"));
|
|
71
|
-
var fs_extra_1 = __importDefault(require("fs-extra"));
|
|
72
|
-
var parse_gitignore_1 = __importDefault(require("parse-gitignore"));
|
|
73
|
-
var logger = __importStar(require("../utils/logger"));
|
|
74
67
|
var build_1 = require("./build");
|
|
75
|
-
var
|
|
76
|
-
var
|
|
77
|
-
var
|
|
78
|
-
var project_1 = require("../config/project");
|
|
79
|
-
exports.DEFAULT_HOST = '127.0.0.1';
|
|
80
|
-
exports.DEFAULT_PORT = '7650';
|
|
68
|
+
var path = __importStar(require("path"));
|
|
69
|
+
var zeppos_app_utils_1 = require("zeppos-app-utils");
|
|
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;
|
|
81
71
|
var run = function (args) { return __awaiter(void 0, void 0, void 0, function () {
|
|
82
|
-
var simulatorHost, simulatorPort, _a, promptSimulatorHost, _b, promptSimulatorPort, answer,
|
|
72
|
+
var simulatorHost, simulatorPort, _a, promptSimulatorHost, _b, promptSimulatorPort, answer, packages, simulatorWebSocketURL, root;
|
|
83
73
|
var _c;
|
|
84
74
|
return __generator(this, function (_d) {
|
|
85
75
|
switch (_d.label) {
|
|
86
76
|
case 0:
|
|
87
77
|
simulatorHost = '';
|
|
88
78
|
simulatorPort = '';
|
|
89
|
-
_a = args.simulatorHost, promptSimulatorHost = _a === void 0 ? '' : _a, _b = args.simulatorPort, promptSimulatorPort = _b === void 0 ?
|
|
79
|
+
_a = args.simulatorHost, promptSimulatorHost = _a === void 0 ? '' : _a, _b = args.simulatorPort, promptSimulatorPort = _b === void 0 ? DEFAULT_PORT : _b;
|
|
90
80
|
if (!promptSimulatorHost) {
|
|
91
|
-
simulatorHost =
|
|
92
|
-
simulatorPort =
|
|
81
|
+
simulatorHost = zeppos_app_utils_1.instanceStorage.getStorage()[simulatorStorageKey.simulatorHost];
|
|
82
|
+
simulatorPort = zeppos_app_utils_1.instanceStorage.getStorage()[simulatorStorageKey.simulatorPort] || DEFAULT_PORT;
|
|
93
83
|
}
|
|
94
84
|
return [4, inquirer_1["default"].prompt([
|
|
95
85
|
{
|
|
@@ -101,8 +91,8 @@ var run = function (args) { return __awaiter(void 0, void 0, void 0, function ()
|
|
|
101
91
|
}
|
|
102
92
|
return !promptSimulatorHost && !simulatorHost;
|
|
103
93
|
},
|
|
104
|
-
"default":
|
|
105
|
-
message: "simulator host (".concat(
|
|
94
|
+
"default": DEFAULT_HOST,
|
|
95
|
+
message: "simulator host (".concat(DEFAULT_HOST, "):")
|
|
106
96
|
},
|
|
107
97
|
{
|
|
108
98
|
name: 'port',
|
|
@@ -113,77 +103,27 @@ var run = function (args) { return __awaiter(void 0, void 0, void 0, function ()
|
|
|
113
103
|
}
|
|
114
104
|
return !promptSimulatorPort && !simulatorPort;
|
|
115
105
|
},
|
|
116
|
-
"default":
|
|
117
|
-
message: "simulator port (".concat(
|
|
106
|
+
"default": DEFAULT_PORT,
|
|
107
|
+
message: "simulator port (".concat(DEFAULT_PORT, "):")
|
|
118
108
|
}
|
|
119
109
|
])];
|
|
120
110
|
case 1:
|
|
121
111
|
answer = _d.sent();
|
|
122
112
|
if (!simulatorHost) {
|
|
123
|
-
simulatorHost = answer.host ||
|
|
124
|
-
simulatorPort = answer.port ||
|
|
125
|
-
|
|
126
|
-
_c[
|
|
127
|
-
_c[
|
|
113
|
+
simulatorHost = answer.host || DEFAULT_HOST;
|
|
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,
|
|
128
118
|
_c));
|
|
129
119
|
}
|
|
130
|
-
|
|
120
|
+
(0, zeppos_app_utils_1.HM_Analytics)('ZEPP_CLI_DEV_C');
|
|
121
|
+
return [4, (0, build_1.chooseBuildPackages)(build_1.BuildMode.DEV, args)];
|
|
122
|
+
case 2:
|
|
123
|
+
packages = _d.sent();
|
|
131
124
|
simulatorWebSocketURL = "http://".concat(simulatorHost, ":").concat(simulatorPort);
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
var zpkBuffer, _a, targetDeviceInternalName, appId, devices, projectName;
|
|
135
|
-
return __generator(this, function (_b) {
|
|
136
|
-
switch (_b.label) {
|
|
137
|
-
case 0:
|
|
138
|
-
logger.info('rebuilding...');
|
|
139
|
-
if (process.env._targetDeviceToBuild && !args.target) {
|
|
140
|
-
args.target = process.env._targetDeviceToBuild;
|
|
141
|
-
}
|
|
142
|
-
return [4, (0, build_1.buildDev)(args)];
|
|
143
|
-
case 1:
|
|
144
|
-
zpkBuffer = _b.sent();
|
|
145
|
-
if (zpkBuffer) {
|
|
146
|
-
logger.info('rebuild done');
|
|
147
|
-
logger.info('refreshing simulator...');
|
|
148
|
-
_a = (0, common_1.getDeviceInfoFromAppJson)(), targetDeviceInternalName = _a.targetDeviceInternalName, appId = _a.appId, devices = _a.deviceSourceArr;
|
|
149
|
-
projectName = path.parse(process.cwd()).base;
|
|
150
|
-
simulator.upload(zpkBuffer, projectName, targetDeviceInternalName, appId, devices);
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
logger.error('build error');
|
|
154
|
-
}
|
|
155
|
-
if (!hasStarted) {
|
|
156
|
-
hasStarted = true;
|
|
157
|
-
logger.log(chalk_1["default"].green("[".concat(args['$0'], "] watching the changes in this project...")));
|
|
158
|
-
}
|
|
159
|
-
return [2];
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
}); }, 1000);
|
|
163
|
-
gitignorePath = path.resolve('.gitignore');
|
|
164
|
-
fs_extra_1["default"].ensureFileSync(gitignorePath);
|
|
165
|
-
gitignore = (0, parse_gitignore_1["default"])(fs_extra_1["default"].readFileSync(gitignorePath));
|
|
166
|
-
if (!gitignore.length) {
|
|
167
|
-
fs_extra_1["default"].writeFileSync(gitignorePath, project_1.gitignoreDefaultItem.join('\n'));
|
|
168
|
-
gitignore = project_1.gitignoreDefaultItem;
|
|
169
|
-
}
|
|
170
|
-
ignored = lodash_1["default"].union([
|
|
171
|
-
'.gitignore',
|
|
172
|
-
'jsconfig.json',
|
|
173
|
-
'dist/**',
|
|
174
|
-
'node_modules/**',
|
|
175
|
-
'.git/**',
|
|
176
|
-
'yarn.lock',
|
|
177
|
-
'package-lock.json'
|
|
178
|
-
], gitignore);
|
|
179
|
-
chokidar_1["default"].watch('.', {
|
|
180
|
-
ignored: ignored
|
|
181
|
-
}).on('all', function (_type, path) {
|
|
182
|
-
if (!lodash_1["default"].startsWith(path, 'dist')) {
|
|
183
|
-
hasStarted && logger.log(path, chalk_1["default"].green(' changed'));
|
|
184
|
-
refreshSimulator();
|
|
185
|
-
}
|
|
186
|
-
});
|
|
125
|
+
root = path.resolve('./');
|
|
126
|
+
zeppos_app_utils_1.modules.runX(root, args, simulatorWebSocketURL, packages);
|
|
187
127
|
return [2];
|
|
188
128
|
}
|
|
189
129
|
});
|
package/package.json
CHANGED
|
@@ -1,73 +1,63 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeppos/zeus-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "zeus mini-program tools",
|
|
5
|
-
"main": "index.
|
|
5
|
+
"main": "index.ts",
|
|
6
6
|
"author": "zepp",
|
|
7
|
+
"license": "ISC",
|
|
7
8
|
"bin": {
|
|
8
|
-
"zeus": "bin/
|
|
9
|
+
"zeus": "bin/main.js"
|
|
9
10
|
},
|
|
10
11
|
"scripts": {
|
|
11
|
-
"
|
|
12
|
+
"start": "ts-node index.ts",
|
|
12
13
|
"dev": "nodemon -e ts,tsx --exec \"npm run build:dev\"",
|
|
13
|
-
"build": "
|
|
14
|
+
"build": "rm -rf dist && npm run build:dev",
|
|
14
15
|
"build:dev": "tsc && ts-node build.ts",
|
|
15
|
-
"clean": "
|
|
16
|
-
},
|
|
17
|
-
"license": "ISC",
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"@types/findup-sync": "^4.0.1",
|
|
20
|
-
"@types/fs-extra": "^9.0.12",
|
|
21
|
-
"@types/inquirer": "^8.1.0",
|
|
22
|
-
"@types/lodash": "^4.14.172",
|
|
23
|
-
"@types/node": "^17.0.31",
|
|
24
|
-
"@types/parse-gitignore": "^1.0.0",
|
|
25
|
-
"@types/qrcode-terminal": "^0.12.0",
|
|
26
|
-
"@types/qs": "^6.9.7",
|
|
27
|
-
"@types/rimraf": "^3.0.2",
|
|
28
|
-
"@types/supports-color": "^8.1.1",
|
|
29
|
-
"@types/update-notifier": "^5.1.0",
|
|
30
|
-
"@types/uuid": "^8.3.3",
|
|
31
|
-
"@types/ws": "^8.2.2",
|
|
32
|
-
"@types/yargs": "^17.0.2",
|
|
33
|
-
"@types/yeoman-environment": "^2.10.5",
|
|
34
|
-
"clean-webpack-plugin": "^4.0.0",
|
|
35
|
-
"nodemon": "^2.0.14",
|
|
36
|
-
"rimraf": "^2.7.1",
|
|
37
|
-
"titleize": "^3.0.0",
|
|
38
|
-
"ts-loader": "^9.2.5",
|
|
39
|
-
"ts-node": "^10.2.1",
|
|
40
|
-
"typescript": "^4.4.2",
|
|
41
|
-
"webpack": "^5.52.0"
|
|
16
|
+
"clean": "rm -rf node_modules && rm -rf dist"
|
|
42
17
|
},
|
|
43
18
|
"dependencies": {
|
|
44
|
-
"
|
|
45
|
-
"
|
|
19
|
+
"dayjs": "^1.11.5",
|
|
20
|
+
"package-json": "^7.0.0",
|
|
21
|
+
"qrcode-terminal": "^0.12.0",
|
|
22
|
+
"vorpal": "^1.12.0",
|
|
23
|
+
"yargs": "^17.5.1",
|
|
24
|
+
"@zeppos/zpm": "^2.6.6",
|
|
25
|
+
"axios": "^0.27.2",
|
|
46
26
|
"chalk": "^4.1.2",
|
|
47
|
-
"chokidar": "^3.5.
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"findup-sync": "^4.0.0",
|
|
27
|
+
"chokidar": "^3.5.3",
|
|
28
|
+
"dotenv": "^16.0.1",
|
|
29
|
+
"findup-sync": "^5.0.0",
|
|
51
30
|
"form-data": "^4.0.0",
|
|
52
|
-
"fs-extra": "^10.
|
|
31
|
+
"fs-extra": "^10.1.0",
|
|
53
32
|
"get-port": "5.1.1",
|
|
54
33
|
"inquirer": "^8.1.2",
|
|
55
34
|
"lodash": "^4.17.21",
|
|
56
|
-
"npm-keyword": "^6.1.0",
|
|
57
35
|
"open": "^8.4.0",
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"qrcode-terminal": "^0.12.0",
|
|
61
|
-
"qs": "^6.10.1",
|
|
36
|
+
"parse-gitignore": "^2.0.0",
|
|
37
|
+
"qs": "^6.11.0",
|
|
62
38
|
"rd": "^2.0.1",
|
|
63
|
-
"shelljs": "^0.8.
|
|
64
|
-
"socket.io-client": "^4.
|
|
39
|
+
"shelljs": "^0.8.5",
|
|
40
|
+
"socket.io-client": "^4.5.1",
|
|
65
41
|
"stoppable": "^1.1.0",
|
|
66
|
-
"update-notifier": "
|
|
42
|
+
"update-notifier": "5.1.0",
|
|
67
43
|
"uuid": "^8.3.2",
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
44
|
+
"ws": "^8.8.0",
|
|
45
|
+
"yargs-parser": "^20.2.0",
|
|
46
|
+
"yeoman-environment": "^3.9.1",
|
|
47
|
+
"module-alias": "^2.2.2"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@types/qrcode-terminal": "^0.12.0",
|
|
51
|
+
"@types/yargs": "^17.0.10",
|
|
52
|
+
"@types/findup-sync": "^4.0.2",
|
|
53
|
+
"@types/fs-extra": "^9.0.13",
|
|
54
|
+
"@types/parse-gitignore": "^1.0.0",
|
|
55
|
+
"@types/stoppable": "^1.1.1",
|
|
56
|
+
"@types/update-notifier": "5.0.0",
|
|
57
|
+
"@types/yargs-parser": "^21.0.0",
|
|
58
|
+
"@types/yeoman-environment": "^2.10.7"
|
|
59
|
+
},
|
|
60
|
+
"_moduleAliases": {
|
|
61
|
+
"zeppos-app-utils": "private-modules/zeppos-app-utils"
|
|
72
62
|
}
|
|
73
63
|
}
|