Skip to content

Commit 2709413

Browse files
authored
chore(defaults): Applies latest webpack-defaults (#82)
* chore: Updates to lates defaults version - Migrates to CircleCI 2.0 from Travis - Removes Appveyor by default ( can be opted into ) - Uses a non-deprecated form of eslit config - Adds base codecov config - Adds commitlint config / hook - Updates PR templates & adds Codeowners - Prettier tooling & complementary eslit config added * chore: Defaults updates to pacakge meta - Updates engines range to disclude nodejs 7 ( we test on 9.x ) - Moves to scoped version of eslint config w/ prettier support - Moves to scoped version of schema-utils with pretty output - Adds commit message validation scripts - Update CI related scripts for CircleCI 2.0 * ci(circle): Adds CircleCI 2.0 configuration - Implements workflow on custom build containers - Fails fast on static analysis or minimum node version test failure - Executes canary suite ( or doesn't ) based on semver comparison of Webpack dist-tags * docs: Updates status badges & removes image table - Tobias didn't want his picture in there * style: Update code style for prettier / eslint configuration * docs: Update badges to remove engines badge * chore(package): applies defaults 2.3 - Switches from Angular to Conventional commit config - Adds Contributing documentation ( w/ commit conventions) * chore: adds overwritten `test:manual` script
1 parent d7d0afc commit 2709413

19 files changed

+16804
-8726
lines changed

.circleci/config.yml

+156
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
unit_tests: &unit_tests
2+
steps:
3+
- checkout
4+
- restore_cache:
5+
key: dependency-cache-{{ checksum "package-lock.json" }}
6+
- run:
7+
name: NPM Rebuild
8+
command: npm install
9+
- run:
10+
name: Run unit tests.
11+
command: npm run ci:test
12+
canary_tests: &canary_tests
13+
steps:
14+
- checkout
15+
- restore_cache:
16+
key: dependency-cache-{{ checksum "package-lock.json" }}
17+
- run:
18+
name: NPM Rebuild
19+
command: npm install
20+
- run:
21+
name: Install Webpack Canary
22+
command: npm i --no-save webpack@next
23+
- run:
24+
name: Run unit tests.
25+
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
26+
27+
version: 2
28+
jobs:
29+
dependency_cache:
30+
docker:
31+
- image: webpackcontrib/circleci-node-base:latest
32+
steps:
33+
- checkout
34+
- restore_cache:
35+
key: dependency-cache-{{ checksum "package-lock.json" }}
36+
- run:
37+
name: Install Dependencies
38+
command: npm install
39+
- save_cache:
40+
key: dependency-cache-{{ checksum "package-lock.json" }}
41+
paths:
42+
- ./node_modules
43+
44+
node8-latest:
45+
docker:
46+
- image: webpackcontrib/circleci-node8:latest
47+
steps:
48+
- checkout
49+
- restore_cache:
50+
key: dependency-cache-{{ checksum "package-lock.json" }}
51+
- run:
52+
name: NPM Rebuild
53+
command: npm install
54+
- run:
55+
name: Run unit tests.
56+
command: npm run ci:coverage
57+
- run:
58+
name: Submit coverage data to codecov.
59+
command: bash <(curl -s https://codecov.io/bash)
60+
when: on_success
61+
node6-latest:
62+
docker:
63+
- image: webpackcontrib/circleci-node6:latest
64+
<<: *unit_tests
65+
node9-latest:
66+
docker:
67+
- image: webpackcontrib/circleci-node9:latest
68+
<<: *unit_tests
69+
node8-canary:
70+
docker:
71+
- image: webpackcontrib/circleci-node8:latest
72+
<<: *canary_tests
73+
analysis:
74+
docker:
75+
- image: webpackcontrib/circleci-node-base:latest
76+
steps:
77+
- checkout
78+
- restore_cache:
79+
key: dependency-cache-{{ checksum "package-lock.json" }}
80+
- run:
81+
name: NPM Rebuild
82+
command: npm install
83+
- run:
84+
name: Run linting.
85+
command: npm run lint
86+
- run:
87+
name: Run NSP Security Check.
88+
command: npm run security
89+
# - run:
90+
# name: Validate Commit Messages
91+
# command: npm run ci:lint:commits
92+
publish:
93+
docker:
94+
- image: webpackcontrib/circleci-node-base:latest
95+
steps:
96+
- checkout
97+
- restore_cache:
98+
key: dependency-cache-{{ checksum "package-lock.json" }}
99+
- run:
100+
name: NPM Rebuild
101+
command: npm install
102+
# - run:
103+
# name: Validate Commit Messages
104+
# command: npm run release:validate
105+
- run:
106+
name: Publish to NPM
107+
command: printf "noop running conventional-github-releaser"
108+
109+
version: 2.0
110+
workflows:
111+
version: 2
112+
validate-publish:
113+
jobs:
114+
- dependency_cache
115+
- node6-latest:
116+
requires:
117+
- dependency_cache
118+
filters:
119+
tags:
120+
only: /.*/
121+
- analysis:
122+
requires:
123+
- dependency_cache
124+
filters:
125+
tags:
126+
only: /.*/
127+
- node8-latest:
128+
requires:
129+
- analysis
130+
- node6-latest
131+
filters:
132+
tags:
133+
only: /.*/
134+
- node9-latest:
135+
requires:
136+
- analysis
137+
- node6-latest
138+
filters:
139+
tags:
140+
only: /.*/
141+
- node8-canary:
142+
requires:
143+
- analysis
144+
- node6-latest
145+
filters:
146+
tags:
147+
only: /.*/
148+
- publish:
149+
requires:
150+
- node8-latest
151+
- node8-canary
152+
- node9-latest
153+
filters:
154+
branches:
155+
only:
156+
- master

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ end_of_line = lf
88
insert_final_newline = true
99
trim_trailing_whitespace = true
1010

11-
[.md]
11+
[*.md]
1212
insert_final_newline = false
1313
trim_trailing_whitespace = false

.eslintrc

-7
This file was deleted.

.eslintrc.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
root: true,
3+
plugins: ['prettier'],
4+
extends: ['@webpack-contrib/eslint-config-webpack'],
5+
rules: {
6+
'prettier/prettier': [
7+
'error',
8+
{ singleQuote: true, trailingComma: 'es5', arrowParens: 'always' },
9+
],
10+
'class-methods-use-this': 'off',
11+
'no-undefined': 'off',
12+
},
13+
};

.github/CODEOWNERS

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# These are the default owners for everything in
2+
# webpack-contrib
3+
@webpack-contrib/org-maintainers
4+
5+
# Add repository specific users / groups
6+
# below here for libs that are not maintained by the org.
7+
@sokra

.github/CONTRIBUTING.md

+124
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
## Contributing in @webpack-contrib
2+
3+
We'd always love contributions to further improve the webpack / webpack-contrib ecosystem!
4+
Here are the guidelines we'd like you to follow:
5+
6+
* [Questions and Problems](#question)
7+
* [Issues and Bugs](#issue)
8+
* [Feature Requests](#feature)
9+
* [Pull Request Submission Guidelines](#submit-pr)
10+
* [Commit Message Conventions](#commit)
11+
12+
### <a name="question"></a> Got a Question or Problem?
13+
14+
Please submit support requests and questions to StackOverflow using the tag [[webpack]](http://stackoverflow.com/tags/webpack).
15+
StackOverflow is better suited for this kind of support though you may also inquire in [Webpack Gitter](https://gitter.im/webpack/webpack).
16+
The issue tracker is for bug reports and feature discussions.
17+
18+
### <a name="issue"></a> Found an Issue or Bug?
19+
20+
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.
21+
22+
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:
23+
24+
- version of Webpack used
25+
- version of the loader / plugin you are creating a bug report for
26+
- the use-case that fails
27+
28+
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.
29+
30+
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.
31+
32+
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.
33+
34+
### <a name="feature"></a> Feature Requests?
35+
36+
You can *request* a new feature by creating an issue on Github.
37+
38+
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.
39+
40+
### <a name="submit-pr"></a> Pull Request Submission Guidelines
41+
42+
Before you submit your Pull Request (PR) consider the following guidelines:
43+
44+
- Search Github for an open or closed PR that relates to your submission. You don't want to duplicate effort.
45+
- 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.
46+
- Fill out our `Pull Request Template`. Your pull request will not be considered if it is ignored.
47+
- 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.
48+
49+
### <a name="commit"></a> Webpack Contrib Commit Conventions
50+
51+
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
52+
format that includes a **type**, a **scope** and a **subject**:
53+
54+
```
55+
<type>(<scope>): <subject>
56+
<BLANK LINE>
57+
<body>
58+
<BLANK LINE>
59+
<footer>
60+
```
61+
62+
The **header** is mandatory and the **scope** of the header is optional.
63+
64+
Any line of the commit message cannot be longer 100 characters! This allows the message to be easier
65+
to read on GitHub as well as in various git tools.
66+
67+
The footer should contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-via-commit-messages/) if any.
68+
69+
Examples:
70+
```
71+
docs(readme): update install instructions
72+
```
73+
```
74+
fix: refer to the `entrypoint` instead of the first `module`
75+
```
76+
77+
#### Revert
78+
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit.
79+
In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
80+
81+
#### Type
82+
Must be one of the following:
83+
84+
* **build**: Changes that affect the build system or external dependencies (example scopes: babel, npm)
85+
* **chore**: Changes that fall outside of build / docs that do not effect source code (example scopes: package, defaults)
86+
* **ci**: Changes to our CI configuration files and scripts (example scopes: circleci, travis)
87+
* **docs**: Documentation only changes (example scopes: readme, changelog)
88+
* **feat**: A new feature
89+
* **fix**: A bug fix
90+
* **perf**: A code change that improves performance
91+
* **refactor**: A code change that neither fixes a bug nor adds a feature
92+
* **revert**: Used when reverting a committed change
93+
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons)
94+
* **test**: Addition of or updates to Jest tests
95+
96+
#### Scope
97+
The scope is subjective & depends on the `type` see above. A good example would be a change to a particular class / module.
98+
99+
#### Subject
100+
The subject contains a succinct description of the change:
101+
102+
* use the imperative, present tense: "change" not "changed" nor "changes"
103+
* don't capitalize the first letter
104+
* no dot (.) at the end
105+
106+
#### Body
107+
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
108+
The body should include the motivation for the change and contrast this with previous behavior.
109+
110+
#### Footer
111+
The footer should contain any information about **Breaking Changes** and is also the place to
112+
reference GitHub issues that this commit **Closes**.
113+
114+
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
115+
116+
Example
117+
118+
```
119+
BREAKING CHANGE: Updates to `Chunk.mapModules`.
120+
121+
This release is not backwards compatible with `Webpack 2.x` due to breaking changes in webpack/webpack#4764
122+
Migration: see webpack/webpack#5225
123+
124+
```

.github/PULL_REQUEST_TEMPLATE.md

+33-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
<!--
2-
1. [Read and sign the CLA](https://cla.js.foundation/webpack/webpack.js.org). This needs to be done only once. PRs that haven't signed it won't be accepted.
3-
2. Check out the [development guide](https://webpack.js.org/development/) for the API and development guidelines.
4-
3. Read through the PR diff carefully as sometimes this can reveal issues. The work will be reviewed, but this can save some effort.
2+
HOLY CRAP a Pull Request. We ❤️ those!
3+
4+
If you remove or skip this template, you'll make the 🐼 sad and the mighty god
5+
of Github will appear and pile-drive the close button from a great height
6+
while making animal noises.
7+
8+
Please place an x (no spaces!) in all [ ] that apply
59
-->
10+
11+
This PR contains a:
12+
13+
- [ ] **bugfix**
14+
- [ ] new **feature**
15+
- [ ] **code refactor**
16+
- [ ] **test update** <!-- if bug or feature is checked, this should be too -->
17+
- [ ] **typo fix**
18+
- [ ] **metadata update**
19+
20+
### Motivation / Use-Case
21+
22+
<!--
23+
Please explain the motivation or use-case for your change.
24+
What existing problem does the PR solve?
25+
If this PR addresses an issue, please link to the issue.
26+
-->
27+
28+
### Breaking Changes
29+
30+
<!--
31+
If this PR introduces a breaking change, please describe the impact and a
32+
migration path for existing applications.
33+
-->
34+
35+
### Additional Info

.prettierrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "es5",
4+
"arrowParens": "always"
5+
}

0 commit comments

Comments
 (0)