Skip to content

Commit 10a1ee4

Browse files
committed
fix: chalk & inquirer imports
1 parent f500e3d commit 10a1ee4

File tree

16 files changed

+161
-118
lines changed

16 files changed

+161
-118
lines changed

lib/autoupdate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* <[email protected]> to get commercial licensing options.
2323
*/
2424
import { execSync } from 'child_process';
25-
import * as inquirer from 'inquirer';
25+
import inquirer, { QuestionCollection } from 'inquirer';
2626

2727
const pkg = require('../package.json');
2828

@@ -45,7 +45,7 @@ export async function checkForUpdate() {
4545
message: `New version ${remoteVersion} of ${
4646
pkg.name} available. Would you like to update?`,
4747
default: true,
48-
}] as inquirer.QuestionCollection);
48+
}] as QuestionCollection);
4949

5050
if (answer.update) {
5151
update();

lib/error.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* purchase a proprietary commercial license. Please contact us at
2222
* <[email protected]> to get commercial licensing options.
2323
*/
24-
import * as chalk from 'chalk';
24+
import chalk from 'chalk';
2525

2626
// that is just a printing function, no need to do specific tests
2727
// istanbul ignore next

lib/github.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* purchase a proprietary commercial license. Please contact us at
2222
* <[email protected]> to get commercial licensing options.
2323
*/
24-
import * as Github from '@octokit/rest';
24+
import { Octokit as Github } from '@octokit/rest';
2525

2626
const RX_DEPRECATION = /Deprecation:/;
2727

lib/license.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@
2222
* <[email protected]> to get commercial licensing options.
2323
*/
2424
import * as inquirer from 'inquirer';
25+
import autocompletePrompt from 'inquirer-autocomplete-prompt';
2526

26-
inquirer.registerPrompt(
27+
(<any>inquirer).registerPrompt(
2728
'autocomplete',
28-
require('inquirer-autocomplete-prompt')
29+
autocompletePrompt,
2930
);
3031

3132
const LICENSES: any = require('./licenses.json');
@@ -71,7 +72,7 @@ export async function licensingOptions(): Promise<{
7172
id: string,
7273
name: string
7374
}> {
74-
let answer: any = await inquirer.prompt<{ addLicense: boolean }>([{
75+
let answer: any = await (<any>(inquirer as any).prompt)([{
7576
type: 'confirm',
7677
name: 'addLicense',
7778
message: 'Would you like to use specific license for your services?',
@@ -86,7 +87,7 @@ export async function licensingOptions(): Promise<{
8687
const licenses: string[] = Object.keys(LICENSES)
8788
.map((id: string) => LICENSES[id]);
8889

89-
answer = await (<any>inquirer.prompt)([{
90+
answer = await (<any>(inquirer as any).prompt)([{
9091
type: 'autocomplete',
9192
name: 'licenseName',
9293
message: 'Select license:',

lib/template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* purchase a proprietary commercial license. Please contact us at
2222
* <[email protected]> to get commercial licensing options.
2323
*/
24-
import * as inquirer from 'inquirer';
24+
import inquirer from 'inquirer';
2525
import {
2626
TPL_HOME,
2727
CUSTOM_TPL_HOME,

package-lock.json

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"devDependencies": {
5959
"@types/chai": "^5.2.2",
6060
"@types/inquirer": "^9.0.8",
61+
"@types/inquirer-autocomplete-prompt": "^3.0.3",
6162
"@types/mocha": "^10.0.10",
6263
"@types/mock-require": "^3.0.0",
6364
"@types/node": "^24.0.8",

src/client/generate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import { Argv, Arguments } from 'yargs';
2525
import { IMQClient } from '@imqueue/rpc';
2626
import * as fs from 'fs';
2727
import * as p from 'path';
28-
import * as inquirer from 'inquirer';
29-
import * as chalk from 'chalk';
28+
import inquirer, { QuestionCollection } from 'inquirer';
29+
import chalk from 'chalk';
3030
import { printError } from '../../lib';
3131

3232
// noinspection JSUnusedGlobalSymbols
@@ -51,7 +51,7 @@ export const { command, describe, builder, promptOverride, handler } = {
5151
name: 'overwrite',
5252
default: false,
5353
message: `File "${filePath}" already exists. Overwrite it?`,
54-
}] as inquirer.QuestionCollection)) as { overwrite: boolean }
54+
}] as QuestionCollection)) as { overwrite: boolean }
5555
).overwrite;
5656

5757
if (!write) {

src/completions/off.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {
2828
writeFileSync as write
2929
} from 'fs';
3030
import { resolve, printError, IS_ZSH } from '../../lib';
31-
import * as chalk from 'chalk';
31+
import chalk from 'chalk';
3232

3333
let PROGRAM: string = '';
3434
let RX_REPLACE: RegExp;

src/completions/on.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {
2828
readFileSync as read
2929
} from 'fs';
3030
import { resolve, touch, printError, IS_ZSH } from '../../lib';
31-
import * as chalk from 'chalk';
31+
import chalk from 'chalk';
3232

3333
let PROGRAM: string = '';
3434
let RX_EXISTS: RegExp;

0 commit comments

Comments
 (0)