UNPKG

vivo-hap-toolkit

Version:

A command line toolkit for developing Quick Apps.

3 lines (2 loc) 1.02 kB
"use strict";const{launchServer:launchServer,stopServer:stopServer}=require("@vivo-hap-toolkit/server"),{compile:compile,stopWatch:stopWatch}=require("./commands/compile");function setRuntimeType(e){const r="card"===e;if(r)return process.env.BUILD_CARD_ONLY=r,void(process.env.USE_LOCAL_IMAGE=r);delete process.env.BUILD_CARD_ONLY,delete process.env.USE_LOCAL_IMAGE}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("app"),module.exports={compile:compile,stopWatch:stopWatch,launchServer:launchServer,stopServer:stopServer,launchWithWatch:launchWithWatch,stopAll:stopAll,setRuntimeType:setRuntimeType}; //# sourceMappingURL=index.js.map