← ClaudeAtlas

nx-importlisted

Import, merge, or combine repositories into an Nx workspace using nx import. USE WHEN the user asks to adopt Nx across repos, move projects into a monorepo, or bring code/history from another repository.
wahidyankf/ose-primer · ★ 2 · AI & Automation · score 75
Install: claude install-skill wahidyankf/ose-primer
## Quick Start - `nx import` brings code from a source repository or folder into the current workspace, preserving commit history. - After nx `22.6.0`, `nx import` responds with .ndjson outputs and follow-up questions. For earlier versions, always run with `--no-interactive` and specify all flags directly. - Run `nx import --help` for available options. - Make sure the destination directory is empty before importing. EXAMPLE: target has `libs/utils` and `libs/models`; source has `libs/ui` and `libs/data-access` — you cannot import `libs/` into `libs/` directly. Import each source library individually. Primary docs: - https://nx.dev/docs/guides/adopting-nx/import-project - https://nx.dev/docs/guides/adopting-nx/preserving-git-histories Read the nx docs if you have the tools for it. ## Import Strategy **Subdirectory-at-a-time** (`nx import <source> apps --source=apps`): - **Recommended for monorepo sources** — files land at top level, no redundant config - Caveats: multiple import commands (separate merge commits each); dest must not have conflicting directories; root configs (deps, plugins, targetDefaults) not imported - **Directory conflicts**: Import into alternate-named dir (e.g. `imported-apps/`), then rename **Whole repo** (`nx import <source> imported --source=.`): - **Only for non-monorepo sources** (single-project repos) - For monorepos, creates messy nested config (`imported/nx.json`, `imported/tsconfig.base.json`, etc.) - If you must: keep imported `tsconf