koatty_schedule 3.3.3 → 3.3.7
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/.rollup.config.js +5 -2
- package/.turbo/turbo-build.log +95 -0
- package/CHANGELOG.md +70 -35
- package/dist/index.d.ts +1 -1
- package/dist/index.js +45 -46
- package/dist/index.mjs +45 -46
- package/dist/package.json +14 -19
- package/package.json +25 -31
- package/rollup.config-1769572274826.cjs +67 -0
package/.rollup.config.js
CHANGED
|
@@ -46,9 +46,12 @@ export default [
|
|
|
46
46
|
compilerOptions: {
|
|
47
47
|
declaration: false,
|
|
48
48
|
declarationMap: false,
|
|
49
|
-
module: "ESNext"
|
|
49
|
+
module: "ESNext",
|
|
50
|
+
skipLibCheck: true
|
|
50
51
|
}
|
|
51
|
-
}
|
|
52
|
+
},
|
|
53
|
+
useTsconfigDeclarationDir: false,
|
|
54
|
+
check: false
|
|
52
55
|
})
|
|
53
56
|
],
|
|
54
57
|
external: [
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> koatty_schedule@3.3.7 build /Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty-schedule
|
|
4
|
+
> npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
> koatty_schedule@3.3.7 build:js
|
|
8
|
+
> npx rollup --bundleConfigAsCjs -c .rollup.config.js
|
|
9
|
+
|
|
10
|
+
[1G[0K[1G[0K[36m
|
|
11
|
+
[1m./src/index.ts[22m → [1m./dist/index.js, ./dist/index.mjs[22m...[39m
|
|
12
|
+
[32mcreated [1m./dist/index.js, ./dist/index.mjs[22m in [1m3.7s[22m[39m
|
|
13
|
+
[1G[0K⠙[1G[0K[1G[0K⠙[1G[0K
|
|
14
|
+
> koatty_schedule@3.3.7 build:dts
|
|
15
|
+
> bash ../../scripts/build-dts.sh
|
|
16
|
+
|
|
17
|
+
[1G[0K🔨 Building type declarations for koatty-schedule...
|
|
18
|
+
⏳ Waiting for dependencies to be ready...
|
|
19
|
+
|
|
20
|
+
🔍 Checking dependencies: koatty_container, koatty_core, koatty_lib, koatty_logger, koatty_store
|
|
21
|
+
✓ koatty_core type declarations ready
|
|
22
|
+
✓ koatty_lib type declarations ready
|
|
23
|
+
✓ koatty_logger type declarations ready
|
|
24
|
+
✓ koatty_store type declarations ready
|
|
25
|
+
⏳ Waiting for: koatty_container (0s)
|
|
26
|
+
✗ koatty_container: not found
|
|
27
|
+
⏳ Waiting for: koatty_container (5s)
|
|
28
|
+
✗ koatty_container: missing .d.ts
|
|
29
|
+
✓ koatty_container type declarations ready
|
|
30
|
+
|
|
31
|
+
✅ All dependencies ready (waited 7530ms)
|
|
32
|
+
📝 Running TypeScript compiler...
|
|
33
|
+
[1G[0K[1G[0K⠙[1G[0K📦 Running API Extractor...
|
|
34
|
+
[1G[0K⠙[1G[0K
|
|
35
|
+
[1mapi-extractor 7.55.2 [36m - https://api-extractor.com/[39m
|
|
36
|
+
[22m
|
|
37
|
+
Using configuration from ./api-extractor.json
|
|
38
|
+
Analysis will use the bundled TypeScript version 5.8.2
|
|
39
|
+
*** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
|
|
40
|
+
[36mWriting: /Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty-schedule/temp/koatty_schedule.api.json[39m
|
|
41
|
+
[36mWriting package typings: /Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty-schedule/dist/index.d.ts[39m
|
|
42
|
+
[33mWarning: src/decorator/redlock.ts:18:4 - (tsdoc-undefined-tag) The TSDoc tag "@export" is not defined in this configuration[39m
|
|
43
|
+
[33mWarning: src/decorator/redlock.ts:19:20 - (tsdoc-param-tag-with-invalid-optional-name) The @param should not include a JSDoc-style optional name; it must not be enclosed in '[ ]' brackets.[39m
|
|
44
|
+
[33mWarning: src/decorator/redlock.ts:19:11 - (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}'[39m
|
|
45
|
+
[33mWarning: src/decorator/redlock.ts:22:34 - (tsdoc-param-tag-with-invalid-optional-name) The @param should not include a JSDoc-style optional name; it must not be enclosed in '[ ]' brackets.[39m
|
|
46
|
+
[33mWarning: src/decorator/redlock.ts:22:11 - (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}'[39m
|
|
47
|
+
[33mWarning: src/decorator/redlock.ts:24:29 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag[39m
|
|
48
|
+
[33mWarning: src/decorator/redlock.ts:24:13 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@"[39m
|
|
49
|
+
[33mWarning: src/decorator/redlock.ts:25:18 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag[39m
|
|
50
|
+
[33mWarning: src/decorator/redlock.ts:25:12 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@"[39m
|
|
51
|
+
[33mWarning: src/decorator/redlock.ts:42:1 - (ae-forgotten-export) The symbol "RedLockMethodOptions" needs to be exported by the entry point index.d.ts[39m
|
|
52
|
+
[33mWarning: src/decorator/scheduled.ts:18:4 - (tsdoc-undefined-tag) The TSDoc tag "@export" is not defined in this configuration[39m
|
|
53
|
+
[33mWarning: src/decorator/scheduled.ts:19:11 - (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}'[39m
|
|
54
|
+
[33mWarning: src/decorator/scheduled.ts:20:20 - (tsdoc-param-tag-with-invalid-optional-name) The @param should not include a JSDoc-style optional name; it must not be enclosed in '[ ]' brackets.[39m
|
|
55
|
+
[33mWarning: src/decorator/scheduled.ts:20:11 - (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}'[39m
|
|
56
|
+
[33mWarning: src/decorator/scheduled.ts:30:29 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag[39m
|
|
57
|
+
[33mWarning: src/decorator/scheduled.ts:30:13 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@"[39m
|
|
58
|
+
[33mWarning: src/decorator/scheduled.ts:31:18 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag[39m
|
|
59
|
+
[33mWarning: src/decorator/scheduled.ts:31:12 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@"[39m
|
|
60
|
+
[33mWarning: src/index.ts:62:1 - (ae-forgotten-export) The symbol "ScheduledOptions" needs to be exported by the entry point index.d.ts[39m
|
|
61
|
+
[33mWarning: src/locker/interface.ts:50:1 - (ae-forgotten-export) The symbol "BaseRedisConfig" needs to be exported by the entry point index.d.ts[39m
|
|
62
|
+
[33mWarning: src/locker/redlock.ts:79:6 - (tsdoc-undefined-tag) The TSDoc tag "@private" is not defined in this configuration[39m
|
|
63
|
+
[33mWarning: src/locker/redlock.ts:96:6 - (tsdoc-undefined-tag) The TSDoc tag "@static" is not defined in this configuration[39m
|
|
64
|
+
[33mWarning: src/locker/redlock.ts:132:6 - (tsdoc-undefined-tag) The TSDoc tag "@static" is not defined in this configuration[39m
|
|
65
|
+
[33mWarning: src/locker/redlock.ts:146:6 - (tsdoc-undefined-tag) The TSDoc tag "@private" is not defined in this configuration[39m
|
|
66
|
+
[33mWarning: src/locker/redlock.ts:177:6 - (tsdoc-undefined-tag) The TSDoc tag "@private" is not defined in this configuration[39m
|
|
67
|
+
|
|
68
|
+
API Extractor completed successfully
|
|
69
|
+
[1G[0K⠙[1G[0K✅ Type declarations built successfully
|
|
70
|
+
[1G[0K⠙[1G[0K
|
|
71
|
+
> koatty_schedule@3.3.7 build:doc
|
|
72
|
+
> npx api-documenter markdown --input temp --output docs/api
|
|
73
|
+
|
|
74
|
+
[1G[0K[1G[0K⠙[1G[0K
|
|
75
|
+
[1mapi-documenter 7.28.2 [36m - https://api-extractor.com/[39m
|
|
76
|
+
[22m
|
|
77
|
+
Reading koatty_schedule.api.json
|
|
78
|
+
|
|
79
|
+
Deleting old output from docs/api
|
|
80
|
+
Writing koatty_schedule package
|
|
81
|
+
Unsupported block tag: @export
|
|
82
|
+
Unsupported block tag: @static
|
|
83
|
+
Unsupported block tag: @private
|
|
84
|
+
Unsupported block tag: @static
|
|
85
|
+
Unsupported block tag: @static
|
|
86
|
+
Unsupported block tag: @private
|
|
87
|
+
Unsupported block tag: @static
|
|
88
|
+
Unsupported block tag: @export
|
|
89
|
+
Unsupported block tag: @export
|
|
90
|
+
Unsupported block tag: @export
|
|
91
|
+
[1G[0K⠙[1G[0K[1G[0K⠙[1G[0K
|
|
92
|
+
> koatty_schedule@3.3.7 build:cp
|
|
93
|
+
> node scripts/postBuild && npx copyfiles package.json LICENSE README.md dist/
|
|
94
|
+
|
|
95
|
+
[1G[0K[1G[0K⠙[1G[0K[1G[0K⠙[1G[0K[1G[0K⠙[1G[0K
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.3.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- build
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- koatty_container@1.17.4
|
|
10
|
+
- koatty_core@2.0.14
|
|
11
|
+
- koatty_lib@1.4.5
|
|
12
|
+
- koatty_logger@2.3.4
|
|
13
|
+
- koatty_store@1.9.4
|
|
14
|
+
|
|
15
|
+
## 3.3.6
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- build
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
- koatty_container@1.17.3
|
|
22
|
+
- koatty_core@2.0.13
|
|
23
|
+
- koatty_lib@1.4.4
|
|
24
|
+
- koatty_logger@2.3.3
|
|
25
|
+
- koatty_store@1.9.3
|
|
26
|
+
|
|
27
|
+
## 3.3.5
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- build
|
|
32
|
+
- Updated dependencies
|
|
33
|
+
- koatty_container@1.17.2
|
|
34
|
+
- koatty_lib@1.4.3
|
|
35
|
+
- koatty_logger@2.3.2
|
|
36
|
+
- koatty_store@1.9.2
|
|
37
|
+
- koatty_core@2.0.12
|
|
38
|
+
|
|
39
|
+
## 3.3.4
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- Updated dependencies
|
|
44
|
+
- koatty_lib@1.4.2
|
|
45
|
+
- koatty_container@1.17.1
|
|
46
|
+
- koatty_core@2.0.11
|
|
47
|
+
- koatty_logger@2.3.1
|
|
48
|
+
- koatty_store@1.9.1
|
|
49
|
+
|
|
3
50
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
51
|
|
|
5
52
|
### [3.3.3](https://github.com/thinkkoa/koatty_schedule/compare/v3.3.2...v3.3.3) (2025-10-31)
|
|
@@ -8,27 +55,24 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
8
55
|
|
|
9
56
|
### [3.3.1](https://github.com/thinkkoa/koatty_schedule/compare/v3.3.0...v3.3.1) (2025-06-22)
|
|
10
57
|
|
|
11
|
-
|
|
12
58
|
### Bug Fixes
|
|
13
59
|
|
|
14
|
-
|
|
60
|
+
- unify component type constant to 'COMPONENT' string literal in IOCContainer registration ([7098c7e](https://github.com/thinkkoa/koatty_schedule/commit/7098c7e2c326a6461b6b8b5c84d07a3ced75de5f))
|
|
15
61
|
|
|
16
62
|
## [3.3.0](https://github.com/thinkkoa/koatty_schedule/compare/v3.2.0...v3.3.0) (2025-06-22)
|
|
17
63
|
|
|
18
|
-
|
|
19
64
|
### Features
|
|
20
65
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
66
|
+
- enhance distributed locking and scheduling system with global configuration management and improved validation ([79a10f5](https://github.com/thinkkoa/koatty_schedule/commit/79a10f5a1ac66958aa44d3ea9151a65826748724))
|
|
67
|
+
- improve RedLock singleton management with thread-safe initialization and lock renewal enhancements ([ec426aa](https://github.com/thinkkoa/koatty_schedule/commit/ec426aae3cd0d824661b1b94ae8043bf66ace606))
|
|
68
|
+
- introduce component-specific metadata keys for scheduled and redlock decorators ([173e79a](https://github.com/thinkkoa/koatty_schedule/commit/173e79ac916c13b20c93d2efac7e69009cc5cf32))
|
|
69
|
+
- refactor RedLock configuration and remove deprecated ScheduleConfig ([7bd4667](https://github.com/thinkkoa/koatty_schedule/commit/7bd4667242c6fd07cfd58a4322d93f4c4548100a))
|
|
70
|
+
- update decorator types to support symbol property keys and improve IOC container integration ([f7b6382](https://github.com/thinkkoa/koatty_schedule/commit/f7b6382e855914176c130b10a769b03cc74c0f23))
|
|
71
|
+
- use dynamic componentType instead of hardcoded constants for IOCContainer registration ([42ca073](https://github.com/thinkkoa/koatty_schedule/commit/42ca07353a8082b1af9e49d43914497d41cddd27))
|
|
28
72
|
|
|
29
73
|
### Bug Fixes
|
|
30
74
|
|
|
31
|
-
|
|
75
|
+
- 修复 IOC 容器元数据键格式不匹配问题 ([644714f](https://github.com/thinkkoa/koatty_schedule/commit/644714f20497196fb705e551880a9ef527257cb7))
|
|
32
76
|
|
|
33
77
|
### [2.1.1](https://github.com/thinkkoa/koatty_schedule/compare/v2.1.0...v2.1.1) (2025-06-09)
|
|
34
78
|
|
|
@@ -36,60 +80,52 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
36
80
|
|
|
37
81
|
## [3.2.0](https://github.com/thinkkoa/koatty_schedule/compare/v3.1.0...v3.2.0) (2025-06-22)
|
|
38
82
|
|
|
39
|
-
|
|
40
83
|
### Features
|
|
41
84
|
|
|
42
|
-
|
|
43
|
-
|
|
85
|
+
- introduce component-specific metadata keys for scheduled and redlock decorators ([803b350](https://github.com/thinkkoa/koatty_schedule/commit/803b3503489c02ab138b3f9f14cb520dd6c7fec4))
|
|
44
86
|
|
|
45
87
|
### Bug Fixes
|
|
46
88
|
|
|
47
|
-
|
|
89
|
+
- 修复 IOC 容器元数据键格式不匹配问题 ([065d456](https://github.com/thinkkoa/koatty_schedule/commit/065d456fc65004e25eb19838da96bf0a52cb2af1))
|
|
48
90
|
|
|
49
91
|
## [3.1.0](https://github.com/thinkkoa/koatty_schedule/compare/v3.0.0...v3.1.0) (2025-06-21)
|
|
50
92
|
|
|
51
|
-
|
|
52
93
|
### Features
|
|
53
94
|
|
|
54
|
-
|
|
95
|
+
- update decorator types to support symbol property keys and improve IOC container integration ([a60ef3e](https://github.com/thinkkoa/koatty_schedule/commit/a60ef3e361b245f97ba0d6ee51d42efd437a1252))
|
|
55
96
|
|
|
56
97
|
## [3.0.0](https://github.com/thinkkoa/koatty_schedule/compare/v2.1.0...v3.0.0) (2025-06-21)
|
|
57
98
|
|
|
58
|
-
|
|
59
99
|
### Features
|
|
60
100
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
101
|
+
- enhance distributed locking and scheduling system with global configuration management and improved validation ([cf3924c](https://github.com/thinkkoa/koatty_schedule/commit/cf3924cf6bccf951f070c68e33483ae935828382))
|
|
102
|
+
- improve RedLock singleton management with thread-safe initialization and lock renewal enhancements ([4e381cd](https://github.com/thinkkoa/koatty_schedule/commit/4e381cd8eec6aa366a6db813918f213f07b02921))
|
|
103
|
+
- refactor RedLock configuration and remove deprecated ScheduleConfig ([bb10ac7](https://github.com/thinkkoa/koatty_schedule/commit/bb10ac7dab67d32ca75a43db92c587a662bc1b9f))
|
|
64
104
|
|
|
65
105
|
## [2.1.0](https://github.com/thinkkoa/koatty_schedule/compare/v2.0.1...v2.1.0) (2025-06-09)
|
|
66
106
|
|
|
67
|
-
|
|
68
107
|
### Features
|
|
69
108
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
109
|
+
- add schedule and redlock decorators with config management ([c1b5359](https://github.com/thinkkoa/koatty_schedule/commit/c1b535940df2b8a3403bf024137519246945870e))
|
|
110
|
+
- enhance ConfigManager with singleton pattern, environment config loading ([00db6eb](https://github.com/thinkkoa/koatty_schedule/commit/00db6eb97bdae226aaf433b23c770704b33d05e8))
|
|
111
|
+
- introduce DecoratorType enum, refactor decorator management system, ([e58e718](https://github.com/thinkkoa/koatty_schedule/commit/e58e718975e663820778352bedb6421e6852ba9f))
|
|
74
112
|
|
|
75
113
|
### Bug Fixes
|
|
76
114
|
|
|
77
|
-
|
|
78
|
-
|
|
115
|
+
- simplify error handling in ConfigManager and RedLocker ([7be75fc](https://github.com/thinkkoa/koatty_schedule/commit/7be75fc7f4160094b57ca64905df4c81f77adb51))
|
|
79
116
|
|
|
80
117
|
### Refactor
|
|
81
118
|
|
|
82
|
-
|
|
119
|
+
- use MethodDecoratorManager ([ff077c7](https://github.com/thinkkoa/koatty_schedule/commit/ff077c7211bb6cf258c6885e1d7dcbdacde90ef1))
|
|
83
120
|
|
|
84
121
|
### [2.0.1](https://github.com/thinkkoa/koatty_schedule/compare/v2.0.0...v2.0.1) (2024-01-17)
|
|
85
122
|
|
|
86
123
|
## [2.0.0](https://github.com/thinkkoa/koatty_schedule/compare/v1.6.0...v2.0.0) (2024-01-17)
|
|
87
124
|
|
|
88
|
-
|
|
89
125
|
### Refactor
|
|
90
126
|
|
|
91
|
-
|
|
92
|
-
|
|
127
|
+
- redlock ([beb7cd9](https://github.com/thinkkoa/koatty_schedule/commit/beb7cd90878319cb1c480f4ad11b2632c184872b))
|
|
128
|
+
- redlock ([ea29337](https://github.com/thinkkoa/koatty_schedule/commit/ea29337052aee081322918914876a95923d314ae))
|
|
93
129
|
|
|
94
130
|
## [1.6.0](https://github.com/thinkkoa/koatty_schedule/compare/v1.5.11...v1.6.0) (2023-12-20)
|
|
95
131
|
|
|
@@ -101,11 +137,10 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
101
137
|
|
|
102
138
|
### [1.5.7](https://github.com/thinkkoa/koatty_schedule/compare/v1.5.6...v1.5.7) (2022-09-05)
|
|
103
139
|
|
|
104
|
-
|
|
105
140
|
### Bug Fixes
|
|
106
141
|
|
|
107
|
-
|
|
108
|
-
|
|
142
|
+
- update ([8eb40be](https://github.com/thinkkoa/koatty_schedule/commit/8eb40be4f0778d218a2a8b9a9370ffbe26c9e884))
|
|
143
|
+
- upgrade deps ([51a68af](https://github.com/thinkkoa/koatty_schedule/commit/51a68af12437a08e3a5468b27b57ae597f66695d))
|
|
109
144
|
|
|
110
145
|
### [1.5.6](https://github.com/thinkkoa/koatty_schedule/compare/v1.5.5...v1.5.6) (2022-05-27)
|
|
111
146
|
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @Author: richen
|
|
3
|
-
* @Date:
|
|
3
|
+
* @Date: 2026-01-28 17:27:51
|
|
4
4
|
* @License: BSD (3-Clause)
|
|
5
5
|
* @Copyright (c) - <richenlin(at)gmail.com>
|
|
6
6
|
* @HomePage: https://koatty.org/
|
|
@@ -197,10 +197,10 @@ function getEffectiveTimezone(options, userTimezone) {
|
|
|
197
197
|
function getEffectiveRedLockOptions(methodOptions) {
|
|
198
198
|
const globalOptions = getGlobalScheduledOptions();
|
|
199
199
|
return {
|
|
200
|
-
lockTimeOut: methodOptions
|
|
201
|
-
clockDriftFactor: methodOptions
|
|
202
|
-
maxRetries: methodOptions
|
|
203
|
-
retryDelayMs: methodOptions
|
|
200
|
+
lockTimeOut: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.lockTimeOut) || globalOptions.lockTimeOut || 10000,
|
|
201
|
+
clockDriftFactor: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.clockDriftFactor) || globalOptions.clockDriftFactor || 0.01,
|
|
202
|
+
maxRetries: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.maxRetries) || globalOptions.maxRetries || 3,
|
|
203
|
+
retryDelayMs: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.retryDelayMs) || globalOptions.retryDelayMs || 200
|
|
204
204
|
};
|
|
205
205
|
}
|
|
206
206
|
|
|
@@ -237,7 +237,6 @@ exports.RedisMode = void 0;
|
|
|
237
237
|
* Wraps ioredis client to provide unified interface
|
|
238
238
|
*/
|
|
239
239
|
class RedisClientAdapter {
|
|
240
|
-
client;
|
|
241
240
|
constructor(client) {
|
|
242
241
|
this.client = client;
|
|
243
242
|
}
|
|
@@ -374,11 +373,12 @@ class RedisFactory {
|
|
|
374
373
|
* @param config - Cluster configuration
|
|
375
374
|
*/
|
|
376
375
|
static createClusterClient(config) {
|
|
376
|
+
var _a, _b;
|
|
377
377
|
koatty_logger.DefaultLogger.Debug(`Creating cluster Redis client with ${config.nodes.length} nodes`);
|
|
378
378
|
const clusterOptions = {
|
|
379
379
|
redisOptions: {
|
|
380
|
-
password: config.redisOptions
|
|
381
|
-
db: config.redisOptions
|
|
380
|
+
password: ((_a = config.redisOptions) === null || _a === void 0 ? void 0 : _a.password) || config.password || undefined,
|
|
381
|
+
db: ((_b = config.redisOptions) === null || _b === void 0 ? void 0 : _b.db) || config.db || 0,
|
|
382
382
|
keyPrefix: config.keyPrefix || '',
|
|
383
383
|
connectTimeout: config.connectTimeout || 10000,
|
|
384
384
|
commandTimeout: config.commandTimeout || 5000,
|
|
@@ -491,15 +491,12 @@ const defaultRedlockSettings = {
|
|
|
491
491
|
* Implements IDistributedLock interface for abstraction
|
|
492
492
|
*/
|
|
493
493
|
class RedLocker {
|
|
494
|
-
static instance = null;
|
|
495
|
-
static instanceLock = Symbol('RedLocker.instanceLock');
|
|
496
|
-
redlock = null;
|
|
497
|
-
redisClient = null;
|
|
498
|
-
config;
|
|
499
|
-
isInitialized = false;
|
|
500
|
-
initializationPromise = null;
|
|
501
494
|
// 私有构造函数防止外部直接实例化
|
|
502
495
|
constructor(options) {
|
|
496
|
+
this.redlock = null;
|
|
497
|
+
this.redisClient = null;
|
|
498
|
+
this.isInitialized = false;
|
|
499
|
+
this.initializationPromise = null;
|
|
503
500
|
this.config = { ...defaultRedLockConfig, ...options };
|
|
504
501
|
// Register this instance in IOC container
|
|
505
502
|
this.registerInContainer();
|
|
@@ -815,16 +812,17 @@ class RedLocker {
|
|
|
815
812
|
* @returns Health status
|
|
816
813
|
*/
|
|
817
814
|
async healthCheck() {
|
|
815
|
+
var _a, _b;
|
|
818
816
|
try {
|
|
819
817
|
await this.initialize();
|
|
820
|
-
const redisStatus = this.redisClient
|
|
818
|
+
const redisStatus = ((_a = this.redisClient) === null || _a === void 0 ? void 0 : _a.status) || 'unknown';
|
|
821
819
|
const isReady = this.isReady();
|
|
822
820
|
return {
|
|
823
821
|
status: isReady ? 'healthy' : 'unhealthy',
|
|
824
822
|
details: {
|
|
825
823
|
initialized: this.isInitialized,
|
|
826
824
|
redisStatus,
|
|
827
|
-
redisMode: this.config.redisConfig
|
|
825
|
+
redisMode: ((_b = this.config.redisConfig) === null || _b === void 0 ? void 0 : _b.mode) || 'unknown',
|
|
828
826
|
redlockReady: !!this.redlock,
|
|
829
827
|
containerRegistered: this.getContainerInfo().registered
|
|
830
828
|
}
|
|
@@ -841,6 +839,8 @@ class RedLocker {
|
|
|
841
839
|
}
|
|
842
840
|
}
|
|
843
841
|
}
|
|
842
|
+
RedLocker.instance = null;
|
|
843
|
+
RedLocker.instanceLock = Symbol('RedLocker.instanceLock');
|
|
844
844
|
|
|
845
845
|
/*
|
|
846
846
|
* @Description:
|
|
@@ -890,21 +890,19 @@ async function initRedLock(options, app) {
|
|
|
890
890
|
koatty_logger.DefaultLogger.Warn(`RedLock initialization skipped: Koatty app not available or not initialized`);
|
|
891
891
|
return;
|
|
892
892
|
}
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
throw Error(`Missing RedLock configuration. Please write a configuration item with the key name 'RedLock' in the db.ts file.`);
|
|
897
|
-
}
|
|
898
|
-
// 获取RedLocker实例,在首次使用时自动初始化
|
|
899
|
-
const redLocker = RedLocker.getInstance(options);
|
|
900
|
-
await redLocker.initialize();
|
|
901
|
-
koatty_logger.DefaultLogger.Info('RedLock initialized successfully');
|
|
902
|
-
}
|
|
903
|
-
catch (error) {
|
|
904
|
-
koatty_logger.DefaultLogger.Error('Failed to initialize RedLock:', error);
|
|
905
|
-
throw error;
|
|
893
|
+
try {
|
|
894
|
+
if (koatty_lib.Helper.isEmpty(options)) {
|
|
895
|
+
throw Error(`Missing RedLock configuration. Please write a configuration item with the key name 'RedLock' in the db.ts file.`);
|
|
906
896
|
}
|
|
907
|
-
|
|
897
|
+
// 获取RedLocker实例,在首次使用时自动初始化
|
|
898
|
+
const redLocker = RedLocker.getInstance(options);
|
|
899
|
+
await redLocker.initialize();
|
|
900
|
+
koatty_logger.DefaultLogger.Info('RedLock initialized successfully');
|
|
901
|
+
}
|
|
902
|
+
catch (error) {
|
|
903
|
+
koatty_logger.DefaultLogger.Error('Failed to initialize RedLock:', error);
|
|
904
|
+
throw error;
|
|
905
|
+
}
|
|
908
906
|
}
|
|
909
907
|
/**
|
|
910
908
|
* Create redLocker Descriptor with improved error handling and type safety
|
|
@@ -1021,6 +1019,7 @@ function redLockerDescriptor(descriptor, name, method, methodOptions) {
|
|
|
1021
1019
|
* Generate lock name for RedLock decorator
|
|
1022
1020
|
*/
|
|
1023
1021
|
function generateLockName(configName, methodName, target) {
|
|
1022
|
+
var _a;
|
|
1024
1023
|
if (configName) {
|
|
1025
1024
|
return configName;
|
|
1026
1025
|
}
|
|
@@ -1035,7 +1034,7 @@ function generateLockName(configName, methodName, target) {
|
|
|
1035
1034
|
// Fallback if IOC container is not available
|
|
1036
1035
|
}
|
|
1037
1036
|
const targetWithConstructor = target;
|
|
1038
|
-
const className = targetWithConstructor.constructor
|
|
1037
|
+
const className = ((_a = targetWithConstructor.constructor) === null || _a === void 0 ? void 0 : _a.name) || 'Unknown';
|
|
1039
1038
|
return `${className}_${methodName}`;
|
|
1040
1039
|
}
|
|
1041
1040
|
|
|
@@ -1199,16 +1198,14 @@ async function initSchedule(options, app) {
|
|
|
1199
1198
|
koatty_logger.DefaultLogger.Warn(`Schedule initialization skipped: Koatty app not available or not initialized`);
|
|
1200
1199
|
return;
|
|
1201
1200
|
}
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
}
|
|
1211
|
-
});
|
|
1201
|
+
try {
|
|
1202
|
+
await injectSchedule(options);
|
|
1203
|
+
koatty_logger.DefaultLogger.Info('Schedule system initialized successfully');
|
|
1204
|
+
}
|
|
1205
|
+
catch (error) {
|
|
1206
|
+
koatty_logger.DefaultLogger.Error('Failed to initialize Schedule system:', error);
|
|
1207
|
+
throw error;
|
|
1208
|
+
}
|
|
1212
1209
|
}
|
|
1213
1210
|
/**
|
|
1214
1211
|
* Inject schedule job with enhanced error handling and validation
|
|
@@ -1312,10 +1309,12 @@ const defaultOptions = {
|
|
|
1312
1309
|
*/
|
|
1313
1310
|
async function KoattyScheduled(options, app) {
|
|
1314
1311
|
options = { ...defaultOptions, ...options };
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1312
|
+
app.once("appReady", async function () {
|
|
1313
|
+
// 初始化RedLock
|
|
1314
|
+
await initRedLock(options, app);
|
|
1315
|
+
// 初始化调度任务系统
|
|
1316
|
+
await initSchedule(options, app);
|
|
1317
|
+
});
|
|
1319
1318
|
}
|
|
1320
1319
|
|
|
1321
1320
|
exports.KoattyScheduled = KoattyScheduled;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @Author: richen
|
|
3
|
-
* @Date:
|
|
3
|
+
* @Date: 2026-01-28 17:27:51
|
|
4
4
|
* @License: BSD (3-Clause)
|
|
5
5
|
* @Copyright (c) - <richenlin(at)gmail.com>
|
|
6
6
|
* @HomePage: https://koatty.org/
|
|
@@ -195,10 +195,10 @@ function getEffectiveTimezone(options, userTimezone) {
|
|
|
195
195
|
function getEffectiveRedLockOptions(methodOptions) {
|
|
196
196
|
const globalOptions = getGlobalScheduledOptions();
|
|
197
197
|
return {
|
|
198
|
-
lockTimeOut: methodOptions
|
|
199
|
-
clockDriftFactor: methodOptions
|
|
200
|
-
maxRetries: methodOptions
|
|
201
|
-
retryDelayMs: methodOptions
|
|
198
|
+
lockTimeOut: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.lockTimeOut) || globalOptions.lockTimeOut || 10000,
|
|
199
|
+
clockDriftFactor: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.clockDriftFactor) || globalOptions.clockDriftFactor || 0.01,
|
|
200
|
+
maxRetries: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.maxRetries) || globalOptions.maxRetries || 3,
|
|
201
|
+
retryDelayMs: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.retryDelayMs) || globalOptions.retryDelayMs || 200
|
|
202
202
|
};
|
|
203
203
|
}
|
|
204
204
|
|
|
@@ -235,7 +235,6 @@ var RedisMode;
|
|
|
235
235
|
* Wraps ioredis client to provide unified interface
|
|
236
236
|
*/
|
|
237
237
|
class RedisClientAdapter {
|
|
238
|
-
client;
|
|
239
238
|
constructor(client) {
|
|
240
239
|
this.client = client;
|
|
241
240
|
}
|
|
@@ -372,11 +371,12 @@ class RedisFactory {
|
|
|
372
371
|
* @param config - Cluster configuration
|
|
373
372
|
*/
|
|
374
373
|
static createClusterClient(config) {
|
|
374
|
+
var _a, _b;
|
|
375
375
|
DefaultLogger.Debug(`Creating cluster Redis client with ${config.nodes.length} nodes`);
|
|
376
376
|
const clusterOptions = {
|
|
377
377
|
redisOptions: {
|
|
378
|
-
password: config.redisOptions
|
|
379
|
-
db: config.redisOptions
|
|
378
|
+
password: ((_a = config.redisOptions) === null || _a === void 0 ? void 0 : _a.password) || config.password || undefined,
|
|
379
|
+
db: ((_b = config.redisOptions) === null || _b === void 0 ? void 0 : _b.db) || config.db || 0,
|
|
380
380
|
keyPrefix: config.keyPrefix || '',
|
|
381
381
|
connectTimeout: config.connectTimeout || 10000,
|
|
382
382
|
commandTimeout: config.commandTimeout || 5000,
|
|
@@ -489,15 +489,12 @@ const defaultRedlockSettings = {
|
|
|
489
489
|
* Implements IDistributedLock interface for abstraction
|
|
490
490
|
*/
|
|
491
491
|
class RedLocker {
|
|
492
|
-
static instance = null;
|
|
493
|
-
static instanceLock = Symbol('RedLocker.instanceLock');
|
|
494
|
-
redlock = null;
|
|
495
|
-
redisClient = null;
|
|
496
|
-
config;
|
|
497
|
-
isInitialized = false;
|
|
498
|
-
initializationPromise = null;
|
|
499
492
|
// 私有构造函数防止外部直接实例化
|
|
500
493
|
constructor(options) {
|
|
494
|
+
this.redlock = null;
|
|
495
|
+
this.redisClient = null;
|
|
496
|
+
this.isInitialized = false;
|
|
497
|
+
this.initializationPromise = null;
|
|
501
498
|
this.config = { ...defaultRedLockConfig, ...options };
|
|
502
499
|
// Register this instance in IOC container
|
|
503
500
|
this.registerInContainer();
|
|
@@ -813,16 +810,17 @@ class RedLocker {
|
|
|
813
810
|
* @returns Health status
|
|
814
811
|
*/
|
|
815
812
|
async healthCheck() {
|
|
813
|
+
var _a, _b;
|
|
816
814
|
try {
|
|
817
815
|
await this.initialize();
|
|
818
|
-
const redisStatus = this.redisClient
|
|
816
|
+
const redisStatus = ((_a = this.redisClient) === null || _a === void 0 ? void 0 : _a.status) || 'unknown';
|
|
819
817
|
const isReady = this.isReady();
|
|
820
818
|
return {
|
|
821
819
|
status: isReady ? 'healthy' : 'unhealthy',
|
|
822
820
|
details: {
|
|
823
821
|
initialized: this.isInitialized,
|
|
824
822
|
redisStatus,
|
|
825
|
-
redisMode: this.config.redisConfig
|
|
823
|
+
redisMode: ((_b = this.config.redisConfig) === null || _b === void 0 ? void 0 : _b.mode) || 'unknown',
|
|
826
824
|
redlockReady: !!this.redlock,
|
|
827
825
|
containerRegistered: this.getContainerInfo().registered
|
|
828
826
|
}
|
|
@@ -839,6 +837,8 @@ class RedLocker {
|
|
|
839
837
|
}
|
|
840
838
|
}
|
|
841
839
|
}
|
|
840
|
+
RedLocker.instance = null;
|
|
841
|
+
RedLocker.instanceLock = Symbol('RedLocker.instanceLock');
|
|
842
842
|
|
|
843
843
|
/*
|
|
844
844
|
* @Description:
|
|
@@ -888,21 +888,19 @@ async function initRedLock(options, app) {
|
|
|
888
888
|
DefaultLogger.Warn(`RedLock initialization skipped: Koatty app not available or not initialized`);
|
|
889
889
|
return;
|
|
890
890
|
}
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
throw Error(`Missing RedLock configuration. Please write a configuration item with the key name 'RedLock' in the db.ts file.`);
|
|
895
|
-
}
|
|
896
|
-
// 获取RedLocker实例,在首次使用时自动初始化
|
|
897
|
-
const redLocker = RedLocker.getInstance(options);
|
|
898
|
-
await redLocker.initialize();
|
|
899
|
-
DefaultLogger.Info('RedLock initialized successfully');
|
|
900
|
-
}
|
|
901
|
-
catch (error) {
|
|
902
|
-
DefaultLogger.Error('Failed to initialize RedLock:', error);
|
|
903
|
-
throw error;
|
|
891
|
+
try {
|
|
892
|
+
if (Helper.isEmpty(options)) {
|
|
893
|
+
throw Error(`Missing RedLock configuration. Please write a configuration item with the key name 'RedLock' in the db.ts file.`);
|
|
904
894
|
}
|
|
905
|
-
|
|
895
|
+
// 获取RedLocker实例,在首次使用时自动初始化
|
|
896
|
+
const redLocker = RedLocker.getInstance(options);
|
|
897
|
+
await redLocker.initialize();
|
|
898
|
+
DefaultLogger.Info('RedLock initialized successfully');
|
|
899
|
+
}
|
|
900
|
+
catch (error) {
|
|
901
|
+
DefaultLogger.Error('Failed to initialize RedLock:', error);
|
|
902
|
+
throw error;
|
|
903
|
+
}
|
|
906
904
|
}
|
|
907
905
|
/**
|
|
908
906
|
* Create redLocker Descriptor with improved error handling and type safety
|
|
@@ -1019,6 +1017,7 @@ function redLockerDescriptor(descriptor, name, method, methodOptions) {
|
|
|
1019
1017
|
* Generate lock name for RedLock decorator
|
|
1020
1018
|
*/
|
|
1021
1019
|
function generateLockName(configName, methodName, target) {
|
|
1020
|
+
var _a;
|
|
1022
1021
|
if (configName) {
|
|
1023
1022
|
return configName;
|
|
1024
1023
|
}
|
|
@@ -1033,7 +1032,7 @@ function generateLockName(configName, methodName, target) {
|
|
|
1033
1032
|
// Fallback if IOC container is not available
|
|
1034
1033
|
}
|
|
1035
1034
|
const targetWithConstructor = target;
|
|
1036
|
-
const className = targetWithConstructor.constructor
|
|
1035
|
+
const className = ((_a = targetWithConstructor.constructor) === null || _a === void 0 ? void 0 : _a.name) || 'Unknown';
|
|
1037
1036
|
return `${className}_${methodName}`;
|
|
1038
1037
|
}
|
|
1039
1038
|
|
|
@@ -1197,16 +1196,14 @@ async function initSchedule(options, app) {
|
|
|
1197
1196
|
DefaultLogger.Warn(`Schedule initialization skipped: Koatty app not available or not initialized`);
|
|
1198
1197
|
return;
|
|
1199
1198
|
}
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
}
|
|
1209
|
-
});
|
|
1199
|
+
try {
|
|
1200
|
+
await injectSchedule(options);
|
|
1201
|
+
DefaultLogger.Info('Schedule system initialized successfully');
|
|
1202
|
+
}
|
|
1203
|
+
catch (error) {
|
|
1204
|
+
DefaultLogger.Error('Failed to initialize Schedule system:', error);
|
|
1205
|
+
throw error;
|
|
1206
|
+
}
|
|
1210
1207
|
}
|
|
1211
1208
|
/**
|
|
1212
1209
|
* Inject schedule job with enhanced error handling and validation
|
|
@@ -1310,10 +1307,12 @@ const defaultOptions = {
|
|
|
1310
1307
|
*/
|
|
1311
1308
|
async function KoattyScheduled(options, app) {
|
|
1312
1309
|
options = { ...defaultOptions, ...options };
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1310
|
+
app.once("appReady", async function () {
|
|
1311
|
+
// 初始化RedLock
|
|
1312
|
+
await initRedLock(options, app);
|
|
1313
|
+
// 初始化调度任务系统
|
|
1314
|
+
await initSchedule(options, app);
|
|
1315
|
+
});
|
|
1317
1316
|
}
|
|
1318
1317
|
|
|
1319
1318
|
export { KoattyScheduled, RedLock, RedLocker, RedisClientAdapter, RedisFactory, RedisMode, Scheduled, SchedulerLock };
|
package/dist/package.json
CHANGED
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koatty_schedule",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.7",
|
|
4
4
|
"description": "Schedule for koatty.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp",
|
|
7
7
|
"build:cp": "node scripts/postBuild && npx copyfiles package.json LICENSE README.md dist/",
|
|
8
8
|
"build:js": "npx rollup --bundleConfigAsCjs -c .rollup.config.js",
|
|
9
9
|
"build:doc": "npx api-documenter markdown --input temp --output docs/api",
|
|
10
|
-
"build:dts": "
|
|
10
|
+
"build:dts": "bash ../../scripts/build-dts.sh",
|
|
11
11
|
"eslint": "eslint --ext .ts,.js ./",
|
|
12
12
|
"lock": "npm i --package-lock-only",
|
|
13
13
|
"prepublishOnly": "npm test && npm run build && git push --follow-tags origin master",
|
|
14
14
|
"prerelease": "npm test && npm run build",
|
|
15
|
-
"release:minor": "npm run release -- --release-as minor",
|
|
16
|
-
"release:major": "npm run release -- --release-as major",
|
|
17
|
-
"release": "standard-version",
|
|
18
|
-
"release:pre": "npm run release -- --prerelease",
|
|
19
15
|
"test": "npm run eslint && jest --passWithNoTests",
|
|
20
|
-
"test:cov": "jest --collectCoverage --detectOpenHandles"
|
|
21
|
-
"version": "conventional-changelog -p angular -i CHANGELOG.md -s"
|
|
16
|
+
"test:cov": "jest --collectCoverage --detectOpenHandles"
|
|
22
17
|
},
|
|
23
18
|
"main": "./dist/index.js",
|
|
24
19
|
"exports": {
|
|
@@ -89,18 +84,18 @@
|
|
|
89
84
|
},
|
|
90
85
|
"dependencies": {
|
|
91
86
|
"@sesamecare-oss/redlock": "^1.4.0",
|
|
92
|
-
"cron": "^4.
|
|
93
|
-
"ioredis": "^5.
|
|
94
|
-
"koatty_container": "^1.
|
|
95
|
-
"koatty_core": "2.0.
|
|
96
|
-
"koatty_lib": "^1.
|
|
97
|
-
"koatty_logger": "^2.
|
|
98
|
-
"koatty_store": "^1.
|
|
87
|
+
"cron": "^4.4.0",
|
|
88
|
+
"ioredis": "^5.9.2",
|
|
89
|
+
"koatty_container": "^1.17.4",
|
|
90
|
+
"koatty_core": "^2.0.14",
|
|
91
|
+
"koatty_lib": "^1.4.5",
|
|
92
|
+
"koatty_logger": "^2.3.4",
|
|
93
|
+
"koatty_store": "^1.9.4"
|
|
99
94
|
},
|
|
100
95
|
"peerDependencies": {
|
|
101
|
-
"koatty_container": "^1.
|
|
102
|
-
"koatty_core": "^
|
|
103
|
-
"koatty_lib": "^1.
|
|
104
|
-
"koatty_logger": "^2.
|
|
96
|
+
"koatty_container": "^1.17.4",
|
|
97
|
+
"koatty_core": "^2.0.14",
|
|
98
|
+
"koatty_lib": "^1.4.5",
|
|
99
|
+
"koatty_logger": "^2.3.4"
|
|
105
100
|
}
|
|
106
101
|
}
|
package/package.json
CHANGED
|
@@ -1,25 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koatty_schedule",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.7",
|
|
4
4
|
"description": "Schedule for koatty.",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp",
|
|
7
|
-
"build:cp": "node scripts/postBuild && npx copyfiles package.json LICENSE README.md dist/",
|
|
8
|
-
"build:js": "npx rollup --bundleConfigAsCjs -c .rollup.config.js",
|
|
9
|
-
"build:doc": "npx api-documenter markdown --input temp --output docs/api",
|
|
10
|
-
"build:dts": "npx tsc && npx api-extractor run --local --verbose",
|
|
11
|
-
"eslint": "eslint --ext .ts,.js ./",
|
|
12
|
-
"lock": "npm i --package-lock-only",
|
|
13
|
-
"prepublishOnly": "npm test && npm run build && git push --follow-tags origin master",
|
|
14
|
-
"prerelease": "npm test && npm run build",
|
|
15
|
-
"release:minor": "npm run release -- --release-as minor",
|
|
16
|
-
"release:major": "npm run release -- --release-as major",
|
|
17
|
-
"release": "standard-version",
|
|
18
|
-
"release:pre": "npm run release -- --prerelease",
|
|
19
|
-
"test": "npm run eslint && jest --passWithNoTests",
|
|
20
|
-
"test:cov": "jest --collectCoverage --detectOpenHandles",
|
|
21
|
-
"version": "conventional-changelog -p angular -i CHANGELOG.md -s"
|
|
22
|
-
},
|
|
23
5
|
"main": "./dist/index.js",
|
|
24
6
|
"exports": {
|
|
25
7
|
"require": "./dist/index.js",
|
|
@@ -89,18 +71,30 @@
|
|
|
89
71
|
},
|
|
90
72
|
"dependencies": {
|
|
91
73
|
"@sesamecare-oss/redlock": "^1.4.0",
|
|
92
|
-
"cron": "^4.
|
|
93
|
-
"ioredis": "^5.
|
|
94
|
-
"koatty_container": "^1.
|
|
95
|
-
"koatty_core": "2.0.
|
|
96
|
-
"koatty_lib": "^1.
|
|
97
|
-
"koatty_logger": "^2.
|
|
98
|
-
"koatty_store": "^1.
|
|
74
|
+
"cron": "^4.4.0",
|
|
75
|
+
"ioredis": "^5.9.2",
|
|
76
|
+
"koatty_container": "^1.17.4",
|
|
77
|
+
"koatty_core": "^2.0.14",
|
|
78
|
+
"koatty_lib": "^1.4.5",
|
|
79
|
+
"koatty_logger": "^2.3.4",
|
|
80
|
+
"koatty_store": "^1.9.4"
|
|
99
81
|
},
|
|
100
82
|
"peerDependencies": {
|
|
101
|
-
"koatty_container": "^1.
|
|
102
|
-
"koatty_core": "^
|
|
103
|
-
"koatty_lib": "^1.
|
|
104
|
-
"koatty_logger": "^2.
|
|
83
|
+
"koatty_container": "^1.17.4",
|
|
84
|
+
"koatty_core": "^2.0.14",
|
|
85
|
+
"koatty_lib": "^1.4.5",
|
|
86
|
+
"koatty_logger": "^2.3.4"
|
|
87
|
+
},
|
|
88
|
+
"scripts": {
|
|
89
|
+
"build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp",
|
|
90
|
+
"build:cp": "node scripts/postBuild && npx copyfiles package.json LICENSE README.md dist/",
|
|
91
|
+
"build:js": "npx rollup --bundleConfigAsCjs -c .rollup.config.js",
|
|
92
|
+
"build:doc": "npx api-documenter markdown --input temp --output docs/api",
|
|
93
|
+
"build:dts": "bash ../../scripts/build-dts.sh",
|
|
94
|
+
"eslint": "eslint --ext .ts,.js ./",
|
|
95
|
+
"lock": "npm i --package-lock-only",
|
|
96
|
+
"prerelease": "npm test && npm run build",
|
|
97
|
+
"test": "npm run eslint && jest --passWithNoTests",
|
|
98
|
+
"test:cov": "jest --collectCoverage --detectOpenHandles"
|
|
105
99
|
}
|
|
106
|
-
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var commonjs = require('@rollup/plugin-commonjs');
|
|
6
|
+
var json = require('@rollup/plugin-json');
|
|
7
|
+
var resolve = require('@rollup/plugin-node-resolve');
|
|
8
|
+
var module$1 = require('module');
|
|
9
|
+
var del = require('rollup-plugin-delete');
|
|
10
|
+
var typescript = require('rollup-plugin-typescript2');
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* @Description:
|
|
14
|
+
* @Usage:
|
|
15
|
+
* @Author: richen
|
|
16
|
+
* @Date: 2021-12-17 10:20:44
|
|
17
|
+
* @LastEditTime: 2024-11-04 22:04:45
|
|
18
|
+
*/
|
|
19
|
+
// import babel from '@rollup/plugin-babel';
|
|
20
|
+
const pkg = require('./package.json');
|
|
21
|
+
|
|
22
|
+
var _rollup_config = [
|
|
23
|
+
{
|
|
24
|
+
input: './src/index.ts',
|
|
25
|
+
output: [
|
|
26
|
+
{
|
|
27
|
+
format: 'cjs',
|
|
28
|
+
file: './dist/index.js',
|
|
29
|
+
banner: require('./scripts/copyright'),
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
format: 'es',
|
|
33
|
+
file: './dist/index.mjs',
|
|
34
|
+
banner: require('./scripts/copyright'),
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
plugins: [
|
|
38
|
+
del({ targets: ["dist/*", "temp/*", "docs/api"] }),
|
|
39
|
+
// babel({
|
|
40
|
+
// babelHelpers: "runtime",
|
|
41
|
+
// configFile: './babel.config.js',
|
|
42
|
+
// exclude: 'node_modules/**',
|
|
43
|
+
// }),
|
|
44
|
+
json(),
|
|
45
|
+
resolve({
|
|
46
|
+
preferBuiltins: true, // 优先选择内置模块
|
|
47
|
+
}),
|
|
48
|
+
commonjs(),
|
|
49
|
+
typescript({
|
|
50
|
+
tsconfigOverride: {
|
|
51
|
+
compilerOptions: {
|
|
52
|
+
declaration: false,
|
|
53
|
+
declarationMap: false,
|
|
54
|
+
module: "ESNext"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
],
|
|
59
|
+
external: [
|
|
60
|
+
...module$1.builtinModules, // 排除 Node.js 内置模块
|
|
61
|
+
...Object.keys(pkg.dependencies || {}), // 排除 package.json 中的外部依赖
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
exports.default = _rollup_config;
|