The generated spec was using the same import when it should be adapted if `exportDefault` is used:
```ts
import { UserComponent } from './user.component.ts`
```
It now produces:
```ts
import UserComponent from './user.component.ts`
```
`ng g c` no longer generates a component with the `CommonModule` import.
This import is not useful if developers adopt the control flow syntax in their templates.
Instead, developers are encouraged to import the individual directives/pipes if needed.
The defer block support introduces a new asynchronous form of the set class metadata Angular function. This form
is needed to allow for providing metadata for dynamically imported deferred components. The asynchronous compileComponents
call within TestBed is now used to initialize this metadata during unit tests. Unit tests that contain defer blocks
must use this call prior to executing a test to allow templates containing defer to properly render. Existing tests that
do not use the new defer block do not require modification unless the defer block is introduced into components used in
the unit test.
`compileComponents` is not necessary when using the CLI (as the templates are inlined) and just adds boilerplate code. So we can remove it from the test schematic and make it independent from `async/await` (only place we would have it in the CLI generated code, and in most Angular apps).
Allow setting `--style=none` for the component schematic to prevent generation of any style file. Previously this was possible only with `--inlineStyle=true`, which had the side-effect of adding an inline style block to the component decorator. Useful for components or projects which have entirely externalised stylesheets and never want to use component-specific styles.
When generating a new component, if `inlineStyle` and either
`viewEncapsulation` or `changeDetection` flag is provided, there is an
extra comma after `styles: [],,` causing the component to bugged out.
Currently, Component and Class have the options to add custom type. In the case of class, It's already working fine with an empty string in type but in the case of component When setting the type to an empty string the file names generated will contain an extra period (.) which breaks the flow.
With this PR, It will generate the files without an extra period (.)
Reference #16811 and #16891
Most editors remember the indentation, even if you remove all code. This way, there is no
indentation thus there is nothing for the editor to remember and there will be no need for
a HTML lint fix.
Fixes#14816
Currently when using `ivy-ngcc` it will print out a warning
```
Failed to read entry point info from //node_modules/@schematics/angular/workspace/files/package.json with error SyntaxError: Unexpected token < in JSON at position 1121.
```
Fixes#13378
This aligns options that do the same thing:
1) `skipSpecs` and `spec` has been deprecated in favor of `skipTests`.
2) `styleext` has been deprecated in favor of `style` since the latest is two words.
Fixes#12784