@nxworker/workspace
Version:
Nx plugin providing generators for managing workspace files, including the move-file generator for safely moving files between projects while updating all imports
56 lines (55 loc) • 2.16 kB
JSON
{
"$schema": "https://json-schema.org/schema",
"$id": "MoveFile",
"title": "Move File Generator",
"description": "Move a file from one Nx project to another and update import paths",
"type": "object",
"properties": {
"file": {
"type": "string",
"description": "Path to the source file relative to workspace root. Supports glob patterns (e.g., '**/*.spec.ts') and comma-separated list to move multiple files at once.",
"$default": {
"$source": "argv",
"index": 0
},
"x-prompt": "What is the source file path (relative to workspace root)?"
},
"project": {
"type": "string",
"description": "Name of the target Nx project",
"x-dropdown": "projects",
"x-prompt": "Which project should the file be moved to?"
},
"projectDirectory": {
"type": "string",
"description": "Optional subdirectory within the target project's base folder (e.g., 'utils' or 'features/auth'). For libraries, files are placed at sourceRoot/lib/<projectDirectory>. For applications, files are placed at sourceRoot/app/<projectDirectory>"
},
"deriveProjectDirectory": {
"type": "boolean",
"description": "Automatically derive the project directory from the source file path. If true, the directory structure from the source project will be preserved in the target project. Cannot be used together with projectDirectory option.",
"default": false
},
"skipExport": {
"type": "boolean",
"description": "Skip adding export to target project's index file",
"default": false
},
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false,
"x-priority": "internal"
},
"allowUnicode": {
"type": "boolean",
"description": "Allow Unicode characters in file path inputs (less safe)",
"default": false
},
"removeEmptyProject": {
"type": "boolean",
"description": "Remove source project(s) if they become empty after moving files (only index file remains)",
"default": false
}
},
"required": ["file", "project"]
}