From 53b8596a5c7548aafe1403428c39db13d683e847 Mon Sep 17 00:00:00 2001 From: Barsukov Nikita <nikita.s.barsukov@gmail.com> Date: Wed, 21 Sep 2022 11:14:57 +0300 Subject: [PATCH] fix(cdk): `schematics` add `Node.js < 16`-support --- projects/cdk/schematics/ng-update/index.ts | 1 + projects/cdk/schematics/ng-update/steps/migrate-date-time.ts | 1 + projects/cdk/schematics/ng-update/steps/replace-styles.ts | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/projects/cdk/schematics/ng-update/index.ts b/projects/cdk/schematics/ng-update/index.ts index d3e136460562..ca44c994f1b0 100644 --- a/projects/cdk/schematics/ng-update/index.ts +++ b/projects/cdk/schematics/ng-update/index.ts @@ -5,6 +5,7 @@ import { saveActiveProject, setActiveProject, } from 'ng-morph'; +import {performance} from 'perf_hooks'; import {TAIGA_VERSION} from '../ng-add/constants/versions'; import {replaceEnums} from './steps/replace-enums'; import {renameTypes} from './steps/rename-types'; diff --git a/projects/cdk/schematics/ng-update/steps/migrate-date-time.ts b/projects/cdk/schematics/ng-update/steps/migrate-date-time.ts index 36b278363ed2..b679042c4382 100644 --- a/projects/cdk/schematics/ng-update/steps/migrate-date-time.ts +++ b/projects/cdk/schematics/ng-update/steps/migrate-date-time.ts @@ -1,4 +1,5 @@ import {CallExpression, Identifier, Node, SyntaxKind} from 'ng-morph'; +import {performance} from 'perf_hooks'; import {getNamedImportReferences} from '../../utils/get-named-import-references'; import {insertTodo} from '../../utils/insert-todo'; import { diff --git a/projects/cdk/schematics/ng-update/steps/replace-styles.ts b/projects/cdk/schematics/ng-update/steps/replace-styles.ts index d33f85895665..b020fae3a94f 100644 --- a/projects/cdk/schematics/ng-update/steps/replace-styles.ts +++ b/projects/cdk/schematics/ng-update/steps/replace-styles.ts @@ -14,7 +14,7 @@ export function replaceStyles() { if (fullText.includes(`taiga-ui-local`)) { DEPRECATED_BREAKPOINTS.forEach(({from, to}) => { - fullText = fullText.replaceAll( + fullText = fullText.replace( new RegExp(`(?<=@media.*)(${from})(?=[\\s,{])`, 'g'), to, );