Skip to content

Commit 3e3d92f

Browse files
chore(deps): update dependency inquirer to v12 (#677)
This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [inquirer](https://redirect.github.com/SBoudrias/Inquirer.js/blob/main/packages/inquirer/README.md) ([source](https://redirect.github.com/SBoudrias/Inquirer.js)) | [`~9.3.0` -> `~12.1.0`](https://renovatebot.com/diffs/npm/inquirer/9.3.7/12.1.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/inquirer/12.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/inquirer/12.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/inquirer/9.3.7/12.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/inquirer/9.3.7/12.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>SBoudrias/Inquirer.js (inquirer)</summary> ### [`v12.1.0`](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@12.1.0) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@12.1.0) ### [`v12.0.1`](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@12.0.1) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@12.0.1) ### [`v12.0.0`](https://redirect.github.com/SBoudrias/Inquirer.js/releases/tag/inquirer%4012.0.0) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@12.0.0) - `@types/node` is now only a `peerDependencies`. This reduces the install size of inquirer dramatically for folks not using Typescript. It's unlikely to break your builds if you used TS already, if it does run `npm install --dev @&#8203;types/node`/`yarn add --dev @&#8203;types/node`. ### [`v11.1.0`](https://redirect.github.com/SBoudrias/Inquirer.js/releases/tag/inquirer%4011.1.0) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@11.1.0) - Now exports base utility Typescript types: `import type { Question, DistinctQuestion, Answers } from 'inquirer';` You should use as follow to keep the inference working properly: ```ts const questions = [ { ... } ] as const satisfies Question[]; // If you're not using inquirer plugins, `Question` could alternatively be replaced by `DistinctQuestion` for stricter checks. ``` ### [`v11.0.2`](https://redirect.github.com/SBoudrias/Inquirer.js/releases/tag/inquirer%4011.0.2) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@11.0.2) - Fix [#&#8203;1555](https://redirect.github.com/SBoudrias/Inquirer.js/issues/1555): `when` behaviour changed unexpectedly when returning a falsy value. ### [`v11.0.1`](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@11.0.1) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@11.0.1) ### [`v11.0.0`](https://redirect.github.com/SBoudrias/Inquirer.js/releases/tag/inquirer%4011.0.0) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@11.0.0) No technical breaking changes; but we changed the style of the question `prefix` once the answer is provided. Once a question is answer, the prefix becomes a tick mark (previously it was the same `?` as when the prompt is idle.) This is theme-able, and so can be overwritten to with `theme.prefix`. ### [`v10.2.2`](https://redirect.github.com/SBoudrias/Inquirer.js/releases/tag/inquirer%4010.2.2) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.2.2) - Fix the `filter` option not working. - The `signal: AbortSignal` didn't work with class based prompts (OSS plugins.) Now it should work consistently with legacy style prompts. ### [`v10.2.1`](https://redirect.github.com/SBoudrias/Inquirer.js/releases/tag/inquirer%4010.2.1) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.2.1) - Fix `expand` prompt being broken if a Separator was in the `choices` array. ### [`v10.2.0`](https://redirect.github.com/SBoudrias/Inquirer.js/releases/tag/inquirer%4010.2.0) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.2.0) - Includes various fixes & new features to the different built-in prompts - Fix: Major rework of the Typescript types. Hoping to reduce the amount of finicky type errors (or wrong types) you might've ran into. ### [`v10.1.8`](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.1.8) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.1.8) ### [`v10.1.7`](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.1.7) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.1.7) ### [`v10.1.6`](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.1.6) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.1.6) ### [`v10.1.5`](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.1.5) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.1.5) ### [`v10.1.4`](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.1.4) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.1.4) ### [`v10.1.3`](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.1.3) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.1.3) ### [`v10.1.2`](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.1.2) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.1.2) ### [`v10.1.1`](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.1.1) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.1.1) ### [`v10.1.0`](https://redirect.github.com/SBoudrias/Inquirer.js/releases/tag/inquirer%4010.1.0) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.1.0) - Adds the new `{ type: 'search' }` prompt. ### [`v10.0.4`](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.0.4) ### [`v10.0.3`](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.0.3) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.0.3) ### [`v10.0.2`](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.0.2) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.0.2) ### [`v10.0.1`](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.0.1) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.0.1) ### [`v10.0.0`](https://redirect.github.com/SBoudrias/Inquirer.js/releases/tag/inquirer%4010.0.0) [Compare Source](https://redirect.github.com/SBoudrias/Inquirer.js/compare/[email protected]@10.0.0) - Re-implemented with Typescript. - Adding CJS support (now `inquirer` is publishes a dual-build CJS/ESM.) - All core prompts are now coming from [`@inquirer/prompt`](https://redirect.github.com/SBoudrias/Inquirer.js). - Custom prompts now should be [implemented with `@inquirer/core`](https://redirect.github.com/SBoudrias/Inquirer.js/tree/main/packages/core). Custom prompts built on `[email protected]` will keep working, but should plan a migration. - `inquirer.ui.BottomBar` is deleted. My expectation is that this release should be a drop-in replacement for people using `inquirer.prompt()` and built-ins 🤞🏻. Please open an issue on Github if you run into issues migrating; it's a large rewrite and there might be a few sharp edges to cut! Hope you'll like this new release. </details> --- ### Configuration 📅 **Schedule**: Branch creation - "every weekday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/apify/apify-cli). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC45Ny4wIiwidXBkYXRlZEluVmVyIjoiMzkuOS41IiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Vlad Frangu <[email protected]>
1 parent 42c6ef8 commit 3e3d92f

File tree

6 files changed

+52
-185
lines changed

6 files changed

+52
-185
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"fs-extra": "^11.2.0",
8585
"globby": "~14.0.2",
8686
"handlebars": "~4.7.8",
87-
"inquirer": "~9.3.0",
87+
"inquirer": "~12.1.0",
8888
"is-ci": "~3.0.1",
8989
"is-online": "~11.0.0",
9090
"istextorbinary": "~9.5.0",

src/commands/init.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class InitCommand extends ApifyCommand<typeof InitCommand> {
7878
while (!response) {
7979
try {
8080
const answer = await inquirer.prompt([
81-
{ name: 'actName', message: 'Actor name:', default: basename(cwd) },
81+
{ name: 'actName', message: 'Actor name:', default: basename(cwd), type: 'input' },
8282
]);
8383
validateActorName(answer.actName);
8484
response = answer;

src/lib/commands/confirm.ts

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
import inquirer, { type DistinctQuestion } from 'inquirer';
22

3-
const yesNoConfirmation = ({ type }: { type: string }): DistinctQuestion => ({
4-
name: 'confirmed',
5-
type: 'confirm',
6-
message: `Are you sure you want to delete this ${type}?`,
7-
default: false,
8-
});
3+
const yesNoConfirmation = ({ type }: { type: string }) =>
4+
({
5+
name: 'confirmed',
6+
type: 'confirm',
7+
message: `Are you sure you want to delete this ${type}?`,
8+
default: false,
9+
}) as const satisfies DistinctQuestion;
910

1011
const inputValidation = ({
1112
type,
1213
expectedValue,
1314
failureMessage,
14-
}: { type: string; expectedValue: string; failureMessage: string }): DistinctQuestion => ({
15-
name: 'confirmed',
16-
type: 'input',
17-
message: `Are you sure you want to delete this ${type}? If so, please type in "${expectedValue}":`,
18-
validate(value) {
19-
if (value === expectedValue) {
20-
return true;
21-
}
15+
}: { type: string; expectedValue: string; failureMessage: string }) =>
16+
({
17+
name: 'confirmed',
18+
type: 'input',
19+
message: `Are you sure you want to delete this ${type}? If so, please type in "${expectedValue}":`,
20+
validate(value) {
21+
if (value === expectedValue) {
22+
return true;
23+
}
2224

23-
return failureMessage;
24-
},
25-
});
25+
return failureMessage;
26+
},
27+
}) as const satisfies DistinctQuestion;
2628

2729
export async function confirmAction({
2830
expectedValue,

src/lib/create-utils.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createWriteStream } from 'node:fs';
22
import { pipeline } from 'node:stream/promises';
33

4-
import { Manifest, Template } from '@apify/actor-templates';
4+
import type { Manifest, Template } from '@apify/actor-templates';
55
import chalk from 'chalk';
66
import inquirer from 'inquirer';
77

@@ -162,22 +162,21 @@ async function promptTemplateInstallation(templateDefinition: Template) {
162162
{ name: 'Go back', value: false },
163163
];
164164

165-
const message = 'Do you want to install the following template?';
166165
const label = chalk.underline(templateDefinition.label);
167166
const description = chalk.dim(templateDefinition.description);
168167
const suffix = `\n ${label}:\n ${description}`;
168+
const message = `Do you want to install the following template?${suffix}`;
169169

170-
const answer = await inquirer.prompt([
170+
const answer = await inquirer.prompt<{ shouldInstall: boolean }>([
171171
{
172172
type: 'list',
173173
name: 'shouldInstall',
174174
message,
175-
suffix,
176175
default: choices[0],
177176
choices,
178177
loop: false,
179178
},
180179
]);
181180

182-
return answer.shouldInstall as boolean;
181+
return answer.shouldInstall;
183182
}

src/lib/projects/scrapy/ScrapyProjectAnalyzer.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Are you sure there is a Scrapy project there?`);
4141
async loadSettings() {
4242
const assumedBotName = this.configuration.get('settings', 'default')!.split('.')[0];
4343

44-
const settings = await inquirer.prompt([
44+
const settings = await inquirer.prompt<{ BOT_NAME: string; SPIDER_MODULES: string }>([
4545
{
4646
type: 'input',
4747
name: 'BOT_NAME',
@@ -52,13 +52,15 @@ Are you sure there is a Scrapy project there?`);
5252
type: 'input',
5353
name: 'SPIDER_MODULES',
5454
message: 'What folder are the Scrapy spider modules stored in? (see SPIDER_MODULES in settings.py):',
55-
default: [`${assumedBotName}.spiders`],
55+
default: `${assumedBotName}.spiders`,
5656
},
5757
]);
5858

59-
if (typeof settings.SPIDER_MODULES === 'string') settings.SPIDER_MODULES = [settings.SPIDER_MODULES];
60-
61-
this.settings = settings;
59+
this.settings = {
60+
BOT_NAME: settings.BOT_NAME,
61+
SPIDER_MODULES:
62+
typeof settings.SPIDER_MODULES === 'string' ? [settings.SPIDER_MODULES] : settings.SPIDER_MODULES,
63+
};
6264
}
6365

6466
getName() {

0 commit comments

Comments
 (0)