@esportsplus/web-storage 0.1.20 → 0.1.22

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.
@@ -1,4 +1,4 @@
1
- import { Options } from './types';
1
+ import { LocalForage, Options } from './types';
2
2
  declare class Store<T> {
3
3
  instance: LocalForage;
4
4
  iterate: LocalForage['iterate'];
@@ -1,7 +1,9 @@
1
+ import localforage from 'localforage';
1
2
  declare enum Driver {
2
3
  IndexedDB = 0,
3
4
  LocalStorage = 1
4
5
  }
6
+ type LocalForage = typeof localforage;
5
7
  type Options = {
6
8
  description?: string;
7
9
  driver?: string | string[];
@@ -9,4 +11,4 @@ type Options = {
9
11
  size?: number;
10
12
  version?: number;
11
13
  };
12
- export { Driver, Options };
14
+ export { Driver, LocalForage, Options };
package/package.json CHANGED
@@ -1,15 +1,12 @@
1
1
  {
2
2
  "author": "ICJR",
3
+ "dependencies": {
4
+ "localforage": "^1.10.0"
5
+ },
3
6
  "description": "Web storage utility",
4
7
  "devDependencies": {
5
- "glob": "^8.0.3",
6
- "localforage": "^1.10.0",
7
- "ts-loader": "^9.4.2",
8
8
  "tsc-alias": "^1.8.1",
9
- "tsconfig-paths-webpack-plugin": "^4.0.0",
10
- "typescript": "^4.9.3",
11
- "webpack": "^5.75.0",
12
- "webpack-cli": "^5.0.1"
9
+ "typescript": "^4.9.3"
13
10
  },
14
11
  "main": "./build/index.js",
15
12
  "name": "@esportsplus/web-storage",
@@ -21,5 +18,5 @@
21
18
  "prepublishOnly": "npm run build"
22
19
  },
23
20
  "types": "./build/index.d.ts",
24
- "version": "0.1.20"
21
+ "version": "0.1.22"
25
22
  }
@@ -1,4 +1,4 @@
1
- import { Driver, Options } from './types';
1
+ import { Driver, LocalForage, Options } from './types';
2
2
  import localforage from 'localforage';
3
3
 
4
4
 
@@ -1,8 +1,13 @@
1
+ import localforage from 'localforage';
2
+
3
+
1
4
  enum Driver {
2
5
  IndexedDB,
3
6
  LocalStorage
4
7
  };
5
8
 
9
+ type LocalForage = typeof localforage;
10
+
6
11
  type Options = {
7
12
  description?: string;
8
13
  driver?: string | string[];
@@ -12,4 +17,4 @@ type Options = {
12
17
  };
13
18
 
14
19
 
15
- export { Driver, Options };
20
+ export { Driver, LocalForage, Options };
package/tsconfig.json CHANGED
@@ -18,9 +18,9 @@
18
18
  "removeComments": true,
19
19
  "resolveJsonModule": true,
20
20
  "strict": true,
21
- "target": "esnext"
21
+ "target": "esnext",
22
+ "typeRoots": ["node_modules/@types"]
22
23
  },
23
24
  "exclude": ["node_modules"],
24
- "include": ["src"],
25
- "typeRoots": ["node_modules/@types"]
25
+ "include": ["src"]
26
26
  }
@@ -1,54 +0,0 @@
1
- const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
2
- const glob = require('glob');
3
-
4
-
5
- module.exports = ({ directory, entry, filename, library, output, production }) => {
6
- filename = filename || 'app';
7
- production = production == 'true' ? true : false;
8
-
9
- if (directory) {
10
- entry = glob.sync(`${directory}/{,!(node_modules)/**/}!(webpack)*!(.d).{ts,js}`);
11
- }
12
-
13
- if (production) {
14
- filename += '.min';
15
- }
16
-
17
- return {
18
- entry: {
19
- [filename]: entry
20
- },
21
- mode: (production ? 'production' : 'development'),
22
- module: {
23
- rules: [
24
- {
25
- test: /\.tsx?$/,
26
- use: 'ts-loader',
27
- exclude: /node_modules/,
28
- resolve: {
29
- fullySpecified: false,
30
- }
31
- }
32
- ]
33
- },
34
- optimization: {
35
- mangleWasmImports: production,
36
- minimize: production,
37
- usedExports: production
38
- },
39
- output: {
40
- library: library || filename,
41
- path: output,
42
- },
43
- resolve: {
44
- extensions: ['.js', '.ts', '.tsx'],
45
- fullySpecified: false,
46
- plugins: [
47
- new TsconfigPathsPlugin({
48
- extensions: ['.js', '.ts', '.tsx']
49
- })
50
- ]
51
- },
52
- watch: true
53
- };
54
- };