@moneko/core 3.9.2 → 3.9.3-beta.1
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/browser-targets.d.ts +2 -0
- package/lib/browser-targets.js +1 -0
- package/lib/config.js +1 -1
- package/lib/loader/lightningcss.cjs +1 -0
- package/lib/loader/lightningcss.d.cts +8 -0
- package/lib/loader/mdx.cjs +1 -1
- package/lib/loader/mdx.d.cts +1 -1
- package/lib/module.config.js +1 -1
- package/lib/polyfills.js +1 -1
- package/lib/prod.js +1 -1
- package/package.json +3 -3
- package/typings/global.d.ts +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import r from"browserslist";import t from"./paths.js";let e=r(void 0,{path:t.programPath,env:process.env.NODE_ENV}).filter(r=>!r.endsWith(" TP"));export default e;
|
package/lib/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fileExists as e}from"@moneko/mdx";import{merge as t}from"webpack-merge";import s,{CUSTOMCONFIG as o}from"./paths.js";import{FRAMEWORK as i,PACKAGENAME as n,coreName as r,isDev as a,isLibrary as l,isMobile as m,isSolid as
|
|
1
|
+
import{fileExists as e}from"@moneko/mdx";import{merge as t}from"webpack-merge";import s,{CUSTOMCONFIG as o}from"./paths.js";import{FRAMEWORK as i,PACKAGENAME as n,coreName as r,isDev as a,isLibrary as l,isMobile as m,isSolid as p,jsxImportSource as c,mainDirectory as u}from"./process-env.js";import{isFunction as d,log as h,readConf as f,resolveProgramPath as g}from"./utils.js";let C=["@moneko","neko-ui","antd","@antv","katex","font-pingfang-sc","font-pingfang-tc","react-photo-view","react-markdown-editor-lite","schema-design","@app",".cache/http/data"],x={seo:!1,mode:"csr",compiler:"swc",bundleAnalyzer:!1,polyfill:!1,entry:{},minifier:{js:{},css:{type:"lightningcss"}},sourceMap:{filename:"[file].map",publicPath:""},env:{NODE_ENV:process.env.NODE_ENV},basename:"/",publicPath:"/",rem:{designSize:m?375:1680},fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:{"@":g(u)},moduleRules:[],prefixJsLoader:[],cssModules:[],importOnDemand:{},proxy:[],cacheDirectory:s.webpackCachePath,devServer:{allowedHosts:[".baidu.com"],host:"localhost",port:3e3,https:!1,compress:!1},htmlPluginOption:{template:`node_modules/${r}/template/index.html`,favicon:`node_modules/${r}/template/favicon.ico`,tags:[]},assetHtml:[],routerMode:"browser",fixBrowserRouter:!1,plugins:[],resolvePlugins:[],overrideResolve:!1,splitChunk:{chunks:"all",minSize:1024,minChunks:1,cacheGroups:{CHANGELOG:{test:/CHANGELOG\.md/,priority:-10,name:"CHANGELOG",reuseExistingChunk:!0},prismjs:{test:/(prism\.js|prism\/css\.ts)/,priority:-10,name:"vendors-prismjs",reuseExistingChunk:!0},site:{test:/site/,priority:-10,reuseExistingChunk:!0},marked:{test:/marked/,priority:-10,reuseExistingChunk:!0},"@moneko":{test:/@moneko/,priority:-10,reuseExistingChunk:!0}}},runtimeChunk:"single",moduleFederation:[],rulesInclude:{css:C,js:C,media:C,font:C,wasm:[]},mdx:{jsx:!1,development:a,jsxImportSource:c,providerImportSource:`@moneko/${i}/mdx`},jsxDomExpressions:{},bar:{name:"Client",color:"#6f42c1"},normalizeCss:!0,externalsPresets:{},buildHttp:{allowedUris:[],lockfileLocation:`${s.httpCachePath}/http.lock`,cacheLocation:`${s.httpCachePath}/data`,upgrade:!0}};p&&Object.assign(x,{jsxDomExpressions:{moduleName:"solid-js/web",builtIns:["For","Show","Switch","Match","Suspense","SuspenseList","Portal","Index","Dynamic","ErrorBoundary"],contextToCustomElements:!0,wrapConditionals:!0,generate:"dom",hydratable:!1}}),l&&(x.alias=Object.assign(x.alias,{"@pkg":s.componentsPath,[n]:s.componentsPath}));let k=x,P={},w={};if(e(s.configPath)){let e=(await f(s.configPath,"index")).default;P=d(e)?e(process):e}if(o&&e(s.customConfigPath)){let e=(await f(s.customConfigPath,o)).default;w=d(e)?e(process):e}"tsc"===(k=t(k,P,w)).compiler&&k.minifier&&void 0===k.minifier.js&&Object.assign(k.minifier,{js:{type:"terser"}}),(!1===k.devtool||!1===k.sourceMap)&&(k.sourceMap=!1,k.devtool=!1),k.fixBrowserRouter&&k.htmlPluginOption&&(k.htmlPluginOption.tags||(k.htmlPluginOption.tags=[]),k.htmlPluginOption.tags.push({textContent:"(function(l) {if (l.search[1] === '/' ) {var decoded = l.search.slice(1).split('&').map(function(s) {return s.replace(/~and~/g, '&')}).join('?');window.history.replaceState(null, null,l.pathname.slice(0, -1) + decoded + l.hash);}}(window.location))"}));export const CONFIG=k;export const PUBLICPATH=CONFIG.publicPath||"/";global.NEKOCLICONFIG={CONFIG,CUSTOMCONFIG:o,log:h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";let t;Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return n}});const e=require("buffer"),r=require("lightningcss");async function n(n,s){let i=this.async(),{implementation:o,targets:u=[],visitor:a={},rem:f,...c}=this.getOptions();if(o&&"function"!=typeof o.transform){i(TypeError(`[lightningcss]: options.implementation.transform must be an 'lightningcss' transform function. Received ${typeof o.transform}`));return}let l=o?.transform??r.transform;try{t||(t=(0,r.browserslistToTargets)(u)),f&&Object.assign(a,{Length(t){if("px"===t.unit)return{unit:"rem",value:t.value/16}}});let{code:o,map:p}=l({filename:this.resourcePath,code:e.Buffer.from(n),sourceMap:this.sourceMap,targets:t,visitor:a,inputSourceMap:this.sourceMap&&s?JSON.stringify(s):void 0,...c}),g=o.toString();i(null,g,p&&JSON.parse(p.toString()))}catch(t){i(t)}}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type TransformOptions } from 'lightningcss';
|
|
2
|
+
import type { LoaderContext } from 'webpack';
|
|
3
|
+
export interface LightningCssLoaderOption extends Omit<TransformOptions<Record<string, never>>, 'filename' | 'code' | 'targets' | 'inputSourceMap'> {
|
|
4
|
+
targets?: string[];
|
|
5
|
+
rem?: boolean;
|
|
6
|
+
implementation?: typeof import('lightningcss');
|
|
7
|
+
}
|
|
8
|
+
export default function LightningCssLoader(this: LoaderContext<LightningCssLoaderOption>, source: string, prevMap?: Record<string, unknown>): Promise<void>;
|
package/lib/loader/mdx.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@moneko/mdx");function t(t){let n=this.async();this.cacheable(!0),(0,e.mdx)({value:t,filepath:this.resourcePath,...this.getOptions()}).then(e=>{n(null,e.code)}).catch(n)}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@moneko/mdx");async function t(t){let n=this.async();this.cacheable(!0),(0,e.mdx)({value:t,filepath:this.resourcePath,...this.getOptions()}).then(e=>{n(null,e.code)}).catch(n)}
|
package/lib/loader/mdx.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type MdxOptions } from '@moneko/mdx';
|
|
2
2
|
import type { LoaderContext } from 'webpack';
|
|
3
|
-
export default function (this: LoaderContext<Omit<MdxOptions, 'value'>>, value: string): void
|
|
3
|
+
export default function (this: LoaderContext<Omit<MdxOptions, 'value'>>, value: string): Promise<void>;
|
package/lib/module.config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"mini-css-extract-plugin";import s from"mini-svg-data-uri";import
|
|
1
|
+
import e from"mini-css-extract-plugin";import s from"mini-svg-data-uri";import t from"./browser-targets.js";import{CONFIG as o,PUBLICPATH as r}from"./config.js";import a from"./modify-vars.js";import l,{CUSTOMCONFIG as i}from"./paths.js";import{FRAMEWORK as n,isDev as c,isLibrary as d,isMicro as m}from"./process-env.js";import p from"./swcrc.js";import u from"./tsloader.config.js";import{resolveNodeModulesPath as f,resolveProgramPath as y}from"./utils.js";import{comment as g}from"./vm/docs.js";import x from"./vm/generate-doc.js";let $={loader:`${l.corePath}/loader/css-unicode.cjs`},v=m?r:"../",j={loader:e.loader,options:{publicPath:"/"!==v?v:"../"}},b={loader:`${l.corePath}/loader/lightningcss.cjs`,options:{sourceMap:!!o.sourceMap,analyzeDependencies:!1,targets:t,drafts:{nesting:!0,customMedia:!0},errorRecovery:!1,unusedSymbols:[],rem:!!o.rem}};c&&(j="style-loader");let h=[...o.cssModules,`@moneko/${n}`,"neko-ui"].map(f),w=[...["src/styles/variables.less","src/styles/mixins.less","site/styles/variables.less","site/styles/mixins.less"].map(y)],_=["components","example","mock","site","src","server"].map(y);i&&_.push(y(i)),o.overrideResolve&&o.overrideResolve.override&&_.push(o.overrideResolve.override);let M={loader:"css-loader",options:{modules:{auto:e=>{for(let s=0,t=h.length;s<t;s++)if(e&&e?.includes(h[s]))return/(.*(?<!\.?global\.(le|c|sc|sa)ss)$)/i.test(e);return/(^(?!.*node_modules))(.*(?<!\.?global\.(le|c|sc|sa)ss)$)/i.test(e)},localIdentName:"[path][name]__[local]",exportLocalsConvention:"dashesOnly"},importLoaders:2}},B=c&&{loader:"@teamsupercell/typings-for-css-modules-loader",options:{verifyOnly:!c}},O=[j,B,M,b,$,{loader:"less-loader",options:{sourceMap:!!o.sourceMap,lessOptions:{modifyVars:a,javascriptEnabled:!0}}},{loader:"style-resources-loader",options:{patterns:w}}].filter(Boolean),P="tsc"===o.compiler,R={loader:P?"ts-loader":"swc-loader",options:P?u:p(c)};function k(e){return _.concat(o.rulesInclude?.[e]?.map(f)||[])}let L=k("media"),I={rules:[d&&c&&{test:/^(?![._]).*(?<!\.test)\.(tsx?)$/,include:o.alias["@pkg"],exclude:[/node_modules/,/(.+)\/__tests__\/(.+)/i],enforce:"pre",loader:`${l.corePath}/loader/ts-doc.cjs`,options:{comment:g,generateDoc:x}},{oneOf:[{resourceQuery:/raw/i,type:"asset/source"},{resourceQuery:/url/i,type:"asset/resource",generator:{filename:e=>{let s=e.filename;return s&&s.endsWith("wasm?url")?"wasm/[name][ext]":"assets/[name][ext]"}}},{test:/\.wasm$/i,type:"webassembly/async",include:k("wasm")},{test:/\.txt$/i,type:"asset/source"},{test:/\.ico$/i,type:"asset/inline",include:L},{test:/\.svg$/i,type:"asset/inline",generator:{dataUrl:e=>s(e.toString())},include:L},{test:/\.(gif|png|jpe?g|webp)$/i,type:"asset",dependency:{not:["url"]},generator:{filename:"assets/images/[name][ext]"},include:L},{test:/\.(webm|mp4|ogv)$/i,type:"asset",dependency:{not:["url"]},generator:{filename:"assets/video/[name][ext]"},include:L},{test:/\.(woff2?|eot|ttf|otf)(\?.*)?$/i,type:"asset",dependency:{not:["url"]},generator:{filename:"assets/fonts/[name][ext]"},include:k("font")},{test:/\.(sa|sc)ss$/i,use:[j,B,M,b,$,{loader:"sass-loader",options:{implementation:await import("sass"),sassOptions:{}}}].filter(Boolean),include:k("css")},{test:/\.less$/i,use:O,include:k("css")},{test:/\.css$/i,use:[j,"css-loader",b,$].filter(Boolean),include:k("css")},{test:/\.(cj|mj|t|j)s(|x)$/i,use:[...o.prefixJsLoader,R].filter(Boolean),include:k("js")},{test:/\.mdx?$/i,use:[...o.prefixJsLoader,{loader:`${l.corePath}/loader/mdx.cjs`,options:o.mdx}].filter(Boolean),include:_,exclude:[/(.+)\/examples\/(.+).mdx?$/i]},{test:/\.mdx?$/i,type:"asset/source",include:[/(.+)\/examples\/(.+).mdx?$/i]},{type:"asset/source",include:[/(.+)\/examples\/(.+).*?$/i]}]},...o.moduleRules].filter(e=>"object"==typeof e)};export default I;
|
package/lib/polyfills.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import r from"
|
|
1
|
+
import r from"core-js-compat";import t from"./browser-targets.js";export default function(){return r({targets:t,version:"3.33"}).list}
|
package/lib/prod.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{removeDirAll as e}from"@moneko/mdx";import i from"css-minimizer-webpack-plugin";import o from"mini-css-extract-plugin";import
|
|
1
|
+
import{removeDirAll as e}from"@moneko/mdx";import i from"css-minimizer-webpack-plugin";import{browserslistToTargets as m}from"lightningcss";import o from"mini-css-extract-plugin";import n from"terser-webpack-plugin";import r from"webpack";import{BundleAnalyzerPlugin as t}from"webpack-bundle-analyzer";import{merge as s}from"webpack-merge";import p from"webpackbar";import l from"./browser-targets.js";import{clientConfig as a}from"./common.js";import{CONFIG as u}from"./config.js";import{getMinifyOption as f}from"./minify.js";import c from"./paths.js";import d from"./plugin/done.js";import h from"./seo.js";let{optimize:{MinChunkSizePlugin:k}}=r,w=[];u.minifier&&(u.minifier.js&&w.push(new n(f(u.minifier.js?.type||"swc",u.minifier.js?.options))),u.minifier.css&&w.push(new i({minify:i.lightningCssMinify,minimizerOptions:{targets:m(l)}})));let b={splitChunks:u.splitChunk,runtimeChunk:u.runtimeChunk,chunkIds:"named",moduleIds:"named",removeAvailableModules:!0,removeEmptyChunks:!0,mergeDuplicateChunks:!0,mangleWasmImports:!0,minimize:!0,minimizer:w};r(s(a,{devtool:!1===u.devtool||u.devtool?u.devtool:"cheap-module-source-map",mode:"production",optimization:b,plugins:[new o({filename:"style/[name].bundle.css",chunkFilename:"style/[name].chunk.css",experimentalUseImportModule:!0}),u.splitChunk&&new k({minChunkSize:1e4}),u.bundleAnalyzer&&new t(u.bundleAnalyzer),u.bar&&new p(u.bar),new d({done:e=>{u.done?.(e),u.seo&&h()}})].filter(Boolean)})).run(e=>{if(e)throw e}),process.on("exit",function(){e(c.cachePath)});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/core",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.3-beta.1",
|
|
4
4
|
"description": "core",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -13,9 +13,8 @@
|
|
|
13
13
|
"author": "moneko",
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@moneko/mdx": "0.1.
|
|
16
|
+
"@moneko/mdx": "0.1.18",
|
|
17
17
|
"@swc/core": "1.3.100",
|
|
18
|
-
"@swc/css": "0.0.28",
|
|
19
18
|
"@swc/helpers": "0.5.3",
|
|
20
19
|
"@teamsupercell/typings-for-css-modules-loader": "2.5.2",
|
|
21
20
|
"add-asset-html-webpack-plugin": "6.0.0",
|
|
@@ -27,6 +26,7 @@
|
|
|
27
26
|
"html-webpack-plugin": "5.5.3",
|
|
28
27
|
"less": "4.2.0",
|
|
29
28
|
"less-loader": "11.1.3",
|
|
29
|
+
"lightningcss": "1.22.1",
|
|
30
30
|
"mini-css-extract-plugin": "2.7.6",
|
|
31
31
|
"mini-svg-data-uri": "1.4.4",
|
|
32
32
|
"sass": "1.69.5",
|
package/typings/global.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export type HtmlWebpackOption = HtmlWebpackPluginOptions & {
|
|
|
36
36
|
[key: string]: string | null | boolean | number;
|
|
37
37
|
}[];
|
|
38
38
|
};
|
|
39
|
-
export type CssMinify = 'swc' | 'cssnano';
|
|
39
|
+
export type CssMinify = 'swc' | 'cssnano' | 'lightningcss';
|
|
40
40
|
export type DevtoolOption =
|
|
41
41
|
| 'eval'
|
|
42
42
|
| 'eval-cheap-source-map'
|