webpack-dev-service 0.5.18 → 0.5.20
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/client/cjs/client.cjs +8 -7
- package/client/cjs/events.cjs +1 -1
- package/client/cjs/hot.cjs +1 -1
- package/client/cjs/index.cjs +1 -1
- package/client/cjs/main.cjs +1 -1
- package/client/cjs/ui/overlay.cjs +170 -169
- package/client/cjs/ui/progress.cjs +43 -43
- package/client/cjs/ui/{utils/index.cjs → utils.cjs} +19 -13
- package/client/esm/client.js +8 -7
- package/client/esm/events.js +1 -1
- package/client/esm/hot.js +1 -1
- package/client/esm/index.js +1 -1
- package/client/esm/main.js +1 -1
- package/client/esm/ui/overlay.js +168 -167
- package/client/esm/ui/progress.js +41 -41
- package/client/esm/ui/{utils/index.js → utils.js} +12 -12
- package/package.json +10 -9
- package/server/cjs/dev.cjs +1 -1
- package/server/cjs/hot.cjs +1 -1
- package/server/cjs/index.cjs +1 -1
- package/server/esm/dev.js +1 -1
- package/server/esm/hot.js +1 -1
- package/server/esm/index.js +1 -1
- package/types/client/ui/overlay.d.ts +1 -1
- package/types/client/ui/{utils/index.d.ts → utils.d.ts} +1 -1
- package/client/cjs/ui/utils/ansi/index.cjs +0 -441
- package/client/cjs/ui/utils/ansi/regexp.cjs +0 -70
- package/client/cjs/ui/utils/ansi/utils.cjs +0 -27
- package/client/esm/ui/utils/ansi/index.js +0 -439
- package/client/esm/ui/utils/ansi/regexp.js +0 -66
- package/client/esm/ui/utils/ansi/utils.js +0 -24
- package/types/client/ui/utils/ansi/enum.d.ts +0 -12
- package/types/client/ui/utils/ansi/index.d.ts +0 -18
- package/types/client/ui/utils/ansi/interface.d.ts +0 -68
- package/types/client/ui/utils/ansi/regexp.d.ts +0 -6
- package/types/client/ui/utils/ansi/utils.d.ts +0 -6
package/client/esm/client.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.5.
|
|
4
|
+
* @version 0.5.20
|
|
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
|
|
@@ -50,17 +50,18 @@ function createClient(options) {
|
|
|
50
50
|
setHash(hash);
|
|
51
51
|
};
|
|
52
52
|
const setProblems = (type, problems) => {
|
|
53
|
-
const maps = {
|
|
54
|
-
errors: ['Error', 'error'],
|
|
55
|
-
warnings: ['Warning', 'warn']
|
|
56
|
-
};
|
|
57
53
|
if (options.overlay) {
|
|
58
54
|
overlay.setProblems(type, problems);
|
|
59
55
|
}
|
|
56
|
+
const maps = {
|
|
57
|
+
errors: ['\x1b[38;2;100;30;22m\x1b[48;2;255;95;88m ERROR \x1b[0m', 'error'],
|
|
58
|
+
warnings: ['\x1b[38;2;32;39;35m\x1b[48;2;255;189;46m WARNING \x1b[0m', 'warn']
|
|
59
|
+
};
|
|
60
60
|
const [name, method] = maps[type];
|
|
61
61
|
const debug = console[method];
|
|
62
|
-
for (const { moduleName, message } of problems) {
|
|
63
|
-
|
|
62
|
+
for (const { moduleName, chunkName, message } of problems) {
|
|
63
|
+
const filename = moduleName || chunkName || 'unknown';
|
|
64
|
+
debug(`\x1b[0m${name} in ${filename}\r\n${message}`);
|
|
64
65
|
}
|
|
65
66
|
};
|
|
66
67
|
const onProblems = ({ errors, warnings }) => {
|
package/client/esm/events.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.5.
|
|
4
|
+
* @version 0.5.20
|
|
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.
|
|
4
|
+
* @version 0.5.20
|
|
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/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.5.
|
|
4
|
+
* @version 0.5.20
|
|
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/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.5.
|
|
4
|
+
* @version 0.5.20
|
|
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/ui/overlay.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.5.
|
|
4
|
+
* @version 0.5.20
|
|
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
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { injectCSS, appendHTML, ansiToHTML } from './utils
|
|
10
|
+
import { injectCSS, appendHTML, ansiToHTML } from './utils.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @module overlay
|
|
@@ -15,172 +15,173 @@ import { injectCSS, appendHTML, ansiToHTML } from './utils/index.js';
|
|
|
15
15
|
*/
|
|
16
16
|
const OVERLAY = 'wds-overlay';
|
|
17
17
|
const CSS = `
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
18
|
+
.${OVERLAY} {
|
|
19
|
+
top:0;
|
|
20
|
+
left: 0;
|
|
21
|
+
right: 0;
|
|
22
|
+
bottom: 0;
|
|
23
|
+
display: flex;
|
|
24
|
+
position: fixed;
|
|
25
|
+
font-size: 16px;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
font-style: normal;
|
|
28
|
+
font-weight: normal;
|
|
29
|
+
z-index: 2147483646;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
transform-origin: center;
|
|
33
|
+
background: rgba(0, 0, 0, .85);
|
|
34
|
+
transform: scale(0) translateZ(0);
|
|
35
|
+
transition: transform .25s ease-out;
|
|
36
|
+
font-family: Consolas, "Lucida Console", monospace;
|
|
37
|
+
}
|
|
38
|
+
.${OVERLAY}-show {
|
|
39
|
+
transform: scale(1) translateZ(0);
|
|
40
|
+
}
|
|
41
|
+
.${OVERLAY}-close {
|
|
42
|
+
top: 16px;
|
|
43
|
+
right: 16px;
|
|
44
|
+
width: 16px;
|
|
45
|
+
height: 16px;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
position: absolute;
|
|
48
|
+
border-radius: 16px;
|
|
49
|
+
background: #ff5f58;
|
|
50
|
+
display: inline-block;
|
|
51
|
+
transform-origin: center;
|
|
52
|
+
box-shadow: #ff5f58 0 0 6px;
|
|
53
|
+
transform: rotate(0) translateZ(0);
|
|
54
|
+
transition: transform .25s ease-in-out;
|
|
55
|
+
}
|
|
56
|
+
.${OVERLAY}-close:before,
|
|
57
|
+
.${OVERLAY}-close:after {
|
|
58
|
+
top: 7px;
|
|
59
|
+
left: 3px;
|
|
60
|
+
content: "";
|
|
61
|
+
width: 10px;
|
|
62
|
+
height: 2px;
|
|
63
|
+
position: absolute;
|
|
64
|
+
background-color: white;
|
|
65
|
+
transform-origin: center;
|
|
66
|
+
}
|
|
67
|
+
.${OVERLAY}-close:before {
|
|
68
|
+
transform: rotate(45deg);
|
|
69
|
+
}
|
|
70
|
+
.${OVERLAY}-close:after {
|
|
71
|
+
transform: rotate(-45deg);
|
|
72
|
+
}
|
|
73
|
+
.${OVERLAY}-close:hover {
|
|
74
|
+
transform: rotate(180deg) translateZ(0);
|
|
75
|
+
}
|
|
76
|
+
.${OVERLAY}-title {
|
|
77
|
+
margin: 0;
|
|
78
|
+
color: #fff;
|
|
79
|
+
line-height: 16px;
|
|
80
|
+
text-align: center;
|
|
81
|
+
background: #282d35;
|
|
82
|
+
border-radius: 0 0 4px 4px;
|
|
83
|
+
padding: 16px 48px 16px 16px;
|
|
84
|
+
}
|
|
85
|
+
.${OVERLAY}-name {
|
|
86
|
+
font-weight: bold;
|
|
87
|
+
font-style: normal;
|
|
88
|
+
text-transform: uppercase;
|
|
89
|
+
}
|
|
90
|
+
.${OVERLAY}-errors-title,
|
|
91
|
+
.${OVERLAY}-warnings-title {
|
|
92
|
+
color: #ff5f58;
|
|
93
|
+
padding-left: 8px;
|
|
94
|
+
font-style: normal;
|
|
95
|
+
}
|
|
96
|
+
.${OVERLAY}-warnings-title {
|
|
97
|
+
color: #ffbd2e;
|
|
98
|
+
}
|
|
99
|
+
.${OVERLAY}-problems {
|
|
100
|
+
padding: 0 16px;
|
|
101
|
+
overflow-y: auto;
|
|
102
|
+
scrollbar-width: none;
|
|
103
|
+
-ms-overflow-style: none;
|
|
104
|
+
-ms-scroll-chaining: none;
|
|
105
|
+
overscroll-behavior: contain;
|
|
106
|
+
-webkit-overflow-scrolling: touch;
|
|
107
|
+
}
|
|
108
|
+
.${OVERLAY}-problems::-webkit-scrollbar {
|
|
109
|
+
display: none;
|
|
110
|
+
}
|
|
111
|
+
.${OVERLAY}-errors,
|
|
112
|
+
.${OVERLAY}-warnings {
|
|
113
|
+
color: #ddd;
|
|
114
|
+
padding: 16px;
|
|
115
|
+
margin: 16px 0;
|
|
116
|
+
display: block;
|
|
117
|
+
line-height: 1.2;
|
|
118
|
+
border-radius: 4px;
|
|
119
|
+
background: #282d35;
|
|
120
|
+
}
|
|
121
|
+
.${OVERLAY}-errors > section + section,
|
|
122
|
+
.${OVERLAY}-warnings > section + section {
|
|
123
|
+
margin: 16px 0 0;
|
|
124
|
+
}
|
|
125
|
+
.${OVERLAY}-errors > section > em,
|
|
126
|
+
.${OVERLAY}-warnings > section > em {
|
|
127
|
+
line-height: 1;
|
|
128
|
+
color: #641e16;
|
|
129
|
+
padding: 4px 8px;
|
|
130
|
+
font-style: normal;
|
|
131
|
+
border-radius: 4px;
|
|
132
|
+
font-weight: normal;
|
|
133
|
+
background: #ff5f58;
|
|
134
|
+
display: inline-block;
|
|
135
|
+
text-transform: uppercase;
|
|
136
|
+
}
|
|
137
|
+
.${OVERLAY}-warnings > section > em {
|
|
138
|
+
color: #3e2723;
|
|
139
|
+
background: #ffbd2e;
|
|
140
|
+
}
|
|
141
|
+
.${OVERLAY}-errors > section > pre,
|
|
142
|
+
.${OVERLAY}-warnings > section > pre {
|
|
143
|
+
margin: 0;
|
|
144
|
+
font-size: 14px;
|
|
145
|
+
font-family: inherit;
|
|
146
|
+
padding: 8px 0 0 16px;
|
|
147
|
+
white-space: pre-wrap;
|
|
148
|
+
overflow-wrap: anywhere;
|
|
149
|
+
}
|
|
150
|
+
.${OVERLAY}-errors > section > pre span,
|
|
151
|
+
.${OVERLAY}-warnings > section > pre span {
|
|
152
|
+
display: inline-flex;
|
|
153
|
+
}
|
|
154
|
+
.${OVERLAY}-hidden {
|
|
155
|
+
display: none;
|
|
156
|
+
}
|
|
157
|
+
`;
|
|
158
158
|
const DEFAULT_NAME = 'webpack';
|
|
159
159
|
const HTML = `
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
160
|
+
<div class="${OVERLAY}">
|
|
161
|
+
<i class="${OVERLAY}-close"></i>
|
|
162
|
+
<div class="${OVERLAY}-title">
|
|
163
|
+
<em class="${OVERLAY}-name"></em>
|
|
164
|
+
<em class="${OVERLAY}-errors-title"></em>
|
|
165
|
+
<em class="${OVERLAY}-warnings-title"></em>
|
|
166
|
+
</div>
|
|
167
|
+
<aside class="${OVERLAY}-problems">
|
|
168
|
+
<article class="${OVERLAY}-errors ${OVERLAY}-hidden"></article>
|
|
169
|
+
<article class="${OVERLAY}-warnings ${OVERLAY}-hidden"></article>
|
|
170
|
+
</aside>
|
|
171
|
+
</div>
|
|
172
|
+
`;
|
|
173
173
|
class Overlay {
|
|
174
174
|
constructor(name) {
|
|
175
175
|
this.hidden = true;
|
|
176
176
|
injectCSS(CSS);
|
|
177
|
-
[
|
|
178
|
-
this.
|
|
179
|
-
this.
|
|
180
|
-
this.
|
|
181
|
-
this.
|
|
182
|
-
this.
|
|
183
|
-
this.
|
|
177
|
+
const [dialog] = appendHTML(HTML);
|
|
178
|
+
this.dialog = dialog;
|
|
179
|
+
this.name = dialog.querySelector(`.${OVERLAY}-name`);
|
|
180
|
+
this.close = dialog.querySelector(`.${OVERLAY}-close`);
|
|
181
|
+
this.errorsList = dialog.querySelector(`.${OVERLAY}-errors`);
|
|
182
|
+
this.warningsList = dialog.querySelector(`.${OVERLAY}-warnings`);
|
|
183
|
+
this.errorsTitle = dialog.querySelector(`.${OVERLAY}-errors-title`);
|
|
184
|
+
this.warningsTitle = dialog.querySelector(`.${OVERLAY}-warnings-title`);
|
|
184
185
|
this.name.innerHTML = `⭕ ${name || DEFAULT_NAME}`;
|
|
185
186
|
this.close.addEventListener('click', () => {
|
|
186
187
|
this.hide();
|
|
@@ -197,10 +198,10 @@ class Overlay {
|
|
|
197
198
|
if (count > 0) {
|
|
198
199
|
let html = '';
|
|
199
200
|
problemTitle.innerText = `${count} ${name}(s)`;
|
|
200
|
-
for (const { moduleName
|
|
201
|
-
const src = ansiToHTML(moduleName);
|
|
201
|
+
for (const { moduleName, chunkName, message } of problems) {
|
|
202
202
|
const details = ansiToHTML(message);
|
|
203
|
-
|
|
203
|
+
const filename = moduleName || chunkName || 'unknown';
|
|
204
|
+
html += `<section><em>${name}</em> in ${filename}<pre>${details}</pre></section>`;
|
|
204
205
|
}
|
|
205
206
|
problemList.innerHTML = html;
|
|
206
207
|
problemList.classList.remove(hidden);
|
|
@@ -213,13 +214,13 @@ class Overlay {
|
|
|
213
214
|
show() {
|
|
214
215
|
if (this.hidden) {
|
|
215
216
|
this.hidden = false;
|
|
216
|
-
this.
|
|
217
|
+
this.dialog.classList.add(`${OVERLAY}-show`);
|
|
217
218
|
}
|
|
218
219
|
}
|
|
219
220
|
hide() {
|
|
220
221
|
if (!this.hidden) {
|
|
221
222
|
this.hidden = true;
|
|
222
|
-
this.
|
|
223
|
+
this.dialog.classList.remove(`${OVERLAY}-show`);
|
|
223
224
|
}
|
|
224
225
|
}
|
|
225
226
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.5.
|
|
4
|
+
* @version 0.5.20
|
|
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
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { injectCSS, appendHTML } from './utils
|
|
10
|
+
import { injectCSS, appendHTML } from './utils.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @module progress
|
|
@@ -17,46 +17,46 @@ import { injectCSS, appendHTML } from './utils/index.js';
|
|
|
17
17
|
const PROGRESS = 'wds-progress';
|
|
18
18
|
const PERIMETER = 2 * Math.PI * 44;
|
|
19
19
|
const CSS = `
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
20
|
+
.${PROGRESS} {
|
|
21
|
+
width: 48px;
|
|
22
|
+
right: 16px;
|
|
23
|
+
height: 48px;
|
|
24
|
+
bottom: 16px;
|
|
25
|
+
display: block;
|
|
26
|
+
font-size: 16px;
|
|
27
|
+
position: fixed;
|
|
28
|
+
cursor: default;
|
|
29
|
+
user-select: none;
|
|
30
|
+
font-style: normal;
|
|
31
|
+
font-weight: normal;
|
|
32
|
+
z-index: 2147483647;
|
|
33
|
+
transform-origin: center;
|
|
34
|
+
transform: scale(0) translateZ(0);
|
|
35
|
+
transition: transform .25s ease-out;
|
|
36
|
+
}
|
|
37
|
+
.${PROGRESS}-show {
|
|
38
|
+
transform: scale(1) translateZ(0);
|
|
39
|
+
}
|
|
40
|
+
.${PROGRESS}-track {
|
|
41
|
+
stroke: #badfac;
|
|
42
|
+
stroke-width: 8;
|
|
43
|
+
stroke-linecap: round;
|
|
44
|
+
fill: rgba(0, 0, 0, 0);
|
|
45
|
+
stroke-dasharray: ${PERIMETER};
|
|
46
|
+
stroke-dashoffset: ${PERIMETER};
|
|
47
|
+
transition: stroke-dashoffset .25s linear;
|
|
48
|
+
transform: matrix(0, -1, 1, 0, 0, 96) translateZ(0);
|
|
49
|
+
}
|
|
50
|
+
`;
|
|
51
51
|
const HTML = `
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
<svg class="${PROGRESS}" x="0" y="0" viewBox="0 0 96 96">
|
|
53
|
+
<circle fill="#282d35" cx="50%" cy="50%" r="44" />
|
|
54
|
+
<circle class="${PROGRESS}-track" cx="50%" cy="50%" r="44" />
|
|
55
|
+
<path fill="#fff" d="m48,83.213561l-31.122918,-17.60678l0,-35.21356l31.122918,-17.60678l31.122918,17.60678l0,35.21356l-31.122918,17.60678z" />
|
|
56
|
+
<path fill="#8ed6fb" d="m22.434956,31.608089l24.537982,-13.880011l0,10.810563l-15.288554,8.410172l-9.249428,-5.340723zm-1.678513,1.520052l0,29.027711l8.979458,-5.182262l0,-18.657318l-8.979458,-5.188131zm52.908373,-1.520052l-24.537982,-13.880011l0,10.810563l15.288554,8.410172l9.249428,-5.340723zm1.678513,1.520052l0,29.027711l-8.979458,-5.182262l0,-18.657318l8.979458,-5.188131zm-1.050538,30.905767l-25.165957,14.238016l0,-10.452558l16.121941,-8.867948l0.123247,-0.070427l8.920768,5.152918zm-52.485811,0l25.165957,14.238016l0,-10.452558l-16.121941,-8.867948l-0.123247,-0.070427l-8.920768,5.152918z" />
|
|
57
|
+
<path fill="#1c78c0" d="m49.126834,30.997721l15.083141,8.292793l0,16.432994l-15.083141,-8.709487l0,-16.016301zm-2.153896,0l-15.083141,8.292793l0,16.432994l15.083141,-8.709487l0,-16.016301zm16.215844,26.62732l-15.141831,8.328007l-15.141831,-8.328007l15.141831,-8.744701l15.141831,8.744701z" />
|
|
58
|
+
</svg>
|
|
59
|
+
`;
|
|
60
60
|
class Progress {
|
|
61
61
|
constructor() {
|
|
62
62
|
this.hidden = true;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.5.
|
|
4
|
+
* @version 0.5.20
|
|
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
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import Ansi from '
|
|
10
|
+
import Ansi from '@nuintun/ansi';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @module utils
|
|
@@ -56,19 +56,19 @@ function blockToHTML({ style, value, url }) {
|
|
|
56
56
|
const styles = [];
|
|
57
57
|
const textDecorations = [];
|
|
58
58
|
if (style.dim) {
|
|
59
|
-
styles.push(`opacity:0.5`);
|
|
59
|
+
styles.push(`opacity: 0.5`);
|
|
60
60
|
}
|
|
61
61
|
if (style.bold) {
|
|
62
|
-
styles.push(`font-weight:bold`);
|
|
62
|
+
styles.push(`font-weight: bold`);
|
|
63
63
|
}
|
|
64
64
|
if (style.italic) {
|
|
65
|
-
styles.push(`font-style:italic`);
|
|
65
|
+
styles.push(`font-style: italic`);
|
|
66
66
|
}
|
|
67
67
|
if (style.inverse) {
|
|
68
|
-
styles.push(`filter:invert(1)`);
|
|
68
|
+
styles.push(`filter: invert(1)`);
|
|
69
69
|
}
|
|
70
70
|
if (style.hidden) {
|
|
71
|
-
styles.push(`visibility:hidden`);
|
|
71
|
+
styles.push(`visibility: hidden`);
|
|
72
72
|
}
|
|
73
73
|
if (style.blink) {
|
|
74
74
|
textDecorations.push('blink');
|
|
@@ -84,23 +84,23 @@ function blockToHTML({ style, value, url }) {
|
|
|
84
84
|
}
|
|
85
85
|
const { color, background } = style;
|
|
86
86
|
if (color) {
|
|
87
|
-
styles.push(`color:rgb(${color})`);
|
|
87
|
+
styles.push(`color: rgb(${color})`);
|
|
88
88
|
}
|
|
89
89
|
if (background) {
|
|
90
|
-
styles.push(`background-color:rgb(${background})`);
|
|
90
|
+
styles.push(`background-color: rgb(${background})`);
|
|
91
91
|
}
|
|
92
92
|
if (textDecorations.length > 0) {
|
|
93
|
-
styles.push(`text-decoration
|
|
93
|
+
styles.push(`text-decoration: ${textDecorations.join(' ')}`);
|
|
94
94
|
}
|
|
95
95
|
const escapedValue = escapeHTML(value);
|
|
96
|
-
const href = url ? JSON.stringify(
|
|
96
|
+
const href = url ? JSON.stringify(new URL(url).toString()) : null;
|
|
97
97
|
if (styles.length <= 0) {
|
|
98
98
|
if (!href) {
|
|
99
99
|
return escapedValue;
|
|
100
100
|
}
|
|
101
101
|
return `<a href=${href} target="_blank">${escapedValue}</a>`;
|
|
102
102
|
}
|
|
103
|
-
const inlineStyle = JSON.stringify(`${styles.join(';')};`);
|
|
103
|
+
const inlineStyle = JSON.stringify(`${styles.join('; ')};`);
|
|
104
104
|
if (!href) {
|
|
105
105
|
return `<span style=${inlineStyle}>${escapedValue}</span>`;
|
|
106
106
|
}
|