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(docs): minor fixes in the docs #874

Merged
merged 3 commits into from May 3, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
134 changes: 67 additions & 67 deletions .github/CONTRIBUTING.md
Expand Up @@ -7,31 +7,31 @@ work is not in vain.

Table of Contents

- [Issues](#issues)
- [Your first Contribution](#your-first-contribution)
- [Setup](#setup)
- [Using npm](#using-npm)
- [Using yarn](#using-yarn)
- [Running Tests](#running-tests)
- [Using npm](#using-npm-1)
- [Using yarn](#using-yarn-1)
- [Editor Config](#editor-config)
- [Dependencies](#dependencies)
- [Branching Model](#branching-model)
- [Naming a branch](#naming-a-branch)
- [Features](#features)
- [Fixes](#fixes)
- [Testing](#testing)
- [Pull Requests](#pull-requests)
- [Submitting a good Pull Request](#submitting-a-good-pull-request)
- [Commit message](#commit-message)
- [Commit Message Format](#commit-message-format)
- [Migrate with the CLI](#migrate-with-the-cli)
- [How it's being done](#how-its-being-done)
- [Structure of a transform](#structure-of-a-transform)
- [Further Work](#further-work)
- [Contributor License Agreement](#contributor-license-agreement)
- [Documentation](#documentation)
- [Issues](#issues)
- [Your first Contribution](#your-first-contribution)
- [Setup](#setup)
- [Using npm](#using-npm)
- [Using yarn](#using-yarn)
- [Running Tests](#running-tests)
- [Using npm](#using-npm-1)
- [Using yarn](#using-yarn-1)
- [Editor Config](#editor-config)
- [Dependencies](#dependencies)
- [Branching Model](#branching-model)
- [Naming a branch](#naming-a-branch)
- [Features](#features)
- [Fixes](#fixes)
- [Testing](#testing)
- [Pull Requests](#pull-requests)
- [Submitting a good Pull Request](#submitting-a-good-pull-request)
- [Commit message](#commit-message)
- [Commit Message Format](#commit-message-format)
- [Migrate with the CLI](#migrate-with-the-cli)
- [How it's being done](#how-its-being-done)
- [Structure of a transform](#structure-of-a-transform)
- [Further Work](#further-work)
- [Contributor License Agreement](#contributor-license-agreement)
- [Documentation](#documentation)

## Issues

Expand All @@ -55,22 +55,22 @@ 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.
- Install [Node.js](https://nodejs.org/) if you don't have it already.
_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`
- 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:
- Install the dependencies and link them:

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

- Bootstrap all the submodules before building for the first time
- Bootstrap all the submodules before building for the first time

```bash
npm run bootstrap
Expand All @@ -79,21 +79,21 @@ In case you are suggesting a new feature, we will match your idea with our curre

### Using yarn

- If you don't have yarn yet:
- If you don't have yarn yet:

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

- Install the dependencies and link them
- Install the dependencies and link them

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

- Bootstrap all the submodules before building for the first time
- Bootstrap all the submodules before building for the first time

```bash
yarn bootstrap
Expand All @@ -104,83 +104,82 @@ In case you are suggesting a new feature, we will match your idea with our curre

### Using npm

- Run all the tests with:
- Run all the tests with:

```bash
npm run test
```

- Run CLI tests with:
- Run CLI tests with:

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

- Run tests of all packages:
- Run tests of all packages:

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

- Test a single CLI test case:
- Test a single CLI test case:

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

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

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

- You can run the linters:
- You can run the linters:

```bash
npm run lint
```

### Using yarn

- Run all the tests with:
- Run all the tests with:

```bash
yarn test
```

- Run CLI tests with:
- Run CLI tests with:

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

- Run tests of all packages:
- Run tests of all packages:

```bash
yarn test:packages
```

- Test a single CLI test case:
- Test a single CLI test case:

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

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

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

- You can run the linters:
- You can run the linters:

```bash
yarn lint
```


## Editor Config

The [.editorconfig](https://github.com/webpack/webpack-cli/blob/master/.editorconfig) in the root should ensure consistent formatting. Please make sure you've [installed the plugin](http://editorconfig.org/#download) if your text editor needs one.
Expand All @@ -199,15 +198,15 @@ We base our branching model on [git flow](http://nvie.com/posts/a-successful-git

Making a branch in your fork for your contribution is helpful in the following ways:

- It allows you to submit more than one contribution in a single PR.
- It allows us to identify what your contribution is about from the branch name.
- It allows you to submit more than one contribution in a single PR.
- It allows us to identify what your contribution is about from the branch name.

You will want to checkout the `master` branch locally before creating your new branch.

There are two types of branches:

- Feature
- Bugfix
- Feature
- Bugfix

### Features

Expand Down Expand Up @@ -238,9 +237,9 @@ In case you've got a small change in most of the cases, your pull request would

## Submitting a good Pull Request

- Write tests
- Follow the existing coding style
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
- Write tests
- Follow the existing coding style
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)

## Commit message

Expand All @@ -258,22 +257,23 @@ format that includes a **type** and a **subject**:
```md
<type>: <subject>
<BLANK LINE>

<body>
<BLANK LINE>
<footer>
```

This is the list of _type_ of commits that we accept:

- ast
- break
- chore
- cli
- docs
- feat
- fix
- misc
- tests
- ast
- break
- chore
- cli
- docs
- feat
- fix
- misc
- tests

The **header** is mandatory.

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 All @@ -344,8 +344,8 @@ It takes the input file given as parameter and uses jest to create a snapshot of
This is still in a very raw form. We'd like to take this as close to a truly useful tool as possible.
We will still need to

- Support all kinds of webpack configuration(made using merge tools)
- Test these transforms against real-world configurations.
- Support all kinds of webpack configuration(made using merge tools)
- Test these transforms against real-world configurations.

## Contributor License Agreement

Expand Down
52 changes: 25 additions & 27 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)
- [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)
- [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)

## 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 All @@ -49,24 +48,23 @@ We organize webpack CLI as a multi-package repository using [lerna](https://gith

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

- [`webpack-cli init`](./packages/init/README.md#webpack-cli-init) - Create a new webpack configuration.
- [`webpack-cli add`](./packages/add/README.md#webpack-cli-add) - Add new properties to a webpack configuration file.
- [`webpack-cli info`](./packages/info/README.md#webpack-cli-info) - Returns information related to the local environment.
- [`webpack-cli migrate`](./packages/migrate/README.md#webpack-cli-migrate) - Migrate project from one version to another.
- [`webpack-cli remove`](./packages/remove/README.md#webpack-cli-remove) - Remove properties from a webpack configuration file.
- [`webpack-cli generate-plugin`](./packages/generate-plugin/README.md#webpack-cli-generate-plugin) - Initiate new plugin project.
- [`webpack-cli generate-loader`](./packages/generate-loader/README.md#webpack-cli-generate-loader) - Initiate new loader project.
- [`webpack-cli serve`](./packages/serve/README.md#webpack-cli-serve) - Use webpack with a development server that provides live reloading.
- [`webpack-cli update`](./packages/update/README.md#webpack-cli-update) - Update properties in a webpack configuration file.
- [`webpack-cli init`](./packages/init/README.md#webpack-cli-init) - Create a new webpack configuration.
- [`webpack-cli add`](./packages/add/README.md#webpack-cli-add) - Add new properties to a webpack configuration file.
- [`webpack-cli info`](./packages/info/README.md#webpack-cli-info) - Returns information related to the local environment.
- [`webpack-cli migrate`](./packages/migrate/README.md#webpack-cli-migrate) - Migrate project from one version to another.
- [`webpack-cli remove`](./packages/remove/README.md#webpack-cli-remove) - Remove properties from a webpack configuration file.
- [`webpack-cli generate-plugin`](./packages/generate-plugin/README.md#webpack-cli-generate-plugin) - Initiate new plugin project.
- [`webpack-cli generate-loader`](./packages/generate-loader/README.md#webpack-cli-generate-loader) - Initiate new loader project.
- [`webpack-cli serve`](./packages/serve/README.md#webpack-cli-serve) - Use webpack with a development server that provides live reloading.
- [`webpack-cli update`](./packages/update/README.md#webpack-cli-update) - Update properties in a webpack configuration file.

### Utilities

The project also has several utility packages which are used by other commands

- [`utils`](./packages/utils/README.md) - Several utilities used across webpack-cli.
- [`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.

- [`utils`](./packages/utils/README.md) - Several utilities used across webpack-cli.
- [`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

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