@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,254 @@
|
|
|
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
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
46
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
47
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
48
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
49
|
+
function step(op) {
|
|
50
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
51
|
+
while (_) try {
|
|
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;
|
|
53
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
54
|
+
switch (op[0]) {
|
|
55
|
+
case 0: case 1: t = op; break;
|
|
56
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
57
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
58
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
59
|
+
default:
|
|
60
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
61
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
62
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
63
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
64
|
+
if (t[2]) _.ops.pop();
|
|
65
|
+
_.trys.pop(); continue;
|
|
66
|
+
}
|
|
67
|
+
op = body.call(thisArg, _);
|
|
68
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
69
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
73
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
74
|
+
};
|
|
75
|
+
exports.__esModule = true;
|
|
76
|
+
exports.createX = void 0;
|
|
77
|
+
var chalk_1 = __importDefault(require("chalk"));
|
|
78
|
+
var rd = __importStar(require("rd"));
|
|
79
|
+
var fs_extra_1 = __importDefault(require("fs-extra"));
|
|
80
|
+
var path_1 = require("path");
|
|
81
|
+
var fs_1 = require("fs");
|
|
82
|
+
var lodash_1 = require("lodash");
|
|
83
|
+
var yeoman_environment_1 = __importDefault(require("yeoman-environment"));
|
|
84
|
+
var local_app_1 = require("./local-app");
|
|
85
|
+
var yeoman_app_1 = require("./yeoman-app");
|
|
86
|
+
var index_1 = require("../../index");
|
|
87
|
+
var AppType = index_1.config.AppType, AppSourceType = index_1.config.AppSourceType, TemplateCopyType = index_1.config.TemplateCopyType, zeppFontIcon = index_1.config.zeppFontIcon;
|
|
88
|
+
var child_process_1 = require("child_process");
|
|
89
|
+
var projectPreInstall = function (dir) {
|
|
90
|
+
return new Promise(function (resolve) {
|
|
91
|
+
var execInstall = (0, child_process_1.spawn)('npm', ['install'], {
|
|
92
|
+
stdio: 'pipe',
|
|
93
|
+
cwd: dir
|
|
94
|
+
});
|
|
95
|
+
execInstall.stdout.pipe(process.stdout);
|
|
96
|
+
execInstall.on('close', function (code) {
|
|
97
|
+
resolve(code);
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
var createX = function (cwdPath, args, func, beforeFiles) {
|
|
102
|
+
if (beforeFiles === void 0) { beforeFiles = []; }
|
|
103
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
104
|
+
var cmd, _a, projectName, workDir, V1_TEMPLATE_DIR, V2_TEMPLATE_DIR, localTemplates, localChoices, watchfaceTemplateChoices, appTemplateChoices, templatesInit, env, generatorMate, generatorMateKeys, choicesValueFormat, answer, choosePkg;
|
|
105
|
+
return __generator(this, function (_b) {
|
|
106
|
+
switch (_b.label) {
|
|
107
|
+
case 0:
|
|
108
|
+
cmd = args._[0], _a = args.projectName, projectName = _a === void 0 ? '' : _a;
|
|
109
|
+
workDir = cwdPath;
|
|
110
|
+
V1_TEMPLATE_DIR = (0, path_1.resolve)(__dirname, '../../public/template/v1');
|
|
111
|
+
V2_TEMPLATE_DIR = (0, path_1.resolve)(__dirname, '../../public/template/v2');
|
|
112
|
+
localTemplates = {
|
|
113
|
+
v1: (0, fs_1.readdirSync)(V1_TEMPLATE_DIR),
|
|
114
|
+
v2: (0, fs_1.readdirSync)(V2_TEMPLATE_DIR)
|
|
115
|
+
};
|
|
116
|
+
localChoices = { v1: [], v2: [] };
|
|
117
|
+
watchfaceTemplateChoices = { v1: [], v2: [] };
|
|
118
|
+
appTemplateChoices = { v1: [], v2: [] };
|
|
119
|
+
templatesInit = function (os, dir) {
|
|
120
|
+
localTemplates[os].forEach(function (dirName) {
|
|
121
|
+
var dirPath = "".concat(dir, "/").concat(dirName);
|
|
122
|
+
var dirStat = (0, fs_1.lstatSync)(dirPath);
|
|
123
|
+
if (dirStat.isDirectory()) {
|
|
124
|
+
var chooseItem = {
|
|
125
|
+
name: (0, lodash_1.startCase)(dirName),
|
|
126
|
+
path: dirPath,
|
|
127
|
+
type: AppSourceType.LOCAL
|
|
128
|
+
};
|
|
129
|
+
if (dirName === 'empty') {
|
|
130
|
+
localChoices[os].unshift(Object.assign(chooseItem, {
|
|
131
|
+
copyType: TemplateCopyType.EDIT
|
|
132
|
+
}));
|
|
133
|
+
watchfaceTemplateChoices[os].unshift(Object.assign(chooseItem, {
|
|
134
|
+
copyType: TemplateCopyType.EDIT
|
|
135
|
+
}));
|
|
136
|
+
appTemplateChoices[os].unshift(Object.assign(chooseItem, {
|
|
137
|
+
copyType: TemplateCopyType.EDIT
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
140
|
+
else if (['hello-world', 'calories', 'fetch-api', 'todo-list'].includes(dirName)) {
|
|
141
|
+
appTemplateChoices[os].push(chooseItem);
|
|
142
|
+
}
|
|
143
|
+
else if (dirName === 'timer') {
|
|
144
|
+
watchfaceTemplateChoices[os].push(chooseItem);
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
localChoices[os].push(chooseItem);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
if (!(0, lodash_1.isEmpty)(localTemplates)) {
|
|
153
|
+
templatesInit('v1', V1_TEMPLATE_DIR);
|
|
154
|
+
templatesInit('v2', V2_TEMPLATE_DIR);
|
|
155
|
+
}
|
|
156
|
+
env = yeoman_environment_1["default"].createEnv();
|
|
157
|
+
env.lookup();
|
|
158
|
+
generatorMate = env.getGeneratorsMeta();
|
|
159
|
+
generatorMateKeys = Object.keys(generatorMate);
|
|
160
|
+
if (generatorMateKeys.length) {
|
|
161
|
+
generatorMateKeys.forEach(function (name) {
|
|
162
|
+
if (/:(app|all)$/.test(name)) {
|
|
163
|
+
localChoices['v1'].push({
|
|
164
|
+
name: name,
|
|
165
|
+
type: AppSourceType.YEOMAN
|
|
166
|
+
});
|
|
167
|
+
appTemplateChoices['v1'].push({
|
|
168
|
+
name: name,
|
|
169
|
+
type: AppSourceType.YEOMAN
|
|
170
|
+
});
|
|
171
|
+
watchfaceTemplateChoices['v1'].push({
|
|
172
|
+
name: name,
|
|
173
|
+
type: AppSourceType.YEOMAN
|
|
174
|
+
});
|
|
175
|
+
localChoices['v2'].push({
|
|
176
|
+
name: name,
|
|
177
|
+
type: AppSourceType.YEOMAN
|
|
178
|
+
});
|
|
179
|
+
appTemplateChoices['v2'].push({
|
|
180
|
+
name: name,
|
|
181
|
+
type: AppSourceType.YEOMAN
|
|
182
|
+
});
|
|
183
|
+
watchfaceTemplateChoices['v2'].push({
|
|
184
|
+
name: name,
|
|
185
|
+
type: AppSourceType.YEOMAN
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
choicesValueFormat = function (arr) {
|
|
191
|
+
arr['v1'].map(function (val, index) { return (val.value = index); });
|
|
192
|
+
arr['v2'].map(function (val, index) { return (val.value = index); });
|
|
193
|
+
};
|
|
194
|
+
choicesValueFormat(localChoices);
|
|
195
|
+
choicesValueFormat(appTemplateChoices);
|
|
196
|
+
choicesValueFormat(watchfaceTemplateChoices);
|
|
197
|
+
return [4, func(args, {
|
|
198
|
+
appTemplateChoices: appTemplateChoices,
|
|
199
|
+
watchfaceTemplateChoices: watchfaceTemplateChoices
|
|
200
|
+
})];
|
|
201
|
+
case 1:
|
|
202
|
+
answer = _b.sent();
|
|
203
|
+
answer.appType = answer.appType || AppType.APP;
|
|
204
|
+
answer.workDir = workDir;
|
|
205
|
+
choosePkg = answer.appType.toLowerCase() === AppType.APP
|
|
206
|
+
? appTemplateChoices[answer.OSVersion][answer.template]
|
|
207
|
+
: watchfaceTemplateChoices[answer.OSVersion][answer.template];
|
|
208
|
+
index_1.logger.info('fetching template...');
|
|
209
|
+
return [4, (0, index_1.sleep)(100)];
|
|
210
|
+
case 2:
|
|
211
|
+
_b.sent();
|
|
212
|
+
if (choosePkg.type === AppSourceType.YEOMAN) {
|
|
213
|
+
index_1.logger.info("".concat((0, lodash_1.upperFirst)(cmd), " application using yeoman template \"").concat(choosePkg.name, "\"."));
|
|
214
|
+
(0, yeoman_app_1.createYeomanApp)(__assign(__assign({}, answer), { env: env, templateInfo: generatorMate[choosePkg.name] }));
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
index_1.logger.info("".concat((0, lodash_1.upperFirst)(cmd), " application using local template \"").concat(choosePkg.name, "\"."));
|
|
218
|
+
(0, local_app_1.createLocalApp)(__assign(__assign({}, answer), { templateInfo: choosePkg }));
|
|
219
|
+
}
|
|
220
|
+
index_1.logger.log('\n');
|
|
221
|
+
return [4, (0, index_1.sleep)(50)];
|
|
222
|
+
case 3:
|
|
223
|
+
_b.sent();
|
|
224
|
+
rd.eachFileSync(workDir, function (file) {
|
|
225
|
+
if ((0, lodash_1.endsWith)(file, '.DS_Store')) {
|
|
226
|
+
fs_extra_1["default"].remove(file);
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
var shortFile = file.replace(cwdPath, '');
|
|
230
|
+
if (beforeFiles.includes(file)) {
|
|
231
|
+
index_1.logger.log(chalk_1["default"].yellow(" ".concat(chalk_1["default"].bold('replace'), " ")), shortFile);
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
index_1.logger.log(chalk_1["default"].green(" ".concat(chalk_1["default"].bold('create'), " ")), shortFile);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
index_1.logger.log('\n');
|
|
239
|
+
index_1.logger.success("Project created successfully by \"".concat(choosePkg.name, "\" template."));
|
|
240
|
+
index_1.logger.log('Start installing dependency packages.');
|
|
241
|
+
return [4, projectPreInstall(workDir)];
|
|
242
|
+
case 4:
|
|
243
|
+
_b.sent();
|
|
244
|
+
index_1.logger.log(chalk_1["default"].hex('#DB8C41')(zeppFontIcon));
|
|
245
|
+
index_1.logger.log("I'm all done. Now you can start your application.");
|
|
246
|
+
return [2, [
|
|
247
|
+
"Project created successfully by \"".concat(choosePkg.name, "\" template."),
|
|
248
|
+
"I'm all done. Now you can start your application.",
|
|
249
|
+
]];
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
});
|
|
253
|
+
};
|
|
254
|
+
exports.createX = createX;
|
|
@@ -56,21 +56,21 @@ var lodash_1 = __importDefault(require("lodash"));
|
|
|
56
56
|
var path_1 = require("path");
|
|
57
57
|
var fs_extra_1 = __importDefault(require("fs-extra"));
|
|
58
58
|
var fs_1 = __importDefault(require("fs"));
|
|
59
|
-
var
|
|
60
|
-
var
|
|
59
|
+
var index_1 = require("../../index");
|
|
60
|
+
var TemplateCopyType = index_1.config.TemplateCopyType, AppType = index_1.config.AppType, deviceTargets = index_1.config.deviceTargets;
|
|
61
61
|
var createLocalApp = function (args) { return __awaiter(void 0, void 0, void 0, function () {
|
|
62
|
-
var workDir, templateInfo, withAppSide, withSettings, buildTargets, appType, appJsonPath, appJson, appID, defaultTarget, targets, defaultWatchFaceConfig, defaultAssetsPath_1;
|
|
62
|
+
var workDir, templateInfo, OSVersion, withAppSide, withSettings, buildTargets, appType, appJsonPath, appJson, appID, defaultTarget, targets, defaultWatchFaceConfig, defaultAssetsPath_1;
|
|
63
63
|
return __generator(this, function (_a) {
|
|
64
|
-
workDir = args.workDir, templateInfo = args.templateInfo, withAppSide = args.withAppSide, withSettings = args.withSettings, buildTargets = args.buildTargets, appType = args.appType;
|
|
64
|
+
workDir = args.workDir, templateInfo = args.templateInfo, OSVersion = args.OSVersion, withAppSide = args.withAppSide, withSettings = args.withSettings, buildTargets = args.buildTargets, appType = args.appType;
|
|
65
65
|
fs_extra_1["default"].copySync(templateInfo.path, workDir);
|
|
66
|
-
fs_extra_1["default"].copySync((0, path_1.resolve)(__dirname,
|
|
67
|
-
fs_extra_1["default"].copySync((0, path_1.resolve)(__dirname,
|
|
66
|
+
fs_extra_1["default"].copySync((0, path_1.resolve)(__dirname, "../../public/template/".concat(OSVersion, "/jsconfig.json")), "".concat(workDir, "/jsconfig.json"));
|
|
67
|
+
fs_extra_1["default"].copySync((0, path_1.resolve)(__dirname, "../../public/template/".concat(OSVersion, "/_package.json")), "".concat(workDir, "/package.json"));
|
|
68
68
|
fs_1["default"].writeFileSync("".concat(workDir, "/global.d.ts"), '/// <reference path="node_modules/@zeppos/device-types/index.d.ts" />');
|
|
69
69
|
appJsonPath = (0, path_1.resolve)(workDir, './app.json');
|
|
70
70
|
appJson = fs_extra_1["default"].readJsonSync(appJsonPath);
|
|
71
71
|
appID = Math.floor(Math.random() * 10001) + 20000;
|
|
72
72
|
lodash_1["default"].set(appJson, 'app.appId', appID);
|
|
73
|
-
if (templateInfo.copyType !==
|
|
73
|
+
if (templateInfo.copyType !== TemplateCopyType.EDIT) {
|
|
74
74
|
fs_extra_1["default"].writeJson(appJsonPath, appJson, {
|
|
75
75
|
spaces: 2,
|
|
76
76
|
EOL: os_1["default"].EOL
|
|
@@ -79,7 +79,7 @@ var createLocalApp = function (args) { return __awaiter(void 0, void 0, void 0,
|
|
|
79
79
|
}
|
|
80
80
|
defaultTarget = lodash_1["default"].get(appJson, 'targets.default');
|
|
81
81
|
targets = {};
|
|
82
|
-
if (appType.toLowerCase() ===
|
|
82
|
+
if (appType.toLowerCase() === AppType.WATCHFACE) {
|
|
83
83
|
defaultWatchFaceConfig = {
|
|
84
84
|
"path": "watchface/index",
|
|
85
85
|
"main": 1,
|
|
@@ -87,7 +87,7 @@ var createLocalApp = function (args) { return __awaiter(void 0, void 0, void 0,
|
|
|
87
87
|
"lockscreen": 0,
|
|
88
88
|
"photoscreen": 0
|
|
89
89
|
};
|
|
90
|
-
lodash_1["default"].set(appJson, 'app.appType',
|
|
90
|
+
lodash_1["default"].set(appJson, 'app.appType', AppType.WATCHFACE);
|
|
91
91
|
lodash_1["default"].set(appJson, 'app.description', 'empty watchface');
|
|
92
92
|
lodash_1["default"].unset(defaultTarget, 'module.page');
|
|
93
93
|
lodash_1["default"].set(defaultTarget, 'module.watchface', defaultWatchFaceConfig);
|
|
@@ -107,7 +107,7 @@ var createLocalApp = function (args) { return __awaiter(void 0, void 0, void 0,
|
|
|
107
107
|
if (buildTargets && buildTargets.length) {
|
|
108
108
|
defaultAssetsPath_1 = (0, path_1.resolve)(workDir, './assets/default');
|
|
109
109
|
buildTargets.forEach(function (type) {
|
|
110
|
-
var _a =
|
|
110
|
+
var _a = deviceTargets[type], deviceName = _a.deviceName, platforms = _a.platforms, screen = _a.screen;
|
|
111
111
|
var pkgName = "".concat(screen.width, "x").concat(screen.height, "-").concat(lodash_1["default"].kebabCase(lodash_1["default"].toLower(deviceName)));
|
|
112
112
|
lodash_1["default"].set(targets, pkgName, __assign(__assign({}, defaultTarget), { platforms: platforms, designWidth: screen.width }));
|
|
113
113
|
fs_extra_1["default"].copySync(defaultAssetsPath_1, (0, path_1.resolve)(workDir, "./assets/".concat(pkgName)));
|
|
@@ -40,7 +40,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
40
40
|
};
|
|
41
41
|
exports.__esModule = true;
|
|
42
42
|
exports.createYeomanApp = void 0;
|
|
43
|
-
var lodash_1 =
|
|
43
|
+
var lodash_1 = require("lodash");
|
|
44
44
|
var fs_extra_1 = __importDefault(require("fs-extra"));
|
|
45
45
|
var path_1 = require("path");
|
|
46
46
|
var update_notifier_1 = __importDefault(require("update-notifier"));
|
|
@@ -54,7 +54,7 @@ var resolveGenerator = function (generator) {
|
|
|
54
54
|
var pkg = fs_extra_1["default"].readJSONSync(pkgPath);
|
|
55
55
|
pkg.namespace = generator.namespace;
|
|
56
56
|
pkg.appGenerator = true;
|
|
57
|
-
pkg.prettyName = lodash_1
|
|
57
|
+
pkg.prettyName = (0, lodash_1.kebabCase)((0, lodash_1.toLower)((0, yeoman_environment_1.namespaceToName)(generator.namespace)));
|
|
58
58
|
pkg.update = (0, update_notifier_1["default"])({ pkg: pkg }).update;
|
|
59
59
|
if (pkg.update && pkg.version !== pkg.update.latest) {
|
|
60
60
|
pkg.updateAvailable = true;
|
|
@@ -0,0 +1,21 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
exports.__esModule = true;
|
|
17
|
+
__exportStar(require("./login"), exports);
|
|
18
|
+
__exportStar(require("./config"), exports);
|
|
19
|
+
__exportStar(require("./status"), exports);
|
|
20
|
+
__exportStar(require("./build"), exports);
|
|
21
|
+
__exportStar(require("./create/index"), exports);
|
|
@@ -1,27 +1,4 @@
|
|
|
1
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
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -70,10 +47,8 @@ var qs_1 = __importDefault(require("qs"));
|
|
|
70
47
|
var lodash_1 = __importDefault(require("lodash"));
|
|
71
48
|
var get_port_1 = __importDefault(require("get-port"));
|
|
72
49
|
var stoppable_1 = __importDefault(require("stoppable"));
|
|
73
|
-
var
|
|
74
|
-
var
|
|
75
|
-
var project_1 = require("../config/project");
|
|
76
|
-
var hm_analytics_1 = require("../utils/hm-analytics");
|
|
50
|
+
var index_1 = require("../index");
|
|
51
|
+
var _a = index_1.config.getLocalConfig(), loginConfig = _a.loginConfig, loginStorageKey = _a.loginStorageKey;
|
|
77
52
|
var loginCallbackServer = function (cb) { return __awaiter(void 0, void 0, void 0, function () {
|
|
78
53
|
var callbackPath, port, server;
|
|
79
54
|
return __generator(this, function (_a) {
|
|
@@ -113,9 +88,9 @@ var login = function (args) { return __awaiter(void 0, void 0, void 0, function
|
|
|
113
88
|
return __generator(this, function (_h) {
|
|
114
89
|
switch (_h.label) {
|
|
115
90
|
case 0:
|
|
116
|
-
_a =
|
|
91
|
+
_a = index_1.instanceStorage.getStorage(), _b = loginStorageKey.accountToken, _c = _a[_b], apptoken = _c === void 0 ? '' : _c, _d = loginStorageKey.userid, _e = _a[_d], userid = _e === void 0 ? '' : _e, _f = loginStorageKey.cname, _g = _a[_f], cname = _g === void 0 ? '' : _g;
|
|
117
92
|
if (apptoken && userid && cname) {
|
|
118
|
-
logger.success("Have logged");
|
|
93
|
+
index_1.logger.success("Have logged");
|
|
119
94
|
return [2, { apptoken: apptoken, userid: userid, cname: cname }];
|
|
120
95
|
}
|
|
121
96
|
loginPromise = new Promise(function (resolve, reject) {
|
|
@@ -126,12 +101,12 @@ var login = function (args) { return __awaiter(void 0, void 0, void 0, function
|
|
|
126
101
|
var _a;
|
|
127
102
|
var appToken = loginInfo.appToken, userId = loginInfo.userId, cname = loginInfo.cname;
|
|
128
103
|
if (appToken && cname) {
|
|
129
|
-
|
|
130
|
-
_a[
|
|
131
|
-
_a[
|
|
132
|
-
_a[
|
|
104
|
+
index_1.globalStorage.set((_a = {},
|
|
105
|
+
_a[loginStorageKey.accountToken] = appToken,
|
|
106
|
+
_a[loginStorageKey.userid] = userId,
|
|
107
|
+
_a[loginStorageKey.cname] = cname,
|
|
133
108
|
_a));
|
|
134
|
-
logger.success('Login success');
|
|
109
|
+
index_1.logger.success('Login success');
|
|
135
110
|
loginPromiseResolve(loginInfo);
|
|
136
111
|
}
|
|
137
112
|
else {
|
|
@@ -143,30 +118,27 @@ var login = function (args) { return __awaiter(void 0, void 0, void 0, function
|
|
|
143
118
|
_h.label = 2;
|
|
144
119
|
case 2:
|
|
145
120
|
_h.trys.push([2, 4, , 5]);
|
|
146
|
-
return [4, (0, open_1["default"])("".concat(
|
|
147
|
-
project_name:
|
|
148
|
-
platform_app:
|
|
121
|
+
return [4, (0, open_1["default"])("".concat(loginConfig.LOGIN_URL, "?").concat(qs_1["default"].stringify({
|
|
122
|
+
project_name: loginConfig.PROJECT_NAME,
|
|
123
|
+
platform_app: loginConfig.PLATFORM_APP,
|
|
149
124
|
project_redirect_uri: loginCallbackUrl
|
|
150
125
|
})))];
|
|
151
126
|
case 3:
|
|
152
127
|
_h.sent();
|
|
153
|
-
logger.info('The login page has been opened in the default browser.');
|
|
128
|
+
index_1.logger.info('The login page has been opened in the default browser.');
|
|
154
129
|
return [3, 5];
|
|
155
130
|
case 4:
|
|
156
131
|
error_1 = _h.sent();
|
|
157
|
-
logger.error('Unknown error, the default browser failed to open the login page.');
|
|
132
|
+
index_1.logger.error('Unknown error, the default browser failed to open the login page.');
|
|
158
133
|
process.exit(1);
|
|
159
134
|
return [3, 5];
|
|
160
|
-
case 5:
|
|
161
|
-
(0, hm_analytics_1.HM_Analytics)('ZEPP_CLI_LOGIN_C');
|
|
162
|
-
return [2, loginPromise];
|
|
135
|
+
case 5: return [2, loginPromise];
|
|
163
136
|
}
|
|
164
137
|
});
|
|
165
138
|
}); };
|
|
166
139
|
exports.login = login;
|
|
167
140
|
var logout = function () {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
logger.success('Logged out');
|
|
141
|
+
index_1.globalStorage.deleteStorage('____login');
|
|
142
|
+
index_1.logger.success('Logged out');
|
|
171
143
|
};
|
|
172
144
|
exports.logout = logout;
|
|
@@ -1,27 +1,4 @@
|
|
|
1
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
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -65,19 +42,17 @@ exports.__esModule = true;
|
|
|
65
42
|
exports.status = void 0;
|
|
66
43
|
var lodash_1 = __importDefault(require("lodash"));
|
|
67
44
|
var chalk_1 = __importDefault(require("chalk"));
|
|
68
|
-
var
|
|
69
|
-
var index_1 =
|
|
70
|
-
var
|
|
71
|
-
var project_1 = require("../config/project");
|
|
72
|
-
var run_1 = require("./run");
|
|
73
|
-
var hm_analytics_1 = require("../utils/hm-analytics");
|
|
45
|
+
var index_1 = require("../index");
|
|
46
|
+
var DEFAULT_HOST = index_1.config.DEFAULT_HOST, DEFAULT_PORT = index_1.config.DEFAULT_PORT, getLocalConfig = index_1.config.getLocalConfig, simulatorStorageKey = index_1.config.simulatorStorageKey;
|
|
47
|
+
var loginStorageKey = getLocalConfig().loginStorageKey;
|
|
74
48
|
var status = function (args) { return __awaiter(void 0, void 0, void 0, function () {
|
|
75
|
-
var _a, _b, _c, apptoken, _d, _e, userid, _f, _g, cname, _h, _j, simulatorHost, _k, _l, simulatorPort, _m, simulatorConnectStatus, loginStatus, userInfoHost, userInfoURL, nickName, res, error_1;
|
|
49
|
+
var _a, _b, _c, apptoken, _d, _e, userid, _f, _g, cname, _h, _j, simulatorHost, _k, _l, simulatorPort, _m, simulatorConnectStatus, loginStatus, loggerMessage, userInfoHost, userInfoURL, nickName, res, message, error_1, message, message1_1, message2_1, message, message1, message2, message3;
|
|
76
50
|
return __generator(this, function (_o) {
|
|
77
51
|
switch (_o.label) {
|
|
78
52
|
case 0:
|
|
79
|
-
_a =
|
|
53
|
+
_a = index_1.instanceStorage.getStorage(), _b = loginStorageKey.accountToken, _c = _a[_b], apptoken = _c === void 0 ? '' : _c, _d = loginStorageKey.userid, _e = _a[_d], userid = _e === void 0 ? '' : _e, _f = loginStorageKey.cname, _g = _a[_f], cname = _g === void 0 ? '' : _g, _h = simulatorStorageKey.simulatorHost, _j = _a[_h], simulatorHost = _j === void 0 ? DEFAULT_HOST : _j, _k = simulatorStorageKey.simulatorPort, _l = _a[_k], simulatorPort = _l === void 0 ? DEFAULT_PORT : _l, _m = simulatorStorageKey.simulatorConnectStatus, simulatorConnectStatus = _a[_m];
|
|
80
54
|
loginStatus = !!(apptoken && userid && cname);
|
|
55
|
+
loggerMessage = [];
|
|
81
56
|
if (!loginStatus) return [3, 5];
|
|
82
57
|
userInfoHost = lodash_1["default"].split(lodash_1["default"].toString(cname), ',').filter(function (h) { return h.indexOf('auth-') > -1; })[0];
|
|
83
58
|
userInfoURL = "https://".concat(userInfoHost, "/v2/developer/account/center");
|
|
@@ -85,31 +60,46 @@ var status = function (args) { return __awaiter(void 0, void 0, void 0, function
|
|
|
85
60
|
_o.label = 1;
|
|
86
61
|
case 1:
|
|
87
62
|
_o.trys.push([1, 3, , 4]);
|
|
88
|
-
return [4,
|
|
63
|
+
return [4, index_1.api.getUserInfo(userInfoURL, apptoken)];
|
|
89
64
|
case 2:
|
|
90
65
|
res = _o.sent();
|
|
91
66
|
nickName = res.userName;
|
|
92
|
-
|
|
67
|
+
message = "login status: ".concat(chalk_1["default"].yellow('logged'));
|
|
68
|
+
index_1.logger.log(message);
|
|
69
|
+
loggerMessage.push(message);
|
|
93
70
|
return [3, 4];
|
|
94
71
|
case 3:
|
|
95
72
|
error_1 = _o.sent();
|
|
96
|
-
|
|
73
|
+
message = "login status: ".concat(chalk_1["default"].keyword('orange')('no login - invalid token, you can login again with the command `zeus login`'));
|
|
74
|
+
index_1.logger.log(message);
|
|
75
|
+
loggerMessage.push(message);
|
|
97
76
|
args._loginAppToken = '';
|
|
98
77
|
process.env._loginAppToken = '';
|
|
99
78
|
return [3, 4];
|
|
100
79
|
case 4:
|
|
101
|
-
|
|
102
|
-
logger.log(
|
|
80
|
+
message1_1 = "nickName: ".concat(chalk_1["default"].yellow(nickName || '-'));
|
|
81
|
+
index_1.logger.log(message1_1);
|
|
82
|
+
loggerMessage.push(message1_1);
|
|
83
|
+
message2_1 = "userID: ".concat(chalk_1["default"].yellow(userid));
|
|
84
|
+
index_1.logger.log(message2_1);
|
|
85
|
+
loggerMessage.push(message2_1);
|
|
103
86
|
return [3, 6];
|
|
104
87
|
case 5:
|
|
105
|
-
|
|
88
|
+
message = "login status: ".concat(chalk_1["default"].yellow('no login'));
|
|
89
|
+
index_1.logger.log(message);
|
|
90
|
+
loggerMessage.push(message);
|
|
106
91
|
_o.label = 6;
|
|
107
92
|
case 6:
|
|
108
|
-
|
|
109
|
-
logger.log(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
93
|
+
message1 = "simulator connect status: ".concat(chalk_1["default"].yellow(simulatorConnectStatus ? simulatorConnectStatus : 'disconnected'));
|
|
94
|
+
index_1.logger.log(message1);
|
|
95
|
+
loggerMessage.push(message1);
|
|
96
|
+
message2 = "simulator host: ".concat(chalk_1["default"].yellow(simulatorHost));
|
|
97
|
+
index_1.logger.log(message2);
|
|
98
|
+
loggerMessage.push(message2);
|
|
99
|
+
message3 = "simulator port: ".concat(chalk_1["default"].yellow(simulatorPort));
|
|
100
|
+
index_1.logger.log(message3);
|
|
101
|
+
loggerMessage.push(message3);
|
|
102
|
+
return [2, loggerMessage];
|
|
113
103
|
}
|
|
114
104
|
});
|
|
115
105
|
}); };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/{public/template → private-modules/zeppos-app-utils/dist/public/template/v1}/empty/app.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|