chore: convert to Turborepo monorepo (v2.9.6)#26
Merged
mattapperson merged 6 commits intomainfrom Apr 20, 2026
Merged
Conversation
Move @openrouter/agent into packages/agent/ under a pnpm workspace with Turborepo managing build/test/lint/typecheck task graphs at the root. Release flow now uses `changeset publish`, which walks the workspace and publishes only packages whose on-disk version differs from npm — the pipeline generalizes to multiple packages with no extra wiring. CI splits lint/typecheck/unit/e2e into parallel jobs and skips e2e when OPENROUTER_API_KEY is unset. Root now holds: pnpm-workspace.yaml, turbo.json (v2.9.6 tasks schema), tsconfig.base.json, a private monorepo package.json with hoisted devDeps, and a short monorepo README. The original package README, CHANGELOG, .npmignore, vitest.config.ts, and tsconfig move into packages/agent/. Biome + grit plugins stay at the root; scope globs widened to cover packages/*. Vitest loads a shared root .env.
ac017ff to
b5743a1
Compare
mattapperson
commented
Apr 20, 2026
Collaborator
Author
mattapperson
left a comment
There was a problem hiding this comment.
2 findings: dead workflow step and shared tsconfig not tracked by turbo caches.
robert-j-y
approved these changes
Apr 20, 2026
- Remove dead "Check for pending changesets" step in publish.yaml; nothing reads steps.changesets.outputs.pending anymore. - Add "globalDependencies": ["tsconfig.base.json"] to turbo.json so edits to the shared base tsconfig invalidate build/typecheck/test caches instead of serving stale output.
# Conflicts: # package.json # pnpm-lock.yaml
# Conflicts: # packages/agent/tests/unit/has-approval-tools.test-d.ts # packages/agent/tests/unit/server-tool-stream-narrowing.test-d.ts # packages/agent/tests/unit/server-tool.test.ts
# Conflicts: # package.json
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
@openrouter/agentintopackages/agent/under a pnpm workspace, with Turborepo (2.9.6) managingbuild/test/test:e2e/lint/typechecktask graphs from the root.pnpm exec changeset publishwalks the workspace and publishes only packages whose on-disk version differs from npm — no republishing of unchanged packages and no extra wiring needed to add packages later.packages/*. Shared.envloaded from workspace root by vitest configs.What moved where
New at root:
pnpm-workspace.yaml,turbo.json(v2tasksschema),tsconfig.base.json, a private monorepopackage.jsonwith hoisted devDeps, and a short monorepoREADME.md.Into
packages/agent/:src/,tests/,package.json(trimmed, addspublishConfig.provenance+repository.directory),tsconfig.json(extends base),vitest.config.ts(loads../../.env),README.md,CHANGELOG.md,.npmignore.Unchanged at root:
.changeset/,.grit/,.husky/,biome.json(globs widened only),pnpm-lock.yaml.Release flow (TL;DR)
pnpm changeset.main→ Release workflow opens a "Version Packages" PR (or updates an existing one).changeset publishreleases every package with a consumed changeset to npm with provenance. Unchanged packages stay put.workflow_dispatchstill supports manualversion/publishwith adry-runtoggle (dry-run falls back topnpm -r publish --dry-run— commented in the workflow — sincechangeset publishhas no native--dry-run).CI
Kept the 4 parallel jobs (lint, typecheck, unit-tests, e2e-tests). Root scripts now route through turbo so per-job invocations get the task graph + caching automatically. The e2e job skips with a warning when
OPENROUTER_API_KEYis unset.Test plan
pnpm install— 2 workspace projects detectedpnpm run lint— biome clean (46 files)pnpm run typecheck— clean; cache hit on re-run (FULL TURBO)pnpm run build— emitspackages/agent/esm/pnpm run test— 232/232 unit tests passpnpm exec changeset status— CLI resolves the workspace packagepnpm run test:e2elocally withOPENROUTER_API_KEYsetReleaseworkflow manually withmode: publish,dry-run: true— confirms the set of packagespnpm -rwould publishNotes
"LICENSE"frompackages/agent/package.json#filesbecause no LICENSE file exists in the repo; follow-up to add one..env/.env.*now in.gitignore(kept.env.exampletrackable).publishConfig.provenance: trueadded per-package sochangeset publish→pnpm publishemits npm provenance.@openrouter/sdkrelease coordination note preserved in the workflow; SDK is an external npm dep unchanged by this PR.