Skip to content

Commit 82687dd

Browse files
iansugaearon
authored andcommitted
Replace prompt function from react-dev-utils with Inquirer.js. (#1772)
1 parent be43292 commit 82687dd

File tree

6 files changed

+182
-240
lines changed

6 files changed

+182
-240
lines changed

packages/react-dev-utils/README.md

-23
Original file line numberDiff line numberDiff line change
@@ -198,29 +198,6 @@ if (openBrowser('http://localhost:3000')) {
198198
}
199199
```
200200

201-
#### `prompt(message: string, isYesDefault: boolean): Promise<boolean>`
202-
203-
This function displays a console prompt to the user.
204-
205-
By convention, "no" should be the conservative choice.<br>
206-
If you mistype the answer, we'll always take it as a "no".<br>
207-
You can control the behavior on `<Enter>` with `isYesDefault`.
208-
209-
```js
210-
var prompt = require('react-dev-utils/prompt');
211-
212-
prompt(
213-
'Are you sure you want to eat all the candy?',
214-
/* isYesDefault */ false
215-
).then(shouldEat => {
216-
if (shouldEat) {
217-
console.log('You have successfully consumed all the candy.');
218-
} else {
219-
console.log('Phew, candy is still available!');
220-
}
221-
});
222-
```
223-
224201
#### `webpackHotDevClient.js`
225202

226203
This is an alternative client for [WebpackDevServer](https://github.com/webpack/webpack-dev-server) that shows a syntax error overlay.

packages/react-dev-utils/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"launchEditor.js",
2323
"openBrowser.js",
2424
"openChrome.applescript",
25-
"prompt.js",
2625
"WatchMissingNodeModulesPlugin.js",
2726
"webpackHotDevClient.js"
2827
],

packages/react-dev-utils/prompt.js

-46
This file was deleted.

packages/react-scripts/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"fs-extra": "0.30.0",
4848
"html-webpack-plugin": "2.28.0",
4949
"http-proxy-middleware": "0.17.3",
50+
"inquirer": "3.0.6",
5051
"jest": "18.1.0",
5152
"object-assign": "4.1.1",
5253
"postcss-loader": "1.3.3",

0 commit comments

Comments
 (0)