@ngx-pwa/local-storage
Advanced tools
Comparing version 13.0.0-0 to 13.0.0
{ | ||
"name": "@ngx-pwa/local-storage", | ||
"version": "13.0.0-0", | ||
"version": "13.0.0", | ||
"funding": { | ||
@@ -5,0 +5,0 @@ "type": "github", |
@@ -13,4 +13,9 @@ { | ||
"factory": "./ng-update/index#updateToV9" | ||
}, | ||
"migration-v13": { | ||
"version": "13", | ||
"description": "Updates @ngx-pwa/local-storage to v13", | ||
"factory": "./ng-update/index#updateToV13" | ||
} | ||
} | ||
} |
@@ -9,6 +9,17 @@ "use strict"; | ||
/* Get config */ | ||
const angularMajorVersion = (0, config_1.getAngularMajorVersion)(host); | ||
if (angularMajorVersion <= 9) { | ||
const angularMajorVersion = (0, config_1.getDependencyMajorVersion)('@angular/core', host); | ||
if (!angularMajorVersion) { | ||
context.logger.warn(`Not able to detect @angular/core version. Be aware that Angular versions <= 9 are no longer supported.`); | ||
} | ||
if (angularMajorVersion && (angularMajorVersion <= 9)) { | ||
throw new schematics_1.SchematicsException('Angular versions <= 9 are no longer supported.'); | ||
} | ||
const rxjsMajorVersion = (0, config_1.getDependencyMajorVersion)('rxjs', host); | ||
if (!rxjsMajorVersion) { | ||
context.logger.warn(`Not able to detect rxjs version. Be aware that rxjs version >= 7.4 is recommended for version 13 of this lib.`); | ||
} | ||
if (angularMajorVersion && rxjsMajorVersion | ||
&& (angularMajorVersion === 13) && (rxjsMajorVersion < 7)) { | ||
context.logger.warn(`rxjs should be updated to version >= 7.4. Support for rxjs version 6 is not guaranteed.`); | ||
} | ||
/* Task to run `npm install` (or user package manager) */ | ||
@@ -15,0 +26,0 @@ context.addTask(new tasks_1.NodePackageInstallTask()); |
import { Rule } from '@angular-devkit/schematics'; | ||
export declare function updateToV8(): Rule; | ||
export declare function updateToV9(): Rule; | ||
export declare function updateToV13(): Rule; |
@@ -12,3 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.updateToV9 = exports.updateToV8 = void 0; | ||
exports.updateToV13 = exports.updateToV9 = exports.updateToV8 = void 0; | ||
const schematics_1 = require("@angular-devkit/schematics"); | ||
@@ -35,2 +35,15 @@ const config_1 = require("../utility/config"); | ||
exports.updateToV9 = updateToV9; | ||
function updateToV13() { | ||
return (host, context) => { | ||
const rxjsMajorVersion = (0, config_1.getDependencyMajorVersion)('rxjs', host); | ||
if (!rxjsMajorVersion) { | ||
context.logger.warn(`Not able to detect rxjs version. Be aware that rxjs version >= 7.4 is recommended for version 13 of this lib.`); | ||
} | ||
if (rxjsMajorVersion && (rxjsMajorVersion < 7)) { | ||
context.logger.warn(`rxjs should be updated to version >= 7.4. Support for rxjs version 6 is not guaranteed.`); | ||
} | ||
return host; | ||
}; | ||
} | ||
exports.updateToV13 = updateToV13; | ||
//# sourceMappingURL=index.js.map |
import { Tree } from '@angular-devkit/schematics'; | ||
export declare const packageName = "@ngx-pwa/local-storage"; | ||
export declare function getAngularMajorVersion(host: Tree): number; | ||
export declare function getDependencyMajorVersion(name: string, host: Tree): number | undefined; | ||
export declare function getAllMainPaths(host: Tree): Promise<string[]>; |
@@ -12,3 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getAllMainPaths = exports.getAngularMajorVersion = exports.packageName = void 0; | ||
exports.getAllMainPaths = exports.getDependencyMajorVersion = exports.packageName = void 0; | ||
const schematics_1 = require("@angular-devkit/schematics"); | ||
@@ -18,13 +18,13 @@ const dependencies_1 = require("@schematics/angular/utility/dependencies"); | ||
exports.packageName = '@ngx-pwa/local-storage'; | ||
function getAngularMajorVersion(host) { | ||
const angularDependency = (0, dependencies_1.getPackageJsonDependency)(host, '@angular/core'); | ||
function getDependencyMajorVersion(name, host) { | ||
const dependency = (0, dependencies_1.getPackageJsonDependency)(host, name); | ||
/* Throw if Angular is not installed */ | ||
if (angularDependency === null) { | ||
throw new schematics_1.SchematicsException(`@angular/core is required to install ${exports.packageName}`); | ||
if (dependency === null) { | ||
return undefined; | ||
} | ||
/* Remove semver signs if present and keep only the first number (major) */ | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
return Number.parseInt(angularDependency.version.replace('~', '').replace('^', '').split('.')[0], 10); | ||
return Number.parseInt(dependency.version.replace('~', '').replace('^', '').split('.')[0], 10); | ||
} | ||
exports.getAngularMajorVersion = getAngularMajorVersion; | ||
exports.getDependencyMajorVersion = getDependencyMajorVersion; | ||
function getAllMainPaths(host) { | ||
@@ -31,0 +31,0 @@ return __awaiter(this, void 0, void 0, function* () { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
551888
5452
0
0
0