Skip to content

Conversation

@avivkeller
Copy link
Member

@avivkeller avivkeller commented Dec 19, 2025

This PR adds comparators for the following generators:

  • api-links (Object assertion)
  • orama-db (File size)
  • legacy-html (File size)
  • llms-txt (File size)

Additionally, to demonstrate one of the added comparators, the legacy-html file size was decreased. This can be reverted if needed.

Copilot AI review requested due to automatic review settings December 19, 2025 15:43
@avivkeller avivkeller requested a review from a team as a code owner December 19, 2025 15:43
@vercel
Copy link

vercel bot commented Dec 19, 2025

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

Project Deployment Review Updated (UTC)
api-docs-tooling Ready Ready Preview Dec 19, 2025 10:53pm

@codecov
Copy link

codecov bot commented Dec 19, 2025

Codecov Report

❌ Patch coverage is 0% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.82%. Comparing base (5a53779) to head (bf5279a).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
scripts/comparators/constants.mjs 0.00% 10 Missing ⚠️
scripts/comparators/object-assertion.mjs 0.00% 4 Missing ⚠️
scripts/comparators/file-size.mjs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #523      +/-   ##
==========================================
- Coverage   79.87%   79.82%   -0.05%     
==========================================
  Files         122      121       -1     
  Lines       12013    12001      -12     
  Branches      841      839       -2     
==========================================
- Hits         9595     9580      -15     
- Misses       2415     2418       +3     
  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.

@github-actions
Copy link

github-actions bot commented Dec 19, 2025

legacy-html Generator

File Base Head Diff
addons.html 336.37 KB 336.17 KB -206.00 B (-0.06%)
assert.html 464.46 KB 464.26 KB -206.00 B (-0.04%)
async_context.html 198.75 KB 198.55 KB -206.00 B (-0.10%)
async_hooks.html 206.88 KB 206.68 KB -206.00 B (-0.10%)
buffer.html 1.06 MB 1.06 MB -206.00 B (-0.02%)
child_process.html 439.09 KB 438.89 KB -206.00 B (-0.05%)
cli.html 280.44 KB 280.23 KB -206.00 B (-0.07%)
cluster.html 196.11 KB 195.91 KB -206.00 B (-0.10%)
console.html 95.98 KB 95.78 KB -206.00 B (-0.21%)
crypto.html 998.85 KB 998.65 KB -206.00 B (-0.02%)
debugger.html 36.48 KB 36.28 KB -206.00 B (-0.55%)
deprecations.html 249.24 KB 249.04 KB -206.00 B (-0.08%)
dgram.html 153.36 KB 153.16 KB -206.00 B (-0.13%)
diagnostics_channel.html 222.17 KB 221.97 KB -206.00 B (-0.09%)
dns.html 211.03 KB 210.83 KB -206.00 B (-0.10%)
documentation.html 24.33 KB 24.13 KB -206.00 B (-0.83%)
domain.html 99.55 KB 99.35 KB -206.00 B (-0.20%)
embedding.html 48.28 KB 48.08 KB -206.00 B (-0.42%)
environment_variables.html 24.67 KB 24.47 KB -206.00 B (-0.82%)
errors.html 340.50 KB 340.30 KB -206.00 B (-0.06%)
esm.html 122.85 KB 122.64 KB -206.00 B (-0.16%)
events.html 542.02 KB 541.82 KB -206.00 B (-0.04%)
fs.html 911.83 KB 911.63 KB -206.00 B (-0.02%)
globals.html 120.41 KB 120.21 KB -206.00 B (-0.17%)
http.html 591.97 KB 591.77 KB -206.00 B (-0.03%)
http2.html 733.63 KB 733.43 KB -206.00 B (-0.03%)
https.html 153.83 KB 153.63 KB -206.00 B (-0.13%)
index.html 15.38 KB 15.18 KB -206.00 B (-1.31%)
inspector.html 102.98 KB 102.78 KB -206.00 B (-0.20%)
intl.html 40.70 KB 40.50 KB -206.00 B (-0.49%)
module.html 323.17 KB 322.97 KB -206.00 B (-0.06%)
modules.html 148.77 KB 148.57 KB -206.00 B (-0.14%)
n-api.html 756.31 KB 756.11 KB -206.00 B (-0.03%)
net.html 209.33 KB 209.13 KB -206.00 B (-0.10%)
os.html 75.64 KB 75.44 KB -206.00 B (-0.27%)
packages.html 119.12 KB 118.92 KB -206.00 B (-0.17%)
path.html 93.93 KB 93.73 KB -206.00 B (-0.21%)
perf_hooks.html 345.57 KB 345.37 KB -206.00 B (-0.06%)
permissions.html 35.86 KB 35.66 KB -206.00 B (-0.56%)
process.html 674.45 KB 674.24 KB -206.00 B (-0.03%)
punycode.html 32.93 KB 32.73 KB -206.00 B (-0.61%)
querystring.html 32.28 KB 32.07 KB -206.00 B (-0.62%)
quic.html 137.57 KB 137.37 KB -206.00 B (-0.15%)
readline.html 200.33 KB 200.13 KB -206.00 B (-0.10%)
repl.html 215.49 KB 215.29 KB -206.00 B (-0.09%)
report.html 186.33 KB 186.13 KB -206.00 B (-0.11%)
single-executable-applications.html 77.69 KB 77.49 KB -206.00 B (-0.26%)
sqlite.html 183.18 KB 182.98 KB -206.00 B (-0.11%)
stream.html 802.87 KB 802.67 KB -206.00 B (-0.03%)
string_decoder.html 38.80 KB 38.60 KB -206.00 B (-0.52%)
synopsis.html 24.13 KB 23.93 KB -206.00 B (-0.83%)
test.html 777.83 KB 777.63 KB -206.00 B (-0.03%)
timers.html 87.42 KB 87.22 KB -206.00 B (-0.23%)
tls.html 258.03 KB 257.83 KB -206.00 B (-0.08%)
tracing.html 87.80 KB 87.59 KB -206.00 B (-0.23%)
tty.html 41.81 KB 41.61 KB -206.00 B (-0.48%)
typescript.html 32.37 KB 32.16 KB -206.00 B (-0.62%)
url.html 312.14 KB 311.94 KB -206.00 B (-0.06%)
util.html 708.25 KB 708.05 KB -206.00 B (-0.03%)
v8.html 236.98 KB 236.77 KB -206.00 B (-0.08%)
vm.html 331.12 KB 330.92 KB -206.00 B (-0.06%)
wasi.html 43.75 KB 43.55 KB -206.00 B (-0.46%)
webcrypto.html 320.72 KB 320.52 KB -206.00 B (-0.06%)
webstreams.html 255.51 KB 255.31 KB -206.00 B (-0.08%)
worker_threads.html 383.07 KB 382.86 KB -206.00 B (-0.05%)
zlib.html 272.77 KB 272.57 KB -206.00 B (-0.07%)

orama-db Generator

File Base Head Diff
orama-db.json 7.99 MB 7.99 MB -526.00 B (-0.01%)

web Generator

File Base Head Diff
styles.css 118.37 KB 118.30 KB -67.00 B (-0.06%)

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 refactors the comparator architecture to enable reusable comparison scripts across multiple generators, and adds comparisons for five additional generators (api-links, orama-db, json-simple, legacy-html, and llms-txt). The changes include creating a new shared constants file, updating existing comparators to use it, modifying the workflow to support flexible comparator assignment, and demonstrating the file-size comparator by minifying the legacy-html template.

Key Changes:

  • Refactored comparator structure from generator-specific to reusable scripts
  • Added file-size and object-assertion comparisons for multiple generators
  • Centralized configuration constants (BASE, HEAD, TITLE) into a shared module

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
scripts/comparators/constants.mjs New shared constants file replacing the deleted utils.mjs, exports BASE, HEAD, and TITLE
scripts/comparators/object-assertion.mjs Updated to import from constants.mjs instead of utils.mjs
scripts/comparators/file-size.mjs Updated to import from constants.mjs instead of utils.mjs
scripts/compare-builds/utils.mjs Removed file (replaced by constants.mjs)
.github/workflows/generate.yml Updated to use reusable comparators with flexible assignment per generator
src/generators/legacy-html/template.html Minified dark mode initialization script to reduce file size
docs/comparators.md Updated documentation to reflect new comparator structure and naming conventions
npm-shrinkwrap.json Updated peer dependency markers for packages used by new generators
Files not reviewed (1)
  • npm-shrinkwrap.json: Language not supported
Comments suppressed due to low confidence (2)

.github/workflows/generate.yml:152

  • The input paths have been changed to remove the ./node/ prefix (e.g., from ./node/lib/*.js to lib/*.js). However, the Node.js repository is checked out into the node directory (line 134), so the CLI command at line 152 will receive paths like lib/*.js which won't exist relative to the current working directory. Either the input paths need to include the ./node/ prefix, or the generator command needs to run from within the node directory.
            input: './node/doc/api/cli.md'

          - target: addon-verify
            input: './node/doc/api/addons.md'

          - target: api-links
            input: './node/lib/*.js'
            compare: object-assertion

          - target: orama-db
            input: './node/doc/api/*.md'
            compare: file-size

          - target: json-simple
            input: './node/doc/api/*.md'
            compare: object-assertion

          - target: legacy-json
            input: './node/doc/api/*.md'
            compare: object-assertion

          - target: legacy-html
            input: './node/doc/api/*.md'
            compare: file-size

          - target: web
            input: './node/doc/api/*.md'
            compare: file-size

          - target: llms-txt
            input: './node/doc/api/*.md'
            compare: file-size
    steps:
      - name: Harden Runner
        uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
        with:
          egress-policy: audit

      - name: Git Checkout
        uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
        with:
          persist-credentials: false

      - name: Git Checkout
        uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
        with:
          persist-credentials: false
          repository: nodejs/node
          ref: ${{ needs.prepare.outputs.sha }}
          sparse-checkout: |
            doc/api
            lib
            .
          path: node

      - name: Setup Node.js
        uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
        with:
          node-version-file: '.nvmrc'
          cache: 'npm'

      - name: Install dependencies
        run: npm ci

      - name: Create output directory
        run: mkdir -p out/${{ matrix.target }}

      - name: Generate ${{ matrix.target }}
        run: |
          node bin/cli.mjs generate \
            -t ${{ matrix.target }} \
            -i "${{ matrix.input }}" \

.github/workflows/generate.yml:133

  • The sparse-checkout configuration now uses ${{ matrix.input }} which contains glob patterns like lib/*.js and doc/api/*.md. However, sparse-checkout typically expects directory paths, not file glob patterns. This may cause issues with checking out the correct files from the repository. Consider either using the parent directories (e.g., lib and doc/api) or verifying that the sparse-checkout action supports glob patterns correctly.
          sparse-checkout: |
            doc/api
            lib
            .

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

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.

SGTM!

@avivkeller avivkeller merged commit 776dd0b into main Dec 21, 2025
20 checks passed
@avivkeller avivkeller deleted the avivkeller/compare-more-generators branch December 21, 2025 22:07
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