Skip to content

feat(web): add web generator #285

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

feat(web): add web generator #285

wants to merge 3 commits into from

Conversation

avivkeller
Copy link
Member

@avivkeller avivkeller commented May 28, 2025

Fixes #7.

This PR adds the web generator.

Tasks / Issues

P1 – Must Complete Before Merge

  • Add more items (anyone can do this as they review1)

P2 – Must complete before migration

P3 – Can Be Done in a Follow-up

  • Remove mustache dependency
  • Adding a tooltip/expand to the DataTag
  • Use new Orama UI
  • Add more items (anyone can do this as they review1)

Get a preview

node bin/cli.mjs generate -t orama-db -i "/node/doc/api/*.md" -o "./out" # If you want search functionality
node bin/cli.mjs generate -t web -i "/node/doc/api/*.md" -o "./out" --index "/node/doc/api/index.md" # Specifying `--index` is optional, but recommended
npx serve out # You can serve the output, or just open one of the files in your browser. Serving is required for using search.

Footnotes

  1. Add things as they appear, or leave review comments. 2 3

@codecov-commenter
Copy link

codecov-commenter commented May 28, 2025

Codecov Report

Attention: Patch coverage is 53.89507% with 580 lines in your changes missing coverage. Please review.

Project coverage is 70.54%. Comparing base (6fa7d1b) to head (2e3f96d).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...nerators/jsx-ast/utils/createSignatureElements.mjs 30.37% 149 Missing ⚠️
src/generators/web/index.mjs 39.55% 81 Missing ⚠️
src/generators/jsx-ast/utils/buildContent.mjs 47.01% 71 Missing ⚠️
src/generators/web/build/generate.mjs 22.36% 59 Missing ⚠️
src/generators/web/build/css.mjs 24.19% 47 Missing ⚠️
src/generators/jsx-ast/utils/buildBarProps.mjs 36.92% 40 Missing and 1 partial ⚠️
src/generators/web/build/bundle.mjs 24.52% 40 Missing ⚠️
src/generators/jsx-ast/index.mjs 26.00% 37 Missing ⚠️
src/generators/orama-db/index.mjs 54.34% 21 Missing ⚠️
src/utils/queries/index.mjs 71.73% 10 Missing and 3 partials ⚠️
... and 8 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #285      +/-   ##
==========================================
- Coverage   72.12%   70.54%   -1.58%     
==========================================
  Files         117      128      +11     
  Lines        9984    10926     +942     
  Branches      597      633      +36     
==========================================
+ Hits         7201     7708     +507     
- Misses       2780     3211     +431     
- Partials        3        7       +4     

☔ 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 avivkeller marked this pull request as ready for review May 28, 2025 22:13
@avivkeller avivkeller requested a review from a team as a code owner May 28, 2025 22:13
@avivkeller avivkeller marked this pull request as draft May 29, 2025 16:36
@avivkeller
Copy link
Member Author

avivkeller commented May 30, 2025

🎉 The code now dehydrates to the client so it can render without JavaScript!

@AugustinMauroy
Copy link
Member

🎉 The code now dehydrates to the client so it run without JavaScript!

Wow 😵‍💫 and what about codetab

@avivkeller
Copy link
Member Author

avivkeller commented May 30, 2025

It rehydrates and runs with JS, but if you don't have JS, you can still view the docs. I used React's SSRing

@avivkeller
Copy link
Member Author

@AugustinMauroy and I got search to finally work 🎉
image

@avivkeller avivkeller force-pushed the feat/web/gen branch 2 times, most recently from 024bbea to dbfe55d Compare June 3, 2025 21:40
@avivkeller
Copy link
Member Author

@nodejs/nodejs-website @nodejs/web-infra ChangeHistory and SideBar aren't implemented yet, so this is still a draft, but it's ready for you to take a look, so feel free to review :-)

@avivkeller avivkeller linked an issue Jun 6, 2025 that may be closed by this pull request
@avivkeller
Copy link
Member Author

avivkeller commented Jul 11, 2025

@nodejs/collaborators @nodejs/web-infra @nodejs/nodejs-website

If you could be so kind as to review https://api-docs-tooling.vercel.app/ and come up with a list of things that still need to be completed, it would be helpful. I know it's a bit tedious, but it'll help with the development significantly.

Note that we are aware of the following issues:

Note that we are in the process of making the following improvements:

  • Increasing the depth of the right-hand side ToC
  • Adding a tooltip/expand to the DataTag, which explains what it refers to (@ovflowd, would you mind opening an issue in nodejs/nodejs.org?)
  • A visualization of the extends keyword (which, I still need to design)
  • Improving the UX of the Mobile Table Design, see Poor Table UX on Mobile nodejs.org#7656

@Qard

This comment was marked as off-topic.

@avivkeller

This comment was marked as resolved.

@Qard

This comment was marked as off-topic.

@avivkeller

This comment was marked as resolved.

This comment was marked as outdated.

This comment was marked as outdated.

@avivkeller
Copy link
Member Author

@ovflowd Did something change on the main branch that required a fast-forward? I've undone that commit to see if it fixes the deployment.

@ovflowd
Copy link
Member

ovflowd commented Jul 12, 2025

@ovflowd Did something change on the main branch that required a fast-forward? I've undone that commit to see if it fixes the deployment.

Please don't undo the commit lol

@ovflowd
Copy link
Member

ovflowd commented Jul 12, 2025

It was just updated vercel permissions that needed to be fixed.

@avivkeller
Copy link
Member Author

Ahh I see, apologies.

@avivkeller
Copy link
Member Author

avivkeller commented Jul 12, 2025

I've re-requested review from previous web-team reviewers, since this PR has undergone substantial changes since the last code review comment.

I'm pleased to feel that this PR is in a place where it can land with minimal adjustments (where a follow-up tracking improvements can be made, see the list of improvements in the PR description).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add react-web generator Write React Components
10 participants