Skip to content

feat(index): support passing an index file #316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 23, 2025
Merged

feat(index): support passing an index file #316

merged 1 commit into from
Jun 23, 2025

Conversation

avivkeller
Copy link
Member

@avivkeller avivkeller commented Jun 22, 2025

Fixes #314

CC @flakey5

Ref: https://openjs-foundation.slack.com/archives/CVAMEJ4UV/p1750617708640369


This will allow us to use the Makefile's parallelism while still keeping the sidebar.

@Copilot Copilot AI review requested due to automatic review settings June 22, 2025 19:49
@avivkeller avivkeller requested a review from a team as a code owner June 22, 2025 19:49
Copy link
Contributor

@Copilot 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 introduces support for passing an index file, refactoring the content loading and parsing pipelines and updating related tests and generators.

  • Introduces a new loadFromURL utility to abstract content loading from both URLs and file paths.
  • Adds new parser functions (parseChangelog and parseIndex) to handle changelog and sidebar data extraction from markdown.
  • Updates the legacy HTML generator to support an index file and adjusts test commands in package.json accordingly.

Reviewed Changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/utils/parser.mjs Adds loadFromURL function for abstracting content loading.
src/utils/tests/parser.test.mjs Tests for the new loadFromURL function.
src/releases.mjs Removal of legacy release handling code.
src/parsers/markdown.mjs Adds parseChangelog and parseIndex for markdown parsing.
src/parsers/tests/markdown.test.mjs Unit tests for the new markdown parser functions.
src/generators/legacy-html/index.mjs Adjusts generator to use optional index file for sidebar creation.
package.json Updates test commands to include experimental module mocks.

Copy link

codecov bot commented Jun 22, 2025

Codecov Report

Attention: Patch coverage is 70.58824% with 25 lines in your changes missing coverage. Please review.

Project coverage is 51.15%. Comparing base (492c2da) to head (4eeea5b).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
bin/commands/generate.mjs 0.00% 12 Missing ⚠️
src/generators/legacy-html/index.mjs 0.00% 9 Missing ⚠️
src/utils/parser.mjs 80.95% 4 Missing ⚠️

❌ Your patch status has failed because the patch coverage (70.58%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #316      +/-   ##
==========================================
+ Coverage   50.02%   51.15%   +1.12%     
==========================================
  Files          81       81              
  Lines        6942     6956      +14     
  Branches      296      306      +10     
==========================================
+ Hits         3473     3558      +85     
+ Misses       3466     3395      -71     
  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.

@avivkeller
Copy link
Member Author

avivkeller commented Jun 22, 2025

Ignore the codecov failure. It's because we don't have any tests covering our CLI, and it's only a reminder that our coverage is currently suboptimal, see #305

Copy link
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

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

LGMT !

Copy link
Member

@flakey5 flakey5 left a comment

Choose a reason for hiding this comment

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

Thanks!

@avivkeller avivkeller added the fast track This PR can land before the typical review time, with a :+1: from collaborators label Jun 22, 2025
@avivkeller
Copy link
Member Author

Requesting fast track as to not block the migration

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.

Overall LGTM, but left a few comments. Will approve after having them resolved.

@avivkeller avivkeller force-pushed the feat/index branch 2 times, most recently from 7e16289 to d20f49e Compare June 23, 2025 17:11
@avivkeller
Copy link
Member Author

Just waiting for #318 to land for a green CI, then we should be good to land.

@avivkeller avivkeller merged commit b3e2fbd into main Jun 23, 2025
7 checks passed
@avivkeller avivkeller deleted the feat/index branch June 23, 2025 18:43
@avivkeller
Copy link
Member Author

avivkeller commented Jun 23, 2025

@flakey5 Updating the migration to b3e2fbd has the updated code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fast track This PR can land before the typical review time, with a :+1: from collaborators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve single-file generation
4 participants