Skip to content

feat: allow dynamic configurations#905

Open
avivkeller wants to merge 2 commits into
mainfrom
allow-dynamic-config
Open

feat: allow dynamic configurations#905
avivkeller wants to merge 2 commits into
mainfrom
allow-dynamic-config

Conversation

@avivkeller

Copy link
Copy Markdown
Member

Closes #900
Closes #894
Closes #893
Fixes #891

@avivkeller avivkeller requested a review from a team as a code owner July 13, 2026 14:00
@cursor

cursor Bot commented Jul 13, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Configuration merge behavior change with a narrow UI default; no auth, security, or data-path changes.

Overview
Generator defaults can now depend on the full run configuration. getDefaultConfig takes the partially merged config and, for each generator, invokes defaultConfiguration when it is a function (plain objects still work unchanged).

The web generator uses this to set showSearchBox only when config.target includes orama-db, so docs builds that do not emit search data no longer show a broken search control. NavBar reads that flag from #theme/config and renders SearchBox conditionally.

Reviewed by Cursor Bugbot for commit 0487443. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
api-docs-tooling Ready Ready Preview Jul 13, 2026 2:06pm

Request Review

@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.19%. Comparing base (68774ca) to head (0487443).

Files with missing lines Patch % Lines
src/generators/web/index.mjs 87.50% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #905   +/-   ##
=======================================
  Coverage   85.19%   85.19%           
=======================================
  Files         180      180           
  Lines       16570    16582   +12     
  Branches     1513     1517    +4     
=======================================
+ Hits        14116    14127   +11     
- Misses       2444     2445    +1     
  Partials       10       10           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 288d7d9. Configure here.

Comment thread src/utils/configuration/index.mjs Outdated
config,
createConfigFromCLIOptions(options),
getDefaultConfig()
getDefaultConfig(config)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CLI targets ignored for defaults

Medium Severity

Dynamic defaults such as showSearchBox are computed from the config-file object alone, before CLI options are merged. When target comes from --target (the project's usual path), orama-db is never visible to defaultConfiguration, so the search box stays hidden even when search data is being built.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 288d7d9. Configure here.

* Get's the default configuration
*/
export const getDefaultConfig = lazy(() =>
export const getDefaultConfig = lazy(config =>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Lazy cache ignores config argument

Medium Severity

getDefaultConfig is still wrapped in lazy, which memoizes the first call and ignores later arguments. After making defaults depend on config, a second createRunConfiguration in the same process reuses the first config's dynamic values (for example showSearchBox) instead of recomputing them.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 288d7d9. Configure here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

  1. createRunConfiguration is only called once per thread, most of the time
  2. config doesn't change

@github-actions

Copy link
Copy Markdown
Contributor

orama-db Generator

File Base Head Diff
orama-db.json 8.92 MB 8.92 MB +1.00 B (+0.00%)

web Generator

File Base Head Diff
404.html 30.38 KB 29.88 KB -513.00 B (-1.65%)
addons.html 275.22 KB 274.72 KB -513.00 B (-0.18%)
assert.html 329.41 KB 328.91 KB -513.00 B (-0.15%)
async_context.html 188.09 KB 187.59 KB -513.00 B (-0.27%)
async_hooks.html 160.52 KB 160.02 KB -513.00 B (-0.31%)
buffer.html 907.87 KB 907.37 KB -513.00 B (-0.06%)
child_process.html 380.48 KB 379.98 KB -513.00 B (-0.13%)
cli.html 519.02 KB 518.52 KB -513.00 B (-0.10%)
cluster.html 197.16 KB 196.65 KB -513.00 B (-0.25%)
console.html 144.57 KB 144.07 KB -513.00 B (-0.35%)
crypto.html 1.10 MB 1.10 MB -513.00 B (-0.04%)
debugger.html 96.42 KB 95.92 KB -513.00 B (-0.52%)
deprecations.html 513.55 KB 513.05 KB -513.00 B (-0.10%)
dgram.html 208.82 KB 208.32 KB -513.00 B (-0.24%)
diagnostics_channel.html 304.72 KB 304.22 KB -513.00 B (-0.16%)
dns.html 297.93 KB 297.43 KB -513.00 B (-0.17%)
documentation.html 38.43 KB 37.93 KB -513.00 B (-1.30%)
domain.html 105.55 KB 105.05 KB -513.00 B (-0.47%)
dtls.html 149.41 KB 148.91 KB -513.00 B (-0.34%)
embedding.html 59.82 KB 59.32 KB -513.00 B (-0.84%)
environment_variables.html 44.43 KB 43.93 KB -513.00 B (-1.13%)
errors.html 489.52 KB 489.01 KB -513.00 B (-0.10%)
esm.html 158.24 KB 157.74 KB -513.00 B (-0.32%)
events.html 456.33 KB 455.83 KB -513.00 B (-0.11%)
ffi.html 135.33 KB 134.82 KB -513.00 B (-0.37%)
fs.html 1.47 MB 1.47 MB -513.00 B (-0.03%)
globals.html 231.37 KB 230.87 KB -513.00 B (-0.22%)
http.html 762.65 KB 762.15 KB -513.00 B (-0.07%)
http2.html 782.93 KB 782.43 KB -513.00 B (-0.06%)
https.html 150.72 KB 150.22 KB -513.00 B (-0.33%)
index.html 40.89 KB 40.39 KB -513.00 B (-1.23%)
inspector.html 172.21 KB 171.71 KB -513.00 B (-0.29%)
intl.html 58.53 KB 58.03 KB -513.00 B (-0.86%)
module.html 328.84 KB 328.34 KB -513.00 B (-0.15%)
modules.html 181.90 KB 181.40 KB -513.00 B (-0.28%)
n-api.html 812.39 KB 811.89 KB -513.00 B (-0.06%)
net.html 418.78 KB 418.28 KB -513.00 B (-0.12%)
os.html 146.36 KB 145.86 KB -513.00 B (-0.34%)
packages.html 178.43 KB 177.93 KB -513.00 B (-0.28%)
path.html 139.74 KB 139.24 KB -513.00 B (-0.36%)
perf_hooks.html 385.99 KB 385.49 KB -513.00 B (-0.13%)
permissions.html 63.24 KB 62.74 KB -513.00 B (-0.79%)
process.html 691.28 KB 690.78 KB -513.00 B (-0.07%)
punycode.html 63.61 KB 63.11 KB -513.00 B (-0.79%)
querystring.html 64.13 KB 63.63 KB -513.00 B (-0.78%)
quic.html 739.24 KB 738.74 KB -513.00 B (-0.07%)
readline.html 252.79 KB 252.29 KB -513.00 B (-0.20%)
repl.html 183.72 KB 183.22 KB -513.00 B (-0.27%)
report.html 176.31 KB 175.81 KB -513.00 B (-0.28%)
single-executable-applications.html 107.48 KB 106.98 KB -513.00 B (-0.47%)
sqlite.html 289.40 KB 288.90 KB -513.00 B (-0.17%)
stream.html 861.80 KB 861.30 KB -513.00 B (-0.06%)
stream_iter.html 367.13 KB 366.63 KB -513.00 B (-0.14%)
string_decoder.html 55.75 KB 55.25 KB -513.00 B (-0.90%)
synopsis.html 43.06 KB 42.56 KB -513.00 B (-1.16%)
test.html 834.93 KB 834.43 KB -513.00 B (-0.06%)
timers.html 134.19 KB 133.69 KB -513.00 B (-0.37%)
tls.html 380.41 KB 379.90 KB -513.00 B (-0.13%)
tracing.html 84.77 KB 84.27 KB -513.00 B (-0.59%)
tty.html 95.64 KB 95.14 KB -513.00 B (-0.52%)
typescript.html 53.86 KB 53.36 KB -513.00 B (-0.93%)
url.html 349.27 KB 348.77 KB -513.00 B (-0.14%)
util.html 696.78 KB 696.27 KB -513.00 B (-0.07%)
v8.html 343.18 KB 342.68 KB -513.00 B (-0.15%)
vfs.html 82.51 KB 82.00 KB -513.00 B (-0.61%)
vm.html 371.66 KB 371.16 KB -513.00 B (-0.13%)
wasi.html 69.75 KB 69.25 KB -513.00 B (-0.72%)
webcrypto.html 557.04 KB 556.54 KB -513.00 B (-0.09%)
webstreams.html 364.97 KB 364.47 KB -513.00 B (-0.14%)
worker_threads.html 375.31 KB 374.81 KB -513.00 B (-0.13%)
zlib.html 347.92 KB 347.42 KB -513.00 B (-0.14%)
all.html 19.97 MB 19.97 MB -279.00 B (-0.00%)

@AugustinMauroy AugustinMauroy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

preview didn't have the searcher enabled and it's also visible on diff CI

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.

web generator should not render the search bar if orama-db is not enabled

2 participants