Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(init): remove --force flag #2391

Merged
merged 1 commit into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions INIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,6 @@ webpack-cli init
webpack-cli init --auto
```

**To force config generation**

```bash
webpack-cli init --force
```

**To scaffold in a specified path**

```bash
Expand Down
3 changes: 1 addition & 2 deletions packages/generators/src/utils/modify-config-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export function modifyHelperUtil(
configFile: string = DEFAULT_WEBPACK_CONFIG_FILENAME,
packages?: string[],
autoSetDefaults = false,
generateConfig = false,
generationPath = '.',
): void {
const configPath: string | null = null;
Expand Down Expand Up @@ -135,7 +134,7 @@ export function modifyHelperUtil(
) as TransformConfig;

// scaffold webpack config file from using .yo-rc.json
return runTransform(transformConfig, 'init', generateConfig, generationPath);
return runTransform(transformConfig, 'init', generationPath);
} catch (error) {
logger.error(error);
process.exitCode = 2;
Expand Down
6 changes: 1 addition & 5 deletions packages/generators/src/utils/scaffold.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,9 @@ function mapOptionsToTransform(config: Config): string[] {
* and writes the file
*/

export function runTransform(transformConfig: TransformConfig, action: string, generateConfig: boolean, generationPath: string): void {
export function runTransform(transformConfig: TransformConfig, action: string, generationPath: string): void {
// webpackOptions.name sent to nameTransform if match
const webpackConfig = Object.keys(transformConfig).filter((p: string): boolean => {
if (p == 'usingDefaults') {
return generateConfig;
}

return p !== 'configFile' && p !== 'configPath';
});
const initActionNotDefined = action && action !== 'init';
Expand Down
6 changes: 0 additions & 6 deletions packages/init/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ npx webpack-cli init
npx webpack-cli init --auto
```

**To force config generation**

```bash
npx webpack-cli init --force
```

**To scaffold in a specified path**

```bash
Expand Down
7 changes: 1 addition & 6 deletions packages/init/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ class InitCommand {
type: Boolean,
description: 'To generate default config',
},
{
name: 'force',
type: Boolean,
description: 'To force config generation',
},
{
name: 'generation-path',
type: String,
Expand All @@ -34,7 +29,7 @@ class InitCommand {
return;
}

modifyHelperUtil(initGenerator, null, null, options.auto, options.force, options.generationPath);
modifyHelperUtil(initGenerator, null, null, options.auto, options.generationPath);
},
);
}
Expand Down
60 changes: 0 additions & 60 deletions test/init/force/init-force.test.js

This file was deleted.