@moneko/core 3.9.9-beta.0 → 3.9.9

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.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import{removeDirAll as e}from"@moneko/mdx";import o from"chalk";import t from"webpack";import s from"webpack-dev-server";import{merge as r}from"webpack-merge";import i from"webpackbar";import{clientConfig as a}from"./common.js";import{CONFIG as l}from"./config.js";import{hasPkg as n}from"./has-pkg.js";import{getIPv4 as p,getPort as m}from"./net.js";import c from"./paths.js";import{isLibrary as d,isReact as u}from"./process-env.js";import{isFunction as w,log as f,resolveProgramPath as v}from"./utils.js";let{HotModuleReplacementPlugin:h}=t,{yellow:g,green:k,grey:b,gray:$,bgBlue:x,bgGreenBright:j,blueBright:S,greenBright:y}=o,T=n("eslint-webpack-plugin"),C=n("stylelint-webpack-plugin"),A=n("@moneko/mock"),B=C?(await import("stylelint-webpack-plugin")).default:null,D=T?(await import("eslint-webpack-plugin")).default:null,E=l.devServer.port||3e3,H=await m(E,65535,l.devServer.host),M=A&&(await import("@moneko/mock")).default,O=u&&(await import("@pmmmwh/react-refresh-webpack-plugin")).default,_=!1===l.devtool||l.devtool?l.devtool:"eval-cheap-module-source-map";l.devServer.port=H;let I="/"===l.basename,J=l.devServer.https?"https:":"http:",N=I?"":l.basename,P=l.devServer.port!==H&&$(`Port ${g(E)} is in use, trying ${k(H)} instead.
2
2
  `);function W(e){return`${J}//${"local"===e?l.devServer.host:p()}:${H}${N}`}let F=$("You application is running here:"),G=`${x(" Local ")} ${S(W("local"))}
3
- ${j(" Network ")} ${y(W("net"))}`,L=["js","jsx","ts","tsx","json","html","vue"],R=L.join(","),Y=["css","scss","sass","less","ts","tsx","js","jsx"],q=Y.join(","),z=["node_modules/","es/","lib/","umd/","docs/","coverage/","dist/"],K=[new h,O&&new O,D&&new D({fix:!0,threads:!0,files:[`${l.alias["@"]}/**/*.{${R}}`,d&&`${l.alias["@pkg"]}/**/*.{${R}}`].filter(Boolean),extensions:L,exclude:z,cache:!0,lintDirtyModulesOnly:!0}),B&&new B({fix:!0,threads:!0,files:[`${l.alias["@"]}/**/*.{${q}}`,d&&`${l.alias["@pkg"]}/**/*.{${q}}`].filter(Boolean),extensions:Y,exclude:z,cache:!0,lintDirtyModulesOnly:!0}),l.bar&&new i(l.bar)].filter(Boolean),Q={headers:{"Access-Control-Allow-Origin":"*"},compress:l.devServer.compress,host:"0.0.0.0",port:H,historyApiFallback:I||{index:N.endsWith("/")?N:`${N}/`,disableDotRule:!0},https:l.devServer.https,proxy:l.proxy,allowedHosts:l.devServer.allowedHosts,client:{reconnect:!0,progress:!1,logging:"info",overlay:!1,webSocketTransport:"ws"},webSocketServer:"ws",static:{watch:{ignored:e=>e.endsWith(".d.ts")||e.includes("/node_modules/")}},setupMiddlewares:(e,o)=>{if(!o)throw Error("devServer is not defined");return o.app&&w(M)&&M(o.app,v("mock/")),e},open:!1,hot:!0},U=t(r(a,{devtool:_,mode:"development",plugins:K}));U.watch({aggregateTimeout:20,ignored:/node_modules(?![\\/]@app)/,stdin:!0},(e,o)=>{!e&&o&&(process.stdout.write("\x1b[2J\x1b[3J\x1b[H"),f([F,"",G,"",b(`Compiled successfully in ${k(`${o.endTime-o.startTime}ms`)}`)]),o.compilation.warnings.forEach(e=>f(e.message)),o.compilation.errors.forEach(e=>f(e.message)),P&&f(P))});let V=new s(Q,U);V.startCallback(e=>{e||f([F,"",G])}),V.stopCallback(o=>{o||e(c.cachePath)}),process.on("exit",function(){U.close(()=>{}),V.invalidate(),V.stop()}),process.on("SIGINT",()=>{process.exit()});
3
+ ${j(" Network ")} ${y(W("net"))}`,L=["js","md","mdx","jsx","ts","tsx","json","html","vue"],R=L.join(","),Y=["css","scss","sass","less","ts","tsx","js","jsx"],q=Y.join(","),z=["node_modules/","es/","lib/","umd/","docs/","coverage/","dist/"],K=[new h,O&&new O,D&&new D({fix:!0,threads:!0,files:[`${l.alias["@"]}/**/*.{${R}}`,d&&`${l.alias["@pkg"]}/**/*.{${R}}`].filter(Boolean),extensions:L,exclude:z,cache:!0,lintDirtyModulesOnly:!0}),B&&new B({fix:!0,threads:!0,files:[`${l.alias["@"]}/**/*.{${q}}`,d&&`${l.alias["@pkg"]}/**/*.{${q}}`].filter(Boolean),extensions:Y,exclude:z,cache:!0,lintDirtyModulesOnly:!0}),l.bar&&new i(l.bar)].filter(Boolean),Q={headers:{"Access-Control-Allow-Origin":"*"},compress:l.devServer.compress,host:"0.0.0.0",port:H,historyApiFallback:I||{index:N.endsWith("/")?N:`${N}/`,disableDotRule:!0},https:l.devServer.https,proxy:l.proxy,allowedHosts:l.devServer.allowedHosts,client:{reconnect:!0,progress:!1,logging:"info",overlay:!1,webSocketTransport:"ws"},webSocketServer:"ws",static:{watch:{ignored:e=>e.endsWith(".d.ts")||e.includes("/node_modules/")}},setupMiddlewares:(e,o)=>{if(!o)throw Error("devServer is not defined");return o.app&&w(M)&&M(o.app,v("mock/")),e},open:!1,hot:!0},U=t(r(a,{devtool:_,mode:"development",plugins:K}));U.watch({aggregateTimeout:20,ignored:/node_modules(?![\\/]@app)/,stdin:!0},(e,o)=>{!e&&o&&(process.stdout.write("\x1b[2J\x1b[3J\x1b[H"),f([F,"",G,"",b(`Compiled successfully in ${k(`${o.endTime-o.startTime}ms`)}`)]),o.compilation.warnings.forEach(e=>f(e.message)),o.compilation.errors.forEach(e=>f(e.message)),P&&f(P))});let V=new s(Q,U);V.startCallback(e=>{e||f([F,"",G])}),V.stopCallback(o=>{o||e(c.cachePath)}),process.on("exit",function(){U.close(()=>{}),V.invalidate(),V.stop()}),process.on("SIGINT",()=>{process.exit()});
@@ -1 +1 @@
1
- import t from"html-webpack-plugin";export default class{constructor(t){this.entryMatchCallback=t}apply(a){a.hooks.compilation.tap("AddEntryAttributeWebpackPlugin",e=>{let r=a.options.plugins.find(a=>a instanceof t);r&&r.getHooks(e).alterAssetTagGroups.tap("AddEntryAttributeWebpackPlugin",t=>(t.headTags.forEach(t=>{"script"===t.tagName&&this.entryMatchCallback(t.attributes.src)&&(t.attributes.entry=!0)}),t))})}}
1
+ export default class{constructor(t){this.entryMatchCallback=t}apply(t){t.hooks.compilation.tap("AddEntryAttributeWebpackPlugin",a=>{let e=t.options.plugins.map(({constructor:t})=>t).find(t=>t&&"HtmlWebpackPlugin"===t.name);e&&e.getHooks(a).alterAssetTagGroups.tap("AddEntryAttributeWebpackPlugin",t=>(t.headTags.forEach(t=>{"script"===t.tagName&&this.entryMatchCallback(t.attributes.src)&&(t.attributes.entry=!0)}),t))})}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "3.9.9-beta.0",
3
+ "version": "3.9.9",
4
4
  "description": "core",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",
@@ -35,7 +35,7 @@
35
35
  "ts-import-plugin": "3.0.0",
36
36
  "ts-loader": "9.5.1",
37
37
  "typescript": "5.3.3",
38
- "webpack": "5.89.0",
38
+ "webpack": "5.77.0",
39
39
  "webpack-bundle-analyzer": "4.10.1",
40
40
  "webpack-cli": "5.1.4",
41
41
  "webpack-dev-server": "4.15.1",
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "devDependencies": {
47
47
  "@swc/cli": "0.1.63",
48
- "eslint-config-neko": "2.3.0",
48
+ "eslint-config-neko": "2.2.0",
49
49
  "stylelint-config-moneko": "1.2.1"
50
50
  },
51
51
  "files": [