webpack-dev-service 0.12.13 → 0.13.0
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/cjs/client/client.cjs +1 -1
- package/cjs/client/events.cjs +1 -1
- package/cjs/client/hot.cjs +1 -1
- package/cjs/client/index.cjs +1 -1
- package/cjs/client/main.cjs +1 -1
- package/cjs/client/ui/Overlay.cjs +1 -1
- package/cjs/client/ui/Progress.cjs +1 -1
- package/cjs/client/ui/utils.cjs +1 -1
- package/cjs/server/compose.cjs +1 -1
- package/cjs/server/dev/{utils/stream.cjs → ReadStream.cjs} +4 -4
- package/cjs/server/dev/Service.cjs +40 -38
- package/cjs/server/dev/index.cjs +1 -1
- package/cjs/server/dev/middleware.cjs +6 -3
- package/cjs/server/dev/utils/fs.cjs +1 -1
- package/cjs/server/dev/utils/hash.cjs +1 -1
- package/cjs/server/dev/utils/http.cjs +68 -73
- package/cjs/server/dev/utils/path.cjs +1 -1
- package/cjs/server/dev/utils/paths.cjs +1 -1
- package/cjs/server/dev/utils/ready.cjs +1 -1
- package/cjs/server/dev/utils/setupHooks.cjs +1 -1
- package/cjs/server/dev/utils/setupOutputFileSystem.cjs +1 -1
- package/cjs/server/dev/utils/setupWatching.cjs +1 -1
- package/cjs/server/dev/utils/setupWriteToDisk.cjs +1 -1
- package/cjs/server/hot/Socket.cjs +1 -1
- package/cjs/server/hot/index.cjs +1 -1
- package/cjs/server/hot/utils.cjs +6 -4
- package/cjs/server/index.cjs +1 -1
- package/cjs/server/schema.cjs +1 -1
- package/cjs/server/utils.cjs +1 -1
- package/esm/client/client.js +1 -1
- package/esm/client/events.js +1 -1
- package/esm/client/hot.js +1 -1
- package/esm/client/index.js +1 -1
- package/esm/client/main.js +1 -1
- package/esm/client/ui/Overlay.js +1 -1
- package/esm/client/ui/Progress.js +1 -1
- package/esm/client/ui/utils.js +1 -1
- package/esm/server/compose.js +1 -1
- package/esm/server/dev/{utils/stream.js → ReadStream.js} +4 -4
- package/esm/server/dev/Service.js +41 -39
- package/esm/server/dev/index.js +1 -1
- package/esm/server/dev/middleware.js +6 -3
- package/esm/server/dev/utils/fs.js +1 -1
- package/esm/server/dev/utils/hash.js +1 -1
- package/esm/server/dev/utils/http.js +68 -73
- package/esm/server/dev/utils/path.js +1 -1
- package/esm/server/dev/utils/paths.js +1 -1
- package/esm/server/dev/utils/ready.js +1 -1
- package/esm/server/dev/utils/setupHooks.js +1 -1
- package/esm/server/dev/utils/setupOutputFileSystem.js +1 -1
- package/esm/server/dev/utils/setupWatching.js +1 -1
- package/esm/server/dev/utils/setupWriteToDisk.js +1 -1
- package/esm/server/hot/Socket.js +1 -1
- package/esm/server/hot/index.js +1 -1
- package/esm/server/hot/utils.js +6 -4
- package/esm/server/index.js +1 -1
- package/esm/server/schema.js +1 -1
- package/esm/server/utils.js +1 -1
- package/package.json +5 -5
- package/types/server/dev/{utils/stream.d.ts → ReadStream.d.ts} +4 -10
- package/types/server/dev/Service.d.ts +3 -3
- package/types/server/dev/utils/http.d.ts +12 -8
- package/types/server/hot/utils.d.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.
|
|
4
|
+
* @version 0.13.0
|
|
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.
|
|
4
|
+
* @version 0.13.0
|
|
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.
|
|
4
|
+
* @version 0.13.0
|
|
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/esm/server/hot/Socket.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.
|
|
4
|
+
* @version 0.13.0
|
|
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/esm/server/hot/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.
|
|
4
|
+
* @version 0.13.0
|
|
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/esm/server/hot/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.
|
|
4
|
+
* @version 0.13.0
|
|
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
|
|
@@ -12,8 +12,8 @@ import { isMultiCompiler, isObject } from '../utils.js';
|
|
|
12
12
|
/**
|
|
13
13
|
* @module utils
|
|
14
14
|
*/
|
|
15
|
-
function isUpgradable(
|
|
16
|
-
const
|
|
15
|
+
function isUpgradable({ request }) {
|
|
16
|
+
const upgrade = request.get('Upgrade');
|
|
17
17
|
return !!upgrade && /^websocket$/i.test(upgrade.trim());
|
|
18
18
|
}
|
|
19
19
|
function normalize(path) {
|
|
@@ -52,7 +52,9 @@ function hasIssues(issues) {
|
|
|
52
52
|
}
|
|
53
53
|
function normalizeStatsOptions(statsOptions) {
|
|
54
54
|
if (!isObject(statsOptions)) {
|
|
55
|
-
statsOptions = {
|
|
55
|
+
statsOptions = {
|
|
56
|
+
preset: statsOptions
|
|
57
|
+
};
|
|
56
58
|
}
|
|
57
59
|
return {
|
|
58
60
|
...statsOptions,
|
package/esm/server/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.
|
|
4
|
+
* @version 0.13.0
|
|
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/esm/server/schema.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.
|
|
4
|
+
* @version 0.13.0
|
|
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/esm/server/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.
|
|
4
|
+
* @version 0.13.0
|
|
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.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "A koa 2 middleware for webpack development and hot reloading.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -88,15 +88,15 @@
|
|
|
88
88
|
"devDependencies": {
|
|
89
89
|
"@rollup/plugin-replace": "^6.0.1",
|
|
90
90
|
"@rollup/plugin-typescript": "^12.1.1",
|
|
91
|
-
"@swc/core": "^1.7.
|
|
91
|
+
"@swc/core": "^1.7.39",
|
|
92
92
|
"@swc/helpers": "^0.5.13",
|
|
93
93
|
"@types/etag": "^1.8.3",
|
|
94
|
-
"@types/node": "^22.7.
|
|
94
|
+
"@types/node": "^22.7.9",
|
|
95
95
|
"@types/range-parser": "^1.2.7",
|
|
96
|
-
"@types/react": "^18.3.
|
|
96
|
+
"@types/react": "^18.3.12",
|
|
97
97
|
"@types/react-dom": "^18.3.1",
|
|
98
98
|
"css-loader": "^7.1.2",
|
|
99
|
-
"html-webpack-plugin": "^5.6.
|
|
99
|
+
"html-webpack-plugin": "^5.6.3",
|
|
100
100
|
"koa": "^2.15.3",
|
|
101
101
|
"koa-compress": "^5.1.1",
|
|
102
102
|
"magic-string": "^0.30.12",
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @module
|
|
2
|
+
* @module ReadStream
|
|
3
3
|
*/
|
|
4
|
-
import { FileSystem } from './fs';
|
|
5
4
|
import { PathLike } from 'node:fs';
|
|
6
|
-
import {
|
|
5
|
+
import { Range } from './utils/http';
|
|
6
|
+
import { FileSystem } from './utils/fs';
|
|
7
7
|
import { Readable, ReadableOptions } from 'node:stream';
|
|
8
8
|
export interface Options extends Pick<ReadableOptions, 'highWaterMark'> {
|
|
9
9
|
fs: FileSystem;
|
|
10
10
|
}
|
|
11
|
-
export interface Range {
|
|
12
|
-
offset: number;
|
|
13
|
-
length: number;
|
|
14
|
-
prefix?: Buffer;
|
|
15
|
-
suffix?: Buffer;
|
|
16
|
-
}
|
|
17
11
|
interface Callback {
|
|
18
12
|
(error?: Error | null): void;
|
|
19
13
|
}
|
|
20
|
-
export declare class
|
|
14
|
+
export declare class ReadStream extends Readable {
|
|
21
15
|
#private;
|
|
22
16
|
/**
|
|
23
17
|
* @constructor
|
|
@@ -11,8 +11,8 @@ interface Headers {
|
|
|
11
11
|
[key: string]: string | string[];
|
|
12
12
|
}
|
|
13
13
|
type FileStats = Stats | null | undefined;
|
|
14
|
-
interface
|
|
15
|
-
(path: string, stats: FileStats): Headers | void;
|
|
14
|
+
interface HeadersFunction {
|
|
15
|
+
(path: string, stats: FileStats): Promise<Headers | void> | Headers | void;
|
|
16
16
|
}
|
|
17
17
|
export interface Options {
|
|
18
18
|
fs: FileSystem;
|
|
@@ -21,7 +21,7 @@ export interface Options {
|
|
|
21
21
|
lastModified?: boolean;
|
|
22
22
|
highWaterMark?: number;
|
|
23
23
|
ignore?: IgnoreFunction;
|
|
24
|
-
headers?: Headers |
|
|
24
|
+
headers?: Headers | HeadersFunction;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* @class Service
|
|
@@ -3,8 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Context } from 'koa';
|
|
5
5
|
import { Stats } from 'node:fs';
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import { Buffer } from 'node:buffer';
|
|
7
|
+
export interface Range {
|
|
8
|
+
offset: number;
|
|
9
|
+
length: number;
|
|
10
|
+
prefix?: Buffer;
|
|
11
|
+
suffix?: Buffer;
|
|
12
|
+
}
|
|
8
13
|
/**
|
|
9
14
|
* @function decodeURI
|
|
10
15
|
* @description Decode URI component.
|
|
@@ -16,18 +21,17 @@ export declare function decodeURI(URI: string): string | -1;
|
|
|
16
21
|
* @description Check if request is conditional GET.
|
|
17
22
|
* @param context The koa context.
|
|
18
23
|
*/
|
|
19
|
-
export declare function isConditionalGET(
|
|
24
|
+
export declare function isConditionalGET({ request }: Context): boolean;
|
|
20
25
|
/**
|
|
21
|
-
* @function
|
|
22
|
-
* @description Check if request precondition
|
|
26
|
+
* @function isPreconditionFailed
|
|
27
|
+
* @description Check if request precondition failed.
|
|
23
28
|
* @param context The koa context.
|
|
24
29
|
*/
|
|
25
|
-
export declare function
|
|
30
|
+
export declare function isPreconditionFailed({ request, response }: Context): boolean;
|
|
26
31
|
/**
|
|
27
32
|
* @function parseRanges
|
|
28
33
|
* @description Parse ranges.
|
|
29
34
|
* @param context The koa context.
|
|
30
35
|
* @param stats The file stats.
|
|
31
36
|
*/
|
|
32
|
-
export declare function parseRanges(context: Context, stats: Stats):
|
|
33
|
-
export {};
|
|
37
|
+
export declare function parseRanges(context: Context, stats: Stats): Range[] | -1 | -2;
|
|
@@ -5,7 +5,7 @@ import webpack from 'webpack';
|
|
|
5
5
|
import { Context } from 'koa';
|
|
6
6
|
import { Options } from './interface';
|
|
7
7
|
import { UnionCompiler } from '../../server/interface';
|
|
8
|
-
export declare function isUpgradable(
|
|
8
|
+
export declare function isUpgradable({ request }: Context): boolean;
|
|
9
9
|
export declare function getOptions(options?: Options): Required<Options>;
|
|
10
10
|
export declare function hasIssues<T>(issues: ArrayLike<T> | undefined): boolean;
|
|
11
11
|
export declare function getStatsOptions(compiler: UnionCompiler): webpack.StatsOptions;
|