@moneko/core 2.0.53-beta.9 → 2.0.54
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/build/common.js +1 -1
- package/build/module.config.js +1 -1
- package/lib/styles/normalize.css +5 -5
- package/lib/styles/variables.css +1 -1
- package/package.json +9 -9
- package/typings/global.d.ts +16 -1
package/build/common.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _export(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}Object.defineProperty(exports,"__esModule",{value:!0}),_export(exports,{ENTRYPATH:function(){return ENTRYPATH},log:function(){return log},CONFIG:function(){return CONFIG},PUBLICPATH:function(){return PUBLICPATH}});var _fs=_interopRequireDefault(require("fs")),_path=_interopRequireDefault(require("path")),_readline=_interopRequireDefault(require("readline")),_chalk=_interopRequireDefault(require("chalk")),_webpackMerge=require("webpack-merge"),_processEnv=require("./process-env"),_utils=require("./utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var ENTRYPATH={mobile:"mobile",site:"site","back-stage":"back-stage","single-spa":"single-spa",library:"library","single-component":"single-component"},includeModule=[_processEnv.pkgName,"neko-ui","antd","@antv","katex","font-pingfang-sc","font-pingfang-tc","react-photo-view","react-markdown-editor-lite","schema-design"],defaultSplitChunk={chunks:"all",minSize:1024,minChunks:1};"single-component"===_processEnv.APPTYPE&&(defaultSplitChunk=!1);var defaultConfig={seo:!1,mode:"csr",compiler:"swc",emotion:{
|
|
1
|
+
"use strict";function _export(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}Object.defineProperty(exports,"__esModule",{value:!0}),_export(exports,{ENTRYPATH:function(){return ENTRYPATH},log:function(){return log},CONFIG:function(){return CONFIG},PUBLICPATH:function(){return PUBLICPATH}});var _fs=_interopRequireDefault(require("fs")),_path=_interopRequireDefault(require("path")),_readline=_interopRequireDefault(require("readline")),_chalk=_interopRequireDefault(require("chalk")),_webpackMerge=require("webpack-merge"),_processEnv=require("./process-env"),_utils=require("./utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var ENTRYPATH={mobile:"mobile",site:"site","back-stage":"back-stage","single-spa":"single-spa",library:"library","single-component":"single-component"},includeModule=[_processEnv.pkgName,"neko-ui","antd","@antv","katex","font-pingfang-sc","font-pingfang-tc","react-photo-view","react-markdown-editor-lite","schema-design"],defaultSplitChunk={chunks:"all",minSize:1024,minChunks:1};"single-component"===_processEnv.APPTYPE&&(defaultSplitChunk=!1);var defaultConfig={seo:!1,mode:"csr",compiler:"swc",emotion:{},bundleAnalyzer:{analyzerMode:"static",reportFilename:"report.html",openAnalyzer:!1},entry:{},minifier:{},sourceMap:{filename:"[file].map",publicPath:""},env:{},routeBaseName:"/",publicPath:"/",designSize:"mobile"===_processEnv.APPTYPE?375:1680,fallbackCompPath:null,modifyVars:{},prefixCls:"n",alias:{},layoutSider:{},moduleRules:[],prefixJsLoader:[],cssModules:[],importOnDemand:{},proxy:[],cacheDirectory:_processEnv.PROGRAMPATH+"/node_modules/.temp_cache",devServer:{allowedHosts:[".baidu.com"],host:"localhost",port:3e3,https:!1,compress:!1},htmlPluginOption:{template:"./node_modules/"+_processEnv.pkgName+"/template/index.html",favicon:"./node_modules/"+_processEnv.pkgName+"/template/favicon.ico",tags:[]},assetHtml:[],routerMode:"browser",fixBrowserRouter:!1,plugins:[],splitChunk:defaultSplitChunk,runtimeChunk:"single-component"!==_processEnv.APPTYPE&&"single",moduleFederation:[],rulesInclude:{less:includeModule,css:includeModule,js:includeModule,media:includeModule,fonts:includeModule}},log=function(e){_readline.default.cursorTo(process.stdout,0),process.stdout.write(e)},customConf=defaultConfig,configPath=null,normalConf={},envConf={};try{configPath=_path.default.join(_processEnv.PROGRAMPATH,"./config/index.ts"),_fs.default.accessSync(configPath,_fs.default.constants.R_OK)}catch(error){configPath=null}if(configPath)try{var conf=eval((0,_utils.tfc)(configPath)).default;normalConf=(0,_utils.isFunction)(conf)?conf(process):conf}catch(error){process.stdout.write(_chalk.default.red(error))}if(_processEnv.CUSTOMCONFIG){var customConfigPath=null;try{customConfigPath=_path.default.join(_processEnv.PROGRAMPATH,"./config/"+_processEnv.CUSTOMCONFIG+".ts"),_fs.default.accessSync(customConfigPath,_fs.default.constants.R_OK)}catch(error){customConfigPath=null}if(null!==customConfigPath)try{var conf=eval((0,_utils.tfc)(customConfigPath)).default;envConf=(0,_utils.isFunction)(conf)?conf(process):conf}catch(error){process.stdout.write(_chalk.default.red(error))}}customConf=(0,_webpackMerge.merge)(customConf,normalConf,envConf),!1===customConf.devtool&&(customConf.sourceMap=!1),!1===customConf.sourceMap&&(customConf.devtool=!1),customConf.fixBrowserRouter&&(customConf.htmlPluginOption.tags||(customConf.htmlPluginOption.tags=[]),customConf.htmlPluginOption.tags.push({textContent:"\n (function(l) {\n if (l.search[1] === '/' ) {\n var decoded = l.search.slice(1).split('&').map(function(s) { \n return s.replace(/~and~/g, '&')\n }).join('?');\n window.history.replaceState(null, null,\n l.pathname.slice(0, -1) + decoded + l.hash\n );\n }\n }(window.location))\n "}));var CONFIG=customConf,PUBLICPATH=CONFIG.publicPath||"/";global.NEKOCLICONFIG={CONFIG:CONFIG,log:log};
|
package/build/module.config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return F}});var e,s,r,t,o,l,a,n,i,u,c=b(require("mini-css-extract-plugin")),d=b(require("mini-svg-data-uri")),p=require("./common"),m=require("./has-pkg"),f=b(require("./modifyVars")),y=require("./process-env"),v=b(require("./swcrc")),g=b(require("./tsloader.config")),h=require("./utils");function x(e,s){(null==s||s>e.length)&&(s=e.length);for(var r=0,t=Array(s);r<s;r++)t[r]=e[r];return t}function b(e){return e&&e.__esModule?e:{default:e}}function I(e){return function(e){if(Array.isArray(e))return x(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,s){if(e){if("string"==typeof e)return x(e,s);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return x(e,s)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var N="single-spa"===y.APPTYPE?p.PUBLICPATH:"../",P={loader:c.default.loader,options:{publicPath:"/"!==N?N:"../"}},O=(0,m.hasPkg)("@moneko/postcss")&&{loader:"postcss-loader",options:{postcssOptions:require("@moneko/postcss")}};y.DEV&&(P="style-loader");var $=I(p.CONFIG.cssModules).concat([y.pkgName,"neko-ui"]).map(h.resolveNodeModulesPath),q=[(0,h.resolveNodeModulesPath)(""+y.pkgName+"/lib/styles/eval/*.less")].concat(I(["src/styles/variables/*.less","src/styles/mixins/*.less","site/styles/variables/*.less","site/styles/mixins/*.less"].map(h.resolveProgramPath))),C=["components","example","mock","site","src"].map(h.resolveProgramPath),j=[P,{loader:"css-loader",options:{modules:{auto:function(e){for(var s=0,r=$.length;s<r;s++)if(e&&(null==e?void 0:e.includes($[s])))return RegExp("(.*(?<!\\.global\\.(le|c)ss)$)","i").test(e);return RegExp("(^(?!.*node_modules))(.*(?<!\\.global\\.(le|c)ss)$)","i").test(e)},localIdentName:"[path][name]__[local]",exportLocalsConvention:"dashesOnly"},importLoaders:2}},O,"css-unicode-loader",{loader:"less-loader",options:{sourceMap:!!p.CONFIG.sourceMap,lessOptions:{modifyVars:f.default,javascriptEnabled:!0}}},{loader:"style-resources-loader",options:{patterns:q}}].filter(Boolean),M={loader:"tsc"===p.CONFIG.compiler?"ts-loader":"swc-loader",options:"tsc"===p.CONFIG.compiler?g.default:(0,v.default)(y.DEV)},F={rules:[{oneOf:[{resourceQuery:/raw/,type:"asset/source"},{resourceQuery:/\.wasm$/,type:"webassembly/async"},{test:/\.less$/,use:j,include:C.concat((null==(e=p.CONFIG.rulesInclude)?void 0:null==(s=e.less)?void 0:s.map(h.resolveNodeModulesPath))||[])},{test:/\.css$/,use:[P,"css-loader",O,"css-unicode-loader"].filter(Boolean),include:C.concat((null==(r=p.CONFIG.rulesInclude)?void 0:null==(t=r.css)?void 0:t.map(h.resolveNodeModulesPath))||[])},{test:/\.(gif|png|jpe?g|ico|mp4)$/i,type:"asset",generator:{filename:"assets/images/[name][ext][query]"},include:C.concat((null==(o=p.CONFIG.rulesInclude)?void 0:null==(l=o.media)?void 0:l.map(h.resolveNodeModulesPath))||[])},{test:/\.(eot|ttf|otf|woff(|2))$/,type:"asset",generator:{filename:"assets/fonts/[name][ext][query]"},include:C.concat((null==(a=p.CONFIG.rulesInclude)?void 0:null==(n=a.fonts)?void 0:n.map(h.resolveNodeModulesPath))||[])},{test:/\.svg$/,type:"asset/inline",generator:{dataUrl:function(e){return(0,d.default)("string"!=typeof e?e.toString():e)}}},{test:/\.txt$/,type:"asset/source"},{test:/\.(cj|mj|t|j)s(|x)$/,use:I(p.CONFIG.prefixJsLoader).concat([M]).filter(Boolean),include:C.concat((null==(i=p.CONFIG.rulesInclude)?void 0:null==(u=i.js)?void 0:u.map(h.resolveNodeModulesPath))||[])},{test:/\.mdx?$/,use:I(p.CONFIG.prefixJsLoader).concat([M,{loader:"@mdx-js/loader",options:{rehypePlugins:[[require("@mapbox/rehype-prism"),{ignore:!0}],require("rehype-accessible-emojis").rehypeAccessibleEmojis,require("rehype-figure")],remarkPlugins:[]}}]).filter(Boolean),include:C,exclude:[/(.+)\/examples\/(.+).mdx?$/i]},{test:/\.mdx?$/,type:"asset/source",include:[/(.+)\/examples\/(.+).mdx?$/i]},{type:"asset/source",include:[/(.+)\/examples\/(.+).*?$/i]}]}].concat(I(p.CONFIG.moduleRules))};
|
package/lib/styles/normalize.css
CHANGED
|
@@ -26,7 +26,7 @@ body {
|
|
|
26
26
|
|
|
27
27
|
input,
|
|
28
28
|
textarea {
|
|
29
|
-
caret-color: var(--primary-
|
|
29
|
+
caret-color: var(--primary-bg);;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
h1 {
|
|
@@ -138,7 +138,7 @@ button:-moz-focusring,
|
|
|
138
138
|
[type='button']:-moz-focusring,
|
|
139
139
|
[type='reset']:-moz-focusring,
|
|
140
140
|
[type='submit']:-moz-focusring {
|
|
141
|
-
outline: 1px dotted var(--primary-
|
|
141
|
+
outline: 1px dotted var(--primary-outline);
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
fieldset {
|
|
@@ -215,15 +215,15 @@ template {
|
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
:hover::-webkit-scrollbar-thumb {
|
|
218
|
-
background-color: var(--primary-
|
|
218
|
+
background-color: var(--primary-bg);
|
|
219
219
|
}
|
|
220
220
|
|
|
221
221
|
::-webkit-scrollbar-thumb:hover {
|
|
222
|
-
background-color: var(--primary-
|
|
222
|
+
background-color: var(--primary-hover);
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
::-webkit-scrollbar-thumb:active {
|
|
226
|
-
background-color: var(--primary-
|
|
226
|
+
background-color: var(--primary-active);
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
::-webkit-scrollbar-button {
|
package/lib/styles/variables.css
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
--text-color: rgb(0 0 0 / 65%);
|
|
13
13
|
--text-secondary: #4e4e4e;
|
|
14
14
|
--text-heading: #1b1b1b;
|
|
15
|
-
--text-selection-bg: var(--primary-
|
|
15
|
+
--text-selection-bg: var(--primary-bg);
|
|
16
16
|
--text-shadow-color: rgb(0 0 0 / 10%);
|
|
17
17
|
--box-shadow-base: 0 3px 6px -4px rgb(0 0 0 / 12%), 0 6px 16px 0 rgb(0 0 0 / 8%),
|
|
18
18
|
0 9px 28px 8px rgb(0 0 0 / 5%);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.54",
|
|
4
4
|
"description": "core",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -18,21 +18,21 @@
|
|
|
18
18
|
"@emotion/css": "11.10.6",
|
|
19
19
|
"@mapbox/rehype-prism": "0.8.0",
|
|
20
20
|
"@mdx-js/loader": "2.3.0",
|
|
21
|
-
"@moneko/common": "1.0.
|
|
21
|
+
"@moneko/common": "1.0.33",
|
|
22
22
|
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
|
|
23
23
|
"@soda/friendly-errors-webpack-plugin": "1.8.1",
|
|
24
24
|
"@swc/core": "1.3.37",
|
|
25
25
|
"@swc/css": "0.0.20",
|
|
26
|
-
"@swc/helpers": "0.
|
|
26
|
+
"@swc/helpers": "0.5.0",
|
|
27
27
|
"@swc/plugin-emotion": "2.5.46",
|
|
28
28
|
"add-asset-html-webpack-plugin": "5.0.2",
|
|
29
|
-
"core-js": "3.30.
|
|
29
|
+
"core-js": "3.30.1",
|
|
30
30
|
"cross-env": "7.0.3",
|
|
31
31
|
"css-loader": "6.7.3",
|
|
32
32
|
"css-minimizer-webpack-plugin": "5.0.0",
|
|
33
33
|
"css-unicode-loader": "1.0.3",
|
|
34
34
|
"external-remotes-plugin": "1.0.0",
|
|
35
|
-
"html-webpack-plugin": "5.5.
|
|
35
|
+
"html-webpack-plugin": "5.5.1",
|
|
36
36
|
"less": "4.1.3",
|
|
37
37
|
"less-loader": "11.1.0",
|
|
38
38
|
"mini-css-extract-plugin": "2.7.5",
|
|
@@ -46,18 +46,18 @@
|
|
|
46
46
|
"react-router-dom": "6.10.0",
|
|
47
47
|
"rehype-accessible-emojis": "0.3.2",
|
|
48
48
|
"rehype-figure": "1.0.1",
|
|
49
|
-
"shared-store-object": "1.0.
|
|
49
|
+
"shared-store-object": "1.0.5",
|
|
50
50
|
"style-loader": "3.3.2",
|
|
51
51
|
"style-resources-loader": "1.5.0",
|
|
52
52
|
"swc-loader": "0.2.3",
|
|
53
53
|
"swc-plugin-another-transform-imports": "0.2.1",
|
|
54
|
-
"ts-import-plugin": "
|
|
54
|
+
"ts-import-plugin": "3.0.0",
|
|
55
55
|
"ts-loader": "9.4.2",
|
|
56
56
|
"typescript": "5.0.4",
|
|
57
|
-
"webpack": "5.
|
|
57
|
+
"webpack": "5.76.1",
|
|
58
58
|
"webpack-bundle-analyzer": "4.8.0",
|
|
59
59
|
"webpack-cli": "5.0.1",
|
|
60
|
-
"webpack-dev-server": "4.13.
|
|
60
|
+
"webpack-dev-server": "4.13.3",
|
|
61
61
|
"webpack-merge": "5.8.0",
|
|
62
62
|
"webpackbar": "5.0.2",
|
|
63
63
|
"xml2js": "0.5.0"
|
package/typings/global.d.ts
CHANGED
|
@@ -55,11 +55,16 @@ export declare type ConfigType<T = 'tsc'> = {
|
|
|
55
55
|
* @default true
|
|
56
56
|
*/
|
|
57
57
|
sourceMap?: boolean;
|
|
58
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* @description
|
|
60
|
+
* 自动将标签属性添加到样式中,以便由css或样式生成的类名包括结果分配到的变量的名称。
|
|
59
61
|
* @default 'dev-only'
|
|
60
62
|
*/
|
|
61
63
|
autoLabel?: 'never' | 'dev-only' | 'always';
|
|
62
64
|
/** 定义类名的格式
|
|
65
|
+
* @alias [local]: 样式表达式的结果被分配到的变量的名称。
|
|
66
|
+
* @alias [filename]: 样式表达式所在的文件名称(无扩展名)。
|
|
67
|
+
* @alias [dirname]: 包含样式表达式所在文件的目录的名称。
|
|
63
68
|
* @default '[local]'
|
|
64
69
|
* @description
|
|
65
70
|
* 此选项仅在autoLabel设置为 `dev-only` 或 `always` 时有效。
|
|
@@ -68,6 +73,16 @@ export declare type ConfigType<T = 'tsc'> = {
|
|
|
68
73
|
* 例如labelFormat:"my-classname--[local]",其中[local]将替换为结果分配给的变量的名称。
|
|
69
74
|
*/
|
|
70
75
|
labelFormat?: string;
|
|
76
|
+
/**
|
|
77
|
+
* @description
|
|
78
|
+
* 此选项假设您正在使用某些东西使 `@emotion/react` 的 jsx 函数适用于所有 jsx。如果您不这样做,并且不希望发生此类优化,请禁用此选项。
|
|
79
|
+
* @default true
|
|
80
|
+
*/
|
|
81
|
+
cssPropOptimization?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* @default true
|
|
84
|
+
*/
|
|
85
|
+
importMap?: boolean;
|
|
71
86
|
};
|
|
72
87
|
/** swc 配置项,仅当编译器为 swc 时有效 */
|
|
73
88
|
swcrc?: SwcConfig | ((isDev: boolean) => SwcConfig);
|