nx-import

Import source repositories into Nx workspaces with subdirectory or whole-repo strategies.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the challenges of integrating repositories into an Nx workspace, streamlining the adoption of Nx and facilitating monorepo development.

Core Features & Use Cases

  • Repository Integration: Import repositories into an Nx workspace with support for preserving commit history.
  • Import Strategies: Offers subdirectory and whole-repo import strategies with configuration guidelines.
  • Application vs Library Detection: Automates the identification of applications versus libraries to ensure correct placement in the workspace.
  • Configuration Management: Manages workspace configuration adjustments for imports, including dependencies, plugins, and project references.

Quick Start

Use the nx-import skill to import a new repository into your Nx workspace:

nx import <source> apps/my-app --source=packages/my-app

Frequently Asked Questions about nx-import

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

FAQPage Schema
How do I import an existing repository into an Nx workspace?

To import a repository into an Nx workspace, you use strategies that support bringing in whole repositories or subdirectories while preserving commit history. The process automatically detects applications versus libraries and adjusts workspace configurations accordingly.

What is the difference between subdirectory and whole-repo import strategies in Nx?

Subdirectory and whole-repo import strategies dictate how source repositories are integrated into an Nx workspace. Whole-repo imports the entire project structure, while subdirectory imports target specific project paths, with both approaches providing specific configuration management guidelines.

Do I need TypeScript and Jest to integrate a repository into an Nx monorepo?

Yes, integrating a repository into an Nx monorepo requires Nx and relevant dependencies like TypeScript, ESLint, and Jest to ensure a comprehensive development experience and proper configuration management within the workspace.

How does Nx handle application versus library detection during repository integration?

During repository integration, application versus library detection is automated to ensure correct placement within the Nx workspace. This automatic identification manages workspace configurations, including dependencies, plugins, and project references for the imported code.

Can I preserve commit history when importing a subdirectory into an Nx workspace?

Yes, you can preserve commit history when importing a subdirectory into an Nx workspace. The repository integration supports preserving commit history alongside managing workspace configuration adjustments for the imported source.