@moneko/core 3.9.1 → 3.9.3-beta.0
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/browserslist.d.ts +2 -0
- package/lib/browserslist.js +1 -0
- package/lib/config.js +1 -1
- package/lib/polyfills.js +1 -1
- package/lib/prod.js +1 -1
- package/lib/vm/docs.js +1 -1
- package/lib/vm/example.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";export default function(){return r(void 0,{path:t.programPath,env:process.env.NODE_ENV}).filter(r=>!r.endsWith(" TP"))}
|
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};
|
package/lib/polyfills.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import r from"
|
|
1
|
+
import r from"core-js-compat";import t from"./browserslist.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 m from"lightningcss";import o from"mini-css-extract-plugin";import n from"terser-webpack-plugin";import r from"webpack";import{BundleAnalyzerPlugin as s}from"webpack-bundle-analyzer";import{merge as t}from"webpack-merge";import p from"webpackbar";import l from"./browserslist.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.browserslistToTargets(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(t(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 s(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/lib/vm/docs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{loadFileSync as e,scanFolder as t}from"@moneko/mdx";import o from"./generate-doc.js";import{CONFIG as r}from"../config.js";import{FRAMEWORKNAME as n,createElement as p,
|
|
1
|
+
import{loadFileSync as e,scanFolder as t}from"@moneko/mdx";import o from"./generate-doc.js";import{CONFIG as r}from"../config.js";import{FRAMEWORKNAME as n,createElement as p,isLibrary as s,isReact as a,isSolid as m}from"../process-env.js";import l from"../reactive-object.js";export const docsModuleName="@app/docs";export const docs=new l({[docsModuleName]:"export default {}"});export const comment=new l({});if(s){let s={},l=`import { ${p}${m?",Dynamic":""} } from "${n}${m?"/web":""}";import SuspenseComp from "@app/suspense";function call_then(res) {return {default: ${a?"() =>":""}${p}(${m?"Dynamic":"'n-md'"}, {text: res.default, ${m?"component: 'n-md', ":""}css: 'table td a {display:inline-flex;align-items:center;gap:2px;}table td a n-img{display:inline-block;overflow:hidden;border-radius:var(--border-radius);inline-size:18px;block-size:18px;}' })};}`,c=(e,t)=>{let[o,r]=e.replace(/^@app\/comment\//,"").split("/");if(s[o]||(s[o]={}),t)s[o][r]&&delete s[o][r];else{let e=`@app/comment/${o}/${r}`;s[o][r]=`rr(() => ${p}(SuspenseComp, { comp: () => import(/* webpackChunkName: '${e}' */ '${e}?raw').then(call_then)}))rr`}let n={};for(let e in s)Object.prototype.hasOwnProperty.call(s,e)&&(n[e]=Object.values(s[e]));docs.setData(docsModuleName,`${l}export default ${JSON.stringify(n).replace(/"rr\((.+?)\)rr"/g,"$1")}`)};comment.on("change",(e,t)=>{c(e,t?.length<0)}),t(r.alias["@pkg"]).filter(e=>/^(?![._]).*(?<!\.test)\.(tsx?)$/i.test(e)).forEach(t=>{let r=e(t);r&&comment.setData(`@app/comment/${t.split("/").slice(-2).join("/").replace(/\.tsx?/,".md")}`,o(r,t))})}
|
package/lib/vm/example.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{generateExample as e}from"@moneko/mdx";import{watchFiles as o}from"./utils.js";import t from"../paths.js";import{isDev as r,isLibrary as p}from"../process-env.js";import m from"../reactive-object.js";export const exampleModuleName="@app/example";function a(){try{return JSON.parse(e(t.componentsPath,"@app/example/"))}catch(e){return{}}}export const examples=new m(a());export function generatorDemo(){let e=a();for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&examples.setData(o,e[o])}p&&r&&o(t.componentsPath,/(?<!\/examples\/(.+)\.md)$/,generatorDemo);
|
|
1
|
+
import{generateExample as e}from"@moneko/mdx";import{watchFiles as o}from"./utils.js";import t from"../paths.js";import{isDev as r,isLibrary as p}from"../process-env.js";import m from"../reactive-object.js";export const exampleModuleName="@app/example";function a(){try{return JSON.parse(e(t.componentsPath,"@app/example/"))}catch(e){return{}}}export const examples=new m(p?a():{});export function generatorDemo(){let e=a();for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&examples.setData(o,e[o])}p&&r&&o(t.componentsPath,/(?<!\/examples\/(.+)\.md)$/,generatorDemo);
|
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.0",
|
|
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'
|