Skip to content

Commit

Permalink
chore(init): remove --force flag (#2391)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 committed Feb 1, 2021
1 parent 7092a72 commit 7bd747a
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 85 deletions.
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.

0 comments on commit 7bd747a

Please sign in to comment.