diff --git a/scripts/check-dist.ts b/scripts/check-dist.ts index 6d4a4dbf2b00..5c1f4900440e 100644 --- a/scripts/check-dist.ts +++ b/scripts/check-dist.ts @@ -1,4 +1,4 @@ -import * as path from 'node:path'; +import {resolve} from 'node:path'; import * as process from 'node:process'; import {getValueByFlag, hasFlag} from './shared/argv.utils'; @@ -7,17 +7,21 @@ import {checkIncorrectImports} from './shared/check-incorrect-imports'; import {checkPrivateExports} from './shared/check-private-exports'; import {checkRequireWithSrc} from './shared/check-require-with-src'; -const pathToSearch = path.resolve(getValueByFlag('--path', './dist')); - (async function main(): Promise { + const path = resolve(getValueByFlag('--path', './dist')); + try { await Promise.all([ - checkIncorrectImports(pathToSearch), - checkImportWithSrc(pathToSearch), + checkIncorrectImports(path), + checkImportWithSrc(path), hasFlag('--skip-check-private-exports') ? Promise.resolve() - : checkPrivateExports(pathToSearch), - checkRequireWithSrc(pathToSearch), + : checkPrivateExports(path), + checkRequireWithSrc(path), + checkIncorrectImports( + resolve(path, 'cdk/schematics'), + '@taiga-ui/cdk/schematics', + ), ]); } catch (error) { console.error(error); diff --git a/scripts/shared/check-incorrect-imports.ts b/scripts/shared/check-incorrect-imports.ts index f8c23df33db8..a93ea6531d3a 100644 --- a/scripts/shared/check-incorrect-imports.ts +++ b/scripts/shared/check-incorrect-imports.ts @@ -1,8 +1,8 @@ import {TuiGrepException} from './grep.exception'; import {grepByPattern} from './grep-by-pattern'; -export async function checkIncorrectImports(path: string): Promise { - const includePattern = 'import("../'; +export async function checkIncorrectImports(path: string, pattern = ''): Promise { + const includePattern = pattern || 'import("../'; const result = await grepByPattern({includePattern, path}); if (result.length > 0) {