@flatjs/evolve 1.4.11 → 1.4.12
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/index.js +1 -1
- package/package.json +7 -7
package/cjs/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
/*! @flatjs/forge MIT https://github.com/flatjs */
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("@flatjs/common");var t=require("babel-merge");var r=require("@flatjs/mock");var n=require("lodash");var o=require("path");var s=require("@flatjs/forge-plugin-postcss-pixel");var a=require("cssnano");var i=require("fs");var l=require("better-opn");var c=require("webpack");var u=require("mini-css-extract-plugin");var p=require("os");var d=require("image-minimizer-webpack-plugin");var f=require("terser-webpack-plugin");var v=require("@pmmmwh/react-refresh-webpack-plugin");var h=require("case-sensitive-paths-webpack-plugin");var m=require("webpack-bundle-analyzer");var g=require("webpack-sources");var b=require("webpack/lib/util/extractUrlAndGlobal");var y=require("html-webpack-plugin");var w=require("webpack-dev-server");var j=require("express");var k=require("https");function C(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var x=C(t);var O=C(a);var M=C(l);var P=C(c);var S=C(u);var A=C(p);var E=C(d);var R=C(f);var B=C(v);var $=C(h);var q=C(b);var T=C(y);var F=C(w);var _=C(j);var D=C(k);function I(e){let t;const r=process.env.NODE_ENV==="FLATJS_CORE";switch(e){case"@flatjs/evolve-preset-babel":t=require.resolve(r?"../../../evolve-preset-babel/src/index":e);break}return t}const N=(e,t=false)=>{if(!t){return require(e)}else{return r.loadModule(e)}};const z=(t={usePreset:"react"},r=[])=>{const{usePreset:n,...o}=t;const s=r.map((e=>[require.resolve("babel-plugin-import"),{transformToDefaultImport:false,libraryDirectory:"cjs",style:()=>false,...e},e.libraryName]));const{reactBabelPreset:a,infernoBabelPreset:i,vueBabelPreset:l}=N(I("@flatjs/evolve-preset-babel"));const c=n==="react"?a():n==="vue"?l():i();let u={};try{u=x["default"](c,o);if(u.plugins){u.plugins.unshift(...s)}else{u.plugins=s}}catch(t){e.printError(t)}return Object.assign({babelrc:false},u)};const L=[`https://polyfill.io/v3/polyfill.min.js?features=Array.from%2CArray.isArray%2CArray.of%2CArray.prototype.entries%2CArray.prototype.every%2CArray.prototype.fill%2CArray.prototype.filter%2CArray.prototype.find%2CArray.prototype.findIndex%2CArray.prototype.flat%2CArray.prototype.forEach%2CArray.prototype.flatMap%2CArray.prototype.keys%2CArray.prototype.indexOf%2CArray.prototype.includes%2CArray.prototype.lastIndexOf%2CArray.prototype.map%2CArray.prototype.reduce%2CArray.prototype.reduceRight%2CArray.prototype.some%2CArray.prototype.sort%2CArray.prototype.values%2CArrayBuffer%2CBlob%2CDataView%2CDate.now%2CObject.assign%2CObject.create%2CObject.defineProperties%2CObject.defineProperty%2CObject.entries%2CObject.freeze%2CObject.fromEntries%2CObject.getOwnPropertySymbols%2CObject.getOwnPropertyNames%2CObject.getOwnPropertyDescriptors%2CObject.getOwnPropertyDescriptor%2CObject.getPrototypeOf%2CObject.is%2CObject.isExtensible%2CObject.isFrozen%2CObject.isSealed%2CObject.keys%2CObject.values%2CObject.setPrototypeOf%2CPromise%2CPromise.prototype.finally%2CReflect%2CReflect.apply%2CReflect.construct%2CReflect.defineProperty%2CReflect.deleteProperty%2CReflect.getPrototypeOf%2CReflect.getOwnPropertyDescriptor%2CReflect.get%2CReflect.ownKeys%2CReflect.isExtensible%2CReflect.has%2CReflect.preventExtensions%2CReflect.set%2CReflect.setPrototypeOf%2CSet%2CString.prototype.trimStart%2CString.prototype.trimEnd%2CString.prototype.trim%2CString.prototype.startsWith%2CString.prototype.repeat%2CString.prototype.replaceAll%2CString.prototype.padStart%2CString.prototype.padEnd%2CMap%2CObject.seal%2Cconsole.groupEnd%2Cconsole.group`];const W={reactDev:[`https://unpkg.com/react@18.0.0/umd/react.development.js`,`https://unpkg.com/history@5.3.0/umd/history.development.js`,`https://unpkg.com/react-dom@18.0.0/umd/react-dom.development.js`,`https://unpkg.com/react-router@6.3.0/umd/react-router.development.js`,`https://unpkg.com/react-router-dom@6.3.0/umd/react-router-dom.development.js`],reactProd:[`https://unpkg.com/react@18.0.0/umd/react.production.min.js`,`https://unpkg.com/history@5.3.0/umd/history.production.min.js`,`https://unpkg.com/react-dom@18.0.0/umd/react-dom.production.min.js`,`https://unpkg.com/react-router@6.3.0/umd/react-router.production.min.js`,`https://unpkg.com/react-router-dom@6.3.0/umd/react-router-dom.production.min.js`]};const U={reactDev:[`https://cdn.jsdelivr.net/npm/react@18.0.0/umd/react.development.js`,`https://cdn.jsdelivr.net/npm/history@5.3.0/umd/history.development.js`,`https://cdn.jsdelivr.net/npm/react-dom@18.0.0/umd/react-dom.development.js`,`https://cdn.jsdelivr.net/npm/react-router@6.3.0/umd/react-router.development.js`,`https://cdn.jsdelivr.net/npm/react-router-dom@6.3.0/umd/react-router-dom.development.js`],reactProd:[`https://cdn.jsdelivr.net/npm/react@18.0.0/umd/react.production.min.js`,`https://cdn.jsdelivr.net/npm/history@5.3.0/umd/history.production.min.js`,`https://cdn.jsdelivr.net/npm/react-dom@18.0.0/umd/react-dom.production.min.js`,`https://cdn.jsdelivr.net/npm/react-router@6.3.0/umd/react-router.production.min.js`,`https://cdn.jsdelivr.net/npm/react-router-dom@6.3.0/umd/react-router-dom.production.min.js`]};const G={reactDev:[`https://cdn.bootcdn.net/ajax/libs/react/18.0.0/umd/react.development.js`,`https://cdn.bootcdn.net/ajax/libs/history/5.3.0/history.development.js`,`https://cdn.bootcdn.net/ajax/libs/react-dom/18.0.0/umd/react-dom.development.js`,`https://cdn.bootcdn.net/ajax/libs/react-router/6.3.0/react-router.development.js`,`https://cdn.bootcdn.net/ajax/libs/react-router-dom/6.3.0/react-router-dom.development.js`],reactProd:[`https://cdn.bootcdn.net/ajax/libs/react/18.0.0/umd/react.production.min.js`,`https://cdn.bootcdn.net/ajax/libs/history/5.3.0/history.production.min.js`,`https://cdn.bootcdn.net/ajax/libs/react-dom/18.0.0/umd/react-dom.production.min.js`,`https://cdn.bootcdn.net/ajax/libs/react-router/6.3.0/react-router.production.min.js`,`https://cdn.bootcdn.net/ajax/libs/react-router-dom/6.3.0/react-router-dom.production.min.js`]};const H={flatjsEvolve:{projectCwd:process.cwd(),projectVirtualPath:"flatjs/evolve",forBuild:{rejectWarnings:false},forServe:{pageMiddlewares:[],defaultServeGlobalData:()=>({})},target:["web","es5"],liveReload:false,minimizeTerserOptions:{},multiHtmlCdn:{},watchOptions:{poll:1e3,ignored:/node_modules/,aggregateTimeout:500},extraPlugins:()=>[],pluginLoaderOptions:{babelOptions:
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("@flatjs/common");var t=require("babel-merge");var r=require("@flatjs/mock");var n=require("lodash");var o=require("path");var s=require("@flatjs/forge-plugin-postcss-pixel");var a=require("cssnano");var i=require("fs");var l=require("better-opn");var c=require("webpack");var u=require("mini-css-extract-plugin");var p=require("os");var d=require("image-minimizer-webpack-plugin");var f=require("terser-webpack-plugin");var v=require("@pmmmwh/react-refresh-webpack-plugin");var h=require("case-sensitive-paths-webpack-plugin");var m=require("webpack-bundle-analyzer");var g=require("webpack-sources");var b=require("webpack/lib/util/extractUrlAndGlobal");var y=require("html-webpack-plugin");var w=require("webpack-dev-server");var j=require("express");var k=require("https");function C(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var x=C(t);var O=C(a);var M=C(l);var P=C(c);var S=C(u);var A=C(p);var E=C(d);var R=C(f);var B=C(v);var $=C(h);var q=C(b);var T=C(y);var F=C(w);var _=C(j);var D=C(k);function I(e){let t;const r=process.env.NODE_ENV==="FLATJS_CORE";switch(e){case"@flatjs/evolve-preset-babel":t=require.resolve(r?"../../../evolve-preset-babel/src/index":e);break}return t}const N=(e,t=false)=>{if(!t){return require(e)}else{return r.loadModule(e)}};const z=(t={usePreset:"react"},r=[])=>{const{usePreset:n,...o}=t;const s=r.map((e=>[require.resolve("babel-plugin-import"),{transformToDefaultImport:false,libraryDirectory:"cjs",style:()=>false,...e},e.libraryName]));const{reactBabelPreset:a,infernoBabelPreset:i,vueBabelPreset:l}=N(I("@flatjs/evolve-preset-babel"));const c=n==="react"?a():n==="vue"?l():i();let u={};try{u=x["default"](c,o);if(u.plugins){u.plugins.unshift(...s)}else{u.plugins=s}}catch(t){e.printError(t)}return Object.assign({babelrc:false},u)};const L=[`https://polyfill.io/v3/polyfill.min.js?features=Array.from%2CArray.isArray%2CArray.of%2CArray.prototype.entries%2CArray.prototype.every%2CArray.prototype.fill%2CArray.prototype.filter%2CArray.prototype.find%2CArray.prototype.findIndex%2CArray.prototype.flat%2CArray.prototype.forEach%2CArray.prototype.flatMap%2CArray.prototype.keys%2CArray.prototype.indexOf%2CArray.prototype.includes%2CArray.prototype.lastIndexOf%2CArray.prototype.map%2CArray.prototype.reduce%2CArray.prototype.reduceRight%2CArray.prototype.some%2CArray.prototype.sort%2CArray.prototype.values%2CArrayBuffer%2CBlob%2CDataView%2CDate.now%2CObject.assign%2CObject.create%2CObject.defineProperties%2CObject.defineProperty%2CObject.entries%2CObject.freeze%2CObject.fromEntries%2CObject.getOwnPropertySymbols%2CObject.getOwnPropertyNames%2CObject.getOwnPropertyDescriptors%2CObject.getOwnPropertyDescriptor%2CObject.getPrototypeOf%2CObject.is%2CObject.isExtensible%2CObject.isFrozen%2CObject.isSealed%2CObject.keys%2CObject.values%2CObject.setPrototypeOf%2CPromise%2CPromise.prototype.finally%2CReflect%2CReflect.apply%2CReflect.construct%2CReflect.defineProperty%2CReflect.deleteProperty%2CReflect.getPrototypeOf%2CReflect.getOwnPropertyDescriptor%2CReflect.get%2CReflect.ownKeys%2CReflect.isExtensible%2CReflect.has%2CReflect.preventExtensions%2CReflect.set%2CReflect.setPrototypeOf%2CSet%2CString.prototype.trimStart%2CString.prototype.trimEnd%2CString.prototype.trim%2CString.prototype.startsWith%2CString.prototype.repeat%2CString.prototype.replaceAll%2CString.prototype.padStart%2CString.prototype.padEnd%2CMap%2CObject.seal%2Cconsole.groupEnd%2Cconsole.group`];const W={reactDev:[`https://unpkg.com/react@18.0.0/umd/react.development.js`,`https://unpkg.com/history@5.3.0/umd/history.development.js`,`https://unpkg.com/react-dom@18.0.0/umd/react-dom.development.js`,`https://unpkg.com/react-router@6.3.0/umd/react-router.development.js`,`https://unpkg.com/react-router-dom@6.3.0/umd/react-router-dom.development.js`],reactProd:[`https://unpkg.com/react@18.0.0/umd/react.production.min.js`,`https://unpkg.com/history@5.3.0/umd/history.production.min.js`,`https://unpkg.com/react-dom@18.0.0/umd/react-dom.production.min.js`,`https://unpkg.com/react-router@6.3.0/umd/react-router.production.min.js`,`https://unpkg.com/react-router-dom@6.3.0/umd/react-router-dom.production.min.js`]};const U={reactDev:[`https://cdn.jsdelivr.net/npm/react@18.0.0/umd/react.development.js`,`https://cdn.jsdelivr.net/npm/history@5.3.0/umd/history.development.js`,`https://cdn.jsdelivr.net/npm/react-dom@18.0.0/umd/react-dom.development.js`,`https://cdn.jsdelivr.net/npm/react-router@6.3.0/umd/react-router.development.js`,`https://cdn.jsdelivr.net/npm/react-router-dom@6.3.0/umd/react-router-dom.development.js`],reactProd:[`https://cdn.jsdelivr.net/npm/react@18.0.0/umd/react.production.min.js`,`https://cdn.jsdelivr.net/npm/history@5.3.0/umd/history.production.min.js`,`https://cdn.jsdelivr.net/npm/react-dom@18.0.0/umd/react-dom.production.min.js`,`https://cdn.jsdelivr.net/npm/react-router@6.3.0/umd/react-router.production.min.js`,`https://cdn.jsdelivr.net/npm/react-router-dom@6.3.0/umd/react-router-dom.production.min.js`]};const G={reactDev:[`https://cdn.bootcdn.net/ajax/libs/react/18.0.0/umd/react.development.js`,`https://cdn.bootcdn.net/ajax/libs/history/5.3.0/history.development.js`,`https://cdn.bootcdn.net/ajax/libs/react-dom/18.0.0/umd/react-dom.development.js`,`https://cdn.bootcdn.net/ajax/libs/react-router/6.3.0/react-router.development.js`,`https://cdn.bootcdn.net/ajax/libs/react-router-dom/6.3.0/react-router-dom.development.js`],reactProd:[`https://cdn.bootcdn.net/ajax/libs/react/18.0.0/umd/react.production.min.js`,`https://cdn.bootcdn.net/ajax/libs/history/5.3.0/history.production.min.js`,`https://cdn.bootcdn.net/ajax/libs/react-dom/18.0.0/umd/react-dom.production.min.js`,`https://cdn.bootcdn.net/ajax/libs/react-router/6.3.0/react-router.production.min.js`,`https://cdn.bootcdn.net/ajax/libs/react-router-dom/6.3.0/react-router-dom.production.min.js`]};const H={flatjsEvolve:{projectCwd:process.cwd(),projectVirtualPath:"flatjs/evolve",forBuild:{rejectWarnings:false},forServe:{pageMiddlewares:[],defaultServeGlobalData:()=>({})},target:["web","es5"],liveReload:false,minimizeTerserOptions:{},multiHtmlCdn:{},watchOptions:{poll:1e3,ignored:/node_modules/,aggregateTimeout:500},extraPlugins:()=>[],pluginLoaderOptions:{babelOptions:{usePreset:"react"},lessOptions:{},cssnanoOptions:{},pixelOptions:{enabled:true,rootValue:{px:100,rpx:1},outputUnit:"rem"},enableBundleHashName:true,modularImports:[]}}};const V=(e,t={},r)=>{var o,s,a;const i=r[1];const l={vue:"Vue",react:"React","react-dom":"ReactDOM","react-router":"ReactRouter","react-router-dom":"ReactRouterDOM"};const c=n.isFunction(t)?t(e):t;const u=n.isFunction((o=i.options)==null?void 0:o.externals)?(s=i.options)==null?void 0:s.externals(e):(a=i.options)==null?void 0:a.externals;return Object.assign({},l,c,u||{})};const J=`(function(d){var j;var b=1;var i=1;var h=750;var c=100;function e(s,o){var q=d.document;var l=q.documentElement;var k=navigator.userAgent;var m=k.toLowerCase().indexOf("android")>-1;i=d.devicePixelRatio||1;if(i>3){i=3}if(m){i=1}console.log("current devicePixelRatio:",i);l.setAttribute("data-dpr",i.toString());var p=q.querySelector('meta[name="viewport"]');if(!p){b=1/i;p=q.createElement("meta");p.setAttribute("name","viewport");q.head.appendChild(p);p.setAttribute(["content","width=device-width,user-scalable=no,initial-scale=",b,",maximum-scale=",b,",minimum-scale=",b].join(""))}function n(){var t=document.documentElement.clientWidth;j=t/o*(s/i)*i;q.documentElement.style.fontSize=String(j)+"px"}var r;d.addEventListener("resize",function(){clearTimeout(r);r=setTimeout(n,300)},false);d.addEventListener("onload",n,false);n()}e(c,h);window.fabricViewport={currRem:j,currDpr:i,currScale:b,dpiPX2px:function f(k){return parseFloat(k.toString())/j*100+"px"},px2DPIpx:function a(k){return parseFloat(k.toString())/100*j+"px"},px2rem:function g(k){return parseFloat(k.toString())/100+"rem"}}})(window);`;const Y={title:"",favicon:"",inlineScripts:()=>[],headBeforeStyles:()=>[],headBeforeScripts:e=>[...L,...e==="development"?G.reactDev:G.reactProd],bodyAfterScripts:()=>[],viewport:J,excludeCdnEnvs:["me","dev","ntv"],minify:true,template:o.join(e.getPackageDirSync(__dirname,""),"templates/html-plugin/index-{0}.html")};const K=(e,t,r)=>{let o;if(r){o=typeof r==="function"?r(t):r}if(n.isUndefined(o)){const r=Y[e];return typeof r==="function"?r(t):r}return o};const X=(e,t)=>Object.assign({sourceMap:e,javascriptEnabled:true},t);const Q=(e,t={},r={})=>{const n=[O["default"]({preset:["default",{discardComments:{removeAll:!e},reduceInitial:false,normalizeWhitespace:!e,...r}]})];if(t.enabled!==false){n.push(s.forgePluginPostcssPixel(t))}return{plugins:n}};const Z=(e,t={})=>{const r={hints:e?false:"warning"};return Object.assign(r,t)};const ee=(e={})=>({parallel:true,
|
3
3
|
// Disable Extract all or some (use /^\**!|@preserve|@license|@cc_on/i RegExp) comments.
|
4
4
|
extractComments:false,terserOptions:n.merge({ecma:undefined,parse:{},compress:{},mangle:true,module:false,output:null,toplevel:false,nameCache:null,ie8:false,keep_classnames:undefined,keep_fnames:false,safari10:false},e)});const te=(t=process.cwd(),r)=>{const o=e.loadFlatjsConfig(t,"flatjsEvolve","flatjs.evolve.js");return n.merge({},H.flatjsEvolve,o.flatjsEvolve,r,{projectCwd:t})};const re=e=>{try{M["default"](e)}catch(e){console.warn(`Unable to open browser. If you are running in a headless environment\n`)}};function ne(e="",t=""){return e.replace(/\/$/,"")+"/"+t.replace(/^\//,"")}function oe(e){const t=new RegExp("[?&]env(=([^&#]*)|&|#|$)");const r=t.exec(window.location.href);const n=r&&r[2]?decodeURIComponent(r[2].replace(/\+/g," ")):"prod";const o=e[n]||e["prod"]||[];const s=o[Math.floor(Math.random()*o.length)];return s.replace(/\/$/,"")+"/"}function se(e={},t="prod"){const r=e[t]||e["prod"]||[];return r[Math.floor(Math.random()*r.length)]}function ae(e){return`window.evolveFetchMicroWidgets = function () {\n var cdnConfig = ${JSON.stringify(e)};\n var cdnFinder = ${oe.toString()};\n return (cdnFinder(cdnConfig) || '').replace(/\\/$/, '');\n }`}function ie(e,t){const r=[];for(const[t,n]of Object.entries(e)){r.push({[t]:n.entry})}return r.map((e=>n.merge({},t,{name:Object.keys(e)[0],entry:e})))}const le=(e,t)=>{var r,o;const s=n.merge({},t.pluginLoaderOptions);if((r=e.options)!=null&&r.allowPx2rem){n.set(s,"pixelOptions.enabled",e.options.allowPx2rem)}if((o=e.options)!=null&&o.enableBundleHashName){n.set(s,"enableBundleHashName",e.options.enableBundleHashName)}const a={...t,pluginLoaderOptions:s};return a};const ce=(e,t)=>{var r,n;const o=(r=e.pluginLoaderOptions)==null?void 0:(n=r.pixelOptions)==null?void 0:n.enabled;const s=(t==null?void 0:t.allowPx2rem)??o;return!!s};const ue=e=>{if(Object.keys(e).length>1){throw new Error(`Only single one entry map support now while "serve", "build" process!`)}let t=undefined;for(const[r,n]of Object.entries(e)){t=[r,n];break}if(!t){throw new Error(`No entry map found while "serve", "build" process!`)}return t};const pe=()=>Date.now().toString();const de=(e,t,r=true)=>{const n=e==="js"?".js":".css";if(t){return`bundle${n}`}if(r){return`bundle[contenthash]${n}`}return`bundle${n}?${pe()}`};const fe=/icons\//;const ve=/\.(jpe?g|png|gif|svg)$/;const he=/\.(ttf|eot|woff|woff2)(\?.+)?$/;const me=({projectCwd:e,projectVirtualPath:t},r,[n,s])=>{let a=o.dirname(o.join(t,r.replace(/^src/,"")));const i=s.entry.map((t=>o.dirname(o.join(e,t))));const l=o.resolve(e,r);const c=i.find((e=>l.startsWith(e)));if(c){a=o.dirname(o.join(n,o.relative(c,l)))}return`${a}/[name]-[contenthash:8][ext]`};const ge=(e,t)=>{const r={test(e){return he.test(e)||ve.test(e)&&!fe.test(e)},type:"asset",generator:{filename({filename:r}){return me(e,r,t)}},parser:{dataUrlCondition:{maxSize:4*1024}}};return r};const be=()=>{const e={test(e){return fe.test(e)&&e.endsWith(".svg")},use:[{loader:require.resolve("./loader-icon"),options:{svgo:{plugins:[{name:"removeTitle"},{name:"removeDimensions"}]}}}]};return e};function ye(e,t){const r=n.isFunction(e)?e(t):e;if(r.usePreset==="react"&&t){if(r.plugins){r.plugins.push(require.resolve("react-refresh/babel"))}else{r.plugins=[require.resolve("react-refresh/babel")]}}return r}const we=(e,t={})=>{const{babelOptions:r={},modularImports:o=[]}=t;const s=ye(r,e);const a=n.isFunction(o)?o(e):o;const i=z(s,a);const l={test:/\.(tsx|ts|js|jsx)$/,use:[{loader:"babel-loader",options:i}]};return l};const je=(e,t={})=>{const r={test:/\.css$/i,use:[{loader:S["default"].loader,options:{esModule:true}},{loader:"css-loader",options:{sourceMap:e}}]};const{pixelOptions:n,cssnanoOptions:o}=t;if(Array.isArray(r.use)){r.use.push({loader:"postcss-loader",options:{postcssOptions:Q(e,n,o),sourceMap:e}})}return r};const ke=(e,t={})=>{const r=je(e,t);r.test=/\.less$/i;const n=t.lessOptions;if(Array.isArray(r.use)){r.use.push({loader:"less-loader",options:{sourceMap:e,lessOptions:X(e,n)}})}return r};const Ce=(e,t,r,n={})=>{const o=[be(),ge(t,r),je(e,n),ke(e,n),we(e,n)];return o};var xe={exports:{}};var Oe=/[|\\{}()[\]^$+*?.]/g;var Me=function(e){if(typeof e!=="string"){throw new TypeError("Expected a string")}return e.replace(Oe,"\\$&")};var Pe={exports:{}};var Se={exports:{}};var Ae={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};var Ee=Ae;var Re={};for(var Be in Ee){if(Ee.hasOwnProperty(Be)){Re[Ee[Be]]=Be}}var $e=Se.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var qe in $e){if($e.hasOwnProperty(qe)){if(!("channels"in $e[qe])){throw new Error("missing channels property: "+qe)}if(!("labels"in $e[qe])){throw new Error("missing channel labels property: "+qe)}if($e[qe].labels.length!==$e[qe].channels){throw new Error("channel and label counts mismatch: "+qe)}var Te=$e[qe].channels;var Fe=$e[qe].labels;delete $e[qe].channels;delete $e[qe].labels;Object.defineProperty($e[qe],"channels",{value:Te});Object.defineProperty($e[qe],"labels",{value:Fe})}}$e.rgb.hsl=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var o=Math.min(t,r,n);var s=Math.max(t,r,n);var a=s-o;var i;var l;var c;if(s===o){i=0}else if(t===s){i=(r-n)/a}else if(r===s){i=2+(n-t)/a}else if(n===s){i=4+(t-r)/a}i=Math.min(i*60,360);if(i<0){i+=360}c=(o+s)/2;if(s===o){l=0}else if(c<=.5){l=a/(s+o)}else{l=a/(2-s-o)}return[i,l*100,c*100]};$e.rgb.hsv=function(e){var t;var r;var n;var o;var s;var a=e[0]/255;var i=e[1]/255;var l=e[2]/255;var c=Math.max(a,i,l);var u=c-Math.min(a,i,l);var p=function(e){return(c-e)/6/u+1/2};if(u===0){o=s=0}else{s=u/c;t=p(a);r=p(i);n=p(l);if(a===c){o=n-r}else if(i===c){o=1/3+t-n}else if(l===c){o=2/3+r-t}if(o<0){o+=1}else if(o>1){o-=1}}return[o*360,s*100,c*100]};$e.rgb.hwb=function(e){var t=e[0];var r=e[1];var n=e[2];var o=$e.rgb.hsl(e)[0];var s=1/255*Math.min(t,Math.min(r,n));n=1-1/255*Math.max(t,Math.max(r,n));return[o,s*100,n*100]};$e.rgb.cmyk=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var o;var s;var a;var i;i=Math.min(1-t,1-r,1-n);o=(1-t-i)/(1-i)||0;s=(1-r-i)/(1-i)||0;a=(1-n-i)/(1-i)||0;return[o*100,s*100,a*100,i*100]};function _e(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}$e.rgb.keyword=function(e){var t=Re[e];if(t){return t}var r=Infinity;var n;for(var o in Ee){if(Ee.hasOwnProperty(o)){var s=Ee[o];var a=_e(e,s);if(a<r){r=a;n=o}}}return n};$e.keyword.rgb=function(e){return Ee[e]};$e.rgb.xyz=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92;r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var o=t*.4124+r*.3576+n*.1805;var s=t*.2126+r*.7152+n*.0722;var a=t*.0193+r*.1192+n*.9505;return[o*100,s*100,a*100]};$e.rgb.lab=function(e){var t=$e.rgb.xyz(e);var r=t[0];var n=t[1];var o=t[2];var s;var a;var i;r/=95.047;n/=100;o/=108.883;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116;o=o>.008856?Math.pow(o,1/3):7.787*o+16/116;s=116*n-16;a=500*(r-n);i=200*(n-o);return[s,a,i]};$e.hsl.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;var o;var s;var a;var i;var l;if(r===0){l=n*255;return[l,l,l]}if(n<.5){s=n*(1+r)}else{s=n+r-n*r}o=2*n-s;i=[0,0,0];for(var c=0;c<3;c++){a=t+1/3*-(c-1);if(a<0){a++}if(a>1){a--}if(6*a<1){l=o+(s-o)*6*a}else if(2*a<1){l=s}else if(3*a<2){l=o+(s-o)*(2/3-a)*6}else{l=o}i[c]=l*255}return i};$e.hsl.hsv=function(e){var t=e[0];var r=e[1]/100;var n=e[2]/100;var o=r;var s=Math.max(n,.01);var a;var i;n*=2;r*=n<=1?n:2-n;o*=s<=1?s:2-s;i=(n+r)/2;a=n===0?2*o/(s+o):2*r/(n+r);return[t,a*100,i*100]};$e.hsv.rgb=function(e){var t=e[0]/60;var r=e[1]/100;var n=e[2]/100;var o=Math.floor(t)%6;var s=t-Math.floor(t);var a=255*n*(1-r);var i=255*n*(1-r*s);var l=255*n*(1-r*(1-s));n*=255;switch(o){case 0:return[n,l,a];case 1:return[i,n,a];case 2:return[a,n,l];case 3:return[a,i,n];case 4:return[l,a,n];case 5:return[n,a,i]}};$e.hsv.hsl=function(e){var t=e[0];var r=e[1]/100;var n=e[2]/100;var o=Math.max(n,.01);var s;var a;var i;i=(2-r)*n;s=(2-r)*o;a=r*o;a/=s<=1?s:2-s;a=a||0;i/=2;return[t,a*100,i*100]};$e.hwb.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;var o=r+n;var s;var a;var i;var l;if(o>1){r/=o;n/=o}s=Math.floor(6*t);a=1-n;i=6*t-s;if((s&1)!==0){i=1-i}l=r+i*(a-r);var c;var u;var p;switch(s){default:case 6:case 0:c=a;u=l;p=r;break;case 1:c=l;u=a;p=r;break;case 2:c=r;u=a;p=l;break;case 3:c=r;u=l;p=a;break;case 4:c=l;u=r;p=a;break;case 5:c=a;u=r;p=l;break}return[c*255,u*255,p*255]};$e.cmyk.rgb=function(e){var t=e[0]/100;var r=e[1]/100;var n=e[2]/100;var o=e[3]/100;var s;var a;var i;s=1-Math.min(1,t*(1-o)+o);a=1-Math.min(1,r*(1-o)+o);i=1-Math.min(1,n*(1-o)+o);return[s*255,a*255,i*255]};$e.xyz.rgb=function(e){var t=e[0]/100;var r=e[1]/100;var n=e[2]/100;var o;var s;var a;o=t*3.2406+r*-1.5372+n*-.4986;s=t*-.9689+r*1.8758+n*.0415;a=t*.0557+r*-.204+n*1.057;o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92;s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92;a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92;o=Math.min(Math.max(0,o),1);s=Math.min(Math.max(0,s),1);a=Math.min(Math.max(0,a),1);return[o*255,s*255,a*255]};$e.xyz.lab=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var s;var a;t/=95.047;r/=100;n/=108.883;t=t>.008856?Math.pow(t,1/3):7.787*t+16/116;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116;o=116*r-16;s=500*(t-r);a=200*(r-n);return[o,s,a]};$e.lab.xyz=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var s;var a;s=(t+16)/116;o=r/500+s;a=s-n/200;var i=Math.pow(s,3);var l=Math.pow(o,3);var c=Math.pow(a,3);s=i>.008856?i:(s-16/116)/7.787;o=l>.008856?l:(o-16/116)/7.787;a=c>.008856?c:(a-16/116)/7.787;o*=95.047;s*=100;a*=108.883;return[o,s,a]};$e.lab.lch=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var s;var a;o=Math.atan2(n,r);s=o*360/2/Math.PI;if(s<0){s+=360}a=Math.sqrt(r*r+n*n);return[t,a,s]};$e.lch.lab=function(e){var t=e[0];var r=e[1];var n=e[2];var o;var s;var a;a=n/360*2*Math.PI;o=r*Math.cos(a);s=r*Math.sin(a);return[t,o,s]};$e.rgb.ansi16=function(e){var t=e[0];var r=e[1];var n=e[2];var o=1 in arguments?arguments[1]:$e.rgb.hsv(e)[2];o=Math.round(o/50);if(o===0){return 30}var s=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(t/255));if(o===2){s+=60}return s};$e.hsv.ansi16=function(e){return $e.rgb.ansi16($e.hsv.rgb(e),e[2])};$e.rgb.ansi256=function(e){var t=e[0];var r=e[1];var n=e[2];if(t===r&&r===n){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}var o=16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5);return o};$e.ansi16.rgb=function(e){var t=e%10;if(t===0||t===7){if(e>50){t+=3.5}t=t/10.5*255;return[t,t,t]}var r=(~~(e>50)+1)*.5;var n=(t&1)*r*255;var o=(t>>1&1)*r*255;var s=(t>>2&1)*r*255;return[n,o,s]};$e.ansi256.rgb=function(e){if(e>=232){var t=(e-232)*10+8;return[t,t,t]}e-=16;var r;var n=Math.floor(e/36)/5*255;var o=Math.floor((r=e%36)/6)/5*255;var s=r%6/5*255;return[n,o,s]};$e.rgb.hex=function(e){var t=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255);var r=t.toString(16).toUpperCase();return"000000".substring(r.length)+r};$e.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t){return[0,0,0]}var r=t[0];if(t[0].length===3){r=r.split("").map((function(e){return e+e})).join("")}var n=parseInt(r,16);var o=n>>16&255;var s=n>>8&255;var a=n&255;return[o,s,a]};$e.rgb.hcg=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var o=Math.max(Math.max(t,r),n);var s=Math.min(Math.min(t,r),n);var a=o-s;var i;var l;if(a<1){i=s/(1-a)}else{i=0}if(a<=0){l=0}else if(o===t){l=(r-n)/a%6}else if(o===r){l=2+(n-t)/a}else{l=4+(t-r)/a+4}l/=6;l%=1;return[l*360,a*100,i*100]};$e.hsl.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=1;var o=0;if(r<.5){n=2*t*r}else{n=2*t*(1-r)}if(n<1){o=(r-.5*n)/(1-n)}return[e[0],n*100,o*100]};$e.hsv.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=t*r;var o=0;if(n<1){o=(r-n)/(1-n)}return[e[0],n*100,o*100]};$e.hcg.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;if(r===0){return[n*255,n*255,n*255]}var o=[0,0,0];var s=t%1*6;var a=s%1;var i=1-a;var l=0;switch(Math.floor(s)){case 0:o[0]=1;o[1]=a;o[2]=0;break;case 1:o[0]=i;o[1]=1;o[2]=0;break;case 2:o[0]=0;o[1]=1;o[2]=a;break;case 3:o[0]=0;o[1]=i;o[2]=1;break;case 4:o[0]=a;o[1]=0;o[2]=1;break;default:o[0]=1;o[1]=0;o[2]=i}l=(1-r)*n;return[(r*o[0]+l)*255,(r*o[1]+l)*255,(r*o[2]+l)*255]};$e.hcg.hsv=function(e){var t=e[1]/100;var r=e[2]/100;var n=t+r*(1-t);var o=0;if(n>0){o=t/n}return[e[0],o*100,n*100]};$e.hcg.hsl=function(e){var t=e[1]/100;var r=e[2]/100;var n=r*(1-t)+.5*t;var o=0;if(n>0&&n<.5){o=t/(2*n)}else if(n>=.5&&n<1){o=t/(2*(1-n))}return[e[0],o*100,n*100]};$e.hcg.hwb=function(e){var t=e[1]/100;var r=e[2]/100;var n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};$e.hwb.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=1-r;var o=n-t;var s=0;if(o<1){s=(n-o)/(1-o)}return[e[0],o*100,s*100]};$e.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};$e.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};$e.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};$e.gray.hsl=$e.gray.hsv=function(e){return[0,0,e[0]]};$e.gray.hwb=function(e){return[0,100,e[0]]};$e.gray.cmyk=function(e){return[0,0,0,e[0]]};$e.gray.lab=function(e){return[e[0],0,0]};$e.gray.hex=function(e){var t=Math.round(e[0]/100*255)&255;var r=(t<<16)+(t<<8)+t;var n=r.toString(16).toUpperCase();return"000000".substring(n.length)+n};$e.rgb.gray=function(e){var t=(e[0]+e[1]+e[2])/3;return[t/255*100]};var De=Se.exports;function Ie(){var e={};var t=Object.keys(De);for(var r=t.length,n=0;n<r;n++){e[t[n]]={distance:-1,parent:null}}return e}function Ne(e){var t=Ie();var r=[e];t[e].distance=0;while(r.length){var n=r.pop();var o=Object.keys(De[n]);for(var s=o.length,a=0;a<s;a++){var i=o[a];var l=t[i];if(l.distance===-1){l.distance=t[n].distance+1;l.parent=n;r.unshift(i)}}}return t}function ze(e,t){return function(r){return t(e(r))}}function Le(e,t){var r=[t[e].parent,e];var n=De[t[e].parent][e];var o=t[e].parent;while(t[o].parent){r.unshift(t[o].parent);n=ze(De[t[o].parent][o],n);o=t[o].parent}n.conversion=r;return n}var We=function(e){var t=Ne(e);var r={};var n=Object.keys(t);for(var o=n.length,s=0;s<o;s++){var a=n[s];var i=t[a];if(i.parent===null){continue}r[a]=Le(a,t)}return r};var Ue=Se.exports;var Ge=We;var He={};var Ve=Object.keys(Ue);function Je(e){var t=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}return e(t)};if("conversion"in e){t.conversion=e.conversion}return t}function Ye(e){var t=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}var r=e(t);if(typeof r==="object"){for(var n=r.length,o=0;o<n;o++){r[o]=Math.round(r[o])}}return r};if("conversion"in e){t.conversion=e.conversion}return t}Ve.forEach((function(e){He[e]={};Object.defineProperty(He[e],"channels",{value:Ue[e].channels});Object.defineProperty(He[e],"labels",{value:Ue[e].labels});var t=Ge(e);var r=Object.keys(t);r.forEach((function(r){var n=t[r];He[e][r]=Ye(n);He[e][r].raw=Je(n)}))}));var Ke=He;(function(e){const t=Ke;const r=(e,r)=>function(){const n=e.apply(t,arguments);return`[${n+r}m`};const n=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};5;${n}m`};const o=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};2;${n[0]};${n[1]};${n[2]}m`};function s(){const e=new Map;const s={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};s.color.grey=s.color.gray;for(const t of Object.keys(s)){const r=s[t];for(const t of Object.keys(r)){const n=r[t];s[t]={open:`[${n[0]}m`,close:`[${n[1]}m`};r[t]=s[t];e.set(n[0],n[1])}Object.defineProperty(s,t,{value:r,enumerable:false});Object.defineProperty(s,"codes",{value:e,enumerable:false})}const a=e=>e;const i=(e,t,r)=>[e,t,r];s.color.close="[39m";s.bgColor.close="[49m";s.color.ansi={ansi:r(a,0)};s.color.ansi256={ansi256:n(a,0)};s.color.ansi16m={rgb:o(i,0)};s.bgColor.ansi={ansi:r(a,10)};s.bgColor.ansi256={ansi256:n(a,10)};s.bgColor.ansi16m={rgb:o(i,10)};for(let e of Object.keys(t)){if(typeof t[e]!=="object"){continue}const a=t[e];if(e==="ansi16"){e="ansi"}if("ansi16"in a){s.color.ansi[e]=r(a.ansi16,0);s.bgColor.ansi[e]=r(a.ansi16,10)}if("ansi256"in a){s.color.ansi256[e]=n(a.ansi256,0);s.bgColor.ansi256[e]=n(a.ansi256,10)}if("rgb"in a){s.color.ansi16m[e]=o(a.rgb,0);s.bgColor.ansi16m[e]=o(a.rgb,10)}}return s}Object.defineProperty(e,"exports",{enumerable:true,get:s})})(Pe);var Xe=(e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":e.length===1?"-":"--";const n=t.indexOf(r+e);const o=t.indexOf("--");return n!==-1&&(o===-1?true:n<o)};const Qe=A["default"];const Ze=Xe;const et=process.env;let tt;if(Ze("no-color")||Ze("no-colors")||Ze("color=false")){tt=false}else if(Ze("color")||Ze("colors")||Ze("color=true")||Ze("color=always")){tt=true}if("FORCE_COLOR"in et){tt=et.FORCE_COLOR.length===0||parseInt(et.FORCE_COLOR,10)!==0}function rt(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function nt(e){if(tt===false){return 0}if(Ze("color=16m")||Ze("color=full")||Ze("color=truecolor")){return 3}if(Ze("color=256")){return 2}if(e&&!e.isTTY&&tt!==true){return 0}const t=tt?1:0;if(process.platform==="win32"){const e=Qe.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in et){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in et))||et.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in et){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(et.TEAMCITY_VERSION)?1:0}if(et.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in et){const e=parseInt((et.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(et.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(et.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(et.TERM)){return 1}if("COLORTERM"in et){return 1}if(et.TERM==="dumb"){return t}return t}function ot(e){const t=nt(e);return rt(t)}var st={supportsColor:ot,stdout:ot(process.stdout),stderr:ot(process.stderr)};const at=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;const it=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;const lt=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;const ct=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;const ut=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function pt(e){if(e[0]==="u"&&e.length===5||e[0]==="x"&&e.length===3){return String.fromCharCode(parseInt(e.slice(1),16))}return ut.get(e)||e}function dt(e,t){const r=[];const n=t.trim().split(/\s*,\s*/g);let o;for(const t of n){if(!isNaN(t)){r.push(Number(t))}else if(o=t.match(lt)){r.push(o[2].replace(ct,((e,t,r)=>t?pt(t):r)))}else{throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`)}}return r}function ft(e){it.lastIndex=0;const t=[];let r;while((r=it.exec(e))!==null){const e=r[1];if(r[2]){const n=dt(e,r[2]);t.push([e].concat(n))}else{t.push([e])}}return t}function vt(e,t){const r={};for(const e of t){for(const t of e.styles){r[t[0]]=e.inverse?null:t.slice(1)}}let n=e;for(const e of Object.keys(r)){if(Array.isArray(r[e])){if(!(e in n)){throw new Error(`Unknown Chalk style: ${e}`)}if(r[e].length>0){n=n[e].apply(n,r[e])}else{n=n[e]}}}return n}var ht=(e,t)=>{const r=[];const n=[];let o=[];t.replace(at,((t,s,a,i,l,c)=>{if(s){o.push(pt(s))}else if(i){const t=o.join("");o=[];n.push(r.length===0?t:vt(e,r)(t));r.push({inverse:a,styles:ft(i)})}else if(l){if(r.length===0){throw new Error("Found extraneous } in Chalk template literal")}n.push(vt(e,r)(o.join("")));o=[];r.pop()}else{o.push(c)}}));n.push(o.join(""));if(r.length>0){const e=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(e)}return n.join("")};(function(e){const t=Me;const r=Pe.exports;const n=st.stdout;const o=ht;const s=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm");const a=["ansi","ansi","ansi256","ansi16m"];const i=new Set(["gray"]);const l=Object.create(null);function c(e,t){t=t||{};const r=n?n.level:0;e.level=t.level===undefined?r:t.level;e.enabled="enabled"in t?t.enabled:e.level>0}function u(e){if(!this||!(this instanceof u)||this.template){const t={};c(t,e);t.template=function(){const e=[].slice.call(arguments);return v.apply(null,[t.template].concat(e))};Object.setPrototypeOf(t,u.prototype);Object.setPrototypeOf(t.template,t);t.template.constructor=u;return t.template}c(this,e)}if(s){r.blue.open="[94m"}for(const e of Object.keys(r)){r[e].closeRe=new RegExp(t(r[e].close),"g");l[e]={get(){const t=r[e];return d.call(this,this._styles?this._styles.concat(t):[t],this._empty,e)}}}l.visible={get(){return d.call(this,this._styles||[],true,"visible")}};r.color.closeRe=new RegExp(t(r.color.close),"g");for(const e of Object.keys(r.color.ansi)){if(i.has(e)){continue}l[e]={get(){const t=this.level;return function(){const n=r.color[a[t]][e].apply(null,arguments);const o={open:n,close:r.color.close,closeRe:r.color.closeRe};return d.call(this,this._styles?this._styles.concat(o):[o],this._empty,e)}}}}r.bgColor.closeRe=new RegExp(t(r.bgColor.close),"g");for(const e of Object.keys(r.bgColor.ansi)){if(i.has(e)){continue}const t="bg"+e[0].toUpperCase()+e.slice(1);l[t]={get(){const t=this.level;return function(){const n=r.bgColor[a[t]][e].apply(null,arguments);const o={open:n,close:r.bgColor.close,closeRe:r.bgColor.closeRe};return d.call(this,this._styles?this._styles.concat(o):[o],this._empty,e)}}}}const p=Object.defineProperties((()=>{}),l);function d(e,t,r){const n=function(){return f.apply(n,arguments)};n._styles=e;n._empty=t;const o=this;Object.defineProperty(n,"level",{enumerable:true,get(){return o.level},set(e){o.level=e}});Object.defineProperty(n,"enabled",{enumerable:true,get(){return o.enabled},set(e){o.enabled=e}});n.hasGrey=this.hasGrey||r==="gray"||r==="grey";n.__proto__=p;return n}function f(){const e=arguments;const t=e.length;let n=String(arguments[0]);if(t===0){return""}if(t>1){for(let r=1;r<t;r++){n+=" "+e[r]}}if(!this.enabled||this.level<=0||!n){return this._empty?"":n}const o=r.dim.open;if(s&&this.hasGrey){r.dim.open=""}for(const e of this._styles.slice().reverse()){n=e.open+n.replace(e.closeRe,e.open)+e.close;n=n.replace(/\r?\n/g,`${e.close}$&${e.open}`)}r.dim.open=o;return n}function v(e,t){if(!Array.isArray(t)){return[].slice.call(arguments,1).join(" ")}const r=[].slice.call(arguments,2);const n=[t.raw[0]];for(let e=1;e<t.length;e++){n.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&"));n.push(String(t.raw[e]))}return o(e,n.join(""))}Object.defineProperties(u.prototype,l);e.exports=u();e.exports.supportsColor=n;e.exports.default=e.exports})(xe);var mt=xe.exports;const gt=new Map;const bt=()=>{const t=[["svgo",{}],["gifsicle",{}],["jpegtran",{}],["pngquant",{}]];const r=t.map((t=>{const r=t[0];try{require.resolve(`imagemin-${r}`);return t}catch(t){if(!gt.get(r)){gt.set(r,true);const t=mt.magenta(`"npm install imagemin-${r} -D"`);e.Logger.warn(`Execute ${t} for assets optimization`,"@flatjs/evolve")}return null}})).filter(Boolean);if(r.length){return new E["default"]({minimizer:{implementation:E["default"].imageminMinify,options:{plugins:r}}})}return null};const yt=e=>new R["default"](ee(e.minimizeTerserOptions));const wt=(e,t)=>{if(e){return[]}return[yt(t),bt()].filter(Boolean)};class jt{constructor(e={}){this.verbose=void 0;this.cleanStaleWebpackAssets=void 0;this.protectWebpackAssets=void 0;this.cleanAfterEveryBuildPatterns=void 0;this.cleanOnceBeforeBuildPatterns=void 0;this.currentAssets=void 0;this.initialClean=void 0;this.outputPath=void 0;this.verbose=e.verbose===true||false;this.cleanStaleWebpackAssets=e.cleanStaleWebpackAssets===true||e.cleanStaleWebpackAssets===false?e.cleanStaleWebpackAssets:true;this.protectWebpackAssets=e.protectWebpackAssets===true||e.protectWebpackAssets===false?e.protectWebpackAssets:true;this.cleanAfterEveryBuildPatterns=Array.isArray(e.cleanAfterEveryBuildPatterns)?e.cleanAfterEveryBuildPatterns:[];this.cleanOnceBeforeBuildPatterns=Array.isArray(e.cleanOnceBeforeBuildPatterns)?e.cleanOnceBeforeBuildPatterns:["**/*"];this.currentAssets=[];this.initialClean=false;this.outputPath="";this.apply=this.apply.bind(this);this.handleInitial=this.handleInitial.bind(this);this.handleDone=this.handleDone.bind(this);this.removeFiles=this.removeFiles.bind(this)}apply(e){if(!e.options.output||!e.options.output.path){console.warn("clean-webpack-plugin: options.output.path not defined. Plugin disabled...");return}this.outputPath=e.options.output.path;const t=e.hooks;if(this.cleanOnceBeforeBuildPatterns.length!==0){t.emit.tap("clean-webpack-plugin",(e=>{this.handleInitial(e)}))}t.done.tap("clean-webpack-plugin",(e=>{this.handleDone(e)}))}handleInitial(e){if(this.initialClean){return}const t=e.getStats();if(t.hasErrors()){return}this.initialClean=true;this.removeFiles(this.cleanOnceBeforeBuildPatterns)}handleDone(e){if(e.hasErrors()){if(this.verbose){console.warn("clean-webpack-plugin: pausing due to webpack errors")}return}const t=e.toJson({assets:true}).assets||[];const r=t.map((e=>e.name));const n=this.currentAssets.filter((e=>{const t=r.includes(e)===false;return t}));this.currentAssets=r.sort();const o=[];if(this.cleanStaleWebpackAssets===true&&n.length!==0){o.push(...n)}if(this.cleanAfterEveryBuildPatterns.length!==0){o.push(...this.cleanAfterEveryBuildPatterns)}if(o.length!==0){this.removeFiles(o)}}removeFiles(t){try{const r=e.delFilesSync(t,{cwd:this.outputPath,dot:true,ignore:this.protectWebpackAssets?this.currentAssets:[]});if(this.verbose){r.forEach((e=>{const t=o.relative(process.cwd(),e);const r="removed";console.warn(`clean-webpack-plugin: ${r} ${t}`)}))}}catch(e){const t=/Cannot delete files\/folders outside the current working directory\./.test(e.message);if(t){const e="clean-webpack-plugin: Cannot delete files/folders outside the current working directory. Can be overridden with the `dangerouslyAllowCleanPatternsOutsideProject` option.";throw new Error(e)}throw e}}}const kt=t=>new jt({verbose:true,cleanOnceBeforeBuildPatterns:[`${o.join(e.ensureSlash(t[0],true),"**/*")}`]});const Ct=(e,t)=>new S["default"]({filename:`[name]/${de("css",e,t==null?void 0:t.enableBundleHashName)}`,chunkFilename:"[id].[contenthash].css"});const xt="ExternalTemplateRemotesPlugin";const Ot=e=>e.constructor.name==="ExternalModule";class Mt{apply(e){e.hooks.make.tap(xt,(e=>{const t=[];e.hooks.buildModule.tap(xt,(e=>{if(Ot(e)&&e.externalType==="script"){t.push(e)}}));e.hooks.afterCodeGeneration.tap(xt,(()=>{t.map((t=>{const r=q["default"](t.request)[0];const n=Pt(r);const o=e.codeGenerationResults.get(t,undefined).sources;const s=o.get("javascript");if(s){const e=new g.RawSource(s.source().toString().replace(`"${r}"`,n));o.set("javascript",e)}}))}))}))}}function Pt(e){const t=[];const r=[];let n=false;let o=false;for(const s of e){if(s==="["){if(n){o=true;break}n=true;if(r.length){t.push(`"${r.join("")}"`);r.length=0}}else if(s==="]"){if(!n){o=true;break}n=false;if(r.length){t.push(`${r.join("")}`);r.length=0}r.length=0}else{r.push(s)}}if(n||o){throw new Error(`Invalid template URL "${e}"`)}if(r.length){t.push(`"${r.join("")}"`)}return t.join(" + ")}const St=`HtmlInjectScriptPlugin`;class At{constructor(e){this.scripts=void 0;this.scripts=e||[]}processScripts(){return this.scripts.filter(Boolean).map((e=>({tagName:"script",innerHTML:e,voidTag:false,attributes:{},meta:{plugin:"html-inject-script-webpack-plugin"}})))}apply(e){e.hooks.compilation.tap(`${St}_compilation`,(e=>{const t=T["default"].getHooks(e);t.alterAssetTags.tap(`${St}_alterAssetTags`,(e=>{e.assetTags.scripts.unshift(...this.processScripts());return e}))}))}}const Et=(e="")=>e.replace(/[\/-]/gi,"_").toLowerCase();const Rt=e=>o.join(e,`micro-remote-module.js`);const Bt=(t,[r,n],o)=>{var s;const a=(s=n.options)==null?void 0:s.moduleFederation;const i=[];if(a){const{remotes:n,...s}=a;const l=Rt(r);const u=Et(r);const p=(n||[]).map((({name:t,endpoint:r})=>{const n=Et(t);const o=Rt(t);const s=r?e.ensureSlash(r(t),false):`[window.evolveFetchMicroWidgets()]`;return{[n]:`${n}@${s}/${o}`}}));i.push(new c.container.ModuleFederationPlugin({name:u,filename:l,remotes:p,...s}),new Mt);if(!t){i.unshift(new At([ae(o)]))}}return i};const $t={minifyJS:true,removeComments:true,collapseWhitespace:true,collapseBooleanAttributes:false};const qt=(e,t,[r,n],o)=>{const s=[];const{options:a}=n;const i=e?"development":"production";for(const e of o){s.push(new T["default"]({inject:"body",title:K("title",i,a==null?void 0:a.title),chunks:[r],minify:(a==null?void 0:a.minify)===false?false:["me","dev"].includes(e)?false:$t,filename:`${r}/index${e==="prod"?"":`-${e}`}.html`,template:K("template",i,a==null?void 0:a.template).replace(`{0}`,e),templateParameters:{title:K("title",i,a==null?void 0:a.title),favicon:K("favicon",i,a==null?void 0:a.favicon),inlineScripts:K("inlineScripts",i,a==null?void 0:a.inlineScripts),headBeforeStyles:K("headBeforeStyles",i,a==null?void 0:a.headBeforeStyles),headBeforeScripts:K("headBeforeScripts",i,a==null?void 0:a.headBeforeScripts),bodyAfterScripts:K("bodyAfterScripts",i,a==null?void 0:a.bodyAfterScripts),viewport:ce(t,a)?K("viewport",i,a==null?void 0:a.viewport):""},multiCdn:{env:e,disabled:((a==null?void 0:a.excludeCdnEnvs)||["me","dev","ntv"]).includes(e)}}))}return s};class Tt{constructor(e){var t;this.config=e;this.pluginName="FlatEvolveMultiCdnPlugin";this.requireFn=c.RuntimeGlobals.publicPath;if(!((t=this.config)!=null&&t.prod)){throw new Error("We must setup `prod` for each CDN config node!")}}apply(e){e.hooks.thisCompilation.tap(this.pluginName,(e=>{e.mainTemplate.hooks.requireExtensions.tap(this.pluginName,((t,r)=>{var n;const o=[];o.push("// Dynamic assets path override(`@flatjs/evolve`) plugin-multi-html-cdn`)");const s=(n=e.chunkGraph)==null?void 0:n.getTreeRuntimeRequirements(r);if(s&&s.has(c.RuntimeGlobals.requireScope)){o.push("(function () {");o.push(c.Template.indent(`var flatjsMultiCdn = {`));o.push(c.Template.indent(c.Template.indent([`cdnConfig: ${JSON.stringify(this.config||{})},`])));o.push(c.Template.indent(c.Template.indent([`cdnFinder: ${oe.toString()}`])));o.push(c.Template.indent(`};`));o.push(c.Template.indent(`${this.requireFn} = flatjsMultiCdn.cdnFinder(flatjsMultiCdn.cdnConfig) || ${this.requireFn};`));o.push("})();")}return c.Template.asString(o)}))}));e.hooks.compilation.tap(this.pluginName,(e=>{T["default"].getHooks(e).beforeAssetTagGeneration.tap(this.pluginName,(e=>{const{assets:t}=e;const{userOptions:r}=e.plugin;const n=r.multiCdn;const s=t.publicPath;const a=t.js.map((e=>{if(n.disabled){return o.basename(e)}const t=se(this.config,n.env);return ne(t,e.replace(s,""))}));const i=t.css.map((e=>{if(n.disabled){return o.basename(e)}const t=se(this.config,n.env);return ne(t,e.replace(s,""))}));e.assets.js=a;e.assets.css=i;return e}))}))}}const Ft=(e,t,r)=>{var n;const o=[new $["default"]];if(r.analyzer){o.push(new m.BundleAnalyzerPlugin({analyzerPort:"auto",analyzerMode:"server",...r.analyzer}))}o.push(Ct(e,r.pluginLoaderOptions));o.push(...Bt(e,t,r.multiHtmlCdn));if(!e){o.push(kt(t));const n=Object.keys(r.multiHtmlCdn);o.push(...qt(e,r,t,n));o.push(new Tt(r.multiHtmlCdn))}const s=ye(((n=r.pluginLoaderOptions)==null?void 0:n.babelOptions)||{},e);if(s.usePreset==="react"&&e){o.push(new B["default"]({overlay:false}))}return o};const _t=(t,r,s,a)=>{process.env.NODE_ENV=t;r=e.ensureSlash(r,true);const i=t==="development";const l=a.projectCwd;const c=a.pluginLoaderOptions;const u=a.watchOptions;const p=ue(s);const d=n.isFunction(a.extraLoaders)?a.extraLoaders(i):a.extraLoaders;const f=[...Ce(i,a,p,c),...d||[]];const v=n.isFunction(a.extraPlugins)?a.extraPlugins(i):a.extraPlugins;const h=[...Ft(i,p,a),...v||[]];const m={mode:t,target:a.target,stats:{preset:"minimal"},infrastructureLogging:{level:"warn"},devtool:i?"eval-source-map":false,plugins:h,watchOptions:u,context:l,cache:{type:"memory"},resolve:{mainFields:["browser","module","main"],extensions:[".ts",".tsx",".js",".json",".vue"],alias:a.resolveAlias||{}},module:{rules:f},externals:V(i,a.externals,p),performance:Z(i,a.performance),output:{devtoolModuleFilenameTemplate:({namespace:e,resourcePath:t})=>`webpack:///${o.join(e,t)}`,environment:{},pathinfo:false,path:o.join(l,"public"),publicPath:r,filename:`[name]/${de("js",i,c==null?void 0:c.enableBundleHashName)}`,chunkFilename:`[id].[contenthash].js`},optimization:{nodeEnv:i?"development":"production",chunkIds:i?"named":"named",moduleIds:i?"named":"named",minimize:a.minimize===false?false:i?false:true,minimizer:wt(i,a),splitChunks:{name:false,chunks:"all",minSize:25e5,cacheGroups:{default:false,defaultVendors:false}}}};return m};const Dt=(e,t,r)=>{const n=_t("production",t,e,r);const o=ie(e,n);if(o.length>1){throw new Error("startSingleEntryBuild() only support `compiler` at a time")}const s=o[0];return new Promise(((e,t)=>{P["default"](s,((n,o)=>{var a,i;if(n){return t(n)}const l=o==null?void 0:o.toJson();if(l!=null&&(a=l.errors)!=null&&a.length){return t(l.errors)}if(r.forBuild.rejectWarnings&&l!=null&&(i=l.warnings)!=null&&i.length){return t(l.warnings)}e({name:s.name,warningStats:l==null?void 0:l.warnings})}))}))};const It=async(t,r)=>{var n;await e.keepPackageDepsUpToDateForNonMonoRepo({cwd:process.cwd(),autoUpgrade:true,needVerifyPackages:r.needVerifyPackages||{}});const o=((n=r.multiHtmlCdn)==null?void 0:n.prod)||[];const s=[];const a=e.ensureSlash(o[Math.floor(Math.random()*o.length)],true);for(const[e,n]of Object.entries(t)){const t=le(n,r);const o={[e]:n};s.push(Dt(o,a,t))}return Promise.all(s)};const Nt=async(t,r,s)=>{const a=await e.getPackageDir(__dirname,process.cwd());const l=i.readFileSync(o.join(a,"./templates/main.html"),"utf-8");const c=[];for(const[n]of Object.entries(s.entryMap)){const o=Object.keys(t).includes(n);c.push({name:n.replace(s.projectVirtualPath,"").replace(/^\//,""),link:e.urlJoin(r,["pages",n],{env:"me"}),flagText:o?"serve":"static",isServed:o?1:0})}const u={title:"@flatjs/evolve",modules:c.sort(((e,t)=>t.isServed-e.isServed))};return n.template(l)(u)};const zt=async(t,r,s,a,l,c)=>{const u=c.entryMap;const p=Object.keys(u).sort(((e,t)=>t.length-e.length));const d=await e.getPackageDir(__dirname,process.cwd());const f=p.find((t=>e.ensureSlash(s.path.replace(/^\//,""),true).startsWith(e.ensureSlash(t,true))));if(!f){const e=i.readFileSync(o.join(d,`./templates/module-404.html`),"utf-8");return n.template(e)({title:"404 Not Found",errorMeta:[{name:`@flatjs/evolve workspace`,value:d},{name:`served entry names`,value:JSON.stringify(p)},{name:`module path`,value:`${s.path}`}]})}const v=u[f];const h=v.options;const m=t[f];const g=(m==null?void 0:m.devServerHostUri)||a;const b=(h==null?void 0:h.serveModuleTemplate)||"./templates/module.html";const y=o.join(c.projectCwd,"./templates/module.html");const w=i.readFileSync(o.isAbsolute(b)?b:e.existsSync(y)?y:o.join(d,"./templates/module.html"),"utf-8");const j=c.forServe;const k=j.defaultServeGlobalData?j.defaultServeGlobalData(v,a):{};const C={title:K("title",r,h==null?void 0:h.title),favicon:K("favicon",r,h==null?void 0:h.favicon),viewport:ce(c,h)?K("viewport",r,h==null?void 0:h.viewport):"",inlineScripts:K("inlineScripts",r,h==null?void 0:h.inlineScripts),headBeforeStyles:K("headBeforeStyles",r,h==null?void 0:h.headBeforeStyles),headBeforeScripts:K("headBeforeScripts",r,h==null?void 0:h.headBeforeScripts),bodyAfterScripts:K("bodyAfterScripts",r,h==null?void 0:h.bodyAfterScripts),moduleFederationScripts:ae({me:[e.urlJoin(a,["public"])]}),global:{hostUrl:a,apiBase:e.urlJoin(a,[l]),routeBaseName:o.join(`/pages`,f),...k,...(h==null?void 0:h.serveGlobalData)||{}},styles:[e.urlJoin(g,[o.join("public",f,"bundle.css")])],scripts:[e.urlJoin(g,[o.join("public",f,"bundle.js")])]};return n.template(w)(C)};const Lt=(e,t,r,n,o)=>{const s=async(s,a)=>{let i;if(s.path==="/"){i=await Nt(n,t,o)}else{i=await zt(n,e,s,t,r,o)}a.send(i)};return(o.forServe.pageMiddlewares||[]).concat(s)};const Wt=t=>async(r,n)=>{const s=r.baseUrl;if(!s.startsWith("/public")){n.redirect("/pages")}else{const r=await e.fileWalk(o.join("public/","**/*.{js,css}"),{cwd:t});const a=o.extname(s);const i=r.find((e=>o.extname(e)===a&&e.indexOf(s.replace(/\.(js|css)$/,""))!==-1));if(i){n.sendFile(i)}else{n.sendFile(o.join(t,s))}}};const Ut=(e,t="development",n,o,s,a,i)=>{const l=_["default"]();r.attachMockMiddlewares(l,i);l.set("hostUri",o);l.use("/pages",...Lt(t,o,i.apiContext||"api",s,a));l.use("*",Wt(e));return new Promise((e=>{const t=a.https?D["default"].createServer(a.https,l):l;t.listen(n,(()=>{e(true)}))}))};const Gt=(e,t,r)=>{const{projectCwd:n,https:s,liveReload:a}=r;const i=new F["default"]({server:{type:s?"https":"http",options:{...s}},open:false,compress:true,port:t,hot:!a,liveReload:a,allowedHosts:"all",static:{directory:`${o.join(n,"/public")}`},headers:{"Access-Control-Allow-Origin":"*"},client:{progress:true,overlay:{errors:true,warnings:false}}},e);return new Promise(((e,t)=>{i.startCallback((r=>{if(r){return t(r)}e(true)}))}))};const Ht=async(t,s,a,i)=>{await e.keepPackageDepsUpToDateForNonMonoRepo({cwd:process.cwd(),autoUpgrade:true,needVerifyPackages:a.needVerifyPackages||{}});if(a.https){i.https=a.https}const{mockPort:l,hostUri:u}=await r.prepareMockDomain(i);const p=e.urlJoin(u,["/pages"]);let d=l;const f=[];const v={};for(const[e]of Object.entries(s)){d=d+1;const{mockPort:t,hostUri:o}=await r.prepareMockDomain(n.merge({},i,{port:d}));v[e]={devServerPort:t,devServerHostUri:o}}for(const[r,n]of Object.entries(s)){var h,m;const s=((h=n.options)==null?void 0:(m=h.moduleFederation)==null?void 0:m.remotes)||[];s.forEach((t=>{t.endpoint=t=>{var r;return e.urlJoin(((r=v[t])==null?void 0:r.devServerHostUri)||u,["/public"])}}));const{devServerPort:i,devServerHostUri:l}=v[r];const d=e.urlJoin(l,["public"]);const g={[r]:n};const b=le(n,a);const y=_t("development",d,g,b);const w=c.webpack(ie(g,y)[0]);f.push(Gt(w,i,a));const j=mt.bgBlack(`[${mt.magenta("@flatjs")}:${mt.bold(w.name||"")}]`);w.hooks.invalid.tap("fileChange",(e=>{console.log(j,`${"file change".padEnd(12," ")} ➩ ${mt.cyan(o.relative(t,e||""))}`)}));w.hooks.done.tap("compileDone",(()=>{console.log(j,`${"serve page".padEnd(12," ")} ➩ ${mt.cyan(p)}`)}))}await Ut(t,"development",l,u,v,a,i);re(p);return Promise.all(f).then((()=>true)).catch((e=>{console.log("evolve serve err: ",e);return false}))};const Vt=async(t,n,o)=>{if(n.https){o.https=n.https}const{mockPort:s,hostUri:a}=await r.prepareMockDomain(o);const i=e.urlJoin(a,["/pages"]);return Ut(t,"development",s,a,{},n,o).then((e=>{const t=mt.bgBlack(`[${mt.magenta("@flatjs")}:`);console.log(t,`${"serve page".padEnd(12," ")} ➩ ${mt.cyan(i)}`);return e}))};const Jt=(e={},t={})=>{const r={};for(const[o,s]of Object.entries(t)){const t={options:{}};if(e[o]){r[o]=n.merge({},t,s,e[o])}n.merge(s,t)}return r};const Yt=(e,t,r={})=>{const n=te(e,r);const o=Jt(t,n.entryMap);return It(o,n)};const Kt=(e,t,n={},o={})=>{const s=te(e,n);const a=r.loadMockConfiguration(e,o);const i=Jt(t,s.entryMap);return Ht(e,i,s,a)};const Xt=(e,t={},n={})=>{const o=te(e,t);const s=r.loadMockConfiguration(e,n);return Vt(e,o,s)};exports.cdnBoot=G;exports.cdnJsDelivr=U;exports.cdnUnpkg=W;exports.createPageMiddleware=Lt;exports.createPublicAssetsMiddleware=Wt;exports.defaultFlatjsConfig=H;exports.evolveBuild=Yt;exports.evolveServe=Kt;exports.evolveStatic=Xt;exports.flatBabelOptions=z;exports.flatExternalOptions=V;exports.flatLessLoaderOptions=X;exports.flatPerformanceOptions=Z;exports.flatPostcssLoaderOptions=Q;exports.getHtmlPluginConfig=K;exports.loadEvolveConfiguration=te;exports.loadModule=N;exports.normalizeEntries=Jt;exports.polyfill=L;exports.terserOptions=ee;exports.viewportScripts=J;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@flatjs/evolve",
|
3
|
-
"version": "1.4.
|
3
|
+
"version": "1.4.12",
|
4
4
|
"description": "the webpack based tools `evolve` of @flatjs",
|
5
5
|
"keywords": [
|
6
6
|
"shared",
|
@@ -23,11 +23,11 @@
|
|
23
23
|
],
|
24
24
|
"dependencies": {
|
25
25
|
"@babel/core": "^7.17.10",
|
26
|
-
"@flatjs/common": "^1.4.
|
26
|
+
"@flatjs/common": "^1.4.12",
|
27
27
|
"@flatjs/evolve-preset-babel": "^1.4.11",
|
28
28
|
"@flatjs/forge-plugin-postcss-pixel": "^1.3.14",
|
29
|
-
"@flatjs/mock": "^1.4.
|
30
|
-
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.
|
29
|
+
"@flatjs/mock": "^1.4.12",
|
30
|
+
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.6",
|
31
31
|
"babel-loader": "^8.2.5",
|
32
32
|
"babel-merge": "^3.0.0",
|
33
33
|
"babel-plugin-import": "^1.13.5",
|
@@ -48,9 +48,9 @@
|
|
48
48
|
"react-refresh": "^0.13.0",
|
49
49
|
"svgo": "^2.8.0",
|
50
50
|
"terser-webpack-plugin": "^5.3.1",
|
51
|
-
"webpack": "^5.72.
|
51
|
+
"webpack": "^5.72.1",
|
52
52
|
"webpack-bundle-analyzer": "^4.5.0",
|
53
|
-
"webpack-dev-server": "4.
|
53
|
+
"webpack-dev-server": "4.9.0",
|
54
54
|
"webpack-sources": "^3.2.3"
|
55
55
|
},
|
56
56
|
"devDependencies": {
|
@@ -69,5 +69,5 @@
|
|
69
69
|
"publishConfig": {
|
70
70
|
"access": "public"
|
71
71
|
},
|
72
|
-
"gitHead": "
|
72
|
+
"gitHead": "e4f6eb14a8babe63921445628f44ccf2146fde98"
|
73
73
|
}
|