koatty_schedule 3.2.0 → 3.3.1

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 CHANGED
@@ -3,61 +3,58 @@
3
3
  * @Usage:
4
4
  * @Author: richen
5
5
  * @Date: 2021-12-17 10:20:44
6
- * @LastEditTime: 2021-12-18 11:58:46
6
+ * @LastEditTime: 2024-11-04 22:04:45
7
7
  */
8
+ import commonjs from '@rollup/plugin-commonjs';
8
9
  import json from "@rollup/plugin-json";
10
+ import resolve from '@rollup/plugin-node-resolve';
11
+ import { builtinModules } from 'module';
12
+ import del from "rollup-plugin-delete";
9
13
  import typescript from 'rollup-plugin-typescript2';
10
14
  // import babel from '@rollup/plugin-babel';
15
+ const pkg = require('./package.json');
11
16
 
12
17
  export default [
13
- {
14
- input: './src/index.ts',
15
- output: [{
16
- format: 'cjs',
17
- file: './dist/index.js',
18
- banner: require('./scripts/copyright')
19
- }],
20
- plugins: [
21
- // babel({
22
- // babelHelpers: "runtime",
23
- // configFile: './babel.config.js',
24
- // exclude: 'node_modules/**',
25
- // }),
26
- json(),
27
- typescript({
28
- tsconfigOverride: {
29
- compilerOptions: {
30
- declaration: false,
31
- declarationMap: false,
32
- module: "ESNext"
33
- }
34
- }
35
- })
36
- ]
37
- },
38
- {
39
- input: './src/index.ts',
40
- output: [{
41
- format: 'es',
42
- file: './dist/index.mjs',
43
- banner: require('./scripts/copyright')
44
- }],
45
- plugins: [
46
- // babel({
47
- // babelHelpers: "runtime",
48
- // configFile: './babel.config.js',
49
- // exclude: 'node_modules/**',
50
- // }),
51
- json(),
52
- typescript({
53
- tsconfigOverride: {
54
- compilerOptions: {
55
- declaration: false,
56
- declarationMap: false,
57
- module: "ESNext"
58
- }
59
- }
60
- })
61
- ]
62
- }
18
+ {
19
+ input: './src/index.ts',
20
+ output: [
21
+ {
22
+ format: 'cjs',
23
+ file: './dist/index.js',
24
+ banner: require('./scripts/copyright'),
25
+ },
26
+ {
27
+ format: 'es',
28
+ file: './dist/index.mjs',
29
+ banner: require('./scripts/copyright'),
30
+ },
31
+ ],
32
+ plugins: [
33
+ del({ targets: ["dist/*", "temp/*", "docs/api"] }),
34
+ // babel({
35
+ // babelHelpers: "runtime",
36
+ // configFile: './babel.config.js',
37
+ // exclude: 'node_modules/**',
38
+ // }),
39
+ json(),
40
+ resolve({
41
+ preferBuiltins: true, // 优先选择内置模块
42
+ }),
43
+ commonjs(),
44
+ typescript({
45
+ tsconfigOverride: {
46
+ compilerOptions: {
47
+ declaration: false,
48
+ declarationMap: false,
49
+ module: "ESNext"
50
+ }
51
+ }
52
+ })
53
+ ],
54
+ external: [
55
+ ...builtinModules, // 排除 Node.js 内置模块
56
+ ...Object.keys(pkg.dependencies || {}), // 排除 package.json 中的外部依赖
57
+ ],
58
+ },
59
+
63
60
  ]
package/CHANGELOG.md CHANGED
@@ -2,6 +2,34 @@
2
2
 
3
3
  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
4
 
5
+ ### [3.3.1](https://github.com/thinkkoa/koatty_schedule/compare/v3.3.0...v3.3.1) (2025-06-22)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * unify component type constant to 'COMPONENT' string literal in IOCContainer registration ([7098c7e](https://github.com/thinkkoa/koatty_schedule/commit/7098c7e2c326a6461b6b8b5c84d07a3ced75de5f))
11
+
12
+ ## [3.3.0](https://github.com/thinkkoa/koatty_schedule/compare/v3.2.0...v3.3.0) (2025-06-22)
13
+
14
+
15
+ ### Features
16
+
17
+ * enhance distributed locking and scheduling system with global configuration management and improved validation ([79a10f5](https://github.com/thinkkoa/koatty_schedule/commit/79a10f5a1ac66958aa44d3ea9151a65826748724))
18
+ * improve RedLock singleton management with thread-safe initialization and lock renewal enhancements ([ec426aa](https://github.com/thinkkoa/koatty_schedule/commit/ec426aae3cd0d824661b1b94ae8043bf66ace606))
19
+ * introduce component-specific metadata keys for scheduled and redlock decorators ([173e79a](https://github.com/thinkkoa/koatty_schedule/commit/173e79ac916c13b20c93d2efac7e69009cc5cf32))
20
+ * refactor RedLock configuration and remove deprecated ScheduleConfig ([7bd4667](https://github.com/thinkkoa/koatty_schedule/commit/7bd4667242c6fd07cfd58a4322d93f4c4548100a))
21
+ * update decorator types to support symbol property keys and improve IOC container integration ([f7b6382](https://github.com/thinkkoa/koatty_schedule/commit/f7b6382e855914176c130b10a769b03cc74c0f23))
22
+ * use dynamic componentType instead of hardcoded constants for IOCContainer registration ([42ca073](https://github.com/thinkkoa/koatty_schedule/commit/42ca07353a8082b1af9e49d43914497d41cddd27))
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * 修复IOC容器元数据键格式不匹配问题 ([644714f](https://github.com/thinkkoa/koatty_schedule/commit/644714f20497196fb705e551880a9ef527257cb7))
28
+
29
+ ### [2.1.1](https://github.com/thinkkoa/koatty_schedule/compare/v2.1.0...v2.1.1) (2025-06-09)
30
+
31
+ ### [1.6.2](https://github.com/thinkkoa/koatty_schedule/compare/v2.0.1...v1.6.2) (2024-11-07)
32
+
5
33
  ## [3.2.0](https://github.com/thinkkoa/koatty_schedule/compare/v3.1.0...v3.2.0) (2025-06-22)
6
34
 
7
35
 
package/README.md CHANGED
@@ -30,11 +30,9 @@ npm install koatty_schedule
30
30
  Use Koatty CLI to generate the plugin template:
31
31
 
32
32
  ```bash
33
- kt plugin
33
+ kt plugin Scheduled
34
34
  ```
35
35
 
36
- ### 2. Create Scheduled Plugin
37
-
38
36
  Create `src/plugin/Scheduled.ts`:
39
37
 
40
38
  ```typescript
@@ -49,7 +47,7 @@ export class Scheduled implements IPlugin {
49
47
  }
50
48
  ```
51
49
 
52
- ### 3. Configure Plugin
50
+ ### 2. Configure Plugin
53
51
 
54
52
  Update `src/config/plugin.ts`:
55
53
 
package/dist/README.md CHANGED
@@ -30,11 +30,9 @@ npm install koatty_schedule
30
30
  Use Koatty CLI to generate the plugin template:
31
31
 
32
32
  ```bash
33
- kt plugin
33
+ kt plugin Scheduled
34
34
  ```
35
35
 
36
- ### 2. Create Scheduled Plugin
37
-
38
36
  Create `src/plugin/Scheduled.ts`:
39
37
 
40
38
  ```typescript
@@ -49,7 +47,7 @@ export class Scheduled implements IPlugin {
49
47
  }
50
48
  ```
51
49
 
52
- ### 3. Configure Plugin
50
+ ### 2. Configure Plugin
53
51
 
54
52
  Update `src/config/plugin.ts`:
55
53
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2025-06-22 20:33:52
3
+ * @Date: 2025-06-22 23:42:00
4
4
  * @License: BSD (3-Clause)
5
5
  * @Copyright (c) - <richenlin(at)gmail.com>
6
6
  * @HomePage: https://koatty.org/
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2025-06-22 20:33:45
3
+ * @Date: 2025-06-22 23:41:54
4
4
  * @License: BSD (3-Clause)
5
5
  * @Copyright (c) - <richenlin(at)gmail.com>
6
6
  * @HomePage: https://koatty.org/
@@ -140,10 +140,10 @@ function getEffectiveTimezone(userTimezone) {
140
140
  function getEffectiveRedLockOptions(methodOptions) {
141
141
  const globalOptions = getGlobalScheduledOptions();
142
142
  return {
143
- lockTimeOut: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.lockTimeOut) || globalOptions.lockTimeOut || 10000,
144
- clockDriftFactor: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.clockDriftFactor) || globalOptions.clockDriftFactor || 0.01,
145
- maxRetries: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.maxRetries) || globalOptions.maxRetries || 3,
146
- retryDelayMs: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.retryDelayMs) || globalOptions.retryDelayMs || 200
143
+ lockTimeOut: methodOptions?.lockTimeOut || globalOptions.lockTimeOut || 10000,
144
+ clockDriftFactor: methodOptions?.clockDriftFactor || globalOptions.clockDriftFactor || 0.01,
145
+ maxRetries: methodOptions?.maxRetries || globalOptions.maxRetries || 3,
146
+ retryDelayMs: methodOptions?.retryDelayMs || globalOptions.retryDelayMs || 200
147
147
  };
148
148
  }
149
149
 
@@ -211,7 +211,7 @@ function RedLock(lockName, options) {
211
211
  validateRedLockMethodOptions(options);
212
212
  }
213
213
  // 保存类到IOC容器
214
- koatty_container.IOCContainer.saveClass(COMPONENT_REDLOCK, targetClass, targetClass.name);
214
+ koatty_container.IOCContainer.saveClass("COMPONENT", targetClass, targetClass.name);
215
215
  // 保存RedLock元数据到 IOC 容器(lockName已确定)
216
216
  koatty_container.IOCContainer.attachClassMetadata(COMPONENT_REDLOCK, DecoratorType.REDLOCK, {
217
217
  method: methodName,
@@ -281,7 +281,7 @@ function Scheduled(cron, timezone) {
281
281
  throw Error("@Scheduled decorator can only be applied to methods");
282
282
  }
283
283
  // 保存类到IOC容器
284
- koatty_container.IOCContainer.saveClass(COMPONENT_SCHEDULED, targetClass, targetClass.name);
284
+ koatty_container.IOCContainer.saveClass("COMPONENT", targetClass, targetClass.name);
285
285
  // 保存调度元数据到 IOC 容器
286
286
  koatty_container.IOCContainer.attachClassMetadata(COMPONENT_SCHEDULED, DecoratorType.SCHEDULED, {
287
287
  method: methodName,
@@ -327,12 +327,15 @@ const defaultRedLockConfig = {
327
327
  * Implements singleton pattern for safe instance management
328
328
  */
329
329
  class RedLocker {
330
+ static instance = null;
331
+ static instanceLock = Symbol('RedLocker.instanceLock');
332
+ redlock = null;
333
+ redis = null;
334
+ config;
335
+ isInitialized = false;
336
+ initializationPromise = null;
330
337
  // 私有构造函数防止外部直接实例化
331
338
  constructor(options) {
332
- this.redlock = null;
333
- this.redis = null;
334
- this.isInitialized = false;
335
- this.initializationPromise = null;
336
339
  this.config = { ...defaultRedLockConfig, ...options };
337
340
  // Register this instance in IOC container
338
341
  this.registerInContainer();
@@ -624,10 +627,9 @@ class RedLocker {
624
627
  * @returns Health status
625
628
  */
626
629
  async healthCheck() {
627
- var _a;
628
630
  try {
629
631
  await this.initialize();
630
- const redisStatus = ((_a = this.redis) === null || _a === void 0 ? void 0 : _a.status) || 'unknown';
632
+ const redisStatus = this.redis?.status || 'unknown';
631
633
  const isReady = this.isReady();
632
634
  return {
633
635
  status: isReady ? 'healthy' : 'unhealthy',
@@ -650,15 +652,13 @@ class RedLocker {
650
652
  }
651
653
  }
652
654
  }
653
- RedLocker.instance = null;
654
- RedLocker.instanceLock = Symbol('RedLocker.instanceLock');
655
655
 
656
656
  /*
657
657
  * @Description:
658
658
  * @Usage:
659
659
  * @Author: richen
660
660
  * @Date: 2024-01-16 19:53:14
661
- * @LastEditTime: 2024-01-17 09:24:45
661
+ * @LastEditTime: 2024-11-07 16:47:58
662
662
  * @License: BSD (3-Clause)
663
663
  * @Copyright (c): <richenlin(at)gmail.com>
664
664
  */
@@ -719,7 +719,7 @@ async function initRedLock(options, app) {
719
719
  async function injectRedLock(_options, _app) {
720
720
  try {
721
721
  koatty_logger.DefaultLogger.Debug('Starting batch RedLock injection...');
722
- const componentList = koatty_container.IOCContainer.listClass(COMPONENT_REDLOCK);
722
+ const componentList = koatty_container.IOCContainer.listClass("COMPONENT");
723
723
  for (const component of componentList) {
724
724
  const classMetadata = koatty_container.IOCContainer.getClassMetadata(COMPONENT_REDLOCK, DecoratorType.REDLOCK, component.target);
725
725
  if (!classMetadata) {
@@ -796,10 +796,10 @@ function redLockerDescriptor(descriptor, name, method, methodOptions) {
796
796
  }
797
797
  // 设置默认选项,合并方法级别的选项
798
798
  const lockOptions = {
799
- lockTimeOut: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.lockTimeOut) || 10000,
800
- clockDriftFactor: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.clockDriftFactor) || 0.01,
801
- maxRetries: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.maxRetries) || 3,
802
- retryDelayMs: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.retryDelayMs) || 200
799
+ lockTimeOut: methodOptions?.lockTimeOut,
800
+ clockDriftFactor: methodOptions?.clockDriftFactor,
801
+ maxRetries: methodOptions?.maxRetries,
802
+ retryDelayMs: methodOptions?.retryDelayMs
803
803
  };
804
804
  /**
805
805
  * Enhanced function wrapper with proper lock renewal and safety
@@ -905,7 +905,7 @@ function redLockerDescriptor(descriptor, name, method, methodOptions) {
905
905
  async function injectSchedule(_options, _app) {
906
906
  try {
907
907
  koatty_logger.DefaultLogger.Debug('Starting batch schedule injection...');
908
- const componentList = koatty_container.IOCContainer.listClass(COMPONENT_SCHEDULED);
908
+ const componentList = koatty_container.IOCContainer.listClass("COMPONENT");
909
909
  for (const component of componentList) {
910
910
  const classMetadata = koatty_container.IOCContainer.getClassMetadata(COMPONENT_SCHEDULED, DecoratorType.SCHEDULED, component.target);
911
911
  if (!classMetadata) {
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2025-06-22 20:33:45
3
+ * @Date: 2025-06-22 23:41:54
4
4
  * @License: BSD (3-Clause)
5
5
  * @Copyright (c) - <richenlin(at)gmail.com>
6
6
  * @HomePage: https://koatty.org/
@@ -138,10 +138,10 @@ function getEffectiveTimezone(userTimezone) {
138
138
  function getEffectiveRedLockOptions(methodOptions) {
139
139
  const globalOptions = getGlobalScheduledOptions();
140
140
  return {
141
- lockTimeOut: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.lockTimeOut) || globalOptions.lockTimeOut || 10000,
142
- clockDriftFactor: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.clockDriftFactor) || globalOptions.clockDriftFactor || 0.01,
143
- maxRetries: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.maxRetries) || globalOptions.maxRetries || 3,
144
- retryDelayMs: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.retryDelayMs) || globalOptions.retryDelayMs || 200
141
+ lockTimeOut: methodOptions?.lockTimeOut || globalOptions.lockTimeOut || 10000,
142
+ clockDriftFactor: methodOptions?.clockDriftFactor || globalOptions.clockDriftFactor || 0.01,
143
+ maxRetries: methodOptions?.maxRetries || globalOptions.maxRetries || 3,
144
+ retryDelayMs: methodOptions?.retryDelayMs || globalOptions.retryDelayMs || 200
145
145
  };
146
146
  }
147
147
 
@@ -209,7 +209,7 @@ function RedLock(lockName, options) {
209
209
  validateRedLockMethodOptions(options);
210
210
  }
211
211
  // 保存类到IOC容器
212
- IOCContainer.saveClass(COMPONENT_REDLOCK, targetClass, targetClass.name);
212
+ IOCContainer.saveClass("COMPONENT", targetClass, targetClass.name);
213
213
  // 保存RedLock元数据到 IOC 容器(lockName已确定)
214
214
  IOCContainer.attachClassMetadata(COMPONENT_REDLOCK, DecoratorType.REDLOCK, {
215
215
  method: methodName,
@@ -279,7 +279,7 @@ function Scheduled(cron, timezone) {
279
279
  throw Error("@Scheduled decorator can only be applied to methods");
280
280
  }
281
281
  // 保存类到IOC容器
282
- IOCContainer.saveClass(COMPONENT_SCHEDULED, targetClass, targetClass.name);
282
+ IOCContainer.saveClass("COMPONENT", targetClass, targetClass.name);
283
283
  // 保存调度元数据到 IOC 容器
284
284
  IOCContainer.attachClassMetadata(COMPONENT_SCHEDULED, DecoratorType.SCHEDULED, {
285
285
  method: methodName,
@@ -325,12 +325,15 @@ const defaultRedLockConfig = {
325
325
  * Implements singleton pattern for safe instance management
326
326
  */
327
327
  class RedLocker {
328
+ static instance = null;
329
+ static instanceLock = Symbol('RedLocker.instanceLock');
330
+ redlock = null;
331
+ redis = null;
332
+ config;
333
+ isInitialized = false;
334
+ initializationPromise = null;
328
335
  // 私有构造函数防止外部直接实例化
329
336
  constructor(options) {
330
- this.redlock = null;
331
- this.redis = null;
332
- this.isInitialized = false;
333
- this.initializationPromise = null;
334
337
  this.config = { ...defaultRedLockConfig, ...options };
335
338
  // Register this instance in IOC container
336
339
  this.registerInContainer();
@@ -622,10 +625,9 @@ class RedLocker {
622
625
  * @returns Health status
623
626
  */
624
627
  async healthCheck() {
625
- var _a;
626
628
  try {
627
629
  await this.initialize();
628
- const redisStatus = ((_a = this.redis) === null || _a === void 0 ? void 0 : _a.status) || 'unknown';
630
+ const redisStatus = this.redis?.status || 'unknown';
629
631
  const isReady = this.isReady();
630
632
  return {
631
633
  status: isReady ? 'healthy' : 'unhealthy',
@@ -648,15 +650,13 @@ class RedLocker {
648
650
  }
649
651
  }
650
652
  }
651
- RedLocker.instance = null;
652
- RedLocker.instanceLock = Symbol('RedLocker.instanceLock');
653
653
 
654
654
  /*
655
655
  * @Description:
656
656
  * @Usage:
657
657
  * @Author: richen
658
658
  * @Date: 2024-01-16 19:53:14
659
- * @LastEditTime: 2024-01-17 09:24:45
659
+ * @LastEditTime: 2024-11-07 16:47:58
660
660
  * @License: BSD (3-Clause)
661
661
  * @Copyright (c): <richenlin(at)gmail.com>
662
662
  */
@@ -717,7 +717,7 @@ async function initRedLock(options, app) {
717
717
  async function injectRedLock(_options, _app) {
718
718
  try {
719
719
  DefaultLogger.Debug('Starting batch RedLock injection...');
720
- const componentList = IOCContainer.listClass(COMPONENT_REDLOCK);
720
+ const componentList = IOCContainer.listClass("COMPONENT");
721
721
  for (const component of componentList) {
722
722
  const classMetadata = IOCContainer.getClassMetadata(COMPONENT_REDLOCK, DecoratorType.REDLOCK, component.target);
723
723
  if (!classMetadata) {
@@ -794,10 +794,10 @@ function redLockerDescriptor(descriptor, name, method, methodOptions) {
794
794
  }
795
795
  // 设置默认选项,合并方法级别的选项
796
796
  const lockOptions = {
797
- lockTimeOut: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.lockTimeOut) || 10000,
798
- clockDriftFactor: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.clockDriftFactor) || 0.01,
799
- maxRetries: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.maxRetries) || 3,
800
- retryDelayMs: (methodOptions === null || methodOptions === void 0 ? void 0 : methodOptions.retryDelayMs) || 200
797
+ lockTimeOut: methodOptions?.lockTimeOut,
798
+ clockDriftFactor: methodOptions?.clockDriftFactor,
799
+ maxRetries: methodOptions?.maxRetries,
800
+ retryDelayMs: methodOptions?.retryDelayMs
801
801
  };
802
802
  /**
803
803
  * Enhanced function wrapper with proper lock renewal and safety
@@ -903,7 +903,7 @@ function redLockerDescriptor(descriptor, name, method, methodOptions) {
903
903
  async function injectSchedule(_options, _app) {
904
904
  try {
905
905
  DefaultLogger.Debug('Starting batch schedule injection...');
906
- const componentList = IOCContainer.listClass(COMPONENT_SCHEDULED);
906
+ const componentList = IOCContainer.listClass("COMPONENT");
907
907
  for (const component of componentList) {
908
908
  const classMetadata = IOCContainer.getClassMetadata(COMPONENT_SCHEDULED, DecoratorType.SCHEDULED, component.target);
909
909
  if (!classMetadata) {
package/dist/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "koatty_schedule",
3
- "version": "3.2.0",
3
+ "version": "3.3.1",
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
- "build:cp": "node scripts/postBuild && copyfiles package.json LICENSE README.md dist/",
8
- "build:js": "del-cli --force dist && npx rollup --bundleConfigAsCjs -c .rollup.config.js",
9
- "build:doc": "del-cli --force docs/api && npx api-documenter markdown --input temp --output docs/api",
10
- "build:dts": "del-cli --force temp && npx tsc && npx api-extractor run --local --verbose",
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
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",
@@ -15,12 +15,16 @@
15
15
  "release:minor": "npm run release -- --release-as minor",
16
16
  "release:major": "npm run release -- --release-as major",
17
17
  "release": "standard-version",
18
- "test": "npm run eslint && jest --passWithNoTests"
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"
19
22
  },
20
23
  "main": "./dist/index.js",
21
24
  "exports": {
22
25
  "require": "./dist/index.js",
23
- "import": "./dist/index.mjs"
26
+ "import": "./dist/index.mjs",
27
+ "types": "./dist/index.d.ts"
24
28
  },
25
29
  "repository": {
26
30
  "type": "git",
@@ -54,7 +58,9 @@
54
58
  "@commitlint/config-conventional": "^19.x.x",
55
59
  "@microsoft/api-documenter": "^7.x.x",
56
60
  "@microsoft/api-extractor": "^7.x.x",
61
+ "@rollup/plugin-commonjs": "^28.0.6",
57
62
  "@rollup/plugin-json": "^6.x.x",
63
+ "@rollup/plugin-node-resolve": "^15.x.x",
58
64
  "@types/jest": "^29.x.x",
59
65
  "@types/koa": "^2.x.x",
60
66
  "@types/lodash": "^4.17.17",
@@ -73,6 +79,7 @@
73
79
  "jest-html-reporters": "^3.x.x",
74
80
  "reflect-metadata": "^0.x.x",
75
81
  "rollup": "^4.x.x",
82
+ "rollup-plugin-delete": "^2.x.x",
76
83
  "rollup-plugin-typescript2": "^0.x.x",
77
84
  "standard-version": "^9.x.x",
78
85
  "ts-jest": "^29.x.x",
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "koatty_schedule",
3
- "version": "3.2.0",
3
+ "version": "3.3.1",
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
- "build:cp": "node scripts/postBuild && copyfiles package.json LICENSE README.md dist/",
8
- "build:js": "del-cli --force dist && npx rollup --bundleConfigAsCjs -c .rollup.config.js",
9
- "build:doc": "del-cli --force docs/api && npx api-documenter markdown --input temp --output docs/api",
10
- "build:dts": "del-cli --force temp && npx tsc && npx api-extractor run --local --verbose",
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
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",
@@ -15,12 +15,16 @@
15
15
  "release:minor": "npm run release -- --release-as minor",
16
16
  "release:major": "npm run release -- --release-as major",
17
17
  "release": "standard-version",
18
- "test": "npm run eslint && jest --passWithNoTests"
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"
19
22
  },
20
23
  "main": "./dist/index.js",
21
24
  "exports": {
22
25
  "require": "./dist/index.js",
23
- "import": "./dist/index.mjs"
26
+ "import": "./dist/index.mjs",
27
+ "types": "./dist/index.d.ts"
24
28
  },
25
29
  "repository": {
26
30
  "type": "git",
@@ -54,7 +58,9 @@
54
58
  "@commitlint/config-conventional": "^19.x.x",
55
59
  "@microsoft/api-documenter": "^7.x.x",
56
60
  "@microsoft/api-extractor": "^7.x.x",
61
+ "@rollup/plugin-commonjs": "^28.0.6",
57
62
  "@rollup/plugin-json": "^6.x.x",
63
+ "@rollup/plugin-node-resolve": "^15.x.x",
58
64
  "@types/jest": "^29.x.x",
59
65
  "@types/koa": "^2.x.x",
60
66
  "@types/lodash": "^4.17.17",
@@ -73,6 +79,7 @@
73
79
  "jest-html-reporters": "^3.x.x",
74
80
  "reflect-metadata": "^0.x.x",
75
81
  "rollup": "^4.x.x",
82
+ "rollup-plugin-delete": "^2.x.x",
76
83
  "rollup-plugin-typescript2": "^0.x.x",
77
84
  "standard-version": "^9.x.x",
78
85
  "ts-jest": "^29.x.x",