Skip to content

Commit

Permalink
chore: npm dedupe schematics packages (#5806)
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode authored Oct 31, 2023
1 parent 5514b6b commit ac1f420
Show file tree
Hide file tree
Showing 10 changed files with 140 additions and 1,615 deletions.
1,729 changes: 127 additions & 1,602 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions projects/addon-doc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
"repository": "https://github.com/taiga-family/taiga-ui",
"license": "Apache-2.0",
"dependencies": {
"@angular-devkit/schematics": "12.2.18",
"markdown-it": "13.0.2",
"ngx-highlightjs": "6.1.3",
"schematics-utilities": "2.0.3"
"ngx-highlightjs": "6.1.3"
},
"devDependencies": {
"@types/markdown-it": "13.0.5"
Expand Down
2 changes: 2 additions & 0 deletions projects/cdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
"repository": "https://github.com/taiga-family/taiga-ui",
"license": "Apache-2.0",
"dependencies": {
"@angular-devkit/schematics": "12.2.18",
"@ng-web-apis/common": "3.0.5",
"@ng-web-apis/mutation-observer": "3.0.5",
"@ng-web-apis/resize-observer": "3.0.5",
"@schematics/angular": "12.2.18",
"@tinkoff/ng-event-plugins": "3.1.0",
"@tinkoff/ng-polymorpheus": "4.2.0",
"tslib": "2.6.2"
Expand Down
2 changes: 1 addition & 1 deletion projects/cdk/schematics/ng-add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import {TuiSchema} from './schema';

export function ngAdd(options: TuiSchema): Rule {
return (tree: Tree, context: SchematicContext) => {
return (tree: Tree, context: SchematicContext): void => {
context.logger.info(`The main packages will be installed - ${MAIN_PACKAGES}`);

addDependencies(tree, options);
Expand Down
2 changes: 1 addition & 1 deletion projects/cdk/schematics/ng-add/steps/add-taiga-modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import {
import {TuiSchema} from '../schema';

export function addTaigaModules(options: TuiSchema): Rule {
return async (tree: Tree, context: SchematicContext) => {
return async (tree: Tree, context: SchematicContext): Promise<Rule | void> => {
const workspace = await getWorkspace(tree);
const project = getProjects(options, workspace)[0];

Expand Down
2 changes: 1 addition & 1 deletion projects/cdk/schematics/ng-add/steps/wrap-with-tui-root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {getStandaloneBootstrapFunction} from '../../utils/get-standalone-bootstr
import {TuiSchema} from '../schema';

export function wrapWithTuiRootComponent(options: TuiSchema): Rule {
return async (tree: Tree, context: SchematicContext) => {
return async (tree: Tree, context: SchematicContext): Promise<Rule | void> => {
const workspace = await getWorkspace(tree);
const project = getProjects(options, workspace)[0];

Expand Down
2 changes: 1 addition & 1 deletion projects/cdk/schematics/ng-update/v3-36/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,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, context: SchematicContext) => {
return (tree: Tree, context: SchematicContext): void => {
if (!getPackageJsonDependency(tree, OLD_PACKAGE)) {
!options[`skip-logs`] &&
titleLog(`${FINISH_SYMBOL} No migrations required for ${OLD_PACKAGE}\n`);
Expand Down
4 changes: 2 additions & 2 deletions projects/cdk/schematics/ng-update/v3/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function updateToV3(options: TuiSchema): Rule {
}

function main(options: TuiSchema): Rule {
return (tree: Tree, context: SchematicContext) => {
return (tree: Tree, context: SchematicContext): void => {
const fileSystem = getFileSystem(tree);

replaceDeepImports(options);
Expand Down Expand Up @@ -125,7 +125,7 @@ function addTaigaStyles(options: TuiSchema): Rule {
}

function showNormalizeWarning(): Rule {
return (tree: Tree, context: SchematicContext) => {
return (tree: Tree, context: SchematicContext): void => {
try {
if (getPackageJsonDependency(tree, `@taiga-ui/styles`)?.version) {
context.logger.warn(TUI_WARNING_NORMALIZE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const MANUAL_MIGRATION_TIPS = `Add ${JSON.stringify(
)} to angular.json manually`;

export function migrateTaigaProprietaryIcons(options: TuiSchema): Rule {
return async (tree: Tree, context: SchematicContext) => {
return async (tree: Tree, context: SchematicContext): Promise<Rule | void> => {
let proprietaryIcons: string | null = null;

try {
Expand Down
6 changes: 3 additions & 3 deletions projects/cdk/schematics/utils/get-projects.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {ProjectDefinition, WorkspaceDefinition} from '@angular-devkit/core/src/workspace';
import {workspaces} from '@angular-devkit/core';

import {TuiSchema} from '../ng-add/schema';

export function getProjects(
options: TuiSchema,
workspace: WorkspaceDefinition,
): ProjectDefinition[] {
workspace: workspaces.WorkspaceDefinition,
): workspaces.ProjectDefinition[] {
const projects = Array.from(workspace.projects.entries())
.filter(([_, project]) => project.targets.get(`build`))
.map(([_, project]) => project);
Expand Down

0 comments on commit ac1f420

Please sign in to comment.