Skip to content

Commit

Permalink
Replace prompt function from react-dev-utils with Inquirer.js. (faceb…
Browse files Browse the repository at this point in the history
  • Loading branch information
iansu authored and romaindso committed Jul 10, 2017
1 parent 50f4cf8 commit c9632d6
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 240 deletions.
23 changes: 0 additions & 23 deletions packages/react-dev-utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,29 +198,6 @@ if (openBrowser('http://localhost:3000')) {
}
```

#### `prompt(message: string, isYesDefault: boolean): Promise<boolean>`

This function displays a console prompt to the user.

By convention, "no" should be the conservative choice.<br>
If you mistype the answer, we'll always take it as a "no".<br>
You can control the behavior on `<Enter>` with `isYesDefault`.

```js
var prompt = require('react-dev-utils/prompt');

prompt(
'Are you sure you want to eat all the candy?',
/* isYesDefault */ false
).then(shouldEat => {
if (shouldEat) {
console.log('You have successfully consumed all the candy.');
} else {
console.log('Phew, candy is still available!');
}
});
```

#### `webpackHotDevClient.js`

This is an alternative client for [WebpackDevServer](https://github.com/webpack/webpack-dev-server) that shows a syntax error overlay.
Expand Down
1 change: 0 additions & 1 deletion packages/react-dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"launchEditor.js",
"openBrowser.js",
"openChrome.applescript",
"prompt.js",
"WatchMissingNodeModulesPlugin.js",
"webpackHotDevClient.js"
],
Expand Down
46 changes: 0 additions & 46 deletions packages/react-dev-utils/prompt.js

This file was deleted.

1 change: 1 addition & 0 deletions packages/react-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"fs-extra": "0.30.0",
"html-webpack-plugin": "2.28.0",
"http-proxy-middleware": "0.17.3",
"inquirer": "3.0.6",
"jest": "18.1.0",
"object-assign": "4.1.1",
"postcss-loader": "1.3.3",
Expand Down
Loading

0 comments on commit c9632d6

Please sign in to comment.