@moneko/core 3.9.17-beta.23 → 3.9.17-beta.25
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/config.mjs +1 -1
- package/lib/options/modify-vars.d.mts +1 -0
- package/lib/options/modify-vars.mjs +1 -1
- package/lib/options/swcrc.d.mts +1 -1
- package/lib/options/swcrc.mjs +1 -1
- package/lib/polyfills/polyfills.mjs +1 -1
- package/lib/vm/generate-doc.mjs +1 -1
- package/package.json +9 -9
- package/lib/loader/hot-router.cjs +0 -1
- package/lib/loader/hot-router.d.cts +0 -1
package/lib/config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fileExists as e}from"@moneko/mdx";import{merge as o}from"webpack-merge";import t from"./options/jsx-dom-expressions.mjs";import s from"./options/split-chunk.mjs";import a,{CUSTOMCONFIG as i}from"./paths.mjs";import{FRAMEWORK as
|
|
1
|
+
import{fileExists as e}from"@moneko/mdx";import{merge as o}from"webpack-merge";import t from"./options/jsx-dom-expressions.mjs";import s from"./options/split-chunk.mjs";import a,{CUSTOMCONFIG as i}from"./paths.mjs";import{FRAMEWORK as l,PACKAGENAME as r,isDev as n,isLibrary as m,isMobile as p,jsxImportSource as c,mainDirectory as u}from"./process-env.mjs";import{isFunction as d,resolveProgramPath as h}from"./utils/index.mjs";import f from"./utils/log.mjs";import g from"./utils/read-conf.mjs";let P=["@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={devtool:n?"eval-cheap-module-source-map":"cheap-module-source-map",seo:!1,mode:"csr",bundleAnalyzer:!1,polyfill:!1,entry:{},minifier:{},sourceMap:{filename:"[file].map",publicPath:""},env:{NODE_ENV:process.env.NODE_ENV},basename:"/",publicPath:"/",rem:{designSize:p?375:1680},fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:{"@":h(u)},moduleRules:[],prefixJsLoader:[],cssModules:[],importOnDemand:{},proxy:{},cacheDirectory:a.webpackCachePath,devServer:{host:"localhost",port:3e3},htmlPluginOption:{},assetHtml:[],routerMode:"browser",fixBrowserRouter:!1,plugins:[],resolvePlugins:[],overrideResolve:!1,splitChunk:s,runtimeChunk:"single",moduleFederation:[],rulesInclude:{css:P,js:P,media:P,font:P,wasm:[]},mdx:{jsx:!1,development:n,jsxImportSource:c,providerImportSource:`@moneko/${l}/mdx`},jsxDomExpressions:t,bar:{name:"Client",color:"#6f42c1"},normalizeCss:!0,externalsPresets:{},buildHttp:{allowedUris:[],lockfileLocation:`${a.httpCachePath}/http.lock`,cacheLocation:`${a.httpCachePath}/data`,upgrade:!0},virtualModule:{}};m&&(x.alias=Object.assign(x.alias,{"@pkg":a.componentsPath,[r]:a.componentsPath}));let v=x,C={},k={};if(e(a.configPath)){let e=(await g(a.configPath,"index")).default;C=d(e)?e(process):e}if(i&&e(a.customConfigPath)){let e=(await g(a.customConfigPath,i)).default;k=d(e)?e(process):e}(!1===(v=o(v,C,k)).devtool||!1===v.sourceMap)&&(v.sourceMap=!1,v.devtool=!1),v.fixBrowserRouter&&v.htmlPluginOption&&(v.htmlPluginOption.tags||(v.htmlPluginOption.tags=[]),v.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=v;export const PUBLICPATH=CONFIG.publicPath||"/";global.NEKOCLICONFIG={CONFIG,CUSTOMCONFIG:i,log:f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CONFIG as
|
|
1
|
+
import i from"./html-plugin-option.mjs";import{CONFIG as o}from"../config.mjs";let f=o.prefixCls||"n",n={"@prefix-cls":f,"@ant-prefix":f,"@iconfont-css-prefix":`${f}-icon`,"@favicon":JSON.stringify(i.favicon)};Object.assign(n,o.modifyVars);export default n;
|
package/lib/options/swcrc.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { JsMinifyOptions, Config as SwcConfig } from '@swc/core';
|
|
2
2
|
export declare const swcMinifyOption: JsMinifyOptions;
|
|
3
|
-
declare const _default: (ssr: boolean) => SwcConfig;
|
|
3
|
+
declare const _default: (ssr: boolean) => (dev: boolean) => SwcConfig;
|
|
4
4
|
export default _default;
|
package/lib/options/swcrc.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{merge as e}from"webpack-merge";import{CONFIG as o}from"../config.mjs";import r from"../paths.mjs";import s from"../polyfills/polyfills.mjs";import{
|
|
1
|
+
import{merge as e}from"webpack-merge";import{CONFIG as o}from"../config.mjs";import r from"../paths.mjs";import s from"../polyfills/polyfills.mjs";import{isReact as t,isSolid as l,jsxImportSource as n}from"../process-env.mjs";export const swcMinifyOption={compress:{top_retain:[],keep_infinity:!0,global_defs:{"@alert":"console.log"},pure_funcs:["console.log","console.warn","console.error","console.info"],toplevel:!1,drop_console:!0,drop_debugger:!0,module:!1,ecma:2015,ie8:!1,keep_classnames:void 0,keep_fnames:!1},mangle:!0};let i=function(e){for(let o=0,r=Object.keys(e),s=r.length;o<s;o++)e[r[o]].transform=`${r[o]}/${e[r[o]].transform}`,e[r[o]].style&&(e[r[o]].style=`${r[o]}/${e[r[o]].style}`);return e}(o.importOnDemand||{}),p={include:s(),mode:"entry",coreJs:"3.35"};export default(s=>m=>e({module:{type:"es6",resolveFully:!0},jsc:{parser:{syntax:"typescript",tsx:!0,decorators:!0,dynamicImport:!0},loose:!0,target:o.polyfill?void 0:"es2017",externalHelpers:!1,transform:{legacyDecorator:!0,decoratorMetadata:!0,react:{runtime:"automatic",throwIfNamespace:!0,refresh:t&&m,development:m,importSource:n},optimizer:{simplify:!1}},minify:m?void 0:swcMinifyOption,experimental:{emitAssertForImportAttributes:!0,cacheRoot:r.swcCachePath,plugins:[["swc-plugin-another-transform-imports",i],l&&["@moneko/jsx-dom-expressions",{...o.jsxDomExpressions,generate:s?"ssr":"dom",hydratable:s}]].filter(Boolean)}},env:o.polyfill?p:void 0,sourceMaps:!0,parseMap:!0},"function"==typeof o.swcrc?o.swcrc(m):o.swcrc||{}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"core-js-compat";import{getBrowsersTargets as r}from"./targets.mjs";export default function(){return t({targets:r(),version:"3.
|
|
1
|
+
import t from"core-js-compat";import{getBrowsersTargets as r}from"./targets.mjs";export default function(){return t({targets:r(),version:"3.35"}).list}
|
package/lib/vm/generate-doc.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dirname as e}from"path";import t from"typescript";import{CONFIG as n}from"../config.mjs";let{ScriptKind:
|
|
1
|
+
import{dirname as e}from"path";import t from"typescript";import{CONFIG as n}from"../config.mjs";let{ScriptKind:l,ScriptTarget:r,SyntaxKind:o,createSourceFile:i,forEachChild:a,getLeadingCommentRanges:c,isInterfaceDeclaration:s,isQuestionToken:u,isPropertySignature:f,isFunctionTypeNode:p,isUnionTypeNode:m,isMethodSignature:g}=t,$={};function h(e){let t=c(e.getSourceFile().text,e.pos);if(t){let n=e.getSourceFile().text.substring(t[0].pos,t[0].end).match(/\/\*\*([\s\S]*?)\*\//);if(n)return n[1].replaceAll(/^\s*\* ?/gm,"").replace(/\s+$/,"").trim()}}function d(e){if(!e)return;let t=e.match(/@since\s+([^\n]+)/);return t?t[1].trim():void 0}function b(e){if(!e)return;let t=e.match(/@author (\w+)\s*(?:<([^>]+)>)?/);if(t&&t.length>0){let e=t[1].trim(),n=t[2]?.trim(),l=/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(n);return n?l&&(n=`mailto:${n}`):n=`https://github.com/${e}`,`[${e}](${n})`}}function y(e){if(!e)return;let t=e.match(/@ignore\s+([^\n]+)/);return t?t[1].trim():void 0}let x=/(?<!['"])(unknown|any|void|bigint|object|undefined|null|boolean|number|string|symbol)(?!['"])/g;function j(e,t){if(!e)return;let l=e.replaceAll(/\b([A-Z][a-zA-Z0-9]*)\b/g,e=>{if($[e]){let l=`/${[n.basename,$[e]].join("/").split("/").filter(Boolean).join("/")}`;return t?`[\\color{#009688}{${e}}](${l})`:`[${e}](${l})`}return t?`\\color{#009688}{${e}}`:e});return t&&(l=l.replaceAll(x,e=>`\\color{#009688}{${e}}`)),l}function A(e){if(e)return(function(e){let t;if(!e)return;let n=[];for(;t=/\\color{([^|}]*)\|?([^|}]*)\|?([^|}]*)\|?([^}]*)}{([^}]*)}/g.exec(e);)n.push(t[0]);return e.replaceAll(/[{}[\]()=>]|keyof|typeof|true|false/g,e=>n.some(t=>t.includes(e))?e:`\\color{#569cd6}{${e}}`)})(e)?.replaceAll(/^\s*\|\s*|\s*\|\s*$/gm,"").replaceAll(/\n/g,"<br/>").replaceAll(/\*/g,"\\*").replaceAll(/\|/g,"\\|").replaceAll(/(['"])((?:(?!\1).)*)\1/g,"\\color{#ce9178}{$1$2$1}")}function T(e){if(e)return e.replaceAll(/^@[a-z].+/gm,"").replaceAll(/(\n\s+)+/g,"<br />").replaceAll(/\n/g,"<br />").replaceAll(/(<br \/>)$/g,"")}export default function B(c,x){let B=i(x,c,r.Latest,!0,l.TS),k="";return a(B,l=>{s(l)?k+=function(l){let r=l.name.text;Object.assign($,{[l.name.text]:e(l.getSourceFile().fileName).replace(n.alias["@pkg"],"")});let i=h(l),a=d(i),c=T(i),s=y(i)?.split("|")||[],x=s.includes("comment"),B=s.includes("initial"),k=s.includes("optional"),v=s.includes("version"),w=s.includes("author"),E=c?`\\color{|4||0.45}{${r}}`:r,S=(function(e){let n=[];if(e.heritageClauses){for(let l of e.heritageClauses)if(l.token===t.SyntaxKind.ExtendsKeyword)for(let e of l.types)n.push(e.getText())}return n})(l)?.map(e=>`<n-tag color="#4c81db" css=".tag{gap:0px;}">${j(A(e))}</n-tag>`),F=[c,E,a&&`\\color{#52c11b|1||0.9}{${a}}`,S.length>0&&`<sub>\`extends\`</sub> ${S.join(" ")}`].filter(Boolean).join(" "),z=`## ${F}`,K=l.members.filter(e=>f(e)&&e.type?.kind!==o.NeverKeyword||g(e)),N=[];if(K.length>0){K.forEach(e=>{let t=j(A(g(e)?`(${e.parameters.map(e=>`${e.name.getText()}: ${e.type?.getText()||"any"}`).join(", ")}): ${e.type?.getText()||"any"}`:e.type?.getText()||"any"),!0),n=h(e),l=A(e.name.getText());!l||l.startsWith("\\color")||(g(e)||function(e){if(e.type){if(!m(e.type))return p(e.type);for(let t of e.type.types)if(p(t))return!0}return!1}(e)||t?.includes("=>")?l=`\\color{#f9a913}{${l}}`:/^["'](.+)["']$/.test(l)||(l=`\\color{#4c81db}{${l}}`));let r=e.questionToken&&u(e.questionToken);N.push([l,!k&&`\\color{${r?"#f9a913":"#52c11b"}\\|\\|\\|0.9}{${r?"✘":"✔"}}`,!x&&A(T(n)),t,!B&&A(function(e){if(!e)return;let t=e.match(/@default\s+([^\n]+)/);return t?t[1].trim():void 0}(n)),!v&&A(d(n)),!w&&(b(n)||b(i))])});let e=!1,t=!1,n=!1,l=!1;N.forEach(r=>{!x&&r[2]&&(l=!0),!B&&r[4]&&(n=!0),!v&&r[5]&&(t=!0),!w&&r[6]&&(e=!0)}),z+="\n";let r=["属性",!k&&"必要",l&&"说明","类型",n&&"默认值",t&&"版本",e&&"作者"].filter(Boolean).join("|");z+=`|${r}|`;let o=[":-",!k&&":-",l&&":-",":-",n&&":-",t&&":-",e&&":-"].filter(Boolean);z+="\n";let a=o.join("|");z+=`|${a}|`,N.forEach(r=>{z+="\n";let o=[r[0]||"-",!k&&(r[1]||"-"),l&&(r[2]||"-"),r[3]||"-",n&&(r[4]||"-"),t&&(r[5]||"-"),e&&(r[6]||"-")].filter(Boolean).join("|");z+=`|${o}|`}),z+="\n"}return z+="\n"}(l):t.isEnumDeclaration(l)&&(k+=function(l){let r=l.name.text,o=h(l),i=T(o),a=d(o);Object.assign($,{[l.name.text]:e(l.getSourceFile().fileName).replace(n.alias["@pkg"],"")});let c=i?`\\color{|4||0.45}{${r}}`:r,s=[i,c,a&&`\\color{#52c11b|1||0.9}{${a}}`].filter(Boolean).join(" "),u=y(o)?.split("|")||[],f=u.includes("comment"),p=u.includes("version"),m=u.includes("author"),g=`## ${s}`;if(l.members.length>0){let e=[];l.members.forEach(n=>{let l=A(n.name.getText()),r=h(n),i=A(function(e){let n=e.initializer;if(n&&t.isStringLiteral(n))return` '${n.text}'`}(n)),a=A(d(r)),c=A(T(r));!l||l.startsWith("\\color")||/^["'](.+)["']$/.test(l)||(l=`\\color{#4c81db}{${l}}`),e.push([l,!f&&c,i,!p&&a,!m&&(b(r)||b(o))])});let n=!1,r=!1,i=!1;e.forEach(e=>{!f&&e[1]&&(i=!0),!p&&e[3]&&(r=!0),!m&&e[4]&&(n=!0)}),g+="\n";let a=["属性",i&&"说明","值",r&&"版本",n&&"作者"].filter(Boolean).join("|");g+=`|${a}|`;let c=[":-",i&&":-",":-",r&&":-",n&&":-"].filter(Boolean);g+="\n";let s=c.join("|");g+=`|${s}|`,e.forEach(e=>{g+="\n";let t=[e[0]||"-",i&&(e[1]||"-"),e[2]||"-",r&&(e[3]||"-"),n&&(e[4]||"-")].filter(Boolean).join("|");g+=`|${t}|`})}return g+="\n\n"}(l))}),k}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/core",
|
|
3
|
-
"version": "3.9.17-beta.
|
|
3
|
+
"version": "3.9.17-beta.25",
|
|
4
4
|
"description": "core",
|
|
5
5
|
"main": "lib/index.mjs",
|
|
6
6
|
"type": "module",
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
"@swc/core": "1.3.101",
|
|
19
19
|
"add-asset-html-webpack-plugin": "6.0.0",
|
|
20
20
|
"chokidar": "3.5.3",
|
|
21
|
-
"core-js": "3.
|
|
22
|
-
"core-js-compat": "3.
|
|
21
|
+
"core-js": "3.35.0",
|
|
22
|
+
"core-js-compat": "3.35.0",
|
|
23
23
|
"cross-env": "7.0.3",
|
|
24
24
|
"css-loader": "6.8.1",
|
|
25
25
|
"express": "4.18.2",
|
|
26
26
|
"html-webpack-plugin": "5.6.0",
|
|
27
27
|
"http-proxy-middleware": "2.0.6",
|
|
28
28
|
"less": "4.2.0",
|
|
29
|
-
"less-loader": "11.1.
|
|
29
|
+
"less-loader": "11.1.4",
|
|
30
30
|
"lightningcss": "1.22.1",
|
|
31
31
|
"mini-css-extract-plugin": "2.7.6",
|
|
32
32
|
"mock-json-schema": "1.1.1",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"typescript": "5.3.3",
|
|
38
38
|
"webpack": "5.89.0",
|
|
39
39
|
"webpack-bundle-analyzer": "4.10.1",
|
|
40
|
-
"webpack-dev-middleware": "
|
|
41
|
-
"webpack-hot-middleware": "2.
|
|
40
|
+
"webpack-dev-middleware": "7.0.0",
|
|
41
|
+
"webpack-hot-middleware": "2.26.0",
|
|
42
42
|
"webpack-merge": "5.10.0",
|
|
43
43
|
"webpack-node-externals": "3.0.0",
|
|
44
44
|
"webpack-virtual-modules": "0.6.1",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"@swc/cli": "0.1.63",
|
|
50
50
|
"@types/express": "4.17.21",
|
|
51
51
|
"@types/multer": "1.4.11",
|
|
52
|
-
"
|
|
53
|
-
"sass": "1.69.
|
|
54
|
-
"sass-loader": "13.3.
|
|
52
|
+
"oxlint": "0.0.22",
|
|
53
|
+
"sass": "1.69.6",
|
|
54
|
+
"sass-loader": "13.3.3"
|
|
55
55
|
},
|
|
56
56
|
"files": [
|
|
57
57
|
"lib",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|