@moneko/core 3.10.0-beta.3 → 3.10.0-beta.5
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/server.mjs +1 -1
- package/lib/build.mjs +1 -1
- package/lib/dev.mjs +1 -1
- package/lib/utils/log.mjs +1 -1
- package/lib/utils/progress.d.mts +1 -1
- package/lib/utils/progress.mjs +2 -1
- package/package.json +1 -1
package/lib/build/server.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"webpack
|
|
1
|
+
import e from"webpack-node-externals";import o from"../module.config.mjs";import{CUSTOMCONFIG as s}from"../paths.mjs";import{isLibrary as t}from"../process-env.mjs";import{resolveProgramPath as r}from"../utils/index.mjs";let m={entry:{main:r("site/ssr.tsx")},output:{path:r(`${t?"docs":"dist"}/server`),library:{type:"commonjs2",umdNamedDefine:!1},filename:"[name].cjs",chunkFilename:"[chunkhash].cjs",globalObject:"global"},cache:{type:"filesystem",name:[s,process.env.NODE_ENV,"server"].filter(Boolean).join("-")},externalsPresets:{node:!0},externals:[e({allowlist:["react","react-dom","solid-js","@app","@moneko"]})],module:o(!0),target:"node"};export default m;
|
package/lib/build.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{removeDirAll as o}from"@moneko/mdx";import r from"webpack";import{merge as m}from"webpack-merge";import e from"./build/common.mjs";import i from"./build/server.mjs";import{CONFIG as t}from"./config.mjs";import s from"./module.config.mjs";import n from"./paths.mjs";import l from"./plugin/done.mjs";import{SSR as p}from"./process-env.mjs";import a from"./utils/compiler-listener.mjs";import f from"./utils/log.mjs";import c from"./utils/seo.mjs";import u from"./utils/progress.mjs";let{ProgressPlugin:g}=r,
|
|
1
|
+
import{removeDirAll as o}from"@moneko/mdx";import r from"webpack";import{merge as m}from"webpack-merge";import e from"./build/common.mjs";import i from"./build/server.mjs";import{CONFIG as t}from"./config.mjs";import s from"./module.config.mjs";import n from"./paths.mjs";import l from"./plugin/done.mjs";import{SSR as p}from"./process-env.mjs";import a from"./utils/compiler-listener.mjs";import f from"./utils/log.mjs";import c from"./utils/seo.mjs";import u from"./utils/progress.mjs";let{ProgressPlugin:g}=r,j=[m(e,{module:s(!1),plugins:[t.done&&new l({done:t.done}),t.bar&&new g({handler(o,r,...m){let e=t.bar;u(o,e.name||"Build",m.length?`[${r}] ${m.join(" ")}`:"",e.color)}})].filter(Boolean)})];p&&j.push(m(e,i));let[d,h]=r(j).compilers,w=[a("client",d)];async function b(){r(j).run((o,r)=>{if(o)throw o;if(r)for(let o=0,m=r.stats.length;o<m;o++){let m=r.stats[o];for(let o=0,r=m.compilation.warnings.length;o<r;o++)f(m.compilation.warnings[o].message);for(let o=0,r=m.compilation.errors.length;o<r;o++)f(m.compilation.errors[o].message)}}),await Promise.all(w),t.seo&&c()}h&&w.push(a("server",h)),await b(),process.on("exit",function(){o(n.cachePath)});
|
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 p}from"./config.mjs";import{PORT as c,devLog as d,headers as u}from"./dev/config.mjs";import f from"./dev/mock.mjs";import h from"./dev/proxy.mjs";import w from"./module.config.mjs";import g from"./paths.mjs";import{SSR as
|
|
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 p}from"./config.mjs";import{PORT as c,devLog as d,headers as u}from"./dev/config.mjs";import f from"./dev/mock.mjs";import h 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 b from"./rule.mjs";import y from"./utils/compiler-listener.mjs";import $ from"./utils/has-pkg.mjs";import{empty as v,resolveProgramPath as _}from"./utils/index.mjs";import P from"./utils/progress.mjs";let{HotModuleReplacementPlugin:S,ProgressPlugin:B,WatchIgnorePlugin:D}=r,T=$("stylelint-webpack-plugin")&&(await import("stylelint-webpack-plugin")).default,I=$("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"],G=F.join(","),M=["css","scss","sass","less","ts","tsx","js","jsx"],O=M.join(","),R=["node_modules/","es/","lib/","umd/","docs/","coverage/","dist/"],U=new URLSearchParams({timeout:2e3,reload:!0,quiet:!0,noInfo:!0,overlay:!0,dynamicPublicPath:!0}).toString(),q=a.output.path;j&&(q=_(`${x?"docs":"dist"}/client`));let A=m(a,{entry:{main:[`webpack-hot-middleware/client?name=client&path=//localhost:${c}/__hmr__&${U}`]},output:{path:q},module:w(!1),plugins:[new S,new D({paths:[/\.d\.ts$/]}),E&&new E,I&&new I({fix:!0,threads:!0,files:[`${p.alias["@"]}/**/*.{${G}}`,x&&`${p.alias["@pkg"]}/**/*.{${G}}`].filter(Boolean),extensions:F,exclude:R,cache:!0,lintDirtyModulesOnly:!0}),T&&new T({fix:!0,threads:!0,files:[`${p.alias["@"]}/**/*.{${O}}`,x&&`${p.alias["@pkg"]}/**/*.{${O}}`].filter(Boolean),extensions:M,exclude:R,cache:!0,lintDirtyModulesOnly:!0}),p.bar&&new B({handler(e,t,...o){let i=p.bar;P(e,i.name||"Build",o.length?`[${t}] ${o.join(" ")}`:"",i.color)}})].filter(Boolean)}),C=[A];j&&C.push(m(a,n));let[L,N]=r(C).compilers;L.hooks.done.tap("client",e=>{d(null,e)});let z=o(),H=i(),J=s(L,{writeToDisk:!1,index:"index.html",headers:()=>u,serverSideRender:j});if(z.use(J),z.use(l(L,{log:!1,path:"/__hmr__",heartbeat:2e3,ignoreUnaccepted:!1,ignoreDeclined:!0,ignoreErrored:!0})),p.proxy&&h(z,p.proxy),e(g.mockPath)){let e=f(g.mockPath);z.use(e)}let K=`${A.output.path}/index.html`;z.all("/*",H.any(),function(e,t,o){if("GET"!==e.method)return o();{let e=J.context.outputFileSystem,o=e?.readFileSync?.(K);t.end(o)}});let Q=[y("client",L)];N&&(N.watch({aggregateTimeout:20,ignored:b.dev_watch_ignored,poll:1e3,stdin:!0},d),Q.push(y("server",N))),await Promise.all(Q);let V=z.listen(c,()=>{});process.on("exit",function(){V.close(v),V.closeAllConnections(),t(g.cachePath)}),process.on("SIGINT",function(){process.exit()});
|
package/lib/utils/log.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import r from"readline";export default function e(o){if(Array.isArray(o))for(let r=0,t=o.length;r<t;r++)e(`${o[r]}
|
|
2
|
-
`);else r.cursorTo(process.stdout,0),process.stdout.write(o)}
|
|
2
|
+
`);else r.cursorTo(process.stdout,0),r.clearLine(process.stdout,1),process.stdout.write(o)}
|
package/lib/utils/progress.d.mts
CHANGED
package/lib/utils/progress.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"readline";import t from"chalk";let{blue:o,bgBlue:r,grey:s}=t;export default function(c=0,p,d,n){let u=process.stdout.rows-2,i=Math.fround(24*c),a=n?[t.hex(n),t.bgHex(n)]:[o,r],l=a[0](`${p}: `),f=`${l}${a[1](" ".repeat(i))+a[1].inverse(" ".repeat(24-i))} ${(100*c).toFixed()}%
|
|
2
|
+
${s(d)}`;0===c&&process.stdout.write("\n\n"),e.cursorTo(process.stdout,0,u),e.clearScreenDown(process.stdout),c<1&&process.stdout.write(f)}
|