@rspack-canary/browser 1.6.3-canary-e52c63da-20251113070149 → 1.6.4-canary-a85877a5-20251114174101

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.
@@ -7,6 +7,10 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack-dev-server/blob/master/LICENSE
9
9
  */
10
+ import type http from "http";
11
+ import type net from "net";
12
+ import type stream from "stream";
13
+ import type url from "url";
10
14
  import type { Compiler, LiteralUnion, MultiCompiler, MultiStats, Stats, Watching } from "..";
11
15
  type Logger = ReturnType<Compiler["getInfrastructureLogger"]>;
12
16
  type MultiWatching = MultiCompiler["watch"];
@@ -126,9 +130,7 @@ type ProxyConfigArrayItem = {
126
130
  context?: HttpProxyMiddlewareOptionsFilter;
127
131
  } & {
128
132
  bypass?: ByPass;
129
- } & {
130
- [key: string]: any;
131
- };
133
+ } & HttpProxyMiddlewareOptions;
132
134
  type ByPass = (req: Request, res: Response, proxyConfig: ProxyConfigArrayItem) => any;
133
135
  type ProxyConfigArray = (ProxyConfigArrayItem | ((req?: Request, res?: Response, next?: NextFunction) => ProxyConfigArrayItem))[];
134
136
  type Callback = (stats?: Stats | MultiStats) => any;
@@ -203,4 +205,110 @@ export type DevServerOptions<A extends BasicApplication = BasicApplication, S ex
203
205
  onListening?: ((devServer: Server) => void) | undefined;
204
206
  setupMiddlewares?: ((middlewares: Middleware[], devServer: Server) => Middleware[]) | undefined;
205
207
  };
208
+ interface HttpProxyMiddlewareOptions extends HttpProxyServerOptions {
209
+ pathRewrite?: {
210
+ [regexp: string]: string;
211
+ } | ((path: string, req: Request) => string) | ((path: string, req: Request) => Promise<string>);
212
+ router?: {
213
+ [hostOrPath: string]: HttpProxyServerOptions["target"];
214
+ } | ((req: Request) => HttpProxyServerOptions["target"]) | ((req: Request) => Promise<HttpProxyServerOptions["target"]>);
215
+ logLevel?: "debug" | "info" | "warn" | "error" | "silent";
216
+ logProvider?: LogProviderCallback;
217
+ onError?: OnErrorCallback;
218
+ onProxyRes?: OnProxyResCallback;
219
+ onProxyReq?: OnProxyReqCallback;
220
+ onProxyReqWs?: OnProxyReqWsCallback;
221
+ onOpen?: OnOpenCallback;
222
+ onClose?: OnCloseCallback;
223
+ }
224
+ interface LogProvider {
225
+ log: Logger;
226
+ debug?: Logger;
227
+ info?: Logger;
228
+ warn?: Logger;
229
+ error?: Logger;
230
+ }
231
+ type LogProviderCallback = (provider: LogProvider) => LogProvider;
232
+ type OnErrorCallback = (err: Error, req: Request, res: Response, target?: string | Partial<url.Url>) => void;
233
+ type OnProxyResCallback = (proxyRes: http.IncomingMessage, req: Request, res: Response) => void;
234
+ type OnProxyReqCallback = (proxyReq: http.ClientRequest, req: Request, res: Response, options: HttpProxyServerOptions) => void;
235
+ type OnProxyReqWsCallback = (proxyReq: http.ClientRequest, req: Request, socket: net.Socket, options: HttpProxyServerOptions, head: any) => void;
236
+ type OnCloseCallback = (proxyRes: Response, proxySocket: net.Socket, proxyHead: any) => void;
237
+ type OnOpenCallback = (proxySocket: net.Socket) => void;
238
+ interface HttpProxyServerOptions {
239
+ /** URL string to be parsed with the url module. */
240
+ target?: HttpProxyTarget | undefined;
241
+ /** URL string to be parsed with the url module. */
242
+ forward?: HttpProxyTargetUrl | undefined;
243
+ /** Object to be passed to http(s).request. */
244
+ agent?: any;
245
+ /** Object to be passed to https.createServer(). */
246
+ ssl?: any;
247
+ /** If you want to proxy websockets. */
248
+ ws?: boolean | undefined;
249
+ /** Adds x- forward headers. */
250
+ xfwd?: boolean | undefined;
251
+ /** Verify SSL certificate. */
252
+ secure?: boolean | undefined;
253
+ /** Explicitly specify if we are proxying to another proxy. */
254
+ toProxy?: boolean | undefined;
255
+ /** Specify whether you want to prepend the target's path to the proxy path. */
256
+ prependPath?: boolean | undefined;
257
+ /** Specify whether you want to ignore the proxy path of the incoming request. */
258
+ ignorePath?: boolean | undefined;
259
+ /** Local interface string to bind for outgoing connections. */
260
+ localAddress?: string | undefined;
261
+ /** Changes the origin of the host header to the target URL. */
262
+ changeOrigin?: boolean | undefined;
263
+ /** specify whether you want to keep letter case of response header key */
264
+ preserveHeaderKeyCase?: boolean | undefined;
265
+ /** Basic authentication i.e. 'user:password' to compute an Authorization header. */
266
+ auth?: string | undefined;
267
+ /** Rewrites the location hostname on (301 / 302 / 307 / 308) redirects, Default: null. */
268
+ hostRewrite?: string | undefined;
269
+ /** Rewrites the location host/ port on (301 / 302 / 307 / 308) redirects based on requested host/ port.Default: false. */
270
+ autoRewrite?: boolean | undefined;
271
+ /** Rewrites the location protocol on (301 / 302 / 307 / 308) redirects to 'http' or 'https'.Default: null. */
272
+ protocolRewrite?: string | undefined;
273
+ /** rewrites domain of set-cookie headers. */
274
+ cookieDomainRewrite?: false | string | {
275
+ [oldDomain: string]: string;
276
+ } | undefined;
277
+ /** rewrites path of set-cookie headers. Default: false */
278
+ cookiePathRewrite?: false | string | {
279
+ [oldPath: string]: string;
280
+ } | undefined;
281
+ /** object with extra headers to be added to target requests. */
282
+ headers?: {
283
+ [header: string]: string;
284
+ } | undefined;
285
+ /** Timeout (in milliseconds) when proxy receives no response from target. Default: 120000 (2 minutes) */
286
+ proxyTimeout?: number | undefined;
287
+ /** Timeout (in milliseconds) for incoming requests */
288
+ timeout?: number | undefined;
289
+ /** Specify whether you want to follow redirects. Default: false */
290
+ followRedirects?: boolean | undefined;
291
+ /** If set to true, none of the webOutgoing passes are called and it's your responsibility to appropriately return the response by listening and acting on the proxyRes event */
292
+ selfHandleResponse?: boolean | undefined;
293
+ /** Buffer */
294
+ buffer?: stream.Stream | undefined;
295
+ /** Explicitly set the method type of the ProxyReq */
296
+ method?: string | undefined;
297
+ }
298
+ interface HttpProxyTargetDetailed {
299
+ host: string;
300
+ port: number;
301
+ protocol?: string | undefined;
302
+ hostname?: string | undefined;
303
+ socketPath?: string | undefined;
304
+ key?: string | undefined;
305
+ passphrase?: string | undefined;
306
+ pfx?: Buffer | string | undefined;
307
+ cert?: string | undefined;
308
+ ca?: string | undefined;
309
+ ciphers?: string | undefined;
310
+ secureProtocol?: string | undefined;
311
+ }
312
+ type HttpProxyTarget = HttpProxyTargetUrl | HttpProxyTargetDetailed;
313
+ type HttpProxyTargetUrl = string | Partial<url.Url>;
206
314
  export {};
package/dist/index.mjs CHANGED
@@ -58126,7 +58126,7 @@ const applybundlerInfoDefaults = (rspackFuture, library)=>{
58126
58126
  if ("object" == typeof rspackFuture) {
58127
58127
  D(rspackFuture, "bundlerInfo", {});
58128
58128
  if ("object" == typeof rspackFuture.bundlerInfo) {
58129
- D(rspackFuture.bundlerInfo, "version", "1.6.3-canary-e52c63da-20251113070149");
58129
+ D(rspackFuture.bundlerInfo, "version", "1.6.4-canary-a85877a5-20251114174101");
58130
58130
  D(rspackFuture.bundlerInfo, "bundler", "rspack");
58131
58131
  D(rspackFuture.bundlerInfo, "force", !library);
58132
58132
  }
@@ -62075,7 +62075,7 @@ class MultiStats {
62075
62075
  return obj;
62076
62076
  });
62077
62077
  if (childOptions.version) {
62078
- obj.rspackVersion = "1.6.3-canary-e52c63da-20251113070149";
62078
+ obj.rspackVersion = "1.6.4-canary-a85877a5-20251114174101";
62079
62079
  obj.version = "5.75.0";
62080
62080
  }
62081
62081
  if (childOptions.hash) obj.hash = obj.children.map((j)=>j.hash).join("");
@@ -63380,7 +63380,7 @@ const SIMPLE_EXTRACTORS = {
63380
63380
  },
63381
63381
  version: (object)=>{
63382
63382
  object.version = "5.75.0";
63383
- object.rspackVersion = "1.6.3-canary-e52c63da-20251113070149";
63383
+ object.rspackVersion = "1.6.4-canary-a85877a5-20251114174101";
63384
63384
  },
63385
63385
  env: (object, _compilation, _context, { _env })=>{
63386
63386
  object.env = _env;
@@ -66517,7 +66517,7 @@ function transformSync(source, options) {
66517
66517
  const _options = JSON.stringify(options || {});
66518
66518
  return external_rspack_wasi_browser_js_["default"].transformSync(source, _options);
66519
66519
  }
66520
- const exports_rspackVersion = "1.6.3-canary-e52c63da-20251113070149";
66520
+ const exports_rspackVersion = "1.6.4-canary-a85877a5-20251114174101";
66521
66521
  const exports_version = "5.75.0";
66522
66522
  const exports_WebpackError = Error;
66523
66523
  const sources = __webpack_require__("../../node_modules/.pnpm/webpack-sources@3.3.3_patch_hash=b2a26650f08a2359d0a3cd81fa6fa272aa7441a28dd7e601792da5ed5d2b4aee/node_modules/webpack-sources/lib/index.js");
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack-canary/browser",
3
- "version": "1.6.3-canary-e52c63da-20251113070149",
3
+ "version": "1.6.4-canary-a85877a5-20251114174101",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "Rspack for running in the browser. This is still in early stage and may not follow the semver.",