"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var ansi_colors_1=require("ansi-colors"),fs_1=require("fs"),rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),utils_1=require("../../../../lib/utils");function default_1(e){var o=e.params||{},e=e.options||{},i=utils_1.getEnvironment().workspaceRoot;if(!i)throw Error("请在 NgCortex 工程目录中操作！");e={getPascalCase:utils_1.getPascalCase,getSeparatorCase:utils_1.getSeparatorCase,microFrontendName:o.name+(/(-f|F)rontend$/.test(o.name)?"":"-micro-frontend"),prefix:e.prefix||"lib"};process.chdir(__dirname),rxjs_1.zip(utils_1.src("./**/*",{base:"./files"}).pipe(utils_1.transform(function(e){e.path="frontends/"+e.path})),utils_1.src("./**/*",{base:"./mock-files"}).pipe(utils_1.transform(function(e){e.path="mock/"+e.path}))).pipe(operators_1.map(function(e){return[].concat.apply([],e)})).pipe(utils_1.ejs(e)).pipe(utils_1.dest(i,{workspaceRoot:i,log:!0})).subscribe(function(){var e=i+"/mock/resconfig.json",r=require(e),t=utils_1.getSeparatorCase(o.name),s=t+"-micro-frontend";r[s]={type:"frontend",origin:{remoteOnly:!1,remote:"https://dev.grandbay.cloud/"+t+"/"+s,local:"./"+s}};r=JSON.stringify(r,null,"  ")+"\n";fs_1.writeFileSync(e,r),utils_1.changeFileLog(ansi_colors_1.cyan("已更新"),e,i)})}exports.default=default_1;
