UNPKG

vivo-hap-toolkit

Version:

A command line toolkit for developing Quick Apps.

3 lines (2 loc) 1.06 kB
"use strict";const{launchServer:launchServer,stopServer:stopServer}=require("@vivo-hap-toolkit/server"),BuildModeManager=require("@vivo-hap-toolkit/shared-utils/lib/buildMode/BuildModeManager"),{compile:compile,stopWatch:stopWatch}=require("./commands/compile");function setRuntimeType(e){const r="card"===e;r?process.env.BUILD_CARD_ONLY=r:delete process.env.BUILD_CARD_ONLY}function stopAll(){return Promise.all([stopServer(),stopWatch()]).then(([e,r])=>{const t=Object.assign({},e,r);return t.error=!(!e.stopServerError&&!r.stopWatchError),t})}function launchWithWatch(e){const{cwd:r,log:t,onerror:o}=e;return Promise.all([launchServer(e),compile("native","dev",!0,{cwd:r,log:t,onerror:o})]).then(([e,r])=>{const t=Object.assign({},e,r);return t.error=!(!e.launchError&&!r.compileError),t})}setRuntimeType("card"),module.exports={compile:compile,stopWatch:stopWatch,launchServer:launchServer,stopServer:stopServer,launchWithWatch:launchWithWatch,stopAll:stopAll,setRuntimeType:setRuntimeType,BuildModeManager:BuildModeManager}; //# sourceMappingURL=index.js.map