@hyext/builder-revues 0.0.1-beta.7 → 1.0.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/dist/index.js CHANGED
@@ -3,4 +3,4 @@
3
3
  * (c) 2024-2024 Alex
4
4
  * Released under the MIT License.
5
5
  */
6
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("fs-extra"),t=require("path"),o=require("@revues/code-compiler"),n=require("os"),a=require("chalk"),r=require("util"),i=require("glob"),u=require("handlebars"),s=require("live-server"),l=require("archiver"),c=require("ramda");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f,p=d(e),m=d(t),h=d(n),y=d(a),g=d(u),j=d(s),v=d(l),x=d(c);!function(e){e[e.Integration=0]="Integration",e[e.Separate=1]="Separate"}(f||(f={}));const w=m.default.join(h.default.tmpdir(),".revue_cache"),S=f.Integration,P=m.default.resolve(__dirname,"../static"),_="project.config.json";function b(e,t){p.default.copyFileSync(m.default.join(e,_),m.default.join(t,_))}function I(){p.default.existsSync(w)||p.default.mkdirSync(w)}async function k(e,t){I(),function(e){const t=m.default.join(e,"web-adapter.js"),o=require.resolve("@revues/cocos-web-adapter/dist/index.js");if(!p.default.existsSync(t))throw new Error("The web-adapter.js was not found from project root.");p.default.writeFileSync(t,p.default.readFileSync(o))}(e),await o.compilerManager.init({projectPath:e,outputPath:t,cachePath:w}),await o.compilerManager.compileDev(),b(e,t)}const E=y.default.gray("·");var T=(e=>{e=` ${e}`;return{log(...t){const o=r.format.apply(r.format,t);console.log(y.default.white(e),E,o)},fatal(...t){t[0]instanceof Error&&(t[0]=t[0].message.trim());const o=r.format.apply(r.format,t);console.error(y.default.red(e),E,o),process.exit(1)},success(...t){const o=r.format.apply(r.format,t);console.log(y.default.green(e),E,o)}}})("REVUE");const U={test:"//test-extsdk.msstatic.com",prod:"//extsdk-msstatic.cdn.huya.com"};function $(e){return`${U.prod}/sdk/$1/${e.hostId}/${e.extUuid||0}/sdk.js`}function q(e,t,o){const n=p.default.readFileSync(e).toString();p.default.outputFileSync(t,function(e,t,o){return g.default.compile(e)(t,o)}(n,o))}function F(e,t){const n=m.default.join(e,"package"),a=function(e){const t=m.default.join(e,"packageConfig.json");return p.default.readJSONSync(t)}(n),r=a.findIndex((e=>{return(t=e).name===o.pkgFileType.MainPkg&&"."===t.root;var t}));if(-1===r)throw new Error("无法找到主包构建信息");const u=a[r];a.splice(r,1);const s=a;s.length>0&&function(e,t,o){const n=m.default.join(e,t.name);o.forEach((t=>{const o=m.default.join(e,t.name,t.root),a=m.default.join(n,t.root);p.default.moveSync(o,a,{overwrite:!0}),p.default.removeSync(m.default.join(e,t.name))}))}(n,u,s);const l=m.default.join(P,"framework"),c=m.default.join(P,"template"),d=m.default.join(n,u.name);if(S===f.Integration){p.default.copySync(l,m.default.join(e,"framework"));const t=require.resolve("@revues/web-sdk-core"),o=m.default.join(e,"sdk"),n=m.default.join(o,"web-sdk-core.js");p.default.mkdirSync(o),p.default.outputFileSync(n,p.default.readFileSync(t))}return function(e){const{mainPath:t,sourcePathPrefix:o,templatePath:n,hyextSDKUrl:a}=e,r={sourcePathPrefix:o,hyextSDKUrl:a},i=[{input:m.default.join(n,"game-frame.hbs"),output:m.default.join(t,"game-frame.html"),data:r},{input:m.default.join(n,"minigame-page-manager.hbs"),output:m.default.join(t,"index.html"),data:r}];i.forEach((e=>{q(e.input,e.output,e.data)}))}({hyextSDKUrl:$({hostId:t.hostId,extUuid:t.extUuid}),sourcePathPrefix:S===f.Integration?m.default.relative(d,e):"",templatePath:c,mainPath:d}),function(e){const t=i.sync("**/**.wasm",{cwd:e,ignore:D,nodir:!0,absolute:!1});console.log("transform wasm to base64 files: \n",t),t.forEach((t=>{const o=m.default.join(e,t),n=p.default.readFileSync(o).toString("base64");p.default.outputFileSync(o+".txt",n)}))}(d),{mainPath:d,main:u,entryPath:"package/"+u.name+"/index.html"}}const D=["node_modules/**/*","**/node_modules/**","**/.git/**",".git/**/*","**/.svn/**",".svn/**/*",".DS_Store","**/.DS_Store"];var z={cert:p.default.readFileSync(m.default.join(P,"./certs/cert.pem")),key:p.default.readFileSync(m.default.join(P,"./certs/key.pem")),passphrase:""};async function M(e,t){const{baseURI:o,extTypes:n,entryInfo:a,outputPath:r}=t,i=m.default.join(r,"build-result"),u={},s=n.map((e=>{const t={type:"HTML",content:{pages:[{path:R(e,a)}],baseURI:o}};return u[e]=t,{type:e,buildResult:{[e]:t}}}));if("development"===e){const e=s.map((e=>p.default.outputFile(m.default.join(i,e.type+".json"),JSON.stringify(e.buildResult,null,2))));await Promise.all(e)}return u}function R(e,t){let o=t.entryPath+`?extType=${e}`;return e.endsWith("_h5")&&(o+="&__module_busi__=kiwi-ExtSDK"),o}const C=e=>{const t=(()=>{const e=h.default.networkInterfaces(),t=x.default.flatten(x.default.values(e));return x.default.filter((e=>/(ipv)?4/gi.test(e.family)&&!/^127\./.test(e.address)),t)})();return t&&t.length>1&&(T.log(`检测到本机有多个 ip 地址:\n- ${t.map((e=>e.address)).join("\n- ")}`),T.log("请在 project.config.json 的 host 中指定正确的 ip"),process.exit(1)),t&&t.length<=0&&(T.log("未能找到本机 ip 地址, 本地开发 app 侧将无法加载小程序"),process.exit(1)),t[0]?.address},N=new Set(["web_video_com","app_panel_h5","zs_anchor_panel_h5","pc_anchor_panel","pc_panel"]);function K(e,t){const o={...t};return function(e){let t=[];e&&0!==e.length?e.forEach((e=>{N.has(e)||t.push(e)})):T.fatal("请在project.config.json相应地方填写supportExtTypes."),t.length>0&&T.fatal(`未支持的小程序类型:${t.join("|")}.`)}(t.supportExtTypes),function(e){null==e.hostId&&(e.hostId="huyaext")}(o),"development"===e&&function(e){e.https=!0,null==e.host&&(e.host=C()||""),null==e.port&&(e.port=18080)}(o),o}function O(e){return`${e.https?"https":"http"}://${e.host}:${e.port}/`}const J=new class{async build(e){const{inputPath:t,outputPath:o,publicPath:n,projectConfig:a,config:r,extUuid:i}=e,u=K("production",r);if(p.default.existsSync(o)&&p.default.removeSync(o),await p.default.copy(t,o,{overwrite:!0}),"game"==a.compileType){T.log("正在合并分包...");const e=F(o,{hostId:u.hostId,extUuid:i});return T.success("合并分包完成"),await M("production",{entryInfo:e,baseURI:n,extTypes:u.supportExtTypes,outputPath:o})}}async start(e){const{inputPath:t,projectConfig:o,outputPath:n,config:a}=e,r=n||m.default.join(__dirname,"../../temp"),i=K("development",a);if("game"==o.compileType){await k(t,r),T.log("正在合并分包...");const e=F(r,{hostId:i.hostId,extUuid:void 0});return T.success("合并分包完成"),T.log("启动 live server 服务..."),T.log("本地访问地址:",O(i)+e.entryPath+"?extType=web_video_com"),function(e){var t={port:e.port,host:e.host,root:e.root,open:!1,ignore:e.ignore,file:"index.html",wait:1e3,mount:e.mount,logLevel:1,https:z};j.default.start(t)}({...i,root:r}),await M("development",{entryInfo:e,baseURI:O(i),extTypes:i.supportExtTypes,outputPath:r})}}async release(e){const{contextPath:t,releasePath:n,projectConfig:a}=e;p.default.existsSync(n)&&p.default.removeSync(n);const r=a.projectName||a.projectname||"project",i=m.default.join(n,r);"game"==a.compileType?await k(t,i):await async function(e,t){I(),await o.compilerManager.init({projectPath:e,outputPath:t,cachePath:w}),await o.compilerManager.compileDev(),b(e,t)}(t,i);const u=m.default.join(n,r);var s;await(s=u,new Promise(((e,t)=>{const o=p.default.createWriteStream(`${s}.zip`),n=v.default("zip",{zlib:{level:9}});o.on("close",(()=>{const t=n.pointer();e({name:`${m.default.basename(s)}.zip`,size:t})})),n.on("warning",(e=>{if("ENOENT"!==e.code)throw e})),n.on("error",(e=>{throw t(e),e})),n.pipe(o),n.directory(`${s}`,!1),n.finalize()})))}config(){}providedProjectConfig(){}};module.exports=J,exports.default=J;
6
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("fs-extra"),t=require("path"),a=require("@revues/code-compiler"),n=require("os"),o=require("chalk"),i=require("util"),r=require("glob"),u=require("handlebars"),s=require("tapable"),c=require("live-server"),l=require("archiver"),d=require("ramda");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f,m=p(e),g=p(t),h=p(n),y=p(o),x=p(u),P=p(c),j=p(l),v=p(d);!function(e){e[e.Integration=0]="Integration",e[e.Separate=1]="Separate"}(f||(f={}));const S=h.default.tmpdir(),b=g.default.join(S,".revue_cache"),w=f.Integration,k=g.default.resolve(__dirname,"../static");var U;!function(e){e.miniProgram="miniProgram",e.miniProgramPlugin="miniProgramPlugin",e.miniGame="miniGame",e.miniGamePlugin="miniGamePlugin"}(U||(U={}));const I="project.config.json";function _(e,t){m.default.copyFileSync(g.default.join(e,I),g.default.join(t,I))}function C(){m.default.existsSync(b)||m.default.mkdirSync(b)}async function T(e,t){C(),await a.compilerManager.init({projectPath:e,outputPath:t,cachePath:b}),await a.compilerManager.compileDev(),_(e,t)}async function E(e,t){C(),await a.compilerManager.init({projectPath:e,outputPath:t,cachePath:b,compileSettings:{cocos:!0}}),await a.compilerManager.compileDev(),_(e,t)}const N=y.default.gray("·");var M=(e=>{e=` ${e}`;return{log(...t){const a=i.format.apply(i.format,t);console.log(y.default.white(e),N,a)},fatal(...t){t[0]instanceof Error&&(t[0]=t[0].message.trim());const a=i.format.apply(i.format,t);console.error(y.default.red(e),N,a),process.exit(1)},success(...t){const a=i.format.apply(i.format,t);console.log(y.default.green(e),N,a)}}})("REVUE");const $=Date.now(),O="production"!==process.env.HYEXT_BUILD_ENV?"//test-hd.huya.com/h5/hyext-sentry-setup-script/test/sentry-setup.js":`//a.msstatic.com/huya/hd/h5/hyext-sentry-setup-script/sentry-setup.js?hash=${$}`;function F(e,t,a){const n=m.default.readFileSync(e).toString();m.default.outputFileSync(t,function(e,t,a){return x.default.compile(e,{noEscape:!0})(t,a)}(n,a))}x.default.registerHelper("toJSON",(function(e){return new x.default.SafeString(JSON.stringify(e))}));const q={context:{deviceOrientation:"portrait"},hooks:{onMergedMainPackge:new s.SyncHook(["IOnMergedMainPackge"]),onSrartBefore:new s.SyncHook(["IOnSrartBefore"])}};class D{apply(e){e.hooks.onMergedMainPackge.tap("InjectWebviewUrlParamsPlugin",(t=>{const{compileType:a,mainPath:n}=t,o=a===U.miniGame;if(o){const t=m.default.readJsonSync(g.default.join(n,"game.json"));"string"==typeof t.deviceOrientation&&t.deviceOrientation.includes("landscape")&&(e.context.deviceOrientation="landscape")}e.context.webviewUrlParams={isLandscape:0,disablePopGesture:1,hideStatusBar:o?1:0,hideBar:1,bounces:0}}))}}function R(){const e=q.context.webviewUrlParams;return e?(t=e,Object.keys(t).reduce(((e,a)=>e+`&${a}=${encodeURIComponent(t[a])}`),"")):"";var t}const z={test:"//test-extsdk.msstatic.com",prod:"//extsdk-msstatic.cdn.huya.com"};function B(e,t,n){const o=g.default.join(t,"package"),i=function(e){const t=g.default.join(e,"packageConfig.json");return m.default.readJSONSync(t)}(o),r=i.findIndex((e=>{return(t=e).name===a.pkgFileType.MainPkg&&"."===t.root;var t}));if(-1===r)throw new Error("无法找到主包构建信息");const u=i[r];i.splice(r,1);const s=i;if(s.length>0&&function(e,t,a,n){const o=g.default.join(e,t.name);a.forEach((t=>{const a=g.default.join(e,t.name),i=g.default.join(a,t.root),r=g.default.join(o,t.root);n&&n(a,o,t),m.default.moveSync(i,r,{overwrite:!0}),m.default.removeSync(g.default.join(e,t.name))}))}(o,u,s,n),!e){const e=g.default.join(k,"framework");if(w===f.Integration){m.default.copySync(e,g.default.join(t,"framework"));const a=g.default.join(t,"sdk");m.default.mkdirSync(a),G(a,"@revues/web-sdk-core"),G(a,"@revues/web-frame"),G(a,"@revues/hyext-adapter")}}return{mainPakConf:u,packagePath:o}}function G(e,t){const a=require.resolve(t);let n=g.default.join(a,"../");"dist"===g.default.basename(n)?m.default.copySync(n,e):(n=g.default.resolve(n,"../"),n=g.default.join(n,"dist"),m.default.existsSync(n)?m.default.copySync(n,e):M.log(`Builder can't resolve ${t} entry from ${a}`))}function J(e){const{builderConfig:t,mainPakConf:a,extUuid:n}=e;return t.supportExtTypes.map((e=>{const o=`index_${e}.html`;return{extType:e,entryPath:"package/"+a.name+"/"+o,sdkUrl:(i={extType:e,extUuid:n,hostId:t.hostId,isTestEnv:t.isTestEnv},`${i.isTestEnv?z.test:z.prod}/sdk/${i.extType}/${i.hostId}/${i.extUuid||0}/sdk.js`),entryFilename:o};var i}))}function H(e,t){const a=t.extName,n=t.extUuid,o=t.builderConfig,i=!!t.watch,{mainPakConf:u,packagePath:s}=B(i,e),c=g.default.join(k,"template"),l=g.default.join(s,u.name),d=J({builderConfig:o,mainPakConf:u,extUuid:n});return q.hooks.onMergedMainPackge.call({mainConf:u,mainPath:l,compileType:U.miniGame}),i||(function(e){const{mainPath:t,sourcePathPrefix:a,templatePath:n,entrys:o,debug:i,dev:r,extUuid:u,extName:s}=e,c=[{input:g.default.join(n,"game-frame.hbs"),output:g.default.join(t,"game-frame.html"),data:{sourcePathPrefix:a}}];r&&c.push({input:g.default.join(n,"remote-debugger.hbs"),output:g.default.join(t,"remote-debugger.html"),data:{extUuid:u,paramsStr:R()}});const l=o.map((e=>({input:g.default.join(n,"minigame-page-manager.hbs"),output:g.default.join(t,e.entryFilename),data:{sourcePathPrefix:a,hyextSDKUrl:e.sdkUrl,debug:i,sentryScript:r?void 0:O,extInfo:{extUuid:u,envVersion:r?"develop":"release",extType:e.extType,extName:s},deviceOrientation:q.context.deviceOrientation}})));l.concat(c).forEach((e=>{F(e.input,e.output,e.data)}))}({entrys:d,sourcePathPrefix:w===f.Integration?g.default.relative(l,e):"",templatePath:c,mainPath:l,extUuid:n,extName:a,...t.template}),function(e){const t=r.sync("**/**.wasm",{cwd:e,ignore:L,nodir:!0,absolute:!1});t.length&&console.log("transform wasm to base64 files: \n",t),t.forEach((t=>{const a=g.default.join(e,t),n=m.default.readFileSync(a).toString("base64");m.default.outputFileSync(a+".txt",n)}))}(l)),{entrys:d,mainPublicPath:"package/"+u.name}}const L=["node_modules/**/*","**/node_modules/**","**/.git/**",".git/**/*","**/.svn/**",".svn/**/*",".DS_Store","**/.DS_Store"];function V(e,t,a){const n=a.name+".js",o=a.name+".js.map",i=g.default.join(e,n),r=g.default.join(e,o);m.default.existsSync(i)&&m.default.outputFileSync(g.default.join(t,n),m.default.readFileSync(i)),m.default.existsSync(r)&&m.default.outputFileSync(g.default.join(t,o),m.default.readFileSync(r))}function K(e,t){const a=t.extName,n=t.extUuid,o=t.builderConfig,i=!!t.watch,{mainPakConf:r,packagePath:u}=B(i,e,V),s=function(e){const t=g.default.join(e,"packageExtConfig.json");return m.default.readJSONSync(t)}(u),c=g.default.join(k,"template"),l=g.default.join(u,r.name),d=J({builderConfig:o,mainPakConf:r,extUuid:n});return q.hooks.onMergedMainPackge.call({mainConf:r,mainPath:l,compileType:U.miniProgram}),i||function(e){const{mainPath:t,sourcePathPrefix:a,templatePath:n,entrys:o,packageExtConfig:i,debug:r,dev:u,extUuid:s,extName:c}=e,l=JSON.stringify(i),d=[{input:g.default.join(n,"service.hbs"),output:g.default.join(t,"service.html"),data:{sourcePathPrefix:a}}];u&&d.push({input:g.default.join(n,"remote-debugger.hbs"),output:g.default.join(t,"remote-debugger.html"),data:{extUuid:s,paramsStr:R()}});const p=o.map((e=>({input:g.default.join(n,"miniapp-page-manager.hbs"),output:g.default.join(t,e.entryFilename),data:{sourcePathPrefix:a,packageExtConfig:l,hyextSDKUrl:e.sdkUrl,debug:r,sentryScript:u?void 0:O,extInfo:{extUuid:s,envVersion:u?"develop":"release",version:"",extType:e.extType,extName:c}}})));p.concat(d).forEach((e=>{F(e.input,e.output,e.data)}))}({entrys:d,sourcePathPrefix:w===f.Integration?g.default.relative(l,e):"",packageExtConfig:s,templatePath:c,mainPath:l,extUuid:n,extName:a,...t.template}),{entrys:d,mainPublicPath:"package/"+r.name}}class W{apply(e){e.hooks.onSrartBefore.tap("RemoveUnlessDIrPlugin",(e=>{const{inputPath:t}=e,a=g.default.join(t,"release"),n=g.default.join(t,"dist");X(a),X(n)}))}}function X(e){m.default.existsSync(e)&&m.default.removeSync(e)}var Y={cert:m.default.readFileSync(g.default.join(k,"./certs/cert.pem")),key:m.default.readFileSync(g.default.join(k,"./certs/key.pem")),passphrase:""};async function A(e,t){const{baseURI:a,entrys:n,outputPath:o}=t,i=g.default.join(o,"build-result"),r={},u=R(),s=n.map((e=>{const t={type:"HTML",content:{pages:[{path:Q(e,u)}],baseURI:a}};return r[e.extType]=t,{type:e.extType,buildResult:{[e.extType]:t}}}));if("development"===e){const e=s.map((e=>m.default.outputFile(g.default.join(i,e.type+".json"),JSON.stringify(e.buildResult,null,2))));await Promise.all(e)}return r}function Q(e,t){const a=e.extType;let n=e.entryPath;return a.endsWith("_h5")&&(n+="?__module_busi__=kiwi-ExtSDK"+t),n}const Z=e=>{const t=(()=>{const e=h.default.networkInterfaces(),t=v.default.flatten(v.default.values(e));return v.default.filter((e=>/(ipv)?4/gi.test(e.family)&&!/^127\./.test(e.address)),t)})();return t&&t.length>1&&(M.log(`检测到本机有多个 ip 地址:\n- ${t.map((e=>e.address)).join("\n- ")}`),M.log("请在 project.config.json 的 host 中指定正确的 ip"),process.exit(1)),t&&t.length<=0&&(M.log("未能找到本机 ip 地址, 本地开发 app 侧将无法加载小程序"),process.exit(1)),t[0]?.address},ee=new Set(["app_inner_h5","web_video_com","app_panel_h5","zs_anchor_panel_h5","pc_anchor_panel","pc_panel"]);function te(e,t){const a={...t};return function(e){let t=[];e&&0!==e.length?e.forEach((e=>{ee.has(e)||t.push(e)})):M.fatal("请在project.config.json相应地方填写supportExtTypes."),t.length>0&&M.fatal(`未支持的小程序类型:${t.join("|")}.`)}(t.supportExtTypes),function(e){null==e.hostId&&(e.hostId="huyaext")}(a),"development"===e&&function(e){e.https=!0,null==e.host&&(e.host=Z()||""),null==e.port&&(e.port=18080)}(a),a}function ae(e){return`${e.https?"https":"http"}://${e.host}:${e.port}/`}function ne(e,t,a){M.log("正在合并分包...");const n=("game"==e.compileType?H:K)(t,a);return M.success("合并分包完成"),n}const oe=new class{constructor(){var e;e=q,(new D).apply(e),(new W).apply(e)}async build(e){const{inputPath:t,outputPath:a,publicPath:n,projectConfig:o,config:i,extUuid:r,extName:u}=e,s=te("production",i);m.default.existsSync(a)&&m.default.removeSync(a),await m.default.copy(t,a,{overwrite:!0});const{entrys:c}=ne(o,a,{builderConfig:s,extUuid:r,extName:u});return await A("production",{entrys:c,baseURI:n,outputPath:a})}async start(e){const{debug:t,inputPath:n,projectConfig:o,outputPath:i,config:r}=e;q.hooks.onSrartBefore.call({inputPath:n});const u=(s=g.default.basename(n),g.default.join(S,".revues-projects",s));var s;const c=function(e){const t=e.appId||e.appid;return null==t||""===t?M.fatal("请填写正确的appid"):t.length>10&&M.fatal("appid错误,请登录 https://ext.huya.com/ 在您的小程序概要中查看小程序ID"),t}(o),l=(d=o).projectname||d.projectName||"小程序";var d;const p=te("development",r);"game"==o.compileType?await async function(e,t,n){await E(e,t),a.compilerManager.watch({graphId:"game"},(async(e,t)=>{await a.compilerManager.compileSingleCode({type:e,filePath:t,graphId:"game"}),n&&n()}))}(n,u,(()=>{ne(o,u,{builderConfig:p,watch:!0})})):await async function(e,t,n){await T(e,t),a.compilerManager.watch({graphId:"miniprogram"},(async(e,t)=>{await a.compilerManager.compileSingleCode({type:e,filePath:t,graphId:"miniprogram"}),n&&n()}))}(n,u,(()=>{ne(o,u,{builderConfig:p,watch:!0})}));const{entrys:f,mainPublicPath:m}=ne(o,u,{builderConfig:p,extUuid:c,extName:l,template:{debug:t,dev:!0}});return M.log("启动 live server 服务..."),M.success("本地访问地址:",ae(p)+f[0]?.entryPath),M.success("扫码预览地址:",ae(p)+m+"/remote-debugger.html"),function(e){var t={port:e.port,host:e.host,root:e.root,open:!1,ignore:e.ignore,file:"index.html",wait:1e3,mount:e.mount,logLevel:1,https:Y};P.default.start(t)}({...p,root:u,ignore:"node_modules"}),await A("development",{entrys:f,baseURI:ae(p),outputPath:i})}async release(e){const{contextPath:t,releasePath:a,projectConfig:n}=e;m.default.existsSync(a)&&m.default.removeSync(a),M.log("开始打包");const o=n.projectName||n.projectname||"project",i=g.default.join(a,o);"game"==n.compileType?await E(t,i):await T(t,i);const r=g.default.join(a,o);var u;await(u=r,new Promise(((e,t)=>{const a=m.default.createWriteStream(`${u}.zip`),n=j.default("zip",{zlib:{level:9}});a.on("close",(()=>{const t=n.pointer();e({name:`${g.default.basename(u)}.zip`,size:t})})),n.on("warning",(e=>{if("ENOENT"!==e.code)throw e})),n.on("error",(e=>{throw t(e),e})),n.pipe(a),n.directory(`${u}`,!1),n.finalize()}))),M.success("打包成功,zip包地址:"+r)}config(){}providedProjectConfig(){}clearCache(){try{m.default.existsSync(b)&&m.default.removeSync(b),M.success("项目缓存清除成功~")}catch(e){M.success("项目缓存清除失败 \n"+e.message)}}};module.exports=oe,exports.default=oe;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyext/builder-revues",
3
- "version": "0.0.1-beta.7",
3
+ "version": "1.0.0",
4
4
  "description": "> TODO: description",
5
5
  "author": "diamondloler <857276958@qq.com>",
6
6
  "homepage": "",
@@ -20,11 +20,15 @@
20
20
  "type": "git",
21
21
  "url": "https://git.huya.com/exc/web/remax.git"
22
22
  },
23
- "scripts": {},
23
+ "scripts": {
24
+ "minify": "node scripts/minify"
25
+ },
24
26
  "dependencies": {
25
- "@revues/cocos-web-adapter": "0.0.1-beta.7",
26
- "@revues/code-compiler": "0.0.1-beta.7",
27
- "@revues/web-sdk-core": "0.0.1-beta.7",
27
+ "@revues/cocos-web-adapter": "1.0.0",
28
+ "@revues/code-compiler": "1.0.0",
29
+ "@revues/hyext-adapter": "0.0.1-beta.19",
30
+ "@revues/web-frame": "1.0.0",
31
+ "@revues/web-sdk-core": "1.0.0",
28
32
  "archiver": "^7.0.1",
29
33
  "chalk": "^2.4.2",
30
34
  "fs-extra": "8.1.0",
@@ -32,12 +36,14 @@
32
36
  "handlebars": "^4.7.8",
33
37
  "live-server": "^1.2.2",
34
38
  "ramda": "^0.29.1",
39
+ "tapable": "^2.2.1",
35
40
  "util": "^0.12.5"
36
41
  },
37
42
  "devDependencies": {
38
43
  "@types/archiver": "^6.0.2",
39
44
  "@types/live-server": "^1.2.3",
40
- "@types/ramda": "^0.29.11"
45
+ "@types/ramda": "^0.29.11",
46
+ "terser": "^5.31.0"
41
47
  },
42
- "gitHead": "925db5afe414cc3c21ab7f417c67b2179945827b"
48
+ "gitHead": "5408ebecf3994a4ae557728f119b6c52bcbb3b1b"
43
49
  }
Binary file
@@ -893,23 +893,23 @@ div.wx-picker {
893
893
  position: fixed;
894
894
  width: 100%;
895
895
  left: 0;
896
- bottom: 274px;
896
+ bottom: 0;
897
897
  z-index: 2048;
898
898
  -webkit-backface-visibility: hidden;
899
899
  backface-visibility: hidden;
900
- -webkit-transform: translateY(100%);
900
+ /* -webkit-transform: translateY(100%);
901
901
  transform: translateY(100%);
902
902
  -webkit-transition: -webkit-transform .3s;
903
903
  transition: -webkit-transform .3s;
904
904
  transition: transform .3s;
905
- transition: transform .3s, -webkit-transform .3s;
905
+ transition: transform .3s, -webkit-transform .3s; */
906
906
  -moz-user-select: none;
907
907
  -webkit-user-select: none;
908
908
  -ms-user-select: none
909
909
  }
910
910
 
911
911
  .wx-picker-android {
912
- bottom: 414px
912
+ bottom: 0px
913
913
  }
914
914
 
915
915
  .wx-picker-show {
@@ -3113,7 +3113,8 @@ wx-video .wx-video-slot * {
3113
3113
 
3114
3114
  wx-video video {
3115
3115
  width: 100%;
3116
- height: 100%
3116
+ height: 100%;
3117
+ position: relative;
3117
3118
  }
3118
3119
 
3119
3120
  wx-video .wx-video-playmask {
@@ -3150,7 +3151,7 @@ wx-video .wx-video-bar {
3150
3151
  display: flex;
3151
3152
  -webkit-align-items: center;
3152
3153
  align-items: center;
3153
- padding: 0 10px
3154
+ padding: 0 10px;
3154
3155
  }
3155
3156
 
3156
3157
  wx-video .wx-video-bar.full {