Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(angular): add --project alias, default argv source and example to move schemas #2390

Merged
merged 1 commit into from Jan 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/angular/api-angular/schematics/move.md
Expand Up @@ -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
Expand All @@ -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
10 changes: 10 additions & 0 deletions docs/angular/api-workspace/schematics/move.md
Expand Up @@ -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
Expand All @@ -36,6 +44,8 @@ The folder to move the project into

### projectName

Alias(es): project

Type: `string`

The name of the project to move
10 changes: 10 additions & 0 deletions docs/react/api-angular/schematics/move.md
Expand Up @@ -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
Expand All @@ -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
10 changes: 10 additions & 0 deletions docs/react/api-workspace/schematics/move.md
Expand Up @@ -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
Expand All @@ -36,6 +44,8 @@ The folder to move the project into

### projectName

Alias(es): project

Type: `string`

The name of the project to move
10 changes: 10 additions & 0 deletions docs/web/api-angular/schematics/move.md
Expand Up @@ -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
Expand All @@ -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
10 changes: 10 additions & 0 deletions docs/web/api-workspace/schematics/move.md
Expand Up @@ -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
Expand All @@ -36,6 +44,8 @@ The folder to move the project into

### projectName

Alias(es): project

Type: `string`

The name of the project to move
2 changes: 1 addition & 1 deletion e2e/move.angular.test.ts
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion e2e/move.workspace.test.ts
Expand Up @@ -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`);
Expand Down
13 changes: 12 additions & 1 deletion packages/angular/src/schematics/move/schema.json
Expand Up @@ -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"]
Expand Down
13 changes: 12 additions & 1 deletion packages/workspace/src/schematics/move/schema.json
Expand Up @@ -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"]
Expand Down