@eggjs/static 4.0.0-beta.34 → 4.0.0-beta.36
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/dist/app/middleware/static.d.ts +6 -3
- package/dist/app/middleware/static.js +42 -52
- package/dist/app.d.ts +9 -5
- package/dist/app.js +16 -18
- package/dist/config/config.default.d.ts +53 -50
- package/dist/config/config.default.js +16 -16
- package/dist/config/config.prod.d.ts +6 -3
- package/dist/config/config.prod.js +11 -8
- package/dist/index.d.ts +20 -16
- package/dist/index.js +23 -20
- package/dist/types.d.ts +13 -11
- package/dist/types.js +1 -2
- package/package.json +38 -47
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { StaticConfig } from "../../config/config.default.js";
|
|
2
|
+
import { Application, MiddlewareFunc } from "egg";
|
|
3
|
+
|
|
4
|
+
//#region src/app/middleware/static.d.ts
|
|
3
5
|
declare const _default: (options: StaticConfig, app: Application) => MiddlewareFunc;
|
|
4
|
-
|
|
6
|
+
//#endregion
|
|
7
|
+
export { _default as default };
|
|
@@ -1,53 +1,43 @@
|
|
|
1
|
-
import assert from
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import compose from
|
|
5
|
-
import
|
|
6
|
-
import { LRU } from
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
if (newOptions.prefix) {
|
|
42
|
-
prefixes.push(newOptions.prefix);
|
|
43
|
-
}
|
|
44
|
-
// ensure directory exists
|
|
45
|
-
if (!existsSync(newOptions.dir)) {
|
|
46
|
-
mkdirSync(newOptions.dir, { recursive: true });
|
|
47
|
-
}
|
|
48
|
-
middlewares.push(staticCache(newOptions));
|
|
49
|
-
app.coreLogger.info('[@eggjs/static] starting static serve %s -> %s', newOptions.prefix, newOptions.dir);
|
|
50
|
-
}
|
|
51
|
-
return compose(middlewares);
|
|
1
|
+
import assert from "node:assert";
|
|
2
|
+
import { existsSync, mkdirSync } from "node:fs";
|
|
3
|
+
import { staticCache } from "@eggjs/koa-static-cache";
|
|
4
|
+
import compose from "koa-compose";
|
|
5
|
+
import range from "koa-range";
|
|
6
|
+
import { LRU } from "ylru";
|
|
7
|
+
|
|
8
|
+
//#region src/app/middleware/static.ts
|
|
9
|
+
var static_default = (options, app) => {
|
|
10
|
+
const dirs = (options.dirs ?? []).concat(options.dir);
|
|
11
|
+
const prefixes = [];
|
|
12
|
+
function rangeMiddleware(ctx, next) {
|
|
13
|
+
if (prefixes.some((p) => ctx.path.startsWith(p))) return range(ctx, next);
|
|
14
|
+
return next();
|
|
15
|
+
}
|
|
16
|
+
const middlewares = [rangeMiddleware];
|
|
17
|
+
for (const dirObj of dirs) {
|
|
18
|
+
const isObject = typeof dirObj === "object" && dirObj !== null;
|
|
19
|
+
const isString = typeof dirObj === "string";
|
|
20
|
+
assert(isObject || isString, "`config.static.dir` must be `string | Array<string|object>`");
|
|
21
|
+
let newOptions;
|
|
22
|
+
if (isString) newOptions = {
|
|
23
|
+
...options,
|
|
24
|
+
dir: dirObj
|
|
25
|
+
};
|
|
26
|
+
else {
|
|
27
|
+
assert(typeof dirObj.dir === "string", "`config.static.dirs` should contains `[].dir` property when object style");
|
|
28
|
+
newOptions = {
|
|
29
|
+
...options,
|
|
30
|
+
...dirObj
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
if (newOptions.dynamic && !newOptions.files) newOptions.files = new LRU(newOptions.maxFiles);
|
|
34
|
+
if (newOptions.prefix) prefixes.push(newOptions.prefix);
|
|
35
|
+
if (!existsSync(newOptions.dir)) mkdirSync(newOptions.dir, { recursive: true });
|
|
36
|
+
middlewares.push(staticCache(newOptions));
|
|
37
|
+
app.coreLogger.info("[@eggjs/static] starting static serve %s -> %s", newOptions.prefix, newOptions.dir);
|
|
38
|
+
}
|
|
39
|
+
return compose(middlewares);
|
|
52
40
|
};
|
|
53
|
-
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
export { static_default as default };
|
package/dist/app.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { Application, ILifecycleBoot } from "egg";
|
|
2
|
+
|
|
3
|
+
//#region src/app.d.ts
|
|
4
|
+
declare class AppBoot implements ILifecycleBoot {
|
|
5
|
+
private readonly app;
|
|
6
|
+
constructor(app: Application);
|
|
7
|
+
configWillLoad(): Promise<void>;
|
|
6
8
|
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { AppBoot as default };
|
package/dist/app.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2FwcC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxNQUFNLENBQUMsT0FBTyxPQUFPLE9BQU87SUFDVCxHQUFHLENBQUM7SUFDckIsWUFBWSxHQUFnQjtRQUMxQixJQUFJLENBQUMsR0FBRyxHQUFHLEdBQUcsQ0FBQztJQUNqQixDQUFDO0lBQ0QsS0FBSyxDQUFDLGNBQWM7UUFDbEIsTUFBTSxHQUFHLEdBQUcsSUFBSSxDQUFDLEdBQUcsQ0FBQztRQUNyQixtREFBbUQ7UUFDbkQsTUFBTSxLQUFLLEdBQUcsR0FBRyxDQUFDLE1BQU0sQ0FBQyxjQUFjLENBQUMsT0FBTyxDQUFDLFlBQVksQ0FBQyxDQUFDO1FBQzlELElBQUksS0FBSyxLQUFLLENBQUMsQ0FBQyxFQUFFLENBQUM7WUFDakIsR0FBRyxDQUFDLE1BQU0sQ0FBQyxjQUFjLENBQUMsSUFBSSxDQUFDLFFBQVEsQ0FBQyxDQUFDO1FBQzNDLENBQUM7YUFBTSxDQUFDO1lBQ04sR0FBRyxDQUFDLE1BQU0sQ0FBQyxjQUFjLENBQUMsTUFBTSxDQUFDLEtBQUssRUFBRSxDQUFDLEVBQUUsUUFBUSxDQUFDLENBQUM7UUFDdkQsQ0FBQztJQUNILENBQUM7Q0FDRiJ9
|
|
1
|
+
//#region src/app.ts
|
|
2
|
+
var AppBoot = class {
|
|
3
|
+
app;
|
|
4
|
+
constructor(app) {
|
|
5
|
+
this.app = app;
|
|
6
|
+
}
|
|
7
|
+
async configWillLoad() {
|
|
8
|
+
const app = this.app;
|
|
9
|
+
const index = app.config.coreMiddleware.indexOf("bodyParser");
|
|
10
|
+
if (index === -1) app.config.coreMiddleware.push("static");
|
|
11
|
+
else app.config.coreMiddleware.splice(index, 0, "static");
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { AppBoot as default };
|
|
@@ -1,53 +1,56 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
import { EggConfigFactory } from "egg";
|
|
2
|
+
import { Options } from "@eggjs/koa-static-cache";
|
|
3
|
+
|
|
4
|
+
//#region src/config/config.default.d.ts
|
|
5
|
+
interface StaticDirOptions extends Omit<Options, "dir"> {
|
|
6
|
+
/**
|
|
7
|
+
* static files store dir
|
|
8
|
+
*/
|
|
9
|
+
dir: string;
|
|
10
|
+
/**
|
|
11
|
+
* static files prefix
|
|
12
|
+
* Default to `'/public/'`
|
|
13
|
+
*/
|
|
14
|
+
prefix: string;
|
|
15
|
+
/**
|
|
16
|
+
* cache max age in `seconds`
|
|
17
|
+
* Default to `0` on development, `31536000` on production
|
|
18
|
+
*/
|
|
19
|
+
maxAge: number;
|
|
20
|
+
/**
|
|
21
|
+
* dynamic load file which not cached on initialization
|
|
22
|
+
* Default to `true`
|
|
23
|
+
*/
|
|
24
|
+
dynamic: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* caches the assets on initialization or not,
|
|
27
|
+
* always work together with `options.dynamic`
|
|
28
|
+
* Default to `false`
|
|
29
|
+
*/
|
|
30
|
+
preload: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* buffer the file content or not
|
|
33
|
+
* Default to `false` on development, `true` on production
|
|
34
|
+
*/
|
|
35
|
+
buffer: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* max files count in store
|
|
38
|
+
* Default to `1000`
|
|
39
|
+
*/
|
|
40
|
+
maxFiles: number;
|
|
38
41
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
interface StaticConfig extends Omit<StaticDirOptions, "dir"> {
|
|
43
|
+
/**
|
|
44
|
+
* static files store dir
|
|
45
|
+
* Default to `${baseDir}/app/public`
|
|
46
|
+
*/
|
|
47
|
+
dir: string | Array<string | StaticDirOptions>;
|
|
48
|
+
/**
|
|
49
|
+
* static files store dirs
|
|
50
|
+
* @deprecated use `dir` instead
|
|
51
|
+
*/
|
|
52
|
+
dirs?: Array<string | StaticDirOptions>;
|
|
50
53
|
}
|
|
51
|
-
import type { EggConfigFactory } from 'egg';
|
|
52
54
|
declare const config: EggConfigFactory;
|
|
53
|
-
|
|
55
|
+
//#endregion
|
|
56
|
+
export { StaticConfig, StaticDirOptions, config as default };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { defineConfigFactory } from "egg";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
|
|
4
|
+
//#region src/config/config.default.ts
|
|
3
5
|
const config = defineConfigFactory((appInfo) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
buffer: false,
|
|
13
|
-
maxFiles: 1000,
|
|
14
|
-
},
|
|
15
|
-
};
|
|
6
|
+
return { static: {
|
|
7
|
+
prefix: "/public/",
|
|
8
|
+
dir: path.join(appInfo.baseDir, "app/public"),
|
|
9
|
+
dynamic: true,
|
|
10
|
+
preload: false,
|
|
11
|
+
buffer: false,
|
|
12
|
+
maxFiles: 1e3
|
|
13
|
+
} };
|
|
16
14
|
});
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
var config_default_default = config;
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { config_default_default as default };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { PartialEggConfig } from "egg";
|
|
2
|
+
|
|
3
|
+
//#region src/config/config.prod.d.ts
|
|
4
|
+
declare const config: PartialEggConfig;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { config as default };
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
|
|
1
|
+
import "egg";
|
|
2
|
+
|
|
3
|
+
//#region src/config/config.prod.ts
|
|
4
|
+
const config = { static: {
|
|
5
|
+
maxAge: 31536e3,
|
|
6
|
+
buffer: true
|
|
7
|
+
} };
|
|
8
|
+
var config_prod_default = config;
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { config_prod_default as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import "./types.js";
|
|
2
|
+
import { EggPluginFactory } from "egg";
|
|
3
|
+
|
|
4
|
+
//#region src/index.d.ts
|
|
5
|
+
|
|
3
6
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
* Static file serve plugin
|
|
8
|
+
*
|
|
9
|
+
* @since 4.1.0
|
|
10
|
+
* Usage:
|
|
11
|
+
* ```ts
|
|
12
|
+
* // config/plugin.ts
|
|
13
|
+
* import staticPlugin from '@eggjs/static';
|
|
14
|
+
*
|
|
15
|
+
* export default {
|
|
16
|
+
* ...staticPlugin(),
|
|
17
|
+
* };
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
17
20
|
declare const _default: EggPluginFactory;
|
|
18
|
-
|
|
21
|
+
//#endregion
|
|
22
|
+
export { _default as default };
|
package/dist/index.js
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import "
|
|
2
|
-
|
|
1
|
+
import { definePluginFactory } from "egg";
|
|
2
|
+
|
|
3
|
+
//#region src/index.ts
|
|
3
4
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
5
|
+
* Static file serve plugin
|
|
6
|
+
*
|
|
7
|
+
* @since 4.1.0
|
|
8
|
+
* Usage:
|
|
9
|
+
* ```ts
|
|
10
|
+
* // config/plugin.ts
|
|
11
|
+
* import staticPlugin from '@eggjs/static';
|
|
12
|
+
*
|
|
13
|
+
* export default {
|
|
14
|
+
* ...staticPlugin(),
|
|
15
|
+
* };
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
var src_default = definePluginFactory({
|
|
19
|
+
name: "static",
|
|
20
|
+
enable: true,
|
|
21
|
+
path: import.meta.dirname
|
|
21
22
|
});
|
|
22
|
-
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { src_default as default };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { StaticConfig } from "./config/config.default.js";
|
|
2
|
+
|
|
3
|
+
//#region src/types.d.ts
|
|
4
|
+
declare module "egg" {
|
|
5
|
+
/**
|
|
6
|
+
* Static file serve
|
|
7
|
+
* @member Config#static
|
|
8
|
+
* @see https://github.com/eggjs/egg/tree/next/packages/koa-static-cache
|
|
9
|
+
*/
|
|
10
|
+
interface EggAppConfig {
|
|
11
|
+
static: StaticConfig;
|
|
12
|
+
}
|
|
13
|
+
}
|
package/dist/types.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
|
1
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,72 +1,63 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eggjs/static",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
4
|
-
"publishConfig": {
|
|
5
|
-
"access": "public"
|
|
6
|
-
},
|
|
3
|
+
"version": "4.0.0-beta.36",
|
|
7
4
|
"description": "static server plugin for egg",
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "https://github.com/eggjs/egg.git",
|
|
11
|
-
"directory": "plugins/static"
|
|
12
|
-
},
|
|
13
|
-
"homepage": "https://github.com/eggjs/egg/tree/next/plugins/static",
|
|
14
|
-
"bugs": {
|
|
15
|
-
"url": "https://github.com/eggjs/egg/issues"
|
|
16
|
-
},
|
|
17
5
|
"keywords": [
|
|
18
6
|
"egg",
|
|
19
7
|
"egg-plugin",
|
|
20
8
|
"eggPlugin",
|
|
21
9
|
"static"
|
|
22
10
|
],
|
|
23
|
-
"
|
|
11
|
+
"homepage": "https://github.com/eggjs/egg/tree/next/plugins/static",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/eggjs/egg/issues"
|
|
14
|
+
},
|
|
24
15
|
"license": "MIT",
|
|
25
|
-
"
|
|
26
|
-
|
|
16
|
+
"author": "dead_horse",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/eggjs/egg.git",
|
|
20
|
+
"directory": "plugins/static"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"type": "module",
|
|
26
|
+
"main": "./dist/index.js",
|
|
27
|
+
"module": "./dist/index.js",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": "./dist/index.js",
|
|
31
|
+
"./app": "./dist/app.js",
|
|
32
|
+
"./app/middleware/static": "./dist/app/middleware/static.js",
|
|
33
|
+
"./config/config.default": "./dist/config/config.default.js",
|
|
34
|
+
"./config/config.prod": "./dist/config/config.prod.js",
|
|
35
|
+
"./types": "./dist/types.js",
|
|
36
|
+
"./package.json": "./package.json"
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
27
40
|
},
|
|
28
41
|
"dependencies": {
|
|
29
42
|
"koa-compose": "^4.1.0",
|
|
30
43
|
"koa-range": "^0.3.0",
|
|
31
44
|
"ylru": "^2.0.0",
|
|
32
|
-
"@eggjs/koa-static-cache": "7.0.0-beta.
|
|
33
|
-
},
|
|
34
|
-
"peerDependencies": {
|
|
35
|
-
"egg": "4.1.0-beta.34"
|
|
45
|
+
"@eggjs/koa-static-cache": "7.0.0-beta.36"
|
|
36
46
|
},
|
|
37
47
|
"devDependencies": {
|
|
38
48
|
"@types/koa-compose": "^3.2.8",
|
|
39
49
|
"@types/koa-range": "^0.3.5",
|
|
40
|
-
"oxlint": "^1.24.0",
|
|
41
|
-
"tsdown": "0.15.11",
|
|
42
50
|
"typescript": "^5.9.3",
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"@eggjs/tsconfig": "3.1.0-beta.34",
|
|
46
|
-
"egg": "4.1.0-beta.34"
|
|
51
|
+
"@eggjs/mock": "7.0.0-beta.36",
|
|
52
|
+
"egg": "4.1.0-beta.36"
|
|
47
53
|
},
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
"./config/config.default": "./dist/config/config.default.js",
|
|
54
|
-
"./config/config.prod": "./dist/config/config.prod.js",
|
|
55
|
-
"./types": "./dist/types.js",
|
|
56
|
-
"./package.json": "./package.json"
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"egg": "4.1.0-beta.36"
|
|
56
|
+
},
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": ">=22.18.0"
|
|
57
59
|
},
|
|
58
|
-
"files": [
|
|
59
|
-
"dist"
|
|
60
|
-
],
|
|
61
|
-
"types": "./dist/index.d.ts",
|
|
62
|
-
"main": "./dist/index.js",
|
|
63
|
-
"module": "./dist/index.js",
|
|
64
60
|
"scripts": {
|
|
65
|
-
"
|
|
66
|
-
"typecheck": "tsc --noEmit",
|
|
67
|
-
"lint": "oxlint --type-aware",
|
|
68
|
-
"lint:fix": "npm run lint -- --fix",
|
|
69
|
-
"test": "npm run lint:fix && vitest run",
|
|
70
|
-
"ci": "vitest run --coverage"
|
|
61
|
+
"typecheck": "tsgo --noEmit"
|
|
71
62
|
}
|
|
72
63
|
}
|