Skip to content

docs(rspeedy): document config default values#2448

Merged
colinaaa merged 4 commits intolynx-family:mainfrom
colinaaa:docs/rspeedy-default-values
Apr 11, 2026
Merged

docs(rspeedy): document config default values#2448
colinaaa merged 4 commits intolynx-family:mainfrom
colinaaa:docs/rspeedy-default-values

Conversation

@colinaaa
Copy link
Copy Markdown
Collaborator

@colinaaa colinaaa commented Apr 11, 2026

Summary

  • add @defaultValue annotations across packages/rspeedy/core/src/config/** and migrate default-related @remarks into the generated API reference
  • clarify which defaults come from Rspeedy itself versus downstream Rsbuild behavior so generated docs do not overstate runtime guarantees
  • add .github/rspeedy-config-docs.instructions.md to keep future config docs aligned with this pattern

Verification

  • pnpm install
  • pnpm build --clean && pnpm build
  • pnpm turbo api-extractor --filter=@lynx-js/rspeedy -- --local
  • cd website && npm run docs
  • confirmed generated API pages such as website/docs/en/api/rspeedy.config.mode.md, website/docs/en/api/rspeedy.output.inlinescripts.md, and website/docs/en/api/rspeedy.configparams.command.md include ## Default Value

Summary by CodeRabbit

  • Documentation
    • Added a documentation instruction for how configuration defaults should be recorded.
    • Updated configuration reference to explicitly document default values across dev, output, server, source, tools, resolve, and performance sections (including CSS, build cache, chunk-splitting, and source/tool defaults).
    • Added a changeset placeholder file.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 11, 2026

🦋 Changeset detected

Latest commit: e11f89c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bdf1b41e-2991-4ce1-93fc-4110e3434861

📥 Commits

Reviewing files that changed from the base of the PR and between 4ed7052 and e11f89c.

📒 Files selected for processing (1)
  • .changeset/crazy-women-raise.md
✅ Files skipped from review due to trivial changes (1)
  • .changeset/crazy-women-raise.md

📝 Walkthrough

Walkthrough

This PR adds explicit JSDoc @defaultValue annotations across many rspeedy configuration interfaces, introduces a docs instruction file enforcing @defaultValue usage for config options, and removes some prior inline "undocumented"/remarks default lines. No TypeScript signatures or runtime behavior were changed.

Changes

Cohort / File(s) Summary
Configuration Guidelines
​.github/rspeedy-config-docs.instructions.md
New documentation rule requiring @defaultValue tags for configuration option defaults and verification against implementation or upstream Rsbuild behavior.
API metadata
packages/rspeedy/core/etc/rspeedy.api.md
Removed // (undocumented) markers from LoadConfigOptions properties configPath and cwd.
Core config interfaces
packages/rspeedy/core/src/config/defineConfig.ts, packages/rspeedy/core/src/config/index.ts, packages/rspeedy/core/src/config/loadConfig.ts
Added @defaultValue JSDoc for ConfigParams.env/command, Config top-level options, and LoadConfigOptions.configPath/cwd.
Dev config
packages/rspeedy/core/src/config/dev/client.ts, packages/rspeedy/core/src/config/dev/index.ts
Replaced remarks with @defaultValue annotations for Client.websocketTransport, Dev.assetPrefix, client, hmr, liveReload, watchFiles, writeToDisk, and progressBar (docs only).
Output config
packages/rspeedy/core/src/config/output/...
css-modules.ts, dist-path.ts, filename.ts, index.ts, minify.ts, source-map.ts
Consolidated multi-line remarks into @defaultValue tags for CSS modules, dist paths, filename defaults, minify and source-map options (documentation-only changes).
Performance config
packages/rspeedy/core/src/config/performance/...
build-cache.ts, chunk-split.ts, index.ts
Added @defaultValue annotations for build cache dependencies, chunk split defaults/overrides, and performance options (buildCache, chunkSplit, profile, removeConsole, printFileSize).
Resolve config
packages/rspeedy/core/src/config/resolve/index.ts
Added @defaultValue for alias, aliasStrategy ('prefer-tsconfig'), dedupe, and extensions (docs only).
Server config
packages/rspeedy/core/src/config/server/index.ts
Added @defaultValue tags and clarified host/port/strictPort/default semantics in server option docs (no type changes).
Source config
packages/rspeedy/core/src/config/source/...
decorators.ts, entry.ts, index.ts, transformImport.ts
Added @defaultValue annotations (e.g., decorators version: '2022-03', tsconfigPath './tsconfig.json') and removed redundant remarks about fallback values.
Tools / loaders
packages/rspeedy/core/src/config/tools/...
css-extract.ts, css-loader.ts, index.ts
Added @defaultValue metadata for css-extract, css-loader defaults (importLoaders breakdown, modules defaults) and tools options (bundlerChain, cssExtract, rsdoctor, rspack, swc).
Changeset
.changeset/crazy-women-raise.md
Added an empty changeset markdown file (frontmatter only).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

Suggested reviewers

  • upupming
  • luhc228

Poem

🐰 I hopped through docs with tiny paws,
Tagging defaults and fixing flaws.
@defaultValue in tidy rows,
So config gardens better grow —
A little hop, a joyful cause! 🌱

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding @defaultValue documentation annotations across the rspeedy config files to document default values.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/rspeedy/core/src/config/output/filename.ts (1)

67-75: ⚠️ Potential issue | 🟡 Minor

template placeholder docs are missing [platform].
@defaultValue uses '[name].[platform].bundle', but the supported-placeholder list does not include [platform]. Please add it (or adjust the default string).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/rspeedy/core/src/config/output/filename.ts` around lines 67 - 75,
The documentation for the output filename template is inconsistent: the
`@defaultValue` lists '[name].[platform].bundle' but the supported-placeholder
list only mentions [name] and [contenthash]; update the docs for the template
option (in filename.ts) to include the [platform] placeholder in the supported
list — or alternatively change the `@defaultValue` to remove [platform] if that
placeholder isn't supported — and ensure the README/comment block for the
template field explicitly documents [platform] alongside [name] and
[contenthash].
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/rspeedy/core/src/config/output/dist-path.ts`:
- Around line 18-21: Update the JSDoc for the deprecated intermediate option in
dist-path.ts so it clearly states that the `@defaultValue` '.rspeedy' is
historical only and has no runtime effect; locate the comment block that
documents the intermediate option (symbol name "intermediate") and append a
short sentence like "This is legacy/historical and is never read at runtime, so
it has no effect on Rspeedy's behavior." to the existing description.

In `@packages/rspeedy/core/src/config/performance/build-cache.ts`:
- Line 46: Update the JSDoc on the performance.buildCache option so the
`@defaultValue` contains only the base array (['package.json', 'tsconfig.json' or
source.tsconfigPath, '.env', '.env.*', 'tailwindcss.config.*']) and remove the
CLI-specific sentence; then add a `@remarks` block (or extend existing `@remarks`)
that documents the CLI augmentation — i.e., that when using the Rspeedy CLI with
performance.buildCache enabled the loaded lynx.config.* file is also added.
Target the JSDoc surrounding the performance.buildCache symbol in build-cache.ts
and ensure the `@defaultValue` and `@remarks` reflect this split.

---

Outside diff comments:
In `@packages/rspeedy/core/src/config/output/filename.ts`:
- Around line 67-75: The documentation for the output filename template is
inconsistent: the `@defaultValue` lists '[name].[platform].bundle' but the
supported-placeholder list only mentions [name] and [contenthash]; update the
docs for the template option (in filename.ts) to include the [platform]
placeholder in the supported list — or alternatively change the `@defaultValue` to
remove [platform] if that placeholder isn't supported — and ensure the
README/comment block for the template field explicitly documents [platform]
alongside [name] and [contenthash].
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: da8e5fc0-3a7b-42f4-ae36-aa96bb0af157

📥 Commits

Reviewing files that changed from the base of the PR and between 74b2b48 and 4ed7052.

📒 Files selected for processing (25)
  • .github/rspeedy-config-docs.instructions.md
  • packages/rspeedy/core/etc/rspeedy.api.md
  • packages/rspeedy/core/src/config/defineConfig.ts
  • packages/rspeedy/core/src/config/dev/client.ts
  • packages/rspeedy/core/src/config/dev/index.ts
  • packages/rspeedy/core/src/config/index.ts
  • packages/rspeedy/core/src/config/loadConfig.ts
  • packages/rspeedy/core/src/config/output/css-modules.ts
  • packages/rspeedy/core/src/config/output/dist-path.ts
  • packages/rspeedy/core/src/config/output/filename.ts
  • packages/rspeedy/core/src/config/output/index.ts
  • packages/rspeedy/core/src/config/output/minify.ts
  • packages/rspeedy/core/src/config/output/source-map.ts
  • packages/rspeedy/core/src/config/performance/build-cache.ts
  • packages/rspeedy/core/src/config/performance/chunk-split.ts
  • packages/rspeedy/core/src/config/performance/index.ts
  • packages/rspeedy/core/src/config/resolve/index.ts
  • packages/rspeedy/core/src/config/server/index.ts
  • packages/rspeedy/core/src/config/source/decorators.ts
  • packages/rspeedy/core/src/config/source/entry.ts
  • packages/rspeedy/core/src/config/source/index.ts
  • packages/rspeedy/core/src/config/source/transformImport.ts
  • packages/rspeedy/core/src/config/tools/css-extract.ts
  • packages/rspeedy/core/src/config/tools/css-loader.ts
  • packages/rspeedy/core/src/config/tools/index.ts
💤 Files with no reviewable changes (1)
  • packages/rspeedy/core/etc/rspeedy.api.md

Comment on lines 18 to 21
* This option is never read and will be removed in the future version.
*
* @remarks
*
* Default value:
*
* - `'.rspeedy'`
* @defaultValue `'.rspeedy'`
*/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Clarify runtime effect for deprecated intermediate default.
Since the option is “never read,” presenting @defaultValue '.rspeedy' alone can imply active behavior. Please append a short clarification that this is legacy/historical and has no runtime effect in Rspeedy.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/rspeedy/core/src/config/output/dist-path.ts` around lines 18 - 21,
Update the JSDoc for the deprecated intermediate option in dist-path.ts so it
clearly states that the `@defaultValue` '.rspeedy' is historical only and has no
runtime effect; locate the comment block that documents the intermediate option
(symbol name "intermediate") and append a short sentence like "This is
legacy/historical and is never read at runtime, so it has no effect on Rspeedy's
behavior." to the existing description.

*
* When using Rspeedy CLI, it will also automatically add
* `lynx.config.js` to the build dependencies.
* @defaultValue `['package.json', 'tsconfig.json' (or source.tsconfigPath), '.env', '.env.*', 'tailwindcss.config.*']`; when using the Rspeedy CLI with `performance.buildCache` enabled, the loaded `lynx.config.*` file is also added.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Split direct default from CLI-injected behavior.
This @defaultValue currently includes tool-injected behavior (“when using the Rspeedy CLI…”). Keep the base list in @defaultValue, and move the CLI augmentation to @remarks for clearer semantics.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/rspeedy/core/src/config/performance/build-cache.ts` at line 46,
Update the JSDoc on the performance.buildCache option so the `@defaultValue`
contains only the base array (['package.json', 'tsconfig.json' or
source.tsconfigPath, '.env', '.env.*', 'tailwindcss.config.*']) and remove the
CLI-specific sentence; then add a `@remarks` block (or extend existing `@remarks`)
that documents the CLI augmentation — i.e., that when using the Rspeedy CLI with
performance.buildCache enabled the loaded lynx.config.* file is also added.
Target the JSDoc surrounding the performance.buildCache symbol in build-cache.ts
and ensure the `@defaultValue` and `@remarks` reflect this split.

@colinaaa
Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 11, 2026

Merging this PR will not alter performance

✅ 72 untouched benchmarks
⏩ 21 skipped benchmarks1


Comparing colinaaa:docs/rspeedy-default-values (e11f89c) with main (74b2b48)

Open in CodSpeed

Footnotes

  1. 21 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@relativeci
Copy link
Copy Markdown

relativeci bot commented Apr 11, 2026

React External

#322 Bundle Size — 590.13KiB (0%).

e11f89c(current) vs 74b2b48 main#318(baseline)

Bundle metrics  no changes
                 Current
#322
     Baseline
#318
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 3 3
No change  Modules 17 17
No change  Duplicate Modules 5 5
No change  Duplicate Code 8.59% 8.59%
No change  Packages 0 0
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#322
     Baseline
#318
No change  Other 590.13KiB 590.13KiB

Bundle analysis reportBranch colinaaa:docs/rspeedy-default-va...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci bot commented Apr 11, 2026

React Example

#7204 Bundle Size — 236.82KiB (0%).

e11f89c(current) vs 74b2b48 main#7200(baseline)

Bundle metrics  no changes
                 Current
#7204
     Baseline
#7200
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 179 179
No change  Duplicate Modules 70 70
No change  Duplicate Code 46.1% 46.1%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#7204
     Baseline
#7200
No change  IMG 145.76KiB 145.76KiB
No change  Other 91.06KiB 91.06KiB

Bundle analysis reportBranch colinaaa:docs/rspeedy-default-va...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci bot commented Apr 11, 2026

Web Explorer

#8778 Bundle Size — 743.45KiB (0%).

e11f89c(current) vs 74b2b48 main#8774(baseline)

Bundle metrics  Change 1 change
                 Current
#8778
     Baseline
#8774
No change  Initial JS 43.82KiB 43.82KiB
No change  Initial CSS 2.16KiB 2.16KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 8 8
No change  Assets 10 10
Change  Modules 148(+0.68%) 147
No change  Duplicate Modules 11 11
No change  Duplicate Code 34.97% 34.97%
No change  Packages 3 3
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#8778
     Baseline
#8774
No change  Other 398.15KiB 398.15KiB
No change  JS 343.13KiB 343.13KiB
No change  CSS 2.16KiB 2.16KiB

Bundle analysis reportBranch colinaaa:docs/rspeedy-default-va...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci bot commented Apr 11, 2026

React MTF Example

#337 Bundle Size — 206.11KiB (0%).

e11f89c(current) vs 74b2b48 main#333(baseline)

Bundle metrics  no changes
                 Current
#337
     Baseline
#333
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 3 3
No change  Modules 173 173
No change  Duplicate Modules 67 67
No change  Duplicate Code 45.76% 45.76%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#337
     Baseline
#333
No change  IMG 111.23KiB 111.23KiB
No change  Other 94.88KiB 94.88KiB

Bundle analysis reportBranch colinaaa:docs/rspeedy-default-va...Project dashboard


Generated by RelativeCIDocumentationReport issue

@colinaaa colinaaa merged commit 0fa3d02 into lynx-family:main Apr 11, 2026
47 of 49 checks passed
@colinaaa colinaaa deleted the docs/rspeedy-default-values branch April 11, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant