@moneko/core 3.15.11 → 3.15.12
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/dev/config.mjs +3 -3
- package/lib/dev.mjs +1 -1
- package/lib/options/reslove.mjs +1 -1
- package/lib/utils/sigint-exit.mjs +1 -1
- package/lib/vm/utils.d.mts +1 -1
- package/lib/vm/utils.mjs +1 -1
- package/package.json +1 -1
- package/typings/global.d.ts +1 -5
- /package/lib/utils/{require.reslove.d.mts → require.d.mts} +0 -0
- /package/lib/utils/{require.reslove.mjs → require.mjs} +0 -0
package/lib/config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fileExists as e}from"@moneko/mdx";import{merge as o}from"webpack-merge";import t from"./options/jsx-dom-expressions.mjs";import s from"./options/split-chunk.mjs";import
|
|
1
|
+
import{fileExists as e}from"@moneko/mdx";import{merge as o}from"webpack-merge";import t from"./options/jsx-dom-expressions.mjs";import s from"./options/split-chunk.mjs";import a,{CUSTOMCONFIG as i}from"./paths.mjs";import{APPTYPE as r,FRAMEWORK as n,NODE_ENV as l,PACKAGENAME as p,isDev as m,isLibrary as c,isMobile as u,jsxImportSource as d,mainDirectory as h}from"./process-env.mjs";import{isFunction as f,resolveProgram as g}from"./utils/index.mjs";import x from"./utils/read-conf.mjs";import P from"./utils/setup-env.mjs";let v=["@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"],k={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:P(l,r,n),basename:"/",publicPath:"/",rem:{designSize:u?375:1680},fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:{"@":g(h)},moduleRules:[],prefixJsLoader:[],cssModules:[],cssModuleDefinition:!0,importOnDemand:{},proxy:{},cacheDirectory:a.webpackCachePath,devServer:{host:"localhost",port:3e3},htmlPluginOption:{},copy:{},routerMode:"browser",fixBrowserRouter:!1,plugins:[],resolvePlugins:[],overrideResolve:!1,splitChunk:s,runtimeChunk:"single",moduleFederation:[],rulesInclude:{css:v,js:v,media:v,font:v,wasm:[]},mdx:{jsx:!1,development:m,jsxImportSource:d,providerImportSource:`@moneko/${n}/mdx`},jsxDomExpressions:t,bar:{name:"Client",color:"#6f42c1"},normalizeCss:!0,externalsPresets:{},buildHttp:{allowedUris:[],lockfileLocation:`${a.httpCachePath}/http.lock`,cacheLocation:`${a.httpCachePath}/data`,upgrade:!0},virtualModule:{},cssExtract:{}};c&&(k.alias=Object.assign(k.alias,{"@pkg":a.componentsPath,[p]:a.componentsPath}));let w=k,C={},j={};if(e(a.configPath)){let e=(await x(a.configPath,"index")).default;C=f(e)?e(process):e}if(i&&e(a.customConfigPath)){let e=(await x(a.customConfigPath,i)).default;j=f(e)?e(process):e}(!1===(w=o(w,C,j)).devtool||!1===w.sourceMap)&&(w.sourceMap=!1,w.devtool=!1),w.fixBrowserRouter&&w.htmlPluginOption&&(w.htmlPluginOption.tags||(w.htmlPluginOption.tags=[]),w.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=w;export const PUBLICPATH=CONFIG.publicPath||"/";
|
package/lib/dev/config.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
`);function
|
|
3
|
-
${c(" Network ")} ${$(
|
|
1
|
+
import e from"chalk";import{getIPv4 as o,getPort as t}from"./net.mjs";import{CONFIG as r}from"../config.mjs";import i from"../utils/log.mjs";let{yellow:n,green:s,grey:l,gray:m,bgBlue:a,bgGreenBright:c,blueBright:p,greenBright:$}=e,d=r.devServer.port||3e3;export const PORT=await t(d,r.devServer.host);r.devServer.port=PORT;let u="/"===r.basename?"":r.basename,v=d!==PORT&&m(`Port ${n(d)} is in use, trying ${s(PORT)} instead.
|
|
2
|
+
`);function f(e){return`http://${"local"===e?r.devServer.host:o()}:${PORT}${u}`}let T=m("You application is running here:"),g=`${a(" Local ")} ${p(f("local"))}
|
|
3
|
+
${c(" Network ")} ${$(f("net"))}`;export function devLog(e,o){!e&&o&&(i([T,"",g,"",l(`Compiled successfully in ${s(`${o.endTime-o.startTime}ms`)}`)]),v&&i(v))}export const headers={"Access-Control-Allow-Origin":"*"};
|
package/lib/dev.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{directoryExists as e,removeDirAll as t}from"@moneko/mdx";import
|
|
1
|
+
import{directoryExists as e,fileExists as o,removeDirAll as t}from"@moneko/mdx";import s from"express";import i from"multer";import l from"webpack";import r from"webpack-dev-middleware";import n from"webpack-hot-middleware";import{merge as m}from"webpack-merge";import a from"./build/server.mjs";import{commonConfig as c}from"./common.mjs";import{CONFIG as p}from"./config.mjs";import{PORT as f,devLog as d,headers as h}from"./dev/config.mjs";import u from"./dev/mock.mjs";import g from"./dev/proxy.mjs";import w from"./module.config.mjs";import x from"./paths.mjs";import{SSR as j,isLibrary as $,isReact as k}from"./process-env.mjs";import b from"./utils/has-pkg.mjs";import{empty as y,resolveProgram as P}from"./utils/index.mjs";import v from"./utils/progress.mjs";import _ from"./utils/sigint-exit.mjs";import S from"./options/reslove.mjs";import{watchFile as C,unwatchFile as B}from"fs";import{spawn as D,exec as M}from"child_process";let{HotModuleReplacementPlugin:G,ProgressPlugin:I,WatchIgnorePlugin:L}=l,U=b("stylelint-webpack-plugin")&&(await import("stylelint-webpack-plugin")).default,A=b("eslint-webpack-plugin")&&(await import("eslint-webpack-plugin")).default,F=k&&(await import("@pmmmwh/react-refresh-webpack-plugin")).default,H=["js","jsx","ts","tsx","json","html","vue"],O=H.join(","),R=["css","scss","sass","less","ts","tsx","js","jsx"],T=R.join(","),q=["node_modules/","es/","lib/","umd/","docs/","coverage/","dist/"],E=new URLSearchParams({timeout:2e3,reload:!(b("solid-refresh")||b("react-refresh")),quiet:!0,noInfo:!0,overlay:!0,dynamicPublicPath:!0}).toString(),N=c.output.path;j&&(N=P(`${$?"docs":"dist"}/client`));let z=m(c,{entry:{main:[`${S.hotMiddlewareClient}?name=client&path=//localhost:${f}/__hmr__&${E}`]},output:{path:N},module:w(!1),plugins:[new G,new L({paths:[/\.d\.ts$/]}),F&&new F,A&&new A({fix:!0,threads:!0,files:[`${p.alias["@"]}/**/*.{${O}}`,$&&`${p.alias["@pkg"]}/**/*.{${O}}`].filter(Boolean),extensions:H,exclude:q,cache:!0,cacheLocation:`${x.lineCachePath}/.eslintcache`,lintDirtyModulesOnly:!0}),U&&new U({fix:!0,threads:!0,files:[`${p.alias["@"]}/**/*.{${T}}`,$&&`${p.alias["@pkg"]}/**/*.{${T}}`].filter(Boolean),extensions:R,exclude:q,cache:!0,cacheLocation:`${x.lineCachePath}/.stylelintcache`,lintDirtyModulesOnly:!0}),p.bar&&new I({handler(e,o,...t){let s=p.bar;v(e,s.name||"Build",t.length?`[${o}] ${t.join(" ")}`:"",s.color)}})].filter(Boolean)}),J=[z];j&&J.push(m(c,a));let K=l(J);K.compilers[0].hooks.done.tap("client-log",e=>{d(null,e)});let Q=s(),V=i(),W=r(K,{writeToDisk:!1,index:"index.html",headers:()=>h,serverSideRender:j,lastModified:!0});if(Q.use(W),Q.use(n(K,{log:!1,path:"/__hmr__",heartbeat:2e3})),p.proxy&&g(Q,p.proxy),e(x.mockPath)){let e=u(x.mockPath);Q.use(e)}let X=`${z.output.path}/index.html`;Q.all("/*",V.any(),function(e,o,t){if("GET"!==e.method)return t();{let e=W.context.outputFileSystem,t=e?.readFileSync?.(X);o.end(t)}});let Y=Q.listen(f,()=>{});function Z(){console.log("listener"),M("win32"===process.platform?`netstat -ano | findstr :${f}`:`lsof -i :${f}`,(e,o,t)=>{let s=eo?o.split(/\s+/).pop():o.split("\n")[1]?.split(/\s+/)[1];s?process.kill(Number(s),"SIGHUP"):console.log(`未找到占用端口 ${f} 的进程`)})}function ee(){B(x.configPath,Z),B(x.customConfigPath,Z)}o(x.configPath)&&C(x.configPath,Z);let eo="win32"===process.platform;process.on("SIGHUP",function(){W.close(y),Y.close(y),Y.closeAllConnections(),ee(),function(){let e=D(process.argv[0],process.argv.slice(1),{detached:!1,stdio:"inherit"});e.unref(),e.on("close",()=>{process.exit(0)})}()}),process.on("exit",function(e){ee(),W.close(y),Y.close(y),Y.closeAllConnections(),t(x.cachePath),t(x.vfsDtsPath)}),_(()=>{process.exit(0)});
|
package/lib/options/reslove.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import s from"../utils/require.
|
|
1
|
+
import s from"../utils/require.mjs";import e from"../utils/has-pkg.mjs";export default{styleLoader:s.resolve("style-loader"),cssLoader:s.resolve("css-loader"),sassLoader:e("sass")&&e("sass-loader")&&s.resolve("sass-loader"),lessLoader:s.resolve("less-loader"),swcLoader:s.resolve("swc-loader"),transformImports:e("@moneko/transform-imports")&&s.resolve("@moneko/transform-imports"),jsxDomExpressions:e("@moneko/jsx-dom-expressions")&&s.resolve("@moneko/jsx-dom-expressions"),hotMiddlewareClient:s.resolve("webpack-hot-middleware/client.js")};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function(
|
|
1
|
+
export default function(o){process.on("SIGINT",o),process.on("SIGTERM",o),process.on("SIGQUIT",o)}
|
package/lib/vm/utils.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function watchFiles(root: string, ignored
|
|
1
|
+
export declare function watchFiles(root: string, ignored?: RegExp, call?: VoidFunction): void;
|
package/lib/vm/utils.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{watch as i}from"chokidar";import t from"../utils/sigint-exit.mjs";export function watchFiles(
|
|
1
|
+
import{watch as i}from"chokidar";import t from"../utils/sigint-exit.mjs";import{empty as n}from"../utils/index.mjs";export function watchFiles(o,r,e=n){let s=i(o,{ignored:(i,t)=>{if(t)return!t.isDirectory()&&r?.test(i)},persistent:!0,ignoreInitial:!0});s.on("add",e).on("change",e).on("unlink",e),t(function(){s.unwatch(o),s.close()})}
|
package/package.json
CHANGED
package/typings/global.d.ts
CHANGED
|
@@ -216,7 +216,7 @@ export declare type ConfigType = {
|
|
|
216
216
|
/** 自定义缓存目录,为 false 时,不使用缓存 */
|
|
217
217
|
cacheDirectory?: string | false;
|
|
218
218
|
/** 开发服务器设置 */
|
|
219
|
-
devServer
|
|
219
|
+
devServer: {
|
|
220
220
|
headers?: Record<string, string>;
|
|
221
221
|
host?: string;
|
|
222
222
|
port?: number;
|
|
@@ -577,9 +577,5 @@ export type SwcImportOnDemandTransform = Record<
|
|
|
577
577
|
memberTransformers?: MemberTransformer[];
|
|
578
578
|
}
|
|
579
579
|
>;
|
|
580
|
-
declare global {
|
|
581
|
-
// eslint-disable-next-line vars-on-top,no-var
|
|
582
|
-
var NEKOCLICONFIG: CommomType;
|
|
583
|
-
}
|
|
584
580
|
|
|
585
581
|
export {};
|
|
File without changes
|
|
File without changes
|