@moneko/core 3.11.0-beta.3 → 3.11.0-beta.6
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/dev/proxy.mjs +1 -1
- package/lib/dev.mjs +1 -1
- package/lib/plugin/virtual-module.mjs +1 -1
- package/lib/utils/index.mjs +1 -1
- package/lib/vm/example.mjs +1 -1
- package/package.json +2 -2
package/lib/dev/proxy.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createProxyMiddleware as e}from"http-proxy-middleware";export default((t,
|
|
1
|
+
import{createProxyMiddleware as e}from"http-proxy-middleware";export default((t,l)=>{let o=Object.keys(l);for(let r=0,p=o.length;r<p;r++){let p=o[r],d=e({logger:console,...l[p]});t.use(p,d)}});
|
package/lib/dev.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{directoryExists as e,removeDirAll as t}from"@moneko/mdx";import o from"express";import i from"multer";import r from"webpack";import s from"webpack-dev-middleware";import l from"webpack-hot-middleware";import{merge as m}from"webpack-merge";import n from"./build/server.mjs";import{commonConfig as a}from"./common.mjs";import{CONFIG as c}from"./config.mjs";import{PORT as p,devLog as d,headers as u}from"./dev/config.mjs";import h from"./dev/mock.mjs";import f from"./dev/proxy.mjs";import w from"./module.config.mjs";import g from"./paths.mjs";import{SSR as j,isLibrary as x,isReact as k}from"./process-env.mjs";import $ from"./rule.mjs";import b from"./utils/compiler-listener.mjs";import y from"./utils/has-pkg.mjs";import{empty as v,resolveProgramPath as _}from"./utils/index.mjs";import P from"./utils/progress.mjs";import S from"./utils/sigint-exit.mjs";let{HotModuleReplacementPlugin:B,ProgressPlugin:D,WatchIgnorePlugin:C}=r,L=y("stylelint-webpack-plugin")&&(await import("stylelint-webpack-plugin")).default,T=y("eslint-webpack-plugin")&&(await import("eslint-webpack-plugin")).default,E=k&&(await import("@pmmmwh/react-refresh-webpack-plugin")).default,F=["js","jsx","ts","tsx","json","html","vue"],M=F.join(","),O=["css","scss","sass","less","ts","tsx","js","jsx"],R=O.join(","),U=["node_modules/","es/","lib/","umd/","docs/","coverage/","dist/"],q=new URLSearchParams({timeout:2e3,reload:!0,quiet:!0,noInfo:!0,overlay:!0,dynamicPublicPath:!0}).toString(),A=a.output.path;j&&(A=_(`${x?"docs":"dist"}/client`));let G=m(a,{entry:{main:[`webpack-hot-middleware/client?name=client&path=//localhost:${p}/__hmr__&${q}`]},output:{path:A},module:w(!1),plugins:[new B,new C({paths:[/\.d\.ts$/]}),E&&new E,T&&new T({fix:!0,threads:!0,files:[`${c.alias["@"]}/**/*.{${M}}`,x&&`${c.alias["@pkg"]}/**/*.{${M}}`].filter(Boolean),extensions:F,exclude:U,cache:!0,cacheLocation:`${g.lineCachePath}/.eslintcache`,lintDirtyModulesOnly:!0}),L&&new L({fix:!0,threads:!0,files:[`${c.alias["@"]}/**/*.{${R}}`,x&&`${c.alias["@pkg"]}/**/*.{${R}}`].filter(Boolean),extensions:O,exclude:U,cache:!0,cacheLocation:`${g.lineCachePath}/.stylelintcache`,lintDirtyModulesOnly:!0}),c.bar&&new D({handler(e,t,...o){let i=c.bar;P(e,i.name||"Build",o.length?`[${t}] ${o.join(" ")}`:"",i.color)}})].filter(Boolean)}),I=[G];j&&I.push(m(a,n));let[z,H]=r(I).compilers;z.hooks.done.tap("client",e=>{d(null,e)});let J=o(),K=i(),N=s(z,{writeToDisk:!1,index:"index.html",headers:()=>u,serverSideRender:j});if(J.use(N),J.use(l(z,{log:!1,path:"/__hmr__",heartbeat:2e3,ignoreUnaccepted:!1,ignoreDeclined:!0,ignoreErrored:!0})),c.proxy&&f(J,c.proxy),e(g.mockPath)){let e=h(g.mockPath);J.use(e)}let Q=`${G.output.path}/index.html`;J.all("/*",K.any(),function(e,t,o){if("GET"!==e.method)return o();{let e=N.context.outputFileSystem,o=e?.readFileSync?.(Q);t.end(o)}});let V=[b("client",z)];H&&(H.watch({aggregateTimeout:20,ignored:$.dev_watch_ignored,poll:1e3,stdin:!0},d),V.push(b("server",H))),await Promise.all(V);let W=J.listen(p,()=>{});process.on("exit",function(){W.close(v),W.closeAllConnections(),t(g.cachePath)}),S(()=>{process.exit(1)});
|
|
1
|
+
import{directoryExists as e,removeDirAll as t}from"@moneko/mdx";import o from"express";import i from"multer";import r from"webpack";import s from"webpack-dev-middleware";import l from"webpack-hot-middleware";import{merge as m}from"webpack-merge";import n from"./build/server.mjs";import{commonConfig as a}from"./common.mjs";import{CONFIG as c}from"./config.mjs";import{PORT as p,devLog as d,headers as u}from"./dev/config.mjs";import h from"./dev/mock.mjs";import f from"./dev/proxy.mjs";import w from"./module.config.mjs";import g from"./paths.mjs";import{SSR as j,isLibrary as x,isReact as k}from"./process-env.mjs";import $ from"./rule.mjs";import b from"./utils/compiler-listener.mjs";import y from"./utils/has-pkg.mjs";import{empty as v,resolveProgramPath as _}from"./utils/index.mjs";import P from"./utils/progress.mjs";import S from"./utils/sigint-exit.mjs";let{HotModuleReplacementPlugin:B,ProgressPlugin:D,WatchIgnorePlugin:C}=r,L=y("stylelint-webpack-plugin")&&(await import("stylelint-webpack-plugin")).default,T=y("eslint-webpack-plugin")&&(await import("eslint-webpack-plugin")).default,E=k&&(await import("@pmmmwh/react-refresh-webpack-plugin")).default,F=["js","jsx","ts","tsx","json","html","vue"],M=F.join(","),O=["css","scss","sass","less","ts","tsx","js","jsx"],R=O.join(","),U=["node_modules/","es/","lib/","umd/","docs/","coverage/","dist/"],q=new URLSearchParams({timeout:2e3,reload:!0,quiet:!0,noInfo:!0,overlay:!0,dynamicPublicPath:!0}).toString(),A=a.output.path;j&&(A=_(`${x?"docs":"dist"}/client`));let G=m(a,{entry:{main:[`webpack-hot-middleware/client?name=client&path=//localhost:${p}/__hmr__&${q}`]},output:{path:A},module:w(!1),plugins:[new B,new C({paths:[/\.d\.ts$/]}),E&&new E,T&&new T({fix:!0,threads:!0,files:[`${c.alias["@"]}/**/*.{${M}}`,x&&`${c.alias["@pkg"]}/**/*.{${M}}`].filter(Boolean),extensions:F,exclude:U,cache:!0,cacheLocation:`${g.lineCachePath}/.eslintcache`,lintDirtyModulesOnly:!0}),L&&new L({fix:!0,threads:!0,files:[`${c.alias["@"]}/**/*.{${R}}`,x&&`${c.alias["@pkg"]}/**/*.{${R}}`].filter(Boolean),extensions:O,exclude:U,cache:!0,cacheLocation:`${g.lineCachePath}/.stylelintcache`,lintDirtyModulesOnly:!0}),c.bar&&new D({handler(e,t,...o){let i=c.bar;P(e,i.name||"Build",o.length?`[${t}] ${o.join(" ")}`:"",i.color)}})].filter(Boolean)}),I=[G];j&&I.push(m(a,n));let[z,H]=r(I).compilers;z.hooks.done.tap("client",e=>{d(null,e)});let J=o(),K=i(),N=s(z,{writeToDisk:!1,index:"index.html",headers:()=>u,serverSideRender:j});if(J.use(N),J.use(l(z,{log:!1,path:"/__hmr__",heartbeat:2e3,ignoreUnaccepted:!1,ignoreDeclined:!0,ignoreErrored:!0})),c.proxy&&f(J,c.proxy),e(g.mockPath)){let e=h(g.mockPath);J.use(e)}let Q=`${G.output.path}/index.html`;J.all("/*",K.any(),function(e,t,o){if("GET"!==e.method)return o();{let e=N.context.outputFileSystem,o=e?.readFileSync?.(Q);t.end(o)}});let V=[b("client",z)];H&&(H.watch({aggregateTimeout:20,ignored:$.dev_watch_ignored,poll:1e3,stdin:!0},d),V.push(b("server",H))),await Promise.all(V);let W=J.listen(p,()=>{});process.on("exit",function(){N.close(v),W.close(v),W.closeAllConnections(),t(g.cachePath)}),S(()=>{process.exit(1)});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"webpack-virtual-modules";import{isLibrary as t}from"../process-env.mjs";import{resolveNodeModulesPath as e}from"../utils/index.mjs";import{comment as r,docs as p}from"../vm/docs.mjs";import{examples as i}from"../vm/example.mjs";import{locales as m}from"../vm/locales.mjs";import s from"../vm/modules.mjs";import{route as
|
|
1
|
+
import o from"webpack-virtual-modules";import{isLibrary as t}from"../process-env.mjs";import{resolveNodeModulesPath as e}from"../utils/index.mjs";import{comment as r,docs as p}from"../vm/docs.mjs";import{examples as i}from"../vm/example.mjs";import{locales as m}from"../vm/locales.mjs";import s from"../vm/modules.mjs";import{route as a}from"../vm/routes.mjs";export class VirtualModuleWebpackPlugin{constructor(o={}){this.options=o,this.hasTapped=!1}apply(l){let n=this.options,f=new o(s);function c(o,t){f.writeModule(e(o),t||"")}f.apply(l),a.on("change",c),m.on("change",c),t&&(i.on("change",c),p.on("change",c),r.on("change",c)),l.hooks.compilation.tap("VirtualModuleWebpackPlugin",()=>{if(!this.hasTapped){for(let o in this.hasTapped=!0,n)if(Object.prototype.hasOwnProperty.call(n,o)){let t=n[o];c(o,"string"==typeof t?t:`export default ${JSON.stringify(t)}`)}for(let o of i)c(...o);for(let o of p)c(...o);for(let o of r)c(...o)}})}}
|
package/lib/utils/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolve as t}from"path";import e from"./resolver-sync.mjs";import o from"../paths.mjs";export function toUpperCaseString(t){return t?.replaceAll(/\b\w/g,t=>t.toUpperCase()).replaceAll(/\./g," ")}export function resolveProgramPath(e){return t(o.programPath,`./${e}`)}export const resolveNodeModulesPath=t
|
|
1
|
+
import{resolve as t}from"path";import e from"./resolver-sync.mjs";import o from"../paths.mjs";export function toUpperCaseString(t){return t?.replaceAll(/\b\w/g,t=>t.toUpperCase()).replaceAll(/\./g," ")}export function resolveProgramPath(e){return t(o.programPath,`./${e}`)}export const resolveNodeModulesPath=e=>t(o.nodeModules,`./${e}`);export const realResolve=t=>e.resolveSync({},o.programPath,t)||t;export function isObject(t){let e=typeof t;return null!==t&&("object"===e||"function"===e)}export function isFunction(t){if(!isObject(t))return!1;let e=Object.prototype.toString.call(t);return"[object Function]"===e||"[object AsyncFunction]"===e||"[object GeneratorFunction]"===e||"[object Proxy]"===e}export function empty(){}
|
package/lib/vm/example.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{generateExample as e}from"@moneko/mdx";import{watchFiles as t}from"./utils.mjs";import o from"../paths.mjs";import{isDev as
|
|
1
|
+
import{generateExample as e}from"@moneko/mdx";import{watchFiles as t}from"./utils.mjs";import o from"../paths.mjs";import{isDev as m,isLibrary as r}from"../process-env.mjs";import a from"../utils/reactive-object.mjs";export const exampleModuleName="@app/example";function p(){try{return JSON.parse(e(o.componentsPath,`${exampleModuleName}/`))}catch(e){return{}}}export const examples=new a(r?p():{});examples.setData(exampleModuleName,"export default []");export function generatorDemo(){let e=p();for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&examples.setData(t,e[t])}r&&m&&t(o.componentsPath,/(?<!\/examples\/(.+)\.md)$/,generatorDemo);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/core",
|
|
3
|
-
"version": "3.11.0-beta.
|
|
3
|
+
"version": "3.11.0-beta.6",
|
|
4
4
|
"description": "core",
|
|
5
5
|
"main": "lib/index.mjs",
|
|
6
6
|
"type": "module",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"css-loader": "6.10.0",
|
|
27
27
|
"express": "4.19.2",
|
|
28
28
|
"html-webpack-plugin": "5.6.0",
|
|
29
|
-
"http-proxy-middleware": "
|
|
29
|
+
"http-proxy-middleware": "3.0.0",
|
|
30
30
|
"less": "4.2.0",
|
|
31
31
|
"less-loader": "12.2.0",
|
|
32
32
|
"lightningcss": "1.24.1",
|