Skip to content

feat(monorepo): W3 extract @mirrorbuddy/tier (reversed-shim)#367

Merged
Roberdan merged 2 commits intomainfrom
feat/packages-tier
Apr 23, 2026
Merged

feat(monorepo): W3 extract @mirrorbuddy/tier (reversed-shim)#367
Roberdan merged 2 commits intomainfrom
feat/packages-tier

Conversation

@Roberdan
Copy link
Copy Markdown
Member

Summary

Closes #358. Adds the @mirrorbuddy/tier workspace entry using the reversed-shim pattern introduced in #365, with zero source-file moves.

Approach

The previous partial-extraction attempt moved tier-service et al. into packages/tier/src/ and kept video-vision-{guard,usage-service} at the app layer because their tests mocked ../tier-service — a relative path that stopped intercepting the package-internal ./tier-service after the move.

This PR takes the opposite approach: nothing moves. Canonical impl stays at src/lib/tier/. packages/tier/src/{index,server}.ts just re-export via relative path (../../../src/lib/tier[/server]). Result:

  • Tests mocking @/lib/db, @/lib/logger, ../tier-service, etc. keep working because the canonical modules are exactly where the tests expect them to be.
  • Any future cross-package consumer that imports @mirrorbuddy/tier reaches the same module identity as the tests — mocks propagate transparently.
  • Zero test migration churn.

Wiring

  • packages/tier/package.json — workspace package, exports . and ./server
  • packages/tier/tsconfig.json — extends root tsconfig
  • next.config.tstranspilePackages += '@mirrorbuddy/tier'
  • root package.json@mirrorbuddy/tier: workspace:*
  • pnpm-lock.yaml — regenerated

Verification

  • 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/tier137/137
  • npm run test:unit (full) → 798/802 files pass, 12029/12044 tests — identical to pre-change baseline

Notes

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

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>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
mirrorbuddy Ignored Ignored Preview Apr 23, 2026 8:53pm

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 23, 2026

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 2 package(s) with unknown licenses.
See the Details below.

License Issues

package.json

PackageVersionLicenseIssue Type
@mirrorbuddy/tierworkspace:*NullUnknown License

packages/tier/package.json

PackageVersionLicenseIssue Type
@mirrorbuddy/typesworkspace:*NullUnknown License
Allowed Licenses: MIT, MIT-0, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, 0BSD, Unlicense, CC0-1.0, CC-BY-3.0, CC-BY-4.0, MPL-2.0, Python-2.0, BlueOak-1.0.0, Zlib, AGPL-3.0

OpenSSF Scorecard

PackageVersionScoreDetails
npm/@mirrorbuddy/tier workspace:* UnknownUnknown
npm/@mirrorbuddy/types workspace:* UnknownUnknown
npm/typescript ^5 UnknownUnknown

Scanned Files

  • package.json
  • packages/tier/package.json

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/tier/tsconfig.json Outdated
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>
@Roberdan Roberdan merged commit efa1101 into main Apr 23, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

W3: complete @mirrorbuddy/tier (move video-vision-{guard,usage-service} into package)

1 participant