Skip to content

chore(monorepo): break out generators#778

Open
avivkeller wants to merge 3 commits intofeature/monorepofrom
monorepo/2
Open

chore(monorepo): break out generators#778
avivkeller wants to merge 3 commits intofeature/monorepofrom
monorepo/2

Conversation

@avivkeller
Copy link
Copy Markdown
Member

@avivkeller avivkeller commented Apr 23, 2026

This PR breaks out the monorepo feature branch into:

  • @doc-kittens/legacy (legacy-*)
  • @doc-kittens/react (orama-db, web TBR react-html, jsx-ast)
  • @doc-kittens/web (sitemap, llms-txt)
  • @doc-kittens/internal (ast-*, metadata)
  • @doc-kittens/extras (Everything else)

Copilot AI review requested due to automatic review settings April 23, 2026 13:32
@avivkeller avivkeller requested a review from a team as a code owner April 23, 2026 13:32
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

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

Project Deployment Actions Updated (UTC)
api-docs-tooling Ready Ready Preview Apr 23, 2026 7:18pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 23, 2026

PR Summary

High Risk
High risk due to a large monorepo refactor that changes generator import specifiers, package boundaries, and CI targets; regressions are likely if any generator/export path or dependency chain was missed.

Overview
Splits generators out of packages/core into new workspace packages (@doc-kittens/internal, @doc-kittens/legacy, @doc-kittens/react, @doc-kittens/extras) and updates generator dependsOn chains and type imports to match the new package export paths.

Updates tooling and CI to use the new generator specifiers (workflows, docs/examples, eslint/prettier/c8 ignores), and trims packages/core dependencies/exports now that legacy/react/internal code has moved.

Refactors shared legacy HTML/JSON utilities into packages/legacy/src/utils (new ToC/template/content + JSON section/list/signature helpers) with corresponding test moves/additions, and relocates React JSX-ast remark/utility code to packages/react/src/utils (including a new JSX remark pipeline module).

Reviewed by Cursor Bugbot for commit 0a923b4. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

❌ Patch coverage is 71.72965% with 389 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (feature/monorepo@6def80a). Learn more about missing BASE report.

Files with missing lines Patch % Lines
packages/legacy/src/utils/json/section.mjs 39.23% 175 Missing ⚠️
packages/legacy/src/utils/html/content.mjs 65.92% 46 Missing ⚠️
packages/legacy/src/utils/html/template.mjs 0.00% 42 Missing ⚠️
packages/legacy/src/generators/html/index.mjs 0.00% 18 Missing ⚠️
packages/website/src/utils/sitemap/entry.mjs 0.00% 18 Missing ⚠️
packages/react/src/generators/web/index.mjs 0.00% 13 Missing ⚠️
packages/legacy/src/generators/html-all/index.mjs 0.00% 10 Missing ⚠️
packages/extras/src/generators/man-page/index.mjs 0.00% 7 Missing ⚠️
packages/react/src/generators/orama-db/index.mjs 0.00% 7 Missing ⚠️
...kages/extras/src/generators/addon-verify/index.mjs 0.00% 6 Missing ⚠️
... and 12 more
Additional details and impacted files
@@                 Coverage Diff                 @@
##             feature/monorepo     #778   +/-   ##
===================================================
  Coverage                    ?   74.29%           
===================================================
  Files                       ?      148           
  Lines                       ?    14175           
  Branches                    ?     1104           
===================================================
  Hits                        ?    10532           
  Misses                      ?     3637           
  Partials                    ?        6           

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

Comment thread packages/legacy/src/utils/html/template.mjs Outdated
"unist-util-select": "^5.1.0",
"unist-util-visit": "^5.1.0",
"yaml": "^2.8.3"
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing tinyglobby and glob-parent dependencies in internal package

High Severity

tinyglobby is imported in both ast/index.mjs and ast-js/index.mjs, and glob-parent is imported in ast/index.mjs, but neither is declared in @doc-kittens/internal's package.json dependencies. Both were removed from @node-core/doc-kit (core) during this refactor. This will cause runtime MODULE_NOT_FOUND errors when the generators are invoked.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2240b47. Configure here.

This comment was marked as low quality.

@ovflowd
Copy link
Copy Markdown
Member

ovflowd commented Apr 23, 2026

@avivkeller can you disable automatic copilot reviews in your acc? 👀

@ovflowd
Copy link
Copy Markdown
Member

ovflowd commented Apr 23, 2026

This PR breaks out the monorepo feature branch into:

  • @doc-kittens/legacy (legacy-*)

Can we call it @node-core/doc-kit-legacy-html, @node-core/doc-kit-legacy-json, since eventually they will be removed and they are node-core only.

  • @doc-kittens/react (orama-db, web, jsx-ast)

I think this must be split. IMO jsx-ast should be part of the core of doc-kit, not in a separate package. orama-db should be @doc-kittens/orama-db... I don't know what the web one should be since it is right now Node.js-specific by default and probably in the future should use neutral colours and a neutral logo by default without any Node.js-specific theming. And if this is the react one, it should probably be called @doc-kittens/react.

  • @doc-kittens/web (sitemap, llms-txt)

Should be @doc-kittens/sitemap, @doc-kittens/llms

  • @doc-kittens/internal (ast-*, metadata)

IMO, these should be shipped with doc-kit, not in an extra package.

  • @doc-kittens/extras (Everything else)

What would be everything else? Examples?

@avivkeller
Copy link
Copy Markdown
Member Author

The idea behind the monorepo was to avoid generators importing packages and files they don't actually need.

For legacy-html, for instance, it depends on some utilities in legacy-json, so it makes sense to put them in the same package.

The extras package isn't a permanent name, it's merely holding everything not already in a package for now. I'll probably break those out into individual packages.

@avivkeller
Copy link
Copy Markdown
Member Author

IMO, these should be shipped with doc-kit, not in an extra package.

I disagree, in the event that a generator doesn't want that data, and merely wants to create its own AST generator and whatnot, there's no need for it to require these

@avivkeller
Copy link
Copy Markdown
Member Author

Can we call it @node-core/doc-kit-legacy-html, @node-core/doc-kit-legacy-json, since eventually they will be removed and they are node-core only.

-1, the current name is IMO fine. The scope doesn't really matter.

@ovflowd
Copy link
Copy Markdown
Member

ovflowd commented Apr 23, 2026

Can we call it @node-core/doc-kit-legacy-html, @node-core/doc-kit-legacy-json, since eventually they will be removed and they are node-core only.

-1, the current name is IMO fine. The scope doesn't really matter.

-1 on your -1, the scope does matter.

@ovflowd
Copy link
Copy Markdown
Member

ovflowd commented Apr 23, 2026

IMO, these should be shipped with doc-kit, not in an extra package.

I disagree, in the event that a generator doesn't want that data, and merely wants to create its own AST generator and whatnot, there's no need for it to require these

The core generators should be part of doc-kit, it doesn't make sense that even the basic ones such as ast, metadata, jsx-ast, etc are in individual packages, they should be shipped with doc-kit, and not be even more packages.

@ovflowd
Copy link
Copy Markdown
Member

ovflowd commented Apr 23, 2026

The idea behind the monorepo was to avoid generators importing packages and files they don't actually need.

For legacy-html, for instance, it depends on some utilities in legacy-json, so it makes sense to put them in the same package.

Then said utilities should not be shared between them and be part of doc-kit itself. Except the legacy ones, all legacy generators should be their own package.

The extras package isn't a permanent name, it's merely holding everything not already in a package for now. I'll probably break those out into individual packages.

Can you still please describe what's inside extra? It doesn't make sense at all having a package called "extra" how are people going to know what's inside extra? The idea is that each of the non-core generators is their own isolated package, so that users can install the generators they want. These packages shouldn't be a set of generators. Think of how Radix UI does this.

Copy link
Copy Markdown
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.

Formally blocking the PR.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

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 and found 2 potential issues.

There are 3 total unresolved issues (including 1 from previous review).

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 0a923b4. Configure here.

Comment thread .prettierignore

# Templates
packages/core/src/generators/web/template.html
packages/legacy/src/generators/web/template.html
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

.prettierignore points to wrong package for web template

Low Severity

The web generator template was moved to packages/react/src/generators/web/template.html, but .prettierignore incorrectly references packages/legacy/src/generators/web/template.html. The legacy package has html and json generators, not web. This means Prettier won't ignore the actual template file in the react package.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0a923b4. Configure here.

Comment thread .c8rc.json
"packages/core/src/generators/legacy-html/assets",
"packages/core/src/generators/web/ui",
"packages/legacy/src/generators/html/assets",
"packages/react/src/generators/web/ui",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

.c8rc.json excludes wrong path for web UI

Low Severity

The coverage exclusion path packages/react/src/generators/web/ui is incorrect. The eslint config in the same PR references the web UI at packages/react/src/utils/web/ui/**/*, and the web generator imports ROOT from ../../utils/web/constants.mjs then resolves UI components relative to that. The UI files live under utils/web/ui, not generators/web/ui.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0a923b4. Configure here.

@ovflowd
Copy link
Copy Markdown
Member

ovflowd commented Apr 23, 2026

Forgot to post this before:

Also to clarify, I just want to understand the process of thought, because I thought that the idea I presented originally was quite clear and thought the execution was also clear 😅

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