diff --git a/docs/angular/api-angular/schematics/move.md b/docs/angular/api-angular/schematics/move.md index 5a7dbd5a1986e..84a2f8faffcd1 100644 --- a/docs/angular/api-angular/schematics/move.md +++ b/docs/angular/api-angular/schematics/move.md @@ -26,6 +26,14 @@ Show what will be generated without writing to disk: ng g move ... --dry-run ``` +### Examples + +Move libs/my-feature-lib to libs/shared/my-feature-lib: + +```bash +ng g @nrwl/angular:move --project my-feature-lib shared/my-feature-lib +``` + ## Options ### destination @@ -36,6 +44,8 @@ The folder to move the Angular project into ### projectName +Alias(es): project + Type: `string` The name of the Angular project to move diff --git a/docs/angular/api-workspace/schematics/move.md b/docs/angular/api-workspace/schematics/move.md index ddd24a04146bd..4d44d0a67b3f1 100644 --- a/docs/angular/api-workspace/schematics/move.md +++ b/docs/angular/api-workspace/schematics/move.md @@ -26,6 +26,14 @@ Show what will be generated without writing to disk: ng g move ... --dry-run ``` +### Examples + +Move libs/my-feature-lib to libs/shared/my-feature-lib: + +```bash +ng g @nrwl/workspace:move --project my-feature-lib shared/my-feature-lib +``` + ## Options ### destination @@ -36,6 +44,8 @@ The folder to move the project into ### projectName +Alias(es): project + Type: `string` The name of the project to move diff --git a/docs/react/api-angular/schematics/move.md b/docs/react/api-angular/schematics/move.md index df6554aac63d8..b5b4a8632cfbc 100644 --- a/docs/react/api-angular/schematics/move.md +++ b/docs/react/api-angular/schematics/move.md @@ -26,6 +26,14 @@ Show what will be generated without writing to disk: nx g move ... --dry-run ``` +### Examples + +Move libs/my-feature-lib to libs/shared/my-feature-lib: + +```bash +nx g @nrwl/angular:move --project my-feature-lib shared/my-feature-lib +``` + ## Options ### destination @@ -36,6 +44,8 @@ The folder to move the Angular project into ### projectName +Alias(es): project + Type: `string` The name of the Angular project to move diff --git a/docs/react/api-workspace/schematics/move.md b/docs/react/api-workspace/schematics/move.md index aaafec73891b2..efd16148a2033 100644 --- a/docs/react/api-workspace/schematics/move.md +++ b/docs/react/api-workspace/schematics/move.md @@ -26,6 +26,14 @@ Show what will be generated without writing to disk: nx g move ... --dry-run ``` +### Examples + +Move libs/my-feature-lib to libs/shared/my-feature-lib: + +```bash +nx g @nrwl/workspace:move --project my-feature-lib shared/my-feature-lib +``` + ## Options ### destination @@ -36,6 +44,8 @@ The folder to move the project into ### projectName +Alias(es): project + Type: `string` The name of the project to move diff --git a/docs/web/api-angular/schematics/move.md b/docs/web/api-angular/schematics/move.md index df6554aac63d8..b5b4a8632cfbc 100644 --- a/docs/web/api-angular/schematics/move.md +++ b/docs/web/api-angular/schematics/move.md @@ -26,6 +26,14 @@ Show what will be generated without writing to disk: nx g move ... --dry-run ``` +### Examples + +Move libs/my-feature-lib to libs/shared/my-feature-lib: + +```bash +nx g @nrwl/angular:move --project my-feature-lib shared/my-feature-lib +``` + ## Options ### destination @@ -36,6 +44,8 @@ The folder to move the Angular project into ### projectName +Alias(es): project + Type: `string` The name of the Angular project to move diff --git a/docs/web/api-workspace/schematics/move.md b/docs/web/api-workspace/schematics/move.md index aaafec73891b2..efd16148a2033 100644 --- a/docs/web/api-workspace/schematics/move.md +++ b/docs/web/api-workspace/schematics/move.md @@ -26,6 +26,14 @@ Show what will be generated without writing to disk: nx g move ... --dry-run ``` +### Examples + +Move libs/my-feature-lib to libs/shared/my-feature-lib: + +```bash +nx g @nrwl/workspace:move --project my-feature-lib shared/my-feature-lib +``` + ## Options ### destination @@ -36,6 +44,8 @@ The folder to move the project into ### projectName +Alias(es): project + Type: `string` The name of the project to move diff --git a/e2e/move.angular.test.ts b/e2e/move.angular.test.ts index bf004d7ed2119..d924e805cd9f2 100644 --- a/e2e/move.angular.test.ts +++ b/e2e/move.angular.test.ts @@ -32,7 +32,7 @@ forEachCli(cli => { */ it('should work for apps', () => { const moveOutput = runCLI( - `generate @nrwl/angular:move --projectName=${app1} --destination=${newPath}` + `generate @nrwl/angular:move --project ${app1} ${newPath}` ); // just check the output diff --git a/e2e/move.workspace.test.ts b/e2e/move.workspace.test.ts index 37dc26ca129a8..74704be810db4 100644 --- a/e2e/move.workspace.test.ts +++ b/e2e/move.workspace.test.ts @@ -48,7 +48,7 @@ forEachCli(cli => { ); const moveOutput = runCLI( - `generate @nrwl/workspace:move --projectName=${lib1}-data-access --destination=shared/${lib1}/data-access` + `generate @nrwl/workspace:move --project ${lib1}-data-access shared/${lib1}/data-access` ); expect(moveOutput).toContain(`DELETE libs/${lib1}/data-access`); diff --git a/packages/angular/src/schematics/move/schema.json b/packages/angular/src/schematics/move/schema.json index 394e5f17b5bcc..d9721794a064c 100644 --- a/packages/angular/src/schematics/move/schema.json +++ b/packages/angular/src/schematics/move/schema.json @@ -4,14 +4,25 @@ "title": "Nx Angular Move", "description": "Move an Angular project to another folder in the workspace", "type": "object", + "examples": [ + { + "command": "g @nrwl/angular:move --project my-feature-lib shared/my-feature-lib", + "description": "Move libs/my-feature-lib to libs/shared/my-feature-lib" + } + ], "properties": { "projectName": { "type": "string", + "alias": "project", "description": "The name of the Angular project to move" }, "destination": { "type": "string", - "description": "The folder to move the Angular project into" + "description": "The folder to move the Angular project into", + "$default": { + "$source": "argv", + "index": 0 + } } }, "required": ["projectName", "destination"] diff --git a/packages/workspace/src/schematics/move/schema.json b/packages/workspace/src/schematics/move/schema.json index 8e017ad6fff2d..87563bed7e406 100644 --- a/packages/workspace/src/schematics/move/schema.json +++ b/packages/workspace/src/schematics/move/schema.json @@ -4,14 +4,25 @@ "title": "Nx Move", "description": "Move a project to another folder in the workspace", "type": "object", + "examples": [ + { + "command": "g @nrwl/workspace:move --project my-feature-lib shared/my-feature-lib", + "description": "Move libs/my-feature-lib to libs/shared/my-feature-lib" + } + ], "properties": { "projectName": { "type": "string", + "alias": "project", "description": "The name of the project to move" }, "destination": { "type": "string", - "description": "The folder to move the project into" + "description": "The folder to move the project into", + "$default": { + "$source": "argv", + "index": 0 + } } }, "required": ["projectName", "destination"]