From 5cc1e6da806020372dedf366fbd08de87f6036a1 Mon Sep 17 00:00:00 2001 From: Simon Boudrias Date: Sun, 30 Jun 2024 17:22:18 -0400 Subject: [PATCH] Chore(docs): Review install instruction for easy copy-paste (#1450) --- packages/checkbox/README.md | 17 +++++++++++++++++ packages/confirm/README.md | 17 +++++++++++++++++ packages/core/README.md | 17 +++++++++++++++++ packages/editor/README.md | 17 +++++++++++++++++ packages/expand/README.md | 17 +++++++++++++++++ packages/input/README.md | 17 +++++++++++++++++ packages/inquirer/README.md | 8 +++++--- packages/number/README.md | 17 +++++++++++++++++ packages/password/README.md | 17 +++++++++++++++++ packages/prompts/README.md | 20 +++++++++++++++++++- packages/rawlist/README.md | 17 +++++++++++++++++ packages/select/README.md | 17 +++++++++++++++++ packages/testing/README.md | 21 +++++++++++++++++++-- 13 files changed, 213 insertions(+), 6 deletions(-) diff --git a/packages/checkbox/README.md b/packages/checkbox/README.md index 4140b9a87..77fe5eb57 100644 --- a/packages/checkbox/README.md +++ b/packages/checkbox/README.md @@ -6,12 +6,29 @@ Simple interactive command line prompt to display a list of checkboxes (multi se # Installation + + + + + + + + + +
npmyarn
+ ```sh npm install @inquirer/checkbox +``` + + +```sh yarn add @inquirer/checkbox ``` +
+ # Usage ```js diff --git a/packages/confirm/README.md b/packages/confirm/README.md index 4d4371d60..bc589e8fd 100644 --- a/packages/confirm/README.md +++ b/packages/confirm/README.md @@ -6,12 +6,29 @@ Simple interactive command line prompt to gather boolean input from users. # Installation + + + + + + + + + +
npmyarn
+ ```sh npm install @inquirer/confirm +``` + + +```sh yarn add @inquirer/confirm ``` +
+ # Usage ```js diff --git a/packages/core/README.md b/packages/core/README.md index 9d18e9474..ba2870138 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -6,12 +6,29 @@ It aims to implements a lightweight API similar to React hooks - but without JSX # Installation + + + + + + + + + +
npmyarn
+ ```sh npm install @inquirer/core +``` + + +```sh yarn add @inquirer/core ``` +
+ # Usage ```ts diff --git a/packages/editor/README.md b/packages/editor/README.md index ea0fd07be..beceac76c 100644 --- a/packages/editor/README.md +++ b/packages/editor/README.md @@ -4,12 +4,29 @@ Prompt that'll open the user preferred editor with default content and allow for # Installation + + + + + + + + + +
npmyarn
+ ```sh npm install @inquirer/editor +``` + + +```sh yarn add @inquirer/editor ``` +
+ # Usage ```js diff --git a/packages/expand/README.md b/packages/expand/README.md index 13ddf127d..f2a1a035a 100644 --- a/packages/expand/README.md +++ b/packages/expand/README.md @@ -7,12 +7,29 @@ Compact single select prompt. Every option is assigned a shortcut key, and selec # Installation + + + + + + + + + +
npmyarn
+ ```sh npm install @inquirer/expand +``` + + +```sh yarn add @inquirer/expand ``` +
+ # Usage ```js diff --git a/packages/input/README.md b/packages/input/README.md index 24206f479..677e26fdf 100644 --- a/packages/input/README.md +++ b/packages/input/README.md @@ -6,12 +6,29 @@ Interactive free text input component for command line interfaces. Supports vali # Installation + + + + + + + + + +
npmyarn
+ ```sh npm install @inquirer/input +``` + + +```sh yarn add @inquirer/input ``` +
+ # Usage ```js diff --git a/packages/inquirer/README.md b/packages/inquirer/README.md index 4bf1cb61a..a3f0c4e94 100644 --- a/packages/inquirer/README.md +++ b/packages/inquirer/README.md @@ -7,8 +7,7 @@ A collection of common interactive command line user interfaces. -### Note: - +> [!IMPORTANT] > This is the legacy version of Inquirer.js. While it still receives maintenance, it is not actively developed. For the new Inquirer, see [@inquirer/prompts](https://www.npmjs.com/package/@inquirer/prompts). ## Table of Contents @@ -76,7 +75,10 @@ inquirer }); ``` -Inquirer v9 and higher are native esm modules, this mean you cannot use the commonjs syntax `require('inquirer')` anymore. If you want to learn more about using native esm in Node, I'd recommend reading [the following guide](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). Alternatively, you can rely on an older version until you're ready to upgrade your environment: +> [!WARNING] +> Inquirer v9 and higher are native esm modules, this mean you cannot use the commonjs syntax `require('inquirer')` anymore. If you want to learn more about using native esm in Node, I'd recommend reading [the following guide](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). + +Alternatively, if you require a commonjs module, you should rely on an older version until you're ready to upgrade your environment: ```sh npm install --save inquirer@^8.0.0 diff --git a/packages/number/README.md b/packages/number/README.md index 961365db6..9aae4512f 100644 --- a/packages/number/README.md +++ b/packages/number/README.md @@ -4,12 +4,29 @@ Interactive free number input component for command line interfaces. Supports va # Installation + + + + + + + + + +
npmyarn
+ ```sh npm install @inquirer/number +``` + + +```sh yarn add @inquirer/number ``` +
+ # Usage ```js diff --git a/packages/password/README.md b/packages/password/README.md index 7c40c798a..9b6fb1cf8 100644 --- a/packages/password/README.md +++ b/packages/password/README.md @@ -6,12 +6,29 @@ Interactive password input component for command line interfaces. Supports input # Installation + + + + + + + + + +
npmyarn
+ ```sh npm install @inquirer/password +``` + + +```sh yarn add @inquirer/password ``` +
+ # Usage ```js diff --git a/packages/prompts/README.md b/packages/prompts/README.md index bab1c210a..51a5db1c5 100644 --- a/packages/prompts/README.md +++ b/packages/prompts/README.md @@ -17,13 +17,31 @@ npx @inquirer/demo@latest # Installation + + + + + + + + + +
npmyarn
+ ```sh npm install @inquirer/prompts +``` + + +```sh yarn add @inquirer/prompts ``` -Inquirer recently underwent a rewrite from the ground up to reduce the package size and improve performance. The previous version of the package is still maintained (though not actively developed), and offered hundreds of community contributed prompts that might not have been migrated to the latest API. If this is what you're looking for, the [previous package is over here](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/inquirer). +
+ +> [!NOTE] +> Inquirer recently underwent a rewrite from the ground up to reduce the package size and improve performance. The previous version of the package is still maintained (though not actively developed), and offered hundreds of community contributed prompts that might not have been migrated to the latest API. If this is what you're looking for, the [previous package is over here](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/inquirer). # Usage diff --git a/packages/rawlist/README.md b/packages/rawlist/README.md index a227595e7..65bb3ab25 100644 --- a/packages/rawlist/README.md +++ b/packages/rawlist/README.md @@ -6,12 +6,29 @@ Simple interactive command line prompt to display a raw list of choices (single # Installation + + + + + + + + + +
npmyarn
+ ```sh npm install @inquirer/rawlist +``` + + +```sh yarn add @inquirer/rawlist ``` +
+ # Usage ```js diff --git a/packages/select/README.md b/packages/select/README.md index a51a65ffd..a8a41c775 100644 --- a/packages/select/README.md +++ b/packages/select/README.md @@ -6,12 +6,29 @@ Simple interactive command line prompt to display a list of choices (single sele # Installation + + + + + + + + + +
npmyarn
+ ```sh npm install @inquirer/select +``` + + +```sh yarn add @inquirer/select ``` +
+ # Usage ```js diff --git a/packages/testing/README.md b/packages/testing/README.md index ba67369a5..5c1910e43 100644 --- a/packages/testing/README.md +++ b/packages/testing/README.md @@ -4,12 +4,29 @@ The `@inquirer/testing` package is Inquirer's answer to testing prompts [built w # Installation + + + + + + + + + +
npmyarn
+ ```sh -npm install @inquirer/testing +npm install @inquirer/testing --save-dev +``` + + -yarn add @inquirer/testing +```sh +yarn add @inquirer/testing --dev ``` +
+ # Example Here's an example of a test running with Jest (though `@inquirer/testing` will work with any runners).