@moneko/core 3.10.5 → 3.11.0-beta.0

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.
@@ -20,7 +20,7 @@ type Any = any;
20
20
  * @param {T} data data
21
21
  * @returns {Promise} mockData
22
22
  */
23
- export declare const yApiSchemaMock: <T extends unknown>(option: YApiOptionBySchema, data?: T | undefined) => Promise<T>;
23
+ export declare const yApiSchemaMock: <T extends unknown>(option: YApiOptionBySchema, data?: T) => Promise<T>;
24
24
  export type YApiOption = {
25
25
  /** YApi host */
26
26
  host: string;
@@ -1 +1 @@
1
- import{merge as e}from"webpack-merge";import{CONFIG as r}from"../config.mjs";import o from"../paths.mjs";import t from"../polyfills/polyfills.mjs";import{isDev as s,isReact as m,isSolid as a,jsxImportSource as l}from"../process-env.mjs";let p=function(e){for(let 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.importOnDemand||{}),i={include:t(),mode:"entry",coreJs:"3.36"};export default(t=>e({module:{type:"es6",resolveFully:!0},jsc:{parser:{syntax:"typescript",tsx:!0,decorators:!0,dynamicImport:!0},loose:!0,target:r.polyfill?void 0:"es2017",externalHelpers:!1,transform:{legacyDecorator:!0,decoratorMetadata:!0,react:{runtime:"automatic",throwIfNamespace:!0,refresh:m&&s,development:s,importSource:l},optimizer:{simplify:!1}},experimental:{emitAssertForImportAttributes:!0,cacheRoot:o.swcCachePath,plugins:[["@moneko/transform-imports",p],a&&["@moneko/jsx-dom-expressions",{...r.jsxDomExpressions,generate:t?"ssr":"dom",hydratable:t}]].filter(Boolean)}},env:r.polyfill?i:void 0,sourceMaps:!0,parseMap:!0},"function"==typeof r.swcrc?r.swcrc(s):r.swcrc||{}));
1
+ import{merge as e}from"webpack-merge";import{CONFIG as r}from"../config.mjs";import o from"../paths.mjs";import t,{coreJsVersion as s}from"../polyfills/polyfills.mjs";import{isDev as m,isReact as a,isSolid as l,jsxImportSource as p}from"../process-env.mjs";let i=function(e){for(let 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.importOnDemand||{}),c={include:t(),mode:"entry",coreJs:s};export default(t=>e({module:{type:"es6",resolveFully:!0},jsc:{parser:{syntax:"typescript",tsx:!0,decorators:!0,dynamicImport:!0},loose:!0,target:r.polyfill?void 0:"es2017",externalHelpers:!1,transform:{legacyDecorator:!0,decoratorMetadata:!0,react:{runtime:"automatic",throwIfNamespace:!0,refresh:a&&m,development:m,importSource:p},optimizer:{simplify:!1}},experimental:{emitAssertForImportAttributes:!0,cacheRoot:o.swcCachePath,plugins:[["@moneko/transform-imports",i],l&&["@moneko/jsx-dom-expressions",{...r.jsxDomExpressions,generate:t?"ssr":"dom",hydratable:t}]].filter(Boolean)}},env:r.polyfill?c:void 0,sourceMaps:!0,parseMap:!0},"function"==typeof r.swcrc?r.swcrc(m):r.swcrc||{}));
@@ -1 +1 @@
1
- import e from"webpack";import r from"./external-remotes.mjs";import{CONFIG as t}from"../config.mjs";import{realResolve as o}from"../utils/index.mjs";let{NormalModuleReplacementPlugin:s,container:{ModuleFederationPlugin:a}}=e,m={},i={},l={},n=t.moduleFederation?.map(e=>{if(Array.isArray(e.remotes))for(let r=0,t=e.remotes.length;r<t;r++){let t=e.remotes[r],o=t.alias||t.name,s=t.filename||"remote_entry.js";if(l[o]=`${t.name}@${t.host}/${s}`,Array.isArray(t.library))for(let e=0,r=t.library.length;e<r;e++)m[t.library[e]]=`${o}/${t.library[e]}`}if(Array.isArray(e.exposes))for(let r=0,t=e.exposes.length;r<t;r++){let t=e.exposes[r];"string"==typeof t?i[`./${t}`]=o(t):"[object Object]"===Object.prototype.toString.call(t)&&(i[`./${t.name}`]=o(t.path))}return new a({filename:"remote_entry.js",...e,remotes:l,exposes:i})});n.length>0&&(n.push(new r),n.push(new s(/(.*)/,e=>{m[e.request]&&(e.request=m[e.request])})));export default n;
1
+ import e from"webpack";import r from"./external-remotes.mjs";import{CONFIG as t}from"../config.mjs";import{realResolve as o}from"../utils/index.mjs";let{NormalModuleReplacementPlugin:s,container:{ModuleFederationPlugin:a}}=e,i={},m={},n={},l=t.moduleFederation?.map(e=>{if(Array.isArray(e.remotes))for(let r=0,t=e.remotes.length;r<t;r++){let t=e.remotes[r],o=t.alias||t.name,s=t.filename||"remote_entry.js";if(n[o]=`${t.name}@${t.host}/${s}`,Array.isArray(t.library))for(let e=0,r=t.library.length;e<r;e++)i[t.library[e]]=`${o}/${t.library[e]}`}if(Array.isArray(e.exposes))for(let r=0,t=e.exposes.length;r<t;r++){let t=e.exposes[r];"string"==typeof t?m[`./${t.toString()}`]=o(t):"[object Object]"===Object.prototype.toString.call(t)&&(m[`./${t.name}`]=o(t.path))}return new a({filename:"remote_entry.js",...e,remotes:n,exposes:m})});l.length>0&&(l.push(new r),l.push(new s(/(.*)/,e=>{i[e.request]&&(e.request=i[e.request])})));export default l;
@@ -1,2 +1,3 @@
1
+ export declare const coreJsVersion: any;
1
2
  declare function polyfills(): string[];
2
3
  export default polyfills;
@@ -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.36"}).list}
1
+ import o from"core-js-compat";import{getBrowsersTargets as r}from"./targets.mjs";import{resolve as e}from"path";import{loadFileSync as t}from"@moneko/mdx";let{version:s}=JSON.parse(t(e("node_modules/core-js/package.json"))||"{}");export const coreJsVersion=s.substring(0,s.indexOf(".",2));export default function(){return o({targets:r(),version:coreJsVersion}).list}
@@ -10,7 +10,7 @@ export declare function resolveProgramPath<T extends string>(src: T): ProgramPat
10
10
  * @param {string} src 路径
11
11
  * @returns {string} 位于项目根目录node_modules下的位置
12
12
  */
13
- export declare const resolveNodeModulesPath: <T extends string>(src: T) => `${`node_modules/${T extends string ? T : string}` extends infer T_1 ? T_1 extends `node_modules/${T extends string ? T : string}` ? T_1 extends string ? T_1 : string : never : never}`;
13
+ export declare const resolveNodeModulesPath: <T extends string>(src: T) => NodeModulesPath<T>;
14
14
  /** 获取模块真实入口位置
15
15
  * @param {string} url 路径
16
16
  * @returns {string} 模块真实入口路径
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "3.10.5",
3
+ "version": "3.11.0-beta.0",
4
4
  "description": "core",
5
5
  "main": "lib/index.mjs",
6
6
  "type": "module",
7
7
  "scripts": {
8
- "prebuild": "oxlint -c ./eslintrc.json -D correctness -D restriction src",
9
8
  "build": "rm -rf ./lib && tsc && swc src -d lib --strip-leading-paths -D",
10
9
  "postbuild": "npm run cjs && npm run mjs",
11
10
  "cjs": "find ./lib/loader/ -type f -name \"*.js\" -execdir bash -c 'mv \"$1\" \"${1%.js}.cjs\"' _ {} \\;",
@@ -16,28 +15,28 @@
16
15
  "license": "MIT",
17
16
  "dependencies": {
18
17
  "@moneko/mdx": "0.1.26",
19
- "@moneko/transform-imports": "0.3.1",
20
- "@swc/core": "1.3.107",
18
+ "@moneko/transform-imports": "0.4.0",
19
+ "@swc/core": "1.4.11",
21
20
  "add-asset-html-webpack-plugin": "6.0.0",
22
21
  "chalk": "5.3.0",
23
22
  "chokidar": "3.6.0",
24
- "core-js": "3.36.0",
25
- "core-js-compat": "3.36.0",
23
+ "core-js": "3.36.1",
24
+ "core-js-compat": "3.36.1",
26
25
  "cross-env": "7.0.3",
27
26
  "css-loader": "6.10.0",
28
- "express": "4.18.2",
27
+ "express": "4.19.2",
29
28
  "html-webpack-plugin": "5.6.0",
30
29
  "http-proxy-middleware": "2.0.6",
31
30
  "less": "4.2.0",
32
31
  "less-loader": "12.2.0",
33
- "lightningcss": "1.23.0",
34
- "mini-css-extract-plugin": "2.8.0",
32
+ "lightningcss": "1.24.1",
33
+ "mini-css-extract-plugin": "2.8.1",
35
34
  "mock-json-schema": "1.1.1",
36
35
  "multer": "1.4.5-lts.1",
37
36
  "style-loader": "3.3.4",
38
37
  "swc-loader": "0.2.6",
39
- "typescript": "5.3.3",
40
- "webpack": "5.90.2",
38
+ "typescript": "5.4.3",
39
+ "webpack": "5.90.3",
41
40
  "webpack-bundle-analyzer": "4.10.1",
42
41
  "webpack-dev-middleware": "7.0.0",
43
42
  "webpack-hot-middleware": "2.26.1",
@@ -47,16 +46,18 @@
47
46
  "xml2js": "0.6.2"
48
47
  },
49
48
  "devDependencies": {
50
- "@swc/cli": "0.3.9",
49
+ "@swc/cli": "0.3.12",
51
50
  "@types/express": "4.17.21",
52
51
  "@types/multer": "1.4.11",
53
- "oxlint": "0.2.8",
54
- "sass": "1.71.0",
55
- "sass-loader": "14.1.0"
52
+ "sass": "1.72.0",
53
+ "sass-loader": "14.1.1"
56
54
  },
57
55
  "files": [
58
56
  "lib",
59
57
  "typings/global.d.ts",
60
58
  "typings/bundle-analyzer.d.ts"
61
- ]
59
+ ],
60
+ "resolutions": {
61
+ "@types/mime": "3.0.4"
62
+ }
62
63
  }