-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(angular): support generating artifacts using options as provided (…
- Loading branch information
1 parent
5740a73
commit c0027de
Showing
19 changed files
with
1,365 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
1 change: 0 additions & 1 deletion
1
packages/angular/src/generators/component/files/__fileName__.__type__.html__tpl__
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
packages/angular/src/generators/component/files/__fileName__.__type__.spec.ts__tpl__
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
packages/angular/src/generators/component/files/__fileName__.html__tpl__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p><%= name %> works!</p> |
22 changes: 22 additions & 0 deletions
22
packages/angular/src/generators/component/files/__fileName__.spec.ts__tpl__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { <%= symbolName %> } from './<%= fileName %>'; | ||
|
||
describe('<%= symbolName %>', () => { | ||
let component: <%= symbolName %>; | ||
let fixture: ComponentFixture<<%= symbolName %>>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
<%= standalone ? 'imports' : 'declarations' %>: [ <%= symbolName %> ] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(<%= symbolName %>); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 1 addition & 7 deletions
8
packages/angular/src/generators/component/lib/validate-options.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,7 @@ | ||
import type { Tree } from '@nx/devkit'; | ||
import { | ||
validatePathIsUnderProjectRoot, | ||
validateProject, | ||
validateStandaloneOption, | ||
} from '../../utils/validations'; | ||
import { validateStandaloneOption } from '../../utils/validations'; | ||
import type { Schema } from '../schema'; | ||
|
||
export function validateOptions(tree: Tree, options: Schema): void { | ||
validateProject(tree, options.project); | ||
validatePathIsUnderProjectRoot(tree, options.project, options.path); | ||
validateStandaloneOption(tree, options.standalone); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.