Repository navigation
refactor(do): drop the unconsumed shard-engine re-exports - #362
Conversation
The barrel froze 275 shard-engine names into this package's public surface; only 55 have a consumer (repo import sites plus the codegen emitter's import builders). Delete the other 234 — every one of them is still exported by @lunora/shard-engine, which is where to import it from. Plan 286's phase A deprecated them for one alpha cycle, but packem's dts bundler merges same-specifier re-exports and drops their JSDoc, so the @deprecated markers never reached dist and no consumer was ever warned. On a pre-release branch the convention is to cut the old path, so the cycle is skipped and the removal lands as one breaking change. Phase A's kept set was three names short: its derivation scanned only @lunora/do import sites (missing lunorash/do, which apps/playground's generated shard uses for WhereInput) and read buildDoTypeImports without the conditional pushes below it — WhereInput for projects with shapes, ExternalSourceLike and SourceClientLike for .source() tables. All three are kept and annotated with their emitter line. BREAKING CHANGE: @lunora/do no longer re-exports the 234 @lunora/shard-engine symbols that had no consumer (lunorash/do mirrors the same removal). Import them from @lunora/shard-engine instead; the names and signatures are unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KBeSX2o4sTCPjVDRDWkVQG
✅ Deploy Preview for lunorash ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Thank you for following the naming conventions! 🙏 |
|
Thank you for confirming the Contributor License Agreement! 🙏 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Walkthrough
ChangesExport boundary
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/do/src/index.ts (1)
42-47: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winAlign the removal counts in the comments and the PR description.
Line 46 states 237 removed names. Line 44 states 230 unused names. The PR description states 234 removed re-exports. These three numbers conflict. Use one verified count, or drop the exact number and describe the rule only.
📝 Proposed comment fix
-// Every re-export below must have a named consumer (the codegen emitter's -// import builders, or an import site in this repo). Additions require one; -// drive-by re-exports are how 230 unused names got frozen here (plan 286). -// -// The 237 that had no consumer were removed; everything they named is still -// exported by `@lunora/shard-engine`, which is where to import it from. +// Every re-export below must have a named consumer (the codegen emitter's +// import builders, or an import site in this repo). Additions require one; +// drive-by re-exports are how unused names got frozen here (plan 286). +// +// Re-exports without a consumer were removed; everything they named is still +// exported by `@lunora/shard-engine`, which is where to import it from.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/do/src/index.ts` around lines 42 - 47, Update the explanatory comments around the re-export list to use one verified removal count consistently with the PR description, or remove the exact counts and retain only the named-consumer rule. Do not change the re-export behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@packages/do/src/index.ts`:
- Around line 42-47: Update the explanatory comments around the re-export list
to use one verified removal count consistently with the PR description, or
remove the exact counts and retain only the named-consumer rule. Do not change
the re-export behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: e04d126b-cd18-411c-b61b-bd13d494bb09
⛔ Files ignored due to path filters (4)
api-snapshots/do.api.mdis excluded by none and included by noneapi-snapshots/lunora.api.mdis excluded by none and included by noneplans/286-do-reexport-barrel.mdis excluded by none and included by noneplans/README.mdis excluded by none and included by none
📒 Files selected for processing (1)
packages/do/src/index.ts
Merging this PR will regress 1 benchmark
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | findMany — plain table (no scope) |
77.8 ms | 87.9 ms | -11.43% |
| ⚡ | 1 after-insert no-op trigger |
473.8 µs | 415.9 µs | +13.94% |
| ⚡ | baseline (Object.keys + toInternal + path spread per field) |
71.7 µs | 65.1 µs | +10.11% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing refactor/286-do-barrel-deletion (7302fc0) with alpha (b179c06)
Footnotes
-
10 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## alpha #362 +/- ##
========================================
Coverage ? 87.08%
========================================
Files ? 1170
Lines ? 63259
Branches ? 15621
========================================
Hits ? 55087
Misses ? 7651
Partials ? 521
🚀 New features to boost your workflow:
|
The ingest-bridge snippet imported it from `@lunora/do`, which no longer re-exports it; the docs build's import check fails on it. The symbol lives in `@lunora/shard-engine` — point the snippet and the module JSDoc there. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KBeSX2o4sTCPjVDRDWkVQG
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
@lunora/do's barrel froze 275@lunora/shard-enginenames into this package'spublic surface. Only 55 have a consumer — repo import sites plus the codegen
emitter's import builders. This deletes the other 234. Every one of them is
still exported by
@lunora/shard-engine, which is where to import it from.do.api.mdgoes 311 → 77 entries;lunora.api.mdloses the same set, sincelunorash/dois anexport *mirror.Why now, instead of after the deprecation cycle
The earlier phase deprecated these for one alpha cycle. That cycle can't deliver
its signal: packem's dts bundler merges same-specifier re-exports and drops their
leading comments, so 57
@deprecatedmarkers in source became 1 indist(andthat 1 is a pre-existing, unrelated alias). Consumers resolve through
dist, inrepo and from npm — nobody was ever going to see a strikethrough.
Waiting another cycle buys calendar time and no warning. On a pre-release branch
the convention is to cut the old path rather than keep a shim alive, so the
removal lands as one deliberate breaking change with release notes.
Fixing the bundler instead is a real option, just not this PR: the dts step is
@visulima/rollup-plugin-dts, and the drop reproduces under both itsoxcandtscgenerators, so it is the bundling step rather than isolated declarations.Every same-specifier re-export is merged into one combined
export { … } fromand the leading comments go with the merge; JSDoc on a declaration survives. That
is worth fixing upstream on its own merits, but it does not change what to do
with 234 re-exports that no consumer wants.
The kept set was three names short
Worth a look from a reviewer — deleting the block as it stood would have broken
generated code:
@lunora/doimport sites, so it missedlunorash/do.apps/playground/lunora/_generated/shard.ts:4importsWhereInputfrom there.buildDoTypeImportsbut not the two conditional pushes below it:emit.ts:4204addsWhereInputwhen a project declares shapes, and:4300emits
ExternalSourceLike+SourceClientLikefor.source()tables.All three sat in the deprecated block. They're kept now, annotated with the
emitter lines that demand them. The final 55-name demand set is asserted present
in the regenerated snapshot rather than eyeballed.
The enforcement comment atop the block stays: a re-export here needs a named
consumer, and drive-by additions are how 230 unused names got frozen in the
first place.
Verification
build:packageslint:types(repo)api-snapshot check@lunora/dotests@lunora/runtimetests@lunora/codegentestslunorashtests@lunora/doeslintNo
_generatedoutput changed, and nothing outsidepackages/do/src/index.ts,the two snapshots, and the plan index was touched.
Breaking change
@lunora/do(andlunorash/do) no longer re-export the 234 shard-engine symbolsthat had no consumer. Import them from
@lunora/shard-engine; names andsignatures are unchanged.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KBeSX2o4sTCPjVDRDWkVQG
Summary by CodeRabbit
Refactor
Documentation