Repository navigation
feat(js): @moq/ui is a private workspace package bundled into watch and publish - #8934
Conversation
Quest-Claim: 038f614df7245980
…nd publish @moq/ui is private and never published. @moq/watch and @moq/publish list it under devDependencies; Vite bundles its code and stylesheet, and common/package.ts emits its declarations into dist/bundled/ui and points every import at that copy. A built package that still imports an @moq package it does not depend on fails its build, and deps.ts rejects a published package depending on a private one. The support elements now export the Support base, Report, Status, and Show they are typed with, and each ./support entrypoint's Level is that same declaration. @moq/video exports rotateDimensions (was the @internal rotateVideoDimensions). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 32 minutes. View limit details
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. |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
I reviewed all 3 commits that make @moq/ui a private workspace package that @moq/watch and @moq/publish bundle in both code and declarations.
@moq/uiis private.js/uiis nowprivate: trueat0.0.0, has nobuildorreleasescript, and sits underdevDependenciesin watch and publish. Each package's Viteexternalexcludes exactly@moq/ui. The@import "@moq/ui/stats.css"lines go through Vite's CSS pipeline, not Rollup'sexternal, so the stylesheet is still inlined.- Declarations are bundled generically.
js/common/package.tsrunstscfor any private workspace devDependency that a built.d.tsimports, writes the output todist/bundled/<dir>/, and rewrites each import to a relative path through the bundled package'sexports. - Two new guards.
package.tsfails the build if a shipped.jsor.d.tsimports an@moq/*package that isn't declared. It also fails if a published package lists a private one independenciesorpeerDependencies.deps.tsapplies the same rule todependencies,peerDependencies, andoptionalDependencies, and lets shipped source import a private package only when it is a devDependency. - Support types now ship with each package.
./support/elementin both packages exportsSupport,Report,Status, andShow.Levelin./supportre-exports the shared declaration. Watch gets atest-dtscheck that runs during its build. rotateDimensionsis public in@moq/video. It replacesrotateVideoDimensions, which was@internal. Its parameter and return shapes are written out inline.- Docs and quests cleaned up.
@moq/uiis gone from the JS index, the upgrade list, the TypeDoc package list,js/ui/api/, andjs/ui/MIGRATE.md. The finished quest file is deleted.
Things I checked:
js/ui/srcnever callscustomElements.define, so bundling it into both packages can't define the same element twice on one page.- Every
workspace:devDependency acrossjs/*resolves under the name-to-directory rule inworkspaceDir(). - The bundled
.d.tsfiles import only@moq/signals, which watch and publish both depend on.
claude-opus-5-5 | 𝕏
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed c42ee5c6210aa85ff2f8cc06a309dc697d7fe656. Keeping UI private and bundling from devDependencies is the right boundary. The existing watch/publish package layout and shared Signals import look sound on POSIX.
[P2] Emit platform-independent declaration import paths. js/common/package.ts:136–137 writes the result of native path.relative() directly into a quoted module specifier. On Windows it produces backslashes (for example, ..\\bundled\\ui\\index.js); the generated source then treats \\u as an invalid Unicode escape instead of a path separator. I reproduced the path and parse failure with Node’s path.win32, not a full Windows build. Normalize separators to / before emitting the specifier and test the rewritten declaration from a Windows-style path. If release packaging is POSIX-only by policy, declare and enforce that instead of emitting invalid artifacts.
I did not independently build the packages or inspect published tarballs.
path.relative() returns backslashes on Windows, which broke the quoted module specifier package.ts writes into each rewritten .d.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Fixed in f28fcae the review (OpenAI) finding: (Written by Claude Opus 5.5) |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Head: f28fcaeb30ffa4dc32f4aa60849d0b2bb61f177c
The previous Windows declaration-path issue is fixed. Normalizing the native separator before adding the relative prefix emits ../bundled/ui/index.js on Windows and leaves POSIX output unchanged. No new blocker in this update. A Windows package build or a small specifier regression test would still be useful; I did not run a package build.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
I reviewed the delta since the prior Pullfrog review (c42ee5c), which is one fix commit plus a style commit.
- Windows-safe declaration specifiers. In
js/common/package.ts, the relative path written into rewritten@moq/uiimports is split onsepand rejoined with/. Windows now emits../bundled/ui/index.jsrather than backslashes, and POSIX output is unchanged.
claude-sonnet-5-5 | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The only commit since the last Pullfrog review (f28fcae) merges origin/main into the branch. Compared with the earlier diff, the only new text is in quest/m2/README.md. No code changed.
- Resolved the merge in
quest/m2/README.md. The str0m link now goes to PR #8963, the JS bullet no longer lists the finished@moq/uiquest, and the Bindings bullet matchesmain.
@moq/ui is still listed only in the devDependencies of @moq/watch and @moq/publish. Nothing merged from main adds a new dependency on it.
claude-opus-5-5 | 𝕏

Claims and finishes quest/m2/ui-private.md, deleted here.
Problem
@moq/uiexisted only to share overlay code between@moq/watchand@moq/publish, yet it was a published package: both kept it external and depended on^of its version, so the helpers they took from it (controlButton,graph,statCard, the formatters, ...) were a real cross-package contract hidden behind@internaland outside every API report.@moq/videodid the same withrotateVideoDimensions. The name was never published (404), so nothing outside the repo uses it.Approach
js/uiisprivate: truewith noreleaseorbuildscript, version0.0.0. Watch and publish list it underdevDependencies, and their Viteexternalrules no longer match it, so its code andstats.cssare bundled into each.js/common/package.tsbundles the declarations of any private workspace package listed indevDependencies: if a built.d.tsimports one, it emits that package's declarations intodist/bundled/<dir>/and points each import at the copy. The built@moq/watchand@moq/publishimport nothing from@moq/ui, in code or types.package.tsfails a build whosedist/*.jsor*.d.tsimports an@moq/*package it does not depend on (for example,@moq/uiput back inexternal).common/deps.ts(just js check) rejects a published package that lists a private one independencies,peerDependencies, oroptionalDependencies. Shipped source may import a private package only when it is bundled fromdevDependencies../support/elementin both packages now exports theSupportbase,Report,Status, andShowthat its declarations name. Each./supportentrypoint'sLevelre-exports the shared declaration, replacing its own copy of the same union.@moq/ui's helpers lose their@internaltags, since none of them is published.@moq/videoexportsrotateDimensionsas public API.@moq/uifromdoc/lib/js/index.md,doc/setup/upgrade.md, and the API reference's package list. Deletedjs/ui/api/andjs/ui/MIGRATE.md. The README now says what the package is for inside the workspace.doc/setup/repository.mdstill listsjs/uibecause the code still lives there.Impact
@moq/ui: never published, so no consumer changes.@moq/watch/support/element,@moq/publish/support/element: add exportsSupport(abstractHTMLElementbanner base),Report, andStatus.Showis unchanged. Not breaking.@moq/watch/support,@moq/publish/support:Levelhas the same shape and is now one shared declaration. Not breaking.@moq/video: addsrotateDimensions(dimensions, rotation?). The oldrotateVideoDimensionswas@internal, so it was never public API. Not breaking.Decisions
The maintainer confirmed these decisions on 2026-11-16 (/quest-run):
export default class extends Supportmust nameSupport. The API check rejects a reference to an unexported declaration, soSupport/Report/Statusare exported from./support/element. A side effect is that subclassingSupportfor a custom banner, which@moq/ui's README advertised, is now available from watch or publish. Alternative: make each element extendHTMLElementand own a private banner instead of inheriting one. That keeps the base off the API but repeats theshow/detailsaccessors and callbacks in both packages.rotateDimensions, notrotateVideoDimensions. The quest recommended exporting the existing name. Since the docs import the package asVideo,Video.rotateVideoDimensionsrepeats the namespace, which the API rules forbid. Its parameter and return types are written out as{ width; height }, matching howRendererInput.displaykeepsDimensionsoff the API, so the package gains exactly one export.package.ts, keyed onprivate: trueplus adevDependenciesentry, rather than special-casing@moq/ui. The copy goes todist/bundled/<dir>/becausedist/ui/is already taken by each package's own./uientrypoint.@moq/uiinstalled. Atest-dtscannot hide a workspace package: TypeScript falls back tonode_moduleswhen apathsmapping misses, which I tried. The newtest-dts/support.tsin watch and publish proves that the shipped types can be used: subclassingSupportand assigningShow. Independence from@moq/uiis proven byjs/common/api.ts, which type-checks the declarations in a copy that links only declared dependencies, and by thepackage.tsscan.Validation
just cipasses. That covers every JS package's build with the new dist scan, the API reports,deps.ts, and the doc site with its TypeDoc reference, which now documentsSupportunder eachsupport/elementpage.@moq/uiback in watch'sexternalfails the build withdist/support/element.js: imports @moq/ui, which @moq/watch does not depend on. Moving it back todependenciesfailsdeps.tswithjs/watch/package.json: depends on the private @moq/ui, which only devDependencies may bundle.@moq/watch/support/element,@moq/publish/support/element,@moq/watch/ui, and@moq/publish/uifrom their builtdist/, with@moq/uiunresolvable, plus a customSupportsubclass. In headless Chromium all four elements registered, all three banners rendered their reports and detail tables, and the page logged no errors.sh/size/bundles.tsbefore and after (bytes). Rows other than the script's ownwatch,watch-ui, andpublishcame from a scratch copy with extra entries:@moq/watch/element@moq/watch/element+/ui@moq/publish/element@moq/publish/element+/ui/ui/, sincepath.relative()returns backslashes there. Checked withpath.win32:dist\support\element.d.tsnow points at../bundled/ui/index.js.A single overlay is unchanged:
stats.csswas already inlined at build time. A page loading both overlays now carries the shared code twice, +5.4 KB raw or +152 B brotli, as the quest expected.Follow-ups
None.
Models
Size: M
Implementer: Claude Code, claude-opus-5-5 (iterate, S, arm A)
Implementer: Claude Code, claude-sonnet-5-5 (iterate, M)
🤖 Generated with Claude Code
(Written by Claude Opus 5.5 with medium)
Review
Rewritten by
quest reviewafter each round.Head: 63fd018
Base: origin/main at 72c57ce
Risk: medium,
the base has no RISK.md to name what is always high or customer-facing, so every change is mediumClassified: medium by default
Reviewer: Codex, gpt-6.1-sol, high effort
Session:
01a1e8ad-21d5-7130-904c-844651ab815a, round 1Score: 9/10,
No actionable defects were found; packaging, bundled declarations, and callers appear consistent, but builds and tests were not run as instructed.Rounds: 3; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none