Skip to content

fix: filter out new keys from legacy JSON generator#595

Open
aduh95 wants to merge 9 commits intomainfrom
filter-out-keys
Open

fix: filter out new keys from legacy JSON generator#595
aduh95 wants to merge 9 commits intomainfrom
filter-out-keys

Conversation

@aduh95
Copy link
Contributor

@aduh95 aduh95 commented Feb 7, 2026

Description

Validation

Related Issues

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run node --run test and all tests passed.
  • I have check code formatting with node --run format & node --run lint.
  • I've covered new added functionality with unit tests if necessary.

@aduh95 aduh95 requested a review from a team as a code owner February 7, 2026 15:19
Copilot AI review requested due to automatic review settings February 7, 2026 15:19
@vercel
Copy link

vercel bot commented Feb 7, 2026

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

Project Deployment Actions Updated (UTC)
api-docs-tooling Ready Ready Preview Feb 7, 2026 10:24pm

Request Review

@codecov
Copy link

codecov bot commented Feb 7, 2026

Codecov Report

❌ Patch coverage is 20.37037% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.57%. Comparing base (07a57f8) to head (c231947).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/utils/generators.mjs 16.32% 41 Missing ⚠️
src/generators/legacy-json-all/index.mjs 66.66% 1 Missing ⚠️
src/generators/legacy-json/index.mjs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #595      +/-   ##
==========================================
- Coverage   80.80%   80.57%   -0.24%     
==========================================
  Files         126      126              
  Lines       12073    12121      +48     
  Branches      874      874              
==========================================
+ Hits         9756     9766      +10     
- Misses       2314     2352      +38     
  Partials        3        3              

☔ View full report in Codecov by Sentry.
📢 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.

Removed commented TODO note about additional keys in JSON output.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the legacy-json generator to emit “legacy-compatible” JSON by filtering the serialized output to a specific allowlist of keys, aiming to prevent newly introduced fields from appearing in generated legacy JSON files.

Changes:

  • Replaces JSON.stringify(section, null, 2) with JSON.stringify(section, [allowedKeys...], 2) to filter output keys.
  • Conditionally includes the modules key for non-index sections during serialization.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

orama-db Generator

File Base Head Diff
orama-db.json 8.03 MB 8.03 MB -3.00 B (-0.00%)

Copy link
Member

@avivkeller avivkeller left a comment

Choose a reason for hiding this comment

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

I don't love this kind of hard-coding, but if it'll get the tooling merged into core, I'm willing to deal with it.

cc @ovflowd @flakey5

Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

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

Let's wait for the TSC meeting.

@ovflowd
Copy link
Member

ovflowd commented Feb 7, 2026

To be clear, not against the PR, just want to want for the TSC meeting before we make any decisions on the approach.

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.

3 participants