@rspack/dev-server 1.0.0-alpha.1 → 1.0.0-alpha.3
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/dist/ansiHTML.js +10 -16
- package/dist/config.d.ts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/middleware.js +1 -1
- package/dist/server.d.ts +1 -1
- package/package.json +4 -4
package/dist/ansiHTML.js
CHANGED
|
@@ -47,7 +47,7 @@ var _openTags = {
|
|
|
47
47
|
4: "<u>",
|
|
48
48
|
8: "display:none",
|
|
49
49
|
9: "<del>",
|
|
50
|
-
38:
|
|
50
|
+
38: match => {
|
|
51
51
|
// color
|
|
52
52
|
var mode = _colorMode[match[0]];
|
|
53
53
|
if (mode === "rgb") {
|
|
@@ -59,7 +59,7 @@ var _openTags = {
|
|
|
59
59
|
return "color: rgb(" + r + "," + g + "," + b + ")";
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
|
-
48:
|
|
62
|
+
48: match => {
|
|
63
63
|
// background color
|
|
64
64
|
var mode = _colorMode[match[0]];
|
|
65
65
|
if (mode === "rgb") {
|
|
@@ -78,7 +78,7 @@ var _openTagToCloseTag = {
|
|
|
78
78
|
9: "29"
|
|
79
79
|
};
|
|
80
80
|
var _closeTags = {
|
|
81
|
-
0:
|
|
81
|
+
0: ansiCodes => {
|
|
82
82
|
if (!ansiCodes)
|
|
83
83
|
return "</span>";
|
|
84
84
|
if (!ansiCodes.length)
|
|
@@ -98,7 +98,7 @@ var _closeTags = {
|
|
|
98
98
|
24: "</u>",
|
|
99
99
|
29: "</del>" // reset delete
|
|
100
100
|
};
|
|
101
|
-
[21, 22, 27, 28, 39, 49].forEach(
|
|
101
|
+
[21, 22, 27, 28, 39, 49].forEach(n => {
|
|
102
102
|
_closeTags[n] = "</span>";
|
|
103
103
|
});
|
|
104
104
|
/**
|
|
@@ -127,7 +127,7 @@ function ansiHTML(text) {
|
|
|
127
127
|
// Cache opened sequence.
|
|
128
128
|
var ansiCodes = [];
|
|
129
129
|
// Replace with markup.
|
|
130
|
-
var ret = text.replace(/\033\[(?:[0-9]{1,3})?(?:(?:;[0-9]{0,3})*)?m/g,
|
|
130
|
+
var ret = text.replace(/\033\[(?:[0-9]{1,3})?(?:(?:;[0-9]{0,3})*)?m/g, m => {
|
|
131
131
|
var match = m.match(/(;?\d+)/g).map(normalizeSeq);
|
|
132
132
|
Object.defineProperty(match, "advance", {
|
|
133
133
|
value: function (count) {
|
|
@@ -180,7 +180,7 @@ function ansiHTML(text) {
|
|
|
180
180
|
* Customize colors.
|
|
181
181
|
* @param {Object} colors reference to _defColors
|
|
182
182
|
*/
|
|
183
|
-
ansiHTML.setColors =
|
|
183
|
+
ansiHTML.setColors = colors => {
|
|
184
184
|
if (typeof colors !== "object") {
|
|
185
185
|
throw new Error("`colors` parameter must be an Object.");
|
|
186
186
|
}
|
|
@@ -197,9 +197,7 @@ ansiHTML.setColors = function (colors) {
|
|
|
197
197
|
}
|
|
198
198
|
if (!Array.isArray(hex) ||
|
|
199
199
|
hex.length === 0 ||
|
|
200
|
-
hex.some(
|
|
201
|
-
return typeof h !== "string";
|
|
202
|
-
})) {
|
|
200
|
+
hex.some(h => typeof h !== "string")) {
|
|
203
201
|
throw new Error("The value of `" +
|
|
204
202
|
key +
|
|
205
203
|
"` property must be an Array and each item could only be a hex string, e.g.: FF0000");
|
|
@@ -224,7 +222,7 @@ ansiHTML.setColors = function (colors) {
|
|
|
224
222
|
/**
|
|
225
223
|
* Reset colors.
|
|
226
224
|
*/
|
|
227
|
-
ansiHTML.reset =
|
|
225
|
+
ansiHTML.reset = () => {
|
|
228
226
|
_setTags(_defColors);
|
|
229
227
|
};
|
|
230
228
|
/**
|
|
@@ -234,14 +232,10 @@ ansiHTML.reset = function () {
|
|
|
234
232
|
ansiHTML.tags = {};
|
|
235
233
|
if (Object.defineProperty) {
|
|
236
234
|
Object.defineProperty(ansiHTML.tags, "open", {
|
|
237
|
-
get:
|
|
238
|
-
return _openTags;
|
|
239
|
-
}
|
|
235
|
+
get: () => _openTags
|
|
240
236
|
});
|
|
241
237
|
Object.defineProperty(ansiHTML.tags, "close", {
|
|
242
|
-
get:
|
|
243
|
-
return _closeTags;
|
|
244
|
-
}
|
|
238
|
+
get: () => _closeTags
|
|
245
239
|
});
|
|
246
240
|
}
|
|
247
241
|
else {
|
package/dist/config.d.ts
CHANGED
package/dist/middleware.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Compiler } from "@rspack/core";
|
|
2
2
|
import type { RequestHandler } from "express";
|
|
3
|
-
import wdm from "webpack-dev-middleware";
|
|
3
|
+
import type wdm from "webpack-dev-middleware";
|
|
4
4
|
export declare function getRspackMemoryAssets(compiler: Compiler, rdm: ReturnType<typeof wdm>): RequestHandler;
|
package/dist/middleware.js
CHANGED
|
@@ -17,7 +17,7 @@ function getRspackMemoryAssets(compiler, rdm) {
|
|
|
17
17
|
const publicPath = compiler.options.output.publicPath
|
|
18
18
|
? compiler.options.output.publicPath.replace(/\/$/, "") + "/"
|
|
19
19
|
: "/";
|
|
20
|
-
return
|
|
20
|
+
return (req, res, next) => {
|
|
21
21
|
const { method, url } = req;
|
|
22
22
|
if (method !== "GET") {
|
|
23
23
|
return next();
|
package/dist/server.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
import type { Server } from "http";
|
|
4
4
|
import type { Socket } from "net";
|
|
5
|
-
import { Compiler, MultiCompiler } from "@rspack/core";
|
|
5
|
+
import { type Compiler, MultiCompiler } from "@rspack/core";
|
|
6
6
|
import type { FSWatcher } from "chokidar";
|
|
7
7
|
import WebpackDevServer from "webpack-dev-server";
|
|
8
8
|
import type { DevServer, ResolvedDevServer } from "./config";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/dev-server",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Development server for rspack",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"@types/express": "4.17.21",
|
|
34
34
|
"@types/mime-types": "2.1.4",
|
|
35
35
|
"@types/ws": "8.5.10",
|
|
36
|
-
"@rspack/core": "1.0.0-alpha.
|
|
37
|
-
"@rspack/
|
|
38
|
-
"@rspack/
|
|
36
|
+
"@rspack/core": "1.0.0-alpha.3",
|
|
37
|
+
"@rspack/plugin-react-refresh": "1.0.0-alpha.3",
|
|
38
|
+
"@rspack/dev-server": "1.0.0-alpha.3"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"chokidar": "3.5.3",
|