@kvs/env 0.3.1 → 2.0.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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @kvs/env
1
+ # @kvs/env ![](https://badgen.net/bundlephobia/minzip/@kvs/env)
2
2
 
3
3
  Universal library for KVS.
4
4
 
@@ -13,7 +13,7 @@ Install with [npm](https://www.npmjs.com/):
13
13
  ## Usage
14
14
 
15
15
  ```ts
16
- import { KVSIndexedDB, kvsIndexedDB } from "@kvs/env";
16
+ import { kvsEnvStorage } from "@kvs/env";
17
17
  (async () => {
18
18
  type StorageSchema = {
19
19
  a1: string;
package/lib/browser.d.ts CHANGED
@@ -1,4 +1,17 @@
1
1
  import { KvsStorage } from "@kvs/storage";
2
2
  import { KvsIndexedDBOptions } from "@kvs/indexeddb";
3
3
  import { KvsEnvStorageOptions, KvsEnvStorageSchema } from "./share";
4
- export declare const kvsEnvStorage: <Schema extends KvsEnvStorageSchema>(options: KvsIndexedDBOptions<Schema>) => Promise<import("@kvs/types").KVS<Schema>>;
4
+ export declare const kvsEnvStorage: <Schema extends KvsEnvStorageSchema>(options: {
5
+ name: string;
6
+ version: number;
7
+ upgrade?({ kvs, oldVersion, newVersion }: {
8
+ kvs: import("@kvs/types").KVS<Schema>;
9
+ oldVersion: number;
10
+ newVersion: number;
11
+ }): Promise<any>;
12
+ } & {
13
+ [index: string]: any;
14
+ } & {
15
+ tableName?: string | undefined;
16
+ debug?: boolean | undefined;
17
+ }) => Promise<KvsStorage<Schema>>;
package/lib/browser.js CHANGED
@@ -11,7 +11,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.kvsEnvStorage = void 0;
13
13
  const indexeddb_1 = require("@kvs/indexeddb");
14
- exports.kvsEnvStorage = (options) => __awaiter(void 0, void 0, void 0, function* () {
15
- return indexeddb_1.kvsIndexedDB(options);
14
+ const kvsEnvStorage = (options) => __awaiter(void 0, void 0, void 0, function* () {
15
+ return (0, indexeddb_1.kvsIndexedDB)(options);
16
16
  });
17
+ exports.kvsEnvStorage = kvsEnvStorage;
17
18
  //# sourceMappingURL=browser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,8CAAmE;AAGtD,QAAA,aAAa,GAAG,CACzB,OAAmE,EACxC,EAAE;IAC7B,OAAO,wBAAY,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC,CAAA,CAAC"}
1
+ {"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,8CAAmE;AAG5D,MAAM,aAAa,GAAG,CACzB,OAAmE,EACxC,EAAE;IAC7B,OAAO,IAAA,wBAAY,EAAC,OAAO,CAAC,CAAC;AACjC,CAAC,CAAA,CAAC;AAJW,QAAA,aAAa,iBAIxB"}
package/lib/node.d.ts CHANGED
@@ -1,4 +1,17 @@
1
1
  import { KvsLocalStorage, KvsLocalStorageOptions } from "@kvs/node-localstorage";
2
2
  import { KvsEnvStorageOptions } from "./share";
3
3
  import { KVSIndexedSchema } from "@kvs/indexeddb/lib";
4
- export declare const kvsEnvStorage: <Schema extends KVSIndexedSchema>(options: KvsLocalStorageOptions<Schema>) => Promise<import("@kvs/types").KVS<Schema>>;
4
+ export declare const kvsEnvStorage: <Schema extends KVSIndexedSchema>(options: {
5
+ name: string;
6
+ version: number;
7
+ upgrade?({ kvs, oldVersion, newVersion }: {
8
+ kvs: import("@kvs/types").KVS<Schema>;
9
+ oldVersion: number;
10
+ newVersion: number;
11
+ }): Promise<any>;
12
+ } & {
13
+ [index: string]: any;
14
+ } & {
15
+ kvsVersionKey?: string | undefined;
16
+ storeFilePath?: string | undefined;
17
+ }) => Promise<KvsLocalStorage<Schema>>;
package/lib/node.js CHANGED
@@ -11,7 +11,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.kvsEnvStorage = void 0;
13
13
  const node_localstorage_1 = require("@kvs/node-localstorage");
14
- exports.kvsEnvStorage = (options) => __awaiter(void 0, void 0, void 0, function* () {
15
- return node_localstorage_1.kvsLocalStorage(options);
14
+ const kvsEnvStorage = (options) => __awaiter(void 0, void 0, void 0, function* () {
15
+ return (0, node_localstorage_1.kvsLocalStorage)(options);
16
16
  });
17
+ exports.kvsEnvStorage = kvsEnvStorage;
17
18
  //# sourceMappingURL=node.js.map
package/lib/node.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8DAAkG;AAIrF,QAAA,aAAa,GAAG,CACzB,OAAsE,EACtC,EAAE;IAClC,OAAO,mCAAe,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC,CAAA,CAAC"}
1
+ {"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8DAAkG;AAI3F,MAAM,aAAa,GAAG,CACzB,OAAsE,EACtC,EAAE;IAClC,OAAO,IAAA,mCAAe,EAAC,OAAO,CAAC,CAAC;AACpC,CAAC,CAAA,CAAC;AAJW,QAAA,aAAa,iBAIxB"}
@@ -1,4 +1,17 @@
1
1
  import { KvsStorage } from "@kvs/storage";
2
2
  import { KvsIndexedDBOptions } from "@kvs/indexeddb";
3
3
  import { KvsEnvStorageOptions, KvsEnvStorageSchema } from "./share";
4
- export declare const kvsEnvStorage: <Schema extends KvsEnvStorageSchema>(options: KvsIndexedDBOptions<Schema>) => Promise<import("@kvs/types").KVS<Schema>>;
4
+ export declare const kvsEnvStorage: <Schema extends KvsEnvStorageSchema>(options: {
5
+ name: string;
6
+ version: number;
7
+ upgrade?({ kvs, oldVersion, newVersion }: {
8
+ kvs: import("@kvs/types").KVS<Schema>;
9
+ oldVersion: number;
10
+ newVersion: number;
11
+ }): Promise<any>;
12
+ } & {
13
+ [index: string]: any;
14
+ } & {
15
+ tableName?: string | undefined;
16
+ debug?: boolean | undefined;
17
+ }) => Promise<KvsStorage<Schema>>;
package/module/node.d.ts CHANGED
@@ -1,4 +1,17 @@
1
1
  import { KvsLocalStorage, KvsLocalStorageOptions } from "@kvs/node-localstorage";
2
2
  import { KvsEnvStorageOptions } from "./share";
3
3
  import { KVSIndexedSchema } from "@kvs/indexeddb/lib";
4
- export declare const kvsEnvStorage: <Schema extends KVSIndexedSchema>(options: KvsLocalStorageOptions<Schema>) => Promise<import("@kvs/types").KVS<Schema>>;
4
+ export declare const kvsEnvStorage: <Schema extends KVSIndexedSchema>(options: {
5
+ name: string;
6
+ version: number;
7
+ upgrade?({ kvs, oldVersion, newVersion }: {
8
+ kvs: import("@kvs/types").KVS<Schema>;
9
+ oldVersion: number;
10
+ newVersion: number;
11
+ }): Promise<any>;
12
+ } & {
13
+ [index: string]: any;
14
+ } & {
15
+ kvsVersionKey?: string | undefined;
16
+ storeFilePath?: string | undefined;
17
+ }) => Promise<KvsLocalStorage<Schema>>;
package/module/share.js CHANGED
@@ -1 +1,2 @@
1
+ export {};
1
2
  //# sourceMappingURL=share.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvs/env",
3
- "version": "0.3.1",
3
+ "version": "2.0.0",
4
4
  "description": "Universal Storage for KVS.",
5
5
  "keywords": [
6
6
  "kvs",
@@ -35,7 +35,7 @@
35
35
  "build": "tsc -p . && tsc --project ./tsconfig.module.json",
36
36
  "clean": "rimraf lib/ module/",
37
37
  "prettier": "prettier --write \"**/*.{js,jsx,ts,tsx,css}\"",
38
- "prepublish": "npm run clean && npm run build",
38
+ "prepublishOnly": "npm run clean && npm run build",
39
39
  "test": "mocha \"test/**/*.ts\"",
40
40
  "watch": "tsc -p . --watch"
41
41
  },
@@ -46,22 +46,21 @@
46
46
  "trailingComma": "none"
47
47
  },
48
48
  "dependencies": {
49
- "@kvs/indexeddb": "^0.3.1",
50
- "@kvs/node-localstorage": "^0.3.0"
49
+ "@kvs/indexeddb": "^2.0.0",
50
+ "@kvs/node-localstorage": "^2.0.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@jsdevtools/karma-config": "^3.1.7",
54
- "@types/mocha": "^8.0.1",
55
- "@types/node": "^14.0.27",
56
- "lerna": "^3.22.1",
57
- "mocha": "^8.1.1",
54
+ "@types/mocha": "^9.0.0",
55
+ "@types/node": "^16.9.1",
56
+ "mocha": "^9.1.1",
58
57
  "prettier": "^2.0.5",
59
58
  "rimraf": "^3.0.2",
60
- "ts-loader": "^8.0.2",
61
- "typescript": "^3.9.7"
59
+ "ts-loader": "^8.2.0",
60
+ "typescript": "^4.2.4"
62
61
  },
63
62
  "publishConfig": {
64
63
  "access": "public"
65
64
  },
66
- "gitHead": "5c9554034e850f5bff73d5573742a6bab862e044"
65
+ "gitHead": "b43dd2fdbefe4ee5714d0690b2f8f576dc8c1417"
67
66
  }
package/CHANGELOG.md DELETED
@@ -1,46 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [0.3.1](https://github.com/azu/kvs/compare/v0.3.0...v0.3.1) (2020-08-22)
7
-
8
- **Note:** Version bump only for package @kvs/env
9
-
10
-
11
-
12
-
13
-
14
- # [0.3.0](https://github.com/azu/kvs/compare/v0.2.1...v0.3.0) (2020-08-22)
15
-
16
- **Note:** Version bump only for package @kvs/env
17
-
18
-
19
-
20
-
21
-
22
- ## [0.2.1](https://github.com/azu/kvs/compare/v0.2.0...v0.2.1) (2020-08-22)
23
-
24
- **Note:** Version bump only for package @kvs/env
25
-
26
-
27
-
28
-
29
-
30
- # [0.2.0](https://github.com/azu/kvs/compare/v0.1.0...v0.2.0) (2020-08-08)
31
-
32
-
33
- ### Features
34
-
35
- * **@kvs/env:** migrate Schema Type ([0951d08](https://github.com/azu/kvs/commit/0951d08405d42588454878a03c9082961ad0c363))
36
-
37
-
38
-
39
-
40
-
41
- # 0.1.0 (2020-08-08)
42
-
43
-
44
- ### Features
45
-
46
- * **@lvs/env:** add universal env ([36eef88](https://github.com/azu/kvs/commit/36eef88020e13d27545f237df4101174d541c098))