link-workspace-packages

Link workspace packages across npm, yarn, pnpm, and bun monorepos.

1|Updated Aug 21, 2022
One-click install
npx skills add https://github.com/zzk13180/seed --skill link-workspace-packages-zzk13180
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: link-workspace-packages
Source: https://github.com/zzk13180/seed/tree/main/.github/skills/link-workspace-packages
Command: npx skills add https://github.com/zzk13180/seed --skill link-workspace-packages-zzk13180

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill simplifies dependency management within monorepos by automatically linking local packages, resolving common module resolution errors.

Core Features & Use Cases

  • Cross-Package Linking: Establishes dependencies between sibling packages in a monorepo.
  • Package Manager Agnostic: Supports npm, yarn, pnpm, and bun.
  • Error Resolution: Fixes "cannot find module" and similar resolution errors.
  • Use Case: After creating a new UI component package, use this Skill to link it to your main application package, ensuring all internal imports work correctly.

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 fix 'cannot find module' errors for local packages in a monorepo?

To fix 'cannot find module' errors in a monorepo, you need to link workspace packages to resolve internal dependencies. This process establishes symlinks between sibling packages, ensuring correct module resolution and eliminating TS2307 errors during local development.

Can I link workspace dependencies across different package managers?

Yes, you can link workspace dependencies across various package managers including npm, yarn, pnpm, and bun. This cross-package linking capability establishes correct symlinks regardless of your specific package manager, ensuring internal imports work correctly.

What is the best way to add a local UI component as a dependency to my main app?

The best way to add a local UI component as a dependency is by linking the workspace packages. This establishes a direct dependency declaration between sibling packages in your monorepo, ensuring all internal imports resolve correctly without publishing to a registry.

Why does TypeScript throw TS2307 errors for internal monorepo packages?

TypeScript throws TS2307 errors for internal monorepo packages because module resolution fails when local dependencies are not properly linked. By leveraging package manager-specific workspace commands to symlink internal packages, you ensure correct dependency declaration and resolve these errors.

How do I set up symlinks for sibling packages in a monorepo?

To set up symlinks for sibling packages in a monorepo, use package manager-specific workspace commands to link the internal packages. This establishes correct dependency declarations and symlinking, ensuring module resolution succeeds for internal package interdependencies.

Do I need to manually configure module resolution for pnpm workspace links?

No, you do not need to manually configure module resolution for pnpm workspace links. By leveraging package manager-specific workspace commands, the linking process handles symlinking and dependency declaration automatically, resolving module resolution errors seamlessly.