Skip to content

Commit b0161e9

Browse files
authored
feat: next
BREAKING CHANGE: yes
1 parent 4ab1f21 commit b0161e9

File tree

222 files changed

+19053
-25071
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

222 files changed

+19053
-25071
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/client
22
!/test/client
33
coverage
4-
client-src/live/web_modules/
54
node_modules

.eslintrc

Lines changed: 0 additions & 21 deletions
This file was deleted.

.eslintrc.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
'use strict';
2+
3+
module.exports = {
4+
extends: ['webpack', 'prettier'],
5+
globals: {
6+
document: true,
7+
window: true,
8+
},
9+
parserOptions: {
10+
sourceType: 'script',
11+
ecmaVersion: 10,
12+
},
13+
rules: {
14+
curly: 'error',
15+
'consistent-return': 'off',
16+
'no-param-reassign': 'off',
17+
'no-underscore-dangle': 'off',
18+
'prefer-destructuring': ['error', { object: false, array: false }],
19+
'prefer-rest-params': 'off',
20+
strict: ['error', 'safe'],
21+
'global-require': 'off',
22+
},
23+
overrides: [
24+
{
25+
files: ['test/**/*.js'],
26+
rules: {
27+
'no-console': 'off',
28+
},
29+
},
30+
{
31+
files: ['examples/**/*.js'],
32+
env: {
33+
browser: true,
34+
},
35+
rules: {
36+
'no-console': 'off',
37+
},
38+
},
39+
],
40+
};

.github/workflows/nodejs.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: webpack-dev-server
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- next
8+
- v4
9+
pull_request:
10+
branches:
11+
- master
12+
- next
13+
- v4
14+
15+
jobs:
16+
lint:
17+
name: Lint - ${{ matrix.os }} - Node v${{ matrix.node-version }}
18+
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
22+
strategy:
23+
matrix:
24+
os: [ubuntu-latest]
25+
node-version: [12.x]
26+
27+
runs-on: ${{ matrix.os }}
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
with:
32+
fetch-depth: 0
33+
34+
- name: Use Node.js ${{ env.node-version }}
35+
uses: actions/setup-node@v1
36+
with:
37+
node-version: ${{ env.node-version }}
38+
39+
- name: Use latest NPM
40+
run: sudo npm i -g npm
41+
42+
- name: Install dependencies
43+
run: npm ci
44+
45+
- name: Lint
46+
run: npm run lint
47+
48+
- name: Security audit
49+
run: npm audit
50+
51+
- name: Check commit message
52+
uses: wagoid/commitlint-github-action@v1
53+
54+
test:
55+
name: Test - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack ${{ matrix.webpack-version }}
56+
57+
strategy:
58+
matrix:
59+
os: [ubuntu-latest, windows-latest, macos-latest]
60+
node-version: [10.x, 12.x, 14.x]
61+
webpack-version: [4, latest]
62+
63+
runs-on: ${{ matrix.os }}
64+
65+
steps:
66+
- uses: actions/checkout@v2
67+
68+
- name: Use Node.js ${{ matrix.node-version }}
69+
uses: actions/setup-node@v1
70+
with:
71+
node-version: ${{ matrix.node-version }}
72+
73+
- name: Use latest NPM on ubuntu/macos
74+
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
75+
run: sudo npm i -g npm
76+
77+
- name: Use latest NPM on windows
78+
if: matrix.os == 'windows-latest'
79+
run: npm i -g npm
80+
81+
- name: Install dependencies
82+
run: npm ci
83+
84+
- name: Install webpack ${{ matrix.webpack-version }}
85+
run: npm i webpack@${{ matrix.webpack-version }}
86+
87+
- name: Link webpack-dev-server
88+
run: |
89+
npm link --ignore-scripts # do not build the client again
90+
npm link webpack-dev-server
91+
92+
- name: Run tests for webpack version ${{ matrix.webpack-version }}
93+
run: npm run test:coverage -- --ci
94+
95+
- name: Submit coverage data to codecov
96+
uses: codecov/codecov-action@v1
97+
with:
98+
token: ${{ secrets.CODECOV_TOKEN }}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ npm-debug.log
77
client
88
!/test/client
99
coverage
10-
ssl/*.pem
1110
node_modules
1211
.vscode
1312
yarn.lock

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/client
22
!/test/client
33
coverage
4-
client-src/live/web_modules/
54
node_modules
65
CHANGELOG.md

.prettierrc.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1+
'use strict';
2+
13
module.exports = {
2-
printWidth: 80,
3-
tabWidth: 2,
44
singleQuote: true,
5-
trailingComma: 'es5',
6-
arrowParens: 'always',
75
overrides: [
86
{
97
files: '*.json',

CONTRIBUTING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ Run the relevant [examples](https://github.com/webpack/webpack-dev-server/tree/m
2929

3030
2. Run `npm install` in the root `webpack-dev-server` folder.
3131

32+
3. Run `npm link && npm link webpack-dev-server` to link the current project to `node_modules`.
33+
3234
Once it is done, you can modify any file locally. In the `examples/` directory you'll find a lot of examples with instructions on how to run it. This can be very handy when testing if your code works.
3335

34-
If you are modifying a file in the `client/` directory, be sure to run `npm run prepublish` after it. This will recompile the files.
36+
If you are modifying a file in the `client/` directory, be sure to run `npm run build:client` after it. This will recompile the files.
3537

3638
## Testing a Pull Request
3739

@@ -64,4 +66,4 @@ Run `git config user.email` to see your Git email, and verify it with [your GitH
6466

6567
---
6668

67-
_Many thanks to [create-react-app](https://github.com/facebookincubator/create-react-app/blob/master/CONTRIBUTING.md) for the inspiration with this contributing guide_
69+
_Many thanks to [create-react-app](https://github.com/facebook/create-react-app/blob/master/CONTRIBUTING.md) for the inspiration with this contributing guide_

README.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
[![npm][npm]][npm-url]
88
[![node][node]][node-url]
9-
[![deps][deps]][deps-url]
109
[![tests][tests]][tests-url]
1110
[![coverage][cover]][cover-url]
1211
[![chat][chat]][chat-url]
@@ -52,14 +51,14 @@ There are two main, recommended methods of using the module:
5251

5352
### With the CLI
5453

55-
The easiest way to use it is with the CLI. In the directory where your
54+
The easiest way to use it is with the [webpack CLI](https://webpack.js.org/api/cli/). In the directory where your
5655
`webpack.config.js` is, run:
5756

5857
```console
59-
node_modules/.bin/webpack-dev-server
58+
node_modules/.bin/webpack serve
6059
```
6160

62-
_**Note**: Many CLI options are available with `webpack-dev-server`. Explore this [link](https://webpack.js.org/configuration/dev-server/)._
61+
_**Note**: Many CLI options are available with `webpack serve`. Explore this [link](https://webpack.js.org/configuration/dev-server/)._
6362

6463
### With NPM Scripts
6564

@@ -69,7 +68,7 @@ script as such:
6968

7069
```json
7170
"scripts": {
72-
"start:dev": "webpack-dev-server"
71+
"start:dev": "webpack serve"
7372
}
7473
```
7574

@@ -144,10 +143,8 @@ This project is heavily inspired by [peerigon/nof5](https://github.com/peerigon/
144143
[npm-url]: https://npmjs.com/package/webpack-dev-server
145144
[node]: https://img.shields.io/node/v/webpack-dev-server.svg
146145
[node-url]: https://nodejs.org
147-
[deps]: https://david-dm.org/webpack/webpack-dev-server.svg
148-
[deps-url]: https://david-dm.org/webpack/webpack-dev-server
149-
[tests]: https://dev.azure.com/webpack/webpack-dev-server/_apis/build/status/webpack.webpack-dev-server?branchName=master
150-
[tests-url]: https://dev.azure.com/webpack/webpack-dev-server/_build/latest?definitionId=7&branchName=master
146+
[tests]: https://github.com/webpack/webpack-dev-server/workflows/webpack-dev-server/badge.svg
147+
[tests-url]: https://github.com/webpack/webpack-dev-server/actions?query=workflow%3Awebpack-dev-server
151148
[cover]: https://codecov.io/gh/webpack/webpack-dev-server/branch/master/graph/badge.svg
152149
[cover-url]: https://codecov.io/gh/webpack/webpack-dev-server
153150
[chat]: https://badges.gitter.im/webpack/webpack.svg

0 commit comments

Comments
 (0)