diff --git a/.eslintrc.js b/.eslintrc.js
index b584e0b742f..0c8e2e4f974 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,31 +1,29 @@
module.exports = {
- "root": true,
- "plugins": ["node"],
- "extends": ["eslint:recommended", "plugin:node/recommended"],
- "env": {
- "node": true,
- "es6": true,
- "jest": true
+ extends: ["eslint:recommended"],
+ env: {
+ node: true,
+ es6: true,
+ jest: true
},
- "parserOptions": { "ecmaVersion": 2017, "sourceType": "module"},
- "rules": {
+ parserOptions: { ecmaVersion: 2017, sourceType: "module" },
+ rules: {
"no-useless-escape": "off",
"quote-props": ["error", "as-needed"],
"no-dupe-keys": "error",
- "quotes": ["error", "double"],
+ quotes: ["error", "double"],
"no-undef": "error",
"no-extra-semi": "error",
- "semi": "error",
+ semi: "error",
"no-template-curly-in-string": "error",
"no-caller": "error",
- "yoda": "error",
- "eqeqeq": "error",
+ yoda: "error",
+ eqeqeq: "error",
"global-require": "off",
"brace-style": "error",
"key-spacing": "error",
"space-in-parens": ["error", "never"],
"space-infix-ops": "error",
- "indent": ["error", "tab", { "SwitchCase": 1 }],
+ indent: ["error", "tab", { SwitchCase: 1 }],
"no-extra-bind": "warn",
"no-empty": "off",
"no-multiple-empty-lines": "error",
@@ -33,78 +31,31 @@ module.exports = {
"no-process-exit": "off",
"no-trailing-spaces": "error",
"no-use-before-define": "off",
- "no-unused-vars": ["error", { "args": "none" }],
+ "no-unused-vars": ["error", { args: "none" }],
"no-unsafe-negation": "error",
"no-loop-func": "warn",
"space-before-function-paren": ["error", "never"],
"space-before-blocks": "error",
"object-curly-spacing": ["error", "always"],
- "object-curly-newline": ["error", { "consistent": true }],
- "keyword-spacing": ["error", {
- "after": true,
- "overrides": {
- "const": { "after": true },
- "try": { "after": true },
- "throw": { "after": true },
- "case": { "after": true },
- "return": { "after": true },
- "finally": { "after": true },
- "do": { "after": true }
- }
- }],
- "no-console": "off",
- "valid-jsdoc": "error",
- "node/no-unsupported-features": ["error", { "version": 6 }],
- "node/no-deprecated-api": "error",
- "node/no-missing-import": "error",
- "node/no-missing-require": [
- "error",
- {
- "resolvePaths": ["./packages"],
- "allowModules": [
- "webpack",
- "@webpack-cli/generators",
- "@webpack-cli/init",
- "@webpack-cli/migrate",
- "@webpack-cli/utils",
- "@webpack-cli/generate-loader",
- "@webpack-cli/generate-plugin",
- "@webpack-cli/webpack-scaffold"
- ]
- }
- ],
- "node/no-unpublished-bin": "error",
- "node/no-unpublished-require": [
+ "object-curly-newline": ["error", { consistent: true }],
+ "keyword-spacing": [
"error",
{
- "allowModules": [
- "webpack",
- "webpack-dev-server",
- "@webpack-cli/generators",
- "@webpack-cli/init",
- "@webpack-cli/migrate",
- "@webpack-cli/utils",
- "@webpack-cli/generate-loader",
- "@webpack-cli/generate-plugin",
- "@webpack-cli/webpack-scaffold"
- ]
- }
- ],
- "node/no-extraneous-require": [
- "error",
- {
- "allowModules": [
- "@webpack-cli/migrate",
- "@webpack-cli/generators",
- "@webpack-cli/utils",
- "@webpack-cli/generate-loader",
- "@webpack-cli/generate-plugin",
- "@webpack-cli/webpack-scaffold"
- ]
+ after: true,
+ overrides: {
+ const: { after: true },
+ try: { after: true },
+ throw: { after: true },
+ case: { after: true },
+ return: { after: true },
+ finally: { after: true },
+ do: { after: true }
+ }
}
],
+ "no-console": "off",
+ "valid-jsdoc": "error",
"eol-last": ["error", "always"],
- "newline-per-chained-call": "off",
- "node/process-exit-as-throw": "error"
+ "newline-per-chained-call": "off"
}
};
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 4ed7f17ccba..704d573270a 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -5,6 +5,34 @@ appreciated and welcomed. If you're planning a new feature or changing
the API, please create an issue first. This way we can ensure that your precious
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
Most of the time, when webpack does not work correctly, it might be a configuration issue.
@@ -19,7 +47,7 @@ that include your `webpack.config.js` and relevant files. This way you help othe
First of all, you will need to create an issue in Github for the feature or bugfix that you want to work on. When you open a new issue, there will be a template that will be automatically added to the text of the issue, which you would need to fill in. Doing this will help us to understand better what the ticket is about.
-After you've created the issue, we will have a look, and provide feedback to your ticket.
+After you've created the issue, we will have a look, and provide feedback to your ticket.
In case it is a bug that you want to fix, we might help you with background information about the issue, so you can make an informed fix.
@@ -27,14 +55,14 @@ 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".*
-* Fork the **webpack-cli** repo at [https://github.com/webpack/webpack-cli](https://github.com/webpack/webpack-cli).
-* `git clone && cd webpack-cli`
+- 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 && cd webpack-cli`
### Using npm
-* Install the dependencies and link them:
+- Install the dependencies and link them:
```bash
npm install
@@ -42,7 +70,7 @@ In case you are suggesting a new feature, we will match your idea with our curre
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
@@ -51,13 +79,13 @@ 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
@@ -65,74 +93,103 @@ In case you are suggesting a new feature, we will match your idea with our curre
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
yarn build
```
-
-## Testing
+## Running Tests
### Using npm
-* Run all the tests with:
-
+- Run all the tests with:
+
```bash
npm run test
```
-* Test a single CLI test case:
-
+- Run CLI tests with:
+
```bash
- npx jest path/to/my-test.js
+ npm run test:cli
```
-* You can also install jest globally and run tests without npx:
+- Run tests of all packages:
+
+ ```bash
+ npm run test:packages
+ ```
+
+- 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:
```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 && npm run tslint
+ npm run lint
```
### Using yarn
-* Run all the tests with:
-
+- Run all the tests with:
+
```bash
yarn test
```
-* Test a single CLI test case:
-
+- Run CLI tests with:
+
+ ```bash
+ yarn test:cli`
+ ```
+
+- Run tests of all packages:
+
+ ```bash
+ yarn test:packages
+ ```
+
+- 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 && yarn tslint
+ 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.
+## Dependencies
+
+This is a multi-package repository and dependencies are managed using [lerna](https://lerna.js.org/)
+
+> If you are adding or updating any dependency, please commit the updated `package-lock.json` file.
+
## Branching Model
We base our branching model on [git flow](http://nvie.com/posts/a-successful-git-branching-model/). Instead of working with a `develop` base branch, we use the `master` branch. We do it to ease the workflow a bit. However, we find that adding prefixes to the branches is useful.
@@ -141,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
@@ -165,7 +222,7 @@ If you are fixing an existing bug, you can create a branch with the following pr
## Testing
-Every bugfix or feature that you submit, needs to be tested. Writing tests for code is very important to prevent future bugs, and help to discover possible new bugs promptly.
+Every bugfix or feature that you submit, needs to be tested. Writing tests for the code is very important to prevent future bugs, and help to discover possible new bugs promptly.
It is important that you test the logic of the code you're writing, and that your tests really go through all your lines, branches and statements. This is the only way to ensure that the code coverage is high enough to ensure the users of the cli, that they are using a solid tool.
@@ -180,11 +237,11 @@ 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 format
+## Commit message
Our commit messages format follows the [angular.js commits format](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit-message-format).
@@ -193,27 +250,30 @@ You can use `npm run commit` script to have an interactive way of making commits
We don't use the scope. The template of a commit would look like this:
### Commit Message Format
-Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
+
+Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
format that includes a **type** and a **subject**:
-```
+```md
:
+
```
-This is the list of *type* of commits that we accept:
-* ast
-* break
-* chore
-* cli
-* docs
-* feat
-* fix
-* misc
-* tests
+This is the list of _type_ of commits that we accept:
+
+- ast
+- break
+- chore
+- cli
+- docs
+- feat
+- fix
+- misc
+- tests
The **header** is mandatory.
@@ -223,11 +283,11 @@ to read on GitHub as well as in several git tools.
For more information about what each part of the template mean, head up to the documentation in the
[angular repo](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit-message-format)
-## --migrate with the CLI
+## Migrate with the CLI
This is a new feature in development for the CLI.
-```
+```sh
webpack --migrate
```
@@ -235,7 +295,7 @@ The expected result of the above command is to take the mentioned `webpack` conf
It should be a valid new config and should keep intact all the features from the original config.
The new config will be as readable as possible (may add some comments).
-With [#40](https://github.com/webpack/webpack-cli/pull/40), we have been able to add basic scaffolding and do many of the conversions recommended in the [docs](https://webpack.js.org/guides/migrating/).
+With [#40](https://github.com/webpack/webpack-cli/pull/40), we have been able to add basic scaffolding and do many of the conversions recommended in the [docs](https://webpack.js.org/migrate).
### How it's being done
@@ -269,22 +329,23 @@ This is where you declare a new test case for your transformation.
Each test will refer to an input webpack config snippet.
Conventionally we write them in `\_\_testfixtures\_\_`.
-```
-const defineTest = require('../defineTest');
+```js
+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.
It takes the input file given as parameter and uses jest to create a snapshot of the output. This effectively tests the correctness of our transformation.
-### TODO
+### Further Work
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
@@ -292,7 +353,6 @@ When submitting your contribution, a CLA (Contributor License Agreement) bot wil
Run `git config user.email` to see your Git email, and verify it with [your GitHub email](https://github.com/settings/emails).
-
## Documentation
webpack is feature rich and documentation is a time sink. We
diff --git a/.gitignore b/.gitignore
index ef696edb785..6fd2e644f89 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,3 +37,4 @@ yarn.lock
# source maps of docs
docs/**/*.map
+junit.xml
diff --git a/.travis.yml b/.travis.yml
index 9209f6441a4..1c1e5a9e6f1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,13 +10,6 @@ cache:
directories:
- ~/.npm
matrix:
- include:
- - os: linux
- node_js: "stable"
- env: JOB_PART=lint
- - os: linux
- node_js: "stable"
- env: JOB_PART=integration
- os: linux
node_js: "10"
env: JOB_PART=integration
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6eda649a0f3..144318849f8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,193 @@
+
+# 3.3.2 (2019-05-04)
+[Full Changelog](https://github.com/webpack/webpack-cli/compare/v0.1.5...v3.3.2)
+
+## New Features
+
+* opencollective prompt: add option to disable it + doc ([d4643ae](https://github.com/webpack/webpack-cli/commit/d4643ae))
+* terser: clean old files ([89e6b74](https://github.com/webpack/webpack-cli/commit/89e6b74))
+* terser: remove leftover files ([27d5b4d](https://github.com/webpack/webpack-cli/commit/27d5b4d))
+* terser: replace after merging master ([c404655](https://github.com/webpack/webpack-cli/commit/c404655))
+* replace Uglify with Terser in generators ([2b8651b](https://github.com/webpack/webpack-cli/commit/2b8651b))
+* use terserPlugin in loaderOptionsPlugin ([14f5337](https://github.com/webpack/webpack-cli/commit/14f5337))
+* use terserJsPlugin for transformations during migrate ([33c6185](https://github.com/webpack/webpack-cli/commit/33c6185))
+* replace uglifyJsPlugin with terserPlugin in migrate ([d467f3b](https://github.com/webpack/webpack-cli/commit/d467f3b))
+* opencollective prompt: work on windows setting atime by code ([3af73a8](https://github.com/webpack/webpack-cli/commit/3af73a8))
+* opencollective prompt: fix typo ([c2351b1](https://github.com/webpack/webpack-cli/commit/c2351b1))
+* opencollective prompt: remove .lastocprint file from fs ([b96ad56](https://github.com/webpack/webpack-cli/commit/b96ad56))
+* opencollective prompt: extract weekday to variable ([790d27a](https://github.com/webpack/webpack-cli/commit/790d27a))
+* opencollective prompt: set terminal cols to 80 ([badc32d](https://github.com/webpack/webpack-cli/commit/badc32d))
+* opencollective prompt: fix azure ci ([ea0039a](https://github.com/webpack/webpack-cli/commit/ea0039a))
+* opencollective prompt: lint ([ea906d8](https://github.com/webpack/webpack-cli/commit/ea906d8))
+* opencollective prompt: clear package.json modifications ([f080733](https://github.com/webpack/webpack-cli/commit/f080733))
+* opencollective prompt: add prompt in postinstall script ([dd9d528](https://github.com/webpack/webpack-cli/commit/dd9d528))
+
+## Ast
+
+* change tooltip property from uglify to terser ([ea9e4b8](https://github.com/webpack/webpack-cli/commit/ea9e4b8))
+* replace requires and inits for uglify with terser ([3011a6c](https://github.com/webpack/webpack-cli/commit/3011a6c))
+* replace UglifyJsPlugin with TerserPlugin ([21da35f](https://github.com/webpack/webpack-cli/commit/21da35f))
+
+## Chore
+
+* cli: move constants to a separate file ([#798](https://github.com/webpack/webpack-cli/pull/798))
+* deps: fix security vulnerabilities ([#857](https://github.com/webpack/webpack-cli/pull/857))
+* deps: upgrade lerna to fix vulnerabilities & update webpack-dev-server ([#823](https://github.com/webpack/webpack-cli/pull/823))
+* docs: minor fixes in the docs ([#874](https://github.com/webpack/webpack-cli/pull/874))
+* docs: removes scaffolding docs from the root ([8c1db03](https://github.com/webpack/webpack-cli/commit/8c1db03))
+* junit: reverting the junit.xml ([80fd4fa](https://github.com/webpack/webpack-cli/commit/80fd4fa))
+* travis: removed stable ([#871](https://github.com/webpack/webpack-cli/pull/871))
+* types: move to @types/yeoman-generator ([#869](https://github.com/webpack/webpack-cli/pull/869))
+* addon generator to async/await ([#849](https://github.com/webpack/webpack-cli/pull/849))
+* v.3.1.1 ([d3f8e20](https://github.com/webpack/webpack-cli/commit/d3f8e20))
+* tests: updated test regex, some helper scripts ([#809](https://github.com/webpack/webpack-cli/pull/809))
+* types: add type information ([#791](https://github.com/webpack/webpack-cli/pull/791))
+* replace instances of uglify with terser ([f9cb8ce](https://github.com/webpack/webpack-cli/commit/f9cb8ce))
+* use actual package name in comment about removing uglify ([b1cf4cc](https://github.com/webpack/webpack-cli/commit/b1cf4cc))
+* align file in the same way as other terserPlugin test fixtures ([b6c6484](https://github.com/webpack/webpack-cli/commit/b6c6484))
+* remove gitHash from package.json ([2af08be](https://github.com/webpack/webpack-cli/commit/2af08be))
+
+## Docs
+
+* code of conduct ([#873](https://github.com/webpack/webpack-cli/pull/873))
+* contribute: adds table of contents and info about dependencies. ([#842](https://github.com/webpack/webpack-cli/pull/842))
+* contributing: fixes dead link ([#835](https://github.com/webpack/webpack-cli/pull/835))
+* opencollective prompt: improve code clarity ([55992a4](https://github.com/webpack/webpack-cli/commit/55992a4))
+* packages: adds downloads/month shield ([6a0375a](https://github.com/webpack/webpack-cli/commit/6a0375a))
+* readme: fix typos, add summary of all commands ([#845](https://github.com/webpack/webpack-cli/pull/845))
+* readme: adds contributors shield ([958d064](https://github.com/webpack/webpack-cli/commit/958d064))
+* README: phrase change ([3a11a16](https://github.com/webpack/webpack-cli/commit/3a11a16))
+* README: add link to webpack-scaffold-starter ([e35a194](https://github.com/webpack/webpack-cli/commit/e35a194))
+* README: update scaffolding links ([74179b5](https://github.com/webpack/webpack-cli/commit/74179b5))
+* serve: link to webpack-dev-server ([cb68b1b](https://github.com/webpack/webpack-cli/commit/cb68b1b))
+* serve: update docs to use webpack-dev-server ([f7451d4](https://github.com/webpack/webpack-cli/commit/f7451d4))
+* replace tooltip link to terser plugin ([4254730](https://github.com/webpack/webpack-cli/commit/4254730))
+* replace Uglify with Terser in comments ([799577d](https://github.com/webpack/webpack-cli/commit/799577d))
+* replace UglifyJsPlugin with TerserPlugin in migrate docs ([326f783](https://github.com/webpack/webpack-cli/commit/326f783))
+
+## Enh
+
+* webpack-scaffold: improve prompt and doc ([#794](https://github.com/webpack/webpack-cli/pull/794))
+
+## Fix
+
+* add: add types ([d4ce6f2](https://github.com/webpack/webpack-cli/commit/d4ce6f2))
+* add: fix runTransform ([dbc3e9e](https://github.com/webpack/webpack-cli/commit/dbc3e9e))
+* add: lint code ([163b309](https://github.com/webpack/webpack-cli/commit/163b309))
+* add: add handling for topScope ([1162cf5](https://github.com/webpack/webpack-cli/commit/1162cf5))
+* bin, serve: force default package export, add serve default ([#815](https://github.com/webpack/webpack-cli/pull/815))
+* init: refactored the init.ts success message ([#810](https://github.com/webpack/webpack-cli/pull/810))
+* opencollective prompt: fix grammar ([246db42](https://github.com/webpack/webpack-cli/commit/246db42))
+* opencollective-prompt: check write permissions ([5284b7e](https://github.com/webpack/webpack-cli/commit/5284b7e))
+* scaffold: config file is always generated at the project root ([#801](https://github.com/webpack/webpack-cli/pull/801))
+* utils: refactors utils ([7fe3543](https://github.com/webpack/webpack-cli/commit/7fe3543))
+* clear up comment about default function purpose ([e48507d](https://github.com/webpack/webpack-cli/commit/e48507d))
+* remove unused files ([ec242ab](https://github.com/webpack/webpack-cli/commit/ec242ab))
+* reset files ([9863445](https://github.com/webpack/webpack-cli/commit/9863445))
+* replace lookups for TerserPlugin in webpack.optimise ([ef23fec](https://github.com/webpack/webpack-cli/commit/ef23fec))
+
+## Tests
+
+* update snapshots ([ce9fbc8](https://github.com/webpack/webpack-cli/commit/ce9fbc8))
+* replace uglify with terser in ast-utils tests ([73f493f](https://github.com/webpack/webpack-cli/commit/73f493f))
+* migration: typescript ([#613](https://github.com/webpack/webpack-cli/pull/613))
+
+## Misc
+
+* chore(docs): Refactors links for badges ([#859](https://github.com/webpack/webpack-cli/pull/859))
+* opencollective-prompt: improve grammar ([e17a26d](https://github.com/webpack/webpack-cli/commit/e17a26d))
+* Remove tslint in favour of eslint ([#834](https://github.com/webpack/webpack-cli/pull/834))
+* cli: refactor functions into utils and config dirs, merge yargs options ([#781](https://github.com/webpack/webpack-cli/pull/781))
+* utils: refactors scaffold ([0b28fb3](https://github.com/webpack/webpack-cli/commit/0b28fb3))
+
+
+# 3.3.1 (2019-04-21)
+[Full Changelog](https://github.com/webpack/webpack-cli/compare/v0.1.5...v3.3.1)
+
+## New Features
+
+* terser: clean old files ([89e6b74](https://github.com/webpack/webpack-cli/commit/89e6b74))
+* terser: remove leftover files ([27d5b4d](https://github.com/webpack/webpack-cli/commit/27d5b4d))
+* terser: replace after merging master ([c404655](https://github.com/webpack/webpack-cli/commit/c404655))
+* replace Uglify with Terser in generators ([2b8651b](https://github.com/webpack/webpack-cli/commit/2b8651b))
+* use terserPlugin in loaderOptionsPlugin ([14f5337](https://github.com/webpack/webpack-cli/commit/14f5337))
+* use terserJsPlugin for transformations during migrate ([33c6185](https://github.com/webpack/webpack-cli/commit/33c6185))
+* replace uglifyJsPlugin with terserPlugin in migrate ([d467f3b](https://github.com/webpack/webpack-cli/commit/d467f3b))
+* opencollective prompt: work on windows setting atime by code ([3af73a8](https://github.com/webpack/webpack-cli/commit/3af73a8))
+* opencollective prompt: fix typo ([c2351b1](https://github.com/webpack/webpack-cli/commit/c2351b1))
+* opencollective prompt: remove .lastocprint file from fs ([b96ad56](https://github.com/webpack/webpack-cli/commit/b96ad56))
+* opencollective prompt: extract weekday to variable ([790d27a](https://github.com/webpack/webpack-cli/commit/790d27a))
+* opencollective prompt: set terminal cols to 80 ([badc32d](https://github.com/webpack/webpack-cli/commit/badc32d))
+* opencollective prompt: fix azure ci ([ea0039a](https://github.com/webpack/webpack-cli/commit/ea0039a))
+* opencollective prompt: lint ([ea906d8](https://github.com/webpack/webpack-cli/commit/ea906d8))
+* opencollective prompt: clear package.json modifications ([f080733](https://github.com/webpack/webpack-cli/commit/f080733))
+* opencollective prompt: add prompt in postinstall script ([dd9d528](https://github.com/webpack/webpack-cli/commit/dd9d528))
+
+## Ast
+
+* change tooltip property from uglify to terser ([ea9e4b8](https://github.com/webpack/webpack-cli/commit/ea9e4b8))
+* replace requires and inits for uglify with terser ([3011a6c](https://github.com/webpack/webpack-cli/commit/3011a6c))
+* replace UglifyJsPlugin with TerserPlugin ([21da35f](https://github.com/webpack/webpack-cli/commit/21da35f))
+
+## Chore
+
+* cli: move constants to a separate file ([#798](https://github.com/webpack/webpack-cli/pull/798))
+* deps: upgrade lerna to fix vulnerabilities & update webpack-dev-server ([#823](https://github.com/webpack/webpack-cli/pull/823))
+* docs: removes scaffolding docs from the root ([8c1db03](https://github.com/webpack/webpack-cli/commit/8c1db03))
+* junit: reverting the junit.xml ([80fd4fa](https://github.com/webpack/webpack-cli/commit/80fd4fa))
+* tests: updated test regex, some helper scripts ([#809](https://github.com/webpack/webpack-cli/pull/809))
+* types: add type information ([#791](https://github.com/webpack/webpack-cli/pull/791))
+* replace instances of uglify with terser ([f9cb8ce](https://github.com/webpack/webpack-cli/commit/f9cb8ce))
+* use actual package name in comment about removing uglify ([b1cf4cc](https://github.com/webpack/webpack-cli/commit/b1cf4cc))
+* align file in the same way as other terserPlugin test fixtures ([b6c6484](https://github.com/webpack/webpack-cli/commit/b6c6484))
+* remove gitHash from package.json ([2af08be](https://github.com/webpack/webpack-cli/commit/2af08be))
+
+## Docs
+
+* contributing: fixes dead link ([#835](https://github.com/webpack/webpack-cli/pull/835))
+* opencollective prompt: improve code clarity ([55992a4](https://github.com/webpack/webpack-cli/commit/55992a4))
+* packages: adds downloads/month shield ([6a0375a](https://github.com/webpack/webpack-cli/commit/6a0375a))
+* readme: adds contributors shield ([958d064](https://github.com/webpack/webpack-cli/commit/958d064))
+* README: phrase change ([3a11a16](https://github.com/webpack/webpack-cli/commit/3a11a16))
+* README: add link to webpack-scaffold-starter ([e35a194](https://github.com/webpack/webpack-cli/commit/e35a194))
+* README: update scaffolding links ([74179b5](https://github.com/webpack/webpack-cli/commit/74179b5))
+* serve: link to webpack-dev-server ([cb68b1b](https://github.com/webpack/webpack-cli/commit/cb68b1b))
+* serve: update docs to use webpack-dev-server ([f7451d4](https://github.com/webpack/webpack-cli/commit/f7451d4))
+* replace tooltip link to terser plugin ([4254730](https://github.com/webpack/webpack-cli/commit/4254730))
+* replace Uglify with Terser in comments ([799577d](https://github.com/webpack/webpack-cli/commit/799577d))
+* replace UglifyJsPlugin with TerserPlugin in migrate docs ([326f783](https://github.com/webpack/webpack-cli/commit/326f783))
+
+## Enh
+
+* webpack-scaffold: improve prompt and doc ([#794](https://github.com/webpack/webpack-cli/pull/794))
+
+## Fix
+
+* add: add types ([d4ce6f2](https://github.com/webpack/webpack-cli/commit/d4ce6f2))
+* add: fix runTransform ([dbc3e9e](https://github.com/webpack/webpack-cli/commit/dbc3e9e))
+* add: lint code ([163b309](https://github.com/webpack/webpack-cli/commit/163b309))
+* add: add handling for topScope ([1162cf5](https://github.com/webpack/webpack-cli/commit/1162cf5))
+* bin, serve: force default package export, add serve default ([#815](https://github.com/webpack/webpack-cli/pull/815))
+* init: refactored the init.ts success message ([#810](https://github.com/webpack/webpack-cli/pull/810))
+* scaffold: config file is always generated at the project root ([#801](https://github.com/webpack/webpack-cli/pull/801))
+* utils: refactors utils ([7fe3543](https://github.com/webpack/webpack-cli/commit/7fe3543))
+* clear up comment about default function purpose ([e48507d](https://github.com/webpack/webpack-cli/commit/e48507d))
+* remove unused files ([ec242ab](https://github.com/webpack/webpack-cli/commit/ec242ab))
+* reset files ([9863445](https://github.com/webpack/webpack-cli/commit/9863445))
+* replace lookups for TerserPlugin in webpack.optimise ([ef23fec](https://github.com/webpack/webpack-cli/commit/ef23fec))
+
+## Tests
+
+* update snapshots ([ce9fbc8](https://github.com/webpack/webpack-cli/commit/ce9fbc8))
+* replace uglify with terser in ast-utils tests ([73f493f](https://github.com/webpack/webpack-cli/commit/73f493f))
+* migration: typescript ([#613](https://github.com/webpack/webpack-cli/pull/613))
+
+## Misc
+
+* Remove tslint in favour of eslint ([#834](https://github.com/webpack/webpack-cli/pull/834))
+* cli: refactor functions into utils and config dirs, merge yargs options ([#781](https://github.com/webpack/webpack-cli/pull/781))
+* utils: refactors scaffold ([0b28fb3](https://github.com/webpack/webpack-cli/commit/0b28fb3))
+
# 3.3.0 (2019-03-15)
[Full Changelog](https://github.com/webpack/webpack-cli/compare/v0.1.3...v3.3.0)
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 00000000000..09c17dc8888
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,9 @@
+Code of Conduct
+---------------
+
+At webpack and webpack/webpack-cli repository we follow the [JSFoundation Code of Conduct][1].
+Please adhere to the guidelines there and feel free to report any violation of them to the @webpack/core-team,
+[**@webpack/cli-team**](https://github.com/orgs/webpack/teams/cli-team), or .
+
+
+[1]: https://js.foundation/community/code-of-conduct
diff --git a/INIT.md b/INIT.md
index c4536c55f3d..112ca86eb77 100644
--- a/INIT.md
+++ b/INIT.md
@@ -3,74 +3,89 @@
`webpack-cli init` is used to initialize `webpack` projects quickly by scaffolding configuration and installing modules required for the project as per user preferences.
## Initial Setup
-A. **Local setup**
-Follow given steps to locally setup `webpack-cli init` by installing dependencies:
+### a. Local setup
+
+These are the steps necessary to setup `webpack-cli init` locally:
+
1. Create `package.json` through npm
```shell
- $ npm init
+ npm init
```
2. Install `webpack` and `webpack-cli` as devDependencies
```shell
- $ npm install --save-dev webpack webpack-cli
+ npm install --save-dev webpack webpack-cli
```
-3. Install `@webpack-cli/init` package to add init scaffold
+3. Install `@webpack-cli/init` package to add the init scaffold
```shell
- $ npm install --save-dev @webpack-cli/init
+ npm install --save-dev @webpack-cli/init
```
-B. **Global Setup**
+### b. Global Setup
+
+These are the steps necessary to setup `webpack-cli init` globally:
-Follow following steps to setup `webpack-cli init` globally:
1. Install `webpack` and `webpack-cli` globally
+
```shell
- $ npm install -g webpack webpack-cli
+ npm install -g webpack webpack-cli
```
-2. Install `@webpack-cli/init` package to add init scaffold
+2. Install `@webpack-cli/init` package to add the init scaffold
+
```shell
- $ npm install -g @webpack-cli/init
+ npm install -g @webpack-cli/init
```
## Usage
-A. **For local setup**:
+
+### a. Running locally
+
```shell
-$ npx webpack-cli init
+npx webpack-cli init
```
-B. **For global setup**
+### b. Running globally
+
```shell
-$ webpack-cli init
+webpack-cli init
```
### Description of questions asked by generator
-1. `Will your application have multiple bundles? (Y/n)`
+1. `Will your application have multiple bundles? (y/N)`
+
+> *Property/key resolved: [entry](https://webpack.js.org/configuration/entry-context/#entry)*
+
+This is used to determine if your app will have multiple [entry points](https://webpack.js.org/configuration/entry-context/#entry).
+If you want to have multiple entry points, answer yes. If you want to have only one, answer no.
+
+2. `Which will be your application entry point? (src/index)`
-> *Property/key to resolve: [entry](https://webpack.js.org/configuration/entry-context/#entry)*
+> *Property/key resolved: [entry](https://webpack.js.org/configuration/entry-context/#entry)*
-What we are meaning here, is if you want to provide your bundle a single or multiple [entry points](https://webpack.js.org/configuration/entry-context/#entry). If you have more than one entry point to your app, answer yes. If you only have one, answer no.
+This tells webpack from which file to start bundling your application. The default answer `src/index` will tell webpack to look for a file called `index` inside a folder named `src`.
-2. `Which folder will your generated bundles be in? [default: dist]`
+3. `In which folder do you want to store your generated bundles? (dist)`
-> *Property/key to resolve: [output.path](https://webpack.js.org/configuration/output/#output-path)*
+> *Property/key resolved: [output.path](https://webpack.js.org/configuration/output/#output-path)*
-This answers to the [output directory](https://webpack.js.org/configuration/output/#output-path) of your application. The output directory is where servers or your `index.html` will read the generated bundle from.
+The output directory is where your bundled application will be. Your `index.html` will read the generated files from this folder, that is usually named `dist`.
4. `Will you be using ES2015? (Y/n)`
-> *Property/key to resolve: [module.rules](https://webpack.js.org/configuration/module/#module-rules) (for .js files)*
+> *Property/key resolved: [module.rules](https://webpack.js.org/configuration/module/#module-rules) (for .js files)*
-If you answer `Yes` to this question, we will add [`ES2015`](https://babeljs.io/learn-es2015/) to your webpack configuration, which will allow you to use modern JavaScript in your project.
+This enables webpack to parse [`ES2015`](https://babeljs.io/learn-es2015/) code. Answer `Yes` if you want to use modern JavaScript in your project.
5. `Will you use one of the below CSS solutions?`
-> *Property/key to resolve: [module.rules](https://webpack.js.org/configuration/module/#module-rules) (for .scss,.less,.css,.postCSS files)*
+> *Property/key resolved: [module.rules](https://webpack.js.org/configuration/module/#module-rules) (for .scss,.less,.css,.postCSS files)*
If you use any sort of style in your project, such as [`.less`](http://lesscss.org/), [`.scss`](http://sass-lang.com/), [`.css`](https://developer.mozilla.org/en-US/docs/Web/CSS) or [`postCSS`](http://postcss.org/) you will need to declare this here. If you don't use CSS, answer no.
diff --git a/README.md b/README.md
index 3f25b9208ac..3ca43eed187 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
webpack CLI
@@ -11,33 +11,26 @@
-[](https://www.npmjs.com/package/webpack-cli)
-[](https://travis-ci.org/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]
-[](https://codeclimate.com/github/webpack/webpack-cli)
-[](https://gitter.im/webpack/webpack)
-[](https://packagephobia.now.sh/result?p=webpack-cli)
-[](https://www.npmjs.com/package/webpack-cli)
-[](https://lernajs.io/)
-
-
-* [About](#about)
- - [How to install](#how-to-install)
-* [Getting Started](#getting-started)
-* [webpack CLI Scaffolds](#webpack-cli-scaffolds)
-* Commands
- - [`webpack-cli init`](./packages/init/README.md#webpack-cli-init)
- - [`webpack-cli add`](./packages/add/README.md#webpack-cli-add)
- - [`webpack-cli info`](./packages/info/README.md#webpack-cli-info)
- - [`webpack-cli migrate`](./packages/migrate/README.md#webpack-cli-migrate)
- - [`webpack-cli remove`](./packages/remove/README.md#webpack-cli-remove)
- - [`webpack-cli generate-plugin`](./packages/generate-plugin/README.md#webpack-cli-generate-plugin)
- - [`webpack-cli generate-loader`](./packages/generate-loader/README.md#webpack-cli-generate-loader)
- - [`webpack-cli serve`](./packages/serve/README.md#webpack-cli-serve)
- - [`webpack-cli update`](./packages/update/README.md#webpack-cli-update)
-* [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)
+- [Packages](#packages)
+ - [Commands](#commands)
+ - [Utilities](#utilities)
+- [Getting started](#getting-started)
+- [webpack CLI Scaffolds](#webpack-cli-scaffolds)
+- [Contributing and Internal Documentation](#contributing-and-internal-documentation)
+- [Open Collective](#open-collective)
## About
@@ -47,32 +40,78 @@ 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
+
+We organize webpack CLI as a multi-package repository using [lerna](https://github.com/lerna/lerna). Every command has a dedicated subfolder in the `packages` Folder. Here's a summary of commands provided by the CLI.
### Commands
-Supporting developers is an important task for webpack CLI. Thus, webpack CLI provides different commands for many common tasks. We organize webpack CLI as a [multi-package repository](https://github.com/lerna/lerna). Every command has a dedicated subfolder in the `packages` Folder.
+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.
+
+### 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.
## 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` functionality 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 init
```
-You will answer many questions when running the `init` 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 webpack's 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 an 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](./SCAFFOLDING.md) or check out the example project [How do I compose a webpack-scaffold?](https://github.com/evenstensberg/webpack-scaffold-demo).
+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).
## Contributing and Internal Documentation
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).
+## Open Collective
+
+If you like **webpack**, please consider donating to our [Open Collective](https://opencollective.com/webpack) to help us maintain it.
+
+We show this message in the terminal once a week, if you want you can disable it by setting the environment variable `DISABLE_OPENCOLLECTIVE=true` or `CI=true`.
+
+[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
diff --git a/SCAFFOLDING.md b/SCAFFOLDING.md
deleted file mode 100644
index 855c5fb3442..00000000000
--- a/SCAFFOLDING.md
+++ /dev/null
@@ -1,148 +0,0 @@
-# Introduction
-
-Setting up webpack for the first time is hard. Writing advanced configurations to optimize performance is even harder. The `init` feature is designed to support people that want to create their own configuration or initializing other projects people create.
-
-## Creating a scaffold
-
-Before writing a `webpack-cli` scaffold, think about what you're trying to achieve. Do you want a "general" scaffold that could be used by any project or type of app? Do you want something very focused, like a scaffold that writes both your `webpack.config.js` and your framework code? It's also useful to think about the user experience for your scaffold.
-
-`webpack-cli` offers an experience that is interactive and you can prompt users for questions (like, "What is your entry point?") to help customize the output accordingly.
-
-### Writing a scaffold
-
-There are many resources where you can learn how to write a scaffold, you can start from: [How do I compose a
-webpack-scaffold?](https://github.com/evenstensberg/webpack-scaffold-demo)
-
-
-[`webpack-scaffold`](./packages/webpack-scaffold) is a utility suite for creating scaffolds. It contains functions that could be used to create a scaffold.
-
-
-### Running a scaffold
-
-A scaffold can be executed using [`webpack-cli init`](./INIT.md):
-
-```js
-webpack-cli init
-```
-
-#### Running a scaffold locally
-When the scaffold package is in your local file system you should pass its path to `init`:
-
-```bash
-webpack-cli init path/to/your/scaffold
-```
-
-Or you can create a global module and symlink to the local one:
-
-* Using npm
-
- ```bash
- cd path/to/my-scaffold
- npm link
- webpack-cli init my-scaffold
- ```
-
-* Using yarn
-
- ```bash
- cd path/to/my-scaffold
- yarn link
- webpack-cli init my-scaffold
-
-#### Running a scaffold from npm
-
-If the package is in npm, its name must begin with `webpack-scaffold` and can be used running:
-
-```js
-webpack-cli init webpack-scaffold-yourpackage
-```
-
-
-## API
-
-To create a `scaffold`, you must create a [`yeoman-generator`](http://yeoman.io/authoring/). Because of that, you can optionally extend your generator to include methods from the [Yeoman API](http://yeoman.io/learning/). It's worth noting that we support all the properties of a regular webpack configuration. In order for us to do this, there's a thing you need to remember:
-
-> Objects are made using strings, while strings are made using double strings. This means that in order for you to create a string, you have to wrap it inside another string for us to validate it correctly.
-
-### Required
-- [opts.env.configuration](#optsenvconfiguration-required)
-- [opts.env.configuration.myObj](#optsenvconfigurationmyObj-required)
-- [myObj.webpackOptions](#myObjwebpackOptions-required)
-- [writing()](#writing()-required)
-
-### Optional
-- [myObj.merge](#myObjmerge-optional)
-- [myObj.topScope](#myObjtopScope-optional)
-- [myObj.configName](#myObjconfigName-optional)
-
-### `opts.env.configuration`(required)
-
-This is the entry point your configuration, initialize it inside the constructor of your generator in order for the CLI to work:
-
-```js
-constructor(args, opts) {
- super(args, opts);
- opts.env.configuration = {};
-}
-```
-### `opts.env.configuration.myObj` (required)
-
-This is your scaffold, you add here the options that the CLI will transform into a webpack configuration. You can have many different scaffolds named as you prefer, representing different configurations like `dev.config` or `prod.config`:
-
-```js
-constructor(args, opts) {
- super(args, opts);
- opts.env.configuration = {
- dev: {},
- prod: {}
- };
-}
-```
-
-### `myObj.webpackOptions` (required)
-
-This object has the same format as a regular webpack configuration, so you declare here the properties that you want to scaffold, like `entry`, `output` and `context`. You can initialize this inside a yeoman method:
-
-```js
-this.options.env.configuration.dev.webpackOptions = {
- entry: '\'app.js\'',
- output: {...}
-};
-```
-
-### `myObj.merge` (optional)
-
-If you want to use [`webpack-merge`](https://github.com/survivejs/webpack-merge), you can set the `merge` property of `myObj` to the name of the configuration you want to merge it with:
-
-```js
-this.options.env.configuration.dev.merge = 'myConfig';
-```
-
-### `myObj.topScope`(optional)
-
-The `topScope` property is where you write all the code needed by your configuration, like module imports and functions/variables definitions:
-
-```js
-this.options.env.configuration.dev.topScope = [
- 'const webpack = require(\'webpack\');',
- 'const path = require(\'path\');'
-];
-```
-
-### `myObj.configName`(optional)
-
-`configName` allows you to customize the name of your configuration file. For example you can name it `webpack.base.js` instead of the default `webpack.config.js`:
-
-```js
-this.options.env.configuration.dev.configName = 'base';
-```
-
-### `writing` (required)
-
-For the scaffolding instance to run, you need to write your configuration to a `.yo-rc.json` file. This could be done using one of the lifecycles in the yeoman generator, such as the `writing` method:
-
-```js
-writing() {
- this.config.set('configuration', myObj)
-}
-```
diff --git a/bin/.eslintrc.js b/bin/.eslintrc.js
new file mode 100644
index 00000000000..b32868dab61
--- /dev/null
+++ b/bin/.eslintrc.js
@@ -0,0 +1,63 @@
+module.exports = {
+ root: true,
+ plugins: ["node"],
+ extends: ["../.eslintrc.js", "plugin:node/recommended"],
+ env: {
+ node: true,
+ es6: true,
+ jest: true
+ },
+ parserOptions: { ecmaVersion: 2017, sourceType: "module" },
+ rules: {
+ "node/no-unsupported-features": ["error", { version: 6 }],
+ "node/no-deprecated-api": "error",
+ "node/no-missing-import": "error",
+ "node/no-missing-require": [
+ "error",
+ {
+ resolvePaths: ["./packages"],
+ allowModules: [
+ "webpack",
+ "@webpack-cli/generators",
+ "@webpack-cli/init",
+ "@webpack-cli/migrate",
+ "@webpack-cli/utils",
+ "@webpack-cli/generate-loader",
+ "@webpack-cli/generate-plugin",
+ "@webpack-cli/webpack-scaffold"
+ ]
+ }
+ ],
+ "node/no-unpublished-bin": "error",
+ "node/no-unpublished-require": [
+ "error",
+ {
+ allowModules: [
+ "webpack",
+ "webpack-dev-server",
+ "@webpack-cli/generators",
+ "@webpack-cli/init",
+ "@webpack-cli/migrate",
+ "@webpack-cli/utils",
+ "@webpack-cli/generate-loader",
+ "@webpack-cli/generate-plugin",
+ "@webpack-cli/webpack-scaffold"
+ ]
+ }
+ ],
+ "node/no-extraneous-require": [
+ "error",
+ {
+ allowModules: [
+ "@webpack-cli/migrate",
+ "@webpack-cli/generators",
+ "@webpack-cli/utils",
+ "@webpack-cli/generate-loader",
+ "@webpack-cli/generate-plugin",
+ "@webpack-cli/webpack-scaffold"
+ ]
+ }
+ ],
+ "node/process-exit-as-throw": "error"
+ }
+};
diff --git a/bin/cli.js b/bin/cli.js
index b0dc2649d2d..3819cda71a0 100755
--- a/bin/cli.js
+++ b/bin/cli.js
@@ -5,6 +5,8 @@
Author Tobias Koppers @sokra
*/
+const { NON_COMPILATION_ARGS } = require("./utils/constants");
+
(function() {
// wrap in IIFE to be able to use return
@@ -16,18 +18,7 @@
require("v8-compile-cache");
- const ErrorHelpers = require("./errorHelpers");
-
- const NON_COMPILATION_ARGS = [
- "init",
- "migrate",
- "add",
- "remove",
- "serve",
- "generate-loader",
- "generate-plugin",
- "info"
- ];
+ const ErrorHelpers = require("./utils/errorHelpers");
const NON_COMPILATION_CMD = process.argv.find(arg => {
if (arg === "serve") {
@@ -38,7 +29,7 @@
});
if (NON_COMPILATION_CMD) {
- return require("./prompt-command")(NON_COMPILATION_CMD, ...process.argv);
+ return require("./utils/prompt-command")(NON_COMPILATION_CMD, ...process.argv);
}
const yargs = require("yargs").usage(`webpack-cli ${require("../package.json").version}
@@ -50,155 +41,7 @@ Usage: webpack-cli [options]
For more information, see https://webpack.js.org/api/cli/.`);
- require("./config-yargs")(yargs);
-
- const DISPLAY_GROUP = "Stats options:";
- const BASIC_GROUP = "Basic options:";
-
- yargs.options({
- silent: {
- type: "boolean",
- describe: "Prevent output from being displayed in stdout"
- },
- json: {
- type: "boolean",
- alias: "j",
- describe: "Prints the result as JSON."
- },
- progress: {
- type: "boolean",
- describe: "Print compilation progress in percentage",
- group: BASIC_GROUP
- },
- color: {
- type: "boolean",
- alias: "colors",
- default: function supportsColor() {
- return require("supports-color").stdout;
- },
- group: DISPLAY_GROUP,
- describe: "Force colors on the console"
- },
- "no-color": {
- type: "boolean",
- alias: "no-colors",
- group: DISPLAY_GROUP,
- describe: "Force no colors on the console"
- },
- "sort-modules-by": {
- type: "string",
- group: DISPLAY_GROUP,
- describe: "Sorts the modules list by property in module"
- },
- "sort-chunks-by": {
- type: "string",
- group: DISPLAY_GROUP,
- describe: "Sorts the chunks list by property in chunk"
- },
- "sort-assets-by": {
- type: "string",
- group: DISPLAY_GROUP,
- describe: "Sorts the assets list by property in asset"
- },
- "hide-modules": {
- type: "boolean",
- group: DISPLAY_GROUP,
- describe: "Hides info about modules"
- },
- "display-exclude": {
- type: "string",
- group: DISPLAY_GROUP,
- describe: "Exclude modules in the output"
- },
- "display-modules": {
- type: "boolean",
- group: DISPLAY_GROUP,
- describe: "Display even excluded modules in the output"
- },
- "display-max-modules": {
- type: "number",
- group: DISPLAY_GROUP,
- describe: "Sets the maximum number of visible modules in output"
- },
- "display-chunks": {
- type: "boolean",
- group: DISPLAY_GROUP,
- describe: "Display chunks in the output"
- },
- "display-entrypoints": {
- type: "boolean",
- group: DISPLAY_GROUP,
- describe: "Display entry points in the output"
- },
- "display-origins": {
- type: "boolean",
- group: DISPLAY_GROUP,
- describe: "Display origins of chunks in the output"
- },
- "display-cached": {
- type: "boolean",
- group: DISPLAY_GROUP,
- describe: "Display also cached modules in the output"
- },
- "display-cached-assets": {
- type: "boolean",
- group: DISPLAY_GROUP,
- describe: "Display also cached assets in the output"
- },
- "display-reasons": {
- type: "boolean",
- group: DISPLAY_GROUP,
- describe: "Display reasons about module inclusion in the output"
- },
- "display-depth": {
- type: "boolean",
- group: DISPLAY_GROUP,
- describe: "Display distance from entry point for each module"
- },
- "display-used-exports": {
- type: "boolean",
- group: DISPLAY_GROUP,
- describe: "Display information about used exports in modules (Tree Shaking)"
- },
- "display-provided-exports": {
- type: "boolean",
- group: DISPLAY_GROUP,
- describe: "Display information about exports provided from modules"
- },
- "display-optimization-bailout": {
- type: "boolean",
- group: DISPLAY_GROUP,
- describe: "Display information about why optimization bailed out for modules"
- },
- "display-error-details": {
- type: "boolean",
- group: DISPLAY_GROUP,
- describe: "Display details about errors"
- },
- display: {
- type: "string",
- choices: ["", "verbose", "detailed", "normal", "minimal", "errors-only", "none"],
- group: DISPLAY_GROUP,
- describe: "Select display preset"
- },
- verbose: {
- type: "boolean",
- group: DISPLAY_GROUP,
- describe: "Show more details"
- },
- "info-verbosity": {
- type: "string",
- default: "info",
- choices: ["none", "info", "verbose"],
- group: DISPLAY_GROUP,
- describe: "Controls the output of lifecycle messaging e.g. Started watching files..."
- },
- "build-delimiter": {
- type: "string",
- group: DISPLAY_GROUP,
- describe: "Display custom text after build output"
- }
- });
+ require("./config/config-yargs")(yargs);
// yargs will terminate the process early when the user uses help or version.
// This causes large help outputs to be cut short (https://github.com/nodejs/node/wiki/API-changes-between-v0.10-and-v4#process).
@@ -225,7 +68,7 @@ For more information, see https://webpack.js.org/api/cli/.`);
let options;
try {
- options = require("./convert-argv")(argv);
+ options = require("./utils/convert-argv")(argv);
} catch (err) {
if (err.name !== "ValidationError") {
throw err;
@@ -251,7 +94,7 @@ For more information, see https://webpack.js.org/api/cli/.`);
const stdout = argv.silent
? {
write: () => {}
- } // eslint-disable-line
+ } // eslint-disable-line
: process.stdout;
function ifArg(name, fn, init) {
@@ -473,6 +316,33 @@ For more information, see https://webpack.js.org/api/cli/.`);
const statsString = stats.toString(outputOptions);
const delimiter = outputOptions.buildDelimiter ? `${outputOptions.buildDelimiter}\n` : "";
if (statsString) stdout.write(`${statsString}\n${delimiter}`);
+
+ /**
+ * Show a hint to donate to our Opencollective
+ * once a week, only on Monday
+ */
+ const openCollectivePath = __dirname + "/opencollective.js";
+ const MONDAY = 1;
+ const SIX_DAYS = 518400000;
+ const now = new Date();
+ if (now.getDay() === MONDAY) {
+ const {
+ access,
+ constants,
+ statSync,
+ utimesSync,
+ } = require("fs");
+ const lastPrint = statSync(openCollectivePath).atime;
+ const lastPrintTS = new Date(lastPrint).getTime();
+ const timeSinceLastPrint = now.getTime() - lastPrintTS;
+ if (timeSinceLastPrint > SIX_DAYS) {
+ require(openCollectivePath);
+ // On windows we need to manually update the atime
+ access(openCollectivePath, constants.W_OK, (e) => {
+ if (!e) utimesSync(openCollectivePath, now, now);
+ });
+ }
+ }
}
if (!options.watch && stats.hasErrors()) {
process.exitCode = 2;
diff --git a/bin/config-yargs.js b/bin/config/config-yargs.js
similarity index 69%
rename from bin/config-yargs.js
rename to bin/config/config-yargs.js
index 2dc1b8a5805..105358875a7 100644
--- a/bin/config-yargs.js
+++ b/bin/config/config-yargs.js
@@ -1,4 +1,17 @@
-const optionsSchema = require("./optionsSchema.json");
+const optionsSchema = require("../config/optionsSchema.json");
+
+const { GROUPS } = require("../utils/constants");
+
+const {
+ CONFIG_GROUP,
+ BASIC_GROUP,
+ MODULE_GROUP,
+ OUTPUT_GROUP,
+ ADVANCED_GROUP,
+ RESOLVE_GROUP,
+ OPTIMIZE_GROUP,
+ DISPLAY_GROUP
+} = GROUPS;
const nestedProperties = ["anyOf", "oneOf", "allOf"];
@@ -52,14 +65,6 @@ const getSchemaInfo = (path, property, subProperty) => {
return findPropertyInSchema(current, property, subProperty);
};
-const CONFIG_GROUP = "Config options:";
-const BASIC_GROUP = "Basic options:";
-const MODULE_GROUP = "Module options:";
-const OUTPUT_GROUP = "Output options:";
-const ADVANCED_GROUP = "Advanced options:";
-const RESOLVE_GROUP = "Resolving options:";
-const OPTIMIZE_GROUP = "Optimizing options:";
-
module.exports = function(yargs) {
yargs
.help("help")
@@ -346,6 +351,148 @@ module.exports = function(yargs) {
type: "boolean",
describe: "shortcut for --optimize-minimize --define process.env.NODE_ENV=\"production\"",
group: BASIC_GROUP
+ },
+ silent: {
+ type: "boolean",
+ describe: "Prevent output from being displayed in stdout"
+ },
+ json: {
+ type: "boolean",
+ alias: "j",
+ describe: "Prints the result as JSON."
+ },
+ progress: {
+ type: "boolean",
+ describe: "Print compilation progress in percentage",
+ group: BASIC_GROUP
+ },
+ color: {
+ type: "boolean",
+ alias: "colors",
+ default: function supportsColor() {
+ return require("supports-color").stdout;
+ },
+ group: DISPLAY_GROUP,
+ describe: "Force colors on the console"
+ },
+ "no-color": {
+ type: "boolean",
+ alias: "no-colors",
+ group: DISPLAY_GROUP,
+ describe: "Force no colors on the console"
+ },
+ "sort-modules-by": {
+ type: "string",
+ group: DISPLAY_GROUP,
+ describe: "Sorts the modules list by property in module"
+ },
+ "sort-chunks-by": {
+ type: "string",
+ group: DISPLAY_GROUP,
+ describe: "Sorts the chunks list by property in chunk"
+ },
+ "sort-assets-by": {
+ type: "string",
+ group: DISPLAY_GROUP,
+ describe: "Sorts the assets list by property in asset"
+ },
+ "hide-modules": {
+ type: "boolean",
+ group: DISPLAY_GROUP,
+ describe: "Hides info about modules"
+ },
+ "display-exclude": {
+ type: "string",
+ group: DISPLAY_GROUP,
+ describe: "Exclude modules in the output"
+ },
+ "display-modules": {
+ type: "boolean",
+ group: DISPLAY_GROUP,
+ describe: "Display even excluded modules in the output"
+ },
+ "display-max-modules": {
+ type: "number",
+ group: DISPLAY_GROUP,
+ describe: "Sets the maximum number of visible modules in output"
+ },
+ "display-chunks": {
+ type: "boolean",
+ group: DISPLAY_GROUP,
+ describe: "Display chunks in the output"
+ },
+ "display-entrypoints": {
+ type: "boolean",
+ group: DISPLAY_GROUP,
+ describe: "Display entry points in the output"
+ },
+ "display-origins": {
+ type: "boolean",
+ group: DISPLAY_GROUP,
+ describe: "Display origins of chunks in the output"
+ },
+ "display-cached": {
+ type: "boolean",
+ group: DISPLAY_GROUP,
+ describe: "Display also cached modules in the output"
+ },
+ "display-cached-assets": {
+ type: "boolean",
+ group: DISPLAY_GROUP,
+ describe: "Display also cached assets in the output"
+ },
+ "display-reasons": {
+ type: "boolean",
+ group: DISPLAY_GROUP,
+ describe: "Display reasons about module inclusion in the output"
+ },
+ "display-depth": {
+ type: "boolean",
+ group: DISPLAY_GROUP,
+ describe: "Display distance from entry point for each module"
+ },
+ "display-used-exports": {
+ type: "boolean",
+ group: DISPLAY_GROUP,
+ describe: "Display information about used exports in modules (Tree Shaking)"
+ },
+ "display-provided-exports": {
+ type: "boolean",
+ group: DISPLAY_GROUP,
+ describe: "Display information about exports provided from modules"
+ },
+ "display-optimization-bailout": {
+ type: "boolean",
+ group: DISPLAY_GROUP,
+ describe: "Display information about why optimization bailed out for modules"
+ },
+ "display-error-details": {
+ type: "boolean",
+ group: DISPLAY_GROUP,
+ describe: "Display details about errors"
+ },
+ display: {
+ type: "string",
+ choices: ["", "verbose", "detailed", "normal", "minimal", "errors-only", "none"],
+ group: DISPLAY_GROUP,
+ describe: "Select display preset"
+ },
+ verbose: {
+ type: "boolean",
+ group: DISPLAY_GROUP,
+ describe: "Show more details"
+ },
+ "info-verbosity": {
+ type: "string",
+ default: "info",
+ choices: ["none", "info", "verbose"],
+ group: DISPLAY_GROUP,
+ describe: "Controls the output of lifecycle messaging e.g. Started watching files..."
+ },
+ "build-delimiter": {
+ type: "string",
+ group: DISPLAY_GROUP,
+ describe: "Display custom text after build output"
}
});
};
diff --git a/bin/optionsSchema.json b/bin/config/optionsSchema.json
similarity index 99%
rename from bin/optionsSchema.json
rename to bin/config/optionsSchema.json
index aa272397d03..8e95e1b7926 100644
--- a/bin/optionsSchema.json
+++ b/bin/config/optionsSchema.json
@@ -1680,7 +1680,7 @@
]
},
"serve": {
- "description": "Options for webpack-serve",
+ "description": "Options for webpack-dev-server",
"type": "object"
},
"stats": {
diff --git a/bin/webpackConfigurationSchema.json b/bin/config/webpackConfigurationSchema.json
similarity index 100%
rename from bin/webpackConfigurationSchema.json
rename to bin/config/webpackConfigurationSchema.json
diff --git a/bin/opencollective.js b/bin/opencollective.js
new file mode 100644
index 00000000000..c8e81b3da6c
--- /dev/null
+++ b/bin/opencollective.js
@@ -0,0 +1,38 @@
+const chalk = require("chalk");
+
+// Only show emoji on OSx (Windows shell doesn't like them that much ¯\_(ツ)_/¯ )
+function emoji(emoji) {
+ if (process.stdout.isTTY && process.platform === "darwin") {
+ return emoji;
+ } else {
+ return "";
+ }
+}
+
+function print(str = "", color = "dim") {
+ const terminalCols = 80;
+ // eslint-disable-next-line no-control-regex
+ const ansiEscapeSeq = /\u001b\[[0-9]{1,2}m/g;
+ const strLength = str.replace(ansiEscapeSeq, "").length;
+ const leftPaddingLength = Math.floor((terminalCols - strLength) / 2);
+ const leftPadding = " ".repeat(leftPaddingLength);
+ str = chalk[color](str);
+ console.log(leftPadding, str);
+}
+
+function printBadge() {
+ console.log("\n");
+ print(`${chalk.bold("Thanks for using")} ${chalk.bold.blue("Webpack!")}`);
+ print(`Please consider donating to our ${chalk.bold.blue("Open Collective")}`);
+ print("to help us maintain this package.");
+ console.log("\n\n");
+ print(`${emoji("👉")} ${chalk.bold.yellow(" Donate:")} ${chalk.reset.underline.yellow("https://opencollective.com/webpack/donate")}`);
+ console.log("\n");
+}
+
+function isTrue(value) {
+ return !!value && value !== "0" && value !== "false";
+}
+const envDisable = isTrue(process.env.DISABLE_OPENCOLLECTIVE) || isTrue(process.env.CI);
+
+if (!envDisable) printBadge();
diff --git a/bin/utils/constants.js b/bin/utils/constants.js
new file mode 100644
index 00000000000..28a36c88a74
--- /dev/null
+++ b/bin/utils/constants.js
@@ -0,0 +1,37 @@
+const NON_COMPILATION_ARGS = [
+ "init",
+ "migrate",
+ "add",
+ "remove",
+ "serve",
+ "generate-loader",
+ "generate-plugin",
+ "info"
+];
+
+const CONFIG_GROUP = "Config options:";
+const BASIC_GROUP = "Basic options:";
+const MODULE_GROUP = "Module options:";
+const OUTPUT_GROUP = "Output options:";
+const ADVANCED_GROUP = "Advanced options:";
+const RESOLVE_GROUP = "Resolving options:";
+const OPTIMIZE_GROUP = "Optimizing options:";
+const DISPLAY_GROUP = "Stats options:";
+const GROUPS = {
+ CONFIG_GROUP,
+ BASIC_GROUP,
+ MODULE_GROUP,
+ OUTPUT_GROUP,
+ ADVANCED_GROUP,
+ RESOLVE_GROUP,
+ OPTIMIZE_GROUP,
+ DISPLAY_GROUP
+};
+
+const WEBPACK_OPTIONS_FLAG = "WEBPACK_OPTIONS";
+
+module.exports = {
+ NON_COMPILATION_ARGS,
+ GROUPS,
+ WEBPACK_OPTIONS_FLAG
+};
diff --git a/bin/convert-argv.js b/bin/utils/convert-argv.js
similarity index 99%
rename from bin/convert-argv.js
rename to bin/utils/convert-argv.js
index c5fc62f18a8..d1c8d8d2f43 100644
--- a/bin/convert-argv.js
+++ b/bin/utils/convert-argv.js
@@ -3,7 +3,7 @@ const fs = require("fs");
fs.existsSync = fs.existsSync || path.existsSync;
const interpret = require("interpret");
const prepareOptions = require("./prepareOptions");
-const webpackConfigurationSchema = require("./webpackConfigurationSchema.json");
+const webpackConfigurationSchema = require("../config/webpackConfigurationSchema.json");
const validateSchema = require("webpack").validateSchema;
const WebpackOptionsValidationError = require("webpack").WebpackOptionsValidationError;
const findup = require("findup-sync");
diff --git a/bin/errorHelpers.js b/bin/utils/errorHelpers.js
similarity index 90%
rename from bin/errorHelpers.js
rename to bin/utils/errorHelpers.js
index 5098f4ca14d..96fe950f34d 100644
--- a/bin/errorHelpers.js
+++ b/bin/utils/errorHelpers.js
@@ -4,7 +4,7 @@
*/
"use strict";
-const webpackOptionsFlag = "WEBPACK_OPTIONS";
+const { WEBPACK_OPTIONS_FLAG } = require("./constants");
exports.cutOffByFlag = (stack, flag) => {
stack = stack.split("\n");
@@ -12,7 +12,7 @@ exports.cutOffByFlag = (stack, flag) => {
return stack.join("\n");
};
-exports.cutOffWebpackOptions = stack => exports.cutOffByFlag(stack, webpackOptionsFlag);
+exports.cutOffWebpackOptions = stack => exports.cutOffByFlag(stack, WEBPACK_OPTIONS_FLAG);
exports.cutOffMultilineMessage = (stack, message) => {
stack = stack.split("\n");
diff --git a/bin/prepareOptions.js b/bin/utils/prepareOptions.js
similarity index 100%
rename from bin/prepareOptions.js
rename to bin/utils/prepareOptions.js
diff --git a/bin/prompt-command.js b/bin/utils/prompt-command.js
similarity index 82%
rename from bin/prompt-command.js
rename to bin/utils/prompt-command.js
index 021fa90527b..20a99a1655f 100644
--- a/bin/prompt-command.js
+++ b/bin/utils/prompt-command.js
@@ -31,12 +31,21 @@ const npmGlobalRoot = () => {
const cp = require("child_process");
return new Promise((resolve, reject) => {
const command = cp.spawn("npm", ["root", "-g"]);
- command.on("error", (error) => reject(error));
- command.stdout.on("data", (data) => resolve(data.toString()));
- command.stderr.on("data", (data) => reject(data));
+ command.on("error", error => reject(error));
+ command.stdout.on("data", data => resolve(data.toString()));
+ command.stderr.on("data", data => reject(data));
});
};
+const runWhenInstalled = (packages, pathForCmd, ...args) => {
+ const currentPackage = require(pathForCmd);
+ const func = currentPackage.default;
+ if (typeof func !== "function") {
+ throw new Error(`@webpack-cli/${packages} failed to export a default function`);
+ }
+ return func(...args);
+};
+
module.exports = function promptForInstallation(packages, ...args) {
const nameOfPackage = "@webpack-cli/" + packages;
let packageIsInstalled = false;
@@ -93,19 +102,18 @@ module.exports = function promptForInstallation(packages, ...args) {
case "y":
case "yes":
case "1": {
-
runCommand(packageManager, options)
- .then(_=> {
+ .then(_ => {
if (packages === "init") {
npmGlobalRoot()
- .then((root) => {
+ .then(root => {
const pathtoInit = path.resolve(root.trim(), "@webpack-cli", "init");
return pathtoInit;
})
- .then((pathForInit) => {
+ .then(pathForInit => {
return require(pathForInit).default(...args);
})
- .catch((error) => {
+ .catch(error => {
console.error(error);
process.exitCode = 1;
});
@@ -113,10 +121,7 @@ module.exports = function promptForInstallation(packages, ...args) {
}
pathForCmd = path.resolve(process.cwd(), "node_modules", "@webpack-cli", packages);
- if (packages === "serve") {
- return require(pathForCmd).default.serve();
- }
- return require(pathForCmd).default(...args); //eslint-disable-line
+ return runWhenInstalled(packages, pathForCmd, ...args);
})
.catch(error => {
console.error(error);
@@ -132,6 +137,6 @@ module.exports = function promptForInstallation(packages, ...args) {
}
});
} else {
- require(pathForCmd).default(...args); // eslint-disable-line
+ return runWhenInstalled(packages, pathForCmd, ...args);
}
};
diff --git a/junit.xml b/junit.xml
deleted file mode 100644
index 304ccef7cc6..00000000000
--- a/junit.xml
+++ /dev/null
@@ -1,557 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index 741b984d2a2..c643b13d8d0 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "webpack-cli",
- "version": "3.3.0",
+ "version": "3.3.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -14,18 +14,18 @@
}
},
"@babel/core": {
- "version": "7.3.4",
- "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.3.4.tgz",
- "integrity": "sha512-jRsuseXBo9pN197KnDwhhaaBzyZr2oIcLHHTt2oDdQrej5Qp57dCCJafWx5ivU8/alEYDpssYqv1MUqcxwQlrA==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.4.4.tgz",
+ "integrity": "sha512-lQgGX3FPRgbz2SKmhMtYgJvVzGZrmjaF4apZ2bLwofAKiSjxU0drPh4S/VasyYXwaTs+A1gvQ45BN8SQJzHsQQ==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
- "@babel/generator": "^7.3.4",
- "@babel/helpers": "^7.2.0",
- "@babel/parser": "^7.3.4",
- "@babel/template": "^7.2.2",
- "@babel/traverse": "^7.3.4",
- "@babel/types": "^7.3.4",
+ "@babel/generator": "^7.4.4",
+ "@babel/helpers": "^7.4.4",
+ "@babel/parser": "^7.4.4",
+ "@babel/template": "^7.4.4",
+ "@babel/traverse": "^7.4.4",
+ "@babel/types": "^7.4.4",
"convert-source-map": "^1.1.0",
"debug": "^4.1.0",
"json5": "^2.1.0",
@@ -62,12 +62,12 @@
}
},
"@babel/generator": {
- "version": "7.3.4",
- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.3.4.tgz",
- "integrity": "sha512-8EXhHRFqlVVWXPezBW5keTiQi/rJMQTg/Y9uVCEZ0CAF3PKtCCaVRnp64Ii1ujhkoDhhF1fVsImoN4yJ2uz4Wg==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.4.4.tgz",
+ "integrity": "sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ==",
"dev": true,
"requires": {
- "@babel/types": "^7.3.4",
+ "@babel/types": "^7.4.4",
"jsesc": "^2.5.1",
"lodash": "^4.17.11",
"source-map": "^0.5.0",
@@ -94,25 +94,25 @@
}
},
"@babel/helper-call-delegate": {
- "version": "7.1.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.1.0.tgz",
- "integrity": "sha512-YEtYZrw3GUK6emQHKthltKNZwszBcHK58Ygcis+gVUrF4/FmTVr5CCqQNSfmvg2y+YDEANyYoaLz/SHsnusCwQ==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.4.4.tgz",
+ "integrity": "sha512-l79boDFJ8S1c5hvQvG+rc+wHw6IuH7YldmRKsYtpbawsxURu/paVy57FZMomGK22/JckepaikOkY0MoAmdyOlQ==",
"dev": true,
"requires": {
- "@babel/helper-hoist-variables": "^7.0.0",
- "@babel/traverse": "^7.1.0",
- "@babel/types": "^7.0.0"
+ "@babel/helper-hoist-variables": "^7.4.4",
+ "@babel/traverse": "^7.4.4",
+ "@babel/types": "^7.4.4"
}
},
"@babel/helper-define-map": {
- "version": "7.1.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.1.0.tgz",
- "integrity": "sha512-yPPcW8dc3gZLN+U1mhYV91QU3n5uTbx7DUdf8NnPbjS0RMwBuHi9Xt2MUgppmNz7CJxTBWsGczTiEp1CSOTPRg==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.4.4.tgz",
+ "integrity": "sha512-IX3Ln8gLhZpSuqHJSnTNBWGDE9kdkTEWl21A/K7PQ00tseBwbqCHTvNLHSBd9M0R5rER4h5Rsvj9vw0R5SieBg==",
"dev": true,
"requires": {
"@babel/helper-function-name": "^7.1.0",
- "@babel/types": "^7.0.0",
- "lodash": "^4.17.10"
+ "@babel/types": "^7.4.4",
+ "lodash": "^4.17.11"
}
},
"@babel/helper-explode-assignable-expression": {
@@ -146,12 +146,12 @@
}
},
"@babel/helper-hoist-variables": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.0.0.tgz",
- "integrity": "sha512-Ggv5sldXUeSKsuzLkddtyhyHe2YantsxWKNi7A+7LeD12ExRDWTRk29JCXpaHPAbMaIPZSil7n+lq78WY2VY7w==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.4.4.tgz",
+ "integrity": "sha512-VYk2/H/BnYbZDDg39hr3t2kKyifAm1W6zHRfhx8jGjIHpQEBv9dry7oQ2f3+J703TLu69nYdxsovl0XYfcnK4w==",
"dev": true,
"requires": {
- "@babel/types": "^7.0.0"
+ "@babel/types": "^7.4.4"
}
},
"@babel/helper-member-expression-to-functions": {
@@ -173,17 +173,17 @@
}
},
"@babel/helper-module-transforms": {
- "version": "7.2.2",
- "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.2.2.tgz",
- "integrity": "sha512-YRD7I6Wsv+IHuTPkAmAS4HhY0dkPobgLftHp0cRGZSdrRvmZY8rFvae/GVu3bD00qscuvK3WPHB3YdNpBXUqrA==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.4.4.tgz",
+ "integrity": "sha512-3Z1yp8TVQf+B4ynN7WoHPKS8EkdTbgAEy0nU0rs/1Kw4pDgmvYH3rz3aI11KgxKCba2cn7N+tqzV1mY2HMN96w==",
"dev": true,
"requires": {
"@babel/helper-module-imports": "^7.0.0",
"@babel/helper-simple-access": "^7.1.0",
- "@babel/helper-split-export-declaration": "^7.0.0",
- "@babel/template": "^7.2.2",
- "@babel/types": "^7.2.2",
- "lodash": "^4.17.10"
+ "@babel/helper-split-export-declaration": "^7.4.4",
+ "@babel/template": "^7.4.4",
+ "@babel/types": "^7.4.4",
+ "lodash": "^4.17.11"
}
},
"@babel/helper-optimise-call-expression": {
@@ -202,12 +202,12 @@
"dev": true
},
"@babel/helper-regex": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.0.0.tgz",
- "integrity": "sha512-TR0/N0NDCcUIUEbqV6dCO+LptmmSQFQ7q70lfcEB4URsjD0E1HzicrwUH+ap6BAQ2jhCX9Q4UqZy4wilujWlkg==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.4.4.tgz",
+ "integrity": "sha512-Y5nuB/kESmR3tKjU8Nkn1wMGEx1tjJX076HBMeL3XLQCu6vA/YRzuTW0bbb+qRnXvQGn+d6Rx953yffl8vEy7Q==",
"dev": true,
"requires": {
- "lodash": "^4.17.10"
+ "lodash": "^4.17.11"
}
},
"@babel/helper-remap-async-to-generator": {
@@ -224,15 +224,15 @@
}
},
"@babel/helper-replace-supers": {
- "version": "7.3.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.3.4.tgz",
- "integrity": "sha512-pvObL9WVf2ADs+ePg0jrqlhHoxRXlOa+SHRHzAXIz2xkYuOHfGl+fKxPMaS4Fq+uje8JQPobnertBBvyrWnQ1A==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.4.4.tgz",
+ "integrity": "sha512-04xGEnd+s01nY1l15EuMS1rfKktNF+1CkKmHoErDppjAAZL+IUBZpzT748x262HF7fibaQPhbvWUl5HeSt1EXg==",
"dev": true,
"requires": {
"@babel/helper-member-expression-to-functions": "^7.0.0",
"@babel/helper-optimise-call-expression": "^7.0.0",
- "@babel/traverse": "^7.3.4",
- "@babel/types": "^7.3.4"
+ "@babel/traverse": "^7.4.4",
+ "@babel/types": "^7.4.4"
}
},
"@babel/helper-simple-access": {
@@ -246,12 +246,12 @@
}
},
"@babel/helper-split-export-declaration": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz",
- "integrity": "sha512-MXkOJqva62dfC0w85mEf/LucPPS/1+04nmmRMPEBUB++hiiThQ2zPtX/mEWQ3mtzCEjIJvPY8nuwxXtQeQwUag==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz",
+ "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==",
"dev": true,
"requires": {
- "@babel/types": "^7.0.0"
+ "@babel/types": "^7.4.4"
}
},
"@babel/helper-wrap-function": {
@@ -267,14 +267,14 @@
}
},
"@babel/helpers": {
- "version": "7.3.1",
- "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.3.1.tgz",
- "integrity": "sha512-Q82R3jKsVpUV99mgX50gOPCWwco9Ec5Iln/8Vyu4osNIOQgSrd9RFrQeUvmvddFNoLwMyOUWU+5ckioEKpDoGA==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.4.4.tgz",
+ "integrity": "sha512-igczbR/0SeuPR8RFfC7tGrbdTbFL3QTvH6D+Z6zNxnTe//GyqmtHmDkzrqDmyZ3eSwPqB/LhyKoU5DXsp+Vp2A==",
"dev": true,
"requires": {
- "@babel/template": "^7.1.2",
- "@babel/traverse": "^7.1.5",
- "@babel/types": "^7.3.0"
+ "@babel/template": "^7.4.4",
+ "@babel/traverse": "^7.4.4",
+ "@babel/types": "^7.4.4"
}
},
"@babel/highlight": {
@@ -289,9 +289,9 @@
}
},
"@babel/parser": {
- "version": "7.3.4",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.3.4.tgz",
- "integrity": "sha512-tXZCqWtlOOP4wgCp6RjRvLmfuhnqTLy9VHwRochJBCP2nDm27JnnuFEnXFASVyQNHk36jD1tAammsCEEqgscIQ==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.4.tgz",
+ "integrity": "sha512-5pCS4mOsL+ANsFZGdvNLybx4wtqAZJ0MJjMHxvzI3bvIsz6sQvzW8XX92EYIkiPtIvcfG3Aj+Ir5VNyjnZhP7w==",
"dev": true
},
"@babel/plugin-proposal-async-generator-functions": {
@@ -316,9 +316,9 @@
}
},
"@babel/plugin-proposal-object-rest-spread": {
- "version": "7.3.4",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.3.4.tgz",
- "integrity": "sha512-j7VQmbbkA+qrzNqbKHrBsW3ddFnOeva6wzSe/zB7T+xaxGc+RCpwo44wCmRixAIGRoIpmVgvzFzNJqQcO3/9RA==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.4.4.tgz",
+ "integrity": "sha512-dMBG6cSPBbHeEBdFXeQ2QLc5gUpg4Vkaz8octD4aoW/ISO+jBOcsuxYL7bsb5WSu8RLP6boxrBIALEHgoHtO9g==",
"dev": true,
"requires": {
"@babel/helper-plugin-utils": "^7.0.0",
@@ -336,14 +336,14 @@
}
},
"@babel/plugin-proposal-unicode-property-regex": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.2.0.tgz",
- "integrity": "sha512-LvRVYb7kikuOtIoUeWTkOxQEV1kYvL5B6U3iWEGCzPNRus1MzJweFqORTj+0jkxozkTSYNJozPOddxmqdqsRpw==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.4.4.tgz",
+ "integrity": "sha512-j1NwnOqMG9mFUOH58JTFsA/+ZYzQLUZ/drqWUqxCYLGeu2JFZL8YrNC9hBxKmWtAuOCHPcRpgv7fhap09Fb4kA==",
"dev": true,
"requires": {
"@babel/helper-plugin-utils": "^7.0.0",
- "@babel/helper-regex": "^7.0.0",
- "regexpu-core": "^4.2.0"
+ "@babel/helper-regex": "^7.4.4",
+ "regexpu-core": "^4.5.4"
}
},
"@babel/plugin-syntax-async-generators": {
@@ -392,9 +392,9 @@
}
},
"@babel/plugin-transform-async-to-generator": {
- "version": "7.3.4",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.3.4.tgz",
- "integrity": "sha512-Y7nCzv2fw/jEZ9f678MuKdMo99MFDJMT/PvD9LisrR5JDFcJH6vYeH6RnjVt3p5tceyGRvTtEN0VOlU+rgHZjA==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.4.4.tgz",
+ "integrity": "sha512-YiqW2Li8TXmzgbXw+STsSqPBPFnGviiaSp6CYOq55X8GQ2SGVLrXB6pNid8HkqkZAzOH6knbai3snhP7v0fNwA==",
"dev": true,
"requires": {
"@babel/helper-module-imports": "^7.0.0",
@@ -412,9 +412,9 @@
}
},
"@babel/plugin-transform-block-scoping": {
- "version": "7.3.4",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.3.4.tgz",
- "integrity": "sha512-blRr2O8IOZLAOJklXLV4WhcEzpYafYQKSGT3+R26lWG41u/FODJuBggehtOwilVAcFu393v3OFj+HmaE6tVjhA==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.4.4.tgz",
+ "integrity": "sha512-jkTUyWZcTrwxu5DD4rWz6rDB5Cjdmgz6z7M7RLXOJyCUkFBawssDGcGh8M/0FTSB87avyJI1HsTwUXp9nKA1PA==",
"dev": true,
"requires": {
"@babel/helper-plugin-utils": "^7.0.0",
@@ -422,18 +422,18 @@
}
},
"@babel/plugin-transform-classes": {
- "version": "7.3.4",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.3.4.tgz",
- "integrity": "sha512-J9fAvCFBkXEvBimgYxCjvaVDzL6thk0j0dBvCeZmIUDBwyt+nv6HfbImsSrWsYXfDNDivyANgJlFXDUWRTZBuA==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.4.4.tgz",
+ "integrity": "sha512-/e44eFLImEGIpL9qPxSRat13I5QNRgBLu2hOQJCF7VLy/otSM/sypV1+XaIw5+502RX/+6YaSAPmldk+nhHDPw==",
"dev": true,
"requires": {
"@babel/helper-annotate-as-pure": "^7.0.0",
- "@babel/helper-define-map": "^7.1.0",
+ "@babel/helper-define-map": "^7.4.4",
"@babel/helper-function-name": "^7.1.0",
"@babel/helper-optimise-call-expression": "^7.0.0",
"@babel/helper-plugin-utils": "^7.0.0",
- "@babel/helper-replace-supers": "^7.3.4",
- "@babel/helper-split-export-declaration": "^7.0.0",
+ "@babel/helper-replace-supers": "^7.4.4",
+ "@babel/helper-split-export-declaration": "^7.4.4",
"globals": "^11.1.0"
}
},
@@ -447,23 +447,23 @@
}
},
"@babel/plugin-transform-destructuring": {
- "version": "7.3.2",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.3.2.tgz",
- "integrity": "sha512-Lrj/u53Ufqxl/sGxyjsJ2XNtNuEjDyjpqdhMNh5aZ+XFOdThL46KBj27Uem4ggoezSYBxKWAil6Hu8HtwqesYw==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.4.4.tgz",
+ "integrity": "sha512-/aOx+nW0w8eHiEHm+BTERB2oJn5D127iye/SUQl7NjHy0lf+j7h4MKMMSOwdazGq9OxgiNADncE+SRJkCxjZpQ==",
"dev": true,
"requires": {
"@babel/helper-plugin-utils": "^7.0.0"
}
},
"@babel/plugin-transform-dotall-regex": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.2.0.tgz",
- "integrity": "sha512-sKxnyHfizweTgKZf7XsXu/CNupKhzijptfTM+bozonIuyVrLWVUvYjE2bhuSBML8VQeMxq4Mm63Q9qvcvUcciQ==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.4.4.tgz",
+ "integrity": "sha512-P05YEhRc2h53lZDjRPk/OektxCVevFzZs2Gfjd545Wde3k+yFDbXORgl2e0xpbq8mLcKJ7Idss4fAg0zORN/zg==",
"dev": true,
"requires": {
"@babel/helper-plugin-utils": "^7.0.0",
- "@babel/helper-regex": "^7.0.0",
- "regexpu-core": "^4.1.3"
+ "@babel/helper-regex": "^7.4.4",
+ "regexpu-core": "^4.5.4"
}
},
"@babel/plugin-transform-duplicate-keys": {
@@ -486,18 +486,18 @@
}
},
"@babel/plugin-transform-for-of": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.2.0.tgz",
- "integrity": "sha512-Kz7Mt0SsV2tQk6jG5bBv5phVbkd0gd27SgYD4hH1aLMJRchM0dzHaXvrWhVZ+WxAlDoAKZ7Uy3jVTW2mKXQ1WQ==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.4.4.tgz",
+ "integrity": "sha512-9T/5Dlr14Z9TIEXLXkt8T1DU7F24cbhwhMNUziN3hB1AXoZcdzPcTiKGRn/6iOymDqtTKWnr/BtRKN9JwbKtdQ==",
"dev": true,
"requires": {
"@babel/helper-plugin-utils": "^7.0.0"
}
},
"@babel/plugin-transform-function-name": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.2.0.tgz",
- "integrity": "sha512-kWgksow9lHdvBC2Z4mxTsvc7YdY7w/V6B2vy9cTIPtLEE9NhwoWivaxdNM/S37elu5bqlLP/qOY906LukO9lkQ==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.4.4.tgz",
+ "integrity": "sha512-iU9pv7U+2jC9ANQkKeNF6DrPy4GBa4NWQtl6dHB4Pb3izX2JOEvDTFarlNsBj/63ZEzNNIAMs3Qw4fNCcSOXJA==",
"dev": true,
"requires": {
"@babel/helper-function-name": "^7.1.0",
@@ -513,6 +513,15 @@
"@babel/helper-plugin-utils": "^7.0.0"
}
},
+ "@babel/plugin-transform-member-expression-literals": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.2.0.tgz",
+ "integrity": "sha512-HiU3zKkSU6scTidmnFJ0bMX8hz5ixC93b4MHMiYebmk2lUVNGOboPsqQvx5LzooihijUoLR/v7Nc1rbBtnc7FA==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
"@babel/plugin-transform-modules-amd": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.2.0.tgz",
@@ -524,23 +533,23 @@
}
},
"@babel/plugin-transform-modules-commonjs": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.2.0.tgz",
- "integrity": "sha512-V6y0uaUQrQPXUrmj+hgnks8va2L0zcZymeU7TtWEgdRLNkceafKXEduv7QzgQAE4lT+suwooG9dC7LFhdRAbVQ==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.4.4.tgz",
+ "integrity": "sha512-4sfBOJt58sEo9a2BQXnZq+Q3ZTSAUXyK3E30o36BOGnJ+tvJ6YSxF0PG6kERvbeISgProodWuI9UVG3/FMY6iw==",
"dev": true,
"requires": {
- "@babel/helper-module-transforms": "^7.1.0",
+ "@babel/helper-module-transforms": "^7.4.4",
"@babel/helper-plugin-utils": "^7.0.0",
"@babel/helper-simple-access": "^7.1.0"
}
},
"@babel/plugin-transform-modules-systemjs": {
- "version": "7.3.4",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.3.4.tgz",
- "integrity": "sha512-VZ4+jlGOF36S7TjKs8g4ojp4MEI+ebCQZdswWb/T9I4X84j8OtFAyjXjt/M16iIm5RIZn0UMQgg/VgIwo/87vw==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.4.4.tgz",
+ "integrity": "sha512-MSiModfILQc3/oqnG7NrP1jHaSPryO6tA2kOMmAQApz5dayPxWiHqmq4sWH2xF5LcQK56LlbKByCd8Aah/OIkQ==",
"dev": true,
"requires": {
- "@babel/helper-hoist-variables": "^7.0.0",
+ "@babel/helper-hoist-variables": "^7.4.4",
"@babel/helper-plugin-utils": "^7.0.0"
}
},
@@ -555,18 +564,18 @@
}
},
"@babel/plugin-transform-named-capturing-groups-regex": {
- "version": "7.3.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.3.0.tgz",
- "integrity": "sha512-NxIoNVhk9ZxS+9lSoAQ/LM0V2UEvARLttEHUrRDGKFaAxOYQcrkN/nLRE+BbbicCAvZPl7wMP0X60HsHE5DtQw==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.4.4.tgz",
+ "integrity": "sha512-Ki+Y9nXBlKfhD+LXaRS7v95TtTGYRAf9Y1rTDiE75zf8YQz4GDaWRXosMfJBXxnk88mGFjWdCRIeqDbon7spYA==",
"dev": true,
"requires": {
"regexp-tree": "^0.1.0"
}
},
"@babel/plugin-transform-new-target": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.0.0.tgz",
- "integrity": "sha512-yin069FYjah+LbqfGeTfzIBODex/e++Yfa0rH0fpfam9uTbuEeEOx5GLGr210ggOV77mVRNoeqSYqeuaqSzVSw==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.4.4.tgz",
+ "integrity": "sha512-r1z3T2DNGQwwe2vPGZMBNjioT2scgWzK9BCnDEh+46z8EEwXBq24uRzd65I7pjtugzPSj921aM15RpESgzsSuA==",
"dev": true,
"requires": {
"@babel/helper-plugin-utils": "^7.0.0"
@@ -583,25 +592,43 @@
}
},
"@babel/plugin-transform-parameters": {
- "version": "7.3.3",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.3.3.tgz",
- "integrity": "sha512-IrIP25VvXWu/VlBWTpsjGptpomtIkYrN/3aDp4UKm7xK6UxZY88kcJ1UwETbzHAlwN21MnNfwlar0u8y3KpiXw==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.4.4.tgz",
+ "integrity": "sha512-oMh5DUO1V63nZcu/ZVLQFqiihBGo4OpxJxR1otF50GMeCLiRx5nUdtokd+u9SuVJrvvuIh9OosRFPP4pIPnwmw==",
"dev": true,
"requires": {
- "@babel/helper-call-delegate": "^7.1.0",
+ "@babel/helper-call-delegate": "^7.4.4",
"@babel/helper-get-function-arity": "^7.0.0",
"@babel/helper-plugin-utils": "^7.0.0"
}
},
+ "@babel/plugin-transform-property-literals": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.2.0.tgz",
+ "integrity": "sha512-9q7Dbk4RhgcLp8ebduOpCbtjh7C0itoLYHXd9ueASKAG/is5PQtMR5VJGka9NKqGhYEGn5ITahd4h9QeBMylWQ==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
"@babel/plugin-transform-regenerator": {
- "version": "7.3.4",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.3.4.tgz",
- "integrity": "sha512-hvJg8EReQvXT6G9H2MvNPXkv9zK36Vxa1+csAVTpE1J3j0zlHplw76uudEbJxgvqZzAq9Yh45FLD4pk5mKRFQA==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.4.4.tgz",
+ "integrity": "sha512-Zz3w+pX1SI0KMIiqshFZkwnVGUhDZzpX2vtPzfJBKQQq8WsP/Xy9DNdELWivxcKOCX/Pywge4SiEaPaLtoDT4g==",
"dev": true,
"requires": {
"regenerator-transform": "^0.13.4"
}
},
+ "@babel/plugin-transform-reserved-words": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.2.0.tgz",
+ "integrity": "sha512-fz43fqW8E1tAB3DKF19/vxbpib1fuyCwSPE418ge5ZxILnBhWyhtPgz8eh1RCGGJlwvksHkyxMxh0eenFi+kFw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
"@babel/plugin-transform-shorthand-properties": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz",
@@ -631,9 +658,9 @@
}
},
"@babel/plugin-transform-template-literals": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.2.0.tgz",
- "integrity": "sha512-FkPix00J9A/XWXv4VoKJBMeSkyY9x/TqIh76wzcdfl57RJJcf8CehQ08uwfhCDNtRQYtHQKBTwKZDEyjE13Lwg==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.4.4.tgz",
+ "integrity": "sha512-mQrEC4TWkhLN0z8ygIvEL9ZEToPhG5K7KDW3pzGqOfIGZ28Jb0POUkeWcoz8HnHvhFy6dwAT1j8OzqN8s804+g==",
"dev": true,
"requires": {
"@babel/helper-annotate-as-pure": "^7.0.0",
@@ -650,105 +677,109 @@
}
},
"@babel/plugin-transform-unicode-regex": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.2.0.tgz",
- "integrity": "sha512-m48Y0lMhrbXEJnVUaYly29jRXbQ3ksxPrS1Tg8t+MHqzXhtBYAvI51euOBaoAlZLPHsieY9XPVMf80a5x0cPcA==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.4.4.tgz",
+ "integrity": "sha512-il+/XdNw01i93+M9J9u4T7/e/Ue/vWfNZE4IRUQjplu2Mqb/AFTDimkw2tdEdSH50wuQXZAbXSql0UphQke+vA==",
"dev": true,
"requires": {
"@babel/helper-plugin-utils": "^7.0.0",
- "@babel/helper-regex": "^7.0.0",
- "regexpu-core": "^4.1.3"
+ "@babel/helper-regex": "^7.4.4",
+ "regexpu-core": "^4.5.4"
}
},
"@babel/preset-env": {
- "version": "7.3.4",
- "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.3.4.tgz",
- "integrity": "sha512-2mwqfYMK8weA0g0uBKOt4FE3iEodiHy9/CW0b+nWXcbL+pGzLx8ESYc+j9IIxr6LTDHWKgPm71i9smo02bw+gA==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.4.4.tgz",
+ "integrity": "sha512-FU1H+ACWqZZqfw1x2G1tgtSSYSfxJLkpaUQL37CenULFARDo+h4xJoVHzRoHbK+85ViLciuI7ME4WTIhFRBBlw==",
"dev": true,
"requires": {
"@babel/helper-module-imports": "^7.0.0",
"@babel/helper-plugin-utils": "^7.0.0",
"@babel/plugin-proposal-async-generator-functions": "^7.2.0",
"@babel/plugin-proposal-json-strings": "^7.2.0",
- "@babel/plugin-proposal-object-rest-spread": "^7.3.4",
+ "@babel/plugin-proposal-object-rest-spread": "^7.4.4",
"@babel/plugin-proposal-optional-catch-binding": "^7.2.0",
- "@babel/plugin-proposal-unicode-property-regex": "^7.2.0",
+ "@babel/plugin-proposal-unicode-property-regex": "^7.4.4",
"@babel/plugin-syntax-async-generators": "^7.2.0",
"@babel/plugin-syntax-json-strings": "^7.2.0",
"@babel/plugin-syntax-object-rest-spread": "^7.2.0",
"@babel/plugin-syntax-optional-catch-binding": "^7.2.0",
"@babel/plugin-transform-arrow-functions": "^7.2.0",
- "@babel/plugin-transform-async-to-generator": "^7.3.4",
+ "@babel/plugin-transform-async-to-generator": "^7.4.4",
"@babel/plugin-transform-block-scoped-functions": "^7.2.0",
- "@babel/plugin-transform-block-scoping": "^7.3.4",
- "@babel/plugin-transform-classes": "^7.3.4",
+ "@babel/plugin-transform-block-scoping": "^7.4.4",
+ "@babel/plugin-transform-classes": "^7.4.4",
"@babel/plugin-transform-computed-properties": "^7.2.0",
- "@babel/plugin-transform-destructuring": "^7.2.0",
- "@babel/plugin-transform-dotall-regex": "^7.2.0",
+ "@babel/plugin-transform-destructuring": "^7.4.4",
+ "@babel/plugin-transform-dotall-regex": "^7.4.4",
"@babel/plugin-transform-duplicate-keys": "^7.2.0",
"@babel/plugin-transform-exponentiation-operator": "^7.2.0",
- "@babel/plugin-transform-for-of": "^7.2.0",
- "@babel/plugin-transform-function-name": "^7.2.0",
+ "@babel/plugin-transform-for-of": "^7.4.4",
+ "@babel/plugin-transform-function-name": "^7.4.4",
"@babel/plugin-transform-literals": "^7.2.0",
+ "@babel/plugin-transform-member-expression-literals": "^7.2.0",
"@babel/plugin-transform-modules-amd": "^7.2.0",
- "@babel/plugin-transform-modules-commonjs": "^7.2.0",
- "@babel/plugin-transform-modules-systemjs": "^7.3.4",
+ "@babel/plugin-transform-modules-commonjs": "^7.4.4",
+ "@babel/plugin-transform-modules-systemjs": "^7.4.4",
"@babel/plugin-transform-modules-umd": "^7.2.0",
- "@babel/plugin-transform-named-capturing-groups-regex": "^7.3.0",
- "@babel/plugin-transform-new-target": "^7.0.0",
+ "@babel/plugin-transform-named-capturing-groups-regex": "^7.4.4",
+ "@babel/plugin-transform-new-target": "^7.4.4",
"@babel/plugin-transform-object-super": "^7.2.0",
- "@babel/plugin-transform-parameters": "^7.2.0",
- "@babel/plugin-transform-regenerator": "^7.3.4",
+ "@babel/plugin-transform-parameters": "^7.4.4",
+ "@babel/plugin-transform-property-literals": "^7.2.0",
+ "@babel/plugin-transform-regenerator": "^7.4.4",
+ "@babel/plugin-transform-reserved-words": "^7.2.0",
"@babel/plugin-transform-shorthand-properties": "^7.2.0",
"@babel/plugin-transform-spread": "^7.2.0",
"@babel/plugin-transform-sticky-regex": "^7.2.0",
- "@babel/plugin-transform-template-literals": "^7.2.0",
+ "@babel/plugin-transform-template-literals": "^7.4.4",
"@babel/plugin-transform-typeof-symbol": "^7.2.0",
- "@babel/plugin-transform-unicode-regex": "^7.2.0",
- "browserslist": "^4.3.4",
+ "@babel/plugin-transform-unicode-regex": "^7.4.4",
+ "@babel/types": "^7.4.4",
+ "browserslist": "^4.5.2",
+ "core-js-compat": "^3.0.0",
"invariant": "^2.2.2",
"js-levenshtein": "^1.1.3",
- "semver": "^5.3.0"
+ "semver": "^5.5.0"
}
},
"@babel/register": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.0.0.tgz",
- "integrity": "sha512-f/+CRmaCe7rVEvcvPvxeA8j5aJhHC3aJie7YuqcMDhUOuyWLA7J/aNrTaHIzoWPEhpHA54mec4Mm8fv8KBlv3g==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.4.4.tgz",
+ "integrity": "sha512-sn51H88GRa00+ZoMqCVgOphmswG4b7mhf9VOB0LUBAieykq2GnRFerlN+JQkO/ntT7wz4jaHNSRPg9IdMPEUkA==",
"dev": true,
"requires": {
- "core-js": "^2.5.7",
- "find-cache-dir": "^1.0.0",
- "home-or-tmp": "^3.0.0",
- "lodash": "^4.17.10",
+ "core-js": "^3.0.0",
+ "find-cache-dir": "^2.0.0",
+ "lodash": "^4.17.11",
"mkdirp": "^0.5.1",
"pirates": "^4.0.0",
"source-map-support": "^0.5.9"
}
},
"@babel/template": {
- "version": "7.2.2",
- "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.2.2.tgz",
- "integrity": "sha512-zRL0IMM02AUDwghf5LMSSDEz7sBCO2YnNmpg3uWTZj/v1rcG2BmQUvaGU8GhU8BvfMh1k2KIAYZ7Ji9KXPUg7g==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz",
+ "integrity": "sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
- "@babel/parser": "^7.2.2",
- "@babel/types": "^7.2.2"
+ "@babel/parser": "^7.4.4",
+ "@babel/types": "^7.4.4"
}
},
"@babel/traverse": {
- "version": "7.3.4",
- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.3.4.tgz",
- "integrity": "sha512-TvTHKp6471OYEcE/91uWmhR6PrrYywQntCHSaZ8CM8Vmp+pjAusal4nGB2WCCQd0rvI7nOMKn9GnbcvTUz3/ZQ==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.4.tgz",
+ "integrity": "sha512-Gw6qqkw/e6AGzlyj9KnkabJX7VcubqPtkUQVAwkc0wUMldr3A/hezNB3Rc5eIvId95iSGkGIOe5hh1kMKf951A==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
- "@babel/generator": "^7.3.4",
+ "@babel/generator": "^7.4.4",
"@babel/helper-function-name": "^7.1.0",
- "@babel/helper-split-export-declaration": "^7.0.0",
- "@babel/parser": "^7.3.4",
- "@babel/types": "^7.3.4",
+ "@babel/helper-split-export-declaration": "^7.4.4",
+ "@babel/parser": "^7.4.4",
+ "@babel/types": "^7.4.4",
"debug": "^4.1.0",
"globals": "^11.1.0",
"lodash": "^4.17.11"
@@ -772,9 +803,9 @@
}
},
"@babel/types": {
- "version": "7.3.4",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.3.4.tgz",
- "integrity": "sha512-WEkp8MsLftM7O/ty580wAmZzN1nDmCACc5+jFzUt+GUFNNIi3LdRlueYz0YIlmJhlZx1QYDMZL5vdWCL0fNjFQ==",
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.4.4.tgz",
+ "integrity": "sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ==",
"dev": true,
"requires": {
"esutils": "^2.0.2",
@@ -839,6 +870,14 @@
"import-from": "2.1.0",
"resolve-pkg": "1.0.0",
"semver": "5.6.0"
+ },
+ "dependencies": {
+ "semver": {
+ "version": "5.6.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz",
+ "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==",
+ "dev": true
+ }
}
},
"@commitlint/ensure": {
@@ -876,6 +915,14 @@
"dev": true,
"requires": {
"semver": "5.6.0"
+ },
+ "dependencies": {
+ "semver": {
+ "version": "5.6.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz",
+ "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==",
+ "dev": true
+ }
}
},
"@commitlint/lint": {
@@ -1140,44 +1187,43 @@
}
},
"@jest/console": {
- "version": "24.3.0",
- "resolved": "https://registry.npmjs.org/@jest/console/-/console-24.3.0.tgz",
- "integrity": "sha512-NaCty/OOei6rSDcbPdMiCbYCI0KGFGPgGO6B09lwWt5QTxnkuhKYET9El5u5z1GAcSxkQmSMtM63e24YabCWqA==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/@jest/console/-/console-24.7.1.tgz",
+ "integrity": "sha512-iNhtIy2M8bXlAOULWVTUxmnelTLFneTNEkHCgPmgd+zNwy9zVddJ6oS5rZ9iwoscNdT5mMwUd0C51v/fSlzItg==",
"dev": true,
"requires": {
"@jest/source-map": "^24.3.0",
- "@types/node": "*",
"chalk": "^2.0.1",
"slash": "^2.0.0"
}
},
"@jest/core": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/@jest/core/-/core-24.5.0.tgz",
- "integrity": "sha512-RDZArRzAs51YS7dXG1pbXbWGxK53rvUu8mCDYsgqqqQ6uSOaTjcVyBl2Jce0exT2rSLk38ca7az7t2f3b0/oYQ==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/@jest/core/-/core-24.7.1.tgz",
+ "integrity": "sha512-ivlZ8HX/FOASfHcb5DJpSPFps8ydfUYzLZfgFFqjkLijYysnIEOieg72YRhO4ZUB32xu40hsSMmaw+IGYeKONA==",
"dev": true,
"requires": {
- "@jest/console": "^24.3.0",
- "@jest/reporters": "^24.5.0",
- "@jest/test-result": "^24.5.0",
- "@jest/transform": "^24.5.0",
- "@jest/types": "^24.5.0",
+ "@jest/console": "^24.7.1",
+ "@jest/reporters": "^24.7.1",
+ "@jest/test-result": "^24.7.1",
+ "@jest/transform": "^24.7.1",
+ "@jest/types": "^24.7.0",
"ansi-escapes": "^3.0.0",
"chalk": "^2.0.1",
"exit": "^0.1.2",
"graceful-fs": "^4.1.15",
- "jest-changed-files": "^24.5.0",
- "jest-config": "^24.5.0",
- "jest-haste-map": "^24.5.0",
- "jest-message-util": "^24.5.0",
+ "jest-changed-files": "^24.7.0",
+ "jest-config": "^24.7.1",
+ "jest-haste-map": "^24.7.1",
+ "jest-message-util": "^24.7.1",
"jest-regex-util": "^24.3.0",
- "jest-resolve-dependencies": "^24.5.0",
- "jest-runner": "^24.5.0",
- "jest-runtime": "^24.5.0",
- "jest-snapshot": "^24.5.0",
- "jest-util": "^24.5.0",
- "jest-validate": "^24.5.0",
- "jest-watcher": "^24.5.0",
+ "jest-resolve-dependencies": "^24.7.1",
+ "jest-runner": "^24.7.1",
+ "jest-runtime": "^24.7.1",
+ "jest-snapshot": "^24.7.1",
+ "jest-util": "^24.7.1",
+ "jest-validate": "^24.7.0",
+ "jest-watcher": "^24.7.1",
"micromatch": "^3.1.10",
"p-each-series": "^1.0.0",
"pirates": "^4.0.1",
@@ -1199,9 +1245,9 @@
"dev": true
},
"strip-ansi": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.1.0.tgz",
- "integrity": "sha512-TjxrkPONqO2Z8QDCpeE2j6n0M6EwxzyDgzEeGp+FbdvaJAt//ClYi6W5my+3ROlC/hZX2KACUwDfK49Ka5eDvg==",
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
+ "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
"dev": true,
"requires": {
"ansi-regex": "^4.1.0"
@@ -1210,40 +1256,38 @@
}
},
"@jest/environment": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-24.5.0.tgz",
- "integrity": "sha512-tzUHR9SHjMXwM8QmfHb/EJNbF0fjbH4ieefJBvtwO8YErLTrecc1ROj0uo2VnIT6SlpEGZnvdCK6VgKYBo8LsA==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-24.7.1.tgz",
+ "integrity": "sha512-wmcTTYc4/KqA+U5h1zQd5FXXynfa7VGP2NfF+c6QeGJ7c+2nStgh65RQWNX62SC716dTtqheTRrZl0j+54oGHw==",
"dev": true,
"requires": {
- "@jest/fake-timers": "^24.5.0",
- "@jest/transform": "^24.5.0",
- "@jest/types": "^24.5.0",
- "@types/node": "*",
- "jest-mock": "^24.5.0"
+ "@jest/fake-timers": "^24.7.1",
+ "@jest/transform": "^24.7.1",
+ "@jest/types": "^24.7.0",
+ "jest-mock": "^24.7.0"
}
},
"@jest/fake-timers": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-24.5.0.tgz",
- "integrity": "sha512-i59KVt3QBz9d+4Qr4QxsKgsIg+NjfuCjSOWj3RQhjF5JNy+eVJDhANQ4WzulzNCHd72srMAykwtRn5NYDGVraw==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-24.7.1.tgz",
+ "integrity": "sha512-4vSQJDKfR2jScOe12L9282uiwuwQv9Lk7mgrCSZHA9evB9efB/qx8i0KJxsAKtp8fgJYBJdYY7ZU6u3F4/pyjA==",
"dev": true,
"requires": {
- "@jest/types": "^24.5.0",
- "@types/node": "*",
- "jest-message-util": "^24.5.0",
- "jest-mock": "^24.5.0"
+ "@jest/types": "^24.7.0",
+ "jest-message-util": "^24.7.1",
+ "jest-mock": "^24.7.0"
}
},
"@jest/reporters": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-24.5.0.tgz",
- "integrity": "sha512-vfpceiaKtGgnuC3ss5czWOihKOUSyjJA4M4udm6nH8xgqsuQYcyDCi4nMMcBKsHXWgz9/V5G7iisnZGfOh1w6Q==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-24.7.1.tgz",
+ "integrity": "sha512-bO+WYNwHLNhrjB9EbPL4kX/mCCG4ZhhfWmO3m4FSpbgr7N83MFejayz30kKjgqr7smLyeaRFCBQMbXpUgnhAJw==",
"dev": true,
"requires": {
- "@jest/environment": "^24.5.0",
- "@jest/test-result": "^24.5.0",
- "@jest/transform": "^24.5.0",
- "@jest/types": "^24.5.0",
+ "@jest/environment": "^24.7.1",
+ "@jest/test-result": "^24.7.1",
+ "@jest/transform": "^24.7.1",
+ "@jest/types": "^24.7.0",
"chalk": "^2.0.1",
"exit": "^0.1.2",
"glob": "^7.1.2",
@@ -1251,11 +1295,11 @@
"istanbul-lib-coverage": "^2.0.2",
"istanbul-lib-instrument": "^3.0.1",
"istanbul-lib-source-maps": "^3.0.1",
- "jest-haste-map": "^24.5.0",
- "jest-resolve": "^24.5.0",
- "jest-runtime": "^24.5.0",
- "jest-util": "^24.5.0",
- "jest-worker": "^24.4.0",
+ "jest-haste-map": "^24.7.1",
+ "jest-resolve": "^24.7.1",
+ "jest-runtime": "^24.7.1",
+ "jest-util": "^24.7.1",
+ "jest-worker": "^24.6.0",
"node-notifier": "^5.2.1",
"slash": "^2.0.0",
"source-map": "^0.6.0",
@@ -1290,32 +1334,44 @@
}
},
"@jest/test-result": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-24.5.0.tgz",
- "integrity": "sha512-u66j2vBfa8Bli1+o3rCaVnVYa9O8CAFZeqiqLVhnarXtreSXG33YQ6vNYBogT7+nYiFNOohTU21BKiHlgmxD5A==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-24.7.1.tgz",
+ "integrity": "sha512-3U7wITxstdEc2HMfBX7Yx3JZgiNBubwDqQMh+BXmZXHa3G13YWF3p6cK+5g0hGkN3iufg/vGPl3hLxQXD74Npg==",
"dev": true,
"requires": {
- "@jest/console": "^24.3.0",
- "@jest/types": "^24.5.0",
- "@types/istanbul-lib-coverage": "^1.1.0"
+ "@jest/console": "^24.7.1",
+ "@jest/types": "^24.7.0",
+ "@types/istanbul-lib-coverage": "^2.0.0"
+ }
+ },
+ "@jest/test-sequencer": {
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-24.7.1.tgz",
+ "integrity": "sha512-84HQkCpVZI/G1zq53gHJvSmhUer4aMYp9tTaffW28Ih5OxfCg8hGr3nTSbL1OhVDRrFZwvF+/R9gY6JRkDUpUA==",
+ "dev": true,
+ "requires": {
+ "@jest/test-result": "^24.7.1",
+ "jest-haste-map": "^24.7.1",
+ "jest-runner": "^24.7.1",
+ "jest-runtime": "^24.7.1"
}
},
"@jest/transform": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-24.5.0.tgz",
- "integrity": "sha512-XSsDz1gdR/QMmB8UCKlweAReQsZrD/DK7FuDlNo/pE8EcKMrfi2kqLRk8h8Gy/PDzgqJj64jNEzOce9pR8oj1w==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-24.7.1.tgz",
+ "integrity": "sha512-EsOUqP9ULuJ66IkZQhI5LufCHlTbi7hrcllRMUEV/tOgqBVQi93+9qEvkX0n8mYpVXQ8VjwmICeRgg58mrtIEw==",
"dev": true,
"requires": {
"@babel/core": "^7.1.0",
- "@jest/types": "^24.5.0",
+ "@jest/types": "^24.7.0",
"babel-plugin-istanbul": "^5.1.0",
"chalk": "^2.0.1",
"convert-source-map": "^1.4.0",
"fast-json-stable-stringify": "^2.0.0",
"graceful-fs": "^4.1.15",
- "jest-haste-map": "^24.5.0",
+ "jest-haste-map": "^24.7.1",
"jest-regex-util": "^24.3.0",
- "jest-util": "^24.5.0",
+ "jest-util": "^24.7.1",
"micromatch": "^3.1.10",
"realpath-native": "^1.1.0",
"slash": "^2.0.0",
@@ -1332,24 +1388,24 @@
}
},
"@jest/types": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.5.0.tgz",
- "integrity": "sha512-kN7RFzNMf2R8UDadPOl6ReyI+MT8xfqRuAnuVL+i4gwjv/zubdDK+EDeLHYwq1j0CSSR2W/MmgaRlMZJzXdmVA==",
+ "version": "24.7.0",
+ "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.7.0.tgz",
+ "integrity": "sha512-ipJUa2rFWiKoBqMKP63Myb6h9+iT3FHRTF2M8OR6irxWzItisa8i4dcSg14IbvmXUnBlHBlUQPYUHWyX3UPpYA==",
"dev": true,
"requires": {
- "@types/istanbul-lib-coverage": "^1.1.0",
+ "@types/istanbul-lib-coverage": "^2.0.0",
"@types/yargs": "^12.0.9"
}
},
"@lerna/add": {
- "version": "3.13.1",
- "resolved": "https://registry.npmjs.org/@lerna/add/-/add-3.13.1.tgz",
- "integrity": "sha512-cXk42YbuhzEnADCK8Qte5laC9Qo03eJLVnr0qKY85jQUM/T4URe3IIUemqpg0CpVATrB+Vz+iNdeqw9ng1iALw==",
+ "version": "3.13.3",
+ "resolved": "https://registry.npmjs.org/@lerna/add/-/add-3.13.3.tgz",
+ "integrity": "sha512-T3/Lsbo9ZFq+vL3ssaHxA8oKikZAPTJTGFe4CRuQgWCDd/M61+51jeWsngdaHpwzSSRDRjxg8fJTG10y10pnfA==",
"dev": true,
"requires": {
- "@lerna/bootstrap": "3.13.1",
- "@lerna/command": "3.13.1",
- "@lerna/filter-options": "3.13.0",
+ "@lerna/bootstrap": "3.13.3",
+ "@lerna/command": "3.13.3",
+ "@lerna/filter-options": "3.13.3",
"@lerna/npm-conf": "3.13.0",
"@lerna/validation-error": "3.13.0",
"dedent": "^0.7.0",
@@ -1371,19 +1427,19 @@
}
},
"@lerna/bootstrap": {
- "version": "3.13.1",
- "resolved": "https://registry.npmjs.org/@lerna/bootstrap/-/bootstrap-3.13.1.tgz",
- "integrity": "sha512-mKdi5Ds5f82PZwEFyB9/W60I3iELobi1i87sTeVrbJh/um7GvqpSPy7kG/JPxyOdMpB2njX6LiJgw+7b6BEPWw==",
+ "version": "3.13.3",
+ "resolved": "https://registry.npmjs.org/@lerna/bootstrap/-/bootstrap-3.13.3.tgz",
+ "integrity": "sha512-2XzijnLHRZOVQh8pwS7+5GR3cG4uh+EiLrWOishCq2TVzkqgjaS3GGBoef7KMCXfWHoLqAZRr/jEdLqfETLVqg==",
"dev": true,
"requires": {
"@lerna/batch-packages": "3.13.0",
- "@lerna/command": "3.13.1",
- "@lerna/filter-options": "3.13.0",
- "@lerna/has-npm-version": "3.13.0",
- "@lerna/npm-install": "3.13.0",
+ "@lerna/command": "3.13.3",
+ "@lerna/filter-options": "3.13.3",
+ "@lerna/has-npm-version": "3.13.3",
+ "@lerna/npm-install": "3.13.3",
"@lerna/package-graph": "3.13.0",
"@lerna/pulse-till-done": "3.13.0",
- "@lerna/rimraf-dir": "3.13.0",
+ "@lerna/rimraf-dir": "3.13.3",
"@lerna/run-lifecycle": "3.13.0",
"@lerna/run-parallel-batches": "3.13.0",
"@lerna/symlink-binary": "3.13.0",
@@ -1403,32 +1459,32 @@
}
},
"@lerna/changed": {
- "version": "3.13.1",
- "resolved": "https://registry.npmjs.org/@lerna/changed/-/changed-3.13.1.tgz",
- "integrity": "sha512-BRXitEJGOkoudbxEewW7WhjkLxFD+tTk4PrYpHLyCBk63pNTWtQLRE6dc1hqwh4emwyGncoyW6RgXfLgMZgryw==",
+ "version": "3.13.4",
+ "resolved": "https://registry.npmjs.org/@lerna/changed/-/changed-3.13.4.tgz",
+ "integrity": "sha512-9lfOyRVObasw6L/z7yCSfsEl1QKy0Eamb8t2Krg1deIoAt+cE3JXOdGGC1MhOSli+7f/U9LyLXjJzIOs/pc9fw==",
"dev": true,
"requires": {
- "@lerna/collect-updates": "3.13.0",
- "@lerna/command": "3.13.1",
+ "@lerna/collect-updates": "3.13.3",
+ "@lerna/command": "3.13.3",
"@lerna/listable": "3.13.0",
"@lerna/output": "3.13.0",
- "@lerna/version": "3.13.1"
+ "@lerna/version": "3.13.4"
}
},
"@lerna/check-working-tree": {
- "version": "3.13.0",
- "resolved": "https://registry.npmjs.org/@lerna/check-working-tree/-/check-working-tree-3.13.0.tgz",
- "integrity": "sha512-dsdO15NXX5To+Q53SYeCrBEpiqv4m5VkaPZxbGQZNwoRen1MloXuqxSymJANQn+ZLEqarv5V56gydebeROPH5A==",
+ "version": "3.13.3",
+ "resolved": "https://registry.npmjs.org/@lerna/check-working-tree/-/check-working-tree-3.13.3.tgz",
+ "integrity": "sha512-LoGZvTkne+V1WpVdCTU0XNzFKsQa2AiAFKksGRT0v8NQj6VAPp0jfVYDayTqwaWt2Ne0OGKOFE79Y5LStOuhaQ==",
"dev": true,
"requires": {
- "@lerna/describe-ref": "3.13.0",
+ "@lerna/describe-ref": "3.13.3",
"@lerna/validation-error": "3.13.0"
}
},
"@lerna/child-process": {
- "version": "3.13.0",
- "resolved": "https://registry.npmjs.org/@lerna/child-process/-/child-process-3.13.0.tgz",
- "integrity": "sha512-0iDS8y2jiEucD4fJHEzKoc8aQJgm7s+hG+0RmDNtfT0MM3n17pZnf5JOMtS1FJp+SEXOjMKQndyyaDIPFsnp6A==",
+ "version": "3.13.3",
+ "resolved": "https://registry.npmjs.org/@lerna/child-process/-/child-process-3.13.3.tgz",
+ "integrity": "sha512-3/e2uCLnbU+bydDnDwyadpOmuzazS01EcnOleAnuj9235CU2U97DH6OyoG1EW/fU59x11J+HjIqovh5vBaMQjQ==",
"dev": true,
"requires": {
"chalk": "^2.3.1",
@@ -1437,16 +1493,16 @@
}
},
"@lerna/clean": {
- "version": "3.13.1",
- "resolved": "https://registry.npmjs.org/@lerna/clean/-/clean-3.13.1.tgz",
- "integrity": "sha512-myGIaXv7RUO2qCFZXvx8SJeI+eN6y9SUD5zZ4/LvNogbOiEIlujC5lUAqK65rAHayQ9ltSa/yK6Xv510xhZXZQ==",
+ "version": "3.13.3",
+ "resolved": "https://registry.npmjs.org/@lerna/clean/-/clean-3.13.3.tgz",
+ "integrity": "sha512-xmNauF1PpmDaKdtA2yuRc23Tru4q7UMO6yB1a/TTwxYPYYsAWG/CBK65bV26J7x4RlZtEv06ztYGMa9zh34UXA==",
"dev": true,
"requires": {
- "@lerna/command": "3.13.1",
- "@lerna/filter-options": "3.13.0",
+ "@lerna/command": "3.13.3",
+ "@lerna/filter-options": "3.13.3",
"@lerna/prompt": "3.13.0",
"@lerna/pulse-till-done": "3.13.0",
- "@lerna/rimraf-dir": "3.13.0",
+ "@lerna/rimraf-dir": "3.13.3",
"p-map": "^1.2.0",
"p-map-series": "^1.0.0",
"p-waterfall": "^1.0.0"
@@ -1465,13 +1521,13 @@
}
},
"@lerna/collect-updates": {
- "version": "3.13.0",
- "resolved": "https://registry.npmjs.org/@lerna/collect-updates/-/collect-updates-3.13.0.tgz",
- "integrity": "sha512-uR3u6uTzrS1p46tHQ/mlHog/nRJGBqskTHYYJbgirujxm6FqNh7Do+I1Q/7zSee407G4lzsNxZdm8IL927HemQ==",
+ "version": "3.13.3",
+ "resolved": "https://registry.npmjs.org/@lerna/collect-updates/-/collect-updates-3.13.3.tgz",
+ "integrity": "sha512-sTpALOAxli/ZS+Mjq6fbmjU9YXqFJ2E4FrE1Ijl4wPC5stXEosg2u0Z1uPY+zVKdM+mOIhLxPVdx83rUgRS+Cg==",
"dev": true,
"requires": {
- "@lerna/child-process": "3.13.0",
- "@lerna/describe-ref": "3.13.0",
+ "@lerna/child-process": "3.13.3",
+ "@lerna/describe-ref": "3.13.3",
"minimatch": "^3.0.4",
"npmlog": "^4.1.2",
"slash": "^1.0.0"
@@ -1486,12 +1542,12 @@
}
},
"@lerna/command": {
- "version": "3.13.1",
- "resolved": "https://registry.npmjs.org/@lerna/command/-/command-3.13.1.tgz",
- "integrity": "sha512-SYWezxX+iheWvzRoHCrbs8v5zHPaxAx3kWvZhqi70vuGsdOVAWmaG4IvHLn11ztS+Vpd5PM+ztBWSbnykpLFKQ==",
+ "version": "3.13.3",
+ "resolved": "https://registry.npmjs.org/@lerna/command/-/command-3.13.3.tgz",
+ "integrity": "sha512-WHFIQCubJV0T8gSLRNr6exZUxTswrh+iAtJCb86SE0Sa+auMPklE8af7w2Yck5GJfewmxSjke3yrjNxQrstx7w==",
"dev": true,
"requires": {
- "@lerna/child-process": "3.13.0",
+ "@lerna/child-process": "3.13.3",
"@lerna/package-graph": "3.13.0",
"@lerna/project": "3.13.1",
"@lerna/validation-error": "3.13.0",
@@ -1547,17 +1603,23 @@
"compare-func": "^1.3.1",
"q": "^1.5.1"
}
+ },
+ "pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
+ "dev": true
}
}
},
"@lerna/create": {
- "version": "3.13.1",
- "resolved": "https://registry.npmjs.org/@lerna/create/-/create-3.13.1.tgz",
- "integrity": "sha512-pLENMXgTkQuvKxAopjKeoLOv9fVUCnpTUD7aLrY5d95/1xqSZlnsOcQfUYcpMf3GpOvHc8ILmI5OXkPqjAf54g==",
+ "version": "3.13.3",
+ "resolved": "https://registry.npmjs.org/@lerna/create/-/create-3.13.3.tgz",
+ "integrity": "sha512-4M5xT1AyUMwt1gCDph4BfW3e6fZmt0KjTa3FoXkUotf/w/eqTsc2IQ+ULz2+gOFQmtuNbqIZEOK3J4P9ArJJ/A==",
"dev": true,
"requires": {
- "@lerna/child-process": "3.13.0",
- "@lerna/command": "3.13.1",
+ "@lerna/child-process": "3.13.3",
+ "@lerna/command": "3.13.3",
"@lerna/npm-conf": "3.13.0",
"@lerna/validation-error": "3.13.0",
"camelcase": "^5.0.0",
@@ -1576,6 +1638,12 @@
"whatwg-url": "^7.0.0"
},
"dependencies": {
+ "pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
+ "dev": true
+ },
"slash": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz",
@@ -1607,48 +1675,48 @@
}
},
"@lerna/describe-ref": {
- "version": "3.13.0",
- "resolved": "https://registry.npmjs.org/@lerna/describe-ref/-/describe-ref-3.13.0.tgz",
- "integrity": "sha512-UJefF5mLxLae9I2Sbz5RLYGbqbikRuMqdgTam0MS5OhXnyuuKYBUpwBshCURNb1dPBXTQhSwc7+oUhORx8ojCg==",
+ "version": "3.13.3",
+ "resolved": "https://registry.npmjs.org/@lerna/describe-ref/-/describe-ref-3.13.3.tgz",
+ "integrity": "sha512-5KcLTvjdS4gU5evW8ESbZ0BF44NM5HrP3dQNtWnOUSKJRgsES8Gj0lq9AlB2+YglZfjEftFT03uOYOxnKto4Uw==",
"dev": true,
"requires": {
- "@lerna/child-process": "3.13.0",
+ "@lerna/child-process": "3.13.3",
"npmlog": "^4.1.2"
}
},
"@lerna/diff": {
- "version": "3.13.1",
- "resolved": "https://registry.npmjs.org/@lerna/diff/-/diff-3.13.1.tgz",
- "integrity": "sha512-cKqmpONO57mdvxtp8e+l5+tjtmF04+7E+O0QEcLcNUAjC6UR2OSM77nwRCXDukou/1h72JtWs0jjcdYLwAmApg==",
+ "version": "3.13.3",
+ "resolved": "https://registry.npmjs.org/@lerna/diff/-/diff-3.13.3.tgz",
+ "integrity": "sha512-/DRS2keYbnKaAC+5AkDyZRGkP/kT7v1GlUS0JGZeiRDPQ1H6PzhX09EgE5X6nj0Ytrm0sUasDeN++CDVvgaI+A==",
"dev": true,
"requires": {
- "@lerna/child-process": "3.13.0",
- "@lerna/command": "3.13.1",
+ "@lerna/child-process": "3.13.3",
+ "@lerna/command": "3.13.3",
"@lerna/validation-error": "3.13.0",
"npmlog": "^4.1.2"
}
},
"@lerna/exec": {
- "version": "3.13.1",
- "resolved": "https://registry.npmjs.org/@lerna/exec/-/exec-3.13.1.tgz",
- "integrity": "sha512-I34wEP9lrAqqM7tTXLDxv/6454WFzrnXDWpNDbiKQiZs6SIrOOjmm6I4FiQsx+rU3o9d+HkC6tcUJRN5mlJUgA==",
+ "version": "3.13.3",
+ "resolved": "https://registry.npmjs.org/@lerna/exec/-/exec-3.13.3.tgz",
+ "integrity": "sha512-c0bD4XqM96CTPV8+lvkxzE7mkxiFyv/WNM4H01YvvbFAJzk+S4Y7cBtRkIYFTfkFZW3FLo8pEgtG1ONtIdM+tg==",
"dev": true,
"requires": {
"@lerna/batch-packages": "3.13.0",
- "@lerna/child-process": "3.13.0",
- "@lerna/command": "3.13.1",
- "@lerna/filter-options": "3.13.0",
+ "@lerna/child-process": "3.13.3",
+ "@lerna/command": "3.13.3",
+ "@lerna/filter-options": "3.13.3",
"@lerna/run-parallel-batches": "3.13.0",
"@lerna/validation-error": "3.13.0"
}
},
"@lerna/filter-options": {
- "version": "3.13.0",
- "resolved": "https://registry.npmjs.org/@lerna/filter-options/-/filter-options-3.13.0.tgz",
- "integrity": "sha512-SRp7DCo9zrf+7NkQxZMkeyO1GRN6GICoB9UcBAbXhLbWisT37Cx5/6+jh49gYB63d/0/WYHSEPMlheUrpv1Srw==",
+ "version": "3.13.3",
+ "resolved": "https://registry.npmjs.org/@lerna/filter-options/-/filter-options-3.13.3.tgz",
+ "integrity": "sha512-DbtQX4eRgrBz1wCFWRP99JBD7ODykYme9ykEK79+RrKph40znhJQRlLg4idogj6IsUEzwo1OHjihCzSfnVo6Cg==",
"dev": true,
"requires": {
- "@lerna/collect-updates": "3.13.0",
+ "@lerna/collect-updates": "3.13.3",
"@lerna/filter-packages": "3.13.0",
"dedent": "^0.7.0"
}
@@ -1708,12 +1776,12 @@
}
},
"@lerna/github-client": {
- "version": "3.13.1",
- "resolved": "https://registry.npmjs.org/@lerna/github-client/-/github-client-3.13.1.tgz",
- "integrity": "sha512-iPLUp8FFoAKGURksYEYZzfuo9TRA+NepVlseRXFaWlmy36dCQN20AciINpoXiXGoHcEUHXUKHQvY3ARFdMlf3w==",
+ "version": "3.13.3",
+ "resolved": "https://registry.npmjs.org/@lerna/github-client/-/github-client-3.13.3.tgz",
+ "integrity": "sha512-fcJkjab4kX0zcLLSa/DCUNvU3v8wmy2c1lhdIbL7s7gABmDcV0QZq93LhnEee3VkC9UpnJ6GKG4EkD7eIifBnA==",
"dev": true,
"requires": {
- "@lerna/child-process": "3.13.0",
+ "@lerna/child-process": "3.13.3",
"@octokit/plugin-enterprise-rest": "^2.1.1",
"@octokit/rest": "^16.16.0",
"git-url-parse": "^11.1.2",
@@ -1727,23 +1795,23 @@
"dev": true
},
"@lerna/has-npm-version": {
- "version": "3.13.0",
- "resolved": "https://registry.npmjs.org/@lerna/has-npm-version/-/has-npm-version-3.13.0.tgz",
- "integrity": "sha512-Oqu7DGLnrMENPm+bPFGOHnqxK8lCnuYr6bk3g/CoNn8/U0qgFvHcq6Iv8/Z04TsvleX+3/RgauSD2kMfRmbypg==",
+ "version": "3.13.3",
+ "resolved": "https://registry.npmjs.org/@lerna/has-npm-version/-/has-npm-version-3.13.3.tgz",
+ "integrity": "sha512-mQzoghRw4dBg0R9FFfHrj0TH0glvXyzdEZmYZ8Isvx5BSuEEwpsryoywuZSdppcvLu8o7NAdU5Tac8cJ/mT52w==",
"dev": true,
"requires": {
- "@lerna/child-process": "3.13.0",
+ "@lerna/child-process": "3.13.3",
"semver": "^5.5.0"
}
},
"@lerna/import": {
- "version": "3.13.1",
- "resolved": "https://registry.npmjs.org/@lerna/import/-/import-3.13.1.tgz",
- "integrity": "sha512-A1Vk1siYx1XkRl6w+zkaA0iptV5TIynVlHPR9S7NY0XAfhykjztYVvwtxarlh6+VcNrO9We6if0+FXCrfDEoIg==",
+ "version": "3.13.4",
+ "resolved": "https://registry.npmjs.org/@lerna/import/-/import-3.13.4.tgz",
+ "integrity": "sha512-dn6eNuPEljWsifBEzJ9B6NoaLwl/Zvof7PBUPA4hRyRlqG5sXRn6F9DnusMTovvSarbicmTURbOokYuotVWQQA==",
"dev": true,
"requires": {
- "@lerna/child-process": "3.13.0",
- "@lerna/command": "3.13.1",
+ "@lerna/child-process": "3.13.3",
+ "@lerna/command": "3.13.3",
"@lerna/prompt": "3.13.0",
"@lerna/pulse-till-done": "3.13.0",
"@lerna/validation-error": "3.13.0",
@@ -1753,25 +1821,25 @@
}
},
"@lerna/init": {
- "version": "3.13.1",
- "resolved": "https://registry.npmjs.org/@lerna/init/-/init-3.13.1.tgz",
- "integrity": "sha512-M59WACqim8WkH5FQEGOCEZ89NDxCKBfFTx4ZD5ig3LkGyJ8RdcJq5KEfpW/aESuRE9JrZLzVr0IjKbZSxzwEMA==",
+ "version": "3.13.3",
+ "resolved": "https://registry.npmjs.org/@lerna/init/-/init-3.13.3.tgz",
+ "integrity": "sha512-bK/mp0sF6jT0N+c+xrbMCqN4xRoiZCXQzlYsyACxPK99KH/mpHv7hViZlTYUGlYcymtew6ZC770miv5A9wF9hA==",
"dev": true,
"requires": {
- "@lerna/child-process": "3.13.0",
- "@lerna/command": "3.13.1",
+ "@lerna/child-process": "3.13.3",
+ "@lerna/command": "3.13.3",
"fs-extra": "^7.0.0",
"p-map": "^1.2.0",
"write-json-file": "^2.3.0"
}
},
"@lerna/link": {
- "version": "3.13.1",
- "resolved": "https://registry.npmjs.org/@lerna/link/-/link-3.13.1.tgz",
- "integrity": "sha512-N3h3Fj1dcea+1RaAoAdy4g2m3fvU7m89HoUn5X/Zcw5n2kPoK8kTO+NfhNAatfRV8VtMXst8vbNrWQQtfm0FFw==",
+ "version": "3.13.3",
+ "resolved": "https://registry.npmjs.org/@lerna/link/-/link-3.13.3.tgz",
+ "integrity": "sha512-IHhtdhA0KlIdevCsq6WHkI2rF3lHWHziJs2mlrEWAKniVrFczbELON1KJAgdJS1k3kAP/WeWVqmIYZ2hJDxMvg==",
"dev": true,
"requires": {
- "@lerna/command": "3.13.1",
+ "@lerna/command": "3.13.3",
"@lerna/package-graph": "3.13.0",
"@lerna/symlink-dependencies": "3.13.0",
"p-map": "^1.2.0",
@@ -1787,13 +1855,13 @@
}
},
"@lerna/list": {
- "version": "3.13.1",
- "resolved": "https://registry.npmjs.org/@lerna/list/-/list-3.13.1.tgz",
- "integrity": "sha512-635iRbdgd9gNvYLLIbYdQCQLr+HioM5FGJLFS0g3DPGygr6iDR8KS47hzCRGH91LU9NcM1mD1RoT/AChF+QbiA==",
+ "version": "3.13.3",
+ "resolved": "https://registry.npmjs.org/@lerna/list/-/list-3.13.3.tgz",
+ "integrity": "sha512-rLRDsBCkydMq2FL6WY1J/elvnXIjxxRtb72lfKHdvDEqVdquT5Qgt9ci42hwjmcocFwWcFJgF6BZozj5pbc13A==",
"dev": true,
"requires": {
- "@lerna/command": "3.13.1",
- "@lerna/filter-options": "3.13.0",
+ "@lerna/command": "3.13.3",
+ "@lerna/filter-options": "3.13.3",
"@lerna/listable": "3.13.0",
"@lerna/output": "3.13.0"
}
@@ -1829,6 +1897,14 @@
"requires": {
"config-chain": "^1.1.11",
"pify": "^3.0.0"
+ },
+ "dependencies": {
+ "pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
+ "dev": true
+ }
}
},
"@lerna/npm-dist-tag": {
@@ -1844,12 +1920,12 @@
}
},
"@lerna/npm-install": {
- "version": "3.13.0",
- "resolved": "https://registry.npmjs.org/@lerna/npm-install/-/npm-install-3.13.0.tgz",
- "integrity": "sha512-qNyfts//isYQxore6fsPorNYJmPVKZ6tOThSH97tP0aV91zGMtrYRqlAoUnDwDdAjHPYEM16hNujg2wRmsqqIw==",
+ "version": "3.13.3",
+ "resolved": "https://registry.npmjs.org/@lerna/npm-install/-/npm-install-3.13.3.tgz",
+ "integrity": "sha512-7Jig9MLpwAfcsdQ5UeanAjndChUjiTjTp50zJ+UZz4CbIBIDhoBehvNMTCL2G6pOEC7sGEg6sAqJINAqred6Tg==",
"dev": true,
"requires": {
- "@lerna/child-process": "3.13.0",
+ "@lerna/child-process": "3.13.3",
"@lerna/get-npm-exec-opts": "3.13.0",
"fs-extra": "^7.0.0",
"npm-package-arg": "^6.1.0",
@@ -1859,27 +1935,36 @@
}
},
"@lerna/npm-publish": {
- "version": "3.13.0",
- "resolved": "https://registry.npmjs.org/@lerna/npm-publish/-/npm-publish-3.13.0.tgz",
- "integrity": "sha512-y4WO0XTaf9gNRkI7as6P2ItVDOxmYHwYto357fjybcnfXgMqEA94c3GJ++jU41j0A9vnmYC6/XxpTd9sVmH9tA==",
+ "version": "3.13.2",
+ "resolved": "https://registry.npmjs.org/@lerna/npm-publish/-/npm-publish-3.13.2.tgz",
+ "integrity": "sha512-HMucPyEYZfom5tRJL4GsKBRi47yvSS2ynMXYxL3kO0ie+j9J7cb0Ir8NmaAMEd3uJWJVFCPuQarehyfTDZsSxg==",
"dev": true,
"requires": {
"@lerna/run-lifecycle": "3.13.0",
"figgy-pudding": "^3.5.1",
"fs-extra": "^7.0.0",
"libnpmpublish": "^1.1.1",
+ "npm-package-arg": "^6.1.0",
"npmlog": "^4.1.2",
"pify": "^3.0.0",
"read-package-json": "^2.0.13"
+ },
+ "dependencies": {
+ "pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
+ "dev": true
+ }
}
},
"@lerna/npm-run-script": {
- "version": "3.13.0",
- "resolved": "https://registry.npmjs.org/@lerna/npm-run-script/-/npm-run-script-3.13.0.tgz",
- "integrity": "sha512-hiL3/VeVp+NFatBjkGN8mUdX24EfZx9rQlSie0CMgtjc7iZrtd0jCguLomSCRHYjJuvqgbp+LLYo7nHVykfkaQ==",
+ "version": "3.13.3",
+ "resolved": "https://registry.npmjs.org/@lerna/npm-run-script/-/npm-run-script-3.13.3.tgz",
+ "integrity": "sha512-qR4o9BFt5hI8Od5/DqLalOJydnKpiQFEeN0h9xZi7MwzuX1Ukwh3X22vqsX4YRbipIelSFtrDzleNVUm5jj0ow==",
"dev": true,
"requires": {
- "@lerna/child-process": "3.13.0",
+ "@lerna/child-process": "3.13.3",
"@lerna/get-npm-exec-opts": "3.13.0",
"npmlog": "^4.1.2"
}
@@ -1975,15 +2060,14 @@
},
"dependencies": {
"cosmiconfig": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.1.0.tgz",
- "integrity": "sha512-kCNPvthka8gvLtzAxQXvWo4FxqRB+ftRZyPZNuab5ngvM9Y7yw7hbEysglptLgpkGX9nAOKTBVkHUAe8xtYR6Q==",
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.0.tgz",
+ "integrity": "sha512-nxt+Nfc3JAqf4WIWd0jXLjTJZmsPLrA9DDc4nRw2KFJQJK7DNooqSXrNI7tzLG50CF8axczly5UV929tBmh/7g==",
"dev": true,
"requires": {
"import-fresh": "^2.0.0",
"is-directory": "^0.3.1",
- "js-yaml": "^3.9.0",
- "lodash.get": "^4.4.2",
+ "js-yaml": "^3.13.0",
"parse-json": "^4.0.0"
}
},
@@ -2069,9 +2153,9 @@
}
},
"inquirer": {
- "version": "6.2.2",
- "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.2.tgz",
- "integrity": "sha512-Z2rREiXA6cHRR9KBOarR3WuLlFzlIfAEIiB45ll5SSadMg7WqOh1MKEjjndfuH5ewXdixWCxqnVfGOQzPeiztA==",
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.3.1.tgz",
+ "integrity": "sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA==",
"dev": true,
"requires": {
"ansi-escapes": "^3.2.0",
@@ -2085,7 +2169,7 @@
"run-async": "^2.2.0",
"rxjs": "^6.4.0",
"string-width": "^2.1.0",
- "strip-ansi": "^5.0.0",
+ "strip-ansi": "^5.1.0",
"through": "^2.3.6"
}
},
@@ -2130,9 +2214,9 @@
}
},
"strip-ansi": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.1.0.tgz",
- "integrity": "sha512-TjxrkPONqO2Z8QDCpeE2j6n0M6EwxzyDgzEeGp+FbdvaJAt//ClYi6W5my+3ROlC/hZX2KACUwDfK49Ka5eDvg==",
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
+ "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
"dev": true,
"requires": {
"ansi-regex": "^4.1.0"
@@ -2141,21 +2225,21 @@
}
},
"@lerna/publish": {
- "version": "3.13.1",
- "resolved": "https://registry.npmjs.org/@lerna/publish/-/publish-3.13.1.tgz",
- "integrity": "sha512-KhCJ9UDx76HWCF03i5TD7z5lX+2yklHh5SyO8eDaLptgdLDQ0Z78lfGj3JhewHU2l46FztmqxL/ss0IkWHDL+g==",
+ "version": "3.13.4",
+ "resolved": "https://registry.npmjs.org/@lerna/publish/-/publish-3.13.4.tgz",
+ "integrity": "sha512-v03pabiPlqCDwX6cVNis1PDdT6/jBgkVb5Nl4e8wcJXevIhZw3ClvtI94gSZu/wdoVFX0RMfc8QBVmaimSO0qg==",
"dev": true,
"requires": {
"@lerna/batch-packages": "3.13.0",
- "@lerna/check-working-tree": "3.13.0",
- "@lerna/child-process": "3.13.0",
- "@lerna/collect-updates": "3.13.0",
- "@lerna/command": "3.13.1",
- "@lerna/describe-ref": "3.13.0",
+ "@lerna/check-working-tree": "3.13.3",
+ "@lerna/child-process": "3.13.3",
+ "@lerna/collect-updates": "3.13.3",
+ "@lerna/command": "3.13.3",
+ "@lerna/describe-ref": "3.13.3",
"@lerna/log-packed": "3.13.0",
"@lerna/npm-conf": "3.13.0",
"@lerna/npm-dist-tag": "3.13.0",
- "@lerna/npm-publish": "3.13.0",
+ "@lerna/npm-publish": "3.13.2",
"@lerna/output": "3.13.0",
"@lerna/pack-directory": "3.13.1",
"@lerna/prompt": "3.13.0",
@@ -2163,7 +2247,7 @@
"@lerna/run-lifecycle": "3.13.0",
"@lerna/run-parallel-batches": "3.13.0",
"@lerna/validation-error": "3.13.0",
- "@lerna/version": "3.13.1",
+ "@lerna/version": "3.13.4",
"figgy-pudding": "^3.5.1",
"fs-extra": "^7.0.0",
"libnpmaccess": "^3.0.1",
@@ -2199,27 +2283,27 @@
}
},
"@lerna/rimraf-dir": {
- "version": "3.13.0",
- "resolved": "https://registry.npmjs.org/@lerna/rimraf-dir/-/rimraf-dir-3.13.0.tgz",
- "integrity": "sha512-kte+pMemulre8cmPqljxIYjCmdLByz8DgHBHXB49kz2EiPf8JJ+hJFt0PzEubEyJZ2YE2EVAx5Tv5+NfGNUQyQ==",
+ "version": "3.13.3",
+ "resolved": "https://registry.npmjs.org/@lerna/rimraf-dir/-/rimraf-dir-3.13.3.tgz",
+ "integrity": "sha512-d0T1Hxwu3gpYVv73ytSL+/Oy8JitsmvOYUR5ouRSABsmqS7ZZCh5t6FgVDDGVXeuhbw82+vuny1Og6Q0k4ilqw==",
"dev": true,
"requires": {
- "@lerna/child-process": "3.13.0",
+ "@lerna/child-process": "3.13.3",
"npmlog": "^4.1.2",
"path-exists": "^3.0.0",
"rimraf": "^2.6.2"
}
},
"@lerna/run": {
- "version": "3.13.1",
- "resolved": "https://registry.npmjs.org/@lerna/run/-/run-3.13.1.tgz",
- "integrity": "sha512-nv1oj7bsqppWm1M4ifN+/IIbVu9F4RixrbQD2okqDGYne4RQPAXyb5cEZuAzY/wyGTWWiVaZ1zpj5ogPWvH0bw==",
+ "version": "3.13.3",
+ "resolved": "https://registry.npmjs.org/@lerna/run/-/run-3.13.3.tgz",
+ "integrity": "sha512-ygnLIfIYS6YY1JHWOM4CsdZiY8kTYPsDFOLAwASlRnlAXF9HiMT08GFXLmMHIblZJ8yJhsM2+QgraCB0WdxzOQ==",
"dev": true,
"requires": {
"@lerna/batch-packages": "3.13.0",
- "@lerna/command": "3.13.1",
- "@lerna/filter-options": "3.13.0",
- "@lerna/npm-run-script": "3.13.0",
+ "@lerna/command": "3.13.3",
+ "@lerna/filter-options": "3.13.3",
+ "@lerna/npm-run-script": "3.13.3",
"@lerna/output": "3.13.0",
"@lerna/run-parallel-batches": "3.13.0",
"@lerna/timer": "3.13.0",
@@ -2292,18 +2376,18 @@
}
},
"@lerna/version": {
- "version": "3.13.1",
- "resolved": "https://registry.npmjs.org/@lerna/version/-/version-3.13.1.tgz",
- "integrity": "sha512-WpfKc5jZBBOJ6bFS4atPJEbHSiywQ/Gcd+vrwaEGyQHWHQZnPTvhqLuq3q9fIb9sbuhH5pSY6eehhuBrKqTnjg==",
+ "version": "3.13.4",
+ "resolved": "https://registry.npmjs.org/@lerna/version/-/version-3.13.4.tgz",
+ "integrity": "sha512-pptWUEgN/lUTQZu34+gfH1g4Uhs7TDKRcdZY9A4T9k6RTOwpKC2ceLGiXdeR+ZgQJAey2C4qiE8fo5Z6Rbc6QA==",
"dev": true,
"requires": {
"@lerna/batch-packages": "3.13.0",
- "@lerna/check-working-tree": "3.13.0",
- "@lerna/child-process": "3.13.0",
- "@lerna/collect-updates": "3.13.0",
- "@lerna/command": "3.13.1",
+ "@lerna/check-working-tree": "3.13.3",
+ "@lerna/child-process": "3.13.3",
+ "@lerna/collect-updates": "3.13.3",
+ "@lerna/command": "3.13.3",
"@lerna/conventional-commits": "3.13.0",
- "@lerna/github-client": "3.13.1",
+ "@lerna/github-client": "3.13.3",
"@lerna/output": "3.13.0",
"@lerna/prompt": "3.13.0",
"@lerna/run-lifecycle": "3.13.0",
@@ -2367,44 +2451,79 @@
"dev": true
},
"@octokit/endpoint": {
- "version": "3.2.3",
- "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-3.2.3.tgz",
- "integrity": "sha512-yUPCt4vMIOclox13CUxzuKiPJIFo46b/6GhUnUTw5QySczN1L0DtSxgmIZrZV4SAb9EyAqrceoyrWoYVnfF2AA==",
+ "version": "4.2.2",
+ "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-4.2.2.tgz",
+ "integrity": "sha512-5IZjkUNhx5q0IRN7Juwf5A+Lu2qAso7ULST7C1P2mbGHePuCOk936Stcl/5GdJpB3ovD8M6/Lv3xra6Mn0IKNQ==",
"dev": true,
"requires": {
"deepmerge": "3.2.0",
- "is-plain-object": "^2.0.4",
+ "is-plain-object": "^3.0.0",
"universal-user-agent": "^2.0.1",
"url-template": "^2.0.8"
+ },
+ "dependencies": {
+ "is-plain-object": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz",
+ "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==",
+ "dev": true,
+ "requires": {
+ "isobject": "^4.0.0"
+ }
+ },
+ "isobject": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz",
+ "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==",
+ "dev": true
+ }
}
},
"@octokit/plugin-enterprise-rest": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-2.2.1.tgz",
- "integrity": "sha512-Ssrh5D5uOqeS/Kjs6bbzn4ZaaaZQ2h6X/DgoDVv0Goa2ncpHwBN644hfYOL5ycigkpYbHKTjyb6cM49kPwQRPA==",
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-2.2.2.tgz",
+ "integrity": "sha512-CTZr64jZYhGWNTDGlSJ2mvIlFsm9OEO3LqWn9I/gmoHI4jRBp4kpHoFYNemG4oA75zUAcmbuWblb7jjP877YZw==",
"dev": true
},
"@octokit/request": {
- "version": "2.4.2",
- "resolved": "https://registry.npmjs.org/@octokit/request/-/request-2.4.2.tgz",
- "integrity": "sha512-lxVlYYvwGbKSHXfbPk5vxEA8w4zHOH1wobado4a9EfsyD3Cbhuhus1w0Ye9Ro0eMubGO8kNy5d+xNFisM3Tvaw==",
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/@octokit/request/-/request-3.0.1.tgz",
+ "integrity": "sha512-aH61OVkMKMofGW/go2x4mJ44X4U/JF8xsiFFictwkZYtz0psE8OPKpsP2TZBZaJoCg2wmeTyEgqGfY+veg0hGQ==",
"dev": true,
"requires": {
- "@octokit/endpoint": "^3.2.0",
+ "@octokit/endpoint": "^4.0.0",
"deprecation": "^1.0.1",
- "is-plain-object": "^2.0.4",
+ "is-plain-object": "^3.0.0",
"node-fetch": "^2.3.0",
"once": "^1.4.0",
"universal-user-agent": "^2.0.1"
+ },
+ "dependencies": {
+ "is-plain-object": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz",
+ "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==",
+ "dev": true,
+ "requires": {
+ "isobject": "^4.0.0"
+ }
+ },
+ "isobject": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz",
+ "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==",
+ "dev": true
+ }
}
},
"@octokit/rest": {
- "version": "16.18.1",
- "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.18.1.tgz",
- "integrity": "sha512-ozKUH4KCusmPQ6xHxF2q1IDVM5tPbmmAUP69yRLd98BH16mqOVwMkm6zLCUJPD03IVhG+YNHShJDc077CTkIWg==",
+ "version": "16.25.2",
+ "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.25.2.tgz",
+ "integrity": "sha512-aUSzvY33dz6RMLLmT+1aNc2OvvAmDfdXKaOzFEEBNJjsjckNjWkB2hgGa5plnnbuLPCloVldPuAdm+8REZGLcg==",
"dev": true,
"requires": {
- "@octokit/request": "2.4.2",
+ "@octokit/request": "3.0.1",
+ "atob-lite": "^2.0.0",
"before-after-hook": "^1.4.0",
"btoa-lite": "^1.0.0",
"deprecation": "^1.0.1",
@@ -2427,9 +2546,9 @@
}
},
"@types/babel__core": {
- "version": "7.1.0",
- "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.0.tgz",
- "integrity": "sha512-wJTeJRt7BToFx3USrCDs2BhEi4ijBInTQjOIukj6a/5tEkwpFMVZ+1ppgmE+Q/FQyc5P/VWUbx7I9NELrKruHA==",
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.1.tgz",
+ "integrity": "sha512-+hjBtgcFPYyCTo0A15+nxrCVJL7aC6Acg87TXd5OW3QhHswdrOLoles+ldL2Uk8q++7yIfl4tURtztccdeeyOw==",
"dev": true,
"requires": {
"@babel/parser": "^7.1.0",
@@ -2509,9 +2628,9 @@
"dev": true
},
"@types/istanbul-lib-coverage": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.0.tgz",
- "integrity": "sha512-ohkhb9LehJy+PA40rDtGAji61NCgdtKLAlFoYp4cnuuQEswwdK3vz9SOIkkyc3wrk8dzjphQApNs56yyXLStaQ==",
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz",
+ "integrity": "sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg==",
"dev": true
},
"@types/jest": {
@@ -2539,15 +2658,15 @@
"dev": true
},
"@types/node": {
- "version": "10.14.1",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.1.tgz",
- "integrity": "sha512-Rymt08vh1GaW4vYB6QP61/5m/CFLGnFZP++bJpWbiNxceNa6RBipDmb413jvtSf/R1gg5a/jQVl2jY4XVRscEA==",
+ "version": "10.14.6",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.6.tgz",
+ "integrity": "sha512-Fvm24+u85lGmV4hT5G++aht2C5I4Z4dYlWZIh62FAfFO/TfzXtPpoLI6I7AuBWkIFqZCnhFOoTT7RjjaIL5Fjg==",
"dev": true
},
"@types/shelljs": {
- "version": "0.8.3",
- "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.8.3.tgz",
- "integrity": "sha512-miY41hqc5SkRlsZDod3heDa4OS9xv8G77EMBQuSpqq86HBn66l7F+f8y9YKm+1PIuwC8QEZVwN8YxOOG7Y67fA==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.8.5.tgz",
+ "integrity": "sha512-bZgjwIWu9gHCjirKJoOlLzGi5N0QgZ5t7EXEuoqyWCHTuSddURXo3FOBYDyRPNOWzZ6NbkLvZnVkn483Y/tvcQ==",
"dev": true,
"requires": {
"@types/glob": "*",
@@ -2561,11 +2680,54 @@
"dev": true
},
"@types/yargs": {
- "version": "12.0.9",
- "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-12.0.9.tgz",
- "integrity": "sha512-sCZy4SxP9rN2w30Hlmg5dtdRwgYQfYRiLo9usw8X9cxlf+H4FqM1xX7+sNH7NNKVdbXMJWqva7iyy+fxh/V7fA==",
+ "version": "12.0.12",
+ "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-12.0.12.tgz",
+ "integrity": "sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw==",
"dev": true
},
+ "@typescript-eslint/eslint-plugin": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.7.0.tgz",
+ "integrity": "sha512-NUSz1aTlIzzTjFFVFyzrbo8oFjHg3K/M9MzYByqbMCxeFdErhLAcGITVfXzSz+Yvp5OOpMu3HkIttB0NyKl54Q==",
+ "dev": true,
+ "requires": {
+ "@typescript-eslint/parser": "1.7.0",
+ "@typescript-eslint/typescript-estree": "1.7.0",
+ "eslint-utils": "^1.3.1",
+ "regexpp": "^2.0.1",
+ "requireindex": "^1.2.0",
+ "tsutils": "^3.7.0"
+ }
+ },
+ "@typescript-eslint/parser": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-1.7.0.tgz",
+ "integrity": "sha512-1QFKxs2V940372srm12ovSE683afqc1jB6zF/f8iKhgLz1yoSjYeGHipasao33VXKI+0a/ob9okeogGdKGvvlg==",
+ "dev": true,
+ "requires": {
+ "@typescript-eslint/typescript-estree": "1.7.0",
+ "eslint-scope": "^4.0.0",
+ "eslint-visitor-keys": "^1.0.0"
+ }
+ },
+ "@typescript-eslint/typescript-estree": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-1.7.0.tgz",
+ "integrity": "sha512-K5uedUxVmlYrVkFbyV3htDipvLqTE3QMOUQEHYJaKtgzxj6r7c5Ca/DG1tGgFxX+fsbi9nDIrf4arq7Ib7H/Yw==",
+ "dev": true,
+ "requires": {
+ "lodash.unescape": "4.0.1",
+ "semver": "5.5.0"
+ },
+ "dependencies": {
+ "semver": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
+ "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==",
+ "dev": true
+ }
+ }
+ },
"@webassemblyjs/ast": {
"version": "1.8.5",
"resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz",
@@ -2777,13 +2939,13 @@
"dev": true
},
"accepts": {
- "version": "1.3.5",
- "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz",
- "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=",
+ "version": "1.3.7",
+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
+ "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==",
"dev": true,
"requires": {
- "mime-types": "~2.1.18",
- "negotiator": "0.6.1"
+ "mime-types": "~2.1.24",
+ "negotiator": "0.6.2"
}
},
"acorn": {
@@ -2799,9 +2961,9 @@
"dev": true
},
"acorn-globals": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.0.tgz",
- "integrity": "sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw==",
+ "version": "4.3.2",
+ "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.2.tgz",
+ "integrity": "sha512-BbzvZhVtZP+Bs1J1HcwrQe8ycfO0wStkSGxuul3He3GkHOIZ6eTqOkPuw9IP1X3+IkOo4wiJmwkobzXYz4wewQ==",
"dev": true,
"requires": {
"acorn": "^6.0.1",
@@ -2936,6 +3098,12 @@
"integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==",
"dev": true
},
+ "archy": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz",
+ "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=",
+ "dev": true
+ },
"are-we-there-yet": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz",
@@ -3128,9 +3296,9 @@
}
},
"async-each": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.2.tgz",
- "integrity": "sha512-6xrbvN0MOBKSJDdonmSSz2OwFSgxRaVtBDes26mj9KIGtDo+g9xosFRSC+i1gQh2oAN/tQ62AI/pGZGQjVOiRg==",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz",
+ "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==",
"dev": true
},
"async-limiter": {
@@ -3150,6 +3318,12 @@
"resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz",
"integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg=="
},
+ "atob-lite": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/atob-lite/-/atob-lite-2.0.0.tgz",
+ "integrity": "sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY=",
+ "dev": true
+ },
"aws-sign2": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
@@ -3359,16 +3533,16 @@
}
},
"babel-jest": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.5.0.tgz",
- "integrity": "sha512-0fKCXyRwxFTJL0UXDJiT2xYxO9Lu2vBd9n+cC+eDjESzcVG3s2DRGAxbzJX21fceB1WYoBjAh8pQ83dKcl003g==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.7.1.tgz",
+ "integrity": "sha512-GPnLqfk8Mtt0i4OemjWkChi73A3ALs4w2/QbG64uAj8b5mmwzxc7jbJVRZt8NJkxi6FopVHog9S3xX6UJKb2qg==",
"dev": true,
"requires": {
- "@jest/transform": "^24.5.0",
- "@jest/types": "^24.5.0",
+ "@jest/transform": "^24.7.1",
+ "@jest/types": "^24.7.0",
"@types/babel__core": "^7.1.0",
"babel-plugin-istanbul": "^5.1.0",
- "babel-preset-jest": "^24.3.0",
+ "babel-preset-jest": "^24.6.0",
"chalk": "^2.4.2",
"slash": "^2.0.0"
}
@@ -3392,20 +3566,20 @@
}
},
"babel-plugin-istanbul": {
- "version": "5.1.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.1.tgz",
- "integrity": "sha512-RNNVv2lsHAXJQsEJ5jonQwrJVWK8AcZpG1oxhnjCUaAjL7xahYLANhPUZbzEQHjKy1NMYUwn+0NPKQc8iSY4xQ==",
+ "version": "5.1.4",
+ "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.4.tgz",
+ "integrity": "sha512-dySz4VJMH+dpndj0wjJ8JPs/7i1TdSPb1nRrn56/92pKOF9VKC1FMFJmMXjzlGGusnCAqujP6PBCiKq0sVA+YQ==",
"dev": true,
"requires": {
"find-up": "^3.0.0",
- "istanbul-lib-instrument": "^3.0.0",
- "test-exclude": "^5.0.0"
+ "istanbul-lib-instrument": "^3.3.0",
+ "test-exclude": "^5.2.3"
}
},
"babel-plugin-jest-hoist": {
- "version": "24.3.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.3.0.tgz",
- "integrity": "sha512-nWh4N1mVH55Tzhx2isvUN5ebM5CDUvIpXPZYMRazQughie/EqGnbR+czzoQlhUmJG9pPJmYDRhvocotb2THl1w==",
+ "version": "24.6.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.6.0.tgz",
+ "integrity": "sha512-3pKNH6hMt9SbOv0F3WVmy5CWQ4uogS3k0GY5XLyQHJ9EGpAT9XWkFd2ZiXXtkwFHdAHa5j7w7kfxSP5lAIwu7w==",
"dev": true,
"requires": {
"@types/babel__traverse": "^7.0.6"
@@ -3762,6 +3936,12 @@
"regenerator-runtime": "^0.10.5"
},
"dependencies": {
+ "core-js": {
+ "version": "2.6.5",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz",
+ "integrity": "sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==",
+ "dev": true
+ },
"regenerator-runtime": {
"version": "0.10.5",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz",
@@ -3821,13 +4001,13 @@
}
},
"babel-preset-jest": {
- "version": "24.3.0",
- "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-24.3.0.tgz",
- "integrity": "sha512-VGTV2QYBa/Kn3WCOKdfS31j9qomaXSgJqi65B6o05/1GsJyj9LVhSljM9ro4S+IBGj/ENhNBuH9bpqzztKAQSw==",
+ "version": "24.6.0",
+ "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-24.6.0.tgz",
+ "integrity": "sha512-pdZqLEdmy1ZK5kyRUfvBb2IfTPb2BUvIJczlPspS8fWmBQslNNDBqVfh7BW5leOVJMDZKzjD8XEyABTk6gQ5yw==",
"dev": true,
"requires": {
"@babel/plugin-syntax-object-rest-spread": "^7.0.0",
- "babel-plugin-jest-hoist": "^24.3.0"
+ "babel-plugin-jest-hoist": "^24.6.0"
}
},
"babel-runtime": {
@@ -3838,6 +4018,14 @@
"requires": {
"core-js": "^2.4.0",
"regenerator-runtime": "^0.11.0"
+ },
+ "dependencies": {
+ "core-js": {
+ "version": "2.6.5",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz",
+ "integrity": "sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==",
+ "dev": true
+ }
}
},
"babel-template": {
@@ -3993,9 +4181,9 @@
"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ=="
},
"binary-extensions": {
- "version": "1.13.0",
- "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.0.tgz",
- "integrity": "sha512-EgmjVLMn22z7eGGv3kcnHwSnJXmFHjISTY9E/S5lIcTD3Oxw05QTcBLNkJFzcb3cNueUdF/IN4U+d78V0zO8Hw==",
+ "version": "1.13.1",
+ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz",
+ "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==",
"dev": true
},
"bl": {
@@ -4035,9 +4223,9 @@
}
},
"bluebird": {
- "version": "3.5.3",
- "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz",
- "integrity": "sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw==",
+ "version": "3.5.4",
+ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.4.tgz",
+ "integrity": "sha512-FG+nFEZChJrbQ9tIccIfZJBz3J7mLrAhxakAbnrJWn8d7aKOC+LWifa0G+p4ZqKp4y13T7juYvdhq9NzKdsrjw==",
"dev": true
},
"bn.js": {
@@ -4249,14 +4437,14 @@
}
},
"browserslist": {
- "version": "4.4.2",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz",
- "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==",
+ "version": "4.5.6",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.5.6.tgz",
+ "integrity": "sha512-o/hPOtbU9oX507lIqon+UvPYqpx3mHc8cV3QemSBTXwkG8gSQSK6UKvXcE/DcleU3+A59XTUHyCvZ5qGy8xVAg==",
"dev": true,
"requires": {
- "caniuse-lite": "^1.0.30000939",
- "electron-to-chromium": "^1.3.113",
- "node-releases": "^1.1.8"
+ "caniuse-lite": "^1.0.30000963",
+ "electron-to-chromium": "^1.3.127",
+ "node-releases": "^1.1.17"
}
},
"bs-logger": {
@@ -4334,12 +4522,6 @@
"integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=",
"dev": true
},
- "builtin-modules": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
- "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=",
- "dev": true
- },
"builtin-status-codes": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz",
@@ -4449,6 +4631,31 @@
"integrity": "sha512-xGBpPqoBvn3unBW7oxgb8aJn42K0m9m1/wyjmazah10Fq7bROGG3kRAE6OIyr3U3PIJUqGuebhCEdMk9OKJG0A==",
"dev": true
},
+ "caching-transform": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-3.0.2.tgz",
+ "integrity": "sha512-Mtgcv3lh3U0zRii/6qVgQODdPA4G3zhG+jtbCWj39RXuUFTMzH0vcdMtaJS1jPowd+It2Pqr6y3NJMQqOqCE2w==",
+ "dev": true,
+ "requires": {
+ "hasha": "^3.0.0",
+ "make-dir": "^2.0.0",
+ "package-hash": "^3.0.0",
+ "write-file-atomic": "^2.4.2"
+ },
+ "dependencies": {
+ "write-file-atomic": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.2.tgz",
+ "integrity": "sha512-s0b6vB3xIVRLWywa6X9TOMA7k9zio0TMOsl9ZnDkliA/cfJlpHXAscj0gbHVJiTdIuAYpIyqS5GW91fqm6gG5g==",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "^4.1.11",
+ "imurmurhash": "^0.1.4",
+ "signal-exit": "^3.0.2"
+ }
+ }
+ }
+ },
"call-me-maybe": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz",
@@ -4482,15 +4689,15 @@
}
},
"callsites": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.0.0.tgz",
- "integrity": "sha512-tWnkwu9YEq2uzlBDI4RcLn8jrFvF9AOi8PxDNU3hZZjJcjkcRAq3vCI+vZcg1SuxISDYe86k9VZFwAxDiJGoAw==",
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
+ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
"dev": true
},
"camelcase": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.2.0.tgz",
- "integrity": "sha512-IXFsBS2pC+X0j0N/GE7Dm7j3bsEBp+oTpb7F50dwEVX7rf3IgwO9XatnegTsDtniKCUtEJH4fSU6Asw7uoVLfQ=="
+ "version": "5.3.1",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
+ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg=="
},
"camelcase-keys": {
"version": "4.2.0",
@@ -4512,9 +4719,9 @@
}
},
"caniuse-lite": {
- "version": "1.0.30000948",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000948.tgz",
- "integrity": "sha512-Lw4y7oz1X5MOMZm+2IFaSISqVVQvUuD+ZUSfeYK/SlYiMjkHN/eJ2PDfJehW5NA6JjrxYSSnIWfwjeObQMEjFQ==",
+ "version": "1.0.30000966",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000966.tgz",
+ "integrity": "sha512-qqLQ/uYrpZmFhPY96VuBkMEo8NhVFBZ9y/Bh+KnvGzGJ5I8hvpIaWlF2pw5gqe4PLAL+ZjsPgMOvoXSpX21Keg==",
"dev": true
},
"capture-exit": {
@@ -4549,9 +4756,9 @@
"dev": true
},
"chokidar": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.2.tgz",
- "integrity": "sha512-IwXUx0FXc5ibYmPC2XeEj5mpXoV66sR+t3jqu2NS2GYwCktt3KF1/Qqjws/NkegajBA4RbZ5+DDwlOiJsxDHEg==",
+ "version": "2.1.5",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.5.tgz",
+ "integrity": "sha512-i0TprVWp+Kj4WRPtInjexJ8Q+BqTE909VpH8xVhXrJkoc5QC8VO9TryGOqTr+2hljzc1sC62t22h5tZePodM/A==",
"dev": true,
"requires": {
"anymatch": "^2.0.0",
@@ -4565,13 +4772,13 @@
"normalize-path": "^3.0.0",
"path-is-absolute": "^1.0.0",
"readdirp": "^2.2.1",
- "upath": "^1.1.0"
+ "upath": "^1.1.1"
},
"dependencies": {
"is-glob": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz",
- "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
+ "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
"dev": true,
"requires": {
"is-extglob": "^2.1.1"
@@ -4601,9 +4808,9 @@
}
},
"ci-env": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/ci-env/-/ci-env-1.7.0.tgz",
- "integrity": "sha512-ifHfV5JmACoTnoPxwjKjUUAekL1UCKZ9EU27GaaSkLVopkV3H1w0eYIpY+aAiX31SVEtTrZFMS94EFETSj0vIA==",
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/ci-env/-/ci-env-1.8.0.tgz",
+ "integrity": "sha512-OKShe5VZpuvVfJhiadgix/+lnOVJIcNLdLOrUwbllNfvHPAQzJxuNjefH3xfw3yHxAV8CDbLqXT9C4ygDtg8ow==",
"dev": true
},
"ci-info": {
@@ -4755,9 +4962,9 @@
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
},
"codecov": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.2.0.tgz",
- "integrity": "sha512-3NJvNARXxilqnqVfgzDHyVrF4oeVgaYW1c1O6Oi5mn93exE7HTSSFNiYdwojWW6IwrCZABJ8crpNbKoo9aUHQw==",
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.3.0.tgz",
+ "integrity": "sha512-S70c3Eg9SixumOvxaKE/yKUxb9ihu/uebD9iPO2IR73IdP4i6ZzjXEULj3d0HeyWPr0DqBfDkjNBWxURjVO5hw==",
"dev": true,
"requires": {
"argv": "^0.0.2",
@@ -4826,15 +5033,15 @@
}
},
"commander": {
- "version": "2.19.0",
- "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz",
- "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==",
+ "version": "2.20.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz",
+ "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==",
"dev": true
},
"commitizen": {
- "version": "3.0.7",
- "resolved": "https://registry.npmjs.org/commitizen/-/commitizen-3.0.7.tgz",
- "integrity": "sha512-2j8E8Ik1pe1Jqy1gQ1SzEZDJCdr0ItjvhbXmDqhz186Q3ukRoQHMBkmCqmsFYmfDmchBkrOXV1239mTeXEPJKQ==",
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/commitizen/-/commitizen-3.1.1.tgz",
+ "integrity": "sha512-n5pnG8sNM5a3dS3Kkh3rYr+hFdPWZlqV6pfz6KGLmWV/gsIiTqAwhTgFKkcF/paKUpfIMp0x4YZlD0xLBNTW9g==",
"dev": true,
"requires": {
"cachedir": "2.1.0",
@@ -4986,30 +5193,30 @@
"dev": true
},
"component-emitter": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz",
- "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY="
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
+ "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg=="
},
"compressible": {
- "version": "2.0.16",
- "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.16.tgz",
- "integrity": "sha512-JQfEOdnI7dASwCuSPWIeVYwc/zMsu/+tRhoUvEfXz2gxOA2DNjmG5vhtFdBlhWPPGo+RdT9S3tgc/uH5qgDiiA==",
+ "version": "2.0.17",
+ "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.17.tgz",
+ "integrity": "sha512-BGHeLCK1GV7j1bSmQQAi26X+GgWcTjLr/0tzSvMCl3LH1w1IJ4PFSPoV5316b30cneTziC+B1a+3OjoSUcQYmw==",
"dev": true,
"requires": {
- "mime-db": ">= 1.38.0 < 2"
+ "mime-db": ">= 1.40.0 < 2"
}
},
"compression": {
- "version": "1.7.3",
- "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.3.tgz",
- "integrity": "sha512-HSjyBG5N1Nnz7tF2+O7A9XUhyjru71/fwgNb7oIsEVHR0WShfs2tIS/EySLgiTe98aOK18YDlMXpzjCXY/n9mg==",
+ "version": "1.7.4",
+ "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz",
+ "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==",
"dev": true,
"requires": {
"accepts": "~1.3.5",
"bytes": "3.0.0",
- "compressible": "~2.0.14",
+ "compressible": "~2.0.16",
"debug": "2.6.9",
- "on-headers": "~1.0.1",
+ "on-headers": "~1.0.2",
"safe-buffer": "5.1.2",
"vary": "~1.1.2"
},
@@ -5107,21 +5314,22 @@
"dev": true
},
"conventional-changelog": {
- "version": "3.0.6",
- "resolved": "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-3.0.6.tgz",
- "integrity": "sha512-1b96x3G67lDKakRvMm+VvYGwgRk+C8aapHKL5iZ/TJzzD/RuyGA2diHNEsR+uPHmQ7/A4Ts7j6N+VNqUoOfksg==",
+ "version": "3.1.4",
+ "resolved": "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-3.1.4.tgz",
+ "integrity": "sha512-uMeTSzEb2oKFlL00Oh9j3+00PFq1MNneLzyy0TBftxo4PFrs7OiaRJXmXtEgSvJDdkc0RSd6ch2N+yTxPagZ0A==",
"dev": true,
"requires": {
"conventional-changelog-angular": "^5.0.3",
"conventional-changelog-atom": "^2.0.1",
"conventional-changelog-codemirror": "^2.0.1",
- "conventional-changelog-core": "^3.1.6",
+ "conventional-changelog-conventionalcommits": "^1.1.2",
+ "conventional-changelog-core": "^3.2.2",
"conventional-changelog-ember": "^2.0.2",
- "conventional-changelog-eslint": "^3.0.1",
+ "conventional-changelog-eslint": "^3.0.2",
"conventional-changelog-express": "^2.0.1",
"conventional-changelog-jquery": "^3.0.4",
"conventional-changelog-jshint": "^2.0.1",
- "conventional-changelog-preset-loader": "^2.0.2"
+ "conventional-changelog-preset-loader": "^2.1.1"
},
"dependencies": {
"conventional-changelog-angular": {
@@ -5156,13 +5364,13 @@
}
},
"conventional-changelog-cli": {
- "version": "2.0.12",
- "resolved": "https://registry.npmjs.org/conventional-changelog-cli/-/conventional-changelog-cli-2.0.12.tgz",
- "integrity": "sha512-6wh9W5Gpr9DM40E8cFi0qa6JotVm4Jq+suksuqgKnm544H8ZXsRhgGNXShDASOteY9brv9fX8/+fE/QL1wHqbA==",
+ "version": "2.0.17",
+ "resolved": "https://registry.npmjs.org/conventional-changelog-cli/-/conventional-changelog-cli-2.0.17.tgz",
+ "integrity": "sha512-IQUS08TTrLxAd0Le3THPz8xFFe1kVmSBOcnfe8RGpi+io3ALnMT4uw0snmP3Cb9lgnHXg0NcjQyVsE+jJmHtrw==",
"dev": true,
"requires": {
"add-stream": "^1.0.0",
- "conventional-changelog": "^3.0.6",
+ "conventional-changelog": "^3.1.4",
"lodash": "^4.2.1",
"meow": "^4.0.0",
"tempfile": "^1.1.1"
@@ -5196,14 +5404,24 @@
"q": "^1.5.1"
}
},
+ "conventional-changelog-conventionalcommits": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-1.1.2.tgz",
+ "integrity": "sha512-t8VyibJHGrtsDwSHjgpW9v7oBbqDGQooCMo/a2rc0z5cousV5O11palcSPpyshEVWVijxPtzBNG02EQkMDJ8CA==",
+ "dev": true,
+ "requires": {
+ "compare-func": "^1.3.1",
+ "q": "^1.5.1"
+ }
+ },
"conventional-changelog-core": {
- "version": "3.1.6",
- "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-3.1.6.tgz",
- "integrity": "sha512-5teTAZOtJ4HLR6384h50nPAaKdDr+IaU0rnD2Gg2C3MS7hKsEPH8pZxrDNqam9eOSPQg9tET6uZY79zzgSz+ig==",
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-3.2.2.tgz",
+ "integrity": "sha512-cssjAKajxaOX5LNAJLB+UOcoWjAIBvXtDMedv/58G+YEmAXMNfC16mmPl0JDOuVJVfIqM0nqQiZ8UCm8IXbE0g==",
"dev": true,
"requires": {
- "conventional-changelog-writer": "^4.0.3",
- "conventional-commits-parser": "^3.0.1",
+ "conventional-changelog-writer": "^4.0.5",
+ "conventional-commits-parser": "^3.0.2",
"dateformat": "^3.0.0",
"get-pkg-repo": "^1.0.0",
"git-raw-commits": "2.0.0",
@@ -5214,13 +5432,13 @@
"q": "^1.5.1",
"read-pkg": "^3.0.0",
"read-pkg-up": "^3.0.0",
- "through2": "^2.0.0"
+ "through2": "^3.0.0"
},
"dependencies": {
"conventional-commits-parser": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.0.1.tgz",
- "integrity": "sha512-P6U5UOvDeidUJ8ebHVDIoXzI7gMlQ1OF/id6oUvp8cnZvOXMt1n8nYl74Ey9YMn0uVQtxmCtjPQawpsssBWtGg==",
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.0.2.tgz",
+ "integrity": "sha512-y5eqgaKR0F6xsBNVSQ/5cI5qIF3MojddSUi1vKIggRkqUTbkqFKH9P5YX/AT1BVZp9DtSzBTIkvjyVLotLsVog==",
"dev": true,
"requires": {
"JSONStream": "^1.0.4",
@@ -5228,7 +5446,7 @@
"lodash": "^4.2.1",
"meow": "^4.0.0",
"split2": "^2.0.0",
- "through2": "^2.0.0",
+ "through2": "^3.0.0",
"trim-off-newlines": "^1.0.0"
}
},
@@ -5243,6 +5461,33 @@
"meow": "^4.0.0",
"split2": "^2.0.0",
"through2": "^2.0.0"
+ },
+ "dependencies": {
+ "readable-stream": {
+ "version": "2.3.6",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
+ "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
+ "dev": true,
+ "requires": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "through2": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz",
+ "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==",
+ "dev": true,
+ "requires": {
+ "readable-stream": "~2.3.6",
+ "xtend": "~4.0.1"
+ }
+ }
}
},
"meow": {
@@ -5261,6 +5506,15 @@
"redent": "^2.0.0",
"trim-newlines": "^2.0.0"
}
+ },
+ "through2": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz",
+ "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==",
+ "dev": true,
+ "requires": {
+ "readable-stream": "2 || 3"
+ }
}
}
},
@@ -5274,9 +5528,9 @@
}
},
"conventional-changelog-eslint": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/conventional-changelog-eslint/-/conventional-changelog-eslint-3.0.1.tgz",
- "integrity": "sha512-yH3+bYrtvgKxSFChUBQnKNh9/U9kN2JElYBm253VpYs5wXhPHVc9ENcuVGWijh24nnOkei7wEJmnmUzgZ4ok+A==",
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/conventional-changelog-eslint/-/conventional-changelog-eslint-3.0.2.tgz",
+ "integrity": "sha512-Yi7tOnxjZLXlCYBHArbIAm8vZ68QUSygFS7PgumPRiEk+9NPUeucy5Wg9AAyKoBprSV3o6P7Oghh4IZSLtKCvQ==",
"dev": true,
"requires": {
"q": "^1.5.1"
@@ -5311,19 +5565,19 @@
}
},
"conventional-changelog-preset-loader": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.0.2.tgz",
- "integrity": "sha512-pBY+qnUoJPXAXXqVGwQaVmcye05xi6z231QM98wHWamGAmu/ghkBprQAwmF5bdmyobdVxiLhPY3PrCfSeUNzRQ==",
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.1.1.tgz",
+ "integrity": "sha512-K4avzGMLm5Xw0Ek/6eE3vdOXkqnpf9ydb68XYmCc16cJ99XMMbc2oaNMuPwAsxVK6CC1yA4/I90EhmWNj0Q6HA==",
"dev": true
},
"conventional-changelog-writer": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.3.tgz",
- "integrity": "sha512-bIlpSiQtQZ1+nDVHEEh798Erj2jhN/wEjyw9sfxY9es6h7pREE5BNJjfv0hXGH/FTrAsEpHUq4xzK99eePpwuA==",
+ "version": "4.0.5",
+ "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.5.tgz",
+ "integrity": "sha512-g/Myp4MaJ1A+f7Ai+SnVhkcWtaHk6flw0SYN7A+vQ+MTu0+gSovQWs4Pg4NtcNUcIztYQ9YHsoxHP+GGQplI7Q==",
"dev": true,
"requires": {
"compare-func": "^1.3.1",
- "conventional-commits-filter": "^2.0.1",
+ "conventional-commits-filter": "^2.0.2",
"dateformat": "^3.0.0",
"handlebars": "^4.1.0",
"json-stringify-safe": "^5.0.1",
@@ -5331,7 +5585,7 @@
"meow": "^4.0.0",
"semver": "^5.5.0",
"split": "^1.0.0",
- "through2": "^2.0.0"
+ "through2": "^3.0.0"
},
"dependencies": {
"meow": {
@@ -5350,22 +5604,31 @@
"redent": "^2.0.0",
"trim-newlines": "^2.0.0"
}
+ },
+ "through2": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz",
+ "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==",
+ "dev": true,
+ "requires": {
+ "readable-stream": "2 || 3"
+ }
}
}
},
"conventional-commit-types": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/conventional-commit-types/-/conventional-commit-types-2.2.0.tgz",
- "integrity": "sha1-XblXOdbCEqy+e29lahG5QLqmiUY=",
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/conventional-commit-types/-/conventional-commit-types-2.1.1.tgz",
+ "integrity": "sha512-0Ts+fEdmjqYDOQ1yZ+LNgdSPO335XZw9qC10M7CxtLP3nIMGmeMhmkM8Taffa4+MXN13bRPlp0CtH+QfOzKTzw==",
"dev": true
},
"conventional-commits-filter": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.1.tgz",
- "integrity": "sha512-92OU8pz/977udhBjgPEbg3sbYzIxMDFTlQT97w7KdhR9igNqdJvy8smmedAAgn4tPiqseFloKkrVfbXCVd+E7A==",
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.2.tgz",
+ "integrity": "sha512-WpGKsMeXfs21m1zIw4s9H5sys2+9JccTzpN6toXtxhpw2VNF2JUXwIakthKBy+LN4DvJm+TzWhxOMWOs1OFCFQ==",
"dev": true,
"requires": {
- "is-subset": "^0.1.1",
+ "lodash.ismatch": "^4.4.0",
"modify-values": "^1.0.0"
}
},
@@ -5404,25 +5667,37 @@
}
},
"conventional-recommended-bump": {
- "version": "4.0.4",
- "resolved": "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-4.0.4.tgz",
- "integrity": "sha512-9mY5Yoblq+ZMqJpBzgS+RpSq+SUfP2miOR3H/NR9drGf08WCrY9B6HAGJZEm6+ThsVP917VHAahSOjM6k1vhPg==",
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-4.1.1.tgz",
+ "integrity": "sha512-JT2vKfSP9kR18RXXf55BRY1O3AHG8FPg5btP3l7LYfcWJsiXI6MCf30DepQ98E8Qhowvgv7a8iev0J1bEDkTFA==",
"dev": true,
"requires": {
- "concat-stream": "^1.6.0",
- "conventional-changelog-preset-loader": "^2.0.2",
- "conventional-commits-filter": "^2.0.1",
- "conventional-commits-parser": "^3.0.1",
+ "concat-stream": "^2.0.0",
+ "conventional-changelog-preset-loader": "^2.1.1",
+ "conventional-commits-filter": "^2.0.2",
+ "conventional-commits-parser": "^3.0.2",
"git-raw-commits": "2.0.0",
"git-semver-tags": "^2.0.2",
"meow": "^4.0.0",
"q": "^1.5.1"
},
"dependencies": {
+ "concat-stream": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz",
+ "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==",
+ "dev": true,
+ "requires": {
+ "buffer-from": "^1.0.0",
+ "inherits": "^2.0.3",
+ "readable-stream": "^3.0.2",
+ "typedarray": "^0.0.6"
+ }
+ },
"conventional-commits-parser": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.0.1.tgz",
- "integrity": "sha512-P6U5UOvDeidUJ8ebHVDIoXzI7gMlQ1OF/id6oUvp8cnZvOXMt1n8nYl74Ey9YMn0uVQtxmCtjPQawpsssBWtGg==",
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.0.2.tgz",
+ "integrity": "sha512-y5eqgaKR0F6xsBNVSQ/5cI5qIF3MojddSUi1vKIggRkqUTbkqFKH9P5YX/AT1BVZp9DtSzBTIkvjyVLotLsVog==",
"dev": true,
"requires": {
"JSONStream": "^1.0.4",
@@ -5430,7 +5705,7 @@
"lodash": "^4.2.1",
"meow": "^4.0.0",
"split2": "^2.0.0",
- "through2": "^2.0.0",
+ "through2": "^3.0.0",
"trim-off-newlines": "^1.0.0"
}
},
@@ -5445,6 +5720,33 @@
"meow": "^4.0.0",
"split2": "^2.0.0",
"through2": "^2.0.0"
+ },
+ "dependencies": {
+ "readable-stream": {
+ "version": "2.3.6",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
+ "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
+ "dev": true,
+ "requires": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "through2": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz",
+ "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==",
+ "dev": true,
+ "requires": {
+ "readable-stream": "~2.3.6",
+ "xtend": "~4.0.1"
+ }
+ }
}
},
"meow": {
@@ -5463,6 +5765,15 @@
"redent": "^2.0.0",
"trim-newlines": "^2.0.0"
}
+ },
+ "through2": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz",
+ "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==",
+ "dev": true,
+ "requires": {
+ "readable-stream": "2 || 3"
+ }
}
}
},
@@ -5507,9 +5818,35 @@
"integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40="
},
"core-js": {
- "version": "2.6.5",
- "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz",
- "integrity": "sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==",
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.0.1.tgz",
+ "integrity": "sha512-sco40rF+2KlE0ROMvydjkrVMMG1vYilP2ALoRXcYR4obqbYIuV3Bg+51GEDW+HF8n7NRA+iaA4qD0nD9lo9mew==",
+ "dev": true
+ },
+ "core-js-compat": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.0.1.tgz",
+ "integrity": "sha512-2pC3e+Ht/1/gD7Sim/sqzvRplMiRnFQVlPpDVaHtY9l7zZP7knamr3VRD6NyGfHd84MrDC0tAM9ulNxYMW0T3g==",
+ "dev": true,
+ "requires": {
+ "browserslist": "^4.5.4",
+ "core-js": "3.0.1",
+ "core-js-pure": "3.0.1",
+ "semver": "^6.0.0"
+ },
+ "dependencies": {
+ "semver": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz",
+ "integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==",
+ "dev": true
+ }
+ }
+ },
+ "core-js-pure": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.0.1.tgz",
+ "integrity": "sha512-mSxeQ6IghKW3MoyF4cz19GJ1cMm7761ON+WObSyLfTu/Jn3x7w4NwNFnrZxgl4MTSvYYepVLNuRtlB4loMwJ5g==",
"dev": true
},
"core-util-is": {
@@ -5529,6 +5866,19 @@
"require-from-string": "^2.0.1"
}
},
+ "cp-file": {
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-6.2.0.tgz",
+ "integrity": "sha512-fmvV4caBnofhPe8kOcitBwSn2f39QLjnAnGq3gO9dfd75mUytzKNZB1hde6QHunW2Rt+OwuBOMc3i1tNElbszA==",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "^4.1.2",
+ "make-dir": "^2.0.0",
+ "nested-error-stacks": "^2.0.0",
+ "pify": "^4.0.1",
+ "safe-buffer": "^5.0.1"
+ }
+ },
"create-ecdh": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz",
@@ -5604,9 +5954,9 @@
"dev": true
},
"cssstyle": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.2.1.tgz",
- "integrity": "sha512-7DYm8qe+gPx/h77QlCyFmX80+fGaE/6A/Ekl0zaszYOubvySO2saYFdQ78P29D0UsULxFKCetDGNaNRUdSF+2A==",
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.2.2.tgz",
+ "integrity": "sha512-43wY3kl1CVQSvL7wUY1qXkxVGkStjpkDmVjiIKX8R97uhajy8Bybay78uOtqvh7Q5GK75dNPfW0geWjE6qQQow==",
"dev": true,
"requires": {
"cssom": "0.3.x"
@@ -5641,14 +5991,15 @@
}
},
"cz-customizable": {
- "version": "5.5.3",
- "resolved": "https://registry.npmjs.org/cz-customizable/-/cz-customizable-5.5.3.tgz",
- "integrity": "sha512-5OUgx+5xjKgysQUs/fxOSGrrl3YWUeMRik2SvtX8mKS6+DaohWloftKFkb84go6eoOYtiuBDzxm1j5N7I4tQMg==",
+ "version": "5.10.0",
+ "resolved": "https://registry.npmjs.org/cz-customizable/-/cz-customizable-5.10.0.tgz",
+ "integrity": "sha512-8fzzmoXXAg3ydu5Uhx4g+XwgWNdjmvm/zycKzZejnhQn8Z+kvnqKwXhwm9thmFE67MIXDMS7n+A1wuMAEplddQ==",
"dev": true,
"requires": {
"editor": "1.0.0",
"find-config": "^1.0.0",
"inquirer": "^6.2.2",
+ "lodash": "^4.17.11",
"temp": "^0.9.0",
"word-wrap": "^1.2.3"
},
@@ -5690,9 +6041,9 @@
}
},
"inquirer": {
- "version": "6.2.2",
- "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.2.tgz",
- "integrity": "sha512-Z2rREiXA6cHRR9KBOarR3WuLlFzlIfAEIiB45ll5SSadMg7WqOh1MKEjjndfuH5ewXdixWCxqnVfGOQzPeiztA==",
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.3.1.tgz",
+ "integrity": "sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA==",
"dev": true,
"requires": {
"ansi-escapes": "^3.2.0",
@@ -5706,7 +6057,7 @@
"run-async": "^2.2.0",
"rxjs": "^6.4.0",
"string-width": "^2.1.0",
- "strip-ansi": "^5.0.0",
+ "strip-ansi": "^5.1.0",
"through": "^2.3.6"
}
},
@@ -5751,9 +6102,9 @@
}
},
"strip-ansi": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.1.0.tgz",
- "integrity": "sha512-TjxrkPONqO2Z8QDCpeE2j6n0M6EwxzyDgzEeGp+FbdvaJAt//ClYi6W5my+3ROlC/hZX2KACUwDfK49Ka5eDvg==",
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
+ "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
"dev": true,
"requires": {
"ansi-regex": "^4.1.0"
@@ -5977,17 +6328,18 @@
}
},
"del": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/del/-/del-3.0.0.tgz",
- "integrity": "sha1-U+z2mf/LyzljdpGrE7rxYIGXZuU=",
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/del/-/del-4.1.1.tgz",
+ "integrity": "sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ==",
"dev": true,
"requires": {
+ "@types/glob": "^7.1.1",
"globby": "^6.1.0",
- "is-path-cwd": "^1.0.0",
- "is-path-in-cwd": "^1.0.0",
- "p-map": "^1.1.1",
- "pify": "^3.0.0",
- "rimraf": "^2.2.8"
+ "is-path-cwd": "^2.0.0",
+ "is-path-in-cwd": "^2.0.0",
+ "p-map": "^2.0.0",
+ "pify": "^4.0.1",
+ "rimraf": "^2.6.3"
},
"dependencies": {
"globby": {
@@ -6010,6 +6362,12 @@
"dev": true
}
}
+ },
+ "p-map": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz",
+ "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==",
+ "dev": true
}
}
},
@@ -6247,9 +6605,9 @@
"dev": true
},
"electron-to-chromium": {
- "version": "1.3.116",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.116.tgz",
- "integrity": "sha512-NKwKAXzur5vFCZYBHpdWjTMO8QptNLNP80nItkSIgUOapPAo9Uia+RvkCaZJtO7fhQaVElSvBPWEc2ku6cKsPA==",
+ "version": "1.3.131",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.131.tgz",
+ "integrity": "sha512-NSO4jLeyGLWrT4mzzfYX8vt1MYCoMI5LxSYAjt0H9+LF/14JyiKJSyyjA6AJTxflZlEM5v3QU33F0ohbPMCAPg==",
"dev": true
},
"elegant-spinner": {
@@ -6365,6 +6723,12 @@
"is-symbol": "^1.0.2"
}
},
+ "es6-error": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz",
+ "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==",
+ "dev": true
+ },
"es6-promise": {
"version": "4.2.6",
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.6.tgz",
@@ -6420,9 +6784,9 @@
}
},
"eslint": {
- "version": "5.15.2",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.15.2.tgz",
- "integrity": "sha512-I8VM4SILpMwUvsRt83bQVwIRQAJ2iPMXun1FVZ/lV1OHklH2tJaXqoDnNzdiFc6bnCtGKXvQIQNP3kj1eMskSw==",
+ "version": "5.16.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz",
+ "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
@@ -6445,7 +6809,7 @@
"import-fresh": "^3.0.0",
"imurmurhash": "^0.1.4",
"inquirer": "^6.2.2",
- "js-yaml": "^3.12.0",
+ "js-yaml": "^3.13.0",
"json-stable-stringify-without-jsonify": "^1.0.1",
"levn": "^0.3.0",
"lodash": "^4.17.11",
@@ -6509,9 +6873,9 @@
}
},
"inquirer": {
- "version": "6.2.2",
- "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.2.tgz",
- "integrity": "sha512-Z2rREiXA6cHRR9KBOarR3WuLlFzlIfAEIiB45ll5SSadMg7WqOh1MKEjjndfuH5ewXdixWCxqnVfGOQzPeiztA==",
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.3.1.tgz",
+ "integrity": "sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA==",
"dev": true,
"requires": {
"ansi-escapes": "^3.2.0",
@@ -6525,14 +6889,14 @@
"run-async": "^2.2.0",
"rxjs": "^6.4.0",
"string-width": "^2.1.0",
- "strip-ansi": "^5.0.0",
+ "strip-ansi": "^5.1.0",
"through": "^2.3.6"
},
"dependencies": {
"strip-ansi": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.1.0.tgz",
- "integrity": "sha512-TjxrkPONqO2Z8QDCpeE2j6n0M6EwxzyDgzEeGp+FbdvaJAt//ClYi6W5my+3ROlC/hZX2KACUwDfK49Ka5eDvg==",
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
+ "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
"dev": true,
"requires": {
"ansi-regex": "^4.1.0"
@@ -6588,6 +6952,23 @@
}
}
},
+ "eslint-config-prettier": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-4.2.0.tgz",
+ "integrity": "sha512-y0uWc/FRfrHhpPZCYflWC8aE0KRJRY04rdZVfl8cL3sEZmOYyaBdhdlQPjKZBnuRMyLVK+JUZr7HaZFClQiH4w==",
+ "dev": true,
+ "requires": {
+ "get-stdin": "^6.0.0"
+ },
+ "dependencies": {
+ "get-stdin": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz",
+ "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==",
+ "dev": true
+ }
+ }
+ },
"eslint-plugin-es": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-1.4.0.tgz",
@@ -6613,9 +6994,9 @@
},
"dependencies": {
"ignore": {
- "version": "5.0.5",
- "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.0.5.tgz",
- "integrity": "sha512-kOC8IUb8HSDMVcYrDVezCxpJkzSQWTAzf3olpKM6o9rM5zpojx23O0Fl8Wr4+qJ6ZbPEHqf1fdwev/DS7v7pmA==",
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.1.tgz",
+ "integrity": "sha512-DWjnQIFLenVrwyRCKZT+7a7/U4Cqgar4WG8V++K3hw+lrW1hc/SIwdiGmtxKCVACmHULTuGeBbHJmbwW7/sAvA==",
"dev": true
}
}
@@ -6643,9 +7024,9 @@
"dev": true
},
"esm": {
- "version": "3.2.18",
- "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.18.tgz",
- "integrity": "sha512-1UENjnnI37UDp7KuOqKYjfqdaMim06eBWnDv37smaxTIzDl0ZWnlgoXwsVwD9+Lidw+q/f1gUf2diVMDCycoVw==",
+ "version": "3.2.22",
+ "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.22.tgz",
+ "integrity": "sha512-z8YG7U44L82j1XrdEJcqZOLUnjxco8pO453gKOlaMD1/md1n/5QrscAmYG+oKUspsmDLuBFZrpbxI6aQ67yRxA==",
"dev": true
},
"espree": {
@@ -6702,9 +7083,9 @@
"dev": true
},
"eventemitter3": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz",
- "integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==",
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz",
+ "integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==",
"dev": true
},
"events": {
@@ -6811,16 +7192,16 @@
}
},
"expect": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/expect/-/expect-24.5.0.tgz",
- "integrity": "sha512-p2Gmc0CLxOgkyA93ySWmHFYHUPFIHG6XZ06l7WArWAsrqYVaVEkOU5NtT5i68KUyGKbkQgDCkiT65bWmdoL6Bw==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/expect/-/expect-24.7.1.tgz",
+ "integrity": "sha512-mGfvMTPduksV3xoI0xur56pQsg2vJjNf5+a+bXOjqCkiCBbmCayrBbHS/75y9K430cfqyocPr2ZjiNiRx4SRKw==",
"dev": true,
"requires": {
- "@jest/types": "^24.5.0",
+ "@jest/types": "^24.7.0",
"ansi-styles": "^3.2.0",
"jest-get-type": "^24.3.0",
- "jest-matcher-utils": "^24.5.0",
- "jest-message-util": "^24.5.0",
+ "jest-matcher-utils": "^24.7.0",
+ "jest-message-util": "^24.7.1",
"jest-regex-util": "^24.3.0"
}
},
@@ -6992,9 +7373,9 @@
},
"dependencies": {
"is-glob": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz",
- "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
+ "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
"dev": true,
"requires": {
"is-extglob": "^2.1.1"
@@ -7104,68 +7485,14 @@
}
},
"find-cache-dir": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz",
- "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=",
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz",
+ "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==",
"dev": true,
"requires": {
"commondir": "^1.0.1",
- "make-dir": "^1.0.0",
- "pkg-dir": "^2.0.0"
- },
- "dependencies": {
- "find-up": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
- "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
- "dev": true,
- "requires": {
- "locate-path": "^2.0.0"
- }
- },
- "locate-path": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
- "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
- "dev": true,
- "requires": {
- "p-locate": "^2.0.0",
- "path-exists": "^3.0.0"
- }
- },
- "p-limit": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
- "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==",
- "dev": true,
- "requires": {
- "p-try": "^1.0.0"
- }
- },
- "p-locate": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
- "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
- "dev": true,
- "requires": {
- "p-limit": "^1.1.0"
- }
- },
- "p-try": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
- "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=",
- "dev": true
- },
- "pkg-dir": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz",
- "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=",
- "dev": true,
- "requires": {
- "find-up": "^2.1.0"
- }
- }
+ "make-dir": "^2.0.0",
+ "pkg-dir": "^3.0.0"
}
},
"find-config": {
@@ -7200,9 +7527,9 @@
}
},
"is-glob": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz",
- "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
+ "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
"dev": true,
"requires": {
"is-extglob": "^2.1.1"
@@ -7316,6 +7643,28 @@
"resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
"integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA="
},
+ "foreground-child": {
+ "version": "1.5.6",
+ "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz",
+ "integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=",
+ "dev": true,
+ "requires": {
+ "cross-spawn": "^4",
+ "signal-exit": "^3.0.0"
+ },
+ "dependencies": {
+ "cross-spawn": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz",
+ "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=",
+ "dev": true,
+ "requires": {
+ "lru-cache": "^4.0.1",
+ "which": "^1.2.9"
+ }
+ }
+ }
+ },
"forever-agent": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
@@ -7442,14 +7791,14 @@
"dev": true
},
"fsevents": {
- "version": "1.2.7",
- "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.7.tgz",
- "integrity": "sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw==",
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz",
+ "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==",
"dev": true,
"optional": true,
"requires": {
- "nan": "^2.9.2",
- "node-pre-gyp": "^0.10.0"
+ "nan": "^2.12.1",
+ "node-pre-gyp": "^0.12.0"
},
"dependencies": {
"abbrev": {
@@ -7527,12 +7876,12 @@
"optional": true
},
"debug": {
- "version": "2.6.9",
+ "version": "4.1.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
- "ms": "2.0.0"
+ "ms": "^2.1.1"
}
},
"deep-extend": {
@@ -7703,24 +8052,24 @@
}
},
"ms": {
- "version": "2.0.0",
+ "version": "2.1.1",
"bundled": true,
"dev": true,
"optional": true
},
"needle": {
- "version": "2.2.4",
+ "version": "2.3.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
- "debug": "^2.1.2",
+ "debug": "^4.1.0",
"iconv-lite": "^0.4.4",
"sax": "^1.2.4"
}
},
"node-pre-gyp": {
- "version": "0.10.3",
+ "version": "0.12.0",
"bundled": true,
"dev": true,
"optional": true,
@@ -7748,13 +8097,13 @@
}
},
"npm-bundled": {
- "version": "1.0.5",
+ "version": "1.0.6",
"bundled": true,
"dev": true,
"optional": true
},
"npm-packlist": {
- "version": "1.2.0",
+ "version": "1.4.1",
"bundled": true,
"dev": true,
"optional": true,
@@ -7893,7 +8242,7 @@
"optional": true
},
"semver": {
- "version": "5.6.0",
+ "version": "5.7.0",
"bundled": true,
"dev": true,
"optional": true
@@ -8504,9 +8853,9 @@
}
},
"globals": {
- "version": "11.11.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-11.11.0.tgz",
- "integrity": "sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw==",
+ "version": "11.12.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
+ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
"dev": true
},
"globby": {
@@ -8530,6 +8879,12 @@
"integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==",
"dev": true
},
+ "pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
+ "dev": true
+ },
"slash": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz",
@@ -8557,6 +8912,14 @@
"requires": {
"duplexer": "^0.1.1",
"pify": "^3.0.0"
+ },
+ "dependencies": {
+ "pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
+ "dev": true
+ }
}
},
"handle-thing": {
@@ -8566,12 +8929,12 @@
"dev": true
},
"handlebars": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.0.tgz",
- "integrity": "sha512-l2jRuU1NAWK6AW5qqcTATWQJvNPEwkM7NEKSiv/gqOsoSQbVoWyqVEY5GS+XPQ88zLNmqASRpzfdm8d79hJS+w==",
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz",
+ "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==",
"dev": true,
"requires": {
- "async": "^2.5.0",
+ "neo-async": "^2.6.0",
"optimist": "^0.6.1",
"source-map": "^0.6.1",
"uglify-js": "^3.1.4"
@@ -8693,6 +9056,15 @@
"minimalistic-assert": "^1.0.1"
}
},
+ "hasha": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/hasha/-/hasha-3.0.0.tgz",
+ "integrity": "sha1-UqMvq4Vp1BymmmH/GiFPjrfIvTk=",
+ "dev": true,
+ "requires": {
+ "is-stream": "^1.0.1"
+ }
+ },
"highlight.js": {
"version": "9.15.6",
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.15.6.tgz",
@@ -8710,12 +9082,6 @@
"minimalistic-crypto-utils": "^1.0.1"
}
},
- "home-or-tmp": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-3.0.0.tgz",
- "integrity": "sha1-V6j+JM8zzdUkhgoVgh3cJchmcfs=",
- "dev": true
- },
"homedir-polyfill": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz",
@@ -8849,9 +9215,9 @@
},
"dependencies": {
"is-glob": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz",
- "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
+ "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
"dev": true,
"requires": {
"is-extglob": "^2.1.1"
@@ -8931,15 +9297,14 @@
},
"dependencies": {
"cosmiconfig": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.1.0.tgz",
- "integrity": "sha512-kCNPvthka8gvLtzAxQXvWo4FxqRB+ftRZyPZNuab5ngvM9Y7yw7hbEysglptLgpkGX9nAOKTBVkHUAe8xtYR6Q==",
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.0.tgz",
+ "integrity": "sha512-nxt+Nfc3JAqf4WIWd0jXLjTJZmsPLrA9DDc4nRw2KFJQJK7DNooqSXrNI7tzLG50CF8axczly5UV929tBmh/7g==",
"dev": true,
"requires": {
"import-fresh": "^2.0.0",
"is-directory": "^0.3.1",
- "js-yaml": "^3.9.0",
- "lodash.get": "^4.4.2",
+ "js-yaml": "^3.13.0",
"parse-json": "^4.0.0"
}
},
@@ -8959,6 +9324,12 @@
"resolve-from": "^3.0.0"
}
},
+ "pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
+ "dev": true
+ },
"read-pkg": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-4.0.1.tgz",
@@ -8982,9 +9353,9 @@
}
},
"ieee754": {
- "version": "1.1.12",
- "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz",
- "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==",
+ "version": "1.1.13",
+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz",
+ "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==",
"dev": true
},
"iferr": {
@@ -9185,21 +9556,13 @@
}
},
"internal-ip": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-4.2.0.tgz",
- "integrity": "sha512-ZY8Rk+hlvFeuMmG5uH1MXhhdeMntmIaxaInvAmzMq/SHV8rv4Kh+6GiQNNDQd0wZFrcO+FiTBo8lui/osKOyJw==",
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-4.3.0.tgz",
+ "integrity": "sha512-S1zBo1D6zcsyuC6PMmY5+55YMILQ9av8lotMx447Bq6SAgo/sDK6y6uUKmuYhW7eacnIhFfsPmCNYdDzsnnDCg==",
"dev": true,
"requires": {
- "default-gateway": "^4.0.1",
+ "default-gateway": "^4.2.0",
"ipaddr.js": "^1.9.0"
- },
- "dependencies": {
- "ipaddr.js": {
- "version": "1.9.0",
- "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz",
- "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==",
- "dev": true
- }
}
},
"interpret": {
@@ -9234,9 +9597,9 @@
"dev": true
},
"ipaddr.js": {
- "version": "1.8.0",
- "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz",
- "integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4=",
+ "version": "1.9.0",
+ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz",
+ "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==",
"dev": true
},
"is-accessor-descriptor": {
@@ -9364,9 +9727,9 @@
"integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8="
},
"is-generator-fn": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.0.0.tgz",
- "integrity": "sha512-elzyIdM7iKoFHzcrndIqjYomImhxrFRnGP3galODoII4TB9gI7mZ+FnlLQmmjf27SxHS2gKEeyhX5/+YRS6H9g==",
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz",
+ "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==",
"dev": true
},
"is-glob": {
@@ -9411,27 +9774,27 @@
}
},
"is-path-cwd": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz",
- "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=",
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.1.0.tgz",
+ "integrity": "sha512-Sc5j3/YnM8tDeyCsVeKlm/0p95075DyLmDEIkSgQ7mXkrOX+uTCtmQFm0CYzVyJwcCCmO3k8qfJt17SxQwB5Zw==",
"dev": true
},
"is-path-in-cwd": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz",
- "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==",
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-2.1.0.tgz",
+ "integrity": "sha512-rNocXHgipO+rvnP6dk3zI20RpOtrAM/kzbB258Uw5BWr3TpXi861yzjo16Dn4hUox07iw5AyeMLHWsujkjzvRQ==",
"dev": true,
"requires": {
- "is-path-inside": "^1.0.0"
+ "is-path-inside": "^2.1.0"
}
},
"is-path-inside": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz",
- "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=",
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-2.1.0.tgz",
+ "integrity": "sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg==",
"dev": true,
"requires": {
- "path-is-inside": "^1.0.1"
+ "path-is-inside": "^1.0.2"
}
},
"is-plain-obj": {
@@ -9489,12 +9852,6 @@
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
},
- "is-subset": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/is-subset/-/is-subset-0.1.1.tgz",
- "integrity": "sha1-ilkRfZMt4d4A8kX83TnOQ/HpOaY=",
- "dev": true
- },
"is-symbol": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz",
@@ -9558,65 +9915,73 @@
"dev": true
},
"istanbul-api": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-2.1.1.tgz",
- "integrity": "sha512-kVmYrehiwyeBAk/wE71tW6emzLiHGjYIiDrc8sfyty4F8M02/lrgXSm+R1kXysmF20zArvmZXjlE/mg24TVPJw==",
+ "version": "2.1.6",
+ "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-2.1.6.tgz",
+ "integrity": "sha512-x0Eicp6KsShG1k1rMgBAi/1GgY7kFGEBwQpw3PXGEmu+rBcBNhqU8g2DgY9mlepAsLPzrzrbqSgCGANnki4POA==",
"dev": true,
"requires": {
- "async": "^2.6.1",
- "compare-versions": "^3.2.1",
+ "async": "^2.6.2",
+ "compare-versions": "^3.4.0",
"fileset": "^2.0.3",
- "istanbul-lib-coverage": "^2.0.3",
- "istanbul-lib-hook": "^2.0.3",
- "istanbul-lib-instrument": "^3.1.0",
- "istanbul-lib-report": "^2.0.4",
- "istanbul-lib-source-maps": "^3.0.2",
- "istanbul-reports": "^2.1.1",
- "js-yaml": "^3.12.0",
- "make-dir": "^1.3.0",
+ "istanbul-lib-coverage": "^2.0.5",
+ "istanbul-lib-hook": "^2.0.7",
+ "istanbul-lib-instrument": "^3.3.0",
+ "istanbul-lib-report": "^2.0.8",
+ "istanbul-lib-source-maps": "^3.0.6",
+ "istanbul-reports": "^2.2.4",
+ "js-yaml": "^3.13.1",
+ "make-dir": "^2.1.0",
"minimatch": "^3.0.4",
"once": "^1.4.0"
}
},
"istanbul-lib-coverage": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz",
- "integrity": "sha512-dKWuzRGCs4G+67VfW9pBFFz2Jpi4vSp/k7zBcJ888ofV5Mi1g5CUML5GvMvV6u9Cjybftu+E8Cgp+k0dI1E5lw==",
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz",
+ "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==",
"dev": true
},
"istanbul-lib-hook": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.3.tgz",
- "integrity": "sha512-CLmEqwEhuCYtGcpNVJjLV1DQyVnIqavMLFHV/DP+np/g3qvdxu3gsPqYoJMXm15sN84xOlckFB3VNvRbf5yEgA==",
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.7.tgz",
+ "integrity": "sha512-vrRztU9VRRFDyC+aklfLoeXyNdTfga2EI3udDGn4cZ6fpSXpHLV9X6CHvfoMCPtggg8zvDDmC4b9xfu0z6/llA==",
"dev": true,
"requires": {
"append-transform": "^1.0.0"
}
},
"istanbul-lib-instrument": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.1.0.tgz",
- "integrity": "sha512-ooVllVGT38HIk8MxDj/OIHXSYvH+1tq/Vb38s8ixt9GoJadXska4WkGY+0wkmtYCZNYtaARniH/DixUGGLZ0uA==",
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz",
+ "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==",
"dev": true,
"requires": {
- "@babel/generator": "^7.0.0",
- "@babel/parser": "^7.0.0",
- "@babel/template": "^7.0.0",
- "@babel/traverse": "^7.0.0",
- "@babel/types": "^7.0.0",
- "istanbul-lib-coverage": "^2.0.3",
- "semver": "^5.5.0"
+ "@babel/generator": "^7.4.0",
+ "@babel/parser": "^7.4.3",
+ "@babel/template": "^7.4.0",
+ "@babel/traverse": "^7.4.3",
+ "@babel/types": "^7.4.0",
+ "istanbul-lib-coverage": "^2.0.5",
+ "semver": "^6.0.0"
+ },
+ "dependencies": {
+ "semver": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz",
+ "integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==",
+ "dev": true
+ }
}
},
"istanbul-lib-report": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.4.tgz",
- "integrity": "sha512-sOiLZLAWpA0+3b5w5/dq0cjm2rrNdAfHWaGhmn7XEFW6X++IV9Ohn+pnELAl9K3rfpaeBfbmH9JU5sejacdLeA==",
+ "version": "2.0.8",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz",
+ "integrity": "sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ==",
"dev": true,
"requires": {
- "istanbul-lib-coverage": "^2.0.3",
- "make-dir": "^1.3.0",
- "supports-color": "^6.0.0"
+ "istanbul-lib-coverage": "^2.0.5",
+ "make-dir": "^2.1.0",
+ "supports-color": "^6.1.0"
},
"dependencies": {
"supports-color": {
@@ -9631,15 +9996,15 @@
}
},
"istanbul-lib-source-maps": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.2.tgz",
- "integrity": "sha512-JX4v0CiKTGp9fZPmoxpu9YEkPbEqCqBbO3403VabKjH+NRXo72HafD5UgnjTEqHL2SAjaZK1XDuDOkn6I5QVfQ==",
+ "version": "3.0.6",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz",
+ "integrity": "sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==",
"dev": true,
"requires": {
"debug": "^4.1.1",
- "istanbul-lib-coverage": "^2.0.3",
- "make-dir": "^1.3.0",
- "rimraf": "^2.6.2",
+ "istanbul-lib-coverage": "^2.0.5",
+ "make-dir": "^2.1.0",
+ "rimraf": "^2.6.3",
"source-map": "^0.6.1"
},
"dependencies": {
@@ -9667,90 +10032,91 @@
}
},
"istanbul-reports": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.1.1.tgz",
- "integrity": "sha512-FzNahnidyEPBCI0HcufJoSEoKykesRlFcSzQqjH9x0+LC8tnnE/p/90PBLu8iZTxr8yYZNyTtiAujUqyN+CIxw==",
+ "version": "2.2.4",
+ "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.4.tgz",
+ "integrity": "sha512-QCHGyZEK0bfi9GR215QSm+NJwFKEShbtc7tfbUdLAEzn3kKhLDDZqvljn8rPZM9v8CEOhzL1nlYoO4r1ryl67w==",
"dev": true,
"requires": {
- "handlebars": "^4.1.0"
+ "handlebars": "^4.1.2"
}
},
"jest": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/jest/-/jest-24.5.0.tgz",
- "integrity": "sha512-lxL+Fq5/RH7inxxmfS2aZLCf8MsS+YCUBfeiNO6BWz/MmjhDGaIEA/2bzEf9q4Q0X+mtFHiinHFvQ0u+RvW/qQ==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/jest/-/jest-24.7.1.tgz",
+ "integrity": "sha512-AbvRar5r++izmqo5gdbAjTeA6uNRGoNRuj5vHB0OnDXo2DXWZJVuaObiGgtlvhKb+cWy2oYbQSfxv7Q7GjnAtA==",
"dev": true,
"requires": {
"import-local": "^2.0.0",
- "jest-cli": "^24.5.0"
+ "jest-cli": "^24.7.1"
}
},
"jest-changed-files": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-24.5.0.tgz",
- "integrity": "sha512-Ikl29dosYnTsH9pYa1Tv9POkILBhN/TLZ37xbzgNsZ1D2+2n+8oEZS2yP1BrHn/T4Rs4Ggwwbp/x8CKOS5YJOg==",
+ "version": "24.7.0",
+ "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-24.7.0.tgz",
+ "integrity": "sha512-33BgewurnwSfJrW7T5/ZAXGE44o7swLslwh8aUckzq2e17/2Os1V0QU506ZNik3hjs8MgnEMKNkcud442NCDTw==",
"dev": true,
"requires": {
- "@jest/types": "^24.5.0",
+ "@jest/types": "^24.7.0",
"execa": "^1.0.0",
"throat": "^4.0.0"
}
},
"jest-cli": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-24.5.0.tgz",
- "integrity": "sha512-P+Jp0SLO4KWN0cGlNtC7JV0dW1eSFR7eRpoOucP2UM0sqlzp/bVHeo71Omonvigrj9AvCKy7NtQANtqJ7FXz8g==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-24.7.1.tgz",
+ "integrity": "sha512-32OBoSCVPzcTslGFl6yVCMzB2SqX3IrWwZCY5mZYkb0D2WsogmU3eV2o8z7+gRQa4o4sZPX/k7GU+II7CxM6WQ==",
"dev": true,
"requires": {
- "@jest/core": "^24.5.0",
- "@jest/test-result": "^24.5.0",
- "@jest/types": "^24.5.0",
+ "@jest/core": "^24.7.1",
+ "@jest/test-result": "^24.7.1",
+ "@jest/types": "^24.7.0",
"chalk": "^2.0.1",
"exit": "^0.1.2",
"import-local": "^2.0.0",
"is-ci": "^2.0.0",
- "jest-config": "^24.5.0",
- "jest-util": "^24.5.0",
- "jest-validate": "^24.5.0",
+ "jest-config": "^24.7.1",
+ "jest-util": "^24.7.1",
+ "jest-validate": "^24.7.0",
"prompts": "^2.0.1",
"realpath-native": "^1.1.0",
"yargs": "^12.0.2"
}
},
"jest-config": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-24.5.0.tgz",
- "integrity": "sha512-t2UTh0Z2uZhGBNVseF8wA2DS2SuBiLOL6qpLq18+OZGfFUxTM7BzUVKyHFN/vuN+s/aslY1COW95j1Rw81huOQ==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-24.7.1.tgz",
+ "integrity": "sha512-8FlJNLI+X+MU37j7j8RE4DnJkvAghXmBWdArVzypW6WxfGuxiL/CCkzBg0gHtXhD2rxla3IMOSUAHylSKYJ83g==",
"dev": true,
"requires": {
"@babel/core": "^7.1.0",
- "@jest/types": "^24.5.0",
- "babel-jest": "^24.5.0",
+ "@jest/test-sequencer": "^24.7.1",
+ "@jest/types": "^24.7.0",
+ "babel-jest": "^24.7.1",
"chalk": "^2.0.1",
"glob": "^7.1.1",
- "jest-environment-jsdom": "^24.5.0",
- "jest-environment-node": "^24.5.0",
+ "jest-environment-jsdom": "^24.7.1",
+ "jest-environment-node": "^24.7.1",
"jest-get-type": "^24.3.0",
- "jest-jasmine2": "^24.5.0",
+ "jest-jasmine2": "^24.7.1",
"jest-regex-util": "^24.3.0",
- "jest-resolve": "^24.5.0",
- "jest-util": "^24.5.0",
- "jest-validate": "^24.5.0",
+ "jest-resolve": "^24.7.1",
+ "jest-util": "^24.7.1",
+ "jest-validate": "^24.7.0",
"micromatch": "^3.1.10",
- "pretty-format": "^24.5.0",
+ "pretty-format": "^24.7.0",
"realpath-native": "^1.1.0"
}
},
"jest-diff": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-24.5.0.tgz",
- "integrity": "sha512-mCILZd9r7zqL9Uh6yNoXjwGQx0/J43OD2vvWVKwOEOLZliQOsojXwqboubAQ+Tszrb6DHGmNU7m4whGeB9YOqw==",
+ "version": "24.7.0",
+ "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-24.7.0.tgz",
+ "integrity": "sha512-ULQZ5B1lWpH70O4xsANC4tf4Ko6RrpwhE3PtG6ERjMg1TiYTC2Wp4IntJVGro6a8HG9luYHhhmF4grF0Pltckg==",
"dev": true,
"requires": {
"chalk": "^2.0.1",
"diff-sequences": "^24.3.0",
"jest-get-type": "^24.3.0",
- "pretty-format": "^24.5.0"
+ "pretty-format": "^24.7.0"
}
},
"jest-docblock": {
@@ -9763,43 +10129,43 @@
}
},
"jest-each": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-24.5.0.tgz",
- "integrity": "sha512-6gy3Kh37PwIT5sNvNY2VchtIFOOBh8UCYnBlxXMb5sr5wpJUDPTUATX2Axq1Vfk+HWTMpsYPeVYp4TXx5uqUBw==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-24.7.1.tgz",
+ "integrity": "sha512-4fsS8fEfLa3lfnI1Jw6NxjhyRTgfpuOVTeUZZFyVYqeTa4hPhr2YkToUhouuLTrL2eMGOfpbdMyRx0GQ/VooKA==",
"dev": true,
"requires": {
- "@jest/types": "^24.5.0",
+ "@jest/types": "^24.7.0",
"chalk": "^2.0.1",
"jest-get-type": "^24.3.0",
- "jest-util": "^24.5.0",
- "pretty-format": "^24.5.0"
+ "jest-util": "^24.7.1",
+ "pretty-format": "^24.7.0"
}
},
"jest-environment-jsdom": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-24.5.0.tgz",
- "integrity": "sha512-62Ih5HbdAWcsqBx2ktUnor/mABBo1U111AvZWcLKeWN/n/gc5ZvDBKe4Og44fQdHKiXClrNGC6G0mBo6wrPeGQ==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-24.7.1.tgz",
+ "integrity": "sha512-Gnhb+RqE2JuQGb3kJsLF8vfqjt3PHKSstq4Xc8ic+ax7QKo4Z0RWGucU3YV+DwKR3T9SYc+3YCUQEJs8r7+Jxg==",
"dev": true,
"requires": {
- "@jest/environment": "^24.5.0",
- "@jest/fake-timers": "^24.5.0",
- "@jest/types": "^24.5.0",
- "jest-mock": "^24.5.0",
- "jest-util": "^24.5.0",
+ "@jest/environment": "^24.7.1",
+ "@jest/fake-timers": "^24.7.1",
+ "@jest/types": "^24.7.0",
+ "jest-mock": "^24.7.0",
+ "jest-util": "^24.7.1",
"jsdom": "^11.5.1"
}
},
"jest-environment-node": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-24.5.0.tgz",
- "integrity": "sha512-du6FuyWr/GbKLsmAbzNF9mpr2Iu2zWSaq/BNHzX+vgOcts9f2ayXBweS7RAhr+6bLp6qRpMB6utAMF5Ygktxnw==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-24.7.1.tgz",
+ "integrity": "sha512-GJJQt1p9/C6aj6yNZMvovZuxTUd+BEJprETdvTKSb4kHcw4mFj8777USQV0FJoJ4V3djpOwA5eWyPwfq//PFBA==",
"dev": true,
"requires": {
- "@jest/environment": "^24.5.0",
- "@jest/fake-timers": "^24.5.0",
- "@jest/types": "^24.5.0",
- "jest-mock": "^24.5.0",
- "jest-util": "^24.5.0"
+ "@jest/environment": "^24.7.1",
+ "@jest/fake-timers": "^24.7.1",
+ "@jest/types": "^24.7.0",
+ "jest-mock": "^24.7.0",
+ "jest-util": "^24.7.1"
}
},
"jest-get-type": {
@@ -9809,50 +10175,53 @@
"dev": true
},
"jest-haste-map": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-24.5.0.tgz",
- "integrity": "sha512-mb4Yrcjw9vBgSvobDwH8QUovxApdimGcOkp+V1ucGGw4Uvr3VzZQBJhNm1UY3dXYm4XXyTW2G7IBEZ9pM2ggRQ==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-24.7.1.tgz",
+ "integrity": "sha512-g0tWkzjpHD2qa03mTKhlydbmmYiA2KdcJe762SbfFo/7NIMgBWAA0XqQlApPwkWOF7Cxoi/gUqL0i6DIoLpMBw==",
"dev": true,
"requires": {
- "@jest/types": "^24.5.0",
+ "@jest/types": "^24.7.0",
+ "anymatch": "^2.0.0",
"fb-watchman": "^2.0.0",
+ "fsevents": "^1.2.7",
"graceful-fs": "^4.1.15",
"invariant": "^2.2.4",
"jest-serializer": "^24.4.0",
- "jest-util": "^24.5.0",
- "jest-worker": "^24.4.0",
+ "jest-util": "^24.7.1",
+ "jest-worker": "^24.6.0",
"micromatch": "^3.1.10",
- "sane": "^4.0.3"
+ "sane": "^4.0.3",
+ "walker": "^1.0.7"
}
},
"jest-jasmine2": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-24.5.0.tgz",
- "integrity": "sha512-sfVrxVcx1rNUbBeyIyhkqZ4q+seNKyAG6iM0S2TYBdQsXjoFDdqWFfsUxb6uXSsbimbXX/NMkJIwUZ1uT9+/Aw==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-24.7.1.tgz",
+ "integrity": "sha512-Y/9AOJDV1XS44wNwCaThq4Pw3gBPiOv/s6NcbOAkVRRUEPu+36L2xoPsqQXsDrxoBerqeyslpn2TpCI8Zr6J2w==",
"dev": true,
"requires": {
"@babel/traverse": "^7.1.0",
- "@jest/environment": "^24.5.0",
- "@jest/test-result": "^24.5.0",
- "@jest/types": "^24.5.0",
+ "@jest/environment": "^24.7.1",
+ "@jest/test-result": "^24.7.1",
+ "@jest/types": "^24.7.0",
"chalk": "^2.0.1",
"co": "^4.6.0",
- "expect": "^24.5.0",
+ "expect": "^24.7.1",
"is-generator-fn": "^2.0.0",
- "jest-each": "^24.5.0",
- "jest-matcher-utils": "^24.5.0",
- "jest-message-util": "^24.5.0",
- "jest-runtime": "^24.5.0",
- "jest-snapshot": "^24.5.0",
- "jest-util": "^24.5.0",
- "pretty-format": "^24.5.0",
+ "jest-each": "^24.7.1",
+ "jest-matcher-utils": "^24.7.0",
+ "jest-message-util": "^24.7.1",
+ "jest-runtime": "^24.7.1",
+ "jest-snapshot": "^24.7.1",
+ "jest-util": "^24.7.1",
+ "pretty-format": "^24.7.0",
"throat": "^4.0.0"
}
},
"jest-junit": {
- "version": "6.3.0",
- "resolved": "https://registry.npmjs.org/jest-junit/-/jest-junit-6.3.0.tgz",
- "integrity": "sha512-3PH9UkpaomX6CUzqjlnk0m4yBCW/eroxV6v61OM6LkCQFO848P3YUhfIzu8ypZSBKB3vvCbB4WaLTKT0BrIf8A==",
+ "version": "6.4.0",
+ "resolved": "https://registry.npmjs.org/jest-junit/-/jest-junit-6.4.0.tgz",
+ "integrity": "sha512-GXEZA5WBeUich94BARoEUccJumhCgCerg7mXDFLxWwI2P7wL3Z7sGWk+53x343YdBLjiMR9aD/gYMVKO+0pE4Q==",
"dev": true,
"requires": {
"jest-validate": "^24.0.0",
@@ -9862,35 +10231,35 @@
}
},
"jest-leak-detector": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-24.5.0.tgz",
- "integrity": "sha512-LZKBjGovFRx3cRBkqmIg+BZnxbrLqhQl09IziMk3oeh1OV81Hg30RUIx885mq8qBv1PA0comB9bjKcuyNO1bCQ==",
+ "version": "24.7.0",
+ "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-24.7.0.tgz",
+ "integrity": "sha512-zV0qHKZGXtmPVVzT99CVEcHE9XDf+8LwiE0Ob7jjezERiGVljmqKFWpV2IkG+rkFIEUHFEkMiICu7wnoPM/RoQ==",
"dev": true,
"requires": {
- "pretty-format": "^24.5.0"
+ "pretty-format": "^24.7.0"
}
},
"jest-matcher-utils": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-24.5.0.tgz",
- "integrity": "sha512-QM1nmLROjLj8GMGzg5VBra3I9hLpjMPtF1YqzQS3rvWn2ltGZLrGAO1KQ9zUCVi5aCvrkbS5Ndm2evIP9yZg1Q==",
+ "version": "24.7.0",
+ "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-24.7.0.tgz",
+ "integrity": "sha512-158ieSgk3LNXeUhbVJYRXyTPSCqNgVXOp/GT7O94mYd3pk/8+odKTyR1JLtNOQSPzNi8NFYVONtvSWA/e1RDXg==",
"dev": true,
"requires": {
"chalk": "^2.0.1",
- "jest-diff": "^24.5.0",
+ "jest-diff": "^24.7.0",
"jest-get-type": "^24.3.0",
- "pretty-format": "^24.5.0"
+ "pretty-format": "^24.7.0"
}
},
"jest-message-util": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-24.5.0.tgz",
- "integrity": "sha512-6ZYgdOojowCGiV0D8WdgctZEAe+EcFU+KrVds+0ZjvpZurUW2/oKJGltJ6FWY2joZwYXN5VL36GPV6pNVRqRnQ==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-24.7.1.tgz",
+ "integrity": "sha512-dk0gqVtyqezCHbcbk60CdIf+8UHgD+lmRHifeH3JRcnAqh4nEyPytSc9/L1+cQyxC+ceaeP696N4ATe7L+omcg==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
- "@jest/test-result": "^24.5.0",
- "@jest/types": "^24.5.0",
+ "@jest/test-result": "^24.7.1",
+ "@jest/types": "^24.7.0",
"@types/stack-utils": "^1.0.1",
"chalk": "^2.0.1",
"micromatch": "^3.1.10",
@@ -9899,12 +10268,12 @@
}
},
"jest-mock": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-24.5.0.tgz",
- "integrity": "sha512-ZnAtkWrKf48eERgAOiUxVoFavVBziO2pAi2MfZ1+bGXVkDfxWLxU0//oJBkgwbsv6OAmuLBz4XFFqvCFMqnGUw==",
+ "version": "24.7.0",
+ "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-24.7.0.tgz",
+ "integrity": "sha512-6taW4B4WUcEiT2V9BbOmwyGuwuAFT2G8yghF7nyNW1/2gq5+6aTqSPcS9lS6ArvEkX55vbPAS/Jarx5LSm4Fng==",
"dev": true,
"requires": {
- "@jest/types": "^24.5.0"
+ "@jest/types": "^24.7.0"
}
},
"jest-pnp-resolver": {
@@ -9920,12 +10289,12 @@
"dev": true
},
"jest-resolve": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-24.5.0.tgz",
- "integrity": "sha512-ZIfGqLX1Rg8xJpQqNjdoO8MuxHV1q/i2OO1hLXjgCWFWs5bsedS8UrOdgjUqqNae6DXA+pCyRmdcB7lQEEbXew==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-24.7.1.tgz",
+ "integrity": "sha512-Bgrc+/UUZpGJ4323sQyj85hV9d+ANyPNu6XfRDUcyFNX1QrZpSoM0kE4Mb2vZMAYTJZsBFzYe8X1UaOkOELSbw==",
"dev": true,
"requires": {
- "@jest/types": "^24.5.0",
+ "@jest/types": "^24.7.0",
"browser-resolve": "^1.11.3",
"chalk": "^2.0.1",
"jest-pnp-resolver": "^1.2.1",
@@ -9933,68 +10302,68 @@
}
},
"jest-resolve-dependencies": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-24.5.0.tgz",
- "integrity": "sha512-dRVM1D+gWrFfrq2vlL5P9P/i8kB4BOYqYf3S7xczZ+A6PC3SgXYSErX/ScW/469pWMboM1uAhgLF+39nXlirCQ==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-24.7.1.tgz",
+ "integrity": "sha512-2Eyh5LJB2liNzfk4eo7bD1ZyBbqEJIyyrFtZG555cSWW9xVHxII2NuOkSl1yUYTAYCAmM2f2aIT5A7HzNmubyg==",
"dev": true,
"requires": {
- "@jest/types": "^24.5.0",
+ "@jest/types": "^24.7.0",
"jest-regex-util": "^24.3.0",
- "jest-snapshot": "^24.5.0"
+ "jest-snapshot": "^24.7.1"
}
},
"jest-runner": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-24.5.0.tgz",
- "integrity": "sha512-oqsiS9TkIZV5dVkD+GmbNfWBRPIvxqmlTQ+AQUJUQ07n+4xTSDc40r+aKBynHw9/tLzafC00DIbJjB2cOZdvMA==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-24.7.1.tgz",
+ "integrity": "sha512-aNFc9liWU/xt+G9pobdKZ4qTeG/wnJrJna3VqunziDNsWT3EBpmxXZRBMKCsNMyfy+A/XHiV+tsMLufdsNdgCw==",
"dev": true,
"requires": {
- "@jest/console": "^24.3.0",
- "@jest/environment": "^24.5.0",
- "@jest/test-result": "^24.5.0",
- "@jest/types": "^24.5.0",
+ "@jest/console": "^24.7.1",
+ "@jest/environment": "^24.7.1",
+ "@jest/test-result": "^24.7.1",
+ "@jest/types": "^24.7.0",
"chalk": "^2.4.2",
"exit": "^0.1.2",
"graceful-fs": "^4.1.15",
- "jest-config": "^24.5.0",
+ "jest-config": "^24.7.1",
"jest-docblock": "^24.3.0",
- "jest-haste-map": "^24.5.0",
- "jest-jasmine2": "^24.5.0",
- "jest-leak-detector": "^24.5.0",
- "jest-message-util": "^24.5.0",
- "jest-resolve": "^24.5.0",
- "jest-runtime": "^24.5.0",
- "jest-util": "^24.5.0",
- "jest-worker": "^24.4.0",
+ "jest-haste-map": "^24.7.1",
+ "jest-jasmine2": "^24.7.1",
+ "jest-leak-detector": "^24.7.0",
+ "jest-message-util": "^24.7.1",
+ "jest-resolve": "^24.7.1",
+ "jest-runtime": "^24.7.1",
+ "jest-util": "^24.7.1",
+ "jest-worker": "^24.6.0",
"source-map-support": "^0.5.6",
"throat": "^4.0.0"
}
},
"jest-runtime": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-24.5.0.tgz",
- "integrity": "sha512-GTFHzfLdwpaeoDPilNpBrorlPoNZuZrwKKzKJs09vWwHo+9TOsIIuszK8cWOuKC7ss07aN1922Ge8fsGdsqCuw==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-24.7.1.tgz",
+ "integrity": "sha512-0VAbyBy7tll3R+82IPJpf6QZkokzXPIS71aDeqh+WzPRXRCNz6StQ45otFariPdJ4FmXpDiArdhZrzNAC3sj6A==",
"dev": true,
"requires": {
- "@jest/console": "^24.3.0",
- "@jest/environment": "^24.5.0",
+ "@jest/console": "^24.7.1",
+ "@jest/environment": "^24.7.1",
"@jest/source-map": "^24.3.0",
- "@jest/transform": "^24.5.0",
- "@jest/types": "^24.5.0",
+ "@jest/transform": "^24.7.1",
+ "@jest/types": "^24.7.0",
"@types/yargs": "^12.0.2",
"chalk": "^2.0.1",
"exit": "^0.1.2",
"glob": "^7.1.3",
"graceful-fs": "^4.1.15",
- "jest-config": "^24.5.0",
- "jest-haste-map": "^24.5.0",
- "jest-message-util": "^24.5.0",
- "jest-mock": "^24.5.0",
+ "jest-config": "^24.7.1",
+ "jest-haste-map": "^24.7.1",
+ "jest-message-util": "^24.7.1",
+ "jest-mock": "^24.7.0",
"jest-regex-util": "^24.3.0",
- "jest-resolve": "^24.5.0",
- "jest-snapshot": "^24.5.0",
- "jest-util": "^24.5.0",
- "jest-validate": "^24.5.0",
+ "jest-resolve": "^24.7.1",
+ "jest-snapshot": "^24.7.1",
+ "jest-util": "^24.7.1",
+ "jest-validate": "^24.7.0",
"realpath-native": "^1.1.0",
"slash": "^2.0.0",
"strip-bom": "^3.0.0",
@@ -10008,37 +10377,36 @@
"dev": true
},
"jest-snapshot": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-24.5.0.tgz",
- "integrity": "sha512-eBEeJb5ROk0NcpodmSKnCVgMOo+Qsu5z9EDl3tGffwPzK1yV37mjGWF2YeIz1NkntgTzP+fUL4s09a0+0dpVWA==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-24.7.1.tgz",
+ "integrity": "sha512-8Xk5O4p+JsZZn4RCNUS3pxA+ORKpEKepE+a5ejIKrId9CwrVN0NY+vkqEkXqlstA5NMBkNahXkR/4qEBy0t5yA==",
"dev": true,
"requires": {
"@babel/types": "^7.0.0",
- "@jest/types": "^24.5.0",
+ "@jest/types": "^24.7.0",
"chalk": "^2.0.1",
- "expect": "^24.5.0",
- "jest-diff": "^24.5.0",
- "jest-matcher-utils": "^24.5.0",
- "jest-message-util": "^24.5.0",
- "jest-resolve": "^24.5.0",
+ "expect": "^24.7.1",
+ "jest-diff": "^24.7.0",
+ "jest-matcher-utils": "^24.7.0",
+ "jest-message-util": "^24.7.1",
+ "jest-resolve": "^24.7.1",
"mkdirp": "^0.5.1",
"natural-compare": "^1.4.0",
- "pretty-format": "^24.5.0",
+ "pretty-format": "^24.7.0",
"semver": "^5.5.0"
}
},
"jest-util": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-24.5.0.tgz",
- "integrity": "sha512-Xy8JsD0jvBz85K7VsTIQDuY44s+hYJyppAhcsHsOsGisVtdhar6fajf2UOf2mEVEgh15ZSdA0zkCuheN8cbr1Q==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-24.7.1.tgz",
+ "integrity": "sha512-/KilOue2n2rZ5AnEBYoxOXkeTu6vi7cjgQ8MXEkih0oeAXT6JkS3fr7/j8+engCjciOU1Nq5loMSKe0A1oeX0A==",
"dev": true,
"requires": {
- "@jest/console": "^24.3.0",
- "@jest/fake-timers": "^24.5.0",
+ "@jest/console": "^24.7.1",
+ "@jest/fake-timers": "^24.7.1",
"@jest/source-map": "^24.3.0",
- "@jest/test-result": "^24.5.0",
- "@jest/types": "^24.5.0",
- "@types/node": "*",
+ "@jest/test-result": "^24.7.1",
+ "@jest/types": "^24.7.0",
"callsites": "^3.0.0",
"chalk": "^2.0.1",
"graceful-fs": "^4.1.15",
@@ -10057,32 +10425,31 @@
}
},
"jest-validate": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-24.5.0.tgz",
- "integrity": "sha512-gg0dYszxjgK2o11unSIJhkOFZqNRQbWOAB2/LOUdsd2LfD9oXiMeuee8XsT0iRy5EvSccBgB4h/9HRbIo3MHgQ==",
+ "version": "24.7.0",
+ "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-24.7.0.tgz",
+ "integrity": "sha512-cgai/gts9B2chz1rqVdmLhzYxQbgQurh1PEQSvSgPZ8KGa1AqXsqC45W5wKEwzxKrWqypuQrQxnF4+G9VejJJA==",
"dev": true,
"requires": {
- "@jest/types": "^24.5.0",
+ "@jest/types": "^24.7.0",
"camelcase": "^5.0.0",
"chalk": "^2.0.1",
"jest-get-type": "^24.3.0",
"leven": "^2.1.0",
- "pretty-format": "^24.5.0"
+ "pretty-format": "^24.7.0"
}
},
"jest-watcher": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-24.5.0.tgz",
- "integrity": "sha512-/hCpgR6bg0nKvD3nv4KasdTxuhwfViVMHUATJlnGCD0r1QrmIssimPbmc5KfAQblAVxkD8xrzuij9vfPUk1/rA==",
+ "version": "24.7.1",
+ "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-24.7.1.tgz",
+ "integrity": "sha512-Wd6TepHLRHVKLNPacEsBwlp9raeBIO+01xrN24Dek4ggTS8HHnOzYSFnvp+6MtkkJ3KfMzy220KTi95e2rRkrw==",
"dev": true,
"requires": {
- "@jest/test-result": "^24.5.0",
- "@jest/types": "^24.5.0",
- "@types/node": "*",
+ "@jest/test-result": "^24.7.1",
+ "@jest/types": "^24.7.0",
"@types/yargs": "^12.0.9",
"ansi-escapes": "^3.0.0",
"chalk": "^2.0.1",
- "jest-util": "^24.5.0",
+ "jest-util": "^24.7.1",
"string-length": "^2.0.0"
},
"dependencies": {
@@ -10095,12 +10462,11 @@
}
},
"jest-worker": {
- "version": "24.4.0",
- "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.4.0.tgz",
- "integrity": "sha512-BH9X/klG9vxwoO99ZBUbZFfV8qO0XNZ5SIiCyYK2zOuJBl6YJVAeNIQjcoOVNu4HGEHeYEKsUWws8kSlSbZ9YQ==",
+ "version": "24.6.0",
+ "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.6.0.tgz",
+ "integrity": "sha512-jDwgW5W9qGNvpI1tNnvajh0a5IE/PuGLFmHk6aR/BZFz8tSgGw17GsDPXAJ6p91IvYDjOw8GpFbvvZGAK+DPQQ==",
"dev": true,
"requires": {
- "@types/node": "*",
"merge-stream": "^1.0.1",
"supports-color": "^6.1.0"
},
@@ -10129,9 +10495,9 @@
"dev": true
},
"js-yaml": {
- "version": "3.12.2",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.2.tgz",
- "integrity": "sha512-QHn/Lh/7HhZ/Twc7vJYQTkjuCa0kaCcDcjK5Zlk2rvnUpy7DxMJ23+Jc2dcyvltwQVg1nygAVlB2oRDFHoRS5Q==",
+ "version": "3.13.1",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
+ "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
"dev": true,
"requires": {
"argparse": "^1.0.7",
@@ -10275,9 +10641,9 @@
"integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA=="
},
"kleur": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.2.tgz",
- "integrity": "sha512-3h7B2WRT5LNXOtQiAaWonilegHcPSf9nLVXlSTci8lu1dZUuui61+EsPEZqSVxY7rXYmB2DVKMQILxaO5WL61Q==",
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz",
+ "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==",
"dev": true
},
"lcid": {
@@ -10295,26 +10661,26 @@
"dev": true
},
"lerna": {
- "version": "3.13.1",
- "resolved": "https://registry.npmjs.org/lerna/-/lerna-3.13.1.tgz",
- "integrity": "sha512-7kSz8LLozVsoUNTJzJzy+b8TnV9YdviR2Ee2PwGZSlVw3T1Rn7kOAPZjEi+3IWnOPC96zMPHVmjCmzQ4uubalw==",
+ "version": "3.13.4",
+ "resolved": "https://registry.npmjs.org/lerna/-/lerna-3.13.4.tgz",
+ "integrity": "sha512-qTp22nlpcgVrJGZuD7oHnFbTk72j2USFimc2Pj4kC0/rXmcU2xPtCiyuxLl8y6/6Lj5g9kwEuvKDZtSXujjX/A==",
"dev": true,
"requires": {
- "@lerna/add": "3.13.1",
- "@lerna/bootstrap": "3.13.1",
- "@lerna/changed": "3.13.1",
- "@lerna/clean": "3.13.1",
+ "@lerna/add": "3.13.3",
+ "@lerna/bootstrap": "3.13.3",
+ "@lerna/changed": "3.13.4",
+ "@lerna/clean": "3.13.3",
"@lerna/cli": "3.13.0",
- "@lerna/create": "3.13.1",
- "@lerna/diff": "3.13.1",
- "@lerna/exec": "3.13.1",
- "@lerna/import": "3.13.1",
- "@lerna/init": "3.13.1",
- "@lerna/link": "3.13.1",
- "@lerna/list": "3.13.1",
- "@lerna/publish": "3.13.1",
- "@lerna/run": "3.13.1",
- "@lerna/version": "3.13.1",
+ "@lerna/create": "3.13.3",
+ "@lerna/diff": "3.13.3",
+ "@lerna/exec": "3.13.3",
+ "@lerna/import": "3.13.4",
+ "@lerna/init": "3.13.3",
+ "@lerna/link": "3.13.3",
+ "@lerna/list": "3.13.3",
+ "@lerna/publish": "3.13.4",
+ "@lerna/run": "3.13.3",
+ "@lerna/version": "3.13.4",
"import-local": "^1.0.0",
"npmlog": "^4.1.2"
},
@@ -10475,15 +10841,14 @@
},
"dependencies": {
"cosmiconfig": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.1.0.tgz",
- "integrity": "sha512-kCNPvthka8gvLtzAxQXvWo4FxqRB+ftRZyPZNuab5ngvM9Y7yw7hbEysglptLgpkGX9nAOKTBVkHUAe8xtYR6Q==",
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.0.tgz",
+ "integrity": "sha512-nxt+Nfc3JAqf4WIWd0jXLjTJZmsPLrA9DDc4nRw2KFJQJK7DNooqSXrNI7tzLG50CF8axczly5UV929tBmh/7g==",
"dev": true,
"requires": {
"import-fresh": "^2.0.0",
"is-directory": "^0.3.1",
- "js-yaml": "^3.9.0",
- "lodash.get": "^4.4.2",
+ "js-yaml": "^3.13.0",
"parse-json": "^4.0.0"
}
},
@@ -10539,9 +10904,9 @@
}
},
"is-glob": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz",
- "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
+ "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
"dev": true,
"requires": {
"is-extglob": "^2.1.1"
@@ -10571,6 +10936,12 @@
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
"dev": true
},
+ "pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
+ "dev": true
+ },
"pretty-format": {
"version": "23.6.0",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-23.6.0.tgz",
@@ -10601,9 +10972,9 @@
},
"dependencies": {
"p-map": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.0.0.tgz",
- "integrity": "sha512-GO107XdrSUmtHxVoi60qc9tUl/KkNKm+X2CF4P9amalpGxv5YqVPJNfSb0wcA+syCopkZvYYIzW8OVTQW59x/w==",
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz",
+ "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==",
"dev": true
}
}
@@ -10826,6 +11197,14 @@
"parse-json": "^4.0.0",
"pify": "^3.0.0",
"strip-bom": "^3.0.0"
+ },
+ "dependencies": {
+ "pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
+ "dev": true
+ }
}
},
"loader-runner": {
@@ -10871,12 +11250,24 @@
"integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=",
"dev": true
},
+ "lodash.flattendeep": {
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz",
+ "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=",
+ "dev": true
+ },
"lodash.get": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",
"integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=",
"dev": true
},
+ "lodash.ismatch": {
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz",
+ "integrity": "sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc=",
+ "dev": true
+ },
"lodash.map": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz",
@@ -11051,18 +11442,19 @@
}
},
"macos-release": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.0.0.tgz",
- "integrity": "sha512-iCM3ZGeqIzlrH7KxYK+fphlJpCCczyHXc+HhRVbEu9uNTCrzYJjvvtefzeKTCVHd5AP/aD/fzC80JZ4ZP+dQ/A==",
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.2.0.tgz",
+ "integrity": "sha512-iV2IDxZaX8dIcM7fG6cI46uNmHUxHE4yN+Z8tKHAW1TBPMZDIKHf/3L+YnOuj/FK9il14UaVdHmiQ1tsi90ltA==",
"dev": true
},
"make-dir": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
- "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==",
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
+ "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
"dev": true,
"requires": {
- "pify": "^3.0.0"
+ "pify": "^4.0.1",
+ "semver": "^5.6.0"
}
},
"make-error": {
@@ -11165,9 +11557,9 @@
"dev": true
},
"mem": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/mem/-/mem-4.2.0.tgz",
- "integrity": "sha512-5fJxa68urlY0Ir8ijatKa3eRz5lwXnRCTvo9+TbTGAuTFJOwpGcY0X05moBd0nW45965Njt4CDI2GFQoG8DvqA==",
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz",
+ "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==",
"requires": {
"map-age-cleaner": "^0.1.1",
"mimic-fn": "^2.0.0",
@@ -11245,6 +11637,23 @@
"integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=",
"dev": true
},
+ "merge-source-map": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz",
+ "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==",
+ "dev": true,
+ "requires": {
+ "source-map": "^0.6.1"
+ },
+ "dependencies": {
+ "source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true
+ }
+ }
+ },
"merge-stream": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz",
@@ -11355,24 +11764,24 @@
"dev": true
},
"mime-db": {
- "version": "1.38.0",
- "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz",
- "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==",
+ "version": "1.40.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz",
+ "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==",
"dev": true
},
"mime-types": {
- "version": "2.1.22",
- "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz",
- "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==",
+ "version": "2.1.24",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz",
+ "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==",
"dev": true,
"requires": {
- "mime-db": "~1.38.0"
+ "mime-db": "1.40.0"
}
},
"mimic-fn": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.0.0.tgz",
- "integrity": "sha512-jbex9Yd/3lmICXwYT6gA/j2mNQGU48wCh/VzRd+/Y/PjYQtlg1gLMdZqvu9s/xH7qKvngxRObl56XZR609IMbA=="
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
+ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="
},
"mimic-response": {
"version": "1.0.1",
@@ -11557,9 +11966,9 @@
"dev": true
},
"nan": {
- "version": "2.13.1",
- "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.1.tgz",
- "integrity": "sha512-I6YB/YEuDeUZMmhscXKxGgZlFnhsn5y0hgOZBadkzfTRrZBtJDZeg6eQf7PYMIEclwmorTKK8GztsyOUSVBREA==",
+ "version": "2.13.2",
+ "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz",
+ "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==",
"dev": true
},
"nanomatch": {
@@ -11587,9 +11996,9 @@
"dev": true
},
"negotiator": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz",
- "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=",
+ "version": "0.6.2",
+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
+ "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==",
"dev": true
},
"neo-async": {
@@ -11598,24 +12007,30 @@
"integrity": "sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==",
"dev": true
},
+ "nested-error-stacks": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.0.tgz",
+ "integrity": "sha512-AO81vsIO1k1sM4Zrd6Hu7regmJN1NSiAja10gc4bX3F0wd+9rQmcuHQaHVQCYIEC8iFXnE+mavh23GOt7wBgug==",
+ "dev": true
+ },
"nice-try": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ=="
},
"node-abi": {
- "version": "2.7.1",
- "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.7.1.tgz",
- "integrity": "sha512-OV8Bq1OrPh6z+Y4dqwo05HqrRL9YNF7QVMRfq1/pguwKLG+q9UB/Lk0x5qXjO23JjJg+/jqCHSTaG1P3tfKfuw==",
+ "version": "2.8.0",
+ "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.8.0.tgz",
+ "integrity": "sha512-1/aa2clS0pue0HjckL62CsbhWWU35HARvBDXcJtYKbYR7LnIutmpxmXbuDMV9kEviD2lP/wACOgWmmwljghHyQ==",
"dev": true,
"requires": {
"semver": "^5.4.1"
}
},
"node-fetch": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.3.0.tgz",
- "integrity": "sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA==",
+ "version": "2.5.0",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.5.0.tgz",
+ "integrity": "sha512-YuZKluhWGJwCcUu4RlZstdAxr8bFfOVHakc1mplwHkk8J+tqM1Y5yraYvIUpeX8aY7+crCwiELJq7Vl0o0LWXw==",
"dev": true
},
"node-fetch-npm": {
@@ -11749,9 +12164,9 @@
}
},
"node-releases": {
- "version": "1.1.10",
- "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.10.tgz",
- "integrity": "sha512-KbUPCpfoBvb3oBkej9+nrU0/7xPlVhmhhUJ1PZqwIP5/1dJkRWKWD3OONjo6M2J7tSCBtDCumLwwqeI+DWWaLQ==",
+ "version": "1.1.17",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.17.tgz",
+ "integrity": "sha512-/SCjetyta1m7YXLgtACZGDYJdCSIBAWorDWkGCGZlydP2Ll7J48l7j/JxNYZ+xsgSPbWfdulVS/aY+GdjUsQ7Q==",
"dev": true,
"requires": {
"semver": "^5.3.0"
@@ -11922,1037 +12337,111 @@
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
},
"nwsapi": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.1.1.tgz",
- "integrity": "sha512-T5GaA1J/d34AC8mkrFD2O0DR17kwJ702ZOtJOsS8RpbsQZVOC2/xYFb1i/cw+xdM54JIlMuojjDOYct8GIWtwg==",
+ "version": "2.1.4",
+ "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.1.4.tgz",
+ "integrity": "sha512-iGfd9Y6SFdTNldEy2L0GUhcarIutFmk+MPWIn9dmj8NMIup03G08uUF2KGbbmv/Ux4RT0VZJoP/sVbWA6d/VIw==",
"dev": true
},
"nyc": {
- "version": "13.3.0",
- "resolved": "https://registry.npmjs.org/nyc/-/nyc-13.3.0.tgz",
- "integrity": "sha512-P+FwIuro2aFG6B0Esd9ZDWUd51uZrAEoGutqZxzrVmYl3qSfkLgcQpBPBjtDFsUQLFY1dvTQJPOyeqr8S9GF8w==",
- "dev": true,
- "requires": {
- "archy": "^1.0.0",
- "arrify": "^1.0.1",
- "caching-transform": "^3.0.1",
- "convert-source-map": "^1.6.0",
- "find-cache-dir": "^2.0.0",
- "find-up": "^3.0.0",
- "foreground-child": "^1.5.6",
- "glob": "^7.1.3",
- "istanbul-lib-coverage": "^2.0.3",
- "istanbul-lib-hook": "^2.0.3",
- "istanbul-lib-instrument": "^3.1.0",
- "istanbul-lib-report": "^2.0.4",
- "istanbul-lib-source-maps": "^3.0.2",
- "istanbul-reports": "^2.1.1",
- "make-dir": "^1.3.0",
- "merge-source-map": "^1.1.0",
- "resolve-from": "^4.0.0",
- "rimraf": "^2.6.3",
- "signal-exit": "^3.0.2",
- "spawn-wrap": "^1.4.2",
- "test-exclude": "^5.1.0",
- "uuid": "^3.3.2",
- "yargs": "^12.0.5",
- "yargs-parser": "^11.1.1"
- },
- "dependencies": {
- "ansi-regex": {
- "version": "3.0.0",
- "bundled": true,
- "dev": true
- },
- "append-transform": {
- "version": "1.0.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "default-require-extensions": "^2.0.0"
- }
- },
- "archy": {
- "version": "1.0.0",
- "bundled": true,
- "dev": true
- },
- "arrify": {
- "version": "1.0.1",
- "bundled": true,
- "dev": true
- },
- "async": {
- "version": "2.6.2",
- "bundled": true,
- "dev": true,
- "requires": {
- "lodash": "^4.17.11"
- }
- },
- "balanced-match": {
- "version": "1.0.0",
- "bundled": true,
- "dev": true
- },
- "brace-expansion": {
- "version": "1.1.11",
- "bundled": true,
- "dev": true,
- "requires": {
- "balanced-match": "^1.0.0",
- "concat-map": "0.0.1"
- }
- },
- "caching-transform": {
- "version": "3.0.1",
- "bundled": true,
- "dev": true,
- "requires": {
- "hasha": "^3.0.0",
- "make-dir": "^1.3.0",
- "package-hash": "^3.0.0",
- "write-file-atomic": "^2.3.0"
- }
- },
- "camelcase": {
- "version": "5.0.0",
- "bundled": true,
- "dev": true
- },
- "cliui": {
- "version": "4.1.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "string-width": "^2.1.1",
- "strip-ansi": "^4.0.0",
- "wrap-ansi": "^2.0.0"
- }
- },
- "code-point-at": {
- "version": "1.1.0",
- "bundled": true,
- "dev": true
- },
- "commander": {
- "version": "2.17.1",
- "bundled": true,
- "dev": true,
- "optional": true
- },
- "commondir": {
- "version": "1.0.1",
- "bundled": true,
- "dev": true
- },
- "concat-map": {
- "version": "0.0.1",
- "bundled": true,
- "dev": true
- },
- "convert-source-map": {
- "version": "1.6.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "safe-buffer": "~5.1.1"
- }
- },
- "cross-spawn": {
- "version": "4.0.2",
- "bundled": true,
- "dev": true,
- "requires": {
- "lru-cache": "^4.0.1",
- "which": "^1.2.9"
- }
- },
- "debug": {
- "version": "4.1.1",
- "bundled": true,
- "dev": true,
- "requires": {
- "ms": "^2.1.1"
- }
- },
- "decamelize": {
- "version": "1.2.0",
- "bundled": true,
- "dev": true
- },
- "default-require-extensions": {
- "version": "2.0.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "strip-bom": "^3.0.0"
- }
- },
- "end-of-stream": {
- "version": "1.4.1",
- "bundled": true,
- "dev": true,
- "requires": {
- "once": "^1.4.0"
- }
- },
- "error-ex": {
- "version": "1.3.2",
- "bundled": true,
- "dev": true,
- "requires": {
- "is-arrayish": "^0.2.1"
- }
- },
- "es6-error": {
- "version": "4.1.1",
- "bundled": true,
- "dev": true
- },
- "execa": {
- "version": "1.0.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "cross-spawn": "^6.0.0",
- "get-stream": "^4.0.0",
- "is-stream": "^1.1.0",
- "npm-run-path": "^2.0.0",
- "p-finally": "^1.0.0",
- "signal-exit": "^3.0.0",
- "strip-eof": "^1.0.0"
- },
- "dependencies": {
- "cross-spawn": {
- "version": "6.0.5",
- "bundled": true,
- "dev": true,
- "requires": {
- "nice-try": "^1.0.4",
- "path-key": "^2.0.1",
- "semver": "^5.5.0",
- "shebang-command": "^1.2.0",
- "which": "^1.2.9"
- }
- }
- }
- },
- "find-cache-dir": {
- "version": "2.0.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "commondir": "^1.0.1",
- "make-dir": "^1.0.0",
- "pkg-dir": "^3.0.0"
- }
- },
- "find-up": {
- "version": "3.0.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "locate-path": "^3.0.0"
- }
- },
- "foreground-child": {
- "version": "1.5.6",
- "bundled": true,
- "dev": true,
- "requires": {
- "cross-spawn": "^4",
- "signal-exit": "^3.0.0"
- }
- },
- "fs.realpath": {
- "version": "1.0.0",
- "bundled": true,
- "dev": true
- },
- "get-caller-file": {
- "version": "1.0.3",
- "bundled": true,
- "dev": true
- },
- "get-stream": {
- "version": "4.1.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "pump": "^3.0.0"
- }
- },
- "glob": {
- "version": "7.1.3",
- "bundled": true,
- "dev": true,
- "requires": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.0.4",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- }
- },
- "graceful-fs": {
- "version": "4.1.15",
- "bundled": true,
- "dev": true
- },
- "handlebars": {
- "version": "4.1.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "async": "^2.5.0",
- "optimist": "^0.6.1",
- "source-map": "^0.6.1",
- "uglify-js": "^3.1.4"
- },
- "dependencies": {
- "source-map": {
- "version": "0.6.1",
- "bundled": true,
- "dev": true
- }
- }
- },
- "has-flag": {
- "version": "3.0.0",
- "bundled": true,
- "dev": true
- },
- "hasha": {
- "version": "3.0.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "is-stream": "^1.0.1"
- }
- },
- "hosted-git-info": {
- "version": "2.7.1",
- "bundled": true,
- "dev": true
- },
- "imurmurhash": {
- "version": "0.1.4",
- "bundled": true,
- "dev": true
- },
- "inflight": {
- "version": "1.0.6",
- "bundled": true,
- "dev": true,
- "requires": {
- "once": "^1.3.0",
- "wrappy": "1"
- }
- },
- "inherits": {
- "version": "2.0.3",
- "bundled": true,
- "dev": true
- },
- "invert-kv": {
- "version": "2.0.0",
- "bundled": true,
- "dev": true
- },
- "is-arrayish": {
- "version": "0.2.1",
- "bundled": true,
- "dev": true
- },
- "is-fullwidth-code-point": {
- "version": "2.0.0",
- "bundled": true,
- "dev": true
- },
- "is-stream": {
- "version": "1.1.0",
- "bundled": true,
- "dev": true
- },
- "isexe": {
- "version": "2.0.0",
- "bundled": true,
- "dev": true
- },
- "istanbul-lib-coverage": {
- "version": "2.0.3",
- "bundled": true,
- "dev": true
- },
- "istanbul-lib-hook": {
- "version": "2.0.3",
- "bundled": true,
- "dev": true,
- "requires": {
- "append-transform": "^1.0.0"
- }
- },
- "istanbul-lib-report": {
- "version": "2.0.4",
- "bundled": true,
- "dev": true,
- "requires": {
- "istanbul-lib-coverage": "^2.0.3",
- "make-dir": "^1.3.0",
- "supports-color": "^6.0.0"
- },
- "dependencies": {
- "supports-color": {
- "version": "6.1.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "has-flag": "^3.0.0"
- }
- }
- }
- },
- "istanbul-lib-source-maps": {
- "version": "3.0.2",
- "bundled": true,
- "dev": true,
- "requires": {
- "debug": "^4.1.1",
- "istanbul-lib-coverage": "^2.0.3",
- "make-dir": "^1.3.0",
- "rimraf": "^2.6.2",
- "source-map": "^0.6.1"
- },
- "dependencies": {
- "source-map": {
- "version": "0.6.1",
- "bundled": true,
- "dev": true
- }
- }
- },
- "istanbul-reports": {
- "version": "2.1.1",
- "bundled": true,
- "dev": true,
- "requires": {
- "handlebars": "^4.1.0"
- }
- },
- "json-parse-better-errors": {
- "version": "1.0.2",
- "bundled": true,
- "dev": true
- },
- "lcid": {
- "version": "2.0.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "invert-kv": "^2.0.0"
- }
- },
- "load-json-file": {
- "version": "4.0.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "graceful-fs": "^4.1.2",
- "parse-json": "^4.0.0",
- "pify": "^3.0.0",
- "strip-bom": "^3.0.0"
- }
- },
- "locate-path": {
- "version": "3.0.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "p-locate": "^3.0.0",
- "path-exists": "^3.0.0"
- }
- },
- "lodash": {
- "version": "4.17.11",
- "bundled": true,
- "dev": true
- },
- "lodash.flattendeep": {
- "version": "4.4.0",
- "bundled": true,
- "dev": true
- },
- "lru-cache": {
- "version": "4.1.5",
- "bundled": true,
- "dev": true,
- "requires": {
- "pseudomap": "^1.0.2",
- "yallist": "^2.1.2"
- }
- },
- "make-dir": {
- "version": "1.3.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "pify": "^3.0.0"
- }
- },
- "map-age-cleaner": {
- "version": "0.1.3",
- "bundled": true,
- "dev": true,
- "requires": {
- "p-defer": "^1.0.0"
- }
- },
- "mem": {
- "version": "4.1.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "map-age-cleaner": "^0.1.1",
- "mimic-fn": "^1.0.0",
- "p-is-promise": "^2.0.0"
- }
- },
- "merge-source-map": {
- "version": "1.1.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "source-map": "^0.6.1"
- },
- "dependencies": {
- "source-map": {
- "version": "0.6.1",
- "bundled": true,
- "dev": true
- }
- }
- },
- "mimic-fn": {
- "version": "1.2.0",
- "bundled": true,
- "dev": true
- },
- "minimatch": {
- "version": "3.0.4",
- "bundled": true,
- "dev": true,
- "requires": {
- "brace-expansion": "^1.1.7"
- }
- },
- "minimist": {
- "version": "0.0.10",
- "bundled": true,
- "dev": true
- },
- "mkdirp": {
- "version": "0.5.1",
- "bundled": true,
- "dev": true,
- "requires": {
- "minimist": "0.0.8"
- },
- "dependencies": {
- "minimist": {
- "version": "0.0.8",
- "bundled": true,
- "dev": true
- }
- }
- },
- "ms": {
- "version": "2.1.1",
- "bundled": true,
- "dev": true
- },
- "nice-try": {
- "version": "1.0.5",
- "bundled": true,
- "dev": true
- },
- "normalize-package-data": {
- "version": "2.5.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "hosted-git-info": "^2.1.4",
- "resolve": "^1.10.0",
- "semver": "2 || 3 || 4 || 5",
- "validate-npm-package-license": "^3.0.1"
- }
- },
- "npm-run-path": {
- "version": "2.0.2",
- "bundled": true,
- "dev": true,
- "requires": {
- "path-key": "^2.0.0"
- }
- },
- "number-is-nan": {
- "version": "1.0.1",
- "bundled": true,
- "dev": true
- },
- "once": {
- "version": "1.4.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "wrappy": "1"
- }
- },
- "optimist": {
- "version": "0.6.1",
- "bundled": true,
- "dev": true,
- "requires": {
- "minimist": "~0.0.1",
- "wordwrap": "~0.0.2"
- }
- },
- "os-homedir": {
- "version": "1.0.2",
- "bundled": true,
- "dev": true
- },
- "os-locale": {
- "version": "3.1.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "execa": "^1.0.0",
- "lcid": "^2.0.0",
- "mem": "^4.0.0"
- }
- },
- "p-defer": {
- "version": "1.0.0",
- "bundled": true,
- "dev": true
- },
- "p-finally": {
- "version": "1.0.0",
- "bundled": true,
- "dev": true
- },
- "p-is-promise": {
- "version": "2.0.0",
- "bundled": true,
- "dev": true
- },
- "p-limit": {
- "version": "2.1.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "p-try": "^2.0.0"
- }
- },
- "p-locate": {
- "version": "3.0.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "p-limit": "^2.0.0"
- }
- },
- "p-try": {
- "version": "2.0.0",
- "bundled": true,
- "dev": true
- },
- "package-hash": {
- "version": "3.0.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "graceful-fs": "^4.1.15",
- "hasha": "^3.0.0",
- "lodash.flattendeep": "^4.4.0",
- "release-zalgo": "^1.0.0"
- }
- },
- "parse-json": {
- "version": "4.0.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "error-ex": "^1.3.1",
- "json-parse-better-errors": "^1.0.1"
- }
- },
- "path-exists": {
- "version": "3.0.0",
- "bundled": true,
- "dev": true
- },
- "path-is-absolute": {
- "version": "1.0.1",
- "bundled": true,
- "dev": true
- },
- "path-key": {
- "version": "2.0.1",
- "bundled": true,
- "dev": true
- },
- "path-parse": {
- "version": "1.0.6",
- "bundled": true,
- "dev": true
- },
- "path-type": {
- "version": "3.0.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "pify": "^3.0.0"
- }
- },
- "pify": {
- "version": "3.0.0",
- "bundled": true,
- "dev": true
- },
- "pkg-dir": {
- "version": "3.0.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "find-up": "^3.0.0"
- }
- },
- "pseudomap": {
- "version": "1.0.2",
- "bundled": true,
- "dev": true
- },
- "pump": {
- "version": "3.0.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "end-of-stream": "^1.1.0",
- "once": "^1.3.1"
- }
- },
- "read-pkg": {
- "version": "3.0.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "load-json-file": "^4.0.0",
- "normalize-package-data": "^2.3.2",
- "path-type": "^3.0.0"
- }
- },
- "read-pkg-up": {
- "version": "4.0.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "find-up": "^3.0.0",
- "read-pkg": "^3.0.0"
- }
- },
- "release-zalgo": {
- "version": "1.0.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "es6-error": "^4.0.1"
- }
- },
- "require-directory": {
- "version": "2.1.1",
- "bundled": true,
- "dev": true
- },
- "require-main-filename": {
- "version": "1.0.1",
- "bundled": true,
- "dev": true
- },
- "resolve": {
- "version": "1.10.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "path-parse": "^1.0.6"
- }
- },
- "resolve-from": {
- "version": "4.0.0",
- "bundled": true,
- "dev": true
- },
- "rimraf": {
- "version": "2.6.3",
- "bundled": true,
- "dev": true,
- "requires": {
- "glob": "^7.1.3"
- }
- },
- "safe-buffer": {
- "version": "5.1.2",
- "bundled": true,
- "dev": true
- },
- "semver": {
- "version": "5.6.0",
- "bundled": true,
- "dev": true
- },
- "set-blocking": {
- "version": "2.0.0",
- "bundled": true,
- "dev": true
- },
- "shebang-command": {
- "version": "1.2.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "shebang-regex": "^1.0.0"
- }
- },
- "shebang-regex": {
- "version": "1.0.0",
- "bundled": true,
- "dev": true
- },
- "signal-exit": {
- "version": "3.0.2",
- "bundled": true,
- "dev": true
- },
- "spawn-wrap": {
- "version": "1.4.2",
- "bundled": true,
- "dev": true,
- "requires": {
- "foreground-child": "^1.5.6",
- "mkdirp": "^0.5.0",
- "os-homedir": "^1.0.1",
- "rimraf": "^2.6.2",
- "signal-exit": "^3.0.2",
- "which": "^1.3.0"
- }
- },
- "spdx-correct": {
- "version": "3.1.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "spdx-expression-parse": "^3.0.0",
- "spdx-license-ids": "^3.0.0"
- }
- },
- "spdx-exceptions": {
- "version": "2.2.0",
- "bundled": true,
- "dev": true
- },
- "spdx-expression-parse": {
- "version": "3.0.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "spdx-exceptions": "^2.1.0",
- "spdx-license-ids": "^3.0.0"
- }
- },
- "spdx-license-ids": {
- "version": "3.0.3",
- "bundled": true,
- "dev": true
- },
- "string-width": {
- "version": "2.1.1",
- "bundled": true,
- "dev": true,
- "requires": {
- "is-fullwidth-code-point": "^2.0.0",
- "strip-ansi": "^4.0.0"
- }
- },
- "strip-ansi": {
- "version": "4.0.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "ansi-regex": "^3.0.0"
- }
- },
- "strip-bom": {
- "version": "3.0.0",
- "bundled": true,
- "dev": true
- },
- "strip-eof": {
- "version": "1.0.0",
- "bundled": true,
- "dev": true
- },
- "test-exclude": {
- "version": "5.1.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "arrify": "^1.0.1",
- "minimatch": "^3.0.4",
- "read-pkg-up": "^4.0.0",
- "require-main-filename": "^1.0.1"
- }
- },
- "uglify-js": {
- "version": "3.4.9",
- "bundled": true,
- "dev": true,
- "optional": true,
- "requires": {
- "commander": "~2.17.1",
- "source-map": "~0.6.1"
- },
- "dependencies": {
- "source-map": {
- "version": "0.6.1",
- "bundled": true,
- "dev": true,
- "optional": true
- }
- }
- },
- "uuid": {
- "version": "3.3.2",
- "bundled": true,
- "dev": true
- },
- "validate-npm-package-license": {
- "version": "3.0.4",
- "bundled": true,
- "dev": true,
- "requires": {
- "spdx-correct": "^3.0.0",
- "spdx-expression-parse": "^3.0.0"
- }
- },
- "which": {
- "version": "1.3.1",
- "bundled": true,
- "dev": true,
- "requires": {
- "isexe": "^2.0.0"
- }
- },
- "which-module": {
- "version": "2.0.0",
- "bundled": true,
- "dev": true
- },
- "wordwrap": {
- "version": "0.0.3",
- "bundled": true,
- "dev": true
- },
- "wrap-ansi": {
- "version": "2.1.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "string-width": "^1.0.1",
- "strip-ansi": "^3.0.1"
- },
- "dependencies": {
- "ansi-regex": {
- "version": "2.1.1",
- "bundled": true,
- "dev": true
- },
- "is-fullwidth-code-point": {
- "version": "1.0.0",
- "bundled": true,
- "dev": true,
- "requires": {
- "number-is-nan": "^1.0.0"
- }
- },
- "string-width": {
- "version": "1.0.2",
- "bundled": true,
- "dev": true,
- "requires": {
- "code-point-at": "^1.0.0",
- "is-fullwidth-code-point": "^1.0.0",
- "strip-ansi": "^3.0.0"
- }
- },
- "strip-ansi": {
- "version": "3.0.1",
- "bundled": true,
- "dev": true,
- "requires": {
- "ansi-regex": "^2.0.0"
- }
- }
- }
+ "version": "14.1.0",
+ "resolved": "https://registry.npmjs.org/nyc/-/nyc-14.1.0.tgz",
+ "integrity": "sha512-iy9fEV8Emevz3z/AanIZsoGa8F4U2p0JKevZ/F0sk+/B2r9E6Qn+EPs0bpxEhnAt6UPlTL8mQZIaSJy8sK0ZFw==",
+ "dev": true,
+ "requires": {
+ "archy": "^1.0.0",
+ "caching-transform": "^3.0.2",
+ "convert-source-map": "^1.6.0",
+ "cp-file": "^6.2.0",
+ "find-cache-dir": "^2.1.0",
+ "find-up": "^3.0.0",
+ "foreground-child": "^1.5.6",
+ "glob": "^7.1.3",
+ "istanbul-lib-coverage": "^2.0.5",
+ "istanbul-lib-hook": "^2.0.7",
+ "istanbul-lib-instrument": "^3.3.0",
+ "istanbul-lib-report": "^2.0.8",
+ "istanbul-lib-source-maps": "^3.0.6",
+ "istanbul-reports": "^2.2.4",
+ "js-yaml": "^3.13.1",
+ "make-dir": "^2.1.0",
+ "merge-source-map": "^1.1.0",
+ "resolve-from": "^4.0.0",
+ "rimraf": "^2.6.3",
+ "signal-exit": "^3.0.2",
+ "spawn-wrap": "^1.4.2",
+ "test-exclude": "^5.2.3",
+ "uuid": "^3.3.2",
+ "yargs": "^13.2.2",
+ "yargs-parser": "^13.0.0"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
+ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
+ "dev": true
},
- "wrappy": {
- "version": "1.0.2",
- "bundled": true,
+ "get-caller-file": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
+ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
"dev": true
},
- "write-file-atomic": {
- "version": "2.4.2",
- "bundled": true,
- "dev": true,
- "requires": {
- "graceful-fs": "^4.1.11",
- "imurmurhash": "^0.1.4",
- "signal-exit": "^3.0.2"
- }
+ "require-main-filename": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
+ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
+ "dev": true
},
- "y18n": {
+ "resolve-from": {
"version": "4.0.0",
- "bundled": true,
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
+ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
"dev": true
},
- "yallist": {
- "version": "2.1.2",
- "bundled": true,
- "dev": true
+ "string-width": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
+ "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
+ "dev": true,
+ "requires": {
+ "emoji-regex": "^7.0.1",
+ "is-fullwidth-code-point": "^2.0.0",
+ "strip-ansi": "^5.1.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
+ "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^4.1.0"
+ }
},
"yargs": {
- "version": "12.0.5",
- "bundled": true,
+ "version": "13.2.2",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz",
+ "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==",
"dev": true,
"requires": {
"cliui": "^4.0.0",
- "decamelize": "^1.2.0",
"find-up": "^3.0.0",
- "get-caller-file": "^1.0.1",
- "os-locale": "^3.0.0",
+ "get-caller-file": "^2.0.1",
+ "os-locale": "^3.1.0",
"require-directory": "^2.1.1",
- "require-main-filename": "^1.0.1",
+ "require-main-filename": "^2.0.0",
"set-blocking": "^2.0.0",
- "string-width": "^2.0.0",
+ "string-width": "^3.0.0",
"which-module": "^2.0.0",
- "y18n": "^3.2.1 || ^4.0.0",
- "yargs-parser": "^11.1.1"
+ "y18n": "^4.0.0",
+ "yargs-parser": "^13.0.0"
}
},
"yargs-parser": {
- "version": "11.1.1",
- "bundled": true,
+ "version": "13.0.0",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz",
+ "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==",
"dev": true,
"requires": {
"camelcase": "^5.0.0",
@@ -13002,9 +12491,9 @@
}
},
"object-keys": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.0.tgz",
- "integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==",
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
+ "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
"dev": true
},
"object-visit": {
@@ -13075,9 +12564,9 @@
"dev": true
},
"opn": {
- "version": "5.4.0",
- "resolved": "https://registry.npmjs.org/opn/-/opn-5.4.0.tgz",
- "integrity": "sha512-YF9MNdVy/0qvJvDtunAOzFw9iasOQHpVthTCvGzxt61Il64AYSGdK+rYwld7NAfk9qJ7dt+hymBNSc9LNYS+Sw==",
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz",
+ "integrity": "sha512-PqHpggC9bLV0VeWcdKhkpxY+3JTzetLSqTCWL/z/tFIbI6G8JCjondXklT1JinczLz2Xib62sSp0T/gKT4KksA==",
"dev": true,
"requires": {
"is-wsl": "^1.1.0"
@@ -13155,12 +12644,12 @@
}
},
"os-name": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/os-name/-/os-name-3.0.0.tgz",
- "integrity": "sha512-7c74tib2FsdFbQ3W+qj8Tyd1R3Z6tuVRNNxXjJcZ4NgjIEQU9N/prVMqcW29XZPXGACqaXN3jq58/6hoaoXH6g==",
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz",
+ "integrity": "sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==",
"dev": true,
"requires": {
- "macos-release": "^2.0.0",
+ "macos-release": "^2.2.0",
"windows-release": "^3.1.0"
}
},
@@ -13200,9 +12689,9 @@
"integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4="
},
"p-is-promise": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.0.0.tgz",
- "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg=="
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz",
+ "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg=="
},
"p-limit": {
"version": "2.2.0",
@@ -13248,9 +12737,9 @@
"dev": true
},
"p-try": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz",
- "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ=="
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
+ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ=="
},
"p-waterfall": {
"version": "1.0.0",
@@ -13261,6 +12750,18 @@
"p-reduce": "^1.0.0"
}
},
+ "package-hash": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-3.0.0.tgz",
+ "integrity": "sha512-lOtmukMDVvtkL84rJHI7dpTYq+0rli8N2wlnqUcBuDWCfVhRUfOmnR9SsoHFMLpACvEV60dX7rd0rFaYDZI+FA==",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "^4.1.15",
+ "hasha": "^3.0.0",
+ "lodash.flattendeep": "^4.4.0",
+ "release-zalgo": "^1.0.0"
+ }
+ },
"pacote": {
"version": "9.5.0",
"resolved": "https://registry.npmjs.org/pacote/-/pacote-9.5.0.tgz",
@@ -13363,9 +12864,9 @@
}
},
"parent-module": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.0.tgz",
- "integrity": "sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA==",
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
+ "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
"dev": true,
"requires": {
"callsites": "^3.0.0"
@@ -13435,9 +12936,9 @@
"dev": true
},
"parseurl": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz",
- "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=",
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
+ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
"dev": true
},
"pascalcase": {
@@ -13498,6 +12999,14 @@
"dev": true,
"requires": {
"pify": "^3.0.0"
+ },
+ "dependencies": {
+ "pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
+ "dev": true
+ }
}
},
"pbkdf2": {
@@ -13520,9 +13029,9 @@
"dev": true
},
"pify": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
- "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
+ "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
"dev": true
},
"pinkie": {
@@ -13650,9 +13159,9 @@
"dev": true
},
"prettier": {
- "version": "1.16.4",
- "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.16.4.tgz",
- "integrity": "sha512-ZzWuos7TI5CKUeQAtFd6Zhm2s6EpAD/ZLApIhsF9pRvRtM1RFo61dM/4MSRUA0SuLugA/zgrZD8m0BaY46Og7g==",
+ "version": "1.17.0",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.17.0.tgz",
+ "integrity": "sha512-sXe5lSt2WQlCbydGETgfm1YBShgOX4HxQkFPvbxkcwgDvGDeqVau8h+12+lmSVlP3rHPz0oavfddSZg/q+Szjw==",
"dev": true
},
"prettier-eslint": {
@@ -14610,12 +14119,12 @@
}
},
"pretty-format": {
- "version": "24.5.0",
- "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.5.0.tgz",
- "integrity": "sha512-/3RuSghukCf8Riu5Ncve0iI+BzVkbRU5EeUoArKARZobREycuH5O4waxvaNIloEXdb0qwgmEAed5vTpX1HNROQ==",
+ "version": "24.7.0",
+ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.7.0.tgz",
+ "integrity": "sha512-apen5cjf/U4dj7tHetpC7UEFCvtAgnNZnBDkfPv3fokzIqyOJckAG9OlAPC1BlFALnqT/lGB2tl9EJjlK6eCsA==",
"dev": true,
"requires": {
- "@jest/types": "^24.5.0",
+ "@jest/types": "^24.7.0",
"ansi-regex": "^4.0.0",
"ansi-styles": "^3.2.0",
"react-is": "^16.8.4"
@@ -14706,9 +14215,9 @@
}
},
"prompts": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.0.3.tgz",
- "integrity": "sha512-H8oWEoRZpybm6NV4to9/1limhttEo13xK62pNvn2JzY0MA03p7s0OjtmhXyon3uJmxiJJVSuUwEJFFssI3eBiQ==",
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.0.4.tgz",
+ "integrity": "sha512-HTzM3UWp/99A0gk51gAegwo1QRYA7xjcZufMNe33rCclFszUYAuHe1fIN/3ZmiHeGPkUsNaRyQm1hHOfM0PKxA==",
"dev": true,
"requires": {
"kleur": "^3.0.2",
@@ -14746,13 +14255,13 @@
}
},
"proxy-addr": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz",
- "integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==",
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz",
+ "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==",
"dev": true,
"requires": {
"forwarded": "~0.1.2",
- "ipaddr.js": "1.8.0"
+ "ipaddr.js": "1.9.0"
}
},
"prr": {
@@ -14849,9 +14358,9 @@
"dev": true
},
"querystringify": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.0.tgz",
- "integrity": "sha512-sluvZZ1YiTLD5jsqZcDmFyV2EwToyXZBfpoVOmktMmW+VEnhgakFHnasVph65fOjGPTWN0Nw3+XQaSeMayr0kg==",
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz",
+ "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==",
"dev": true
},
"quick-lru": {
@@ -14927,9 +14436,9 @@
}
},
"react-is": {
- "version": "16.8.4",
- "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.4.tgz",
- "integrity": "sha512-PVadd+WaUDOAciICm/J1waJaSvgq+4rHE/K70j0PFqKhkTBsPv/82UGQJNXAngz1fOQLLxI6z1sEDmJDQhCTAA==",
+ "version": "16.8.6",
+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.6.tgz",
+ "integrity": "sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==",
"dev": true
},
"read": {
@@ -15051,9 +14560,9 @@
}
},
"readable-stream": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.2.0.tgz",
- "integrity": "sha512-RV20kLjdmpZuTF1INEb9IA3L68Nmi+Ri7ppZqo78wj//Pn62fCoJyV9zalccNzDD/OuJpMG4f+pfMl8+L6QdGw==",
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz",
+ "integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==",
"dev": true,
"requires": {
"inherits": "^2.0.3",
@@ -15191,9 +14700,9 @@
}
},
"regexp-tree": {
- "version": "0.1.5",
- "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.5.tgz",
- "integrity": "sha512-nUmxvfJyAODw+0B13hj8CFVAxhe7fDEAgJgaotBu3nnR+IgGgZq59YedJP5VYTlkEfqjuK6TuRpnymKdatLZfQ==",
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.6.tgz",
+ "integrity": "sha512-LFrA98Dw/heXqDojz7qKFdygZmFoiVlvE1Zp7Cq2cvF+ZA+03Gmhy0k0PQlsC1jvHPiTUSs+pDHEuSWv6+6D7w==",
"dev": true
},
"regexpp": {
@@ -15239,6 +14748,15 @@
}
}
},
+ "release-zalgo": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz",
+ "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=",
+ "dev": true,
+ "requires": {
+ "es6-error": "^4.0.1"
+ }
+ },
"remove-trailing-separator": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz",
@@ -15367,6 +14885,12 @@
}
}
},
+ "requireindex": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz",
+ "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==",
+ "dev": true
+ },
"requires-port": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
@@ -15380,9 +14904,9 @@
"dev": true
},
"resolve": {
- "version": "1.10.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz",
- "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==",
+ "version": "1.10.1",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.1.tgz",
+ "integrity": "sha512-KuIe4mf++td/eFb6wkaPbMDnP6kObCaEtIDuHOUED6MNUo4K670KZUHuuvYPZDxNF0WVLw49n06M2m2dXphEzA==",
"dev": true,
"requires": {
"path-parse": "^1.0.6"
@@ -15533,9 +15057,9 @@
}
},
"rxjs": {
- "version": "6.4.0",
- "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.4.0.tgz",
- "integrity": "sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw==",
+ "version": "6.5.1",
+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.1.tgz",
+ "integrity": "sha512-y0j31WJc83wPu31vS1VlAFW5JGrnGC+j+TtGAa1fRQphy48+fDYiDmX8tjGloToEsMkxnouOg/1IzXGKkJnZMg==",
"dev": true,
"requires": {
"tslib": "^1.9.0"
@@ -15618,9 +15142,9 @@
}
},
"semver": {
- "version": "5.6.0",
- "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz",
- "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg=="
+ "version": "5.7.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz",
+ "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA=="
},
"semver-compare": {
"version": "1.0.0",
@@ -15650,9 +15174,9 @@
}
},
"serialize-javascript": {
- "version": "1.6.1",
- "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.6.1.tgz",
- "integrity": "sha512-A5MOagrPFga4YaKQSWHryl7AXvbQkEqpw4NNYMTNYUNV51bA8ABHgYFpqKx+YFFrw59xMV1qGH1R4AgoNIVgCw==",
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.7.0.tgz",
+ "integrity": "sha512-ke8UG8ulpFOxO8f8gRYabHQe/ZntKlcig2Mp+8+URDP1D8vJZ0KUt7LYo07q25Z/+JVSgpr/cui9PIp5H6/+nA==",
"dev": true
},
"serve-index": {
@@ -16017,9 +15541,9 @@
}
},
"source-map-support": {
- "version": "0.5.11",
- "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.11.tgz",
- "integrity": "sha512-//sajEx/fGL3iw6fltKMdPvy8kL3kJ2O3iuYlRoT3k9Kb4BjOoZ+BZzaNHeuaruSt+Kf3Zk9tnfAQg9/AJqUVQ==",
+ "version": "0.5.12",
+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz",
+ "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==",
"dev": true,
"requires": {
"buffer-from": "^1.0.0",
@@ -16039,6 +15563,20 @@
"resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz",
"integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM="
},
+ "spawn-wrap": {
+ "version": "1.4.2",
+ "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.4.2.tgz",
+ "integrity": "sha512-vMwR3OmmDhnxCVxM8M+xO/FtIp6Ju/mNaDfCMMW7FDcLRTPFWUswec4LXJHTJE2hwTI9O0YBfygu4DalFl7Ylg==",
+ "dev": true,
+ "requires": {
+ "foreground-child": "^1.5.6",
+ "mkdirp": "^0.5.0",
+ "os-homedir": "^1.0.1",
+ "rimraf": "^2.6.2",
+ "signal-exit": "^3.0.2",
+ "which": "^1.3.0"
+ }
+ },
"spdx-correct": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz",
@@ -16066,9 +15604,9 @@
}
},
"spdx-license-ids": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz",
- "integrity": "sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==",
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz",
+ "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==",
"dev": true
},
"spdy": {
@@ -16469,9 +16007,9 @@
}
},
"strip-ansi": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.1.0.tgz",
- "integrity": "sha512-TjxrkPONqO2Z8QDCpeE2j6n0M6EwxzyDgzEeGp+FbdvaJAt//ClYi6W5my+3ROlC/hZX2KACUwDfK49Ka5eDvg==",
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
+ "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
"dev": true,
"requires": {
"ansi-regex": "^4.1.0"
@@ -16480,9 +16018,9 @@
}
},
"tapable": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.1.tgz",
- "integrity": "sha512-9I2ydhj8Z9veORCw5PRm4u9uebCn0mcCa6scWoNcbZ6dAtoo2618u9UUzxgmsCOreJpqDDuv61LvwofW7hLcBA=="
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz",
+ "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA=="
},
"tar": {
"version": "2.2.1",
@@ -16589,6 +16127,23 @@
"pify": "^3.0.0",
"temp-dir": "^1.0.0",
"uuid": "^3.0.1"
+ },
+ "dependencies": {
+ "make-dir": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
+ "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==",
+ "dev": true,
+ "requires": {
+ "pify": "^3.0.0"
+ }
+ },
+ "pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
+ "dev": true
+ }
}
},
"tempfile": {
@@ -16644,33 +16199,6 @@
"worker-farm": "^1.5.2"
},
"dependencies": {
- "find-cache-dir": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz",
- "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==",
- "dev": true,
- "requires": {
- "commondir": "^1.0.1",
- "make-dir": "^2.0.0",
- "pkg-dir": "^3.0.0"
- }
- },
- "make-dir": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
- "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
- "dev": true,
- "requires": {
- "pify": "^4.0.1",
- "semver": "^5.6.0"
- }
- },
- "pify": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
- "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
- "dev": true
- },
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
@@ -16680,15 +16208,15 @@
}
},
"test-exclude": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.1.0.tgz",
- "integrity": "sha512-gwf0S2fFsANC55fSeSqpb8BYk6w3FDvwZxfNjeF6FRgvFa43r+7wRiA/Q0IxoRU37wB/LE8IQ4221BsNucTaCA==",
+ "version": "5.2.3",
+ "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz",
+ "integrity": "sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==",
"dev": true,
"requires": {
- "arrify": "^1.0.1",
+ "glob": "^7.1.3",
"minimatch": "^3.0.4",
"read-pkg-up": "^4.0.0",
- "require-main-filename": "^1.0.1"
+ "require-main-filename": "^2.0.0"
},
"dependencies": {
"read-pkg-up": {
@@ -16700,6 +16228,12 @@
"find-up": "^3.0.0",
"read-pkg": "^3.0.0"
}
+ },
+ "require-main-filename": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
+ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
+ "dev": true
}
}
},
@@ -16950,31 +16484,10 @@
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==",
"dev": true
},
- "tslint": {
- "version": "5.14.0",
- "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.14.0.tgz",
- "integrity": "sha512-IUla/ieHVnB8Le7LdQFRGlVJid2T/gaJe5VkjzRVSRR6pA2ODYrnfR1hmxi+5+au9l50jBwpbBL34txgv4NnTQ==",
- "dev": true,
- "requires": {
- "babel-code-frame": "^6.22.0",
- "builtin-modules": "^1.1.1",
- "chalk": "^2.3.0",
- "commander": "^2.12.1",
- "diff": "^3.2.0",
- "glob": "^7.1.1",
- "js-yaml": "^3.7.0",
- "minimatch": "^3.0.4",
- "mkdirp": "^0.5.1",
- "resolve": "^1.3.2",
- "semver": "^5.3.0",
- "tslib": "^1.8.0",
- "tsutils": "^2.29.0"
- }
- },
"tsutils": {
- "version": "2.29.0",
- "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz",
- "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==",
+ "version": "3.10.0",
+ "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.10.0.tgz",
+ "integrity": "sha512-q20XSMq7jutbGB8luhKKsQldRKWvyBO2BGqni3p4yq8Ys9bEP/xQw3KepKmMRt9gJ4lvQSScrihJrcKdKoSU7Q==",
"dev": true,
"requires": {
"tslib": "^1.8.1"
@@ -17011,13 +16524,13 @@
}
},
"type-is": {
- "version": "1.6.16",
- "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz",
- "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==",
+ "version": "1.6.18",
+ "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
+ "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
"dev": true,
"requires": {
"media-typer": "0.3.0",
- "mime-types": "~2.1.18"
+ "mime-types": "~2.1.24"
}
},
"typedarray": {
@@ -17027,9 +16540,9 @@
"dev": true
},
"typedoc": {
- "version": "0.13.0",
- "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.13.0.tgz",
- "integrity": "sha512-jQWtvPcV+0fiLZAXFEe70v5gqjDO6pJYJz4mlTtmGJeW2KRoIU/BEfktma6Uj8Xii7UakuZjbxFewl3UYOkU/w==",
+ "version": "0.14.2",
+ "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.14.2.tgz",
+ "integrity": "sha512-aEbgJXV8/KqaVhcedT7xG6d2r+mOvB5ep3eIz1KuB5sc4fDYXcepEEMdU7XSqLFO5hVPu0nllHi1QxX2h/QlpQ==",
"dev": true,
"requires": {
"@types/fs-extra": "^5.0.3",
@@ -17041,14 +16554,14 @@
"@types/shelljs": "^0.8.0",
"fs-extra": "^7.0.0",
"handlebars": "^4.0.6",
- "highlight.js": "^9.0.0",
+ "highlight.js": "^9.13.1",
"lodash": "^4.17.10",
"marked": "^0.4.0",
"minimatch": "^3.0.0",
"progress": "^2.0.0",
"shelljs": "^0.8.2",
"typedoc-default-themes": "^0.5.0",
- "typescript": "3.1.x"
+ "typescript": "3.2.x"
},
"dependencies": {
"shelljs": {
@@ -17063,9 +16576,9 @@
}
},
"typescript": {
- "version": "3.1.6",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.1.6.tgz",
- "integrity": "sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA==",
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.4.tgz",
+ "integrity": "sha512-0RNDbSdEokBeEAkgNbxJ+BLwSManFy9TeXz8uW+48j/xhEXv1ePME60olyzw2XzUqUBNAYFeJadIqAgNqIACwg==",
"dev": true
}
}
@@ -17095,9 +16608,9 @@
}
},
"typescript": {
- "version": "3.3.3333",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.3333.tgz",
- "integrity": "sha512-JjSKsAfuHBE/fB2oZ8NxtRTk5iGcg6hkYXMnZ3Wc+b2RSqejEqTaem11mHASMnFilHrax3sLK0GDzcJrekZYLw==",
+ "version": "3.4.5",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.5.tgz",
+ "integrity": "sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw==",
"dev": true
},
"typescript-eslint-parser": {
@@ -17119,13 +16632,13 @@
}
},
"uglify-js": {
- "version": "3.4.10",
- "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.10.tgz",
- "integrity": "sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw==",
+ "version": "3.5.10",
+ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.10.tgz",
+ "integrity": "sha512-/GTF0nosyPLbdJBd+AwYiZ+Hu5z8KXWnO0WCGt1BQ/u9Iamhejykqmz5o1OHJ53+VAk6xVxychonnApDjuqGsw==",
"dev": true,
"optional": true,
"requires": {
- "commander": "~2.19.0",
+ "commander": "~2.20.0",
"source-map": "~0.6.1"
},
"dependencies": {
@@ -17324,12 +16837,12 @@
}
},
"url-parse": {
- "version": "1.4.4",
- "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.4.tgz",
- "integrity": "sha512-/92DTTorg4JjktLNLe6GPS2/RvAd/RGr6LuktmWSMLEOa6rjnlrFXNgSbSmkNvCoL2T028A0a1JaJLzRMlFoHg==",
+ "version": "1.4.7",
+ "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz",
+ "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==",
"dev": true,
"requires": {
- "querystringify": "^2.0.0",
+ "querystringify": "^2.1.1",
"requires-port": "^1.0.0"
}
},
@@ -17633,9 +17146,9 @@
"dev": true
},
"webpack": {
- "version": "4.29.6",
- "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.29.6.tgz",
- "integrity": "sha512-MwBwpiE1BQpMDkbnUUaW6K8RFZjljJHArC6tWQJoFm0oQtfoSebtg4Y7/QHnJ/SddtjYLHaKGX64CFjG5rehJw==",
+ "version": "4.30.0",
+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.30.0.tgz",
+ "integrity": "sha512-4hgvO2YbAFUhyTdlR4FNyt2+YaYBYHavyzjCMbZzgglo02rlKi/pcsEzwCuCpsn1ryzIl1cq/u8ArIKu8JBYMg==",
"dev": true,
"requires": {
"@webassemblyjs/ast": "1.8.5",
@@ -17673,9 +17186,9 @@
}
},
"webpack-dev-middleware": {
- "version": "3.6.1",
- "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-3.6.1.tgz",
- "integrity": "sha512-XQmemun8QJexMEvNFbD2BIg4eSKrmSIMrTfnl2nql2Sc6OGAYFyb8rwuYrCjl/IiEYYuyTEiimMscu7EXji/Dw==",
+ "version": "3.6.2",
+ "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-3.6.2.tgz",
+ "integrity": "sha512-A47I5SX60IkHrMmZUlB0ZKSWi29TZTcPz7cha1Z75yYOsgWh/1AcPmQEbC8ZIbU3A1ytSv1PMU0PyPz2Lmz2jg==",
"dev": true,
"requires": {
"memory-fs": "^0.4.1",
@@ -17685,49 +17198,49 @@
},
"dependencies": {
"mime": {
- "version": "2.4.0",
- "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.0.tgz",
- "integrity": "sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w==",
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.2.tgz",
+ "integrity": "sha512-zJBfZDkwRu+j3Pdd2aHsR5GfH2jIWhmL1ZzBoc+X+3JEti2hbArWcyJ+1laC1D2/U/W1a/+Cegj0/OnEU2ybjg==",
"dev": true
}
}
},
"webpack-dev-server": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-3.2.1.tgz",
- "integrity": "sha512-sjuE4mnmx6JOh9kvSbPYw3u/6uxCLHNWfhWaIPwcXWsvWOPN+nc5baq4i9jui3oOBRXGonK9+OI0jVkaz6/rCw==",
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-3.3.1.tgz",
+ "integrity": "sha512-jY09LikOyGZrxVTXK0mgIq9y2IhCoJ05848dKZqX1gAGLU1YDqgpOT71+W53JH/wI4v6ky4hm+KvSyW14JEs5A==",
"dev": true,
"requires": {
"ansi-html": "0.0.7",
"bonjour": "^3.5.0",
- "chokidar": "^2.0.0",
- "compression": "^1.5.2",
- "connect-history-api-fallback": "^1.3.0",
+ "chokidar": "^2.1.5",
+ "compression": "^1.7.4",
+ "connect-history-api-fallback": "^1.6.0",
"debug": "^4.1.1",
- "del": "^3.0.0",
- "express": "^4.16.2",
- "html-entities": "^1.2.0",
+ "del": "^4.1.0",
+ "express": "^4.16.4",
+ "html-entities": "^1.2.1",
"http-proxy-middleware": "^0.19.1",
"import-local": "^2.0.0",
"internal-ip": "^4.2.0",
"ip": "^1.1.5",
- "killable": "^1.0.0",
- "loglevel": "^1.4.1",
- "opn": "^5.1.0",
- "portfinder": "^1.0.9",
+ "killable": "^1.0.1",
+ "loglevel": "^1.6.1",
+ "opn": "^5.5.0",
+ "portfinder": "^1.0.20",
"schema-utils": "^1.0.0",
- "selfsigned": "^1.9.1",
- "semver": "^5.6.0",
- "serve-index": "^1.7.2",
+ "selfsigned": "^1.10.4",
+ "semver": "^6.0.0",
+ "serve-index": "^1.9.1",
"sockjs": "0.3.19",
"sockjs-client": "1.3.0",
"spdy": "^4.0.0",
- "strip-ansi": "^3.0.0",
+ "strip-ansi": "^3.0.1",
"supports-color": "^6.1.0",
"url": "^0.11.0",
- "webpack-dev-middleware": "^3.5.1",
+ "webpack-dev-middleware": "^3.6.2",
"webpack-log": "^2.0.0",
- "yargs": "12.0.2"
+ "yargs": "12.0.5"
},
"dependencies": {
"ansi-regex": {
@@ -17736,12 +17249,6 @@
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"dev": true
},
- "camelcase": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
- "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=",
- "dev": true
- },
"debug": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
@@ -17751,21 +17258,18 @@
"ms": "^2.1.1"
}
},
- "decamelize": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-2.0.0.tgz",
- "integrity": "sha512-Ikpp5scV3MSYxY39ymh45ZLEecsTdv/Xj2CaQfI8RLMuwi7XvjX9H/fhraiSuU+C5w5NTDu4ZU72xNiZnurBPg==",
- "dev": true,
- "requires": {
- "xregexp": "4.0.0"
- }
- },
"ms": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
"dev": true
},
+ "semver": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz",
+ "integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==",
+ "dev": true
+ },
"strip-ansi": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
@@ -17783,35 +17287,6 @@
"requires": {
"has-flag": "^3.0.0"
}
- },
- "yargs": {
- "version": "12.0.2",
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.2.tgz",
- "integrity": "sha512-e7SkEx6N6SIZ5c5H22RTZae61qtn3PYUE8JYbBFlK9sYmh3DMQ6E5ygtaG/2BW0JZi4WGgTR2IV5ChqlqrDGVQ==",
- "dev": true,
- "requires": {
- "cliui": "^4.0.0",
- "decamelize": "^2.0.0",
- "find-up": "^3.0.0",
- "get-caller-file": "^1.0.1",
- "os-locale": "^3.0.0",
- "require-directory": "^2.1.1",
- "require-main-filename": "^1.0.1",
- "set-blocking": "^2.0.0",
- "string-width": "^2.0.0",
- "which-module": "^2.0.0",
- "y18n": "^3.2.1 || ^4.0.0",
- "yargs-parser": "^10.1.0"
- }
- },
- "yargs-parser": {
- "version": "10.1.0",
- "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz",
- "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==",
- "dev": true,
- "requires": {
- "camelcase": "^4.1.0"
- }
}
}
},
@@ -17914,35 +17389,12 @@
}
},
"windows-release": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.1.0.tgz",
- "integrity": "sha512-hBb7m7acFgQPQc222uEQTmdcGLeBmQLNLFIh0rDk3CwFOBrfjefLzEfEfmpMq8Af/n/GnFf3eYf203FY1PmudA==",
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.2.0.tgz",
+ "integrity": "sha512-QTlz2hKLrdqukrsapKsINzqMgOUpQW268eJ0OaOpJN32h272waxR9fkB9VoWRtK7uKHG5EHJcTXQBD8XZVJkFA==",
"dev": true,
"requires": {
- "execa": "^0.10.0"
- },
- "dependencies": {
- "execa": {
- "version": "0.10.0",
- "resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz",
- "integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==",
- "dev": true,
- "requires": {
- "cross-spawn": "^6.0.0",
- "get-stream": "^3.0.0",
- "is-stream": "^1.1.0",
- "npm-run-path": "^2.0.0",
- "p-finally": "^1.0.0",
- "signal-exit": "^3.0.0",
- "strip-eof": "^1.0.0"
- }
- },
- "get-stream": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
- "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=",
- "dev": true
- }
+ "execa": "^1.0.0"
}
},
"word-wrap": {
@@ -17958,9 +17410,9 @@
"dev": true
},
"worker-farm": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.6.0.tgz",
- "integrity": "sha512-6w+3tHbM87WnSWnENBUvA2pxJPLhQUg5LKwUQHq3r+XPhIM+Gh2R5ycbwPCyuGbNg+lPgdcnQUhuC02kJCvffQ==",
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz",
+ "integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==",
"dev": true,
"requires": {
"errno": "~0.1.7"
@@ -18045,6 +17497,23 @@
"pify": "^3.0.0",
"sort-keys": "^2.0.0",
"write-file-atomic": "^2.0.0"
+ },
+ "dependencies": {
+ "make-dir": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
+ "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==",
+ "dev": true,
+ "requires": {
+ "pify": "^3.0.0"
+ }
+ },
+ "pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
+ "dev": true
+ }
}
},
"write-pkg": {
@@ -18078,12 +17547,6 @@
"integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==",
"dev": true
},
- "xregexp": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.0.0.tgz",
- "integrity": "sha512-PHyM+sQouu7xspQQwELlGwwd05mXUFqwFYfqPO0cC7x4fxyHnnuetmQr6CjJiafIDoH4MogHb9dOoJzR/Y4rFg==",
- "dev": true
- },
"xtend": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
diff --git a/package.json b/package.json
index dbbf4dc175e..6a06e7a687c 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "webpack-cli",
- "version": "3.3.0",
+ "version": "3.3.2",
"description": "CLI for webpack & friends",
"license": "MIT",
"repository": {
@@ -35,14 +35,16 @@
"docs": "typedoc",
"format": "prettier-eslint ./bin/*.js ./test/**/*.js ./packages/**/*.js --write",
"lint:codeOnly": "eslint \"{bin}/**/!(__testfixtures__)/*.js\" \"{bin}/**.js\"",
- "lint": "eslint \"./bin/*.js\" \"./test/**/*.js\" \"packages/**/!(node_modules)/*.test.js\"",
- "pretest": "npm run build && npm run lint && npm run tslint",
+ "lint": "eslint \"./bin/*.js\" \"./test/**/*.js\" \"packages/**/!(node_modules)/*.ts\"",
+ "postinstall": "node ./bin/opencollective.js",
+ "pretest": "npm run build && npm run lint",
"reportCoverage": "nyc report --reporter=json && codecov -f coverage/coverage-final.json --disable=gcov",
"test": "nyc jest --maxWorkers=4 --reporters=default --reporters=jest-junit",
+ "test:cli": "nyc jest test/ --maxWorkers=4 --reporters=default --reporters=jest-junit",
+ "test:packages": "nyc jest packages/ --maxWorkers=4 --reporters=default --reporters=jest-junit",
"test:ci": "nyc jest --maxWorkers=$(nproc) --reporters=default --reporters=jest-junit",
"travis:integration": "npm run build && npm run test && npm run reportCoverage",
- "travis:lint": "npm run build && npm run lint && npm run tslint",
- "tslint": "tslint -c tslint.json \"packages/**/*.ts\"",
+ "travis:lint": "npm run build && npm run lint",
"watch": "npm run build && tsc -w"
},
"husky": {
@@ -55,15 +57,10 @@
"{packages,bin}/**/!(__testfixtures__)/**.js": [
"eslint --fix",
"git add"
- ],
- "{packages,bin}/**/!(__testfixtures__)/**.ts": [
- "tslint --fix",
- "git add"
]
},
"jest": {
"testPathIgnorePatterns": [
- "^.+\\.(ts)?$",
"/node_modules/"
],
"testEnvironment": "node",
@@ -73,9 +70,18 @@
"html",
"cobertura"
],
- "moduleNameMapper": {
+ "transform": {
"^.+\\.(ts)?$": "ts-jest"
- }
+ },
+ "testRegex": [
+ "/__tests__/.*\\.(test.js|test.ts)$",
+ "/test/.*\\.(test.js|test.ts)$"
+ ],
+ "moduleFileExtensions": [
+ "ts",
+ "js",
+ "json"
+ ]
},
"nyc": {
"include": [
@@ -134,6 +140,8 @@
"@commitlint/travis-cli": "^7.2.1",
"@types/jest": "^23.3.14",
"@types/node": "^10.12.9",
+ "@typescript-eslint/eslint-plugin": "^1.6.0",
+ "@typescript-eslint/parser": "^1.6.0",
"babel-preset-env": "^1.7.0",
"babel-preset-jest": "^24.3.0",
"bundlesize": "^0.17.0",
@@ -143,6 +151,7 @@
"conventional-changelog-cli": "^2.0.11",
"cz-customizable": "^5.3.0",
"eslint": "^5.9.0",
+ "eslint-config-prettier": "^4.1.0",
"eslint-plugin-node": "^8.0.0",
"esm": "^3.2.14",
"execa": "^1.0.0",
@@ -150,21 +159,20 @@
"jest": "^24.3.1",
"jest-cli": "^24.3.1",
"jest-junit": "^6.3.0",
- "lerna": "^3.13.1",
+ "lerna": "^3.13.4",
"lint-staged": "7.x.x",
- "nyc": "^13.3.0",
+ "nyc": "^14.1.0",
"prettier-eslint-cli": "^4.7.1",
"readable-stream": "^3.0.6",
"rimraf": "^2.6.2",
"schema-utils": "^1.0.0",
"ts-jest": "^23.10.5",
"ts-node": "^7.0.1",
- "tslint": "^5.11.0",
- "typedoc": "^0.13.0",
+ "typedoc": "^0.14.2",
"typedoc-plugin-monorepo": "^0.1.0",
"typescript": "^3.3.1",
"webpack": "4.x.x",
- "webpack-dev-server": "^3.1.10"
+ "webpack-dev-server": "^3.3.1"
},
"collective": {
"type": "opencollective",
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/.eslintrc b/packages/add/.eslintrc
new file mode 100644
index 00000000000..365d9f85d71
--- /dev/null
+++ b/packages/add/.eslintrc
@@ -0,0 +1,11 @@
+{
+ "root": true,
+ "extends": [
+ "../../.eslintrc.js",
+ "plugin:@typescript-eslint/recommended",
+ "prettier",
+ "prettier/@typescript-eslint"
+ ],
+ "parser": "@typescript-eslint/parser",
+ "plugins": ["@typescript-eslint"]
+}
diff --git a/packages/add/README.md b/packages/add/README.md
index 81145ceee68..82196d3e567 100644
--- a/packages/add/README.md
+++ b/packages/add/README.md
@@ -1,5 +1,7 @@
# webpack-cli add
+[![NPM downloads][downloads]][downloads-url]
+
## Description
This package contains the logic to add new properties in a webpack configuration file. It will run a generator that prompts the user for questions of which property to add to their webpack configuration file.
@@ -10,17 +12,28 @@ This package contains the logic to add new properties in a webpack configuration
npm i -D webpack-cli @webpack-cli/add
```
+or
+
+```bash
+yarn add --dev webpack-cli @webpack-cli/add
+```
+
## Usage
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 add = require("@webpack-cli/add").default;
add();
```
### CLI (via `webpack-cli`)
+
```bash
npx webpack-cli add
-```
\ No newline at end of file
+```
+
+[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/add/index.ts b/packages/add/index.ts
index 38f545d6889..a63515c9347 100644
--- a/packages/add/index.ts
+++ b/packages/add/index.ts
@@ -9,12 +9,11 @@ import modifyConfigHelper from "@webpack-cli/utils/modify-config-helper";
* we're given on a generator
*
*/
+const DEFAULT_WEBPACK_CONFIG_FILENAME = "webpack.config.js";
export default function add(...args: string[]): Function {
- const DEFAULT_WEBPACK_CONFIG_FILENAME: string = "webpack.config.js";
-
- const filePaths: string[] = args.slice(3);
- let configFile: string = DEFAULT_WEBPACK_CONFIG_FILENAME;
+ const filePaths = args.slice(3);
+ let configFile = DEFAULT_WEBPACK_CONFIG_FILENAME;
if (filePaths.length) {
configFile = filePaths[0];
}
diff --git a/packages/add/package-lock.json b/packages/add/package-lock.json
index 61a703534e8..dfebd320fe5 100644
--- a/packages/add/package-lock.json
+++ b/packages/add/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "@webpack-cli/add",
- "version": "0.1.2",
+ "version": "0.1.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -10,6 +10,109 @@
"integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==",
"dev": true
},
+ "@typescript-eslint/eslint-plugin": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.6.0.tgz",
+ "integrity": "sha512-U224c29E2lo861TQZs6GSmyC0OYeRNg6bE9UVIiFBxN2MlA0nq2dCrgIVyyRbC05UOcrgf2Wk/CF2gGOPQKUSQ==",
+ "dev": true,
+ "requires": {
+ "@typescript-eslint/parser": "1.6.0",
+ "@typescript-eslint/typescript-estree": "1.6.0",
+ "requireindex": "^1.2.0",
+ "tsutils": "^3.7.0"
+ }
+ },
+ "@typescript-eslint/parser": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-1.6.0.tgz",
+ "integrity": "sha512-VB9xmSbfafI+/kI4gUK3PfrkGmrJQfh0N4EScT1gZXSZyUxpsBirPL99EWZg9MmPG0pzq/gMtgkk7/rAHj4aQw==",
+ "dev": true,
+ "requires": {
+ "@typescript-eslint/typescript-estree": "1.6.0",
+ "eslint-scope": "^4.0.0",
+ "eslint-visitor-keys": "^1.0.0"
+ }
+ },
+ "@typescript-eslint/typescript-estree": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-1.6.0.tgz",
+ "integrity": "sha512-A4CanUwfaG4oXobD5y7EXbsOHjCwn8tj1RDd820etpPAjH+Icjc2K9e/DQM1Hac5zH2BSy+u6bjvvF2wwREvYA==",
+ "dev": true,
+ "requires": {
+ "lodash.unescape": "4.0.1",
+ "semver": "5.5.0"
+ }
+ },
+ "eslint-scope": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz",
+ "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==",
+ "dev": true,
+ "requires": {
+ "esrecurse": "^4.1.0",
+ "estraverse": "^4.1.1"
+ }
+ },
+ "eslint-visitor-keys": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz",
+ "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==",
+ "dev": true
+ },
+ "esrecurse": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz",
+ "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==",
+ "dev": true,
+ "requires": {
+ "estraverse": "^4.1.0"
+ }
+ },
+ "estraverse": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz",
+ "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=",
+ "dev": true
+ },
+ "lodash.unescape": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/lodash.unescape/-/lodash.unescape-4.0.1.tgz",
+ "integrity": "sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw=",
+ "dev": true
+ },
+ "prettier": {
+ "version": "1.17.0",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.17.0.tgz",
+ "integrity": "sha512-sXe5lSt2WQlCbydGETgfm1YBShgOX4HxQkFPvbxkcwgDvGDeqVau8h+12+lmSVlP3rHPz0oavfddSZg/q+Szjw==",
+ "dev": true
+ },
+ "requireindex": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz",
+ "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==",
+ "dev": true
+ },
+ "semver": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
+ "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==",
+ "dev": true
+ },
+ "tslib": {
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz",
+ "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==",
+ "dev": true
+ },
+ "tsutils": {
+ "version": "3.10.0",
+ "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.10.0.tgz",
+ "integrity": "sha512-q20XSMq7jutbGB8luhKKsQldRKWvyBO2BGqni3p4yq8Ys9bEP/xQw3KepKmMRt9gJ4lvQSScrihJrcKdKoSU7Q==",
+ "dev": true,
+ "requires": {
+ "tslib": "^1.8.1"
+ }
+ },
"typescript": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.2.tgz",
diff --git a/packages/add/package.json b/packages/add/package.json
index 4b28fbb1a3a..90cad053007 100644
--- a/packages/add/package.json
+++ b/packages/add/package.json
@@ -19,6 +19,5 @@
"scripts": {
"build": "tsc",
"watch": "npm run build && tsc -w"
- },
- "gitHead": "6846f2eb8f0d04acc4453cb20da10263ff00a139"
+ }
}
diff --git a/packages/add/tsconfig.json b/packages/add/tsconfig.json
index 8b1269a36b6..2a74d10580a 100644
--- a/packages/add/tsconfig.json
+++ b/packages/add/tsconfig.json
@@ -1,3 +1,3 @@
{
- "extends": "../../tsconfig.packages.json"
+ "extends": "../../tsconfig.packages.json"
}
diff --git a/packages/generate-loader/.eslintrc b/packages/generate-loader/.eslintrc
new file mode 100644
index 00000000000..365d9f85d71
--- /dev/null
+++ b/packages/generate-loader/.eslintrc
@@ -0,0 +1,11 @@
+{
+ "root": true,
+ "extends": [
+ "../../.eslintrc.js",
+ "plugin:@typescript-eslint/recommended",
+ "prettier",
+ "prettier/@typescript-eslint"
+ ],
+ "parser": "@typescript-eslint/parser",
+ "plugins": ["@typescript-eslint"]
+}
diff --git a/packages/generate-loader/README.md b/packages/generate-loader/README.md
index 26a9100e432..d1b6ad8a38c 100644
--- a/packages/generate-loader/README.md
+++ b/packages/generate-loader/README.md
@@ -1,5 +1,7 @@
# webpack-cli generate-loader
+[![NPM Downloads][downloads]][downloads-url]
+
## Description
This package contains the logic to initiate new loader projects.
@@ -22,6 +24,10 @@ generateLoader();
```
### CLI (via `webpack-cli`)
+
```bash
npx webpack-cli generate-loader
-```
\ No newline at end of file
+```
+
+[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-loader/index.ts b/packages/generate-loader/index.ts
index 83dc9cea9fc..8f280fc6226 100644
--- a/packages/generate-loader/index.ts
+++ b/packages/generate-loader/index.ts
@@ -1,8 +1,6 @@
import LoaderGenerator from "@webpack-cli/generators/loader-generator";
import * as yeoman from "yeoman-environment";
-import { IYeoman } from "./types/Yeoman";
-
/**
* Runs a yeoman generator to create a new webpack loader project
* @returns {void}
@@ -10,7 +8,7 @@ import { IYeoman } from "./types/Yeoman";
export default function loaderCreator(): void {
const env = yeoman.createEnv();
- const generatorName: string = "webpack-loader-generator";
+ const generatorName = "webpack-loader-generator";
env.registerStub(LoaderGenerator, generatorName);
diff --git a/packages/generate-loader/package-lock.json b/packages/generate-loader/package-lock.json
index b9561b5e442..90c9c102e80 100644
--- a/packages/generate-loader/package-lock.json
+++ b/packages/generate-loader/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "@webpack-cli/generate-loader",
- "version": "0.1.2",
+ "version": "0.1.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -24,6 +24,47 @@
"integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==",
"dev": true
},
+ "@typescript-eslint/eslint-plugin": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.6.0.tgz",
+ "integrity": "sha512-U224c29E2lo861TQZs6GSmyC0OYeRNg6bE9UVIiFBxN2MlA0nq2dCrgIVyyRbC05UOcrgf2Wk/CF2gGOPQKUSQ==",
+ "dev": true,
+ "requires": {
+ "@typescript-eslint/parser": "1.6.0",
+ "@typescript-eslint/typescript-estree": "1.6.0",
+ "requireindex": "^1.2.0",
+ "tsutils": "^3.7.0"
+ }
+ },
+ "@typescript-eslint/parser": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-1.6.0.tgz",
+ "integrity": "sha512-VB9xmSbfafI+/kI4gUK3PfrkGmrJQfh0N4EScT1gZXSZyUxpsBirPL99EWZg9MmPG0pzq/gMtgkk7/rAHj4aQw==",
+ "dev": true,
+ "requires": {
+ "@typescript-eslint/typescript-estree": "1.6.0",
+ "eslint-scope": "^4.0.0",
+ "eslint-visitor-keys": "^1.0.0"
+ }
+ },
+ "@typescript-eslint/typescript-estree": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-1.6.0.tgz",
+ "integrity": "sha512-A4CanUwfaG4oXobD5y7EXbsOHjCwn8tj1RDd820etpPAjH+Icjc2K9e/DQM1Hac5zH2BSy+u6bjvvF2wwREvYA==",
+ "dev": true,
+ "requires": {
+ "lodash.unescape": "4.0.1",
+ "semver": "5.5.0"
+ },
+ "dependencies": {
+ "semver": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
+ "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==",
+ "dev": true
+ }
+ }
+ },
"ansi-escapes": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz",
@@ -384,6 +425,37 @@
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
},
+ "eslint-scope": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz",
+ "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==",
+ "dev": true,
+ "requires": {
+ "esrecurse": "^4.1.0",
+ "estraverse": "^4.1.1"
+ }
+ },
+ "eslint-visitor-keys": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz",
+ "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==",
+ "dev": true
+ },
+ "esrecurse": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz",
+ "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==",
+ "dev": true,
+ "requires": {
+ "estraverse": "^4.1.0"
+ }
+ },
+ "estraverse": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz",
+ "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=",
+ "dev": true
+ },
"expand-brackets": {
"version": "2.1.4",
"resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz",
@@ -905,6 +977,12 @@
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
"integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg=="
},
+ "lodash.unescape": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/lodash.unescape/-/lodash.unescape-4.0.1.tgz",
+ "integrity": "sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw=",
+ "dev": true
+ },
"log-symbols": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz",
@@ -1142,6 +1220,12 @@
"resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
"integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs="
},
+ "prettier": {
+ "version": "1.17.0",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.17.0.tgz",
+ "integrity": "sha512-sXe5lSt2WQlCbydGETgfm1YBShgOX4HxQkFPvbxkcwgDvGDeqVau8h+12+lmSVlP3rHPz0oavfddSZg/q+Szjw==",
+ "dev": true
+ },
"process-nextick-args": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
@@ -1185,6 +1269,12 @@
"resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz",
"integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ="
},
+ "requireindex": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz",
+ "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==",
+ "dev": true
+ },
"resolve-url": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz",
@@ -1571,6 +1661,15 @@
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz",
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ=="
},
+ "tsutils": {
+ "version": "3.10.0",
+ "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.10.0.tgz",
+ "integrity": "sha512-q20XSMq7jutbGB8luhKKsQldRKWvyBO2BGqni3p4yq8Ys9bEP/xQw3KepKmMRt9gJ4lvQSScrihJrcKdKoSU7Q==",
+ "dev": true,
+ "requires": {
+ "tslib": "^1.8.1"
+ }
+ },
"typescript": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.2.tgz",
diff --git a/packages/generate-loader/package.json b/packages/generate-loader/package.json
index 65bb6d96815..fc6aae439a7 100644
--- a/packages/generate-loader/package.json
+++ b/packages/generate-loader/package.json
@@ -24,6 +24,5 @@
"scripts": {
"build": "tsc",
"watch": "npm run build && tsc -w"
- },
- "gitHead": "6846f2eb8f0d04acc4453cb20da10263ff00a139"
+ }
}
diff --git a/packages/generate-loader/types/Yeoman.ts b/packages/generate-loader/types/Yeoman.ts
deleted file mode 100644
index 4c56a771c00..00000000000
--- a/packages/generate-loader/types/Yeoman.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-interface IRunEnv extends Object {
- on?: (event: string, callbackFn: Function) => void;
-}
-
-export interface IYeoman extends Object {
- registerStub?(generator: IGenerator, namespace: string): void;
- run?(target: string, options?: object, done?: Function): IRunEnv;
-}
-
-export interface IGenerator extends Object {
- composeWith?: (path: string) => void;
-}
diff --git a/packages/generate-plugin/.eslintrc b/packages/generate-plugin/.eslintrc
new file mode 100644
index 00000000000..365d9f85d71
--- /dev/null
+++ b/packages/generate-plugin/.eslintrc
@@ -0,0 +1,11 @@
+{
+ "root": true,
+ "extends": [
+ "../../.eslintrc.js",
+ "plugin:@typescript-eslint/recommended",
+ "prettier",
+ "prettier/@typescript-eslint"
+ ],
+ "parser": "@typescript-eslint/parser",
+ "plugins": ["@typescript-eslint"]
+}
diff --git a/packages/generate-plugin/README.md b/packages/generate-plugin/README.md
index df400763c1d..096a0ad491e 100644
--- a/packages/generate-plugin/README.md
+++ b/packages/generate-plugin/README.md
@@ -1,5 +1,7 @@
# webpack-cli generate-plugin
+[![NPM Downloads][downloads]][downloads-url]
+
## Description
This package contains the logic to initiate new plugin projects.
@@ -15,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
-```
\ No newline at end of file
+```
+
+[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/generate-plugin/index.ts b/packages/generate-plugin/index.ts
index 6c31d6d43df..50448da6713 100644
--- a/packages/generate-plugin/index.ts
+++ b/packages/generate-plugin/index.ts
@@ -1,8 +1,6 @@
import PluginGenerator from "@webpack-cli/generators/plugin-generator";
import * as yeoman from "yeoman-environment";
-import { IYeoman } from "./types/Yeoman";
-
/**
* Runs a yeoman generator to create a new webpack plugin project
* @returns {void}
@@ -10,7 +8,7 @@ import { IYeoman } from "./types/Yeoman";
export default function pluginCreator(): void {
const env = yeoman.createEnv();
- const generatorName: string = "webpack-plugin-generator";
+ const generatorName = "webpack-plugin-generator";
env.registerStub(PluginGenerator, generatorName);
diff --git a/packages/generate-plugin/package.json b/packages/generate-plugin/package.json
index d3f1e166f8c..e191dae6ec5 100644
--- a/packages/generate-plugin/package.json
+++ b/packages/generate-plugin/package.json
@@ -24,6 +24,5 @@
"scripts": {
"build": "tsc",
"watch": "npm run build && tsc -w"
- },
- "gitHead": "6846f2eb8f0d04acc4453cb20da10263ff00a139"
+ }
}
diff --git a/packages/generate-plugin/types/Yeoman.ts b/packages/generate-plugin/types/Yeoman.ts
deleted file mode 100644
index 4c56a771c00..00000000000
--- a/packages/generate-plugin/types/Yeoman.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-interface IRunEnv extends Object {
- on?: (event: string, callbackFn: Function) => void;
-}
-
-export interface IYeoman extends Object {
- registerStub?(generator: IGenerator, namespace: string): void;
- run?(target: string, options?: object, done?: Function): IRunEnv;
-}
-
-export interface IGenerator extends Object {
- composeWith?: (path: string) => void;
-}
diff --git a/packages/generators/.eslintrc b/packages/generators/.eslintrc
new file mode 100644
index 00000000000..365d9f85d71
--- /dev/null
+++ b/packages/generators/.eslintrc
@@ -0,0 +1,11 @@
+{
+ "root": true,
+ "extends": [
+ "../../.eslintrc.js",
+ "plugin:@typescript-eslint/recommended",
+ "prettier",
+ "prettier/@typescript-eslint"
+ ],
+ "parser": "@typescript-eslint/parser",
+ "plugins": ["@typescript-eslint"]
+}
diff --git a/packages/generators/README.md b/packages/generators/README.md
index 921217257f9..d35dd5eb2a7 100644
--- a/packages/generators/README.md
+++ b/packages/generators/README.md
@@ -1,8 +1,10 @@
# 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
@@ -17,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`
+- [**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/generators/__tests__/.eslintrc b/packages/generators/__tests__/.eslintrc
new file mode 100644
index 00000000000..e3e3b0884ac
--- /dev/null
+++ b/packages/generators/__tests__/.eslintrc
@@ -0,0 +1,9 @@
+{
+ "root": true,
+ "extends": [
+ "../.eslintrc"
+ ],
+ "rules": {
+ "@typescript-eslint/explicit-function-return-type": ["off"]
+ }
+}
diff --git a/packages/generators/loader-generator.test.js b/packages/generators/__tests__/loader-generator.test.ts
similarity index 84%
rename from packages/generators/loader-generator.test.js
rename to packages/generators/__tests__/loader-generator.test.ts
index 283f6bf551a..f8d6c4667c3 100644
--- a/packages/generators/loader-generator.test.js
+++ b/packages/generators/__tests__/loader-generator.test.ts
@@ -1,6 +1,4 @@
-"use strict";
-
-const { makeLoaderName } = require("./loader-generator");
+import { makeLoaderName } from "../loader-generator";
describe("makeLoaderName", () => {
it("should kebab-case loader name and append '-loader'", () => {
diff --git a/packages/generators/add-generator.ts b/packages/generators/add-generator.ts
index 977850f2167..bef3c32afd3 100644
--- a/packages/generators/add-generator.ts
+++ b/packages/generators/add-generator.ts
@@ -1,4 +1,4 @@
-import Generator = require("yeoman-generator");
+import * as Generator from "yeoman-generator";
import * as glob from "glob-all";
import * as autoComplete from "inquirer-autocomplete-prompt";
@@ -7,21 +7,13 @@ import * as path from "path";
import npmExists from "@webpack-cli/utils/npm-exists";
import { getPackageManager } from "@webpack-cli/utils/package-manager";
import PROP_TYPES from "@webpack-cli/utils/prop-types";
-import {
- AutoComplete,
- Confirm,
- IInquirerInput,
- IInquirerList,
- Input,
- List,
-} from "@webpack-cli/webpack-scaffold";
+import { AutoComplete, Confirm, Input, List } from "@webpack-cli/webpack-scaffold";
-import { ISchemaProperties, IWebpackOptions } from "./types";
+import { SchemaProperties, WebpackOptions } from "./types";
import entryQuestions from "./utils/entry";
-// tslint:disable:no-var-requires
-const webpackDevServerSchema = require("webpack-dev-server/lib/options.json");
-const webpackSchema = require("./utils/optionsSchema.json");
+import webpackDevServerSchema from "webpack-dev-server/lib/options.json";
+import webpackSchema from "./utils/optionsSchema.json";
const PROPS: string[] = Array.from(PROP_TYPES.keys());
/**
@@ -29,7 +21,7 @@ const PROPS: string[] = Array.from(PROP_TYPES.keys());
* Replaces the string with a substring at the given index
* https://gist.github.com/efenacigiray/9367920
*
- * @param {String} string - string to be modified
+ * @param {String} str - string to be modified
* @param {Number} index - index to replace from
* @param {String} replace - string to replace starting from index
*
@@ -51,12 +43,14 @@ function replaceAt(str: string, index: number, replace: string): string {
* is present
*/
const traverseAndGetProperties = (arr: object[], prop: string): boolean => {
- let hasProp: boolean = false;
- arr.forEach((p: object): void => {
- if (p[prop]) {
- hasProp = true;
+ let hasProp = false;
+ arr.forEach(
+ (p: object): void => {
+ if (p[prop]) {
+ hasProp = true;
+ }
}
- });
+ );
return hasProp;
};
@@ -72,11 +66,7 @@ const traverseAndGetProperties = (arr: object[], prop: string): boolean => {
*/
const searchProps = (answers: object, input: string): Promise => {
input = input || "";
- return Promise.resolve(
- PROPS.filter((prop: string): boolean =>
- prop.toLowerCase().includes(input.toLowerCase()),
- ),
- );
+ return Promise.resolve(PROPS.filter((prop: string): boolean => prop.toLowerCase().includes(input.toLowerCase())));
};
/**
@@ -92,440 +82,414 @@ export default class AddGenerator extends Generator {
private dependencies: string[];
private configuration: {
config: {
- configName?: string,
- topScope?: string[],
+ configName?: string;
+ topScope?: string[];
item?: string;
- webpackOptions?: IWebpackOptions,
- },
+ webpackOptions?: WebpackOptions;
+ };
};
- constructor(args, opts) {
+ public constructor(args, opts) {
super(args, opts);
this.dependencies = [];
this.configuration = {
config: {
topScope: ["const webpack = require('webpack')"],
- webpackOptions: {},
- },
+ webpackOptions: {}
+ }
};
const { registerPrompt } = this.env.adapter.promptModule;
registerPrompt("autocomplete", autoComplete);
}
- public prompting() {
- const done: (_?: void) => void | boolean = this.async();
+ public prompting(): Promise {
+ const done: () => {} = this.async();
let action: string;
const self: this = this;
- const manualOrListInput: (promptAction: string) => IInquirerInput = (promptAction: string) =>
+ const manualOrListInput: (promptAction: string) => Generator.Question = (promptAction: string): Generator.Question =>
Input("actionAnswer", `What do you want to add to ${promptAction}?`);
- let inputPrompt: IInquirerInput;
+ let inputPrompt: Generator.Question;
// first index indicates if it has a deep prop, 2nd indicates what kind of
+ // TODO: this must be reviewed. It starts as an array of booleans but after that it get overridden
+ // Bye bye functional programming.
+ // eslint-disable-next-line
const isDeepProp: any[] = [false, false];
return this.prompt([
- AutoComplete(
- "actionType",
- "What property do you want to add to?",
- {
- pageSize: 7,
- source: searchProps,
- suggestOnly: false,
- },
- ),
- ])
- .then((actionTypeAnswer: {
- actionType: string,
- }) => {
- // Set initial prop, like devtool
- this.configuration.config.webpackOptions[
- actionTypeAnswer.actionType
- ] = null;
- // update the action variable, we're using it later
- action = actionTypeAnswer.actionType;
+ AutoComplete("actionType", "What property do you want to add to?", {
+ pageSize: 7,
+ source: searchProps,
+ suggestOnly: false
})
- .then((_: void) => {
- if (action === "entry") {
- return this.prompt([
- Confirm("entryType", "Will your application have multiple bundles?"),
- ])
- .then((entryTypeAnswer: {
- entryType: boolean,
- }) => {
- // Ask different questions for entry points
- return entryQuestions(self, entryTypeAnswer);
- })
- .then((entryOptions: {
- entryType: boolean;
- }) => {
- this.configuration.config.webpackOptions.entry = entryOptions;
- this.configuration.config.item = action;
- });
- }
- const temp: string = action;
- if (action === "resolveLoader") {
- action = "resolve";
+ ])
+ .then(
+ (actionTypeAnswer: { actionType: string }): void => {
+ // Set initial prop, like devtool
+ this.configuration.config.webpackOptions[actionTypeAnswer.actionType] = null;
+ // update the action variable, we're using it later
+ action = actionTypeAnswer.actionType;
}
- const webpackSchemaProp: ISchemaProperties = webpackSchema.definitions[action];
- /*
- * https://github.com/webpack/webpack/blob/next/schemas/WebpackOptions.json
- * Find the properties directly in the properties prop, or the anyOf prop
- */
- let defOrPropDescription: object = webpackSchemaProp
- ? webpackSchemaProp.properties
- : webpackSchema.properties[action].properties
+ )
+ .then(
+ (): Promise => {
+ if (action === "entry") {
+ return this.prompt([
+ Confirm("entryType", "Will your application have multiple bundles?", false)
+ ])
+ .then(
+ (entryTypeAnswer: { entryType: boolean }): Promise => {
+ // Ask different questions for entry points
+ return entryQuestions(self, entryTypeAnswer);
+ }
+ )
+ .then(
+ (entryOptions: { entryType: boolean }): void => {
+ this.configuration.config.webpackOptions.entry = entryOptions;
+ this.configuration.config.item = action;
+ }
+ );
+ } else {
+ if (action === "topScope") {
+ return this.prompt([Input("topScope", "What do you want to add to topScope?")]).then(
+ (topScopeAnswer: { topScope: string }): void => {
+ this.configuration.config.topScope.push(topScopeAnswer.topScope);
+ done();
+ }
+ );
+ }
+ }
+ const temp = action;
+ if (action === "resolveLoader") {
+ action = "resolve";
+ }
+ const webpackSchemaProp: SchemaProperties = webpackSchema.definitions[action];
+ /*
+ * https://github.com/webpack/webpack/blob/next/schemas/WebpackOptions.json
+ * Find the properties directly in the properties prop, or the anyOf prop
+ */
+ let defOrPropDescription: object = webpackSchemaProp
+ ? webpackSchemaProp.properties
+ : webpackSchema.properties[action].properties
? webpackSchema.properties[action].properties
: webpackSchema.properties[action].anyOf
- ? webpackSchema.properties[action].anyOf.filter(
- (p: {
- properties?: object,
- enum?: any[],
- }) => p.properties || p.enum,
- )
- : null;
- if (Array.isArray(defOrPropDescription)) {
- // Todo: Generalize these to go through the array, then merge enum with props if needed
- const hasPropertiesProp: boolean = traverseAndGetProperties(
- defOrPropDescription,
- "properties",
- );
- const hasEnumProp: boolean = traverseAndGetProperties(
- defOrPropDescription,
- "enum",
- );
- /* as we know he schema only has two arrays that might hold our values,
- * check them for either having arr.enum or arr.properties
- */
- if (hasPropertiesProp) {
- defOrPropDescription =
- defOrPropDescription[0].properties ||
- defOrPropDescription[1].properties;
- if (!defOrPropDescription) {
- defOrPropDescription = defOrPropDescription[0].enum;
- }
- // TODO: manually implement stats and devtools like sourcemaps
- } else if (hasEnumProp) {
- const originalPropDesc: object = defOrPropDescription[0].enum;
- // Array -> Object -> Merge objects into one for compat in manualOrListInput
- defOrPropDescription = Object.keys(defOrPropDescription[0].enum)
- .map((p: string): object => {
- return Object.assign(
- {},
- {
- [originalPropDesc[p]]: "noop",
- },
- );
- })
- .reduce((result: object, currentObject: object): object => {
- for (const key in currentObject) {
- if (currentObject.hasOwnProperty(key)) {
- result[key] = currentObject[key];
+ ? webpackSchema.properties[action].anyOf.filter(
+ (p: { properties?: object; enum?: string[] }): boolean => !!p.properties || !!p.enum
+ )
+ : null;
+ if (Array.isArray(defOrPropDescription)) {
+ // Todo: Generalize these to go through the array, then merge enum with props if needed
+ const hasPropertiesProp: boolean = traverseAndGetProperties(defOrPropDescription, "properties");
+ const hasEnumProp: boolean = traverseAndGetProperties(defOrPropDescription, "enum");
+ /* as we know he schema only has two arrays that might hold our values,
+ * check them for either having arr.enum or arr.properties
+ */
+ if (hasPropertiesProp) {
+ defOrPropDescription =
+ defOrPropDescription[0].properties || defOrPropDescription[1].properties;
+ if (!defOrPropDescription) {
+ defOrPropDescription = defOrPropDescription[0].enum;
+ }
+ // TODO: manually implement stats and devtools like sourcemaps
+ } else if (hasEnumProp) {
+ const originalPropDesc: object = defOrPropDescription[0].enum;
+ // Array -> Object -> Merge objects into one for compat in manualOrListInput
+ defOrPropDescription = Object.keys(defOrPropDescription[0].enum)
+ .map(
+ (p: string): object => {
+ return Object.assign(
+ {},
+ {
+ [originalPropDesc[p]]: "noop"
+ }
+ );
}
- }
- return result;
- }, {});
+ )
+ .reduce((result: object, currentObject: object): object => {
+ for (const key in currentObject) {
+ if (currentObject.hasOwnProperty(key)) {
+ result[key] = currentObject[key];
+ }
+ }
+ return result;
+ }, {});
+ }
}
- }
- // WDS has its own schema, so we gonna need to check that too
- const webpackDevserverSchemaProp: ISchemaProperties =
- action === "devServer" ? webpackDevServerSchema : null;
- // Watch has a boolean arg, but we need to append to it manually
- if (action === "watch") {
- defOrPropDescription = {
- false: {},
- true: {},
- };
- }
- if (action === "mode") {
- defOrPropDescription = {
- development: {},
- production: {},
- };
- }
- action = temp;
- if (action === "resolveLoader") {
- defOrPropDescription = Object.assign(defOrPropDescription, {
- moduleExtensions: {},
- });
- }
- // If we've got a schema prop or devServer Schema Prop
- if (defOrPropDescription || webpackDevserverSchemaProp) {
- // Check for properties in definitions[action] or properties[action]
- if (defOrPropDescription) {
- if (action !== "devtool") {
- // Add the option of adding an own variable if the user wants
- defOrPropDescription = Object.assign(defOrPropDescription, {
- other: {},
- });
+ // WDS has its own schema, so we gonna need to check that too
+ const webpackDevserverSchemaProp: SchemaProperties =
+ action === "devServer" ? webpackDevServerSchema : null;
+ // Watch has a boolean arg, but we need to append to it manually
+ if (action === "watch") {
+ defOrPropDescription = {
+ false: {},
+ true: {}
+ };
+ }
+ if (action === "mode") {
+ defOrPropDescription = {
+ development: {},
+ production: {}
+ };
+ }
+ action = temp;
+ if (action === "resolveLoader") {
+ defOrPropDescription = Object.assign(defOrPropDescription, {
+ moduleExtensions: {}
+ });
+ }
+ // If we've got a schema prop or devServer Schema Prop
+ if (defOrPropDescription || webpackDevserverSchemaProp) {
+ // Check for properties in definitions[action] or properties[action]
+ if (defOrPropDescription) {
+ if (action !== "devtool") {
+ // Add the option of adding an own variable if the user wants
+ defOrPropDescription = Object.assign(defOrPropDescription, {
+ other: {}
+ });
+ } else {
+ // The schema doesn't have the source maps we can prompt, so add those
+ defOrPropDescription = Object.assign(defOrPropDescription, {
+ "cheap-eval-source-map": {},
+ "cheap-module-eval-source-map": {},
+ "cheap-module-source-map": {},
+ "cheap-source-map": {},
+ eval: {},
+ "eval-source-map": {},
+ "hidden-source-map": {},
+ "inline-cheap-module-source-map": {},
+ "inline-cheap-source-map": {},
+ "inline-source-map": {},
+ "nosources-source-map": {},
+ "source-map": {}
+ });
+ }
+ inputPrompt = List(
+ "actionAnswer",
+ `What do you want to add to ${action}?`,
+ Object.keys(defOrPropDescription)
+ );
+ // We know we're gonna append some deep prop like module.rule
+ isDeepProp[0] = true;
+ } else if (webpackDevserverSchemaProp) {
+ // Append the custom property option
+ webpackDevserverSchemaProp.properties = Object.assign(
+ webpackDevserverSchemaProp.properties,
+ {
+ other: {}
+ }
+ );
+ inputPrompt = List(
+ "actionAnswer",
+ `What do you want to add to ${action}?`,
+ Object.keys(webpackDevserverSchemaProp.properties)
+ );
+ // We know we are in a devServer.prop scenario
+ isDeepProp[0] = true;
} else {
- // The schema doesn't have the source maps we can prompt, so add those
- defOrPropDescription = Object.assign(defOrPropDescription, {
- "cheap-eval-source-map": {},
- "cheap-module-eval-source-map": {},
- "cheap-module-source-map": {},
- "cheap-source-map": {},
- "eval": {},
- "eval-source-map": {},
- "hidden-source-map": {},
- "inline-cheap-module-source-map": {},
- "inline-cheap-source-map": {},
- "inline-source-map": {},
- "nosources-source-map": {},
- "source-map": {},
- });
+ // manual input if non-existent
+ inputPrompt = manualOrListInput(action);
}
- inputPrompt = List(
- "actionAnswer",
- `What do you want to add to ${action}?`,
- Object.keys(defOrPropDescription),
- );
- // We know we're gonna append some deep prop like module.rule
- isDeepProp[0] = true;
- } else if (webpackDevserverSchemaProp) {
- // Append the custom property option
- webpackDevserverSchemaProp.properties = Object.assign(
- webpackDevserverSchemaProp.properties,
- {
- other: {},
- },
- );
- inputPrompt = List(
- "actionAnswer",
- `What do you want to add to ${action}?`,
- Object.keys(webpackDevserverSchemaProp.properties),
- );
- // We know we are in a devServer.prop scenario
- isDeepProp[0] = true;
} else {
- // manual input if non-existent
inputPrompt = manualOrListInput(action);
}
- } else {
- inputPrompt = manualOrListInput(action);
+ return this.prompt([inputPrompt]);
}
- return this.prompt([
- inputPrompt,
- ]);
- })
- .then((answerToAction: {
- actionAnswer: string,
- }) => {
- if (!answerToAction) {
- done();
- return;
- }
- /*
- * Plugins got their own logic,
- * find the names of each natively plugin and check if it matches
- */
- if (action === "plugins") {
- const pluginExist: string = glob
- .sync([
- "node_modules/webpack/lib/*Plugin.js",
- "node_modules/webpack/lib/**/*Plugin.js",
- ])
- .map((p: string): string =>
- p
- .split("/")
- .pop()
- .replace(".js", ""),
- )
- .find(
- (p: string): boolean => p.toLowerCase().indexOf(answerToAction.actionAnswer) >= 0,
- );
-
- if (pluginExist) {
- this.configuration.config.item = pluginExist;
- const pluginsSchemaPath: string = glob
- .sync([
- "node_modules/webpack/schemas/plugins/*Plugin.json",
- "node_modules/webpack/schemas/plugins/**/*Plugin.json",
- ])
- .find(
- (p: string): boolean =>
+ )
+ .then(
+ (answerToAction: { actionAnswer: string }): Promise => {
+ if (!answerToAction) {
+ done();
+ return;
+ }
+ /*
+ * Plugins got their own logic,
+ * find the names of each natively plugin and check if it matches
+ */
+ if (action === "plugins") {
+ const pluginExist: string = glob
+ .sync(["node_modules/webpack/lib/*Plugin.js", "node_modules/webpack/lib/**/*Plugin.js"])
+ .map(
+ (p: string): string =>
p
.split("/")
.pop()
- .replace(".json", "")
- .toLowerCase()
- .indexOf(answerToAction.actionAnswer) >= 0,
- );
- if (pluginsSchemaPath) {
- const constructorPrefix: string =
- pluginsSchemaPath.indexOf("optimize") >= 0
- ? "webpack.optimize"
- : "webpack";
- const resolvePluginsPath: string = path.resolve(pluginsSchemaPath);
- const pluginSchema: object = resolvePluginsPath
- ? require(resolvePluginsPath)
- : null;
- let pluginsSchemaProps: string[] = ["other"];
- if (pluginSchema) {
- Object.keys(pluginSchema)
- .filter((p: string): boolean => Array.isArray(pluginSchema[p]))
- .forEach((p: string): void => {
- Object.keys(pluginSchema[p]).forEach((n: string): void => {
- if (pluginSchema[p][n].properties) {
- pluginsSchemaProps = Object.keys(
- pluginSchema[p][n].properties,
+ .replace(".js", "")
+ )
+ .find((p: string): boolean => p.toLowerCase().indexOf(answerToAction.actionAnswer) >= 0);
+
+ if (pluginExist) {
+ this.configuration.config.item = pluginExist;
+ const pluginsSchemaPath: string = glob
+ .sync([
+ "node_modules/webpack/schemas/plugins/*Plugin.json",
+ "node_modules/webpack/schemas/plugins/**/*Plugin.json"
+ ])
+ .find(
+ (p: string): boolean =>
+ p
+ .split("/")
+ .pop()
+ .replace(".json", "")
+ .toLowerCase()
+ .indexOf(answerToAction.actionAnswer) >= 0
+ );
+ if (pluginsSchemaPath) {
+ const constructorPrefix: string =
+ pluginsSchemaPath.indexOf("optimize") >= 0 ? "webpack.optimize" : "webpack";
+ const resolvePluginsPath: string = path.resolve(pluginsSchemaPath);
+ const pluginSchema: object = resolvePluginsPath ? require(resolvePluginsPath) : null;
+ let pluginsSchemaProps: string[] = ["other"];
+ if (pluginSchema) {
+ Object.keys(pluginSchema)
+ .filter((p: string): boolean => Array.isArray(pluginSchema[p]))
+ .forEach(
+ (p: string): void => {
+ Object.keys(pluginSchema[p]).forEach(
+ (n: string): void => {
+ if (pluginSchema[p][n].properties) {
+ pluginsSchemaProps = Object.keys(
+ pluginSchema[p][n].properties
+ );
+ }
+ }
);
}
- });
- });
- }
+ );
+ }
- return this.prompt([
- List(
- "pluginsPropType",
- `What property do you want to add ${pluginExist}?`,
- pluginsSchemaProps,
- ),
- ]).then((pluginsPropAnswer: {
- pluginsPropType: string,
- }) => {
return this.prompt([
- Input(
- "pluginsPropTypeVal",
- `What value should ${pluginExist}.${
- pluginsPropAnswer.pluginsPropType
- } have?`,
- ),
- ]).then((valForProp: {
- pluginsPropTypeVal: string,
- }) => {
- this.configuration.config.webpackOptions[action] = {
- [`${constructorPrefix}.${pluginExist}`]: {
- [pluginsPropAnswer.pluginsPropType]:
- valForProp.pluginsPropTypeVal,
- },
- };
- done();
- });
- });
+ List(
+ "pluginsPropType",
+ `What property do you want to add ${pluginExist}?`,
+ pluginsSchemaProps
+ )
+ ]).then(
+ (pluginsPropAnswer: { pluginsPropType: string }): Promise => {
+ return this.prompt([
+ Input(
+ "pluginsPropTypeVal",
+ `What value should ${pluginExist}.${
+ pluginsPropAnswer.pluginsPropType
+ } have?`
+ )
+ ]).then(
+ (valForProp: { pluginsPropTypeVal: string }): void => {
+ this.configuration.config.webpackOptions[action] = {
+ [`${constructorPrefix}.${pluginExist}`]: {
+ [pluginsPropAnswer.pluginsPropType]:
+ valForProp.pluginsPropTypeVal
+ }
+ };
+ done();
+ }
+ );
+ }
+ );
+ } else {
+ this.configuration.config.webpackOptions[action] = `new webpack.${pluginExist}`;
+ done();
+ }
} else {
- this.configuration.config.webpackOptions[
- action
- ] = `new webpack.${pluginExist}`;
- done();
+ // If its not in webpack, check npm
+ npmExists(answerToAction.actionAnswer).then(
+ (p: boolean): void => {
+ if (p) {
+ this.dependencies.push(answerToAction.actionAnswer);
+ const normalizePluginName = answerToAction.actionAnswer.replace(
+ "-webpack-plugin",
+ "Plugin"
+ );
+ const pluginName = replaceAt(
+ normalizePluginName,
+ 0,
+ normalizePluginName.charAt(0).toUpperCase()
+ );
+ this.configuration.config.topScope.push(
+ `const ${pluginName} = require("${answerToAction.actionAnswer}")`
+ );
+ this.configuration.config.webpackOptions[action] = `new ${pluginName}`;
+ this.configuration.config.item = answerToAction.actionAnswer;
+ done();
+ this.scheduleInstallTask(getPackageManager(), this.dependencies, {
+ "save-dev": true
+ });
+ } else {
+ console.error(
+ answerToAction.actionAnswer,
+ "doesn't exist on NPM or is built in webpack, please check for any misspellings."
+ );
+ process.exit(0);
+ }
+ }
+ );
}
} else {
- // If its not in webpack, check npm
- npmExists(answerToAction.actionAnswer)
- .then((p: string) => {
- if (p) {
- this.dependencies.push(answerToAction.actionAnswer);
- const normalizePluginName: string = answerToAction.actionAnswer.replace(
- "-webpack-plugin",
- "Plugin",
- );
- const pluginName: string = replaceAt(
- normalizePluginName,
- 0,
- normalizePluginName.charAt(0).toUpperCase(),
- );
- this.configuration.config.topScope.push(
- `const ${pluginName} = require("${
- answerToAction.actionAnswer
- }")`,
- );
- this.configuration.config.webpackOptions[
- action
- ] = `new ${pluginName}`;
- this.configuration.config.item = answerToAction.actionAnswer;
- done();
- this.scheduleInstallTask(getPackageManager(), this.dependencies, {
- "save-dev": true,
- });
- } else {
- console.error(
- answerToAction.actionAnswer,
- "doesn't exist on NPM or is built in webpack, please check for any misspellings.",
- );
- process.exit(0);
+ // If we're in the scenario with a deep-property
+ if (isDeepProp[0]) {
+ isDeepProp[1] = answerToAction.actionAnswer;
+ if (
+ isDeepProp[1] !== "other" &&
+ (action === "devtool" || action === "watch" || action === "mode")
+ ) {
+ this.configuration.config.item = action;
+ this.configuration.config.webpackOptions[action] = answerToAction.actionAnswer;
+ done();
+ return;
+ }
+ // Either we are adding directly at the property, else we're in a prop.theOne scenario
+ const actionMessage =
+ isDeepProp[1] === "other"
+ ? `What do you want the key on ${action} to be? (press enter if you want it directly as a value on the property)`
+ : `What do you want the value of ${isDeepProp[1]} to be?`;
+
+ this.prompt([Input("deepProp", actionMessage)]).then(
+ (deepPropAns: { deepProp: string }): void => {
+ // The other option needs to be validated of either being empty or not
+ if (isDeepProp[1] === "other") {
+ const othersDeepPropKey: string = deepPropAns.deepProp
+ ? `What do you want the value of ${deepPropAns.deepProp} to be?` // eslint-disable-line
+ : `What do you want to be the value of ${action} to be?`;
+ // Push the answer to the array we have created, so we can use it later
+ isDeepProp.push(deepPropAns.deepProp);
+ this.prompt([Input("innerProp", othersDeepPropKey)]).then(
+ (innerPropAns: { innerProp }): void => {
+ // Check length, if it has none, add the prop directly on the given action
+ if (isDeepProp[2].length === 0) {
+ this.configuration.config.item = action;
+ this.configuration.config.webpackOptions[action] =
+ innerPropAns.innerProp;
+ } else {
+ // If not, we're adding to something like devServer.myProp
+ this.configuration.config.item = action + "." + isDeepProp[2];
+ this.configuration.config.webpackOptions[action] = {
+ [isDeepProp[2]]: innerPropAns.innerProp
+ };
+ }
+ done();
+ }
+ );
+ } else {
+ // We got the schema prop, we've correctly prompted it, and can add it directly
+ this.configuration.config.item = `${action}.${isDeepProp[1]}`;
+ this.configuration.config.webpackOptions[action] = {
+ [isDeepProp[1]]: deepPropAns.deepProp
+ };
+ done();
+ }
}
- });
- }
- } else {
- // If we're in the scenario with a deep-property
- if (isDeepProp[0]) {
- isDeepProp[1] = answerToAction.actionAnswer;
- if (
- isDeepProp[1] !== "other" &&
- (action === "devtool" || action === "watch" || action === "mode")
- ) {
+ );
+ } else {
+ // We're asking for input-only
this.configuration.config.item = action;
- this.configuration.config.webpackOptions[action] =
- answerToAction.actionAnswer;
+ this.configuration.config.webpackOptions[action] = answerToAction.actionAnswer;
done();
- return;
}
- // Either we are adding directly at the property, else we're in a prop.theOne scenario
- const actionMessage: string =
- isDeepProp[1] === "other"
- ? `What do you want the key on ${
- action
- } to be? (press enter if you want it directly as a value on the property)`
- : `What do you want the value of ${isDeepProp[1]} to be?`;
-
- this.prompt([
- Input("deepProp", actionMessage),
- ]).then(
- (deepPropAns: {
- deepProp: string,
- }) => {
- // The other option needs to be validated of either being empty or not
- if (isDeepProp[1] === "other") {
- const othersDeepPropKey: string = deepPropAns.deepProp
- ? `What do you want the value of ${
- deepPropAns.deepProp
- } to be?` // eslint-disable-line
- : `What do you want to be the value of ${action} to be?`;
- // Push the answer to the array we have created, so we can use it later
- isDeepProp.push(deepPropAns.deepProp);
- this.prompt([
- Input("innerProp", othersDeepPropKey),
- ]).then(
- (innerPropAns: {
- innerProp,
- }) => {
- // Check length, if it has none, add the prop directly on the given action
- if (isDeepProp[2].length === 0) {
- this.configuration.config.item = action;
- this.configuration.config.webpackOptions[action] =
- innerPropAns.innerProp;
- } else {
- // If not, we're adding to something like devServer.myProp
- this.configuration.config.item =
- action + "." + isDeepProp[2];
- this.configuration.config.webpackOptions[action] = {
- [isDeepProp[2]]: innerPropAns.innerProp,
- };
- }
- done();
- },
- );
- } else {
- // We got the schema prop, we've correctly prompted it, and can add it directly
- this.configuration.config.item = action + "." + isDeepProp[1];
- this.configuration.config.webpackOptions[action] = {
- [isDeepProp[1]]: deepPropAns.deepProp,
- };
- done();
- }
- },
- );
- } else {
- // We're asking for input-only
- this.configuration.config.item = action;
- this.configuration.config.webpackOptions[action] =
- answerToAction.actionAnswer;
- done();
}
}
- });
+ );
}
- public writing() {
+ public writing(): void {
this.config.set("configuration", this.configuration);
}
}
diff --git a/packages/generators/addon-generator.ts b/packages/generators/addon-generator.ts
index 8e56d92e5cf..fbbcf7fc8e5 100644
--- a/packages/generators/addon-generator.ts
+++ b/packages/generators/addon-generator.ts
@@ -1,15 +1,14 @@
import * as mkdirp from "mkdirp";
import * as path from "path";
-import Generator = require("yeoman-generator");
+import * as Generator from "yeoman-generator";
import * as copyUtils from "@webpack-cli/utils/copy-utils";
-import { IInquirerScaffoldObject } from "@webpack-cli/webpack-scaffold";
/**
* Creates a Yeoman Generator that generates a project conforming
* to webpack-defaults.
*
- * @param {any[]} prompts An array of Yeoman prompt objects
+ * @param {Generator.Questions} prompts An array of Yeoman prompt objects
*
* @param {string} templateDir Absolute path to template directory
*
@@ -26,60 +25,60 @@ import { IInquirerScaffoldObject } from "@webpack-cli/webpack-scaffold";
*
* @returns {Generator} A class extending Generator
*/
-export default function addonGenerator(
- prompts: IInquirerScaffoldObject[],
+const addonGenerator = (
+ prompts: Generator.Questions,
templateDir: string,
copyFiles: string[],
copyTemplateFiles: string[],
- templateFn: Function,
-) {
- return class AddOnGenerator extends Generator {
- public props: IInquirerScaffoldObject;
- private copy: (value: string, index: number, array: string[]) => void;
- private copyTpl: (value: string, index: number, array: string[]) => void;
+ templateFn: Function
+): typeof Generator => class AddonGenerator extends Generator {
+ public props: Generator.Question;
+ public copy: (value: string, index: number, array: string[]) => void;
+ public copyTpl: (value: string, index: number, array: string[]) => void;
- public prompting(): Promise<{}> {
- return this.prompt(prompts)
- .then((props: IInquirerScaffoldObject): void => {
+ public prompting(): Promise {
+ return this.prompt(prompts).then(
+ (props: Generator.Question): void => {
this.props = props;
- });
+ }
+ );
}
- public default() {
- const currentDirName: string = path.basename(this.destinationPath());
+ public default(): void {
+ const currentDirName = path.basename(this.destinationPath());
if (currentDirName !== this.props.name) {
this.log(`
Your project must be inside a folder named ${this.props.name}
I will create this folder for you.
`);
- mkdirp(this.props.name, (err: object) => {
- console.error("Failed to create directory", err);
- });
+ mkdirp(
+ this.props.name,
+ (err: object): void => {
+ console.error("Failed to create directory", err);
+ }
+ );
const pathToProjectDir: string = this.destinationPath(this.props.name);
this.destinationRoot(pathToProjectDir);
}
}
- public writing() {
+ public writing(): void {
this.copy = copyUtils.generatorCopy(this, templateDir);
- this.copyTpl = copyUtils.generatorCopyTpl(
- this,
- templateDir,
- templateFn(this),
- );
+ this.copyTpl = copyUtils.generatorCopyTpl(this, templateDir, templateFn(this));
copyFiles.forEach(this.copy);
copyTemplateFiles.forEach(this.copyTpl);
}
- public install() {
+ public install(): void {
this.npmInstall(["webpack-defaults", "bluebird"], {
- "save-dev": true,
+ "save-dev": true
});
}
- public end() {
+ public end(): void {
this.spawnCommand("npm", ["run", "defaults"]);
}
};
-}
+
+export default addonGenerator;
diff --git a/packages/generators/init-generator.ts b/packages/generators/init-generator.ts
index 3b63041c45d..a50f04813d3 100644
--- a/packages/generators/init-generator.ts
+++ b/packages/generators/init-generator.ts
@@ -1,15 +1,12 @@
import chalk from "chalk";
import * as logSymbols from "log-symbols";
-import Generator = require("yeoman-generator");
+import * as Generator from "yeoman-generator";
+import * as Inquirer from "inquirer";
import { getPackageManager } from "@webpack-cli/utils/package-manager";
-import {
- Confirm,
- Input,
- List,
-} from "@webpack-cli/webpack-scaffold";
+import { Confirm, Input, List } from "@webpack-cli/webpack-scaffold";
-import { IWebpackOptions } from "./types";
+import { WebpackOptions } from "./types";
import entryQuestions from "./utils/entry";
import getBabelPlugin from "./utils/module";
import getDefaultPlugins from "./utils/plugins";
@@ -30,32 +27,33 @@ export default class InitGenerator extends Generator {
private dependencies: string[];
private configuration: {
config: {
- configName?: string,
- topScope?: string[],
- webpackOptions?: IWebpackOptions,
- },
+ configName?: string;
+ topScope?: string[];
+ webpackOptions?: WebpackOptions;
+ };
};
- constructor(args, opts) {
+ public constructor(args, opts) {
super(args, opts);
this.isProd = false;
- this.usingDefaults = false,
- this.dependencies = [
- "webpack",
- "webpack-cli",
- "uglifyjs-webpack-plugin",
- "babel-plugin-syntax-dynamic-import",
- ];
+ (this.usingDefaults = false),
+ (this.dependencies = [
+ "webpack",
+ "webpack-cli",
+ "terser-webpack-plugin",
+ "babel-plugin-syntax-dynamic-import"
+ ]);
this.configuration = {
config: {
topScope: [],
- webpackOptions: {},
- },
+ webpackOptions: {}
+ }
};
}
- public prompting() {
- const done: (_?: void) => void | boolean = this.async();
+ // eslint-disable-next-line
+ public prompting(): any {
+ const done: () => {} = this.async();
const self: this = this;
let regExpForStyles: string;
let ExtractUseProps: object[];
@@ -65,389 +63,361 @@ export default class InitGenerator extends Generator {
logSymbols.info +
chalk.blue(" INFO ") +
"For more information and a detailed description of each question, have a look at " +
- chalk.bold.green(
- "https://github.com/webpack/webpack-cli/blob/master/INIT.md",
- ) +
- "\n",
+ chalk.bold.green("https://github.com/webpack/webpack-cli/blob/master/INIT.md") +
+ "\n"
);
process.stdout.write(
logSymbols.info +
chalk.blue(" INFO ") +
"Alternatively, run `webpack(-cli) --help` for usage info." +
- "\n\n",
+ "\n\n"
);
this.configuration.config.webpackOptions.module = {
- rules: [],
+ rules: []
};
this.configuration.config.topScope.push(
"const webpack = require('webpack')",
"const path = require('path')",
- "\n",
+ "\n"
);
- return this.prompt([
- Confirm("entryType", "Will your application have multiple bundles?"),
- ])
- .then((entryTypeAnswer: {
- entryType: boolean;
- }) => {
- // Ask different questions for entry points
- return entryQuestions(self, entryTypeAnswer);
- })
- .then((entryOptions: object | string) => {
- if (typeof entryOptions === "string" && entryOptions.length > 0) {
+ return this.prompt([Confirm("entryType", "Will your application have multiple bundles?", false)])
+ .then(
+ (entryTypeAnswer: { entryType: boolean }): Promise => {
+ // Ask different questions for entry points
+ return entryQuestions(self, entryTypeAnswer);
+ }
+ )
+ .then(
+ (entryOptions: object | string): Promise<{}> => {
+ if (typeof entryOptions === "string" && entryOptions.length > 0) {
+ return this.prompt([
+ Input("outputType", "In which folder do you want to store your generated bundles? (dist):")
+ ]);
+ }
+ if (entryOptions !== '""') {
+ this.configuration.config.webpackOptions.entry = entryOptions;
+ }
return this.prompt([
- Input(
- "outputType",
- "Which folder will your generated bundles be in? [default: dist]:",
- ),
+ Input("outputType", "In which folder do you want to store your generated bundles? (dist):")
]);
}
- if (entryOptions !== "\"\"") {
- this.configuration.config.webpackOptions.entry = entryOptions;
- }
- return this.prompt([
- Input(
- "outputType",
- "Which folder will your generated bundles be in? [default: dist]:",
- ),
- ]);
- })
- .then((outputTypeAnswer: {
- outputType: string;
- }) => {
- // As entry is not required anymore and we dont set it to be an empty string or """""
- // it can be undefined so falsy check is enough (vs entry.length);
- if (
- !this.configuration.config.webpackOptions.entry &&
- !this.usingDefaults
- ) {
- this.configuration.config.webpackOptions.output = {
- chunkFilename: "'[name].[chunkhash].js'",
- filename: "'[name].[chunkhash].js'",
- };
- } else if (!this.usingDefaults) {
- this.configuration.config.webpackOptions.output = {
- filename: "'[name].[chunkhash].js'",
- };
+ )
+ .then(
+ (outputTypeAnswer: { outputType: string }): void => {
+ // As entry is not required anymore and we dont set it to be an empty string or """""
+ // it can be undefined so falsy check is enough (vs entry.length);
+ if (!this.configuration.config.webpackOptions.entry && !this.usingDefaults) {
+ this.configuration.config.webpackOptions.output = {
+ chunkFilename: "'[name].[chunkhash].js'",
+ filename: "'[name].[chunkhash].js'"
+ };
+ } else if (!this.usingDefaults) {
+ this.configuration.config.webpackOptions.output = {
+ filename: "'[name].[chunkhash].js'"
+ };
+ }
+ if (!this.usingDefaults && outputTypeAnswer.outputType.length) {
+ this.configuration.config.webpackOptions.output.path = `path.resolve(__dirname, '${
+ outputTypeAnswer.outputType
+ }')`;
+ }
}
- if (!this.usingDefaults && outputTypeAnswer.outputType.length) {
- this.configuration.config.webpackOptions.output.path =
- `path.resolve(__dirname, '${outputTypeAnswer.outputType}')`;
+ )
+ .then(
+ (): Promise => {
+ this.isProd = this.usingDefaults ? true : false;
+ this.configuration.config.configName = this.isProd ? "prod" : "config";
+ if (!this.isProd) {
+ this.configuration.config.webpackOptions.mode = "'development'";
+ }
+ this.configuration.config.webpackOptions.plugins = this.isProd ? [] : getDefaultPlugins();
+ return this.prompt([Confirm("babelConfirm", "Will you be using ES2015?")]);
}
- })
- .then((_: void) => {
- this.isProd = this.usingDefaults ? true : false;
- this.configuration.config.configName = this.isProd ? "prod" : "config";
- if (!this.isProd) {
- this.configuration.config.webpackOptions.mode = "'development'";
+ )
+ .then(
+ (babelConfirmAnswer: { babelConfirm: boolean }): void => {
+ if (babelConfirmAnswer.babelConfirm) {
+ this.configuration.config.webpackOptions.module.rules.push(getBabelPlugin());
+ this.dependencies.push("babel-loader", "@babel/core", "@babel/preset-env");
+ }
}
- this.configuration.config.webpackOptions.plugins = this.isProd ? [] : getDefaultPlugins();
- return this.prompt([
- Confirm("babelConfirm", "Will you be using ES2015?"),
- ]);
- })
- .then((babelConfirmAnswer: {
- babelConfirm: boolean;
- }) => {
- if (babelConfirmAnswer.babelConfirm) {
- this.configuration.config.webpackOptions.module.rules.push(
- getBabelPlugin(),
- );
- this.dependencies.push(
- "babel-loader",
- "@babel/core",
- "@babel/preset-env",
- );
+ )
+ .then(
+ (): Promise => {
+ return this.prompt([
+ List("stylingType", "Will you use one of the below CSS solutions?", [
+ "No",
+ "CSS",
+ "SASS",
+ "LESS",
+ "PostCSS"
+ ])
+ ]);
}
- })
- .then((_: void) => {
- return this.prompt([
- List("stylingType", "Will you use one of the below CSS solutions?", [
- "SASS",
- "LESS",
- "CSS",
- "PostCSS",
- "No",
- ]),
- ]);
- })
- .then((stylingTypeAnswer: {
- stylingType: string;
- }) => {
- ExtractUseProps = [];
- switch (stylingTypeAnswer.stylingType) {
- case "SASS":
- this.dependencies.push(
- "sass-loader",
- "node-sass",
- "style-loader",
- "css-loader",
- );
- regExpForStyles = `${new RegExp(/\.(scss|css)$/)}`;
- if (this.isProd) {
- ExtractUseProps.push(
- {
- loader: "'css-loader'",
- options: {
- sourceMap: true,
+ )
+ .then(
+ (stylingTypeAnswer: { stylingType: string }): void => {
+ ExtractUseProps = [];
+ switch (stylingTypeAnswer.stylingType) {
+ case "SASS":
+ this.dependencies.push("sass-loader", "node-sass", "style-loader", "css-loader");
+ regExpForStyles = `${new RegExp(/\.(scss|css)$/)}`;
+ if (this.isProd) {
+ ExtractUseProps.push(
+ {
+ loader: "'css-loader'",
+ options: {
+ sourceMap: true
+ }
},
- },
- {
- loader: "'sass-loader'",
- options: {
- sourceMap: true,
+ {
+ loader: "'sass-loader'",
+ options: {
+ sourceMap: true
+ }
+ }
+ );
+ } else {
+ ExtractUseProps.push(
+ {
+ loader: "'style-loader'"
},
- },
- );
- } else {
- ExtractUseProps.push(
- {
- loader: "'style-loader'",
- },
- {
- loader: "'css-loader'",
- },
- {
- loader: "'sass-loader'",
- },
- );
- }
- break;
- case "LESS":
- regExpForStyles = `${new RegExp(/\.(less|css)$/)}`;
- this.dependencies.push(
- "less-loader",
- "less",
- "style-loader",
- "css-loader",
- );
- if (this.isProd) {
- ExtractUseProps.push(
- {
- loader: "'css-loader'",
- options: {
- sourceMap: true,
+ {
+ loader: "'css-loader'"
},
- },
- {
- loader: "'less-loader'",
- options: {
- sourceMap: true,
+ {
+ loader: "'sass-loader'"
+ }
+ );
+ }
+ break;
+ case "LESS":
+ regExpForStyles = `${new RegExp(/\.(less|css)$/)}`;
+ this.dependencies.push("less-loader", "less", "style-loader", "css-loader");
+ if (this.isProd) {
+ ExtractUseProps.push(
+ {
+ loader: "'css-loader'",
+ options: {
+ sourceMap: true
+ }
},
- },
- );
- } else {
- ExtractUseProps.push(
- {
- loader: "'css-loader'",
- options: {
- sourceMap: true,
+ {
+ loader: "'less-loader'",
+ options: {
+ sourceMap: true
+ }
+ }
+ );
+ } else {
+ ExtractUseProps.push(
+ {
+ loader: "'css-loader'",
+ options: {
+ sourceMap: true
+ }
},
- },
- {
- loader: "'less-loader'",
- options: {
- sourceMap: true,
- },
- },
+ {
+ loader: "'less-loader'",
+ options: {
+ sourceMap: true
+ }
+ }
+ );
+ }
+ break;
+ case "PostCSS":
+ this.configuration.config.topScope.push(
+ tooltip.postcss(),
+ "const autoprefixer = require('autoprefixer');",
+ "const precss = require('precss');",
+ "\n"
);
- }
- break;
- case "PostCSS":
- this.configuration.config.topScope.push(
- tooltip.postcss(),
- "const autoprefixer = require('autoprefixer');",
- "const precss = require('precss');",
- "\n",
- );
- this.dependencies.push(
- "style-loader",
- "css-loader",
- "postcss-loader",
- "precss",
- "autoprefixer",
- );
- regExpForStyles = `${new RegExp(/\.css$/)}`;
- if (this.isProd) {
- ExtractUseProps.push(
- {
- loader: "'css-loader'",
- options: {
- importLoaders: 1,
- sourceMap: true,
+ this.dependencies.push(
+ "style-loader",
+ "css-loader",
+ "postcss-loader",
+ "precss",
+ "autoprefixer"
+ );
+ regExpForStyles = `${new RegExp(/\.css$/)}`;
+ if (this.isProd) {
+ ExtractUseProps.push(
+ {
+ loader: "'css-loader'",
+ options: {
+ importLoaders: 1,
+ sourceMap: true
+ }
},
- },
- {
- loader: "'postcss-loader'",
- options: {
- plugins: `function () {
+ {
+ loader: "'postcss-loader'",
+ options: {
+ plugins: `function () {
return [
precss,
autoprefixer
];
- }`,
+ }`
+ }
+ }
+ );
+ } else {
+ ExtractUseProps.push(
+ {
+ loader: "'style-loader'"
},
- },
- );
- } else {
- ExtractUseProps.push(
- {
- loader: "'style-loader'",
- },
- {
- loader: "'css-loader'",
- options: {
- importLoaders: 1,
- sourceMap: true,
+ {
+ loader: "'css-loader'",
+ options: {
+ importLoaders: 1,
+ sourceMap: true
+ }
},
- },
- {
- loader: "'postcss-loader'",
- options: {
- plugins: `function () {
+ {
+ loader: "'postcss-loader'",
+ options: {
+ plugins: `function () {
return [
precss,
autoprefixer
];
- }`,
- },
- },
- );
- }
- break;
- case "CSS":
- this.dependencies.push("style-loader", "css-loader");
- regExpForStyles = `${new RegExp(/\.css$/)}`;
- if (this.isProd) {
- ExtractUseProps.push({
- loader: "'css-loader'",
- options: {
- sourceMap: true,
- },
- });
- } else {
- ExtractUseProps.push(
- {
- loader: "'style-loader'",
+ }`
+ }
+ }
+ );
+ }
+ break;
+ case "CSS":
+ this.dependencies.push("style-loader", "css-loader");
+ regExpForStyles = `${new RegExp(/\.css$/)}`;
+ if (this.isProd) {
+ ExtractUseProps.push({
+ loader: "'css-loader'",
options: {
- sourceMap: true,
+ sourceMap: true
+ }
+ });
+ } else {
+ ExtractUseProps.push(
+ {
+ loader: "'style-loader'",
+ options: {
+ sourceMap: true
+ }
},
- },
- {
- loader: "'css-loader'",
- },
- );
- }
- break;
- default:
- regExpForStyles = null;
- }
- })
- .then((_: void) => {
- if (this.isProd) {
- // Ask if the user wants to use extractPlugin
- return this.prompt([
- Input(
- "extractPlugin",
- "If you want to bundle your CSS files, what will you name the bundle? (press enter to skip)",
- ),
- ]);
+ {
+ loader: "'css-loader'"
+ }
+ );
+ }
+ break;
+ default:
+ regExpForStyles = null;
+ }
}
- })
- .then((extractPluginAnswer: {
- extractPlugin: string;
- }) => {
- if (regExpForStyles) {
+ )
+ .then(
+ (): Promise => {
if (this.isProd) {
- const cssBundleName: string = extractPluginAnswer.extractPlugin;
- this.configuration.config.topScope.push(tooltip.cssPlugin());
- this.dependencies.push("mini-css-extract-plugin");
+ // Ask if the user wants to use extractPlugin
+ return this.prompt([
+ Input(
+ "extractPlugin",
+ "If you want to bundle your CSS files, what will you name the bundle? (press enter to skip)"
+ )
+ ]);
+ }
+ }
+ )
+ .then(
+ (extractPluginAnswer: { extractPlugin: string }): void => {
+ if (regExpForStyles) {
+ if (this.isProd) {
+ const cssBundleName: string = extractPluginAnswer.extractPlugin;
+ this.configuration.config.topScope.push(tooltip.cssPlugin());
+ this.dependencies.push("mini-css-extract-plugin");
- if (cssBundleName.length !== 0) {
- this.configuration.config.webpackOptions.plugins.push(
- // TODO: use [contenthash] after it is supported
- `new MiniCssExtractPlugin({ filename:'${cssBundleName}.[chunkhash].css' })`,
- );
- } else {
- this.configuration.config.webpackOptions.plugins.push(
- "new MiniCssExtractPlugin({ filename:'style.css' })",
- );
- }
+ if (cssBundleName.length !== 0) {
+ (this.configuration.config.webpackOptions.plugins as string[]).push(
+ // TODO: use [contenthash] after it is supported
+ `new MiniCssExtractPlugin({ filename:'${cssBundleName}.[chunkhash].css' })`
+ );
+ } else {
+ (this.configuration.config.webpackOptions.plugins as string[]).push(
+ "new MiniCssExtractPlugin({ filename:'style.css' })"
+ );
+ }
- ExtractUseProps.unshift({
- loader: "MiniCssExtractPlugin.loader",
- });
+ ExtractUseProps.unshift({
+ loader: "MiniCssExtractPlugin.loader"
+ });
- const moduleRulesObj = {
- test: regExpForStyles,
- use: ExtractUseProps,
- };
+ const moduleRulesObj = {
+ test: regExpForStyles,
+ use: ExtractUseProps
+ };
- this.configuration.config.webpackOptions.module.rules.push(
- moduleRulesObj,
- );
- this.configuration.config.topScope.push(
- "const MiniCssExtractPlugin = require('mini-css-extract-plugin');",
- "\n",
- );
- } else {
- const moduleRulesObj: {
- test: string;
- use: object[];
- } = {
- test: regExpForStyles,
- use: ExtractUseProps,
- };
+ this.configuration.config.webpackOptions.module.rules.push(moduleRulesObj);
+ this.configuration.config.topScope.push(
+ "const MiniCssExtractPlugin = require('mini-css-extract-plugin');",
+ "\n"
+ );
+ } else {
+ const moduleRulesObj: {
+ test: string;
+ use: object[];
+ } = {
+ test: regExpForStyles,
+ use: ExtractUseProps
+ };
- this.configuration.config.webpackOptions.module.rules.push(
- moduleRulesObj,
- );
+ this.configuration.config.webpackOptions.module.rules.push(moduleRulesObj);
+ }
}
- }
- // add splitChunks options for transparency
- // defaults coming from: https://webpack.js.org/plugins/split-chunks-plugin/#optimization-splitchunks
- this.configuration.config.topScope.push(tooltip.splitChunks());
- this.configuration.config.webpackOptions.optimization = {
- splitChunks: {
- cacheGroups: {
- vendors: {
- priority: -10,
- test: "/[\\\\/]node_modules[\\\\/]/",
+ // add splitChunks options for transparency
+ // defaults coming from: https://webpack.js.org/plugins/split-chunks-plugin/#optimization-splitchunks
+ this.configuration.config.topScope.push(tooltip.splitChunks());
+ this.configuration.config.webpackOptions.optimization = {
+ splitChunks: {
+ cacheGroups: {
+ vendors: {
+ priority: -10,
+ test: "/[\\\\/]node_modules[\\\\/]/"
+ }
},
- },
- chunks: "'async'",
- minChunks: 1,
- minSize: 30000,
- // for production name is recommended to be off
- name: !this.isProd,
- },
- };
- done();
- });
+ chunks: "'async'",
+ minChunks: 1,
+ minSize: 30000,
+ // for production name is recommended to be off
+ name: !this.isProd
+ }
+ };
+ done();
+ }
+ );
}
- public installPlugins() {
+ public installPlugins(): void {
if (this.isProd) {
- this.dependencies = this.dependencies.filter(
- (p: string) => p !== "uglifyjs-webpack-plugin",
- );
+ this.dependencies = this.dependencies.filter((p: string): boolean => p !== "terser-webpack-plugin");
} else {
this.configuration.config.topScope.push(
- tooltip.uglify(),
- "const UglifyJSPlugin = require('uglifyjs-webpack-plugin');",
- "\n",
+ tooltip.terser(),
+ "const TerserPlugin = require('terser-webpack-plugin');",
+ "\n"
);
}
- const packager: string = getPackageManager();
+ const packager = getPackageManager();
const opts: {
- dev?: boolean,
- "save-dev"?: boolean,
+ dev?: boolean;
+ "save-dev"?: boolean;
} = packager === "yarn" ? { dev: true } : { "save-dev": true };
this.scheduleInstallTask(packager, this.dependencies, opts);
}
- public writing() {
+ public writing(): void {
this.config.set("configuration", this.configuration);
}
}
diff --git a/packages/generators/package-lock.json b/packages/generators/package-lock.json
index 60bec2740d7..9e54eb33282 100644
--- a/packages/generators/package-lock.json
+++ b/packages/generators/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "@webpack-cli/generators",
- "version": "0.1.2",
+ "version": "0.1.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -92,6 +92,27 @@
"@types/node": "*"
}
},
+ "@types/inquirer": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/@types/inquirer/-/inquirer-6.0.1.tgz",
+ "integrity": "sha512-O9rEHE9iBvYaFAGS0fAlDzqY/3CsOrRKzni4zwnAEce2JrHUEbXAce2Pwwe8ZGzmQkucwSXn1tSiKig37INgfA==",
+ "dev": true,
+ "requires": {
+ "@types/through": "*",
+ "rxjs": ">=6.4.0"
+ },
+ "dependencies": {
+ "rxjs": {
+ "version": "6.5.1",
+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.1.tgz",
+ "integrity": "sha512-y0j31WJc83wPu31vS1VlAFW5JGrnGC+j+TtGAa1fRQphy48+fDYiDmX8tjGloToEsMkxnouOg/1IzXGKkJnZMg==",
+ "dev": true,
+ "requires": {
+ "tslib": "^1.9.0"
+ }
+ }
+ }
+ },
"@types/lodash": {
"version": "4.14.119",
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.119.tgz",
@@ -147,6 +168,15 @@
"integrity": "sha512-78AdXtlhpCHT0K3EytMpn4JNxaf5tbqbLcbIRoQIHzpTIyjpxLQKRoxU55ujBXAtg3Nl2h/XWvfDa9dsMOd0pQ==",
"dev": true
},
+ "@types/through": {
+ "version": "0.0.29",
+ "resolved": "https://registry.npmjs.org/@types/through/-/through-0.0.29.tgz",
+ "integrity": "sha512-9a7C5VHh+1BKblaYiq+7Tfc+EOmjMdZaD1MYtkQjSoxgB69tBjW98ry6SKsi4zEIWztLOMRuL87A3bdT/Fc/4w==",
+ "dev": true,
+ "requires": {
+ "@types/node": "*"
+ }
+ },
"@types/uglify-js": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/@types/uglify-js/-/uglify-js-3.0.4.tgz",
@@ -197,6 +227,27 @@
"@types/webpack": "*"
}
},
+ "@types/yeoman-generator": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/@types/yeoman-generator/-/yeoman-generator-3.1.2.tgz",
+ "integrity": "sha512-Wr67yKgBKxKJ9eUNCL5WuKuc3e9CSCbdw8nMDiBatp+/NHgvriqUGjt5kbWBIfLG9yRdIKaxT4Tf8L+VVd7qSA==",
+ "dev": true,
+ "requires": {
+ "@types/inquirer": "*",
+ "rxjs": ">=6.4.0"
+ },
+ "dependencies": {
+ "rxjs": {
+ "version": "6.5.1",
+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.1.tgz",
+ "integrity": "sha512-y0j31WJc83wPu31vS1VlAFW5JGrnGC+j+TtGAa1fRQphy48+fDYiDmX8tjGloToEsMkxnouOg/1IzXGKkJnZMg==",
+ "dev": true,
+ "requires": {
+ "tslib": "^1.9.0"
+ }
+ }
+ }
+ },
"@webassemblyjs/ast": {
"version": "1.7.11",
"resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.7.11.tgz",
@@ -519,7 +570,7 @@
},
"util": {
"version": "0.10.3",
- "resolved": "http://registry.npmjs.org/util/-/util-0.10.3.tgz",
+ "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz",
"integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=",
"requires": {
"inherits": "2.0.1"
@@ -1865,7 +1916,7 @@
},
"finalhandler": {
"version": "1.1.1",
- "resolved": "http://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz",
+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz",
"integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==",
"requires": {
"debug": "2.6.9",
@@ -1995,7 +2046,8 @@
},
"ansi-regex": {
"version": "2.1.1",
- "bundled": true
+ "bundled": true,
+ "optional": true
},
"aproba": {
"version": "1.2.0",
@@ -2013,11 +2065,13 @@
},
"balanced-match": {
"version": "1.0.0",
- "bundled": true
+ "bundled": true,
+ "optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
+ "optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -2030,15 +2084,18 @@
},
"code-point-at": {
"version": "1.1.0",
- "bundled": true
+ "bundled": true,
+ "optional": true
},
"concat-map": {
"version": "0.0.1",
- "bundled": true
+ "bundled": true,
+ "optional": true
},
"console-control-strings": {
"version": "1.1.0",
- "bundled": true
+ "bundled": true,
+ "optional": true
},
"core-util-is": {
"version": "1.0.2",
@@ -2141,7 +2198,8 @@
},
"inherits": {
"version": "2.0.3",
- "bundled": true
+ "bundled": true,
+ "optional": true
},
"ini": {
"version": "1.3.5",
@@ -2151,6 +2209,7 @@
"is-fullwidth-code-point": {
"version": "1.0.0",
"bundled": true,
+ "optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@@ -2163,17 +2222,20 @@
"minimatch": {
"version": "3.0.4",
"bundled": true,
+ "optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "0.0.8",
- "bundled": true
+ "bundled": true,
+ "optional": true
},
"minipass": {
"version": "2.2.4",
"bundled": true,
+ "optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
@@ -2190,6 +2252,7 @@
"mkdirp": {
"version": "0.5.1",
"bundled": true,
+ "optional": true,
"requires": {
"minimist": "0.0.8"
}
@@ -2262,7 +2325,8 @@
},
"number-is-nan": {
"version": "1.0.1",
- "bundled": true
+ "bundled": true,
+ "optional": true
},
"object-assign": {
"version": "4.1.1",
@@ -2272,6 +2336,7 @@
"once": {
"version": "1.4.0",
"bundled": true,
+ "optional": true,
"requires": {
"wrappy": "1"
}
@@ -2347,7 +2412,8 @@
},
"safe-buffer": {
"version": "5.1.1",
- "bundled": true
+ "bundled": true,
+ "optional": true
},
"safer-buffer": {
"version": "2.1.2",
@@ -2377,6 +2443,7 @@
"string-width": {
"version": "1.0.2",
"bundled": true,
+ "optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@@ -2394,6 +2461,7 @@
"strip-ansi": {
"version": "3.0.1",
"bundled": true,
+ "optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@@ -2432,11 +2500,13 @@
},
"wrappy": {
"version": "1.0.2",
- "bundled": true
+ "bundled": true,
+ "optional": true
},
"yallist": {
"version": "3.0.2",
- "bundled": true
+ "bundled": true,
+ "optional": true
}
}
},
@@ -2447,7 +2517,7 @@
},
"get-stream": {
"version": "3.0.0",
- "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
"integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ="
},
"get-value": {
@@ -2520,7 +2590,7 @@
},
"globby": {
"version": "6.1.0",
- "resolved": "http://registry.npmjs.org/globby/-/globby-6.1.0.tgz",
+ "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz",
"integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=",
"requires": {
"array-union": "^1.0.1",
@@ -2532,7 +2602,7 @@
"dependencies": {
"pify": {
"version": "2.3.0",
- "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
}
}
@@ -2679,7 +2749,7 @@
},
"http-errors": {
"version": "1.6.3",
- "resolved": "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
"integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=",
"requires": {
"depd": "~1.1.2",
@@ -2705,7 +2775,7 @@
},
"http-proxy-middleware": {
"version": "0.18.0",
- "resolved": "http://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.18.0.tgz",
+ "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.18.0.tgz",
"integrity": "sha512-Fs25KVMPAIIcgjMZkVHJoKg9VcXcC1C8yb9JUgeDvVXY0S/zgVIhMb+qVswDIgtJe2DfckMSY2d6TuTEutlk6Q==",
"requires": {
"http-proxy": "^1.16.2",
@@ -2857,7 +2927,7 @@
},
"is-accessor-descriptor": {
"version": "0.1.6",
- "resolved": "http://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
"integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
"requires": {
"kind-of": "^3.0.2"
@@ -2893,7 +2963,7 @@
},
"is-builtin-module": {
"version": "1.0.0",
- "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz",
+ "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz",
"integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=",
"requires": {
"builtin-modules": "^1.0.0"
@@ -2901,7 +2971,7 @@
},
"is-data-descriptor": {
"version": "0.1.4",
- "resolved": "http://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
"integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
"requires": {
"kind-of": "^3.0.2"
@@ -3111,7 +3181,7 @@
},
"json5": {
"version": "1.0.1",
- "resolved": "http://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
"requires": {
"minimist": "^1.2.0"
@@ -3119,7 +3189,7 @@
"dependencies": {
"minimist": {
"version": "1.2.0",
- "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
}
}
@@ -3254,7 +3324,7 @@
},
"media-typer": {
"version": "0.3.0",
- "resolved": "http://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
+ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
},
"mem": {
@@ -3439,7 +3509,7 @@
},
"minimist": {
"version": "0.1.0",
- "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.1.0.tgz",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.1.0.tgz",
"integrity": "sha1-md9lelJXTCHJBXSX33QnkLK0wN4="
},
"mississippi": {
@@ -3480,7 +3550,7 @@
},
"mkdirp": {
"version": "0.5.1",
- "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"requires": {
"minimist": "0.0.8"
@@ -3488,7 +3558,7 @@
"dependencies": {
"minimist": {
"version": "0.0.8",
- "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
}
}
@@ -3527,7 +3597,7 @@
},
"multimatch": {
"version": "2.1.0",
- "resolved": "http://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz",
+ "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz",
"integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=",
"requires": {
"array-differ": "^1.0.0",
@@ -3538,7 +3608,7 @@
},
"mute-stream": {
"version": "0.0.7",
- "resolved": "http://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz",
+ "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz",
"integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s="
},
"nan": {
@@ -3794,7 +3864,7 @@
},
"os-tmpdir": {
"version": "1.0.2",
- "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
+ "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
},
"p-cancelable": {
@@ -3814,7 +3884,7 @@
},
"p-is-promise": {
"version": "1.1.0",
- "resolved": "http://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz",
+ "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz",
"integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4="
},
"p-limit": {
@@ -3899,7 +3969,7 @@
},
"path-browserify": {
"version": "0.0.0",
- "resolved": "http://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz",
+ "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz",
"integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo="
},
"path-dirname": {
@@ -3914,7 +3984,7 @@
},
"path-is-absolute": {
"version": "1.0.1",
- "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
},
"path-is-inside": {
@@ -4175,7 +4245,7 @@
},
"readable-stream": {
"version": "2.3.6",
- "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"requires": {
"core-util-is": "~1.0.0",
@@ -4337,7 +4407,7 @@
},
"safe-regex": {
"version": "1.1.0",
- "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
+ "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
"integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=",
"requires": {
"ret": "~0.1.10"
@@ -4468,7 +4538,7 @@
},
"sha.js": {
"version": "2.4.11",
- "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz",
+ "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz",
"integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==",
"requires": {
"inherits": "^2.0.1",
@@ -4828,7 +4898,7 @@
},
"stream-browserify": {
"version": "2.0.1",
- "resolved": "http://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz",
+ "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz",
"integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=",
"requires": {
"inherits": "~2.0.1",
@@ -4892,7 +4962,7 @@
},
"string_decoder": {
"version": "1.1.1",
- "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": {
"safe-buffer": "~5.1.0"
@@ -4900,7 +4970,7 @@
},
"strip-ansi": {
"version": "3.0.1",
- "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"requires": {
"ansi-regex": "^2.0.0"
@@ -4932,7 +5002,7 @@
},
"strip-eof": {
"version": "1.0.0",
- "resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
+ "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
"integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8="
},
"supports-color": {
@@ -5009,7 +5079,7 @@
},
"through": {
"version": "2.3.8",
- "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz",
+ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
"integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
},
"through2": {
@@ -5097,7 +5167,7 @@
},
"tty-browserify": {
"version": "0.0.0",
- "resolved": "http://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz",
+ "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz",
"integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY="
},
"type-is": {
@@ -5350,7 +5420,7 @@
},
"pify": {
"version": "2.3.0",
- "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
},
"replace-ext": {
@@ -5380,7 +5450,7 @@
},
"vm-browserify": {
"version": "0.0.4",
- "resolved": "http://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz",
+ "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz",
"integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=",
"requires": {
"indexof": "0.0.1"
@@ -5606,7 +5676,7 @@
},
"wrap-ansi": {
"version": "2.1.0",
- "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
"integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
"requires": {
"string-width": "^1.0.1",
@@ -5623,7 +5693,7 @@
},
"string-width": {
"version": "1.0.2",
- "resolved": "http://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"requires": {
"code-point-at": "^1.0.0",
@@ -5660,7 +5730,7 @@
},
"yargs": {
"version": "1.2.6",
- "resolved": "http://registry.npmjs.org/yargs/-/yargs-1.2.6.tgz",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-1.2.6.tgz",
"integrity": "sha1-nHtKgv1dWVsr8Xq23MQxNUMv40s=",
"requires": {
"minimist": "^0.1.0"
@@ -5788,7 +5858,7 @@
},
"minimist": {
"version": "1.2.0",
- "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
},
"ms": {
diff --git a/packages/generators/package.json b/packages/generators/package.json
index dd98ac8b21a..edcb344376b 100644
--- a/packages/generators/package.json
+++ b/packages/generators/package.json
@@ -26,16 +26,17 @@
"webpack": "4.x.x"
},
"devDependencies": {
+ "@types/inquirer": "^6.0.1",
"@types/lodash": "^4.14.118",
"@types/log-symbols": "^2.0.0",
"@types/mkdirp": "^0.5.2",
"@types/node": "^10.12.9",
"@types/webpack-dev-server": "^3.1.1",
+ "@types/yeoman-generator": "^3.1.2",
"typescript": "^3.1.6"
},
"scripts": {
"build": "tsc",
"watch": "npm run build && tsc -w"
- },
- "gitHead": "6846f2eb8f0d04acc4453cb20da10263ff00a139"
+ }
}
diff --git a/packages/generators/remove-generator.ts b/packages/generators/remove-generator.ts
index cec7c7a08a2..9169a42ffad 100644
--- a/packages/generators/remove-generator.ts
+++ b/packages/generators/remove-generator.ts
@@ -1,10 +1,10 @@
import * as fs from "fs";
import * as path from "path";
-import Generator = require("yeoman-generator");
+import * as Generator from "yeoman-generator";
import PROP_TYPES from "@webpack-cli/utils/prop-types";
import { List } from "@webpack-cli/webpack-scaffold";
-import { IWebpackOptions } from "./types";
+import { WebpackOptions } from "./types";
/**
*
@@ -18,23 +18,23 @@ import { IWebpackOptions } from "./types";
export default class RemoveGenerator extends Generator {
private configuration: {
config: {
- configName?: string,
- topScope?: string[],
- webpackOptions?: IWebpackOptions,
- },
+ configName?: string;
+ topScope?: string[];
+ webpackOptions?: WebpackOptions;
+ };
};
- private webpackOptions: IWebpackOptions | string;
+ private webpackOptions: WebpackOptions | string;
- constructor(args, opts) {
+ public constructor(args, opts) {
super(args, opts);
this.configuration = {
config: {
- webpackOptions: {},
- },
+ webpackOptions: {}
+ }
};
- let configPath: string = path.resolve(process.cwd(), "webpack.config.js");
- const webpackConfigExists: boolean = fs.existsSync(configPath);
+ let configPath = path.resolve(process.cwd(), "webpack.config.js");
+ const webpackConfigExists = fs.existsSync(configPath);
if (!webpackConfigExists) {
configPath = null;
// end the generator stating webpack config not found or to specify the config
@@ -49,90 +49,96 @@ export default class RemoveGenerator extends Generator {
public getModuleLoadersNames(): string[] {
if (typeof this.webpackOptions === "object") {
if (this.webpackOptions.module && this.webpackOptions.module.rules) {
- return this.webpackOptions.module.rules.map((rule: {
- loader: string;
- }) => rule ? rule.loader : null);
+ return this.webpackOptions.module.rules.map(
+ (rule: { loader: string }): string | null => (rule ? rule.loader : null)
+ );
}
}
}
- public prompting() {
- const done: (_?: void) => void | boolean = this.async();
+ public prompting(): Promise {
+ const done: () => {} = this.async();
let propValue: object | string | boolean;
- return this.prompt([
- List(
- "propType",
- "Which property do you want to remove?",
- Array.from(this.getPropTypes()),
- ),
- ])
- .then(({ propType }: { propType: string }): Promise<{}> => {
- if (!PROP_TYPES.has(propType)) {
- console.error("Invalid webpack config prop");
- return;
- }
+ return this.prompt([List("propType", "Which property do you want to remove?", Array.from(this.getPropTypes()))])
+ .then(
+ ({ propType }: { propType: string }): Promise => {
+ if (!PROP_TYPES.has(propType)) {
+ console.error("Invalid webpack config prop");
+ return;
+ }
- propValue = this.webpackOptions[propType];
- if (typeof propValue === "object") {
- if (Array.isArray(propValue)) {
- return this.prompt([
- List(
- "keyType",
- `Which key do you want to remove from ${propType}?`,
- Array.from(propValue),
- ),
- ]).then(({ keyType }: { keyType: string }): void => {
- this.configuration.config.webpackOptions[propType] = [ keyType ];
- });
- } else {
- return this.prompt([
- List(
- "keyType",
- `Which key do you want to remove from ${propType}?`,
- Array.from(Object.keys(propValue)),
- ),
- ])
- .then(({ keyType }: { keyType: string }): Promise<{}> => {
- if (propType === "module" && keyType === "rules") {
- return this.prompt([
- List(
- "rule",
- "Which loader do you want to remove?",
- Array.from(this.getModuleLoadersNames()),
- ),
- ])
- .then(({ rule }: { rule: string }): void => {
- if (typeof this.webpackOptions === "object") {
- const loaderIndex: number = this.getModuleLoadersNames().indexOf(rule);
- const loader: object = this.webpackOptions.module.rules[loaderIndex];
- this.configuration.config.webpackOptions.module = {
- rules: [ loader ],
- };
+ propValue = this.webpackOptions[propType];
+ if (typeof propValue === "object") {
+ if (Array.isArray(propValue)) {
+ return this.prompt([
+ List(
+ "keyType",
+ `Which key do you want to remove from ${propType}?`,
+ Array.from(propValue)
+ )
+ ]).then(
+ ({ keyType }: { keyType: string }): void => {
+ this.configuration.config.webpackOptions[propType] = [keyType];
+ }
+ );
+ } else {
+ return this.prompt([
+ List(
+ "keyType",
+ `Which key do you want to remove from ${propType}?`,
+ Array.from(Object.keys(propValue))
+ )
+ ]).then(
+ ({ keyType }: { keyType: string }): Promise => {
+ if (propType === "module" && keyType === "rules") {
+ return this.prompt([
+ List(
+ "rule",
+ "Which loader do you want to remove?",
+ Array.from(this.getModuleLoadersNames())
+ )
+ ]).then(
+ ({ rule }: { rule: string }): void => {
+ if (typeof this.webpackOptions === "object") {
+ const loaderIndex: number = this.getModuleLoadersNames().indexOf(
+ rule
+ );
+ const loader: object = this.webpackOptions.module.rules[
+ loaderIndex
+ ];
+ this.configuration.config.webpackOptions.module = {
+ rules: [loader]
+ };
+ }
}
- });
- } else {
- // remove the complete prop object if there is only one key
- if (Object.keys(this.webpackOptions[propType]).length <= 1) {
- this.configuration.config.webpackOptions[propType] = null;
+ );
} else {
- this.configuration.config.webpackOptions[propType] = {
- [keyType]: null,
- };
+ // remove the complete prop object if there is only one key
+ if (Object.keys(this.webpackOptions[propType]).length <= 1) {
+ this.configuration.config.webpackOptions[propType] = null;
+ } else {
+ this.configuration.config.webpackOptions[propType] = {
+ [keyType]: null
+ };
+ }
}
}
- });
+ );
+ }
+ } else {
+ this.configuration.config.webpackOptions[propType] = null;
}
- } else {
- this.configuration.config.webpackOptions[propType] = null;
}
- })
- .then((_: void): void => {
- done();
- });
+ )
+ .then(
+ (): void => {
+ done();
+ }
+ );
}
- public writing() {
+ public writing(): void {
this.config.set("configuration", this.configuration);
}
}
diff --git a/packages/generators/tslint.json b/packages/generators/tslint.json
deleted file mode 100644
index 0946f20963a..00000000000
--- a/packages/generators/tslint.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "extends": "../../tslint.json"
-}
diff --git a/packages/generators/types/index.ts b/packages/generators/types/index.ts
index 1adc7ee911c..449dc0cc477 100644
--- a/packages/generators/types/index.ts
+++ b/packages/generators/types/index.ts
@@ -1,11 +1,11 @@
-export interface ISchemaProperties {
+export interface SchemaProperties {
additionalProperties?: boolean;
definitions?: object;
properties?: object;
type?: string;
}
-interface IWebpackResolve {
+interface WebpackResolve {
alias?: object;
aliasFields?: string[];
cachePredicate?: Function;
@@ -27,7 +27,7 @@ interface IWebpackResolve {
type IRuleSetCondition = RegExp | string | Function | object;
-export interface IWebpackOptions {
+export interface WebpackOptions {
amd?: string;
bail?: boolean;
cache?: boolean | object;
@@ -47,10 +47,12 @@ export interface IWebpackOptions {
headers?: object;
logLevel?: string;
clientLogLevel?: string;
- overlay?: boolean | {
- errors?: boolean;
- warnings?: boolean;
- };
+ overlay?:
+ | boolean
+ | {
+ errors?: boolean;
+ warnings?: boolean;
+ };
progress?: boolean;
key?: string | Buffer;
cert?: string | Buffer;
@@ -69,10 +71,12 @@ export interface IWebpackOptions {
openPage?: string;
compress?: boolean;
proxy?: object[] | Function[];
- historyApiFallback?: boolean | {
- rewrites?: object[];
- disableDotRule?: boolean;
- };
+ historyApiFallback?:
+ | boolean
+ | {
+ rewrites?: object[];
+ disableDotRule?: boolean;
+ };
staticOptions?: object;
setup?: Function;
before?: Function;
@@ -97,25 +101,7 @@ export interface IWebpackOptions {
exprContextRegExp?: boolean | RegExp;
exprContextRequest?: string;
noParse?: string | string[] | Function | RegExp | RegExp[];
- rules?: Array<{
- enforce?: "pre" | "post";
- exclude?: IRuleSetCondition;
- include?: IRuleSetCondition;
- issuer?: IRuleSetCondition;
- loader?: string | Function | object;
- loaders?: Function[] | object[];
- options?: object;
- parser?: object;
- sideEffects?: boolean;
- type?: string;
- resource?: IRuleSetCondition;
- resourceQuery?: IRuleSetCondition;
- compiler?: IRuleSetCondition;
- rules?: object[];
- use?: object | object[] | Function;
- test?: IRuleSetCondition;
-
- }>;
+ rules?: Rule[];
unknownContextCritical?: boolean;
unknownContextRecursive?: boolean;
unknownContextRegExp?: boolean | RegExp;
@@ -127,15 +113,19 @@ export interface IWebpackOptions {
strictExportPresence?: boolean;
strictThisContextOnImports?: boolean;
};
- node?: false | true | string | {
- console?: boolean | string;
- process?: boolean | string;
- global?: boolean;
- __filename?: boolean | string;
- __dirname?: boolean | string;
- Buffer?: boolean | string;
- setImmediate?: boolean | string;
- };
+ node?:
+ | false
+ | true
+ | string
+ | {
+ console?: boolean | string;
+ process?: boolean | string;
+ global?: boolean;
+ __filename?: boolean | string;
+ __dirname?: boolean | string;
+ Buffer?: boolean | string;
+ setImmediate?: boolean | string;
+ };
output?: {
auxiliaryComment?: string | object;
chunkFilename?: string;
@@ -199,19 +189,21 @@ export interface IWebpackOptions {
};
};
parallelism?: number;
- performance?: false | {
- assetFilter?: Function;
- hints?: false | string;
- maxEntrypointSize?: number;
- maxAssetSize?: number;
- };
- plugins?: object[] | Function[] | string[] | string | any;
+ performance?:
+ | false
+ | {
+ assetFilter?: Function;
+ hints?: false | string;
+ maxEntrypointSize?: number;
+ maxAssetSize?: number;
+ };
+ plugins?: object[] | Function[] | string[] | string;
profile?: boolean;
recordsInputPath?: string;
recordsOutputPath?: string;
recordsPath?: string;
- resolve?: IWebpackResolve;
- resolveLoader?: IWebpackResolve;
+ resolve?: WebpackResolve;
+ resolveLoader?: WebpackResolve;
stats?: string | boolean | object;
target?: string | Function;
watch?: boolean;
@@ -221,3 +213,22 @@ export interface IWebpackOptions {
poll?: boolean | number;
};
}
+
+interface Rule {
+ enforce?: "pre" | "post";
+ exclude?: IRuleSetCondition;
+ include?: IRuleSetCondition;
+ issuer?: IRuleSetCondition;
+ loader?: string | Function | object;
+ loaders?: Function[] | object[];
+ options?: object;
+ parser?: object;
+ sideEffects?: boolean;
+ type?: string;
+ resource?: IRuleSetCondition;
+ resourceQuery?: IRuleSetCondition;
+ compiler?: IRuleSetCondition;
+ rules?: object[];
+ use?: object | object[] | Function;
+ test?: IRuleSetCondition;
+}
diff --git a/packages/generators/types/json-loader.d.ts b/packages/generators/types/json-loader.d.ts
index 0cb4cf5f44b..36396113911 100644
--- a/packages/generators/types/json-loader.d.ts
+++ b/packages/generators/types/json-loader.d.ts
@@ -1,4 +1,5 @@
declare module "*.json" {
+ // eslint-disable-next-line
const value: any;
export default value;
}
diff --git a/packages/generators/types/yeoman-generator.d.ts b/packages/generators/types/yeoman-generator.d.ts
deleted file mode 100644
index d845fd911a3..00000000000
--- a/packages/generators/types/yeoman-generator.d.ts
+++ /dev/null
@@ -1,90 +0,0 @@
-// Type definitions for yeoman-generator
-// Project: https://github.com/yeoman/generator
-// Definitions by: Kentaro Okuno
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
-
-interface IYeoman {
- public config: {
- set: (setProperty: string, setValue: object) => void;
- };
- public env: {
- adapter: {
- promptModule: {
- registerPrompt: (promptName: string, promptModule: object) => void;
- },
- },
- };
- public props: {
- name: string;
- };
- public composeWith(namespace: string, options?: object, settings?: IComposeSetting): YeomanGeneratorBase;
- public destinationRoot(rootPath?: string): string;
- public destinationPath(...path: string[]): string;
- public run(target: string, options?: object, done?: Function): IRunEnv;
- public scheduleInstallTask(packager: string, dependencies: string[], options?: object): void;
- public on(event: string, listener: Function): this;
- public async(): (_?: void) => void | boolean;
- public prompt(opt: IPromptOptions[]): Promise<>;
- public log(message: string): void;
- public npmInstall(packages?: string[] | string, options?: object, cb?: Function): Promise<>;
- public spawnCommand(name: string, args?: string[], options?: Object): void;
-}
-
-declare module "yeoman-generator" {
-
- class YeomanGeneratorBase extends IYeoman {
- public config: {
- set: (setProperty: string, setValue: object) => void;
- };
- public env: {
- adapter: {
- promptModule: {
- registerPrompt: (promptName: string, promptModule: object) => void;
- },
- },
- };
- public props: {
- name: string;
- };
- public composeWith(namespace: string, options?: object, settings?: IComposeSetting): YeomanGeneratorBase;
- public destinationRoot(rootPath?: string): string;
- public destinationPath(...path: string[]): string;
- public run(target: string, options?: object, done?: Function): IRunEnv;
- public scheduleInstallTask(packager: string, dependencies: string[], options?: object): void;
- public on(event: string, listener: Function): this;
- public async(): (_?: void) => void | boolean;
- public prompt(opt: IPromptOptions[]): Promise<>;
- public log(message: string): void;
- public npmInstall(packages?: string[] | string, options?: object, cb?: Function): Promise<>;
- public spawnCommand(name: string, args?: string[], options?: Object): void;
- }
-
- interface IRunEnv extends Object {
- on: (event: string, callbackFn: Function) => void;
- }
-
- interface IPromptOptions {
- type?: string;
- name: string;
- message: string | ((answers: Object) => string);
- choices?: string[] | ((answers: Object) => string);
- default?: string | number | string[] | number[] | ((answers: Object) => (string | number | string[] | number[]));
- validate?: ((input: string) => boolean | string);
- when?: ((answers: Object) => boolean) | boolean;
- store?: boolean;
- filter?: (name: string) => string;
- }
-
- // tslint:disable-next-line
- class NamedBase extends YeomanGeneratorBase implements INamedBase {
- constructor(args: string | string[], options: object);
- }
-
- // tslint:disable-next-line
- class Base extends NamedBase implements IBase {
- public static extend(protoProps: IQueueProps): YeomanGeneratorBase;
- }
-
- export = Base;
-}
diff --git a/packages/generators/update-generator.ts b/packages/generators/update-generator.ts
index ca5d7ce78ce..f5c3060de66 100644
--- a/packages/generators/update-generator.ts
+++ b/packages/generators/update-generator.ts
@@ -1,3 +1,3 @@
-import Generator = require("yeoman-generator");
+import * as Generator from "yeoman-generator";
export default class UpdateGenerator extends Generator {}
diff --git a/packages/generators/utils/entry.ts b/packages/generators/utils/entry.ts
index 9c809e08751..47762928337 100644
--- a/packages/generators/utils/entry.ts
+++ b/packages/generators/utils/entry.ts
@@ -1,8 +1,9 @@
+import * as Generator from "yeoman-generator";
import { InputValidate } from "@webpack-cli/webpack-scaffold";
import validate from "./validate";
-interface IEntry extends IYeoman {
+interface CustomGenerator extends Generator {
usingDefaults?: boolean;
}
@@ -15,93 +16,104 @@ interface IEntry extends IYeoman {
* @returns {Object} An Object that holds the answers given by the user, later used to scaffold
*/
-export default function entry(self: IEntry, answer: {
- entryType: boolean;
-}): Promise<{}> {
+export default function entry(
+ self: CustomGenerator,
+ answer: {
+ entryType: boolean;
+ }
+): Promise {
let entryIdentifiers: string[];
- let result: Promise<{}>;
+ let result: Promise;
if (answer.entryType) {
result = self
.prompt([
InputValidate(
"multipleEntries",
"Type the names you want for your modules (entry files), separated by comma [example: app,vendor]",
- validate,
- ),
+ validate
+ )
])
- .then((multipleEntriesAnswer: {
- multipleEntries: string,
- }) => {
- const webpackEntryPoint: object = {};
- entryIdentifiers = multipleEntriesAnswer.multipleEntries.split(",");
+ .then(
+ (multipleEntriesAnswer: { multipleEntries: string }): Promise => {
+ const webpackEntryPoint: object = {};
+ entryIdentifiers = multipleEntriesAnswer.multipleEntries.split(",");
- function forEachPromise(entries: string[], fn: (entryProp: string) => Promise<{} | void>) {
- return entries.reduce((promise: Promise<{}>, prop: string) => {
- const trimmedProp: string = prop.trim();
+ function forEachPromise(
+ entries: string[],
+ fn: (entryProp: string) => Promise
+ ): Promise {
+ return entries.reduce((promise: Promise<{}>, prop: string): Promise => {
+ const trimmedProp: string = prop.trim();
- return promise.then((n: object) => {
- if (n) {
- Object.keys(n).forEach((val: string): void => {
+ return promise.then(
+ (n: object): Promise => {
+ if (n) {
+ Object.keys(n).forEach(
+ (val: string): void => {
+ if (
+ n[val].charAt(0) !== "(" &&
+ n[val].charAt(0) !== "[" &&
+ !n[val].includes("function") &&
+ !n[val].includes("path") &&
+ !n[val].includes("process")
+ ) {
+ n[val] = `\'${n[val].replace(/"|'/g, "").concat(".js")}\'`;
+ }
+ webpackEntryPoint[val] = n[val];
+ }
+ );
+ } else {
+ n = {};
+ }
+ return fn(trimmedProp);
+ }
+ );
+ }, Promise.resolve());
+ }
+ return forEachPromise(
+ entryIdentifiers,
+ (entryProp: string): Promise =>
+ self.prompt([
+ InputValidate(
+ `${entryProp}`,
+ `What is the location of "${entryProp}"? [example: ./src/${entryProp}]`,
+ validate
+ )
+ ])
+ ).then(
+ (entryPropAnswer: object): object => {
+ Object.keys(entryPropAnswer).forEach(
+ (val: string): void => {
if (
- n[val].charAt(0) !== "(" &&
- n[val].charAt(0) !== "[" &&
- !n[val].includes("function") &&
- !n[val].includes("path") &&
- !n[val].includes("process")
+ entryPropAnswer[val].charAt(0) !== "(" &&
+ entryPropAnswer[val].charAt(0) !== "[" &&
+ !entryPropAnswer[val].includes("function") &&
+ !entryPropAnswer[val].includes("path") &&
+ !entryPropAnswer[val].includes("process")
) {
- n[val] = `\'${n[val].replace(/"|'/g, "").concat(".js")}\'`;
+ entryPropAnswer[val] = `\'${entryPropAnswer[val].replace(/"|'/g, "")}\'`;
}
- webpackEntryPoint[val] = n[val];
- });
- } else {
- n = {};
- }
- return fn(trimmedProp);
- });
- }, Promise.resolve());
- }
- return forEachPromise(entryIdentifiers, (entryProp: string): Promise<{} | void> =>
- self.prompt([
- InputValidate(
- `${entryProp}`,
- `What is the location of "${entryProp}"? [example: ./src/${entryProp}]`,
- validate,
- ),
- ]),
- ).then((entryPropAnswer: object): object => {
- Object.keys(entryPropAnswer).forEach((val: string): void => {
- if (
- entryPropAnswer[val].charAt(0) !== "(" &&
- entryPropAnswer[val].charAt(0) !== "[" &&
- !entryPropAnswer[val].includes("function") &&
- !entryPropAnswer[val].includes("path") &&
- !entryPropAnswer[val].includes("process")
- ) {
- entryPropAnswer[val] = `\'${entryPropAnswer[val].replace(/"|'/g, "")}\'`;
+ webpackEntryPoint[val] = entryPropAnswer[val];
+ }
+ );
+ return webpackEntryPoint;
}
- webpackEntryPoint[val] = entryPropAnswer[val];
- });
- return webpackEntryPoint;
- });
- });
+ );
+ }
+ );
} else {
result = self
- .prompt([
- InputValidate(
- "singularEntry",
- "Which module will be the first to enter the application? [default: ./src/index]",
- ),
- ])
- .then((singularEntryAnswer: {
- singularEntry: string,
- }): string => {
- let { singularEntry } = singularEntryAnswer;
- singularEntry = `\'${singularEntry.replace(/"|'/g, "")}\'`;
- if (singularEntry.length <= 0) {
- self.usingDefaults = true;
+ .prompt([InputValidate("singularEntry", "Which will be your application entry point? (src/index)")])
+ .then(
+ (singularEntryAnswer: { singularEntry: string }): string => {
+ let { singularEntry } = singularEntryAnswer;
+ singularEntry = `\'${singularEntry.replace(/"|'/g, "")}\'`;
+ if (singularEntry.length <= 0) {
+ self.usingDefaults = true;
+ }
+ return singularEntry;
}
- return singularEntry;
- });
+ );
}
return result;
}
diff --git a/packages/generators/utils/module.ts b/packages/generators/utils/module.ts
index 50c4b0deeea..25b846723f1 100644
--- a/packages/generators/utils/module.ts
+++ b/packages/generators/utils/module.ts
@@ -1,36 +1,36 @@
-interface IModule extends Object {
+interface Module extends Object {
include: string[];
loader: string;
options: {
plugins: string[];
- presets: Array>;
+ presets: Preset[][];
};
test: string;
}
+type Preset = string | object;
+
/**
*
* Returns an module.rule object that has the babel loader if invoked
*
* @returns {Function} A callable function that adds the babel-loader with env preset
*/
-export default function(): IModule {
+export default function(): Module {
return {
include: ["path.resolve(__dirname, 'src')"],
loader: "'babel-loader'",
options: {
- plugins: [
- "'syntax-dynamic-import'",
- ],
+ plugins: ["'syntax-dynamic-import'"],
presets: [
[
"'@babel/preset-env'",
{
- "'modules'": false,
- },
- ],
- ],
+ "'modules'": false
+ }
+ ]
+ ]
},
- test: `${new RegExp(/\.js$/)}`,
+ test: `${new RegExp(/\.js$/)}`
};
}
diff --git a/packages/generators/utils/plugins.ts b/packages/generators/utils/plugins.ts
index 56e8ea89c86..6dedb1fab9e 100644
--- a/packages/generators/utils/plugins.ts
+++ b/packages/generators/utils/plugins.ts
@@ -3,9 +3,9 @@
* Callable function with the initial plugins
*
* @returns {Function} An function that returns an array
- * that consists of the uglify plugin
+ * that consists of terser-webpack-plugin
*/
-export default function(_?: void): string[] {
- return ["new UglifyJSPlugin()"];
+export default function(): string[] {
+ return ["new TerserPlugin()"];
}
diff --git a/packages/generators/utils/tooltip.ts b/packages/generators/utils/tooltip.ts
index ad0fa1c575a..cd9dba4e7ec 100644
--- a/packages/generators/utils/tooltip.ts
+++ b/packages/generators/utils/tooltip.ts
@@ -7,7 +7,7 @@
*/
export default {
- cssPlugin: (_?: void): string => {
+ cssPlugin: (): string => {
return `/*
* We've enabled MiniCssExtractPlugin for you. This allows your app to
* use css modules that will be moved into a separate CSS file instead of inside
@@ -18,7 +18,7 @@ export default {
*/`;
},
- splitChunks: (_?: void): string => {
+ splitChunks: (): string => {
return `/*
* SplitChunksPlugin is enabled by default and replaced
* deprecated CommonsChunkPlugin. It automatically identifies modules which
@@ -33,7 +33,7 @@ export default {
*/`;
},
- postcss: (_?: void): string => {
+ postcss: (): string => {
return `/*
* We've enabled Postcss, autoprefixer and precss for you. This allows your app
* to lint CSS, support variables and mixins, transpile future CSS syntax,
@@ -50,13 +50,13 @@ export default {
*/`;
},
- uglify: (_?: void): string => {
+ terser: (): string => {
return `/*
- * We've enabled UglifyJSPlugin for you! This minifies your app
+ * We've enabled TerserPlugin for you! This minifies your app
* in order to load faster and run less javascript.
*
- * https://github.com/webpack-contrib/uglifyjs-webpack-plugin
+ * https://github.com/webpack-contrib/terser-webpack-plugin
*
*/`;
- },
+ }
};
diff --git a/packages/generators/utils/validate.ts b/packages/generators/utils/validate.ts
index b1ff173ca54..806e2fdb074 100644
--- a/packages/generators/utils/validate.ts
+++ b/packages/generators/utils/validate.ts
@@ -7,9 +7,7 @@
* Or a string if the user hasn't written anything
*/
export default function validate(value: string): string | boolean {
- const pass: number = value.length;
-
- if (pass) {
+ if (value.length) {
return true;
}
diff --git a/packages/info/.eslintrc b/packages/info/.eslintrc
new file mode 100644
index 00000000000..365d9f85d71
--- /dev/null
+++ b/packages/info/.eslintrc
@@ -0,0 +1,11 @@
+{
+ "root": true,
+ "extends": [
+ "../../.eslintrc.js",
+ "plugin:@typescript-eslint/recommended",
+ "prettier",
+ "prettier/@typescript-eslint"
+ ],
+ "parser": "@typescript-eslint/parser",
+ "plugins": ["@typescript-eslint"]
+}
diff --git a/packages/info/README.md b/packages/info/README.md
index a1944e21808..a1258e1affa 100644
--- a/packages/info/README.md
+++ b/packages/info/README.md
@@ -1,8 +1,10 @@
# webpack-cli info
+[![NPM Downloads][downloads]][downloads-url]
+
## 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
@@ -20,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/info/__tests__/.eslintrc b/packages/info/__tests__/.eslintrc
new file mode 100644
index 00000000000..5d4340a351d
--- /dev/null
+++ b/packages/info/__tests__/.eslintrc
@@ -0,0 +1,7 @@
+{
+ "root": true,
+ "extends": ["../.eslintrc"],
+ "rules": {
+ "@typescript-eslint/explicit-function-return-type": ["off"]
+ }
+}
diff --git a/packages/info/__tests__/index.test.ts b/packages/info/__tests__/index.test.ts
index fca23773708..7ddb1dae791 100644
--- a/packages/info/__tests__/index.test.ts
+++ b/packages/info/__tests__/index.test.ts
@@ -8,7 +8,7 @@ describe("info", () => {
Browsers: ["Chrome", "Firefox", "Safari"],
System: ["OS", "CPU"],
npmGlobalPackages: ["webpack", "webpack-cli"],
- npmPackages: "*webpack*",
+ npmPackages: "*webpack*"
};
expect(returnedInformation).toEqual(expectedInformation);
diff --git a/packages/info/index.ts b/packages/info/index.ts
index 43db20f6234..68c69c9ddf8 100644
--- a/packages/info/index.ts
+++ b/packages/info/index.ts
@@ -5,16 +5,18 @@ import * as process from "process";
* Prints debugging information for webpack issue reporting
*/
-export function information() {
+// TODO: define proper interface
+// eslint-disable-next-line
+export function information(): any {
return {
Binaries: ["Node", "Yarn", "npm"],
Browsers: ["Chrome", "Firefox", "Safari"],
System: ["OS", "CPU"],
npmGlobalPackages: ["webpack", "webpack-cli"],
- npmPackages: "*webpack*",
+ npmPackages: "*webpack*"
};
}
-export default async function info() {
+export default async function info(): Promise {
process.stdout.write(await envinfo.run(information()));
}
diff --git a/packages/info/package.json b/packages/info/package.json
index 2378df5929b..7e20c698449 100644
--- a/packages/info/package.json
+++ b/packages/info/package.json
@@ -18,6 +18,5 @@
"scripts": {
"build": "tsc",
"watch": "npm run build && tsc -w"
- },
- "gitHead": "6846f2eb8f0d04acc4453cb20da10263ff00a139"
+ }
}
diff --git a/packages/init/.eslintrc b/packages/init/.eslintrc
new file mode 100644
index 00000000000..365d9f85d71
--- /dev/null
+++ b/packages/init/.eslintrc
@@ -0,0 +1,11 @@
+{
+ "root": true,
+ "extends": [
+ "../../.eslintrc.js",
+ "plugin:@typescript-eslint/recommended",
+ "prettier",
+ "prettier/@typescript-eslint"
+ ],
+ "parser": "@typescript-eslint/parser",
+ "plugins": ["@typescript-eslint"]
+}
diff --git a/packages/init/README.md b/packages/init/README.md
index d2eacb9caa1..9f93a65754b 100644
--- a/packages/init/README.md
+++ b/packages/init/README.md
@@ -1,5 +1,7 @@
# webpack-cli init
+[![NPM Downloads][downloads]][downloads-url]
+
## Description
This package contains the logic to create a new webpack configuration.
@@ -22,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
+
+2. Using path to a 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/init/index.ts b/packages/init/index.ts
index bb80bd0fae3..a412bceebfb 100644
--- a/packages/init/index.ts
+++ b/packages/init/index.ts
@@ -14,7 +14,7 @@ import npmPackagesExists from "@webpack-cli/utils/npm-packages-exists";
*/
export default function initializeInquirer(...args: string[]): Function | void {
- const packages: string[] = args.slice(3);
+ const packages = args.slice(3);
if (packages.length === 0) {
return modifyConfigHelper("init", defaultGenerator);
diff --git a/packages/init/init.ts b/packages/init/init.ts
index a564cd239c7..b4063cd15e9 100644
--- a/packages/init/init.ts
+++ b/packages/init/init.ts
@@ -7,9 +7,9 @@ import propTypes from "@webpack-cli/utils/prop-types";
import astTransform from "@webpack-cli/utils/recursive-parser";
import runPrettier from "@webpack-cli/utils/run-prettier";
-import { INode } from "@webpack-cli/utils/types/NodePath";
-import { IError } from "./types";
-import { IConfiguration, IWebpackProperties } from "./types/Transform";
+import { Node } from "@webpack-cli/utils/types/NodePath";
+import { Error } from "./types";
+import { Configuration, WebpackProperties } from "./types/Transform";
/**
*
@@ -21,9 +21,8 @@ import { IConfiguration, IWebpackProperties } from "./types/Transform";
* @returns {Array} - An array with the transformations to be run
*/
-const mapOptionsToTransform = (config: IConfiguration): string[] =>
- Object.keys(config.webpackOptions)
- .filter((key: string): boolean => propTypes.has(key));
+const mapOptionsToTransform = (config: Configuration): string[] =>
+ Object.keys(config.webpackOptions).filter((key: string): boolean => propTypes.has(key));
/**
*
@@ -35,64 +34,56 @@ const mapOptionsToTransform = (config: IConfiguration): string[] =>
* and writes the file
*/
-export default function runTransform(webpackProperties: IWebpackProperties, action: string): void {
+export default function runTransform(webpackProperties: WebpackProperties, action: string): void {
// webpackOptions.name sent to nameTransform if match
- const webpackConfig: string[] =
- Object
- .keys(webpackProperties)
- .filter((p: string): boolean => p !== "configFile" && p !== "configPath");
+ const webpackConfig: string[] = Object.keys(webpackProperties).filter(
+ (p: string): boolean => p !== "configFile" && p !== "configPath"
+ );
- const initActionNotDefined: boolean = (action && action !== "init") || false;
+ const initActionNotDefined = (action && action !== "init") || false;
- webpackConfig.forEach((scaffoldPiece: string): Promise => {
- const config: IConfiguration = webpackProperties[scaffoldPiece];
- const transformations: string[] = mapOptionsToTransform(config);
- const ast = j(
- initActionNotDefined
- ? webpackProperties.configFile
- : "module.exports = {}",
- );
- const transformAction: string | null = action || null;
+ webpackConfig.forEach(
+ (scaffoldPiece: string): Promise => {
+ const config: Configuration = webpackProperties[scaffoldPiece];
+ const transformations = mapOptionsToTransform(config);
+ const ast = j(initActionNotDefined ? webpackProperties.configFile : "module.exports = {}");
+ const transformAction: string | null = action || null;
- return pEachSeries(transformations, (f: string): boolean | INode => {
- return astTransform(j, ast, config.webpackOptions[f], transformAction, f);
- })
- .then((value: string[]): void | PromiseLike => {
- let configurationName: string = "webpack.config.js";
- if (config.configName) {
- configurationName = "webpack." + config.configName + ".js";
+ return pEachSeries(
+ transformations,
+ (f: string): boolean | Node => {
+ return astTransform(j, ast, config.webpackOptions[f], transformAction, f);
}
+ )
+ .then(
+ (): void | PromiseLike => {
+ let configurationName = "webpack.config.js";
+ if (config.configName) {
+ configurationName = `webpack.${config.configName}.js`;
+ }
- const outputPath: string = initActionNotDefined
- ? webpackProperties.configPath
- : path.join(process.cwd(), configurationName);
+ const outputPath = initActionNotDefined
+ ? webpackProperties.configPath
+ : path.join(process.cwd(), configurationName);
- const source: string = ast.toSource({
- quote: "single",
- });
+ const source: string = ast.toSource({
+ quote: "single"
+ });
- runPrettier(outputPath, source);
- })
- .catch((err: IError) => {
- console.error(err.message ? err.message : err);
- });
- });
+ runPrettier(outputPath, source);
+ }
+ )
+ .catch(
+ (err: Error): void => {
+ console.error(err.message ? err.message : err);
+ }
+ );
+ }
+ );
+ let successMessage: string = `Congratulations! Your new webpack configuration file has been created!`;
if (initActionNotDefined && webpackProperties.config.item) {
- process.stdout.write(
- "\n" +
- chalk.green(
- `Congratulations! ${
- webpackProperties.config.item
- } has been ${action}ed!\n`,
- ),
- );
- } else {
- process.stdout.write(
- "\n" +
- chalk.green(
- "Congratulations! Your new webpack configuration file has been created!\n",
- ),
- );
+ successMessage = `Congratulations! ${webpackProperties.config.item} has been ${action}ed!`;
}
+ process.stdout.write("\n" + chalk.green(`${successMessage}\n`));
}
diff --git a/packages/init/package-lock.json b/packages/init/package-lock.json
index fede4727f12..1695fbbf370 100644
--- a/packages/init/package-lock.json
+++ b/packages/init/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "@webpack-cli/init",
- "version": "0.1.3",
+ "version": "0.1.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/packages/init/package.json b/packages/init/package.json
index 381cff53424..6111beb2b27 100644
--- a/packages/init/package.json
+++ b/packages/init/package.json
@@ -23,6 +23,5 @@
"scripts": {
"build": "tsc",
"watch": "npm run build && tsc -w"
- },
- "gitHead": "6846f2eb8f0d04acc4453cb20da10263ff00a139"
+ }
}
diff --git a/packages/init/types/Transform.ts b/packages/init/types/Transform.ts
index 89622b85f62..d117d93d558 100644
--- a/packages/init/types/Transform.ts
+++ b/packages/init/types/Transform.ts
@@ -1,14 +1,14 @@
-export interface IWebpackProperties extends Object {
+export interface WebpackProperties extends Object {
configFile: string;
configPath: string;
- webpackOptions: IConfiguration;
+ webpackOptions: Configuration;
config: {
item: string;
configName: string;
};
}
-export interface IConfiguration extends Object {
+export interface Configuration extends Object {
configName: string;
webpackOptions: object;
topScope: string[];
diff --git a/packages/init/types/index.ts b/packages/init/types/index.ts
index c0f13602567..9480d6ce9b0 100644
--- a/packages/init/types/index.ts
+++ b/packages/init/types/index.ts
@@ -1,3 +1,3 @@
-export interface IError {
+export interface Error {
message?: string;
}
diff --git a/packages/make/.eslintrc b/packages/make/.eslintrc
new file mode 100644
index 00000000000..365d9f85d71
--- /dev/null
+++ b/packages/make/.eslintrc
@@ -0,0 +1,11 @@
+{
+ "root": true,
+ "extends": [
+ "../../.eslintrc.js",
+ "plugin:@typescript-eslint/recommended",
+ "prettier",
+ "prettier/@typescript-eslint"
+ ],
+ "parser": "@typescript-eslint/parser",
+ "plugins": ["@typescript-eslint"]
+}
diff --git a/packages/migrate/.eslintrc b/packages/migrate/.eslintrc
new file mode 100644
index 00000000000..365d9f85d71
--- /dev/null
+++ b/packages/migrate/.eslintrc
@@ -0,0 +1,11 @@
+{
+ "root": true,
+ "extends": [
+ "../../.eslintrc.js",
+ "plugin:@typescript-eslint/recommended",
+ "prettier",
+ "prettier/@typescript-eslint"
+ ],
+ "parser": "@typescript-eslint/parser",
+ "plugins": ["@typescript-eslint"]
+}
diff --git a/packages/migrate/README.md b/packages/migrate/README.md
index 38fad56a13d..a5fc77e87dc 100644
--- a/packages/migrate/README.md
+++ b/packages/migrate/README.md
@@ -1,5 +1,7 @@
# webpack-cli migrate
+[![npm][downloads]][downloads-url]
+
## Description
This package contains the logic to migrate a project from one version to the other.
@@ -15,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;
@@ -23,6 +26,10 @@ migrate(null, null, inputPath, outputPath);
```
### CLI (via `webpack-cli`)
+
```bash
npx webpack-cli migrate
-```
\ No newline at end of file
+```
+
+[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/migrate/__tests__/.eslintrc b/packages/migrate/__tests__/.eslintrc
new file mode 100644
index 00000000000..5d4340a351d
--- /dev/null
+++ b/packages/migrate/__tests__/.eslintrc
@@ -0,0 +1,7 @@
+{
+ "root": true,
+ "extends": ["../.eslintrc"],
+ "rules": {
+ "@typescript-eslint/explicit-function-return-type": ["off"]
+ }
+}
diff --git a/packages/migrate/__snapshots__/migrate.test.js.snap b/packages/migrate/__tests__/__snapshots__/migrate.test.ts.snap
similarity index 100%
rename from packages/migrate/__snapshots__/migrate.test.js.snap
rename to packages/migrate/__tests__/__snapshots__/migrate.test.ts.snap
diff --git a/packages/migrate/__tests__/migrate.test.ts b/packages/migrate/__tests__/migrate.test.ts
new file mode 100644
index 00000000000..4369f0f86b7
--- /dev/null
+++ b/packages/migrate/__tests__/migrate.test.ts
@@ -0,0 +1,63 @@
+import { transform, transformations } from "../migrate";
+
+const input = `
+module.exports = {
+ devtool: 'eval',
+ entry: [
+ './src/index'
+ ],
+ output: {
+ path: path.join(__dirname, 'dist'),
+ filename: 'index.js'
+ },
+ module: {
+ loaders: [{
+ test: /.js$/,
+ loaders: ['babel'],
+ include: path.join(__dirname, 'src')
+ }]
+ },
+ resolve: {
+ root: path.resolve('/src'),
+ modules: ['node_modules']
+ },
+ plugins: [
+ new webpack.optimize.UglifyJsPlugin(),
+ new webpack.optimize.OccurrenceOrderPlugin()
+ ],
+ debug: true
+};
+`;
+
+describe("transform", () => {
+ it("should not transform if no transformations defined", (done) => {
+ transform(input, []).then((output) => {
+ expect(output).toMatchSnapshot(input);
+ done();
+ });
+ });
+
+ it("should transform using all transformations", (done) => {
+ transform(input).then((output) => {
+ expect(output).toMatchSnapshot();
+ done();
+ });
+ });
+
+ it("should transform only using specified transformations", (done) => {
+ transform(input, [transformations.loadersTransform]).then((output) => {
+ expect(output).toMatchSnapshot();
+ done();
+ });
+ });
+
+ it("should respect recast options", (done) => {
+ transform(input, undefined, {
+ quote: "double",
+ trailingComma: true,
+ }).then((output) => {
+ expect(output).toMatchSnapshot();
+ done();
+ });
+ });
+});
diff --git a/packages/migrate/bannerPlugin/__snapshots__/bannerPlugin.test.js.snap b/packages/migrate/bannerPlugin/__tests__/__snapshots__/bannerPlugin.test.ts.snap
similarity index 100%
rename from packages/migrate/bannerPlugin/__snapshots__/bannerPlugin.test.js.snap
rename to packages/migrate/bannerPlugin/__tests__/__snapshots__/bannerPlugin.test.ts.snap
diff --git a/packages/migrate/bannerPlugin/__testfixtures__/bannerPlugin-0.input.js b/packages/migrate/bannerPlugin/__tests__/__testfixtures__/bannerPlugin-0.input.js
similarity index 100%
rename from packages/migrate/bannerPlugin/__testfixtures__/bannerPlugin-0.input.js
rename to packages/migrate/bannerPlugin/__tests__/__testfixtures__/bannerPlugin-0.input.js
diff --git a/packages/migrate/bannerPlugin/__testfixtures__/bannerPlugin-1.input.js b/packages/migrate/bannerPlugin/__tests__/__testfixtures__/bannerPlugin-1.input.js
similarity index 100%
rename from packages/migrate/bannerPlugin/__testfixtures__/bannerPlugin-1.input.js
rename to packages/migrate/bannerPlugin/__tests__/__testfixtures__/bannerPlugin-1.input.js
diff --git a/packages/migrate/bannerPlugin/__testfixtures__/bannerPlugin-2.input.js b/packages/migrate/bannerPlugin/__tests__/__testfixtures__/bannerPlugin-2.input.js
similarity index 100%
rename from packages/migrate/bannerPlugin/__testfixtures__/bannerPlugin-2.input.js
rename to packages/migrate/bannerPlugin/__tests__/__testfixtures__/bannerPlugin-2.input.js
diff --git a/packages/migrate/bannerPlugin/__tests__/bannerPlugin.test.ts b/packages/migrate/bannerPlugin/__tests__/bannerPlugin.test.ts
new file mode 100644
index 00000000000..f7382096901
--- /dev/null
+++ b/packages/migrate/bannerPlugin/__tests__/bannerPlugin.test.ts
@@ -0,0 +1,8 @@
+import defineTest from "@webpack-cli/utils/defineTest";
+import { join } from "path";
+
+const dirName: string = join(__dirname, "..");
+
+defineTest(dirName, "bannerPlugin", "bannerPlugin-0");
+defineTest(dirName, "bannerPlugin", "bannerPlugin-1");
+defineTest(dirName, "bannerPlugin", "bannerPlugin-2");
diff --git a/packages/migrate/bannerPlugin/bannerPlugin.test.js b/packages/migrate/bannerPlugin/bannerPlugin.test.js
deleted file mode 100644
index 8f6ad100036..00000000000
--- a/packages/migrate/bannerPlugin/bannerPlugin.test.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-const defineTest = require("@webpack-cli/utils/defineTest").default;
-
-defineTest(__dirname, "bannerPlugin", "bannerPlugin-0");
-defineTest(__dirname, "bannerPlugin", "bannerPlugin-1");
-defineTest(__dirname, "bannerPlugin", "bannerPlugin-2");
diff --git a/packages/migrate/bannerPlugin/bannerPlugin.ts b/packages/migrate/bannerPlugin/bannerPlugin.ts
index 5d369f57ec9..422e1d40dd1 100644
--- a/packages/migrate/bannerPlugin/bannerPlugin.ts
+++ b/packages/migrate/bannerPlugin/bannerPlugin.ts
@@ -1,6 +1,6 @@
import * as utils from "@webpack-cli/utils/ast-utils";
-import { IJSCodeshift, INode } from "../types/NodePath";
+import { JSCodeshift, Node } from "../types/NodePath";
/**
*
@@ -12,24 +12,19 @@ import { IJSCodeshift, INode } from "../types/NodePath";
* @returns {Node} ast - jscodeshift ast
*/
-export default function(j: IJSCodeshift, ast: INode): INode {
- return utils
- .findPluginsByName(j, ast, ["webpack.BannerPlugin"])
- .forEach((path: INode): void => {
- const args: INode[] = path.value.arguments; // any node
+export default function(j: JSCodeshift, ast: Node): Node {
+ return utils.findPluginsByName(j, ast, ["webpack.BannerPlugin"]).forEach(
+ (path: Node): void => {
+ const args: Node[] = (path.value as Node).arguments; // any node
// If the first argument is a literal replace it with object notation
// See https://webpack.js.org/guides/migrating/#bannerplugin-breaking-change
if (args && args.length > 1 && args[0].type === j.Literal.name) {
// and remove the first argument
- path.value.arguments = [path.value.arguments[1]];
- utils.createOrUpdatePluginByName(
- j,
- path.parent,
- "webpack.BannerPlugin",
- {
- banner: args[0].value,
- },
- );
+ (path.value as Node).arguments = [(path.value as Node).arguments[1]];
+ utils.createOrUpdatePluginByName(j, path.parent, "webpack.BannerPlugin", {
+ banner: args[0].value
+ });
}
- });
+ }
+ );
}
diff --git a/packages/migrate/commonsChunkPlugin/__snapshots__/commonsChunkPlugin.test.js.snap b/packages/migrate/commonsChunkPlugin/__tests__/__snapshots__/commonsChunkPlugin.test.ts.snap
similarity index 100%
rename from packages/migrate/commonsChunkPlugin/__snapshots__/commonsChunkPlugin.test.js.snap
rename to packages/migrate/commonsChunkPlugin/__tests__/__snapshots__/commonsChunkPlugin.test.ts.snap
diff --git a/packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-0.input.js b/packages/migrate/commonsChunkPlugin/__tests__/__testfixtures__/commonsChunkPlugin-0.input.js
similarity index 100%
rename from packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-0.input.js
rename to packages/migrate/commonsChunkPlugin/__tests__/__testfixtures__/commonsChunkPlugin-0.input.js
diff --git a/packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-1.input.js b/packages/migrate/commonsChunkPlugin/__tests__/__testfixtures__/commonsChunkPlugin-1.input.js
similarity index 100%
rename from packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-1.input.js
rename to packages/migrate/commonsChunkPlugin/__tests__/__testfixtures__/commonsChunkPlugin-1.input.js
diff --git a/packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-2.input.js b/packages/migrate/commonsChunkPlugin/__tests__/__testfixtures__/commonsChunkPlugin-2.input.js
similarity index 100%
rename from packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-2.input.js
rename to packages/migrate/commonsChunkPlugin/__tests__/__testfixtures__/commonsChunkPlugin-2.input.js
diff --git a/packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-3.input.js b/packages/migrate/commonsChunkPlugin/__tests__/__testfixtures__/commonsChunkPlugin-3.input.js
similarity index 100%
rename from packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-3.input.js
rename to packages/migrate/commonsChunkPlugin/__tests__/__testfixtures__/commonsChunkPlugin-3.input.js
diff --git a/packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-4.input.js b/packages/migrate/commonsChunkPlugin/__tests__/__testfixtures__/commonsChunkPlugin-4.input.js
similarity index 100%
rename from packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-4.input.js
rename to packages/migrate/commonsChunkPlugin/__tests__/__testfixtures__/commonsChunkPlugin-4.input.js
diff --git a/packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-5.input.js b/packages/migrate/commonsChunkPlugin/__tests__/__testfixtures__/commonsChunkPlugin-5.input.js
similarity index 100%
rename from packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-5.input.js
rename to packages/migrate/commonsChunkPlugin/__tests__/__testfixtures__/commonsChunkPlugin-5.input.js
diff --git a/packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-6a.input.js b/packages/migrate/commonsChunkPlugin/__tests__/__testfixtures__/commonsChunkPlugin-6a.input.js
similarity index 100%
rename from packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-6a.input.js
rename to packages/migrate/commonsChunkPlugin/__tests__/__testfixtures__/commonsChunkPlugin-6a.input.js
diff --git a/packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-6b.input.js b/packages/migrate/commonsChunkPlugin/__tests__/__testfixtures__/commonsChunkPlugin-6b.input.js
similarity index 100%
rename from packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-6b.input.js
rename to packages/migrate/commonsChunkPlugin/__tests__/__testfixtures__/commonsChunkPlugin-6b.input.js
diff --git a/packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-6c.input.js b/packages/migrate/commonsChunkPlugin/__tests__/__testfixtures__/commonsChunkPlugin-6c.input.js
similarity index 100%
rename from packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-6c.input.js
rename to packages/migrate/commonsChunkPlugin/__tests__/__testfixtures__/commonsChunkPlugin-6c.input.js
diff --git a/packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-6d.input.js b/packages/migrate/commonsChunkPlugin/__tests__/__testfixtures__/commonsChunkPlugin-6d.input.js
similarity index 100%
rename from packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-6d.input.js
rename to packages/migrate/commonsChunkPlugin/__tests__/__testfixtures__/commonsChunkPlugin-6d.input.js
diff --git a/packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-7.input.js b/packages/migrate/commonsChunkPlugin/__tests__/__testfixtures__/commonsChunkPlugin-7.input.js
similarity index 100%
rename from packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-7.input.js
rename to packages/migrate/commonsChunkPlugin/__tests__/__testfixtures__/commonsChunkPlugin-7.input.js
diff --git a/packages/migrate/commonsChunkPlugin/__tests__/commonsChunkPlugin.test.ts b/packages/migrate/commonsChunkPlugin/__tests__/commonsChunkPlugin.test.ts
new file mode 100644
index 00000000000..5c2e28e1f40
--- /dev/null
+++ b/packages/migrate/commonsChunkPlugin/__tests__/commonsChunkPlugin.test.ts
@@ -0,0 +1,32 @@
+import defineTest from "@webpack-cli/utils/defineTest";
+import { join } from "path";
+
+const dirName: string = join(__dirname, "..");
+
+defineTest(dirName, "commonsChunkPlugin", "commonsChunkPlugin-0");
+defineTest(dirName, "commonsChunkPlugin", "commonsChunkPlugin-1");
+defineTest(dirName, "commonsChunkPlugin", "commonsChunkPlugin-2");
+defineTest(dirName, "commonsChunkPlugin", "commonsChunkPlugin-3");
+defineTest(dirName, "commonsChunkPlugin", "commonsChunkPlugin-4");
+defineTest(dirName, "commonsChunkPlugin", "commonsChunkPlugin-5");
+defineTest(
+ dirName,
+ "commonsChunkPlugin",
+ "commonsChunkPlugin-6a",
+);
+defineTest(
+ dirName,
+ "commonsChunkPlugin",
+ "commonsChunkPlugin-6b",
+);
+defineTest(
+ dirName,
+ "commonsChunkPlugin",
+ "commonsChunkPlugin-6c",
+);
+defineTest(
+ dirName,
+ "commonsChunkPlugin",
+ "commonsChunkPlugin-6d",
+);
+defineTest(dirName, "commonsChunkPlugin", "commonsChunkPlugin-7");
diff --git a/packages/migrate/commonsChunkPlugin/commonsChunkPlugin.test.js b/packages/migrate/commonsChunkPlugin/commonsChunkPlugin.test.js
deleted file mode 100644
index 123b3ba81d8..00000000000
--- a/packages/migrate/commonsChunkPlugin/commonsChunkPlugin.test.js
+++ /dev/null
@@ -1,15 +0,0 @@
-"use strict";
-
-const defineTest = require("@webpack-cli/utils/defineTest").default;
-
-defineTest(__dirname, "commonsChunkPlugin", "commonsChunkPlugin-0");
-defineTest(__dirname, "commonsChunkPlugin", "commonsChunkPlugin-1");
-defineTest(__dirname, "commonsChunkPlugin", "commonsChunkPlugin-2");
-defineTest(__dirname, "commonsChunkPlugin", "commonsChunkPlugin-3");
-defineTest(__dirname, "commonsChunkPlugin", "commonsChunkPlugin-4");
-defineTest(__dirname, "commonsChunkPlugin", "commonsChunkPlugin-5");
-defineTest(__dirname, "commonsChunkPlugin", "commonsChunkPlugin-6a");
-defineTest(__dirname, "commonsChunkPlugin", "commonsChunkPlugin-6b");
-defineTest(__dirname, "commonsChunkPlugin", "commonsChunkPlugin-6c");
-defineTest(__dirname, "commonsChunkPlugin", "commonsChunkPlugin-6d");
-defineTest(__dirname, "commonsChunkPlugin", "commonsChunkPlugin-7");
diff --git a/packages/migrate/commonsChunkPlugin/commonsChunkPlugin.ts b/packages/migrate/commonsChunkPlugin/commonsChunkPlugin.ts
index ea86fb371ba..62bc6a090e2 100644
--- a/packages/migrate/commonsChunkPlugin/commonsChunkPlugin.ts
+++ b/packages/migrate/commonsChunkPlugin/commonsChunkPlugin.ts
@@ -4,10 +4,47 @@ import {
createProperty,
findAndRemovePluginByName,
findPluginsByName,
- findRootNodesByName,
+ findRootNodesByName
} from "@webpack-cli/utils/ast-utils";
-import { IJSCodeshift, INode } from "../types/NodePath";
+import { JSCodeshift, Node } from "../types/NodePath";
+
+// merge test entry prop and function expression. case 6[x]
+// TODO: set the proper type once moved to @types/jscodeshift
+// eslint-disable-next-line
+const mergeTestPropArrowFunction = (j, chunkKey, testFunc): any => {
+ return j.property(
+ "init",
+ createIdentifierOrLiteral(j, "test"),
+ j.arrowFunctionExpression(
+ [j.identifier("module")],
+ j.blockStatement([
+ j.ifStatement(
+ j.callExpression(
+ j.memberExpression(
+ j.callExpression(j.memberExpression(j.identifier("module"), j.identifier("getChunks")), []),
+ j.identifier("some"),
+ false
+ ),
+ [
+ j.arrowFunctionExpression(
+ [j.identifier("chunk")],
+ j.binaryExpression(
+ "===",
+ j.memberExpression(j.identifier("chunk"), j.identifier("name")),
+ j.literal(chunkKey)
+ )
+ )
+ ]
+ ),
+ j.returnStatement(j.literal(true))
+ ),
+ j.variableDeclaration("const", [j.variableDeclarator(j.identifier("fn"), testFunc)]),
+ j.returnStatement(j.callExpression(j.identifier("fn"), [j.identifier("module")]))
+ ])
+ )
+ );
+};
/**
*
@@ -18,20 +55,15 @@ import { IJSCodeshift, INode } from "../types/NodePath";
* @param {Node} ast - jscodeshift ast to transform
* @returns {Node} ast - jscodeshift ast
*/
-export default function(j: IJSCodeshift, ast: INode): INode {
- const splitChunksProps: INode[] = [];
- const cacheGroupsProps: INode[] = [];
+export default function(j: JSCodeshift, ast: Node): Node {
+ const splitChunksProps: Node[] = [];
+ const cacheGroupsProps: Node[] = [];
const optimizationProps: object = {};
- let commonCacheGroupsProps: INode[] = [
- createProperty(j, "chunks", "initial"),
- createProperty(j, "enforce", true),
- ];
+ let commonCacheGroupsProps: Node[] = [createProperty(j, "chunks", "initial"), createProperty(j, "enforce", true)];
// find old options
- const CommonsChunkPlugin: INode = findPluginsByName(j, ast, [
- "webpack.optimize.CommonsChunkPlugin",
- ]);
+ const CommonsChunkPlugin: Node = findPluginsByName(j, ast, ["webpack.optimize.CommonsChunkPlugin"]);
if (!CommonsChunkPlugin.size()) {
return ast;
@@ -39,64 +71,66 @@ export default function(j: IJSCodeshift, ast: INode): INode {
// cache group options based on keys
let cacheGroup: object = {};
- let cacheGroups: INode[] = [];
+ let cacheGroups: Node[] = [];
// iterate each CommonsChunkPlugin instance
CommonsChunkPlugin.forEach(
- (path: INode): void => {
- const CCPProps: INode[] = path.value.arguments[0].properties;
+ (path: Node): void => {
+ const CCPProps: Node[] = (path.value as Node).arguments[0].properties;
// reset chunks from old props
cacheGroup = {};
cacheGroups = [];
- commonCacheGroupsProps = [
- createProperty(j, "chunks", "initial"),
- createProperty(j, "enforce", true),
- ];
+ commonCacheGroupsProps = [createProperty(j, "chunks", "initial"), createProperty(j, "enforce", true)];
let chunkKey: string;
- let chunkCount: number = 0;
+ let chunkCount = 0;
// iterate CCP props and map SCP props
CCPProps.forEach(
- (p: INode): void => {
+ (p: Node): void => {
const propKey: string = p.key.name;
switch (propKey) {
case "names":
- p.value.elements.forEach(({ value: chunkValue }): void => {
- if (chunkValue === "runtime") {
- optimizationProps["runtimeChunk"] = j.objectExpression([ // tslint:disable-line
- createProperty(j, "name", chunkValue),
- ]);
- } else {
- if (!Array.isArray(cacheGroup[chunkValue])) {
- cacheGroup[chunkValue] = [];
- }
+ (p.value as Node).elements.forEach(
+ ({ value: chunkValue }): void => {
+ if (chunkValue === "runtime") {
+ optimizationProps["runtimeChunk"] = j.objectExpression([
+ createProperty(j, "name", chunkValue)
+ ]);
+ } else {
+ if (!Array.isArray(cacheGroup[chunkValue as string])) {
+ cacheGroup[chunkValue as string] = [];
+ }
- findRootNodesByName(j, ast, "entry").forEach(
- ({ value: { value: { properties: entries }} },
- ): void => {
- chunkCount = entries.length;
- entries.forEach(({ key: { name: entryName }}): void => {
- if (entryName === chunkValue) {
- cacheGroup[chunkValue].push(
- createProperty(j, "test", entryName),
+ findRootNodesByName(j, ast, "entry").forEach(
+ ({ value }): void => {
+ const { properties: entries } = (value as Node).value as Node;
+ chunkCount = entries.length;
+ entries.forEach(
+ ({ key: { name: entryName } }): void => {
+ if (entryName === chunkValue) {
+ cacheGroup[chunkValue as string].push(
+ createProperty(j, "test", entryName)
+ );
+ }
+ }
);
}
- });
- });
+ );
+ }
}
- });
+ );
break;
- case "name":
- const nameKey = p.value.value;
+ case "name": {
+ const nameKey = (p.value as Node).value as string;
if (nameKey === "runtime") {
- optimizationProps["runtimeChunk"] = j.objectExpression([ // tslint:disable-line
- createProperty(j, "name", nameKey),
+ optimizationProps["runtimeChunk"] = j.objectExpression([
+ createProperty(j, "name", nameKey)
]);
} else {
chunkKey = nameKey;
@@ -106,19 +140,21 @@ export default function(j: IJSCodeshift, ast: INode): INode {
}
findRootNodesByName(j, ast, "entry").forEach(
- ({ value: { value: { properties: entries }} },
- ): void => {
- chunkCount = entries.length;
- entries.forEach(({ key: { name: entryName }}): void => {
- if (entryName === nameKey) {
- cacheGroup[nameKey].push(
- createProperty(j, "test", entryName),
- );
- }
- });
- });
+ ({ value }): void => {
+ const { properties: entries } = (value as Node).value as Node;
+ chunkCount = entries.length;
+ entries.forEach(
+ ({ key: { name: entryName } }): void => {
+ if (entryName === nameKey) {
+ cacheGroup[nameKey].push(createProperty(j, "test", entryName));
+ }
+ }
+ );
+ }
+ );
}
break;
+ }
case "filename":
if (chunkKey) {
@@ -126,7 +162,7 @@ export default function(j: IJSCodeshift, ast: INode): INode {
cacheGroup[chunkKey] = [];
}
cacheGroup[chunkKey].push(
- createProperty(j, propKey, p.value.value),
+ createProperty(j, propKey, (p.value as Node).value as string)
);
}
break;
@@ -135,9 +171,7 @@ export default function(j: IJSCodeshift, ast: INode): INode {
if (!Array.isArray(cacheGroup[chunkKey])) {
cacheGroup[chunkKey] = [];
}
- cacheGroup[chunkKey].push(
- createProperty(j, "chunks", "async"),
- );
+ cacheGroup[chunkKey].push(createProperty(j, "chunks", "async"));
break;
case "minSize":
@@ -145,177 +179,104 @@ export default function(j: IJSCodeshift, ast: INode): INode {
cacheGroup[chunkKey] = [];
}
cacheGroup[chunkKey].push(
- j.property("init", createIdentifierOrLiteral(j, propKey), p.value),
+ j.property("init", createIdentifierOrLiteral(j, propKey), p.value as Node)
);
break;
- case "minChunks" :
- const { value: pathValue }: INode = p;
+ case "minChunks": {
+ const { value: pathValue }: Node = p;
// minChunk is a function
if (
- pathValue.type === "ArrowFunctionExpression" ||
- pathValue.type === "FunctionExpression"
+ (pathValue as Node).type === "ArrowFunctionExpression" ||
+ (pathValue as Node).type === "FunctionExpression"
) {
if (!Array.isArray(cacheGroup[chunkKey])) {
cacheGroup[chunkKey] = [];
}
- cacheGroup[chunkKey] = cacheGroup[chunkKey].map((prop) =>
- prop.key.name === "test" ? mergeTestPropArrowFunction(j, chunkKey, pathValue) : prop);
+ // eslint-disable-next-line
+ cacheGroup[chunkKey] = cacheGroup[chunkKey].map(
+ (prop): any =>
+ prop.key.name === "test"
+ ? mergeTestPropArrowFunction(j, chunkKey, pathValue)
+ : prop
+ );
}
break;
+ }
}
- },
+ }
);
- Object.keys(cacheGroup).forEach((chunkName: string): void => {
- let chunkProps: INode[] = [
- createProperty(j, "name", chunkName),
- ];
+ Object.keys(cacheGroup).forEach(
+ (chunkName: string): void => {
+ let chunkProps: Node[] = [createProperty(j, "name", chunkName)];
- const chunkPropsToAdd = cacheGroup[chunkName];
- const chunkPropsKeys = chunkPropsToAdd.map((prop) => prop.key.name);
+ const chunkPropsToAdd = cacheGroup[chunkName];
+ const chunkPropsKeys = chunkPropsToAdd.map((prop): string => prop.key.name);
- commonCacheGroupsProps =
- commonCacheGroupsProps.filter((commonProp) => !chunkPropsKeys.includes(commonProp.key.name));
+ commonCacheGroupsProps = commonCacheGroupsProps.filter(
+ (commonProp): boolean => !chunkPropsKeys.includes(commonProp.key.name)
+ );
- chunkProps.push(...commonCacheGroupsProps);
+ chunkProps.push(...commonCacheGroupsProps);
- if (chunkCount > 1) {
- chunkProps.push(
- j.property(
- "init",
- createIdentifierOrLiteral(j, "minChunks"),
- createIdentifierOrLiteral(j, chunkCount),
- ),
+ if (chunkCount > 1) {
+ chunkProps.push(
+ j.property(
+ "init",
+ createIdentifierOrLiteral(j, "minChunks"),
+ createIdentifierOrLiteral(j, chunkCount)
+ )
+ );
+ }
+
+ const chunkPropsContainTest = chunkPropsToAdd.some(
+ (prop): boolean => prop.key.name === "test" && prop.value.type === "Literal"
);
- }
- const chunkPropsContainTest =
- chunkPropsToAdd.some((prop) => prop.key.name === "test" && prop.value.type === "Literal");
+ if (chunkPropsContainTest) {
+ chunkProps = chunkProps.filter((prop): boolean => prop.key.name !== "minChunks");
+ }
- if (chunkPropsContainTest) {
- chunkProps = chunkProps.filter((prop) => prop.key.name !== "minChunks");
- }
+ if (chunkPropsToAdd && Array.isArray(chunkPropsToAdd) && chunkPropsToAdd.length > 0) {
+ chunkProps.push(...chunkPropsToAdd);
+ }
- if (
- chunkPropsToAdd &&
- Array.isArray(chunkPropsToAdd) &&
- chunkPropsToAdd.length > 0
- ) {
- chunkProps.push(...chunkPropsToAdd);
+ cacheGroups.push(
+ j.property("init", createIdentifierOrLiteral(j, chunkName), j.objectExpression([...chunkProps]))
+ );
}
-
- cacheGroups.push(
- j.property(
- "init",
- createIdentifierOrLiteral(j, chunkName),
- j.objectExpression([...chunkProps]),
- ),
- );
- });
+ );
if (cacheGroups.length > 0) {
cacheGroupsProps.push(...cacheGroups);
}
- },
+ }
);
// Remove old plugin
- const root: INode = findAndRemovePluginByName(
- j,
- ast,
- "webpack.optimize.CommonsChunkPlugin",
- );
+ const root: Node = findAndRemovePluginByName(j, ast, "webpack.optimize.CommonsChunkPlugin");
- const rootProps: INode[] = [...splitChunksProps];
+ const rootProps: Node[] = [...splitChunksProps];
if (cacheGroupsProps.length > 0) {
rootProps.push(
- j.property(
- "init",
- createIdentifierOrLiteral(j, "cacheGroups"),
- j.objectExpression([...cacheGroupsProps]),
- ),
+ j.property("init", createIdentifierOrLiteral(j, "cacheGroups"), j.objectExpression([...cacheGroupsProps]))
);
}
// Add new optimizations splitChunks option
if (root) {
- addOrUpdateConfigObject(
- j,
- root,
- "optimizations",
- "splitChunks",
- j.objectExpression([...rootProps]),
- );
+ addOrUpdateConfigObject(j, root, "optimizations", "splitChunks", j.objectExpression([...rootProps]));
- Object.keys(optimizationProps).forEach((key: string): void => {
- addOrUpdateConfigObject(
- j,
- root,
- "optimizations",
- key,
- optimizationProps[key],
- );
- });
+ Object.keys(optimizationProps).forEach(
+ (key: string): void => {
+ addOrUpdateConfigObject(j, root, "optimizations", key, optimizationProps[key]);
+ }
+ );
}
return ast;
}
-
-// merge test entry prop and function expression. case 6[x]
-const mergeTestPropArrowFunction = (j, chunkKey, testFunc) => {
- return j.property(
- "init",
- createIdentifierOrLiteral(j, "test"),
- j.arrowFunctionExpression(
- [j.identifier("module")],
- j.blockStatement([
- j.ifStatement(
- j.callExpression(
- j.memberExpression(
- j.callExpression(
- j.memberExpression(
- j.identifier("module"),
- j.identifier("getChunks"),
- ),
- [],
- ),
- j.identifier("some"),
- false,
- ),
- [j.arrowFunctionExpression(
- [j.identifier("chunk")],
- j.binaryExpression(
- "===",
- j.memberExpression(
- j.identifier("chunk"),
- j.identifier("name"),
- ),
- j.literal(chunkKey),
- ),
- )],
- ),
- j.returnStatement(
- j.literal(true),
- ),
- ),
- j.variableDeclaration(
- "const",
- [j.variableDeclarator(
- j.identifier("fn"),
- testFunc,
- )],
- ),
- j.returnStatement(
- j.callExpression(
- j.identifier("fn"),
- [j.identifier("module")],
- ),
- ),
- ]),
- ),
- );
-};
diff --git a/packages/migrate/extractTextPlugin/__snapshots__/extractTextPlugin.test.js.snap b/packages/migrate/extractTextPlugin/__snapshots__/extractTextPlugin.test.js.snap
deleted file mode 100644
index c60c600d9c2..00000000000
--- a/packages/migrate/extractTextPlugin/__snapshots__/extractTextPlugin.test.js.snap
+++ /dev/null
@@ -1,24 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`extractTextPlugin transforms correctly 1`] = `
-"let ExtractTextPlugin = require('extract-text-webpack-plugin');
-let HTMLWebpackPlugin = require('html-webpack-plugin');
-
-module.export = {
- module: {
- rules: [
- {
- test: /\\\\.css$/,
- use: ExtractTextPlugin.extract({
- fallback: 'style-loader',
- use: 'css-loader'
- })
- }
- ]
- },
- plugins: [
- new ExtractTextPlugin(\\"styles.css\\"),
- ]
-}
-"
-`;
diff --git a/packages/migrate/extractTextPlugin/__testfixtures__/extractTextPlugin.input.js b/packages/migrate/extractTextPlugin/__testfixtures__/extractTextPlugin.input.js
deleted file mode 100644
index f578bb4342d..00000000000
--- a/packages/migrate/extractTextPlugin/__testfixtures__/extractTextPlugin.input.js
+++ /dev/null
@@ -1,16 +0,0 @@
-let ExtractTextPlugin = require('extract-text-webpack-plugin');
-let HTMLWebpackPlugin = require('html-webpack-plugin');
-
-module.export = {
- module: {
- rules: [
- {
- test: /\.css$/,
- use: ExtractTextPlugin.extract('style-loader', 'css-loader')
- }
- ]
- },
- plugins: [
- new ExtractTextPlugin("styles.css"),
- ]
-}
diff --git a/packages/migrate/extractTextPlugin/__tests__/__snapshots__/extractTextPlugin.test.ts.snap b/packages/migrate/extractTextPlugin/__tests__/__snapshots__/extractTextPlugin.test.ts.snap
new file mode 100644
index 00000000000..fe042da4a2c
--- /dev/null
+++ b/packages/migrate/extractTextPlugin/__tests__/__snapshots__/extractTextPlugin.test.ts.snap
@@ -0,0 +1,21 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`extractTextPlugin transforms correctly 1`] = `
+"const ExtractTextPlugin = require(\\"extract-text-webpack-plugin\\");
+
+module.exports = {
+ module: {
+ rules: [
+ {
+ test: /\\\\.css$/,
+ use: ExtractTextPlugin.extract({
+ fallback: 'style-loader',
+ use: 'css-loader'
+ })
+ }
+ ]
+ },
+ plugins: [new ExtractTextPlugin(\\"styles.css\\")]
+};
+"
+`;
diff --git a/packages/migrate/extractTextPlugin/__tests__/__testfixtures__/extractTextPlugin.input.js b/packages/migrate/extractTextPlugin/__tests__/__testfixtures__/extractTextPlugin.input.js
new file mode 100644
index 00000000000..07d46e38cc0
--- /dev/null
+++ b/packages/migrate/extractTextPlugin/__tests__/__testfixtures__/extractTextPlugin.input.js
@@ -0,0 +1,13 @@
+const ExtractTextPlugin = require("extract-text-webpack-plugin");
+
+module.exports = {
+ module: {
+ rules: [
+ {
+ test: /\.css$/,
+ use: ExtractTextPlugin.extract("style-loader", "css-loader")
+ }
+ ]
+ },
+ plugins: [new ExtractTextPlugin("styles.css")]
+};
diff --git a/packages/migrate/extractTextPlugin/__tests__/extractTextPlugin.test.ts b/packages/migrate/extractTextPlugin/__tests__/extractTextPlugin.test.ts
new file mode 100644
index 00000000000..4e866fb005f
--- /dev/null
+++ b/packages/migrate/extractTextPlugin/__tests__/extractTextPlugin.test.ts
@@ -0,0 +1,5 @@
+import defineTest from "@webpack-cli/utils/defineTest";
+import { join } from "path";
+
+const dirName: string = join(__dirname, "..");
+defineTest(dirName, "extractTextPlugin");
diff --git a/packages/migrate/extractTextPlugin/extractTextPlugin.test.js b/packages/migrate/extractTextPlugin/extractTextPlugin.test.js
deleted file mode 100644
index b003fcc520a..00000000000
--- a/packages/migrate/extractTextPlugin/extractTextPlugin.test.js
+++ /dev/null
@@ -1,5 +0,0 @@
-"use strict";
-
-const defineTest = require("@webpack-cli/utils/defineTest").default;
-
-defineTest(__dirname, "extractTextPlugin");
diff --git a/packages/migrate/extractTextPlugin/extractTextPlugin.ts b/packages/migrate/extractTextPlugin/extractTextPlugin.ts
index bf0cf39d937..fcc3931a394 100644
--- a/packages/migrate/extractTextPlugin/extractTextPlugin.ts
+++ b/packages/migrate/extractTextPlugin/extractTextPlugin.ts
@@ -1,6 +1,6 @@
import * as utils from "@webpack-cli/utils/ast-utils";
-import { IJSCodeshift, INode } from "../types/NodePath";
+import { JSCodeshift, Node } from "../types/NodePath";
/**
*
@@ -12,12 +12,12 @@ import { IJSCodeshift, INode } from "../types/NodePath";
* @returns {Boolean} isPluginInvocation - whether `node` is the invocation of the plugin denoted by `pluginName`
*/
-function findInvocation(j: IJSCodeshift, path: INode, pluginName: string): boolean {
- let found: boolean = false;
+function findInvocation(j: JSCodeshift, path: Node, pluginName: string): boolean {
+ let found = false;
found =
j(path)
.find(j.MemberExpression)
- .filter((p: INode): boolean => p.get("object").value.name === pluginName)
+ .filter((p: Node): boolean => (p.get("object").value as Node).name === pluginName)
.size() > 0;
return found;
}
@@ -31,30 +31,28 @@ function findInvocation(j: IJSCodeshift, path: INode, pluginName: string): boole
* @returns {Node} ast - jscodeshift ast
*/
-export default function(j: IJSCodeshift, ast: INode): void | INode {
- const changeArguments = (path: INode): INode => {
- const args: INode[] = path.value.arguments;
+export default function(j: JSCodeshift, ast: Node): void | Node {
+ const changeArguments = (path: Node): Node => {
+ const args: Node[] = (path.value as Node).arguments;
- const literalArgs: INode[] = args.filter((p: INode): boolean => utils.isType(p, "Literal"));
+ const literalArgs: Node[] = args.filter((p: Node): boolean => utils.isType(p, "Literal"));
if (literalArgs && literalArgs.length > 1) {
const newArgs: object = j.objectExpression(
- literalArgs.map((p: INode, index: number): INode =>
- utils.createProperty(j, index === 0 ? "fallback" : "use", p.value),
- ),
+ literalArgs.map(
+ (p: Node, index: number): Node => utils.createProperty(j, index === 0 ? "fallback" : "use", p.value as Node)
+ )
);
- path.value.arguments = [newArgs];
+ (path.value as Node).arguments = [newArgs];
}
return path;
};
- const name: string = utils.findVariableToPlugin(
- j,
- ast,
- "extract-text-webpack-plugin",
- );
- if (!name) { return ast; }
+ const name: string = utils.findVariableToPlugin(j, ast, "extract-text-webpack-plugin");
+ if (!name) {
+ return ast;
+ }
return ast
.find(j.CallExpression)
- .filter((p: INode): boolean => findInvocation(j, p, name))
+ .filter((p: Node): boolean => findInvocation(j, p, name))
.forEach(changeArguments);
}
diff --git a/packages/migrate/index.ts b/packages/migrate/index.ts
index c7b6e78ca48..09e6bcee346 100644
--- a/packages/migrate/index.ts
+++ b/packages/migrate/index.ts
@@ -10,19 +10,20 @@ import { validate, WebpackOptionsValidationError } from "webpack";
import runPrettier from "@webpack-cli/utils/run-prettier";
import { transformations } from "./migrate";
-import { IJSCodeshift, INode } from "./types/NodePath";
+import { Node } from "./types/NodePath";
+import jscodeshift from "jscodeshift";
declare var process: {
cwd: Function;
webpackModule: {
validate: Function;
- /* tslint:disable */
WebpackOptionsValidationError: {
- new(errors: string[]): {
+ new: (
+ errors: string[]
+ ) => {
message: string;
};
};
- /* tslint:enable */
};
stdout: {
write: Function;
@@ -30,59 +31,6 @@ declare var process: {
exitCode: number;
};
-/**
- *
- * Runs migration on a given configuration using AST's and promises
- * to sequentially transform a configuration file.
- *
- * @param {Array} args - Migrate arguments such as input and
- * output path
- * @returns {Function} Runs the migration using the 'runMigrate'
- * function.
- */
-
-export default function migrate(...args: string[]): void | Promise {
- const filePaths: string[] = args.slice(3);
- if (!filePaths.length) {
- const errMsg: string = "\n ✖ Please specify a path to your webpack config \n ";
- console.error(chalk.red(errMsg));
- return;
- }
-
- const currentConfigPath: string = path.resolve(process.cwd(), filePaths[0]);
- let outputConfigPath: string;
-
- if (!filePaths[1]) {
- return inquirer
- .prompt([
- {
- default: "Y",
- message:
- "Migration output path not specified. " +
- "Do you want to use your existing webpack " +
- "configuration?",
- name: "confirmPath",
- type: "confirm",
- },
- ])
- .then((ans: {
- confirmPath: boolean;
- }): void | Promise => {
- if (!ans.confirmPath) {
- console.error(chalk.red("✖ ︎Migration aborted due no output path"));
- return;
- }
- outputConfigPath = path.resolve(process.cwd(), filePaths[0]);
- return runMigration(currentConfigPath, outputConfigPath);
- })
- .catch((err: object): void => {
- console.error(err);
- });
- }
- outputConfigPath = path.resolve(process.cwd(), filePaths[1]);
- return runMigration(currentConfigPath, outputConfigPath);
-}
-
/**
*
* Runs migration on a given configuration using AST's and promises
@@ -97,144 +45,204 @@ export default function migrate(...args: string[]): void | Promise {
function runMigration(currentConfigPath: string, outputConfigPath: string): Promise | void {
const recastOptions: object = {
- quote: "single",
+ quote: "single"
};
const tasks: Listr = new Listr([
{
- task: (ctx: INode): string | void | Listr | Promise<{}> =>
- new pLazy((
+ task: (ctx: Node): string | void | Listr | Promise<{}> =>
+ new pLazy(
+ (
resolve: (value?: object) => void,
- reject: (reason?: string | object, err?: object) => void,
- ) => {
- fs.readFile(currentConfigPath, "utf8", (err: object, content: string) => {
- if (err) {
- reject(err);
- }
- try {
- const jscodeshift: IJSCodeshift = require("jscodeshift");
- ctx.source = content;
- ctx.ast = jscodeshift(content);
- resolve();
- } catch (err) {
- reject("Error generating AST", err);
- }
- });
- }),
- title: "Reading webpack config",
+ reject: (reason?: string | object, err?: object) => void
+ ): void => {
+ fs.readFile(
+ currentConfigPath,
+ "utf8",
+ (err: object, content: string): void => {
+ if (err) {
+ reject(err);
+ }
+ try {
+ ctx.source = content;
+ ctx.ast = jscodeshift(content);
+ resolve();
+ } catch (err) {
+ reject("Error generating AST", err);
+ }
+ }
+ );
+ }
+ ),
+ title: "Reading webpack config"
},
{
- task: (ctx: INode): string | void | Listr | Promise => {
+ task: (ctx: Node): string | void | Listr | Promise<{}> => {
return new Listr(
- Object.keys(transformations).map((key: string): {
- task: (_?: void) => string;
- title: string;
- } => {
- const transform: Function = transformations[key];
- return {
- task: (_?: void) => transform(ctx.ast, ctx.source),
- title: key,
- };
- }),
+ Object.keys(transformations).map(
+ (
+ key: string
+ ): {
+ task: () => string;
+ title: string;
+ } => {
+ const transform: Function = transformations[key];
+ return {
+ task: (): string => transform(ctx.ast, ctx.source),
+ title: key
+ };
+ }
+ )
);
},
- title: "Migrating config to newest version",
- },
+ title: "Migrating config to newest version"
+ }
]);
tasks
.run()
- .then((ctx: INode): void | Promise => {
- const result: string = ctx.ast.toSource(recastOptions);
- const diffOutput: diff.IDiffResult[] = diff.diffLines(ctx.source, result);
-
- diffOutput.forEach((diffLine: diff.IDiffResult): void => {
- if (diffLine.added) {
- process.stdout.write(chalk.green(`+ ${diffLine.value}`));
- } else if (diffLine.removed) {
- process.stdout.write(chalk.red(`- ${diffLine.value}`));
- }
- });
-
- return inquirer
- .prompt([
- {
- default: "Y",
- message: "Are you sure these changes are fine?",
- name: "confirmMigration",
- type: "confirm",
- },
- ])
- .then((answers: {
- confirmMigration: boolean;
- }): Promise<{}> => {
- if (answers.confirmMigration) {
- return inquirer.prompt([
- {
- default: "Y",
- message:
- "Do you want to validate your configuration? " +
- "(If you're using webpack merge, validation isn't useful)",
- name: "confirmValidation",
- type: "confirm",
- },
- ]);
- } else {
- console.error(chalk.red("✖ Migration aborted"));
- }
- })
- .then((answer: {
- confirmValidation: boolean;
- }): void => {
- if (!answer) { return; }
-
- runPrettier(outputConfigPath, result, (err: object): void => {
- if (err) {
- throw err;
+ .then(
+ (ctx: Node): void | Promise => {
+ const result: string = ctx.ast.toSource(recastOptions);
+ const diffOutput: diff.IDiffResult[] = diff.diffLines(ctx.source, result);
+
+ diffOutput.forEach(
+ (diffLine: diff.IDiffResult): void => {
+ if (diffLine.added) {
+ process.stdout.write(chalk.green(`+ ${diffLine.value}`));
+ } else if (diffLine.removed) {
+ process.stdout.write(chalk.red(`- ${diffLine.value}`));
}
- });
-
- if (answer.confirmValidation) {
- const webpackOptionsValidationErrors: string[] = validate(
- require(outputConfigPath),
- );
+ }
+ );
- if (webpackOptionsValidationErrors.length) {
- console.error(
- chalk.red(
- "\n✖ Your configuration validation wasn't successful \n",
- ),
+ return inquirer
+ .prompt([
+ {
+ default: "Y",
+ message: "Are you sure these changes are fine?",
+ name: "confirmMigration",
+ type: "confirm"
+ }
+ ])
+ .then(
+ (answers: { confirmMigration: boolean }): Promise<{}> => {
+ if (answers.confirmMigration) {
+ return inquirer.prompt([
+ {
+ default: "Y",
+ message:
+ "Do you want to validate your configuration? " +
+ "(If you're using webpack merge, validation isn't useful)",
+ name: "confirmValidation",
+ type: "confirm"
+ }
+ ]);
+ } else {
+ console.error(chalk.red("✖ Migration aborted"));
+ }
+ }
+ )
+ .then(
+ (answer: { confirmValidation: boolean }): void => {
+ if (!answer) {
+ return;
+ }
+
+ runPrettier(
+ outputConfigPath,
+ result,
+ (err: object): void => {
+ if (err) {
+ throw err;
+ }
+ }
);
- console.error(
- new WebpackOptionsValidationError(
- webpackOptionsValidationErrors,
- ).message,
+
+ if (answer.confirmValidation) {
+ const webpackOptionsValidationErrors: string[] = validate(require(outputConfigPath));
+
+ if (webpackOptionsValidationErrors.length) {
+ console.error(chalk.red("\n✖ Your configuration validation wasn't successful \n"));
+ console.error(
+ new WebpackOptionsValidationError(webpackOptionsValidationErrors).message
+ );
+ }
+ }
+
+ console.info(chalk.green(`\n✔︎ New webpack config file is at ${outputConfigPath}.`));
+ console.info(
+ chalk.green(
+ "✔︎ Heads up! Updating to the latest version could contain breaking changes."
+ )
);
- }
- }
- console.info(
- chalk.green(
- `\n✔︎ New webpack config file is at ${outputConfigPath}.`,
- ),
- );
- console.info(
- chalk.green(
- "✔︎ Heads up! Updating to the latest version could contain breaking changes.",
- ),
+ console.info(chalk.green("✔︎ Plugin and loader dependencies may need to be updated."));
+ }
);
+ }
+ )
+ .catch(
+ (err: object): void => {
+ const errMsg = "\n ✖ ︎Migration aborted due to some errors: \n";
+ console.error(chalk.red(errMsg));
+ console.error(err);
+ process.exitCode = 1;
+ }
+ );
+}
- console.info(
- chalk.green(
- "✔︎ Plugin and loader dependencies may need to be updated.",
- ),
- );
- });
- })
- .catch((err: object): void => {
- const errMsg: string = "\n ✖ ︎Migration aborted due to some errors: \n";
- console.error(chalk.red(errMsg));
- console.error(err);
- process.exitCode = 1;
- });
+/**
+ *
+ * Runs migration on a given configuration using AST's and promises
+ * to sequentially transform a configuration file.
+ *
+ * @param {Array} args - Migrate arguments such as input and
+ * output path
+ * @returns {Function} Runs the migration using the 'runMigrate'
+ * function.
+ */
+
+export default function migrate(...args: string[]): void | Promise {
+ const filePaths = args.slice(3);
+ if (!filePaths.length) {
+ const errMsg = "\n ✖ Please specify a path to your webpack config \n ";
+ console.error(chalk.red(errMsg));
+ return;
+ }
+
+ const currentConfigPath = path.resolve(process.cwd(), filePaths[0]);
+ let outputConfigPath: string;
+
+ if (!filePaths[1]) {
+ return inquirer
+ .prompt([
+ {
+ default: "Y",
+ message:
+ "Migration output path not specified. " +
+ "Do you want to use your existing webpack " +
+ "configuration?",
+ name: "confirmPath",
+ type: "confirm"
+ }
+ ])
+ .then(
+ (ans: { confirmPath: boolean }): void | Promise => {
+ if (!ans.confirmPath) {
+ console.error(chalk.red("✖ ︎Migration aborted due no output path"));
+ return;
+ }
+ outputConfigPath = path.resolve(process.cwd(), filePaths[0]);
+ return runMigration(currentConfigPath, outputConfigPath);
+ }
+ )
+ .catch(
+ (err: object): void => {
+ console.error(err);
+ }
+ );
+ }
+ outputConfigPath = path.resolve(process.cwd(), filePaths[1]);
+ return runMigration(currentConfigPath, outputConfigPath);
}
diff --git a/packages/migrate/loaderOptionsPlugin/__snapshots__/loaderOptionsPlugin.test.js.snap b/packages/migrate/loaderOptionsPlugin/__tests__/__snapshots__/loaderOptionsPlugin.test.ts.snap
similarity index 100%
rename from packages/migrate/loaderOptionsPlugin/__snapshots__/loaderOptionsPlugin.test.js.snap
rename to packages/migrate/loaderOptionsPlugin/__tests__/__snapshots__/loaderOptionsPlugin.test.ts.snap
diff --git a/packages/migrate/loaderOptionsPlugin/__testfixtures__/loaderOptionsPlugin-0.input.js b/packages/migrate/loaderOptionsPlugin/__tests__/__testfixtures__/loaderOptionsPlugin-0.input.js
similarity index 100%
rename from packages/migrate/loaderOptionsPlugin/__testfixtures__/loaderOptionsPlugin-0.input.js
rename to packages/migrate/loaderOptionsPlugin/__tests__/__testfixtures__/loaderOptionsPlugin-0.input.js
diff --git a/packages/migrate/loaderOptionsPlugin/__testfixtures__/loaderOptionsPlugin-1.input.js b/packages/migrate/loaderOptionsPlugin/__tests__/__testfixtures__/loaderOptionsPlugin-1.input.js
similarity index 100%
rename from packages/migrate/loaderOptionsPlugin/__testfixtures__/loaderOptionsPlugin-1.input.js
rename to packages/migrate/loaderOptionsPlugin/__tests__/__testfixtures__/loaderOptionsPlugin-1.input.js
diff --git a/packages/migrate/loaderOptionsPlugin/__testfixtures__/loaderOptionsPlugin-2.input.js b/packages/migrate/loaderOptionsPlugin/__tests__/__testfixtures__/loaderOptionsPlugin-2.input.js
similarity index 100%
rename from packages/migrate/loaderOptionsPlugin/__testfixtures__/loaderOptionsPlugin-2.input.js
rename to packages/migrate/loaderOptionsPlugin/__tests__/__testfixtures__/loaderOptionsPlugin-2.input.js
diff --git a/packages/migrate/loaderOptionsPlugin/__testfixtures__/loaderOptionsPlugin-3.input.js b/packages/migrate/loaderOptionsPlugin/__tests__/__testfixtures__/loaderOptionsPlugin-3.input.js
similarity index 100%
rename from packages/migrate/loaderOptionsPlugin/__testfixtures__/loaderOptionsPlugin-3.input.js
rename to packages/migrate/loaderOptionsPlugin/__tests__/__testfixtures__/loaderOptionsPlugin-3.input.js
diff --git a/packages/migrate/loaderOptionsPlugin/__tests__/loaderOptionsPlugin.test.ts b/packages/migrate/loaderOptionsPlugin/__tests__/loaderOptionsPlugin.test.ts
new file mode 100644
index 00000000000..0126a11b8cd
--- /dev/null
+++ b/packages/migrate/loaderOptionsPlugin/__tests__/loaderOptionsPlugin.test.ts
@@ -0,0 +1,25 @@
+import defineTest from "@webpack-cli/utils/defineTest";
+import { join } from "path";
+
+const dirName: string = join(__dirname, "..");
+
+defineTest(
+ dirName,
+ "loaderOptionsPlugin",
+ "loaderOptionsPlugin-0",
+);
+defineTest(
+ dirName,
+ "loaderOptionsPlugin",
+ "loaderOptionsPlugin-1",
+);
+defineTest(
+ dirName,
+ "loaderOptionsPlugin",
+ "loaderOptionsPlugin-2",
+);
+defineTest(
+ dirName,
+ "loaderOptionsPlugin",
+ "loaderOptionsPlugin-3",
+);
diff --git a/packages/migrate/loaderOptionsPlugin/loaderOptionsPlugin.test.js b/packages/migrate/loaderOptionsPlugin/loaderOptionsPlugin.test.js
deleted file mode 100644
index c8928b75473..00000000000
--- a/packages/migrate/loaderOptionsPlugin/loaderOptionsPlugin.test.js
+++ /dev/null
@@ -1,8 +0,0 @@
-"use strict";
-
-const defineTest = require("@webpack-cli/utils/defineTest").default;
-
-defineTest(__dirname, "loaderOptionsPlugin", "loaderOptionsPlugin-0");
-defineTest(__dirname, "loaderOptionsPlugin", "loaderOptionsPlugin-1");
-defineTest(__dirname, "loaderOptionsPlugin", "loaderOptionsPlugin-2");
-defineTest(__dirname, "loaderOptionsPlugin", "loaderOptionsPlugin-3");
diff --git a/packages/migrate/loaderOptionsPlugin/loaderOptionsPlugin.ts b/packages/migrate/loaderOptionsPlugin/loaderOptionsPlugin.ts
index 681ff9579cd..b16a927d46b 100644
--- a/packages/migrate/loaderOptionsPlugin/loaderOptionsPlugin.ts
+++ b/packages/migrate/loaderOptionsPlugin/loaderOptionsPlugin.ts
@@ -1,14 +1,10 @@
import isEmpty = require("lodash/isEmpty");
-import {
- createOrUpdatePluginByName,
- findPluginsByName,
- safeTraverse,
-} from "@webpack-cli/utils/ast-utils";
+import { createOrUpdatePluginByName, findPluginsByName, safeTraverse } from "@webpack-cli/utils/ast-utils";
-import { IJSCodeshift, INode } from "../types/NodePath";
+import { JSCodeshift, Node } from "../types/NodePath";
-interface ILoaderOptions {
+interface LoaderOptions {
debug?: boolean;
minimize?: boolean;
}
@@ -23,18 +19,18 @@ interface ILoaderOptions {
*
*/
-export default function(j: IJSCodeshift, ast: INode): INode {
- const loaderOptions: ILoaderOptions = {};
+export default function(j: JSCodeshift, ast: Node): Node {
+ const loaderOptions: LoaderOptions = {};
// If there is debug: true, set debug: true in the plugin
if (ast.find(j.Identifier, { name: "debug" }).size()) {
loaderOptions.debug = true;
- ast
- .find(j.Identifier, { name: "debug" })
- .forEach((p: INode): void => {
+ ast.find(j.Identifier, { name: "debug" }).forEach(
+ (p: Node): void => {
p.parent.prune();
- });
+ }
+ );
}
// If there is UglifyJsPlugin, set minimize: true
@@ -44,18 +40,12 @@ export default function(j: IJSCodeshift, ast: INode): INode {
return ast
.find(j.ArrayExpression)
- .filter(
- (path: INode): boolean =>
- safeTraverse(path, ["parent", "value", "key", "name"]) === "plugins",
- )
- .forEach((path: INode): void => {
- if (!isEmpty(loaderOptions)) {
- createOrUpdatePluginByName(
- j,
- path,
- "webpack.LoaderOptionsPlugin",
- loaderOptions,
- );
+ .filter((path: Node): boolean => safeTraverse(path, ["parent", "value", "key", "name"]) === "plugins")
+ .forEach(
+ (path: Node): void => {
+ if (!isEmpty(loaderOptions)) {
+ createOrUpdatePluginByName(j, path, "webpack.LoaderOptionsPlugin", loaderOptions);
+ }
}
- });
+ );
}
diff --git a/packages/migrate/loaders/__snapshots__/loaders.test.js.snap b/packages/migrate/loaders/__snapshots__/loaders.test.js.snap
deleted file mode 100644
index 02b59594ec0..00000000000
--- a/packages/migrate/loaders/__snapshots__/loaders.test.js.snap
+++ /dev/null
@@ -1,270 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`loaders transforms correctly using "loaders-0" data 1`] = `
-"export default [{
- module: {
- rules: [{
- test: /\\\\.js$/,
- use: [{
- loader: 'babel-loader'
- }]
- }]
- }
-}, {
- module: {
- rules: [{
- test: /\\\\.css$/,
- use: [{
- loader: 'style-loader'
- }, {
- loader: 'css-loader',
-
- options: {
- modules: true,
- importLoaders: 1,
- string: 'test123'
- }
- }]
- }]
- }
-}, {
- module: {
- rules: [{
- test: /\\\\.css$/,
- use: [{
- loader: 'style-loader'
- }, {
- loader: 'css-loader',
- options: {
- modules: true
- }
- }]
- }]
- }
-}, {
- module: {
- rules:[{
- test: /\\\\.js$/,
-
- use: [{
- loader: 'eslint-loader'
- }],
-
- enforce: 'pre'
- }]
- }
-}, {
- module: {
- rules:[{
- test: /\\\\.js$/,
-
- use: [{
- loader: 'my-post-loader'
- }],
-
- enforce: 'post'
- }]
- }
-}, {
- module: {
- rules: [{
- test: /\\\\.js$/,
- use: [{
- loader: 'babel-loader'
- }]
- }, {
- test: /\\\\.js$/,
-
- use: [{
- loader: 'eslint-loader'
- }],
-
- enforce: 'pre'
- }]
- }
-}, {
- module: {
- rules: [{
- test: /\\\\.js$/,
- use: [{
- loader: 'babel-loader'
- }]
- }, {
- test: /\\\\.js$/,
-
- use: [{
- loader: 'my-post-loader'
- }],
-
- enforce: 'post'
- }]
- }
-}];
-"
-`;
-
-exports[`loaders transforms correctly using "loaders-1" data 1`] = `
-"export default {
- module: {
- rules: [{
- test: /\\\\.css$/,
- use: [{
- loader: 'style-loader'
- }, {
- loader: 'css-loader',
-
- options: {
- modules: true,
- importLoaders: 1,
- string: 'test123'
- }
- }]
- }]
- }
-}
-"
-`;
-
-exports[`loaders transforms correctly using "loaders-2" data 1`] = `
-"export default {
- module: {
- rules: [{
- test: /\\\\.css$/,
- use: [{
- loader: 'style-loader'
- }, {
- loader: 'css-loader',
- options: {
- modules: true
- }
- }]
- }]
- }
-}
-"
-`;
-
-exports[`loaders transforms correctly using "loaders-3" data 1`] = `
-"export default {
- module: {
- rules:[{
- test: /\\\\.js$/,
-
- use: [{
- loader: 'eslint-loader'
- }],
-
- enforce: 'pre'
- }]
- }
-}
-"
-`;
-
-exports[`loaders transforms correctly using "loaders-4" data 1`] = `
-"export default {
- module: {
- rules:[{
- test: /\\\\.js$/,
-
- use: [{
- loader: 'my-post-loader'
- }],
-
- enforce: 'post'
- }]
- }
-}
-"
-`;
-
-exports[`loaders transforms correctly using "loaders-5" data 1`] = `
-"export default {
- module: {
- rules: [{
- test: /\\\\.js$/,
- use: [{
- loader: 'babel-loader'
- }]
- }, {
- test: /\\\\.js$/,
-
- use: [{
- loader: 'eslint-loader'
- }],
-
- enforce: 'pre'
- }]
- }
-}
-"
-`;
-
-exports[`loaders transforms correctly using "loaders-6" data 1`] = `
-"export default {
- module: {
- rules: [{
- test: /\\\\.js$/,
- use: [{
- loader: 'babel-loader'
- }]
- }, {
- test: /\\\\.js$/,
-
- use: [{
- loader: 'my-post-loader'
- }],
-
- enforce: 'post'
- }]
- }
-}
-"
-`;
-
-exports[`loaders transforms correctly using "loaders-7" data 1`] = `
-"export default {
- module: {
- rules: [
- {
- test: /\\\\.js$/,
- exclude: /(node_modules)/,
-
- use: [{
- loader: 'babel-loader',
-
- options: {
- presets: ['@babel/preset-env']
- }
- }]
- }
- ]
- }
-};
-"
-`;
-
-exports[`loaders transforms correctly using "loaders-8" data 1`] = `
-"module.exports = {
- module: {
- rules: [
- {
- test: /\\\\.js$/,
- use: [{
- loader: 'style-loader'
- }, {
- loader: 'css-loader',
-
- options: {
- modules: true,
- importLoaders: 1,
- string: 'test123'
- }
- }],
- include: path.join(__dirname, 'src')
- }
- ]
- }
-}
-"
-`;
diff --git a/packages/migrate/loaders/__testfixtures__/loaders-0.input.js b/packages/migrate/loaders/__testfixtures__/loaders-0.input.js
deleted file mode 100644
index e0d498f6506..00000000000
--- a/packages/migrate/loaders/__testfixtures__/loaders-0.input.js
+++ /dev/null
@@ -1,65 +0,0 @@
-export default [{
- module: {
- loaders: [{
- test: /\.js$/,
- loader: 'babel'
- }]
- }
-}, {
- module: {
- loaders: [{
- test: /\.css$/,
- loader: 'style!css?modules&importLoaders=1&string=test123'
- }]
- }
-}, {
- module: {
- loaders: [{
- test: /\.css$/,
- loaders: [{
- loader: 'style'
- }, {
- loader: 'css',
- query: {
- modules: true
- }
- }]
- }]
- }
-}, {
- module: {
- preLoaders:[{
- test: /\.js$/,
- loader: 'eslint'
- }]
- }
-}, {
- module: {
- postLoaders:[{
- test: /\.js$/,
- loader: 'my-post'
- }]
- }
-}, {
- module: {
- preLoaders:[{
- test: /\.js$/,
- loader: 'eslint-loader'
- }],
- loaders: [{
- test: /\.js$/,
- loader: 'babel-loader'
- }]
- }
-}, {
- module: {
- loaders: [{
- test: /\.js$/,
- loader: 'babel-loader'
- }],
- postLoaders:[{
- test: /\.js$/,
- loader: 'my-post-loader'
- }]
- }
-}];
diff --git a/packages/migrate/loaders/__testfixtures__/loaders-1.input.js b/packages/migrate/loaders/__testfixtures__/loaders-1.input.js
deleted file mode 100644
index eae75024e61..00000000000
--- a/packages/migrate/loaders/__testfixtures__/loaders-1.input.js
+++ /dev/null
@@ -1,8 +0,0 @@
-export default {
- module: {
- loaders: [{
- test: /\.css$/,
- loader: 'style!css?modules&importLoaders=1&string=test123'
- }]
- }
-}
diff --git a/packages/migrate/loaders/__testfixtures__/loaders-2.input.js b/packages/migrate/loaders/__testfixtures__/loaders-2.input.js
deleted file mode 100644
index 771404a300c..00000000000
--- a/packages/migrate/loaders/__testfixtures__/loaders-2.input.js
+++ /dev/null
@@ -1,15 +0,0 @@
-export default {
- module: {
- loaders: [{
- test: /\.css$/,
- loaders: [{
- loader: 'style'
- }, {
- loader: 'css',
- query: {
- modules: true
- }
- }]
- }]
- }
-}
diff --git a/packages/migrate/loaders/__testfixtures__/loaders-3.input.js b/packages/migrate/loaders/__testfixtures__/loaders-3.input.js
deleted file mode 100644
index 4d49e89a89b..00000000000
--- a/packages/migrate/loaders/__testfixtures__/loaders-3.input.js
+++ /dev/null
@@ -1,8 +0,0 @@
-export default {
- module: {
- preLoaders:[{
- test: /\.js$/,
- loader: 'eslint'
- }]
- }
-}
diff --git a/packages/migrate/loaders/__testfixtures__/loaders-4.input.js b/packages/migrate/loaders/__testfixtures__/loaders-4.input.js
deleted file mode 100644
index cc3e076bed9..00000000000
--- a/packages/migrate/loaders/__testfixtures__/loaders-4.input.js
+++ /dev/null
@@ -1,8 +0,0 @@
-export default {
- module: {
- postLoaders:[{
- test: /\.js$/,
- loader: 'my-post'
- }]
- }
-}
diff --git a/packages/migrate/loaders/__testfixtures__/loaders-5.input.js b/packages/migrate/loaders/__testfixtures__/loaders-5.input.js
deleted file mode 100644
index 6fd315e4d08..00000000000
--- a/packages/migrate/loaders/__testfixtures__/loaders-5.input.js
+++ /dev/null
@@ -1,12 +0,0 @@
-export default {
- module: {
- preLoaders:[{
- test: /\.js$/,
- loader: 'eslint-loader'
- }],
- loaders: [{
- test: /\.js$/,
- loader: 'babel-loader'
- }]
- }
-}
diff --git a/packages/migrate/loaders/__testfixtures__/loaders-6.input.js b/packages/migrate/loaders/__testfixtures__/loaders-6.input.js
deleted file mode 100644
index 184e4e1ad08..00000000000
--- a/packages/migrate/loaders/__testfixtures__/loaders-6.input.js
+++ /dev/null
@@ -1,12 +0,0 @@
-export default {
- module: {
- loaders: [{
- test: /\.js$/,
- loader: 'babel-loader'
- }],
- postLoaders:[{
- test: /\.js$/,
- loader: 'my-post-loader'
- }]
- }
-}
diff --git a/packages/migrate/loaders/__testfixtures__/loaders-7.input.js b/packages/migrate/loaders/__testfixtures__/loaders-7.input.js
deleted file mode 100644
index 32d30c7eb86..00000000000
--- a/packages/migrate/loaders/__testfixtures__/loaders-7.input.js
+++ /dev/null
@@ -1,14 +0,0 @@
-export default {
- module: {
- loaders: [
- {
- test: /\.js$/,
- exclude: /(node_modules)/,
- loader: 'babel-loader',
- query: {
- presets: ['@babel/preset-env']
- }
- }
- ]
- }
-};
diff --git a/packages/migrate/loaders/__testfixtures__/loaders-8.input.js b/packages/migrate/loaders/__testfixtures__/loaders-8.input.js
deleted file mode 100644
index 737e4515fca..00000000000
--- a/packages/migrate/loaders/__testfixtures__/loaders-8.input.js
+++ /dev/null
@@ -1,14 +0,0 @@
-module.exports = {
- module: {
- loaders: [
- {
- test: /\.js$/,
- loaders: [
- 'style',
- 'css?modules&importLoaders=1&string=test123'
- ],
- include: path.join(__dirname, 'src')
- }
- ]
- }
-}
diff --git a/packages/migrate/loaders/__testfixtures__/loaders-9.input.js b/packages/migrate/loaders/__testfixtures__/loaders-9.input.js
deleted file mode 100644
index 0bf440bce28..00000000000
--- a/packages/migrate/loaders/__testfixtures__/loaders-9.input.js
+++ /dev/null
@@ -1,14 +0,0 @@
-module.exports = {
- module: {
- loaders: [
- {
- test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
- loader: 'url-loader',
- options: {
- limit: 10000,
- name: 'static/media/[name].[hash:8].[ext]'
- }
- }
- ]
- }
-}
diff --git a/packages/migrate/loaders/__tests__/__snapshots__/loaders.test.ts.snap b/packages/migrate/loaders/__tests__/__snapshots__/loaders.test.ts.snap
new file mode 100644
index 00000000000..e12d1d75875
--- /dev/null
+++ b/packages/migrate/loaders/__tests__/__snapshots__/loaders.test.ts.snap
@@ -0,0 +1,289 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`loaders transforms correctly using "loaders-0" data 1`] = `
+"module.exports = [
+ {
+ module: {
+ rules: [
+ {
+ use: [{
+ loader: 'babel-loader'
+ }],
+ test: /\\\\.js$/,
+ },
+ ],
+ },
+ },
+ {
+ module: {
+ rules: [
+ {
+ use: [{
+ loader: 'style-loader'
+ }, {
+ loader: 'css-loader',
+
+ options: {
+ modules: true,
+ importLoaders: 1,
+ string: 'test123'
+ }
+ }],
+ test: /\\\\.css$/,
+ },
+ ],
+ },
+ },
+ {
+ module: {
+ rules: [
+ {
+ use: [{
+ loader: 'style-loader',
+ }, {
+ loader: 'css-loader',
+ options: {
+ modules: true,
+ },
+ }],
+ test: /\\\\.css$/,
+ },
+ ],
+ },
+ },
+ {
+ module: {
+ rules: [
+ {
+ use: [{
+ loader: 'eslint-loader'
+ }],
+
+ test: /\\\\.js$/,
+ enforce: 'pre'
+ },
+ ],
+ },
+ },
+ {
+ module: {
+ rules: [
+ {
+ use: [{
+ loader: 'my-post-loader'
+ }],
+
+ test: /\\\\.js$/,
+ enforce: 'post'
+ },
+ ],
+ },
+ },
+ {
+ module: {
+ rules: [{
+ use: [{
+ loader: 'babel-loader'
+ }],
+ test: /\\\\.js$/,
+ }, {
+ use: [{
+ loader: 'eslint-loader'
+ }],
+
+ test: /\\\\.js$/,
+ enforce: 'pre'
+ }]
+ },
+ },
+ {
+ module: {
+ rules: [{
+ use: [{
+ loader: 'babel-loader'
+ }],
+ test: /\\\\.js$/,
+ }, {
+ use: [{
+ loader: 'my-post-loader'
+ }],
+
+ test: /\\\\.js$/,
+ enforce: 'post'
+ }]
+ },
+ },
+];
+"
+`;
+
+exports[`loaders transforms correctly using "loaders-1" data 1`] = `
+"module.exports = {
+ module: {
+ rules: [
+ {
+ use: [{
+ loader: 'style-loader'
+ }, {
+ loader: 'css-loader',
+
+ options: {
+ modules: true,
+ importLoaders: 1,
+ string: 'test123'
+ }
+ }],
+ test: /\\\\.css$/,
+ },
+ ],
+ },
+};
+"
+`;
+
+exports[`loaders transforms correctly using "loaders-2" data 1`] = `
+"module.exports = {
+ module: {
+ rules: [
+ {
+ use: [{
+ loader: 'style-loader',
+ }, {
+ loader: 'css-loader',
+ options: {
+ modules: true,
+ },
+ }],
+ test: /\\\\.css$/,
+ },
+ ],
+ },
+};
+"
+`;
+
+exports[`loaders transforms correctly using "loaders-3" data 1`] = `
+"module.exports = {
+ module: {
+ rules: [
+ {
+ use: [{
+ loader: 'eslint-loader'
+ }],
+
+ test: /\\\\.js$/,
+ enforce: 'pre'
+ },
+ ],
+ },
+};
+"
+`;
+
+exports[`loaders transforms correctly using "loaders-4" data 1`] = `
+"module.exports = {
+ module: {
+ rules: [
+ {
+ use: [{
+ loader: 'my-post-loader'
+ }],
+
+ test: /\\\\.js$/,
+ enforce: 'post'
+ },
+ ],
+ },
+};
+"
+`;
+
+exports[`loaders transforms correctly using "loaders-5" data 1`] = `
+"module.exports = {
+ module: {
+ rules: [{
+ use: [{
+ loader: 'babel-loader'
+ }],
+ test: /\\\\.js$/,
+ }, {
+ use: [{
+ loader: 'eslint-loader'
+ }],
+
+ test: /\\\\.js$/,
+ enforce: 'pre'
+ }]
+ },
+};
+"
+`;
+
+exports[`loaders transforms correctly using "loaders-6" data 1`] = `
+"module.exports = {
+ module: {
+ rules: [{
+ use: [{
+ loader: 'babel-loader'
+ }],
+ test: /\\\\.js$/,
+ }, {
+ use: [{
+ loader: 'my-post-loader'
+ }],
+
+ test: /\\\\.js$/,
+ enforce: 'post'
+ }]
+ },
+};
+"
+`;
+
+exports[`loaders transforms correctly using "loaders-7" data 1`] = `
+"module.exports = {
+ module: {
+ rules: [
+ {
+ exclude: /(node_modules)/,
+
+ use: [{
+ loader: 'babel-loader',
+
+ options: {
+ presets: [\\"@babel/preset-env\\"],
+ }
+ }],
+
+ test: /\\\\.js$/
+ },
+ ],
+ },
+};
+"
+`;
+
+exports[`loaders transforms correctly using "loaders-8" data 1`] = `
+"module.exports = {
+ module: {
+ rules: [
+ {
+ include: path.join(__dirname, \\"src\\"),
+ use: [{
+ loader: 'style-loader'
+ }, {
+ loader: 'css-loader',
+
+ options: {
+ modules: true,
+ importLoaders: 1,
+ string: 'test123'
+ }
+ }],
+ test: /\\\\.js$/
+ }
+ ]
+ }
+};
+"
+`;
diff --git a/packages/migrate/loaders/__tests__/__testfixtures__/loaders-0.input.js b/packages/migrate/loaders/__tests__/__testfixtures__/loaders-0.input.js
new file mode 100644
index 00000000000..e58bb6f88ef
--- /dev/null
+++ b/packages/migrate/loaders/__tests__/__testfixtures__/loaders-0.input.js
@@ -0,0 +1,94 @@
+module.exports = [
+ {
+ module: {
+ loaders: [
+ {
+ loader: "babel",
+ test: /\.js$/,
+ },
+ ],
+ },
+ },
+ {
+ module: {
+ loaders: [
+ {
+ loader: "style!css?modules&importLoaders=1&string=test123",
+ test: /\.css$/,
+ },
+ ],
+ },
+ },
+ {
+ module: {
+ loaders: [
+ {
+ loaders: [
+ {
+ loader: "style",
+ },
+ {
+ loader: "css",
+ query: {
+ modules: true,
+ },
+ },
+ ],
+ test: /\.css$/,
+ },
+ ],
+ },
+ },
+ {
+ module: {
+ preLoaders: [
+ {
+ loader: "eslint",
+ test: /\.js$/,
+ },
+ ],
+ },
+ },
+ {
+ module: {
+ postLoaders: [
+ {
+ loader: "my-post",
+ test: /\.js$/,
+ },
+ ],
+ },
+ },
+ {
+ module: {
+ loaders: [
+ {
+ loader: "babel-loader",
+ test: /\.js$/,
+ },
+ ],
+ preLoaders: [
+ {
+ loader: "eslint-loader",
+ test: /\.js$/,
+ },
+ ],
+ },
+ },
+ {
+ module: {
+ loaders: [
+ {
+ loader: "babel-loader",
+ test: /\.js$/,
+ },
+ ],
+ postLoaders: [
+ {
+ loader: "my-post-loader",
+ test: /\.js$/,
+ },
+ ],
+ },
+ },
+];
diff --git a/packages/migrate/loaders/__tests__/__testfixtures__/loaders-1.input.js b/packages/migrate/loaders/__tests__/__testfixtures__/loaders-1.input.js
new file mode 100644
index 00000000000..0662abea05e
--- /dev/null
+++ b/packages/migrate/loaders/__tests__/__testfixtures__/loaders-1.input.js
@@ -0,0 +1,10 @@
+module.exports = {
+ module: {
+ loaders: [
+ {
+ loader: "style!css?modules&importLoaders=1&string=test123",
+ test: /\.css$/,
+ },
+ ],
+ },
+};
diff --git a/packages/migrate/loaders/__tests__/__testfixtures__/loaders-2.input.js b/packages/migrate/loaders/__tests__/__testfixtures__/loaders-2.input.js
new file mode 100644
index 00000000000..388182d1d9e
--- /dev/null
+++ b/packages/migrate/loaders/__tests__/__testfixtures__/loaders-2.input.js
@@ -0,0 +1,20 @@
+module.exports = {
+ module: {
+ loaders: [
+ {
+ loaders: [
+ {
+ loader: "style",
+ },
+ {
+ loader: "css",
+ query: {
+ modules: true,
+ },
+ },
+ ],
+ test: /\.css$/,
+ },
+ ],
+ },
+};
diff --git a/packages/migrate/loaders/__tests__/__testfixtures__/loaders-3.input.js b/packages/migrate/loaders/__tests__/__testfixtures__/loaders-3.input.js
new file mode 100644
index 00000000000..cef7c100bb7
--- /dev/null
+++ b/packages/migrate/loaders/__tests__/__testfixtures__/loaders-3.input.js
@@ -0,0 +1,10 @@
+module.exports = {
+ module: {
+ preLoaders: [
+ {
+ loader: "eslint",
+ test: /\.js$/,
+ },
+ ],
+ },
+};
diff --git a/packages/migrate/loaders/__tests__/__testfixtures__/loaders-4.input.js b/packages/migrate/loaders/__tests__/__testfixtures__/loaders-4.input.js
new file mode 100644
index 00000000000..863f7acb499
--- /dev/null
+++ b/packages/migrate/loaders/__tests__/__testfixtures__/loaders-4.input.js
@@ -0,0 +1,10 @@
+module.exports = {
+ module: {
+ postLoaders: [
+ {
+ loader: "my-post",
+ test: /\.js$/,
+ },
+ ],
+ },
+};
diff --git a/packages/migrate/loaders/__tests__/__testfixtures__/loaders-5.input.js b/packages/migrate/loaders/__tests__/__testfixtures__/loaders-5.input.js
new file mode 100644
index 00000000000..63758597dcf
--- /dev/null
+++ b/packages/migrate/loaders/__tests__/__testfixtures__/loaders-5.input.js
@@ -0,0 +1,17 @@
+module.exports = {
+ module: {
+ loaders: [
+ {
+ loader: "babel-loader",
+ test: /\.js$/,
+ },
+ ],
+
+ preLoaders: [
+ {
+ loader: "eslint-loader",
+ test: /\.js$/,
+ },
+ ],
+ },
+};
diff --git a/packages/migrate/loaders/__tests__/__testfixtures__/loaders-6.input.js b/packages/migrate/loaders/__tests__/__testfixtures__/loaders-6.input.js
new file mode 100644
index 00000000000..405e508e2d7
--- /dev/null
+++ b/packages/migrate/loaders/__tests__/__testfixtures__/loaders-6.input.js
@@ -0,0 +1,16 @@
+module.exports = {
+ module: {
+ loaders: [
+ {
+ loader: "babel-loader",
+ test: /\.js$/,
+ },
+ ],
+ postLoaders: [
+ {
+ loader: "my-post-loader",
+ test: /\.js$/,
+ },
+ ],
+ },
+};
diff --git a/packages/migrate/loaders/__tests__/__testfixtures__/loaders-7.input.js b/packages/migrate/loaders/__tests__/__testfixtures__/loaders-7.input.js
new file mode 100644
index 00000000000..40c46492632
--- /dev/null
+++ b/packages/migrate/loaders/__tests__/__testfixtures__/loaders-7.input.js
@@ -0,0 +1,14 @@
+module.exports = {
+ module: {
+ loaders: [
+ {
+ exclude: /(node_modules)/,
+ loader: "babel-loader",
+ query: {
+ presets: ["@babel/preset-env"],
+ },
+ test: /\.js$/,
+ },
+ ],
+ },
+};
diff --git a/packages/migrate/loaders/__tests__/__testfixtures__/loaders-8.input.js b/packages/migrate/loaders/__tests__/__testfixtures__/loaders-8.input.js
new file mode 100644
index 00000000000..1be3161d4b7
--- /dev/null
+++ b/packages/migrate/loaders/__tests__/__testfixtures__/loaders-8.input.js
@@ -0,0 +1,11 @@
+module.exports = {
+ module: {
+ loaders: [
+ {
+ include: path.join(__dirname, "src"),
+ loaders: ["style", "css?modules&importLoaders=1&string=test123"],
+ test: /\.js$/
+ }
+ ]
+ }
+};
diff --git a/packages/migrate/loaders/__tests__/__testfixtures__/loaders-9.input.js b/packages/migrate/loaders/__tests__/__testfixtures__/loaders-9.input.js
new file mode 100644
index 00000000000..d100038d9a6
--- /dev/null
+++ b/packages/migrate/loaders/__tests__/__testfixtures__/loaders-9.input.js
@@ -0,0 +1,14 @@
+module.exports = {
+ module: {
+ loaders: [
+ {
+ loader: "url-loader",
+ options: {
+ limit: 10000,
+ name: "static/media/[name].[hash:8].[ext]",
+ },
+ test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
+ },
+ ],
+ },
+};
diff --git a/packages/migrate/loaders/__tests__/loaders.test.ts b/packages/migrate/loaders/__tests__/loaders.test.ts
new file mode 100644
index 00000000000..052103e79ef
--- /dev/null
+++ b/packages/migrate/loaders/__tests__/loaders.test.ts
@@ -0,0 +1,14 @@
+import defineTest from "@webpack-cli/utils/defineTest";
+import { join } from "path";
+
+const dirName: string = join(__dirname, "..");
+
+defineTest(dirName, "loaders", "loaders-0");
+defineTest(dirName, "loaders", "loaders-1");
+defineTest(dirName, "loaders", "loaders-2");
+defineTest(dirName, "loaders", "loaders-3");
+defineTest(dirName, "loaders", "loaders-4");
+defineTest(dirName, "loaders", "loaders-5");
+defineTest(dirName, "loaders", "loaders-6");
+defineTest(dirName, "loaders", "loaders-7");
+defineTest(dirName, "loaders", "loaders-8");
diff --git a/packages/migrate/loaders/loaders.test.js b/packages/migrate/loaders/loaders.test.js
deleted file mode 100644
index 4dc548b6bc3..00000000000
--- a/packages/migrate/loaders/loaders.test.js
+++ /dev/null
@@ -1,13 +0,0 @@
-"use strict";
-
-const defineTest = require("@webpack-cli/utils/defineTest").default;
-
-defineTest(__dirname, "loaders", "loaders-0");
-defineTest(__dirname, "loaders", "loaders-1");
-defineTest(__dirname, "loaders", "loaders-2");
-defineTest(__dirname, "loaders", "loaders-3");
-defineTest(__dirname, "loaders", "loaders-4");
-defineTest(__dirname, "loaders", "loaders-5");
-defineTest(__dirname, "loaders", "loaders-6");
-defineTest(__dirname, "loaders", "loaders-7");
-defineTest(__dirname, "loaders", "loaders-8");
diff --git a/packages/migrate/loaders/loaders.ts b/packages/migrate/loaders/loaders.ts
index e3b5b920fbb..0f5452c2ac1 100644
--- a/packages/migrate/loaders/loaders.ts
+++ b/packages/migrate/loaders/loaders.ts
@@ -1,6 +1,6 @@
import * as utils from "@webpack-cli/utils/ast-utils";
-import { IJSCodeshift, INode } from "../types/NodePath";
+import { JSCodeshift, Node } from "../types/NodePath";
/**
*
@@ -13,7 +13,7 @@ import { IJSCodeshift, INode } from "../types/NodePath";
* @returns {Node} ast - jscodeshift ast
*/
-export default function(j: IJSCodeshift, ast: INode): INode {
+export default function(j: JSCodeshift, ast: Node): Node {
/**
* Creates an Array expression out of loaders string
*
@@ -54,46 +54,46 @@ export default function(j: IJSCodeshift, ast: INode): INode {
* @returns {Node} path - object expression ast with array expression instead of loaders string
*/
- const createArrayExpressionFromArray = (path: INode): INode => {
- const value: INode = path.value;
+ const createArrayExpressionFromArray = (path: Node): Node => {
+ const value: Node = (path.value as Node);
// Find paths with `loaders` keys in the given Object
- const paths: INode[] = value.properties.filter((prop: INode): boolean =>
- prop.key.name.startsWith("loader"),
- );
+ const paths: Node[] = value.properties.filter((prop: Node): boolean => prop.key.name.startsWith("loader"));
// For each pair of key and value
- paths.forEach((pair: INode): void => {
- // Replace 'loaders' Identifier with 'use'
- pair.key.name = "use";
- // If the value is an Array
- if (pair.value.type === j.ArrayExpression.name) {
- // replace its elements
- const pairValue: INode = pair.value;
- pair.value = j.arrayExpression(
- pairValue.elements.map((arrElement: INode): INode => {
- // If items of the array are Strings
- if (arrElement.type === j.Literal.name) {
- // Replace with `{ loader: LOADER }` Object
- return j.objectExpression([
- utils.createProperty(j, "loader", arrElement.value),
- ]);
- }
- // otherwise keep the existing element
- return arrElement;
- }),
- );
- // If the value is String of loaders like 'style!css'
- } else if (pair.value.type === j.Literal.name) {
- // Replace it with Array expression of loaders
- const literalValue: INode = pair.value;
- pair.value = j.arrayExpression(
- literalValue.value.split("!").map((loader: string): INode => {
- return j.objectExpression([
- utils.createProperty(j, "loader", loader),
- ]);
- }),
- );
+ paths.forEach(
+ (pair: Node): void => {
+ // Replace 'loaders' Identifier with 'use'
+ pair.key.name = "use";
+ // If the value is an Array
+ if ((pair.value as Node).type === j.ArrayExpression.name) {
+ // replace its elements
+ const pairValue = pair.value as Node;
+ pair.value = j.arrayExpression(
+ pairValue.elements.map(
+ (arrElement: Node): Node => {
+ // If items of the array are Strings
+ if (arrElement.type === j.Literal.name) {
+ // Replace with `{ loader: LOADER }` Object
+ return j.objectExpression([utils.createProperty(j, "loader", (arrElement.value as Node))]);
+ }
+ // otherwise keep the existing element
+ return arrElement;
+ }
+ )
+ );
+ // If the value is String of loaders like 'style!css'
+ } else if ((pair.value as Node).type === j.Literal.name) {
+ // Replace it with Array expression of loaders
+ const literalValue = pair.value as Node;
+ pair.value = j.arrayExpression(
+ (literalValue.value as string).split("!").map(
+ (loader: string): Node => {
+ return j.objectExpression([utils.createProperty(j, "loader", loader)]);
+ }
+ )
+ );
+ }
}
- });
+ );
return path;
};
@@ -105,26 +105,24 @@ export default function(j: IJSCodeshift, ast: INode): INode {
* @returns {Node} objectExpression - an new object expression ast containing the query parameters
*/
- const createLoaderWithQuery = (p: INode): INode => {
- const properties: INode[] = p.value.properties;
+ const createLoaderWithQuery = (p: Node): Node => {
+ const properties: Node[] = (p.value as Node).properties;
const loaderValue: string = properties.reduce(
- (val: string, prop: INode): string => (prop.key.name === "loader" ? prop.value.value : val),
- "",
+ (val: string, prop: Node): string => (prop.key.name === "loader" ? (prop.value as Node).value as string: val),
+ ""
);
const loader: string = loaderValue.split("?")[0];
const query: string = loaderValue.split("?")[1];
- const options: INode[] = query.split("&").map((option: string): INode => {
- const param: string[] = option.split("=");
- const key: string = param[0];
- const val: string | boolean = param[1] || true; // No value in query string means it is truthy value
- return j.objectProperty(j.identifier(key), utils.createLiteral(j, val));
- });
- const loaderProp: INode = utils.createProperty(j, "loader", loader);
- const queryProp: INode = j.property(
- "init",
- j.identifier("options"),
- j.objectExpression(options),
+ const options: Node[] = query.split("&").map(
+ (option: string): Node => {
+ const param: string[] = option.split("=");
+ const key: string = param[0];
+ const val: string | boolean = param[1] || true; // No value in query string means it is truthy value
+ return j.objectProperty(j.identifier(key), utils.createLiteral(j, val));
+ }
);
+ const loaderProp: Node = utils.createProperty(j, "loader", loader);
+ const queryProp: Node = j.property("init", j.identifier("options"), j.objectExpression(options));
return j.objectExpression([loaderProp, queryProp]);
};
@@ -136,11 +134,10 @@ export default function(j: IJSCodeshift, ast: INode): INode {
* @returns {Boolean} hasLoaderQueryString - whether the loader object contains a query string
*/
- const findLoaderWithQueryString = (p: INode): boolean => {
- return p.value.properties.reduce((predicate: boolean, prop: INode): boolean => {
+ const findLoaderWithQueryString = (p: Node): boolean => {
+ return (p.value as Node).properties.reduce((predicate: boolean, prop: Node): boolean => {
return (
- (utils.safeTraverse(prop, ["value", "value", "indexOf"]) &&
- prop.value.value.indexOf("?") > -1) ||
+ (utils.safeTraverse(prop, ["value", "value", "indexOf"]) && ((prop.value as Node).value as string).indexOf("?") > -1) ||
predicate
);
}, false);
@@ -155,16 +152,9 @@ export default function(j: IJSCodeshift, ast: INode): INode {
* @returns {Boolean} isLoadersProp - whether the identifier is the `loaders` prop in the `module` object
*/
- const checkForLoader = (path: INode): boolean =>
- path.value.name === "loaders" &&
- utils.safeTraverse(path, [
- "parent",
- "parent",
- "parent",
- "node",
- "key",
- "name",
- ]) === "module";
+ const checkForLoader = (path: Node): boolean =>
+ (path.value as Node).name === "loaders" &&
+ utils.safeTraverse(path, ["parent", "parent", "parent", "node", "key", "name"]) === "module";
/**
* Puts pre- or postLoader into `loaders` object and adds the appropriate `enforce` property
@@ -173,32 +163,36 @@ export default function(j: IJSCodeshift, ast: INode): INode {
* @returns {Node} p - object expression with a `loaders` object and appropriate `enforce` properties
*/
- const fitIntoLoaders = (p: INode): INode => {
- let loaders: INode = null;
- p.value.properties.map((prop: INode): void => {
- const keyName = prop.key.name;
- if (keyName === "loaders") {
- loaders = prop.value;
+ const fitIntoLoaders = (p: Node): Node => {
+ let loaders: Node = null;
+ (p.value as Node).properties.map(
+ (prop: Node): void => {
+ const keyName = prop.key.name;
+ if (keyName === "loaders") {
+ loaders = prop.value as Node;
+ }
}
- });
- p.value.properties.map((prop: INode): void => {
- const keyName = prop.key.name;
- if (keyName !== "loaders") {
- const enforceVal: string = keyName === "preLoaders" ? "pre" : "post";
- prop.value.elements.map((elem: INode): void => {
- elem.properties.push(utils.createProperty(j, "enforce", enforceVal));
- if (loaders && loaders.type === "ArrayExpression") {
- loaders.elements.push(elem);
- } else {
- prop.key.name = "loaders";
- }
- });
+ );
+ (p.value as Node).properties.map(
+ (prop: Node): void => {
+ const keyName = prop.key.name;
+ if (keyName !== "loaders") {
+ const enforceVal: string = keyName === "preLoaders" ? "pre" : "post";
+ (prop.value as Node).elements.map(
+ (elem: Node): void => {
+ elem.properties.push(utils.createProperty(j, "enforce", enforceVal));
+ if (loaders && loaders.type === "ArrayExpression") {
+ loaders.elements.push(elem);
+ } else {
+ prop.key.name = "loaders";
+ }
+ }
+ );
+ }
}
- });
+ );
if (loaders) {
- p.value.properties = p.value.properties.filter(
- (prop: INode): boolean => prop.key.name === "loaders",
- );
+ (p.value as Node).properties = (p.value as Node).properties.filter((prop: Node): boolean => prop.key.name === "loaders");
}
return p;
};
@@ -209,10 +203,10 @@ export default function(j: IJSCodeshift, ast: INode): INode {
* @returns {Node} ast - jscodeshift ast
*/
- const prepostLoaders = (_?: void): INode =>
+ const prepostLoaders = (): Node =>
ast
.find(j.ObjectExpression)
- .filter((p: INode): boolean => utils.findObjWithOneOfKeys(p, ["preLoaders", "postLoaders"]))
+ .filter((p: Node): boolean => utils.findObjWithOneOfKeys(p, ["preLoaders", "postLoaders"]))
.forEach(fitIntoLoaders);
/**
@@ -221,11 +215,11 @@ export default function(j: IJSCodeshift, ast: INode): INode {
* @returns {Node} ast - jscodeshift ast
*/
- const loadersToRules = (_?: void): INode =>
+ const loadersToRules = (): Node =>
ast
.find(j.Identifier)
.filter(checkForLoader)
- .forEach((p: INode): string => (p.value.name = "rules"));
+ .forEach((p: Node): string => ((p.value as Node).name = "rules"));
/**
* Convert `loader` and `loaders` to Array of {Rule.Use}
@@ -233,19 +227,13 @@ export default function(j: IJSCodeshift, ast: INode): INode {
* @returns {Node} ast - jscodeshift ast
*/
- const loadersToArrayExpression = (_?: void): INode | void =>
+ const loadersToArrayExpression = (): Node | void =>
ast
.find(j.ObjectExpression)
- .filter((path: INode): boolean => utils.findObjWithOneOfKeys(path, ["loader", "loaders"]))
+ .filter((path: Node): boolean => utils.findObjWithOneOfKeys(path, ["loader", "loaders"]))
.filter(
- (path: INode): boolean =>
- utils.safeTraverse(path, [
- "parent",
- "parent",
- "node",
- "key",
- "name",
- ]) === "rules",
+ (path: Node): boolean =>
+ utils.safeTraverse(path, ["parent", "parent", "node", "key", "name"]) === "rules"
)
.forEach(createArrayExpressionFromArray);
@@ -271,10 +259,10 @@ export default function(j: IJSCodeshift, ast: INode): INode {
* @returns {Node} ast - jscodeshift ast
*/
- const loaderWithQueryParam = (_?: void): INode =>
+ const loaderWithQueryParam = (): Node =>
ast
.find(j.ObjectExpression)
- .filter((p: INode): boolean => utils.findObjWithOneOfKeys(p, ["loader"]))
+ .filter((p: Node): boolean => utils.findObjWithOneOfKeys(p, ["loader"]))
.filter(findLoaderWithQueryString)
.replaceWith(createLoaderWithQuery);
@@ -295,10 +283,10 @@ export default function(j: IJSCodeshift, ast: INode): INode {
* @returns {Node} ast - jscodeshift ast
*/
- const loaderWithQueryProp = (_?: void): INode =>
+ const loaderWithQueryProp = (): Node =>
ast
.find(j.Identifier)
- .filter((p: INode): boolean => p.value.name === "query")
+ .filter((p: Node): boolean => (p.value as Node).name === "query")
.replaceWith(j.identifier("options"));
/**
@@ -308,18 +296,22 @@ export default function(j: IJSCodeshift, ast: INode): INode {
* @returns {Node} ast - jscodeshift ast
*/
- const addLoaderSuffix = (_?: void): INode =>
- ast.find(j.ObjectExpression).forEach((path: INode): void => {
- path.value.properties.forEach((prop: INode): void => {
- if (
- prop.key.name === "loader" &&
- utils.safeTraverse(prop, ["value", "value"]) &&
- !prop.value.value.endsWith("-loader")
- ) {
- prop.value = j.literal(prop.value.value + "-loader");
- }
- });
- });
+ const addLoaderSuffix = (): Node =>
+ ast.find(j.ObjectExpression).forEach(
+ (path: Node): void => {
+ (path.value as Node).properties.forEach(
+ (prop: Node): void => {
+ if (
+ prop.key.name === "loader" &&
+ utils.safeTraverse(prop, ["value", "value"]) &&
+ !((prop.value as Node).value as string).endsWith("-loader")
+ ) {
+ prop.value = j.literal((prop.value as Node).value as string + "-loader");
+ }
+ }
+ );
+ }
+ );
/**
*
@@ -329,26 +321,28 @@ export default function(j: IJSCodeshift, ast: INode): INode {
* @returns {Node} objectExpression - an use object expression ast containing the options and loader
*/
- const fitOptionsToUse = (p: INode): INode => {
- let options: INode = null;
- p.value.properties.forEach((prop: INode): void => {
- const keyName: string = prop.key.name;
- if (keyName === "options") {
- options = prop;
+ const fitOptionsToUse = (p: Node): Node => {
+ let options: Node = null;
+ (p.value as Node).properties.forEach(
+ (prop: Node): void => {
+ const keyName: string = prop.key.name;
+ if (keyName === "options") {
+ options = prop;
+ }
}
- });
+ );
if (options) {
- p.value.properties = p.value.properties.filter(
- (prop: INode): boolean => prop.key.name !== "options",
- );
+ (p.value as Node).properties = (p.value as Node).properties.filter((prop: Node): boolean => prop.key.name !== "options");
- p.value.properties.forEach((prop: INode): void => {
- const keyName = prop.key.name;
- if (keyName === "use") {
- prop.value.elements[0].properties.push(options);
+ (p.value as Node).properties.forEach(
+ (prop: Node): void => {
+ const keyName = prop.key.name;
+ if (keyName === "use") {
+ (prop.value as Node).elements[0].properties.push(options);
+ }
}
- });
+ );
}
return p;
@@ -360,10 +354,10 @@ export default function(j: IJSCodeshift, ast: INode): INode {
* @returns {Node} ast - jscodeshift ast
*/
- const moveOptionsToUse = (_?: void): INode =>
+ const moveOptionsToUse = (): Node =>
ast
.find(j.ObjectExpression)
- .filter((p: INode): boolean => utils.findObjWithOneOfKeys(p, ["use"]))
+ .filter((p: Node): boolean => utils.findObjWithOneOfKeys(p, ["use"]))
.forEach(fitOptionsToUse);
const transforms = [
@@ -373,7 +367,7 @@ export default function(j: IJSCodeshift, ast: INode): INode {
loaderWithQueryParam,
loaderWithQueryProp,
addLoaderSuffix,
- moveOptionsToUse,
+ moveOptionsToUse
];
transforms.forEach((t: Function): void => t());
diff --git a/packages/migrate/migrate.test.js b/packages/migrate/migrate.test.js
deleted file mode 100644
index 1ba4601cd11..00000000000
--- a/packages/migrate/migrate.test.js
+++ /dev/null
@@ -1,66 +0,0 @@
-"use strict";
-
-const transform = require("./migrate").transform;
-const transformations = require("./migrate").transformations;
-
-const input = `
-module.exports = {
- devtool: 'eval',
- entry: [
- './src/index'
- ],
- output: {
- path: path.join(__dirname, 'dist'),
- filename: 'index.js'
- },
- module: {
- loaders: [{
- test: /.js$/,
- loaders: ['babel'],
- include: path.join(__dirname, 'src')
- }]
- },
- resolve: {
- root: path.resolve('/src'),
- modules: ['node_modules']
- },
- plugins: [
- new webpack.optimize.UglifyJsPlugin(),
- new webpack.optimize.OccurrenceOrderPlugin()
- ],
- debug: true
-};
-`;
-
-describe("transform", () => {
- it("should not transform if no transformations defined", done => {
- transform(input, []).then(output => {
- expect(output).toMatchSnapshot(input);
- done();
- });
- });
-
- it("should transform using all transformations", done => {
- transform(input).then(output => {
- expect(output).toMatchSnapshot();
- done();
- });
- });
-
- it("should transform only using specified transformations", done => {
- transform(input, [transformations.loadersTransform]).then(output => {
- expect(output).toMatchSnapshot();
- done();
- });
- });
-
- it("should respect recast options", done => {
- transform(input, undefined, {
- quote: "double",
- trailingComma: true
- }).then(output => {
- expect(output).toMatchSnapshot();
- done();
- });
- });
-});
diff --git a/packages/migrate/migrate.ts b/packages/migrate/migrate.ts
index 6f85374fe92..bfed7bee56d 100644
--- a/packages/migrate/migrate.ts
+++ b/packages/migrate/migrate.ts
@@ -11,13 +11,12 @@ import noEmitOnErrorsPluginTransform from "./noEmitOnErrorsPlugin/noEmitOnErrors
import removeDeprecatedPluginsTransform from "./removeDeprecatedPlugins/removeDeprecatedPlugins";
import removeJsonLoaderTransform from "./removeJsonLoader/removeJsonLoader";
import resolveTransform from "./resolve/resolve";
-import { INode } from "./types/NodePath";
import uglifyJsPluginTransform from "./uglifyJsPlugin/uglifyJsPlugin";
-interface ITransformsObject {
+interface TransformsObject {
bannerPluginTransform: object;
commonsChunkPluginTransform?: object;
- extractTextPluginTransform: object; /* tslint:disable */
+ extractTextPluginTransform: object;
loaderOptionsPluginTransform: object;
loadersTransform: object;
noEmitOnErrorsPluginTransform: object;
@@ -27,8 +26,7 @@ interface ITransformsObject {
uglifyJsPluginTransform: object;
}
-/* tslint:disable object-literal-sort-keys */
-const transformsObject: ITransformsObject = {
+const transformsObject: TransformsObject = {
loadersTransform,
resolveTransform,
removeJsonLoaderTransform,
@@ -38,18 +36,21 @@ const transformsObject: ITransformsObject = {
extractTextPluginTransform,
noEmitOnErrorsPluginTransform,
removeDeprecatedPluginsTransform,
- commonsChunkPluginTransform,
+ commonsChunkPluginTransform
};
-/* tslint:enable object-literal-sort-keys */
-export const transformations =
- Object
- .keys(transformsObject)
- .reduce((res: object, key: string): object => {
- res[key] = (ast: object, source: string) =>
- transformSingleAST(ast, source, transformsObject[key]);
- return res;
- }, {});
+interface LazyTransformObject {
+ loadersTransform?: (ast: object, source: string) => pLazy<{}>;
+ resolveTransform?: (ast: object, source: string) => pLazy<{}>;
+ removeJsonLoaderTransform?: (ast: object, source: string) => pLazy<{}>;
+ uglifyJsPluginTransform?: (ast: object, source: string) => pLazy<{}>;
+ loaderOptionsPluginTransform?: (ast: object, source: string) => pLazy<{}>;
+ bannerPluginTransform?: (ast: object, source: string) => pLazy<{}>;
+ extractTextPluginTransform?: (ast: object, source: string) => pLazy<{}>;
+ noEmitOnErrorsPluginTransform?: (ast: object, source: string) => pLazy<{}>;
+ removeDeprecatedPluginsTransform?: (ast: object, source: string) => pLazy<{}>;
+ commonsChunkPluginTransform?: (ast: object, source: string) => pLazy<{}>;
+}
/**
*
@@ -65,23 +66,29 @@ export const transformations =
export const transformSingleAST = (
ast: object,
source: string,
- transformFunction: (jscodeshift: object, ast: object, source: string) => object)
- : pLazy<{}> => {
-
- return new pLazy((
- resolve: (value?: {} | PromiseLike<{}>) => void,
- reject: (reason?: object) => void,
- ): void => {
- setTimeout((_?: void): void => {
- try {
- resolve(transformFunction(jscodeshift, ast, source));
- } catch (err) {
- reject(err);
- }
- }, 0);
- });
+ transformFunction: (jscodeshift: object, ast: object, source: string) => object
+): pLazy<{}> => {
+ return new pLazy(
+ (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: object) => void): void => {
+ setTimeout((): void => {
+ try {
+ resolve(transformFunction(jscodeshift, ast, source));
+ } catch (err) {
+ reject(err);
+ }
+ }, 0);
+ }
+ );
};
+export const transformations: LazyTransformObject = Object.keys(transformsObject).reduce(
+ (res: object, key: string): LazyTransformObject => {
+ res[key] = (ast: object, source: string): object => transformSingleAST(ast, source, transformsObject[key]);
+ return res;
+ },
+ {}
+);
+
/**
*
* Transforms a given piece of source code by applying selected transformations to the AST.
@@ -98,24 +105,26 @@ export const transformSingleAST = (
export const transform = (
source: string,
transforms?: Iterable>,
- options?: object)
- : Promise => {
-
- const ast: INode = jscodeshift(source);
+ options?: object
+): Promise => {
+ const ast = jscodeshift(source);
const recastOptions: object = Object.assign(
{
- quote: "single",
+ quote: "single"
},
- options,
+ options
);
- transforms =
- transforms || Object.keys(transformations).map((k: string): Function => transformations[k]);
+ transforms = transforms || Object.keys(transformations).map((k: string): Function => transformations[k]);
- return pEachSeries(transforms, (f: Function) => f(ast, source))
- .then((value: Function[]): string | PromiseLike => {
- return ast.toSource(recastOptions);
- })
- .catch((err: object) => {
- console.error(err);
- });
+ return pEachSeries(transforms, (f: Function): void => f(ast, source))
+ .then(
+ (): string | PromiseLike => {
+ return ast.toSource(recastOptions);
+ }
+ )
+ .catch(
+ (err: object): void => {
+ console.error(err);
+ }
+ );
};
diff --git a/packages/migrate/moduleConcatenationPlugin/__testfixtures__/moduleConcatenationPlugin-0.input.js b/packages/migrate/moduleConcatenationPlugin/__testfixtures__/moduleConcatenationPlugin-0.input.js
deleted file mode 100644
index 2d78c6398e1..00000000000
--- a/packages/migrate/moduleConcatenationPlugin/__testfixtures__/moduleConcatenationPlugin-0.input.js
+++ /dev/null
@@ -1,5 +0,0 @@
-module.export = {
- plugins: [
- new webpack.optimize.ModuleConcatenationPlugin()
- ]
-}
diff --git a/packages/migrate/moduleConcatenationPlugin/__testfixtures__/moduleConcatenationPlugin-1.input.js b/packages/migrate/moduleConcatenationPlugin/__testfixtures__/moduleConcatenationPlugin-1.input.js
deleted file mode 100644
index cc81fd6b768..00000000000
--- a/packages/migrate/moduleConcatenationPlugin/__testfixtures__/moduleConcatenationPlugin-1.input.js
+++ /dev/null
@@ -1,9 +0,0 @@
-module.export = {
- optimizations: {
- splitChunks: false
- },
- plugins: [
- new Foo(),
- new webpack.optimize.ModuleConcatenationPlugin()
- ]
-}
diff --git a/packages/migrate/moduleConcatenationPlugin/__testfixtures__/moduleConcatenationPlugin-2.input.js b/packages/migrate/moduleConcatenationPlugin/__testfixtures__/moduleConcatenationPlugin-2.input.js
deleted file mode 100644
index eb80df14c9c..00000000000
--- a/packages/migrate/moduleConcatenationPlugin/__testfixtures__/moduleConcatenationPlugin-2.input.js
+++ /dev/null
@@ -1,9 +0,0 @@
-module.export = {
- optimizations: {
- concatenateModules: false
- },
- plugins: [
- new Foo(),
- new webpack.optimize.ModuleConcatenationPlugin()
- ]
-}
diff --git a/packages/migrate/moduleConcatenationPlugin/__snapshots__/moduleConcatenationPlugin.test.js.snap b/packages/migrate/moduleConcatenationPlugin/__tests__/__snapshots__/moduleConcatenationPlugin.test.ts.snap
similarity index 83%
rename from packages/migrate/moduleConcatenationPlugin/__snapshots__/moduleConcatenationPlugin.test.js.snap
rename to packages/migrate/moduleConcatenationPlugin/__tests__/__snapshots__/moduleConcatenationPlugin.test.ts.snap
index a13f37ea1f0..5a974551a29 100644
--- a/packages/migrate/moduleConcatenationPlugin/__snapshots__/moduleConcatenationPlugin.test.js.snap
+++ b/packages/migrate/moduleConcatenationPlugin/__tests__/__snapshots__/moduleConcatenationPlugin.test.ts.snap
@@ -1,31 +1,31 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`moduleConcatenationPlugin transforms correctly using "moduleConcatenationPlugin-0" data 1`] = `
-"module.export = {
+"module.exports = {
optimizations: {
concatenateModules: true
}
-}
+};
"
`;
exports[`moduleConcatenationPlugin transforms correctly using "moduleConcatenationPlugin-1" data 1`] = `
-"module.export = {
+"module.exports = {
optimizations: {
splitChunks: false,
concatenateModules: true
},
- plugins: [new Foo()]
-}
+ plugins: [new Foo()]
+};
"
`;
exports[`moduleConcatenationPlugin transforms correctly using "moduleConcatenationPlugin-2" data 1`] = `
-"module.export = {
+"module.exports = {
optimizations: {
concatenateModules: true
},
- plugins: [new Foo()]
-}
+ plugins: [new Foo()]
+};
"
`;
diff --git a/packages/migrate/moduleConcatenationPlugin/__tests__/__testfixtures__/moduleConcatenationPlugin-0.input.js b/packages/migrate/moduleConcatenationPlugin/__tests__/__testfixtures__/moduleConcatenationPlugin-0.input.js
new file mode 100644
index 00000000000..cd8dd6c0e65
--- /dev/null
+++ b/packages/migrate/moduleConcatenationPlugin/__tests__/__testfixtures__/moduleConcatenationPlugin-0.input.js
@@ -0,0 +1,3 @@
+module.exports = {
+ plugins: [new webpack.optimize.ModuleConcatenationPlugin()]
+};
diff --git a/packages/migrate/moduleConcatenationPlugin/__tests__/__testfixtures__/moduleConcatenationPlugin-1.input.js b/packages/migrate/moduleConcatenationPlugin/__tests__/__testfixtures__/moduleConcatenationPlugin-1.input.js
new file mode 100644
index 00000000000..4681fe01cb8
--- /dev/null
+++ b/packages/migrate/moduleConcatenationPlugin/__tests__/__testfixtures__/moduleConcatenationPlugin-1.input.js
@@ -0,0 +1,6 @@
+module.exports = {
+ optimizations: {
+ splitChunks: false
+ },
+ plugins: [new Foo(), new webpack.optimize.ModuleConcatenationPlugin()]
+};
diff --git a/packages/migrate/moduleConcatenationPlugin/__tests__/__testfixtures__/moduleConcatenationPlugin-2.input.js b/packages/migrate/moduleConcatenationPlugin/__tests__/__testfixtures__/moduleConcatenationPlugin-2.input.js
new file mode 100644
index 00000000000..1cae8402ad0
--- /dev/null
+++ b/packages/migrate/moduleConcatenationPlugin/__tests__/__testfixtures__/moduleConcatenationPlugin-2.input.js
@@ -0,0 +1,6 @@
+module.exports = {
+ optimizations: {
+ concatenateModules: false
+ },
+ plugins: [new Foo(), new webpack.optimize.ModuleConcatenationPlugin()]
+};
diff --git a/packages/migrate/moduleConcatenationPlugin/__tests__/moduleConcatenationPlugin.test.ts b/packages/migrate/moduleConcatenationPlugin/__tests__/moduleConcatenationPlugin.test.ts
new file mode 100644
index 00000000000..840dee420a2
--- /dev/null
+++ b/packages/migrate/moduleConcatenationPlugin/__tests__/moduleConcatenationPlugin.test.ts
@@ -0,0 +1,20 @@
+import defineTest from "@webpack-cli/utils/defineTest";
+import { join } from "path";
+
+const dirName: string = join(__dirname, "..");
+
+defineTest(
+ dirName,
+ "moduleConcatenationPlugin",
+ "moduleConcatenationPlugin-0",
+);
+defineTest(
+ dirName,
+ "moduleConcatenationPlugin",
+ "moduleConcatenationPlugin-1",
+);
+defineTest(
+ dirName,
+ "moduleConcatenationPlugin",
+ "moduleConcatenationPlugin-2",
+);
diff --git a/packages/migrate/moduleConcatenationPlugin/moduleConcatenationPlugin.test.js b/packages/migrate/moduleConcatenationPlugin/moduleConcatenationPlugin.test.js
deleted file mode 100644
index 9a895b1c50e..00000000000
--- a/packages/migrate/moduleConcatenationPlugin/moduleConcatenationPlugin.test.js
+++ /dev/null
@@ -1,19 +0,0 @@
-"use strict";
-
-const defineTest = require("@webpack-cli/utils/defineTest").default;
-
-defineTest(
- __dirname,
- "moduleConcatenationPlugin",
- "moduleConcatenationPlugin-0"
-);
-defineTest(
- __dirname,
- "moduleConcatenationPlugin",
- "moduleConcatenationPlugin-1"
-);
-defineTest(
- __dirname,
- "moduleConcatenationPlugin",
- "moduleConcatenationPlugin-2"
-);
diff --git a/packages/migrate/moduleConcatenationPlugin/moduleConcatenationPlugin.ts b/packages/migrate/moduleConcatenationPlugin/moduleConcatenationPlugin.ts
index 21750bc8663..658d2c1359f 100644
--- a/packages/migrate/moduleConcatenationPlugin/moduleConcatenationPlugin.ts
+++ b/packages/migrate/moduleConcatenationPlugin/moduleConcatenationPlugin.ts
@@ -1,9 +1,6 @@
-import {
- addOrUpdateConfigObject,
- findAndRemovePluginByName,
-} from "@webpack-cli/utils/ast-utils";
+import { addOrUpdateConfigObject, findAndRemovePluginByName } from "@webpack-cli/utils/ast-utils";
-import { IJSCodeshift, INode } from "../types/NodePath";
+import { JSCodeshift, Node } from "../types/NodePath";
/**
*
@@ -14,23 +11,13 @@ import { IJSCodeshift, INode } from "../types/NodePath";
* @param {Node} ast - jscodeshift ast to transform
* @returns {Node} ast - jscodeshift ast
*/
-export default function(j: IJSCodeshift, ast: INode): INode {
+export default function(j: JSCodeshift, ast: Node): Node {
// Remove old plugin
- const root: INode = findAndRemovePluginByName(
- j,
- ast,
- "webpack.optimize.ModuleConcatenationPlugin",
- );
+ const root: Node = findAndRemovePluginByName(j, ast, "webpack.optimize.ModuleConcatenationPlugin");
// Add new optimizations option
if (root) {
- addOrUpdateConfigObject(
- j,
- root,
- "optimizations",
- "concatenateModules",
- j.booleanLiteral(true),
- );
+ addOrUpdateConfigObject(j, root, "optimizations", "concatenateModules", j.booleanLiteral(true));
}
return ast;
diff --git a/packages/migrate/namedModulesPlugin/__snapshots__/namedModulesPlugin.test.js.snap b/packages/migrate/namedModulesPlugin/__tests__/__snapshots__/namedModulesPlugin.test.ts.snap
similarity index 100%
rename from packages/migrate/namedModulesPlugin/__snapshots__/namedModulesPlugin.test.js.snap
rename to packages/migrate/namedModulesPlugin/__tests__/__snapshots__/namedModulesPlugin.test.ts.snap
diff --git a/packages/migrate/namedModulesPlugin/__testfixtures__/namedModulesPlugin-0.input.js b/packages/migrate/namedModulesPlugin/__tests__/__testfixtures__/namedModulesPlugin-0.input.js
similarity index 100%
rename from packages/migrate/namedModulesPlugin/__testfixtures__/namedModulesPlugin-0.input.js
rename to packages/migrate/namedModulesPlugin/__tests__/__testfixtures__/namedModulesPlugin-0.input.js
diff --git a/packages/migrate/namedModulesPlugin/__testfixtures__/namedModulesPlugin-1.input.js b/packages/migrate/namedModulesPlugin/__tests__/__testfixtures__/namedModulesPlugin-1.input.js
similarity index 100%
rename from packages/migrate/namedModulesPlugin/__testfixtures__/namedModulesPlugin-1.input.js
rename to packages/migrate/namedModulesPlugin/__tests__/__testfixtures__/namedModulesPlugin-1.input.js
diff --git a/packages/migrate/namedModulesPlugin/__testfixtures__/namedModulesPlugin-2.input.js b/packages/migrate/namedModulesPlugin/__tests__/__testfixtures__/namedModulesPlugin-2.input.js
similarity index 100%
rename from packages/migrate/namedModulesPlugin/__testfixtures__/namedModulesPlugin-2.input.js
rename to packages/migrate/namedModulesPlugin/__tests__/__testfixtures__/namedModulesPlugin-2.input.js
diff --git a/packages/migrate/namedModulesPlugin/__tests__/namedModulesPlugin.test.ts b/packages/migrate/namedModulesPlugin/__tests__/namedModulesPlugin.test.ts
new file mode 100644
index 00000000000..ed0ffe9d7d3
--- /dev/null
+++ b/packages/migrate/namedModulesPlugin/__tests__/namedModulesPlugin.test.ts
@@ -0,0 +1,8 @@
+import defineTest from "@webpack-cli/utils/defineTest";
+import { join } from "path";
+
+const dirName: string = join(__dirname, "..");
+
+defineTest(dirName, "namedModulesPlugin", "namedModulesPlugin-0");
+defineTest(dirName, "namedModulesPlugin", "namedModulesPlugin-1");
+defineTest(dirName, "namedModulesPlugin", "namedModulesPlugin-2");
diff --git a/packages/migrate/namedModulesPlugin/namedModulesPlugin.test.js b/packages/migrate/namedModulesPlugin/namedModulesPlugin.test.js
deleted file mode 100644
index b0a0b14969a..00000000000
--- a/packages/migrate/namedModulesPlugin/namedModulesPlugin.test.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-const defineTest = require("@webpack-cli/utils/defineTest").default;
-
-defineTest(__dirname, "namedModulesPlugin", "namedModulesPlugin-0");
-defineTest(__dirname, "namedModulesPlugin", "namedModulesPlugin-1");
-defineTest(__dirname, "namedModulesPlugin", "namedModulesPlugin-2");
diff --git a/packages/migrate/namedModulesPlugin/namedModulesPlugin.ts b/packages/migrate/namedModulesPlugin/namedModulesPlugin.ts
index 98c7e2ceb9c..34faab3cd4b 100644
--- a/packages/migrate/namedModulesPlugin/namedModulesPlugin.ts
+++ b/packages/migrate/namedModulesPlugin/namedModulesPlugin.ts
@@ -1,9 +1,6 @@
-import {
- addOrUpdateConfigObject,
- findAndRemovePluginByName,
-} from "@webpack-cli/utils/ast-utils";
+import { addOrUpdateConfigObject, findAndRemovePluginByName } from "@webpack-cli/utils/ast-utils";
-import { IJSCodeshift, INode } from "../types/NodePath";
+import { JSCodeshift, Node } from "../types/NodePath";
/**
*
@@ -14,19 +11,13 @@ import { IJSCodeshift, INode } from "../types/NodePath";
* @param {Node} ast - jscodeshift ast to transform
* @returns {Node} ast - jscodeshift ast
*/
-export default function(j: IJSCodeshift, ast: INode): INode {
+export default function(j: JSCodeshift, ast: Node): Node {
// Remove old plugin
- const root: INode = findAndRemovePluginByName(j, ast, "webpack.NamedModulesPlugin");
+ const root: Node = findAndRemovePluginByName(j, ast, "webpack.NamedModulesPlugin");
// Add new optimizations option
if (root) {
- addOrUpdateConfigObject(
- j,
- root,
- "optimizations",
- "namedModules",
- j.booleanLiteral(true),
- );
+ addOrUpdateConfigObject(j, root, "optimizations", "namedModules", j.booleanLiteral(true));
}
return ast;
diff --git a/packages/migrate/noEmitOnErrorsPlugin/__testfixtures__/noEmitOnErrorsPlugin-0.input.js b/packages/migrate/noEmitOnErrorsPlugin/__testfixtures__/noEmitOnErrorsPlugin-0.input.js
deleted file mode 100644
index 040e6e057e4..00000000000
--- a/packages/migrate/noEmitOnErrorsPlugin/__testfixtures__/noEmitOnErrorsPlugin-0.input.js
+++ /dev/null
@@ -1,5 +0,0 @@
-module.export = {
- plugins: [
- new webpack.NoEmitOnErrorsPlugin()
- ]
-}
diff --git a/packages/migrate/noEmitOnErrorsPlugin/__testfixtures__/noEmitOnErrorsPlugin-1.input.js b/packages/migrate/noEmitOnErrorsPlugin/__testfixtures__/noEmitOnErrorsPlugin-1.input.js
deleted file mode 100644
index a194920c60a..00000000000
--- a/packages/migrate/noEmitOnErrorsPlugin/__testfixtures__/noEmitOnErrorsPlugin-1.input.js
+++ /dev/null
@@ -1,9 +0,0 @@
-module.export = {
- optimizations: {
- splitChunks: false
- },
- plugins: [
- new Foo(),
- new webpack.NoEmitOnErrorsPlugin()
- ]
-}
diff --git a/packages/migrate/noEmitOnErrorsPlugin/__testfixtures__/noEmitOnErrorsPlugin-2.input.js b/packages/migrate/noEmitOnErrorsPlugin/__testfixtures__/noEmitOnErrorsPlugin-2.input.js
deleted file mode 100644
index d320a16507a..00000000000
--- a/packages/migrate/noEmitOnErrorsPlugin/__testfixtures__/noEmitOnErrorsPlugin-2.input.js
+++ /dev/null
@@ -1,9 +0,0 @@
-module.export = {
- optimizations: {
- noEmitOnErrors: false
- },
- plugins: [
- new Foo(),
- new webpack.NoEmitOnErrorsPlugin()
- ]
-}
diff --git a/packages/migrate/noEmitOnErrorsPlugin/__snapshots__/noEmitOnErrorsPlugin.test.js.snap b/packages/migrate/noEmitOnErrorsPlugin/__tests__/__snapshots__/noEmitOnErrorsPlugin.test.ts.snap
similarity index 82%
rename from packages/migrate/noEmitOnErrorsPlugin/__snapshots__/noEmitOnErrorsPlugin.test.js.snap
rename to packages/migrate/noEmitOnErrorsPlugin/__tests__/__snapshots__/noEmitOnErrorsPlugin.test.ts.snap
index b831648670e..6febeb7012a 100644
--- a/packages/migrate/noEmitOnErrorsPlugin/__snapshots__/noEmitOnErrorsPlugin.test.js.snap
+++ b/packages/migrate/noEmitOnErrorsPlugin/__tests__/__snapshots__/noEmitOnErrorsPlugin.test.ts.snap
@@ -1,31 +1,31 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`noEmitOnErrorsPlugin transforms correctly using "noEmitOnErrorsPlugin-0" data 1`] = `
-"module.export = {
+"module.exports = {
optimizations: {
noEmitOnErrors: true
}
-}
+};
"
`;
exports[`noEmitOnErrorsPlugin transforms correctly using "noEmitOnErrorsPlugin-1" data 1`] = `
-"module.export = {
+"module.exports = {
optimizations: {
splitChunks: false,
noEmitOnErrors: true
},
- plugins: [new Foo()]
-}
+ plugins: [new Foo()]
+};
"
`;
exports[`noEmitOnErrorsPlugin transforms correctly using "noEmitOnErrorsPlugin-2" data 1`] = `
-"module.export = {
+"module.exports = {
optimizations: {
noEmitOnErrors: true
},
- plugins: [new Foo()]
-}
+ plugins: [new Foo()]
+};
"
`;
diff --git a/packages/migrate/noEmitOnErrorsPlugin/__tests__/__testfixtures__/noEmitOnErrorsPlugin-0.input.js b/packages/migrate/noEmitOnErrorsPlugin/__tests__/__testfixtures__/noEmitOnErrorsPlugin-0.input.js
new file mode 100644
index 00000000000..7eb2fa30679
--- /dev/null
+++ b/packages/migrate/noEmitOnErrorsPlugin/__tests__/__testfixtures__/noEmitOnErrorsPlugin-0.input.js
@@ -0,0 +1,3 @@
+module.exports = {
+ plugins: [new webpack.NoEmitOnErrorsPlugin()]
+};
diff --git a/packages/migrate/noEmitOnErrorsPlugin/__tests__/__testfixtures__/noEmitOnErrorsPlugin-1.input.js b/packages/migrate/noEmitOnErrorsPlugin/__tests__/__testfixtures__/noEmitOnErrorsPlugin-1.input.js
new file mode 100644
index 00000000000..9d409eb31d0
--- /dev/null
+++ b/packages/migrate/noEmitOnErrorsPlugin/__tests__/__testfixtures__/noEmitOnErrorsPlugin-1.input.js
@@ -0,0 +1,6 @@
+module.exports = {
+ optimizations: {
+ splitChunks: false
+ },
+ plugins: [new Foo(), new webpack.NoEmitOnErrorsPlugin()]
+};
diff --git a/packages/migrate/noEmitOnErrorsPlugin/__tests__/__testfixtures__/noEmitOnErrorsPlugin-2.input.js b/packages/migrate/noEmitOnErrorsPlugin/__tests__/__testfixtures__/noEmitOnErrorsPlugin-2.input.js
new file mode 100644
index 00000000000..b30145bcc85
--- /dev/null
+++ b/packages/migrate/noEmitOnErrorsPlugin/__tests__/__testfixtures__/noEmitOnErrorsPlugin-2.input.js
@@ -0,0 +1,6 @@
+module.exports = {
+ optimizations: {
+ noEmitOnErrors: false
+ },
+ plugins: [new Foo(), new webpack.NoEmitOnErrorsPlugin()]
+};
diff --git a/packages/migrate/noEmitOnErrorsPlugin/__tests__/noEmitOnErrorsPlugin.test.ts b/packages/migrate/noEmitOnErrorsPlugin/__tests__/noEmitOnErrorsPlugin.test.ts
new file mode 100644
index 00000000000..760a5a1aa75
--- /dev/null
+++ b/packages/migrate/noEmitOnErrorsPlugin/__tests__/noEmitOnErrorsPlugin.test.ts
@@ -0,0 +1,20 @@
+import defineTest from "@webpack-cli/utils/defineTest";
+import { join } from "path";
+
+const dirName: string = join(__dirname, "..");
+
+defineTest(
+ dirName,
+ "noEmitOnErrorsPlugin",
+ "noEmitOnErrorsPlugin-0",
+);
+defineTest(
+ dirName,
+ "noEmitOnErrorsPlugin",
+ "noEmitOnErrorsPlugin-1",
+);
+defineTest(
+ dirName,
+ "noEmitOnErrorsPlugin",
+ "noEmitOnErrorsPlugin-2",
+);
diff --git a/packages/migrate/noEmitOnErrorsPlugin/noEmitOnErrorsPlugin.test.js b/packages/migrate/noEmitOnErrorsPlugin/noEmitOnErrorsPlugin.test.js
deleted file mode 100644
index fc7c0663748..00000000000
--- a/packages/migrate/noEmitOnErrorsPlugin/noEmitOnErrorsPlugin.test.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-const defineTest = require("@webpack-cli/utils/defineTest").default;
-
-defineTest(__dirname, "noEmitOnErrorsPlugin", "noEmitOnErrorsPlugin-0");
-defineTest(__dirname, "noEmitOnErrorsPlugin", "noEmitOnErrorsPlugin-1");
-defineTest(__dirname, "noEmitOnErrorsPlugin", "noEmitOnErrorsPlugin-2");
diff --git a/packages/migrate/noEmitOnErrorsPlugin/noEmitOnErrorsPlugin.ts b/packages/migrate/noEmitOnErrorsPlugin/noEmitOnErrorsPlugin.ts
index c45ce923185..567d688a47c 100644
--- a/packages/migrate/noEmitOnErrorsPlugin/noEmitOnErrorsPlugin.ts
+++ b/packages/migrate/noEmitOnErrorsPlugin/noEmitOnErrorsPlugin.ts
@@ -1,8 +1,5 @@
-import {
- addOrUpdateConfigObject,
- findAndRemovePluginByName,
-} from "@webpack-cli/utils/ast-utils";
-import { IJSCodeshift, INode } from "../types/NodePath";
+import { addOrUpdateConfigObject, findAndRemovePluginByName } from "@webpack-cli/utils/ast-utils";
+import { JSCodeshift, Node } from "../types/NodePath";
/**
*
@@ -13,23 +10,13 @@ import { IJSCodeshift, INode } from "../types/NodePath";
* @param {Node} ast - jscodeshift ast to transform
* @returns {Node} ast - jscodeshift ast
*/
-export default function(j: IJSCodeshift, ast: INode): INode {
+export default function(j: JSCodeshift, ast: Node): Node {
// Remove old plugin
- const root: INode = findAndRemovePluginByName(
- j,
- ast,
- "webpack.NoEmitOnErrorsPlugin",
- );
+ const root: Node = findAndRemovePluginByName(j, ast, "webpack.NoEmitOnErrorsPlugin");
// Add new optimizations option
if (root) {
- addOrUpdateConfigObject(
- j,
- root,
- "optimizations",
- "noEmitOnErrors",
- j.booleanLiteral(true),
- );
+ addOrUpdateConfigObject(j, root, "optimizations", "noEmitOnErrors", j.booleanLiteral(true));
}
return ast;
diff --git a/packages/migrate/outputPath/__testfixtures__/outputPath-1.input.js b/packages/migrate/outputPath/__testfixtures__/outputPath-1.input.js
deleted file mode 100644
index c7a0ed58e7a..00000000000
--- a/packages/migrate/outputPath/__testfixtures__/outputPath-1.input.js
+++ /dev/null
@@ -1,6 +0,0 @@
-const path = require('path');
-module.exports = {
- output: {
- path: path.join(__dirname, 'dist')
- }
-}
diff --git a/packages/migrate/outputPath/__testfixtures__/outputPath-2.input.js b/packages/migrate/outputPath/__testfixtures__/outputPath-2.input.js
deleted file mode 100644
index de8436ae6c3..00000000000
--- a/packages/migrate/outputPath/__testfixtures__/outputPath-2.input.js
+++ /dev/null
@@ -1,6 +0,0 @@
-const p = require('path');
-module.exports = {
- output: {
- path: 'dist'
- }
-}
diff --git a/packages/migrate/outputPath/__snapshots__/outputPath.test.js.snap b/packages/migrate/outputPath/__tests__/__snapshots__/outputPath.test.ts.snap
similarity index 59%
rename from packages/migrate/outputPath/__snapshots__/outputPath.test.js.snap
rename to packages/migrate/outputPath/__tests__/__snapshots__/outputPath.test.ts.snap
index 27e07047768..faf8dd2b327 100644
--- a/packages/migrate/outputPath/__snapshots__/outputPath.test.js.snap
+++ b/packages/migrate/outputPath/__tests__/__snapshots__/outputPath.test.ts.snap
@@ -2,29 +2,27 @@
exports[`outputPath transforms correctly using "outputPath-0" data 1`] = `
"module.exports = {
- output: {
- path: path.join(__dirname, 'dist')
- }
-}
+ output: {
+ path: path.join(__dirname, \\"dist\\"),
+ },
+};
"
`;
exports[`outputPath transforms correctly using "outputPath-1" data 1`] = `
-"const path = require('path');
-module.exports = {
+"module.exports = {
output: {
- path: path.join(__dirname, 'dist')
+ path: path.join(__dirname, \\"dist\\")
}
-}
+};
"
`;
exports[`outputPath transforms correctly using "outputPath-2" data 1`] = `
-"const p = require('path');
-module.exports = {
+"module.exports = {
output: {
- path: p.join(__dirname, 'dist')
+ path: path.join(__dirname, \\"dist\\")
}
-}
+};
"
`;
diff --git a/packages/migrate/outputPath/__tests__/__testfixtures__/outputPath-0.input.js b/packages/migrate/outputPath/__tests__/__testfixtures__/outputPath-0.input.js
new file mode 100644
index 00000000000..e111b266b50
--- /dev/null
+++ b/packages/migrate/outputPath/__tests__/__testfixtures__/outputPath-0.input.js
@@ -0,0 +1,5 @@
+module.exports = {
+ output: {
+ path: "dist",
+ },
+};
diff --git a/packages/migrate/outputPath/__tests__/__testfixtures__/outputPath-1.input.js b/packages/migrate/outputPath/__tests__/__testfixtures__/outputPath-1.input.js
new file mode 100644
index 00000000000..18e3d927d8f
--- /dev/null
+++ b/packages/migrate/outputPath/__tests__/__testfixtures__/outputPath-1.input.js
@@ -0,0 +1,5 @@
+module.exports = {
+ output: {
+ path: path.join(__dirname, "dist")
+ }
+};
diff --git a/packages/migrate/outputPath/__testfixtures__/outputPath-0.input.js b/packages/migrate/outputPath/__tests__/__testfixtures__/outputPath-2.input.js
similarity index 64%
rename from packages/migrate/outputPath/__testfixtures__/outputPath-0.input.js
rename to packages/migrate/outputPath/__tests__/__testfixtures__/outputPath-2.input.js
index 085268fadbe..9f9c30a0420 100644
--- a/packages/migrate/outputPath/__testfixtures__/outputPath-0.input.js
+++ b/packages/migrate/outputPath/__tests__/__testfixtures__/outputPath-2.input.js
@@ -1,5 +1,5 @@
module.exports = {
output: {
- path: 'dist'
+ path: "dist"
}
-}
+};
diff --git a/packages/migrate/outputPath/__tests__/outputPath.test.ts b/packages/migrate/outputPath/__tests__/outputPath.test.ts
new file mode 100644
index 00000000000..1d5141154bb
--- /dev/null
+++ b/packages/migrate/outputPath/__tests__/outputPath.test.ts
@@ -0,0 +1,8 @@
+import defineTest from "@webpack-cli/utils/defineTest";
+import { join } from "path";
+
+const dirName: string = join(__dirname, "..");
+
+defineTest(dirName, "outputPath", "outputPath-0");
+defineTest(dirName, "outputPath", "outputPath-1");
+defineTest(dirName, "outputPath", "outputPath-2");
diff --git a/packages/migrate/outputPath/outputPath.test.js b/packages/migrate/outputPath/outputPath.test.js
deleted file mode 100644
index f103e99a09e..00000000000
--- a/packages/migrate/outputPath/outputPath.test.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-const defineTest = require("@webpack-cli/utils/defineTest").default;
-
-defineTest(__dirname, "outputPath", "outputPath-0");
-defineTest(__dirname, "outputPath", "outputPath-1");
-defineTest(__dirname, "outputPath", "outputPath-2");
diff --git a/packages/migrate/outputPath/outputPath.ts b/packages/migrate/outputPath/outputPath.ts
index e5038b3c9a0..e3d1c0bd087 100644
--- a/packages/migrate/outputPath/outputPath.ts
+++ b/packages/migrate/outputPath/outputPath.ts
@@ -1,6 +1,20 @@
import * as utils from "@webpack-cli/utils/ast-utils";
-import { IJSCodeshift, INode } from "../types/NodePath";
+import { JSCodeshift, Node } from "../types/NodePath";
+
+
+function replaceWithPath(
+ j: JSCodeshift,
+ p: Node,
+ pathVarName: string,
+): Node {
+ const convertedPath: Node = j.callExpression(
+ j.memberExpression(j.identifier(pathVarName), j.identifier("join"), false),
+ [j.identifier("__dirname"), p.value as Node],
+ );
+
+ return convertedPath;
+}
/**
*
@@ -10,70 +24,68 @@ import { IJSCodeshift, INode } from "../types/NodePath";
* @param {Node} ast - jscodeshift ast to transform
* @returns {Node} ast - jscodeshift ast
*/
+export default function(j: JSCodeshift, ast: Node): Node | void {
+ const literalOutputPath: Node = ast
+ .find(j.ObjectExpression)
+ .filter(
+ (p: Node): boolean =>
+ utils.safeTraverse(p, ["parentPath", "value", "key", "name"]) ===
+ "output",
+ )
+ .find(j.Property)
+ .filter(
+ (p: Node): boolean =>
+ utils.safeTraverse(p, ["value", "key", "name"]) === "path" &&
+ utils.safeTraverse(p, ["value", "value", "type"]) === "Literal",
+ );
-export default function(j: IJSCodeshift, ast: INode): INode | void {
-
- const literalOutputPath: INode = ast
- .find(j.ObjectExpression)
+ if (literalOutputPath) {
+ let pathVarName = "path";
+ let isPathPresent = false;
+ const pathDeclaration: Node = ast
+ .find(j.VariableDeclarator)
.filter(
- (p: INode): boolean =>
- utils.safeTraverse(p, ["parentPath", "value", "key", "name"]) ===
- "output",
+ (p: Node): boolean =>
+ utils.safeTraverse(p, ["value", "init", "callee", "name"]) ===
+ "require",
)
- .find(j.Property)
.filter(
- (p: INode): boolean =>
- utils.safeTraverse(p, ["value", "key", "name"]) === "path" &&
- utils.safeTraverse(p, ["value", "value", "type"]) === "Literal",
+ (p: Node): boolean =>
+ utils.safeTraverse(p, ["value", "init", "arguments"]) &&
+ // TODO: to fix when we have proper typing (@types/jscodeshift)
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ (p.value as any).init.arguments.reduce(
+ (isPresent: boolean, a: Node): boolean => {
+ return (a.type === "Literal" && a.value === "path") || isPresent;
+ },
+ false,
+ ),
);
- if (literalOutputPath) {
- let pathVarName = "path";
- let isPathPresent = false;
- const pathDeclaration: INode = ast
- .find(j.VariableDeclarator)
- .filter(
- (p: INode): boolean =>
- utils.safeTraverse(p, ["value", "init", "callee", "name"]) ===
- "require",
- )
- .filter(
- (p: INode): boolean =>
- utils.safeTraverse(p, ["value", "init", "arguments"]) &&
- p.value.init.arguments.reduce((isPresent: boolean, a: INode): boolean => {
- return (a.type === "Literal" && a.value === "path") || isPresent;
- }, false),
- );
-
- if (pathDeclaration) {
- isPathPresent = true;
- pathDeclaration.forEach((p: INode): void => {
- pathVarName = utils.safeTraverse(p, ["value", "id", "name"]);
- });
- }
- const finalPathName = pathVarName;
- literalOutputPath
- .find(j.Literal)
- .replaceWith((p: INode): INode => replaceWithPath(j, p, finalPathName));
+ if (pathDeclaration) {
+ isPathPresent = true;
+ pathDeclaration.forEach(
+ (p: Node): void => {
+ pathVarName = utils.safeTraverse(p, ["value", "id", "name"]) as string;
+ },
+ );
+ }
+ const finalPathName = pathVarName;
+ literalOutputPath
+ .find(j.Literal)
+ .replaceWith((p: Node): Node => replaceWithPath(j, p, finalPathName));
- if (!isPathPresent) {
- const pathRequire: INode = utils.getRequire(j, "path", "path");
- return ast
- .find(j.Program)
- .replaceWith((p: INode): INode =>
- j.program([].concat(pathRequire).concat(p.value.body)),
- );
- }
+ if (!isPathPresent) {
+ const pathRequire: Node = utils.getRequire(j, "path", "path");
+ return ast
+ .find(j.Program)
+ .replaceWith(
+ (p: Node): Node =>
+ j.program([].concat(pathRequire).concat((p.value as Node).body)),
+ );
}
+ }
- return ast;
+ return ast;
}
-function replaceWithPath(j: IJSCodeshift, p: INode, pathVarName: string): INode {
- const convertedPath: INode = j.callExpression(
- j.memberExpression(j.identifier(pathVarName), j.identifier("join"), false),
- [j.identifier("__dirname"), p.value],
- );
-
- return convertedPath;
-}
diff --git a/packages/migrate/package-lock.json b/packages/migrate/package-lock.json
index 4c6b238c144..c70bc03abc9 100644
--- a/packages/migrate/package-lock.json
+++ b/packages/migrate/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "@webpack-cli/migrate",
- "version": "0.1.3",
+ "version": "0.1.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -67,7 +67,7 @@
},
"@types/listr": {
"version": "0.13.0",
- "resolved": "http://registry.npmjs.org/@types/listr/-/listr-0.13.0.tgz",
+ "resolved": "https://registry.npmjs.org/@types/listr/-/listr-0.13.0.tgz",
"integrity": "sha512-8DOy0JCGwwAf76xmU0sRzSZCWKSPPA9djRcTYTsyqBPnMdGOjZ5tjmNswC4J9mgKZudte2tuTo1l14R1/t5l/g==",
"dev": true,
"requires": {
@@ -100,7 +100,7 @@
},
"@types/rx": {
"version": "4.1.1",
- "resolved": "http://registry.npmjs.org/@types/rx/-/rx-4.1.1.tgz",
+ "resolved": "https://registry.npmjs.org/@types/rx/-/rx-4.1.1.tgz",
"integrity": "sha1-WY/JSla67ZdfGUV04PVy/Y5iekg=",
"dev": true,
"requires": {
@@ -488,7 +488,7 @@
},
"ansi-escapes": {
"version": "3.1.0",
- "resolved": "http://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz",
+ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz",
"integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw=="
},
"ansi-regex": {
@@ -840,7 +840,7 @@
},
"array-equal": {
"version": "1.0.0",
- "resolved": "http://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz",
+ "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz",
"integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=",
"dev": true
},
@@ -991,7 +991,7 @@
},
"chalk": {
"version": "1.1.3",
- "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"requires": {
"ansi-styles": "^2.2.1",
@@ -1011,7 +1011,7 @@
},
"supports-color": {
"version": "2.0.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+ "resolved": "http://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc="
}
}
@@ -1245,7 +1245,7 @@
},
"babel-plugin-istanbul": {
"version": "4.1.6",
- "resolved": "http://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz",
+ "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz",
"integrity": "sha512-PWP9FQ1AhZhS01T/4qLSKoHGY/xvkZdVBGlKM/HuxxS3+sC66HhTNR7+MpbO/so/cz/wY94MeSWJuP1hXIPfwQ==",
"dev": true,
"requires": {
@@ -1308,7 +1308,7 @@
},
"babel-plugin-syntax-object-rest-spread": {
"version": "6.13.0",
- "resolved": "http://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz",
+ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz",
"integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U="
},
"babel-plugin-syntax-trailing-function-commas": {
@@ -1943,7 +1943,7 @@
},
"browserify-aes": {
"version": "1.2.0",
- "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
+ "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
"integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==",
"dev": true,
"requires": {
@@ -1980,7 +1980,7 @@
},
"browserify-rsa": {
"version": "4.0.1",
- "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz",
+ "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz",
"integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=",
"dev": true,
"requires": {
@@ -2023,7 +2023,7 @@
},
"buffer": {
"version": "4.9.1",
- "resolved": "http://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz",
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz",
"integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=",
"dev": true,
"requires": {
@@ -2458,7 +2458,7 @@
},
"string-width": {
"version": "1.0.2",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
+ "resolved": "http://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"dev": true,
"requires": {
@@ -2640,7 +2640,7 @@
},
"create-hash": {
"version": "1.2.0",
- "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz",
+ "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz",
"integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==",
"dev": true,
"requires": {
@@ -2653,7 +2653,7 @@
},
"create-hmac": {
"version": "1.1.7",
- "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz",
+ "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz",
"integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==",
"dev": true,
"requires": {
@@ -2894,7 +2894,7 @@
},
"diffie-hellman": {
"version": "5.0.3",
- "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz",
+ "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz",
"integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==",
"dev": true,
"requires": {
@@ -3152,7 +3152,7 @@
},
"expand-range": {
"version": "1.8.2",
- "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz",
+ "resolved": "http://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz",
"integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=",
"requires": {
"fill-range": "^2.1.0"
@@ -4381,7 +4381,7 @@
},
"is-accessor-descriptor": {
"version": "0.1.6",
- "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
+ "resolved": "http://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
"integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
"dev": true,
"requires": {
@@ -4434,7 +4434,7 @@
},
"is-data-descriptor": {
"version": "0.1.4",
- "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
+ "resolved": "http://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
"integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
"dev": true,
"requires": {
@@ -4504,7 +4504,7 @@
},
"is-generator-fn": {
"version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-1.0.0.tgz",
+ "resolved": "http://registry.npmjs.org/is-generator-fn/-/is-generator-fn-1.0.0.tgz",
"integrity": "sha1-lp1J4bszKfa7fwkIm+JleLLd1Go=",
"dev": true
},
@@ -5412,7 +5412,7 @@
},
"chalk": {
"version": "1.1.3",
- "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"requires": {
"ansi-styles": "^2.2.1",
@@ -5441,7 +5441,7 @@
},
"supports-color": {
"version": "2.0.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+ "resolved": "http://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc="
}
}
@@ -5551,7 +5551,7 @@
},
"chalk": {
"version": "1.1.3",
- "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"requires": {
"ansi-styles": "^2.2.1",
@@ -5571,7 +5571,7 @@
},
"supports-color": {
"version": "2.0.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+ "resolved": "http://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc="
}
}
@@ -5849,7 +5849,7 @@
},
"mute-stream": {
"version": "0.0.7",
- "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz",
+ "resolved": "http://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz",
"integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s="
},
"nan": {
@@ -6327,7 +6327,7 @@
},
"path-browserify": {
"version": "0.0.0",
- "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz",
+ "resolved": "http://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz",
"integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=",
"dev": true
},
@@ -7151,7 +7151,7 @@
},
"resolve": {
"version": "1.1.7",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz",
+ "resolved": "http://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz",
"integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=",
"dev": true
},
@@ -7864,7 +7864,7 @@
},
"sprintf-js": {
"version": "1.0.3",
- "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
+ "resolved": "http://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
"dev": true
},
@@ -7929,7 +7929,7 @@
},
"stream-browserify": {
"version": "2.0.1",
- "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz",
+ "resolved": "http://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz",
"integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=",
"dev": true,
"requires": {
@@ -8008,7 +8008,7 @@
},
"string_decoder": {
"version": "1.1.1",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+ "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"requires": {
@@ -8284,7 +8284,7 @@
},
"tty-browserify": {
"version": "0.0.0",
- "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz",
+ "resolved": "http://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz",
"integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=",
"dev": true
},
@@ -8547,7 +8547,7 @@
},
"vm-browserify": {
"version": "0.0.4",
- "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz",
+ "resolved": "http://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz",
"integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=",
"dev": true,
"requires": {
@@ -8715,7 +8715,7 @@
},
"is-accessor-descriptor": {
"version": "0.1.6",
- "resolved": "http://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
"integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
"dev": true,
"requires": {
@@ -8735,7 +8735,7 @@
},
"is-data-descriptor": {
"version": "0.1.4",
- "resolved": "http://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
"integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
"dev": true,
"requires": {
diff --git a/packages/migrate/package.json b/packages/migrate/package.json
index f5fea0ba6e3..1628882a832 100644
--- a/packages/migrate/package.json
+++ b/packages/migrate/package.json
@@ -40,6 +40,5 @@
"test": "jest",
"build": "tsc",
"watch": "npm run build && tsc -w"
- },
- "gitHead": "6846f2eb8f0d04acc4453cb20da10263ff00a139"
+ }
}
diff --git a/packages/migrate/removeDeprecatedPlugins/__testfixtures__/.editorconfig~HEAD b/packages/migrate/removeDeprecatedPlugins/__testfixtures__/.editorconfig~HEAD
deleted file mode 100644
index adbdb1ba476..00000000000
--- a/packages/migrate/removeDeprecatedPlugins/__testfixtures__/.editorconfig~HEAD
+++ /dev/null
@@ -1,3 +0,0 @@
-[*]
-indent_style = space
-indent_size = 4
diff --git a/packages/migrate/removeDeprecatedPlugins/__testfixtures__/.editorconfig~ec53c68744edef90a7889cda35f1527442a79450 b/packages/migrate/removeDeprecatedPlugins/__testfixtures__/.editorconfig~ec53c68744edef90a7889cda35f1527442a79450
deleted file mode 100644
index adbdb1ba476..00000000000
--- a/packages/migrate/removeDeprecatedPlugins/__testfixtures__/.editorconfig~ec53c68744edef90a7889cda35f1527442a79450
+++ /dev/null
@@ -1,3 +0,0 @@
-[*]
-indent_style = space
-indent_size = 4
diff --git a/packages/migrate/removeDeprecatedPlugins/__testfixtures__/removeDeprecatedPlugins-0.input.js b/packages/migrate/removeDeprecatedPlugins/__testfixtures__/removeDeprecatedPlugins-0.input.js
deleted file mode 100644
index 133c4984bfd..00000000000
--- a/packages/migrate/removeDeprecatedPlugins/__testfixtures__/removeDeprecatedPlugins-0.input.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Works for OccurrenceOrderPlugin
-module.exports = {
- plugins: [
- new webpack.optimize.OccurrenceOrderPlugin(),
- ]
-}
diff --git a/packages/migrate/removeDeprecatedPlugins/__testfixtures__/removeDeprecatedPlugins-1.input.js b/packages/migrate/removeDeprecatedPlugins/__testfixtures__/removeDeprecatedPlugins-1.input.js
deleted file mode 100644
index a64dab79b37..00000000000
--- a/packages/migrate/removeDeprecatedPlugins/__testfixtures__/removeDeprecatedPlugins-1.input.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Works for DedupePlugin
-module.exports = {
- plugins: [
- new webpack.optimize.DedupePlugin(),
- ]
-}
diff --git a/packages/migrate/removeDeprecatedPlugins/__testfixtures__/removeDeprecatedPlugins-2.input.js b/packages/migrate/removeDeprecatedPlugins/__testfixtures__/removeDeprecatedPlugins-2.input.js
deleted file mode 100644
index 26150117db4..00000000000
--- a/packages/migrate/removeDeprecatedPlugins/__testfixtures__/removeDeprecatedPlugins-2.input.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Doesn't remove unmatched plugins
-module.exports = {
- plugins: [
- new webpack.optimize.OccurrenceOrderPlugin(),
- new webpack.optimize.UglifyJsPlugin(),
- new webpack.optimize.DedupePlugin()
- ]
-}
diff --git a/packages/migrate/removeDeprecatedPlugins/__testfixtures__/removeDeprecatedPlugins-3.input.js b/packages/migrate/removeDeprecatedPlugins/__testfixtures__/removeDeprecatedPlugins-3.input.js
deleted file mode 100644
index 1d5194460e3..00000000000
--- a/packages/migrate/removeDeprecatedPlugins/__testfixtures__/removeDeprecatedPlugins-3.input.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// This should throw
-export default (config) => {
- config.plugins.push(new webpack.optimize.UglifyJsPlugin());
- config.plugins.push(new webpack.optimize.DedupePlugin());
- config.plugins.push(new webpack.optimize.OccurrenceOrderPlugin());
- return config
-}
diff --git a/packages/migrate/removeDeprecatedPlugins/__testfixtures__/removeDeprecatedPlugins-4.input.js b/packages/migrate/removeDeprecatedPlugins/__testfixtures__/removeDeprecatedPlugins-4.input.js
deleted file mode 100644
index fab47caf971..00000000000
--- a/packages/migrate/removeDeprecatedPlugins/__testfixtures__/removeDeprecatedPlugins-4.input.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// This should throw
-const inst = new webpack.optimize.OccurrenceOrderPlugin()
-export default (config) => {
- config.plugins = [
- inst
- ]
- return config
-}
diff --git a/packages/migrate/removeDeprecatedPlugins/__snapshots__/removeDeprecatedPlugins.test.js.snap b/packages/migrate/removeDeprecatedPlugins/__tests__/__snapshots__/removeDeprecatedPlugins.test.ts.snap
similarity index 50%
rename from packages/migrate/removeDeprecatedPlugins/__snapshots__/removeDeprecatedPlugins.test.js.snap
rename to packages/migrate/removeDeprecatedPlugins/__tests__/__snapshots__/removeDeprecatedPlugins.test.ts.snap
index 550faf1fba2..62b69a6e5de 100644
--- a/packages/migrate/removeDeprecatedPlugins/__snapshots__/removeDeprecatedPlugins.test.js.snap
+++ b/packages/migrate/removeDeprecatedPlugins/__tests__/__snapshots__/removeDeprecatedPlugins.test.ts.snap
@@ -1,44 +1,42 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`removeDeprecatedPlugins transforms correctly using "removeDeprecatedPlugins-0" data 1`] = `
-"// Works for OccurrenceOrderPlugin
-module.exports = {}
+"module.exports = {};
"
`;
exports[`removeDeprecatedPlugins transforms correctly using "removeDeprecatedPlugins-1" data 1`] = `
-"// Works for DedupePlugin
-module.exports = {}
+"module.exports = {};
"
`;
exports[`removeDeprecatedPlugins transforms correctly using "removeDeprecatedPlugins-2" data 1`] = `
-"// Doesn't remove unmatched plugins
-module.exports = {
- plugins: [new webpack.optimize.UglifyJsPlugin()]
-}
+"module.exports = {
+ plugins: [new webpack.optimize.UglifyJsPlugin()]
+};
"
`;
exports[`removeDeprecatedPlugins transforms correctly using "removeDeprecatedPlugins-3" data 1`] = `
"// This should throw
-export default (config) => {
- config.plugins.push(new webpack.optimize.UglifyJsPlugin());
- config.plugins.push(new webpack.optimize.DedupePlugin());
- config.plugins.push(new webpack.optimize.OccurrenceOrderPlugin());
- return config
-}
+
+module.exports = config => {
+ config.plugins.push(new webpack.optimize.UglifyJsPlugin());
+ config.plugins.push(new webpack.optimize.DedupePlugin());
+ config.plugins.push(new webpack.optimize.OccurrenceOrderPlugin());
+ return config;
+};
"
`;
exports[`removeDeprecatedPlugins transforms correctly using "removeDeprecatedPlugins-4" data 1`] = `
"// This should throw
-const inst = new webpack.optimize.OccurrenceOrderPlugin()
-export default (config) => {
- config.plugins = [
- inst
- ]
- return config
-}
+const webpack = require(\\"webpack\\");
+
+const inst = new webpack.optimize.OccurrenceOrderPlugin();
+module.exports = config => {
+ config.plugins = [inst];
+ return config;
+};
"
`;
diff --git a/packages/migrate/removeDeprecatedPlugins/__tests__/__testfixtures__/removeDeprecatedPlugins-0.input.js b/packages/migrate/removeDeprecatedPlugins/__tests__/__testfixtures__/removeDeprecatedPlugins-0.input.js
new file mode 100644
index 00000000000..5171ac6d172
--- /dev/null
+++ b/packages/migrate/removeDeprecatedPlugins/__tests__/__testfixtures__/removeDeprecatedPlugins-0.input.js
@@ -0,0 +1,3 @@
+module.exports = {
+ plugins: [new webpack.optimize.OccurrenceOrderPlugin()]
+};
diff --git a/packages/migrate/removeDeprecatedPlugins/__tests__/__testfixtures__/removeDeprecatedPlugins-1.input.js b/packages/migrate/removeDeprecatedPlugins/__tests__/__testfixtures__/removeDeprecatedPlugins-1.input.js
new file mode 100644
index 00000000000..73c1c9554fd
--- /dev/null
+++ b/packages/migrate/removeDeprecatedPlugins/__tests__/__testfixtures__/removeDeprecatedPlugins-1.input.js
@@ -0,0 +1,3 @@
+module.exports = {
+ plugins: [new webpack.optimize.DedupePlugin()]
+};
diff --git a/packages/migrate/removeDeprecatedPlugins/__tests__/__testfixtures__/removeDeprecatedPlugins-2.input.js b/packages/migrate/removeDeprecatedPlugins/__tests__/__testfixtures__/removeDeprecatedPlugins-2.input.js
new file mode 100644
index 00000000000..93c058b3fff
--- /dev/null
+++ b/packages/migrate/removeDeprecatedPlugins/__tests__/__testfixtures__/removeDeprecatedPlugins-2.input.js
@@ -0,0 +1,3 @@
+module.exports = {
+ plugins: [new webpack.optimize.OccurrenceOrderPlugin(), new webpack.optimize.UglifyJsPlugin(), new webpack.optimize.DedupePlugin()]
+};
diff --git a/packages/migrate/removeDeprecatedPlugins/__tests__/__testfixtures__/removeDeprecatedPlugins-3.input.js b/packages/migrate/removeDeprecatedPlugins/__tests__/__testfixtures__/removeDeprecatedPlugins-3.input.js
new file mode 100644
index 00000000000..abdd8a4599b
--- /dev/null
+++ b/packages/migrate/removeDeprecatedPlugins/__tests__/__testfixtures__/removeDeprecatedPlugins-3.input.js
@@ -0,0 +1,8 @@
+// This should throw
+
+module.exports = config => {
+ config.plugins.push(new webpack.optimize.UglifyJsPlugin());
+ config.plugins.push(new webpack.optimize.DedupePlugin());
+ config.plugins.push(new webpack.optimize.OccurrenceOrderPlugin());
+ return config;
+};
diff --git a/packages/migrate/removeDeprecatedPlugins/__tests__/__testfixtures__/removeDeprecatedPlugins-4.input.js b/packages/migrate/removeDeprecatedPlugins/__tests__/__testfixtures__/removeDeprecatedPlugins-4.input.js
new file mode 100644
index 00000000000..b436cbdb8ad
--- /dev/null
+++ b/packages/migrate/removeDeprecatedPlugins/__tests__/__testfixtures__/removeDeprecatedPlugins-4.input.js
@@ -0,0 +1,8 @@
+// This should throw
+const webpack = require("webpack");
+
+const inst = new webpack.optimize.OccurrenceOrderPlugin();
+module.exports = config => {
+ config.plugins = [inst];
+ return config;
+};
diff --git a/packages/migrate/removeDeprecatedPlugins/__tests__/removeDeprecatedPlugins.test.ts b/packages/migrate/removeDeprecatedPlugins/__tests__/removeDeprecatedPlugins.test.ts
new file mode 100644
index 00000000000..922ca71424c
--- /dev/null
+++ b/packages/migrate/removeDeprecatedPlugins/__tests__/removeDeprecatedPlugins.test.ts
@@ -0,0 +1,30 @@
+import defineTest from "@webpack-cli/utils/defineTest";
+import { join } from "path";
+
+const dirName: string = join(__dirname, "..");
+
+defineTest(
+ dirName,
+ "removeDeprecatedPlugins",
+ "removeDeprecatedPlugins-0",
+);
+defineTest(
+ dirName,
+ "removeDeprecatedPlugins",
+ "removeDeprecatedPlugins-1",
+);
+defineTest(
+ dirName,
+ "removeDeprecatedPlugins",
+ "removeDeprecatedPlugins-2",
+);
+defineTest(
+ dirName,
+ "removeDeprecatedPlugins",
+ "removeDeprecatedPlugins-3",
+);
+defineTest(
+ dirName,
+ "removeDeprecatedPlugins",
+ "removeDeprecatedPlugins-4",
+);
diff --git a/packages/migrate/removeDeprecatedPlugins/removeDeprecatedPlugins.test.js b/packages/migrate/removeDeprecatedPlugins/removeDeprecatedPlugins.test.js
deleted file mode 100644
index e881f02428f..00000000000
--- a/packages/migrate/removeDeprecatedPlugins/removeDeprecatedPlugins.test.js
+++ /dev/null
@@ -1,9 +0,0 @@
-"use strict";
-
-const defineTest = require("@webpack-cli/utils/defineTest").default;
-
-defineTest(__dirname, "removeDeprecatedPlugins", "removeDeprecatedPlugins-0");
-defineTest(__dirname, "removeDeprecatedPlugins", "removeDeprecatedPlugins-1");
-defineTest(__dirname, "removeDeprecatedPlugins", "removeDeprecatedPlugins-2");
-defineTest(__dirname, "removeDeprecatedPlugins", "removeDeprecatedPlugins-3");
-defineTest(__dirname, "removeDeprecatedPlugins", "removeDeprecatedPlugins-4");
diff --git a/packages/migrate/removeDeprecatedPlugins/removeDeprecatedPlugins.ts b/packages/migrate/removeDeprecatedPlugins/removeDeprecatedPlugins.ts
index 5d83f3cce0a..e7f7518bdad 100644
--- a/packages/migrate/removeDeprecatedPlugins/removeDeprecatedPlugins.ts
+++ b/packages/migrate/removeDeprecatedPlugins/removeDeprecatedPlugins.ts
@@ -2,7 +2,7 @@ import chalk from "chalk";
import * as utils from "@webpack-cli/utils/ast-utils";
-import { IJSCodeshift, INode } from "../types/NodePath";
+import { JSCodeshift, Node } from "../types/NodePath";
/**
*
@@ -14,25 +14,24 @@ import { IJSCodeshift, INode } from "../types/NodePath";
* @returns {Node} ast - jscodeshift ast
*/
-export default function(j: IJSCodeshift, ast: INode) {
-
+export default function(j: JSCodeshift, ast: Node): Node {
// List of deprecated plugins to remove
// each item refers to webpack.optimize.[NAME] construct
const deprecatedPlugingsList: string[] = [
"webpack.optimize.OccurrenceOrderPlugin",
- "webpack.optimize.DedupePlugin",
+ "webpack.optimize.DedupePlugin"
];
- return utils
- .findPluginsByName(j, ast, deprecatedPlugingsList)
- .forEach((path: INode): void => {
+ return utils.findPluginsByName(j, ast, deprecatedPlugingsList).forEach(
+ (path: Node): void => {
// For now we only support the case where plugins are defined in an Array
- const arrayPath: INode = utils.safeTraverse(path, ["parent", "value"]);
+ const arrayPath = utils.safeTraverse(path, ["parent", "value"]) as Node;
if (arrayPath && utils.isType(arrayPath, "ArrayExpression")) {
// Check how many plugins are defined and
// if there is only last plugin left remove `plugins: []` node
- const arrayElementsPath: INode[] = utils.safeTraverse(arrayPath, ["elements"]);
+ //
+ const arrayElementsPath = utils.safeTraverse(arrayPath, ["elements"]) as Node[];
if (arrayElementsPath && arrayElementsPath.length === 1) {
j(path.parent.parent).remove();
} else {
@@ -41,9 +40,8 @@ export default function(j: IJSCodeshift, ast: INode) {
} else {
console.error(`
${chalk.red("Please remove deprecated plugins manually. ")}
-See ${chalk.underline(
- "https://webpack.js.org/guides/migrating/",
- )} for more information.`);
+See ${chalk.underline("https://webpack.js.org/guides/migrating/")} for more information.`);
}
- });
+ }
+ );
}
diff --git a/packages/migrate/removeJsonLoader/__snapshots__/removeJsonLoader.test.js.snap b/packages/migrate/removeJsonLoader/__snapshots__/removeJsonLoader.test.js.snap
deleted file mode 100644
index e5153cd3412..00000000000
--- a/packages/migrate/removeJsonLoader/__snapshots__/removeJsonLoader.test.js.snap
+++ /dev/null
@@ -1,51 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`removeJsonLoader transforms correctly using "removeJsonLoader-0" data 1`] = `
-"export default {
- module: {
- rules: [{
- test: /\\\\.yml/,
- use: [{
- loader: 'another-loader'
- }, {
- loader: 'yml-loader'
- }]
- }]
- }
-}
-
-"
-`;
-
-exports[`removeJsonLoader transforms correctly using "removeJsonLoader-1" data 1`] = `
-"export default {
- module: {
- rules: [{
- test: /\\\\.yml/,
- use: [{
- loader: 'yml-loader'
- }]
- }]
- }
-}
-"
-`;
-
-exports[`removeJsonLoader transforms correctly using "removeJsonLoader-2" data 1`] = `
-"export default {
- module: {
- rules: []
- }
-}
-"
-`;
-
-exports[`removeJsonLoader transforms correctly using "removeJsonLoader-3" data 1`] = `
-"export default {
- module: {
- rules: []
- }
-}
-
-"
-`;
diff --git a/packages/migrate/removeJsonLoader/__testfixtures__/.editorconfig~HEAD b/packages/migrate/removeJsonLoader/__testfixtures__/.editorconfig~HEAD
deleted file mode 100644
index adbdb1ba476..00000000000
--- a/packages/migrate/removeJsonLoader/__testfixtures__/.editorconfig~HEAD
+++ /dev/null
@@ -1,3 +0,0 @@
-[*]
-indent_style = space
-indent_size = 4
diff --git a/packages/migrate/removeJsonLoader/__testfixtures__/.editorconfig~ec53c68744edef90a7889cda35f1527442a79450 b/packages/migrate/removeJsonLoader/__testfixtures__/.editorconfig~ec53c68744edef90a7889cda35f1527442a79450
deleted file mode 100644
index adbdb1ba476..00000000000
--- a/packages/migrate/removeJsonLoader/__testfixtures__/.editorconfig~ec53c68744edef90a7889cda35f1527442a79450
+++ /dev/null
@@ -1,3 +0,0 @@
-[*]
-indent_style = space
-indent_size = 4
diff --git a/packages/migrate/removeJsonLoader/__testfixtures__/removeJsonLoader-0.input.js b/packages/migrate/removeJsonLoader/__testfixtures__/removeJsonLoader-0.input.js
deleted file mode 100644
index 48517948142..00000000000
--- a/packages/migrate/removeJsonLoader/__testfixtures__/removeJsonLoader-0.input.js
+++ /dev/null
@@ -1,19 +0,0 @@
-export default {
- module: {
- rules: [{
- test: /\.yml/,
- use: [
- {
- loader: 'json-loader'
- },
- {
- loader: 'another-loader'
- },
- {
- loader: 'yml-loader'
- }
- ]
- }]
- }
-}
-
diff --git a/packages/migrate/removeJsonLoader/__testfixtures__/removeJsonLoader-1.input.js b/packages/migrate/removeJsonLoader/__testfixtures__/removeJsonLoader-1.input.js
deleted file mode 100644
index 1040b5ff919..00000000000
--- a/packages/migrate/removeJsonLoader/__testfixtures__/removeJsonLoader-1.input.js
+++ /dev/null
@@ -1,12 +0,0 @@
-export default {
- module: {
- rules: [{
- test: /\.yml/,
- use: [{
- loader: 'json-loader'
- }, {
- loader: 'yml-loader'
- }]
- }]
- }
-}
diff --git a/packages/migrate/removeJsonLoader/__testfixtures__/removeJsonLoader-2.input.js b/packages/migrate/removeJsonLoader/__testfixtures__/removeJsonLoader-2.input.js
deleted file mode 100644
index 39b473705d0..00000000000
--- a/packages/migrate/removeJsonLoader/__testfixtures__/removeJsonLoader-2.input.js
+++ /dev/null
@@ -1,10 +0,0 @@
-export default {
- module: {
- rules: [
- {
- test: /\.json/,
- loader: 'json-loader'
- }
- ]
- }
-}
diff --git a/packages/migrate/removeJsonLoader/__testfixtures__/removeJsonLoader-3.input.js b/packages/migrate/removeJsonLoader/__testfixtures__/removeJsonLoader-3.input.js
deleted file mode 100644
index be47fd92ee2..00000000000
--- a/packages/migrate/removeJsonLoader/__testfixtures__/removeJsonLoader-3.input.js
+++ /dev/null
@@ -1,11 +0,0 @@
-export default {
- module: {
- rules: [{
- test: /\.json/,
- use: [{
- loader: 'json-loader'
- }]
- }]
- }
-}
-
diff --git a/packages/migrate/removeJsonLoader/__tests__/__snapshots__/removeJsonLoader.test.ts.snap b/packages/migrate/removeJsonLoader/__tests__/__snapshots__/removeJsonLoader.test.ts.snap
new file mode 100644
index 00000000000..cb5cf219f5e
--- /dev/null
+++ b/packages/migrate/removeJsonLoader/__tests__/__snapshots__/removeJsonLoader.test.ts.snap
@@ -0,0 +1,53 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`removeJsonLoader transforms correctly using "removeJsonLoader-0" data 1`] = `
+"module.exports = {
+ module: {
+ rules: [
+ {
+ test: /\\\\.yml/,
+ use: [{
+ loader: \\"another-loader\\"
+ }, {
+ loader: \\"yml-loader\\"
+ }]
+ }
+ ]
+ }
+};
+"
+`;
+
+exports[`removeJsonLoader transforms correctly using "removeJsonLoader-1" data 1`] = `
+"module.exports = {
+ module: {
+ rules: [
+ {
+ test: /\\\\.yml/,
+ use: [{
+ loader: \\"yml-loader\\"
+ }]
+ }
+ ]
+ }
+};
+"
+`;
+
+exports[`removeJsonLoader transforms correctly using "removeJsonLoader-2" data 1`] = `
+"module.exports = {
+ module: {
+ rules: []
+ }
+};
+"
+`;
+
+exports[`removeJsonLoader transforms correctly using "removeJsonLoader-3" data 1`] = `
+"module.exports = {
+ module: {
+ rules: []
+ }
+};
+"
+`;
diff --git a/packages/migrate/removeJsonLoader/__tests__/__testfixtures__/removeJsonLoader-0.input.js b/packages/migrate/removeJsonLoader/__tests__/__testfixtures__/removeJsonLoader-0.input.js
new file mode 100644
index 00000000000..a492d057aec
--- /dev/null
+++ b/packages/migrate/removeJsonLoader/__tests__/__testfixtures__/removeJsonLoader-0.input.js
@@ -0,0 +1,20 @@
+module.exports = {
+ module: {
+ rules: [
+ {
+ test: /\.yml/,
+ use: [
+ {
+ loader: "json-loader"
+ },
+ {
+ loader: "another-loader"
+ },
+ {
+ loader: "yml-loader"
+ }
+ ]
+ }
+ ]
+ }
+};
diff --git a/packages/migrate/removeJsonLoader/__tests__/__testfixtures__/removeJsonLoader-1.input.js b/packages/migrate/removeJsonLoader/__tests__/__testfixtures__/removeJsonLoader-1.input.js
new file mode 100644
index 00000000000..cf3e50853c4
--- /dev/null
+++ b/packages/migrate/removeJsonLoader/__tests__/__testfixtures__/removeJsonLoader-1.input.js
@@ -0,0 +1,17 @@
+module.exports = {
+ module: {
+ rules: [
+ {
+ test: /\.yml/,
+ use: [
+ {
+ loader: "json-loader"
+ },
+ {
+ loader: "yml-loader"
+ }
+ ]
+ }
+ ]
+ }
+};
diff --git a/packages/migrate/removeJsonLoader/__tests__/__testfixtures__/removeJsonLoader-2.input.js b/packages/migrate/removeJsonLoader/__tests__/__testfixtures__/removeJsonLoader-2.input.js
new file mode 100644
index 00000000000..5a8709cb4b4
--- /dev/null
+++ b/packages/migrate/removeJsonLoader/__tests__/__testfixtures__/removeJsonLoader-2.input.js
@@ -0,0 +1,10 @@
+module.exports = {
+ module: {
+ rules: [
+ {
+ loader: "json-loader",
+ test: /\.json/
+ }
+ ]
+ }
+};
diff --git a/packages/migrate/removeJsonLoader/__tests__/__testfixtures__/removeJsonLoader-3.input.js b/packages/migrate/removeJsonLoader/__tests__/__testfixtures__/removeJsonLoader-3.input.js
new file mode 100644
index 00000000000..c4050edc398
--- /dev/null
+++ b/packages/migrate/removeJsonLoader/__tests__/__testfixtures__/removeJsonLoader-3.input.js
@@ -0,0 +1,14 @@
+module.exports = {
+ module: {
+ rules: [
+ {
+ test: /\.json/,
+ use: [
+ {
+ loader: "json-loader"
+ }
+ ]
+ }
+ ]
+ }
+};
diff --git a/packages/migrate/removeJsonLoader/__tests__/removeJsonLoader.test.ts b/packages/migrate/removeJsonLoader/__tests__/removeJsonLoader.test.ts
new file mode 100644
index 00000000000..6d705023056
--- /dev/null
+++ b/packages/migrate/removeJsonLoader/__tests__/removeJsonLoader.test.ts
@@ -0,0 +1,25 @@
+import defineTest from "@webpack-cli/utils/defineTest";
+import { join } from "path";
+
+const dirName: string = join(__dirname, "..");
+
+defineTest(
+ dirName,
+ "removeJsonLoader",
+ "removeJsonLoader-0",
+);
+defineTest(
+ dirName,
+ "removeJsonLoader",
+ "removeJsonLoader-1",
+);
+defineTest(
+ dirName,
+ "removeJsonLoader",
+ "removeJsonLoader-2",
+);
+defineTest(
+ dirName,
+ "removeJsonLoader",
+ "removeJsonLoader-3",
+);
diff --git a/packages/migrate/removeJsonLoader/removeJsonLoader.test.js b/packages/migrate/removeJsonLoader/removeJsonLoader.test.js
deleted file mode 100644
index 82e38804c86..00000000000
--- a/packages/migrate/removeJsonLoader/removeJsonLoader.test.js
+++ /dev/null
@@ -1,8 +0,0 @@
-"use strict";
-
-const defineTest = require("@webpack-cli/utils/defineTest").default;
-
-defineTest(__dirname, "removeJsonLoader", "removeJsonLoader-0");
-defineTest(__dirname, "removeJsonLoader", "removeJsonLoader-1");
-defineTest(__dirname, "removeJsonLoader", "removeJsonLoader-2");
-defineTest(__dirname, "removeJsonLoader", "removeJsonLoader-3");
diff --git a/packages/migrate/removeJsonLoader/removeJsonLoader.ts b/packages/migrate/removeJsonLoader/removeJsonLoader.ts
index 88d7a4fae5f..1fcd9c379cb 100644
--- a/packages/migrate/removeJsonLoader/removeJsonLoader.ts
+++ b/packages/migrate/removeJsonLoader/removeJsonLoader.ts
@@ -1,6 +1,8 @@
import * as utils from "@webpack-cli/utils/ast-utils";
-import { IJSCodeshift, INode } from "../types/NodePath";
+import { JSCodeshift, Node } from "../types/NodePath";
+
+type TransformCallback = (astNode: Node) => void;
/**
*
@@ -11,7 +13,7 @@ import { IJSCodeshift, INode } from "../types/NodePath";
* @returns {Node} ast - jscodeshift ast
*/
-export default function(j: IJSCodeshift, ast: INode): INode {
+export default function(j: JSCodeshift, ast: Node): Node {
/**
*
* Remove the loader with name `name` from the given NodePath
@@ -21,14 +23,16 @@ export default function(j: IJSCodeshift, ast: INode): INode {
* @returns {void}
*/
- function removeLoaderByName(path: INode, name: string): void {
- const loadersNode: INode = path.value.value;
+ function removeLoaderByName(path: Node, name: string): void {
+ const loadersNode = (path.value as Node).value as Node;
switch (loadersNode.type) {
case j.ArrayExpression.name: {
- const loaders: string[] = loadersNode.elements.map((p: INode): string => {
- return utils.safeTraverse(p, ["properties", "0", "value", "value"]);
- });
+ const loaders: Node[] = loadersNode.elements.map(
+ (p: Node): Node => {
+ return utils.safeTraverse(p, ["properties", "0", "value", "value"]) as Node;
+ }
+ );
const loaderIndex: number = loaders.indexOf(name);
if (loaders.length && loaderIndex > -1) {
@@ -55,19 +59,19 @@ export default function(j: IJSCodeshift, ast: INode): INode {
}
}
- function removeLoaders(astNode: INode) {
+ function removeLoaders(astNode: Node): void {
astNode
.find(j.Property, { key: { name: "use" } })
- .forEach((path: INode): void => removeLoaderByName(path, "json-loader"));
+ .forEach((path: Node): void => removeLoaderByName(path, "json-loader"));
astNode
.find(j.Property, { key: { name: "loader" } })
- .forEach((path: INode): void => removeLoaderByName(path, "json-loader"));
+ .forEach((path: Node): void => removeLoaderByName(path, "json-loader"));
}
- const transforms: Array<(astNode: INode) => void> = [removeLoaders];
+ const transforms: TransformCallback[] = [removeLoaders];
- transforms.forEach((t: (astNode: INode) => void): void => t(ast));
+ transforms.forEach((t: TransformCallback): void => t(ast));
return ast;
}
diff --git a/packages/migrate/resolve/__snapshots__/resolve.test.js.snap b/packages/migrate/resolve/__snapshots__/resolve.test.js.snap
deleted file mode 100644
index 820fc965a13..00000000000
--- a/packages/migrate/resolve/__snapshots__/resolve.test.js.snap
+++ /dev/null
@@ -1,24 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`resolve transforms correctly 1`] = `
-"import path from 'path';
-
-export default [{
- resolve: {
- modules: [path.resolve('/src')]
- }
-}, {
- resolve: {
- modules: [path.resolve('/src')]
- }
-}, {
- resolve: {
- modules: [path.resolve('/src'), 'node_modules']
- }
-}, {
- resolve: {
- modules: ['node_modules', path.resolve('/src')]
- }
-}];
-"
-`;
diff --git a/packages/migrate/resolve/__testfixtures__/.editorconfig~HEAD b/packages/migrate/resolve/__testfixtures__/.editorconfig~HEAD
deleted file mode 100644
index adbdb1ba476..00000000000
--- a/packages/migrate/resolve/__testfixtures__/.editorconfig~HEAD
+++ /dev/null
@@ -1,3 +0,0 @@
-[*]
-indent_style = space
-indent_size = 4
diff --git a/packages/migrate/resolve/__testfixtures__/.editorconfig~ec53c68744edef90a7889cda35f1527442a79450 b/packages/migrate/resolve/__testfixtures__/.editorconfig~ec53c68744edef90a7889cda35f1527442a79450
deleted file mode 100644
index adbdb1ba476..00000000000
--- a/packages/migrate/resolve/__testfixtures__/.editorconfig~ec53c68744edef90a7889cda35f1527442a79450
+++ /dev/null
@@ -1,3 +0,0 @@
-[*]
-indent_style = space
-indent_size = 4
diff --git a/packages/migrate/resolve/__testfixtures__/resolve.input.js b/packages/migrate/resolve/__testfixtures__/resolve.input.js
deleted file mode 100644
index 2b83fcf26ce..00000000000
--- a/packages/migrate/resolve/__testfixtures__/resolve.input.js
+++ /dev/null
@@ -1,20 +0,0 @@
-import path from 'path';
-
-export default [{
- resolve: {
- root: path.resolve('/src')
- }
-}, {
- resolve: {
- root: [path.resolve('/src')]
- }
-}, {
- resolve: {
- root: [path.resolve('/src'), 'node_modules']
- }
-}, {
- resolve: {
- root: path.resolve('/src'),
- modules: ['node_modules']
- }
-}];
diff --git a/packages/migrate/resolve/__tests__/__snapshots__/resolve.test.ts.snap b/packages/migrate/resolve/__tests__/__snapshots__/resolve.test.ts.snap
new file mode 100644
index 00000000000..c96bb8462fc
--- /dev/null
+++ b/packages/migrate/resolve/__tests__/__snapshots__/resolve.test.ts.snap
@@ -0,0 +1,29 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`resolve transforms correctly 1`] = `
+"const path = require(\\"path\\");
+const rootPath = path.resolve(\\"/src\\");
+module.exports = [
+ {
+ resolve: {
+ modules: [rootPath]
+ }
+ },
+ {
+ resolve: {
+ modules: [rootPath]
+ }
+ },
+ {
+ resolve: {
+ modules: [rootPath, \\"node_modules\\"]
+ }
+ },
+ {
+ resolve: {
+ modules: [\\"node_modules\\", rootPath]
+ }
+ }
+];
+"
+`;
diff --git a/packages/migrate/resolve/__tests__/__testfixtures__/resolve.input.js b/packages/migrate/resolve/__tests__/__testfixtures__/resolve.input.js
new file mode 100644
index 00000000000..f90803ff3d0
--- /dev/null
+++ b/packages/migrate/resolve/__tests__/__testfixtures__/resolve.input.js
@@ -0,0 +1,25 @@
+const path = require("path");
+const rootPath = path.resolve("/src");
+module.exports = [
+ {
+ resolve: {
+ root: rootPath
+ }
+ },
+ {
+ resolve: {
+ root: [rootPath]
+ }
+ },
+ {
+ resolve: {
+ root: [rootPath, "node_modules"]
+ }
+ },
+ {
+ resolve: {
+ modules: ["node_modules"],
+ root: rootPath
+ }
+ }
+];
diff --git a/packages/migrate/resolve/__tests__/resolve.test.ts b/packages/migrate/resolve/__tests__/resolve.test.ts
new file mode 100644
index 00000000000..82349cbc543
--- /dev/null
+++ b/packages/migrate/resolve/__tests__/resolve.test.ts
@@ -0,0 +1,5 @@
+import defineTest from "@webpack-cli/utils/defineTest";
+import { join } from "path";
+
+const dirName: string = join(__dirname, "..");
+defineTest(dirName, "resolve");
diff --git a/packages/migrate/resolve/resolve.test.js b/packages/migrate/resolve/resolve.test.js
deleted file mode 100644
index c3971466966..00000000000
--- a/packages/migrate/resolve/resolve.test.js
+++ /dev/null
@@ -1,5 +0,0 @@
-"use strict";
-
-const defineTest = require("@webpack-cli/utils/defineTest").default;
-
-defineTest(__dirname, "resolve");
diff --git a/packages/migrate/resolve/resolve.ts b/packages/migrate/resolve/resolve.ts
index c79f5cca4c3..be60e4e69b0 100644
--- a/packages/migrate/resolve/resolve.ts
+++ b/packages/migrate/resolve/resolve.ts
@@ -1,4 +1,4 @@
-import { IJSCodeshift, INode } from "../types/NodePath";
+import { JSCodeshift, Node } from "../types/NodePath";
/**
*
@@ -9,22 +9,19 @@ import { IJSCodeshift, INode } from "../types/NodePath";
* @returns {Node} ast - jscodeshift ast
*/
-export default function transformer(j: IJSCodeshift, ast: INode): INode {
-
- const getRootVal = (p: INode): INode => {
- return p.node.value.properties.filter((prop: INode): boolean => prop.key.name === "root")[0];
+export default function transformer(j: JSCodeshift, ast: Node): Node {
+ const getRootVal = (p: Node): Node => {
+ return (p.node.value as Node).properties.filter((prop: Node): boolean => prop.key.name === "root")[0];
};
- const getRootIndex = (p: INode): number => {
- return p.node.value.properties.reduce((rootIndex: number, prop: INode, index: number): number => {
+ const getRootIndex = (p: Node): number => {
+ return (p.node.value as Node).properties.reduce((rootIndex: number, prop: Node, index: number): number => {
return prop.key.name === "root" ? index : rootIndex;
}, -1);
};
- const isModulePresent = (p: INode): INode | false => {
- const modules: INode[] = p.node.value.properties.filter(
- (prop: INode): boolean => prop.key.name === "modules",
- );
+ const isModulePresent = (p: Node): Node | false => {
+ const modules: Node[] = (p.node.value as Node).properties.filter((prop: Node): boolean => prop.key.name === "modules");
return modules.length > 0 && modules[0];
};
@@ -38,46 +35,42 @@ export default function transformer(j: IJSCodeshift, ast: INode): INode {
* @returns {Node} ast - ast node
*/
- const createModuleArray = (p: INode): INode => {
-
- const rootVal: INode = getRootVal(p);
+ const createModuleArray = (p: Node): Node => {
+ const rootVal: Node = getRootVal(p);
- let modulesVal: INode[] = null;
+ let modulesVal: Node[] = null;
- if (rootVal.value.type === "ArrayExpression") {
- modulesVal = rootVal.value.elements;
+ if ((rootVal.value as Node).type === "ArrayExpression") {
+ modulesVal = (rootVal.value as Node).elements;
} else {
- modulesVal = [rootVal.value];
+ modulesVal = [rootVal.value as Node];
}
- let module: INode | false = isModulePresent(p);
+ let module: Node | false = isModulePresent(p);
if (!module) {
- module = j.property(
- "init",
- j.identifier("modules"),
- j.arrayExpression(modulesVal),
- );
- p.node.value.properties = p.node.value.properties.concat([module]);
+ module = j.property("init", j.identifier("modules"), j.arrayExpression(modulesVal));
+ (p.node.value as Node).properties = (p.node.value as Node).properties.concat([module]);
} else {
- module.value.elements = module.value.elements.concat(modulesVal);
+ (module.value as Node).elements = (module.value as Node).elements.concat(modulesVal);
}
const rootIndex: number = getRootIndex(p);
- p.node.value.properties.splice(rootIndex, 1);
+ (p.node.value as Node).properties.splice(rootIndex, 1);
return p;
};
return ast
.find(j.Property)
- .filter((p: INode): boolean => {
- return (
- p.node.key.name === "resolve" &&
- p.node.value.properties.filter((prop: INode): boolean => prop.key.name === "root")
- .length === 1
- );
- })
+ .filter(
+ (p: Node): boolean => {
+ return (
+ p.node.key.name === "resolve" &&
+ (p.node.value as Node).properties.filter((prop: Node): boolean => prop.key.name === "root").length === 1
+ );
+ }
+ )
.forEach(createModuleArray);
}
diff --git a/packages/migrate/types/NodePath.ts b/packages/migrate/types/NodePath.ts
index e40bdf3cba8..1b828378ddb 100644
--- a/packages/migrate/types/NodePath.ts
+++ b/packages/migrate/types/NodePath.ts
@@ -1,100 +1,99 @@
-export interface INode extends Object {
+export interface Node extends Object {
id?: {
name: string;
};
- arguments?: INode[];
- body?: INode[];
- elements?: INode[];
+ arguments?: Node[];
+ body?: Node[];
+ elements?: Node[];
expression?: {
left: {
- computed: boolean,
- object: INode,
- property: INode,
- type: string,
- },
- operator: string,
- right: INode,
- type: string,
+ computed: boolean;
+ object: Node;
+ property: Node;
+ type: string;
+ };
+ operator: string;
+ right: Node;
+ type: string;
+ value?: string;
};
- filter?: (p: (p: INode) => boolean) => INode;
- find?: (objectExpression: object, filterExpression?: object) => INode;
- forEach?: (p: (p: INode) => void) => INode;
- get?: (property: string) => INode;
- remove?: (_?: void) => void;
- nodes?: (_?: void) => INode[];
- pop?: (_?: void) => INode;
+ filter?: (p: (p: Node) => boolean) => Node;
+ find?: (objectExpression: object, filterExpression?: object) => Node;
+ forEach?: (p: (p: Node) => void) => Node;
+ get?: (property: string) => Node;
+ remove?: () => void;
+ nodes?: () => Node[];
+ pop?: () => Node;
key?: {
name: string;
- value: INode | string;
+ value: Node | string;
};
- node?: INode;
+ node?: Node;
name?: string;
object?: object;
- parent?: INode;
- properties?: INode[];
- property?: INode;
+ parent?: Node;
+ properties?: Node[];
+ property?: Node;
prune?: Function;
- replaceWith?: (objectExpression: object) => INode;
- size?: (_?: void) => number;
+ replaceWith?: (objectExpression: object) => Node;
+ size?: () => number;
type?: string;
- value?: INode | string | any;
- toSource?: (object: {
- quote?: string,
- }) => string;
+ value?: Node | string | Node[];
+ toSource?: (
+ object: {
+ quote?: string;
+ }
+ ) => string;
source?: string;
- ast?: INode;
- rules?: IModuleRule[];
- __paths?: INode[];
+ ast?: Node;
+ rules?: ModuleRule[];
+
+ declarations?: Node[];
+
+ __paths?: Node[];
}
-interface IModuleRule {
+interface ModuleRule {
loader?: string;
}
-interface IExpressionObject {
+interface ExpressionObject {
name?: string;
}
-export interface IJSCodeshift extends Object {
- (source?: INode | string): INode;
- withParser?: (parser: string) => IJSCodeshift;
- identifier?: (key: string) => INode;
- literal?: (key: valueType) => INode;
- memberExpression?: (node1: INode, node2: INode, bool?: boolean) => INode;
- objectProperty?: (key: INode, property: valueType) => INode;
- objectExpression?: (properties: INode[]) => INode;
- newExpression?: (expression: INode, args: INode[]) => INode;
- callExpression?: (expression: INode, args: INode[]) => INode;
- variableDeclarator?: (key: INode, args: INode) => INode;
- variableDeclaration?: (key: string, args: INode[]) => INode;
- arrayExpression?: (args?: INode[]) => INode;
- property?: (type: string, key: INode, value: INode) => INode;
- program?: (nodes: INode[]) => INode;
- booleanLiteral?: (bool: boolean) => INode;
- arrowFunctionExpression?: (params: INode[], body: INode, exp: INode) => INode;
- blockStatement?: (body: INode[]) => INode;
- ifStatement?: (test: INode, consequent: INode, alternate?: INode) => INode;
- returnStatement?: (arg: INode) => INode;
- binaryExpression?: (operator: string, left: INode, right: INode) => INode;
-
- Property?: IExpressionObject;
- NewExpression?: IExpressionObject;
- CallExpression?: IExpressionObject;
- VariableDeclarator?: IExpressionObject;
- Identifier?: IExpressionObject;
- Literal?: IExpressionObject;
- ArrayExpression?: IExpressionObject;
- MemberExpression?: IExpressionObject;
- FunctionExpression?: IExpressionObject;
- ObjectExpression?: IExpressionObject;
- BlockStatement?: IExpressionObject;
- Program?: IExpressionObject;
- ArrowFunctionExpression?: IExpressionObject;
+export interface JSCodeshift extends Object {
+ (source?: Node | string): Node;
+ withParser?: (parser: string) => JSCodeshift;
+ identifier?: (key: string) => Node;
+ literal?: (key: valueType) => Node;
+ memberExpression?: (node1: Node, node2: Node, bool?: boolean) => Node;
+ objectProperty?: (key: Node, property: valueType) => Node;
+ objectExpression?: (properties: Node[]) => Node;
+ newExpression?: (expression: Node, args: Node[]) => Node;
+ callExpression?: (expression: Node, args: Node[]) => Node;
+ variableDeclarator?: (key: Node, args: Node) => Node;
+ variableDeclaration?: (key: string, args: Node[]) => Node;
+ arrayExpression?: (args?: Node[]) => Node;
+ property?: (type: string, key: Node, value: Node) => Node;
+ program?: (nodes: Node[]) => Node;
+ booleanLiteral?: (bool: boolean) => Node;
+ Property?: ExpressionObject;
+ NewExpression?: ExpressionObject;
+ CallExpression?: ExpressionObject;
+ VariableDeclarator?: ExpressionObject;
+ Identifier?: ExpressionObject;
+ Literal?: ExpressionObject;
+ ArrayExpression?: ExpressionObject;
+ MemberExpression?: ExpressionObject;
+ FunctionExpression?: ExpressionObject;
+ ObjectExpression?: ExpressionObject;
+ BlockStatement?: ExpressionObject;
+ Program?: ExpressionObject;
filters?: {
VariableDeclarator: {
- requiresModule: Function,
- },
+ requiresModule: Function;
+ };
};
}
-export type valueType = string | number | boolean | any[] | INode | null;
+export type valueType = string | number | boolean | Node | null;
diff --git a/packages/migrate/types/index.ts b/packages/migrate/types/index.ts
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/packages/migrate/uglifyJsPlugin/__snapshots__/uglifyJsPlugin.test.js.snap b/packages/migrate/uglifyJsPlugin/__tests__/__snapshots__/uglifyJsPlugin.test.ts.snap
similarity index 86%
rename from packages/migrate/uglifyJsPlugin/__snapshots__/uglifyJsPlugin.test.js.snap
rename to packages/migrate/uglifyJsPlugin/__tests__/__snapshots__/uglifyJsPlugin.test.ts.snap
index b53445ca5a1..5559fd99aa5 100644
--- a/packages/migrate/uglifyJsPlugin/__snapshots__/uglifyJsPlugin.test.js.snap
+++ b/packages/migrate/uglifyJsPlugin/__tests__/__snapshots__/uglifyJsPlugin.test.ts.snap
@@ -10,13 +10,13 @@ exports[`uglifyJsPlugin transforms correctly using "uglifyJsPlugin-0" data 1`] =
`;
exports[`uglifyJsPlugin transforms correctly using "uglifyJsPlugin-1" data 1`] = `
-"const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
+"const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
devtool: \\"source-map\\",
optimization: {
minimize: true,
- minimizer: [new UglifyJsPlugin({
+ minimizer: [new TerserPlugin({
sourceMap: true,
compress: {}
})]
@@ -26,13 +26,13 @@ module.exports = {
`;
exports[`uglifyJsPlugin transforms correctly using "uglifyJsPlugin-2" data 1`] = `
-"const Uglify = require('uglifyjs-webpack-plugin');
+"const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
devtool: \\"source-map\\",
optimization: {
minimize: true,
- minimizer: [new Uglify({
+ minimizer: [new TerserPlugin({
sourceMap: true,
compress: {}
})]
@@ -78,7 +78,7 @@ exports[`uglifyJsPlugin transforms correctly using "uglifyJsPlugin-3" data 1`] =
`;
exports[`uglifyJsPlugin transforms correctly using "uglifyJsPlugin-4" data 1`] = `
-"const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
+"const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
devtool: 'eval',
@@ -110,7 +110,7 @@ module.exports = {
optimization: {
minimize: true,
- minimizer: [new UglifyJsPlugin({
+ minimizer: [new TerserPlugin({
sourceMap: true
})]
}
diff --git a/packages/migrate/uglifyJsPlugin/__testfixtures__/uglifyJsPlugin-0.input.js b/packages/migrate/uglifyJsPlugin/__tests__/__testfixtures__/uglifyJsPlugin-0.input.js
similarity index 100%
rename from packages/migrate/uglifyJsPlugin/__testfixtures__/uglifyJsPlugin-0.input.js
rename to packages/migrate/uglifyJsPlugin/__tests__/__testfixtures__/uglifyJsPlugin-0.input.js
diff --git a/packages/migrate/uglifyJsPlugin/__testfixtures__/uglifyJsPlugin-1.input.js b/packages/migrate/uglifyJsPlugin/__tests__/__testfixtures__/uglifyJsPlugin-1.input.js
similarity index 100%
rename from packages/migrate/uglifyJsPlugin/__testfixtures__/uglifyJsPlugin-1.input.js
rename to packages/migrate/uglifyJsPlugin/__tests__/__testfixtures__/uglifyJsPlugin-1.input.js
diff --git a/packages/migrate/uglifyJsPlugin/__testfixtures__/uglifyJsPlugin-2.input.js b/packages/migrate/uglifyJsPlugin/__tests__/__testfixtures__/uglifyJsPlugin-2.input.js
similarity index 100%
rename from packages/migrate/uglifyJsPlugin/__testfixtures__/uglifyJsPlugin-2.input.js
rename to packages/migrate/uglifyJsPlugin/__tests__/__testfixtures__/uglifyJsPlugin-2.input.js
diff --git a/packages/migrate/uglifyJsPlugin/__testfixtures__/uglifyJsPlugin-3.input.js b/packages/migrate/uglifyJsPlugin/__tests__/__testfixtures__/uglifyJsPlugin-3.input.js
similarity index 100%
rename from packages/migrate/uglifyJsPlugin/__testfixtures__/uglifyJsPlugin-3.input.js
rename to packages/migrate/uglifyJsPlugin/__tests__/__testfixtures__/uglifyJsPlugin-3.input.js
diff --git a/packages/migrate/uglifyJsPlugin/__testfixtures__/uglifyJsPlugin-4.input.js b/packages/migrate/uglifyJsPlugin/__tests__/__testfixtures__/uglifyJsPlugin-4.input.js
similarity index 100%
rename from packages/migrate/uglifyJsPlugin/__testfixtures__/uglifyJsPlugin-4.input.js
rename to packages/migrate/uglifyJsPlugin/__tests__/__testfixtures__/uglifyJsPlugin-4.input.js
diff --git a/packages/migrate/uglifyJsPlugin/__tests__/uglifyJsPlugin.test.ts b/packages/migrate/uglifyJsPlugin/__tests__/uglifyJsPlugin.test.ts
new file mode 100644
index 00000000000..d5e3ddbaf97
--- /dev/null
+++ b/packages/migrate/uglifyJsPlugin/__tests__/uglifyJsPlugin.test.ts
@@ -0,0 +1,10 @@
+import defineTest from "@webpack-cli/utils/defineTest";
+import { join } from "path";
+
+const dirName: string = join(__dirname, "..");
+
+defineTest(dirName, "uglifyJsPlugin", "uglifyJsPlugin-0");
+defineTest(dirName, "uglifyJsPlugin", "uglifyJsPlugin-1");
+defineTest(dirName, "uglifyJsPlugin", "uglifyJsPlugin-2");
+defineTest(dirName, "uglifyJsPlugin", "uglifyJsPlugin-3");
+defineTest(dirName, "uglifyJsPlugin", "uglifyJsPlugin-4");
diff --git a/packages/migrate/uglifyJsPlugin/uglifyJsPlugin.test.js b/packages/migrate/uglifyJsPlugin/uglifyJsPlugin.test.js
deleted file mode 100644
index d60cd4ba928..00000000000
--- a/packages/migrate/uglifyJsPlugin/uglifyJsPlugin.test.js
+++ /dev/null
@@ -1,9 +0,0 @@
-"use strict";
-
-const defineTest = require("@webpack-cli/utils/defineTest").default;
-
-defineTest(__dirname, "uglifyJsPlugin", "uglifyJsPlugin-0");
-defineTest(__dirname, "uglifyJsPlugin", "uglifyJsPlugin-1");
-defineTest(__dirname, "uglifyJsPlugin", "uglifyJsPlugin-2");
-defineTest(__dirname, "uglifyJsPlugin", "uglifyJsPlugin-3");
-defineTest(__dirname, "uglifyJsPlugin", "uglifyJsPlugin-4");
diff --git a/packages/migrate/uglifyJsPlugin/uglifyJsPlugin.ts b/packages/migrate/uglifyJsPlugin/uglifyJsPlugin.ts
index dbf5f8152fa..71980715a60 100644
--- a/packages/migrate/uglifyJsPlugin/uglifyJsPlugin.ts
+++ b/packages/migrate/uglifyJsPlugin/uglifyJsPlugin.ts
@@ -3,10 +3,10 @@ import {
findPluginsArrayAndRemoveIfEmpty,
findPluginsByName,
getRequire,
- safeTraverse,
+ safeTraverse
} from "@webpack-cli/utils/ast-utils";
-import { IJSCodeshift, INode } from "../types/NodePath";
+import { JSCodeshift, Node } from "../types/NodePath";
/**
*
@@ -15,43 +15,41 @@ import { IJSCodeshift, INode } from "../types/NodePath";
* and adds `optimization.minimize: true` to config
*
* If any configuration is passed to UglifyWebpackPlugin
- * plugin instantiation is moved to `optimization.minimizer`.
+ * UglifyWebpackPlugin is replaced with TerserPlugin
+ * and plugin instantiation is moved to `optimization.minimizer`.
*
* @param {Object} j - jscodeshift top-level import
* @param {Node} ast - jscodeshift ast to transform
* @returns {Node} ast - jscodeshift ast
*/
-export default function(j: IJSCodeshift, ast: INode): INode {
-
+export default function(j: JSCodeshift, ast: Node): Node {
let pluginVariableAssignment: string = null;
- const searchForRequirePlugin: INode = ast
+ const searchForRequirePlugin: Node = ast
.find(j.VariableDeclarator)
- .filter(
- j.filters.VariableDeclarator.requiresModule("uglifyjs-webpack-plugin"),
- );
+ .filter(j.filters.VariableDeclarator.requiresModule("uglifyjs-webpack-plugin"));
/**
* Look for a variable declaration which requires uglifyjs-webpack-plugin
* saves the name of this variable.
*/
- searchForRequirePlugin.forEach((node: INode): void => {
- pluginVariableAssignment = node.value.id.name;
- });
+ searchForRequirePlugin.forEach(
+ (node: Node): void => {
+ pluginVariableAssignment = (node.value as Node).id.name;
+ }
+ );
- pluginVariableAssignment = !pluginVariableAssignment
- ? "webpack.optimize.UglifyJsPlugin"
- : pluginVariableAssignment;
+ pluginVariableAssignment = !pluginVariableAssignment ? "webpack.optimize.UglifyJsPlugin" : pluginVariableAssignment;
- findPluginsByName(j, ast, [pluginVariableAssignment])
- .forEach((node: INode): void => {
+ findPluginsByName(j, ast, [pluginVariableAssignment]).forEach(
+ (node: Node): void => {
let expressionContent: object = null;
- const configBody: INode = safeTraverse(node, ["parent", "parent", "parent"]);
+ const configBody = safeTraverse(node, ["parent", "parent", "parent"]);
// options passed to plugin
- const pluginOptions: INode[] = node.value.arguments;
+ const pluginOptions: Node[] = (node.value as Node).arguments;
/**
* check if there are any options passed to UglifyWebpackPlugin
@@ -60,67 +58,55 @@ export default function(j: IJSCodeshift, ast: INode): INode {
*/
if (pluginOptions.length) {
/*
- * If user is using UglifyJsPlugin directly from webpack
- * transformation must:
- * - remove it
- * - add require for uglify-webpack-plugin
- * - add to minimizer
- */
- if (pluginVariableAssignment && pluginVariableAssignment.includes("webpack")) {
- // create require for uglify-webpack-plugin
- const pathRequire: INode = getRequire(
- j,
- "UglifyJsPlugin",
- "uglifyjs-webpack-plugin",
+ * If user is using UglifyJsPlugin directly from webpack
+ * transformation must:
+ * - remove it
+ * - add require for terser-webpack-plugin
+ * - add to minimizer
+ */
+ if (pluginVariableAssignment) {
+ // remove require for uglify-webpack-plugin
+ searchForRequirePlugin.remove();
+
+ // create require for terser-webpack-plugin
+ const pathRequire: Node = getRequire(j, "TerserPlugin", "terser-webpack-plugin");
+ // prepend to source code.
+ ast.find(j.Program).replaceWith(
+ (p: Node): Node => j.program([].concat(pathRequire).concat((p.value as Node).body))
);
- // append to source code.
- ast
- .find(j.Program)
- .replaceWith((p: INode): INode =>
- j.program([].concat(pathRequire).concat(p.value.body)),
- );
expressionContent = j.property(
"init",
j.identifier("minimizer"),
- j.arrayExpression([
- j.newExpression(j.identifier("UglifyJsPlugin"), [pluginOptions[0]]),
- ]),
+ j.arrayExpression([j.newExpression(j.identifier("TerserPlugin"), [pluginOptions[0]])])
);
} else {
- expressionContent = j.property(
- "init",
- j.identifier("minimizer"),
- j.arrayExpression([node.value]),
- );
+ expressionContent = j.property("init", j.identifier("minimizer"), j.arrayExpression([node.value as Node]));
}
} else {
- searchForRequirePlugin.forEach((n: INode): void => j(n).remove());
+ searchForRequirePlugin.forEach((n: Node): void => j(n).remove());
}
const minimizeProperty = createProperty(j, "minimize", "true");
// creates optimization property at the body of the config.
if (expressionContent) {
- configBody.value.properties.push(
+ ((configBody as Node).value as Node).properties.push(
j.property(
"init",
j.identifier("optimization"),
- j.objectExpression([minimizeProperty, expressionContent]),
- ),
+ j.objectExpression([minimizeProperty, expressionContent])
+ )
);
} else {
- configBody.value.properties.push(
- j.property(
- "init",
- j.identifier("optimization"),
- j.objectExpression([minimizeProperty]),
- ),
+ ((configBody as Node).value as Node).properties.push(
+ j.property("init", j.identifier("optimization"), j.objectExpression([minimizeProperty]))
);
}
// remove the old Uglify plugin from Plugins array.
j(node).remove();
- });
+ }
+ );
findPluginsArrayAndRemoveIfEmpty(j, ast);
diff --git a/packages/remove/.eslintrc b/packages/remove/.eslintrc
new file mode 100644
index 00000000000..365d9f85d71
--- /dev/null
+++ b/packages/remove/.eslintrc
@@ -0,0 +1,11 @@
+{
+ "root": true,
+ "extends": [
+ "../../.eslintrc.js",
+ "plugin:@typescript-eslint/recommended",
+ "prettier",
+ "prettier/@typescript-eslint"
+ ],
+ "parser": "@typescript-eslint/parser",
+ "plugins": ["@typescript-eslint"]
+}
diff --git a/packages/remove/README.md b/packages/remove/README.md
index 6af72b205f4..f6404874945 100644
--- a/packages/remove/README.md
+++ b/packages/remove/README.md
@@ -1,8 +1,10 @@
# 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
@@ -15,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
-```
\ No newline at end of file
+```
+
+[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/remove/index.ts b/packages/remove/index.ts
index ce6e0dbf8e0..429cbd8805c 100644
--- a/packages/remove/index.ts
+++ b/packages/remove/index.ts
@@ -11,10 +11,10 @@ import modifyConfigHelper from "@webpack-cli/utils/modify-config-helper";
*/
export default function remove(...args: string[]): Function {
- const DEFAULT_WEBPACK_CONFIG_FILENAME: string = "webpack.config.js";
+ const DEFAULT_WEBPACK_CONFIG_FILENAME = "webpack.config.js";
- const filePaths: string[] = args.slice(3);
- let configFile: string = DEFAULT_WEBPACK_CONFIG_FILENAME;
+ const filePaths = args.slice(3);
+ let configFile = DEFAULT_WEBPACK_CONFIG_FILENAME;
if (filePaths.length) {
configFile = filePaths[0];
}
diff --git a/packages/remove/package.json b/packages/remove/package.json
index 2f7406f695b..f24508ef4e1 100644
--- a/packages/remove/package.json
+++ b/packages/remove/package.json
@@ -20,6 +20,5 @@
"scripts": {
"build": "tsc",
"watch": "npm run build && tsc -w"
- },
- "gitHead": "6846f2eb8f0d04acc4453cb20da10263ff00a139"
+ }
}
diff --git a/packages/serve/.eslintrc b/packages/serve/.eslintrc
new file mode 100644
index 00000000000..365d9f85d71
--- /dev/null
+++ b/packages/serve/.eslintrc
@@ -0,0 +1,11 @@
+{
+ "root": true,
+ "extends": [
+ "../../.eslintrc.js",
+ "plugin:@typescript-eslint/recommended",
+ "prettier",
+ "prettier/@typescript-eslint"
+ ],
+ "parser": "@typescript-eslint/parser",
+ "plugins": ["@typescript-eslint"]
+}
diff --git a/packages/serve/README.md b/packages/serve/README.md
index eb647361781..204f5b65813 100644
--- a/packages/serve/README.md
+++ b/packages/serve/README.md
@@ -1,8 +1,10 @@
# webpack-cli serve
+[![NPM Downloads][downloads]][downloads-url]
+
## Description
-This package contains the logic to run webpack-serve without using webpack-serve directly.
+This package contains the logic to run [webpack-dev-server](https://github.com/webpack/webpack-dev-server) to serve your webpack app and provide live reloading.
## Installation
@@ -15,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").serve;
+const serve = require("@webpack-cli/serve").default;
serve();
```
### CLI (via `webpack-cli`)
+
```bash
npx webpack-cli serve
-```
\ No newline at end of file
+```
+
+[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/serve/index.ts b/packages/serve/index.ts
index 7272733435d..8ae5a867368 100644
--- a/packages/serve/index.ts
+++ b/packages/serve/index.ts
@@ -17,7 +17,7 @@ import { List } from "@webpack-cli/webpack-scaffold";
const spawnNPMWithArg = (cmd: string): SpawnSyncReturns =>
spawn.sync("npm", ["install", "webpack-dev-server", cmd], {
- stdio: "inherit",
+ stdio: "inherit"
});
/**
@@ -30,7 +30,7 @@ const spawnNPMWithArg = (cmd: string): SpawnSyncReturns =>
const spawnYarnWithArg = (cmd: string): SpawnSyncReturns =>
spawn.sync("yarn", ["add", "webpack-dev-server", cmd], {
- stdio: "inherit",
+ stdio: "inherit"
});
/**
@@ -47,44 +47,38 @@ const getRootPathModule = (dep: string): string => path.resolve(process.cwd(), d
*
* Prompts for installing the devServer and running it
*
- * @param {Object} args - args processed from the CLI
+ * @param {String[]} args - args processed from the CLI
* @returns {Function} invokes the devServer API
*/
-function serve() {
- const packageJSONPath: string = getRootPathModule("package.json");
+export default function serve(): Promise {
+ const packageJSONPath = getRootPathModule("package.json");
if (!packageJSONPath) {
- console.error(
- "\n",
- chalk.red("✖ Could not find your package.json file"),
- "\n",
- );
+ console.error("\n", chalk.red("✖ Could not find your package.json file"), "\n");
process.exit(1);
}
+ // TODO: to refactor this dynamic require and use import()
+ // eslint-disable-next-line
const packageJSON: object = require(packageJSONPath);
/*
* We gotta do this, cause some configs might not have devdep,
* dep or optional dep, so we'd need sanity checks for each
- */
+ */
const hasDevServerDep: string[] = packageJSON
- ? Object.keys(packageJSON).filter((p: string) => packageJSON[p]["webpack-dev-server"])
+ ? Object.keys(packageJSON).filter((p: string): boolean => packageJSON[p]["webpack-dev-server"])
: [];
if (hasDevServerDep.length) {
- const WDSPath: string = getRootPathModule(
- "node_modules/webpack-dev-server/bin/webpack-dev-server.js",
- );
+ const WDSPath: string = getRootPathModule("node_modules/webpack-dev-server/bin/webpack-dev-server.js");
if (!WDSPath) {
console.error(
"\n",
- chalk.red(
- "✖ Could not find the webpack-dev-server dependency in node_modules root path",
- ),
+ chalk.red("✖ Could not find the webpack-dev-server dependency in node_modules root path")
);
console.info(
chalk.bold.green(" ✔︎"),
"Try this command:",
- chalk.bold.green("rm -rf node_modules && npm install"),
+ chalk.bold.green("rm -rf node_modules && npm install")
);
process.exit(1);
}
@@ -92,14 +86,12 @@ function serve() {
} else {
process.stdout.write(
"\n" +
- chalk.bold(
- "✖ We didn't find any webpack-dev-server dependency in your project,",
- ) +
+ chalk.bold("✖ We didn't find any webpack-dev-server dependency in your project,") +
"\n" +
chalk.bold.green(" 'webpack serve'") +
" " +
chalk.bold("requires you to have it installed ") +
- "\n\n",
+ "\n\n"
);
return inquirer
.prompt([
@@ -107,72 +99,68 @@ function serve() {
default: "Y",
message: "Do you want to install it? (default: Y)",
name: "confirmDevserver",
- type: "confirm",
- },
+ type: "confirm"
+ }
])
- .then((answer: {
- confirmDevserver: boolean,
- }) => {
- if (answer.confirmDevserver) {
- return inquirer
- .prompt(
- List(
- "confirmDepType",
- "What kind of dependency do you want it to be under? (default: devDependency)",
- ["devDependency", "optionalDependency", "dependency"],
- ),
- )
- .then((depTypeAns: {
- confirmDepType: string;
- }) => {
- const packager: string = getRootPathModule("package-lock.json")
- ? "npm"
- : "yarn";
- let spawnAction: (_?: void) => SpawnSyncReturns;
- if (depTypeAns.confirmDepType === "devDependency") {
- if (packager === "yarn") {
- spawnAction = (_?: void) => spawnYarnWithArg("--dev");
- } else {
- spawnAction = (_?: void) => spawnNPMWithArg("--save-dev");
- }
- }
- if (depTypeAns.confirmDepType === "dependency") {
- if (packager === "yarn") {
- spawnAction = (_?: void) => spawnYarnWithArg(" ");
- } else {
- spawnAction = (_?: void) => spawnNPMWithArg("--save");
+ .then(
+ (answer: { confirmDevserver: boolean }): Promise => {
+ if (answer.confirmDevserver) {
+ return inquirer
+ .prompt(
+ List(
+ "confirmDepType",
+ "What kind of dependency do you want it to be under? (default: devDependency)",
+ ["devDependency", "optionalDependency", "dependency"]
+ )
+ )
+ .then(
+ (depTypeAns: { confirmDepType: string }): Promise => {
+ const packager: string = getRootPathModule("package-lock.json") ? "npm" : "yarn";
+ let spawnAction: () => SpawnSyncReturns;
+ if (depTypeAns.confirmDepType === "devDependency") {
+ if (packager === "yarn") {
+ spawnAction = (): SpawnSyncReturns => spawnYarnWithArg("--dev");
+ } else {
+ spawnAction = (): SpawnSyncReturns => spawnNPMWithArg("--save-dev");
+ }
+ }
+ if (depTypeAns.confirmDepType === "dependency") {
+ if (packager === "yarn") {
+ spawnAction = (): SpawnSyncReturns => spawnYarnWithArg(" ");
+ } else {
+ spawnAction = (): SpawnSyncReturns => spawnNPMWithArg("--save");
+ }
+ }
+ if (depTypeAns.confirmDepType === "optionalDependency") {
+ if (packager === "yarn") {
+ spawnAction = (): SpawnSyncReturns =>
+ spawnYarnWithArg("--optional");
+ } else {
+ spawnAction = (): SpawnSyncReturns =>
+ spawnNPMWithArg("--save-optional");
+ }
+ }
+ return processPromise(spawnAction()).then(
+ (): Promise => {
+ // Recursion doesn't work well with require call being cached
+ delete require.cache[require.resolve(packageJSONPath)];
+ return serve();
+ }
+ );
}
- }
- if (depTypeAns.confirmDepType === "optionalDependency") {
- if (packager === "yarn") {
- spawnAction = (_?: void) => spawnYarnWithArg("--optional");
- } else {
- spawnAction = (_?: void) => spawnNPMWithArg("--save-optional");
- }
- }
- return processPromise(spawnAction())
- .then((_: void) => {
- // Recursion doesn't work well with require call being cached
- delete require.cache[require.resolve(packageJSONPath)];
- return serve();
- });
- });
- } else {
- console.error(chalk.bold.red("✖ Serve aborted due cancelling"));
+ );
+ } else {
+ console.error(chalk.bold.red("✖ Serve aborted due cancelling"));
+ process.exitCode = 1;
+ }
+ }
+ )
+ .catch(
+ (err: object): void => {
+ console.error(chalk.red("✖ Serve aborted due to some errors"));
+ console.error(err);
process.exitCode = 1;
}
- })
- .catch((err: object) => {
- console.error(chalk.red("✖ Serve aborted due to some errors"));
- console.error(err);
- process.exitCode = 1;
- });
+ );
}
}
-
-export = {
- getRootPathModule,
- serve,
- spawnNPMWithArg,
- spawnYarnWithArg,
-};
diff --git a/packages/serve/package.json b/packages/serve/package.json
index 422da6ff3fd..18f77208bc8 100644
--- a/packages/serve/package.json
+++ b/packages/serve/package.json
@@ -26,6 +26,5 @@
"scripts": {
"build": "tsc",
"watch": "npm run build && tsc -w"
- },
- "gitHead": "6846f2eb8f0d04acc4453cb20da10263ff00a139"
+ }
}
diff --git a/packages/update/.eslintrc b/packages/update/.eslintrc
new file mode 100644
index 00000000000..365d9f85d71
--- /dev/null
+++ b/packages/update/.eslintrc
@@ -0,0 +1,11 @@
+{
+ "root": true,
+ "extends": [
+ "../../.eslintrc.js",
+ "plugin:@typescript-eslint/recommended",
+ "prettier",
+ "prettier/@typescript-eslint"
+ ],
+ "parser": "@typescript-eslint/parser",
+ "plugins": ["@typescript-eslint"]
+}
diff --git a/packages/update/README.md b/packages/update/README.md
index 16f38f42326..ae6ab2e2dad 100644
--- a/packages/update/README.md
+++ b/packages/update/README.md
@@ -1,5 +1,7 @@
# webpack-cli update
+[![NPM Downloads][downloads]][downloads-url]
+
## Description
This package contains the logic to update properties in a webpack configuration file. It will run a generator that prompts the user for questions of which property to update in their webpack configuration file.
@@ -15,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
-```
\ No newline at end of file
+```
+
+[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/update/index.ts b/packages/update/index.ts
index 09f398b0915..8e15be5217d 100644
--- a/packages/update/index.ts
+++ b/packages/update/index.ts
@@ -11,10 +11,10 @@ import modifyConfigHelper from "@webpack-cli/utils/modify-config-helper";
*/
export default function update(...args: string[]): Function {
- const DEFAULT_WEBPACK_CONFIG_FILENAME: string = "webpack.config.js";
+ const DEFAULT_WEBPACK_CONFIG_FILENAME = "webpack.config.js";
- const filePaths: string[] = args.slice(3);
- let configFile: string = DEFAULT_WEBPACK_CONFIG_FILENAME;
+ const filePaths = args.slice(3);
+ let configFile = DEFAULT_WEBPACK_CONFIG_FILENAME;
if (filePaths.length) {
configFile = filePaths[0];
}
diff --git a/packages/update/package.json b/packages/update/package.json
index 1f23babb9e3..bd34f903639 100644
--- a/packages/update/package.json
+++ b/packages/update/package.json
@@ -20,6 +20,5 @@
"scripts": {
"build": "tsc",
"watch": "npm run build && tsc -w"
- },
- "gitHead": "6846f2eb8f0d04acc4453cb20da10263ff00a139"
+ }
}
diff --git a/packages/utils/.eslintrc b/packages/utils/.eslintrc
new file mode 100644
index 00000000000..365d9f85d71
--- /dev/null
+++ b/packages/utils/.eslintrc
@@ -0,0 +1,11 @@
+{
+ "root": true,
+ "extends": [
+ "../../.eslintrc.js",
+ "plugin:@typescript-eslint/recommended",
+ "prettier",
+ "prettier/@typescript-eslint"
+ ],
+ "parser": "@typescript-eslint/parser",
+ "plugins": ["@typescript-eslint"]
+}
diff --git a/packages/utils/README.md b/packages/utils/README.md
index 33bc3f771f6..4686cdb4238 100644
--- a/packages/utils/README.md
+++ b/packages/utils/README.md
@@ -1,5 +1,7 @@
# webpack-cli utils (WIP, not yet published)
+[![NPM Downloads][downloads]][downloads-url]
+
## Description
This package contains the utilities used across the webpack-cli repositories.
@@ -11,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
@@ -26,4 +29,7 @@ npm i -D webpack-cli @webpack-cli/utils
```js
const utils = require("@webpack-cli/utils");
// API yet to be exposed
-```
\ No newline at end of file
+```
+
+[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/utils/__tests__/.eslintrc b/packages/utils/__tests__/.eslintrc
new file mode 100644
index 00000000000..5d4340a351d
--- /dev/null
+++ b/packages/utils/__tests__/.eslintrc
@@ -0,0 +1,7 @@
+{
+ "root": true,
+ "extends": ["../.eslintrc"],
+ "rules": {
+ "@typescript-eslint/explicit-function-return-type": ["off"]
+ }
+}
diff --git a/packages/utils/__snapshots__/ast-utils.test.js.snap b/packages/utils/__tests__/__snapshots__/ast-utils.test.ts.snap
similarity index 96%
rename from packages/utils/__snapshots__/ast-utils.test.js.snap
rename to packages/utils/__tests__/__snapshots__/ast-utils.test.ts.snap
index 39b61acb349..0e3eab43eb3 100644
--- a/packages/utils/__snapshots__/ast-utils.test.js.snap
+++ b/packages/utils/__tests__/__snapshots__/ast-utils.test.ts.snap
@@ -12,14 +12,13 @@ exports[`utils addProperty add entry property using add 1`] = `
}],
man: () => duper,
+ man: () => duper,
+ nice: ':)',
objects: are,
super: [yeah, {
loader: 'eslint-loader'
- }],
-
- nice: ':)',
- man: () => duper
+ }]
}
}"
`;
@@ -27,14 +26,13 @@ exports[`utils addProperty add entry property using add 1`] = `
exports[`utils addProperty add entry property using init 1`] = `
"module.exports = {
entry: {
+ man: () => duper,
+ nice: ':)',
objects: are,
super: [yeah, {
loader: 'eslint-loader'
- }],
-
- nice: ':)',
- man: () => duper
+ }]
}
}"
`;
diff --git a/packages/utils/__snapshots__/recursive-parser.test.js.snap b/packages/utils/__tests__/__snapshots__/recursive-parser.test.ts.snap
similarity index 98%
rename from packages/utils/__snapshots__/recursive-parser.test.js.snap
rename to packages/utils/__tests__/__snapshots__/recursive-parser.test.ts.snap
index 882e9e5f327..282542a0fd7 100644
--- a/packages/utils/__snapshots__/recursive-parser.test.js.snap
+++ b/packages/utils/__tests__/__snapshots__/recursive-parser.test.ts.snap
@@ -25,23 +25,23 @@ module.exports = {
foo: \\"Promise.resolve()\\",
man: \\"() => duper\\",
mode: \\"yaaa\\",
+ foo: Promise.resolve(),
+ man: () => nice!!,
+ mode: super-man,
+ nice: '=)',
objects: are not,
super: [op, {
- test: /\\\\.(wasm|c)$/,
- loader: 'pia-loader',
enforce: 'pre',
include: [asd, 'Stringy'],
+ loader: 'pia-loader',
options: {
formatter: 'nao'
- }
- }],
+ },
- nice: '=)',
- foo: Promise.resolve(),
- man: () => nice!!,
- mode: super-man
+ test: /\\\\.(wasm|c)$/
+ }]
}
}
"
@@ -50,22 +50,22 @@ module.exports = {
exports[`init transforms correctly using "fixture-1" data 1`] = `
"module.exports = {
entry: {
+ foo: Promise.resolve(),
+ man: () => duper,
+ nice: ':)',
objects: are,
super: [yeah, {
- test: /\\\\.(js|vue)$/,
- loader: 'eslint-loader',
enforce: 'pre',
include: [customObj, 'Stringy'],
+ loader: 'eslint-loader',
options: {
formatter: 'someOption'
- }
- }],
+ },
- nice: ':)',
- foo: Promise.resolve(),
- man: () => duper
+ test: /\\\\.(js|vue)$/
+ }]
}
};"
`;
diff --git a/packages/utils/__testfixtures__/fixture-0.input.js b/packages/utils/__tests__/__testfixtures__/fixture-0.input.js
similarity index 100%
rename from packages/utils/__testfixtures__/fixture-0.input.js
rename to packages/utils/__tests__/__testfixtures__/fixture-0.input.js
diff --git a/packages/utils/__testfixtures__/fixture-1.input.js b/packages/utils/__tests__/__testfixtures__/fixture-1.input.js
similarity index 100%
rename from packages/utils/__testfixtures__/fixture-1.input.js
rename to packages/utils/__tests__/__testfixtures__/fixture-1.input.js
diff --git a/packages/utils/__testfixtures__/fixture-2.input.js b/packages/utils/__tests__/__testfixtures__/fixture-2.input.js
similarity index 100%
rename from packages/utils/__testfixtures__/fixture-2.input.js
rename to packages/utils/__tests__/__testfixtures__/fixture-2.input.js
diff --git a/packages/utils/__testfixtures__/fixture-3.input.js b/packages/utils/__tests__/__testfixtures__/fixture-3.input.js
similarity index 100%
rename from packages/utils/__testfixtures__/fixture-3.input.js
rename to packages/utils/__tests__/__testfixtures__/fixture-3.input.js
diff --git a/packages/utils/ast-utils.test.js b/packages/utils/__tests__/ast-utils.test.ts
similarity index 94%
rename from packages/utils/ast-utils.test.js
rename to packages/utils/__tests__/ast-utils.test.ts
index bdb2ffe901a..6883531049f 100644
--- a/packages/utils/ast-utils.test.js
+++ b/packages/utils/__tests__/ast-utils.test.ts
@@ -1,7 +1,8 @@
"use strict";
-const j = require("jscodeshift/dist/core");
-const utils = require("./ast-utils");
+import * as j from "jscodeshift/dist/core";
+import * as utils from "../ast-utils";
+import { Node } from "../types/NodePath";
describe("utils", () => {
describe("createProperty", () => {
@@ -105,7 +106,7 @@ const a = { plugs: [] }
describe("createOrUpdatePluginByName", () => {
it("should create a new plugin without arguments", () => {
const ast = j("{ plugins: [] }");
- ast.find(j.ArrayExpression).forEach(node => {
+ ast.find(j.ArrayExpression).forEach((node: Node) => {
utils.createOrUpdatePluginByName(j, node, "Plugin");
});
expect(ast.toSource()).toMatchSnapshot();
@@ -113,7 +114,7 @@ const a = { plugs: [] }
it("should create a new plugin with arguments", () => {
const ast = j("{ plugins: [] }");
- ast.find(j.ArrayExpression).forEach(node => {
+ ast.find(j.ArrayExpression).forEach((node: Node) => {
utils.createOrUpdatePluginByName(j, node, "Plugin", {
foo: "bar"
});
@@ -123,7 +124,7 @@ const a = { plugs: [] }
it("should add an object as an argument", () => {
const ast = j("[new Plugin()]");
- ast.find(j.ArrayExpression).forEach(node => {
+ ast.find(j.ArrayExpression).forEach((node: Node) => {
utils.createOrUpdatePluginByName(j, node, "Plugin", {
foo: true
});
@@ -133,7 +134,7 @@ const a = { plugs: [] }
it("should merge options objects", () => {
const ast = j("[new Plugin({ foo: true })]");
- ast.find(j.ArrayExpression).forEach(node => {
+ ast.find(j.ArrayExpression).forEach((node: Node) => {
utils.createOrUpdatePluginByName(j, node, "Plugin", {
bar: "baz",
foo: false
@@ -266,15 +267,15 @@ const a = { plugs: [] }
it("add entry property using init", () => {
const ast = j("module.exports = {}");
const propertyValue = {
+ man: "() => duper",
+ nice: "':)'",
objects: "are",
super: [
"yeah",
{
loader: "'eslint-loader'"
}
- ],
- nice: "':)'",
- man: "() => duper"
+ ]
};
const root = ast.find(j.ObjectExpression);
@@ -299,20 +300,20 @@ const a = { plugs: [] }
}
}`);
const propertyValue = {
+ man: "() => duper",
+ nice: "':)'",
objects: "are",
super: [
"yeah",
{
loader: "'eslint-loader'"
}
- ],
- nice: "':)'",
- man: "() => duper"
+ ]
};
const root = ast.find(j.ObjectExpression);
- utils.findRootNodesByName(j, root, "entry").forEach(p => {
+ utils.findRootNodesByName(j, root, "entry").forEach((p: Node) => {
j(p).replaceWith(utils.addProperty(j, p, "entry", propertyValue, "add"));
});
diff --git a/packages/utils/is-local-path.test.js b/packages/utils/__tests__/is-local-path.test.ts
similarity index 87%
rename from packages/utils/is-local-path.test.js
rename to packages/utils/__tests__/is-local-path.test.ts
index a6db609e694..ca34c0e7b66 100644
--- a/packages/utils/is-local-path.test.js
+++ b/packages/utils/__tests__/is-local-path.test.ts
@@ -1,7 +1,7 @@
"use strict";
-const isLocalPath = require("./is-local-path").default;
-const path = require("path");
+import * as path from "path";
+import isLocalPath from "../is-local-path";
describe("is-local-path", () => {
it("returns true for paths beginning in the current directory", () => {
diff --git a/packages/utils/npm-exists.test.js b/packages/utils/__tests__/npm-exists.test.ts
similarity index 64%
rename from packages/utils/npm-exists.test.js
rename to packages/utils/__tests__/npm-exists.test.ts
index 619e9eda157..2b773259af1 100644
--- a/packages/utils/npm-exists.test.js
+++ b/packages/utils/__tests__/npm-exists.test.ts
@@ -1,15 +1,15 @@
"use strict";
-const exists = require("./npm-exists").default;
+import exists from "../npm-exists";
describe("npm-exists", () => {
it("should successfully existence of a published module", () => {
- exists("webpack-scaffold-demo").then(status => {
+ exists("webpack-scaffold-demo").then((status) => {
expect(status).toBe(true);
});
});
it("should return false for the existence of a fake module", () => {
- exists("webpack-scaffold-noop").then(status => {
+ exists("webpack-scaffold-noop").then((status) => {
expect(status).toBe(false);
});
});
diff --git a/packages/utils/npm-packages-exists.test.js b/packages/utils/__tests__/npm-packages-exists.test.ts
similarity index 59%
rename from packages/utils/npm-packages-exists.test.js
rename to packages/utils/__tests__/npm-packages-exists.test.ts
index fe37675d338..151eb82f863 100644
--- a/packages/utils/npm-packages-exists.test.js
+++ b/packages/utils/__tests__/npm-packages-exists.test.ts
@@ -1,9 +1,11 @@
-const npmPackagesExists = require("./npm-packages-exists").default;
+import npmPackagesExists from "../npm-packages-exists";
+import {resolvePackages} from "../resolve-packages";
-jest.mock("./npm-exists");
-jest.mock("./resolve-packages");
+jest.mock("../npm-exists");
+jest.mock("../resolve-packages");
-const mockResolvePackages = require("./resolve-packages").resolvePackages;
+// TS is not aware that jest changes the type of resolvePackages
+const mockResolvePackages = resolvePackages as jest.Mock;
describe("npmPackagesExists", () => {
test("resolves packages when they are available on the local filesystem", () => {
diff --git a/packages/utils/package-manager.test.js b/packages/utils/__tests__/package-manager.test.ts
similarity index 91%
rename from packages/utils/package-manager.test.js
rename to packages/utils/__tests__/package-manager.test.ts
index e86e015ab0e..baa4204822a 100644
--- a/packages/utils/package-manager.test.js
+++ b/packages/utils/__tests__/package-manager.test.ts
@@ -1,31 +1,33 @@
"use strict";
-const path = require("path");
+import * as path from "path";
+import * as packageManager from "../package-manager";
jest.mock("cross-spawn");
jest.mock("fs");
describe("package-manager", () => {
- const packageManager = require("./package-manager");
+ // eslint-disable-next-line
const spawn = require("cross-spawn");
+ // eslint-disable-next-line
const fs = require("fs");
const defaultSyncResult = {
- pid: 1234,
+ error: null,
output: [null, null, null],
- stdout: null,
- stderr: null,
+ pid: 1234,
signal: null,
status: 1,
- error: null
+ stderr: null,
+ stdout: null,
};
function mockSpawnErrorOnce() {
spawn.sync.mockReturnValueOnce(
Object.assign({}, defaultSyncResult, {
+ error: new Error(),
status: null,
- error: new Error()
- })
+ }),
);
}
@@ -50,7 +52,7 @@ describe("package-manager", () => {
fs.existsSync.mockReturnValueOnce(true);
}
- spawn.sync.mockReturnValue(defaultSyncResult);
+ jest.spyOn(spawn, "sync").mockReturnValue(defaultSyncResult);
it("should return 'yarn' from getPackageManager if it's installed", () => {
expect(packageManager.getPackageManager()).toEqual("yarn");
@@ -101,8 +103,8 @@ describe("package-manager", () => {
// Mock stdout of `yarn global dir`
spawn.sync.mockReturnValueOnce({
stdout: {
- toString: () => `${yarnDir}\n`
- }
+ toString: () => `${yarnDir}\n`,
+ },
});
const globalPath = packageManager.getPathToGlobalPackages();
const expected = path.join(yarnDir, "node_modules");
diff --git a/packages/utils/__tests__/recursive-parser.test.ts b/packages/utils/__tests__/recursive-parser.test.ts
new file mode 100644
index 00000000000..87778124f13
--- /dev/null
+++ b/packages/utils/__tests__/recursive-parser.test.ts
@@ -0,0 +1,65 @@
+"use strict";
+
+import { join } from "path";
+import defineTest from "../defineTest";
+
+defineTest(join(__dirname, ".."), "init", "fixture-1", "entry", {
+ foo: "Promise.resolve()",
+ man: "() => duper",
+ nice: "':)'",
+ objects: "are",
+ super: [
+ "yeah",
+ {
+ enforce: "'pre'",
+ include: ["customObj", "'Stringy'"],
+ loader: "'eslint-loader'",
+ options: {
+ formatter: "'someOption'",
+ },
+ test: new RegExp(/\.(js|vue)$/),
+ },
+ ],
+});
+
+defineTest(join(__dirname, ".."), "add", "fixture-2", "entry", {
+ foo: "Promise.resolve()",
+ man: "() => nice!!",
+ mode: "super-man",
+ nice: "'=)'",
+ objects: "are not",
+ super: [
+ "op",
+ {
+ enforce: "'pre'",
+ include: ["asd", "'Stringy'"],
+ loader: "'pia-loader'",
+ options: {
+ formatter: "'nao'",
+ },
+ test: new RegExp(/\.(wasm|c)$/),
+ },
+ ],
+});
+
+defineTest(join(__dirname, ".."), "remove", "fixture-3", "resolve", {
+ alias: null,
+});
+
+defineTest(join(__dirname, ".."), "remove", "fixture-3", "plugins", ["plugin2"]);
+
+defineTest(join(__dirname, ".."), "remove", "fixture-3", "module", {
+ noParse: null,
+});
+
+defineTest(join(__dirname, ".."), "remove", "fixture-3", "entry", {
+ a: null,
+});
+
+defineTest(join(__dirname, ".."), "remove", "fixture-3", "module", {
+ rules: [
+ {
+ loader: "eslint-loader",
+ },
+ ],
+});
diff --git a/packages/utils/resolve-packages.test.js b/packages/utils/__tests__/resolve-packages.test.ts
similarity index 87%
rename from packages/utils/resolve-packages.test.js
rename to packages/utils/__tests__/resolve-packages.test.ts
index bb30405ff93..765b907f1d2 100644
--- a/packages/utils/resolve-packages.test.js
+++ b/packages/utils/__tests__/resolve-packages.test.ts
@@ -1,11 +1,11 @@
"use strict";
-const path = require("path");
+import * as path from "path";
function mockPromise(value) {
const isValueAPromise = (value || {}).then;
const mockedPromise = {
- then: function(callback) {
+ then(callback) {
return mockPromise(callback(value));
}
};
@@ -17,17 +17,15 @@ function spawnChild(pkg) {
}
function getLoc(option) {
- let packageModule = [];
+ const packageModule = [];
option.filter(pkg => {
- mockPromise(spawnChild(pkg)).then(_ => {
+ mockPromise(spawnChild(pkg)).then(() => {
try {
- let loc = path.join("..", "..", "node_modules", pkg);
+ const loc = path.join("..", "..", "node_modules", pkg);
packageModule.push(loc);
} catch (err) {
throw new Error(
- "Package wasn't validated correctly.." + "Submit an issue for",
- pkg,
- "if this persists"
+ "Package wasn't validated correctly.." + "Submit an issue for " + pkg + " if this persists"
);
}
});
diff --git a/packages/utils/validate-identifier.test.js b/packages/utils/__tests__/validate-identifier.test.ts
similarity index 59%
rename from packages/utils/validate-identifier.test.js
rename to packages/utils/__tests__/validate-identifier.test.ts
index 598c2c1d18e..96d36c09408 100644
--- a/packages/utils/validate-identifier.test.js
+++ b/packages/utils/__tests__/validate-identifier.test.ts
@@ -1,6 +1,6 @@
"use strict";
-const validateIdentifier = require("./validate-identifier");
+import * as validateIdentifier from "../validate-identifier";
describe("validate-identifier", () => {
it("should return true for reserved keyword", () => {
@@ -13,22 +13,27 @@ describe("validate-identifier", () => {
expect(validateIdentifier.isKeyword(l)).toBe(false);
});
- it("should retrun false if literal is not in U+200C zero width non-joiner, U+200D zero width joiner, or any symbol with the Unicode derived core property ID_Continue", () => {
+ it("should retrun false if literal is not in U+200C zero width non-joiner,\
+ U+200D zero width joiner, or any symbol with \
+ the Unicode derived core property ID_Continue", () => {
const l = "\u00A9";
expect(validateIdentifier.isIdentifierChar(l)).toBe(false);
});
- it("should retrun true if literal is in U+200C zero width non-joiner, U+200D zero width joiner, or any symbol with the Unicode derived core property ID_Continue", () => {
+ it("should retrun true if literal is in U+200C zero width non-joiner, U+200D zero width joiner,\
+ or any symbol with the Unicode derived core property ID_Continue", () => {
const l = "foo$bar";
expect(validateIdentifier.isIdentifierChar(l)).toBe(true);
});
- it("should return true if literal name starts with $, _ or any symbol with the unicode derived core property ID_Start", () => {
+ it("should return true if literal name starts with \
+ $, _ or any symbol with the unicode derived core property ID_Start", () => {
const l = "$foo";
expect(validateIdentifier.isIdentifierStart(l)).toBe(true);
});
- it("should return false if literal name does not starts with $, _ or any symbol with the unicode derived core property ID_Start", () => {
+ it("should return false if literal name does not starts with \
+ $, _ or any symbol with the unicode derived core property ID_Start", () => {
const l = "^bar";
expect(validateIdentifier.isIdentifierStart(l)).toBe(false);
});
diff --git a/packages/utils/ast-utils.ts b/packages/utils/ast-utils.ts
index 9d1fc58d50e..7a6fed5a657 100644
--- a/packages/utils/ast-utils.ts
+++ b/packages/utils/ast-utils.ts
@@ -1,4 +1,4 @@
-import { IJSCodeshift, INode, valueType } from "./types/NodePath";
+import { JSCodeshift, Node, valueType } from "./types/NodePath";
import * as validateIdentifier from "./validate-identifier";
/**
@@ -6,11 +6,14 @@ import * as validateIdentifier from "./validate-identifier";
* Traverse safely over a path object for array for paths
* @param {Object} obj - Object on which we traverse
* @param {Array} paths - Array of strings containing the traversal path
- * @returns {Any} Value at given traversal path
+ * @returns {Node} Value at given traversal path
*/
-function safeTraverse(obj: INode, paths: string[]): any {
- let val: INode = obj;
- let idx: number = 0;
+
+function safeTraverse(obj: Node, paths: string[]): Node | Node[] {
+ // TODO: to revisit the type of this function, it's not clear what should return.
+ // Sometimes its return type is used as string
+ let val: Node = obj;
+ let idx = 0;
while (idx < paths.length) {
if (!val) {
@@ -28,23 +31,27 @@ function safeTraverse(obj: INode, paths: string[]): any {
* @param {Node} path - AST node
* @returns {String|Boolean} type at given path.
*/
-function safeTraverseAndGetType(path: INode): string | boolean {
- const pathValue: INode = safeTraverse(path, ["value", "value"]);
+
+function safeTraverseAndGetType(path: Node): string | boolean {
+ const pathValue = safeTraverse(path, ["value", "value"]) as Node;
return pathValue ? pathValue.type : false;
}
-// Convert nested MemberExpressions to strings like webpack.optimize.DedupePlugin
-function memberExpressionToPathString(path: INode) {
+/**
+ * Convert nested MemberExpressions to strings like webpack.optimize.DedupePlugin
+ * @param {Node} path - AST node
+ * @returns {String} member expression string.
+ */
+
+function memberExpressionToPathString(path: Node): string {
if (path && path.object) {
- return [memberExpressionToPathString(path.object), path.property.name].join(
- ".",
- );
+ return [memberExpressionToPathString(path.object), path.property.name].join(".");
}
return path.name;
}
// Convert Array like ['webpack', 'optimize', 'DedupePlugin'] to nested MemberExpressions
-function pathsToMemberExpression(j: IJSCodeshift, paths: string[]): INode {
+function pathsToMemberExpression(j: JSCodeshift, paths: string[]): Node {
if (!paths.length) {
return null;
} else if (paths.length === 1) {
@@ -52,10 +59,7 @@ function pathsToMemberExpression(j: IJSCodeshift, paths: string[]): INode {
} else {
const first: string[] = paths.slice(0, 1);
const rest: string[] = paths.slice(1);
- return j.memberExpression(
- pathsToMemberExpression(j, rest),
- pathsToMemberExpression(j, first),
- );
+ return j.memberExpression(pathsToMemberExpression(j, rest), pathsToMemberExpression(j, first));
}
}
@@ -70,15 +74,14 @@ function pathsToMemberExpression(j: IJSCodeshift, paths: string[]): INode {
* @returns {Node} Node that has the pluginName
*/
-function findPluginsByName(j: IJSCodeshift, node: INode, pluginNamesArray: string[]): INode {
- return node
- .find(j.NewExpression)
- .filter((path: INode): boolean => {
+function findPluginsByName(j: JSCodeshift, node: Node, pluginNamesArray: string[]): Node {
+ return node.find(j.NewExpression).filter(
+ (path: Node): boolean => {
return pluginNamesArray.some(
- (plugin: string) =>
- memberExpressionToPathString(path.get("callee").value) === plugin,
+ (plugin: string): boolean => memberExpressionToPathString(path.get("callee").value as Node) === plugin
);
- });
+ }
+ );
}
/**
@@ -88,20 +91,15 @@ function findPluginsByName(j: IJSCodeshift, node: INode, pluginNamesArray: strin
* @returns {Node} rootNode modified AST.
*/
-function findPluginsArrayAndRemoveIfEmpty(j: IJSCodeshift, rootNode: INode): INode {
- return rootNode
- .find(j.Identifier, { name: "plugins" })
- .forEach((node: INode) => {
- const elements: INode[] = safeTraverse(node, [
- "parent",
- "value",
- "value",
- "elements",
- ]);
+function findPluginsArrayAndRemoveIfEmpty(j: JSCodeshift, rootNode: Node): Node {
+ return rootNode.find(j.Identifier, { name: "plugins" }).forEach(
+ (node: Node): void => {
+ const elements = safeTraverse(node, ["parent", "value", "value", "elements"]) as Node[];
if (!elements.length) {
j(node.parent).remove();
}
- });
+ }
+ );
}
/**
@@ -114,51 +112,10 @@ function findPluginsArrayAndRemoveIfEmpty(j: IJSCodeshift, rootNode: INode): INo
* @returns {Node} found node and
*/
-function findRootNodesByName(j: IJSCodeshift, node: INode, propName: string): INode {
+function findRootNodesByName(j: JSCodeshift, node: Node, propName: string): Node {
return node.find(j.Property, { key: { name: propName } });
}
-/**
- *
- * Creates an Object's property with a given key and value
- *
- * @param {any} j — jscodeshift API
- * @param {String | Number} key - Property key
- * @param {String | Number | Boolean} value - Property value
- * @returns {Node}
- */
-
-function createProperty(j: IJSCodeshift, key: string | number, value: valueType): INode {
- return j.property(
- "init",
- createIdentifierOrLiteral(j, key),
- createLiteral(j, value),
- );
-}
-
-/**
- *
- * Creates an appropriate literal property
- *
- * @param {any} j — jscodeshift API
- * @param {String | Boolean | Number} val
- * @returns {Node}
- */
-
-function createLiteral(j: IJSCodeshift, val: valueType): INode {
- let literalVal: valueType = val;
- // We'll need String to native type conversions
- if (typeof val === "string") {
- // 'true' => true
- if (val === "true") { literalVal = true; }
- // 'false' => false
- if (val === "false") { literalVal = false; }
- // '1' => 1
- if (!isNaN(Number(val))) { literalVal = Number(val); }
- }
- return j.literal(literalVal);
-}
-
/**
*
* Creates an appropriate identifier or literal property
@@ -168,12 +125,12 @@ function createLiteral(j: IJSCodeshift, val: valueType): INode {
* @returns {Node}
*/
-function createIdentifierOrLiteral(j: IJSCodeshift, val: valueType): INode {
+function createIdentifierOrLiteral(j: JSCodeshift, val: valueType): Node {
// IPath | IPath doesn't work, find another way
let literalVal = val;
// We'll need String to native type conversions
if (!Array.isArray(val)) {
- if (typeof val === "string" || typeof val === "object" && val.__paths) {
+ if (typeof val === "string" || (typeof val === "object" && val.__paths)) {
// 'true' => true
if (val === "true") {
literalVal = true;
@@ -190,7 +147,7 @@ function createIdentifierOrLiteral(j: IJSCodeshift, val: valueType): INode {
return j.literal(literalVal);
}
if (typeof val === "object" && val.__paths) {
- const regExpVal = val.__paths[0].value.program.body[0].expression;
+ const regExpVal = ((val.__paths[0].value as JSCodeshift).program as Node).body[0].expression;
return j.literal(regExpVal.value);
} else if (typeof literalVal === "string") {
// Use identifier instead
@@ -207,6 +164,49 @@ function createIdentifierOrLiteral(j: IJSCodeshift, val: valueType): INode {
return j.literal(literalVal);
}
+/**
+ *
+ * Creates an appropriate literal property
+ *
+ * @param {any} j — jscodeshift API
+ * @param {String | Boolean | Number} val
+ * @returns {Node}
+ */
+
+function createLiteral(j: JSCodeshift, val: valueType): Node {
+ let literalVal: valueType = val;
+ // We'll need String to native type conversions
+ if (typeof val === "string") {
+ // 'true' => true
+ if (val === "true") {
+ literalVal = true;
+ }
+ // 'false' => false
+ if (val === "false") {
+ literalVal = false;
+ }
+ // '1' => 1
+ if (!isNaN(Number(val))) {
+ literalVal = Number(val);
+ }
+ }
+ return j.literal(literalVal);
+}
+
+/**
+ *
+ * Creates an Object's property with a given key and value
+ *
+ * @param {any} j — jscodeshift API
+ * @param {String | Number} key - Property key
+ * @param {String | Number | Boolean} value - Property value
+ * @returns {Node}
+ */
+
+function createProperty(j: JSCodeshift, key: string | number, value: valueType): Node {
+ return j.property("init", createIdentifierOrLiteral(j, key), createLiteral(j, value));
+}
+
/**
*
* Adds or updates the value of a key within a root
@@ -221,35 +221,32 @@ function createIdentifierOrLiteral(j: IJSCodeshift, val: valueType): INode {
*/
function addOrUpdateConfigObject(
- j: IJSCodeshift, rootNode: INode, configProperty: string, key: string, value: valueType,
+ j: JSCodeshift,
+ rootNode: Node,
+ configProperty: string,
+ key: string,
+ value: valueType
): void {
-
- const propertyExists = rootNode.properties.filter(
- (node: INode): boolean => node.key.name === configProperty,
- ).length;
+ const propertyExists = rootNode.properties.filter((node: Node): boolean => node.key.name === configProperty).length;
if (propertyExists) {
rootNode.properties
- .filter((path: INode) => path.key.name === configProperty)
- .forEach((path: INode) => {
- const newProperties = path.value.properties.filter(
- (p: INode) => p.key.name !== key,
- );
- newProperties.push(
- j.objectProperty(
- j.identifier(key), value,
- ),
- );
- path.value.properties = newProperties;
- });
+ .filter((path: Node): boolean => path.key.name === configProperty)
+ .forEach(
+ (path: Node): void => {
+ const newProperties = (path.value as Node).properties.filter(
+ (p: Node): boolean => p.key.name !== key
+ );
+ newProperties.push(j.objectProperty(j.identifier(key), value));
+ (path.value as Node).properties = newProperties;
+ }
+ );
} else {
rootNode.properties.push(
j.objectProperty(
j.identifier(configProperty),
- j.objectExpression(
- [j.objectProperty(j.identifier(key), value)],
- ),
- ),
+ j.objectExpression([j.objectProperty(j.identifier(key), value)])
+ )
);
}
}
@@ -265,20 +262,22 @@ function addOrUpdateConfigObject(
* @returns {Node | Void} - path to the root webpack configuration object if plugin is found
*/
-function findAndRemovePluginByName(j: IJSCodeshift, node: INode, pluginName: string): INode {
- let rootPath: INode;
+function findAndRemovePluginByName(j: JSCodeshift, node: Node, pluginName: string): Node {
+ let rootPath: Node;
findPluginsByName(j, node, [pluginName])
- .filter((path: INode) => safeTraverse(path, ["parent", "value"]))
- .forEach((path: INode) => {
- rootPath = safeTraverse(path, ["parent", "parent", "parent", "value"]);
- const arrayPath: INode = path.parent.value;
- if (arrayPath.elements && arrayPath.elements.length === 1) {
- j(path.parent.parent).remove();
- } else {
- j(path).remove();
+ .filter((path: Node): boolean => !!safeTraverse(path, ["parent", "value"]))
+ .forEach(
+ (path: Node): void => {
+ rootPath = safeTraverse(path, ["parent", "parent", "parent", "value"]) as Node;
+ const arrayPath = path.parent.value as Node;
+ if (arrayPath.elements && arrayPath.elements.length === 1) {
+ j(path.parent.parent).remove();
+ } else {
+ j(path).remove();
+ }
}
- });
+ );
return rootPath;
}
@@ -296,62 +295,68 @@ function findAndRemovePluginByName(j: IJSCodeshift, node: INode, pluginName: str
* @returns {Void}
*/
-function createOrUpdatePluginByName(j: IJSCodeshift, rootNodePath: INode, pluginName: string, options: object): void {
- const pluginInstancePath: INode = findPluginsByName(j, j(rootNodePath), [
- pluginName,
- ]);
- let optionsProps: INode[];
+function createOrUpdatePluginByName(j: JSCodeshift, rootNodePath: Node, pluginName: string, options?: object): void {
+ const pluginInstancePath: Node = findPluginsByName(j, j(rootNodePath), [pluginName]);
+ let optionsProps: Node[];
if (options) {
- optionsProps = Object.keys(options).map((key: string) => {
- return createProperty(j, key, options[key]);
- });
+ optionsProps = Object.keys(options).map(
+ (key: string): Node => {
+ return createProperty(j, key, options[key]);
+ }
+ );
}
// If plugin declaration already exist
if (pluginInstancePath.size()) {
- pluginInstancePath.forEach((path: INode) => {
- // There are options we want to pass as argument
- if (optionsProps) {
- const args: INode[] = path.value.arguments;
- if (args.length) {
- // Plugin is called with object as arguments
- // we will merge those objects
- const currentProps: INode = j(path)
- .find(j.ObjectExpression)
- .get("properties");
-
- optionsProps.forEach((opt: INode) => {
- // Search for same keys in the existing object
- const existingProps = j(currentProps)
- .find(j.Identifier)
- .filter((p: INode) => opt.key.value === p.value.name);
-
- if (existingProps.size()) {
- // Replacing values for the same key
- existingProps.forEach((p: INode) => {
- j(p.parent).replaceWith(opt);
- });
- } else {
- // Adding new key:values
- currentProps.value.push(opt);
- }
- });
- } else {
- // Plugin is called without arguments
- args.push(j.objectExpression(optionsProps));
+ pluginInstancePath.forEach(
+ (path: Node): void => {
+ // There are options we want to pass as argument
+ if (optionsProps) {
+ const args: Node[] = (path.value as Node).arguments;
+ if (args.length) {
+ // Plugin is called with object as arguments
+ // we will merge those objects
+ const currentProps: Node = j(path)
+ .find(j.ObjectExpression)
+ .get("properties");
+
+ optionsProps.forEach(
+ (opt: Node): void => {
+ // Search for same keys in the existing object
+ const existingProps = j(currentProps)
+ .find(j.Identifier)
+ .filter((p: Node): boolean => opt.key.value === (p.value as Node).name);
+
+ if (existingProps.size()) {
+ // Replacing values for the same key
+ existingProps.forEach(
+ (p: Node): void => {
+ j(p.parent).replaceWith(opt);
+ }
+ );
+ } else {
+ // Adding new key:values
+ (currentProps.value as Node[]).push(opt);
+ }
+ }
+ );
+ } else {
+ // Plugin is called without arguments
+ args.push(j.objectExpression(optionsProps));
+ }
}
}
- });
+ );
} else {
- let argumentsArray: INode[] = [];
+ let argumentsArray: Node[] = [];
if (optionsProps) {
argumentsArray = [j.objectExpression(optionsProps)];
}
const loaderPluginInstance = j.newExpression(
pathsToMemberExpression(j, pluginName.split(".").reverse()),
- argumentsArray,
+ argumentsArray
);
- rootNodePath.value.elements.push(loaderPluginInstance);
+ (rootNodePath.value as Node).elements.push(loaderPluginInstance);
}
}
@@ -366,12 +371,14 @@ function createOrUpdatePluginByName(j: IJSCodeshift, rootNodePath: INode, plugin
* @returns {String} variable name - ex. 'const s = require(s) gives "s"`
*/
-function findVariableToPlugin(j: IJSCodeshift, rootNode: INode, pluginPackageName: string): string {
- const moduleVarNames: INode[] = rootNode
+function findVariableToPlugin(j: JSCodeshift, rootNode: Node, pluginPackageName: string): string {
+ const moduleVarNames: Node[] = rootNode
.find(j.VariableDeclarator)
.filter(j.filters.VariableDeclarator.requiresModule(pluginPackageName))
.nodes();
- if (moduleVarNames.length === 0) { return null; }
+ if (moduleVarNames.length === 0) {
+ return null;
+ }
return moduleVarNames.pop().id.name;
}
@@ -383,12 +390,12 @@ function findVariableToPlugin(j: IJSCodeshift, rootNode: INode, pluginPackageNam
* @returns {Boolean}
*/
-function isType(path: INode, type: string): boolean {
+function isType(path: Node, type: string): boolean {
return path.type === type;
}
-function findObjWithOneOfKeys(p: INode, keyNames: string[]) {
- return p.value.properties.reduce((predicate: boolean, prop: INode) => {
+function findObjWithOneOfKeys(p: Node, keyNames: string[]): boolean {
+ return (p.value as Node).properties.reduce((predicate: boolean, prop: Node): boolean => {
const name: string = prop.key.name;
return keyNames.indexOf(name) > -1 || predicate;
}, false);
@@ -403,12 +410,12 @@ function findObjWithOneOfKeys(p: INode, keyNames: string[]) {
* @returns {Node} - the created ast
*/
-function getRequire(j: IJSCodeshift, constName: string, packagePath: string): INode {
+function getRequire(j: JSCodeshift, constName: string, packagePath: string): Node {
return j.variableDeclaration("const", [
j.variableDeclarator(
j.identifier(constName),
- j.callExpression(j.identifier("require"), [j.literal(packagePath)]),
- ),
+ j.callExpression(j.identifier("require"), [j.literal(packagePath)])
+ )
]);
}
@@ -423,32 +430,33 @@ function getRequire(j: IJSCodeshift, constName: string, packagePath: string): IN
* @returns {Node} - the created ast
*/
-function addProperty(j: IJSCodeshift, p: INode, key: string, value: valueType, action?: string): INode {
+function addProperty(j: JSCodeshift, p: Node, key: string, value: valueType, action?: string): Node {
if (!p) {
return;
}
let valForNode: valueType;
if (Array.isArray(value)) {
- let arrExp: INode = j.arrayExpression([]);
+ let arrExp: Node = j.arrayExpression([]);
if (safeTraverseAndGetType(p) === "ArrayExpression") {
- arrExp = p.value.value;
+ arrExp = (p.value as Node).value as Node;
}
- value.forEach((val: valueType) => {
- addProperty(j, arrExp, null, val);
- });
+ value.forEach(
+ (val: valueType): void => {
+ addProperty(j, arrExp, null, val);
+ }
+ );
valForNode = arrExp;
- } else if (
- typeof value === "object" &&
- !(value.__paths || value instanceof RegExp)
- ) {
- let objectExp: INode = j.objectExpression([]);
+ } else if (typeof value === "object" && !(value.__paths || value instanceof RegExp)) {
+ let objectExp: Node = j.objectExpression([]);
if (safeTraverseAndGetType(p) === "ObjectExpression") {
- objectExp = p.value.value;
+ objectExp = (p.value as Node).value as Node;
}
// object -> loop through it
- Object.keys(value).forEach((prop: string) => {
- addProperty(j, objectExp, prop, value[prop]);
- });
+ Object.keys(value).forEach(
+ (prop: string): void => {
+ addProperty(j, objectExp, prop, value[prop]);
+ }
+ );
valForNode = objectExp;
} else {
valForNode = createIdentifierOrLiteral(j, value);
@@ -461,14 +469,16 @@ function addProperty(j: IJSCodeshift, p: INode, key: string, value: valueType, a
}
// we only return the generated pushVal which will be replace the node path
- if (action === "add") { return pushVal; }
+ if (action === "add") {
+ return pushVal;
+ }
if (p.properties) {
p.properties.push(pushVal);
return p;
}
- if (p.value && p.value.properties) {
- p.value.properties.push(pushVal);
+ if (p.value && (p.value as Node).properties) {
+ (p.value as Node).properties.push(pushVal);
return p;
}
if (p.elements) {
@@ -488,8 +498,7 @@ function addProperty(j: IJSCodeshift, p: INode, key: string, value: valueType, a
* @returns {Node} - the created ast
*/
-function removeProperty(j: IJSCodeshift, ast: INode, key: string, value: valueType): INode {
-
+function removeProperty(j: JSCodeshift, ast: Node, key: string, value: valueType): Node {
if (typeof value === "object" && !Array.isArray(value)) {
// override for module.rules / loaders
if (key === "module" && value.rules) {
@@ -497,12 +506,14 @@ function removeProperty(j: IJSCodeshift, ast: INode, key: string, value: valueTy
.find(j.Property, {
value: {
type: "Literal",
- value: value.rules[0].loader,
- },
+ value: value.rules[0].loader
+ }
})
- .forEach((p: INode) => {
- j(p.parent).remove();
- });
+ .forEach(
+ (p: Node): void => {
+ j(p.parent).remove();
+ }
+ );
}
}
@@ -510,14 +521,16 @@ function removeProperty(j: IJSCodeshift, ast: INode, key: string, value: valueTy
if (Array.isArray(value)) {
return ast
.find(j.Literal, {
- value: value[0],
+ value: value[0]
})
- .forEach((p: INode) => {
- const configKey = safeTraverse(p, ["parent", "parent", "node", "key", "name"]);
- if (configKey === key) {
- j(p).remove();
+ .forEach(
+ (p: Node): void => {
+ const configKey = safeTraverse(p, ["parent", "parent", "node", "key", "name"]);
+ if (configKey === key) {
+ j(p).remove();
+ }
}
- });
+ );
}
// value => literal string / boolean / nested object
@@ -526,19 +539,23 @@ function removeProperty(j: IJSCodeshift, ast: INode, key: string, value: valueTy
objKeyToRemove = key;
} else if (typeof value === "object") {
for (const innerKey in value) {
- if (value[innerKey] === null) { objKeyToRemove = innerKey; }
+ if (value[innerKey] === null) {
+ objKeyToRemove = innerKey;
+ }
}
}
return ast
.find(j.Property, {
key: {
name: objKeyToRemove,
- type: "Identifier",
- },
+ type: "Identifier"
+ }
})
- .forEach((p: INode) => {
- j(p).remove();
- });
+ .forEach(
+ (p: Node): void => {
+ j(p).remove();
+ }
+ );
}
/**
@@ -553,20 +570,23 @@ function removeProperty(j: IJSCodeshift, ast: INode, key: string, value: valueTy
* @returns ast - jscodeshift API
*/
-function parseTopScope(j: IJSCodeshift, ast: INode, value: string[], action: string): boolean | INode {
- function createTopScopeProperty(p: INode): boolean {
- value.forEach((n: string) => {
- if (
- !p.value.body[0].declarations ||
- n.indexOf(p.value.body[0].declarations[0].id.name) <= 0
- ) {
- p.value.body.splice(-1, 0, n);
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
+function parseTopScope(j: JSCodeshift, ast: Node, value: string[], action: string): boolean | Node {
+ function createTopScopeProperty(p: Node): boolean {
+ value.forEach(
+ (n: string): void => {
+ if (
+ !(p.value as Node).body[0].declarations ||
+ n.indexOf((p.value as Node).body[0].declarations[0].id.name) <= 0
+ ) {
+ (p.value as Node).body.splice(-1, 0, n);
+ }
}
- });
+ );
return false; // TODO: debug later
}
if (value) {
- return ast.find(j.Program).filter((p: INode): boolean => createTopScopeProperty(p));
+ return ast.find(j.Program).filter((p: Node): boolean => createTopScopeProperty(p));
} else {
return ast;
}
@@ -584,36 +604,36 @@ function parseTopScope(j: IJSCodeshift, ast: INode, value: string[], action: str
* @returns ast - jscodeshift API
*/
-function parseMerge(j: IJSCodeshift, ast: INode, value: string, action: string): boolean | INode {
- function createMergeProperty(p: INode) {
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
+function parseMerge(j: JSCodeshift, ast: Node, value: string, action: string): boolean | Node {
+ function createMergeProperty(p: Node): boolean {
// FIXME Use j.callExp()
- const exportsDecl: INode[] = p.value.body.map((n: INode) => {
- if (n.expression) {
- return n.expression.right;
+ const exportsDecl: Node[] = (p.value as Node).body.map(
+ (n: Node): Node => {
+ if (n.expression) {
+ return n.expression.right;
+ }
}
- });
+ );
const bodyLength = exportsDecl.length;
- const newVal: INode = {};
+ const newVal: Node = {};
newVal.type = "ExpressionStatement";
newVal.expression = {
left: {
computed: false,
object: j.identifier("module"),
property: j.identifier("exports"),
- type: "MemberExpression",
+ type: "MemberExpression"
},
operator: "=",
- right: j.callExpression(j.identifier("merge"), [
- j.identifier(value),
- exportsDecl.pop(),
- ]),
- type: "AssignmentExpression",
+ right: j.callExpression(j.identifier("merge"), [j.identifier(value), exportsDecl.pop()]),
+ type: "AssignmentExpression"
};
- p.value.body[bodyLength - 1] = newVal;
+ (p.value as Node).body[bodyLength - 1] = newVal;
return false; // TODO: debug later
}
if (value) {
- return ast.find(j.Program).filter((p: INode): boolean => createMergeProperty(p));
+ return ast.find(j.Program).filter((p: Node): boolean => createMergeProperty(p));
} else {
return ast;
}
@@ -638,5 +658,5 @@ export {
addProperty,
removeProperty,
parseTopScope,
- parseMerge,
+ parseMerge
};
diff --git a/packages/utils/copy-utils.ts b/packages/utils/copy-utils.ts
index d7f98fa6639..85674f714a3 100644
--- a/packages/utils/copy-utils.ts
+++ b/packages/utils/copy-utils.ts
@@ -1,13 +1,5 @@
import * as path from "path";
-interface IGenerator {
- fs: {
- copy(from: string, to: string, options?: object): void;
- copyTpl(from: string, to: string, context: object, templateOptions?: object, copyOptions?: object): void;
- };
- destinationPath: (path: string) => string;
-}
-
/**
* Takes in a file path in the `./templates` directory. Copies that
* file to the destination, with the `.tpl` extension stripped.
@@ -16,18 +8,17 @@ interface IGenerator {
* @param {string} templateDir Absolute path to template directory
* @returns {Function} A curried function that takes a file path and copies it
*/
-export const generatorCopy = (
- generator,
- templateDir: string,
-): (filePath: string) => void => (filePath: string): void => {
- const sourceParts: string[] = templateDir.split(path.delimiter);
+export const generatorCopy = (generator, templateDir: string): ((filePath: string) => void) => (
+ filePath: string
+): void => {
+ const sourceParts = templateDir.split(path.delimiter);
sourceParts.push.apply(sourceParts, filePath.split("/"));
- const targetParts: string[] = path.dirname(filePath).split("/");
+ const targetParts = path.dirname(filePath).split("/");
targetParts.push(path.basename(filePath, ".tpl"));
generator.fs.copy(
path.join.apply(null, sourceParts),
- generator.destinationPath(path.join.apply(null, targetParts)),
+ generator.destinationPath(path.join.apply(null, targetParts))
);
};
@@ -45,16 +36,16 @@ export const generatorCopy = (
export const generatorCopyTpl = (
generator,
templateDir: string,
- templateData: object,
-): (filePath: string) => void => (filePath: string): void => {
- const sourceParts: string[] = templateDir.split(path.delimiter);
+ templateData: object
+): ((filePath: string) => void) => (filePath: string): void => {
+ const sourceParts = templateDir.split(path.delimiter);
sourceParts.push.apply(sourceParts, filePath.split("/"));
- const targetParts: string[] = path.dirname(filePath).split("/");
+ const targetParts = path.dirname(filePath).split("/");
targetParts.push(path.basename(filePath, ".tpl").slice(1));
generator.fs.copyTpl(
path.join.apply(null, sourceParts),
generator.destinationPath(path.join.apply(null, targetParts)),
- templateData,
+ templateData
);
};
diff --git a/packages/utils/defineTest.ts b/packages/utils/defineTest.ts
index 1118cde9a32..350e03a05ba 100644
--- a/packages/utils/defineTest.ts
+++ b/packages/utils/defineTest.ts
@@ -1,26 +1,28 @@
+/* eslint-disable @typescript-eslint/explicit-function-return-type */
import * as fs from "fs";
import * as path from "path";
-import { IJSCodeshift, INode } from "./types/NodePath";
-interface IModule {
+import { JSCodeshift, Node } from "./types/NodePath";
+
+interface Module {
(
- jscodeshift: IJSCodeshift,
- ast: INode,
+ jscodeshift: JSCodeshift,
+ ast: Node,
initOptions: string | boolean | object,
action: string,
- transformName?: string,
- ): INode;
+ transformName?: string
+ ): Node;
default: transformType;
parser: string;
}
type transformType = (
- jscodeshift: IJSCodeshift,
- ast: INode,
+ jscodeshift: JSCodeshift,
+ ast: Node,
initOptions: string | boolean | object,
- action: string,
- transformName?: string,
-) => INode;
+ action: object | string,
+ transformName?: string
+) => Node;
/**
* Utility function to run a jscodeshift script within a unit test.
@@ -51,45 +53,40 @@ function runSingleTransform(
transformName: string,
testFilePrefix: string,
initOptions: object | boolean | string,
- action: string,
+ action: object | string
): string {
if (!testFilePrefix) {
testFilePrefix = transformName;
}
- const fixtureDir: string = path.join(dirName, "__testfixtures__");
- const inputPath: string = path.join(fixtureDir, testFilePrefix + ".input.js");
- const source: string = fs.readFileSync(inputPath, "utf8");
+ const fixtureDir = path.join(dirName, "__tests__", "__testfixtures__");
+ const inputPath = path.join(fixtureDir, `${testFilePrefix}.input.js`);
+ const source = fs.readFileSync(inputPath, "utf8");
- let module: IModule;
+ let module: Module;
// Assumes transform and test are on the same level
if (action) {
- module = require(path.join(dirName, "recursive-parser" + ".js"));
+ module = require(path.join(dirName, "recursive-parser.ts"));
} else {
- module = require(path.join(dirName, transformName + ".js"));
+ module = require(path.join(dirName, `${transformName}.ts`));
}
// Handle ES6 modules using default export for the transform
const transform = module.default ? module.default : module;
// Jest resets the module registry after each test, so we need to always get
// a fresh copy of jscodeshift on every test run.
- let jscodeshift: IJSCodeshift = require("jscodeshift/dist/core");
+ // eslint-disable-next-line
+ let jscodeshift: JSCodeshift = require("jscodeshift/dist/core");
if (module.parser) {
jscodeshift = jscodeshift.withParser(module.parser);
}
- const ast: INode = jscodeshift(source);
+ const ast: Node = jscodeshift(source);
if (initOptions || typeof initOptions === "boolean") {
- return transform(
- jscodeshift,
- ast,
- initOptions,
- action,
- transformName,
- ).toSource({
- quote: "single",
+ return transform(jscodeshift, ast, initOptions, action, transformName).toSource({
+ quote: "single"
});
}
return transform(jscodeshift, ast, source, action).toSource({
- quote: "single",
+ quote: "single"
});
}
@@ -113,22 +110,16 @@ function runSingleTransform(
export default function defineTest(
dirName: string,
transformName: string,
- testFilePrefix: string,
- transformObject: object,
- action: string,
+ testFilePrefix?: string,
+ transformObject?: object | string,
+ action?: object | string
): void {
const testName: string = testFilePrefix
? `transforms correctly using "${testFilePrefix}" data`
: "transforms correctly";
describe(transformName, () => {
it(testName, () => {
- const output = runSingleTransform(
- dirName,
- transformName,
- testFilePrefix,
- transformObject,
- action,
- );
+ const output = runSingleTransform(dirName, transformName, testFilePrefix, transformObject, action);
expect(output).toMatchSnapshot();
});
});
diff --git a/packages/utils/find-root.ts b/packages/utils/find-root.ts
new file mode 100644
index 00000000000..0345da2db62
--- /dev/null
+++ b/packages/utils/find-root.ts
@@ -0,0 +1,14 @@
+import * as findup from "findup-sync";
+import * as path from "path";
+
+/**
+ * Returns the absolute path of the project directory
+ * Finds the package.json, by using findup-sync
+ * @returns {String} path of project directory
+ */
+
+export function findProjectRoot(): string {
+ const rootFilePath = findup(`package.json`);
+ const projectRoot = path.dirname(rootFilePath);
+ return projectRoot;
+}
diff --git a/packages/utils/modify-config-helper.ts b/packages/utils/modify-config-helper.ts
index d1066c029c3..e836f283991 100644
--- a/packages/utils/modify-config-helper.ts
+++ b/packages/utils/modify-config-helper.ts
@@ -3,12 +3,12 @@ import * as fs from "fs";
import * as logSymbols from "log-symbols";
import * as path from "path";
import * as yeoman from "yeoman-environment";
-import Generator = require("yeoman-generator");
+import * as Generator from "yeoman-generator";
+
import runTransform from "./scaffold";
-import { IGenerator, IYeoman } from "./types/Yeoman";
-export interface IConfig extends Object {
+export interface Config extends Object {
item?: {
name: string;
};
@@ -18,10 +18,10 @@ export interface IConfig extends Object {
webpackOptions: object;
}
-export interface ITransformConfig extends Object {
+export interface TransformConfig extends Object {
configPath?: string;
configFile?: string;
- config?: IConfig;
+ config?: Config;
}
const DEFAULT_WEBPACK_CONFIG_FILENAME = "webpack.config.js";
@@ -40,11 +40,10 @@ const DEFAULT_WEBPACK_CONFIG_FILENAME = "webpack.config.js";
export default function modifyHelperUtil(
action: string,
- generator: IGenerator,
+ generator: typeof Generator,
configFile: string = DEFAULT_WEBPACK_CONFIG_FILENAME,
- packages?: string[])
- : Function {
-
+ packages?: string[]
+): typeof Generator {
let configPath: string | null = null;
if (action !== "init") {
@@ -57,7 +56,7 @@ export default function modifyHelperUtil(
chalk.green(" SUCCESS ") +
"Found config " +
chalk.cyan(configFile + "\n") +
- "\n",
+ "\n"
);
} else {
process.stdout.write(
@@ -68,69 +67,79 @@ export default function modifyHelperUtil(
" not found. Please specify a valid path to your webpack config like " +
chalk.white("$ ") +
chalk.cyan(`webpack-cli ${action} webpack.dev.js`) +
- "\n",
+ "\n"
);
return;
}
}
const env = yeoman.createEnv("webpack", null);
- const generatorName: string = `webpack-${action}-generator`;
+ const generatorName = `webpack-${action}-generator`;
if (!generator) {
generator = class extends Generator {
- public initializing() {
- packages.forEach((pkgPath: string) => {
- return (this as IGenerator).composeWith(require.resolve(pkgPath));
- });
+ public initializing(): void {
+ packages.forEach(
+ (pkgPath: string): Generator => {
+ return this.composeWith(require.resolve(pkgPath), {});
+ }
+ );
}
};
}
env.registerStub(generator, generatorName);
- env.run(generatorName).then((_: void) => {
- let configModule: object;
- try {
- const confPath: string = path.resolve(process.cwd(), ".yo-rc.json");
- configModule = require(confPath);
- // Change structure of the config to be transformed
- const tmpConfig: object = {};
- Object.keys(configModule).forEach((prop: string): void => {
- const configs: string[] = Object.keys(configModule[prop].configuration);
- configs.forEach((conf: string): void => {
- tmpConfig[conf] = configModule[prop].configuration[conf];
- });
- });
- configModule = tmpConfig;
- } catch (err) {
- console.error(
- chalk.red("\nCould not find a yeoman configuration file.\n"),
- );
- console.error(
- chalk.red(
- "\nPlease make sure to use 'this.config.set('configuration', this.configuration);' at the end of the generator.\n",
- ),
- );
- Error.stackTraceLimit = 0;
- process.exitCode = -1;
- }
- const transformConfig: ITransformConfig = Object.assign(
- {
- configFile: !configPath ? null : fs.readFileSync(configPath, "utf8"),
- configPath,
- },
- configModule,
- );
- return runTransform(transformConfig, action);
- }).catch((err) => {
- console.error(
- chalk.red(
- `
+ env.run(generatorName)
+ .then(
+ (): void => {
+ let configModule: object;
+ try {
+ const confPath = path.resolve(process.cwd(), ".yo-rc.json");
+ configModule = require(confPath);
+ // Change structure of the config to be transformed
+ const tmpConfig: object = {};
+ Object.keys(configModule).forEach(
+ (prop: string): void => {
+ const configs = Object.keys(configModule[prop].configuration);
+ configs.forEach(
+ (conf: string): void => {
+ tmpConfig[conf] = configModule[prop].configuration[conf];
+ }
+ );
+ }
+ );
+ configModule = tmpConfig;
+ } catch (err) {
+ console.error(chalk.red("\nCould not find a yeoman configuration file.\n"));
+ console.error(
+ chalk.red(
+ "\nPlease make sure to use 'this.config.set('configuration', this.configuration);' at the end of the generator.\n"
+ )
+ );
+ Error.stackTraceLimit = 0;
+ process.exitCode = -1;
+ }
+ const transformConfig: TransformConfig = Object.assign(
+ {
+ configFile: !configPath ? null : fs.readFileSync(configPath, "utf8"),
+ configPath
+ },
+ configModule
+ );
+ return runTransform(transformConfig, action);
+ }
+ )
+ .catch(
+ (err): void => {
+ console.error(
+ chalk.red(
+ `
Unexpected Error
please file an issue here https://github.com/webpack/webpack-cli/issues/new?template=Bug_report.md
- `,
- ),
+ `
+ )
+ );
+ console.error(err);
+ }
);
- console.error(err);
- });
}
diff --git a/packages/utils/npm-exists.ts b/packages/utils/npm-exists.ts
index 2856f439e96..0db70f11883 100644
--- a/packages/utils/npm-exists.ts
+++ b/packages/utils/npm-exists.ts
@@ -1,5 +1,7 @@
import * as got from "got";
+// TODO: to understand the type
+// eslint-disable-next-line
const constant = (value: boolean) => (res: got.Response): boolean | PromiseLike => value;
/**
@@ -11,11 +13,13 @@ const constant = (value: boolean) => (res: got.Response): boolean | Prom
* based on if it exists or not
*/
+// TODO: figure out the correct type here
+// eslint-disable-next-line
export default function npmExists(moduleName: string): Promise {
- const hostname: string = "https://www.npmjs.org";
- const pkgUrl: string = `${hostname}/package/${moduleName}`;
+ const hostname = "https://www.npmjs.org";
+ const pkgUrl = `${hostname}/package/${moduleName}`;
return got(pkgUrl, {
- method: "HEAD",
+ method: "HEAD"
})
.then(constant(true))
.catch(constant(false));
diff --git a/packages/utils/npm-packages-exists.ts b/packages/utils/npm-packages-exists.ts
index 2d206cfe54c..529da51ad2f 100644
--- a/packages/utils/npm-packages-exists.ts
+++ b/packages/utils/npm-packages-exists.ts
@@ -4,7 +4,7 @@ import isLocalPath from "./is-local-path";
import npmExists from "./npm-exists";
import { resolvePackages } from "./resolve-packages";
-const WEBPACK_SCAFFOLD_PREFIX: string = "webpack-scaffold";
+const WEBPACK_SCAFFOLD_PREFIX = "webpack-scaffold";
/**
*
@@ -18,46 +18,52 @@ const WEBPACK_SCAFFOLD_PREFIX: string = "webpack-scaffold";
export default function npmPackagesExists(pkg: string[]): void {
const acceptedPackages: string[] = [];
- function resolvePackagesIfReady() {
+ function resolvePackagesIfReady(): void | Function {
if (acceptedPackages.length === pkg.length) {
return resolvePackages(acceptedPackages);
}
}
- pkg.forEach((scaffold: string): void => {
- if (isLocalPath(scaffold)) {
- // If the scaffold is a path to a local folder, no name validation is necessary.
- acceptedPackages.push(scaffold);
- resolvePackagesIfReady();
- return;
- }
+ pkg.forEach(
+ (scaffold: string): void => {
+ if (isLocalPath(scaffold)) {
+ // If the scaffold is a path to a local folder, no name validation is necessary.
+ acceptedPackages.push(scaffold);
+ resolvePackagesIfReady();
+ return;
+ }
- // The scaffold is on npm; validate name and existence
- if (
- scaffold.length <= WEBPACK_SCAFFOLD_PREFIX.length ||
- scaffold.slice(0, WEBPACK_SCAFFOLD_PREFIX.length) !== WEBPACK_SCAFFOLD_PREFIX
- ) {
- throw new TypeError(
- chalk.bold(`${scaffold} isn't a valid name.\n`) +
- chalk.red(
- `\nIt should be prefixed with '${WEBPACK_SCAFFOLD_PREFIX}', but have different suffix.\n`,
- ),
- );
- }
+ // The scaffold is on npm; validate name and existence
+ if (
+ scaffold.length <= WEBPACK_SCAFFOLD_PREFIX.length ||
+ scaffold.slice(0, WEBPACK_SCAFFOLD_PREFIX.length) !== WEBPACK_SCAFFOLD_PREFIX
+ ) {
+ throw new TypeError(
+ chalk.bold(`${scaffold} isn't a valid name.\n`) +
+ chalk.red(
+ `\nIt should be prefixed with '${WEBPACK_SCAFFOLD_PREFIX}', but have different suffix.\n`
+ )
+ );
+ }
- npmExists(scaffold)
- .then((moduleExists: boolean) => {
- if (moduleExists) {
- acceptedPackages.push(scaffold);
- } else {
- Error.stackTraceLimit = 0;
- throw new TypeError(`Cannot resolve location of package ${scaffold}.`);
- }
- })
- .catch((err: IError) => {
- console.error(err.stack || err);
- process.exit(0);
- })
- .then(resolvePackagesIfReady);
- });
+ npmExists(scaffold)
+ .then(
+ (moduleExists: boolean): void => {
+ if (moduleExists) {
+ acceptedPackages.push(scaffold);
+ } else {
+ Error.stackTraceLimit = 0;
+ throw new TypeError(`Cannot resolve location of package ${scaffold}.`);
+ }
+ }
+ )
+ .catch(
+ (err: Error): void => {
+ console.error(err.stack || err);
+ process.exit(0);
+ }
+ )
+ .then(resolvePackagesIfReady);
+ }
+ );
}
diff --git a/packages/utils/package-lock.json b/packages/utils/package-lock.json
index d0ff77c38cb..30e688d29c6 100644
--- a/packages/utils/package-lock.json
+++ b/packages/utils/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "@webpack-cli/utils",
- "version": "0.1.3",
+ "version": "0.1.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -75,6 +75,27 @@
"@types/node": "*"
}
},
+ "@types/inquirer": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/@types/inquirer/-/inquirer-6.0.1.tgz",
+ "integrity": "sha512-O9rEHE9iBvYaFAGS0fAlDzqY/3CsOrRKzni4zwnAEce2JrHUEbXAce2Pwwe8ZGzmQkucwSXn1tSiKig37INgfA==",
+ "dev": true,
+ "requires": {
+ "@types/through": "*",
+ "rxjs": ">=6.4.0"
+ },
+ "dependencies": {
+ "rxjs": {
+ "version": "6.5.1",
+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.1.tgz",
+ "integrity": "sha512-y0j31WJc83wPu31vS1VlAFW5JGrnGC+j+TtGAa1fRQphy48+fDYiDmX8tjGloToEsMkxnouOg/1IzXGKkJnZMg==",
+ "dev": true,
+ "requires": {
+ "tslib": "^1.9.0"
+ }
+ }
+ }
+ },
"@types/jest": {
"version": "23.3.11",
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-23.3.11.tgz",
@@ -105,6 +126,36 @@
"integrity": "sha512-XIB0ZCaFZmWUHAa9dBqP5UKXXHwuukmVlP+XcyU94dui2k+l2lG+CHAbt2ffenHPUqoIs5Beh8Pdf2YEq/CZ7A==",
"dev": true
},
+ "@types/through": {
+ "version": "0.0.29",
+ "resolved": "https://registry.npmjs.org/@types/through/-/through-0.0.29.tgz",
+ "integrity": "sha512-9a7C5VHh+1BKblaYiq+7Tfc+EOmjMdZaD1MYtkQjSoxgB69tBjW98ry6SKsi4zEIWztLOMRuL87A3bdT/Fc/4w==",
+ "dev": true,
+ "requires": {
+ "@types/node": "*"
+ }
+ },
+ "@types/yeoman-generator": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/@types/yeoman-generator/-/yeoman-generator-3.1.2.tgz",
+ "integrity": "sha512-Wr67yKgBKxKJ9eUNCL5WuKuc3e9CSCbdw8nMDiBatp+/NHgvriqUGjt5kbWBIfLG9yRdIKaxT4Tf8L+VVd7qSA==",
+ "dev": true,
+ "requires": {
+ "@types/inquirer": "*",
+ "rxjs": ">=6.4.0"
+ },
+ "dependencies": {
+ "rxjs": {
+ "version": "6.5.1",
+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.1.tgz",
+ "integrity": "sha512-y0j31WJc83wPu31vS1VlAFW5JGrnGC+j+TtGAa1fRQphy48+fDYiDmX8tjGloToEsMkxnouOg/1IzXGKkJnZMg==",
+ "dev": true,
+ "requires": {
+ "tslib": "^1.9.0"
+ }
+ }
+ }
+ },
"abab": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz",
@@ -465,7 +516,7 @@
},
"array-equal": {
"version": "1.0.0",
- "resolved": "http://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz",
+ "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz",
"integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM="
},
"array-union": {
@@ -569,7 +620,7 @@
},
"chalk": {
"version": "1.1.3",
- "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"requires": {
"ansi-styles": "^2.2.1",
@@ -581,7 +632,7 @@
},
"strip-ansi": {
"version": "3.0.1",
- "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"requires": {
"ansi-regex": "^2.0.0"
@@ -808,7 +859,7 @@
},
"babel-plugin-istanbul": {
"version": "4.1.6",
- "resolved": "http://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz",
+ "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz",
"integrity": "sha512-PWP9FQ1AhZhS01T/4qLSKoHGY/xvkZdVBGlKM/HuxxS3+sC66HhTNR7+MpbO/so/cz/wY94MeSWJuP1hXIPfwQ==",
"requires": {
"babel-plugin-syntax-object-rest-spread": "^6.13.0",
@@ -869,7 +920,7 @@
},
"babel-plugin-syntax-object-rest-spread": {
"version": "6.13.0",
- "resolved": "http://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz",
+ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz",
"integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U="
},
"babel-plugin-syntax-trailing-function-commas": {
@@ -1619,7 +1670,7 @@
"dependencies": {
"colors": {
"version": "1.0.3",
- "resolved": "http://registry.npmjs.org/colors/-/colors-1.0.3.tgz",
+ "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz",
"integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs="
}
}
@@ -1935,6 +1986,11 @@
"resolved": "https://registry.npmjs.org/detect-conflict/-/detect-conflict-1.0.1.tgz",
"integrity": "sha1-CIZXpmqWHAUBnbfEIwiDsca0F24="
},
+ "detect-file": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz",
+ "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc="
+ },
"detect-indent": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz",
@@ -2583,6 +2639,280 @@
"locate-path": "^2.0.0"
}
},
+ "findup-sync": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz",
+ "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==",
+ "requires": {
+ "detect-file": "^1.0.0",
+ "is-glob": "^4.0.0",
+ "micromatch": "^3.0.4",
+ "resolve-dir": "^1.0.1"
+ },
+ "dependencies": {
+ "arr-diff": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
+ "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA="
+ },
+ "array-unique": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz",
+ "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg="
+ },
+ "braces": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz",
+ "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==",
+ "requires": {
+ "arr-flatten": "^1.1.0",
+ "array-unique": "^0.3.2",
+ "extend-shallow": "^2.0.1",
+ "fill-range": "^4.0.0",
+ "isobject": "^3.0.1",
+ "repeat-element": "^1.1.2",
+ "snapdragon": "^0.8.1",
+ "snapdragon-node": "^2.0.1",
+ "split-string": "^3.0.2",
+ "to-regex": "^3.0.1"
+ },
+ "dependencies": {
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "requires": {
+ "is-extendable": "^0.1.0"
+ }
+ }
+ }
+ },
+ "expand-brackets": {
+ "version": "2.1.4",
+ "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz",
+ "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=",
+ "requires": {
+ "debug": "^2.3.3",
+ "define-property": "^0.2.5",
+ "extend-shallow": "^2.0.1",
+ "posix-character-classes": "^0.1.0",
+ "regex-not": "^1.0.0",
+ "snapdragon": "^0.8.1",
+ "to-regex": "^3.0.1"
+ },
+ "dependencies": {
+ "define-property": {
+ "version": "0.2.5",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
+ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
+ "requires": {
+ "is-descriptor": "^0.1.0"
+ }
+ },
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "requires": {
+ "is-extendable": "^0.1.0"
+ }
+ },
+ "is-accessor-descriptor": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
+ "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
+ "requires": {
+ "kind-of": "^3.0.2"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
+ }
+ },
+ "is-data-descriptor": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
+ "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
+ "requires": {
+ "kind-of": "^3.0.2"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
+ }
+ },
+ "is-descriptor": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
+ "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
+ "requires": {
+ "is-accessor-descriptor": "^0.1.6",
+ "is-data-descriptor": "^0.1.4",
+ "kind-of": "^5.0.0"
+ }
+ },
+ "kind-of": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
+ "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw=="
+ }
+ }
+ },
+ "extglob": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz",
+ "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==",
+ "requires": {
+ "array-unique": "^0.3.2",
+ "define-property": "^1.0.0",
+ "expand-brackets": "^2.1.4",
+ "extend-shallow": "^2.0.1",
+ "fragment-cache": "^0.2.1",
+ "regex-not": "^1.0.0",
+ "snapdragon": "^0.8.1",
+ "to-regex": "^3.0.1"
+ },
+ "dependencies": {
+ "define-property": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
+ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
+ "requires": {
+ "is-descriptor": "^1.0.0"
+ }
+ },
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "requires": {
+ "is-extendable": "^0.1.0"
+ }
+ }
+ }
+ },
+ "fill-range": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
+ "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=",
+ "requires": {
+ "extend-shallow": "^2.0.1",
+ "is-number": "^3.0.0",
+ "repeat-string": "^1.6.1",
+ "to-regex-range": "^2.1.0"
+ },
+ "dependencies": {
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "requires": {
+ "is-extendable": "^0.1.0"
+ }
+ }
+ }
+ },
+ "is-accessor-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
+ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
+ "requires": {
+ "kind-of": "^6.0.0"
+ }
+ },
+ "is-data-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
+ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
+ "requires": {
+ "kind-of": "^6.0.0"
+ }
+ },
+ "is-descriptor": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
+ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
+ "requires": {
+ "is-accessor-descriptor": "^1.0.0",
+ "is-data-descriptor": "^1.0.0",
+ "kind-of": "^6.0.2"
+ }
+ },
+ "is-extglob": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI="
+ },
+ "is-glob": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz",
+ "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=",
+ "requires": {
+ "is-extglob": "^2.1.1"
+ }
+ },
+ "is-number": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
+ "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
+ "requires": {
+ "kind-of": "^3.0.2"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
+ }
+ },
+ "isobject": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
+ "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8="
+ },
+ "kind-of": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz",
+ "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA=="
+ },
+ "micromatch": {
+ "version": "3.1.10",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
+ "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==",
+ "requires": {
+ "arr-diff": "^4.0.0",
+ "array-unique": "^0.3.2",
+ "braces": "^2.3.1",
+ "define-property": "^2.0.2",
+ "extend-shallow": "^3.0.2",
+ "extglob": "^2.0.4",
+ "fragment-cache": "^0.2.1",
+ "kind-of": "^6.0.2",
+ "nanomatch": "^1.2.9",
+ "object.pick": "^1.3.0",
+ "regex-not": "^1.0.0",
+ "snapdragon": "^0.8.1",
+ "to-regex": "^3.0.2"
+ }
+ }
+ }
+ },
"first-chunk-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-2.0.0.tgz",
@@ -3139,7 +3469,7 @@
},
"get-stream": {
"version": "3.0.0",
- "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
"integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ="
},
"get-value": {
@@ -3534,6 +3864,16 @@
"requires": {
"pkg-dir": "^2.0.0",
"resolve-cwd": "^2.0.0"
+ },
+ "dependencies": {
+ "pkg-dir": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz",
+ "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=",
+ "requires": {
+ "find-up": "^2.1.0"
+ }
+ }
}
},
"imurmurhash": {
@@ -3602,7 +3942,7 @@
},
"into-stream": {
"version": "3.1.0",
- "resolved": "http://registry.npmjs.org/into-stream/-/into-stream-3.1.0.tgz",
+ "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-3.1.0.tgz",
"integrity": "sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY=",
"requires": {
"from2": "^2.1.1",
@@ -3642,7 +3982,7 @@
},
"is-builtin-module": {
"version": "1.0.0",
- "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz",
+ "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz",
"integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=",
"requires": {
"builtin-modules": "^1.0.0"
@@ -4125,7 +4465,7 @@
},
"jest-get-type": {
"version": "22.4.3",
- "resolved": "http://registry.npmjs.org/jest-get-type/-/jest-get-type-22.4.3.tgz",
+ "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-22.4.3.tgz",
"integrity": "sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w=="
},
"jest-haste-map": {
@@ -4458,7 +4798,7 @@
},
"jsesc": {
"version": "1.3.0",
- "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz",
"integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s="
},
"json-buffer": {
@@ -4488,7 +4828,7 @@
},
"json5": {
"version": "0.5.1",
- "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz",
"integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE="
},
"jsprim": {
@@ -4552,7 +4892,7 @@
},
"load-json-file": {
"version": "1.1.0",
- "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
+ "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
"integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
"requires": {
"graceful-fs": "^4.1.2",
@@ -4564,7 +4904,7 @@
"dependencies": {
"pify": {
"version": "2.3.0",
- "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
}
}
@@ -4789,7 +5129,7 @@
},
"minimist": {
"version": "0.0.8",
- "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
},
"mixin-deep": {
@@ -4813,7 +5153,7 @@
},
"mkdirp": {
"version": "0.5.1",
- "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"requires": {
"minimist": "0.0.8"
@@ -4943,7 +5283,7 @@
},
"strip-ansi": {
"version": "0.1.1",
- "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz",
"integrity": "sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE="
}
}
@@ -5125,7 +5465,7 @@
},
"os-homedir": {
"version": "1.0.2",
- "resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
+ "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M="
},
"os-locale": {
@@ -5140,12 +5480,12 @@
},
"os-tmpdir": {
"version": "1.0.2",
- "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
+ "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
},
"p-cancelable": {
"version": "0.4.1",
- "resolved": "http://registry.npmjs.org/p-cancelable/-/p-cancelable-0.4.1.tgz",
+ "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.4.1.tgz",
"integrity": "sha512-HNa1A8LvB1kie7cERyy21VNeHb2CWJJYqyyC2o3klWFfMGlFmWv2Z7sFgZH8ZiaYL95ydToKTFVXgMV/Os0bBQ=="
},
"p-each-series": {
@@ -5163,7 +5503,7 @@
},
"p-is-promise": {
"version": "1.1.0",
- "resolved": "http://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz",
+ "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz",
"integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4="
},
"p-limit": {
@@ -5246,7 +5586,7 @@
},
"path-is-absolute": {
"version": "1.0.1",
- "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
},
"path-key": {
@@ -5271,7 +5611,7 @@
"dependencies": {
"pify": {
"version": "2.3.0",
- "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
}
}
@@ -5299,14 +5639,6 @@
"pinkie": "^2.0.0"
}
},
- "pkg-dir": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz",
- "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=",
- "requires": {
- "find-up": "^2.1.0"
- }
- },
"pn": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz",
@@ -5399,7 +5731,7 @@
},
"query-string": {
"version": "5.1.1",
- "resolved": "http://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz",
+ "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz",
"integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==",
"requires": {
"decode-uri-component": "^0.2.0",
@@ -5485,7 +5817,7 @@
},
"readable-stream": {
"version": "2.3.6",
- "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"requires": {
"core-util-is": "~1.0.0",
@@ -5570,7 +5902,7 @@
},
"regexpu-core": {
"version": "2.0.0",
- "resolved": "http://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz",
+ "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz",
"integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=",
"requires": {
"regenerate": "^1.2.1",
@@ -5580,12 +5912,12 @@
},
"regjsgen": {
"version": "0.2.0",
- "resolved": "http://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz",
+ "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz",
"integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc="
},
"regjsparser": {
"version": "0.1.5",
- "resolved": "http://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz",
+ "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz",
"integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=",
"requires": {
"jsesc": "~0.5.0"
@@ -5593,7 +5925,7 @@
"dependencies": {
"jsesc": {
"version": "0.5.0",
- "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
"integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0="
}
}
@@ -5787,7 +6119,7 @@
},
"safe-regex": {
"version": "1.1.0",
- "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
+ "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
"integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=",
"requires": {
"ret": "~0.1.10"
@@ -6064,7 +6396,7 @@
},
"minimist": {
"version": "1.2.0",
- "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
}
}
@@ -6449,7 +6781,7 @@
},
"strip-eof": {
"version": "1.0.0",
- "resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
+ "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
"integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8="
},
"supports-color": {
@@ -6467,7 +6799,7 @@
},
"temp": {
"version": "0.8.3",
- "resolved": "http://registry.npmjs.org/temp/-/temp-0.8.3.tgz",
+ "resolved": "https://registry.npmjs.org/temp/-/temp-0.8.3.tgz",
"integrity": "sha1-4Ma8TSa5AxJEEOT+2BEDAU38H1k=",
"requires": {
"os-tmpdir": "^1.0.0",
@@ -6476,7 +6808,7 @@
"dependencies": {
"rimraf": {
"version": "2.2.8",
- "resolved": "http://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz",
"integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI="
}
}
@@ -6510,7 +6842,7 @@
},
"through": {
"version": "2.3.8",
- "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz",
+ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
"integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
},
"through2": {
@@ -6657,7 +6989,7 @@
},
"underscore": {
"version": "1.6.0",
- "resolved": "http://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz",
+ "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz",
"integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag="
},
"union-value": {
@@ -6832,7 +7164,7 @@
"dependencies": {
"pify": {
"version": "2.3.0",
- "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
}
}
@@ -6864,7 +7196,7 @@
"dependencies": {
"minimist": {
"version": "1.2.0",
- "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
}
}
@@ -6934,7 +7266,7 @@
},
"wrap-ansi": {
"version": "2.1.0",
- "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
"integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
"requires": {
"string-width": "^1.0.1",
@@ -6961,7 +7293,7 @@
},
"strip-ansi": {
"version": "3.0.1",
- "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"requires": {
"ansi-regex": "^2.0.0"
@@ -7014,7 +7346,7 @@
},
"yargs": {
"version": "11.1.0",
- "resolved": "http://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz",
"integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==",
"requires": {
"cliui": "^4.0.0",
@@ -7146,7 +7478,7 @@
},
"minimist": {
"version": "1.2.0",
- "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
},
"ms": {
diff --git a/packages/utils/package-manager.ts b/packages/utils/package-manager.ts
index 0660cd3bf78..888b974ef18 100644
--- a/packages/utils/package-manager.ts
+++ b/packages/utils/package-manager.ts
@@ -4,16 +4,11 @@ import * as spawn from "cross-spawn";
import * as fs from "fs";
import * as path from "path";
-interface ISpawnFunctions {
+interface SpawnFunctions {
npm: (pkg: string, isNew: boolean) => SpawnSyncReturns;
yarn: (pkg: string, isNew: boolean) => SpawnSyncReturns;
}
-const SPAWN_FUNCTIONS: ISpawnFunctions = {
- npm: spawnNPM,
- yarn: spawnYarn,
-};
-
/**
*
* Spawns a new process using npm
@@ -25,7 +20,7 @@ const SPAWN_FUNCTIONS: ISpawnFunctions = {
function spawnNPM(pkg: string, isNew: boolean): SpawnSyncReturns {
return spawn.sync("npm", [isNew ? "install" : "update", "-g", pkg], {
- stdio: "inherit",
+ stdio: "inherit"
});
}
@@ -40,25 +35,14 @@ function spawnNPM(pkg: string, isNew: boolean): SpawnSyncReturns {
function spawnYarn(pkg: string, isNew: boolean): SpawnSyncReturns {
return spawn.sync("yarn", ["global", isNew ? "add" : "upgrade", pkg], {
- stdio: "inherit",
+ stdio: "inherit"
});
}
-/**
- *
- * Spawns a new process that installs the scaffold/dependency
- *
- * @param {String} pkg - The dependency to be installed
- * @returns {Function} spawn - Installs the package
- */
-
-export function spawnChild(pkg: string): SpawnSyncReturns {
- const rootPath: string = getPathToGlobalPackages();
- const pkgPath: string = path.resolve(rootPath, pkg);
- const packageManager: string = getPackageManager();
- const isNew: boolean = !fs.existsSync(pkgPath);
- return SPAWN_FUNCTIONS[packageManager](pkg, isNew);
-}
+const SPAWN_FUNCTIONS: SpawnFunctions = {
+ npm: spawnNPM,
+ yarn: spawnYarn
+};
/**
*
@@ -69,10 +53,8 @@ export function spawnChild(pkg: string): SpawnSyncReturns {
*/
export function getPackageManager(): string {
- const hasLocalNPM: boolean = fs.existsSync(
- path.resolve(process.cwd(), "package-lock.json"),
- );
- const hasLocalYarn: boolean = fs.existsSync(path.resolve(process.cwd(), "yarn.lock"));
+ const hasLocalNPM = fs.existsSync(path.resolve(process.cwd(), "package-lock.json"));
+ const hasLocalYarn = fs.existsSync(path.resolve(process.cwd(), "yarn.lock"));
if (hasLocalNPM) {
return "npm";
} else if (hasLocalYarn) {
@@ -109,3 +91,18 @@ export function getPathToGlobalPackages(): string {
return require("global-modules");
}
+/**
+ *
+ * Spawns a new process that installs the scaffold/dependency
+ *
+ * @param {String} pkg - The dependency to be installed
+ * @returns {SpawnSyncReturns} spawn - Installs the package
+ */
+export function spawnChild(pkg: string): SpawnSyncReturns {
+ const rootPath: string = getPathToGlobalPackages();
+ const pkgPath: string = path.resolve(rootPath, pkg);
+ const packageManager: string = getPackageManager();
+ const isNew: boolean = !fs.existsSync(pkgPath);
+
+ return SPAWN_FUNCTIONS[packageManager](pkg, isNew);
+}
diff --git a/packages/utils/package.json b/packages/utils/package.json
index 631dedde138..3a243bbb1ad 100644
--- a/packages/utils/package.json
+++ b/packages/utils/package.json
@@ -12,6 +12,7 @@
"dependencies": {
"chalk": "^2.4.1",
"cross-spawn": "^6.0.5",
+ "findup-sync": "^3.0.0",
"global-modules": "^1.0.0",
"got": "8.x.x",
"jest": "^23.6.0",
@@ -31,12 +32,12 @@
"@types/node": "^10.12.9",
"@types/p-each-series": "^1.0.0",
"@types/prettier": "^1.15.0",
+ "@types/yeoman-generator": "^3.1.2",
"typescript": "^3.1.6"
},
"scripts": {
"build": "tsc",
"test": "jest --detectOpenHandles",
"watch": "npm run build && tsc -w"
- },
- "gitHead": "6846f2eb8f0d04acc4453cb20da10263ff00a139"
+ }
}
diff --git a/packages/utils/recursive-parser.test.js b/packages/utils/recursive-parser.test.js
deleted file mode 100644
index 7a6d6b99e05..00000000000
--- a/packages/utils/recursive-parser.test.js
+++ /dev/null
@@ -1,64 +0,0 @@
-"use strict";
-
-const defineTest = require("./defineTest").default;
-
-defineTest(__dirname, "init", "fixture-1", "entry", {
- objects: "are",
- super: [
- "yeah",
- {
- test: new RegExp(/\.(js|vue)$/),
- loader: "'eslint-loader'",
- enforce: "'pre'",
- include: ["customObj", "'Stringy'"],
- options: {
- formatter: "'someOption'"
- }
- }
- ],
- nice: "':)'",
- foo: "Promise.resolve()",
- man: "() => duper"
-});
-
-defineTest(__dirname, "add", "fixture-2", "entry", {
- objects: "are not",
- super: [
- "op",
- {
- test: new RegExp(/\.(wasm|c)$/),
- loader: "'pia-loader'",
- enforce: "'pre'",
- include: ["asd", "'Stringy'"],
- options: {
- formatter: "'nao'"
- }
- }
- ],
- nice: "'=)'",
- foo: "Promise.resolve()",
- man: "() => nice!!",
- mode: "super-man"
-});
-
-defineTest(__dirname, "remove", "fixture-3", "resolve", {
- alias: null
-});
-
-defineTest(__dirname, "remove", "fixture-3", "plugins", ["plugin2"]);
-
-defineTest(__dirname, "remove", "fixture-3", "module", {
- noParse: null
-});
-
-defineTest(__dirname, "remove", "fixture-3", "entry", {
- a: null
-});
-
-defineTest(__dirname, "remove", "fixture-3", "module", {
- rules: [
- {
- loader: "eslint-loader"
- }
- ]
-});
diff --git a/packages/utils/recursive-parser.ts b/packages/utils/recursive-parser.ts
index f6c9f03b7eb..a6312798f5b 100644
--- a/packages/utils/recursive-parser.ts
+++ b/packages/utils/recursive-parser.ts
@@ -1,9 +1,13 @@
import * as utils from "./ast-utils";
-import { IJSCodeshift, INode, valueType } from "./types/NodePath";
+import { JSCodeshift, Node, valueType } from "./types/NodePath";
export default function recursiveTransform(
- j: IJSCodeshift, ast: INode, key: string, value: valueType, action: string,
-): boolean | INode {
+ j: JSCodeshift,
+ ast: Node,
+ key: string,
+ value: valueType,
+ action: string
+): boolean | Node {
if (key === "topScope") {
if (Array.isArray(value)) {
return utils.parseTopScope(j, ast, value, action);
@@ -15,46 +19,39 @@ export default function recursiveTransform(
return utils.parseMerge(j, ast, value, action);
}
}
- const node: INode = utils.findRootNodesByName(j, ast, key);
+ const node: Node = utils.findRootNodesByName(j, ast, key);
// get module.exports prop
const root = ast
.find(j.ObjectExpression)
- .filter((p: INode): boolean => {
- return (
- utils.safeTraverse(p, [
- "parentPath",
- "value",
- "left",
- "object",
- "name",
- ]) === "module" &&
- utils.safeTraverse(p, [
- "parentPath",
- "value",
- "left",
- "property",
- "name",
- ]) === "exports"
- );
- })
- .filter((p: INode): boolean => p.value.properties);
+ .filter(
+ (p: Node): boolean => {
+ return (
+ utils.safeTraverse(p, ["parentPath", "value", "left", "object", "name"]) === "module" &&
+ utils.safeTraverse(p, ["parentPath", "value", "left", "property", "name"]) === "exports"
+ );
+ }
+ )
+ .filter((p: Node): boolean => !!(p.value as Node).properties);
if (node.size() !== 0) {
if (action === "add") {
- return utils.findRootNodesByName(j, root, key)
- .forEach((p: INode) => {
+ return utils.findRootNodesByName(j, root, key).forEach(
+ (p: Node): void => {
j(p).replaceWith(utils.addProperty(j, p, key, value, action));
- });
+ }
+ );
} else if (action === "remove") {
return utils.removeProperty(j, root, key, value);
}
} else {
- return root.forEach((p: INode) => {
- if (value) {
- // init, add new property
- utils.addProperty(j, p, key, value, null);
+ return root.forEach(
+ (p: Node): void => {
+ if (value) {
+ // init, add new property
+ utils.addProperty(j, p, key, value, null);
+ }
}
- });
+ );
}
}
diff --git a/packages/utils/resolve-packages.ts b/packages/utils/resolve-packages.ts
index b16823509a9..c5dabe60474 100644
--- a/packages/utils/resolve-packages.ts
+++ b/packages/utils/resolve-packages.ts
@@ -6,7 +6,7 @@ import modifyConfigHelper from "./modify-config-helper";
import { getPathToGlobalPackages } from "./package-manager";
import { spawnChild } from "./package-manager";
-interface IChildProcess {
+interface ChildProcess {
status: number;
}
@@ -18,14 +18,16 @@ interface IChildProcess {
* @returns {Promise} promise - Returns a promise to the installation
*/
-export function processPromise(child: IChildProcess): Promise {
- return new Promise((resolve: (_?: void) => void, reject: (_?: void) => void) => {
- if (child.status !== 0) {
- reject();
- } else {
- resolve();
+export function processPromise(child: ChildProcess): Promise {
+ return new Promise(
+ (resolve: () => void, reject: () => void): void => {
+ if (child.status !== 0) {
+ reject();
+ } else {
+ resolve();
+ }
}
- });
+ );
}
/**
@@ -48,46 +50,52 @@ export function resolvePackages(pkg: string[]): Function | void {
}
}
- pkg.forEach((scaffold: string) => {
- // Resolve paths to modules on local filesystem
- if (isLocalPath(scaffold)) {
- let absolutePath: string = scaffold;
-
- try {
- absolutePath = path.resolve(process.cwd(), scaffold);
- require.resolve(absolutePath);
- packageLocations.push(absolutePath);
- } catch (err) {
- console.error(`Cannot find a generator at ${absolutePath}.`);
- console.error("\nReason:\n");
- console.error(chalk.bold.red(err));
- process.exitCode = 1;
- }
-
- invokeGeneratorIfReady();
- return;
- }
+ pkg.forEach(
+ (scaffold: string): void => {
+ // Resolve paths to modules on local filesystem
+ if (isLocalPath(scaffold)) {
+ let absolutePath: string = scaffold;
- // Resolve modules on npm registry
- processPromise(spawnChild(scaffold))
- .then((_: void) => {
try {
- const globalPath: string = getPathToGlobalPackages();
- packageLocations.push(path.resolve(globalPath, scaffold));
+ absolutePath = path.resolve(process.cwd(), scaffold);
+ require.resolve(absolutePath);
+ packageLocations.push(absolutePath);
} catch (err) {
- console.error("Package wasn't validated correctly..");
- console.error("Submit an issue for", pkg, "if this persists");
- console.error("\nReason: \n");
+ console.error(`Cannot find a generator at ${absolutePath}.`);
+ console.error("\nReason:\n");
console.error(chalk.bold.red(err));
process.exitCode = 1;
}
- })
- .catch((err: string) => {
- console.error("Package couldn't be installed, aborting..");
- console.error("\nReason: \n");
- console.error(chalk.bold.red(err));
- process.exitCode = 1;
- })
- .then(invokeGeneratorIfReady);
- });
+
+ invokeGeneratorIfReady();
+ return;
+ }
+
+ // Resolve modules on npm registry
+ processPromise(spawnChild(scaffold))
+ .then(
+ (): void => {
+ try {
+ const globalPath: string = getPathToGlobalPackages();
+ packageLocations.push(path.resolve(globalPath, scaffold));
+ } catch (err) {
+ console.error("Package wasn't validated correctly..");
+ console.error("Submit an issue for", pkg, "if this persists");
+ console.error("\nReason: \n");
+ console.error(chalk.bold.red(err));
+ process.exitCode = 1;
+ }
+ }
+ )
+ .catch(
+ (err: string): void => {
+ console.error("Package couldn't be installed, aborting..");
+ console.error("\nReason: \n");
+ console.error(chalk.bold.red(err));
+ process.exitCode = 1;
+ }
+ )
+ .then(invokeGeneratorIfReady);
+ }
+ );
}
diff --git a/packages/utils/scaffold.ts b/packages/utils/scaffold.ts
index c3ced0fc904..2d2ece8a390 100644
--- a/packages/utils/scaffold.ts
+++ b/packages/utils/scaffold.ts
@@ -2,12 +2,14 @@ import chalk from "chalk";
import * as j from "jscodeshift";
import pEachSeries = require("p-each-series");
import * as path from "path";
+import { findProjectRoot } from "./find-root";
-import { IConfig, ITransformConfig } from "./modify-config-helper";
+import { Error } from "../init/types";
+import { Config, TransformConfig } from "./modify-config-helper";
import propTypes from "./prop-types";
import astTransform from "./recursive-parser";
import runPrettier from "./run-prettier";
-import { INode } from "./types/NodePath";
+import { Node } from "./types/NodePath";
/**
*
@@ -18,8 +20,8 @@ import { INode } from "./types/NodePath";
* @returns {Array} - An array with keys on which transformations need to be run
*/
-function mapOptionsToTransform(config: IConfig): string[] {
- return Object.keys(config.webpackOptions).filter((k: string) => propTypes.has(k));
+function mapOptionsToTransform(config: Config): string[] {
+ return Object.keys(config.webpackOptions).filter((k: string): boolean => propTypes.has(k));
}
/**
@@ -32,77 +34,73 @@ function mapOptionsToTransform(config: IConfig): string[] {
* and writes the file
*/
-export default function runTransform(transformConfig: ITransformConfig, action: string): void {
+export default function runTransform(transformConfig: TransformConfig, action: string): void {
// webpackOptions.name sent to nameTransform if match
- const webpackConfig = Object.keys(transformConfig).filter((p: string) => {
- return p !== "configFile" && p !== "configPath";
- });
- const initActionNotDefined: boolean = action && action !== "init" ? true : false;
-
- webpackConfig.forEach((scaffoldPiece: string) => {
- const config: IConfig = transformConfig[scaffoldPiece];
-
- const transformations: string[] = mapOptionsToTransform(config);
-
- if (config.topScope) {
- transformations.push("topScope");
+ const webpackConfig = Object.keys(transformConfig).filter(
+ (p: string): boolean => {
+ return p !== "configFile" && p !== "configPath";
}
+ );
+ const initActionNotDefined = action && action !== "init" ? true : false;
- if (config.merge) {
- transformations.push("merge");
- }
+ webpackConfig.forEach(
+ (scaffoldPiece: string): Promise => {
+ const config: Config = transformConfig[scaffoldPiece];
- const ast: INode = j(
- initActionNotDefined
- ? transformConfig.configFile
- : "module.exports = {}",
- );
+ const transformations = mapOptionsToTransform(config);
- const transformAction: string = action || null;
+ if (config.topScope && transformations.indexOf("topScope") === -1) {
+ transformations.push("topScope");
+ }
- return pEachSeries(transformations, (f: string): boolean | INode => {
- if (f === "merge" || f === "topScope") {
- return astTransform(j, ast, f, config[f], transformAction);
+ if (config.merge) {
+ transformations.push("merge");
}
- return astTransform(j, ast, f, config.webpackOptions[f], transformAction);
- })
- .then((value: string[]): void | PromiseLike => {
- let configurationName: string;
- if (!config.configName) {
- configurationName = "webpack.config.js";
- } else {
- configurationName = "webpack." + config.configName + ".js";
- }
- const outputPath: string = initActionNotDefined
- ? transformConfig.configPath
- : path.join(process.cwd(), configurationName);
- const source: string = ast.toSource({
- quote: "single",
- });
+ const ast: Node = j(initActionNotDefined ? transformConfig.configFile : "module.exports = {}");
+
+ const transformAction: string = action || null;
- runPrettier(outputPath, source);
- })
- .catch((err: IError) => {
- console.error(err.message ? err.message : err);
- });
- });
+ return pEachSeries(
+ transformations,
+ (f: string): boolean | Node => {
+ if (f === "merge" || f === "topScope") {
+ // TODO: typing here is difficult to understand
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ return astTransform(j, ast, f, config[f] as any, transformAction);
+ }
+ return astTransform(j, ast, f, config.webpackOptions[f], transformAction);
+ }
+ )
+ .then(
+ (): void | PromiseLike => {
+ let configurationName: string;
+ if (!config.configName) {
+ configurationName = "webpack.config.js";
+ } else {
+ configurationName = "webpack." + config.configName + ".js";
+ }
+ const projectRoot = findProjectRoot();
+ const outputPath: string = initActionNotDefined
+ ? transformConfig.configPath
+ : path.join(projectRoot || process.cwd(), configurationName);
+ const source: string = ast.toSource({
+ quote: "single"
+ });
+ runPrettier(outputPath, source);
+ }
+ )
+ .catch(
+ (err: Error): void => {
+ console.error(err.message ? err.message : err);
+ }
+ );
+ }
+ );
+ let successMessage: string = `Congratulations! Your new webpack configuration file has been created!\n`;
if (initActionNotDefined && transformConfig.config.item) {
- process.stdout.write(
- "\n" +
- chalk.green(
- `Congratulations! ${
- transformConfig.config.item
- } has been ${action}ed!\n`,
- ),
- );
- } else {
- process.stdout.write(
- "\n" +
- chalk.green(
- "Congratulations! Your new webpack configuration file has been created!\n",
- ),
- );
+ successMessage = `Congratulations! ${transformConfig.config.item} has been ${action}ed!\n`;
}
+ process.stdout.write("\n" + chalk.green(successMessage));
}
diff --git a/packages/utils/types/NodePath.ts b/packages/utils/types/NodePath.ts
index d082ddc6587..1b828378ddb 100644
--- a/packages/utils/types/NodePath.ts
+++ b/packages/utils/types/NodePath.ts
@@ -1,93 +1,99 @@
-export interface INode extends Object {
+export interface Node extends Object {
id?: {
name: string;
};
- arguments?: INode[];
- body?: INode[];
- elements?: INode[];
+ arguments?: Node[];
+ body?: Node[];
+ elements?: Node[];
expression?: {
left: {
- computed: boolean,
- object: INode,
- property: INode,
- type: string,
- },
- operator: string,
- right: INode,
- type: string,
+ computed: boolean;
+ object: Node;
+ property: Node;
+ type: string;
+ };
+ operator: string;
+ right: Node;
+ type: string;
+ value?: string;
};
- filter?: (p: (p: INode) => boolean) => INode;
- find?: (objectExpression: object, filterExpression?: object) => INode;
- forEach?: (p: (p: INode) => void) => INode;
- get?: (property: string) => INode;
- remove?: (_?: void) => void;
- nodes?: (_?: void) => INode[];
- pop?: (_?: void) => INode;
+ filter?: (p: (p: Node) => boolean) => Node;
+ find?: (objectExpression: object, filterExpression?: object) => Node;
+ forEach?: (p: (p: Node) => void) => Node;
+ get?: (property: string) => Node;
+ remove?: () => void;
+ nodes?: () => Node[];
+ pop?: () => Node;
key?: {
name: string;
- value: INode | string;
+ value: Node | string;
};
- node?: INode;
+ node?: Node;
name?: string;
object?: object;
- parent?: INode;
- properties?: INode[];
- property?: INode;
+ parent?: Node;
+ properties?: Node[];
+ property?: Node;
prune?: Function;
- replaceWith?: (objectExpression: object) => INode;
- size?: (_?: void) => number;
+ replaceWith?: (objectExpression: object) => Node;
+ size?: () => number;
type?: string;
- value?: INode | string | any;
- toSource?: (object: {
- quote?: string,
- }) => string;
+ value?: Node | string | Node[];
+ toSource?: (
+ object: {
+ quote?: string;
+ }
+ ) => string;
source?: string;
- ast?: INode;
- rules?: IModuleRule[];
- __paths?: INode[];
+ ast?: Node;
+ rules?: ModuleRule[];
+
+ declarations?: Node[];
+
+ __paths?: Node[];
}
-interface IModuleRule {
+interface ModuleRule {
loader?: string;
}
-interface IExpressionObject {
+interface ExpressionObject {
name?: string;
}
-export interface IJSCodeshift extends Object {
- (source?: INode | string): INode;
- withParser?: (parser: string) => IJSCodeshift;
- identifier?: (key: string) => INode;
- literal?: (key: valueType) => INode;
- memberExpression?: (node1: INode, node2: INode, bool?: boolean) => INode;
- objectProperty?: (key: INode, property: valueType) => INode;
- objectExpression?: (properties: INode[]) => INode;
- newExpression?: (expression: INode, args: INode[]) => INode;
- callExpression?: (expression: INode, args: INode[]) => INode;
- variableDeclarator?: (key: INode, args: INode) => INode;
- variableDeclaration?: (key: string, args: INode[]) => INode;
- arrayExpression?: (args?: INode[]) => INode;
- property?: (type: string, key: INode, value: INode) => INode;
- program?: (nodes: INode[]) => INode;
- booleanLiteral?: (bool: boolean) => INode;
- Property?: IExpressionObject;
- NewExpression?: IExpressionObject;
- CallExpression?: IExpressionObject;
- VariableDeclarator?: IExpressionObject;
- Identifier?: IExpressionObject;
- Literal?: IExpressionObject;
- ArrayExpression?: IExpressionObject;
- MemberExpression?: IExpressionObject;
- FunctionExpression?: IExpressionObject;
- ObjectExpression?: IExpressionObject;
- BlockStatement?: IExpressionObject;
- Program?: IExpressionObject;
+export interface JSCodeshift extends Object {
+ (source?: Node | string): Node;
+ withParser?: (parser: string) => JSCodeshift;
+ identifier?: (key: string) => Node;
+ literal?: (key: valueType) => Node;
+ memberExpression?: (node1: Node, node2: Node, bool?: boolean) => Node;
+ objectProperty?: (key: Node, property: valueType) => Node;
+ objectExpression?: (properties: Node[]) => Node;
+ newExpression?: (expression: Node, args: Node[]) => Node;
+ callExpression?: (expression: Node, args: Node[]) => Node;
+ variableDeclarator?: (key: Node, args: Node) => Node;
+ variableDeclaration?: (key: string, args: Node[]) => Node;
+ arrayExpression?: (args?: Node[]) => Node;
+ property?: (type: string, key: Node, value: Node) => Node;
+ program?: (nodes: Node[]) => Node;
+ booleanLiteral?: (bool: boolean) => Node;
+ Property?: ExpressionObject;
+ NewExpression?: ExpressionObject;
+ CallExpression?: ExpressionObject;
+ VariableDeclarator?: ExpressionObject;
+ Identifier?: ExpressionObject;
+ Literal?: ExpressionObject;
+ ArrayExpression?: ExpressionObject;
+ MemberExpression?: ExpressionObject;
+ FunctionExpression?: ExpressionObject;
+ ObjectExpression?: ExpressionObject;
+ BlockStatement?: ExpressionObject;
+ Program?: ExpressionObject;
filters?: {
VariableDeclarator: {
- requiresModule: Function,
- },
+ requiresModule: Function;
+ };
};
}
-export type valueType = string | number | boolean | any[] | INode | null;
+export type valueType = string | number | boolean | Node | null;
diff --git a/packages/utils/types/Yeoman.ts b/packages/utils/types/Yeoman.ts
deleted file mode 100644
index 4c56a771c00..00000000000
--- a/packages/utils/types/Yeoman.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-interface IRunEnv extends Object {
- on?: (event: string, callbackFn: Function) => void;
-}
-
-export interface IYeoman extends Object {
- registerStub?(generator: IGenerator, namespace: string): void;
- run?(target: string, options?: object, done?: Function): IRunEnv;
-}
-
-export interface IGenerator extends Object {
- composeWith?: (path: string) => void;
-}
diff --git a/packages/utils/types/index.ts b/packages/utils/types/index.ts
index fd94138d988..dba558d3ccf 100644
--- a/packages/utils/types/index.ts
+++ b/packages/utils/types/index.ts
@@ -1,4 +1,4 @@
-interface IError {
- stack?: object;
- message?: string;
+interface Error {
+ stack?: string;
+ message: string;
}
diff --git a/packages/utils/validate-identifier.ts b/packages/utils/validate-identifier.ts
index 341af6c6bd6..272b01f364a 100644
--- a/packages/utils/validate-identifier.ts
+++ b/packages/utils/validate-identifier.ts
@@ -3,18 +3,12 @@
// predicate containing a big ugly `switch` statement is faster than
// a regular expression, and on Chrome the two are about on par.
// https://tc39.github.io/ecma262/#sec-keywords
-function isKeyword(code: string) {
+function isKeyword(code: string): boolean {
switch (code.length) {
case 2:
return code === "if" || code === "in" || code === "do";
case 3:
- return (
- code === "var" ||
- code === "for" ||
- code === "new" ||
- code === "try" ||
- code === "let"
- );
+ return code === "var" || code === "for" || code === "new" || code === "try" || code === "let";
case 4:
return (
code === "this" ||
@@ -61,9 +55,7 @@ function isKeyword(code: string) {
case 8:
return code === "function" || code === "continue" || code === "debugger";
case 9:
- return (
- code === "protected" || code === "interface" || code === "arguments"
- );
+ return code === "protected" || code === "interface" || code === "arguments";
case 10:
return code === "instanceof" || code === "implements";
default:
@@ -77,19 +69,13 @@ function isKeyword(code: string) {
// are only applied when a character is found to actually have a
// code point above 128.
-/* tslint:disable: max-line-length */
-let nonASCIIidentifierStartChars: string =
-"\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0-\u08b2\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua7ad\ua7b0\ua7b1\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab5f\uab64\uab65\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
+let nonASCIIidentifierStartChars =
+ "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0-\u08b2\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua7ad\ua7b0\ua7b1\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab5f\uab64\uab65\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
let nonASCIIidentifierChars =
-"\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d01-\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1cf8\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2d\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
-/* tslint:enable: max-line-length */
+ "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d01-\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1cf8\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2d\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
-const nonASCIIidentifierStart: RegExp = new RegExp(
- "[" + nonASCIIidentifierStartChars + "]",
-);
-const nonASCIIidentifier: RegExp = new RegExp(
- "[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]",
-);
+const nonASCIIidentifierStart: RegExp = new RegExp("[" + nonASCIIidentifierStartChars + "]");
+const nonASCIIidentifier: RegExp = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
@@ -97,7 +83,7 @@ nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
// >0xffff code points that are a valid part of identifiers. The
// offset starts at 0x10000, and each pair of numbers represents an
// offset to the next range, and then a size of the range.
-const astralIdentifierStartCodes: number[] = [
+const astralIdentifierStartCodes = [
0,
11,
2,
@@ -425,10 +411,10 @@ const astralIdentifierStartCodes: number[] = [
12,
221,
16355,
- 541,
+ 541
];
-const astralIdentifierCodes: number[] = [
+const astralIdentifierCodes = [
509,
0,
227,
@@ -548,7 +534,7 @@ const astralIdentifierCodes: number[] = [
4305,
6,
792618,
- 239,
+ 239
];
// This has a complexity linear to the value of the code. The
@@ -558,10 +544,14 @@ function isInAstralSet(code: number, set: number[]): boolean {
let pos = 0x10000;
for (let i = 0; i < set.length; i += 2) {
pos += set[i];
- if (pos > code) { return false; }
+ if (pos > code) {
+ return false;
+ }
pos += set[i + 1];
- if (pos >= code) { return true; }
+ if (pos >= code) {
+ return true;
+ }
}
}
@@ -569,16 +559,49 @@ function isInAstralSet(code: number, set: number[]): boolean {
function isIdentifierStart(code: string): boolean {
const c: number = code.charCodeAt(0);
- if (c < 65) { return c === 36; }
- if (c < 91) { return true; }
- if (c < 97) { return c === 95; }
- if (c < 123) { return true; }
+ if (c < 65) {
+ return c === 36;
+ }
+ if (c < 91) {
+ return true;
+ }
+ if (c < 97) {
+ return c === 95;
+ }
+ if (c < 123) {
+ return true;
+ }
if (c <= 0xffff) {
return c >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(c));
}
return isInAstralSet(c, astralIdentifierStartCodes);
}
+function validationChar(charCode: number): boolean {
+ if (charCode < 48) {
+ return charCode === 36;
+ }
+ if (charCode < 58) {
+ return true;
+ }
+ if (charCode < 65) {
+ return false;
+ }
+ if (charCode < 91) {
+ return true;
+ }
+ if (charCode < 97) {
+ return charCode === 95;
+ }
+ if (charCode < 123) {
+ return true;
+ }
+ if (charCode <= 0xffff) {
+ return charCode >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(charCode));
+ }
+ return isInAstralSet(charCode, astralIdentifierStartCodes) || isInAstralSet(charCode, astralIdentifierCodes);
+}
+
// Test whether a given character is part of an identifier.
function isIdentifierChar(code: string): boolean {
@@ -595,24 +618,4 @@ function isIdentifierChar(code: string): boolean {
}
}
-function validationChar(charCode: number): boolean {
- if (charCode < 48) { return charCode === 36; }
- if (charCode < 58) { return true; }
- if (charCode < 65) { return false; }
- if (charCode < 91) { return true; }
- if (charCode < 97) { return charCode === 95; }
- if (charCode < 123) { return true; }
- if (charCode <= 0xffff) {
- return charCode >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(charCode));
- }
- return (
- isInAstralSet(charCode, astralIdentifierStartCodes) ||
- isInAstralSet(charCode, astralIdentifierCodes)
- );
-}
-
-export {
- isIdentifierChar,
- isIdentifierStart,
- isKeyword,
-};
+export { isIdentifierChar, isIdentifierStart, isKeyword };
diff --git a/packages/webpack-scaffold/.eslintrc b/packages/webpack-scaffold/.eslintrc
new file mode 100644
index 00000000000..365d9f85d71
--- /dev/null
+++ b/packages/webpack-scaffold/.eslintrc
@@ -0,0 +1,11 @@
+{
+ "root": true,
+ "extends": [
+ "../../.eslintrc.js",
+ "plugin:@typescript-eslint/recommended",
+ "prettier",
+ "prettier/@typescript-eslint"
+ ],
+ "parser": "@typescript-eslint/parser",
+ "plugins": ["@typescript-eslint"]
+}
diff --git a/packages/webpack-scaffold/README.md b/packages/webpack-scaffold/README.md
index 11e294e0391..a0a92441b40 100755
--- a/packages/webpack-scaffold/README.md
+++ b/packages/webpack-scaffold/README.md
@@ -1,20 +1,26 @@
# webpack-scaffold
-This is the utility suite for creating a webpack `scaffold`. It contains utility functions to assist with inquirer prompting and scaffolding.
+[![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.
+
# Installation
+
```bash
npm i -D webpack-cli @webpack-cli/webpack-scaffold
```
+
# API
-1. [parseValue()](#parsevalue)
-2. [createArrowFunction()](#createarrowfunction)
-3. [createRegularFunction()](#createregularfunction)
-4. [createDynamicPromise()](#createdynamicpromise)
-5. [createAssetFilterFunction()](#createassetfilterfunction)
-6. [createExternalFunction()](#createexternalfunction)
-7. [createRequire()](#createrequire)
-8. 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
Param: `String`
@@ -22,21 +28,22 @@ 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'
```
+
## createArrowFunction
Param: `String`
-Generally used when dealing with an entry point as an arrow function.
+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'
```
@@ -44,26 +51,28 @@ this.configuration.myScaffold.webpackOptions.entry = createArrowFunction('app.js
Param: `String`
-Used when creating a function that returns a single value.
+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' }
```
+
## createDynamicPromise
Param: `Array` | `String`
-Used to create an dynamic entry point.
+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']))
```
@@ -74,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'); }
```
@@ -87,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) {
@@ -98,7 +107,6 @@ externals: [
}
callback();
}
-
*/
```
@@ -109,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')
```
@@ -122,19 +130,23 @@ this.configuration.myScaffold.topScope = [createRequire('webpack')]
Param: `name, message, choices`
Creates a List from Inquirer
+
```js
-const List = require('@webpack-cli/webpack-scaffold').List;
-List('entry', 'what kind of entry do you want?', ['Array', 'Function'])
+const List = require("@webpack-cli/webpack-scaffold").List;
+
+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;
-RawList('entry', 'what kind of entry do you want?', ['Array', 'Function'])
+const RawList = require("@webpack-cli/webpack-scaffold").RawList;
+
+RawList("entry", "what kind of entry do you want?", ["Array", "Function"]);
```
### CheckList
@@ -142,19 +154,23 @@ RawList('entry', 'what kind of entry do you want?', ['Array', 'Function'])
Param: `name, message, choices`
Creates a CheckList(`checkbox`) from Inquirer
+
```js
-const CheckList = require('@webpack-cli/webpack-scaffold').CheckList;
-CheckList('entry', 'what kind of entry do you want?', ['Array', 'Function'])
+const CheckList = require("@webpack-cli/webpack-scaffold").CheckList;
+
+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;
-Input('entry', 'what is your entry point?')
+const Input = require("@webpack-cli/webpack-scaffold").Input;
+
+Input("entry", "what is your entry point?");
```
### InputValidate
@@ -162,24 +178,31 @@ Input('entry', 'what is your entry point?')
Param: `name, message, validate`
Creates an Input from Inquirer
+
```js
-const Input = require('@webpack-cli/webpack-scaffold').Input;
-const validation = (value) => {
- if(value.length > 4) {
- return true;
- } else {
- return 'Wow, that was short!'
- }
-}
-Input('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
-Param: `name, message`
+Param: `name, message, default`
Creates an Input from Inquirer
+
```js
-const Confirm = require('@webpack-cli/webpack-scaffold').Confirm;
-Confirm('contextConfirm', 'Is this your context?')
+const Confirm = require("@webpack-cli/webpack-scaffold").Confirm;
+
+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
diff --git a/packages/webpack-scaffold/__tests__/.eslintrc b/packages/webpack-scaffold/__tests__/.eslintrc
new file mode 100644
index 00000000000..5d4340a351d
--- /dev/null
+++ b/packages/webpack-scaffold/__tests__/.eslintrc
@@ -0,0 +1,7 @@
+{
+ "root": true,
+ "extends": ["../.eslintrc"],
+ "rules": {
+ "@typescript-eslint/explicit-function-return-type": ["off"]
+ }
+}
diff --git a/packages/webpack-scaffold/__tests__/__snapshots__/index.test.js.snap b/packages/webpack-scaffold/__tests__/__snapshots__/index.test.ts.snap
similarity index 97%
rename from packages/webpack-scaffold/__tests__/__snapshots__/index.test.js.snap
rename to packages/webpack-scaffold/__tests__/__snapshots__/index.test.ts.snap
index afd57eac245..0304203ef64 100755
--- a/packages/webpack-scaffold/__tests__/__snapshots__/index.test.js.snap
+++ b/packages/webpack-scaffold/__tests__/__snapshots__/index.test.ts.snap
@@ -31,13 +31,13 @@ callback();
}"
`;
-exports[`utils createRegularFunction should stringify an regular function 1`] = `
+exports[`utils createRegularFunction should stringify a regular function 1`] = `
"function () {
return 'app.js'
}"
`;
-exports[`utils createRequire should stringify an require statement 1`] = `"const webpack = require('webpack');"`;
+exports[`utils createRequire should stringify a require statement 1`] = `"const webpack = require('webpack');"`;
exports[`utils parseValue should parse value 1`] = `
Collection {
diff --git a/packages/webpack-scaffold/__tests__/index.test.js b/packages/webpack-scaffold/__tests__/index.test.ts
similarity index 71%
rename from packages/webpack-scaffold/__tests__/index.test.js
rename to packages/webpack-scaffold/__tests__/index.test.ts
index 3c3e2981449..0db475e179a 100755
--- a/packages/webpack-scaffold/__tests__/index.test.js
+++ b/packages/webpack-scaffold/__tests__/index.test.ts
@@ -1,5 +1,5 @@
"use strict";
-const utils = require("../index");
+import * as utils from "../index";
describe("utils", () => {
describe("createArrowFunction", () => {
@@ -8,7 +8,7 @@ describe("utils", () => {
});
});
describe("createRegularFunction", () => {
- it("should stringify an regular function", () => {
+ it("should stringify a regular function", () => {
expect(utils.createRegularFunction("app.js")).toMatchSnapshot();
});
});
@@ -18,7 +18,7 @@ describe("utils", () => {
});
it("should stringify an array", () => {
expect(
- utils.createDynamicPromise(["app.js", "index.js"])
+ utils.createDynamicPromise(["app.js", "index.js"]),
).toMatchSnapshot();
});
});
@@ -41,56 +41,65 @@ describe("utils", () => {
});
});
describe("createRequire", () => {
- it("should stringify an require statement", () => {
+ it("should stringify a require statement", () => {
expect(utils.createRequire("webpack")).toMatchSnapshot();
});
});
describe("Inquirer", () => {
- it("should make an List object", () => {
+ it("should make a List object", () => {
expect(utils.List("entry", "does it work?", ["Yes", "Maybe"])).toEqual({
- type: "list",
- name: "entry",
+ choices: ["Yes", "Maybe"],
message: "does it work?",
- choices: ["Yes", "Maybe"]
+ name: "entry",
+ type: "list",
});
});
- it("should make an RawList object", () => {
+ it("should make a RawList object", () => {
expect(
- utils.RawList("output", "does it work?", ["Yes", "Maybe"])
+ utils.RawList("output", "does it work?", ["Yes", "Maybe"]),
).toEqual({
- type: "rawlist",
- name: "output",
+ choices: ["Yes", "Maybe"],
message: "does it work?",
- choices: ["Yes", "Maybe"]
+ name: "output",
+ type: "rawlist",
});
});
- it("should make an CheckList object", () => {
+ it("should make a CheckList object", () => {
expect(
- utils.CheckList("context", "does it work?", ["Yes", "Maybe"])
+ utils.CheckList("context", "does it work?", ["Yes", "Maybe"]),
).toEqual({
- type: "checkbox",
- name: "context",
+ choices: ["Yes", "Maybe"],
message: "does it work?",
- choices: ["Yes", "Maybe"]
+ name: "context",
+ type: "checkbox",
});
});
it("should make an Input object", () => {
expect(utils.Input("plugins", "what is your plugin?")).toEqual({
- type: "input",
+ message: "what is your plugin?",
name: "plugins",
- message: "what is your plugin?"
+ type: "input",
});
});
- it("should make an Confirm object", () => {
+ it("should make a Confirm object", () => {
expect(utils.Confirm("context", "what is your context?")).toEqual({
+ default: true,
+ message: "what is your context?",
+ name: "context",
type: "confirm",
+ });
+ });
+ it("should make a Confirm object with No as default", () => {
+ expect(utils.Confirm("context", "what is your context?", false)).toEqual({
+ default: false,
+ message: "what is your context?",
name: "context",
- message: "what is your context?"
+ type: "confirm",
});
});
it("should make an Input object with validation", () => {
expect(
- utils.InputValidate("plugins", "what is your plugin?", () => {})
+ utils.InputValidate("plugins", "what is your plugin?", () => true),
).toMatchSnapshot();
});
});
diff --git a/packages/webpack-scaffold/index.ts b/packages/webpack-scaffold/index.ts
index 01cf53a3558..0a4ceb38d5c 100755
--- a/packages/webpack-scaffold/index.ts
+++ b/packages/webpack-scaffold/index.ts
@@ -1,44 +1,27 @@
import * as jscodeshift from "jscodeshift";
+import * as Generator from "yeoman-generator";
-export interface IInquirerScaffoldObject {
- type?: string;
- name: string;
- message: string;
- choices?: ((answers: Object) => string) | string[];
- default?: string | number | string[] | number[] | ((answers: Object) => (string | number | string[] | number[]));
- validate?: ((input: string) => boolean | string);
- when?: ((answers: Object) => boolean) | boolean;
- store?: boolean;
- filter?: (name: string) => string;
-}
-
-export interface IInquirerList extends IInquirerScaffoldObject {
- choices?: string[];
-}
-
-export interface IInquirerInput extends IInquirerScaffoldObject {
- validate?: (input: string) => string | boolean;
-}
-
-export function createArrowFunction(value: Function): string {
+export function createArrowFunction(value: string): string {
return `() => '${value}'`;
}
-export function createRegularFunction(value: Function): string {
+export function createRegularFunction(value: string): string {
return `function () {\n return '${value}'\n}`;
}
-export function createDynamicPromise(arrOrString: Function[] | string): string {
+export function createDynamicPromise(arrOrString: string[] | string): string {
if (Array.isArray(arrOrString)) {
return (
"() => new Promise((resolve) => resolve([" +
- arrOrString.map((func: Function) => {
- return "'" + func + "'";
- }) +
+ arrOrString.map(
+ (func: string): string => {
+ return "'" + func + "'";
+ }
+ ) +
"]))"
);
} else {
- return "() => new Promise((resolve) => resolve(" + "'" + arrOrString + "'" + "))";
+ return `() => new Promise((resolve) => resolve('${arrOrString}'))`;
}
}
@@ -66,62 +49,68 @@ export function createRequire(val: string): string {
return `const ${val} = require('${val}');`;
}
-export function List(name: string, message: string, choices: string[]): IInquirerList {
+export function List(name: string, message: string, choices: string[]): Generator.Question {
return {
choices,
message,
name,
- type: "list",
+ type: "list"
};
}
-export function RawList(name: string, message: string, choices: string[]): IInquirerList {
+export function RawList(name: string, message: string, choices: string[]): Generator.Question {
return {
choices,
message,
name,
- type: "rawlist",
+ type: "rawlist"
};
}
-export function CheckList(name: string, message: string, choices: string[]): IInquirerList {
+export function CheckList(name: string, message: string, choices: string[]): Generator.Question {
return {
choices,
message,
name,
- type: "checkbox",
+ type: "checkbox"
};
}
-export function Input(name: string, message: string): IInquirerInput {
+export function Input(name: string, message: string): Generator.Question {
return {
message,
name,
- type: "input",
+ type: "input"
};
}
-export function InputValidate(name: string, message: string, cb?: (input: string) => string | boolean): IInquirerInput {
+export function InputValidate(name: string, message: string, cb?: (input: string) => string | boolean): Generator.Question {
return {
message,
name,
type: "input",
- validate: cb,
+ validate: cb
};
}
-export function Confirm(name: string, message: string): IInquirerScaffoldObject {
+export function Confirm(name: string, message: string, defaultChoice: boolean = true): Generator.Question {
return {
+ default: defaultChoice,
message,
name,
- type: "confirm",
+ type: "confirm"
};
}
-export function AutoComplete(name: string, message: string, options: object = {}) {
- return Object.assign({
- message,
- name,
- type: "autocomplete",
- }, options);
+// TODO: to understand this type
+// eslint-disable-next-line
+export function AutoComplete(name: string, message: string, options: object = {}): any {
+ return Object.assign(
+ {
+ message,
+ name,
+ type: "autocomplete"
+ },
+ options
+ );
}
diff --git a/packages/webpack-scaffold/package-lock.json b/packages/webpack-scaffold/package-lock.json
index 9ef7540efc7..825247992d0 100644
--- a/packages/webpack-scaffold/package-lock.json
+++ b/packages/webpack-scaffold/package-lock.json
@@ -1,9 +1,44 @@
{
"name": "@webpack-cli/webpack-scaffold",
- "version": "0.1.3",
+ "version": "0.1.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
+ "@types/inquirer": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/@types/inquirer/-/inquirer-6.0.1.tgz",
+ "integrity": "sha512-O9rEHE9iBvYaFAGS0fAlDzqY/3CsOrRKzni4zwnAEce2JrHUEbXAce2Pwwe8ZGzmQkucwSXn1tSiKig37INgfA==",
+ "dev": true,
+ "requires": {
+ "@types/through": "*",
+ "rxjs": ">=6.4.0"
+ }
+ },
+ "@types/node": {
+ "version": "11.13.8",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-11.13.8.tgz",
+ "integrity": "sha512-szA3x/3miL90ZJxUCzx9haNbK5/zmPieGraZEe4WI+3srN0eGLiT22NXeMHmyhNEopn+IrxqMc7wdVwvPl8meg==",
+ "dev": true
+ },
+ "@types/through": {
+ "version": "0.0.29",
+ "resolved": "https://registry.npmjs.org/@types/through/-/through-0.0.29.tgz",
+ "integrity": "sha512-9a7C5VHh+1BKblaYiq+7Tfc+EOmjMdZaD1MYtkQjSoxgB69tBjW98ry6SKsi4zEIWztLOMRuL87A3bdT/Fc/4w==",
+ "dev": true,
+ "requires": {
+ "@types/node": "*"
+ }
+ },
+ "@types/yeoman-generator": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/@types/yeoman-generator/-/yeoman-generator-3.1.2.tgz",
+ "integrity": "sha512-Wr67yKgBKxKJ9eUNCL5WuKuc3e9CSCbdw8nMDiBatp+/NHgvriqUGjt5kbWBIfLG9yRdIKaxT4Tf8L+VVd7qSA==",
+ "dev": true,
+ "requires": {
+ "@types/inquirer": "*",
+ "rxjs": ">=6.4.0"
+ }
+ },
"ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
@@ -97,7 +132,7 @@
"dependencies": {
"jsesc": {
"version": "1.3.0",
- "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz",
"integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s="
}
}
@@ -883,7 +918,7 @@
},
"expand-range": {
"version": "1.8.2",
- "resolved": "http://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz",
+ "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz",
"integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=",
"requires": {
"fill-range": "^2.1.0"
@@ -1098,12 +1133,12 @@
},
"jsesc": {
"version": "0.5.0",
- "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
"integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0="
},
"json5": {
"version": "0.5.1",
- "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz",
"integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE="
},
"kind-of": {
@@ -1162,12 +1197,12 @@
},
"minimist": {
"version": "0.0.8",
- "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
},
"mkdirp": {
"version": "0.5.1",
- "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"requires": {
"minimist": "0.0.8"
@@ -1214,7 +1249,7 @@
},
"strip-ansi": {
"version": "0.1.1",
- "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz",
"integrity": "sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE="
}
}
@@ -1243,12 +1278,12 @@
},
"os-homedir": {
"version": "1.0.2",
- "resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
+ "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M="
},
"os-tmpdir": {
"version": "1.0.2",
- "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
+ "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
},
"parse-glob": {
@@ -1264,7 +1299,7 @@
},
"path-is-absolute": {
"version": "1.0.1",
- "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
},
"preserve": {
@@ -1347,7 +1382,7 @@
},
"regexpu-core": {
"version": "2.0.0",
- "resolved": "http://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz",
+ "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz",
"integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=",
"requires": {
"regenerate": "^1.2.1",
@@ -1357,12 +1392,12 @@
},
"regjsgen": {
"version": "0.2.0",
- "resolved": "http://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz",
+ "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz",
"integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc="
},
"regjsparser": {
"version": "0.1.5",
- "resolved": "http://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz",
+ "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz",
"integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=",
"requires": {
"jsesc": "~0.5.0"
@@ -1393,9 +1428,18 @@
},
"rimraf": {
"version": "2.2.8",
- "resolved": "http://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz",
"integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI="
},
+ "rxjs": {
+ "version": "6.5.1",
+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.1.tgz",
+ "integrity": "sha512-y0j31WJc83wPu31vS1VlAFW5JGrnGC+j+TtGAa1fRQphy48+fDYiDmX8tjGloToEsMkxnouOg/1IzXGKkJnZMg==",
+ "dev": true,
+ "requires": {
+ "tslib": "^1.9.0"
+ }
+ },
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
@@ -1426,7 +1470,7 @@
},
"strip-ansi": {
"version": "3.0.1",
- "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"requires": {
"ansi-regex": "^2.0.0"
@@ -1434,12 +1478,12 @@
},
"supports-color": {
"version": "2.0.0",
- "resolved": "http://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc="
},
"temp": {
"version": "0.8.3",
- "resolved": "http://registry.npmjs.org/temp/-/temp-0.8.3.tgz",
+ "resolved": "https://registry.npmjs.org/temp/-/temp-0.8.3.tgz",
"integrity": "sha1-4Ma8TSa5AxJEEOT+2BEDAU38H1k=",
"requires": {
"os-tmpdir": "^1.0.0",
@@ -1456,6 +1500,12 @@
"resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz",
"integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM="
},
+ "tslib": {
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz",
+ "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==",
+ "dev": true
+ },
"typescript": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.2.tgz",
@@ -1464,7 +1514,7 @@
},
"underscore": {
"version": "1.6.0",
- "resolved": "http://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz",
+ "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz",
"integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag="
},
"write-file-atomic": {
diff --git a/packages/webpack-scaffold/package.json b/packages/webpack-scaffold/package.json
index fb34aebeb85..26096b56a7c 100644
--- a/packages/webpack-scaffold/package.json
+++ b/packages/webpack-scaffold/package.json
@@ -13,12 +13,12 @@
"jscodeshift": "^0.5.1"
},
"devDependencies": {
+ "@types/yeoman-generator": "^3.1.2",
"typescript": "^3.1.6"
},
"scripts": {
"test": "jest --detectOpenHandles",
"build": "tsc",
"watch": "npm run build && tsc -w"
- },
- "gitHead": "6846f2eb8f0d04acc4453cb20da10263ff00a139"
+ }
}
diff --git a/test/binCases/stats/single-config/single-config.test.js b/test/binCases/stats/single-config/single-config.test.js
index e7b29b4a12c..e8f50126247 100644
--- a/test/binCases/stats/single-config/single-config.test.js
+++ b/test/binCases/stats/single-config/single-config.test.js
@@ -6,8 +6,8 @@ jest.setTimeout(10E6);
const { run, extractSummary } = require("../../../testUtils");
-test("single-config", async done => {
- const { code, stdout, stderr } = await run(__dirname);
+test("single-config", done => {
+ const { code, stdout, stderr } = run(__dirname);
const summary = extractSummary(stdout);
diff --git a/test/binCases/watch/info-verbosity-off/info-verbosity-off.test.js b/test/binCases/watch/info-verbosity-off/info-verbosity-off.test.js
index 10313d086bf..bb416f354bd 100644
--- a/test/binCases/watch/info-verbosity-off/info-verbosity-off.test.js
+++ b/test/binCases/watch/info-verbosity-off/info-verbosity-off.test.js
@@ -28,7 +28,7 @@ afterEach(() => {
}
});
-test.skip("info-verbosity-off", async done => {
+test.skip("info-verbosity-off", done => {
var webpackProc = runAndGetWatchProc(__dirname, [
"--entry ",
"./index.js",
diff --git a/test/binCases/watch/info-verbosity-verbose/info-verbosity-verbose.test.js b/test/binCases/watch/info-verbosity-verbose/info-verbosity-verbose.test.js
index c3ccd9102e4..5b6b3972189 100644
--- a/test/binCases/watch/info-verbosity-verbose/info-verbosity-verbose.test.js
+++ b/test/binCases/watch/info-verbosity-verbose/info-verbosity-verbose.test.js
@@ -28,7 +28,7 @@ afterEach(() => {
}
});
-test.skip("info-verbosity-verbose", async done => {
+test.skip("info-verbosity-verbose", done => {
const webpackProc = runAndGetWatchProc(__dirname, [
"--entry ",
"./index.js",
diff --git a/test/binCases/watch/multi-config-watch-opt/multi-config-watch-opt.test.js b/test/binCases/watch/multi-config-watch-opt/multi-config-watch-opt.test.js
index 1b691428608..a89fb1b53e8 100644
--- a/test/binCases/watch/multi-config-watch-opt/multi-config-watch-opt.test.js
+++ b/test/binCases/watch/multi-config-watch-opt/multi-config-watch-opt.test.js
@@ -28,7 +28,7 @@ afterEach(() => {
}
});
-test.skip("multi-config-watch-opt", async done => {
+test.skip("multi-config-watch-opt", done => {
const webpackProc = runAndGetWatchProc(__dirname, [
"--entry",
"./index.js",
diff --git a/test/binCases/watch/multi-config/multi-config.test.js b/test/binCases/watch/multi-config/multi-config.test.js
index fbb4f055d58..7738b81472d 100644
--- a/test/binCases/watch/multi-config/multi-config.test.js
+++ b/test/binCases/watch/multi-config/multi-config.test.js
@@ -28,7 +28,7 @@ afterEach(() => {
}
});
-test.skip("multi-config", async done => {
+test.skip("multi-config", done => {
const webpackProc = runAndGetWatchProc(__dirname);
// info-verbosity is set to info by default
diff --git a/test/binCases/watch/single-config-watch-opt/single-config-watch-opt.test.js b/test/binCases/watch/single-config-watch-opt/single-config-watch-opt.test.js
index 1d1ab6be2f5..47c512c47ce 100644
--- a/test/binCases/watch/single-config-watch-opt/single-config-watch-opt.test.js
+++ b/test/binCases/watch/single-config-watch-opt/single-config-watch-opt.test.js
@@ -28,7 +28,7 @@ afterEach(() => {
}
});
-test.skip("single-config-watch-opt", async done => {
+test.skip("single-config-watch-opt", done => {
const webpackProc = runAndGetWatchProc(__dirname, [
"--entry",
"./index.js",
diff --git a/test/binCases/watch/single-config/single-config.test.js b/test/binCases/watch/single-config/single-config.test.js
index 51fca537634..1865cd130a9 100644
--- a/test/binCases/watch/single-config/single-config.test.js
+++ b/test/binCases/watch/single-config/single-config.test.js
@@ -28,7 +28,7 @@ afterEach(() => {
}
});
-test.skip("single-config", async(done) => {
+test.skip("single-config", done => {
const webpackProc = runAndGetWatchProc(__dirname, [
"--entry",
"./index.js",
diff --git a/tsconfig.base.json b/tsconfig.base.json
index 7f5d043ed5f..d92fae8bb6a 100644
--- a/tsconfig.base.json
+++ b/tsconfig.base.json
@@ -1,11 +1,16 @@
{
- "compilerOptions": {
- "target": "es6",
- "module": "commonjs",
- "moduleResolution": "node",
- "allowSyntheticDefaultImports": true,
- "skipLibCheck": true
- },
- "include": ["packages/**/*.ts"],
- "exclude": ["node_modules/**", "packages/*/node_modules/**", "packages/*/__tests__/*.test.ts"]
+ "compilerOptions": {
+ "target": "es6",
+ "module": "commonjs",
+ "moduleResolution": "node",
+ "allowSyntheticDefaultImports": true,
+ "skipLibCheck": true
+ },
+ "include": ["packages/**/*.ts"],
+ "exclude": [
+ "node_modules/**",
+ "packages/*/node_modules/**",
+ "packages/**/__tests__/*.test.ts",
+ "packages/**/__testfixtures__/*.ts"
+ ]
}
diff --git a/tsconfig.json b/tsconfig.json
index b76518ebc78..4257314b6ca 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,6 +1,6 @@
{
- "extends": "./tsconfig.base.json",
- "compilerOptions": {
- "allowJs": true
- }
+ "extends": "./tsconfig.base.json",
+ "compilerOptions": {
+ "allowJs": true
+ }
}
diff --git a/tsconfig.packages.json b/tsconfig.packages.json
index 41bddf784fc..3f4af061bd6 100644
--- a/tsconfig.packages.json
+++ b/tsconfig.packages.json
@@ -1,6 +1,6 @@
{
- "extends": "tsconfig.base.json",
- "compilerOptions": {
- "declaration": true
- }
+ "extends": "./tsconfig.base.json",
+ "compilerOptions": {
+ "declaration": true
+ }
}
diff --git a/tslint.json b/tslint.json
deleted file mode 100644
index ee672ce2d93..00000000000
--- a/tslint.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "defaultSeverity": "error",
- "extends": [
- "tslint:recommended"
- ],
- "jsRules": {},
- "rules": {
- "indent": [
- true,
- "tabs",
- 4
- ],
- "ban-types": [
- false
- ],
- "no-console": [true, "log"]
- },
- "rulesDirectory": [],
- "linterOptions": {
- "exclude": [
- "node_modules/**",
- "packages/*/node_modules/**"
- ]
- }
-}