@moneko/core 3.12.1 → 3.12.2
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.mjs +1 -1
- package/lib/dev.mjs +1 -1
- package/lib/paths.d.mts +1 -0
- package/lib/paths.mjs +1 -1
- package/package.json +1 -1
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
|
|
1
|
+
import{removeDirAll as o}from"@moneko/mdx";import r from"webpack";import{merge as m}from"webpack-merge";import t from"./build/common.mjs";import e from"./build/server.mjs";import{CONFIG as i}from"./config.mjs";import s from"./module.config.mjs";import n from"./paths.mjs";import l from"./plugin/done.mjs";import{SSR as a}from"./process-env.mjs";import p from"./utils/log.mjs";import f from"./utils/seo.mjs";import c from"./utils/progress.mjs";import g from"chalk";let{ProgressPlugin:h}=r,u=[m(t,{module:s(!1),plugins:[i.done&&new l({done:i.done}),i.bar&&new h({handler(o,r,...m){let t=i.bar;c(o,t.name||"Build",m.length?`[${r}] ${m.join(" ")}`:"",t.color)}})].filter(Boolean)})];a&&u.push(m(t,e));let d=r(u);async function j(){await new Promise(o=>{d.run((r,m)=>{if(r)throw r;if(m&&(m.hasErrors()||m.hasWarnings()))for(let o=0,r=m.stats.length;o<r;o++){let r=m.stats[o];for(let o=0,m=r.compilation.warnings.length;o<m;o++)p(g.yellowBright(r.compilation.warnings[o].message));for(let o=0,m=r.compilation.errors.length;o<m;o++)p(g.redBright(r.compilation.errors[o].message))}o(r)})}),i.seo&&f()}await j(),process.on("exit",function(){o(n.cachePath),o(n.vfsDtsPath)});
|
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 s from"webpack";import l from"webpack-dev-middleware";import r from"webpack-hot-middleware";import{merge as m}from"webpack-merge";import a from"./build/server.mjs";import{commonConfig as n}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 x from"./paths.mjs";import{SSR as j,isLibrary as g,isReact as k}from"./process-env.mjs";import $ from"./utils/has-pkg.mjs";import{empty as b,resolveProgram as y}from"./utils/index.mjs";import v from"./utils/progress.mjs";import
|
|
1
|
+
import{directoryExists as e,removeDirAll as t}from"@moneko/mdx";import o from"express";import i from"multer";import s from"webpack";import l from"webpack-dev-middleware";import r from"webpack-hot-middleware";import{merge as m}from"webpack-merge";import a from"./build/server.mjs";import{commonConfig as n}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 x from"./paths.mjs";import{SSR as j,isLibrary as g,isReact as k}from"./process-env.mjs";import $ from"./utils/has-pkg.mjs";import{empty as b,resolveProgram as y}from"./utils/index.mjs";import v from"./utils/progress.mjs";import P from"./utils/sigint-exit.mjs";let{HotModuleReplacementPlugin:_,ProgressPlugin:S,WatchIgnorePlugin:B}=s,D=$("stylelint-webpack-plugin")&&(await import("stylelint-webpack-plugin")).default,C=$("eslint-webpack-plugin")&&(await import("eslint-webpack-plugin")).default,L=k&&(await import("@pmmmwh/react-refresh-webpack-plugin")).default,M=["js","jsx","ts","tsx","json","html","vue"],F=M.join(","),O=["css","scss","sass","less","ts","tsx","js","jsx"],R=O.join(","),T=["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=n.output.path;j&&(A=y(`${g?"docs":"dist"}/client`));let E=m(n,{entry:{main:[`webpack-hot-middleware/client?name=client&path=//localhost:${p}/__hmr__&${q}`]},output:{path:A},module:w(!1),plugins:[new _,new B({paths:[/\.d\.ts$/]}),L&&new L,C&&new C({fix:!0,threads:!0,files:[`${c.alias["@"]}/**/*.{${F}}`,g&&`${c.alias["@pkg"]}/**/*.{${F}}`].filter(Boolean),extensions:M,exclude:T,cache:!0,cacheLocation:`${x.lineCachePath}/.eslintcache`,lintDirtyModulesOnly:!0}),D&&new D({fix:!0,threads:!0,files:[`${c.alias["@"]}/**/*.{${R}}`,g&&`${c.alias["@pkg"]}/**/*.{${R}}`].filter(Boolean),extensions:O,exclude:T,cache:!0,cacheLocation:`${x.lineCachePath}/.stylelintcache`,lintDirtyModulesOnly:!0}),c.bar&&new S({handler(e,t,...o){let i=c.bar;v(e,i.name||"Build",o.length?`[${t}] ${o.join(" ")}`:"",i.color)}})].filter(Boolean)}),G=[E];j&&G.push(m(n,a));let I=s(G);I.compilers[0].hooks.done.tap("client-log",e=>{d(null,e)});let U=o(),z=i(),H=l(I,{writeToDisk:!1,index:"index.html",headers:()=>u,serverSideRender:j,lastModified:!0});if(U.use(H),U.use(r(I,{log:!1,path:"/__hmr__",heartbeat:2e3})),c.proxy&&f(U,c.proxy),e(x.mockPath)){let e=h(x.mockPath);U.use(e)}let J=`${E.output.path}/index.html`;U.all("/*",z.any(),function(e,t,o){if("GET"!==e.method)return o();{let e=H.context.outputFileSystem,o=e?.readFileSync?.(J);t.end(o)}});let K=U.listen(p,()=>{});process.on("exit",function(){H.close(b),K.close(b),K.closeAllConnections(),t(x.cachePath),t(x.vfsDtsPath)}),P(()=>{process.exit(1)});
|
package/lib/paths.d.mts
CHANGED
package/lib/paths.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"url";import{dirname as t,resolve as o}from"path";let a=JSON.parse(process.env.npm_config_argv||'{"original":[]}').original;export const __filename=e.fileURLToPath(import.meta.url);export const __dirname=t(__filename);export const yarnArgv={};for(let e=0,t=a.length;e<t;e++){let t=a[e].split("=");Object.assign(yarnArgv,{[t[0]]:t[1]||!0})}export const CUSTOMCONFIG=process.env.npm_config_config||yarnArgv.config;let c=process.cwd(),r=o(c,"./node_modules"),n={__dirname,__filename,nodeModules:r,corePath:e.fileURLToPath(new URL(".",import.meta.url)),programPath:c,webpackCachePath:o(r,"./.temp_cache"),lineCachePath:o(r,"./.cache"),cachePath:o(r,"./.cache/.mo"),httpCachePath:o(r,"./.cache/http"),swcCachePath:o(r,"./.swc"),configPath:o(c,"./config/index.ts"),customConfigPath:o(c,`./config/${CUSTOMCONFIG}.ts`),coveragePath:o(c,"./coverage/clover.xml"),pagesPath:o(c,"./src/pages"),componentsPath:o(c,"./components"),mockPath:o(c,"./mock")};export const routeDir="library"===process.env.APPTYPE?n.componentsPath:n.pagesPath;export default n;
|
|
1
|
+
import e from"url";import{dirname as t,resolve as o}from"path";let a=JSON.parse(process.env.npm_config_argv||'{"original":[]}').original;export const __filename=e.fileURLToPath(import.meta.url);export const __dirname=t(__filename);export const yarnArgv={};for(let e=0,t=a.length;e<t;e++){let t=a[e].split("=");Object.assign(yarnArgv,{[t[0]]:t[1]||!0})}export const CUSTOMCONFIG=process.env.npm_config_config||yarnArgv.config;let c=process.cwd(),r=o(c,"./node_modules"),n={__dirname,__filename,nodeModules:r,corePath:e.fileURLToPath(new URL(".",import.meta.url)),programPath:c,webpackCachePath:o(r,"./.temp_cache"),lineCachePath:o(r,"./.cache"),cachePath:o(r,"./.cache/.mo"),httpCachePath:o(r,"./.cache/http"),swcCachePath:o(r,"./.swc"),configPath:o(c,"./config/index.ts"),customConfigPath:o(c,`./config/${CUSTOMCONFIG}.ts`),coveragePath:o(c,"./coverage/clover.xml"),pagesPath:o(c,"./src/pages"),componentsPath:o(c,"./components"),mockPath:o(c,"./mock"),vfsDtsPath:o(r,"./@app")};export const routeDir="library"===process.env.APPTYPE?n.componentsPath:n.pagesPath;export default n;
|