@rspack/core 2.0.1 → 2.0.2
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/compiled/http-proxy-middleware/index.d.ts +1 -26
- package/compiled/http-proxy-middleware/package.json +1 -1
- package/compiled/watchpack/index.d.ts +2 -218
- package/compiled/watchpack/index.js +1387 -939
- package/compiled/watchpack/package.json +8 -1
- package/compiled/watchpack/types/DirectoryWatcher.d.ts +333 -0
- package/compiled/watchpack/types/LinkResolver.d.ts +10 -0
- package/compiled/watchpack/types/getWatcherManager.d.ts +62 -0
- package/compiled/watchpack/types/index.d.ts +261 -0
- package/compiled/watchpack/types/reducePlan.d.ts +34 -0
- package/compiled/watchpack/types/watchEventSource.d.ts +53 -0
- package/compiled/watchpack/types/watchpack.d.ts +2 -0
- package/dist/Compilation.d.ts +2 -2
- package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/rsc/index.d.ts +4 -4
- package/dist/index.js +29 -20
- package/dist/stats/statsFactoryUtils.d.ts +3 -3
- package/package.json +5 -6
|
@@ -5,8 +5,6 @@ import net__default, { Socket } from 'node:net';
|
|
|
5
5
|
import http2, { Http2ServerResponse, Http2ServerRequest } from 'node:http2';
|
|
6
6
|
import { EventEmitter } from 'node:events';
|
|
7
7
|
import * as stream from 'node:stream';
|
|
8
|
-
import { HttpBindings } from '@hono/node-server';
|
|
9
|
-
import { MiddlewareHandler } from 'hono';
|
|
10
8
|
|
|
11
9
|
interface ProxyTargetDetailed {
|
|
12
10
|
host?: string;
|
|
@@ -330,29 +328,6 @@ interface Options<TReq extends http.IncomingMessage = http.IncomingMessage, TRes
|
|
|
330
328
|
*/
|
|
331
329
|
declare function createProxyMiddleware<TReq extends http.IncomingMessage = http.IncomingMessage, TRes extends http.ServerResponse = http.ServerResponse, TNext = NextFunction>(options: Options<TReq, TRes>): RequestHandler<TReq, TRes, TNext>;
|
|
332
330
|
|
|
333
|
-
/**
|
|
334
|
-
* Creates a Hono middleware that proxies requests using http-proxy-middleware.
|
|
335
|
-
*
|
|
336
|
-
* `@remarks`
|
|
337
|
-
* This middleware requires Hono to be running on Node.js via `@hono/node-server`.
|
|
338
|
-
* It uses `c.env.incoming` and `c.env.outgoing` which are only available with `HttpBindings`.
|
|
339
|
-
*
|
|
340
|
-
* `@experimental` This API is experimental and may change without a major version bump.
|
|
341
|
-
*
|
|
342
|
-
* `@example`
|
|
343
|
-
* ```ts
|
|
344
|
-
* import { serve } from '@hono/node-server';
|
|
345
|
-
* import { Hono } from 'hono';
|
|
346
|
-
* import { createHonoProxyMiddleware } from 'http-proxy-middleware';
|
|
347
|
-
*
|
|
348
|
-
* const app = new Hono();
|
|
349
|
-
* app.use('/api', createHonoProxyMiddleware({ target: 'http://example.com', changeOrigin: true }));
|
|
350
|
-
* serve(app);
|
|
351
|
-
*/
|
|
352
|
-
declare function createHonoProxyMiddleware(options: Options): MiddlewareHandler<{
|
|
353
|
-
Bindings: HttpBindings;
|
|
354
|
-
}>;
|
|
355
|
-
|
|
356
331
|
type Interceptor<TReq = http.IncomingMessage, TRes = http.ServerResponse> = (buffer: Buffer, proxyRes: http.IncomingMessage, req: TReq, res: TRes) => Promise<Buffer | string>;
|
|
357
332
|
/**
|
|
358
333
|
* Intercept responses from upstream.
|
|
@@ -403,5 +378,5 @@ declare const loggerPlugin: Plugin;
|
|
|
403
378
|
*/
|
|
404
379
|
declare const proxyEventsPlugin: Plugin;
|
|
405
380
|
|
|
406
|
-
export {
|
|
381
|
+
export { createProxyMiddleware, debugProxyErrorsPlugin, errorResponsePlugin, fixRequestBody, loggerPlugin, proxyEventsPlugin, responseInterceptor };
|
|
407
382
|
export type { Filter, Options, Plugin, RequestHandler };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"http-proxy-middleware","author":"Steven Chim","version":"4.0.0-beta.
|
|
1
|
+
{"name":"http-proxy-middleware","author":"Steven Chim","version":"4.0.0-beta.6","license":"MIT","types":"index.d.ts","type":"module"}
|
|
@@ -1,219 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// @ts-ignore
|
|
4
|
-
import fs from 'graceful-fs';
|
|
5
|
-
|
|
6
|
-
declare class DirectoryWatcher extends EventEmitter {
|
|
7
|
-
options: Watchpack.WatcherOptions;
|
|
8
|
-
directories: {
|
|
9
|
-
[path: string]: Watcher | true;
|
|
10
|
-
};
|
|
11
|
-
files: {
|
|
12
|
-
[path: string]: [number, number];
|
|
13
|
-
};
|
|
14
|
-
initialScan: boolean;
|
|
15
|
-
initialScanRemoved: string[];
|
|
16
|
-
nestedWatching: boolean;
|
|
17
|
-
path: string;
|
|
18
|
-
refs: number;
|
|
19
|
-
watcher: fs.FSWatcher;
|
|
20
|
-
watchers: {
|
|
21
|
-
[path: string]: Watcher[];
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
constructor(directoryPath: string, options: Watchpack.WatcherOptions);
|
|
25
|
-
|
|
26
|
-
setFileTime(filePath: string, mtime: number, initial: boolean, type?: string | boolean): void;
|
|
27
|
-
|
|
28
|
-
setDirectory(directoryPath: string, exist: boolean, initial: boolean): void;
|
|
29
|
-
|
|
30
|
-
createNestedWatcher(directoryPath: string): void;
|
|
31
|
-
|
|
32
|
-
setNestedWatching(flag: boolean): void;
|
|
33
|
-
|
|
34
|
-
watch(filePath: string, startTime: number): Watcher;
|
|
35
|
-
|
|
36
|
-
onFileAdded(filePath: string, stat: fs.Stats): void;
|
|
37
|
-
|
|
38
|
-
onDirectoryAdded(directoryPath: string): void;
|
|
39
|
-
|
|
40
|
-
onChange(filePath: string, stat: fs.Stats): void;
|
|
41
|
-
|
|
42
|
-
onFileUnlinked(filePath: string): void;
|
|
43
|
-
|
|
44
|
-
onDirectoryUnlinked(directoryPath: string): void;
|
|
45
|
-
|
|
46
|
-
onWatcherError(): void;
|
|
47
|
-
|
|
48
|
-
doInitialScan(): void;
|
|
49
|
-
|
|
50
|
-
getTimes(): {
|
|
51
|
-
[path: string]: number;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
close(): void;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
declare class Watcher extends EventEmitter {
|
|
58
|
-
data: number;
|
|
59
|
-
directoryWatcher: DirectoryWatcher;
|
|
60
|
-
path: string;
|
|
61
|
-
startTime: number;
|
|
62
|
-
|
|
63
|
-
constructor(directoryWatcher: DirectoryWatcher, filePath: string, startTime: number);
|
|
64
|
-
|
|
65
|
-
checkStartTime(mtime: number, initial: boolean): boolean;
|
|
66
|
-
|
|
67
|
-
close(): void;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
interface Entry {
|
|
71
|
-
/** A point in time at which is it safe to say all changes happened before that */
|
|
72
|
-
safeTime: number;
|
|
73
|
-
/** Only for file entries: the last modified timestamp of the file */
|
|
74
|
-
timestamp: number;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
declare class Watchpack extends EventEmitter {
|
|
78
|
-
aggregatedChanges: Set<string>;
|
|
79
|
-
aggregatedRemovals: Set<string>;
|
|
80
|
-
|
|
81
|
-
aggregateTimeout: number;
|
|
82
|
-
dirWatchers: Watcher[];
|
|
83
|
-
fileWatchers: Watcher[];
|
|
84
|
-
/** Last modified times for files by path */
|
|
85
|
-
mtimes: {
|
|
86
|
-
[path: string]: number;
|
|
87
|
-
};
|
|
88
|
-
options: Watchpack.WatchOptions;
|
|
89
|
-
paused: boolean;
|
|
90
|
-
watcherOptions: Watchpack.WatcherOptions;
|
|
91
|
-
|
|
92
|
-
constructor(options: Watchpack.WatchOptions);
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Starts watching these files and directories
|
|
96
|
-
* Calling this again will override the files and directories
|
|
97
|
-
*/
|
|
98
|
-
watch(options: {
|
|
99
|
-
/**
|
|
100
|
-
* Can be files or directories
|
|
101
|
-
* For files: content and existence changes are tracked
|
|
102
|
-
* For directories: only existence and timestamp changes are tracked
|
|
103
|
-
*/
|
|
104
|
-
files?: Iterable<string>;
|
|
105
|
-
/**
|
|
106
|
-
* Can only be directories
|
|
107
|
-
* Directory content (and content of children, ...) and existence changes are tracked.
|
|
108
|
-
* For files: content and existence changes are tracked
|
|
109
|
-
* Assumed to exist, when directory is not found without further information a remove event is emitted
|
|
110
|
-
*/
|
|
111
|
-
directories?: Iterable<string>;
|
|
112
|
-
/**
|
|
113
|
-
* Can be files or directories
|
|
114
|
-
* Only existence changes are tracked
|
|
115
|
-
* Assued to not exist, no remove event is emitted when not found initially
|
|
116
|
-
*/
|
|
117
|
-
missing?: Iterable<string>;
|
|
118
|
-
startTime?: number;
|
|
119
|
-
}): void;
|
|
120
|
-
|
|
121
|
-
on(
|
|
122
|
-
eventName: "change",
|
|
123
|
-
listener: (
|
|
124
|
-
/** The changed file or directory */
|
|
125
|
-
filePath: string,
|
|
126
|
-
/** The last modified time of the changed file */
|
|
127
|
-
modifiedTime: number,
|
|
128
|
-
/** Textual information how this change was detected */
|
|
129
|
-
explanation: string,
|
|
130
|
-
) => void,
|
|
131
|
-
): this;
|
|
132
|
-
|
|
133
|
-
on(
|
|
134
|
-
eventName: "remove",
|
|
135
|
-
listener: (
|
|
136
|
-
/** The removed file or directory */
|
|
137
|
-
filePath: string,
|
|
138
|
-
/** Textual information how this change was detected */
|
|
139
|
-
explanation: string,
|
|
140
|
-
) => void,
|
|
141
|
-
): this;
|
|
142
|
-
|
|
143
|
-
on(
|
|
144
|
-
eventName: "aggregated",
|
|
145
|
-
listener: (
|
|
146
|
-
/** Set of all changed files */
|
|
147
|
-
changes: Set<string>,
|
|
148
|
-
/** Set of all removed files */
|
|
149
|
-
removals: Set<string>,
|
|
150
|
-
) => void,
|
|
151
|
-
): this;
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Stops emitting events, but keeps watchers open
|
|
155
|
-
* The next "watch" call can reuse the watchers
|
|
156
|
-
* The watcher will keep aggregating events which can be received with `getAggregated()`
|
|
157
|
-
*/
|
|
158
|
-
pause(): void;
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Stops emitting events and closes all watchers
|
|
162
|
-
*/
|
|
163
|
-
close(): void;
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Returns the current aggregated info and removes that from the watcher
|
|
167
|
-
* The next aggregated event won't include that info and will only emitted when futher changes happen
|
|
168
|
-
* Can be used when paused
|
|
169
|
-
*/
|
|
170
|
-
getAggregated(): {
|
|
171
|
-
changes: Set<string>;
|
|
172
|
-
removals: Set<string>;
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Collects time info objects for all known files and directories
|
|
177
|
-
* This includes info from files not directly watched
|
|
178
|
-
*/
|
|
179
|
-
collectTimeInfoEntries(fileInfoEntries: Map<string, Entry>, directoryInfoEntries: Map<string, Entry>): void;
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Returns a `Map` with all known time info objects for files and directories
|
|
183
|
-
* Similar to `collectTimeInfoEntries()` but returns a single map with all entries
|
|
184
|
-
*/
|
|
185
|
-
getTimeInfoEntries(): Map<string, Entry>;
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Returns an object with all known change times for files
|
|
189
|
-
* This include timestamps from files not directly watched
|
|
190
|
-
* Key: absolute path, value: timestamp as number
|
|
191
|
-
* @deprecated
|
|
192
|
-
*/
|
|
193
|
-
getTimes(): {
|
|
194
|
-
[path: string]: number;
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
_fileWatcher(file: string, watcher: Watcher): Watcher;
|
|
198
|
-
|
|
199
|
-
_dirWatcher(item: string, watcher: Watcher): Watcher;
|
|
200
|
-
|
|
201
|
-
_onChange(item: string, mtime: number, file?: string): void;
|
|
202
|
-
|
|
203
|
-
_onTimeout(): void;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
declare namespace Watchpack {
|
|
207
|
-
interface WatcherOptions {
|
|
208
|
-
ignored?: string[] | string | RegExp | ((path: string) => boolean) | undefined;
|
|
209
|
-
poll?: boolean | number | undefined;
|
|
210
|
-
followSymlinks?: boolean;
|
|
211
|
-
}
|
|
212
|
-
interface WatchOptions extends WatcherOptions {
|
|
213
|
-
aggregateTimeout?: number | undefined;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
export { Watchpack as default };
|
|
218
|
-
|
|
1
|
+
import Watchpack = require("./types/index");
|
|
2
|
+
export default Watchpack;
|
|
219
3
|
export type WatchOptions = Watchpack.WatchOptions;
|