@moneko/core 4.0.5 → 4.0.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/build-dev.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{relative as o}from"node:path";import r from"node:process";import{analyzeBundleSize as t,completedInfo as e,ink as m,println as i,progressBar as n}from"@moneko/utils";import a from"webpack";import s from"./commom/log.mjs";import l from"./commom/paths.mjs";import{empty as p}from"./utils/index.mjs";import{CONFIG as c}from"./config.mjs";import{createDevelopmentConfiguration as g}from"./create-development-configuration.mjs";let u=await g({});if(c.bar){let o=c.bar,t=o.name||"Build";u.plugins.push(new a.ProgressPlugin({handler(e,m,...i){let a=i.length?`[${m}] ${i.join(" ")}`:" ";o.quiet?r.stdout.write(`${a}
2
- `):(n(e||0,1,{msg:a,name:t,barColor:o.barColor,nameColor:o.nameColor,barBgColor:o.barBgColor,msgColor:o.msgColor}),1===e&&r.stdout.write("\r\x1b[2K"))}}))}let d=a(u);async function f(){let r=await new Promise((o,r)=>{d?.run((t,e)=>{t&&r(t),e?o(e):r(Error("编译过程中没有生成统计信息"))})});(r.hasErrors()||r.hasWarnings())&&function(o){let{warnings:r,errors:t}=o.compilation,e=[];r.forEach(o=>{o.message.includes("Conflicting order between css ./node_modules/.pnpm/monaco-editor")?e.push(o.message):i(m(o.message,"178"))}),e.length&&s(e.join("\n")),t.forEach(o=>{i(m(o.message,"red"))})}(r),await new Promise(n=>{r.compilation.compiler.cache.shutdown(a=>{a&&i(m(a.toString(),"red")),t(r.compilation.outputOptions.path,["\\.js$"]),e(~~((r.endTime-r.startTime)/10)/100,o(l.programPath,r.compilation.outputOptions.path)),n()})})}r.on("exit",p),await f();
1
+ import{relative as o}from"node:path";import r from"node:process";import{analyzeBundleSize as e,completedInfo as t,ink as m,println as i,progressBar as n}from"@moneko/utils";import s from"webpack";import a from"./commom/log.mjs";import l from"./commom/paths.mjs";import{empty as p}from"./utils/index.mjs";import{CONFIG as c}from"./config.mjs";import{createDevelopmentConfiguration as g}from"./create-development-configuration.mjs";let u=await g({});if(c.bar){let o=c.bar,e=o.name||"Build";u.plugins.push(new s.ProgressPlugin({handler(t,m,...i){let s=i.length?`[${m}] ${i.join(" ")}`:" ";o.quiet?r.stdout.write(`${s}
2
+ `):(n(t||0,1,{msg:s,name:e,barColor:o.barColor,nameColor:o.nameColor,barBgColor:o.barBgColor,msgColor:o.msgColor}),1===t&&r.stdout.write("\r\x1b[2K"))}}))}let d=s(u);async function f(){let r=await new Promise((o,r)=>{d?.run((e,t)=>{e&&r(e),t?o(t):r(Error("编译过程中没有生成统计信息"))})});(r.hasErrors()||r.hasWarnings())&&function(o){let{warnings:r,errors:e}=o.compilation,t=[];r.forEach(o=>{o.message.includes("Conflicting order between css ./node_modules/")&&o.message.includes("monaco-editor")?t.push(o.message):i(m(o.message,"178"))}),t.length&&a(t.join("\n")),e.forEach(o=>{i(m(o.message,"red"))})}(r),await new Promise(n=>{r.compilation.compiler.cache.shutdown(s=>{s&&i(m(s.toString(),"red")),e(r.compilation.outputOptions.path,["\\.js$"]),t(~~((r.endTime-r.startTime)/10)/100,o(l.programPath,r.compilation.outputOptions.path)),n()})})}r.on("exit",p),await f();
package/lib/build.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{relative as o}from"node:path";import r from"node:process";import{analyzeBundleSize as m,completedInfo as e,ink as t,println as i,progressBar as n}from"@moneko/utils";import s from"webpack";import{merge as a}from"webpack-merge";import p from"./build/common.mjs";import l from"./commom/log.mjs";import u from"./commom/paths.mjs";import{DonePlugin as g}from"./plugin/done.mjs";import{empty as c}from"./utils/index.mjs";import d from"./utils/seo.mjs";import{CONFIG as f}from"./config.mjs";import h from"./module.config.mjs";let w=a(p,{module:h(!1),plugins:[]});if(f.done&&w.plugins.push(new g({done:f.done})),f.bar){let o=f.bar,m=o.name||"Build";w.plugins.push(new s.ProgressPlugin({handler(e,t,...i){let s=i.length?`[${t}] ${i.join(" ")}`:" ";o.quiet?r.stdout.write(`${s}
2
- `):(n(e||0,1,{msg:s,name:m,barColor:o.barColor,nameColor:o.nameColor,barBgColor:o.barBgColor,msgColor:o.msgColor}),1===e&&r.stdout.write("\r\x1b[2K"))}}))}let b=s(w);if(!b)throw Error("无法创建编译器");async function j(){let r=await new Promise((o,r)=>{b?.run((m,e)=>{m&&r(m),e?o(e):r(Error("编译过程中没有生成统计信息"))})});(r.hasErrors()||r.hasWarnings())&&function(o){let{warnings:r,errors:m}=o.compilation,e=[];r.forEach(o=>{o.message.includes("Conflicting order between css ./node_modules/.pnpm/monaco-editor")?e.push(o.message):i(t(o.message,"178"))}),e.length&&l(e.join("\n")),m.forEach(o=>{i(t(o.message,"red"))})}(r),await new Promise(n=>{r.compilation.compiler.cache.shutdown(s=>{s&&i(t(s.toString(),"red")),m(r.compilation.outputOptions.path,["\\.js$"]),e(~~((r.endTime-r.startTime)/10)/100,o(u.programPath,r.compilation.outputOptions.path)),n()})}),f.seo&&d()}r.on("exit",c),await j();
1
+ import{relative as o}from"node:path";import r from"node:process";import{analyzeBundleSize as m,completedInfo as e,ink as i,println as t,progressBar as s}from"@moneko/utils";import n from"webpack";import{merge as a}from"webpack-merge";import l from"./build/common.mjs";import p from"./commom/log.mjs";import u from"./commom/paths.mjs";import{DonePlugin as g}from"./plugin/done.mjs";import{empty as c}from"./utils/index.mjs";import d from"./utils/seo.mjs";import{CONFIG as f}from"./config.mjs";import h from"./module.config.mjs";let w=a(l,{module:h(!1),plugins:[]});if(f.done&&w.plugins.push(new g({done:f.done})),f.bar){let o=f.bar,m=o.name||"Build";w.plugins.push(new n.ProgressPlugin({handler(e,i,...t){let n=t.length?`[${i}] ${t.join(" ")}`:" ";o.quiet?r.stdout.write(`${n}
2
+ `):(s(e||0,1,{msg:n,name:m,barColor:o.barColor,nameColor:o.nameColor,barBgColor:o.barBgColor,msgColor:o.msgColor}),1===e&&r.stdout.write("\r\x1b[2K"))}}))}let b=n(w);if(!b)throw Error("无法创建编译器");async function j(){let r=await new Promise((o,r)=>{b?.run((m,e)=>{m&&r(m),e?o(e):r(Error("编译过程中没有生成统计信息"))})});(r.hasErrors()||r.hasWarnings())&&function(o){let{warnings:r,errors:m}=o.compilation,e=[];r.forEach(o=>{o.message.includes("Conflicting order between css ./node_modules/")&&o.message.includes("monaco-editor")?e.push(o.message):t(i(o.message,"178"))}),e.length&&p(e.join("\n")),m.forEach(o=>{t(i(o.message,"red"))})}(r),await new Promise(s=>{r.compilation.compiler.cache.shutdown(n=>{n&&t(i(n.toString(),"red")),m(r.compilation.outputOptions.path,["\\.js$"]),e(~~((r.endTime-r.startTime)/10)/100,o(u.programPath,r.compilation.outputOptions.path)),s()})}),f.seo&&d()}r.on("exit",c),await j();
@@ -1,2 +1,2 @@
1
- import{ink as e,println as o,termClear as r}from"@moneko/utils";import{hostHelp as t}from"../commom/host.mjs";import m from"../commom/log.mjs";import{getIPv4 as s,getPort as n}from"../commom/net.mjs";import i from"../commom/print-log.mjs";import{CONFIG as l}from"../config.mjs";let a=l.devServer.port||3e3;export const PORT=await n(a);l.devServer.port=PORT;let p="/"===l.basename?"":l.basename,c=a!==PORT&&e(`Port ${e(`${a}`,"yellow")} is in use, trying ${e(`${PORT}`,"green")} instead.
2
- `,"245");export function getServerAddress(e){return`${l.devServer.https?"https":"http"}://${"local"===e?l.devServer.host:s()}:${PORT}${p}`}let d=e("You application is running here:","245");export function devLog(s,n){r(3);let a=(n?.endTime??0)-(n?.startTime??0);if(o(d,!0),o("",!0),i("Local",getServerAddress("local"),{timestamp:!1,labelBackgroundColor:"blue",labelLen:9}),i("Network",getServerAddress("net"),{timestamp:!1,labelBackgroundColor:"29"}),o("",!0),o(e(`Compiled successfully in ${e(`${a}ms`,"green")}`,"245"),!0),o("",!0),c&&o(c),t(l.devServer.host),n){let e=[];n.compilation.warnings.forEach(r=>{r.message.includes("Conflicting order between css ./node_modules/.pnpm/monaco-editor")?e.push(r.message):o(r.message)}),n.compilation.errors.forEach(e=>{o(e.message)}),e.length&&m(e.join("\n"))}s&&o(s.message)}
1
+ import{ink as e,println as o,termClear as r}from"@moneko/utils";import{hostHelp as t}from"../commom/host.mjs";import s from"../commom/log.mjs";import{getIPv4 as m,getPort as n}from"../commom/net.mjs";import i from"../commom/print-log.mjs";import{CONFIG as l}from"../config.mjs";let a=l.devServer.port||3e3;export const PORT=await n(a);l.devServer.port=PORT;let c="/"===l.basename?"":l.basename,d=a!==PORT&&e(`Port ${e(`${a}`,"yellow")} is in use, trying ${e(`${PORT}`,"green")} instead.
2
+ `,"245");export function getServerAddress(e){return`${l.devServer.https?"https":"http"}://${"local"===e?l.devServer.host:m()}:${PORT}${c}`}let p=e("You application is running here:","245");export function devLog(m,n){r(3);let a=(n?.endTime??0)-(n?.startTime??0);if(o(p,!0),o("",!0),i("Local",getServerAddress("local"),{timestamp:!1,labelBackgroundColor:"blue",labelLen:9}),i("Network",getServerAddress("net"),{timestamp:!1,labelBackgroundColor:"29"}),o("",!0),o(e(`Compiled successfully in ${e(`${a}ms`,"green")}`,"245"),!0),o("",!0),d&&o(d),t(l.devServer.host),n){let e=[];n.compilation.warnings.forEach(r=>{r.message.includes("Conflicting order between css ./node_modules/")&&r.message.includes("monaco-editor")?e.push(r.message):o(r.message)}),n.compilation.errors.forEach(e=>{o(e.message)}),e.length&&s(e.join("\n"))}m&&o(m.message)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "4.0.5",
3
+ "version": "4.0.6",
4
4
  "description": "core",
5
5
  "main": "lib/index.mjs",
6
6
  "type": "module",