@eggjs/redis 4.0.0-beta.35 → 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/agent.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { RedisBoot } from './lib/redis.ts';
2
- export default RedisBoot;
1
+ import { RedisBoot } from "./lib/redis.js";
2
+ export { RedisBoot as default };
package/dist/agent.js CHANGED
@@ -1,3 +1,7 @@
1
1
  import { RedisBoot } from "./lib/redis.js";
2
- export default RedisBoot;
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWdlbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvYWdlbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBRTNDLGVBQWUsU0FBUyxDQUFDIn0=
2
+
3
+ //#region src/agent.ts
4
+ var agent_default = RedisBoot;
5
+
6
+ //#endregion
7
+ export { agent_default as default };
package/dist/app.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { RedisBoot } from './lib/redis.ts';
2
- export default RedisBoot;
1
+ import { RedisBoot } from "./lib/redis.js";
2
+ export { RedisBoot as default };
package/dist/app.js CHANGED
@@ -1,3 +1,7 @@
1
1
  import { RedisBoot } from "./lib/redis.js";
2
- export default RedisBoot;
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2FwcC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFFM0MsZUFBZSxTQUFTLENBQUMifQ==
2
+
3
+ //#region src/app.ts
4
+ var app_default = RedisBoot;
5
+
6
+ //#endregion
7
+ export { app_default as default };
@@ -1,59 +1,62 @@
1
- import type { RedisOptions, ClusterOptions, Redis } from 'ioredis';
2
- export interface RedisClientOptions extends RedisOptions {
3
- /**
4
- * Whether to enable weakDependent mode, the redis client start will not block the application start
5
- *
6
- * Default to `undefined`
7
- */
8
- weakDependent?: boolean;
1
+ import { ClusterOptions, Redis, RedisOptions } from "ioredis";
2
+
3
+ //#region src/config/config.default.d.ts
4
+ interface RedisClientOptions extends RedisOptions {
5
+ /**
6
+ * Whether to enable weakDependent mode, the redis client start will not block the application start
7
+ *
8
+ * Default to `undefined`
9
+ */
10
+ weakDependent?: boolean;
9
11
  }
10
- export interface RedisClusterOptions extends ClusterOptions {
11
- cluster: true;
12
- nodes: RedisClientOptions[];
12
+ interface RedisClusterOptions extends ClusterOptions {
13
+ cluster: true;
14
+ nodes: RedisClientOptions[];
13
15
  }
14
- export interface RedisConfig {
15
- /**
16
- * Default redis client config
17
- *
18
- * Default to `{}`
19
- */
20
- default: RedisClientOptions;
21
- /**
22
- * Single Redis or Cluster Redis config
23
- */
24
- client?: RedisClientOptions | RedisClusterOptions;
25
- /**
26
- * Multi Redis config
27
- */
28
- clients?: Record<string, RedisClientOptions>;
29
- /**
30
- * redis client will try to use TIME command to detect client is ready or not
31
- * if your redis server not support TIME command, please set this config to false
32
- * see https://redis.io/commands/time
33
- *
34
- * Default to `true`
35
- */
36
- supportTimeCommand: boolean;
37
- /**
38
- * Whether to enable redis for `app`
39
- *
40
- * Default to `true`
41
- */
42
- app: boolean;
43
- /**
44
- * Whether to enable redis for `agent`
45
- *
46
- * Default to `false`
47
- */
48
- agent: boolean;
49
- /**
50
- * Customize iovalkey version, only set when you needed
51
- *
52
- * Default to `undefined`, which means using the built-in ioredis
53
- */
54
- Redis?: typeof Redis;
16
+ interface RedisConfig {
17
+ /**
18
+ * Default redis client config
19
+ *
20
+ * Default to `{}`
21
+ */
22
+ default: RedisClientOptions;
23
+ /**
24
+ * Single Redis or Cluster Redis config
25
+ */
26
+ client?: RedisClientOptions | RedisClusterOptions;
27
+ /**
28
+ * Multi Redis config
29
+ */
30
+ clients?: Record<string, RedisClientOptions>;
31
+ /**
32
+ * redis client will try to use TIME command to detect client is ready or not
33
+ * if your redis server not support TIME command, please set this config to false
34
+ * see https://redis.io/commands/time
35
+ *
36
+ * Default to `true`
37
+ */
38
+ supportTimeCommand: boolean;
39
+ /**
40
+ * Whether to enable redis for `app`
41
+ *
42
+ * Default to `true`
43
+ */
44
+ app: boolean;
45
+ /**
46
+ * Whether to enable redis for `agent`
47
+ *
48
+ * Default to `false`
49
+ */
50
+ agent: boolean;
51
+ /**
52
+ * Customize iovalkey version, only set when you needed
53
+ *
54
+ * Default to `undefined`, which means using the built-in ioredis
55
+ */
56
+ Redis?: typeof Redis;
55
57
  }
56
58
  declare const _default: {
57
- redis: RedisConfig;
59
+ redis: RedisConfig;
58
60
  };
59
- export default _default;
61
+ //#endregion
62
+ export { RedisClientOptions, RedisClusterOptions, RedisConfig, _default as default };
@@ -1,53 +1,10 @@
1
- export default {
2
- redis: {
3
- default: {},
4
- app: true,
5
- agent: false,
6
- supportTimeCommand: true,
7
- // Single Redis
8
- // client: {
9
- // host: 'host',
10
- // port: 'port',
11
- // family: 'user',
12
- // password: 'password',
13
- // db: 'db',
14
- // },
15
- //
16
- // Cluster Redis
17
- // client: {
18
- // cluster: true,
19
- // nodes: [{
20
- // host: 'host',
21
- // port: 'port',
22
- // family: 'user',
23
- // password: 'password',
24
- // db: 'db',
25
- // }, {
26
- // host: 'host',
27
- // port: 'port',
28
- // family: 'user',
29
- // password: 'password',
30
- // db: 'db',
31
- // },
32
- // ]},
33
- //
34
- // Multi Redis
35
- // clients: {
36
- // instance1: {
37
- // host: 'host',
38
- // port: 'port',
39
- // family: 'user',
40
- // password: 'password',
41
- // db: 'db',
42
- // },
43
- // instance2: {
44
- // host: 'host',
45
- // port: 'port',
46
- // family: 'user',
47
- // password: 'password',
48
- // db: 'db',
49
-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QUNoQixPQUFPO1FBQ1AsS0FBSztLQUNTO0NBQ2pCLENBQUMifQ==
1
+ //#region src/config/config.default.ts
2
+ var config_default_default = { redis: {
3
+ default: {},
4
+ app: true,
5
+ agent: false,
6
+ supportTimeCommand: true
7
+ } };
8
+
9
+ //#endregion
10
+ export { config_default_default as default };
package/dist/index.d.ts CHANGED
@@ -1,18 +1,22 @@
1
- import './types.ts';
2
- import { type EggPluginFactory } from 'egg';
1
+ import "./types.js";
2
+ import { EggPluginFactory } from "egg";
3
+
4
+ //#region src/index.d.ts
5
+
3
6
  /**
4
- * Redis plugin
5
- *
6
- * @since 4.1.0
7
- * Usage:
8
- * ```ts
9
- * // config/plugin.ts
10
- * import redisPlugin from '@eggjs/redis';
11
- *
12
- * export default {
13
- * ...redisPlugin(),
14
- * };
15
- * ```
16
- */
7
+ * Redis plugin
8
+ *
9
+ * @since 4.1.0
10
+ * Usage:
11
+ * ```ts
12
+ * // config/plugin.ts
13
+ * import redisPlugin from '@eggjs/redis';
14
+ *
15
+ * export default {
16
+ * ...redisPlugin(),
17
+ * };
18
+ * ```
19
+ */
17
20
  declare const _default: EggPluginFactory;
18
- export default _default;
21
+ //#endregion
22
+ export { _default as default };
package/dist/index.js CHANGED
@@ -1,22 +1,25 @@
1
- import "./types.js";
2
- import { definePluginFactory } from 'egg';
1
+ import { definePluginFactory } from "egg";
2
+
3
+ //#region src/index.ts
3
4
  /**
4
- * Redis plugin
5
- *
6
- * @since 4.1.0
7
- * Usage:
8
- * ```ts
9
- * // config/plugin.ts
10
- * import redisPlugin from '@eggjs/redis';
11
- *
12
- * export default {
13
- * ...redisPlugin(),
14
- * };
15
- * ```
16
- */
17
- export default definePluginFactory({
18
- name: 'redis',
19
- enable: true,
20
- path: import.meta.dirname,
5
+ * Redis plugin
6
+ *
7
+ * @since 4.1.0
8
+ * Usage:
9
+ * ```ts
10
+ * // config/plugin.ts
11
+ * import redisPlugin from '@eggjs/redis';
12
+ *
13
+ * export default {
14
+ * ...redisPlugin(),
15
+ * };
16
+ * ```
17
+ */
18
+ var src_default = definePluginFactory({
19
+ name: "redis",
20
+ enable: true,
21
+ path: import.meta.dirname
21
22
  });
22
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxZQUFZLENBQUM7QUFDcEIsT0FBTyxFQUFFLG1CQUFtQixFQUF5QixNQUFNLEtBQUssQ0FBQztBQUVqRTs7Ozs7Ozs7Ozs7OztHQWFHO0FBQ0gsZUFBZSxtQkFBbUIsQ0FBQztJQUNqQyxJQUFJLEVBQUUsT0FBTztJQUNiLE1BQU0sRUFBRSxJQUFJO0lBQ1osSUFBSSxFQUFFLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTztDQUMxQixDQUFxQixDQUFDIn0=
23
+
24
+ //#endregion
25
+ export { src_default as default };
@@ -1,6 +1,10 @@
1
- import type { ILifecycleBoot, EggApplicationCore } from 'egg';
2
- export declare class RedisBoot implements ILifecycleBoot {
3
- private readonly app;
4
- constructor(app: EggApplicationCore);
5
- didLoad(): Promise<void>;
1
+ import { EggApplicationCore, ILifecycleBoot } from "egg";
2
+
3
+ //#region src/lib/redis.d.ts
4
+ declare class RedisBoot implements ILifecycleBoot {
5
+ private readonly app;
6
+ constructor(app: EggApplicationCore);
7
+ didLoad(): Promise<void>;
6
8
  }
9
+ //#endregion
10
+ export { RedisBoot };
package/dist/lib/redis.js CHANGED
@@ -1,76 +1,66 @@
1
- import assert from 'node:assert';
2
- import { once } from 'node:events';
3
- import { Redis } from 'ioredis';
4
- export class RedisBoot {
5
- app;
6
- constructor(app) {
7
- this.app = app;
8
- }
9
- async didLoad() {
10
- const app = this.app;
11
- if (app.type === 'application' && app.config.redis.app) {
12
- app.addSingleton('redis', createClient);
13
- }
14
- else if (app.type === 'agent' && app.config.redis.agent) {
15
- app.addSingleton('redis', createClient);
16
- }
17
- }
18
- }
1
+ import assert from "node:assert";
2
+ import { once } from "node:events";
3
+ import { Redis } from "ioredis";
4
+
5
+ //#region src/lib/redis.ts
6
+ var RedisBoot = class {
7
+ app;
8
+ constructor(app) {
9
+ this.app = app;
10
+ }
11
+ async didLoad() {
12
+ const app = this.app;
13
+ if (app.type === "application" && app.config.redis.app) app.addSingleton("redis", createClient);
14
+ else if (app.type === "agent" && app.config.redis.agent) app.addSingleton("redis", createClient);
15
+ }
16
+ };
19
17
  let count = 0;
20
18
  function createClient(options, app) {
21
- const RedisClass = app.config.redis.Redis ?? Redis;
22
- let client;
23
- if ('cluster' in options && options.cluster === true) {
24
- const config = options;
25
- assert(config.nodes && config.nodes.length > 0, '[@eggjs/redis] cluster nodes configuration is required when use cluster redis');
26
- for (const client of config.nodes) {
27
- assert(client.host && client.port, `[@eggjs/redis] 'host: ${client.host}', 'port: ${client.port}' are required on config`);
28
- }
29
- app.coreLogger.info('[@eggjs/redis] cluster connecting');
30
- client = new RedisClass.Cluster(config.nodes, config);
31
- }
32
- else if ('sentinels' in options && options.sentinels) {
33
- const config = options;
34
- assert(config.sentinels && config.sentinels.length > 0, '[@eggjs/redis] sentinels configuration is required when use redis sentinel');
35
- for (const sentinel of config.sentinels) {
36
- assert(sentinel.host && sentinel.port, `[@eggjs/redis] 'host: ${sentinel.host}', 'port: ${sentinel.port}' are required on config`);
37
- }
38
- const mask = config.password ? '***' : config.password;
39
- assert(config.name && config.password !== undefined && config.db !== undefined, `[@eggjs/redis] 'name of master: ${config.name}', 'password: ${mask}', 'db: ${config.db}' are required on config`);
40
- app.coreLogger.info('[@eggjs/redis] sentinel connecting start');
41
- client = new RedisClass(config);
42
- }
43
- else {
44
- const config = options;
45
- const mask = config.password ? '***' : config.password;
46
- assert((config.host && config.port && config.password !== undefined && config.db !== undefined) || config.path, `[@eggjs/redis] 'host: ${config.host}', 'port: ${config.port}', 'password: ${mask}', 'db: ${config.db}' or 'path:${config.path}' are required on config`);
47
- if (config.host) {
48
- app.coreLogger.info('[@eggjs/redis] server connecting redis://:***@%s:%s/%s', config.host, config.port, config.db);
49
- }
50
- else {
51
- app.coreLogger.info('[@eggjs/redis] server connecting %s', config.path || config);
52
- }
53
- client = new RedisClass(config);
54
- }
55
- client.on('connect', () => {
56
- app.coreLogger.info('[@eggjs/redis] client connect success');
57
- });
58
- client.on('error', (err) => {
59
- app.coreLogger.error('[@eggjs/redis] client error: %s', err);
60
- app.coreLogger.error(err);
61
- });
62
- const index = count++;
63
- app.lifecycle.registerBeforeStart(async () => {
64
- if ('weakDependent' in options && options.weakDependent) {
65
- app.coreLogger.info(`[@eggjs/redis] instance[${index}] is weak dependent and won't block app start`);
66
- client.once('ready', () => {
67
- app.coreLogger.info(`[@eggjs/redis] instance[${index}] status OK`);
68
- });
69
- return;
70
- }
71
- await Promise.race([once(client, 'ready'), once(client, 'error')]);
72
- app.coreLogger.info(`[@eggjs/redis] instance[${index}] status OK, client ready`);
73
- }, `[@eggjs/redis] instance[${index}] start check`);
74
- return client;
19
+ const RedisClass = app.config.redis.Redis ?? Redis;
20
+ let client;
21
+ if ("cluster" in options && options.cluster === true) {
22
+ const config = options;
23
+ assert(config.nodes && config.nodes.length > 0, "[@eggjs/redis] cluster nodes configuration is required when use cluster redis");
24
+ for (const client$1 of config.nodes) assert(client$1.host && client$1.port, `[@eggjs/redis] 'host: ${client$1.host}', 'port: ${client$1.port}' are required on config`);
25
+ app.coreLogger.info("[@eggjs/redis] cluster connecting");
26
+ client = new RedisClass.Cluster(config.nodes, config);
27
+ } else if ("sentinels" in options && options.sentinels) {
28
+ const config = options;
29
+ assert(config.sentinels && config.sentinels.length > 0, "[@eggjs/redis] sentinels configuration is required when use redis sentinel");
30
+ for (const sentinel of config.sentinels) assert(sentinel.host && sentinel.port, `[@eggjs/redis] 'host: ${sentinel.host}', 'port: ${sentinel.port}' are required on config`);
31
+ const mask = config.password ? "***" : config.password;
32
+ assert(config.name && config.password !== void 0 && config.db !== void 0, `[@eggjs/redis] 'name of master: ${config.name}', 'password: ${mask}', 'db: ${config.db}' are required on config`);
33
+ app.coreLogger.info("[@eggjs/redis] sentinel connecting start");
34
+ client = new RedisClass(config);
35
+ } else {
36
+ const config = options;
37
+ const mask = config.password ? "***" : config.password;
38
+ assert(config.host && config.port && config.password !== void 0 && config.db !== void 0 || config.path, `[@eggjs/redis] 'host: ${config.host}', 'port: ${config.port}', 'password: ${mask}', 'db: ${config.db}' or 'path:${config.path}' are required on config`);
39
+ if (config.host) app.coreLogger.info("[@eggjs/redis] server connecting redis://:***@%s:%s/%s", config.host, config.port, config.db);
40
+ else app.coreLogger.info("[@eggjs/redis] server connecting %s", config.path || config);
41
+ client = new RedisClass(config);
42
+ }
43
+ client.on("connect", () => {
44
+ app.coreLogger.info("[@eggjs/redis] client connect success");
45
+ });
46
+ client.on("error", (err) => {
47
+ app.coreLogger.error("[@eggjs/redis] client error: %s", err);
48
+ app.coreLogger.error(err);
49
+ });
50
+ const index = count++;
51
+ app.lifecycle.registerBeforeStart(async () => {
52
+ if ("weakDependent" in options && options.weakDependent) {
53
+ app.coreLogger.info(`[@eggjs/redis] instance[${index}] is weak dependent and won't block app start`);
54
+ client.once("ready", () => {
55
+ app.coreLogger.info(`[@eggjs/redis] instance[${index}] status OK`);
56
+ });
57
+ return;
58
+ }
59
+ await Promise.race([once(client, "ready"), once(client, "error")]);
60
+ app.coreLogger.info(`[@eggjs/redis] instance[${index}] status OK, client ready`);
61
+ }, `[@eggjs/redis] instance[${index}] start check`);
62
+ return client;
75
63
  }
76
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVkaXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbGliL3JlZGlzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sTUFBTSxNQUFNLGFBQWEsQ0FBQ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VLENBQUMsSUFBSSxDQUFDLDJCQUEyQixLQUFLLCtDQUErQyxDQUFDLENBQUM7WUFDckcsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLEVBQUUsR0FBRyxFQUFFO2dCQUN4QixHQUFHLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQywyQkFBMkIsS0FBSyxhQUFhLENBQUMsQ0FBQztZQUNyRSxDQUFDLENBQUMsQ0FBQztZQUNILE9BQU87UUFDVCxDQUFDO1FBRUQsTUFBTSxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUMsSUFBSSxDQUFDLE1BQU0sRUFBRSxPQUFPLENBQUMsRUFBRSxJQUFJLENBQUMsTUFBTSxFQUFFLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUNuRSxHQUFHLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQywyQkFBMkIsS0FBSywyQkFBMkIsQ0FBQyxDQUFDO0lBQ25GLENBQUMsRUFBRSwyQkFBMkIsS0FBSyxlQUFlLENBQUMsQ0FBQztJQUVwRCxPQUFPLE1BQU0sQ0FBQztBQUNoQixDQUFDIn0=
64
+
65
+ //#endregion
66
+ export { RedisBoot };
package/dist/types.d.ts CHANGED
@@ -1,14 +1,16 @@
1
- import type { Singleton } from 'egg';
2
- import type { Redis } from 'ioredis';
3
- import type { RedisConfig } from './config/config.default.ts';
4
- declare module 'egg' {
5
- interface EggAppConfig {
6
- /**
7
- * Redis plugin config
8
- */
9
- redis: RedisConfig;
10
- }
11
- interface EggApplicationCore {
12
- redis: Redis & Singleton<Redis>;
13
- }
14
- }
1
+ import { RedisConfig } from "./config/config.default.js";
2
+ import { Redis } from "ioredis";
3
+ import { Singleton } from "egg";
4
+
5
+ //#region src/types.d.ts
6
+ declare module "egg" {
7
+ interface EggAppConfig {
8
+ /**
9
+ * Redis plugin config
10
+ */
11
+ redis: RedisConfig;
12
+ }
13
+ interface EggApplicationCore {
14
+ redis: Redis & Singleton<Redis>;
15
+ }
16
+ }
package/dist/types.js CHANGED
@@ -1,2 +1 @@
1
- export {};
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
1
+ export { };
package/package.json CHANGED
@@ -1,70 +1,63 @@
1
1
  {
2
2
  "name": "@eggjs/redis",
3
- "version": "4.0.0-beta.35",
3
+ "version": "4.0.0-beta.36",
4
4
  "description": "Valkey / Redis plugin for egg",
5
- "type": "module",
6
- "exports": {
7
- ".": "./dist/index.js",
8
- "./agent": "./dist/agent.js",
9
- "./app": "./dist/app.js",
10
- "./config/config.default": "./dist/config/config.default.js",
11
- "./lib/redis": "./dist/lib/redis.js",
12
- "./types": "./dist/types.js",
13
- "./package.json": "./package.json"
14
- },
15
- "publishConfig": {
16
- "access": "public"
17
- },
18
- "files": [
19
- "dist"
20
- ],
21
5
  "keywords": [
6
+ "Valkey",
7
+ "database",
22
8
  "egg",
23
- "eggPlugin",
24
9
  "egg-plugin",
25
- "redis",
26
- "Valkey",
27
- "database"
10
+ "eggPlugin",
11
+ "redis"
28
12
  ],
29
- "license": "MIT",
30
13
  "homepage": "https://github.com/eggjs/egg/tree/next/plugins/redis",
31
14
  "bugs": {
32
15
  "url": "https://github.com/eggjs/egg/issues"
33
16
  },
17
+ "license": "MIT",
18
+ "author": "jtyjty99999",
34
19
  "repository": {
35
20
  "type": "git",
36
21
  "url": "git+https://github.com/eggjs/egg.git",
37
22
  "directory": "plugins/redis"
38
23
  },
39
- "author": "jtyjty99999",
40
- "engines": {
41
- "node": ">= 22.18.0"
24
+ "files": [
25
+ "dist"
26
+ ],
27
+ "type": "module",
28
+ "main": "./dist/index.js",
29
+ "module": "./dist/index.js",
30
+ "types": "./dist/index.d.ts",
31
+ "exports": {
32
+ ".": "./dist/index.js",
33
+ "./agent": "./dist/agent.js",
34
+ "./app": "./dist/app.js",
35
+ "./config/config.default": "./dist/config/config.default.js",
36
+ "./lib/redis": "./dist/lib/redis.js",
37
+ "./types": "./dist/types.js",
38
+ "./package.json": "./package.json"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
42
  },
43
43
  "dependencies": {
44
44
  "ioredis": "^5.4.2"
45
45
  },
46
- "peerDependencies": {
47
- "egg": "4.1.0-beta.35"
48
- },
49
46
  "devDependencies": {
50
- "@types/node": "^24.10.1",
47
+ "@types/node": "^24.10.2",
51
48
  "detect-port": "^2.1.0",
52
- "oxlint": "^1.31.0",
53
- "rimraf": "^6.1.2",
54
- "tsdown": "^0.17.0",
55
49
  "typescript": "^5.9.3",
56
- "vitest": "^4.0.15",
57
- "@eggjs/tsconfig": "3.1.0-beta.35",
58
- "egg": "4.1.0-beta.35",
59
- "@eggjs/mock": "7.0.0-beta.35"
50
+ "@eggjs/mock": "7.0.0-beta.36",
51
+ "@eggjs/tsconfig": "3.1.0-beta.36",
52
+ "egg": "4.1.0-beta.36"
53
+ },
54
+ "peerDependencies": {
55
+ "egg": "4.1.0-beta.36"
56
+ },
57
+ "engines": {
58
+ "node": ">= 22.18.0"
60
59
  },
61
- "main": "./dist/index.js",
62
- "module": "./dist/index.js",
63
- "types": "./dist/index.d.ts",
64
60
  "scripts": {
65
- "build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
66
- "typecheck": "tsc --noEmit",
67
- "lint": "oxlint --type-aware",
68
- "test": "vitest run"
61
+ "typecheck": "tsgo --noEmit"
69
62
  }
70
63
  }