koatty_store 1.6.1 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.rollup.config.js CHANGED
@@ -3,27 +3,44 @@
3
3
  * @Usage:
4
4
  * @Author: richen
5
5
  * @Date: 2021-12-17 10:20:44
6
- * @LastEditTime: 2023-02-18 23:21:06
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
18
  {
14
19
  input: './src/index.ts',
15
- output: [{
16
- format: 'cjs',
17
- file: './dist/index.js',
18
- banner: require('./scripts/copyright')
19
- }],
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
+ ],
20
32
  plugins: [
33
+ del({ targets: ["dist/*", "temp/*", "docs/api"] }),
21
34
  // babel({
22
35
  // babelHelpers: "runtime",
23
36
  // configFile: './babel.config.js',
24
37
  // exclude: 'node_modules/**',
25
38
  // }),
26
39
  json(),
40
+ resolve({
41
+ preferBuiltins: true, // 优先选择内置模块
42
+ }),
43
+ commonjs(),
27
44
  typescript({
28
45
  tsconfigOverride: {
29
46
  compilerOptions: {
@@ -33,31 +50,11 @@ export default [
33
50
  }
34
51
  }
35
52
  })
36
- ]
53
+ ],
54
+ external: [
55
+ ...builtinModules, // 排除 Node.js 内置模块
56
+ ...Object.keys(pkg.dependencies || {}), // 排除 package.json 中的外部依赖
57
+ ],
37
58
  },
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
- }
59
+
63
60
  ]
package/CHANGELOG.md CHANGED
@@ -2,13 +2,17 @@
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
- ### [1.6.1](https://github.com/koatty/koatty_store/compare/v1.6.0...v1.6.1) (2023-07-28)
6
-
7
-
8
- ### Bug Fixes
9
-
10
- * remove words ([604d31d](https://github.com/koatty/koatty_store/commit/604d31df38814a530b32605668542821b608cb7d))
5
+ ## [1.7.0](https://github.com/koatty/koatty_store/compare/v1.6.2...v1.7.0) (2024-11-07)
11
6
 
7
+ ### [1.6.2](https://github.com/koatty/koatty_store/compare/v1.6.1...v1.6.2) (2023-12-20)
8
+
9
+ ### [1.6.1](https://github.com/koatty/koatty_store/compare/v1.6.0...v1.6.1) (2023-07-28)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * remove words ([604d31d](https://github.com/koatty/koatty_store/commit/604d31df38814a530b32605668542821b608cb7d))
15
+
12
16
  ## [1.6.0](https://github.com/koatty/koatty_store/compare/v1.5.8...v1.6.0) (2023-02-18)
13
17
 
14
18
  ### [1.5.8](https://github.com/koatty/koatty_store/compare/v1.5.6...v1.5.8) (2023-01-13)
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2023-07-28 21:00:59
3
+ * @Date: 2024-11-07 14:39:13
4
4
  * @License: BSD (3-Clause)
5
5
  * @Copyright (c) - <richenlin(at)gmail.com>
6
6
  * @HomePage: https://koatty.org/
@@ -30,14 +30,14 @@ export declare class CacheStore {
30
30
  * @param {StoreOptions} options
31
31
  * @memberof CacheStore
32
32
  */
33
- constructor(options: StoreOptions);
33
+ constructor(options?: StoreOptions);
34
34
  /**
35
35
  *
36
36
  *
37
37
  * @static
38
38
  * @returns
39
39
  */
40
- static getInstance(options: StoreOptions): CacheStore;
40
+ static getInstance(options?: StoreOptions): CacheStore;
41
41
  getConnection(): MemoryCache | Promise<default_2 | default_3>;
42
42
  close(): Promise<void>;
43
43
  release(conn: any): Promise<void>;
@@ -813,19 +813,19 @@ declare class MemoryStore implements CacheStoreInterface {
813
813
  /**
814
814
  * release
815
815
  *
816
- * @param {*} conn
816
+ * @param {*} _conn
817
817
  * @returns {*} {Promise<void>}
818
818
  * @memberof MemoryStore
819
819
  */
820
- release(conn: any): Promise<void>;
820
+ release(_conn: any): Promise<void>;
821
821
  /**
822
822
  * defineCommand
823
823
  *
824
- * @param {string} name
825
- * @param {*} scripts
824
+ * @param {string} _name
825
+ * @param {*} _scripts
826
826
  * @memberof MemoryStore
827
827
  */
828
- defineCommand(name: string, scripts: any): Promise<void>;
828
+ defineCommand(_name: string, _scripts: any): Promise<void>;
829
829
  /**
830
830
  * get and compare value
831
831
  *