Effect ts monorepo with turbo and subpath exports
Skill kjuhwa/skills-hub/skills/monorepo/effect-ts-monorepo-with-turbo-and-subpath-exports
Organize effect-based services in a monorepo using Turbo task pipelines and explicit subpath exports instead of barrel indexesFrom its SKILL.md
npx -y skills add kjuhwa/skills-hub --skill effect-ts-monorepo-with-turbo-and-subpath-exportsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.2 KB, 443 tokens by cl100k_base, as published. Nobody here has run it
When to Apply
- You have 4+ packages in a Bun/Node monorepo with Effect.ts services
- You want to avoid barrel index files (e.g.,
index.tsexporting everything) - You need lazy-loading and want to control import surface area per package
- You're using Turbo for task orchestration and need deterministic builds
Steps
- Structure as
apps/{server,web,desktop}andpackages/{contracts,shared,client-runtime} - In
packages/*/package.json, defineexportswith subpath mappings:{ "exports": { "./git": "./dist/git.js", "./DrainableWorker": "./dist/DrainableWorker.js" } } - Each subpath is a separate file, not re-exported from
index.ts - Consumers import explicitly:
import { GitCore } from '@t3tools/shared/git' - In
package.jsonroot, definecatalogwith common dependency versions (effect, typescript, etc.) - Use
overridesto enforce catalog versions across workspace - Define
turbo.jsonwith task dependency DAG:build -> test,typecheckin parallel - Add
bunaspackageManagerand pin versions inengines
Example
{
"workspaces": { "packages": ["apps/*", "packages/*"] },
"catalog": { "effect": "4.0.0-beta.45", "typescript": "^5.7.3" },
"overrides": { "effect": "catalog:", "typescript": "catalog:" },
"packageManager": "[email protected]"
}
Counter / Caveats
- Subpath exports require explicit
package.jsonmaintenance per file - Bundler/TypeScript LSP may not resolve subpaths in dev; test early
- Turbo cache can become stale if tasks mutate inputs; use immutable inputs/outputs
- Catalog overrides may conflict with transitive deps; audit carefully
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.