Polyglot Monorepo Patterns
Patterns for managing repositories with multiple language runtimes (Python + TypeScript) under a single root.
Observed Patterns
marcusrbrown/copiloting
marcusrbrown—copiloting is a Python (Poetry) + TypeScript (pnpm) monorepo with independent toolchains:
- Tool version management:
mise.tomlpins Python, Node.js, pnpm, and Poetry versions in one file. Developers runmise installto get the correct versions. - Workspace isolation: pnpm workspaces handle JS/TS packages (
tutorials/,course/pdf-dist/client/). Poetry path dependencies handle Python packages (course/sections/,course/pdf-dist/). No cross-language tooling bridge. - CI path filtering:
dorny/paths-filterdetects which language files changed and skips unaffected build jobs. The Node.js and Python CI jobs run independently. - Dual lockfiles:
pnpm-lock.yamlfor JS/TS,poetry.lockfor Python. Both committed. Renovate manages updates to both. - Convention enforcement: Separate linting/formatting pipelines per language. ESLint + Prettier for JS/TS, pytest for Python. No shared quality tool spans both.
Key Risks
- Version drift: Language-specific deps can drift independently. The JS
langchainversion in copiloting is significantly older than the Python version. - Stale imports: Upgrading deps in lock files without updating application code creates import path mismatches (observed in copiloting’s Python LangChain imports).
- Onboarding complexity: Two package managers, two test runners, two sets of conventions. The
AGENTS.mdpattern helps document this.