@moneko/core 2.0.0-beta.44 → 2.0.0-beta.46

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return _default}});var _miniCssExtractPlugin=_interopRequireDefault(require("mini-css-extract-plugin"));var _miniSvgDataUri=_interopRequireDefault(require("mini-svg-data-uri"));var _common=require("./common");var _modifyVars=_interopRequireDefault(require("./modifyVars"));var _swcrc=_interopRequireDefault(require("./swcrc"));var _utils=require("./utils");var _hasPkg=require("./has-pkg");var _processEnv=require("./process-env");var _tsloaderConfig=_interopRequireDefault(require("./tsloader.config"));function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}var _CONFIG_rulesInclude,_CONFIG_rulesInclude_less,_CONFIG_rulesInclude1,_CONFIG_rulesInclude_css,_CONFIG_rulesInclude2,_CONFIG_rulesInclude_media,_CONFIG_rulesInclude3,_CONFIG_rulesInclude_fonts,_CONFIG_rulesInclude4,_CONFIG_rulesInclude_js;var cssAssetsPublicPath=_processEnv.APPTYPE==="single-spa"?_common.PUBLICPATH:"../";var styleLoader={loader:_miniCssExtractPlugin.default.loader,options:{publicPath:cssAssetsPublicPath!=="/"?cssAssetsPublicPath:"../"}};var postcssLoader=(0,_hasPkg.hasPkg)("@moneko/postcss")&&{loader:"postcss-loader",options:{postcssOptions:require("@moneko/postcss")}};if(_processEnv.DEV){styleLoader="style-loader"}var customCssModules=_toConsumableArray(_common.CONFIG.cssModules).concat([_processEnv.pkgName,"neko-ui"]).map(_utils.resolveNodeModulesPath);var styleResources=[(0,_utils.resolveNodeModulesPath)("".concat(_processEnv.pkgName,"/lib/styles/eval/*.less"))].concat(_toConsumableArray(["src/styles/variables/*.less","src/styles/mixins/*.less","site/styles/variables/*.less","site/styles/mixins/*.less"].map(_utils.resolveProgramPath)));var entryResolveProgramPath=["components","example","mock","site","src"].map(_utils.resolveProgramPath);var lessLoaderRule=[styleLoader,{loader:"css-loader",options:{modules:{auto:function(resourcePath){for(var i=0,len=customCssModules.length;i<len;i++){if(resourcePath&&(resourcePath===null||resourcePath===void 0?void 0:resourcePath.includes(customCssModules[i]))){return RegExp("(.*(?<!\\.global\\.(le|c)ss)$)","i").test(resourcePath)}}return RegExp("(^(?!.*node_modules))(.*(?<!\\.global\\.(le|c)ss)$)","i").test(resourcePath)},localIdentName:"[path][name]__[local]",exportLocalsConvention:"dashesOnly"},importLoaders:2}},postcssLoader,"css-unicode-loader",{loader:"less-loader",options:{sourceMap:!!_common.CONFIG.sourceMap,lessOptions:{modifyVars:_modifyVars.default,javascriptEnabled:true}}},{loader:"style-resources-loader",options:{patterns:styleResources}}].filter(Boolean);var tsLoader={loader:_common.CONFIG.compiler==="tsc"?"ts-loader":"swc-loader",options:_common.CONFIG.compiler==="tsc"?_tsloaderConfig.default:(0,_swcrc.default)(_processEnv.DEV)};var moduleOptions={rules:[{oneOf:[{resourceQuery:/raw/,type:"asset/source"},{resourceQuery:/\.wasm$/,type:"webassembly/async"},{test:/\.less$/,use:lessLoaderRule,include:entryResolveProgramPath.concat(((_CONFIG_rulesInclude=_common.CONFIG.rulesInclude)===null||_CONFIG_rulesInclude===void 0?void 0:(_CONFIG_rulesInclude_less=_CONFIG_rulesInclude.less)===null||_CONFIG_rulesInclude_less===void 0?void 0:_CONFIG_rulesInclude_less.map(_utils.resolveNodeModulesPath))||[])},{test:/\.css$/,use:[styleLoader,"css-loader",postcssLoader,"css-unicode-loader"].filter(Boolean),include:entryResolveProgramPath.concat(((_CONFIG_rulesInclude1=_common.CONFIG.rulesInclude)===null||_CONFIG_rulesInclude1===void 0?void 0:(_CONFIG_rulesInclude_css=_CONFIG_rulesInclude1.css)===null||_CONFIG_rulesInclude_css===void 0?void 0:_CONFIG_rulesInclude_css.map(_utils.resolveNodeModulesPath))||[])},{test:/\.(gif|png|jpe?g|ico|mp4)$/i,type:"asset",generator:{filename:"assets/images/[name][ext][query]"},include:entryResolveProgramPath.concat(((_CONFIG_rulesInclude2=_common.CONFIG.rulesInclude)===null||_CONFIG_rulesInclude2===void 0?void 0:(_CONFIG_rulesInclude_media=_CONFIG_rulesInclude2.media)===null||_CONFIG_rulesInclude_media===void 0?void 0:_CONFIG_rulesInclude_media.map(_utils.resolveNodeModulesPath))||[])},{test:/\.(eot|ttf|otf|woff(|2))$/,type:"asset",generator:{filename:"assets/fonts/[name][ext][query]"},include:entryResolveProgramPath.concat(((_CONFIG_rulesInclude3=_common.CONFIG.rulesInclude)===null||_CONFIG_rulesInclude3===void 0?void 0:(_CONFIG_rulesInclude_fonts=_CONFIG_rulesInclude3.fonts)===null||_CONFIG_rulesInclude_fonts===void 0?void 0:_CONFIG_rulesInclude_fonts.map(_utils.resolveNodeModulesPath))||[])},{test:/\.svg$/,type:"asset/inline",generator:{dataUrl:function(content){return(0,_miniSvgDataUri.default)(typeof content!=="string"?content.toString():content)}}},{test:/\.txt$/,type:"asset/source"},{test:/\.(cj|mj|t|j)s(|x)$/,use:_toConsumableArray(_common.CONFIG.prefixJsLoader).concat([tsLoader]).filter(Boolean),include:entryResolveProgramPath.concat(((_CONFIG_rulesInclude4=_common.CONFIG.rulesInclude)===null||_CONFIG_rulesInclude4===void 0?void 0:(_CONFIG_rulesInclude_js=_CONFIG_rulesInclude4.js)===null||_CONFIG_rulesInclude_js===void 0?void 0:_CONFIG_rulesInclude_js.map(_utils.resolveNodeModulesPath))||[])},{test:/\.mdx?$/,use:_toConsumableArray(_common.CONFIG.prefixJsLoader).concat([tsLoader,{loader:"@mdx-js/loader",options:{rehypePlugins:[require("@mapbox/rehype-prism"),require("rehype-accessible-emojis").rehypeAccessibleEmojis,require("rehype-figure")],remarkPlugins:[]}}]).filter(Boolean),include:entryResolveProgramPath}]}].concat(_toConsumableArray(_common.CONFIG.moduleRules))};var _default=moduleOptions;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return _default}});var _miniCssExtractPlugin=_interopRequireDefault(require("mini-css-extract-plugin"));var _miniSvgDataUri=_interopRequireDefault(require("mini-svg-data-uri"));var _common=require("./common");var _modifyVars=_interopRequireDefault(require("./modifyVars"));var _swcrc=_interopRequireDefault(require("./swcrc"));var _utils=require("./utils");var _hasPkg=require("./has-pkg");var _processEnv=require("./process-env");var _tsloaderConfig=_interopRequireDefault(require("./tsloader.config"));function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}var _CONFIG_rulesInclude,_CONFIG_rulesInclude_less,_CONFIG_rulesInclude1,_CONFIG_rulesInclude_css,_CONFIG_rulesInclude2,_CONFIG_rulesInclude_media,_CONFIG_rulesInclude3,_CONFIG_rulesInclude_fonts,_CONFIG_rulesInclude4,_CONFIG_rulesInclude_js;var cssAssetsPublicPath=_processEnv.APPTYPE==="single-spa"?_common.PUBLICPATH:"../";var styleLoader={loader:_miniCssExtractPlugin.default.loader,options:{publicPath:cssAssetsPublicPath!=="/"?cssAssetsPublicPath:"../"}};var postcssLoader=(0,_hasPkg.hasPkg)("@moneko/postcss")&&{loader:"postcss-loader",options:{postcssOptions:require("@moneko/postcss")}};if(_processEnv.DEV){styleLoader="style-loader"}var customCssModules=_toConsumableArray(_common.CONFIG.cssModules).concat([_processEnv.pkgName,"neko-ui"]).map(_utils.resolveNodeModulesPath);var styleResources=[(0,_utils.resolveNodeModulesPath)("".concat(_processEnv.pkgName,"/lib/styles/eval/*.less"))].concat(_toConsumableArray(["src/styles/variables/*.less","src/styles/mixins/*.less","site/styles/variables/*.less","site/styles/mixins/*.less"].map(_utils.resolveProgramPath)));var entryResolveProgramPath=["components","example","mock","site","src"].map(_utils.resolveProgramPath);var lessLoaderRule=[styleLoader,{loader:"css-loader",options:{modules:{auto:function(resourcePath){for(var i=0,len=customCssModules.length;i<len;i++){if(resourcePath&&(resourcePath===null||resourcePath===void 0?void 0:resourcePath.includes(customCssModules[i]))){return RegExp("(.*(?<!\\.global\\.(le|c)ss)$)","i").test(resourcePath)}}return RegExp("(^(?!.*node_modules))(.*(?<!\\.global\\.(le|c)ss)$)","i").test(resourcePath)},localIdentName:"[path][name]__[local]",exportLocalsConvention:"dashesOnly"},importLoaders:2}},postcssLoader,"css-unicode-loader",{loader:"less-loader",options:{sourceMap:!!_common.CONFIG.sourceMap,lessOptions:{modifyVars:_modifyVars.default,javascriptEnabled:true}}},{loader:"style-resources-loader",options:{patterns:styleResources}}].filter(Boolean);var tsLoader={loader:_common.CONFIG.compiler==="tsc"?"ts-loader":"swc-loader",options:_common.CONFIG.compiler==="tsc"?_tsloaderConfig.default:(0,_swcrc.default)(_processEnv.DEV)};var moduleOptions={rules:[{oneOf:[{resourceQuery:/raw/,type:"asset/source"},{resourceQuery:/\.wasm$/,type:"webassembly/async"},{test:/\.less$/,use:lessLoaderRule,include:entryResolveProgramPath.concat(((_CONFIG_rulesInclude=_common.CONFIG.rulesInclude)===null||_CONFIG_rulesInclude===void 0?void 0:(_CONFIG_rulesInclude_less=_CONFIG_rulesInclude.less)===null||_CONFIG_rulesInclude_less===void 0?void 0:_CONFIG_rulesInclude_less.map(_utils.resolveNodeModulesPath))||[])},{test:/\.css$/,use:[styleLoader,"css-loader",postcssLoader,"css-unicode-loader"].filter(Boolean),include:entryResolveProgramPath.concat(((_CONFIG_rulesInclude1=_common.CONFIG.rulesInclude)===null||_CONFIG_rulesInclude1===void 0?void 0:(_CONFIG_rulesInclude_css=_CONFIG_rulesInclude1.css)===null||_CONFIG_rulesInclude_css===void 0?void 0:_CONFIG_rulesInclude_css.map(_utils.resolveNodeModulesPath))||[])},{test:/\.(gif|png|jpe?g|ico|mp4)$/i,type:"asset",generator:{filename:"assets/images/[name][ext][query]"},include:entryResolveProgramPath.concat(((_CONFIG_rulesInclude2=_common.CONFIG.rulesInclude)===null||_CONFIG_rulesInclude2===void 0?void 0:(_CONFIG_rulesInclude_media=_CONFIG_rulesInclude2.media)===null||_CONFIG_rulesInclude_media===void 0?void 0:_CONFIG_rulesInclude_media.map(_utils.resolveNodeModulesPath))||[])},{test:/\.(eot|ttf|otf|woff(|2))$/,type:"asset",generator:{filename:"assets/fonts/[name][ext][query]"},include:entryResolveProgramPath.concat(((_CONFIG_rulesInclude3=_common.CONFIG.rulesInclude)===null||_CONFIG_rulesInclude3===void 0?void 0:(_CONFIG_rulesInclude_fonts=_CONFIG_rulesInclude3.fonts)===null||_CONFIG_rulesInclude_fonts===void 0?void 0:_CONFIG_rulesInclude_fonts.map(_utils.resolveNodeModulesPath))||[])},{test:/\.svg$/,type:"asset/inline",generator:{dataUrl:function(content){return(0,_miniSvgDataUri.default)(typeof content!=="string"?content.toString():content)}}},{test:/\.txt$/,type:"asset/source"},{test:/\.(cj|mj|t|j)s(|x)$/,use:_toConsumableArray(_common.CONFIG.prefixJsLoader).concat([tsLoader]).filter(Boolean),include:entryResolveProgramPath.concat(((_CONFIG_rulesInclude4=_common.CONFIG.rulesInclude)===null||_CONFIG_rulesInclude4===void 0?void 0:(_CONFIG_rulesInclude_js=_CONFIG_rulesInclude4.js)===null||_CONFIG_rulesInclude_js===void 0?void 0:_CONFIG_rulesInclude_js.map(_utils.resolveNodeModulesPath))||[])},{test:/\.mdx?$/,use:_toConsumableArray(_common.CONFIG.prefixJsLoader).concat([tsLoader,{loader:"@mdx-js/loader",options:{rehypePlugins:[[require("@mapbox/rehype-prism"),{ignore:true}],require("rehype-accessible-emojis").rehypeAccessibleEmojis,require("rehype-figure")],remarkPlugins:[]}}]).filter(Boolean),include:entryResolveProgramPath}]}].concat(_toConsumableArray(_common.CONFIG.moduleRules))};var _default=moduleOptions;
package/lib/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export * from './prefix/react-router-dom.js';
3
3
  export * from './prefix/i18n-hooks.js';
4
4
  export * from './prefix/mini-idc.js';
5
5
  export * from './utils';
6
- export { matchUtil, router, onlyLoginRouter, myPkgs, myDemoKv, type ExampleModule, type RouterProps, } from './router';
6
+ export { matchUtil, router, onlyLoginRouter, myPkgs, myDemoKv, type ExampleModule, type RouterProps, type MyPkg, } from './router';
7
7
  export declare const LayoutMenu: any;
8
8
  export type { ConfigType, AppType, CommomType, ProgramInfoType } from '../typings/global';
9
9
  import type { ConfigType, CommomType, CoverageType, ProjectCoverageType } from '../typings/global';
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './prefix/react-router-dom.js';\nexport * from './prefix/i18n-hooks.js';\nexport * from './prefix/mini-idc.js';\nexport * from './utils';\nexport {\n matchUtil,\n router,\n onlyLoginRouter,\n myPkgs,\n myDemoKv,\n type ExampleModule,\n type RouterProps,\n} from './router';\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nexport const LayoutMenu = hasAntd ? require('./components/layout-menu').default : null;\nexport type { ConfigType, AppType, CommomType, ProgramInfoType } from '../typings/global';\nimport type { ConfigType, CommomType, CoverageType, ProjectCoverageType } from '../typings/global';\nexport type PartialConfigType<T = 'swc'> = Partial<ConfigType<T>>;\nexport type PartialCommomType<T = 'swc'> = Partial<CommomType<T>>;\n\ndeclare const projectCoverage: Record<string, CoverageType & Partial<ProjectCoverageType>>;\n\n/** 一些项目基本信息 */\nexport const projectBasicInfo = {\n projectName,\n providerConfig,\n programInfo,\n coverage: projectCoverage,\n};\n\n// export { default as colorPalette } from './utils/color-palette';\n// export { setThemeColor, getColorPalette, type ThemeColorOptions } from './styles/vars';\n"],"names":["matchUtil","router","onlyLoginRouter","myPkgs","myDemoKv","LayoutMenu","hasAntd","require","default","projectBasicInfo","projectName","providerConfig","programInfo","coverage","projectCoverage"],"mappings":"AAAA,WAAc,8BAA+B,AAC7C,YAAc,wBAAyB,AACvC,YAAc,sBAAuB,AACrC,YAAc,SAAU,AACxB,QACEA,SAAS,CACTC,MAAM,CACNC,eAAe,CACfC,MAAM,CACNC,QAAQ,KAGH,UAAW,AAElB,QAAO,IAAMC,WAAaC,QAAUC,QAAQ,4BAA4BC,OAAO,CAAG,IAAI,AAAC,AASvF,QAAO,IAAMC,iBAAmB,CAC9BC,YAAAA,YACAC,eAAAA,eACAC,YAAAA,YACAC,SAAUC,eACZ,CAAE"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './prefix/react-router-dom.js';\nexport * from './prefix/i18n-hooks.js';\nexport * from './prefix/mini-idc.js';\nexport * from './utils';\nexport {\n matchUtil,\n router,\n onlyLoginRouter,\n myPkgs,\n myDemoKv,\n type ExampleModule,\n type RouterProps,\n type MyPkg,\n} from './router';\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nexport const LayoutMenu = hasAntd ? require('./components/layout-menu').default : null;\nexport type { ConfigType, AppType, CommomType, ProgramInfoType } from '../typings/global';\nimport type { ConfigType, CommomType, CoverageType, ProjectCoverageType } from '../typings/global';\nexport type PartialConfigType<T = 'swc'> = Partial<ConfigType<T>>;\nexport type PartialCommomType<T = 'swc'> = Partial<CommomType<T>>;\n\ndeclare const projectCoverage: Record<string, CoverageType & Partial<ProjectCoverageType>>;\n\n/** 一些项目基本信息 */\nexport const projectBasicInfo = {\n projectName,\n providerConfig,\n programInfo,\n coverage: projectCoverage,\n};\n\n// export { default as colorPalette } from './utils/color-palette';\n// export { setThemeColor, getColorPalette, type ThemeColorOptions } from './styles/vars';\n"],"names":["matchUtil","router","onlyLoginRouter","myPkgs","myDemoKv","LayoutMenu","hasAntd","require","default","projectBasicInfo","projectName","providerConfig","programInfo","coverage","projectCoverage"],"mappings":"AAAA,WAAc,8BAA+B,AAC7C,YAAc,wBAAyB,AACvC,YAAc,sBAAuB,AACrC,YAAc,SAAU,AACxB,QACEA,SAAS,CACTC,MAAM,CACNC,eAAe,CACfC,MAAM,CACNC,QAAQ,KAIH,UAAW,AAElB,QAAO,IAAMC,WAAaC,QAAUC,QAAQ,4BAA4BC,OAAO,CAAG,IAAI,AAAC,AASvF,QAAO,IAAMC,iBAAmB,CAC9BC,YAAAA,YACAC,eAAAA,eACAC,YAAAA,YACAC,SAAUC,eACZ,CAAE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "2.0.0-beta.44",
3
+ "version": "2.0.0-beta.46",
4
4
  "description": "core",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {