link-workspace-packages

Link workspace packages in monorepos using npm, yarn, pnpm, or bun.

11|2|Updated Apr 17, 2023
One-click install
npx skills add https://github.com/Eventiva/Eventiva --skill link-workspace-packages-eventiva
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: link-workspace-packages
Source: https://github.com/Eventiva/Eventiva/tree/main/.cursor/skills/link-workspace-packages
Command: npx skills add https://github.com/Eventiva/Eventiva --skill link-workspace-packages-eventiva

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines dependency management within monorepos by correctly linking sibling packages, resolving common module resolution errors.

Core Features & Use Cases

  • Automated Linking: Uses package manager-specific commands to add dependencies between workspace packages.
  • Error Resolution: Fixes issues like "cannot find module" or "TS2307" that arise from unlinked workspace dependencies.
  • Use Case: After creating a new @org/utils package and importing it into your @org/app package, use this Skill to ensure they are correctly linked by the package manager.

Quick Start

Use the link-workspace-packages skill to add the @org/ui package as a dependency to the @org/app package using pnpm.

Frequently Asked Questions about link-workspace-packages

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I link workspace packages in a monorepo?

To link workspace packages in a monorepo, declare inter-package dependencies and use package manager-specific commands to symlink them. This ensures correct module resolution and automated dependency verification for sibling packages.

Why does my monorepo get a cannot find module error after adding a new package?

A cannot find module error occurs because the workspace dependency is undeclared or unlinked. You must explicitly add the sibling package as a dependency to ensure the package manager correctly symlinks it during module resolution.

Can I use this to link dependencies with pnpm or bun?

Yes, you can link dependencies with pnpm or bun. This approach supports npm, yarn, pnpm, and bun, automatically applying the specific commands each package manager requires to symlink workspace packages.

What is the best way to resolve TS2307 errors in a monorepo architecture?

The best way to resolve TS2307 errors in a monorepo is to ensure sibling packages are correctly linked by the package manager. Automating dependency declaration and symlinking fixes these module resolution errors.

How do I add an internal package as a dependency to another workspace app?

To add an internal package as a dependency to a workspace app, use package manager-specific linking commands to declare the relationship. This symlinks the sibling package and resolves any inter-package module resolution errors.