diff --git a/package.json b/package.json index b8d3d60a533a7..1f67da9001e23 100644 --- a/package.json +++ b/package.json @@ -325,7 +325,7 @@ "@zkochan/js-yaml": "0.0.6", "axios": "1.0.0", "classnames": "^2.3.1", - "cliui": "^7.0.2", + "cliui": "^8.0.1", "core-js": "^3.6.5", "enquirer": "~2.3.6", "fast-glob": "3.2.7", diff --git a/packages/nx/package.json b/packages/nx/package.json index 6ea222477461d..1beae3011ba91 100644 --- a/packages/nx/package.json +++ b/packages/nx/package.json @@ -40,7 +40,7 @@ "chalk": "^4.1.0", "cli-cursor": "3.1.0", "cli-spinners": "2.6.1", - "cliui": "^7.0.2", + "cliui": "^8.0.1", "dotenv": "~16.3.1", "dotenv-expand": "~10.0.0", "enquirer": "~2.3.6", diff --git a/packages/nx/src/utils/print-help.ts b/packages/nx/src/utils/print-help.ts index 47c9795ecc312..2e070dbd0683c 100644 --- a/packages/nx/src/utils/print-help.ts +++ b/packages/nx/src/utils/print-help.ts @@ -1,13 +1,16 @@ import * as chalk from 'chalk'; import * as stringWidth from 'string-width'; -// cliui is the CLI layout engine developed by, and used within, yargs -import * as cliui from 'cliui'; import { logger } from './logger'; import { output } from './output'; import { Schema } from './params'; import { nxVersion } from './versions'; import { readModulePackageJson } from './package-json'; +// cliui is the CLI layout engine developed by, and used within, yargs +// the typings for cliui do not play nice with our tsconfig, it either +// works in build or in test but not both. +const cliui = require('cliui') as typeof import('cliui')['default']; + export function printHelp( header: string, schema: Schema, @@ -91,7 +94,7 @@ function generateGeneratorOverviewOutput({ description: string; aliases: string[]; }): string { - const ui = cliui(); + const ui = cliui(null); const overviewItemsLabelWidth = // Chars in labels "From" and "Name" 4 + @@ -156,7 +159,7 @@ function generateExecutorOverviewOutput({ name: string; description: string; }): string { - const ui = cliui(); + const ui = cliui(null); const overviewItemsLeftPadding = 2; const overviewItemsLabelWidth = overviewItemsLeftPadding + 'Executor:'.length; @@ -204,7 +207,7 @@ const formatOptionType = (optionConfig: Schema['properties'][0]) => { }; function generateOptionsOutput(schema: Schema): string { - const ui = cliui(); + const ui = cliui(null); const flagAndAliasLeftPadding = 4; const flagAndAliasRightPadding = 4; @@ -281,7 +284,7 @@ function generateOptionsOutput(schema: Schema): string { { text: renderedTypesAndDefault, padding: [0, 0, 0, 0], - align: 'right', + align: 'right' as const, }, ]; @@ -295,7 +298,7 @@ function generateExamplesOutput(schema: Schema): string { if (!schema.examples || schema.examples.length === 0) { return ''; } - const ui = cliui(); + const ui = cliui(null); const xPadding = 4; ui.div({ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3f2a462b40848..0e29a43cbbe28 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,9 +1,5 @@ lockfileVersion: '6.0' -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - overrides: minimist: ^1.2.6 underscore: ^1.12.1 @@ -64,8 +60,8 @@ dependencies: specifier: ^2.3.1 version: 2.3.2 cliui: - specifier: ^7.0.2 - version: 7.0.4 + specifier: ^8.0.1 + version: 8.0.1 core-js: specifier: ^3.6.5 version: 3.26.0 @@ -250,7 +246,7 @@ devDependencies: version: 9.1.6(@nestjs/common@9.1.6)(@nestjs/core@9.1.6) '@nestjs/schematics': specifier: ^9.1.0 - version: 9.1.0(typescript@5.1.3) + version: 9.1.0(chokidar@3.5.3)(typescript@4.9.4) '@nestjs/swagger': specifier: ^6.0.0 version: 6.1.3(@nestjs/common@9.1.6)(@nestjs/core@9.1.6)(reflect-metadata@0.1.13) @@ -5299,20 +5295,6 @@ packages: - chokidar dev: true - /@nestjs/schematics@9.1.0(typescript@5.1.3): - resolution: {integrity: sha512-/7CyMTnPJSK9/xD9CkCqwuHPOlHVlLC2RDnbdCJ7mIO07SdbBbY14msTqtYW9VRQtsjZPLh1GTChf7ryJUImwA==} - peerDependencies: - typescript: '>=4.3.5' - dependencies: - '@angular-devkit/core': 15.2.4(chokidar@3.5.3) - '@angular-devkit/schematics': 15.2.4(chokidar@3.5.3) - jsonc-parser: 3.2.0 - pluralize: 8.0.0 - typescript: 5.1.3 - transitivePeerDependencies: - - chokidar - dev: true - /@nestjs/swagger@6.1.3(@nestjs/common@9.1.6)(@nestjs/core@9.1.6)(reflect-metadata@0.1.13): resolution: {integrity: sha512-H9C/yRgLFb5QrAt6iGrYmIX9X7Q0zXkgZaTNUATljUBra+RCWrEUbLHBcGjTAOtcIyGV/vmyCLv68YSVcZoE0Q==} peerDependencies: @@ -5845,42 +5827,6 @@ packages: - typescript dev: true - /@nrwl/js@15.8.0(@swc-node/register@1.6.7)(@swc/core@1.3.86)(nx@15.8.0)(prettier@2.7.1)(typescript@5.1.3): - resolution: {integrity: sha512-l2Q7oFpzx6ul7G0nKpMkrvnIEaOY+X8fc2g2Db5WqpnnBdfkrtWXZPg/O4DQ1p9O6BXrZ+Q2AK9bfgnliiwyEg==} - dependencies: - '@babel/core': 7.22.9 - '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.22.9) - '@babel/plugin-proposal-decorators': 7.21.0(@babel/core@7.22.9) - '@babel/plugin-transform-runtime': 7.22.9(@babel/core@7.22.9) - '@babel/preset-env': 7.22.5(@babel/core@7.22.9) - '@babel/preset-typescript': 7.22.5(@babel/core@7.22.9) - '@babel/runtime': 7.22.6 - '@nrwl/devkit': 15.8.0(nx@15.8.0)(typescript@5.1.3) - '@nrwl/workspace': 15.8.0(@swc-node/register@1.6.7)(@swc/core@1.3.86)(eslint@8.46.0)(prettier@2.7.1)(typescript@5.1.3) - '@phenomnomnominal/tsquery': 4.1.1(typescript@5.1.3) - babel-plugin-const-enum: 1.2.0(@babel/core@7.22.9) - babel-plugin-macros: 2.8.0 - babel-plugin-transform-typescript-metadata: 0.3.2(@babel/core@7.22.9) - chalk: 4.1.2 - fast-glob: 3.2.7 - fs-extra: 11.1.1 - ignore: 5.2.0 - js-tokens: 4.0.0 - minimatch: 3.0.5 - source-map-support: 0.5.19 - tree-kill: 1.2.2 - tslib: 2.6.1 - transitivePeerDependencies: - - '@babel/traverse' - - '@swc-node/register' - - '@swc/core' - - debug - - nx - - prettier - - supports-color - - typescript - dev: true - /@nrwl/js@16.8.1(@swc-node/register@1.6.7)(@swc/core@1.3.86)(@types/node@18.16.9)(nx@16.9.0-rc.1)(typescript@5.1.3)(verdaccio@5.15.4): resolution: {integrity: sha512-I5kCtk0TUvcvJXnD6fbOI1+L4EBHbSZCXVCkv3eXKOeAj0cJ6cOt2g6S7DpWPf2P7zTq22XOPNJy3C8u9tCbgQ==} dependencies: @@ -5907,7 +5853,7 @@ packages: optional: true dependencies: '@nrwl/devkit': 15.8.0(nx@15.8.0)(typescript@5.1.3) - '@nrwl/js': 15.8.0(@swc-node/register@1.6.7)(@swc/core@1.3.86)(nx@15.8.0)(prettier@2.7.1)(typescript@5.1.3) + '@nrwl/js': 15.8.0(@swc-node/register@1.6.7)(@swc/core@1.3.86)(eslint@8.46.0)(nx@16.9.0-rc.1)(prettier@2.7.1)(typescript@5.1.3) '@phenomnomnominal/tsquery': 4.1.1(typescript@5.1.3) eslint: 8.46.0 tmp: 0.2.1 @@ -13425,6 +13371,7 @@ packages: string-width: 4.2.3 strip-ansi: 6.0.1 wrap-ansi: 7.0.0 + dev: true /cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} @@ -13433,7 +13380,6 @@ packages: string-width: 4.2.3 strip-ansi: 6.0.1 wrap-ansi: 7.0.0 - dev: true /clone-deep@4.0.1: resolution: {integrity: sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==} @@ -28512,3 +28458,7 @@ packages: /zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} dev: true + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false