From 18c93f16164b875861e281c63342bd2f46ba0bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20M=C3=BCller?= Date: Sun, 25 Aug 2019 18:06:14 +0200 Subject: [PATCH 001/146] docs(README): fix broken `context` link (#415) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b03ad79..e5ddad4f 100644 --- a/README.md +++ b/README.md @@ -139,7 +139,7 @@ If you use JS styles without the [`postcss-js`][postcss-js] parser, add the `exe |Name|Type|Default|Description| |:--:|:--:|:-----:|:----------| |[`path`](#path)|`{String}`|`undefined`|PostCSS Config Directory| -|[`context`](#context)|`{Object}`|`undefined`|PostCSS Config Context| +|[`context`](#context-ctx)|`{Object}`|`undefined`|PostCSS Config Context| #### `Path` From fa02761482e5861326a42470133eb3ad394b93ef Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Tue, 28 Jul 2020 11:10:47 -0700 Subject: [PATCH 002/146] Move license to JS Foundation --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index c6bb2fc6..67d35648 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ License (MIT) -Copyright 2017 Andrey Sitnik +Copyright JS Foundation and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in From 2ea3cf07d02797ee4f227af9a814b5ef358bcbd8 Mon Sep 17 00:00:00 2001 From: Alexey Lavinsky Date: Mon, 10 Aug 2020 13:36:04 +0300 Subject: [PATCH 003/146] chore: update defaults --- .editorconfig | 10 +- .eslintignore | 4 + .eslintrc.js | 4 + .gitattributes | 4 + .github/CODEOWNERS | 7 +- .github/CONTRIBUTING.md | 160 + .github/FUNDING.yml | 1 + .github/ISSUE_TEMPLATE.md | 16 + .github/ISSUE_TEMPLATE/BUG.md | 52 +- .github/ISSUE_TEMPLATE/DOCS.md | 38 +- .github/ISSUE_TEMPLATE/FEATURE.md | 31 +- .github/ISSUE_TEMPLATE/MODIFICATION.md | 27 + .github/ISSUE_TEMPLATE/SUPPORT.md | 8 + .github/PULL_REQUEST_TEMPLATE.md | 80 +- .github/workflows/nodejs.yml | 95 + .gitignore | 28 +- .npmignore | 24 - .npmrc | 1 - .prettierignore | 6 + .prettierrc.js | 1 + .travis.yml | 25 - LICENSE | 32 +- README.md | 168 +- appveyor.yml | 21 - babel.config.js | 19 + commitlint.config.js | 3 + docs/LOADER.md | 10 +- husky.config.js | 6 + lint-staged.config.js | 4 + package-lock.json | 15711 ++++++++++++++++ package.json | 94 +- src/Error.js | 22 +- src/Warning.js | 18 +- src/cjs.js | 1 + src/index.js | 334 +- src/options.js | 23 +- src/options.json | 62 +- test/Errors.test.js | 65 - test/Warnings.test.js | 33 - test/__snapshots__/Errors.test.js.snap | 14 - test/__snapshots__/Warnings.test.js.snap | 7 - test/__snapshots__/loader.test.js.snap | 35 +- .../validate-options.test.js.snap | 292 + test/cjs.test.js | 8 + test/helpers/compile.js | 11 + test/helpers/execute.js | 22 + test/helpers/getCodeFromBundle.js | 21 + test/helpers/getCompiler.js | 46 + test/helpers/getErrors.js | 5 + test/helpers/getExecutedCode.js | 17 + test/helpers/getWarnings.js | 5 + test/helpers/index.js | 23 + test/helpers/normalizeErrors.js | 29 + test/helpers/normalizeMap.js | 26 + test/helpers/readAsset.js | 23 + test/helpers/readAssets.js | 11 + test/loader.test.js | 66 +- .../options/__snapshots__/config.test.js.snap | 26 +- test/options/__snapshots__/exec.test.js.snap | 8 +- .../options/__snapshots__/parser.test.js.snap | 12 +- .../__snapshots__/plugins.test.js.snap | 24 +- .../__snapshots__/sourceMap.test.js.snap | 20 +- .../__snapshots__/stringifier.test.js.snap | 12 +- .../options/__snapshots__/syntax.test.js.snap | 12 +- test/options/config.test.js | 194 +- test/options/exec.test.js | 99 +- test/options/parser.test.js | 94 +- test/options/plugins.test.js | 160 +- test/options/sourceMap.test.js | 93 +- test/options/stringifier.test.js | 63 +- test/options/syntax.test.js | 106 +- test/validate-options.test.js | 117 + 72 files changed, 17860 insertions(+), 1089 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc.js create mode 100644 .gitattributes create mode 100644 .github/CONTRIBUTING.md create mode 100644 .github/FUNDING.yml create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/ISSUE_TEMPLATE/MODIFICATION.md create mode 100644 .github/ISSUE_TEMPLATE/SUPPORT.md create mode 100644 .github/workflows/nodejs.yml delete mode 100644 .npmignore delete mode 100644 .npmrc create mode 100644 .prettierignore create mode 100644 .prettierrc.js delete mode 100644 .travis.yml delete mode 100644 appveyor.yml create mode 100644 babel.config.js create mode 100644 commitlint.config.js create mode 100644 husky.config.js create mode 100644 lint-staged.config.js create mode 100644 package-lock.json create mode 100644 src/cjs.js delete mode 100644 test/Errors.test.js delete mode 100644 test/Warnings.test.js delete mode 100644 test/__snapshots__/Errors.test.js.snap delete mode 100644 test/__snapshots__/Warnings.test.js.snap create mode 100644 test/__snapshots__/validate-options.test.js.snap create mode 100644 test/cjs.test.js create mode 100644 test/helpers/compile.js create mode 100644 test/helpers/execute.js create mode 100644 test/helpers/getCodeFromBundle.js create mode 100644 test/helpers/getCompiler.js create mode 100644 test/helpers/getErrors.js create mode 100644 test/helpers/getExecutedCode.js create mode 100644 test/helpers/getWarnings.js create mode 100644 test/helpers/index.js create mode 100644 test/helpers/normalizeErrors.js create mode 100644 test/helpers/normalizeMap.js create mode 100644 test/helpers/readAsset.js create mode 100644 test/helpers/readAssets.js create mode 100644 test/validate-options.test.js diff --git a/.editorconfig b/.editorconfig index 2229196d..ab524583 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,12 +1,12 @@ -root = true +# editorconfig.org [*] +charset = utf-8 indent_style = space indent_size = 2 end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true insert_final_newline = true +trim_trailing_whitespace = true -[*.{json,yml}] -indent_size = 2 +[*.md] +trim_trailing_whitespace = false \ No newline at end of file diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..c52afd16 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,4 @@ +/coverage +/dist +/node_modules +/test/fixtures \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..095ce2a5 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: ['@webpack-contrib/eslint-config-webpack', 'prettier'], +}; diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..6fcfa732 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +* text=auto +bin/* eol=lf +yarn.lock -diff +package-lock.json -diff diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 76712b59..f3206485 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1,6 @@ -* @michael-ciniawsky @evilebottnawi +# These are the default owners for everything in +# webpack-contrib +@webpack-contrib/org-maintainers + +# Add repository specific users / groups +# below here for libs that are not maintained by the org. diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 00000000..bd5cdefa --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,160 @@ +# Contributing in @webpack-contrib + +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) + +## 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). +The issue tracker is for bug reports and feature discussions. + +## 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. + +We want to fix all the issues as soon as possible, but before fixing a bug we need to reproduce and confirm it. In order to reproduce bugs, we ask that you to provide a minimal reproduction scenario (github repo or failing test case). Having a live, reproducible scenario gives us a wealth of important information without going back & forth to you with additional questions like: + +- version of Webpack used +- version of the loader / plugin you are creating a bug report for +- the use-case that fails + +A minimal reproduce scenario allows us to quickly confirm a bug (or point out config problems) as well as confirm that we are fixing the right problem. + +We will be insisting on a minimal reproduce scenario in order to save maintainers time and ultimately be able to fix more bugs. We understand that sometimes it might be hard to extract essentials bits of code from a larger code-base but we really need to isolate the problem before we can fix it. + +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? + +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. + +## Pull Request Submission Guidelines + +Before you submit your Pull Request (PR) consider the following guidelines: + +- Search Github for an open or closed PR that relates to your submission. You don't want to duplicate effort. +- Commit your changes using a descriptive commit message that follows our [commit message conventions](#commit). Adherence to these conventions is necessary because release notes are automatically generated from these messages. +- 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 + +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**: + +``` +(): + + + +