@ngx-pwa/local-storage 13.0.6 → 14.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/lib/tokens.d.ts CHANGED
@@ -43,29 +43,19 @@ export declare const DEFAULT_IDB_NO_WRAP = true;
43
43
  export declare const IDB_NO_WRAP: InjectionToken<boolean>;
44
44
  export interface StorageConfig {
45
45
  /**
46
- * Allows to add a prefix before `localStorage` keys.
47
- * *Use only* for interoperability with other APIs or to avoid collision for multiple apps on the same subdomain.
48
- * **WARNING: do not change this option in an app already deployed in production, as previously stored data would be lost.**
46
+ * @deprecated Use `provideLocalStoragePrefix()` method instead
49
47
  */
50
48
  LSPrefix?: string;
51
49
  /**
52
- * Allows to change the name used for `indexedDB` database.
53
- * *Use only* for interoperability with other APIs or to avoid collision for multiple apps on the same subdomain.
54
- * **WARNING: do not change this option in an app already deployed in production, as previously stored data would be lost.**
50
+ * @deprecated Use `provideIndexedDBDataBaseName()` method instead
55
51
  */
56
52
  IDBDBName?: string;
57
53
  /**
58
- * Allows to change the name used for `indexedDB` object store.
59
- * *Use only* for interoperability with other APIs.
60
- * **WARNING: do not change this option in an app already deployed in production, as previously stored data would be lost.**
54
+ * @deprecated Use `provideIndexedDBStoreName()` method instead
61
55
  */
62
56
  IDBStoreName?: string;
63
57
  /**
64
- * Allows to change the database version used for `indexedDB` database.
65
- * Must be an unsigned **integer**.
66
- * **Use with caution as the creation of the store depends on the version.**
67
- * *Use only* for interoperability with other APIs or to avoid collision for multiple apps on the same subdomain.
68
- * **WARNING: do not change this option in an app already deployed in production, as previously stored data would be lost.**
58
+ * @deprecated Use `provideIndexedDBDataBaseVersion()` method instead
69
59
  */
70
60
  IDBDBVersion?: number;
71
61
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngx-pwa/local-storage",
3
- "version": "13.0.6",
3
+ "version": "14.0.0",
4
4
  "funding": {
5
5
  "type": "github",
6
6
  "url": "https://github.com/sponsors/cyrilletuzi"
@@ -20,9 +20,9 @@
20
20
  "tslib": "^2.3.0"
21
21
  },
22
22
  "peerDependencies": {
23
- "@angular/common": "^13.0.0 || ^14.0.0",
24
- "@angular/core": "^13.0.0 || ^14.0.0",
25
- "rxjs": "^6.5.3 || ^7.4.0"
23
+ "@angular/common": "^15.0.0",
24
+ "@angular/core": "^15.0.0",
25
+ "rxjs": "^7.4.0"
26
26
  },
27
27
  "schematics": "./schematics/collection.json",
28
28
  "ng-update": {
@@ -33,13 +33,13 @@
33
33
  "esm2020": "esm2020/ngx-pwa-local-storage.mjs",
34
34
  "fesm2020": "fesm2020/ngx-pwa-local-storage.mjs",
35
35
  "fesm2015": "fesm2015/ngx-pwa-local-storage.mjs",
36
- "typings": "ngx-pwa-local-storage.d.ts",
36
+ "typings": "index.d.ts",
37
37
  "exports": {
38
38
  "./package.json": {
39
39
  "default": "./package.json"
40
40
  },
41
41
  ".": {
42
- "types": "./ngx-pwa-local-storage.d.ts",
42
+ "types": "./index.d.ts",
43
43
  "esm2020": "./esm2020/ngx-pwa-local-storage.mjs",
44
44
  "es2020": "./fesm2020/ngx-pwa-local-storage.mjs",
45
45
  "es2015": "./fesm2015/ngx-pwa-local-storage.mjs",
package/public-api.d.ts CHANGED
@@ -7,3 +7,4 @@ export { LocalStorage } from './lib/storages/local-storage.service';
7
7
  export { ValidationError, VALIDATION_ERROR } from './lib/storages/exceptions';
8
8
  export { StorageConfig } from './lib/tokens';
9
9
  export { StorageModule } from './lib/storage.module';
10
+ export { provideIndexedDBDataBaseName, provideIndexedDBDataBaseVersion, provideIndexedDBStoreName, provideLocalStoragePrefix } from './lib/providers';
@@ -15,6 +15,11 @@
15
15
  "version": "13",
16
16
  "description": "Updates @ngx-pwa/local-storage to v13",
17
17
  "factory": "./ng-update/index#updateToV13"
18
+ },
19
+ "migration-v15": {
20
+ "version": "15",
21
+ "description": "Updates @ngx-pwa/local-storage to v15",
22
+ "factory": "./ng-update/index#updateToV15"
18
23
  }
19
24
  }
20
25
  }
@@ -8,14 +8,19 @@ function default_1() {
8
8
  /* Get config */
9
9
  const angularMajorVersion = (0, config_1.getDependencyMajorVersion)('@angular/core', host);
10
10
  if (!angularMajorVersion) {
11
- context.logger.warn(`Not able to detect @angular/core version. Be aware that Angular versions <= 10 are no longer supported.`);
11
+ context.logger.warn(`Not able to detect @angular/core version. Be aware that Angular versions <= 12 are no longer supported.`);
12
12
  }
13
- if (angularMajorVersion && (angularMajorVersion <= 10)) {
14
- throw new schematics_1.SchematicsException('Angular versions <= 10 are no longer supported.');
13
+ if (angularMajorVersion && (angularMajorVersion <= 12)) {
14
+ throw new schematics_1.SchematicsException('Angular versions <= 12 are no longer supported.');
15
15
  }
16
16
  const rxjsMajorVersion = (0, config_1.getDependencyMajorVersion)('rxjs', host);
17
17
  if (!rxjsMajorVersion) {
18
- context.logger.warn(`Not able to detect rxjs version. Be aware that rxjs version >= 7.4 is recommended for Angular >= 13.`);
18
+ // eslint-disable-next-line max-len
19
+ context.logger.warn(`Not able to detect rxjs version. Be aware that rxjs version >= 7.4 is recommended for Angular 13 & 14 and required for Angular >= 15.`);
20
+ }
21
+ if (angularMajorVersion && rxjsMajorVersion
22
+ && (angularMajorVersion >= 15) && (rxjsMajorVersion < 7)) {
23
+ throw new schematics_1.SchematicsException('rxjs >= 7.4 is required for this lib, rxjs 6 is not supported.');
19
24
  }
20
25
  if (angularMajorVersion && rxjsMajorVersion
21
26
  && (angularMajorVersion >= 13) && (rxjsMajorVersion < 7)) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../projects/ngx-pwa/local-storage/schematics/ng-add/index.ts"],"names":[],"mappings":";;AAAA,2DAAsG;AACtG,4DAA0E;AAE1E,8CAA8D;AAE9D;IACE,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAE/C,gBAAgB;QAChB,MAAM,mBAAmB,GAAG,IAAA,kCAAyB,EAAC,eAAe,EAAE,IAAI,CAAC,CAAC;QAE7E,IAAI,CAAC,mBAAmB,EAAE;YACxB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,yGAAyG,CAAC,CAAC;SAChI;QAED,IAAI,mBAAmB,IAAI,CAAC,mBAAmB,IAAI,EAAE,CAAC,EAAE;YACtD,MAAM,IAAI,gCAAmB,CAAC,iDAAiD,CAAC,CAAC;SAClF;QAED,MAAM,gBAAgB,GAAG,IAAA,kCAAyB,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAEjE,IAAI,CAAC,gBAAgB,EAAE;YACrB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,sGAAsG,CAAC,CAAC;SAC7H;QAED,IAAI,mBAAmB,IAAI,gBAAgB;eACtC,CAAC,mBAAmB,IAAI,EAAE,CAAC,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC,EAAE;YACxD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,yFAAyF,CAAC,CAAC;SAClH;QAED,yDAAyD;QACzD,OAAO,CAAC,OAAO,CAAC,IAAI,8BAAsB,EAAE,CAAC,CAAC;QAE9C,OAAO,IAAA,kBAAK,EAAC,EAAE,CAAC,CAAC;IAEnB,CAAC,CAAC;AACJ,CAAC;AA/BD,4BA+BC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../projects/ngx-pwa/local-storage/schematics/ng-add/index.ts"],"names":[],"mappings":";;AAAA,2DAAsG;AACtG,4DAA0E;AAE1E,8CAA8D;AAE9D;IACE,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAE/C,gBAAgB;QAChB,MAAM,mBAAmB,GAAG,IAAA,kCAAyB,EAAC,eAAe,EAAE,IAAI,CAAC,CAAC;QAE7E,IAAI,CAAC,mBAAmB,EAAE;YACxB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,yGAAyG,CAAC,CAAC;SAChI;QAED,IAAI,mBAAmB,IAAI,CAAC,mBAAmB,IAAI,EAAE,CAAC,EAAE;YACtD,MAAM,IAAI,gCAAmB,CAAC,iDAAiD,CAAC,CAAC;SAClF;QAED,MAAM,gBAAgB,GAAG,IAAA,kCAAyB,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAEjE,IAAI,CAAC,gBAAgB,EAAE;YACrB,mCAAmC;YACnC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,uIAAuI,CAAC,CAAC;SAC9J;QAED,IAAI,mBAAmB,IAAI,gBAAgB;eACtC,CAAC,mBAAmB,IAAI,EAAE,CAAC,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC,EAAE;YACxD,MAAM,IAAI,gCAAmB,CAAC,gEAAgE,CAAC,CAAC;SACnG;QAED,IAAI,mBAAmB,IAAI,gBAAgB;eACtC,CAAC,mBAAmB,IAAI,EAAE,CAAC,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC,EAAE;YACxD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,yFAAyF,CAAC,CAAC;SAClH;QAED,yDAAyD;QACzD,OAAO,CAAC,OAAO,CAAC,IAAI,8BAAsB,EAAE,CAAC,CAAC;QAE9C,OAAO,IAAA,kBAAK,EAAC,EAAE,CAAC,CAAC;IAEnB,CAAC,CAAC;AACJ,CAAC;AArCD,4BAqCC"}
@@ -2,3 +2,4 @@ import { Rule } from '@angular-devkit/schematics';
2
2
  export declare function updateToV8(): Rule;
3
3
  export declare function updateToV9(): Rule;
4
4
  export declare function updateToV13(): Rule;
5
+ export declare function updateToV15(): Rule;
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.updateToV13 = exports.updateToV9 = exports.updateToV8 = void 0;
12
+ exports.updateToV15 = exports.updateToV13 = exports.updateToV9 = exports.updateToV8 = void 0;
13
13
  const schematics_1 = require("@angular-devkit/schematics");
14
14
  const config_1 = require("../utility/config");
15
15
  const module_1 = require("../utility/module");
@@ -44,4 +44,18 @@ function updateToV13() {
44
44
  };
45
45
  }
46
46
  exports.updateToV13 = updateToV13;
47
+ function updateToV15() {
48
+ return (host, context) => {
49
+ const rxjsMajorVersion = (0, config_1.getDependencyMajorVersion)('rxjs', host);
50
+ if (!rxjsMajorVersion) {
51
+ // eslint-disable-next-line max-len
52
+ context.logger.warn(`Not able to detect rxjs version. Be aware that rxjs version >= 7.4 is required for version 15 of this lib, rxjs 6 is not supported.`);
53
+ }
54
+ if (rxjsMajorVersion && (rxjsMajorVersion < 7)) {
55
+ throw new schematics_1.SchematicsException('rxjs >= 7.4 is required for this lib, rxjs 6 is not supported.');
56
+ }
57
+ return host;
58
+ };
59
+ }
60
+ exports.updateToV15 = updateToV15;
47
61
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../projects/ngx-pwa/local-storage/schematics/ng-update/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2DAAiF;AAEjF,8CAA+E;AAC/E,8CAAiD;AAEjD,SAAgB,UAAU;IACxB,OAAO,CAAO,IAAU,EAAE,EAAE;QAE1B,gBAAgB;QAChB,MAAM,SAAS,GAAG,MAAM,IAAA,wBAAe,EAAC,IAAI,CAAC,CAAC;QAE9C,wCAAwC;QACxC,OAAO,IAAA,kBAAK,EAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAA,qBAAY,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEpE,CAAC,CAAA,CAAC;AACJ,CAAC;AAVD,gCAUC;AAED,SAAgB,UAAU;IACxB,OAAO,CAAO,IAAU,EAAE,EAAE;QAE1B,gBAAgB;QAChB,MAAM,SAAS,GAAG,MAAM,IAAA,wBAAe,EAAC,IAAI,CAAC,CAAC;QAE9C,wCAAwC;QACxC,OAAO,IAAA,kBAAK,EAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAA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