From f168876c5bc508441079e0016dbdf6e92ee489aa Mon Sep 17 00:00:00 2001
From: Pranshu Chittora
Date: Thu, 25 Apr 2019 16:09:40 +0530
Subject: [PATCH 1/3] chore(docs): refactors doc links in main readme
created references for the links
---
README.md | 83 +++++++++++++++++++++++++++++++++----------------------
1 file changed, 50 insertions(+), 33 deletions(-)
diff --git a/README.md b/README.md
index 381f5610cd1..c75d606f3f5 100644
--- a/README.md
+++ b/README.md
@@ -11,25 +11,24 @@
-[![npm](https://img.shields.io/npm/v/webpack-cli.svg)](https://www.npmjs.com/package/webpack-cli)
-[![Build Status](https://travis-ci.org/webpack/webpack-cli.svg)](https://travis-ci.org/webpack/webpack-cli)
-[![Build2 Status](https://dev.azure.com/webpack/webpack/_apis/build/status/webpack.webpack-cli)](https://dev.azure.com/webpack/webpack/_build/latest?definitionId=4)
+[![npm][npm]][npm-url]
+[![Build Status][build-status]][build-status-url]
+[![Build2 Status][build-status-azure]][build-status-azure-url]
[![deps][deps]][deps-url]
-[![Code Climate](https://codeclimate.com/github/webpack/webpack-cli/badges/gpa.svg)](https://codeclimate.com/github/webpack/webpack-cli)
-[![chat on gitter](https://badges.gitter.im/webpack/webpack.svg)](https://gitter.im/webpack/webpack)
-[![Install Size](https://packagephobia.now.sh/badge?p=webpack-cli)](https://packagephobia.now.sh/result?p=webpack-cli)
-[![npm](https://img.shields.io/npm/dw/webpack-cli.svg)](https://www.npmjs.com/package/webpack-cli)
-[![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)
+[![Code Climate][maintainability]][maintainability-url]
+[![chat on gitter][chat]][chat-url]
+[![Install Size][size]][size-url]
+[![Downloads][downloads]][downloads-url]
+[![lerna][lerna]][lerna-url]
+[![GitHub contributors][contributors]][contributors-url]
+
+- [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
@@ -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
@@ -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
@@ -77,7 +75,7 @@ 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
@@ -89,5 +87,24 @@ You can read more about [Scaffolding](https://webpack.js.org/guides/scaffolding)
The webpack family welcomes any contributor, small or big. We are happy to elaborate, guide you through the source code and find issues you might want to work on! To get started have a look at our [documentation on contributing](./.github/CONTRIBUTING.md).
+[build-status]: https://travis-ci.org/webpack/webpack-cli.svg
+[build-status-url]: https://travis-ci.org/webpack/webpack-cli
+[build-status-azure]: https://dev.azure.com/webpack/webpack/_apis/build/status/webpack.webpack-cli
+[build-status-azure-url]: https://dev.azure.com/webpack/webpack/_build/latest?definitionId=4
+[chat]: https://badges.gitter.im/webpack/webpack.svg
+[chat-url]: https://gitter.im/webpack/webpack
+[contributors]: https://img.shields.io/github/contributors/webpack/webpack-cli.svg
+[contributors-url]:https://github.com/webpack/webpack-cli/graphs/contributors
[deps]: https://img.shields.io/david/webpack/webpack.svg
[deps-url]: https://david-dm.org/webpack/webpack-cli
+[downloads]: https://img.shields.io/npm/dw/webpack-cli.svg
+[downloads-url]: https://www.npmjs.com/package/webpack-cli
+[lerna]: https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg
+
+[lerna-url]:http://www.lernajs.io/
+[npm]: https://img.shields.io/npm/v/webpack-cli.svg
+[npm-url]: https://www.npmjs.com/package/webpack-cli
+[maintainability]: https://codeclimate.com/github/webpack/webpack-cli/badges/gpa.svg
+[maintainability-url]: https://codeclimate.com/github/webpack/webpack-cli
+[size]: https://packagephobia.now.sh/badge?p=webpack-cli
+[size-url]:https://packagephobia.now.sh/result?p=webpack-cli
From 2364ae28852d1dd0b9c0f3b0487c32224b5ec415 Mon Sep 17 00:00:00 2001
From: Pranshu Chittora
Date: Thu, 25 Apr 2019 18:11:37 +0530
Subject: [PATCH 2/3] chore(docs): refactors links for badges in all packages
created macros for all readme.md badges links
---
packages/README.md | 8 ++-
packages/add/README.md | 5 +-
packages/generate-loader/README.md | 6 +-
packages/generate-plugin/README.md | 7 +-
packages/generators/README.md | 38 +++++++----
packages/info/README.md | 6 +-
packages/init/README.md | 11 ++-
packages/migrate/README.md | 7 +-
packages/remove/README.md | 9 ++-
packages/serve/README.md | 7 +-
packages/update/README.md | 7 +-
packages/utils/README.md | 20 +++---
packages/webpack-scaffold/README.md | 102 ++++++++++++++--------------
13 files changed, 148 insertions(+), 85 deletions(-)
diff --git a/packages/README.md b/packages/README.md
index 905d1917cca..3e9e3661d5b 100644
--- a/packages/README.md
+++ b/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)
@@ -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/
```
2. Installation of respective `package` with `webpack-cli` [Recommended]
+
```shell
npm install webpack-cli @webpack-cli/
```
-----
+---
+
[Back to webpack-cli](https://github.com/webpack/webpack-cli)
diff --git a/packages/add/README.md b/packages/add/README.md
index cc13015724b..82196d3e567 100644
--- a/packages/add/README.md
+++ b/packages/add/README.md
@@ -1,6 +1,6 @@
# webpack-cli add
-[![npm](https://img.shields.io/npm/dm/@webpack-cli/add.svg)](https://www.npmjs.com/package/@webpack-cli/add)
+[![NPM downloads][downloads]][downloads-url]
## Description
@@ -34,3 +34,6 @@ add();
```bash
npx webpack-cli add
```
+
+[downloads]: https://img.shields.io/npm/dm/@webpack-cli/add.svg
+[downloads-url]: https://www.npmjs.com/package/@webpack-cli/add
diff --git a/packages/generate-loader/README.md b/packages/generate-loader/README.md
index ed7e47ae96a..d1b6ad8a38c 100644
--- a/packages/generate-loader/README.md
+++ b/packages/generate-loader/README.md
@@ -1,6 +1,6 @@
# webpack-cli generate-loader
-[![npm](https://img.shields.io/npm/dm/@webpack-cli/generate-loader.svg)](https://www.npmjs.com/package/@webpack-cli/generate-loader)
+[![NPM Downloads][downloads]][downloads-url]
## Description
@@ -24,6 +24,10 @@ generateLoader();
```
### CLI (via `webpack-cli`)
+
```bash
npx webpack-cli generate-loader
```
+
+[downloads]: https://img.shields.io/npm/dm/@webpack-cli/generate-loader.svg
+[downloads-url]: https://www.npmjs.com/package/@webpack-cli/generate-loader
diff --git a/packages/generate-plugin/README.md b/packages/generate-plugin/README.md
index 29662905a17..096a0ad491e 100644
--- a/packages/generate-plugin/README.md
+++ b/packages/generate-plugin/README.md
@@ -1,6 +1,6 @@
# webpack-cli generate-plugin
-[![npm](https://img.shields.io/npm/dm/@webpack-cli/generate-plugin.svg)](https://www.npmjs.com/package/@webpack-cli/generate-plugin)
+[![NPM Downloads][downloads]][downloads-url]
## Description
@@ -17,12 +17,17 @@ 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
```
+
+[downloads]: https://img.shields.io/npm/dm/@webpack-cli/generate-plugin.svg
+[downloads-url]: https://www.npmjs.com/package/@webpack-cli/generate-plugin
diff --git a/packages/generators/README.md b/packages/generators/README.md
index 5139dcf3c4b..6fcb5621dec 100644
--- a/packages/generators/README.md
+++ b/packages/generators/README.md
@@ -1,10 +1,10 @@
# webpack-cli generators
-[![npm](https://img.shields.io/npm/dm/@webpack-cli/generators.svg)](https://www.npmjs.com/package/@webpack-cli/generators)
+[![NPM Downloads][downloads]][downloads-url]
## Description
-This package contains all webpack-cli related yeoman generators.
+This package contains all webpack-cli related yeoman generators.
## Installation
@@ -19,19 +19,31 @@ 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`
+- [**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`
+
---
+
[Back to Packages](https://github.com/webpack/webpack-cli/tree/master/packages)
+
+[downloads]: https://img.shields.io/npm/dm/@webpack-cli/generators.svg
+[downloads-url]: https://www.npmjs.com/package/@webpack-cli/generators
diff --git a/packages/info/README.md b/packages/info/README.md
index 03dcd9bd8d1..1c484609142 100644
--- a/packages/info/README.md
+++ b/packages/info/README.md
@@ -1,6 +1,6 @@
# webpack-cli info
-[![npm](https://img.shields.io/npm/dm/@webpack-cli/info.svg)](https://www.npmjs.com/package/@webpack-cli/info)
+[![NPM Downloads][downloads]][downloads-url]
## Description
@@ -22,6 +22,10 @@ envinfo();
```
### CLI (via `webpack-cli`)
+
```bash
npx webpack-cli info
```
+
+[downloads]: https://img.shields.io/npm/dm/@webpack-cli/info.svg
+[downloads-url]: https://www.npmjs.com/package/@webpack-cli/info
diff --git a/packages/init/README.md b/packages/init/README.md
index 465966be148..80777a7a179 100644
--- a/packages/init/README.md
+++ b/packages/init/README.md
@@ -1,6 +1,6 @@
# webpack-cli init
-[![npm](https://img.shields.io/npm/dm/@webpack-cli/init.svg)](https://www.npmjs.com/package/@webpack-cli/init)
+[![NPM Downloads][downloads]][downloads-url]
## Description
@@ -24,24 +24,31 @@ const init = require("@webpack-cli/init").default;
// this will run the default init instance
init();
- // we're slicing node.process, ...myPacakges is a webpack-scaffold name/path
+// we're slicing node.process, ...myPacakges is a webpack-scaffold name/path
init([null, null, ...myPacakges]);
```
### CLI (via `webpack-cli`)
+
**Via defaults**
```bash
npx webpack-cli init
```
+
**Via custom scaffold**
+
1. Using package on `npm`
```bash
npx webpack-cli init webpack-scaffold-[name]
```
+
2. Using path to local directory
```bash
npx webpack-cli init [path]
```
+
+[downloads]: https://img.shields.io/npm/dm/@webpack-cli/init.svg
+[downloads-url]: https://www.npmjs.com/package/@webpack-cli/init
diff --git a/packages/migrate/README.md b/packages/migrate/README.md
index 68a8ae342a9..a5fc77e87dc 100644
--- a/packages/migrate/README.md
+++ b/packages/migrate/README.md
@@ -1,6 +1,6 @@
# webpack-cli migrate
-[![npm](https://img.shields.io/npm/dm/@webpack-cli/migrate.svg)](https://www.npmjs.com/package/@webpack-cli/migrate)
+[![npm][downloads]][downloads-url]
## Description
@@ -17,6 +17,7 @@ npm i -D webpack-cli @webpack-cli/migrate
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 migrate = require("@webpack-cli/migrate").default;
@@ -25,6 +26,10 @@ migrate(null, null, inputPath, outputPath);
```
### CLI (via `webpack-cli`)
+
```bash
npx webpack-cli migrate
```
+
+[downloads]: https://img.shields.io/npm/dm/@webpack-cli/migrate.svg
+[downloads-url]: https://www.npmjs.com/package/@webpack-cli/migrate
diff --git a/packages/remove/README.md b/packages/remove/README.md
index 9ec0202d772..f6404874945 100644
--- a/packages/remove/README.md
+++ b/packages/remove/README.md
@@ -1,10 +1,10 @@
# webpack-cli remove
-[![npm](https://img.shields.io/npm/dm/@webpack-cli/remove.svg)](https://www.npmjs.com/package/@webpack-cli/remove)
+[![NPM Downloads][downloads]][downloads-url]
## Description
-This package contains the logic to remove properties of a webpack configuration file. It will run a generator that prompts the user for questions of which property to remove in their webpack configuration file.
+This package contains the logic to remove properties of a webpack configuration file. It will run a generator that prompts the user for questions of which property to remove in their webpack configuration file.
## Installation
@@ -17,12 +17,17 @@ npm i -D webpack-cli @webpack-cli/remove
To run the scaffolding instance programmatically, install it as a dependency. When using the package programmatically, one does not have to install webpack-cli.
### Node
+
```js
const remove = require("@webpack-cli/remove").default;
remove();
```
### CLI (via `webpack-cli`)
+
```bash
npx webpack-cli remove
```
+
+[downloads]: https://img.shields.io/npm/dm/@webpack-cli/remove.svg
+[downloads-url]: https://www.npmjs.com/package/@webpack-cli/remove
diff --git a/packages/serve/README.md b/packages/serve/README.md
index 39269aef404..204f5b65813 100644
--- a/packages/serve/README.md
+++ b/packages/serve/README.md
@@ -1,6 +1,6 @@
# webpack-cli serve
-[![npm](https://img.shields.io/npm/dm/@webpack-cli/serve.svg)](https://www.npmjs.com/package/@webpack-cli/serve)
+[![NPM Downloads][downloads]][downloads-url]
## Description
@@ -17,12 +17,17 @@ npm i -D webpack-cli @webpack-cli/serve
To run the scaffolding instance programmatically, install it as a dependency. When using the package programmatically, one does not have to install webpack-cli.
### Node
+
```js
const serve = require("@webpack-cli/serve").default;
serve();
```
### CLI (via `webpack-cli`)
+
```bash
npx webpack-cli serve
```
+
+[downloads]: https://img.shields.io/npm/dm/@webpack-cli/serve.svg
+[downloads-url]: https://www.npmjs.com/package/@webpack-cli/serve
diff --git a/packages/update/README.md b/packages/update/README.md
index dd038a61038..ae6ab2e2dad 100644
--- a/packages/update/README.md
+++ b/packages/update/README.md
@@ -1,6 +1,6 @@
# webpack-cli update
-[![npm](https://img.shields.io/npm/dm/@webpack-cli/update.svg)](https://www.npmjs.com/package/@webpack-cli/update)
+[![NPM Downloads][downloads]][downloads-url]
## Description
@@ -17,12 +17,17 @@ npm i -D webpack-cli @webpack-cli/update
To run the scaffolding instance programmatically, install it as a dependency. When using the package programmatically, one does not have to install webpack-cli.
### Node
+
```js
const update = require("@webpack-cli/update").default;
update();
```
### CLI (via `webpack-cli`)
+
```bash
npx webpack-cli update
```
+
+[downloads]: https://img.shields.io/npm/dm/@webpack-cli/update.svg
+[downloads-url]: https://www.npmjs.com/package/@webpack-cli/update
diff --git a/packages/utils/README.md b/packages/utils/README.md
index 2ea21274d09..ec10524f063 100644
--- a/packages/utils/README.md
+++ b/packages/utils/README.md
@@ -1,6 +1,6 @@
# webpack-cli utils (WIP, not yet published)
-[![npm](https://img.shields.io/npm/dm/@webpack-cli/utils.svg)](https://www.npmjs.com/package/@webpack-cli/utils)
+[![NPM Downloads][downloads]][downloads-url]
## Description
@@ -13,13 +13,14 @@ npm i -D webpack-cli @webpack-cli/utils
```
## Contents
- - AST transformations
- - Checking NPM registry
- - A Recursive AST parser
- - Checking Local Configurations
- - Yeoman Generator Adapter
- - Package Resolver
- - Test Utilities for Jest
+
+- AST transformations
+- Checking NPM registry
+- A Recursive AST parser
+- Checking Local Configurations
+- Yeoman Generator Adapter
+- Package Resolver
+- Test Utilities for Jest
## Usage
@@ -29,3 +30,6 @@ npm i -D webpack-cli @webpack-cli/utils
const utils = require("@webpack-cli/utils");
// API yet to be exposed
```
+
+[downloads]: https://img.shields.io/npm/dm/@webpack-cli/utils.svg
+[downloads-url]: https://www.npmjs.com/package/@webpack-cli/utils
diff --git a/packages/webpack-scaffold/README.md b/packages/webpack-scaffold/README.md
index fcd01de288f..a0a92441b40 100755
--- a/packages/webpack-scaffold/README.md
+++ b/packages/webpack-scaffold/README.md
@@ -1,6 +1,6 @@
# webpack-scaffold
-[![npm](https://img.shields.io/npm/dm/@webpack-cli/webpack-scaffold.svg)](https://www.npmjs.com/package/@webpack-cli/webpack-scaffold)
+[![NPM Downloads][downloads]][downloads-url]
This is the utility suite for creating a webpack `scaffold`, it contains utility functions to help you work with [Inquirer](https://github.com/SBoudrias/Inquirer.js/) prompting and scaffolding.
@@ -11,20 +11,15 @@ npm i -D webpack-cli @webpack-cli/webpack-scaffold
```
# API
-- [parseValue](#parsevalue)
-- [createArrowFunction](#createarrowfunction)
-- [createRegularFunction](#createregularfunction)
-- [createDynamicPromise](#createdynamicpromise)
-- [createAssetFilterFunction](#createassetfilterfunction)
-- [createExternalFunction](#createexternalfunction)
-- [createRequire](#createrequire)
-- [Inquirer](#inquirer)
- - [List](#list)
- - [RawList](#rawlist)
- - [CheckList](#checklist)
- - [Input](#input)
- - [InputValidate](#inputvalidate)
- - [Confirm](#confirm)
+
+- [parseValue](#parsevalue)
+- [createArrowFunction](#createarrowfunction)
+- [createRegularFunction](#createregularfunction)
+- [createDynamicPromise](#createdynamicpromise)
+- [createAssetFilterFunction](#createassetfilterfunction)
+- [createExternalFunction](#createexternalfunction)
+- [createRequire](#createrequire)
+- [Inquirer](#inquirer) - [List](#list) - [RawList](#rawlist) - [CheckList](#checklist) - [Input](#input) - [InputValidate](#inputvalidate) - [Confirm](#confirm)
## parseValue
@@ -33,9 +28,9 @@ Param: `String`
Used when you cannot use regular conventions. Handy for examples like `RegExp` or `output.sourcePrefix`
```js
-const parseValue = require('@webpack-cli/webpack-scaffold').parseValue;
+const parseValue = require("@webpack-cli/webpack-scaffold").parseValue;
-this.configuration.myScaffold.webpackOptions.output.sourcePrefix = parseValue('\t')
+this.configuration.myScaffold.webpackOptions.output.sourcePrefix = parseValue("\t");
// sourcePrefix: '\t'
```
@@ -46,9 +41,9 @@ Param: `String`
Generally used when dealing with an entry point as an arrow function
```js
-const createArrowFunction = require('@webpack-cli/webpack-scaffold').createArrowFunction;
+const createArrowFunction = require("@webpack-cli/webpack-scaffold").createArrowFunction;
-this.configuration.myScaffold.webpackOptions.entry = createArrowFunction('app.js')
+this.configuration.myScaffold.webpackOptions.entry = createArrowFunction("app.js");
// entry: () => 'app.js'
```
@@ -59,9 +54,9 @@ Param: `String`
Used when creating a function that returns a single value
```js
-const createRegularFunction = require('@webpack-cli/webpack-scaffold').createRegularFunction;
+const createRegularFunction = require("@webpack-cli/webpack-scaffold").createRegularFunction;
-this.configuration.myScaffold.webpackOptions.entry = createRegularFunction('app.js')
+this.configuration.myScaffold.webpackOptions.entry = createRegularFunction("app.js");
// entry: function() { return 'app.js' }
```
@@ -72,12 +67,12 @@ Param: `Array` | `String`
Used to create a dynamic entry point
```js
-const createDynamicPromise = require('@webpack-cli/webpack-scaffold').createDynamicPromise;
+const createDynamicPromise = require("@webpack-cli/webpack-scaffold").createDynamicPromise;
-this.confguration.myScaffold.webpackOptions.entry = createDynamicPromise('app.js')
+this.confguration.myScaffold.webpackOptions.entry = createDynamicPromise("app.js");
// entry: () => new Promise((resolve) => resolve('app.js'))
-this.configuration.myScaffold.webpackOptions.entry = createDynamicPromise(['app.js', 'index.js'])
+this.configuration.myScaffold.webpackOptions.entry = createDynamicPromise(["app.js", "index.js"]);
// entry: () => new Promise((resolve) => resolve(['app.js','index.js']))
```
@@ -88,9 +83,9 @@ Param: `String`
Used to create an [assetFilterFunction](https://webpack.js.org/configuration/performance/#performance-assetfilter)
```js
-const createAssetFilterFunction = require('@webpack-cli/webpack-scaffold').createAssetFilterFunction;
+const createAssetFilterFunction = require("@webpack-cli/webpack-scaffold").createAssetFilterFunction;
-this.configuration.myScaffold.webpackOptions.performance.assetFilter = createAssetFilterFunction('js')
+this.configuration.myScaffold.webpackOptions.performance.assetFilter = createAssetFilterFunction("js");
// assetFilter: function (assetFilename) { return assetFilename.endsWith('.js'); }
```
@@ -101,9 +96,9 @@ Param: `String`
Used to create an [general function from Externals](https://webpack.js.org/configuration/externals/#function)
```js
-const createExternalFunction = require('@webpack-cli/webpack-scaffold').createExternalFunction;
+const createExternalFunction = require("@webpack-cli/webpack-scaffold").createExternalFunction;
-this.configuration.myScaffold.webpackOptions.externals = [createExternalFunction('^yourregex$')]
+this.configuration.myScaffold.webpackOptions.externals = [createExternalFunction("^yourregex$")];
/*
externals: [
function(context, request, callback) {
@@ -122,9 +117,9 @@ Param: `String`
Used to create a module in `topScope`
```js
-const createRequire = require('@webpack-cli/webpack-scaffold').createRequire;
+const createRequire = require("@webpack-cli/webpack-scaffold").createRequire;
-this.configuration.myScaffold.topScope = [createRequire('webpack')]
+this.configuration.myScaffold.topScope = [createRequire("webpack")];
// const webpack = require('webpack')
```
@@ -137,21 +132,21 @@ Param: `name, message, choices`
Creates a List from Inquirer
```js
-const List = require('@webpack-cli/webpack-scaffold').List;
+const List = require("@webpack-cli/webpack-scaffold").List;
-List('entry', 'what kind of entry do you want?', ['Array', 'Function'])
+List("entry", "what kind of entry do you want?", ["Array", "Function"]);
```
-### RawList
+### RawList
Param: `name, message, choices`
Creates a RawList from Inquirer
```js
-const RawList = require('@webpack-cli/webpack-scaffold').RawList;
+const RawList = require("@webpack-cli/webpack-scaffold").RawList;
-RawList('entry', 'what kind of entry do you want?', ['Array', 'Function'])
+RawList("entry", "what kind of entry do you want?", ["Array", "Function"]);
```
### CheckList
@@ -161,21 +156,21 @@ Param: `name, message, choices`
Creates a CheckList(`checkbox`) from Inquirer
```js
-const CheckList = require('@webpack-cli/webpack-scaffold').CheckList;
+const CheckList = require("@webpack-cli/webpack-scaffold").CheckList;
-CheckList('entry', 'what kind of entry do you want?', ['Array', 'Function'])
+CheckList("entry", "what kind of entry do you want?", ["Array", "Function"]);
```
-### Input
+### Input
Param: `name, message`
Creates an Input from Inquirer
```js
-const Input = require('@webpack-cli/webpack-scaffold').Input;
+const Input = require("@webpack-cli/webpack-scaffold").Input;
-Input('entry', 'what is your entry point?')
+Input("entry", "what is your entry point?");
```
### InputValidate
@@ -185,16 +180,16 @@ Param: `name, message, validate`
Creates an Input from Inquirer
```js
-const InputValidate = require('@webpack-cli/webpack-scaffold').InputValidate;
-
-const validation = (value) => {
- if(value.length > 4) {
- return true;
- } else {
- return 'Wow, that was short!'
- }
-}
-InputValidate('entry', 'what is your entry point?', validation)
+const InputValidate = require("@webpack-cli/webpack-scaffold").InputValidate;
+
+const validation = value => {
+ if (value.length > 4) {
+ return true;
+ } else {
+ return "Wow, that was short!";
+ }
+};
+InputValidate("entry", "what is your entry point?", validation);
```
### Confirm
@@ -204,7 +199,10 @@ Param: `name, message, default`
Creates an Input from Inquirer
```js
-const Confirm = require('@webpack-cli/webpack-scaffold').Confirm;
+const Confirm = require("@webpack-cli/webpack-scaffold").Confirm;
-Confirm('contextConfirm', 'Is this your context?')
+Confirm("contextConfirm", "Is this your context?");
```
+
+[downloads]: https://img.shields.io/npm/dm/@webpack-cli/webpack-scaffold.svg
+[downloads-url]: https://www.npmjs.com/package/@webpack-cli/webpack-scaffold
From 2683bc5f5069f177e303caa5cc5432862b498fb2 Mon Sep 17 00:00:00 2001
From: Pranshu Chittora
Date: Fri, 3 May 2019 23:43:52 +0530
Subject: [PATCH 3/3] fix(docs): removes conflict markers
removed traces of conflict markers
---
README.md | 6 ------
1 file changed, 6 deletions(-)
diff --git a/README.md b/README.md
index 5c29994299c..ec9fa54384e 100644
--- a/README.md
+++ b/README.md
@@ -62,15 +62,9 @@ Supporting developers is an important task for webpack CLI. Thus, webpack CLI pr
The project also has several utility packages which are used by other commands
-<<<<<<< HEAD
-
-- [`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.
- > > > > > > > d16404afee273887e8a91228185126015232aff9
## Getting started