From f29a170b36a87a2088129f3f03f076ac9249bde3 Mon Sep 17 00:00:00 2001 From: Anshuman Verma Date: Sun, 16 Feb 2020 18:38:38 +0530 Subject: [PATCH] fix(init): fix the invalid package name (#1228) * fix(init): fix the invalid package name fix invalid package name ISSUES CLOSED: #1227 * docs(init): update init package docs to indicate correct package name update init package docs ISSUES CLOSED: #1227 --- INIT.md | 12 ++++++------ README.md | 4 ++-- lib/webpack-cli.js | 2 +- packages/README.md | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/INIT.md b/INIT.md index 93b9c955cb9..e32506e556e 100644 --- a/INIT.md +++ b/INIT.md @@ -1,12 +1,12 @@ -# webpack-cli create +# webpack-cli init -`webpack-cli create` is used to initialize `webpack` projects quickly by scaffolding configuration and creating a runnable project with all the dependencies based on the user preferences. +`webpack-cli init` is used to initialize `webpack` projects quickly by scaffolding configuration and creating a runnable project with all the dependencies based on the user preferences. ## Initial Setup ### a. Local setup -These are the steps necessary to setup `webpack-cli create` locally: +These are the steps necessary to setup `webpack-cli init` locally: 1. Create `package.json` through npm @@ -28,7 +28,7 @@ These are the steps necessary to setup `webpack-cli create` locally: ### b. Global Setup -These are the steps necessary to setup `webpack-cli create` globally: +These are the steps necessary to setup `webpack-cli init` globally: 1. Install `webpack` and `webpack-cli` globally @@ -47,13 +47,13 @@ These are the steps necessary to setup `webpack-cli create` globally: ### a. Running locally ```shell -npx webpack-cli create +npx webpack-cli init ``` ### b. Running globally ```shell -webpack-cli create +webpack-cli init ``` ### Description of questions asked by generator diff --git a/README.md b/README.md index 01a8beb1afd..1b819a21507 100644 --- a/README.md +++ b/README.md @@ -120,14 +120,14 @@ The project also has several utility packages which are used by other commands ## Getting started -When you have followed the [Getting Started](https://webpack.js.org/guides/getting-started/) guide of webpack then webpack CLI is already installed! Otherwise, you would need to install webpack CLI and the packages you want to use. If we want to use the `create` command to create a new `webpack.config.js` configuration file: +When you have followed the [Getting Started](https://webpack.js.org/guides/getting-started/) guide of webpack then webpack CLI is already installed! Otherwise, you would need to install webpack CLI and the packages you want to use. If we want to use the `init` command to create a new `webpack.config.js` configuration file: ```sh npm i webpack-cli @webpack-cli/init npx webpack-cli create ``` -You will be prompted for some questions about what how you want to generate your config file when running the `create` command so webpack CLI can provide the best fitting configuration. +You will be prompted for some questions about what how you want to generate your config file when running the `init` command so webpack CLI can provide the best fitting configuration. ## webpack CLI Scaffolds diff --git a/lib/webpack-cli.js b/lib/webpack-cli.js index 4bd4c7ea945..d31275c0161 100644 --- a/lib/webpack-cli.js +++ b/lib/webpack-cli.js @@ -6,7 +6,7 @@ const { groups } = require('./utils/cli-flags'); const webpackMerge = require('webpack-merge'); const defaultCommands = { - create: 'init', + init: 'init', loader: 'generate-loader', plugin: 'generate-plugin', info: 'info', diff --git a/packages/README.md b/packages/README.md index 895130bf5ae..0bb048077ca 100644 --- a/packages/README.md +++ b/packages/README.md @@ -11,7 +11,7 @@ This folder is the collection of those packages. 2. [generate-plugin](https://github.com/webpack/webpack-cli/tree/master/packages/generate-plugin) 3. [generators](https://github.com/webpack/webpack-cli/tree/master/packages/generators) 4. [info](https://github.com/webpack/webpack-cli/tree/master/packages/info) -5. [create](https://github.com/webpack/webpack-cli/tree/master/packages/init) +5. [init](https://github.com/webpack/webpack-cli/tree/master/packages/init) 6. [migrate](https://github.com/webpack/webpack-cli/tree/master/packages/migrate) 7. [serve](https://github.com/webpack/webpack-cli/tree/master/packages/serve) 8. [utils](https://github.com/webpack/webpack-cli/tree/master/packages/utils)