Skip to content

Commit

Permalink
fix(schematics): @tinkoff/tui-editor should be installed after migr…
Browse files Browse the repository at this point in the history
…ation (#4900)
  • Loading branch information
splincode authored Jul 12, 2023
1 parent a90e3e6 commit 7755254
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion projects/cdk/schematics/ng-update/v3-36/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {Rule, SchematicContext, Tree} from '@angular-devkit/schematics';
import {NodePackageInstallTask} from '@angular-devkit/schematics/tasks';
import {
addPackageJsonDependency,
getPackageJsonDependency,
Expand All @@ -24,7 +25,7 @@ const NEW_PACKAGE_VERSION = `^1.0.1`;

// eslint-disable-next-line @typescript-eslint/naming-convention
export function updateToV3_36(options: TuiSchema): Rule {
return (tree: Tree, _: SchematicContext) => {
return (tree: Tree, context: SchematicContext) => {
if (!getPackageJsonDependency(tree, OLD_PACKAGE)) {
!options[`skip-logs`] &&
titleLog(`${FINISH_SYMBOL} No migrations required for ${OLD_PACKAGE}\n`);
Expand All @@ -41,7 +42,9 @@ export function updateToV3_36(options: TuiSchema): Rule {

replaceText([{from: OLD_PACKAGE, to: NEW_PACKAGE}], ALL_TS_FILES);
removePackageJsonDependency(tree, OLD_PACKAGE);

addPackageJsonDependency(tree, {name: NEW_PACKAGE, version: NEW_PACKAGE_VERSION});
context.addTask(new NodePackageInstallTask());

fileSystem.commitEdits();
saveActiveProject();
Expand Down

0 comments on commit 7755254

Please sign in to comment.