Skip to content

feat: allow dynamic configurations#905

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

feat: allow dynamic configurations#905
avivkeller wants to merge 7 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

Medium Risk
Changes global config merge semantics and deepMerge behavior, which could alter effective settings for existing configs; the web navbar UX change is localized but depends on the new default.

Overview
Dynamic configuration lets generators expose defaultConfiguration as a function that receives the partially merged user config, so defaults can depend on resolved options (e.g. target).

createRunConfiguration now merges config file + CLI first, then applies defaults on top via getDefaultConfig(intermediate), so those functions see real user choices while CLI still wins over the file for overlapping keys.

The web generator uses this to set showSearchBox only when orama-db is in target; the navbar renders SearchBox conditionally from #theme/config.

deepMerge is simplified to a left-to-right deep merge (later arguments override), skips undefined, copies arrays, and isPlainObject is stricter. Tests were updated for merge order and dynamic showSearchBox.

Reviewed by Cursor Bugbot for commit 1dda708. 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 14, 2026 10:34pm

Request Review

@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.36066% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.31%. Comparing base (68774ca) to head (1aefcfd).
⚠️ Report is 5 commits behind head on main.

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.31%   +0.12%     
==========================================
  Files         180      186       +6     
  Lines       16570    16866     +296     
  Branches     1513     1503      -10     
==========================================
+ Hits        14116    14389     +273     
- Misses       2444     2470      +26     
+ Partials       10        7       -3     

☔ 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.

Comment thread src/utils/configuration/index.mjs Outdated
Comment thread src/utils/configuration/index.mjs Outdated
Comment thread src/utils/configuration/index.mjs
@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

orama-db Generator

File Base Head Diff
orama-db.json 8.92 MB 8.91 MB -1.13 KB (-0.01%)

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

@avivkeller

Copy link
Copy Markdown
Member Author

Pushed a preview fix. The CI diff is because CI isn't running web and orama-db at the same time, thus, orama-db is not being specified, causing it not to be loaded, it's expected.

Comment thread src/utils/configuration/index.mjs Outdated

@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 1 potential issue.

Fix All in Cursor

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

Reviewed by Cursor Bugbot for commit 1aefcfd. Configure here.

Comment thread src/utils/misc.mjs
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

3 participants