From a527200b7b919094de256425946aac2cbc45eeb9 Mon Sep 17 00:00:00 2001 From: fi3ework Date: Mon, 18 Nov 2024 15:12:57 +0800 Subject: [PATCH 1/2] fix: add tsdoc for config options --- packages/core/src/types/config/index.ts | 43 ++++++++++++++++--------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/packages/core/src/types/config/index.ts b/packages/core/src/types/config/index.ts index c312e365f..592aa3a99 100644 --- a/packages/core/src/types/config/index.ts +++ b/packages/core/src/types/config/index.ts @@ -80,59 +80,67 @@ export type Redirect = { export interface LibConfig extends RsbuildConfig { /** * The unique identifier of the library. - * @default undefined + * @defaultValue `undefined` */ id?: string; /** * Output format for the generated JavaScript files. - * @default undefined + * @defaultValue `undefined` + * @see {@link https://lib.rsbuild.dev/config/lib/format} */ format?: Format; /** * Whether to bundle the library. - * @default true + * @defaultValue `true` + * @see {@link https://lib.rsbuild.dev/config/lib/bundle} */ bundle?: boolean; /** - * Whether to automatically set the file extension based on the `format` option in the JavaScript output files. - * @default true + * Whether to automatically set the file extension based on {@link format} option in the JavaScript output files. + * @defaultValue `true` + * @see {@link https://lib.rsbuild.dev/config/lib/auto-extension} */ autoExtension?: boolean; /** * Whether to automatically externalize dependencies of different dependency types and do not bundle them. - * @default true + * @defaultValue `true` + * @see {@link https://lib.rsbuild.dev/config/lib/auto-external} */ autoExternal?: AutoExternal; /** - * Configure the redirect of the import paths, applicable when `bundle: false`. - * @default {} + * Configure the redirect of the import paths, applicable {@link bundle} is set to `false`. + * @defaultValue `{}` + * @see {@link https://lib.rsbuild.dev/config/lib/redirect} */ redirect?: Redirect; /** * Configure the syntax to which JavaScript and CSS will be downgraded. - * Support ECMAScript version and browserslist query. - * @default 'esnext' + * @defaultValue `'esnext'` + * @see {@link https://lib.rsbuild.dev/config/lib/syntax} */ syntax?: Syntax; /** * Whether to import SWC helper functions from `@swc/helpers` instead of inlining them. - * @default false + * @defaultValue `false` + * @see {@link https://lib.rsbuild.dev/config/lib/external-helpers} */ externalHelpers?: boolean; /** * Inject content into the top of each JS, CSS or DTS file. - * @default {} + * @defaultValue `{}` + * @see {@link https://lib.rsbuild.dev/config/lib/banner} */ banner?: BannerAndFooter; /** * Inject content into the bottom of each JS, CSS or DTS file. - * @default {} + * @defaultValue `{}` + * @see {@link https://lib.rsbuild.dev/config/lib/footer} */ footer?: BannerAndFooter; /** * Configure the shims for CommonJS and ESM output. * - * @default + * @defaultValue * ```js * const defaultShims = { * cjs: { @@ -145,16 +153,19 @@ export interface LibConfig extends RsbuildConfig { * }, * }; * ``` + * @see {@link https://lib.rsbuild.dev/config/lib/shims} */ shims?: Shims; /** * Configure the generation of the TypeScript declaration files. - * @default false + * @defaultValue `false` + * @see {@link https://lib.rsbuild.dev/config/lib/dts} */ dts?: Dts; /** * The export name of the UMD bundle. - * @default undefined + * @defaultValue `undefined` + * @see {@link https://lib.rsbuild.dev/config/lib/umd-name} */ umdName?: string; } From e74400498b883de1f2d9ae42f70115bb3ae942e3 Mon Sep 17 00:00:00 2001 From: Wei Date: Mon, 18 Nov 2024 15:37:56 +0800 Subject: [PATCH 2/2] Update packages/core/src/types/config/index.ts Co-authored-by: Timeless0911 <50201324+Timeless0911@users.noreply.github.com> --- packages/core/src/types/config/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/core/src/types/config/index.ts b/packages/core/src/types/config/index.ts index 592aa3a99..e9eb95408 100644 --- a/packages/core/src/types/config/index.ts +++ b/packages/core/src/types/config/index.ts @@ -81,6 +81,7 @@ export interface LibConfig extends RsbuildConfig { /** * The unique identifier of the library. * @defaultValue `undefined` + * @see {@link https://lib.rsbuild.dev/config/lib/id} */ id?: string; /**