Skip to content

Commit

Permalink
chore(docs): minor fixes in the docs (#874)
Browse files Browse the repository at this point in the history
* chore(docs): minor fixes in the docs

fixed indentation and corrected spellings

* chore(docs): fixes ul tab size

prettier makes the initial space twice for ul
  • Loading branch information
pranshuchittora authored and ematipico committed May 3, 2019
1 parent 7883871 commit 68b674b
Show file tree
Hide file tree
Showing 13 changed files with 128 additions and 98 deletions.
128 changes: 64 additions & 64 deletions .github/CONTRIBUTING.md
Expand Up @@ -56,130 +56,129 @@ In case you are suggesting a new feature, we will match your idea with our curre
## Setup

- Install [Node.js](https://nodejs.org/) if you don't have it already.
_Note: Node 6 or greater would be better for "best results"._
_Note: Node 6 or greater would be better for "best results"._
- Fork the **webpack-cli** repo at [https://github.com/webpack/webpack-cli](https://github.com/webpack/webpack-cli).
- `git clone <your-clone-url> && cd webpack-cli`

### Using npm

- Install the dependencies and link them:

```bash
npm install
npm link
npm link webpack-cli
```
```bash
npm install
npm link
npm link webpack-cli
```

- Bootstrap all the submodules before building for the first time

```bash
npm run bootstrap
npm run build
```
```bash
npm run bootstrap
npm run build
```

### Using yarn

- If you don't have yarn yet:

```bash
npm install -g yarn
```
```bash
npm install -g yarn
```

- Install the dependencies and link them

```bash
yarn
yarn link
yarn link webpack-cli
```
```bash
yarn
yarn link
yarn link webpack-cli
```

- Bootstrap all the submodules before building for the first time

```bash
yarn bootstrap
yarn build
```
```bash
yarn bootstrap
yarn build
```

## Running Tests

### Using npm

- Run all the tests with:

```bash
npm run test
```
```bash
npm run test
```

- Run CLI tests with:

```bash
npm run test:cli
```
```bash
npm run test:cli
```

- Run tests of all packages:

```bash
npm run test:packages
```
```bash
npm run test:packages
```

- Test a single CLI test case:

```bash
npx jest path/to/my-test.js
```
```bash
npx jest path/to/my-test.js
```

- You can also install jest globally and run tests without npx:

```bash
npm i -g jest
jest path/to/my-test.js
```
```bash
npm i -g jest
jest path/to/my-test.js
```

- You can run the linters:

```bash
npm run lint
```
```bash
npm run lint
```

### Using yarn

- Run all the tests with:

```bash
yarn test
```
```bash
yarn test
```

- Run CLI tests with:

```bash
yarn test:cli`
```
```bash
yarn test:cli`
```

- Run tests of all packages:

```bash
yarn test:packages
```
```bash
yarn test:packages
```

- Test a single CLI test case:

```bash
yarn jest path/to/my-test.js
```
```bash
yarn jest path/to/my-test.js
```

- You can also install jest globally and run tests:

```bash
yarn global add jest
jest path/to/my-test.js
```
```bash
yarn global add jest
jest path/to/my-test.js
```

- You can run the linters:

```bash
yarn lint
```

```bash
yarn lint
```

## Editor Config

Expand Down Expand Up @@ -258,6 +257,7 @@ format that includes a **type** and a **subject**:
```md
<type>: <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
Expand Down Expand Up @@ -330,10 +330,10 @@ Each test will refer to an input webpack config snippet.
Conventionally we write them in `\_\_testfixtures\_\_`.

```js
const defineTest = require('../defineTest');
const defineTest = require("../defineTest");
defineTest(__dirname, 'transform-name.input1.js');
defineTest(__dirname, 'transform-name.input2.js');
defineTest(__dirname, "transform-name.input1.js");
defineTest(__dirname, "transform-name.input2.js");
```

`defineTest` is a helper test method which helps us to run tests on all the transforms uniformly.
Expand Down
26 changes: 12 additions & 14 deletions README.md
@@ -1,7 +1,7 @@
<div align="center">
<a href="https://github.com/webpack/webpack-cli">
<img width="200" height="200" src="https://webpack.js.org/assets/icon-square-big.svg">
</a>
<a href="https://github.com/webpack/webpack-cli">
<img width="200" height="200" src="https://webpack.js.org/assets/icon-square-big.svg">
</a>
</div>

<h1 align="center">webpack CLI</h1>
Expand All @@ -22,14 +22,13 @@
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lernajs.io/)
[![GitHub contributors](https://img.shields.io/github/contributors/webpack/webpack-cli.svg)](https://github.com/webpack/webpack-cli/graphs/contributors)


* [About](#about)
- [About](#about)
- [How to install](#how-to-install)
* [Getting Started](#getting-started)
* [webpack CLI Scaffolds](#webpack-cli-scaffolds)
* [Commands](#commands)
* [webpack.config.js](https://webpack.js.org/concepts/configuration/)
* [Contributing and Internal Documentation](#contributing-and-internal-documentation)
- [Getting Started](#getting-started)
- [webpack CLI Scaffolds](#webpack-cli-scaffolds)
- [Commands](#commands)
- [webpack.config.js](https://webpack.js.org/concepts/configuration/)
- [Contributing and Internal Documentation](#contributing-and-internal-documentation)

## About

Expand All @@ -39,7 +38,7 @@ webpack CLI provides a flexible set of commands for developers to increase speed

When you have followed the [Getting Started](https://webpack.js.org/guides/getting-started/) guide of webpack then webpack CLI is already installed!

Otherwise `npm install --save-dev webpack-cli` or `yarn add webpack-cli --dev` will install it.
Otherwise `npm install --save-dev webpack-cli` or `yarn add webpack-cli --dev` will install it.

## Packages

Expand Down Expand Up @@ -67,7 +66,6 @@ The project also has several utility packages which are used by other commands
- [`generators`](./packages/generators/README.md) - Contains all webpack-cli related yeoman generators.
- [`webpack-scaffold`](./packages/info/README.md#webpack-cli-info) - Utilities to create a webpack scaffold.


## 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 `init` command to create a new `webpack.config.js` configuration file:
Expand All @@ -77,11 +75,11 @@ npm i webpack-cli @webpack-cli/init
npx webpack-cli init
```

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.
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

With v3 of webpack CLI, we introduced scaffolding as an integral part of the CLI. Our goal is to simplify the creation of webpack configurations for different purposes. Additionally, sharing such solutions with the community is beneficial and with webpack we want to allow this. We provide `webpack-scaffold` as a utility suite for creating these scaffolds. It contains functions that could be of use for creating a scaffold yourself.
With v3 of webpack CLI, we introduced scaffolding as an integral part of the CLI. Our goal is to simplify the creation of webpack configurations for different purposes. Additionally, sharing such solutions with the community is beneficial and with webpack, we want to allow this. We provide `webpack-scaffold` as a utility suite for creating these scaffolds. It contains functions that could be of use for creating a scaffold yourself.

You can read more about [Scaffolding](https://webpack.js.org/guides/scaffolding), learn [How to compose a webpack-scaffold?](https://webpack.js.org/contribute/writing-a-scaffold) or generate one with [webpack-scaffold-starter](https://github.com/rishabh3112/webpack-scaffold-starter).

Expand Down
8 changes: 7 additions & 1 deletion packages/README.md
@@ -1,10 +1,12 @@
# webpack-cli Packages

## Description

webpack CLI hosts several standalone packages apart from the main package that focuses on the solving respective smaller use cases.
This folder is the collection of those packages.

## Packages

1. [add](https://github.com/webpack/webpack-cli/tree/master/packages/add)
2. [generate-loader](https://github.com/webpack/webpack-cli/tree/master/packages/generate-loader)
3. [generate-plugin](https://github.com/webpack/webpack-cli/tree/master/packages/generate-plugin)
Expand All @@ -20,15 +22,19 @@ This folder is the collection of those packages.
13. [webpack-scaffold](https://github.com/webpack/webpack-cli/tree/master/packages/webpack-scaffold)

## Generic Installation

1. Standalone installation of packages

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

2. Installation of respective `package` with `webpack-cli` [Recommended]

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

----
---

[Back to webpack-cli](https://github.com/webpack/webpack-cli)
1 change: 1 addition & 0 deletions packages/generate-loader/README.md
Expand Up @@ -24,6 +24,7 @@ generateLoader();
```

### CLI (via `webpack-cli`)

```bash
npx webpack-cli generate-loader
```
2 changes: 2 additions & 0 deletions packages/generate-plugin/README.md
Expand Up @@ -17,12 +17,14 @@ npm i -D webpack-cli @webpack-cli/generate-plugin
To run the package programmatically, install it as a dependency. When using the package programmatically, one does not have to install webpack-cli.

### Node

```js
const generatePlugin = require("@webpack-cli/generate-plugin").default;
generatePlugin();
```

### CLI (via `webpack-cli`)

```bash
npx webpack-cli generate-plugin
```
25 changes: 17 additions & 8 deletions packages/generators/README.md
Expand Up @@ -4,7 +4,7 @@

## Description

This package contains all webpack-cli related yeoman generators.
This package contains all webpack-cli related yeoman generators.

## Installation

Expand All @@ -19,19 +19,28 @@ To run the package programmatically, install it as a dependency. When using the
### Node

```js
const { addGenerator, addonGenerator, initGenerator, loaderGenerator,
pluginGenerator, removeGenerator, updateGenerator
} = require("@webpack-cli/generators");
// ... compose with yeoman env or add a generator to your own yeoman project
const {
addGenerator,
addonGenerator,
initGenerator,
loaderGenerator,
pluginGenerator,
removeGenerator,
updateGenerator
} = require("@webpack-cli/generators");
// ... compose with yeoman env or add a generator to your own yeoman project
```

## Generators

- [**Plugin Generator**](https://github.com/webpack/webpack-cli/blob/master/packages/generators/plugin-generator.ts) : Creates a webpack plugin project, add starter plugin code and runs `webpack-defaults`
- [**Remove Generator**](https://github.com/webpack/webpack-cli/blob/master/packages/generators/remove-generator.ts) : Removes properties from webpack configurations
- [**Update Generator**](https://github.com/webpack/webpack-cli/blob/master/packages/generators/update-generator.ts) : [WIP] Updates properties of webpack configurations
- [**Loader Generator**](https://github.com/webpack/webpack-cli/blob/master/packages/generators/loader-generator.ts) : Creates a webpack loader project, add starter loader code and runs `webpack-defaults`
- [**Init Generator**](https://github.com/webpack/webpack-cli/blob/master/packages/generators/init-generator.ts) : Generates new webapck configuration as per user requirements
- [**Add Generator**](https://github.com/webpack/webpack-cli/blob/master/packages/generators/add-generator.ts) : Add properties to webpack configurations
- [**Addon Generator**](https://github.com/webpack/webpack-cli/blob/master/packages/generators/addon-generator.ts) : Generates a webpack project conforming to `webpack-defaults`
- [**Init Generator**](https://github.com/webpack/webpack-cli/blob/master/packages/generators/init-generator.ts) : Generates new webapck configuration as per user requirements
- [**Add Generator**](https://github.com/webpack/webpack-cli/blob/master/packages/generators/add-generator.ts) : Add properties to webpack configurations
- [**Addon Generator**](https://github.com/webpack/webpack-cli/blob/master/packages/generators/addon-generator.ts) : Generates a webpack project conforming to `webpack-defaults`

---

[Back to Packages](https://github.com/webpack/webpack-cli/tree/master/packages)
3 changes: 2 additions & 1 deletion packages/info/README.md
Expand Up @@ -4,7 +4,7 @@

## Description

This pacakge returns a set of information related to the local enviroment.
This package returns a set of information related to the local environment.

## Installation

Expand All @@ -22,6 +22,7 @@ envinfo();
```

### CLI (via `webpack-cli`)

```bash
npx webpack-cli info
```

0 comments on commit 68b674b

Please sign in to comment.