Skip to content

Commit df83e0e

Browse files
authoredOct 3, 2023
chore(repo): bump cliui (#19374)
1 parent a11e8f1 commit df83e0e

File tree

4 files changed

+21
-68
lines changed

4 files changed

+21
-68
lines changed
 

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@
325325
"@zkochan/js-yaml": "0.0.6",
326326
"axios": "1.0.0",
327327
"classnames": "^2.3.1",
328-
"cliui": "^7.0.2",
328+
"cliui": "^8.0.1",
329329
"core-js": "^3.6.5",
330330
"enquirer": "~2.3.6",
331331
"fast-glob": "3.2.7",

‎packages/nx/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"chalk": "^4.1.0",
4141
"cli-cursor": "3.1.0",
4242
"cli-spinners": "2.6.1",
43-
"cliui": "^7.0.2",
43+
"cliui": "^8.0.1",
4444
"dotenv": "~16.3.1",
4545
"dotenv-expand": "~10.0.0",
4646
"enquirer": "~2.3.6",

‎packages/nx/src/utils/print-help.ts

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import * as chalk from 'chalk';
22
import * as stringWidth from 'string-width';
3-
// cliui is the CLI layout engine developed by, and used within, yargs
4-
import * as cliui from 'cliui';
53
import { logger } from './logger';
64
import { output } from './output';
75
import { Schema } from './params';
86
import { nxVersion } from './versions';
97
import { readModulePackageJson } from './package-json';
108

9+
// cliui is the CLI layout engine developed by, and used within, yargs
10+
// the typings for cliui do not play nice with our tsconfig, it either
11+
// works in build or in test but not both.
12+
const cliui = require('cliui') as typeof import('cliui')['default'];
13+
1114
export function printHelp(
1215
header: string,
1316
schema: Schema,
@@ -91,7 +94,7 @@ function generateGeneratorOverviewOutput({
9194
description: string;
9295
aliases: string[];
9396
}): string {
94-
const ui = cliui();
97+
const ui = cliui(null);
9598
const overviewItemsLabelWidth =
9699
// Chars in labels "From" and "Name"
97100
4 +
@@ -156,7 +159,7 @@ function generateExecutorOverviewOutput({
156159
name: string;
157160
description: string;
158161
}): string {
159-
const ui = cliui();
162+
const ui = cliui(null);
160163
const overviewItemsLeftPadding = 2;
161164
const overviewItemsLabelWidth = overviewItemsLeftPadding + 'Executor:'.length;
162165

@@ -204,7 +207,7 @@ const formatOptionType = (optionConfig: Schema['properties'][0]) => {
204207
};
205208

206209
function generateOptionsOutput(schema: Schema): string {
207-
const ui = cliui();
210+
const ui = cliui(null);
208211
const flagAndAliasLeftPadding = 4;
209212
const flagAndAliasRightPadding = 4;
210213

@@ -281,7 +284,7 @@ function generateOptionsOutput(schema: Schema): string {
281284
{
282285
text: renderedTypesAndDefault,
283286
padding: [0, 0, 0, 0],
284-
align: 'right',
287+
align: 'right' as const,
285288
},
286289
];
287290

@@ -295,7 +298,7 @@ function generateExamplesOutput(schema: Schema): string {
295298
if (!schema.examples || schema.examples.length === 0) {
296299
return '';
297300
}
298-
const ui = cliui();
301+
const ui = cliui(null);
299302
const xPadding = 4;
300303

301304
ui.div({

‎pnpm-lock.yaml

+9-59
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

1 commit comments

Comments
 (1)

vercel[bot] commented on Oct 3, 2023

@vercel[bot]

Successfully deployed to the following URLs:

nx-dev – ./

nx-five.vercel.app
nx-dev-nrwl.vercel.app
nx.dev
nx-dev-git-master-nrwl.vercel.app

Please sign in to comment.