Skip to content

Commit a9940bd

Browse files
anshumanvrishabh3112
authored andcommitted
docs(create): migrate init package docs (#1155)
1 parent 8f92cb9 commit a9940bd

File tree

6 files changed

+35
-34
lines changed

6 files changed

+35
-34
lines changed

.cz-config.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313
'use strict';
1414

1515
module.exports = {
16-
allowBreakingChanges: ["ast"],
17-
allowCustomScopes: true,
18-
scopes: [],
19-
// sort type values in asc
20-
types: [
21-
{ value: "ast", name: "ast: init, migrate, add, etc" },
22-
{ value: "break", name: "break: Changes that break the behaviour of the cli" },
23-
{ value: "chore", name: "chore: Updating deps, docs, linting, etc" },
24-
{ value: "cli", name: "cli: Core CLI things" },
25-
{ value: "docs", name: "docs: Documentation" },
26-
{ value: "feat", name: "feat: A new feature" },
27-
{ value: "fix", name: "fix: Bugs, typos, etc" },
28-
{ value: "misc", name: "misc: Other formats like tweaks and such" },
29-
{ value: "tests", name: "tests: Tests, jest, etc" },
30-
]
16+
allowBreakingChanges: ['ast'],
17+
allowCustomScopes: true,
18+
scopes: [],
19+
// sort type values in asc
20+
types: [
21+
{ value: 'ast', name: 'ast: create, migrate, add, etc' },
22+
{ value: 'break', name: 'break: Changes that break the behaviour of the cli' },
23+
{ value: 'chore', name: 'chore: Updating deps, docs, linting, etc' },
24+
{ value: 'cli', name: 'cli: Core CLI things' },
25+
{ value: 'docs', name: 'docs: Documentation' },
26+
{ value: 'feat', name: 'feat: A new feature' },
27+
{ value: 'fix', name: 'fix: Bugs, typos, etc' },
28+
{ value: 'misc', name: 'misc: Other formats like tweaks and such' },
29+
{ value: 'tests', name: 'tests: Tests, jest, etc' },
30+
],
3131
};

INIT.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# webpack-cli init
1+
# webpack-cli create
22

3-
`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.
3+
`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.
44

55
## Initial Setup
66

77
### a. Local setup
88

9-
These are the steps necessary to setup `webpack-cli init` locally:
9+
These are the steps necessary to setup `webpack-cli create` locally:
1010

1111
1. Create `package.json` through npm
1212

@@ -28,15 +28,15 @@ These are the steps necessary to setup `webpack-cli init` locally:
2828

2929
### b. Global Setup
3030

31-
These are the steps necessary to setup `webpack-cli init` globally:
31+
These are the steps necessary to setup `webpack-cli create` globally:
3232

3333
1. Install `webpack` and `webpack-cli` globally
3434

3535
```shell
3636
npm install -g webpack webpack-cli
3737
```
3838

39-
2. Install `@webpack-cli/init` package to add the init scaffold
39+
2. Install `@webpack-cli/init` package to add the create scaffold
4040

4141
```shell
4242
npm install -g @webpack-cli/init
@@ -47,13 +47,13 @@ These are the steps necessary to setup `webpack-cli init` globally:
4747
### a. Running locally
4848

4949
```shell
50-
npx webpack-cli init
50+
npx webpack-cli create
5151
```
5252

5353
### b. Running globally
5454

5555
```shell
56-
webpack-cli init
56+
webpack-cli create
5757
```
5858

5959
### Description of questions asked by generator

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ We organize webpack CLI as a multi-package repository using [lerna](https://gith
5454

5555
Supporting developers is an important task for webpack CLI. Thus, webpack CLI provides different commands for many common tasks.
5656

57-
- [`webpack-cli init`](./packages/init/README.md#webpack-cli-init) - Create a new webpack configuration.
57+
- [`webpack-cli create`](./packages/init/README.md#webpack-cli-create) - Create a new webpack configuration.
5858
- [`webpack-cli info`](./packages/info/README.md#webpack-cli-info) - Returns information related to the local environment.
5959
- [`webpack-cli migrate`](./packages/migrate/README.md#webpack-cli-migrate) - Migrate project from one version to another.
6060
- [`webpack-cli generate-plugin`](./packages/generate-plugin/README.md#webpack-cli-generate-plugin) - Initiate new plugin project.
@@ -77,14 +77,14 @@ The project also has several utility packages which are used by other commands
7777

7878
## Getting started
7979

80-
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:
80+
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:
8181

8282
```sh
8383
npm i webpack-cli @webpack-cli/init
84-
npx webpack-cli init
84+
npx webpack-cli create
8585
```
8686

87-
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.
87+
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.
8888

8989
## webpack CLI Scaffolds
9090

packages/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This folder is the collection of those packages.
1111
2. [generate-plugin](https://github.com/webpack/webpack-cli/tree/master/packages/generate-plugin)
1212
3. [generators](https://github.com/webpack/webpack-cli/tree/master/packages/generators)
1313
4. [info](https://github.com/webpack/webpack-cli/tree/master/packages/info)
14-
5. [init](https://github.com/webpack/webpack-cli/tree/master/packages/init)
14+
5. [create](https://github.com/webpack/webpack-cli/tree/master/packages/init)
1515
6. [migrate](https://github.com/webpack/webpack-cli/tree/master/packages/migrate)
1616
7. [serve](https://github.com/webpack/webpack-cli/tree/master/packages/serve)
1717
8. [utils](https://github.com/webpack/webpack-cli/tree/master/packages/utils)

packages/init/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# webpack-cli init
1+
# webpack-cli create
22

33
[![NPM Downloads][downloads]][downloads-url]
44

@@ -19,7 +19,7 @@ To run the package programmatically, install it as a dependency. When using the
1919
### Node
2020

2121
```js
22-
const init = require("@webpack-cli/init").default;
22+
const init = require('@webpack-cli/init').default;
2323

2424
// this will run the default init instance
2525
init();
@@ -33,26 +33,27 @@ init([null, null, ...myPacakges]);
3333
**Via defaults**
3434

3535
```bash
36-
npx webpack-cli init
36+
npx webpack-cli create
3737
```
3838

3939
**To generate default configs**
40+
4041
```bash
41-
npx webpack-cli init --auto
42+
npx webpack-cli create --auto
4243
```
4344

4445
**Via custom scaffold**
4546

4647
1. Using package on `npm`
4748

4849
```bash
49-
npx webpack-cli init webpack-scaffold-[name]
50+
npx webpack-cli create webpack-scaffold-[name]
5051
```
5152

5253
2. Using path to a local directory
5354

5455
```bash
55-
npx webpack-cli init [path]
56+
npx webpack-cli create [path]
5657
```
5758

5859
[downloads]: https://img.shields.io/npm/dm/@webpack-cli/init.svg

test/version/version-multi-args.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('version flag with multiple arguments', () => {
1111
});
1212

1313
it('outputs version with multiple commands', () => {
14-
const { stdout, stderr } = run(__dirname, ['version', 'init']);
14+
const { stdout, stderr } = run(__dirname, ['version', 'create']);
1515
expect(stdout).toContain(pkgJSON.version);
1616
expect(stderr).toHaveLength(0);
1717
});

0 commit comments

Comments
 (0)