@rsbuild/core 2.0.0-rc.4 → 2.0.1

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.
Files changed (33) hide show
  1. package/compiled/css-loader/index.js +2 -2
  2. package/compiled/html-rspack-plugin/index.js +14 -14
  3. package/compiled/http-proxy-middleware/index.d.ts +7 -12
  4. package/compiled/http-proxy-middleware/package.json +1 -1
  5. package/compiled/postcss/index.js +1 -1
  6. package/compiled/postcss/package.json +1 -1
  7. package/compiled/postcss-loader/index.js +6 -6
  8. package/dist/753.js +41 -118
  9. package/dist/http-proxy-middleware.js +30 -7
  10. package/dist/launch-editor-middleware.js +1 -1
  11. package/dist/manifest-plugin.js +6 -6
  12. package/dist/memfs.js +96 -96
  13. package/dist-types/cli/init.d.ts +1 -1
  14. package/dist-types/configChain.d.ts +60 -60
  15. package/dist-types/helpers/format.d.ts +1 -1
  16. package/dist-types/helpers/index.d.ts +1 -1
  17. package/dist-types/helpers/version.d.ts +1 -1
  18. package/dist-types/initConfigs.d.ts +2 -2
  19. package/dist-types/initPlugins.d.ts +1 -1
  20. package/dist-types/inspectConfig.d.ts +1 -1
  21. package/dist-types/loadConfig.d.ts +1 -1
  22. package/dist-types/loadEnv.d.ts +1 -1
  23. package/dist-types/logger.d.ts +1 -1
  24. package/dist-types/pluginManager.d.ts +1 -1
  25. package/dist-types/restart.d.ts +1 -1
  26. package/dist-types/rspack-plugins/resource-hints/doesChunkBelongToHtml.d.ts +1 -1
  27. package/dist-types/rspack-plugins/resource-hints/getResourceType.d.ts +1 -1
  28. package/dist-types/rspackConfig.d.ts +1 -1
  29. package/dist-types/server/cliShortcuts.d.ts +1 -1
  30. package/dist-types/server/gzipMiddleware.d.ts +1 -1
  31. package/dist-types/server/helper.d.ts +2 -1
  32. package/dist-types/server/open.d.ts +1 -1
  33. package/package.json +8 -8
@@ -1,8 +1,8 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 117: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 172: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const { HtmlWebpackChildCompiler } = __nccwpck_require__(438);
5
+ const { HtmlWebpackChildCompiler } = __nccwpck_require__(161);
6
6
  const compilerMap = new WeakMap();
7
7
  class CachedChildCompilation {
8
8
  constructor(compiler) {
@@ -311,7 +311,7 @@
311
311
  }
312
312
  module.exports = { CachedChildCompilation };
313
313
  },
314
- 438: (module) => {
314
+ 161: (module) => {
315
315
  "use strict";
316
316
  class HtmlWebpackChildCompiler {
317
317
  constructor(templates) {
@@ -480,7 +480,7 @@
480
480
  }
481
481
  module.exports = { HtmlWebpackChildCompiler };
482
482
  },
483
- 686: (module) => {
483
+ 807: (module) => {
484
484
  "use strict";
485
485
  module.exports = {};
486
486
  module.exports.none = (chunks) => chunks;
@@ -499,7 +499,7 @@
499
499
  };
500
500
  module.exports.auto = module.exports.none;
501
501
  },
502
- 345: (module) => {
502
+ 50: (module) => {
503
503
  "use strict";
504
504
  module.exports = function (err) {
505
505
  return {
@@ -523,7 +523,7 @@
523
523
  };
524
524
  };
525
525
  },
526
- 72: (module, __unused_webpack_exports, __nccwpck_require__) => {
526
+ 81: (module, __unused_webpack_exports, __nccwpck_require__) => {
527
527
  "use strict";
528
528
  const { AsyncSeriesWaterfallHook } = __nccwpck_require__(159);
529
529
  const htmlWebpackPluginHooksMap = new WeakMap();
@@ -549,7 +549,7 @@
549
549
  }
550
550
  module.exports = { getHtmlRspackPluginHooks };
551
551
  },
552
- 965: (module) => {
552
+ 808: (module) => {
553
553
  const voidTags = [
554
554
  "area",
555
555
  "base",
@@ -617,19 +617,19 @@
617
617
  htmlTagObjectToString,
618
618
  };
619
619
  },
620
- 544: (module, __unused_webpack_exports, __nccwpck_require__) => {
620
+ 61: (module, __unused_webpack_exports, __nccwpck_require__) => {
621
621
  "use strict";
622
622
  const promisify = __nccwpck_require__(23).promisify;
623
623
  const vm = __nccwpck_require__(154);
624
624
  const fs = __nccwpck_require__(896);
625
625
  const path = __nccwpck_require__(928);
626
- const { CachedChildCompilation } = __nccwpck_require__(117);
626
+ const { CachedChildCompilation } = __nccwpck_require__(172);
627
627
  const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
628
- __nccwpck_require__(965);
629
- const prettyError = __nccwpck_require__(345);
630
- const chunkSorter = __nccwpck_require__(686);
628
+ __nccwpck_require__(808);
629
+ const prettyError = __nccwpck_require__(50);
630
+ const chunkSorter = __nccwpck_require__(807);
631
631
  const getHtmlRspackPluginHooks =
632
- __nccwpck_require__(72).getHtmlRspackPluginHooks;
632
+ __nccwpck_require__(81).getHtmlRspackPluginHooks;
633
633
  const WITH_PLACEHOLDER = "function __with_placeholder__";
634
634
  class HtmlRspackPlugin {
635
635
  constructor(userOptions = {}) {
@@ -2398,6 +2398,6 @@
2398
2398
  }
2399
2399
  if (typeof __nccwpck_require__ !== "undefined")
2400
2400
  __nccwpck_require__.ab = __dirname + "/";
2401
- var __webpack_exports__ = __nccwpck_require__(544);
2401
+ var __webpack_exports__ = __nccwpck_require__(61);
2402
2402
  module.exports = __webpack_exports__;
2403
2403
  })();
@@ -10,7 +10,6 @@ import { HttpBindings } from '@hono/node-server';
10
10
  // @ts-ignore
11
11
  import { MiddlewareHandler } from 'hono';
12
12
 
13
- //#region src/types.d.ts
14
13
  interface ProxyTargetDetailed {
15
14
  host?: string;
16
15
  port?: number | string;
@@ -88,15 +87,11 @@ interface ProxyServerOptions {
88
87
  /** Buffer */
89
88
  buffer?: stream.Stream;
90
89
  }
91
- //#endregion
92
- //#region src/middleware/_utils.d.ts
93
90
  type ResOfType<T extends "web" | "ws"> = T extends "ws" ? T extends "web" ? ServerResponse | Http2ServerResponse | Socket : Socket : T extends "web" ? ServerResponse | Http2ServerResponse : never;
94
91
  type ProxyMiddleware<T extends ServerResponse | Http2ServerResponse | Socket> = (req: IncomingMessage | Http2ServerRequest, res: T, opts: ProxyServerOptions & {
95
92
  target: URL | ProxyTargetDetailed;
96
93
  forward: URL;
97
94
  }, server: ProxyServer<IncomingMessage | Http2ServerRequest, ServerResponse | Http2ServerResponse>, head?: Buffer, callback?: (err: any, req: IncomingMessage | Http2ServerRequest, socket: T, url?: any) => void) => void | true;
98
- //#endregion
99
- //#region src/server.d.ts
100
95
  interface ProxyServerEventMap<Req extends http__default.IncomingMessage | http2.Http2ServerRequest = http__default.IncomingMessage, Res extends http__default.ServerResponse | http2.Http2ServerResponse = http__default.ServerResponse> {
101
96
  error: [err: Error, req?: Req, res?: Res | net__default.Socket, target?: URL | ProxyTarget];
102
97
  start: [req: Req, res: Res, target: URL | ProxyTarget];
@@ -126,8 +121,9 @@ declare class ProxyServer<Req extends http__default.IncomingMessage | http2.Http
126
121
  * A function that wraps the object in a webserver, for your convenience
127
122
  * @param port - Port to listen on
128
123
  * @param hostname - The hostname to listen on
124
+ * @param listeningListener - A callback function that is called when the server starts listening
129
125
  */
130
- listen(port: number, hostname?: string): this;
126
+ listen(port: number, hostname?: string, listeningListener?: () => void): this;
131
127
  /**
132
128
  * A function that closes the inner webserver and stops listening on given port
133
129
  */
@@ -164,6 +160,9 @@ interface OnProxyEvent<TReq extends http.IncomingMessage = http.IncomingMessage,
164
160
  econnreset?: (err: Error, req: TReq, res: TRes, target: string | Partial<URL>) => void;
165
161
  }
166
162
  type Logger = Pick<Console, 'info' | 'warn' | 'error'>;
163
+ type PathRewriteConfig<TReq extends http.IncomingMessage = http.IncomingMessage> = {
164
+ [regexp: string]: string;
165
+ } | ((path: string, req: TReq) => string | undefined) | ((path: string, req: TReq) => Promise<string>);
167
166
  interface Options<TReq extends http.IncomingMessage = http.IncomingMessage, TRes extends http.ServerResponse = http.ServerResponse> extends ProxyServerOptions {
168
167
  /**
169
168
  * Narrow down requests to proxy or not.
@@ -185,9 +184,7 @@ interface Options<TReq extends http.IncomingMessage = http.IncomingMessage, TRes
185
184
  * ```
186
185
  * @link https://github.com/chimurai/http-proxy-middleware/blob/master/recipes/pathRewrite.md
187
186
  */
188
- pathRewrite?: {
189
- [regexp: string]: string;
190
- } | ((path: string, req: TReq) => string | undefined) | ((path: string, req: TReq) => Promise<string>);
187
+ pathRewrite?: PathRewriteConfig<TReq>;
191
188
  /**
192
189
  * Access the internal http-proxy server instance to customize behavior
193
190
  *
@@ -242,9 +239,7 @@ interface Options<TReq extends http.IncomingMessage = http.IncomingMessage, TRes
242
239
  * ```
243
240
  * @link https://github.com/chimurai/http-proxy-middleware/blob/master/recipes/router.md
244
241
  */
245
- router?: {
246
- [hostOrPath: string]: ProxyServerOptions['target'];
247
- } | ((req: TReq) => ProxyServerOptions['target']) | ((req: TReq) => Promise<ProxyServerOptions['target']>);
242
+ router?: Record<string, ProxyServerOptions['target']> | ((req: TReq) => ProxyServerOptions['target']) | ((req: TReq) => Promise<ProxyServerOptions['target']>);
248
243
  /**
249
244
  * Log information from http-proxy-middleware
250
245
  * @example
@@ -1 +1 @@
1
- {"name":"http-proxy-middleware","author":"Steven Chim","version":"4.0.0-beta.3","license":"MIT","types":"index.d.ts","type":"module"}
1
+ {"name":"http-proxy-middleware","author":"Steven Chim","version":"4.0.0-beta.4","license":"MIT","types":"index.d.ts","type":"module"}