@lynx-js/rspeedy 0.8.3 → 0.8.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @lynx-js/rspeedy
2
2
 
3
+ ## 0.8.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Bump Rsbuild v1.2.19 with Rspack v1.2.8 ([#168](https://github.com/lynx-family/lynx-stack/pull/168))
8
+
9
+ - Add `mergeRspeedyConfig` function for merging multiple Rspeedy configuration object. ([#169](https://github.com/lynx-family/lynx-stack/pull/169))
10
+
11
+ - Bump Rsdoctor v1.0.0-rc.0 ([#186](https://github.com/lynx-family/lynx-stack/pull/186))
12
+
13
+ - Support configure the base path of the server. ([#196](https://github.com/lynx-family/lynx-stack/pull/196))
14
+
15
+ By default, the base path of the server is `/`, and users can access lynx bundle through `http://<host>:<port>/main.lynx.bundle`
16
+ If you want to access lynx bundle through `http://<host>:<port>/foo/main.lynx.bundle`, you can change `server.base` to `/foo`
17
+
18
+ example:
19
+
20
+ ```js
21
+ import { defineConfig } from '@lynx-js/rspeedy'
22
+ export default defineConfig({
23
+ server: {
24
+ base: '/dist',
25
+ },
26
+ })
27
+ ```
28
+
29
+ - Updated dependencies [[`b026c8b`](https://github.com/lynx-family/lynx-stack/commit/b026c8bdcbf7bdcda73e170477297213b447d876)]:
30
+ - @lynx-js/webpack-dev-transport@0.1.2
31
+
3
32
  ## 0.8.3
4
33
 
5
34
  ### Patch Changes
@@ -0,0 +1,36 @@
1
+ import type { Config } from './index.js';
2
+ /**
3
+ * Merge multiple Rspeedy configuration objects.
4
+ *
5
+ * @param configs - The Rspeedy configuration objects to merge.
6
+ *
7
+ * @returns The merged Rspeedy configuration object.
8
+ *
9
+ * @example
10
+ *
11
+ * ```ts
12
+ * import { mergeRspeedyConfig } from '@lynx-js/rspeedy';
13
+ *
14
+ * const config1 = {
15
+ * dev: {
16
+ * writeToDisk: false,
17
+ * },
18
+ * };
19
+ * const config2 = {
20
+ * dev: {
21
+ * writeToDisk: true,
22
+ * },
23
+ * };
24
+ *
25
+ * const mergedConfig = mergeRspeedyConfig(config1, config2);
26
+ *
27
+ * console.log(mergedConfig); // { dev: { writeToDisk: true } }
28
+ * ```
29
+ *
30
+ * @remarks
31
+ *
32
+ * This is actually an alias of {@link https://rsbuild.dev/api/javascript-api/core#mergersbuildconfig | mergeRsbuildConfig}.
33
+ *
34
+ * @public
35
+ */
36
+ export declare function mergeRspeedyConfig(...configs: Config[]): Config;
@@ -0,0 +1,42 @@
1
+ // Copyright 2024 The Lynx Authors. All rights reserved.
2
+ // Licensed under the Apache License Version 2.0 that can be found in the
3
+ // LICENSE file in the root directory of this source tree.
4
+ import { mergeRsbuildConfig } from '@rsbuild/core';
5
+ /**
6
+ * Merge multiple Rspeedy configuration objects.
7
+ *
8
+ * @param configs - The Rspeedy configuration objects to merge.
9
+ *
10
+ * @returns The merged Rspeedy configuration object.
11
+ *
12
+ * @example
13
+ *
14
+ * ```ts
15
+ * import { mergeRspeedyConfig } from '@lynx-js/rspeedy';
16
+ *
17
+ * const config1 = {
18
+ * dev: {
19
+ * writeToDisk: false,
20
+ * },
21
+ * };
22
+ * const config2 = {
23
+ * dev: {
24
+ * writeToDisk: true,
25
+ * },
26
+ * };
27
+ *
28
+ * const mergedConfig = mergeRspeedyConfig(config1, config2);
29
+ *
30
+ * console.log(mergedConfig); // { dev: { writeToDisk: true } }
31
+ * ```
32
+ *
33
+ * @remarks
34
+ *
35
+ * This is actually an alias of {@link https://rsbuild.dev/api/javascript-api/core#mergersbuildconfig | mergeRsbuildConfig}.
36
+ *
37
+ * @public
38
+ */
39
+ export function mergeRspeedyConfig(...configs) {
40
+ return mergeRsbuildConfig(...configs);
41
+ }
42
+ //# sourceMappingURL=mergeRspeedyConfig.js.map
@@ -40,6 +40,7 @@ export function toRsbuildConfig(config) {
40
40
  tsconfigPath: config.source?.tsconfigPath,
41
41
  },
42
42
  server: {
43
+ base: config.server?.base,
43
44
  headers: config.server?.headers,
44
45
  host: config.server?.host,
45
46
  port: config.server?.port,
@@ -3,6 +3,28 @@
3
3
  * @public
4
4
  */
5
5
  export interface Server {
6
+ /**
7
+ * Configure the base path of the server.
8
+ *
9
+ * @remarks
10
+ * By default, the base path of the server is `/`, and users can access lynx bundle through `http://<host>:<port>/main.lynx.bundle`
11
+ *
12
+ * If you want to access lynx bundle through `http://<host>:<port>/foo/main.lynx.bundle`, you can change `server.base` to `/foo`
13
+ *
14
+ * you can refer to {@link https://rsbuild.dev/config/server/base | server.base } for more information.
15
+ *
16
+ * @example
17
+ *
18
+ * ```js
19
+ * import { defineConfig } from '@lynx-js/rspeedy'
20
+ * export default defineConfig({
21
+ * server: {
22
+ * base: '/dist'
23
+ * },
24
+ * })
25
+ * ```
26
+ */
27
+ base?: string | undefined;
6
28
  /**
7
29
  * Adds headers to all responses.
8
30
  *