link-workspace-packages

Automate dependency linking between workspace packages in monorepos.

Updated Jul 22, 2023
One-click install
npx skills add https://github.com/ValerianGuivarch/lsr-nestjs-backend --skill link-workspace-packages-valerianguivarch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: link-workspace-packages
Source: https://github.com/ValerianGuivarch/lsr-nestjs-backend/tree/main/.opencode/skills/link-workspace-packages
Command: npx skills add https://github.com/ValerianGuivarch/lsr-nestjs-backend --skill link-workspace-packages-valerianguivarch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

The Skill solves the problem of managing dependencies in monorepos across different package managers (npm, yarn, pnpm, bun), by providing a clear, automated method to link packages with minimal errors.

Core Features & Use Cases

  • Dependency Linking: Automates the process of linking packages between different workspace packages.
  • Supports Multiple Package Managers: Functions with npm, yarn, pnpm, and bun.
  • Resolution Errors: Helps fix common issues like "cannot find module" or "failed to resolve import".

Quick Start

To link the 'ui' package to the 'app' package in a monorepo using pnpm, execute: pnpm add @org/ui --filter @org/app --workspace

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 fix failed to resolve import errors?

To fix failed to resolve import errors in a monorepo, you need to link workspace packages using your package manager's workspace filter commands. This ensures local packages are correctly referenced and resolved.

Does this dependency linking automation work with pnpm and yarn workspaces?

Yes, the dependency linking automation works with pnpm and yarn workspaces, alongside npm and bun. It functions across multiple package managers to resolve imports in complex project structures.

What is the best way to automate dependency linking across different package managers in a monorepo?

Automating dependency linking across different package managers in a monorepo requires a unified script approach that maps local packages correctly. This minimizes manual errors and resolves cross-package imports automatically.

How to link a specific UI package to an app package using pnpm in a monorepo?

To link a specific UI package to an app package using pnpm in a monorepo, execute the command `pnpm add @org/ui --filter @org/app --workspace`. This directly links the local package.

Why does my monorepo show cannot find module errors after linking workspace packages?

If your monorepo shows cannot find module errors after linking workspace packages, it indicates incorrect package resolution or missing references. Automated linking ensures packages are correctly referenced to prevent this.