@moneko/core 3.0.0-beta.1 → 3.0.0-beta.100

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.
Files changed (105) hide show
  1. package/lib/app.d.ts +31 -0
  2. package/lib/app.js +1 -0
  3. package/lib/cleanup.js +1 -0
  4. package/{build → lib}/common.d.ts +1 -1
  5. package/lib/common.js +12 -0
  6. package/{build → lib}/coverage.d.ts +1 -1
  7. package/lib/coverage.js +1 -0
  8. package/lib/define.d.ts +4 -0
  9. package/lib/define.js +1 -0
  10. package/lib/docs.d.ts +4 -0
  11. package/lib/docs.js +1 -0
  12. package/lib/done.d.ts +11 -0
  13. package/lib/done.js +1 -0
  14. package/lib/esm.d.ts +1 -0
  15. package/lib/esm.js +1 -0
  16. package/lib/generate-api.d.ts +1 -0
  17. package/lib/generate-api.js +1 -0
  18. package/lib/has-pkg.js +1 -0
  19. package/lib/html-add-entry-attr.js +1 -0
  20. package/{build → lib}/html-plugin-option.d.ts +1 -1
  21. package/lib/html-plugin-option.js +1 -0
  22. package/lib/index.d.ts +3 -37
  23. package/lib/index.js +1 -1
  24. package/lib/loader/frontmatter.cjs +6 -0
  25. package/{build → lib}/minify.d.ts +3 -3
  26. package/lib/minify.js +1 -0
  27. package/lib/modifyVars.js +1 -0
  28. package/lib/module-federation.d.ts +5 -0
  29. package/lib/module-federation.js +1 -0
  30. package/lib/module.config.js +1 -0
  31. package/lib/net.d.ts +3 -0
  32. package/lib/net.js +1 -0
  33. package/lib/object-listener.d.ts +4 -0
  34. package/lib/object-listener.js +1 -0
  35. package/lib/process-env.d.ts +34 -0
  36. package/lib/process-env.js +1 -0
  37. package/{build → lib}/resolver-sync.d.ts +2 -1
  38. package/lib/resolver-sync.js +1 -0
  39. package/lib/routes.d.ts +31 -0
  40. package/lib/routes.js +1 -0
  41. package/lib/seo.js +1 -0
  42. package/{build → lib}/swcrc.d.ts +1 -1
  43. package/lib/swcrc.js +1 -0
  44. package/{build → lib}/tsloader.config.d.ts +1 -1
  45. package/lib/tsloader.config.js +1 -0
  46. package/{build → lib}/utils.d.ts +4 -4
  47. package/lib/utils.js +1 -0
  48. package/lib/virtual-module-plugin.d.ts +10 -0
  49. package/lib/virtual-module-plugin.js +1 -0
  50. package/lib/virtual-modules.d.ts +2 -0
  51. package/lib/virtual-modules.js +1 -0
  52. package/{build → lib}/webpack.common.d.ts +2 -1
  53. package/lib/webpack.common.js +1 -0
  54. package/lib/webpack.dev.d.ts +3 -0
  55. package/lib/webpack.dev.js +4 -0
  56. package/lib/webpack.prod.d.ts +3 -0
  57. package/lib/webpack.prod.js +1 -0
  58. package/lib/yarn-argv.js +1 -0
  59. package/package.json +29 -40
  60. package/template/index.html +5 -1
  61. package/typings/global.d.ts +53 -20
  62. package/build/common.js +0 -1
  63. package/build/coverage.js +0 -1
  64. package/build/done.d.ts +0 -8
  65. package/build/done.js +0 -1
  66. package/build/envFlags.d.ts +0 -17
  67. package/build/envFlags.js +0 -1
  68. package/build/has-pkg.js +0 -1
  69. package/build/html-add-entry-attr.js +0 -1
  70. package/build/html-plugin-option.js +0 -1
  71. package/build/index.d.ts +0 -2
  72. package/build/index.js +0 -1
  73. package/build/minify.js +0 -1
  74. package/build/modifyVars.js +0 -1
  75. package/build/module-federation.d.ts +0 -4
  76. package/build/module-federation.js +0 -1
  77. package/build/module.config.js +0 -1
  78. package/build/process-env.d.ts +0 -29
  79. package/build/process-env.js +0 -1
  80. package/build/resolver-sync.js +0 -1
  81. package/build/seo.js +0 -1
  82. package/build/swcrc.js +0 -1
  83. package/build/tsloader.config.js +0 -1
  84. package/build/utils.js +0 -1
  85. package/build/webpack.common.js +0 -1
  86. package/build/webpack.dev.d.ts +0 -2
  87. package/build/webpack.dev.js +0 -1
  88. package/build/webpack.prod.d.ts +0 -3
  89. package/build/webpack.prod.js +0 -1
  90. package/build/yarn-argv.js +0 -1
  91. package/lib/normalize.css +0 -254
  92. package/lib/packages/library/bootstrap.js +0 -1
  93. package/lib/packages/library/index.d.ts +0 -4
  94. package/lib/packages/library/index.js +0 -1
  95. package/lib/refresh-rem.d.ts +0 -0
  96. package/lib/refresh-rem.js +0 -1
  97. package/lib/router/index.d.ts +0 -51
  98. package/lib/router/index.js +0 -1
  99. /package/lib/{packages/library/bootstrap.d.ts → cleanup.d.ts} +0 -0
  100. /package/{build → lib}/has-pkg.d.ts +0 -0
  101. /package/{build → lib}/html-add-entry-attr.d.ts +0 -0
  102. /package/{build → lib}/modifyVars.d.ts +0 -0
  103. /package/{build → lib}/module.config.d.ts +0 -0
  104. /package/{build → lib}/seo.d.ts +0 -0
  105. /package/{build → lib}/yarn-argv.d.ts +0 -0
package/lib/normalize.css DELETED
@@ -1,254 +0,0 @@
1
- @import url('tailwindcss/utilities');
2
-
3
- html,
4
- body {
5
- margin: 0;
6
- padding: 0;
7
- inline-size: 100vi;
8
- font-size: var(--font-size, 14px);
9
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
10
- Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
11
- 'Noto Color Emoji', Helvetica, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans';
12
- color: var(--text-color, rgb(0 0 0 / 65%));
13
- line-height: 1.8;
14
- transition-duration: var(--transition-duration, 0.3s);
15
- transition-property: background-color, color;
16
- transition-timing-function: var(--transition-timing-function, cubic-bezier(0.94, -0.1, 0.1, 1.2));
17
- }
18
-
19
- #root {
20
- display: flex;
21
- -webkit-overflow-scrolling: touch;
22
- }
23
-
24
- #root > main {
25
- animation: route-in var(--transition-duration, 0.3s);
26
- }
27
-
28
- input,
29
- textarea {
30
- caret-color: inherit;
31
- }
32
-
33
- h1 {
34
- margin: 0.67em 0;
35
- font-size: 2em;
36
- }
37
-
38
- hr {
39
- overflow: visible;
40
- block-size: 0;
41
- box-sizing: content-box;
42
- }
43
-
44
- pre {
45
- font-size: 1em;
46
- font-family: monospace;
47
- }
48
-
49
- a {
50
- text-decoration: none;
51
- background-color: transparent;
52
- cursor: pointer;
53
- }
54
-
55
- abbr[title] {
56
- border-block-end: none;
57
- text-decoration: underline;
58
- text-decoration: underline dotted;
59
- }
60
-
61
- b,
62
- strong {
63
- font-weight: bolder;
64
- }
65
-
66
- code,
67
- kbd,
68
- samp {
69
- font-size: 1em;
70
- font-family: monospace;
71
- }
72
-
73
- small {
74
- font-size: 80%;
75
- }
76
-
77
- sub,
78
- sup {
79
- position: relative;
80
- font-size: 75%;
81
- line-height: 0;
82
- vertical-align: baseline;
83
- }
84
-
85
- sub {
86
- inset-block-end: -0.25em;
87
- }
88
-
89
- sup {
90
- inset-block-start: -0.5em;
91
- }
92
-
93
- img {
94
- border-style: none;
95
- }
96
-
97
- img,
98
- button {
99
- outline: 1px solid transparent;
100
- }
101
-
102
- button,
103
- input,
104
- optgroup,
105
- select,
106
- textarea {
107
- margin: 0;
108
- font-size: 100%;
109
- font-family: inherit;
110
- line-height: 1.15;
111
- }
112
-
113
- button,
114
- input {
115
- overflow: visible;
116
- }
117
-
118
- button,
119
- select {
120
- text-transform: none;
121
- }
122
-
123
- button,
124
- [type='button'],
125
- [type='reset'],
126
- [type='submit'] {
127
- appearance: button;
128
- }
129
-
130
- button::-moz-focus-inner,
131
- [type='button']::-moz-focus-inner,
132
- [type='reset']::-moz-focus-inner,
133
- [type='submit']::-moz-focus-inner {
134
- border-style: none;
135
- padding: 0;
136
- }
137
-
138
- button:-moz-focusring,
139
- [type='button']:-moz-focusring,
140
- [type='reset']:-moz-focusring,
141
- [type='submit']:-moz-focusring {
142
- outline: 1px dotted var(--primary-outline);
143
- }
144
-
145
- fieldset {
146
- padding: 0.35em 0.75em 0.625em;
147
- }
148
-
149
- legend {
150
- display: table;
151
- padding: 0;
152
- max-inline-size: 100%;
153
- white-space: normal;
154
- color: inherit;
155
- box-sizing: border-box;
156
- }
157
-
158
- progress {
159
- vertical-align: baseline;
160
- }
161
-
162
- textarea {
163
- overflow: auto;
164
- }
165
-
166
- details {
167
- display: block;
168
- }
169
-
170
- summary {
171
- display: list-item;
172
- }
173
-
174
- template,
175
- [hidden] {
176
- display: none;
177
- }
178
-
179
- [type='checkbox'],
180
- [type='radio'] {
181
- box-sizing: border-box;
182
- padding: 0;
183
- }
184
-
185
- [type='number']::-webkit-inner-spin-button,
186
- [type='number']::-webkit-outer-spin-button {
187
- block-size: auto;
188
- }
189
-
190
- [type='search'] {
191
- appearance: textfield;
192
- outline-offset: -2px;
193
- }
194
-
195
- [type='search']::-webkit-search-decoration {
196
- appearance: none;
197
- }
198
-
199
- ::-webkit-file-upload-button {
200
- appearance: button;
201
- font: inherit;
202
- }
203
-
204
- ::-webkit-scrollbar {
205
- inline-size: 4px;
206
- block-size: 4px;
207
- }
208
-
209
- ::-webkit-scrollbar-track,
210
- ::-webkit-scrollbar-thumb {
211
- border-radius: 5px;
212
- background-color: transparent;
213
- }
214
-
215
- :hover::-webkit-scrollbar-thumb {
216
- background-color: var(--primary-selection);
217
- }
218
-
219
- ::-webkit-scrollbar-thumb:hover {
220
- background-color: var(--primary-hover);
221
- }
222
-
223
- ::-webkit-scrollbar-thumb:active {
224
- background-color: var(--primary-active);
225
- }
226
-
227
- ::-webkit-scrollbar-button {
228
- display: none;
229
- }
230
-
231
- @keyframes route-in {
232
- from {
233
- transform: translate3d(0, 16px, 0);
234
- opacity: 0;
235
- }
236
-
237
- to {
238
- transform: translate3d(0, 0, 0);
239
- opacity: 1;
240
- }
241
- }
242
-
243
- @keyframes route-out {
244
- from {
245
- transform: translate3d(0, 0, 0);
246
- opacity: 1;
247
- }
248
-
249
- to {
250
- z-index: -1;
251
- transform: translate3d(0, 1rem, 0);
252
- opacity: 0;
253
- }
254
- }
@@ -1 +0,0 @@
1
- import{isFunction as n}from"@moneko/common";import{Router as o}from"@solidjs/router";import{render as t}from"solid-js/web";import r from"@/index";var e=APPENTRY?require(APPENTRY):null,u=document.getElementById("root");n(null==e?void 0:e.bootstrap)&&(null==e||e.bootstrap());var l=function(){return React.createElement(o,null,React.createElement(r,null))};window.rootInstance={unmount:function(){return null},render:function(){window.rootInstance.unmount=t(l,u)}},window.rootInstance.render(l),n(null==e?void 0:e.mount)&&(null==e||e.mount());
@@ -1,4 +0,0 @@
1
- import '../../refresh-rem';
2
- import '../../normalize.css';
3
- declare const bootstrap: typeof import("./bootstrap");
4
- export default bootstrap;
@@ -1 +0,0 @@
1
- import"../../refresh-rem";import"../../normalize.css";var r=await import("./bootstrap");export default r;
File without changes
@@ -1 +0,0 @@
1
- !function(o,n){var t=function(){var n=o.documentElement,t=n.clientWidth||o.body.clientWidth,e=t<=375?375:programInfo.designSize,i=t;i=t<=375?t:t<=programInfo.designSize?e:t;var l=16/e*i+"px";l!==n.style.fontSize&&(n.style.fontSize=l)};t(),"addEventListener"in o&&n.addEventListener("orientationchange"in n?"orientationchange":"resize",t,!1),window.scrollTo||(window.scrollTo=function(o){window.scrollLeft=o.left,window.scrollTop=o.top}),document.body.scrollTo||(Element.prototype.scrollTo=function(o){this.scrollLeft=o.left,this.scrollTop=o.top})}(document,window);
@@ -1,51 +0,0 @@
1
- type Any = any;
2
- type MDXComponents = Record<string, Any>;
3
- export interface RouterProps {
4
- /** 菜单id */
5
- key: string;
6
- alive?: boolean;
7
- /** 菜单图标 */
8
- icon?: string;
9
- dynamicTitle?: string;
10
- /** 菜单名 */
11
- i18n?: string | null;
12
- hideMenu?: boolean;
13
- hideTabs?: boolean;
14
- onlyLogin?: boolean;
15
- /** 菜单父id */
16
- parentId?: string;
17
- root?: boolean;
18
- path?: string;
19
- element?: Any;
20
- fallback?: Any;
21
- /** 可否关闭标签 */
22
- closable?: boolean;
23
- /** 子菜单 */
24
- children?: RouterProps[];
25
- props?: {
26
- path: string;
27
- components?: MDXComponents;
28
- [key: string]: Any;
29
- };
30
- }
31
- export declare function lazyImport(filePath: string): Promise<unknown>;
32
- export interface ExampleModule {
33
- code: string;
34
- title?: string;
35
- description?: string | null;
36
- noInline: boolean;
37
- language: never;
38
- }
39
- export type MyPkg = RouterProps & {
40
- type: string;
41
- title: string;
42
- subtitle?: string;
43
- icon?: string;
44
- };
45
- export declare const myPkgs: MyPkg[];
46
- export declare const myDemoKv: Record<string, ExampleModule[]>;
47
- export declare const mdxComponents: MDXComponents;
48
- export declare const onlyLoginRouter: RouterProps[];
49
- export declare const router: RouterProps[];
50
- export declare function matchUtil(pathname: string): RouterProps;
51
- export {};
@@ -1 +0,0 @@
1
- function e(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=Array(r);n<r;n++)t[n]=e[n];return t}function r(){return(r=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e}).apply(this,arguments)}import{isUndefined as n}from"@moneko/common";import{pathToRegexp as t}from"path-to-regexp";export function lazyImport(e){return new Promise(function(r){return import("@/pages/"+e.replace(/:/g,"$").replace(/^\//,"")).then(r).catch(function(){return Promise.resolve({default:null})})})}export var myPkgs=[];export var myDemoKv={};export var mdxComponents={};if("library"===APPTYPE){var o,i,a=require.context("@pkg/",!0,/README\.mdx?$/),l={};try{l=require("@/components/components").default}catch(e){}Object.assign(mdxComponents,r({},l)),null==(o=a.keys())||o.forEach(function(e){var n=e.substring(2).split("/").slice(0,-1).join("/"),t=a(e),o=t.basic,i=t.default;myPkgs.push(r({key:n,path:n,element:i},o,{props:{components:mdxComponents,path:n}}))});var u=require.context("@pkg/",!0,/\/examples\/(.+)\.mdx$/);null==(i=u.keys())||i.forEach(function(r){var n=r.substring(2).split("/"),t=n[0];Array.isArray(myDemoKv[t])||(myDemoKv[t]=[]);for(var o,i,a=u(r),l=a.matchAll(/```([^\r\n]+)?\r?\n([\s\S]*?)\r?\n```/g),c="",p="",s=null,h=function(r,n){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=function(r,n){if(r){if("string"==typeof r)return e(r,n);var t=Object.prototype.toString.call(r).slice(8,-1);if("Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return e(r,n)}}(r))){t&&(r=t);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(l);!(i=h()).done;){var y=i.value;p=y[1]||"tsx",c=y[2],s=a.replace(y[0],"")}myDemoKv[t].push({language:p,code:c,description:s,title:null==(o=n.pop())?void 0:o.replace(/\.mdx$/,""),noInline:/render\([^\\)]*\);?(?=\s*$)/.test(c)})})}var c=[];try{c=require("@/router").default}catch(e){console.info("自定义路由请在 router 目录下新建 index.ts, 类型: RouterProps[]",e)}function p(e,r){return["*"===r&&"*"!==e?void 0:r,e].filter(Boolean).join("/")}var s=function(e){for(var r=[],n=0;n<e.length;n++)for(var t=e[n].split("/").slice(0,-1),o=r,i=0;i<t.length;i++){var a=t[i];if(""!==a){"."===a&&(a="*");var l=o;if(Array.isArray(o)){for(var u=0;u<o.length;u++)if(o[u].path===a){o=o[u].children;break}}if(l===o){var c=i===t.length-1?e[n]:t.slice(0,i+1).join("/")+"/",p={key:c=c.substring(2,c.lastIndexOf("/")),path:a,i18n:"route-"+c,children:[],alive:!1,element:lazyImport(c),hideMenu:c.includes(":"),props:{path:c}};Array.isArray(o)&&o.push(p),o=p.children}}}return r}(require.context("@/pages/",!0,/\.(t|j)sx$/,"lazy").keys().map(function(e){return e.replace(/\$/g,":")}));function h(e,n,t){return void 0===e&&(e=[]),e.map(function(e){var o=r({},e);return void 0===o.key&&(o.key=p(e.path,t)),void 0===o.i18n&&(o.i18n="route-"+o.key),void 0===o.alive&&(o.alive=!1),"*"===o.path&&void 0===o.hideMenu&&(o.hideMenu=!0),Array.isArray(o.children)&&(o.children=o.children.length?h(o.children,n,o.key):void 0),o.element||(o.element=lazyImport(o.key),o.props={path:o.key}),!!o.onlyLogin!==n||o.root?o:null}).filter(Boolean)}for(var y=[].concat(c),f=0,d=s.length;f<d;f++)!function e(t,o,i){var a,l=t.find(function(e){return e.path===o.path});l?(l.key=p(l.path,i),n(l.i18n)&&(l.i18n="route-"+l.key),n(l.alive)&&(l.alive=!1),n(l.element)&&o.element&&(l.element=o.element,l.props=o.props),n(l.hideMenu)&&(l.hideMenu="*"===l.path||l.key.includes(":")),Object.assign(l,r({},o,l)),o.children&&(!l.children&&Array.isArray(o.children)&&(l.children=o.children),null==(a=o.children)||a.forEach(function(r){e(null==l?void 0:l.children,r,null==l?void 0:l.key)}))):t.push(o)}(y,s[f]);export var onlyLoginRouter=h(y,!1);export var router=h(y,!0);export function matchUtil(e){var r={key:""};return!function n(o){for(var i=0,a=o.length;i<a;i++){if(o[i].path&&"*"!==o[i].path&&o[i].key)try{if(t(o[i].key).exec(e.substring(1))){r=o[i];return}}catch(e){}Array.isArray(o[i].children)&&n(o[i].children)}}(router),r}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes