@moneko/core 3.11.0-beta.5 → 3.11.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.
package/lib/dev/mock.d.mts
CHANGED
|
@@ -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
|
|
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 o from"webpack-virtual-modules";import{isLibrary as t}from"../process-env.mjs";import{resolveNodeModulesPath as e}from"../utils/index.mjs";import{comment as r,docs as p}from"../vm/docs.mjs";import{examples as i}from"../vm/example.mjs";import{locales as m}from"../vm/locales.mjs";import s from"../vm/modules.mjs";import{route as
|
|
1
|
+
import o from"webpack-virtual-modules";import{isLibrary as t}from"../process-env.mjs";import{resolveNodeModulesPath as e}from"../utils/index.mjs";import{comment as r,docs as p}from"../vm/docs.mjs";import{examples as i}from"../vm/example.mjs";import{locales as m}from"../vm/locales.mjs";import s from"../vm/modules.mjs";import{route as l}from"../vm/routes.mjs";export class VirtualModuleWebpackPlugin{constructor(o={}){this.options=o,this.hasTapped=!1}apply(a){let n=this.options,f=new o(s);function c(o,t){let r=e(o);f.writeModule(r,t||"")}f.apply(a),l.on("change",c),m.on("change",c),t&&(i.on("change",c),p.on("change",c),r.on("change",c)),a.hooks.compilation.tap("VirtualModuleWebpackPlugin",()=>{if(!this.hasTapped){for(let o in this.hasTapped=!0,n)if(Object.prototype.hasOwnProperty.call(n,o)){let t=n[o];c(o,"string"==typeof t?t:`export default ${JSON.stringify(t)}`)}for(let o of i)c(...o);for(let o of p)c(...o);for(let o of r)c(...o)}})}}
|
package/lib/utils/index.d.mts
CHANGED
|
@@ -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) =>
|
|
13
|
+
export declare const resolveNodeModulesPath: <T extends string>(src: T) => NodeModulesPath<T>;
|
|
14
14
|
/** 获取模块真实入口位置
|
|
15
15
|
* @param {string} url 路径
|
|
16
16
|
* @returns {string} 模块真实入口路径
|
package/lib/utils/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolve as t}from"path";import e from"./resolver-sync.mjs";import o from"../paths.mjs";export function toUpperCaseString(t){return t?.replaceAll(/\b\w/g,t=>t.toUpperCase()).replaceAll(/\./g," ")}export function resolveProgramPath(e){return t(o.programPath,`./${e}`)}export const resolveNodeModulesPath=
|
|
1
|
+
import{resolve as t}from"path";import e from"./resolver-sync.mjs";import o from"../paths.mjs";export function toUpperCaseString(t){return t?.replaceAll(/\b\w/g,t=>t.toUpperCase()).replaceAll(/\./g," ")}export function resolveProgramPath(e){return t(o.programPath,`./${e}`)}export const resolveNodeModulesPath=t=>`${o.nodeModules}/${t}`;export const realResolve=t=>e.resolveSync({},o.programPath,t)||t;export function isObject(t){let e=typeof t;return null!==t&&("object"===e||"function"===e)}export function isFunction(t){if(!isObject(t))return!1;let e=Object.prototype.toString.call(t);return"[object Function]"===e||"[object AsyncFunction]"===e||"[object GeneratorFunction]"===e||"[object Proxy]"===e}export function empty(){}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneko/core",
|
|
3
|
-
"version": "3.11.0
|
|
3
|
+
"version": "3.11.0",
|
|
4
4
|
"description": "core",
|
|
5
5
|
"main": "lib/index.mjs",
|
|
6
6
|
"type": "module",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"multer": "1.4.5-lts.1",
|
|
36
36
|
"style-loader": "3.3.4",
|
|
37
37
|
"swc-loader": "0.2.6",
|
|
38
|
-
"typescript": "5.
|
|
38
|
+
"typescript": "5.4.3",
|
|
39
39
|
"webpack": "5.91.0",
|
|
40
40
|
"webpack-bundle-analyzer": "4.10.1",
|
|
41
41
|
"webpack-dev-middleware": "7.2.0",
|
|
@@ -56,5 +56,8 @@
|
|
|
56
56
|
"lib",
|
|
57
57
|
"typings/global.d.ts",
|
|
58
58
|
"typings/bundle-analyzer.d.ts"
|
|
59
|
-
]
|
|
59
|
+
],
|
|
60
|
+
"resolutions": {
|
|
61
|
+
"@types/mime": "3.0.4"
|
|
62
|
+
}
|
|
60
63
|
}
|