@moneko/core 3.17.9 → 3.17.10
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/build.mjs +1 -1
- package/lib/config.mjs +1 -1
- package/lib/dev.mjs +1 -1
- package/lib/module.config.mjs +1 -1
- package/lib/plugin/copy.mjs +1 -1
- package/lib/plugin/override-resolve.mjs +1 -1
- package/lib/utils/read-conf.mjs +1 -1
- package/lib/utils/seo.mjs +1 -1
- package/lib/vm/coverage.mjs +1 -1
- package/lib/vm/docs.mjs +1 -1
- package/lib/vm/locales.mjs +2 -2
- package/lib/vm/modules.mjs +1 -1
- package/package.json +2 -1
package/lib/build.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from"webpack";import{merge as r}from"webpack-merge";import t from"./build/common.mjs";import m from"./build/server.mjs";import{CONFIG as i}from"./config.mjs";import e from"./module.config.mjs";import s from"./paths.mjs";import n from"./plugin/done.mjs";import{SSR as l}from"./process-env.mjs";import a from"./utils/log.mjs";import p from"./utils/seo.mjs";import f from"./utils/progress.mjs";import c from"chalk";import{removeDir as u}from"@moneko/utils";let{ProgressPlugin:g}=o,h=!!i.bar,d=r(t,{module:e(!1),plugins:[i.done&&new n({done:i.done}),new g({handler(o,r,...t){let m=i.bar||{};f({showBar:h,percentage:o,title:m.name||"Build",color:m.color,info:t.length?`[${r}] ${t.join(" ")}`:"",output:d.output?.path})}})].filter(Boolean)}),j=[d];l&&j.push(r(t,m));let w=o(j);async function b(){await new Promise(o=>{w.run((r,t)=>{if(r)throw r;if(t&&(t.hasErrors()||t.hasWarnings()))for(let o=0,r=t.stats.length;o<r;o++){let r=t.stats[o];for(let o=0,t=r.compilation.warnings.length;o<t;o++)a(c.yellowBright(r.compilation.warnings[o].message));for(let o=0,t=r.compilation.errors.length;o<t;o++)a(c.redBright(r.compilation.errors[o].message))}o(r)})}),i.seo&&p()}await b(),process.on("exit",function(){u(s.cachePath)});
|
package/lib/config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{merge as e}from"webpack-merge";import o from"./options/jsx-dom-expressions.mjs";import t from"./options/split-chunk.mjs";import s,{CUSTOMCONFIG as i}from"./paths.mjs";import{APPTYPE as r,FRAMEWORK as n,NODE_ENV as a,PACKAGENAME as l,isDev as m,isLibrary as p,isMobile as c,jsxImportSource as u,mainDirectory as d}from"./process-env.mjs";import{isFunction as f,resolveProgram as h}from"./utils/index.mjs";import g from"./utils/read-conf.mjs";import x from"./utils/setup-env.mjs";import{fileExists as v}from"@moneko/utils";let P=["@moneko","neko-ui","antd","@antv","katex","font-pingfang-sc","font-pingfang-tc","react-photo-view","react-markdown-editor-lite","schema-design","@app",".cache/http/data"],w={devtool:m?"eval-cheap-module-source-map":"cheap-module-source-map",seo:!1,mode:"csr",bundleAnalyzer:!1,polyfill:!1,entry:{},minifier:{},sourceMap:{filename:"[file].map",publicPath:""},env:x(a,r,n),basename:"/",publicPath:"/",rem:{designSize:c?375:1680},fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:{"@":h(d)},moduleRules:[],prefixJsLoader:[],cssModules:[],cssModuleDefinition:!0,importOnDemand:{},proxy:{},cacheDirectory:s.webpackCachePath,devServer:{host:"localhost",port:3e3},htmlPluginOption:{},copy:{},routerMode:"browser",fixBrowserRouter:!1,plugins:[],resolvePlugins:[],overrideResolve:!1,splitChunk:t,runtimeChunk:"single",moduleFederation:[],rulesInclude:{css:P,js:P,media:P,font:P,wasm:[]},mdx:{jsx:!1,development:m,jsxImportSource:u,providerImportSource:`@moneko/${n}/mdx`},jsxDomExpressions:o,bar:{name:"Client",color:"#6f42c1"},normalizeCss:!0,externalsPresets:{},buildHttp:void 0,virtualModule:{},cssExtract:{}};async function j(e,o){if(o&&v(e)){let t=(await g(e,o)).default;return f(t)?t(process):t}return{}}p&&(w.alias=Object.assign(w.alias,{"@pkg":s.componentsPath,[l]:s.componentsPath}));let k=w;(!1===(k=e(k,await j(s.configPath,"index"),await j(s.customConfigPath,i))).devtool||!1===k.sourceMap)&&(k.sourceMap=!1,k.devtool=!1),k.fixBrowserRouter&&k.htmlPluginOption&&(k.htmlPluginOption.tags||(k.htmlPluginOption.tags=[]),k.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))"}));export const CONFIG=k;export const PUBLICPATH=CONFIG.publicPath||"/";
|
package/lib/dev.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"express";import t from"multer";import o from"webpack";import i from"webpack-dev-middleware";import s from"webpack-hot-middleware";import{merge as l}from"webpack-merge";import r from"./build/server.mjs";import{commonConfig as n}from"./common.mjs";import{CONFIG as m}from"./config.mjs";import{PORT as a,devLog as c,headers as p}from"./dev/config.mjs";import f from"./dev/mock.mjs";import u from"./dev/proxy.mjs";import d from"./module.config.mjs";import h,{CUSTOMCONFIG as g}from"./paths.mjs";import{SSR as w,isLibrary as j,isReact as x}from"./process-env.mjs";import $ from"./utils/has-pkg.mjs";import{empty as k,resolveProgram as y}from"./utils/index.mjs";import b from"./utils/progress.mjs";import v from"./utils/sigint-exit.mjs";import P from"./options/reslove.mjs";import{watchFile as _}from"fs";import{spawn as S,exec as C}from"child_process";import B from"./utils/log.mjs";import M from"chalk";import{directoryExists as D,loadFileSync as G,removeDir as I}from"@moneko/utils";let{HotModuleReplacementPlugin:L,ProgressPlugin:U,WatchIgnorePlugin:A}=o,F=$("stylelint-webpack-plugin")&&(await import("stylelint-webpack-plugin")).default,H=$("eslint-webpack-plugin")&&(await import("eslint-webpack-plugin")).default,O=x&&(await import("@pmmmwh/react-refresh-webpack-plugin")).default,R=["js","jsx","ts","tsx","json","html","vue"],T=R.join(","),q=["css","scss","sass","less","ts","tsx","js","jsx"],E=q.join(","),N=["node_modules/","es/","lib/","umd/","docs/","coverage/","dist/"],z=new URLSearchParams({timeout:2e3,reload:!($("solid-refresh")||$("react-refresh")),quiet:!0,noInfo:!0,overlay:!0,dynamicPublicPath:!0}).toString(),J=n.output.path;w&&(J=y(`${j?"docs":"dist"}/client`));let K=!!m.bar,Q=l(n,{entry:{main:[`${P.hotMiddlewareClient}?name=client&path=//localhost:${a}/__hmr__&${z}`]},output:{path:J},module:d(!1),plugins:[new L,new A({paths:[/\.d\.ts$/]}),O&&new O,H&&new H({fix:!0,threads:!0,files:[`${m.alias["@"]}/**/*.{${T}}`,j&&`${m.alias["@pkg"]}/**/*.{${T}}`].filter(Boolean),extensions:R,exclude:N,cache:!0,cacheLocation:`${h.lineCachePath}/.eslintcache`,lintDirtyModulesOnly:!0}),F&&new F({fix:!0,threads:!0,files:[`${m.alias["@"]}/**/*.{${E}}`,j&&`${m.alias["@pkg"]}/**/*.{${E}}`].filter(Boolean),extensions:q,exclude:N,cache:!0,cacheLocation:`${h.lineCachePath}/.stylelintcache`,lintDirtyModulesOnly:!0}),new U({handler(e,t,...o){let i=m.bar||{};b({showBar:K,percentage:e,title:i.name||"Build",color:i.color,info:o.length?`[${t}] ${o.join(" ")}`:"",output:Q.output?.path})}})].filter(Boolean)}),V=[Q];w&&V.push(l(n,r));let W=o(V);W.compilers[0].hooks.done.tap("client-log",e=>{c(null,e)});let X=e(),Y=t(),Z=i(W,{writeToDisk:!1,index:"index.html",headers:()=>p,serverSideRender:w,lastModified:!0});if(X.use(Z),X.use(s(W,{log:!1,path:"/__hmr__",heartbeat:2e3})),m.proxy&&u(X,m.proxy),D(h.mockPath)){let e=f(h.mockPath);X.use(e)}let ee=`${Q.output.path}/index.html`;X.all("/*",Y.any(),function(e,t,o){if("GET"!==e.method)return o();{let e=Z.context.outputFileSystem,o=e?.readFileSync?.(ee);t.end(o)}});let et=X.listen(a,()=>{});function eo(){process.exit(0)}function ei(e,t){let o=G(e);t&&null!==o&&_(e,async function(){let i=G(e);o.trim().replace(/^\s*[\r\n]/gm,"")!==i?.trim().replace(/^\s*[\r\n]/gm,"")?(B(M.yellow(`检测到工程配置${M.blue(`[${t}]`)}变更, 程序即将重启...`)),C("win32"===process.platform?`netstat -ano | findstr :${a}`:`lsof -i :${a}`,(e,t,o)=>{let i=es?t.split(/\s+/).pop():t.split("\n")[1]?.split(/\s+/)[1];i?process.kill(Number(i),"SIGHUP"):B(`未找到占用端口 ${a} 的进程`)})):B(M.gray(`未变更`))})}ei(h.configPath,"index"),ei(h.customConfigPath,g);let es="win32"===process.platform;process.on("SIGHUP",function(){Z.close(k),et.close(k),et.closeAllConnections(),function(){let e=S(process.argv[0],process.argv.slice(1),{detached:!1,stdio:"inherit"});e.unref(),e.on("close",eo)}()}),process.on("exit",function(){Z.close(k),et.close(k),et.closeAllConnections(),I(h.cachePath)}),v(eo);
|
package/lib/module.config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
let e;import{CONFIG as s}from"./config.mjs";import o from"./options/modify-vars.mjs";import t from"./options/swcrc.mjs";import r,{CUSTOMCONFIG as n}from"./paths.mjs";import{getLightningCssTargets as a}from"./polyfills/targets.mjs";import{FRAMEWORK as i,isDev as l,isLibrary as m}from"./process-env.mjs";import d from"./rule.mjs";import c from"./utils/has-pkg.mjs";import{node_modules as
|
|
1
|
+
let e;import{CONFIG as s}from"./config.mjs";import o from"./options/modify-vars.mjs";import t from"./options/swcrc.mjs";import r,{CUSTOMCONFIG as n}from"./paths.mjs";import{getLightningCssTargets as a}from"./polyfills/targets.mjs";import{FRAMEWORK as i,isDev as l,isLibrary as m}from"./process-env.mjs";import d from"./rule.mjs";import c from"./utils/has-pkg.mjs";import{node_modules as u,resolveProgram as p}from"./utils/index.mjs";import f from"./utils/svg-to-data-uri.mjs";import{comment as j,getCommentPath as y}from"./vm/docs.mjs";import v from"./vm/generate-doc.mjs";import g from"./options/css-extract.mjs";import{saveFileSync as h}from"@moneko/utils";import x from"./utils/reactive-object.mjs";import _ from"./options/reslove.mjs";let w={loader:`${r.corePath}/loader/lightningcss.cjs`,options:{sourceMap:!!s.sourceMap,analyzeDependencies:!1,targets:a(),drafts:{nesting:!0,customMedia:!0},errorRecovery:!1,unusedSymbols:[],rem:!!s.rem}},L={loader:_.lessLoader,options:{sourceMap:!!s.sourceMap,lessOptions:{modifyVars:o,javascriptEnabled:!0}}},$=[...s.cssModules,`@moneko/${i}`,"neko-ui"].map(u),k=["components","example","mock","site","src","server"].map(p);function M(e){return[...k,...s.rulesInclude?.[e]?.map(u)||[]]}n&&k.push(p(n)),s.overrideResolve&&s.overrideResolve.override&&k.push(s.overrideResolve.override);let P=M("css"),O=M("js"),b=M("media"),R=M("wasm"),B=M("font");_.sassLoader&&(e={loader:_.sassLoader,options:{implementation:await import("sass"),sassOptions:{}}});let D=m&&l&&{test:d.tsdoc,include:s.alias["@pkg"],exclude:[d.node_modules,d.__tests__],enforce:"pre",loader:`${r.corePath}/loader/ts-doc.cjs`,options:{comment:j,generateDoc:v,getCommentPath:y}},S=[{resourceQuery:/raw/i,type:"asset/source"},{resourceQuery:/url/i,type:"asset/resource",generator:{filename:e=>{let s=e.filename;return s&&s.endsWith("wasm?url")?"wasm/[name][ext]":"assets/[name][ext]"}}},{test:d.wasm,type:"webassembly/async",include:R},{test:d.txt,type:"asset/source"},{test:d.ico,type:"asset/inline",include:b},{test:d.svg,type:"asset/inline",generator:{dataUrl:e=>f(e.toString())},include:b},{test:d.image,type:"asset",dependency:{not:["url"]},generator:{filename:"assets/images/[name][ext]"},include:b},{test:d.video,type:"asset",dependency:{not:["url"]},generator:{filename:"assets/video/[name][ext]"},include:b},{test:d.font,type:"asset",dependency:{not:["url"]},generator:{filename:"assets/fonts/[name][ext]"},include:B}],I=s.prefixJsLoader.filter(Boolean)||[];l?c("solid-refresh")&&"solid"===i&&I.unshift(`${r.corePath}/loader/solid-refresh.cjs`):c("@moneko/css")&&I.unshift(`${r.corePath}/loader/css-in-js-minify.cjs`);let J=new x({});function N(e){J.setData(`${e.resourcePath}.d.ts`,e.exports.map(({name:e,value:s})=>`export const ${e}: '${s}';`).join("\n")+"\n")}J.on("change",(e,s)=>{h(e,s)});export default(o=>{let n={loader:_.swcLoader,options:t(o)},a={loader:_.cssLoader,options:{modules:{auto:e=>{if(e){for(let s=0,o=$.length;s<o;s++)if(e.includes($[s]))return d.css_module.test(e)}return d.node_modules_css_module.test(e)},localIdentName:"[path][name]_[local]",exportLocalsConvention:"dashesOnly",exportOnlyLocals:o,getJSON:s.cssModuleDefinition?N:void 0},importLoaders:2}};return{noParse:d.no_parse,rules:[D,{oneOf:[...S,{test:d.js,use:[...I,n],include:O},{test:d.css,use:[g,_.cssLoader,w],include:P},e&&{test:d.scss,use:[g,a,w,e],include:P},{test:d.less,use:[g,a,w,L],include:P},{test:d.markdown,use:[...I,{loader:`${r.corePath}/loader/mdx.cjs`,options:s.mdx}],exclude:[d.node_modules]}].filter(Boolean)},...s.moduleRules].filter(Boolean)}});
|
package/lib/plugin/copy.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{basename as t,resolve as i}from"path";import o from"../utils/log.mjs";import{loadFileSync as p,scanFolderSync as e}from"@moneko/utils";export class CopyPlugin{constructor(t){this.option=t}async writeFile(e,l){let r=l.compiler.outputFileSystem;if(r){let s=t(e),m=p(i(e));r.writeFile(i(l.outputOptions.path,s),m||"",t=>{t&&o(`Error copying file ${s} to output directory: ${t}`)})}}apply(t){t.hooks.emit.tapPromise({name:"CopyPlugin",stage:t.webpack.Compilation.PROCESS_ASSETS_STAGE_REPORT},async t=>{if(this.option&&t.compiler.outputFileSystem){let i=[...this.option.files||[],...this.option.dirs?.flatMap(t=>e(t))||[]];await Promise.all(i.map(i=>this.writeFile(i,t)))}})}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{relative as e}from"path";import{fileExists as
|
|
1
|
+
import{relative as e}from"path";import t from"../paths.mjs";import{fileExists as r}from"@moneko/utils";let o="OverrideResolverPlugin";export default class{constructor(e){this.options=e}apply(a){let i=a.ensureHook("resolved"),{override:s,original:l}=this.options;if(s&&l){let p=`./${e(t.programPath,l)}`,n=`./${e(t.programPath,s)}`;a.getHook("existing-file").tapAsync(o,(e,t,h)=>{let m=e.request||e.path;if(m&&m.startsWith(l)&&e.relativePath){let u=m.replace(l,s);if(r(u)){let r=e.relativePath.replace(p,n);return Object.assign(e,{path:u,relativePath:r,__innerRequest_relativePath:r,__innerRequest:r}),a.doResolve(i,e,`${o} 使用目标模块${s}`,t,h)}}return h()})}}}
|
package/lib/utils/read-conf.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{updateFileSync as
|
|
1
|
+
import{updateFileSync as t}from"@moneko/utils";import m from"./tfc.mjs";import o from"../paths.mjs";async function r(r,e){let f=`${o.cachePath}/${e}.mjs`;return t(f,m(r)),import(f)}export default r;
|
package/lib/utils/seo.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{join as m}from"path";import{
|
|
1
|
+
import{join as m}from"path";import{scanRouter as o,sitemap as t}from"@moneko/mdx";import{resolveProgram as r}from"./index.mjs";import{outputConfig as e}from"../common.mjs";import{CONFIG as p}from"../config.mjs";import{routeDir as i}from"../paths.mjs";import{isLibrary as s}from"../process-env.mjs";import{saveFileSync as f}from"@moneko/utils";export default(()=>{let{domain:n,jekyll:a,path:j}=p.seo||{},l=j&&r(j)||e?.path;if(!n||!l)return;let x=`https://${n}${p.basename}`;f(m(l,"CNAME"),n),f(m(l,"robots"),`Sitemap: ${x}/sitemap.txt`),f(m(l,"sitemap.txt"),t(i,x,o(i,s)).join("\n")),a||f(m(l,".nojekyll"),"")});
|
package/lib/vm/coverage.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Parser as e}from"xml2js";import{PACKAGENAME as t}from"../process-env.mjs";import{fileExists as r,loadFileSync as o}from"@moneko/utils";export default function(i){let a={},n="export default {}";if(r(i))try{let r=o(i);(0,new e({explicitArray:!1,async:!1}).parseString)(r,(e,r)=>{if(!e){let{metrics:e,package:o}=r.coverage.project;Object.assign(a,{[t]:e.$});for(let e=0,t=o.length;e<t;e++){let t=o[e];Object.assign(a,{[t.$.name]:t.metrics.$})}}n=`export default ${JSON.stringify(a)}`})}catch(e){}return n}
|
package/lib/vm/docs.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"./generate-doc.mjs";import{CONFIG as t}from"../config.mjs";import{FRAMEWORK as o,isLibrary as r,isReact as n,isSolid as s}from"../process-env.mjs";import a from"../utils/reactive-object.mjs";import m from"../rule.mjs";import{loadFileSync as l,scanFolderSync as p}from"@moneko/utils";let c={react:"createElement",solid:"createComponent"}[o];export const docsModuleName="@app/docs";export const docs=new a({[docsModuleName]:"export default {}"});export const comment=new a({});export const getCommentPath=function(){let e=/^\/?(.+?)\.tsx?$/,o=t.alias["@pkg"]?.length;return t=>t.substring(o).replace(e,"@app/comment/$1.md")}();if(r){let r={},a=`import { ${c}${s?",Dynamic":""} } from "${{react:"react",solid:"solid-js"}[o]}${s?"/web":""}";import SuspenseComp from "@app/suspense";function call_then(res) {return {default: ${n?"() =>":""}${c}(${s?"Dynamic":"'n-md'"}, {text: res.default, ${s?"component: 'n-md', ":""}css: 'table td a {display:inline-flex;align-items:center;gap:2px;}table td a n-img{display:inline-block;overflow:hidden;border-radius:var(--border-radius);inline-size:18px;block-size:18px;}' })};}`,i=(e,t)=>{let o=e.replace(/^@app\/comment\//,"").split("/"),n=o.pop(),s=o.join("/");r[s]||(r[s]={}),t?r[s][n]&&delete r[s][n]:r[s][n]=`rr(() => ${c}(SuspenseComp, { comp: () => import(/* webpackChunkName: '${e}' */ '${e}?raw').then(call_then)}))rr`;let l={};for(let e in r)Object.prototype.hasOwnProperty.call(r,e)&&(l[e]=Object.values(r[e]));docs.setData(docsModuleName,`${a}export default ${JSON.stringify(l).replace(m.extract_func,"$1")}`)};comment.on("change",(e,t)=>{i(e,t?.length<0)});let d=p(t.alias["@pkg"],["\\.tsx?$"]).filter(e=>!/(^|\/)\.[^\\/\\.]|\.test\./i.test(e));for(let t=0,o=d.length;t<o;t++){let o=d[t],r=l(o);r&&comment.setData(getCommentPath(o),e(r,o))}}
|
package/lib/vm/locales.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{basename as e,join as t}from"path";import{
|
|
2
|
-
export function interpolateString(r,n){return r.replace(/\\\${\\w+}/g,function(r){var t=r.slice(2,-1);var e=n[t];return e!==void 0?e.toString():""})}function deepFreeze(o) { const p = Reflect.ownKeys(o);for (const k of p) {const v = o[k];if ((v && typeof v === "object") || typeof v === "function") {deepFreeze(v);}}return Object.freeze(o);}export const locales = ${JSON.stringify(e)};const _res = ${JSON.stringify(t)};const resources = deepFreeze(_res);${
|
|
1
|
+
import{basename as e,join as t}from"path";import{watch as o}from"chokidar";import{CONFIG as a}from"../config.mjs";import{FRAMEWORK as l,isDev as r}from"../process-env.mjs";import n from"../utils/esm.mjs";import s from"../utils/reactive-object.mjs";import c from"../utils/tfc.mjs";import i from"../utils/sigint-exit.mjs";import{directoryExists as g,scanFolderSync as u}from"@moneko/utils";let f={react:'import sso from "shared-store-object";',solid:'import { createEffect, createRoot, getOwner } from "solid-js";import { createStore } from "solid-js/store";'},p={react:'let storageKey="localizable.language",language=localStorage.getItem(storageKey)||"zh_CN",{translation:a,...defaultLocale}=Object.assign({title:"简体中文",language:"zh_CN",translation:{}},resources[language]||resources.zh_CN),localizable=sso({lang:defaultLocale,t:a});export function setLang(a){let{translation:e,...l}=resources[a]||{};e&&(localizable.lang=l,localizable.t=e,localStorage.setItem(storageKey,l.language))}export default localizable;',solid:'let locale=createRoot(()=>{let e="localizable.language",a=localStorage.getItem(e)||"zh_CN",{translation:l,...o}=Object.assign({title:"简体中文",language:"zh_CN",translation:{}},resources[a]||resources.zh_CN),[n,c]=createStore({lang:o,t:l});return createEffect(()=>{let a=resources[n.lang.language]?.translation;a&&(c("t",a),localStorage.setItem(e,n.lang.language))}),{localizable:n,setLocalizable:c,setLang:function(e){let{translation:a,...l}=resources[e]||{};a&&c("lang",l)}}},getOwner());export const setLocalizable=locale.setLocalizable;export const t=locale.localizable.t;export const lang=locale.localizable.lang;export const setLang=locale.setLang;'}[l];function m(e,t){return`${f[l]}
|
|
2
|
+
export function interpolateString(r,n){return r.replace(/\\\${\\w+}/g,function(r){var t=r.slice(2,-1);var e=n[t];return e!==void 0?e.toString():""})}function deepFreeze(o) { const p = Reflect.ownKeys(o);for (const k of p) {const v = o[k];if ((v && typeof v === "object") || typeof v === "function") {deepFreeze(v);}}return Object.freeze(o);}export const locales = ${JSON.stringify(e)};const _res = ${JSON.stringify(t)};const resources = deepFreeze(_res);${p}`}export const localesModuleName="@app/locales";export const locales=new s({[localesModuleName]:m([],{})});let d={};async function z(t,o){let a=e(t).replace(/\.[^.]+$/,"");"deleted"===o?delete d[a]:Object.assign(d,{[a]:(await import(n`${c(t)}`)).default});let l=[],r={};for(let e in d)if(Object.prototype.hasOwnProperty.call(d,e)){let{language:t=a,title:o=t,icon:n,translation:s={}}=d[e];l.push({language:t,title:o,icon:n}),r[t]={language:t,title:o,icon:n,translation:s}}locales.setData(localesModuleName,m(l,r))}let b=t(a.alias["@"],"./locales");if(g(b)){let e=u(b,[".ts$"]).filter(e=>!/^\..*|\.d\.ts$/.test(e));await Promise.all(e.map(e=>z(e,"added"))),r&&function(e,t){let a=o(e,{ignored:t,persistent:!0,ignoreInitial:!0});function l(){a.unwatch(e),a.close()}a.on("add",e=>{z(e,"added")}),a.on("change",e=>{z(e,"change")}),a.on("unlink",e=>{z(e,"deleted")}),a.once("ready",()=>{r||l()}),i(l)}(b,[/^\..*/,/!\.ts$/,/\.d\.ts$/])}
|
package/lib/vm/modules.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{join as p}from"path";import{getAppEntry as t,getAppFallback as e,getAppMdxScope as o,getAppMergeRouter as r,getAppNormalizeCss as
|
|
1
|
+
import{join as p}from"path";import{getAppEntry as t,getAppFallback as e,getAppMdxScope as o,getAppMergeRouter as r,getAppNormalizeCss as m,getAppPrefixRouter as a,getAppRem as s,getAppSuspense as i}from"@moneko/mdx";import f from"./coverage.mjs";import{docs as n,docsModuleName as l}from"./docs.mjs";import x from"./info.mjs";import{locales as c,localesModuleName as d}from"./locales.mjs";import{route as j,routesModuleName as g}from"./routes.mjs";import{CONFIG as u}from"../config.mjs";import _ from"../paths.mjs";import{APPTYPE as v,FRAMEWORK as y}from"../process-env.mjs";import{node_modules as h}from"../utils/index.mjs";import{generateDeclaration as k}from"../utils/dts.mjs";import O from"../utils/has-pkg.mjs";import{updateFile as $}from"@moneko/utils";let b=O(p(u.alias["@"],"./mdx-scope.tsx"))||O(p(u.alias["@"],"./mdx-scope.ts")),z={app_env:h("@app/env.ts"),app_info:h("@app/info.ts"),app_entry:h("@app/entry.ts"),app_mdx_scope:h("@app/mdx-scope.tsx")},D={[z.app_env]:`export default ${JSON.stringify(u.env)}`,[z.app_info]:`export default ${JSON.stringify(x)}`,[z.app_entry]:t(p(u.alias["@"],"./index.ts"),!!u.rem,!!u.normalizeCss,v,y),[h("@app/rem")]:s(u.rem?.designSize||1680),[h("@app/fallback")]:e(u.fallbackCompPath),[h("@app/coverage")]:f(_.coveragePath),[h("@app/merge-router")]:r(),[h("@app/prefix-router")]:a(),[h("@app/normalize/index.css")]:m(),[h("@app/suspense/index.tsx")]:i(v,y),[z.app_mdx_scope]:b?o(b):"export default {}",[h(g)]:j.getData(g),[h(d)]:c.getData(d),[h(l)]:n.getData(l)},P=/\.tsx?/,S=/\.(j|t)sx?$/;for(let p in z)if(Object.prototype.hasOwnProperty.call(z,p)){let t=z[p];S.test(t)&&$(t.replace(P,".d$&"),k(D[t],t))}export default D;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/core",
|
|
3
|
-
"version": "3.17.
|
|
3
|
+
"version": "3.17.10",
|
|
4
4
|
"description": "core",
|
|
5
5
|
"main": "lib/index.mjs",
|
|
6
6
|
"type": "module",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@babel/core": "7.24.5",
|
|
15
15
|
"@moneko/mdx": "0.1.29",
|
|
16
|
+
"@moneko/utils": "0.1.2",
|
|
16
17
|
"@moneko/transform-imports": "0.5.1",
|
|
17
18
|
"@swc/core": "1.5.7",
|
|
18
19
|
"@typescript/vfs": "1.5.0",
|