@inquirer/core
Advanced tools
Comparing version 4.1.0 to 5.0.0
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -11,9 +34,12 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createPrompt = void 0; | ||
const readline = require("node:readline"); | ||
const readline = __importStar(require("node:readline")); | ||
const type_1 = require("@inquirer/type"); | ||
const mute_stream_1 = require("mute-stream"); | ||
const mute_stream_1 = __importDefault(require("mute-stream")); | ||
const signal_exit_1 = require("signal-exit"); | ||
const screen_manager_mjs_1 = require('./screen-manager.js'); | ||
const screen_manager_mjs_1 = __importDefault(require('./screen-manager.js')); | ||
const hook_engine_mjs_1 = require('./hook-engine.js'); | ||
@@ -24,3 +50,3 @@ // Take an AsyncPromptConfig and resolves all it's values. | ||
const message = typeof config.message === 'function' ? config.message() : config.message; | ||
return Object.assign(Object.assign({ validate: () => true }, config), { message: yield message }); | ||
return Object.assign(Object.assign({}, config), { message: yield message }); | ||
}); | ||
@@ -27,0 +53,0 @@ } |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const cli_width_1 = require("cli-width"); | ||
const strip_ansi_1 = require("strip-ansi"); | ||
const ansi_escapes_1 = require("ansi-escapes"); | ||
const cli_width_1 = __importDefault(require("cli-width")); | ||
const strip_ansi_1 = __importDefault(require("strip-ansi")); | ||
const ansi_escapes_1 = __importDefault(require("ansi-escapes")); | ||
const utils_mjs_1 = require('./utils.js'); | ||
@@ -7,0 +10,0 @@ const height = (content) => content.split('\n').length; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Separator = void 0; | ||
const chalk_1 = require("chalk"); | ||
const figures_1 = require("figures"); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
const figures_1 = __importDefault(require("figures")); | ||
/** | ||
@@ -7,0 +10,0 @@ * Separator object |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.usePagination = void 0; | ||
const chalk_1 = require("chalk"); | ||
const cli_width_1 = require("cli-width"); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
const cli_width_1 = __importDefault(require("cli-width")); | ||
const utils_mjs_1 = require('./utils.js'); | ||
@@ -7,0 +10,0 @@ const hook_engine_mjs_1 = require('./hook-engine.js'); |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.usePrefix = void 0; | ||
const chalk_1 = require("chalk"); | ||
const spinners = require("cli-spinners"); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
const cli_spinners_1 = __importDefault(require("cli-spinners")); | ||
const use_state_mjs_1 = require('./use-state.js'); | ||
const use_effect_mjs_1 = require('./use-effect.js'); | ||
const spinner = spinners.dots; | ||
const spinner = cli_spinners_1.default.dots; | ||
function usePrefix(isLoading = false) { | ||
@@ -10,0 +13,0 @@ const [tick, setTick] = (0, use_state_mjs_1.useState)(0); |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.breakLines = void 0; | ||
const wrap_ansi_1 = require("wrap-ansi"); | ||
const wrap_ansi_1 = __importDefault(require("wrap-ansi")); | ||
/** | ||
@@ -6,0 +9,0 @@ * Force line returns at specific width. This function is ANSI code friendly and it'll |
@@ -8,4 +8,4 @@ export * from './lib/key.js'; | ||
export { usePagination } from './lib/use-pagination.js'; | ||
export { createPrompt, type AsyncPromptConfig } from './lib/create-prompt.js'; | ||
export { createPrompt, type PromptConfig, type AsyncPromptConfig, } from './lib/create-prompt.js'; | ||
export { Separator } from './lib/Separator.js'; | ||
export { type InquirerReadline } from './lib/read-line.type.js'; |
@@ -1,11 +0,11 @@ | ||
import { type Prompt } from '@inquirer/type'; | ||
import { type Prompt, type Prettify } from '@inquirer/type'; | ||
export type AsyncPromptConfig = { | ||
message: string | Promise<string> | (() => Promise<string>); | ||
validate?: (value: string) => boolean | string | Promise<string | boolean>; | ||
}; | ||
export type PromptConfig<Config> = Prettify<AsyncPromptConfig & Config>; | ||
type ResolvedPromptConfig = { | ||
message: string; | ||
validate: (value: string) => boolean | string | Promise<string | boolean>; | ||
}; | ||
export declare function createPrompt<Value, Config extends AsyncPromptConfig>(view: (config: Config & ResolvedPromptConfig, done: (value: Value) => void) => string | [string, string | undefined]): Prompt<Value, Config>; | ||
type ViewFunction<Value, Config> = (config: Prettify<Config & ResolvedPromptConfig>, done: (value: Value) => void) => string | [string, string | undefined]; | ||
export declare function createPrompt<Value, Config extends AsyncPromptConfig>(view: ViewFunction<Value, Config>): Prompt<Value, Config>; | ||
export {}; |
{ | ||
"name": "@inquirer/core", | ||
"version": "4.1.0", | ||
"version": "5.0.0", | ||
"engines": { | ||
@@ -60,3 +60,3 @@ "node": ">=14.18.0" | ||
"dependencies": { | ||
"@inquirer/type": "^1.1.3", | ||
"@inquirer/type": "^1.1.4", | ||
"@types/mute-stream": "^0.0.1", | ||
@@ -77,3 +77,3 @@ "@types/node": "^20.6.0", | ||
"devDependencies": { | ||
"@inquirer/testing": "^2.1.5" | ||
"@inquirer/testing": "^2.1.6" | ||
}, | ||
@@ -100,3 +100,3 @@ "scripts": { | ||
}, | ||
"gitHead": "f5c544a8ded1c7dfb6ac8364759955e8f2ecfb0c" | ||
"gitHead": "c2d1c5fdfd1029f78351fb04e06f1cfb29d55bb6" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
62670
1225
0
Updated@inquirer/type@^1.1.4