@ngrx/effects
Advanced tools
Comparing version 18.0.0 to 18.0.1
@@ -35,3 +35,2 @@ "use strict"; | ||
return function (tree, ctx) { | ||
var changes = []; | ||
(0, schematics_core_1.addPackageToPackageJson)(tree, 'dependencies', '@ngrx/operators', '^18.0.0'); | ||
@@ -42,7 +41,10 @@ (0, schematics_core_1.visitTSSourceFiles)(tree, function (sourceFile) { | ||
getImportDeclarations(sourceFile, importDeclarations); | ||
var effectsImportsAndDeclaration = importDeclarations | ||
var effectsImportsAndDeclarations = importDeclarations | ||
.map(function (effectsImportDeclaration) { | ||
var effectsImports = getEffectsNamedBinding(effectsImportDeclaration); | ||
if (effectsImports) { | ||
return { effectsImports: effectsImports, effectsImportDeclaration: effectsImportDeclaration }; | ||
if (effectsImports.elements.some(function (element) { return element.name.getText() === 'concatLatestFrom'; })) { | ||
return { effectsImports: effectsImports, effectsImportDeclaration: effectsImportDeclaration }; | ||
} | ||
return undefined; | ||
} | ||
@@ -53,3 +55,11 @@ else { | ||
}) | ||
.find(Boolean); | ||
.filter(Boolean); | ||
if (effectsImportsAndDeclarations.length === 0) { | ||
return; | ||
} | ||
else if (effectsImportsAndDeclarations.length > 1) { | ||
ctx.logger.info('[@ngrx/effects] Skipping because of multiple `concatLatestFrom` imports'); | ||
return; | ||
} | ||
var _b = __read(effectsImportsAndDeclarations, 1), effectsImportsAndDeclaration = _b[0]; | ||
if (!effectsImportsAndDeclaration) { | ||
@@ -66,2 +76,3 @@ return; | ||
.join(', '); | ||
var changes = []; | ||
// Remove `concatLatestFrom` from @ngrx/effects and leave the other imports | ||
@@ -91,3 +102,4 @@ if (otherEffectsImports) { | ||
var newOperatorsImport = "import { concatLatestFrom } from '@ngrx/operators';"; | ||
changes.push(new schematics_core_1.InsertChange(sourceFile.fileName, effectsImportDeclaration.getEnd() + 1, "".concat(newOperatorsImport, "\n"))); | ||
changes.push(new schematics_core_1.InsertChange(sourceFile.fileName, effectsImportDeclaration.getEnd() + 1, "".concat(newOperatorsImport, "\n") // not os-independent for snapshot tests | ||
)); | ||
} | ||
@@ -94,0 +106,0 @@ (0, schematics_core_1.commitChanges)(tree, sourceFile.fileName, changes); |
{ | ||
"name": "@ngrx/effects", | ||
"version": "18.0.0", | ||
"version": "18.0.1", | ||
"description": "Side effect model for @ngrx/store", | ||
@@ -25,3 +25,3 @@ "repository": { | ||
"@angular/core": "^18.0.0", | ||
"@ngrx/store": "18.0.0", | ||
"@ngrx/store": "18.0.1", | ||
"rxjs": "^6.5.3 || ^7.5.0" | ||
@@ -48,3 +48,3 @@ }, | ||
"dependencies": { | ||
"@ngrx/operators": "17.0.0-beta.0", | ||
"@ngrx/operators": "18.0.1", | ||
"tslib": "^2.0.0" | ||
@@ -51,0 +51,0 @@ }, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.platformVersion = void 0; | ||
exports.platformVersion = '^18.0.0'; | ||
exports.platformVersion = '^18.0.1'; | ||
//# sourceMappingURL=libs-version.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
560244
4928
+ Added@ngrx/operators@18.0.1(transitive)
+ Added@ngrx/store@18.0.1(transitive)
- Removed@ngrx/operators@17.0.0-beta.0(transitive)
- Removed@ngrx/store@18.0.0(transitive)
Updated@ngrx/operators@18.0.1