Skip to content

Commit 6a646aa

Browse files
refactor: minor improvements
1 parent 98728ee commit 6a646aa

File tree

4 files changed

+7
-19
lines changed

4 files changed

+7
-19
lines changed

packages/README.md

+2-8
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,14 @@ This folder is the collection of those packages.
1414
## Packages
1515

1616
1. [configtest](https://github.com/webpack/webpack-cli/tree/master/packages/configtest)
17-
2. [generators](https://github.com/webpack/webpack-cli/tree/master/packages/generators)
17+
2. [create-webpack-app](https://github.com/webpack/webpack-cli/tree/master/packages/create-webpack-app)
1818
3. [info](https://github.com/webpack/webpack-cli/tree/master/packages/info)
1919
4. [serve](https://github.com/webpack/webpack-cli/tree/master/packages/serve)
2020
5. [webpack-cli](https://github.com/webpack/webpack-cli/tree/master/packages/webpack-cli)
2121

2222
## Generic Installation
2323

24-
1. Standalone installation of packages
25-
26-
```shell
27-
npm install @webpack-cli/<package>
28-
```
29-
30-
2. Installation of respective `package` with `webpack-cli` [Recommended]
24+
Standalone installation of packages (except `create-webpack-app`, it is a self-sufficient package)
3125

3226
```shell
3327
npm install webpack-cli @webpack-cli/<package>

test/build/config-format/typescript-esnext/typescript.test.js

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ describe("webpack cli", () => {
1414
env,
1515
});
1616

17-
console.log(stderr);
18-
console.log(stdout);
19-
2017
expect(stderr).not.toBeFalsy(); // Deprecation warning logs on stderr
2118
expect(stdout).toBeTruthy();
2219
expect(exitCode).toBe(0);

test/build/config-name/config-name.test.js

-3
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@ describe("--config-name flag", () => {
120120
false,
121121
);
122122

123-
console.log(stdout);
124-
console.log(stderr);
125-
126123
expect(exitCode).toBe(0);
127124
expect(stderr).toBeFalsy();
128125
expect(stdout).toContain("first");

test/create-webpack-app/test.utils.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,16 @@ function createPathDependentUtils(cli) {
130130
};
131131
/*
132132
* runPromptWithAnswers
133-
* @param {string} location location of current working directory
133+
* @param {string} location of current working directory
134134
* @param {string[]} args CLI args to pass in
135-
* @param {string[]} answers answers to be passed to stdout for inquirer question
135+
* @param {string[]} answers to be passed to stdout for inquirer question
136136
*/
137137
const runPromptWithAnswers = (location, args, answers) => {
138138
const process = runAndGetProcess(location, args);
139139

140140
process.stdin.setDefaultEncoding("utf-8");
141141

142-
const delay = 2000;
142+
const delay = 1000;
143143
let outputTimeout;
144144
let currentAnswer = 0;
145145

@@ -162,12 +162,12 @@ function createPathDependentUtils(cli) {
162162
write(chunk, encoding, callback) {
163163
const output = chunk.toString("utf8");
164164

165-
if (output) {
165+
if (output.length > 0) {
166166
if (outputTimeout) {
167167
clearTimeout(outputTimeout);
168168
}
169169

170-
// we must receive new stdout, then have 2 seconds
170+
// we must receive new stdout, then have 1 second
171171
// without any stdout before writing the next answer
172172
outputTimeout = setTimeout(() => {
173173
writeAnswer(output);

0 commit comments

Comments
 (0)