@lynx-js/config-rsbuild-plugin-canary 0.0.0 → 0.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,23 @@
1
+ # @lynx-js/config-rsbuild-plugin
2
+
3
+ ## 0.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Init `@lynx-js/config-rsbuild-plugin` for configuring Lynx Configs that are not exposed by DSL plugins. ([#2052](https://github.com/lynx-family/lynx-stack/pull/2052))
8
+
9
+ For example:
10
+
11
+ ```ts
12
+ // lynx.config.ts
13
+ import { pluginLynxConfig } from '@lynx-js/config-rsbuild-plugin'
14
+ import { defineConfig } from '@lynx-js/rspeedy'
15
+
16
+ export default defineConfig({
17
+ plugins: [
18
+ pluginLynxConfig({
19
+ enableCheckExposureOptimize: false,
20
+ }),
21
+ ],
22
+ })
23
+ ```
package/README.md ADDED
@@ -0,0 +1,42 @@
1
+ <p align="center">
2
+ <a href="https://lynxjs.org/rspeedy" target="blank"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/rspeedy-banner.png" alt="Rspeedy Logo" /></a>
3
+ </p>
4
+
5
+ <p>
6
+ <a aria-label="NPM version" href="https://www.npmjs.com/package/@lynx-js/config-rsbuild-plugin">
7
+ <img alt="" src="https://img.shields.io/npm/v/@lynx-js/config-rsbuild-plugin?logo=npm">
8
+ </a>
9
+ <a aria-label="License" href="https://www.npmjs.com/package/@lynx-js/config-rsbuild-plugin">
10
+ <img src="https://img.shields.io/badge/License-Apache--2.0-blue" alt="license" />
11
+ </a>
12
+ </p>
13
+
14
+ ## Getting Started
15
+
16
+ ```bash
17
+ npm install -D @lynx-js/config-rsbuild-plugin
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ ```ts
23
+ // lynx.config.ts
24
+ import { pluginLynxConfig } from '@lynx-js/config-rsbuild-plugin'
25
+ import { defineConfig } from '@lynx-js/rspeedy'
26
+
27
+ export default defineConfig({
28
+ plugins: [
29
+ pluginLynxConfig({
30
+ enableCheckExposureOptimize: false,
31
+ }),
32
+ ],
33
+ })
34
+ ```
35
+
36
+ ## Contributing
37
+
38
+ Contributions to Rspeedy are welcome and highly appreciated. However, before you jump right into it, we would like you to review our [Contribution Guidelines](/CONTRIBUTING.md) to make sure you have a smooth experience contributing to this project.
39
+
40
+ ## License
41
+
42
+ Rspeedy is Apache-2.0 licensed.
@@ -0,0 +1,96 @@
1
+ /**
2
+ * @packageDocumentation
3
+ *
4
+ * An rsbuild plugin for config Lynx Config defined by `@lynx-js/type-config`.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * import { pluginLynxConfig } from '@lynx-js/config-rsbuild-plugin'
9
+ * import { defineConfig } from '@lynx-js/rspeedy'
10
+ *
11
+ * export default defineConfig({
12
+ * plugins: [
13
+ * pluginLynxConfig({
14
+ * enableCheckExposureOptimize: false,
15
+ * }),
16
+ * ],
17
+ * })
18
+ * ```
19
+ */
20
+
21
+ import type { CompilerOptions } from '@lynx-js/type-config';
22
+ import type { Config as Config_2 } from '@lynx-js/type-config';
23
+ import type { RsbuildPlugin } from '@lynx-js/rspeedy';
24
+
25
+ /**
26
+ * A configuration interface for Lynx Config defined by `@lynx-js/type-config`.
27
+ *
28
+ * See all available options in {@link https://lynxjs.org/next/api/lynx-config/config-reference.html}.
29
+ *
30
+ * @public
31
+ */
32
+ export declare interface Config extends Config_2, CompilerOptions {
33
+ }
34
+
35
+ /**
36
+ * Options for the Lynx Config rsbuild plugin.
37
+ *
38
+ * @public
39
+ */
40
+ export declare interface Options {
41
+ /**
42
+ * The keys of compiler options to set.
43
+ */
44
+ compilerOptionsKeys?: string[];
45
+ /**
46
+ * The keys of config options to set.
47
+ */
48
+ configKeys?: string[];
49
+ /**
50
+ * Custom validation function for the Lynx config.
51
+ *
52
+ * @param input - The input to validate.
53
+ * @returns The validated Lynx config.
54
+ */
55
+ validate?: (input: unknown) => Config;
56
+ /**
57
+ * A map from DSL plugin name to its package name.
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * {
62
+ * 'lynx:react': '@lynx-js/react-rsbuild-plugin',
63
+ * }
64
+ * ```
65
+ */
66
+ dslPluginName2PkgName?: Record<string, string>;
67
+ /**
68
+ * The link to upgrade Rspeedy.
69
+ */
70
+ upgradeRspeedyLink?: string;
71
+ }
72
+
73
+ /**
74
+ * An rsbuild plugin for config Lynx Config defined by `@lynx-js/type-config`.
75
+ *
76
+ * @param config - The Lynx config to set.
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * import { pluginLynxConfig } from '@lynx-js/config-rsbuild-plugin'
81
+ * import { defineConfig } from '@lynx-js/rspeedy'
82
+ *
83
+ * export default defineConfig({
84
+ * plugins: [
85
+ * pluginLynxConfig({
86
+ * enableCheckExposureOptimize: false,
87
+ * }),
88
+ * ],
89
+ * })
90
+ * ```
91
+ *
92
+ * @public
93
+ */
94
+ export declare function pluginLynxConfig(config: Config, options?: Options): RsbuildPlugin;
95
+
96
+ export { }