Skip to content

Commit

Permalink
feat: next
Browse files Browse the repository at this point in the history
BREAKING CHANGE: yes
  • Loading branch information
hiroppy authored Nov 27, 2020
1 parent 4ab1f21 commit b0161e9
Show file tree
Hide file tree
Showing 222 changed files with 19,053 additions and 25,071 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/client
!/test/client
coverage
client-src/live/web_modules/
node_modules
21 changes: 0 additions & 21 deletions .eslintrc

This file was deleted.

40 changes: 40 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
'use strict';

module.exports = {
extends: ['webpack', 'prettier'],
globals: {
document: true,
window: true,
},
parserOptions: {
sourceType: 'script',
ecmaVersion: 10,
},
rules: {
curly: 'error',
'consistent-return': 'off',
'no-param-reassign': 'off',
'no-underscore-dangle': 'off',
'prefer-destructuring': ['error', { object: false, array: false }],
'prefer-rest-params': 'off',
strict: ['error', 'safe'],
'global-require': 'off',
},
overrides: [
{
files: ['test/**/*.js'],
rules: {
'no-console': 'off',
},
},
{
files: ['examples/**/*.js'],
env: {
browser: true,
},
rules: {
'no-console': 'off',
},
},
],
};
98 changes: 98 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: webpack-dev-server

on:
push:
branches:
- master
- next
- v4
pull_request:
branches:
- master
- next
- v4

jobs:
lint:
name: Lint - ${{ matrix.os }} - Node v${{ matrix.node-version }}

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

strategy:
matrix:
os: [ubuntu-latest]
node-version: [12.x]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.node-version }}

- name: Use latest NPM
run: sudo npm i -g npm

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Security audit
run: npm audit

- name: Check commit message
uses: wagoid/commitlint-github-action@v1

test:
name: Test - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack ${{ matrix.webpack-version }}

strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [10.x, 12.x, 14.x]
webpack-version: [4, latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Use latest NPM on ubuntu/macos
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: sudo npm i -g npm

- name: Use latest NPM on windows
if: matrix.os == 'windows-latest'
run: npm i -g npm

- name: Install dependencies
run: npm ci

- name: Install webpack ${{ matrix.webpack-version }}
run: npm i webpack@${{ matrix.webpack-version }}

- name: Link webpack-dev-server
run: |
npm link --ignore-scripts # do not build the client again
npm link webpack-dev-server
- name: Run tests for webpack version ${{ matrix.webpack-version }}
run: npm run test:coverage -- --ci

- name: Submit coverage data to codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ npm-debug.log
client
!/test/client
coverage
ssl/*.pem
node_modules
.vscode
yarn.lock
Expand Down
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/client
!/test/client
coverage
client-src/live/web_modules/
node_modules
CHANGELOG.md
6 changes: 2 additions & 4 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
'use strict';

module.exports = {
printWidth: 80,
tabWidth: 2,
singleQuote: true,
trailingComma: 'es5',
arrowParens: 'always',
overrides: [
{
files: '*.json',
Expand Down
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ Run the relevant [examples](https://github.com/webpack/webpack-dev-server/tree/m

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

3. Run `npm link && npm link webpack-dev-server` to link the current project to `node_modules`.

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.

If you are modifying a file in the `client/` directory, be sure to run `npm run prepublish` after it. This will recompile the files.
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.

## Testing a Pull Request

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

---

_Many thanks to [create-react-app](https://github.com/facebookincubator/create-react-app/blob/master/CONTRIBUTING.md) for the inspiration with this contributing guide_
_Many thanks to [create-react-app](https://github.com/facebook/create-react-app/blob/master/CONTRIBUTING.md) for the inspiration with this contributing guide_
15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

[![npm][npm]][npm-url]
[![node][node]][node-url]
[![deps][deps]][deps-url]
[![tests][tests]][tests-url]
[![coverage][cover]][cover-url]
[![chat][chat]][chat-url]
Expand Down Expand Up @@ -52,14 +51,14 @@ There are two main, recommended methods of using the module:

### With the CLI

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

```console
node_modules/.bin/webpack-dev-server
node_modules/.bin/webpack serve
```

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

### With NPM Scripts

Expand All @@ -69,7 +68,7 @@ script as such:

```json
"scripts": {
"start:dev": "webpack-dev-server"
"start:dev": "webpack serve"
}
```

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

0 comments on commit b0161e9

Please sign in to comment.