webpack-dev-service 0.5.16 → 0.5.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,7 +5,9 @@
5
5
  >
6
6
  > [![NPM Version][npm-image]][npm-url]
7
7
  > [![Download Status][download-image]][npm-url]
8
- > [![Snyk Vulnerabilities][snyk-image]][snyk-url]
8
+ > [![Languages Status][languages-image]][github-url]
9
+ > [![Tree Shakeable][tree-shakeable-image]][bundle-phobia-url]
10
+ > [![Side Effect][side-effect-image]][bundle-phobia-url]
9
11
  > [![License][license-image]][license-url]
10
12
 
11
13
  ### Usage
@@ -203,7 +205,10 @@ app.listen(port, () => {
203
205
  [npm-image]: https://img.shields.io/npm/v/webpack-dev-service?style=flat-square
204
206
  [npm-url]: https://www.npmjs.org/package/webpack-dev-service
205
207
  [download-image]: https://img.shields.io/npm/dm/webpack-dev-service?style=flat-square
206
- [snyk-image]: https://img.shields.io/snyk/vulnerabilities/github/nuintun/webpack-dev-service?style=flat-square
207
- [snyk-url]: https://snyk.io/test/github/nuintun/webpack-dev-service
208
+ [languages-image]: https://img.shields.io/github/languages/top/nuintun/webpack-dev-service?style=flat-square
209
+ [github-url]: https://github.com/nuintun/webpack-dev-service
210
+ [tree-shakeable-image]: https://img.shields.io/badge/tree--shakeable-true-brightred?style=flat-square
211
+ [side-effect-image]: https://img.shields.io/badge/side--effect-true-yellow?style=flat-square
212
+ [bundle-phobia-url]: https://bundlephobia.com/result?p=webpack-dev-service
208
213
  [license-image]: https://img.shields.io/github/license/nuintun/webpack-dev-service?style=flat-square
209
214
  [license-url]: https://github.com/nuintun/webpack-dev-service/blob/master/LICENSE
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -84,7 +84,7 @@ function createClient(options) {
84
84
  const parseMessage = message => {
85
85
  try {
86
86
  return JSON.parse(message.data);
87
- } catch {
87
+ } catch (_a) {
88
88
  return null;
89
89
  }
90
90
  };
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -71,7 +71,7 @@ const resolveOptions = () => {
71
71
  hmr: options.hmr === false ? false : hmr,
72
72
  progress: options.progress === false ? false : progress
73
73
  };
74
- } catch {
74
+ } catch (_a) {
75
75
  throw new Error('Imported the hot client but the hot server is not enabled.');
76
76
  }
77
77
  };
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -173,15 +173,8 @@ const HTML = `
173
173
  </aside>
174
174
  `;
175
175
  class Overlay {
176
- hidden = true;
177
- name;
178
- close;
179
- aside;
180
- errorsList;
181
- errorsTitle;
182
- warningsList;
183
- warningsTitle;
184
176
  constructor(name) {
177
+ this.hidden = true;
185
178
  index.injectCSS(CSS);
186
179
  [this.aside] = index.appendHTML(HTML);
187
180
  this.name = this.aside.querySelector(`.${OVERLAY}-name`);
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -60,11 +60,8 @@ const HTML = `
60
60
  </svg>
61
61
  `;
62
62
  class Progress {
63
- timer;
64
- hidden = true;
65
- svg;
66
- track;
67
63
  constructor() {
64
+ this.hidden = true;
68
65
  index.injectCSS(CSS);
69
66
  [this.svg] = index.appendHTML(HTML);
70
67
  this.track = this.svg.querySelector(`.${PROGRESS}-track`);
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -16,23 +16,21 @@ const regexp = require('./regexp.cjs');
16
16
  * @module index
17
17
  */
18
18
  class Ansi {
19
- buffer = '';
20
- style = {
21
- dim: false,
22
- bold: false,
23
- color: null,
24
- blink: false,
25
- hidden: false,
26
- italic: false,
27
- inverse: false,
28
- overline: false,
29
- background: null,
30
- underline: false,
31
- strikethrough: false
32
- };
33
- colors256;
34
- colors16;
35
19
  constructor(theme = {}) {
20
+ this.buffer = '';
21
+ this.style = {
22
+ dim: false,
23
+ bold: false,
24
+ color: null,
25
+ blink: false,
26
+ hidden: false,
27
+ italic: false,
28
+ inverse: false,
29
+ overline: false,
30
+ background: null,
31
+ underline: false,
32
+ strikethrough: false
33
+ };
36
34
  const colors16 = [
37
35
  // Colors 16 bit
38
36
  [
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -82,7 +82,7 @@ function createClient(options) {
82
82
  const parseMessage = message => {
83
83
  try {
84
84
  return JSON.parse(message.data);
85
- } catch {
85
+ } catch (_a) {
86
86
  return null;
87
87
  }
88
88
  };
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
package/client/esm/hot.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -69,7 +69,7 @@ const resolveOptions = () => {
69
69
  hmr: options.hmr === false ? false : hmr,
70
70
  progress: options.progress === false ? false : progress
71
71
  };
72
- } catch {
72
+ } catch (_a) {
73
73
  throw new Error('Imported the hot client but the hot server is not enabled.');
74
74
  }
75
75
  };
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -171,15 +171,8 @@ const HTML = `
171
171
  </aside>
172
172
  `;
173
173
  class Overlay {
174
- hidden = true;
175
- name;
176
- close;
177
- aside;
178
- errorsList;
179
- errorsTitle;
180
- warningsList;
181
- warningsTitle;
182
174
  constructor(name) {
175
+ this.hidden = true;
183
176
  injectCSS(CSS);
184
177
  [this.aside] = appendHTML(HTML);
185
178
  this.name = this.aside.querySelector(`.${OVERLAY}-name`);
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -58,11 +58,8 @@ const HTML = `
58
58
  </svg>
59
59
  `;
60
60
  class Progress {
61
- timer;
62
- hidden = true;
63
- svg;
64
- track;
65
61
  constructor() {
62
+ this.hidden = true;
66
63
  injectCSS(CSS);
67
64
  [this.svg] = appendHTML(HTML);
68
65
  this.track = this.svg.querySelector(`.${PROGRESS}-track`);
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -14,23 +14,21 @@ import { CSI_RE, OSC_ST_RE, OSC_RE } from './regexp.js';
14
14
  * @module index
15
15
  */
16
16
  class Ansi {
17
- buffer = '';
18
- style = {
19
- dim: false,
20
- bold: false,
21
- color: null,
22
- blink: false,
23
- hidden: false,
24
- italic: false,
25
- inverse: false,
26
- overline: false,
27
- background: null,
28
- underline: false,
29
- strikethrough: false
30
- };
31
- colors256;
32
- colors16;
33
17
  constructor(theme = {}) {
18
+ this.buffer = '';
19
+ this.style = {
20
+ dim: false,
21
+ bold: false,
22
+ color: null,
23
+ blink: false,
24
+ hidden: false,
25
+ italic: false,
26
+ inverse: false,
27
+ overline: false,
28
+ background: null,
29
+ underline: false,
30
+ strikethrough: false
31
+ };
34
32
  const colors16 = [
35
33
  // Colors 16 bit
36
34
  [
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack-dev-service",
3
- "version": "0.5.16",
3
+ "version": "0.5.18",
4
4
  "description": "A koa 2 middleware for webpack development and hot reloading.",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -86,8 +86,8 @@
86
86
  "build:types": "tsc --declaration --emitDeclarationOnly --declarationDir types && node tools/fix-types.js"
87
87
  },
88
88
  "dependencies": {
89
- "@types/koa": "^2.13.11",
90
- "@types/ws": "^8.5.9",
89
+ "@types/koa": "^2.13.12",
90
+ "@types/ws": "^8.5.10",
91
91
  "koa-compose": "^4.1.0",
92
92
  "tslib": "^2.6.2",
93
93
  "webpack-dev-middleware": "^6.1.1",
@@ -95,24 +95,24 @@
95
95
  },
96
96
  "devDependencies": {
97
97
  "@rollup/plugin-typescript": "^11.1.5",
98
- "@swc/core": "^1.3.96",
98
+ "@swc/core": "^1.3.99",
99
99
  "@swc/helpers": "^0.5.3",
100
100
  "@types/koa-compose": "^3.2.8",
101
- "@types/node": "^20.9.0",
101
+ "@types/node": "^20.10.0",
102
102
  "css-loader": "^6.8.1",
103
103
  "html-webpack-plugin": "^5.5.3",
104
104
  "koa": "^2.14.2",
105
105
  "magic-string": "^0.30.5",
106
106
  "memfs": "^4.6.0",
107
107
  "mini-css-extract-plugin": "^2.7.6",
108
- "prettier": "^3.0.3",
108
+ "prettier": "^3.1.0",
109
109
  "react": "^18.2.0",
110
110
  "react-dom": "^18.2.0",
111
111
  "rimraf": "^5.0.5",
112
- "rollup": "^4.3.0",
112
+ "rollup": "^4.5.2",
113
113
  "swc-loader": "^0.2.3",
114
114
  "tsc-alias": "^1.8.8",
115
- "typescript": "^5.2.2",
115
+ "typescript": "^5.3.2",
116
116
  "webpack": "^5.89.0"
117
117
  },
118
118
  "peerDependencies": {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -82,13 +82,8 @@ function hasProblems(problems) {
82
82
  return !!problems && problems.length > 0;
83
83
  }
84
84
  class HotServer {
85
- stats;
86
- compiler;
87
- server;
88
- options;
89
- name = 'webpack-hot-middleware';
90
- logger;
91
85
  constructor(compiler, options) {
86
+ this.name = 'webpack-hot-middleware';
92
87
  this.compiler = compiler;
93
88
  this.options = resolveOptions(options);
94
89
  this.logger = compiler.getInfrastructureLogger(this.name);
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
package/server/esm/dev.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
package/server/esm/hot.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -73,13 +73,8 @@ function hasProblems(problems) {
73
73
  return !!problems && problems.length > 0;
74
74
  }
75
75
  class HotServer {
76
- stats;
77
- compiler;
78
- server;
79
- options;
80
- name = 'webpack-hot-middleware';
81
- logger;
82
76
  constructor(compiler, options) {
77
+ this.name = 'webpack-hot-middleware';
83
78
  this.compiler = compiler;
84
79
  this.options = resolveOptions(options);
85
80
  this.logger = compiler.getInfrastructureLogger(this.name);
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package webpack-dev-service
3
3
  * @license MIT
4
- * @version 0.5.16
4
+ * @version 0.5.18
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A koa 2 middleware for webpack development and hot reloading.
7
7
  * @see https://github.com/nuintun/webpack-dev-service#readme
@@ -2,11 +2,11 @@
2
2
  * @module enum
3
3
  */
4
4
  export declare const enum TokenType {
5
- EOS = 0,
6
- ESC = 1,
7
- OSC = 2,
8
- SGR = 3,
9
- TEXT = 4,
10
- INCESC = 5,
5
+ EOS = 0, // End Operating System
6
+ ESC = 1, // A single ESC char - random
7
+ OSC = 2, // Operating System Command
8
+ SGR = 3, // Select Graphic Rendition
9
+ TEXT = 4, // ANSI normal text group
10
+ INCESC = 5, // An Incomplete ESC sequence
11
11
  UNKNOWN = 6
12
12
  }