refactor(core): load generators by import specifier - #958
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 #958 +/- ##
==========================================
+ Coverage 86.63% 88.94% +2.31%
==========================================
Files 195 197 +2
Lines 17938 18106 +168
Branches 1632 1664 +32
==========================================
+ Hits 15540 16105 +565
+ Misses 2392 1994 -398
- Partials 6 7 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
PR SummaryMedium Risk Overview Built-in generators are plain metadata objects (no Configuration resolves targets and loads only the requested generators (plus deps) before merging defaults. Docs and tests follow the new registration model; signature parsing helpers move to Reviewed by Cursor Bugbot for commit 630eee0. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
| File | Main | PR | Change |
|---|---|---|---|
orama-db.json |
8.89 MB | 8.89 MB | +1.20 KB (+0.0%) |
Performance estimate (single CI run)
- Generation time: 16.4% slower (9.01 s → 10.49 s)
- Peak memory: 1.9% lower (1.81 GB → 1.78 GB)
web Generator
Output size: 2 files changed · net 0 B
File size details
| File | Main | PR | Change |
|---|---|---|---|
assets/all-C8_ahR43.js |
22.13 MB | — | -22.13 MB (-100.0%) |
assets/all-CavH_T_o.js |
— | 22.13 MB | +22.13 MB |
Performance estimate (single CI run)
- Generation time: 2.0% slower (73.65 s → 75.13 s)
- Peak memory: 0.1% higher (5.29 GB → 5.29 GB)
ovflowd
left a comment
There was a problem hiding this comment.
Lots of changes, hard to review so rubber stamp SGTM
c8553db to
630eee0
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 46 out of 52 changed files in this pull request and generated no new comments.
Suppressed comments (1)
packages/core/src/generators/loader.mjs:21
resolveGeneratorSpecifier()uses theinoperator to check for shorthand targets. Becauseinalso matches inherited keys (e.g.__proto__,toString), a crafted--targetvalue can resolve to a non-string and causeimport()to throw a confusing TypeError (and can open prototype-pollution style footguns). Use an own-property check instead.
export const resolveGeneratorSpecifier = target => {
if (target in allGenerators) {
return allGenerators[target];
}
Generators are no longer resolved through a static registry.
Now, they're now loaded dynamically by import specifier.
--targetaccepts either a built-in shorthand (web,legacy-html, …) or any import specifier that resolves to a generator module (e.g.some-package/generator,./my-generator.mjs). A generator'sdependsOnfield is likewise now a full import specifier.