@moneko/core 2.0.60-beta.9 → 2.0.61-bate.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/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=_interop_require_default(require("fs")),_path=_interop_require_default(require("path")),_readline=_interop_require_default(require("readline")),_chalk=_interop_require_default(require("chalk")),_webpackmerge=require("webpack-merge"),_processenv=require("./process-env"),_utils=require("./utils");function _interop_require_default(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};
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=_interop_require_default(require("fs")),_path=_interop_require_default(require("path")),_readline=_interop_require_default(require("readline")),_chalk=_interop_require_default(require("chalk")),_webpackmerge=require("webpack-merge"),_processenv=require("./process-env"),_utils=require("./utils");function _interop_require_default(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",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/swcrc.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),function(e,r){for(var o in r)Object.defineProperty(e,o,{enumerable:!0,get:r[o]})}(exports,{swcMinifyOption:function(){return n},default:function(){return s}});var e=require("webpack-merge"),r=require("./common"),o=function(e){return e&&e.__esModule?e:{default:e}}(require("./envFlags")),t={env:{targets:["last 2 version","> 0.5%","ie 11","not dead"],mode:"entry",coreJs:"3"}},n={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},s=function(n){void 0===n&&(n=!1);var s=Object.assign({module:{type:"es6",ignoreDynamic:!0,strict:!0,strictMode:!0,lazy:!0,noInterop:!0},jsc:{parser:{syntax:"typescript",decorators:!0,dynamicImport:!0,tsx:!0},loose:!0,target:"es2022",externalHelpers:!0,transform:{legacyDecorator:!0,decoratorMetadata:!0,react:{runtime:"automatic",throwIfNamespace:!0,useBuiltins:!0,refresh:n,development:n},constModules:{globals:{"env-flags":o.default}},optimizer:{simplify:!1}},experimental:{plugins:[["swc-plugin-another-transform-imports",function(e){for(var r=0,o=Object.keys(e),t=o.length;r<t;r++)e[o[r]].transform=o[r]+"/"+e[o[r]].transform,e[o[r]].style&&(e[o[r]].style=o[r]+"/"+e[o[r]].style);return e}(r.CONFIG.importOnDemand||{})],["@swc/plugin-emotion",r.CONFIG.emotion]]}},sourceMaps:!0},!n&&t);return r.CONFIG.swcrc&&(s=(0,e.merge)(s,"function"==typeof r.CONFIG.swcrc?r.CONFIG.swcrc(n):r.CONFIG.swcrc)),s};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),function(e,r){for(var t in r)Object.defineProperty(e,t,{enumerable:!0,get:r[t]})}(exports,{swcMinifyOption:function(){return n},default:function(){return s}});var e=require("webpack-merge"),r=require("./common"),t=function(e){return e&&e.__esModule?e:{default:e}}(require("./envFlags")),o={env:{targets:["last 2 version","> 0.5%","ie 11","not dead"],mode:"entry",coreJs:"3"}},n={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},s=function(n){void 0===n&&(n=!1);var s=Object.assign({module:{type:"es6",ignoreDynamic:!0,strict:!0,strictMode:!0,lazy:!0,noInterop:!0},jsc:{parser:{syntax:"typescript",decorators:!0,dynamicImport:!0,tsx:!0},loose:!0,target:"es2022",externalHelpers:!0,transform:{legacyDecorator:!0,decoratorMetadata:!0,react:{runtime:"automatic",throwIfNamespace:!0,useBuiltins:!0,refresh:n,development:n},constModules:{globals:{"env-flags":t.default}},optimizer:{simplify:!1}},experimental:{plugins:[["swc-plugin-another-transform-imports",function(e){for(var r=0,t=Object.keys(e),o=t.length;r<o;r++)e[t[r]].transform=t[r]+"/"+e[t[r]].transform,e[t[r]].style&&(e[t[r]].style=t[r]+"/"+e[t[r]].style);return e}(r.CONFIG.importOnDemand||{})]]}},sourceMaps:!0},!n&&o);return r.CONFIG.swcrc&&(s=(0,e.merge)(s,"function"==typeof r.CONFIG.swcrc?r.CONFIG.swcrc(n):r.CONFIG.swcrc)),s};
@@ -1 +1 @@
1
- import{persistence as t}from"@moneko/common";import n from"shared-store-object";import e from"./persistentKey";var a,o={keys:function(){return[]}};try{o=hasLocales?require.context("@/locales/",!0,/\.(t|j)s$/):{keys:function(){return[]}}}catch(t){console.warn(t)}var r={},l=[];null==o.keys||null==(a=o.keys())||a.map(function(t,n){var e=o(t).default;if(e&&"[object Object]"===Object.prototype.toString.call(e)){var a=e.language,i=void 0===a?t.replace(/(.*\/)*([^.]+).*/gi,"$2"):a,c=e.title,u=void 0===c?i:c,s=e.icon,g=e.translation;0===n&&l.splice(0),l.push({language:i,title:u,icon:s}),r[i]={language:i,title:u,icon:s,translation:new Proxy(void 0===g?{}:g,{get:function(t,n){return t[n]||n}})}}e=null});var i=t.load(e.language,"zh_CN"),c=Object.assign({title:"简体中文",language:"zh_CN",translation:{}},r[i]||r.zh_CN),u=n({language:i,t:c.translation,locales:l});export function setLanguage(t){var n;u.language=t,u.t=(null==(n=r[t])?void 0:n.translation)||c.translation}export function interpolateString(t,n){return t.replace(/\${\w+}/g,function(t){var e=n[t.slice(2,-1)];return void 0!==e?e.toString():""})}export default u;
1
+ import{persistence as t}from"@moneko/common";import n from"shared-store-object";import e from"./persistentKey";var a,o={keys:function(){return[]}};try{o=hasLocales?require.context("@/locales/",!0,/\.(t|j)s$/):{keys:function(){return[]}}}catch(t){console.warn(t)}var r={},i=[];null==o.keys||null==(a=o.keys())||a.map(function(t,n){var e=o(t).default;if(e&&"[object Object]"===Object.prototype.toString.call(e)){var a=e.language,l=void 0===a?t.replace(/(.*\/)*([^.]+).*/gi,"$2"):a,c=e.title,u=void 0===c?l:c,s=e.icon,g=e.translation;0===n&&i.splice(0),i.push({language:l,title:u,icon:s}),r[l]={language:l,title:u,icon:s,translation:new Proxy(void 0===g?{}:g,{get:function(t,n){return t[n]||n}})}}});var l=t.load(e.language,"zh_CN"),c=Object.assign({title:"简体中文",language:"zh_CN",translation:{}},r[l]||r.zh_CN),u=n({language:l,t:c.translation,locales:i});export function setLanguage(t){var n;u.language=t,u.t=(null==(n=r[t])?void 0:n.translation)||c.translation}export function interpolateString(t,n){return t.replace(/\${\w+}/g,function(t){var e=n[t.slice(2,-1)];return void 0!==e?e.toString():""})}export default u;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "2.0.60-beta.9",
3
+ "version": "2.0.61-bate.1",
4
4
  "description": "core",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -15,18 +15,17 @@
15
15
  "author": "moneko",
16
16
  "license": "MIT",
17
17
  "dependencies": {
18
- "@emotion/css": "11.10.8",
18
+ "@emotion/css": "11.11.0",
19
19
  "@mapbox/rehype-prism": "0.8.0",
20
20
  "@mdx-js/loader": "2.3.0",
21
21
  "@moneko/common": "1.1.0",
22
22
  "@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
23
23
  "@soda/friendly-errors-webpack-plugin": "1.8.1",
24
- "@swc/core": "1.3.51",
24
+ "@swc/core": "1.3.57",
25
25
  "@swc/css": "0.0.20",
26
26
  "@swc/helpers": "0.5.1",
27
- "@swc/plugin-emotion": "2.5.61",
28
- "add-asset-html-webpack-plugin": "5.0.2",
29
- "core-js": "3.30.1",
27
+ "add-asset-html-webpack-plugin": "6.0.0",
28
+ "core-js": "3.30.2",
30
29
  "cross-env": "7.0.3",
31
30
  "css-loader": "6.7.3",
32
31
  "css-minimizer-webpack-plugin": "5.0.0",
@@ -42,8 +41,8 @@
42
41
  "react-activation": "0.12.4",
43
42
  "react-refresh": "0.14.0",
44
43
  "react-refresh-typescript": "2.0.9",
45
- "react-router": "6.11.0",
46
- "react-router-dom": "6.11.0",
44
+ "react-router": "6.11.1",
45
+ "react-router-dom": "6.11.1",
47
46
  "rehype-accessible-emojis": "0.3.2",
48
47
  "rehype-figure": "1.0.1",
49
48
  "shared-store-object": "1.0.7",
@@ -56,7 +55,7 @@
56
55
  "typescript": "5.0.4",
57
56
  "webpack": "5.76.1",
58
57
  "webpack-bundle-analyzer": "4.8.0",
59
- "webpack-cli": "5.0.1",
58
+ "webpack-cli": "5.0.2",
60
59
  "webpack-dev-server": "4.11.1",
61
60
  "webpack-merge": "5.8.0",
62
61
  "webpackbar": "5.0.2",
@@ -71,7 +70,7 @@
71
70
  "@types/shelljs": "^0.8.12",
72
71
  "@types/webpack-bundle-analyzer": "^4.6.0",
73
72
  "@types/webpack-env": "^1.18.0",
74
- "antd": "5.4.2",
73
+ "antd": "5.4.6",
75
74
  "eslint-config-neko": "^1.0.22",
76
75
  "react": "^18.2.0",
77
76
  "shelljs": "^0.8.5",
@@ -50,40 +50,6 @@ export declare type ConfigType<T = 'tsc'> = {
50
50
  * @default 'swc'
51
51
  */
52
52
  compiler: 'tsc' | 'swc';
53
- emotion: {
54
- /** sourceMap: 默认开启, 当构建为生产时将禁用
55
- * @default true
56
- */
57
- sourceMap?: boolean;
58
- /**
59
- * @description
60
- * 自动将标签属性添加到样式中,以便由css或样式生成的类名包括结果分配到的变量的名称。
61
- * @default 'dev-only'
62
- */
63
- autoLabel?: 'never' | 'dev-only' | 'always';
64
- /** 定义类名的格式
65
- * @alias [local]: 样式表达式的结果被分配到的变量的名称。
66
- * @alias [filename]: 样式表达式所在的文件名称(无扩展名)。
67
- * @alias [dirname]: 包含样式表达式所在文件的目录的名称。
68
- * @default '[local]'
69
- * @description
70
- * 此选项仅在autoLabel设置为 `dev-only` 或 `always` 时有效。
71
- * 它允许您定义结果标签的格式。
72
- * 格式通过字符串定义,其中变量部分用方括号括起来[]。
73
- * 例如labelFormat:"my-classname--[local]",其中[local]将替换为结果分配给的变量的名称。
74
- */
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;
86
- };
87
53
  /** swc 配置项,仅当编译器为 swc 时有效 */
88
54
  swcrc?: SwcConfig | ((isDev: boolean) => SwcConfig);
89
55
  /**