@moneko/core 3.16.4 → 3.16.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.
@@ -1 +1 @@
1
- import e from"mini-css-extract-plugin";import i from"terser-webpack-plugin";import n from"webpack";import{BundleAnalyzerPlugin as m}from"webpack-bundle-analyzer";import{merge as r}from"webpack-merge";import{commonConfig as o}from"../common.mjs";import{CONFIG as t}from"../config.mjs";import{getMinifyOption as l}from"../options/js-minify.mjs";import{LightningCssMinifyPlugin as p}from"../plugin/lightningcss-plugin.mjs";let{optimize:{MinChunkSizePlugin:s}}=n,a=[];t.minifier&&(a.push(new i(l(t.minifier.type,t.minifier.options))),a.push(new p));let u=r(o,{plugins:[new e({filename:"style/[name].bundle.css",chunkFilename:"style/[name].chunk.css",ignoreOrder:!0}),t.splitChunk&&new s({minChunkSize:1e4}),t.bundleAnalyzer&&new m({analyzerMode:"static",reportFilename:"report.html",openAnalyzer:!1,defaultSizes:"gzip",logLevel:"silent",...t.bundleAnalyzer})].filter(Boolean),optimization:{splitChunks:t.splitChunk,runtimeChunk:t.runtimeChunk,chunkIds:"named",moduleIds:"named",removeAvailableModules:!0,removeEmptyChunks:!0,mergeDuplicateChunks:!0,mangleWasmImports:!0,minimize:!0,minimizer:a}});export default u;
1
+ import e from"mini-css-extract-plugin";import i from"terser-webpack-plugin";import n from"webpack";import{BundleAnalyzerPlugin as m}from"webpack-bundle-analyzer";import{merge as r}from"webpack-merge";import{commonConfig as t}from"../common.mjs";import{CONFIG as o}from"../config.mjs";import{getMinifyOption as l}from"../options/js-minify.mjs";import{LightningCssMinifyPlugin as s}from"../plugin/lightningcss-plugin.mjs";import{getLightningCssTargets as p}from"../polyfills/targets.mjs";let{optimize:{MinChunkSizePlugin:a}}=n,u=[];o.minifier&&(u.push(new i(l(o.minifier.type,o.minifier.options))),u.push(new s({targets:p()})));let f=r(t,{plugins:[new e({filename:"style/[name].bundle.css",chunkFilename:"style/[name].chunk.css",ignoreOrder:!0}),o.splitChunk&&new a({minChunkSize:1e4}),o.bundleAnalyzer&&new m({analyzerMode:"static",reportFilename:"report.html",openAnalyzer:!1,defaultSizes:"gzip",logLevel:"silent",...o.bundleAnalyzer})].filter(Boolean),optimization:{splitChunks:o.splitChunk,runtimeChunk:o.runtimeChunk,chunkIds:"named",moduleIds:"named",removeAvailableModules:!0,removeEmptyChunks:!0,mergeDuplicateChunks:!0,mangleWasmImports:!0,minimize:!0,minimizer:u}});export default f;
package/lib/common.mjs CHANGED
@@ -1 +1 @@
1
- import{CONFIG as e,PUBLICPATH as t}from"./config.mjs";import o,{CUSTOMCONFIG as s}from"./paths.mjs";import r from"./plugin/override-resolve.mjs";import n from"./plugins.config.mjs";import{PACKAGENAME as i,PACKAGEVERSION as l,isDev as a,isLibrary as p}from"./process-env.mjs";import m from"./rule.mjs";import{node_modules as u,resolveProgram as c}from"./utils/index.mjs";export const outputConfig={path:c(p?"docs":"dist"),filename:"js/[name].bundle.js",chunkFilename:`js/[${a?"name":"chunkhash"}].js`,assetModuleFilename:e=>{let t=e.filename;return t?.endsWith("?url")&&m.worker_file.test(t.replace("?url",""))?"worker/[name][ext]":"assets/[name][hash][ext]"},library:{name:i,type:"window"},globalObject:"window",chunkLoadingGlobal:`webpackJsonp_${i}`,pathinfo:a,clean:!0,publicPath:t,asyncChunks:!0,charset:!0};let f={main:[e.polyfill&&`${o.corePath}/polyfills/replace-children.js`,u("@app/entry")].filter(Boolean)};e.entry&&("string"==typeof e.entry?f={main:[e.entry]}:Object.keys(e.entry)&&(f=Object.assign(f,e.entry))),"string"==typeof f.main&&(f.main=[f.main]),e.output&&("string"==typeof e.output?outputConfig.path=e.output:Object.keys(e.output)&&Object.assign(outputConfig,e.output));let d=!1;e.cacheDirectory&&(d={type:"filesystem",store:"pack",allowCollectingMemory:!0,cacheDirectory:e.cacheDirectory,memoryCacheUnaffected:!0,name:[s,process.env.NODE_ENV].filter(Boolean).join("-"),version:l});let y=Object.assign({original:e.alias["@"],override:s&&c(s)},e.overrideResolve);export const commonConfig={devtool:e.devtool,entry:f,mode:a?"development":"production",stats:"errors-only",cache:d,infrastructureLogging:{level:"error"},target:"web",externalsPresets:e.externalsPresets,plugins:n,node:{global:!1},experiments:{topLevelAwait:!0,asyncWebAssembly:!0,cacheUnaffected:!0,layers:!0,lazyCompilation:a&&{imports:!1,entries:!1},buildHttp:e.buildHttp,backCompat:!0,futureDefaults:!1,css:!1,outputModule:!1},resolve:{extensions:["...",".jsx",".ts",".tsx"],alias:e.alias,modules:[o.nodeModules,o.pnpmNodeModules],mainFields:["browser","module","main"],mainFiles:["index"],plugins:[e.overrideResolve&&new r(y),...e.resolvePlugins].filter(Boolean),fallback:{path:!1,fs:!1,crypto:!1,assert:!1}},externals:e.externals,output:outputConfig};
1
+ import{CONFIG as e,PUBLICPATH as t}from"./config.mjs";import o,{CUSTOMCONFIG as s}from"./paths.mjs";import r from"./plugin/override-resolve.mjs";import n from"./plugins.config.mjs";import{PACKAGENAME as i,PACKAGEVERSION as l,isDev as a,isLibrary as p}from"./process-env.mjs";import m from"./rule.mjs";import{node_modules as u,resolveProgram as c}from"./utils/index.mjs";import{join as f}from"path";export const outputConfig={path:c(p?"docs":"dist"),filename:"js/[name].bundle.js",chunkFilename:`js/[${a?"name":"chunkhash"}].js`,assetModuleFilename:e=>{let t=e.filename;return t?.endsWith("?url")&&m.worker_file.test(t.replace("?url",""))?"worker/[name][ext]":"assets/[name][hash][ext]"},library:{name:i,type:"window"},globalObject:"window",chunkLoadingGlobal:`webpackJsonp_${i}`,pathinfo:a,clean:!0,publicPath:t,asyncChunks:!0,charset:!0};let d={main:[e.polyfill&&f(o.corePath,"./polyfills/replace-children.mjs"),u("@app/entry")].filter(Boolean)};e.entry&&("string"==typeof e.entry?d={main:[e.entry]}:Object.keys(e.entry)&&(d=Object.assign(d,e.entry))),"string"==typeof d.main&&(d.main=[d.main]),e.output&&("string"==typeof e.output?outputConfig.path=e.output:Object.keys(e.output)&&Object.assign(outputConfig,e.output));let y=!1;e.cacheDirectory&&(y={type:"filesystem",store:"pack",allowCollectingMemory:!0,cacheDirectory:e.cacheDirectory,memoryCacheUnaffected:!0,name:[s,process.env.NODE_ENV].filter(Boolean).join("-"),version:l});let g=Object.assign({original:e.alias["@"],override:s&&c(s)},e.overrideResolve);export const commonConfig={devtool:e.devtool,entry:d,mode:a?"development":"production",stats:"errors-only",cache:y,infrastructureLogging:{level:"error"},target:"web",externalsPresets:e.externalsPresets,plugins:n,node:{global:!1},experiments:{topLevelAwait:!0,asyncWebAssembly:!0,cacheUnaffected:!0,layers:!0,lazyCompilation:a&&{imports:!1,entries:!1},buildHttp:e.buildHttp,backCompat:!0,futureDefaults:!1,css:!1,outputModule:!1},resolve:{extensions:["...",".jsx",".ts",".tsx"],alias:e.alias,modules:[o.nodeModules,o.pnpmNodeModules],mainFields:["browser","module","main"],mainFiles:["index"],plugins:[e.overrideResolve&&new r(g),...e.resolvePlugins].filter(Boolean),fallback:{path:!1,fs:!1,crypto:!1,assert:!1}},externals:e.externals,output:outputConfig};
@@ -1 +1 @@
1
- import{Buffer as s}from"buffer";import{transform as t}from"lightningcss";import i from"webpack";import{paths as o}from"../index.mjs";import n from"../utils/require.mjs";let{sources:{RawSource:e,SourceMapSource:r},ModuleFilenameHelpers:{matchObject:a}}=i,m="lightning-css-minify",p=/\.css(?:\?.*)?$/i,{name:f,version:c}=n(`${o.programPath}/package.json`);export class LightningCssMinifyPlugin{constructor(s={}){let{implementation:i,...o}=s;if(i&&"function"!=typeof i.transform)throw TypeError(`[LightningCssMinifyPlugin]: implementation.transform must be an 'lightningcss' transform function. Received ${typeof i.transform}`);this.transform=i?.transform??t,this.options=o}apply(s){let t=JSON.stringify({name:f,version:c,options:this.options});s.hooks.compilation.tap(m,s=>{s.hooks.chunkHash.tap(m,(s,i)=>i.update(t)),s.hooks.processAssets.tapPromise({name:m,stage:s.constructor.PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE,additionalAssets:!0},async()=>await this.transformAssets(s)),s.hooks.statsPrinter.tap(m,s=>{s.hooks.print.for("asset.info.minimized").tap(m,(s,{green:t,formatFlag:i})=>s&&t&&i?t(i("minimized")):void 0)})})}async transformAssets(t){let{options:{devtool:i}}=t.compiler,{include:o,exclude:n,test:m,sourceMap:f=!!(i&&i.includes("source-map")),...c}=this.options,l=t.getAssets().filter(s=>!s.info.minimized&&(m||p).test(s.name)&&a({include:o,exclude:n},s.name));await Promise.all(l.map(async i=>{let o;let{source:n,map:a}=i.source.sourceAndMap(),m=n.toString(),p="string"==typeof n?s.from(n):n,l=this.transform({filename:i.name,code:p,minify:!0,sourceMap:f,...c}),g=l.code.toString();o=f?new r(g,i.name,JSON.parse(l.map.toString()),m,a,!0):new e(g),t.updateAsset(i.name,o,{...i.info,minimized:!0})}))}}
1
+ import{Buffer as s}from"buffer";import{transform as t}from"lightningcss";import i from"webpack";import{paths as o}from"../index.mjs";import n from"../utils/require.mjs";let{sources:{RawSource:e,SourceMapSource:r},ModuleFilenameHelpers:{matchObject:a}}=i,m="lightning-css-minify",p=/\.(c|le|sc|sa)ss(?:\?.*)?$/i,{name:f,version:c}=n(`${o.programPath}/package.json`);export class LightningCssMinifyPlugin{constructor(s={}){let{implementation:i,...o}=s;if(i&&"function"!=typeof i.transform)throw TypeError(`[LightningCssMinifyPlugin]: implementation.transform must be an 'lightningcss' transform function. Received ${typeof i.transform}`);this.transform=i?.transform??t,this.options=o}apply(s){let t=JSON.stringify({name:f,version:c,options:this.options});s.hooks.compilation.tap(m,s=>{s.hooks.chunkHash.tap(m,(s,i)=>i.update(t)),s.hooks.processAssets.tapPromise({name:m,stage:s.constructor.PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE,additionalAssets:!0},async()=>await this.transformAssets(s)),s.hooks.statsPrinter.tap(m,s=>{s.hooks.print.for("asset.info.minimized").tap(m,(s,{green:t,formatFlag:i})=>s&&t&&i?t(i("minimized")):void 0)})})}async transformAssets(t){let{options:{devtool:i}}=t.compiler,{include:o,exclude:n,test:m,sourceMap:f=!!(i&&i.includes("source-map")),...c}=this.options,l=t.getAssets().filter(s=>!s.info.minimized&&(m||p).test(s.name)&&a({include:o,exclude:n},s.name));await Promise.all(l.map(async i=>{let o;let{source:n,map:a}=i.source.sourceAndMap(),m=n.toString(),p="string"==typeof n?s.from(n):n,l=this.transform({filename:i.name,code:p,minify:!0,sourceMap:f,...c}),g=l.code.toString();o=f?new r(g,i.name,l.map?JSON.parse(l.map.toString()):{},m,a,!0):new e(g),t.updateAsset(i.name,o,{...i.info,minimized:!0})}))}}
package/lib/rule.mjs CHANGED
@@ -1 +1 @@
1
- export default{js:/\.(cj|mj|t|j)s(|x)$/i,css:/\.css$/i,less:/\.less$/i,scss:/\.(sa|sc)ss$/i,wasm:/\.wasm$/i,txt:/\.txt$/i,ico:/\.ico$/i,svg:/\.svg$/i,image:/\.(gif|png|jpe?g|webp)$/i,video:/\.(webm|mp4|ogv)$/i,font:/\.(woff2?|eot|ttf|otf)(\?.*)?$/i,markdown:/\.mdx?$/i,tsdoc:/^(?![._]).*(?<!\.test)\.(tsx?)$/,css_module:/(.*(?<!\.?global\.(le|c|sc|sa)ss)$)/i,node_modules_css_module:/(^(?!.*node_modules))(.*(?<!\.?global\.(le|c|sc|sa)ss)$)/i,no_parse:[/jquery|prismjs|prism\.js/,/react\.min\.js$/,/marked\.min\.js$/],node_modules:/node_modules/,__tests__:/(.+)\/__tests__\/(.+)/,dev_watch_ignored:/node_modules(?![\\/]@app)/,worker_file:/(?:webworker|worker)(\.|\b).*\.(js|ts)\b/,extract_func:/"rr\((.+?)\)rr"/g};
1
+ export default{js:/\.(cj|mj|t|j)s(|x)$/i,css:/\.css$/i,less:/\.less$/i,scss:/\.(sa|sc)ss$/i,wasm:/\.wasm$/i,txt:/\.txt$/i,ico:/\.ico$/i,svg:/\.svg$/i,image:/\.(gif|png|jpe?g|webp)$/i,video:/\.(webm|mp4|ogv)$/i,font:/\.(woff2?|eot|ttf|otf)(\?.*)?$/i,markdown:/\.mdx?$/i,tsdoc:/^(?![._]).*(?<!\.test)\.(tsx?)$/,css_module:/(.*(?<!\.?global\.(le|c|sc|sa)ss)$)/i,node_modules_css_module:/(^(?!.*node_modules))(.*(?<!\.?global\.(le|c|sc|sa)ss)$)/i,no_parse:[/jquery/,/react\.min\.js$/,/marked\.min\.js$/],node_modules:/node_modules/,__tests__:/(.+)\/__tests__\/(.+)/,dev_watch_ignored:/node_modules(?![\\/]@app)/,worker_file:/(?:webworker|worker)(\.|\b).*\.(js|ts)\b/,extract_func:/"rr\((.+?)\)rr"/g};
@@ -1 +1 @@
1
- import{join as p}from"path";import{getAppEntry as t,getAppFallback as e,getAppMdxScope as r,getAppMergeRouter as o,getAppNormalizeCss as m,getAppPrefixRouter as a,getAppRem as s,getAppSuspense as i,saveFile as f}from"@moneko/mdx";import n from"./coverage.mjs";import{docs as l,docsModuleName as c}from"./docs.mjs";import d from"./info.mjs";import{locales as x,localesModuleName as j}from"./locales.mjs";import{route as g,routesModuleName as u}from"./routes.mjs";import{CONFIG as v}from"../config.mjs";import y from"../paths.mjs";import{APPTYPE as h,FRAMEWORK as _}from"../process-env.mjs";import{node_modules as k}from"../utils/index.mjs";import{generateDeclaration as O}from"../utils/dts.mjs";import $ from"../utils/has-pkg.mjs";let b=$("@/mdx-scope"),z={app_env:k("@app/env.ts"),app_info:k("@app/info.ts"),app_entry:k("@app/entry.ts")},D={[z.app_env]:`export default ${JSON.stringify(v.env)}`,[z.app_info]:`export default ${JSON.stringify(d)}`,[z.app_entry]:t(p(v.alias["@"],"./index.ts"),!!v.rem,!!v.normalizeCss,h,_),[k("@app/rem")]:s(v.rem?.designSize||1680),[k("@app/fallback")]:e(v.fallbackCompPath),[k("@app/coverage")]:n(y.coveragePath),[k("@app/merge-router")]:o(),[k("@app/prefix-router")]:a(),[k("@app/normalize/index.css")]:m(),[k("@app/suspense/index.tsx")]:i(h,_),[k("@app/mdx-scope")]:b?r(b):"export default {}",[k(u)]:g.getData(u),[k(j)]:x.getData(j),[k(c)]:l.getData(c)},P=/\.tsx?/,S=/\.(j|t)sx?$/;for(let p in z)if(Object.prototype.hasOwnProperty.call(z,p)){let t=z[p];S.test(t)&&f(t.replace(P,".d$&"),O(D[t],t))}export default D;
1
+ import{join as p}from"path";import{getAppEntry as t,getAppFallback as e,getAppMdxScope as o,getAppMergeRouter as r,getAppNormalizeCss as a,getAppPrefixRouter as m,getAppRem as s,getAppSuspense as i,saveFile as f}from"@moneko/mdx";import n from"./coverage.mjs";import{docs as l,docsModuleName as x}from"./docs.mjs";import c from"./info.mjs";import{locales as d,localesModuleName as j}from"./locales.mjs";import{route as g,routesModuleName as u}from"./routes.mjs";import{CONFIG as v}from"../config.mjs";import y from"../paths.mjs";import{APPTYPE as h,FRAMEWORK as _}from"../process-env.mjs";import{node_modules as k}from"../utils/index.mjs";import{generateDeclaration as O}from"../utils/dts.mjs";import $ from"../utils/has-pkg.mjs";let b=$(p(v.alias["@"],"./mdx-scope.tsx"))||$(p(v.alias["@"],"./mdx-scope.ts")),z={app_env:k("@app/env.ts"),app_info:k("@app/info.ts"),app_entry:k("@app/entry.ts")},D={[z.app_env]:`export default ${JSON.stringify(v.env)}`,[z.app_info]:`export default ${JSON.stringify(c)}`,[z.app_entry]:t(p(v.alias["@"],"./index.ts"),!!v.rem,!!v.normalizeCss,h,_),[k("@app/rem")]:s(v.rem?.designSize||1680),[k("@app/fallback")]:e(v.fallbackCompPath),[k("@app/coverage")]:n(y.coveragePath),[k("@app/merge-router")]:r(),[k("@app/prefix-router")]:m(),[k("@app/normalize/index.css")]:a(),[k("@app/suspense/index.tsx")]:i(h,_),[k("@app/mdx-scope")]:b?o(b):"export default {}",[k(u)]:g.getData(u),[k(j)]:d.getData(j),[k(x)]:l.getData(x)},P=/\.tsx?/,S=/\.(j|t)sx?$/;for(let p in z)if(Object.prototype.hasOwnProperty.call(z,p)){let t=z[p];S.test(t)&&f(t.replace(P,".d$&"),O(D[t],t))}export default D;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "3.16.4",
3
+ "version": "3.16.6",
4
4
  "description": "core",
5
5
  "main": "lib/index.mjs",
6
6
  "type": "module",