fixes for TypeScript 5.0

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-03-25 15:30:22 +01:00
parent cc0e135cb9
commit 2898b6c8d5
22 changed files with 72 additions and 45 deletions
+2 -2
View File
@@ -15,12 +15,12 @@
*/
import chalk from 'chalk';
import inquirer from 'inquirer';
import inquirer, { Answers } from 'inquirer';
import { AnyFactory, Prompt } from './types';
import * as factories from './factories';
import partition from 'lodash/partition';
function applyPromptMessageTransforms<T>(
function applyPromptMessageTransforms<T extends Answers>(
prompt: Prompt<T>,
transforms: {
message: (msg: string) => string;
+4 -2
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { DistinctQuestion } from 'inquirer';
import { Answers, DistinctQuestion } from 'inquirer';
export interface CreateContext {
/** The package scope to use for new packages */
@@ -37,7 +37,9 @@ export interface CreateContext {
export type AnyOptions = Record<string, string>;
export type Prompt<TOptions> = DistinctQuestion<TOptions> & { name: string };
export type Prompt<TOptions extends Answers> = DistinctQuestion<TOptions> & {
name: string;
};
export interface Factory<TOptions extends AnyOptions> {
/**