fix(monorepo): modern monorepo architecture, eliminate shallow trpc wrapper & fix CLI publish - #7
Open
KitsuneKode wants to merge 1 commit into
Open
KitsuneKode wants to merge 1 commit into
KitsuneKode wants to merge 1 commit into
Conversation
Eliminate shallow @arche-template/trpc package and export tRPC contract directly from @arche-template/server/trpc. Fix workspace glob 'tests/*' to 'tests' in root package.json so @arche-template/tests is included in the workspace graph. Fix CLI template path resolution in web-core.ts after bun build. Move bundled CLI dependencies (@arche-template/registry, zod) to devDependencies for npm publish readiness. Switch CLI package dry-run script from npm pack to bun pm pack. Enforce strict DATABASE_URL requirement in production for packages/store. Add sensible defaults and Vercel skipValidation to clientEnv. Consolidate turbo CI pipeline with streaming UI and root tasks. Remove dead apps/server/env.ts and empty .npmrc. Update documentation and template generators for direct tRPC exports.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 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 |
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 of Architectural Improvements
This PR addresses all 14 findings from our Principal Engineer monorepo audit, restoring clean package boundaries, fixing publish-breaking issues in the CLI, and streamlining the Turborepo CI pipeline.
1. Architectural Cleanup & Inversion Fix
packages/trpc: Removed the zero-value shallow wrapper package and inverted dependency (packages/trpcwas depending onapps/server).apps/web,apps/worker, and integration tests now consume typed contracts directly from@arche-template/server/trpc(AppRouter,createCaller,RouterInputs,RouterOutputs).packages/trpc.2. Workspace Graph & Tooling Fixes
package.jsonworkspaces from"tests/*"to"tests", bringing@arche-template/testsinto the workspace dependency graph.apps/server/env.tsand empty.npmrc.toolings/scripts/repo-doctor.ts,sync-template-agents.ts, andsync-web-core.tsnow resolve repo root relative to module location rather than relying on variable runtimeprocess.cwd().3. CLI Publishing Readiness
apps/cli/src/lib/web-core.tswith a fallback to find template directories both during local development and inside compileddist/bundles.@arche-template/registry,zod) fromdependenciestodevDependenciesso npm consumers don't encounter unresolvableworkspace:*orcatalog:versions.npm packforbun pm packin CLI packaging scripts.apps/cli/teststo prevent executing embedded template stubs.4. Environment Validation & Reliability
packages/store/src/index.tsto strictly requireDATABASE_URLin production while safely allowing standard local dev fallbacks.VERCELskip-validation support inpackages/common/src/env/client.tsandapps/web/env.ts.5. Turborepo & CI Consolidation
turbo.jsonUI mode to"stream"to prevent TUI SIGSEGV crashes in headless/CI environments.testanddb:studiotasks to Turborepo.bun run ciorchestratesformat:check,lint,check-types,test,build,pkg:check, andrepo:doctor:strict.Verification
bun run format:check-> All files formattedbun run lint-> 0 errors across all 14 workspacesbun run check-types-> 12/12 type check tasks passedbun test-> 560+ unit, integration, and scaffold tests passedbun run build-> Next.js, Express, Worker, and CLI bundles built successfullybun run pkg:check->@kitsunekode/archetarball generated cleanly with 466 filesbun run repo:doctor:strict-> 0 errors, 0 warnings