Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat(angular): add --project alias, default argv source and example t…
…o move schemas (#2390)
  • Loading branch information
jdpearce committed Jan 28, 2020
1 parent aab5cf9 commit 8c99bc3
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 4 deletions.
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

0 comments on commit 8c99bc3

Please sign in to comment.