Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report❌ Patch coverage is 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. 🚀 New features to boost your workflow:
|
|
| 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%) |
| // 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/'; |
There was a problem hiding this comment.
Unrelated, can we revert? This is a large PR, so I'd prefer any unrelated changes to be separate
| for (const k of Object.keys(allGenerators)) { | ||
| defaults[k] = allGenerators[k].defaultConfiguration ?? {}; | ||
| } |
There was a problem hiding this comment.
You can use Object.entries().forEach
| /** | ||
| * 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, | ||
| > = { |
There was a problem hiding this comment.
I don't think we need this Impl type. We can just type the generators in their functions' JSDoc with Generate and ProcessChunk
| // The resolved type of a generator (now synchronous, not lazy) | ||
| export type ResolvedGenerator<K extends keyof AllGenerators> = AllGenerators[K]; |
There was a problem hiding this comment.
We don't need this type anymore, we can use the way we did it before we lazy loaded anything
|
@avivkeller just do whatever with the PR, I don't have the time/mental availability to address your nitpicks now. |
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.