@moneko/core 3.40.1 → 3.40.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/bin/build.mjs CHANGED
@@ -1 +1 @@
1
- import{join as o}from"node:path";import{argv as t}from"node:process";import{convert as e}from"@moneko/convert";import{ink as s,println as i,removeDir as r}from"@moneko/utils";import m from"../commom/setup-env.mjs";import{cwd as n,swcCachePath as l}from"./utils/config.mjs";import{getSwcOption as c}from"./utils/setup-swcrc.mjs";import{lesscCommonjs as p}from"./lessc.mjs";import d from"./tsc.mjs";async function u(){let u=t[3],a=t[4],f=t.slice(5);u||(i(s(`type: 无效值 ${s(u,"245")}`,"red")),process.exit(1));let j=!f.includes("no-docs"),y=!f.includes("no-lib"),x=!f.includes("no-es"),b=!f.includes("no-dts"),g=f.filter(o=>!["no-docs","no-es","no-lib"].includes(o));if(await m("production",u,a,g),"library"===u){let{CONFIG:t}=await import("../config.mjs"),s="swc"===t.dts,i=[y&&{type:"commonjs",dir:"lib",msg:"Convert to CommonJS"},x&&{type:"es6",dir:"es",msg:"Convert to ES Module"}].filter(Boolean);for(let t=0,m=i.length;t<m;t++){r(o(n,`./${i[t].dir}`));let m=c(a);"es6"===i[t].type&&(m.jsc.target="es2015"),m.jsc.experimental.emitIsolatedDts=b&&s,m.jsc.experimental.cacheRoot=l,m.module.type=i[t].type,e({outDir:i[t].dir,inputDir:"components",ignore:[/^.*\/__*__\//,/\.test\.(js|ts)x?$/,/\.DS_Store/,/\.mdx?$/,/^.*\/examples\//,/\.d\.(cj|mj|j|t|ct|mt)sx?$/],options:m}),"commonjs"===i[t].type&&p(),b&&!s&&d(i[t].dir)}}("library"!==u||j&&"library"===u)&&import("../build.mjs")}export default u;
1
+ import{join as o}from"node:path";import{argv as t}from"node:process";import{convert as e}from"@moneko/convert";import{ink as r,println as s,removeDir as i}from"@moneko/utils";import m from"../commom/setup-env.mjs";import{cwd as n,swcCachePath as c}from"./utils/config.mjs";import{getSwcOption as l}from"./utils/setup-swcrc.mjs";import{lesscCommonjs as p}from"./lessc.mjs";import d from"./tsc.mjs";async function a(){let a=t[3],f=t[4],u=t.slice(5);a||(s(r(`type: 无效值 ${r(a,"245")}`,"red")),process.exit(1));let j=!u.includes("no-docs"),y=!u.includes("no-lib"),x=!u.includes("no-es"),b=!u.includes("no-dts"),g=u.filter(o=>!["no-docs","no-es","no-lib"].includes(o));if(await m("production",a,f,g),"library"===a){let{CONFIG:t}=await import("../config.mjs"),r="swc"===t.dts,s=[y&&{type:"commonjs",dir:"lib",msg:"Convert to CommonJS"},x&&{type:"es6",dir:"es",msg:"Convert to ES Module"}].filter(Boolean);for(let t=0,m=s.length;t<m;t++){i(o(n,`./${s[t].dir}`));let m=l(f);"es6"===s[t].type&&(m.jsc.target="es2015"),m.jsc.experimental.emitIsolatedDts=b&&r,m.jsc.experimental.cacheRoot=c,m.module.type=s[t].type,e({outDir:s[t].dir,inputDir:"components",ignore:[/^.*\/__*__\//,/\.test\.(js|ts)x?$/,/\.DS_Store/,/\.mdx?$/,/^.*\/examples\//,/\.d\.(cj|mj|j|t|ct|mt)sx?$/],options:m}),"commonjs"===s[t].type&&p(),b&&!r&&d(s[t].dir)}}if("library"!==a||j&&"library"===a)try{await import("../build.mjs")}catch(o){console.error(Error(o)),process.exit(1)}}export default a;
package/lib/bin/start.mjs CHANGED
@@ -1 +1 @@
1
- import{argv as e}from"node:process";import{ink as o,println as t}from"@moneko/utils";import m from"../commom/setup-env.mjs";async function i(){let i=e[3],r=e[4],p=e.slice(5);i||(t(o(`type: 无效值 ${o(i,"245")}`,"red")),process.exit(1));let s=p.indexOf("no-verify");-1!==s&&p.splice(s,1),await m("development",i,r,p),import("../dev.mjs")}export default i;
1
+ import{argv as e}from"node:process";import{ink as o,println as r}from"@moneko/utils";import t from"../commom/setup-env.mjs";async function i(){let i=e[3],m=e[4],s=e.slice(5);i||(r(o(`type: 无效值 ${o(i,"245")}`,"red")),process.exit(1));let p=s.indexOf("no-verify");-1!==p&&s.splice(p,1),await t("development",i,m,s);try{await import("../dev.mjs")}catch(e){console.error(Error(e)),process.exit(1)}}export default i;
package/lib/common.mjs CHANGED
@@ -1 +1 @@
1
- import{extname as e,join as t,resolve as o}from"node:path";import s,{config_files as n,CUSTOMCONFIG as a}from"./commom/paths.mjs";import i from"./commom/require.mjs";import r from"./plugin/override-resolve.mjs";import{isObject as l,node_modules as m,resolveProgram as p}from"./utils/index.mjs";import{exampleModuleName as c}from"./vm/example.mjs";import u from"./vm/info.mjs";import{CONFIG as h,PUBLICPATH as f}from"./config.mjs";import d from"./plugins.config.mjs";import{isDev as g,isLibrary as b,NODE_ENV as y,packageJson as j}from"./process-env.mjs";export const outputConfig={path:p(b?"docs":"dist"),filename:"js/[name].[contenthash].bundle.js",chunkFilename:"js/[contenthash].chunk.js",assetModuleFilename:t=>{let o=e(t.filename||"").substring(1);return`assets/${o}/[hash][ext]`},library:{name:`${u.projectName}`,type:"umd",umdNamedDefine:!0},globalObject:"self",chunkLoadingGlobal:`webpackJsonp_${j.name}`,pathinfo:g,clean:!0,publicPath:f,asyncChunks:!0,charset:!0,iife:!0,crossOriginLoading:"anonymous",enabledWasmLoadingTypes:["fetch"],hotUpdateChunkFilename:"[id].[fullhash].hot.js",hotUpdateMainFilename:"[runtime].[fullhash].hot.json"};let v={main:[m("@app/entry")]};if(h.polyfill&&v.main.unshift(t(s.corePath,"./polyfills/replace-children.mjs")),g&&h.refresh&&h.env.injectRemoteReactRefresh&&v.main.unshift(i.resolve("@moneko/react/lib/injectRemoteReactRefresh.js")),h.entry&&("string"==typeof h.entry?v={main:[h.entry]}:Object.keys(h.entry)&&(v=Object.assign(v,h.entry))),"string"==typeof v.main&&(v.main=[v.main]),h.output){if("string"==typeof h.output)outputConfig.path=h.output;else if(Object.keys(h.output)){let e=h.output,t={...outputConfig.library};Object.assign(outputConfig,e),"object"==typeof h.output&&e.library&&(outputConfig.library=Object.assign(t,e.library))}}let C={type:"filesystem",allowCollectingMemory:!0,cacheDirectory:s.webpackCachePath,memoryCacheUnaffected:!0,name:`.${[a,y].filter(Boolean).join("-")}`,version:`${j.version}`,buildDependencies:{config:n}};!1===h.cache?C=!1:l(h.cache)&&(C=Object.assign(C,h.cache));export const commonConfig={name:"client",target:"web",devtool:h.devtool,entry:v,mode:g?"development":"production",stats:"errors-only",cache:C,snapshot:{immutablePaths:[/node_modules\/(?!(@app|@moneko)\/)/],managedPaths:[/^@app\/.+/,/^@moneko\/.+/],buildDependencies:{timestamp:!0,hash:!0}},infrastructureLogging:{level:"error"},externalsPresets:h.externalsPresets,plugins:d,node:{global:!1,__filename:!1,__dirname:!1},experiments:{topLevelAwait:!0,asyncWebAssembly:!0,cacheUnaffected:!0,layers:!0,lazyCompilation:h.lazyCompilation&&g&&{imports:!0,entries:!0,test:e=>{let t=e.nameForCondition();return!!(t&&(t.startsWith(m(c))||t.startsWith(m("@app/comment"))||t.startsWith(s.pagesPath)||t.startsWith(s.componentsPath)))}},buildHttp:l(h.buildHttp)?{allowedUris:[],lockfileLocation:o(s.httpCachePath,"http.lock"),cacheLocation:o(s.httpCachePath,"data"),upgrade:!0,...h.buildHttp}:h.buildHttp,backCompat:!0,futureDefaults:!0,css:!1,outputModule:!1},resolve:{extensions:[".mts",".mjs",".ts",".tsx",".js",".jsx",".json",".wasm"],alias:h.alias,modules:[s.nodeModules,s.pnpmNodeModules,s.denoNodeModules],mainFields:["browser","module","main"],mainFiles:["index"],plugins:h.resolvePlugins,preferAbsolute:!0,cache:!0,fallback:{}},externals:h.externals,output:outputConfig};h.overrideResolve&&commonConfig.resolve.plugins.push(new r(Object.assign({original:h.alias["@"],override:a&&p(a)},h.overrideResolve)));
1
+ import{extname as e,join as t,resolve as o}from"node:path";import s,{config_files as n,CUSTOMCONFIG as a}from"./commom/paths.mjs";import i from"./commom/require.mjs";import r from"./plugin/override-resolve.mjs";import{isObject as l,node_modules as m,resolveProgram as p}from"./utils/index.mjs";import{exampleModuleName as c}from"./vm/example.mjs";import u from"./vm/info.mjs";import{CONFIG as h,PUBLICPATH as f}from"./config.mjs";import d from"./plugins.config.mjs";import{isDev as g,isLibrary as b,NODE_ENV as y,packageJson as j}from"./process-env.mjs";export const outputConfig={path:p(b?"docs":"dist"),filename:"js/[name].[contenthash].bundle.js",chunkFilename:"js/[contenthash].chunk.js",assetModuleFilename:t=>{let o=e(t.filename||"").substring(1);return`assets/${o}/[hash][ext]`},library:{name:`${u.projectName}`,type:"umd",umdNamedDefine:!0},globalObject:"self",chunkLoadingGlobal:`webpackJsonp_${j.name}`,pathinfo:g,clean:!g,publicPath:f,asyncChunks:!0,charset:!0,iife:!0,crossOriginLoading:"anonymous",enabledWasmLoadingTypes:["fetch"],hotUpdateChunkFilename:"[id].[fullhash].hot.js",hotUpdateMainFilename:"[runtime].[fullhash].hot.json"};let v={main:[m("@app/entry")]};if(h.polyfill&&v.main.unshift(t(s.corePath,"./polyfills/replace-children.mjs")),g&&h.refresh&&h.env.injectRemoteReactRefresh&&v.main.unshift(i.resolve("@moneko/react/lib/injectRemoteReactRefresh.js")),h.entry&&("string"==typeof h.entry?v={main:[h.entry]}:Object.keys(h.entry)&&(v=Object.assign(v,h.entry))),"string"==typeof v.main&&(v.main=[v.main]),h.output){if("string"==typeof h.output)outputConfig.path=h.output;else if(Object.keys(h.output)){let e=h.output,t={...outputConfig.library};Object.assign(outputConfig,e),"object"==typeof h.output&&e.library&&(outputConfig.library=Object.assign(t,e.library))}}let C={type:"filesystem",allowCollectingMemory:!0,cacheDirectory:s.webpackCachePath,memoryCacheUnaffected:!0,name:`.${[a,y].filter(Boolean).join("-")}`,version:`${j.version}`,buildDependencies:{config:n}};!1===h.cache?C=!1:l(h.cache)&&(C=Object.assign(C,h.cache));export const commonConfig={name:"client",target:"web",devtool:h.devtool,entry:v,mode:g?"development":"production",stats:"errors-only",cache:C,snapshot:{immutablePaths:[/node_modules\/(?!(@app|@moneko)\/)/],managedPaths:[/^@app\/.+/,/^@moneko\/.+/],buildDependencies:{timestamp:!0,hash:!0}},infrastructureLogging:{level:"error"},externalsPresets:h.externalsPresets,plugins:d,node:{global:!1,__filename:!1,__dirname:!1},experiments:{topLevelAwait:!0,asyncWebAssembly:!0,cacheUnaffected:!0,layers:!0,lazyCompilation:h.lazyCompilation&&g&&{imports:!0,entries:!0,test:e=>{let t=e.nameForCondition();return!!(t&&(t.startsWith(m(c))||t.startsWith(m("@app/comment"))||t.startsWith(s.pagesPath)||t.startsWith(s.componentsPath)))}},buildHttp:l(h.buildHttp)?{allowedUris:[],lockfileLocation:o(s.httpCachePath,"http.lock"),cacheLocation:o(s.httpCachePath,"data"),upgrade:!0,...h.buildHttp}:h.buildHttp,backCompat:!0,futureDefaults:!0,css:!1,outputModule:!1},resolve:{extensions:[".mts",".mjs",".ts",".tsx",".js",".jsx",".json",".wasm"],alias:h.alias,modules:[s.nodeModules,s.pnpmNodeModules,s.denoNodeModules],mainFields:["browser","module","main"],mainFiles:["index"],plugins:h.resolvePlugins,preferAbsolute:!0,cache:!0,fallback:{}},externals:h.externals,output:outputConfig};h.overrideResolve&&commonConfig.resolve.plugins.push(new r(Object.assign({original:h.alias["@"],override:a&&p(a)},h.overrideResolve)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "3.40.1",
3
+ "version": "3.40.2",
4
4
  "description": "core",
5
5
  "main": "lib/index.mjs",
6
6
  "type": "module",