feat(monorepo): W3 extract @mirrorbuddy/tier (reversed-shim)#367
Merged
feat(monorepo): W3 extract @mirrorbuddy/tier (reversed-shim)#367
Conversation
Closes #358. Adds @mirrorbuddy/tier workspace entry without moving any source files. Canonical impl stays at src/lib/tier/ per the reversed-shim pattern introduced in #365 / CONTRIBUTING-MONOREPO.md §Test-arch. Package entry points re-export via relative paths: - packages/tier/src/index.ts → ../../../src/lib/tier - packages/tier/src/server.ts → ../../../src/lib/tier/server This preserves the module identity that existing unit tests rely on: tests mock '@/lib/db', '../tier-service', etc., and those mocks now propagate transparently to any future cross-package consumer that imports '@mirrorbuddy/tier'. The video-vision-{guard,usage-service} test-mock blocker disappears naturally — nothing moved. Wiring: - next.config.ts transpilePackages += '@mirrorbuddy/tier' - root package.json deps += '@mirrorbuddy/tier': workspace:* - pnpm-lock.yaml regenerated Verification (local): - ci:summary ALL CLEAN - tier suite: 137/137 ✅ - full unit suite: 798/802 files pass, 12029/12044 tests — identical to pre-change baseline Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Dependency ReviewThe following issues were found:
License Issuespackage.json
packages/tier/package.json
OpenSSF Scorecard
Scanned Files
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bf4085b692
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex P1 comment on #367: pnpm --filter @mirrorbuddy/tier typecheck failed with TS6059 because rootDir: ./src excluded the re-exported files under ../../src/lib/tier. Reversed-shim packages need to include the canonical source location too. Drop rootDir; extend include to cover src/lib/tier. Verified: pnpm --filter @mirrorbuddy/tier typecheck now exits 0. ci:summary ALL CLEAN. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #358. Adds the
@mirrorbuddy/tierworkspace entry using the reversed-shim pattern introduced in #365, with zero source-file moves.Approach
The previous partial-extraction attempt moved
tier-serviceet al. intopackages/tier/src/and keptvideo-vision-{guard,usage-service}at the app layer because their tests mocked../tier-service— a relative path that stopped intercepting the package-internal./tier-serviceafter the move.This PR takes the opposite approach: nothing moves. Canonical impl stays at
src/lib/tier/.packages/tier/src/{index,server}.tsjust re-export via relative path (../../../src/lib/tier[/server]). Result:@/lib/db,@/lib/logger,../tier-service, etc. keep working because the canonical modules are exactly where the tests expect them to be.@mirrorbuddy/tierreaches the same module identity as the tests — mocks propagate transparently.Wiring
packages/tier/package.json— workspace package, exports.and./serverpackages/tier/tsconfig.json— extends root tsconfignext.config.ts—transpilePackages += '@mirrorbuddy/tier'package.json—@mirrorbuddy/tier: workspace:*pnpm-lock.yaml— regeneratedVerification
npm run ci:summary→ ALL CLEAN (lint ✅, typecheck ✅, build ✅, unsafe-queries ✅)npm run i18n:check→ PASS (7046 keys × 5 locales)npm run test:unit -- src/lib/tier→ 137/137 ✅npm run test:unit(full) → 798/802 files pass, 12029/12044 tests — identical to pre-change baselineNotes
Documents the reversed-shim policy already landed in #366 /
CONTRIBUTING-MONOREPO.md§Test-arch. Same approach will be used for the remaining W3 extractions (#356, #357, #361, #359, #360 shadcn).🤖 Generated with Claude Code