56 Commits

Author SHA1 Message Date
Charles Lyding
fa9bce0e9a test: enable @typescript-eslint/no-unnecessary-type-assertion lint rule
The `@typescript-eslint/no-unnecessary-type-assertion` rule is now enabled and all failures
have been addressed within the code.
2024-06-25 16:57:03 -04:00
Ash Ramirez
434a3740f0 refactor(@angular/cli): update aio links -> adev links
Updates for all angular.io links to the new angular.dev domain. Additionally, adjustment to new resources where the equivalent does not exist on the new site (e.g. Tour of Heroes tutorial)
2024-06-06 11:12:06 +02:00
Charles Lyding
db7f4657ef refactor(@schematics/angular): use built-in POSIX path utilities for module schematic
The use of the custom path functions from `@angular-devkit/core` have been
removed in favor of the built-in functions from Node.js. These provide
equivalent functionality with an improvement in performance. The amount
of custom code executed has also been reduced.
2024-03-11 10:05:28 -04:00
Alan Agius
a1f3ae5799 fix(@schematics/angular): do not generate standalone component when using ng generate module
Adjust the module schematic to always generate non standalone components.

Closes #26700
2023-12-19 16:48:12 +01:00
Alan Agius
ac0db66975 feat(@schematics/angular): enable standalone by default in new applications
This commit update the schematics to generate a standalone application by default.
2023-09-22 16:42:35 +02:00
Alan Agius
ace34b7af3 docs: remove default project from schematic description
The default project is deprecated.
2023-01-03 14:49:19 +00:00
Alan Agius
207358afb8 feat(@angular-devkit/schematics): add runSchematic and runExternalSchematic methods
These async methods are a replacement for the Observable based `runSchematicAsync` and `runExternalSchematicAsync` methods.

DEPRECATED:
The Observable based `SchematicTestRunner.runSchematicAsync` and `SchematicTestRunner.runExternalSchematicAsync` method have been deprecated in favor of the Promise based `SchematicTestRunner.runSchematic` and `SchematicTestRunner.runExternalSchematic`.
2022-12-08 14:49:43 -08:00
Alan Agius
639a3071c3 refactor: migrate analytics collector to use GA4
This change updates the analytics collector collector to use GA4 instead of UA. The motivation behind this change is that UA will stop collecting data in 2023.

BREAKING CHANGE:

`analyticsSharing` option in the global angular configuration has been
removed without replacement. This option was used to configure the Angular CLI to  access to your own users' CLI usage data.

If this option is used, it can be removed using `ng config --global cli.analyticsSharing undefined`.
2022-10-11 18:52:30 +02:00
Alan Agius
d0984148a5 refactor(@schematics/angular): consolidate addDeclarationToNgModule logic
This commits extracts all `addDeclarationToNgModule` logic into a common util which is re-used across a number of schematics.
2022-09-06 19:03:47 +02:00
Alan Agius
57d93fb7d9 fix(@schematics/angular): mark project as required option
While this option is always required it was not marked as such

Closes #23848
2022-09-02 12:24:51 -04:00
Alan Agius
4368c85983 refactor: remove unused local variables 2022-08-12 08:19:26 -04:00
Alan Agius
e995bdad32 fix(@schematics/angular): prevent numbers from class names
With this change we prevent creating classes with invalid characters.

Closes #12868
2022-07-21 19:18:48 -04:00
Alan Agius
9e3152466b fix(@schematics/angular): prevent importing RouterModule parallel to RoutingModule
Prior to this commit, we defined routes in two places example:
```ts
@NgModule({
  declarations: [
    HomeComponent
  ],
  imports: [
    CommonModule,
    RouterModule.forChild(routes),
    HomeRoutingModule
  ]
})
export class HomeModule { }
```

Closes #17139
2022-07-06 16:33:40 +02:00
Alan Agius
e751464ea3 fix(@angular/cli): populate path with working directory in nested schematics
With this change we change the how we handle `"format": "path"` schematic property option. We replace the formatter in favour of a `SmartDefaultProvider`, which ensures that nested schematics can access the `workingDirectory`.
2022-05-24 10:19:30 -07:00
Charles Lyding
a0e3de2b5f refactor(@schematics/angular): use Tree's newly introduced readText and readJSON functionality
Code related to decoding buffers into strings and parsing content into JSON can now be removed by using the
support provided directly from the Tree instance for the executing schematic.
2022-04-26 19:24:55 -04:00
Charles Lyding
291bbffcc9 refactor(@schematics/angular): use string helper re-export from @angular-devkit/schematics
By using the `strings` re-export from `@angular-devkit/schematics` instead of from `@angular-devkit/core`,
the number of imports from `@angular-devkit/core` has been reduced and lowers the direct dependency count
for many of the individual schematics.
2022-04-22 11:31:53 -04:00
Alan Agius
5986befcdc feat(@schematics/angular): remove deprecated options
With this change we removed several deprecated `@schematics/angular` deprecated options.

BREAKING CHANGE:

We removed several deprecated `@schematics/angular` deprecated options.
- `lintFix` have been removed from all schematics. `ng lint --fix` should be used instead.
- `legacyBrowsers` have been removed from the `application` schematics since IE 11 is no longer supported.
- `configuration` has been removed from the `web-worker` as it was unused.
- `target` has been removed from the `service-worker` as it was unused.
2021-07-30 14:26:53 +01:00
Charles Lyding
c1512e4274 build: update files to be eslint compliant
All TypeScript files have been updated to pass the new eslint-based linting checks. eslint compatible disabling comments have also been added in place of the previous tslint comments.
2021-05-03 07:31:02 -04:00
Charles Lyding
37a06a7c37 build: format all files
All files are now formatted using the ng-dev tools via prettier.
2021-04-28 16:05:49 -07:00
Joey Perrott
003854257c build: migrate all file header to use Google LLC rather than Google Inc 2021-04-27 08:35:22 +02:00
Keen Yee Liau
5a57fea36b docs(@schematics/angular): add README and update description in schema
Create README for the package, and add missing description in some schema.
2021-04-19 20:34:35 +02:00
Alan Agius
076ab0f11f refactor: add correct schema keys
With this change
- We replace `id` with `$id`,  this no longer valid in draft-07.
- Replace all `$schemas` to `http://json-schema.org/draft-07/schema`, this is needed to "pin" the schema to `draft-07`.

More information about `draft-07` can be found https://json-schema.org/draft-07/json-schema-release-notes.html
2021-04-13 10:51:12 -04:00
Alan Agius
ba6f546a02 fix(@schematics/angular): add additionalProperties to all schemas 2021-03-10 08:17:50 -06:00
Alan Agius
c99cef7ed6 docs: remove when true, when false from argument descriptions
It's confusing and redundant to use `When true` and `when false` in descriptions for a CLI arguments because specifying false/true is redundant in a command line argument flag and in most cases users will not do it.

Example:
`--foo=true` is the same as `--foo`
`--foo=false` is the same as `--no-foo`
2020-12-08 14:39:23 -05:00
tim_frijters
2dac2ac769 fix(@schematics/angular): Alphabetized import sources within a group 2020-12-01 10:05:02 +01:00
Alan Agius
affaabe6d3 fix(@schematics/angular): remove lint fix default value
Since will remove lintFix usage warnings when the option is set by a default of another schematic.

Example when executing
```
ng generate module customers --route customers --module app.module
```

The lintFix default of the module schematic will be passed down to the component schematic which would cause a warning to be shown.

Closes #19169
2020-10-22 15:48:30 +02:00
Alan Agius
57b63b3a93 refactor(@schematics/angular): deprecate lintFix option
As part of tslint deprecation we are also deprecated the lintFIx option. Users should use `ng lint --fix` directly instead
2020-10-07 11:12:58 -04:00
Sachin Grover
d4198e500b fix(@schematics/angular): consecutive blank lines in routing.module.ts
Fixes: #18220
2020-07-15 12:33:05 -04:00
Alan Agius
47e4111b9f refactor(@schematics/angular): clean up module schematic template 2019-12-03 12:35:04 -08:00
Judy Bogart
805e1a9a47 docs: further clarify module relationship 2019-09-11 10:12:35 -07:00
Judy Bogart
e200d730d4 docs: remove naming comment, clarify declaring module 2019-09-11 10:12:35 -07:00
Judy Bogart
f2cb88572b docs: expand doc for new -route flag in generate module 2019-09-11 10:12:35 -07:00
Alan Agius
fcea2443aa fix(@schematics/angular): lazy loading module generation routing module lookup
Fixes: #15552
2019-09-10 10:09:31 -07:00
Alan
cabf57d3c9 docs(@schematics/angular): improve description of the route parameter 2019-09-10 10:05:16 -07:00
Charles Lyding
5a7b823b28 test: remove use of deprecated synchronous test helper runSchematic 2019-08-08 08:27:31 -07:00
Alan Agius
15ef15e94a style: remove redundant max-line-length disables and fix other lint issues 2019-07-24 19:06:21 -07:00
hawkgs
fdcd1f7546 feat(@schematics/angular): lazy routing module generator
Introduces the lazy routing module generator as part of the existing
module generator.

Feature document:
https://docs.google.com/document/d/1NAJEWTG54cu4kW7XBp0gVadmz-gqJouW2XDs4c9PPJM/edit#heading=h.xgjl2srtytjt
2019-06-26 11:15:58 -07:00
Charles Lyding
ef12a1511b refactor(@schematics/angular): update module to use new workspace rules 2019-04-16 11:23:48 -07:00
Hans Larsen
2e9dc3d252 docs: add analytics dimensions for schematics flags and internal doc
The analytics.md should be kept up to date with the flags.
2019-03-20 15:08:07 -07:00
Alex Eagle
bf1c069f73 refactor(@schematics/angular): drop dependency on TypeScript package
instead, vendor in the two files we actually need.
This reduces our install footprint by 5MB
2019-03-06 11:27:48 -08:00
Charles Lyding
91d457af73 refactor(@schematics/angular): remove redundant branchAndMerge rules 2019-02-13 15:21:37 -08:00
Alan
4718de4dae feat(@schematics/angular): only support known style extentions
Fixes #13149
2019-01-18 11:56:19 -08:00
Alan Agius
36eba0c9fc refactor: use .template suffix for all schematic files
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
2019-01-16 10:29:56 -08:00
Alan Agius
0715beb65c feat(@schematics/angular): add lintFix to several other schematics
At the moment some schematics contain this options for instance the `guard`, `component` etc.. But some others don't such as `module`

Fixes #12894 and Fixes #6272
2018-12-13 15:53:13 -08:00
Alan Agius
e18b912aa7 test: use toContain instead of indexOf 2018-11-14 12:34:49 -08:00
Judy Bogart
ed6e765471
docs: add generation schematics option docs 2018-11-13 13:09:51 -08:00
Alan Agius
a1176986e4 fix(@schematics/angular): order of module properties is inconsistent
Closes #12509
2018-10-31 21:00:34 -07:00
Alan Agius
f52f043e4f docs: update descriptions 2018-10-24 13:11:55 -07:00
clydin
e9a8c3cfa8 feat(@schematics/angular): add prompts for all name options (#12519) 2018-10-10 12:11:12 -07:00
Cédric Exbrayat
5757b21f21 fix(@schematics/angular): remove module test (#11278)
The `module` schematic was generating a useless `module.spec.ts` file.
This commit removes such test.

Fixes #11277
2018-09-20 14:05:47 -07:00