Skip to content

meta: move generators#616

Open
ovflowd wants to merge 1 commit intomainfrom
meta/move-generators
Open

meta: move generators#616
ovflowd wants to merge 1 commit intomainfrom
meta/move-generators

Conversation

@ovflowd
Copy link
Member

@ovflowd ovflowd commented Feb 19, 2026

This PR moves the generator strategy from lazy load + loading all at entry, to simply having the metadata be synchronous and always exposed and the actual generator implementation to be within a new file of generator.mjs for each generator. This reduces a bit asynchronous overload, separates schema from implementation and also ensures that generator dependencies and code gets initialized only when needed, which solves for now the downstream nodejs/node build.

Copilot AI review requested due to automatic review settings February 19, 2026 16:02
@ovflowd ovflowd requested a review from a team as a code owner February 19, 2026 16:02
@vercel
Copy link

vercel bot commented Feb 19, 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 19, 2026 4:02pm

Request Review

@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

❌ Patch coverage is 18.31470% with 950 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.25%. Comparing base (32a824c) to head (57fe80d).

Files with missing lines Patch % Lines
src/generators/legacy-html/generate.mjs 0.00% 142 Missing ⚠️
src/generators/man-page/generate.mjs 0.00% 84 Missing ⚠️
src/generators/addon-verify/generate.mjs 0.00% 81 Missing ⚠️
src/generators/legacy-json-all/generate.mjs 0.00% 80 Missing ⚠️
src/generators/legacy-html-all/generate.mjs 0.00% 74 Missing ⚠️
src/generators/jsx-ast/generate.mjs 0.00% 67 Missing ⚠️
src/generators/legacy-json/generate.mjs 0.00% 66 Missing ⚠️
src/generators/sitemap/generate.mjs 0.00% 64 Missing ⚠️
src/generators/orama-db/generate.mjs 0.00% 59 Missing ⚠️
src/generators/ast/generate.mjs 0.00% 58 Missing ⚠️
... and 11 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #616      +/-   ##
==========================================
- Coverage   78.62%   72.25%   -6.38%     
==========================================
  Files         128      144      +16     
  Lines       12461    12537      +76     
  Branches      902      872      -30     
==========================================
- Hits         9798     9058     -740     
- Misses       2658     3474     +816     
  Partials        5        5              

☔ 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

orama-db Generator

File Base Head Diff
orama-db.json 8.03 MB 8.03 MB -1.78 KB (-0.02%)

web Generator

File Base Head Diff
styles.css 128.14 KB 128.21 KB +67.00 B (+0.05%)

Comment on lines 5 to 11
// This is the Base URL for viewing a file within GitHub UI
export const GITHUB_BLOB_URL = 'https://github.com/{repository}/blob/{ref}/';
export const GH_BLOB_URL = 'https://github.com/{repository}/blob/{ref}/';

// This is the API docs base URL for editing a file on GitHub UI
// TODO(@avivkeller): specify /doc/api in config
export const GITHUB_EDIT_URL =
export const GH_EDIT_URL =
'https://github.com/{repository}/edit/{ref}/doc/api/';
Copy link
Member

Choose a reason for hiding this comment

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

Unrelated, can we revert? This is a large PR, so I'd prefer any unrelated changes to be separate

Comment on lines +35 to +37
for (const k of Object.keys(allGenerators)) {
defaults[k] = allGenerators[k].defaultConfiguration ?? {};
}
Copy link
Member

Choose a reason for hiding this comment

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

You can use Object.entries().forEach

Copy link
Member

Choose a reason for hiding this comment

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

Unrelated

Comment on lines +102 to +109
/**
* Generator implementation - loaded dynamically from each generator's generate.mjs.
* Contains the generate function and optional processChunk for parallel processing.
*/
export type GeneratorImpl<
G extends Generate<any, any>,
P extends ProcessChunk<any, any, any> | undefined = undefined,
> = {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need this Impl type. We can just type the generators in their functions' JSDoc with Generate and ProcessChunk

Comment on lines +10 to +11
// The resolved type of a generator (now synchronous, not lazy)
export type ResolvedGenerator<K extends keyof AllGenerators> = AllGenerators[K];
Copy link
Member

Choose a reason for hiding this comment

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

We don't need this type anymore, we can use the way we did it before we lazy loaded anything

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@ovflowd
Copy link
Member Author

ovflowd commented Feb 19, 2026

@avivkeller just do whatever with the PR, I don't have the time/mental availability to address your nitpicks now.

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.

2 participants

Comments