@moneko/core 4.8.6-beta.13 → 4.8.6-beta.15
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/lib/config.mjs +1 -1
- package/lib/loader/css-in-js-minify.cjs +1 -1
- package/lib/loader/react-compiler.cjs +1 -1
- package/lib/loader/solid.cjs +1 -1
- package/lib/plugin/compression.mjs +1 -1
- package/lib/plugin/eslint.mjs +1 -1
- package/lib/plugin/html-plugin.mjs +1 -1
- package/lib/plugin/stylelint.mjs +1 -1
- package/lib/process-env.d.mts +1 -0
- package/lib/process-env.mjs +1 -1
- package/package.json +1 -1
package/lib/config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{sep as e}from"node:path";import o from"node:process";import{merge as t}from"webpack-merge";import{CUSTOMCONFIG as n}from"./commom/custom-config.mjs";import s from"./commom/paths.mjs";import{join as a}from"./commom/posix.mjs";import i from"./commom/setup-env.mjs";import r from"./options/jsx-dom-expressions.mjs";import m from"./options/split-chunk.mjs";import{getConfigWithTypescript as l,isFunction as p,node_modules as c,resolveProgram as u}from"./utils/index.mjs";import{initDts as d}from"./vm/dts.mjs";import{APPTYPE as f,FRAMEWORK as h,frameworkVersion as g,
|
|
1
|
+
import{sep as e}from"node:path";import o from"node:process";import{merge as t}from"webpack-merge";import{CUSTOMCONFIG as n}from"./commom/custom-config.mjs";import s from"./commom/paths.mjs";import{join as a}from"./commom/posix.mjs";import i from"./commom/setup-env.mjs";import r from"./options/jsx-dom-expressions.mjs";import m from"./options/split-chunk.mjs";import{getConfigWithTypescript as l,isFunction as p,node_modules as c,resolveProgram as u}from"./utils/index.mjs";import{initDts as d}from"./vm/dts.mjs";import{APPTYPE as f,FRAMEWORK as h,frameworkVersion as g,isBuild as v,isCI as x,isDev as b,isLibrary as j,isMobile as C,isReact as P,jsxImportSource as k,mainDirectory as w,NODE_ENV as O,PACKAGENAME as y}from"./process-env.mjs";let S=[/(app|vm|docs|example):[a-zA-Z_0-9]/,"@moneko","neko-ui",".cache/http/data","@element-plus","ant-design-vue","element-plus","element-ui","ng-zorro-antd","@mui","@du","@fontsource","@fortawesome","font-pingfang-sc","font-pingfang-tc","katex","react-markdown-editor-lite","react-photo-view","schema-design","monaco-editor"];export async function getConfig(e){let t=l(e).default;return(p(t)?await t(o):t)??{}}let I=await i(O,f,h,[],v,n),[M,z]=await Promise.all([getConfig(s.configPath),getConfig(s.customConfigPath)]),F={mode:O,strict:!1,devtool:v||!b?"cheap-module-source-map":"eval-cheap-module-source-map",seo:!1,bundleAnalyzer:!1,polyfill:!1,entry:{},minifier:(!!x||!b)&&{},sourceMap:{filename:"[file].map",publicPath:"",namespace:y,moduleFilenameTemplate:"moneko://[namespace]/[resource-path]?[loaders]",fallbackModuleFilenameTemplate:"moneko://[namespace]/[resource-path]?[loaders]"},env:I,basename:"/",publicPath:"auto",rem:{designSize:C?375:1920},fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:Object.assign({"@":u(w)},P&&g<18?{"react/package.json":c("react/package.json"),"react/jsx-runtime":c("react/jsx-runtime.js"),"react/jsx-dev-runtime":c("react/jsx-dev-runtime.js")}:{}),moduleRules:[],prefixJsLoader:[],cssModules:[],cssModuleDefinition:!0,importOnDemand:{},proxy:{},devServer:{host:"localhost",port:3e3,open:!0},htmlPluginOption:{title:y.toLocaleUpperCase(),favicon:"https://h5static.dewucdn.com/node-common/718d5e10-576d-8b14-b0b1-e4c58c3b3f40.webp"},copy:{},routerMode:"browser",fixBrowserRouter:!1,plugins:[],resolvePlugins:[],overrideResolve:!1,splitChunk:m,runtimeChunk:"single",moduleFederation:[],rulesInclude:{css:S,js:S,media:S,font:S,wasm:[]},mdx:{jsx:!1,development:b,jsxImportSource:k,providerImportSource:`@moneko/${h}/mdx`},jsxDomExpressions:r,bar:{name:"Client",nameColor:"68",msgColor:"242",barBgColor:"15",barColor:"69",quiet:x},normalizeCss:!0,externalsPresets:{},buildHttp:void 0,virtualModule:{},cssExtract:{},externals:["@swc/core"],lazyCompilation:!1,performance:!1,refresh:"solid"!==h,bundleId:"com.moneko.bid",bundles:[],stylelint:{},eslint:{lintDirtyModulesOnly:!1},minChunkSize:1e3,compression:!1,manifest:{filename:"site.webmanifest"},corepack:!0,reactJsxRuntime:"automatic"};j&&(F.alias=Object.assign(F.alias,{"@pkg":s.componentsPath,[y]:s.componentsPath}));let A=F;if((!1===(A=t(A,M,z)).devtool||!1===A.sourceMap)&&(A.sourceMap=!1,A.devtool=!1),"true"===o.env.CODESPACES&&(A.devServer.https=!1),!1===A.devServer.https&&"darwin"===o.platform&&(A.devServer.open=!1),A.htmlPluginOption&&(A.htmlPluginOption.tags||(A.htmlPluginOption.tags=[]),A.fixBrowserRouter&&A.htmlPluginOption.tags.push({textContent:"(function(l) {if (l.search[1] === '/' ) {var decoded = l.search.slice(1).split('&').map(function(s) {return s.replace(/~and~/g, '&')}).join('?');window.history.replaceState(null, null,l.pathname.slice(0, -1) + decoded + l.hash);}}(window.location))"}),A.manifest)){let o=A.manifest.publicPath??A.htmlPluginOption.publicPath??A.publicPath??"/";A.htmlPluginOption.tags.push({href:a("auto"===o?"/":o,A.manifest.filename).replaceAll(e,"/"),tag:"link",rel:"manifest"})}export const CONFIG=A;export const PUBLICPATH="auto"===CONFIG.publicPath?"":CONFIG.publicPath;d(CONFIG);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return r}});let e=require("node:path"),s=require("node:worker_threads"),t=require("../process-env.mjs"),i=new s.Worker((0,e.join)(__dirname,"../worker/css-in-js-minify.mjs"));async function r(e){(this._compiler?.options.mode!=="development"||t.isBuild)&&this._compiler?.hooks.done.tap("css-in-js-minify-loader",()=>{i.terminate()}),this.cacheable&&this.cacheable();let s=this.async(),r=this.getOptions(),o=this.resourcePath;i.postMessage({options:r,code:e,filename:o}),i.addListener("message",function e(t){o===t[0]&&(s(t[1],t[2]),i.removeListener("message",e))})}i.setMaxListeners(0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=exports,t={get custom(){return
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=exports,t={get custom(){return c},get default(){return d}};for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:Object.getOwnPropertyDescriptor(t,r).get});let s=require("node:path"),i=require("node:worker_threads"),o=require("../process-env.mjs"),n=new i.Worker((0,s.join)(__dirname,"../worker/react-compiler.mjs"));function a(e,t){(this._compiler?.options.mode!=="development"||o.isBuild)&&this._compiler?.hooks.done.tap("react-compiler-loader",()=>{n.terminate()});let r=this.resourcePath,s=this.getOptions();if(r.endsWith(".d.ts")||r.endsWith(".json")||!("annotation"===s.compilationMode?e.includes("use memo")||e.includes("use forget"):e.includes("react")||r.endsWith(".tsx")||r.endsWith(".jsx")))return e;let i=this.async();this.cacheable&&this.cacheable(),n.postMessage({sourceCode:e,filename:r,inputSourceMap:t,options:s}),n.addListener("message",function e(t){r===t[0]&&(i(t[1],t[2],t[3]),n.removeListener("message",e))})}function c(e,t){return a.bind(this,e,t)}n.setMaxListeners(0);let d=a;
|
package/lib/loader/solid.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=exports,t={get custom(){return
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=exports,t={get custom(){return c},get default(){return d}};for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:Object.getOwnPropertyDescriptor(t,r).get});let s=require("node:path"),o=require("node:worker_threads"),i=require("../process-env.mjs"),n=new o.Worker((0,s.join)(__dirname,"../worker/solid.mjs"));async function a(e,t){(this._compiler?.options.mode!=="development"||i.isBuild)&&this._compiler?.hooks.done.tap("solid-loader",()=>{n.terminate()}),this.cacheable&&this.cacheable();let r=this.async(),s=this.getOptions(),o=this.resourcePath;n.postMessage({...s,sourceCode:e,filename:o,inputSourceMap:t}),n.addListener("message",function e(t){o===t[0]&&(r(t[1],t[2],t[3]),n.removeListener("message",e))})}function c(e,t){return a.bind(this,e,t)}n.setMaxListeners(0);let d=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fileURLToPath as e}from"node:url";import{Worker as s}from"node:worker_threads";export class CompressionPlugin{constructor(t){this.name="CompressionPlugin";let{test:o,algorithm:r="brotli"}=t||{};this.options={test:o,algorithm:r,filename:`[path][base].${"brotli"===r?"br":"gz"}`},this.worker=new s(e(new URL("../worker/compression.mjs",import.meta.url))),this.worker.setMaxListeners(0)}async runCompressionAlgorithm(e,s){return new Promise(t=>{this.worker.postMessage({input:e,filename:s,algorithm:this.options.algorithm}),this.worker.addListener("message",e=>{e[0]===s&&t(Buffer.from(e[1]))})})}async compress(e,s,t){this.worker.removeAllListeners("message");let o=s.getCache(this.name),{RawSource:r}=e.webpack.sources;await Promise.allSettled(Object.keys(t).map(async t=>{let i,a="gzip"===this.options.algorithm?"gzipped":`${this.options.algorithm}ed`,{info:m,source:n}=s.getAsset(t);if(m.compressed||!e.webpack.ModuleFilenameHelpers.matchObject.bind(void 0,this.options)(t)||m.related&&m.related[a])return!1;let p=o.getItemCache(JSON.stringify(`${t}${this.options.algorithm}`),o.getLazyHashedEtag(n)),l=await p.getPromise()||{};if(!l.source){if("function"==typeof n.buffer)i=n.buffer();else{let e=n.source();i=Buffer.isBuffer(e)?e:Buffer.from(e)}if(!l.compressed&&i)try{l.compressed=await this.runCompressionAlgorithm(i,t)}catch(e){s.errors.push(e);return}l.compressed&&(l.source=new r(l.compressed)),await p.storePromise(l)}let h=s.getPath(this.options.filename,{filename:t}),c={compressed:!0};m.immutable&&/(\[name]|\[base]|\[file])/.test(this.options.filename)&&(c.immutable=!0),s.updateAsset(t,n,{related:{[a]:h}}),s.emitAsset(h,l.source,c)}))}apply(e){let s=this.name;(
|
|
1
|
+
import{fileURLToPath as e}from"node:url";import{Worker as s}from"node:worker_threads";import{isBuild as t,isDev as o}from"../process-env.mjs";export class CompressionPlugin{constructor(t){this.name="CompressionPlugin";let{test:o,algorithm:r="brotli"}=t||{};this.options={test:o,algorithm:r,filename:`[path][base].${"brotli"===r?"br":"gz"}`},this.worker=new s(e(new URL("../worker/compression.mjs",import.meta.url))),this.worker.setMaxListeners(0)}async runCompressionAlgorithm(e,s){return new Promise(t=>{this.worker.postMessage({input:e,filename:s,algorithm:this.options.algorithm}),this.worker.addListener("message",e=>{e[0]===s&&t(Buffer.from(e[1]))})})}async compress(e,s,t){this.worker.removeAllListeners("message");let o=s.getCache(this.name),{RawSource:r}=e.webpack.sources;await Promise.allSettled(Object.keys(t).map(async t=>{let i,a="gzip"===this.options.algorithm?"gzipped":`${this.options.algorithm}ed`,{info:m,source:n}=s.getAsset(t);if(m.compressed||!e.webpack.ModuleFilenameHelpers.matchObject.bind(void 0,this.options)(t)||m.related&&m.related[a])return!1;let p=o.getItemCache(JSON.stringify(`${t}${this.options.algorithm}`),o.getLazyHashedEtag(n)),l=await p.getPromise()||{};if(!l.source){if("function"==typeof n.buffer)i=n.buffer();else{let e=n.source();i=Buffer.isBuffer(e)?e:Buffer.from(e)}if(!l.compressed&&i)try{l.compressed=await this.runCompressionAlgorithm(i,t)}catch(e){s.errors.push(e);return}l.compressed&&(l.source=new r(l.compressed)),await p.storePromise(l)}let h=s.getPath(this.options.filename,{filename:t}),c={compressed:!0};m.immutable&&/(\[name]|\[base]|\[file])/.test(this.options.filename)&&(c.immutable=!0),s.updateAsset(t,n,{related:{[a]:h}}),s.emitAsset(h,l.source,c)}))}apply(e){let s=this.name;(!o||t)&&e.hooks.done.tap(this.name,()=>{this.worker.terminate()}),e.hooks.thisCompilation.tap(s,t=>{t.hooks.processAssets.tapPromise({name:s,stage:e.webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER,additionalAssets:!0},s=>this.compress(e,t,s))})}}
|
package/lib/plugin/eslint.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fileURLToPath as
|
|
1
|
+
import{fileURLToPath as t}from"node:url";import{Worker as e}from"node:worker_threads";import s from"webpack";import{isBuild as o,isDev as r}from"../process-env.mjs";class i extends s.WebpackError{constructor(t){super(`[ESLint] ${t}`),this.name="ESLintError",this.stack=""}}export class ESLintPlugin{constructor(s={files:[]}){this.name="ESLintPlugin",this.options=s,this.worker=new e(t(new URL("../worker/eslint.mjs",import.meta.url))),this.worker.setMaxListeners(0)}apply(t){(!r||o)&&t.hooks.done.tap(this.name,()=>{this.worker.terminate()}),t.hooks.thisCompilation.tap(this.name,e=>{let s=t.modifiedFiles||new Set,o=t=>{this.report(e,t)};this.worker.on("message",o),e.hooks.finishModules.tap(this.name,t=>{let e=this.options;if(this.options?.lintDirtyModulesOnly){let o=[];for(let e of t){let t=e.resource;s.has(t)&&o.push(t)}e.files=o}this.worker.postMessage({options:e})})})}report(t,e){e?.length&&t&&(e[0]?.length&&t.warnings.push(new i(e[0])),e[1]?.length&&t.errors.push(new i(e[1])))}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as t,readFileSync as e}from"node:fs";import{basename as s,resolve as i,sep as o}from"node:path";import n from"webpack";import{isNetworkUrl as a,join as h}from"../commom/posix.mjs";export class HtmlPlugin{constructor(t={}){this.AddEntry=/(?:.*\/)?main\.[a-zA-Z0-9]+\.entry\.js$/,this.faviconPath="",this.name="HtmlPlugin",this.cachedMetaTags=null,this.cachedCustomTags=null,this.options={title:"WebApp",filename:"index.html",inject:"head",...t}}getPublicPath(t){if("string"==typeof this.options.publicPath)return this.options.publicPath;let e=t.getAssetPath(t.outputOptions.publicPath,{hash:t.hash}),s="auto"===e?"":e;return s.length&&!s.endsWith("/")&&(s+="/"),s}apply(
|
|
1
|
+
import{existsSync as t,readFileSync as e}from"node:fs";import{basename as s,resolve as i,sep as o}from"node:path";import n from"webpack";import{isNetworkUrl as a,join as h}from"../commom/posix.mjs";import{isBuild as r,isDev as l}from"../process-env.mjs";export class HtmlPlugin{constructor(t={}){this.AddEntry=/(?:.*\/)?main\.[a-zA-Z0-9]+\.entry\.js$/,this.faviconPath="",this.name="HtmlPlugin",this.cachedMetaTags=null,this.cachedCustomTags=null,this.options={title:"WebApp",filename:"index.html",inject:"head",...t}}getPublicPath(t){if("string"==typeof this.options.publicPath)return this.options.publicPath;let e=t.getAssetPath(t.outputOptions.publicPath,{hash:t.hash}),s="auto"===e?l&&!r?"/":"":e;return s.length&&!s.endsWith("/")&&(s+="/"),s}apply(r){r.hooks.compilation.tap(this.name,l=>{l.hooks.processAssets.tap({name:this.name,stage:n.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL},()=>{let c;if(this.options.favicon)if(a(this.options.favicon))this.faviconPath=this.options.favicon;else{let a=i(r.context,this.options.favicon);if(t(a)){let t=s(this.options.favicon),i=e(a);l.emitAsset(t,new n.sources.RawSource(i),{javascriptModule:!1});let r=this.getPublicPath(l);this.faviconPath=h(r,t).replaceAll(o,"/")}else l.warnings.push(new n.WebpackError(`Favicon file ${a} does not exist`))}if(c=this.options.templateContent?this.options.templateContent(this.options):this.options.template?e(i(r.context,this.options.template),{encoding:"utf-8"}):this.generateDefaultTemplate(),this.options.inject){let t=this.getAssets(l);c=this.injectAssets(c,t,this.options.inject)}let p="function"==typeof this.options.filename?this.options.filename("index"):this.options.filename||"index.html";l.emitAsset(p,new n.sources.RawSource(c),{javascriptModule:!1})})})}generateDefaultTemplate(){let t=this.generateMetaTags();return`<!DOCTYPE html><html><head><meta charset="utf-8">${t}<title>${this.options.title}</title><link rel="icon" type="image/x-icon" href="${this.faviconPath}"></head><body><div id="root"></div></body></html>`}generateMetaTags(){if(null!==this.cachedMetaTags)return this.cachedMetaTags;if(!this.options.meta)return this.cachedMetaTags="","";let t=Object.entries(this.options.meta).map(([t,e])=>{if("string"==typeof e)return`<meta name="${t}" content="${e}">`;if(void 0===e)return"";let s=Object.entries(e).map(([t,e])=>`${t}="${e}"`).join(" ");return`<meta ${s}>`}).join("");return this.cachedMetaTags=t,t}generateCustomTags(){if(null!==this.cachedCustomTags)return this.cachedCustomTags;let t={head:"",body:""};if(!this.options.tags)return this.cachedCustomTags=t,t;let e=[],s=[];return this.options.tags.forEach(t=>{let{tag:i="script",textContent:o="",inject:n=this.options.inject,...a}=t,h=Object.entries(a).filter(([,t])=>null!=t).map(([t,e])=>!0===e?t:`${t}="${e}"`).join(" "),r=`<${i} ${h}>${o}</${i}>`;"head"===n?e.push(r):s.push(r)}),t.head=e.join(""),t.body=s.join(""),this.cachedCustomTags=t,t}getAssets(t){let e={js:[],css:[]},s=["import-scripts","require","async-node"],i=this.getPublicPath(t);for(let n of t.entrypoints.values())for(let t of n.chunks){let n=t.getEntryOptions(),a=n?.chunkLoading;if(!(n?.asyncChunks||a&&s.includes(a)))for(let s of t.files)s.endsWith(".js")?e.js.push(h(i,s).replaceAll(o,"/")):s.endsWith(".css")&&e.css.push(h(i,s).replaceAll(o,"/"))}return e}injectAssets(t,e,s){let i=e.css.length?e.css.map(t=>`<link href="${t}" rel="stylesheet" />`).join(""):"",o=e.js.length?e.js.map(t=>`<script defer ${this.AddEntry.test(t)?'entry="true" ':""}src="${t}"></script>`).join(""):"",n=this.generateCustomTags(),a=t.split("</head>");if(2===a.length){let[t,e]=a,h=e.split("</body>");return"head"===s?`${t}${i}${o}${n.head}</head>${h[0]}${n.body}</body>${h[1]||""}`:`${t}${n.head}</head>${h[0]}${i}${o}${n.body}</body>${h[1]||""}`}return t}}
|
package/lib/plugin/stylelint.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fileURLToPath as t}from"node:url";import{Worker as e}from"node:worker_threads";import r from"webpack";
|
|
1
|
+
import{fileURLToPath as t}from"node:url";import{Worker as e}from"node:worker_threads";import r from"webpack";import{isBuild as s,isDev as o}from"../process-env.mjs";class i extends r.WebpackError{constructor(t){super(`[Stylelint] ${t}`),this.name="StylelintError",this.stack=""}}export class StylelintPlugin{constructor(r={files:[]}){this.name="StylelintPlugin",this.options=r,this.worker=new e(t(new URL("../worker/stylelint.mjs",import.meta.url))),this.worker.setMaxListeners(0)}apply(t){(!o||s)&&t.hooks.done.tap(this.name,()=>{this.worker.terminate()}),t.hooks.thisCompilation.tap(this.name,t=>{let e=e=>{this.report(e,t)};this.worker.postMessage({options:this.options}),this.worker.on("message",e)})}report(t,e){t?.length&&e&&(t[0]?.length&&e.warnings.push(new i(t[0])),t[1]?.length&&e.errors.push(new i(t[1])))}}
|
package/lib/process-env.d.mts
CHANGED
|
@@ -30,6 +30,7 @@ export declare const frameworkVersion: number;
|
|
|
30
30
|
export declare const projectNameCamelCase: string;
|
|
31
31
|
/** core 包名 */ export declare const coreName: string;
|
|
32
32
|
/** 是否为本地开发环境 */ export declare const isDev: boolean;
|
|
33
|
+
/** 是否为打包环境(打包开发模式的产物,一般用于支持模块联邦hmr) */ export declare const isBuild: boolean;
|
|
33
34
|
export declare const refresh: boolean;
|
|
34
35
|
export declare const isCI: boolean;
|
|
35
36
|
export declare const CACHE_NAME: string;
|
package/lib/process-env.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"node:process";import e from"./commom/has-pkg.mjs";import r from"./commom/is-ci-environment.mjs";import{CUSTOMCONFIG as t}from"./commom/paths.mjs";import{readJson as s}from"./commom/read-json.mjs";import{convertToCamelCase as c,md5 as p}from"./utils/index.mjs";export const packageJson=s(`${o.cwd()}/package.json`);delete packageJson.scripts;export const IS_WINDOW="win32"===o.platform;export const APPTYPE=o.env.APPTYPE;export const FRAMEWORK=o.env.FRAMEWORK??"react";export const NODE_ENV=o.env.NODE_ENV;export const isLibrary="library"===APPTYPE;export const isMicro="micro"===APPTYPE;export const isMobile="mobile"===APPTYPE;export const isReact="react"===FRAMEWORK;export const isSolid="solid"===FRAMEWORK;export const SSR="true"===o.env.SSR;export const app_schema="app";export const virtual_schema="vm";export const docs_schema="docs";export const example_schema="example";export const scope_schema="scope";export const service_worker_schema="sw";export const re_export_schema="re-export";export const module_federation_schema="mf";export const mainDirectory=isLibrary?"site":"src";export const jsxImportSource={react:"react",solid:"solid-js/h"}[FRAMEWORK];export const framework={react:"react",solid:"solid-js"}[FRAMEWORK];export const frameworkVersionStr=framework?s(`${framework}/package.json`).version:19;export const frameworkVersion=parseFloat(frameworkVersionStr);export const PACKAGENAME=packageJson.name;export const projectNameCamelCase=c(PACKAGENAME);export const coreName="@moneko/core";export const isDev="development"===NODE_ENV;export const refresh=!!(isDev&&e("solid"===FRAMEWORK?"solid-refresh":"react-refresh"));export const isCI=r();export const CACHE_NAME=p(`${PACKAGENAME}${t}${NODE_ENV}${o.argv[2]}`);
|
|
1
|
+
import o from"node:process";import e from"./commom/has-pkg.mjs";import r from"./commom/is-ci-environment.mjs";import{CUSTOMCONFIG as t}from"./commom/paths.mjs";import{readJson as s}from"./commom/read-json.mjs";import{convertToCamelCase as c,md5 as p}from"./utils/index.mjs";export const packageJson=s(`${o.cwd()}/package.json`);delete packageJson.scripts;export const IS_WINDOW="win32"===o.platform;export const APPTYPE=o.env.APPTYPE;export const FRAMEWORK=o.env.FRAMEWORK??"react";export const NODE_ENV=o.env.NODE_ENV;export const isLibrary="library"===APPTYPE;export const isMicro="micro"===APPTYPE;export const isMobile="mobile"===APPTYPE;export const isReact="react"===FRAMEWORK;export const isSolid="solid"===FRAMEWORK;export const SSR="true"===o.env.SSR;export const app_schema="app";export const virtual_schema="vm";export const docs_schema="docs";export const example_schema="example";export const scope_schema="scope";export const service_worker_schema="sw";export const re_export_schema="re-export";export const module_federation_schema="mf";export const mainDirectory=isLibrary?"site":"src";export const jsxImportSource={react:"react",solid:"solid-js/h"}[FRAMEWORK];export const framework={react:"react",solid:"solid-js"}[FRAMEWORK];export const frameworkVersionStr=framework?s(`${framework}/package.json`).version:19;export const frameworkVersion=parseFloat(frameworkVersionStr);export const PACKAGENAME=packageJson.name;export const projectNameCamelCase=c(PACKAGENAME);export const coreName="@moneko/core";export const isDev="development"===NODE_ENV;export const isBuild="true"===o.env.IS_BUILD;export const refresh=!!(isDev&&e("solid"===FRAMEWORK?"solid-refresh":"react-refresh"));export const isCI=r();export const CACHE_NAME=p(`${PACKAGENAME}${t}${NODE_ENV}${o.argv[2]}`);
|