From 5aada52f9dc25c41300aea908d56bf216a682186 Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Fri, 7 Jun 2019 18:16:02 +0300 Subject: [PATCH] chore(default): update BREAKING CHANGE: minimum required nodejs version is 8.9 --- .babelrc | 35 - .circleci/config.yml | 141 - .eslintignore | 5 +- .eslintrc.js | 11 +- .gitattributes | 3 +- .github/CONTRIBUTING.md | 112 +- .github/FUNDING.yml | 1 + .github/ISSUE_TEMPLATE/BUG.md | 21 +- .github/ISSUE_TEMPLATE/DOCS.md | 4 +- .github/ISSUE_TEMPLATE/FEATURE.md | 15 +- .github/ISSUE_TEMPLATE/MODIFICATION.md | 18 +- .github/ISSUE_TEMPLATE/SUPPORT.md | 3 +- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .gitignore | 1 + .prettierignore | 5 + .prettierrc | 5 - .prettierrc.js | 5 + CONTRIBUTING.md | 116 - README.md | 83 +- appveyor.yml | 30 - azure-pipelines.yml | 192 + babel.config.js | 19 + codecov.yml | 10 - commitlint.config.js | 31 +- husky.config.js | 6 + lint-staged.config.js | 7 + package-lock.json | 15914 ++++++++++------------- package.json | 98 +- src/karma-webpack.js | 17 +- src/mocha-env-loader.js | 6 +- 30 files changed, 7055 insertions(+), 9861 deletions(-) delete mode 100644 .babelrc delete mode 100644 .circleci/config.yml create mode 100644 .github/FUNDING.yml create mode 100644 .prettierignore delete mode 100644 .prettierrc create mode 100644 .prettierrc.js delete mode 100644 CONTRIBUTING.md delete mode 100644 appveyor.yml create mode 100644 azure-pipelines.yml create mode 100644 babel.config.js delete mode 100644 codecov.yml create mode 100644 husky.config.js create mode 100644 lint-staged.config.js diff --git a/.babelrc b/.babelrc deleted file mode 100644 index a63facd..0000000 --- a/.babelrc +++ /dev/null @@ -1,35 +0,0 @@ -{ - "presets": [ - [ - "env", - { - "useBuiltIns": true, - "targets": { - "node": "6.9.0" - }, - "exclude": [ - "transform-async-to-generator", - "transform-regenerator" - ] - } - ] - ], - "plugins": [ - [ - "transform-object-rest-spread", - { - "useBuiltIns": true - } - ] - ], - "env": { - "test": { - "presets": [ - "env" - ], - "plugins": [ - "transform-object-rest-spread" - ] - } - } -} diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 4512dd3..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,141 +0,0 @@ -unit_tests: &unit_tests - steps: - - checkout - - restore_cache: - key: dependency-cache-{{ checksum "package-lock.json" }} - - run: - name: NPM Rebuild - command: npm install - - run: - name: Run unit tests. - command: npm run ci:test -canary_tests: &canary_tests - steps: - - checkout - - restore_cache: - key: dependency-cache-{{ checksum "package-lock.json" }} - - run: - name: NPM Rebuild - command: npm install - - run: - name: Install Webpack Canary - command: npm i --no-save webpack@next - - run: - name: Run unit tests. - command: if [[ $(compver --name webpack --gte next --lt latest) < 1 ]] ; then printf "Next is older than Latest - Skipping Canary Suite"; else npm run ci:test ; fi - -version: 2 -jobs: - dependency_cache: - docker: - - image: webpackcontrib/circleci-node-base:latest - steps: - - checkout - - restore_cache: - key: dependency-cache-{{ checksum "package-lock.json" }} - - run: - name: Install Dependencies - command: npm install - - save_cache: - key: dependency-cache-{{ checksum "package-lock.json" }} - paths: - - ./node_modules - - node8-latest: - docker: - - image: webpackcontrib/circleci-node8:latest - steps: - - checkout - - restore_cache: - key: dependency-cache-{{ checksum "package-lock.json" }} - - run: - name: NPM Rebuild - command: npm install - - run: - name: Run unit tests. - command: npm run ci:coverage - - run: - name: Submit coverage data to codecov. - command: bash <(curl -s https://codecov.io/bash) - when: on_success - node10-latest: - docker: - - image: webpackcontrib/circleci-node10:latest - <<: *unit_tests - node8-canary: - docker: - - image: webpackcontrib/circleci-node8:latest - <<: *canary_tests - analysis: - docker: - - image: webpackcontrib/circleci-node-base:latest - steps: - - checkout - - restore_cache: - key: dependency-cache-{{ checksum "package-lock.json" }} - - run: - name: NPM Rebuild - command: npm install - - run: - name: Run linting. - command: npm run lint - - run: - name: Run NSP Security Check. - command: npm run security - - run: - name: Validate Commit Messages - command: npm run ci:lint:commits - publish: - docker: - - image: webpackcontrib/circleci-node-base:latest - steps: - - checkout - - restore_cache: - key: dependency-cache-{{ checksum "package-lock.json" }} - - run: - name: NPM Rebuild - command: npm install - # - run: - # name: Validate Commit Messages - # command: npm run release:validate - - run: - name: Publish to NPM - command: printf "noop running conventional-github-releaser" -workflows: - version: 2 - validate-publish: - jobs: - - dependency_cache - - analysis: - requires: - - dependency_cache - filters: - tags: - only: /.*/ - - node8-latest: - requires: - - analysis - filters: - tags: - only: /.*/ - - node10-latest: - requires: - - analysis - filters: - tags: - only: /.*/ - - node8-canary: - requires: - - analysis - filters: - tags: - only: /.*/ - - publish: - requires: - - node8-latest - - node8-canary - - node10-latest - filters: - branches: - only: - - master diff --git a/.eslintignore b/.eslintignore index 917376c..c52afd1 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ -lib/* -/node_modules +/coverage /dist +/node_modules +/test/fixtures \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index 5287d21..095ce2a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,11 +1,4 @@ module.exports = { root: true, - plugins: ['prettier'], - extends: ['@webpack-contrib/eslint-config-webpack'], - rules: { - 'prettier/prettier': [ - 'error', - { singleQuote: true, trailingComma: 'es5', arrowParens: 'always' }, - ], - }, -}; \ No newline at end of file + extends: ['@webpack-contrib/eslint-config-webpack', 'prettier'], +}; diff --git a/.gitattributes b/.gitattributes index bb55f69..8b6b1c8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,4 @@ * text=auto bin/* eol=lf -package-lock.json -diff \ No newline at end of file +package-lock.json -diff +yarn.lock -diff diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index e69279a..0d815bb 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,21 +1,21 @@ -## Contributing in @webpack-contrib +# Contributing in @webpack-contrib -We'd always love contributions to further improve the webpack / webpack-contrib ecosystem! +We'd always love contributions to further improve the webpack / webpack-contrib ecosystem! Here are the guidelines we'd like you to follow: -* [Questions and Problems](#question) -* [Issues and Bugs](#issue) -* [Feature Requests](#feature) -* [Pull Request Submission Guidelines](#submit-pr) -* [Commit Message Conventions](#commit) +- [Questions and Problems](#question) +- [Issues and Bugs](#issue) +- [Feature Requests](#feature) +- [Pull Request Submission Guidelines](#submit-pr) +- [Commit Message Conventions](#commit) -### Got a Question or Problem? +## Got a Question or Problem? -Please submit support requests and questions to StackOverflow using the tag [[webpack]](http://stackoverflow.com/tags/webpack). -StackOverflow is better suited for this kind of support though you may also inquire in [Webpack Gitter](https://gitter.im/webpack/webpack). +Please submit support requests and questions to StackOverflow using the tag [[webpack]](http://stackoverflow.com/tags/webpack). +StackOverflow is better suited for this kind of support though you may also inquire in [Webpack Gitter](https://gitter.im/webpack/webpack). The issue tracker is for bug reports and feature discussions. -### Found an Issue or Bug? +## Found an Issue or Bug? Before you submit an issue, please search the issue tracker, maybe an issue for your problem already exists and the discussion might inform you of workarounds readily available. @@ -31,13 +31,13 @@ We will be insisting on a minimal reproduce scenario in order to save maintainer Unfortunately, we are not able to investigate / fix bugs without a minimal reproduction, so if we don't hear back from you we are going to close an issue that doesn't have enough info to be reproduced. -### Feature Requests? +## Feature Requests? -You can *request* a new feature by creating an issue on Github. +You can _request_ a new feature by creating an issue on Github. -If you would like to *implement* a new feature, please submit an issue with a proposal for your work `first`, to be sure that particular makes sense for the project. +If you would like to _implement_ a new feature, please submit an issue with a proposal for your work `first`, to be sure that particular makes sense for the project. -### Pull Request Submission Guidelines +## Pull Request Submission Guidelines Before you submit your Pull Request (PR) consider the following guidelines: @@ -46,9 +46,9 @@ Before you submit your Pull Request (PR) consider the following guidelines: - Fill out our `Pull Request Template`. Your pull request will not be considered if it is ignored. - Please sign the `Contributor License Agreement (CLA)` when a pull request is opened. We cannot accept your pull request without this. Make sure you sign with the primary email address associated with your local / github account. -### Webpack Contrib Commit Conventions +## Webpack Contrib Commit Conventions -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**, a **scope** and a **subject**: ``` @@ -66,48 +66,56 @@ to read on GitHub as well as in various git tools. The footer should contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-via-commit-messages/) if any. -Examples: +Examples: + ``` docs(readme): update install instructions ``` + ``` fix: refer to the `entrypoint` instead of the first `module` ``` -#### Revert -If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. +### Revert + +If the commit reverts a previous commit, it should begin with `revert:`, followed by the header of the reverted commit. In the body it should say: `This reverts commit .`, where the hash is the SHA of the commit being reverted. -#### Type +### Type + Must be one of the following: -* **build**: Changes that affect the build system or external dependencies (example scopes: babel, npm) -* **chore**: Changes that fall outside of build / docs that do not effect source code (example scopes: package, defaults) -* **ci**: Changes to our CI configuration files and scripts (example scopes: circleci, travis) -* **docs**: Documentation only changes (example scopes: readme, changelog) -* **feat**: A new feature -* **fix**: A bug fix -* **perf**: A code change that improves performance -* **refactor**: A code change that neither fixes a bug nor adds a feature -* **revert**: Used when reverting a committed change -* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons) -* **test**: Addition of or updates to Jest tests - -#### Scope +- **build**: Changes that affect the build system or external dependencies (example scopes: babel, npm) +- **chore**: Changes that fall outside of build / docs that do not effect source code (example scopes: package, defaults) +- **ci**: Changes to our CI configuration files and scripts (example scopes: circleci, travis) +- **docs**: Documentation only changes (example scopes: readme, changelog) +- **feat**: A new feature +- **fix**: A bug fix +- **perf**: A code change that improves performance +- **refactor**: A code change that neither fixes a bug nor adds a feature +- **revert**: Used when reverting a committed change +- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons) +- **test**: Addition of or updates to Jest tests + +### Scope + The scope is subjective & depends on the `type` see above. A good example would be a change to a particular class / module. -#### Subject +### Subject + The subject contains a succinct description of the change: -* use the imperative, present tense: "change" not "changed" nor "changes" -* don't capitalize the first letter -* no dot (.) at the end +- use the imperative, present tense: "change" not "changed" nor "changes" +- don't capitalize the first letter +- no dot (.) at the end + +### Body -#### Body Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior. -#### Footer +### Footer + The footer should contain any information about **Breaking Changes** and is also the place to reference GitHub issues that this commit **Closes**. @@ -116,9 +124,29 @@ reference GitHub issues that this commit **Closes**. Example ``` -BREAKING CHANGE: Updates to `Chunk.mapModules`. +BREAKING CHANGE: Updates to `Chunk.mapModules`. This release is not backwards compatible with `Webpack 2.x` due to breaking changes in webpack/webpack#4764 Migration: see webpack/webpack#5225 -``` \ No newline at end of file +``` + +## Testing Your Pull Request + +You may have the need to test your changes in a real-world project or dependent +module. Thankfully, Github provides a means to do this. Add a dependency to the +`package.json` for such a project as follows: + +```json +{ + "devDependencies": { + "karma-webpack": "webpack-contrib/karma-webpack#{id}/head" + } +} +``` + +Where `{id}` is the # ID of your Pull Request. + +## Thanks + +For your interest, time, understanding, and for following this simple guide. diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..5e7c7b6 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +open_collective: webpack diff --git a/.github/ISSUE_TEMPLATE/BUG.md b/.github/ISSUE_TEMPLATE/BUG.md index 3c59e4c..0097ef4 100644 --- a/.github/ISSUE_TEMPLATE/BUG.md +++ b/.github/ISSUE_TEMPLATE/BUG.md @@ -1,7 +1,6 @@ --- name: 🐛 Bug Report about: Something went awry and you'd like to tell us about it. - --- -* Operating System: -* Node Version: -* NPM Version: -* webpack Version: -* karma-webpack Version: +- Operating System: +- Node Version: +- NPM Version: +- webpack Version: +- karma-webpack Version: ### Expected Behavior @@ -32,13 +31,13 @@ about: Something went awry and you'd like to tell us about it. ### Code ```js - // webpack.config.js - // If your bitchin' code blocks are over 20 lines, please paste a link to a gist - // (https://gist.github.com). +// webpack.config.js +// If your code blocks are over 20 lines, please paste a link to a gist +// (https://gist.github.com). ``` ```js - // additional code, HEY YO remove this block if you don't need it +// additional code, HEY YO remove this block if you don't need it ``` ### How Do We Reproduce? @@ -48,4 +47,4 @@ about: Something went awry and you'd like to tell us about it. If your webpack config is over 50 lines long, please provide a URL to a repo for your beefy 🍖 app that we can use to reproduce. ---> \ No newline at end of file +--> diff --git a/.github/ISSUE_TEMPLATE/DOCS.md b/.github/ISSUE_TEMPLATE/DOCS.md index 900ef50..88d05dd 100644 --- a/.github/ISSUE_TEMPLATE/DOCS.md +++ b/.github/ISSUE_TEMPLATE/DOCS.md @@ -1,7 +1,6 @@ --- name: 📚 Documentation about: Are the docs lacking or missing something? Do they need some new 🔥 hotness? Tell us here. - --- -* Operating System: -* Node Version: -* NPM Version: -* webpack Version: -* karma-webpack Version: +- Operating System: +- Node Version: +- NPM Version: +- webpack Version: +- karma-webpack Version: ### Feature Proposal - - -### Feature Use Case \ No newline at end of file +### Feature Use Case diff --git a/.github/ISSUE_TEMPLATE/MODIFICATION.md b/.github/ISSUE_TEMPLATE/MODIFICATION.md index b23a167..a0fba26 100644 --- a/.github/ISSUE_TEMPLATE/MODIFICATION.md +++ b/.github/ISSUE_TEMPLATE/MODIFICATION.md @@ -1,7 +1,6 @@ --- name: 🔧 Modification Request about: Would you like something work differently? Have an alternative approach? This is the template for you. - --- -* Operating System: -* Node Version: -* NPM Version: -* webpack Version: -* karma-webpack Version: - +- Operating System: +- Node Version: +- NPM Version: +- webpack Version: +- karma-webpack Version: ### Expected Behavior / Situation - - ### Actual Behavior / Situation - - -### Modification Proposal \ No newline at end of file +### Modification Proposal diff --git a/.github/ISSUE_TEMPLATE/SUPPORT.md b/.github/ISSUE_TEMPLATE/SUPPORT.md index e27ffab..558934a 100644 --- a/.github/ISSUE_TEMPLATE/SUPPORT.md +++ b/.github/ISSUE_TEMPLATE/SUPPORT.md @@ -1,9 +1,8 @@ --- name: 🆘 Support, Help, and Advice about: 👉🏽 Need support, help, or advice? Don't open an issue! Head to StackOverflow or https://gitter.im/webpack/webpack. - --- Hey there! If you need support, help, or advice then this is not the place to ask. Please visit [StackOverflow](https://stackoverflow.com/questions/tagged/webpack) -or [the Webpack Gitter](https://gitter.im/webpack/webpack) instead. \ No newline at end of file +or [the Webpack Gitter](https://gitter.im/webpack/webpack) instead. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index ec8d357..550abc2 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -32,4 +32,4 @@ This PR contains a: migration path for existing applications. --> -### Additional Info \ No newline at end of file +### Additional Info diff --git a/.gitignore b/.gitignore index 363f1b6..eab697f 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ Thumbs.db .vscode *.sublime-project *.sublime-workspace +*.iml diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..f8f1e31 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,5 @@ +/coverage +/dist +/node_modules +/test/fixtures +CHANGELOG.md \ No newline at end of file diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index b524caf..0000000 --- a/.prettierrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "singleQuote": true, - "trailingComma": "es5", - "arrowParens": "always" -} \ No newline at end of file diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..1934550 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,5 @@ +module.exports = { + singleQuote: true, + trailingComma: 'es5', + arrowParens: 'always', +}; diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 6d3a90b..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,116 +0,0 @@ -# Contributing - -From opening a bug report to creating a pull request: every contribution is -appreciated and welcome. If you're planning to implement a new feature or change -the api please create an issue first. This way we can ensure that your precious -work is not in vain. - -## Issues - -Most of the time, if webpack is not working correctly for you it is a simple configuration issue. - -If you are having difficulty, please search the [StackOverflow with the webpack tag][stackwebpack] for questions related -to the `karma-webpack`. If you can find an answer to your issue, please post a question in [StackOverflow][stackwebpack] or -the [webpack Gitter][webpackgitter] and include both your webpack, karma & karma-webpack versions. - -**If you have discovered a bug or have a feature suggestion, feel free to create an issue on Github.** - -### Setup - -```bash -git clone https://github.com/webpack/karma-webpack.git -cd karma-webpack -npm install -``` - -To run the entire test suite use: - -```bash -npm test -``` - -### Submitting Changes - -After getting some feedback, push to your fork and submit a pull request. We -may suggest some changes or improvements or alternatives, but for small changes -your pull request should be accepted quickly. - -Some things that will increase the chance that your pull request is accepted: - -* Write tests -* Follow the existing Webpack coding style defined in the eslint and editor config rules. - -### Required `global` npm packages -We use [conventional changelog][conventionalchangelog] & the [commitizen][cz] adapter to generate our release notes using Angular's commit message convention. - -*This requires commitizen to be installed globally.* - -- `npm install commitizen -g` -- Now, simply use `git cz` instead of `git commit` when committing. - -*If you're not working in a Commitizen friendly repository, then `git cz` will work just the same as `git commit`.* - -### Commit Message Format (Commitizen handles this formatting for you) -Each commit message consists of a **header**, a **body** and a **footer**. The header has a special -format that includes a **type**, a **scope** and a **subject**: - -``` -(): - - - -